fork of hey-api/openapi-ts because I need some additional things

Merge pull request #2819 from hey-api/refactor/absolute-paths

refactor: use absolute paths

authored by

Lubos and committed by
GitHub
7532f227 72a79ccb

+1801 -1212
+233
eslint-rules/local-paths.js
··· 1 + import path from 'node:path'; 2 + 3 + function normalize(p) { 4 + return p.split(path.sep).join('/'); 5 + } 6 + 7 + function stripExtAndIndex(p) { 8 + return p 9 + .replace(/(\/index)?\.(ts|tsx|js|cjs|mjs|d\.ts)$/, '') 10 + .replace(/\/index$/, ''); 11 + } 12 + 13 + /** 14 + * Single consolidated rule implementing the previous three behaviors: 15 + * - plugins: allow relative within same plugin (plugin may be @scope/name), else require `~` 16 + * - openApi: allow relative only within same first-level openApi folder, else require `~` 17 + * - first-level folders: allow relative only within same first-level folder, else require `~` 18 + */ 19 + const enforceLocalPaths = { 20 + create(context) { 21 + const filename = context.getFilename(); 22 + if (!filename || filename === '<input>') return {}; 23 + 24 + const normalizedFile = normalize(filename); 25 + const srcMarker = '/packages/openapi-ts/src/'; 26 + const srcIdx = normalizedFile.indexOf(srcMarker); 27 + if (srcIdx === -1) return {}; 28 + 29 + const after = normalizedFile.slice(srcIdx + srcMarker.length); 30 + const parts = after.split('/'); 31 + const firstLevel = parts[0]; 32 + 33 + // helpers and mode-specific roots 34 + // compute the absolute normalized bundle root for accurate comparisons 35 + let bundleAbsRoot = 36 + normalizedFile.slice(0, srcIdx + srcMarker.length) + 37 + 'plugins/@hey-api/client-core/bundle/'; 38 + bundleAbsRoot = normalize(bundleAbsRoot); 39 + 40 + let mode = 'first-level'; 41 + let pluginAbsRoot = null; 42 + let openApiFirstRoot = null; 43 + let firstRoot = null; 44 + 45 + if (firstLevel === 'plugins') { 46 + mode = 'plugins'; 47 + // derive plugin folder (support scoped plugin names) 48 + let pluginFolder = parts[1] || ''; 49 + if (pluginFolder.startsWith('@') && parts.length > 2) { 50 + pluginFolder = `${pluginFolder}/${parts[2]}`; 51 + } 52 + pluginAbsRoot = 53 + normalizedFile.slice(0, srcIdx + srcMarker.length) + 54 + `plugins/${pluginFolder}/`; 55 + pluginAbsRoot = normalize(pluginAbsRoot); 56 + } else if (firstLevel === 'openApi') { 57 + mode = 'openApi'; 58 + const apiFirst = parts[1] || ''; 59 + openApiFirstRoot = 60 + normalizedFile.slice(0, srcIdx + srcMarker.length) + 61 + `openApi/${apiFirst}/`; 62 + openApiFirstRoot = normalize(openApiFirstRoot); 63 + } else { 64 + firstRoot = 65 + normalizedFile.slice(0, srcIdx + srcMarker.length) + `${firstLevel}/`; 66 + firstRoot = normalize(firstRoot); 67 + } 68 + 69 + function resolveFromBasedir(basedir, sourceValue) { 70 + try { 71 + return path.resolve(basedir, sourceValue); 72 + } catch { 73 + return null; 74 + } 75 + } 76 + 77 + function resolveTildeToAbs(sourceValue) { 78 + const rest = sourceValue.replace(/^~\/?/, ''); 79 + return path.resolve(process.cwd(), 'packages/openapi-ts/src', rest); 80 + } 81 + 82 + function toTilde(resolvedAbsolutePath) { 83 + const normalized = normalize(resolvedAbsolutePath); 84 + const marker = '/packages/openapi-ts/src/'; 85 + const i = normalized.indexOf(marker); 86 + if (i === -1) return null; 87 + let rest = normalized.slice(i + marker.length); 88 + rest = stripExtAndIndex(rest); 89 + return `~/${rest}`; 90 + } 91 + 92 + function reportReplaceWithTilde(node, sourceValue, message) { 93 + const basedir = path.dirname(filename); 94 + const resolved = resolveFromBasedir(basedir, sourceValue); 95 + if (!resolved) return; 96 + const newImport = toTilde(resolved); 97 + if (!newImport) return; 98 + context.report({ 99 + fix(fixer) { 100 + return fixer.replaceText(node.source, `'${newImport}'`); 101 + }, 102 + message, 103 + node: node.source, 104 + }); 105 + } 106 + 107 + function reportReplaceWithRelative(node, sourceValue, message) { 108 + const resolved = resolveTildeToAbs(sourceValue); 109 + if (!resolved) return; 110 + let relativePath = path 111 + .relative(path.dirname(filename), resolved) 112 + .split(path.sep) 113 + .join('/'); 114 + relativePath = stripExtAndIndex(relativePath); 115 + if (!relativePath.startsWith('.')) relativePath = `./${relativePath}`; 116 + context.report({ 117 + fix(fixer) { 118 + return fixer.replaceText(node.source, `'${relativePath}'`); 119 + }, 120 + message, 121 + node: node.source, 122 + }); 123 + } 124 + 125 + function shouldRewriteRelative(sourceValue) { 126 + if (typeof sourceValue !== 'string') return false; 127 + if (!sourceValue.startsWith('.')) return false; 128 + const basedir = path.dirname(filename); 129 + const resolved = resolveFromBasedir(basedir, sourceValue); 130 + if (!resolved) return false; 131 + const nr = normalize(resolved); 132 + if (!nr.includes('/packages/openapi-ts/src/')) return false; 133 + 134 + if (mode === 'plugins') { 135 + if (nr.startsWith(pluginAbsRoot)) return false; // inside same plugin -> keep relative 136 + if (nr.startsWith(bundleAbsRoot)) return false; // client-core bundle: keep relative 137 + return true; 138 + } 139 + 140 + if (mode === 'openApi') { 141 + // if target is inside same first-level openApi folder -> don't rewrite 142 + if (nr.startsWith(openApiFirstRoot)) return false; 143 + // only rewrite if target is inside openApi at all 144 + return nr.includes('/packages/openapi-ts/src/openApi/'); 145 + } 146 + 147 + // generic first-level folder rule 148 + if (nr.startsWith(firstRoot)) return false; 149 + return true; 150 + } 151 + 152 + function shouldRewriteTilde(sourceValue) { 153 + if (typeof sourceValue !== 'string') return false; 154 + if (!sourceValue.startsWith('~')) return false; 155 + const resolved = resolveTildeToAbs(sourceValue); 156 + if (!resolved) return false; 157 + const nr = normalize(resolved); 158 + 159 + if (mode === 'plugins') { 160 + // prefer relative imports for same-plugin targets or for the shared client-core bundle 161 + return nr.startsWith(pluginAbsRoot) || nr.startsWith(bundleAbsRoot); 162 + } 163 + if (mode === 'openApi') { 164 + return nr.startsWith(openApiFirstRoot); 165 + } 166 + return nr.startsWith(firstRoot); 167 + } 168 + 169 + return { 170 + ExportAllDeclaration(node) { 171 + const sourceValue = node.source && node.source.value; 172 + if (shouldRewriteRelative(sourceValue)) { 173 + reportReplaceWithTilde( 174 + node, 175 + sourceValue, 176 + 'Prefer `~` export for cross-boundary exports (autofixable).', 177 + ); 178 + return; 179 + } 180 + if (shouldRewriteTilde(sourceValue)) { 181 + reportReplaceWithRelative( 182 + node, 183 + sourceValue, 184 + 'Prefer relative export for intra-boundary targets (autofixable).', 185 + ); 186 + return; 187 + } 188 + }, 189 + ImportDeclaration(node) { 190 + const sourceValue = node.source && node.source.value; 191 + if (shouldRewriteRelative(sourceValue)) { 192 + reportReplaceWithTilde( 193 + node, 194 + sourceValue, 195 + 'Prefer `~` import for cross-boundary imports (autofixable).', 196 + ); 197 + return; 198 + } 199 + if (shouldRewriteTilde(sourceValue)) { 200 + reportReplaceWithRelative( 201 + node, 202 + sourceValue, 203 + 'Prefer relative import for intra-boundary targets (autofixable).', 204 + ); 205 + return; 206 + } 207 + }, 208 + }; 209 + }, 210 + meta: { 211 + docs: { 212 + description: 213 + 'Enforce local import path boundaries for openapi-ts sources', 214 + recommended: false, 215 + }, 216 + fixable: 'code', 217 + schema: [], 218 + type: 'suggestion', 219 + }, 220 + }; 221 + 222 + export default { 223 + configs: { 224 + recommended: { 225 + rules: { 226 + 'local-paths/enforce-local-paths': 'error', 227 + }, 228 + }, 229 + }, 230 + rules: { 231 + 'enforce-local-paths': enforceLocalPaths, 232 + }, 233 + };
+4
eslint.config.js
··· 8 8 import globals from 'globals'; 9 9 import tseslint from 'typescript-eslint'; 10 10 11 + import pluginLocalPaths from './eslint-rules/local-paths.js'; 12 + 11 13 export default tseslint.config( 12 14 eslint.configs.recommended, 13 15 ...tseslint.configs.recommended, 16 + pluginLocalPaths.configs.recommended, 14 17 { 15 18 languageOptions: { 16 19 ecmaVersion: 'latest', ··· 19 22 }, 20 23 }, 21 24 plugins: { 25 + 'local-paths': pluginLocalPaths, 22 26 'simple-import-sort': pluginSimpleImportSort, 23 27 'sort-destructure-keys': pluginSortDestructureKeys, 24 28 'sort-keys-fix': pluginSortKeysFix,
+1 -1
packages/openapi-ts-tests/main/test/openapi-ts.config.ts
··· 275 275 // mutationOptions: { 276 276 // name: '{{name}}MO', 277 277 // }, 278 - // name: '@tanstack/react-query', 278 + name: '@tanstack/react-query', 279 279 // queryKeys: { 280 280 // name: '{{name}}QK', 281 281 // },
+11 -3
packages/openapi-ts-tests/main/vitest.config.ts
··· 1 + import path from 'node:path'; 1 2 import { fileURLToPath } from 'node:url'; 2 3 3 4 import { createVitestConfig } from '@config/vite-base'; 4 5 5 - export default createVitestConfig( 6 - fileURLToPath(new URL('./', import.meta.url)), 7 - ); 6 + const rootDir = fileURLToPath(new URL('./', import.meta.url)); 7 + 8 + export default createVitestConfig(rootDir, { 9 + resolve: { 10 + alias: [ 11 + { find: /^~\/(.*)/, replacement: path.resolve(rootDir, 'src/$1') }, 12 + { find: '~', replacement: path.resolve(rootDir, 'src') }, 13 + ], 14 + }, 15 + });
+11 -3
packages/openapi-ts-tests/zod/v3/vitest.config.ts
··· 1 + import path from 'node:path'; 1 2 import { fileURLToPath } from 'node:url'; 2 3 3 4 import { createVitestConfig } from '@config/vite-base'; 4 5 5 - export default createVitestConfig( 6 - fileURLToPath(new URL('./', import.meta.url)), 7 - ); 6 + const rootDir = fileURLToPath(new URL('./', import.meta.url)); 7 + 8 + export default createVitestConfig(rootDir, { 9 + resolve: { 10 + alias: [ 11 + { find: /^~\/(.*)/, replacement: path.resolve(rootDir, 'src/$1') }, 12 + { find: '~', replacement: path.resolve(rootDir, 'src') }, 13 + ], 14 + }, 15 + });
+11 -3
packages/openapi-ts-tests/zod/v4/vitest.config.ts
··· 1 + import path from 'node:path'; 1 2 import { fileURLToPath } from 'node:url'; 2 3 3 4 import { createVitestConfig } from '@config/vite-base'; 4 5 5 - export default createVitestConfig( 6 - fileURLToPath(new URL('./', import.meta.url)), 7 - ); 6 + const rootDir = fileURLToPath(new URL('./', import.meta.url)); 7 + 8 + export default createVitestConfig(rootDir, { 9 + resolve: { 10 + alias: [ 11 + { find: /^~\/(.*)/, replacement: path.resolve(rootDir, 'src/$1') }, 12 + { find: '~', replacement: path.resolve(rootDir, 'src') }, 13 + ], 14 + }, 15 + });
+1 -1
packages/openapi-ts/src/__tests__/createClient.test.ts
··· 1 1 import { describe, expect, it } from 'vitest'; 2 2 3 - import { compileInputPath } from '../createClient'; 3 + import { compileInputPath } from '~/createClient'; 4 4 5 5 describe('compileInputPath', () => { 6 6 it('with raw OpenAPI specification', () => {
+1 -1
packages/openapi-ts/src/__tests__/error.test.ts
··· 1 1 import { describe, expect, it, vi } from 'vitest'; 2 2 3 - import { shouldReportCrash } from '../error'; 3 + import { shouldReportCrash } from '~/error'; 4 4 5 5 describe('shouldReportCrash', () => { 6 6 it('should return false when isInteractive is false', async () => {
+1 -1
packages/openapi-ts/src/__tests__/index.test.ts
··· 1 1 import { describe, expect, it } from 'vitest'; 2 2 3 - import { createClient } from '../index'; 3 + import { createClient } from '~/index'; 4 4 5 5 type Config = Parameters<typeof createClient>[0]; 6 6
+3 -3
packages/openapi-ts/src/__tests__/interactive.test.ts
··· 1 1 import { afterEach, describe, expect, it } from 'vitest'; 2 2 3 - import { detectInteractiveSession, initConfigs } from '../config/init'; 4 - import { mergeConfigs } from '../config/merge'; 5 - import { Logger } from '../utils/logger'; 3 + import { detectInteractiveSession, initConfigs } from '~/config/init'; 4 + import { mergeConfigs } from '~/config/merge'; 5 + import { Logger } from '~/utils/logger'; 6 6 7 7 describe('interactive config', () => { 8 8 it('should use detectInteractiveSession when not provided', async () => {
+2 -1
packages/openapi-ts/src/config/__tests__/input.test.ts
··· 1 1 import { describe, expect, it } from 'vitest'; 2 2 3 - import type { UserConfig } from '../../types/config'; 3 + import type { UserConfig } from '~/types/config'; 4 + 4 5 import { getInput } from '../input'; 5 6 6 7 describe('input config', () => {
+1 -1
packages/openapi-ts/src/config/engine.ts
··· 1 - import { ConfigError } from '../error'; 1 + import { ConfigError } from '~/error'; 2 2 3 3 export const checkNodeVersion = () => { 4 4 if (typeof Bun !== 'undefined') {
+6 -5
packages/openapi-ts/src/config/init.ts
··· 2 2 3 3 import colors from 'ansi-colors'; 4 4 5 - import { ConfigError } from '../error'; 6 - import type { Config, UserConfig } from '../types/config'; 7 - import type { ArrayOnly } from '../types/utils'; 8 - import { isLegacyClient, setConfig } from '../utils/config'; 9 - import type { Logger } from '../utils/logger'; 5 + import { ConfigError } from '~/error'; 6 + import type { Config, UserConfig } from '~/types/config'; 7 + import type { ArrayOnly } from '~/types/utils'; 8 + import { isLegacyClient, setConfig } from '~/utils/config'; 9 + import type { Logger } from '~/utils/logger'; 10 + 10 11 import { getInput } from './input'; 11 12 import { getLogs } from './logs'; 12 13 import { mergeConfigs } from './merge';
+4 -4
packages/openapi-ts/src/config/input.ts
··· 1 - import type { Config, UserConfig } from '../types/config'; 2 - import type { Input, Watch } from '../types/input'; 3 - import { inputToApiRegistry } from '../utils/input'; 4 - import { heyApiRegistryBaseUrl } from '../utils/input/heyApi'; 1 + import type { Config, UserConfig } from '~/types/config'; 2 + import type { Input, Watch } from '~/types/input'; 3 + import { inputToApiRegistry } from '~/utils/input'; 4 + import { heyApiRegistryBaseUrl } from '~/utils/input/heyApi'; 5 5 6 6 const defaultWatch: Watch = { 7 7 enabled: false,
+1 -1
packages/openapi-ts/src/config/logs.ts
··· 1 - import type { Config, UserConfig } from '../types/config'; 1 + import type { Config, UserConfig } from '~/types/config'; 2 2 3 3 export const getLogs = ( 4 4 userConfig: Pick<UserConfig, 'logs'> | undefined,
+1 -1
packages/openapi-ts/src/config/merge.ts
··· 1 - import type { UserConfig } from '../types/config'; 1 + import type { UserConfig } from '~/types/config'; 2 2 3 3 const mergeObjects = ( 4 4 objA: Record<string, unknown> | undefined,
+3 -2
packages/openapi-ts/src/config/output.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { findTsConfigPath, loadTsConfig } from '../generate/tsConfig'; 4 - import type { Config, UserConfig } from '../types/config'; 3 + import { findTsConfigPath, loadTsConfig } from '~/generate/tsConfig'; 4 + import type { Config, UserConfig } from '~/types/config'; 5 + 5 6 import { valueToObject } from './utils/config'; 6 7 7 8 export const getOutput = (userConfig: UserConfig): Config['output'] => {
+2 -1
packages/openapi-ts/src/config/parser.ts
··· 1 - import type { Config, UserConfig } from '../types/config'; 1 + import type { Config, UserConfig } from '~/types/config'; 2 + 2 3 import { valueToObject } from './utils/config'; 3 4 4 5 export const defaultPaginationKeywords = [
+4 -3
packages/openapi-ts/src/config/plugins.ts
··· 1 - import { defaultPluginConfigs } from '../plugins/config'; 1 + import { defaultPluginConfigs } from '~/plugins/config'; 2 2 import type { 3 3 AnyPluginName, 4 4 PluginContext, 5 5 PluginNames, 6 - } from '../plugins/types'; 7 - import type { Config, UserConfig } from '../types/config'; 6 + } from '~/plugins/types'; 7 + import type { Config, UserConfig } from '~/types/config'; 8 + 8 9 import { valueToObject } from './utils/config'; 9 10 import { packageFactory } from './utils/package'; 10 11
+16 -16
packages/openapi-ts/src/createClient.ts
··· 3 3 import { $RefParser } from '@hey-api/json-schema-ref-parser'; 4 4 import colors from 'ansi-colors'; 5 5 6 - import { generateLegacyOutput } from './generate/legacy/output'; 7 - import { generateOutput } from './generate/output'; 8 - import { getSpec } from './getSpec'; 9 - import type { IR } from './ir/types'; 10 - import { parseLegacy, parseOpenApiSpec } from './openApi'; 11 - import { buildGraph } from './openApi/shared/utils/graph'; 12 - import { patchOpenApiSpec } from './openApi/shared/utils/patch'; 13 - import { processOutput } from './processOutput'; 14 - import type { Client } from './types/client'; 15 - import type { Config } from './types/config'; 16 - import type { Input } from './types/input'; 17 - import type { WatchValues } from './types/types'; 18 - import { isLegacyClient, legacyNameFromConfig } from './utils/config'; 19 - import type { Templates } from './utils/handlebars'; 20 - import type { Logger } from './utils/logger'; 21 - import { postProcessClient } from './utils/postprocess'; 6 + import { generateLegacyOutput } from '~/generate/legacy/output'; 7 + import { generateOutput } from '~/generate/output'; 8 + import { getSpec } from '~/getSpec'; 9 + import type { IR } from '~/ir/types'; 10 + import { parseLegacy, parseOpenApiSpec } from '~/openApi'; 11 + import { buildGraph } from '~/openApi/shared/utils/graph'; 12 + import { patchOpenApiSpec } from '~/openApi/shared/utils/patch'; 13 + import { processOutput } from '~/processOutput'; 14 + import type { Client } from '~/types/client'; 15 + import type { Config } from '~/types/config'; 16 + import type { Input } from '~/types/input'; 17 + import type { WatchValues } from '~/types/types'; 18 + import { isLegacyClient, legacyNameFromConfig } from '~/utils/config'; 19 + import type { Templates } from '~/utils/handlebars'; 20 + import type { Logger } from '~/utils/logger'; 21 + import { postProcessClient } from '~/utils/postprocess'; 22 22 23 23 export const compileInputPath = (input: Omit<Input, 'watch'>) => { 24 24 const result: Pick<
+1 -1
packages/openapi-ts/src/debug/graph.ts
··· 1 - import type { Graph } from '../openApi/shared/utils/graph'; 1 + import type { Graph } from '~/openApi/shared/utils/graph'; 2 2 3 3 const analyzeStructure = (graph: Graph) => { 4 4 let maxDepth = 0;
+2 -2
packages/openapi-ts/src/debug/ir.ts
··· 1 1 import colors from 'ansi-colors'; 2 2 3 - import type { IR } from '../ir/types'; 4 - import { httpMethods } from '../openApi/shared/utils/operation'; 3 + import type { IR } from '~/ir/types'; 4 + import { httpMethods } from '~/openApi/shared/utils/operation'; 5 5 6 6 export interface PrintOptions { 7 7 /**
+2 -2
packages/openapi-ts/src/error.ts
··· 3 3 4 4 import colors from 'ansi-colors'; 5 5 6 - import { loadPackageJson } from './generate/tsConfig'; 7 - import { ensureDirSync } from './generate/utils'; 6 + import { loadPackageJson } from '~/generate/tsConfig'; 7 + import { ensureDirSync } from '~/generate/utils'; 8 8 9 9 type IJobError = { 10 10 error: Error;
+3 -2
packages/openapi-ts/src/generate/__tests__/class.test.ts
··· 3 3 import type ts from 'typescript'; 4 4 import { describe, expect, it, vi } from 'vitest'; 5 5 6 - import type { Config } from '../../types/config'; 7 - import { setConfig } from '../../utils/config'; 6 + import type { Config } from '~/types/config'; 7 + import { setConfig } from '~/utils/config'; 8 + 8 9 import { generateLegacyClientClass } from '../class'; 9 10 import { mockTemplates, openApi } from './mocks'; 10 11
+3 -2
packages/openapi-ts/src/generate/__tests__/core.test.ts
··· 4 4 import type ts from 'typescript'; 5 5 import { beforeEach, describe, expect, it, vi } from 'vitest'; 6 6 7 - import type { Config } from '../../types/config'; 8 - import { setConfig } from '../../utils/config'; 7 + import type { Config } from '~/types/config'; 8 + import { setConfig } from '~/utils/config'; 9 + 9 10 import { generateLegacyCore } from '../core'; 10 11 import { mockTemplates } from './mocks'; 11 12
+4 -4
packages/openapi-ts/src/generate/__tests__/mocks.ts
··· 1 1 import { vi } from 'vitest'; 2 2 3 - import type { OpenApi } from '../../openApi'; 4 - import type { Client } from '../../types/client'; 5 - import type { Config } from '../../types/config'; 6 - import type { Templates } from '../../utils/handlebars'; 3 + import type { OpenApi } from '~/openApi'; 4 + import type { Client } from '~/types/client'; 5 + import type { Config } from '~/types/config'; 6 + import type { Templates } from '~/utils/handlebars'; 7 7 8 8 export const client: Client = { 9 9 config: {} as Config,
+8 -7
packages/openapi-ts/src/generate/class.ts
··· 1 1 import fs from 'node:fs'; 2 2 import path from 'node:path'; 3 3 4 - import type { OpenApi } from '../openApi'; 5 - import { getClientPlugin } from '../plugins/@hey-api/client-core/utils'; 6 - import type { Client } from '../types/client'; 7 - import { getConfig, legacyNameFromConfig } from '../utils/config'; 8 - import { getHttpRequestName } from '../utils/getHttpRequestName'; 9 - import type { Templates } from '../utils/handlebars'; 10 - import { sortByName } from '../utils/sort'; 4 + import type { OpenApi } from '~/openApi'; 5 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 6 + import type { Client } from '~/types/client'; 7 + import { getConfig, legacyNameFromConfig } from '~/utils/config'; 8 + import { getHttpRequestName } from '~/utils/getHttpRequestName'; 9 + import type { Templates } from '~/utils/handlebars'; 10 + import { sortByName } from '~/utils/sort'; 11 + 11 12 import { ensureDirSync } from './utils'; 12 13 13 14 /**
+5 -4
packages/openapi-ts/src/generate/client.ts
··· 4 4 5 5 import type { IProject, ProjectRenderMeta } from '@hey-api/codegen-core'; 6 6 7 - import type { Client } from '../plugins/@hey-api/client-core/types'; 8 - import { getClientPlugin } from '../plugins/@hey-api/client-core/utils'; 9 - import type { DefinePlugin } from '../plugins/types'; 10 - import type { Config } from '../types/config'; 7 + import type { Client } from '~/plugins/@hey-api/client-core/types'; 8 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 9 + import type { DefinePlugin } from '~/plugins/types'; 10 + import type { Config } from '~/types/config'; 11 + 11 12 import { ensureDirSync, relativeModulePath } from './utils'; 12 13 13 14 const __filename = fileURLToPath(import.meta.url);
+5 -5
packages/openapi-ts/src/generate/core.ts
··· 1 1 import fs from 'node:fs'; 2 2 import path from 'node:path'; 3 3 4 - import { getClientPlugin } from '../plugins/@hey-api/client-core/utils'; 5 - import type { Client } from '../types/client'; 6 - import { getConfig, legacyNameFromConfig } from '../utils/config'; 7 - import { getHttpRequestName } from '../utils/getHttpRequestName'; 8 - import type { Templates } from '../utils/handlebars'; 4 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 5 + import type { Client } from '~/types/client'; 6 + import { getConfig, legacyNameFromConfig } from '~/utils/config'; 7 + import { getHttpRequestName } from '~/utils/getHttpRequestName'; 8 + import type { Templates } from '~/utils/handlebars'; 9 9 10 10 /** 11 11 * Generate OpenAPI core files, this includes the basic boilerplate code to handle requests.
+3 -2
packages/openapi-ts/src/generate/file.ts
··· 3 3 4 4 import ts from 'typescript'; 5 5 6 - import { tsc } from '../tsc'; 7 - import { type ImportExportItemObject, tsNodeToString } from '../tsc/utils'; 6 + import { tsc } from '~/tsc'; 7 + import { type ImportExportItemObject, tsNodeToString } from '~/tsc/utils'; 8 + 8 9 import { ensureDirSync } from './utils'; 9 10 10 11 type FileImportResult<
+2 -1
packages/openapi-ts/src/generate/legacy/__tests__/index.test.ts
··· 4 4 import type ts from 'typescript'; 5 5 import { describe, expect, it, vi } from 'vitest'; 6 6 7 - import { setConfig } from '../../../utils/config'; 7 + import { setConfig } from '~/utils/config'; 8 + 8 9 import { GeneratedFile } from '../../file'; 9 10 import { generateIndexFile } from '../indexFile'; 10 11
+4 -3
packages/openapi-ts/src/generate/legacy/__tests__/output.test.ts
··· 3 3 import type ts from 'typescript'; 4 4 import { describe, expect, it, vi } from 'vitest'; 5 5 6 - import type { Client } from '../../../types/client'; 7 - import type { Config } from '../../../types/config'; 8 - import { setConfig } from '../../../utils/config'; 6 + import type { Client } from '~/types/client'; 7 + import type { Config } from '~/types/config'; 8 + import { setConfig } from '~/utils/config'; 9 + 9 10 import { mockTemplates, openApi } from '../../__tests__/mocks'; 10 11 import { generateLegacyOutput } from '../output'; 11 12
+5 -4
packages/openapi-ts/src/generate/legacy/indexFile.ts
··· 1 - import { getClientPlugin } from '../../plugins/@hey-api/client-core/utils'; 2 - import { tsc } from '../../tsc'; 3 - import type { Files } from '../../types/utils'; 4 - import { getConfig, legacyNameFromConfig } from '../../utils/config'; 1 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 2 + import { tsc } from '~/tsc'; 3 + import type { Files } from '~/types/utils'; 4 + import { getConfig, legacyNameFromConfig } from '~/utils/config'; 5 + 5 6 import { GeneratedFile } from '../file'; 6 7 7 8 export const generateIndexFile = ({ files }: { files: Files }): void => {
+7 -6
packages/openapi-ts/src/generate/legacy/output.ts
··· 2 2 3 3 import type { ProjectRenderMeta } from '@hey-api/codegen-core'; 4 4 5 - import type { OpenApi } from '../../openApi'; 6 - import { getClientPlugin } from '../../plugins/@hey-api/client-core/utils'; 7 - import type { Client } from '../../types/client'; 8 - import type { Files } from '../../types/utils'; 9 - import { getConfig, isLegacyClient } from '../../utils/config'; 10 - import type { Templates } from '../../utils/handlebars'; 5 + import type { OpenApi } from '~/openApi'; 6 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 7 + import type { Client } from '~/types/client'; 8 + import type { Files } from '~/types/utils'; 9 + import { getConfig, isLegacyClient } from '~/utils/config'; 10 + import type { Templates } from '~/utils/handlebars'; 11 + 11 12 import { generateLegacyClientClass } from '../class'; 12 13 import { generateClientBundle } from '../client'; 13 14 import { generateLegacyCore } from '../core';
+3 -2
packages/openapi-ts/src/generate/output.ts
··· 3 3 4 4 import type { ProjectRenderMeta } from '@hey-api/codegen-core'; 5 5 6 - import type { IR } from '../ir/types'; 7 - import { getClientPlugin } from '../plugins/@hey-api/client-core/utils'; 6 + import type { IR } from '~/ir/types'; 7 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 8 + 8 9 import { generateClientBundle } from './client'; 9 10 import { removeDirSync } from './utils'; 10 11
+3 -3
packages/openapi-ts/src/generate/renderer.ts
··· 12 12 import { createBinding, mergeBindings, renderIds } from '@hey-api/codegen-core'; 13 13 import ts from 'typescript'; 14 14 15 - import { ensureValidIdentifier } from '../openApi/shared/utils/identifier'; 16 - import { tsc } from '../tsc'; 17 - import { tsNodeToString } from '../tsc/utils'; 15 + import { ensureValidIdentifier } from '~/openApi/shared/utils/identifier'; 16 + import { tsc } from '~/tsc'; 17 + import { tsNodeToString } from '~/tsc/utils'; 18 18 19 19 const nodeBuiltins = new Set([ 20 20 'buffer',
+1 -1
packages/openapi-ts/src/generate/tsConfig.ts
··· 4 4 5 5 import ts from 'typescript'; 6 6 7 - import type { UserOutput } from '../types/output'; 7 + import type { UserOutput } from '~/types/output'; 8 8 9 9 const __filename = fileURLToPath(import.meta.url); 10 10 const __dirname = path.dirname(__filename);
+3 -3
packages/openapi-ts/src/getSpec.ts
··· 1 1 import { getResolvedInput, sendRequest } from '@hey-api/json-schema-ref-parser'; 2 2 3 - import { mergeHeaders } from './plugins/@hey-api/client-fetch/bundle'; 4 - import type { Input } from './types/input'; 5 - import type { WatchValues } from './types/types'; 3 + import { mergeHeaders } from '~/plugins/@hey-api/client-fetch/bundle'; 4 + import type { Input } from '~/types/input'; 5 + import type { WatchValues } from '~/types/types'; 6 6 7 7 type SpecResponse = { 8 8 arrayBuffer: ArrayBuffer | undefined;
+13 -13
packages/openapi-ts/src/index.ts
··· 5 5 // @ts-expect-error 6 6 import colorSupport from 'color-support'; 7 7 8 - import { checkNodeVersion } from './config/engine'; 9 - import type { Configs } from './config/init'; 10 - import { initConfigs } from './config/init'; 11 - import { getLogs } from './config/logs'; 12 - import { createClient as pCreateClient } from './createClient'; 8 + import { checkNodeVersion } from '~/config/engine'; 9 + import type { Configs } from '~/config/init'; 10 + import { initConfigs } from '~/config/init'; 11 + import { getLogs } from '~/config/logs'; 12 + import { createClient as pCreateClient } from '~/createClient'; 13 13 import { 14 14 ConfigValidationError, 15 15 JobError, ··· 17 17 openGitHubIssueWithCrashReport, 18 18 printCrashReport, 19 19 shouldReportCrash, 20 - } from './error'; 21 - import type { IR } from './ir/types'; 22 - import type { Client } from './types/client'; 23 - import type { UserConfig } from './types/config'; 24 - import type { LazyOrAsync, MaybeArray } from './types/utils'; 25 - import { printCliIntro } from './utils/cli'; 26 - import { registerHandlebarTemplates } from './utils/handlebars'; 27 - import { Logger } from './utils/logger'; 20 + } from '~/error'; 21 + import type { IR } from '~/ir/types'; 22 + import type { Client } from '~/types/client'; 23 + import type { UserConfig } from '~/types/config'; 24 + import type { LazyOrAsync, MaybeArray } from '~/types/utils'; 25 + import { printCliIntro } from '~/utils/cli'; 26 + import { registerHandlebarTemplates } from '~/utils/handlebars'; 27 + import { Logger } from '~/utils/logger'; 28 28 29 29 colors.enabled = colorSupport().hasBasic; 30 30
+3 -2
packages/openapi-ts/src/ir/__tests__/graph.test.ts
··· 1 1 import { describe, expect, it } from 'vitest'; 2 2 3 - import type { Graph } from '../../openApi/shared/utils/graph'; 4 - import { buildGraph } from '../../openApi/shared/utils/graph'; 3 + import type { Graph } from '~/openApi/shared/utils/graph'; 4 + import { buildGraph } from '~/openApi/shared/utils/graph'; 5 + 5 6 import type { IrTopLevelKind } from '../graph'; 6 7 import { matchIrTopLevelPointer, walkTopological } from '../graph'; 7 8
+3 -2
packages/openapi-ts/src/ir/__tests__/pagination.test.ts
··· 1 1 import { describe, expect, it, vi } from 'vitest'; 2 2 3 - import { defaultPaginationKeywords } from '../../config/parser'; 4 - import type { Config } from '../../types/config'; 3 + import { defaultPaginationKeywords } from '~/config/parser'; 4 + import type { Config } from '~/types/config'; 5 + 5 6 import { operationPagination } from '../operation'; 6 7 import { getPaginationKeywordsRegExp } from '../pagination'; 7 8 import type { IR } from '../types';
+12 -11
packages/openapi-ts/src/ir/context.ts
··· 1 1 import { Project } from '@hey-api/codegen-core'; 2 2 3 - import type { Package } from '../config/utils/package'; 4 - import { packageFactory } from '../config/utils/package'; 5 - import { TypeScriptRenderer } from '../generate/renderer'; 6 - import type { Graph } from '../openApi/shared/utils/graph'; 7 - import { buildName } from '../openApi/shared/utils/name'; 8 - import type { PluginConfigMap } from '../plugins/config'; 9 - import { PluginInstance } from '../plugins/shared/utils/instance'; 10 - import type { PluginNames } from '../plugins/types'; 11 - import type { Config } from '../types/config'; 12 - import type { Logger } from '../utils/logger'; 13 - import { resolveRef } from '../utils/ref'; 3 + import type { Package } from '~/config/utils/package'; 4 + import { packageFactory } from '~/config/utils/package'; 5 + import { TypeScriptRenderer } from '~/generate/renderer'; 6 + import type { Graph } from '~/openApi/shared/utils/graph'; 7 + import { buildName } from '~/openApi/shared/utils/name'; 8 + import type { PluginConfigMap } from '~/plugins/config'; 9 + import { PluginInstance } from '~/plugins/shared/utils/instance'; 10 + import type { PluginNames } from '~/plugins/types'; 11 + import type { Config } from '~/types/config'; 12 + import type { Logger } from '~/utils/logger'; 13 + import { resolveRef } from '~/utils/ref'; 14 + 14 15 import type { IR } from './types'; 15 16 16 17 export class IRContext<Spec extends Record<string, any> = any> {
+2 -2
packages/openapi-ts/src/ir/graph.ts
··· 1 - import type { Graph, NodeInfo } from '../openApi/shared/utils/graph'; 2 - import { MinHeap } from '../utils/minHeap'; 1 + import type { Graph, NodeInfo } from '~/openApi/shared/utils/graph'; 2 + import { MinHeap } from '~/utils/minHeap'; 3 3 4 4 type KindPriority = Record<IrTopLevelKind, number>; 5 5 type PreferGroups = ReadonlyArray<IrTopLevelKind>;
+2 -1
packages/openapi-ts/src/ir/pagination.ts
··· 1 - import type { Config } from '../types/config'; 1 + import type { Config } from '~/types/config'; 2 + 2 3 import type { IR } from './types'; 3 4 4 5 export function getPaginationKeywordsRegExp(
+3 -2
packages/openapi-ts/src/ir/types.d.ts
··· 1 1 import type { Symbol } from '@hey-api/codegen-core'; 2 2 3 - import type { JsonSchemaDraft2020_12 } from '../openApi/3.1.x/types/json-schema-draft-2020-12'; 3 + import type { JsonSchemaDraft2020_12 } from '~/openApi/3.1.x/types/json-schema-draft-2020-12'; 4 4 import type { 5 5 SecuritySchemeObject, 6 6 ServerObject, 7 - } from '../openApi/3.1.x/types/spec'; 7 + } from '~/openApi/3.1.x/types/spec'; 8 + 8 9 import type { IRContext } from './context'; 9 10 import type { IRMediaType } from './mediaType'; 10 11
+2 -1
packages/openapi-ts/src/openApi/2.0.x/parser/__tests__/server.test.ts
··· 1 1 import { describe, expect, it } from 'vitest'; 2 2 3 + import type { OpenApi } from '~/openApi/types'; 4 + 3 5 import type { IR } from '../../../../ir/types'; 4 - import type { OpenApi } from '../../../types'; 5 6 import { parseServers } from '../server'; 6 7 7 8 describe('parseServers', () => {
+3 -2
packages/openapi-ts/src/openApi/2.0.x/parser/__tests__/validate.test.ts
··· 2 2 3 3 import { describe, expect, it } from 'vitest'; 4 4 5 + import { getSpecsPath, specFileToJson } from '~/openApi/__tests__/utils'; 6 + import type { ValidatorResult } from '~/openApi/shared/utils/validator'; 7 + 5 8 import { Logger } from '../../../../utils/logger'; 6 - import { getSpecsPath, specFileToJson } from '../../../__tests__/utils'; 7 - import type { ValidatorResult } from '../../../shared/utils/validator'; 8 9 import { validateOpenApiSpec } from '../validate'; 9 10 10 11 const specsFolder = path.join(getSpecsPath(), '2.0.x', 'invalid');
+5 -4
packages/openapi-ts/src/openApi/2.0.x/parser/filter.ts
··· 1 - import { createOperationKey } from '../../../ir/operation'; 2 - import type { Logger } from '../../../utils/logger'; 3 - import { addNamespace, removeNamespace } from '../../shared/utils/filter'; 4 - import { httpMethods } from '../../shared/utils/operation'; 1 + import { createOperationKey } from '~/ir/operation'; 2 + import { addNamespace, removeNamespace } from '~/openApi/shared/utils/filter'; 3 + import { httpMethods } from '~/openApi/shared/utils/operation'; 4 + import type { Logger } from '~/utils/logger'; 5 + 5 6 import type { 6 7 OpenApiV2_0_X, 7 8 OperationObject,
+9 -8
packages/openapi-ts/src/openApi/2.0.x/parser/index.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { buildResourceMetadata } from '../../shared/graph/meta'; 3 - import { transformOpenApiSpec } from '../../shared/transforms'; 4 - import type { State } from '../../shared/types/state'; 1 + import type { IR } from '~/ir/types'; 2 + import { buildResourceMetadata } from '~/openApi/shared/graph/meta'; 3 + import { transformOpenApiSpec } from '~/openApi/shared/transforms'; 4 + import type { State } from '~/openApi/shared/types/state'; 5 5 import { 6 6 createFilteredDependencies, 7 7 createFilters, 8 8 hasFilters, 9 - } from '../../shared/utils/filter'; 10 - import { buildGraph } from '../../shared/utils/graph'; 11 - import { mergeParametersObjects } from '../../shared/utils/parameter'; 12 - import { handleValidatorResult } from '../../shared/utils/validator'; 9 + } from '~/openApi/shared/utils/filter'; 10 + import { buildGraph } from '~/openApi/shared/utils/graph'; 11 + import { mergeParametersObjects } from '~/openApi/shared/utils/parameter'; 12 + import { handleValidatorResult } from '~/openApi/shared/utils/validator'; 13 + 13 14 import type { 14 15 OpenApiV2_0_X, 15 16 OperationObject,
+3 -5
packages/openapi-ts/src/openApi/2.0.x/parser/mediaType.ts
··· 1 - import type { IRMediaType } from '../../../ir/mediaType'; 2 - import { 3 - isMediaTypeFileLike, 4 - mediaTypeToIrMediaType, 5 - } from '../../../ir/mediaType'; 1 + import type { IRMediaType } from '~/ir/mediaType'; 2 + import { isMediaTypeFileLike, mediaTypeToIrMediaType } from '~/ir/mediaType'; 3 + 6 4 import type { 7 5 ReferenceObject, 8 6 ResponseObject,
+4 -3
packages/openapi-ts/src/openApi/2.0.x/parser/operation.ts
··· 1 - import type { IR, IRBodyObject } from '../../../ir/types'; 2 - import type { State } from '../../shared/types/state'; 3 - import { operationToId } from '../../shared/utils/operation'; 1 + import type { IR, IRBodyObject } from '~/ir/types'; 2 + import type { State } from '~/openApi/shared/types/state'; 3 + import { operationToId } from '~/openApi/shared/utils/operation'; 4 + 4 5 import type { 5 6 OperationObject, 6 7 ParameterObject,
+4 -3
packages/openapi-ts/src/openApi/2.0.x/parser/pagination.ts
··· 1 - import { getPaginationKeywordsRegExp } from '../../../ir/pagination'; 2 - import type { IR } from '../../../ir/types'; 3 - import type { SchemaType } from '../../shared/types/schema'; 1 + import { getPaginationKeywordsRegExp } from '~/ir/pagination'; 2 + import type { IR } from '~/ir/types'; 3 + import type { SchemaType } from '~/openApi/shared/types/schema'; 4 + 4 5 import type { ParameterObject, ReferenceObject } from '../types/spec'; 5 6 import type { SchemaObject } from '../types/spec'; 6 7 import { getSchemaType } from './schema';
+2 -1
packages/openapi-ts/src/openApi/2.0.x/parser/parameter.ts
··· 1 - import type { IR } from '../../../ir/types'; 1 + import type { IR } from '~/ir/types'; 2 + 2 3 import type { 3 4 OperationObject, 4 5 ParameterObject,
+6 -5
packages/openapi-ts/src/openApi/2.0.x/parser/schema.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { addItemsToSchema } from '../../../ir/utils'; 3 - import { refToName } from '../../../utils/ref'; 1 + import type { IR } from '~/ir/types'; 2 + import { addItemsToSchema } from '~/ir/utils'; 4 3 import type { 5 4 SchemaState, 6 5 SchemaType, 7 6 SchemaWithRequired, 8 - } from '../../shared/types/schema'; 9 - import { discriminatorValues } from '../../shared/utils/discriminator'; 7 + } from '~/openApi/shared/types/schema'; 8 + import { discriminatorValues } from '~/openApi/shared/utils/discriminator'; 9 + import { refToName } from '~/utils/ref'; 10 + 10 11 import type { SchemaObject } from '../types/spec'; 11 12 12 13 export const getSchemaType = ({
+2 -2
packages/openapi-ts/src/openApi/2.0.x/parser/server.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { parseUrl } from '../../../utils/url'; 1 + import type { IR } from '~/ir/types'; 2 + import { parseUrl } from '~/utils/url'; 3 3 4 4 export const parseServers = ({ context }: { context: IR.Context }) => { 5 5 let schemes: ReadonlyArray<string> = context.spec.schemes ?? [];
+5 -4
packages/openapi-ts/src/openApi/2.0.x/parser/validate.ts
··· 1 - import { createOperationKey } from '../../../ir/operation'; 2 - import type { Logger } from '../../../utils/logger'; 3 - import { httpMethods } from '../../shared/utils/operation'; 1 + import { createOperationKey } from '~/ir/operation'; 2 + import { httpMethods } from '~/openApi/shared/utils/operation'; 4 3 import type { 5 4 ValidatorIssue, 6 5 ValidatorResult, 7 - } from '../../shared/utils/validator'; 6 + } from '~/openApi/shared/utils/validator'; 7 + import type { Logger } from '~/utils/logger'; 8 + 8 9 import type { OpenApiV2_0_X, PathItemObject, PathsObject } from '../types/spec'; 9 10 10 11 export const validateOpenApiSpec = (
+1 -1
packages/openapi-ts/src/openApi/2.0.x/types/json-schema-draft-4.d.ts
··· 1 - import type { EnumExtensions } from '../../shared/types/openapi-spec-extensions'; 1 + import type { EnumExtensions } from '~/openApi/shared/types/openapi-spec-extensions'; 2 2 3 3 export interface JsonSchemaDraft4 extends EnumExtensions { 4 4 /**
+2 -1
packages/openapi-ts/src/openApi/2.0.x/types/spec.d.ts
··· 1 - import type { EnumExtensions } from '../../shared/types/openapi-spec-extensions'; 1 + import type { EnumExtensions } from '~/openApi/shared/types/openapi-spec-extensions'; 2 + 2 3 import type { JsonSchemaDraft4 } from './json-schema-draft-4'; 3 4 import type { OpenApiV2_0_X_Nullable_Extensions } from './openapi-spec-extensions'; 4 5
+3 -2
packages/openapi-ts/src/openApi/3.0.x/parser/__tests__/validate.test.ts
··· 2 2 3 3 import { describe, expect, it } from 'vitest'; 4 4 5 + import { getSpecsPath, specFileToJson } from '~/openApi/__tests__/utils'; 6 + import type { ValidatorResult } from '~/openApi/shared/utils/validator'; 7 + 5 8 import { Logger } from '../../../../utils/logger'; 6 - import { getSpecsPath, specFileToJson } from '../../../__tests__/utils'; 7 - import type { ValidatorResult } from '../../../shared/utils/validator'; 8 9 import { validateOpenApiSpec } from '../validate'; 9 10 10 11 const specsFolder = path.join(getSpecsPath(), '3.0.x', 'invalid');
+5 -4
packages/openapi-ts/src/openApi/3.0.x/parser/filter.ts
··· 1 - import { createOperationKey } from '../../../ir/operation'; 2 - import type { Logger } from '../../../utils/logger'; 3 - import { addNamespace, removeNamespace } from '../../shared/utils/filter'; 4 - import { httpMethods } from '../../shared/utils/operation'; 1 + import { createOperationKey } from '~/ir/operation'; 2 + import { addNamespace, removeNamespace } from '~/openApi/shared/utils/filter'; 3 + import { httpMethods } from '~/openApi/shared/utils/operation'; 4 + import type { Logger } from '~/utils/logger'; 5 + 5 6 import type { OpenApiV3_0_X, PathItemObject, PathsObject } from '../types/spec'; 6 7 7 8 /**
+9 -8
packages/openapi-ts/src/openApi/3.0.x/parser/index.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { buildResourceMetadata } from '../../shared/graph/meta'; 3 - import { transformOpenApiSpec } from '../../shared/transforms'; 4 - import type { State } from '../../shared/types/state'; 1 + import type { IR } from '~/ir/types'; 2 + import { buildResourceMetadata } from '~/openApi/shared/graph/meta'; 3 + import { transformOpenApiSpec } from '~/openApi/shared/transforms'; 4 + import type { State } from '~/openApi/shared/types/state'; 5 5 import { 6 6 createFilteredDependencies, 7 7 createFilters, 8 8 hasFilters, 9 - } from '../../shared/utils/filter'; 10 - import { buildGraph } from '../../shared/utils/graph'; 11 - import { mergeParametersObjects } from '../../shared/utils/parameter'; 12 - import { handleValidatorResult } from '../../shared/utils/validator'; 9 + } from '~/openApi/shared/utils/filter'; 10 + import { buildGraph } from '~/openApi/shared/utils/graph'; 11 + import { mergeParametersObjects } from '~/openApi/shared/utils/parameter'; 12 + import { handleValidatorResult } from '~/openApi/shared/utils/validator'; 13 + 13 14 import type { 14 15 OpenApiV3_0_X, 15 16 ParameterObject,
+3 -5
packages/openapi-ts/src/openApi/3.0.x/parser/mediaType.ts
··· 1 - import type { IRMediaType } from '../../../ir/mediaType'; 2 - import { 3 - isMediaTypeFileLike, 4 - mediaTypeToIrMediaType, 5 - } from '../../../ir/mediaType'; 1 + import type { IRMediaType } from '~/ir/mediaType'; 2 + import { isMediaTypeFileLike, mediaTypeToIrMediaType } from '~/ir/mediaType'; 3 + 6 4 import type { 7 5 MediaTypeObject, 8 6 ReferenceObject,
+4 -3
packages/openapi-ts/src/openApi/3.0.x/parser/operation.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import type { State } from '../../shared/types/state'; 3 - import { operationToId } from '../../shared/utils/operation'; 1 + import type { IR } from '~/ir/types'; 2 + import type { State } from '~/openApi/shared/types/state'; 3 + import { operationToId } from '~/openApi/shared/utils/operation'; 4 + 4 5 import type { 5 6 OperationObject, 6 7 PathItemObject,
+4 -3
packages/openapi-ts/src/openApi/3.0.x/parser/pagination.ts
··· 1 - import { getPaginationKeywordsRegExp } from '../../../ir/pagination'; 2 - import type { IR } from '../../../ir/types'; 3 - import type { SchemaType } from '../../shared/types/schema'; 1 + import { getPaginationKeywordsRegExp } from '~/ir/pagination'; 2 + import type { IR } from '~/ir/types'; 3 + import type { SchemaType } from '~/openApi/shared/types/schema'; 4 + 4 5 import type { 5 6 ParameterObject, 6 7 ReferenceObject,
+3 -2
packages/openapi-ts/src/openApi/3.0.x/parser/parameter.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { refToName } from '../../../utils/ref'; 1 + import type { IR } from '~/ir/types'; 2 + import { refToName } from '~/utils/ref'; 3 + 3 4 import type { 4 5 ParameterObject, 5 6 ReferenceObject,
+3 -2
packages/openapi-ts/src/openApi/3.0.x/parser/requestBody.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { refToName } from '../../../utils/ref'; 1 + import type { IR } from '~/ir/types'; 2 + import { refToName } from '~/utils/ref'; 3 + 3 4 import type { RequestBodyObject, SchemaObject } from '../types/spec'; 4 5 import { mediaTypeObjects } from './mediaType'; 5 6 import { schemaToIrSchema } from './schema';
+6 -5
packages/openapi-ts/src/openApi/3.0.x/parser/schema.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { addItemsToSchema } from '../../../ir/utils'; 3 - import { refToName } from '../../../utils/ref'; 1 + import type { IR } from '~/ir/types'; 2 + import { addItemsToSchema } from '~/ir/utils'; 4 3 import type { 5 4 SchemaState, 6 5 SchemaType, 7 6 SchemaWithRequired, 8 - } from '../../shared/types/schema'; 9 - import { discriminatorValues } from '../../shared/utils/discriminator'; 7 + } from '~/openApi/shared/types/schema'; 8 + import { discriminatorValues } from '~/openApi/shared/utils/discriminator'; 9 + import { refToName } from '~/utils/ref'; 10 + 10 11 import type { ReferenceObject, SchemaObject } from '../types/spec'; 11 12 12 13 export const getSchemaType = ({
+2 -2
packages/openapi-ts/src/openApi/3.0.x/parser/server.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { parseUrl } from '../../../utils/url'; 1 + import type { IR } from '~/ir/types'; 2 + import { parseUrl } from '~/utils/url'; 3 3 4 4 export const parseServers = ({ context }: { context: IR.Context }) => { 5 5 if (context.spec.servers) {
+5 -4
packages/openapi-ts/src/openApi/3.0.x/parser/validate.ts
··· 1 - import { createOperationKey } from '../../../ir/operation'; 2 - import type { Logger } from '../../../utils/logger'; 3 - import { httpMethods } from '../../shared/utils/operation'; 1 + import { createOperationKey } from '~/ir/operation'; 2 + import { httpMethods } from '~/openApi/shared/utils/operation'; 4 3 import type { 5 4 ValidatorIssue, 6 5 ValidatorResult, 7 - } from '../../shared/utils/validator'; 6 + } from '~/openApi/shared/utils/validator'; 7 + import type { Logger } from '~/utils/logger'; 8 + 8 9 import type { OpenApiV3_0_X, PathItemObject, PathsObject } from '../types/spec'; 9 10 10 11 export const validateOpenApiSpec = (
+1 -1
packages/openapi-ts/src/openApi/3.0.x/types/spec.d.ts
··· 1 - import type { EnumExtensions } from '../../shared/types/openapi-spec-extensions'; 1 + import type { EnumExtensions } from '~/openApi/shared/types/openapi-spec-extensions'; 2 2 3 3 /** 4 4 * This is the root object of the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#openapi-description OpenAPI Description}.
+3 -2
packages/openapi-ts/src/openApi/3.1.x/parser/__tests__/validate.test.ts
··· 2 2 3 3 import { describe, expect, it } from 'vitest'; 4 4 5 + import { getSpecsPath, specFileToJson } from '~/openApi/__tests__/utils'; 6 + import type { ValidatorResult } from '~/openApi/shared/utils/validator'; 7 + 5 8 import { Logger } from '../../../../utils/logger'; 6 - import { getSpecsPath, specFileToJson } from '../../../__tests__/utils'; 7 - import type { ValidatorResult } from '../../../shared/utils/validator'; 8 9 import { validateOpenApiSpec } from '../validate'; 9 10 10 11 const specsFolder = path.join(getSpecsPath(), '3.1.x', 'invalid');
+5 -4
packages/openapi-ts/src/openApi/3.1.x/parser/filter.ts
··· 1 - import { createOperationKey } from '../../../ir/operation'; 2 - import type { Logger } from '../../../utils/logger'; 3 - import { addNamespace, removeNamespace } from '../../shared/utils/filter'; 4 - import { httpMethods } from '../../shared/utils/operation'; 1 + import { createOperationKey } from '~/ir/operation'; 2 + import { addNamespace, removeNamespace } from '~/openApi/shared/utils/filter'; 3 + import { httpMethods } from '~/openApi/shared/utils/operation'; 4 + import type { Logger } from '~/utils/logger'; 5 + 5 6 import type { OpenApiV3_1_X, PathItemObject, PathsObject } from '../types/spec'; 6 7 7 8 /**
+9 -8
packages/openapi-ts/src/openApi/3.1.x/parser/index.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { buildResourceMetadata } from '../../shared/graph/meta'; 3 - import { transformOpenApiSpec } from '../../shared/transforms'; 4 - import type { State } from '../../shared/types/state'; 1 + import type { IR } from '~/ir/types'; 2 + import { buildResourceMetadata } from '~/openApi/shared/graph/meta'; 3 + import { transformOpenApiSpec } from '~/openApi/shared/transforms'; 4 + import type { State } from '~/openApi/shared/types/state'; 5 5 import { 6 6 createFilteredDependencies, 7 7 createFilters, 8 8 hasFilters, 9 - } from '../../shared/utils/filter'; 10 - import { buildGraph } from '../../shared/utils/graph'; 11 - import { mergeParametersObjects } from '../../shared/utils/parameter'; 12 - import { handleValidatorResult } from '../../shared/utils/validator'; 9 + } from '~/openApi/shared/utils/filter'; 10 + import { buildGraph } from '~/openApi/shared/utils/graph'; 11 + import { mergeParametersObjects } from '~/openApi/shared/utils/parameter'; 12 + import { handleValidatorResult } from '~/openApi/shared/utils/validator'; 13 + 13 14 import type { 14 15 OpenApiV3_1_X, 15 16 ParameterObject,
+3 -5
packages/openapi-ts/src/openApi/3.1.x/parser/mediaType.ts
··· 1 - import type { IRMediaType } from '../../../ir/mediaType'; 2 - import { 3 - isMediaTypeFileLike, 4 - mediaTypeToIrMediaType, 5 - } from '../../../ir/mediaType'; 1 + import type { IRMediaType } from '~/ir/mediaType'; 2 + import { isMediaTypeFileLike, mediaTypeToIrMediaType } from '~/ir/mediaType'; 3 + 6 4 import type { MediaTypeObject, SchemaObject } from '../types/spec'; 7 5 8 6 interface Content {
+5 -4
packages/openapi-ts/src/openApi/3.1.x/parser/operation.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import type { State } from '../../shared/types/state'; 3 - import type { httpMethods } from '../../shared/utils/operation'; 4 - import { operationToId } from '../../shared/utils/operation'; 1 + import type { IR } from '~/ir/types'; 2 + import type { State } from '~/openApi/shared/types/state'; 3 + import type { httpMethods } from '~/openApi/shared/utils/operation'; 4 + import { operationToId } from '~/openApi/shared/utils/operation'; 5 + 5 6 import type { 6 7 OperationObject, 7 8 RequestBodyObject,
+4 -3
packages/openapi-ts/src/openApi/3.1.x/parser/pagination.ts
··· 1 - import { getPaginationKeywordsRegExp } from '../../../ir/pagination'; 2 - import type { IR } from '../../../ir/types'; 3 - import type { SchemaType } from '../../shared/types/schema'; 1 + import { getPaginationKeywordsRegExp } from '~/ir/pagination'; 2 + import type { IR } from '~/ir/types'; 3 + import type { SchemaType } from '~/openApi/shared/types/schema'; 4 + 4 5 import type { ParameterObject, RequestBodyObject } from '../types/spec'; 5 6 import type { SchemaObject } from '../types/spec'; 6 7 import { mediaTypeObjects } from './mediaType';
+3 -2
packages/openapi-ts/src/openApi/3.1.x/parser/parameter.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { refToName } from '../../../utils/ref'; 1 + import type { IR } from '~/ir/types'; 2 + import { refToName } from '~/utils/ref'; 3 + 3 4 import type { 4 5 ParameterObject, 5 6 ReferenceObject,
+3 -2
packages/openapi-ts/src/openApi/3.1.x/parser/requestBody.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { refToName } from '../../../utils/ref'; 1 + import type { IR } from '~/ir/types'; 2 + import { refToName } from '~/utils/ref'; 3 + 3 4 import type { RequestBodyObject, SchemaObject } from '../types/spec'; 4 5 import { mediaTypeObjects } from './mediaType'; 5 6 import { schemaToIrSchema } from './schema';
+6 -5
packages/openapi-ts/src/openApi/3.1.x/parser/schema.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { addItemsToSchema } from '../../../ir/utils'; 3 - import { refToName } from '../../../utils/ref'; 1 + import type { IR } from '~/ir/types'; 2 + import { addItemsToSchema } from '~/ir/utils'; 4 3 import type { 5 4 SchemaState, 6 5 SchemaType, 7 6 SchemaWithRequired, 8 - } from '../../shared/types/schema'; 9 - import { discriminatorValues } from '../../shared/utils/discriminator'; 7 + } from '~/openApi/shared/types/schema'; 8 + import { discriminatorValues } from '~/openApi/shared/utils/discriminator'; 9 + import { refToName } from '~/utils/ref'; 10 + 10 11 import type { SchemaObject } from '../types/spec'; 11 12 12 13 export const getSchemaTypes = ({
+2 -2
packages/openapi-ts/src/openApi/3.1.x/parser/server.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { parseUrl } from '../../../utils/url'; 1 + import type { IR } from '~/ir/types'; 2 + import { parseUrl } from '~/utils/url'; 3 3 4 4 export const parseServers = ({ context }: { context: IR.Context }) => { 5 5 if (context.spec.servers) {
+5 -4
packages/openapi-ts/src/openApi/3.1.x/parser/validate.ts
··· 1 - import { createOperationKey } from '../../../ir/operation'; 2 - import type { Logger } from '../../../utils/logger'; 3 - import { httpMethods } from '../../shared/utils/operation'; 1 + import { createOperationKey } from '~/ir/operation'; 2 + import { httpMethods } from '~/openApi/shared/utils/operation'; 4 3 import type { 5 4 ValidatorIssue, 6 5 ValidatorResult, 7 - } from '../../shared/utils/validator'; 6 + } from '~/openApi/shared/utils/validator'; 7 + import type { Logger } from '~/utils/logger'; 8 + 8 9 import type { OpenApiV3_1_X, PathItemObject, PathsObject } from '../types/spec'; 9 10 10 11 export const validateOpenApiSpec = (
+3 -2
packages/openapi-ts/src/openApi/3.1.x/parser/webhook.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { mergeParametersObjects } from '../../shared/utils/parameter'; 1 + import type { IR } from '~/ir/types'; 2 + import { mergeParametersObjects } from '~/openApi/shared/utils/parameter'; 3 + 3 4 import type { OpenApiV3_1_X, PathItemObject } from '../types/spec'; 4 5 import { parseWebhookOperation } from './operation'; 5 6 import { parametersArrayToObject } from './parameter';
+2 -1
packages/openapi-ts/src/openApi/3.1.x/types/json-schema-draft-2020-12.d.ts
··· 1 + import type { EnumExtensions } from '~/openApi/shared/types/openapi-spec-extensions'; 2 + 1 3 import type { MaybeArray } from '../../../types/utils'; 2 - import type { EnumExtensions } from '../../shared/types/openapi-spec-extensions'; 3 4 import type { OpenApiSchemaExtensions } from './spec-extensions'; 4 5 5 6 // TODO: left out some keywords related to structuring a complex schema and declaring a dialect
+7 -6
packages/openapi-ts/src/openApi/__tests__/index.test.ts
··· 1 1 import { afterEach, describe, expect, it, vi } from 'vitest'; 2 2 3 + import type { OpenApiV3_0_X } from '~/openApi/3.0.x'; 4 + import { parseV3_0_X } from '~/openApi/3.0.x'; 5 + import type { OpenApiV3_1_X } from '~/openApi/3.1.x'; 6 + import { parseV3_1_X } from '~/openApi/3.1.x'; 7 + import * as parseV2 from '~/openApi/v2'; 8 + import * as parseV3 from '~/openApi/v3'; 9 + 3 10 import type { Config } from '../../types/config'; 4 11 import { type OpenApi, parseLegacy, parseOpenApiSpec } from '..'; 5 - import type { OpenApiV3_0_X } from '../3.0.x'; 6 - import { parseV3_0_X } from '../3.0.x'; 7 - import type { OpenApiV3_1_X } from '../3.1.x'; 8 - import { parseV3_1_X } from '../3.1.x'; 9 - import * as parseV2 from '../v2'; 10 - import * as parseV3 from '../v3'; 11 12 12 13 vi.mock('../3.0.x', () => ({ 13 14 parseV3_0_X: vi.fn(),
+2 -2
packages/openapi-ts/src/openApi/common/interfaces/OpenApi.ts
··· 1 - import type { OpenApi as OpenApiV2 } from '../../v2/interfaces/OpenApi'; 2 - import type { OpenApi as OpenApiV3 } from '../../v3/interfaces/OpenApi'; 1 + import type { OpenApi as OpenApiV2 } from '~/openApi/v2/interfaces/OpenApi'; 2 + import type { OpenApi as OpenApiV3 } from '~/openApi/v3/interfaces/OpenApi'; 3 3 4 4 export type OpenApi = OpenApiV2 | OpenApiV3;
+2 -1
packages/openapi-ts/src/openApi/common/interfaces/client.ts
··· 1 + import type { OpenApiParameter } from '~/openApi/v3/interfaces/OpenApiParameter'; 2 + 1 3 import type { Config } from '../../../types/config'; 2 - import type { OpenApiParameter } from '../../v3/interfaces/OpenApiParameter'; 3 4 4 5 export interface ModelComposition 5 6 extends Pick<Model, '$refs' | 'enums' | 'imports' | 'properties'> {
+4 -3
packages/openapi-ts/src/openApi/common/parser/getDefault.ts
··· 1 + import type { OpenApiParameter } from '~/openApi/v2/interfaces/OpenApiParameter'; 2 + import type { OpenApiSchema } from '~/openApi/v3/interfaces/OpenApiSchema'; 3 + import { getDefinitionTypes } from '~/openApi/v3/parser/inferType'; 4 + 1 5 import type { Model } from '../../common/interfaces/client'; 2 - import type { OpenApiParameter } from '../../v2/interfaces/OpenApiParameter'; 3 - import type { OpenApiSchema } from '../../v3/interfaces/OpenApiSchema'; 4 - import { getDefinitionTypes } from '../../v3/parser/inferType'; 5 6 import type { OperationParameter } from '../interfaces/client'; 6 7 7 8 export const getDefault = (
+2 -1
packages/openapi-ts/src/openApi/common/parser/getEnums.ts
··· 1 - import { unique } from '../../../utils/unique'; 1 + import { unique } from '~/utils/unique'; 2 + 2 3 import type { Enum } from '../interfaces/client'; 3 4 import type { WithEnumExtension } from '../interfaces/WithEnumExtension'; 4 5
+3 -2
packages/openapi-ts/src/openApi/common/parser/getRef.ts
··· 1 - import type { OpenApiReference as OpenApiReferenceV2 } from '../../v2/interfaces/OpenApiReference'; 2 - import type { OpenApiReference as OpenApiReferenceV3 } from '../../v3/interfaces/OpenApiReference'; 1 + import type { OpenApiReference as OpenApiReferenceV2 } from '~/openApi/v2/interfaces/OpenApiReference'; 2 + import type { OpenApiReference as OpenApiReferenceV3 } from '~/openApi/v3/interfaces/OpenApiReference'; 3 + 3 4 import type { OpenApi } from '../interfaces/OpenApi'; 4 5 5 6 const ESCAPED_REF_SLASH = /~1/g;
+4 -3
packages/openapi-ts/src/openApi/common/parser/operation.ts
··· 1 + import { getConfig, isLegacyClient } from '~/utils/config'; 2 + import { stringCase } from '~/utils/stringCase'; 3 + import { transformTypeKeyName } from '~/utils/type'; 4 + 1 5 import type { Config } from '../../../types/config'; 2 - import { getConfig, isLegacyClient } from '../../../utils/config'; 3 - import { stringCase } from '../../../utils/stringCase'; 4 - import { transformTypeKeyName } from '../../../utils/type'; 5 6 import type { 6 7 OperationParameter, 7 8 OperationResponse,
+1 -1
packages/openapi-ts/src/openApi/common/parser/sanitize.ts
··· 1 - import { illegalStartCharactersRegExp } from '../../../utils/regexp'; 1 + import { illegalStartCharactersRegExp } from '~/utils/regexp'; 2 2 3 3 export const ensureValidTypeScriptJavaScriptIdentifier = (name: string) => { 4 4 const replaced = name.replace(/[^$\u200c\u200d\p{ID_Continue}]/gu, '_');
+4 -3
packages/openapi-ts/src/openApi/common/parser/type.ts
··· 1 - import { refParametersPartial } from '../../../utils/const'; 2 - import { transformTypeName } from '../../../utils/transform'; 3 - import { isDefinitionTypeNullable } from '../../v3/parser/inferType'; 1 + import { isDefinitionTypeNullable } from '~/openApi/v3/parser/inferType'; 2 + import { refParametersPartial } from '~/utils/const'; 3 + import { transformTypeName } from '~/utils/transform'; 4 + 4 5 import type { Type } from '../interfaces/Type'; 5 6 import { ensureValidTypeScriptJavaScriptIdentifier } from './sanitize'; 6 7 import { stripNamespace } from './stripNamespace';
+13 -13
packages/openapi-ts/src/openApi/index.ts
··· 1 - import { satisfies } from '../config/utils/package'; 2 - import { IRContext } from '../ir/context'; 3 - import type { IR } from '../ir/types'; 4 - import type { Config } from '../types/config'; 5 - import type { Logger } from '../utils/logger'; 6 - import { parseV2_0_X } from './2.0.x'; 7 - import { parseV3_0_X } from './3.0.x'; 8 - import { parseV3_1_X } from './3.1.x'; 9 - import type { Client } from './common/interfaces/client'; 10 - import type { OpenApi as LegacyOpenApi } from './common/interfaces/OpenApi'; 11 - import type { OpenApi } from './types'; 12 - import { parse as parseV2 } from './v2'; 13 - import { parse as parseV3 } from './v3'; 1 + import { satisfies } from '~/config/utils/package'; 2 + import { IRContext } from '~/ir/context'; 3 + import type { IR } from '~/ir/types'; 4 + import { parseV2_0_X } from '~/openApi/2.0.x'; 5 + import { parseV3_0_X } from '~/openApi/3.0.x'; 6 + import { parseV3_1_X } from '~/openApi/3.1.x'; 7 + import type { Client } from '~/openApi/common/interfaces/client'; 8 + import type { OpenApi as LegacyOpenApi } from '~/openApi/common/interfaces/OpenApi'; 9 + import type { OpenApi } from '~/openApi/types'; 10 + import { parse as parseV2 } from '~/openApi/v2'; 11 + import { parse as parseV3 } from '~/openApi/v3'; 12 + import type { Config } from '~/types/config'; 13 + import type { Logger } from '~/utils/logger'; 14 14 15 15 export type { 16 16 Client,
+4 -3
packages/openapi-ts/src/openApi/shared/graph/meta.ts
··· 1 - import { createOperationKey } from '../../../ir/operation'; 2 - import type { Logger } from '../../../utils/logger'; 3 - import { jsonPointerToPath } from '../../../utils/ref'; 1 + import { createOperationKey } from '~/ir/operation'; 2 + import type { Logger } from '~/utils/logger'; 3 + import { jsonPointerToPath } from '~/utils/ref'; 4 + 4 5 import { addNamespace, stringToNamespace } from '../utils/filter'; 5 6 import type { Graph } from '../utils/graph'; 6 7 import { httpMethods } from '../utils/operation';
+2 -1
packages/openapi-ts/src/openApi/shared/transforms/enums.ts
··· 1 + import { jsonPointerToPath } from '~/utils/ref'; 2 + 1 3 import type { Config } from '../../../types/config'; 2 - import { jsonPointerToPath } from '../../../utils/ref'; 3 4 import { buildName } from '../utils/name'; 4 5 import { deepClone } from '../utils/schema'; 5 6 import { childSchemaRelationships } from '../utils/schemaChildRelationships';
+2 -1
packages/openapi-ts/src/openApi/shared/transforms/index.ts
··· 1 - import type { IR } from '../../../ir/types'; 1 + import type { IR } from '~/ir/types'; 2 + 2 3 import { enumsTransform } from './enums'; 3 4 import { propertiesRequiredByDefaultTransform } from './propertiesRequiredByDefault'; 4 5 import { readWriteTransform } from './readWrite';
+3 -2
packages/openapi-ts/src/openApi/shared/transforms/readWrite.ts
··· 1 + import type { Logger } from '~/utils/logger'; 2 + import { jsonPointerToPath } from '~/utils/ref'; 3 + 1 4 import type { Config } from '../../../types/config'; 2 - import type { Logger } from '../../../utils/logger'; 3 - import { jsonPointerToPath } from '../../../utils/ref'; 4 5 import deepEqual from '../utils/deepEqual'; 5 6 import { buildGraph, type Graph, type Scope } from '../utils/graph'; 6 7 import { buildName } from '../utils/name';
+2 -1
packages/openapi-ts/src/openApi/shared/utils/__tests__/patch.test.ts
··· 1 1 import { describe, expect, it, vi } from 'vitest'; 2 2 3 - import type { OpenApi } from '../../../../openApi/types'; 3 + import type { OpenApi } from '~/openApi/types'; 4 + 4 5 import { patchOpenApiSpec } from '../patch'; 5 6 6 7 const specMetadataV2: Pick<OpenApi.V2_0_X, 'info' | 'paths' | 'swagger'> = {
+1 -1
packages/openapi-ts/src/openApi/shared/utils/discriminator.ts
··· 1 - import { refToName } from '../../../utils/ref'; 1 + import { refToName } from '~/utils/ref'; 2 2 3 3 export const discriminatorValues = ( 4 4 $ref: string,
+5 -4
packages/openapi-ts/src/openApi/shared/utils/filter.ts
··· 1 - import { createOperationKey } from '../../../ir/operation'; 1 + import { createOperationKey } from '~/ir/operation'; 2 + import type { PathItemObject, PathsObject } from '~/openApi/3.1.x/types/spec'; 3 + import type { OpenApi } from '~/openApi/types'; 4 + import type { Logger } from '~/utils/logger'; 5 + 2 6 import type { Config } from '../../../types/config'; 3 - import type { Logger } from '../../../utils/logger'; 4 - import type { PathItemObject, PathsObject } from '../../3.1.x/types/spec'; 5 - import type { OpenApi } from '../../types'; 6 7 import type { ResourceMetadata } from '../graph/meta'; 7 8 import { httpMethods } from './operation'; 8 9
+3 -2
packages/openapi-ts/src/openApi/shared/utils/graph.ts
··· 1 - import type { Logger } from '../../../utils/logger'; 2 - import { normalizeJsonPointer, pathToJsonPointer } from '../../../utils/ref'; 1 + import type { Logger } from '~/utils/logger'; 2 + import { normalizeJsonPointer, pathToJsonPointer } from '~/utils/ref'; 3 + 3 4 import { childSchemaRelationships } from './schemaChildRelationships'; 4 5 5 6 /**
+1 -1
packages/openapi-ts/src/openApi/shared/utils/identifier.ts
··· 5 5 reservedJavaScriptKeywordsRegExp, 6 6 reservedNodeGlobalsRegExp, 7 7 reservedTypeScriptKeywordsRegExp, 8 - } from '../../../utils/regexp'; 8 + } from '~/utils/regexp'; 9 9 10 10 const regexps = [ 11 11 reservedJavaScriptKeywordsRegExp,
+2 -1
packages/openapi-ts/src/openApi/shared/utils/name.ts
··· 1 + import { stringCase } from '~/utils/stringCase'; 2 + 1 3 import type { StringCase, StringName } from '../../../types/case'; 2 - import { stringCase } from '../../../utils/stringCase'; 3 4 4 5 export const buildName = ({ 5 6 config,
+5 -4
packages/openapi-ts/src/openApi/shared/utils/operation.ts
··· 1 - import { createOperationKey } from '../../../ir/operation'; 2 - import type { IR } from '../../../ir/types'; 3 - import { stringCase } from '../../../utils/stringCase'; 4 - import { sanitizeNamespaceIdentifier } from '../../common/parser/sanitize'; 1 + import { createOperationKey } from '~/ir/operation'; 2 + import type { IR } from '~/ir/types'; 3 + import { sanitizeNamespaceIdentifier } from '~/openApi/common/parser/sanitize'; 4 + import { stringCase } from '~/utils/stringCase'; 5 + 5 6 import type { State } from '../types/state'; 6 7 7 8 export const httpMethods = [
+1 -1
packages/openapi-ts/src/openApi/shared/utils/parameter.ts
··· 1 - import type { IR } from '../../../ir/types'; 1 + import type { IR } from '~/ir/types'; 2 2 3 3 export const mergeParametersObjects = ({ 4 4 source,
+2 -1
packages/openapi-ts/src/openApi/shared/utils/patch.ts
··· 1 + import type { OpenApi } from '~/openApi/types'; 2 + 1 3 import type { Patch } from '../../../types/parser'; 2 - import type { OpenApi } from '../../types'; 3 4 4 5 export const patchOpenApiSpec = ({ 5 6 patchOptions,
+1 -1
packages/openapi-ts/src/openApi/shared/utils/validator.ts
··· 1 1 import colors from 'ansi-colors'; 2 2 3 - import type { IR } from '../../../ir/types'; 3 + import type { IR } from '~/ir/types'; 4 4 5 5 export interface ValidatorIssue { 6 6 /**
+3 -3
packages/openapi-ts/src/openApi/types.d.ts
··· 1 - import type { OpenApiV2_0_X, OpenApiV2_0_XTypes } from './2.0.x'; 2 - import type { OpenApiV3_0_X, OpenApiV3_0_XTypes } from './3.0.x'; 3 - import type { OpenApiV3_1_X, OpenApiV3_1_XTypes } from './3.1.x'; 1 + import type { OpenApiV2_0_X, OpenApiV2_0_XTypes } from '~/openApi/2.0.x'; 2 + import type { OpenApiV3_0_X, OpenApiV3_0_XTypes } from '~/openApi/3.0.x'; 3 + import type { OpenApiV3_1_X, OpenApiV3_1_XTypes } from '~/openApi/3.1.x'; 4 4 5 5 export namespace OpenApi { 6 6 export type V2_0_X = OpenApiV2_0_X;
+3 -2
packages/openapi-ts/src/openApi/v2/index.ts
··· 1 - import type { Client } from '../common/interfaces/client'; 2 - import { getServiceVersion } from '../common/parser/service'; 1 + import type { Client } from '~/openApi/common/interfaces/client'; 2 + import { getServiceVersion } from '~/openApi/common/parser/service'; 3 + 3 4 import type { OpenApi } from './interfaces/OpenApi'; 4 5 import { getModels } from './parser/getModels'; 5 6 import { getOperations } from './parser/getOperations';
+2 -1
packages/openapi-ts/src/openApi/v2/interfaces/Model.ts
··· 1 + import type { Model, ModelMeta } from '~/openApi/common/interfaces/client'; 2 + 1 3 import type { Client } from '../../../types/client'; 2 - import type { Model, ModelMeta } from '../../common/interfaces/client'; 3 4 import type { OpenApi } from './OpenApi'; 4 5 import type { OpenApiSchema } from './OpenApiSchema'; 5 6
+2 -1
packages/openapi-ts/src/openApi/v2/interfaces/OpenApi.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiExternalDocs } from './OpenApiExternalDocs'; 3 4 import type { OpenApiInfo } from './OpenApiInfo'; 4 5 import type { OpenApiParameter } from './OpenApiParameter';
+2 -1
packages/openapi-ts/src/openApi/v2/interfaces/OpenApiHeader.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiItems } from './OpenApiItems'; 3 4 4 5 /**
+1 -1
packages/openapi-ts/src/openApi/v2/interfaces/OpenApiItems.ts
··· 1 - import type { WithEnumExtension } from '../../common/interfaces/WithEnumExtension'; 1 + import type { WithEnumExtension } from '~/openApi/common/interfaces/WithEnumExtension'; 2 2 3 3 /** 4 4 * {@link} https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#items-object)
+2 -1
packages/openapi-ts/src/openApi/v2/interfaces/OpenApiParameter.ts
··· 1 - import type { WithEnumExtension } from '../../common/interfaces/WithEnumExtension'; 1 + import type { WithEnumExtension } from '~/openApi/common/interfaces/WithEnumExtension'; 2 + 2 3 import type { WithNullableExtension } from './Extensions/WithNullableExtension'; 3 4 import type { OpenApiItems } from './OpenApiItems'; 4 5 import type { OpenApiReference } from './OpenApiReference';
+2 -1
packages/openapi-ts/src/openApi/v2/interfaces/OpenApiResponse.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiExample } from './OpenApiExample'; 3 4 import type { OpenApiHeader } from './OpenApiHeader'; 4 5 import type { OpenApiReference } from './OpenApiReference';
+3 -2
packages/openapi-ts/src/openApi/v2/interfaces/OpenApiSchema.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 2 - import type { WithEnumExtension } from '../../common/interfaces/WithEnumExtension'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + import type { WithEnumExtension } from '~/openApi/common/interfaces/WithEnumExtension'; 3 + 3 4 import type { WithNullableExtension } from './Extensions/WithNullableExtension'; 4 5 import type { OpenApiExternalDocs } from './OpenApiExternalDocs'; 5 6 import type { OpenApiReference } from './OpenApiReference';
+1 -1
packages/openapi-ts/src/openApi/v2/interfaces/OpenApiSecurityScheme.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 2 3 3 /** 4 4 * {@link} https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#security-scheme-object
+5 -4
packages/openapi-ts/src/openApi/v2/parser/getModel.ts
··· 1 + import type { Model, ModelMeta } from '~/openApi/common/interfaces/client'; 2 + import { getEnums } from '~/openApi/common/parser/getEnums'; 3 + import { getPattern } from '~/openApi/common/parser/getPattern'; 4 + import { getType } from '~/openApi/common/parser/type'; 5 + 1 6 import type { Client } from '../../../types/client'; 2 - import type { Model, ModelMeta } from '../../common/interfaces/client'; 3 - import { getEnums } from '../../common/parser/getEnums'; 4 - import { getPattern } from '../../common/parser/getPattern'; 5 - import { getType } from '../../common/parser/type'; 6 7 import type { OpenApi } from '../interfaces/OpenApi'; 7 8 import type { OpenApiSchema } from '../interfaces/OpenApiSchema'; 8 9 import { getModelComposition } from './getModelComposition';
+5 -1
packages/openapi-ts/src/openApi/v2/parser/getModelComposition.ts
··· 1 + import type { 2 + Model, 3 + ModelComposition, 4 + } from '~/openApi/common/interfaces/client'; 5 + 1 6 import type { Client } from '../../../types/client'; 2 - import type { Model, ModelComposition } from '../../common/interfaces/client'; 3 7 import type { GetModelFn } from '../interfaces/Model'; 4 8 import type { OpenApi } from '../interfaces/OpenApi'; 5 9 import type { OpenApiSchema } from '../interfaces/OpenApiSchema';
+5 -4
packages/openapi-ts/src/openApi/v2/parser/getModelProperties.ts
··· 1 + import type { Model } from '~/openApi/common/interfaces/client'; 2 + import { getPattern } from '~/openApi/common/parser/getPattern'; 3 + import { getType } from '~/openApi/common/parser/type'; 4 + import { escapeName } from '~/utils/escape'; 5 + 1 6 import type { Client } from '../../../types/client'; 2 - import { escapeName } from '../../../utils/escape'; 3 - import type { Model } from '../../common/interfaces/client'; 4 - import { getPattern } from '../../common/parser/getPattern'; 5 - import { getType } from '../../common/parser/type'; 6 7 import type { GetModelFn } from '../interfaces/Model'; 7 8 import type { OpenApi } from '../interfaces/OpenApi'; 8 9 import type { OpenApiSchema } from '../interfaces/OpenApiSchema';
+3 -2
packages/openapi-ts/src/openApi/v2/parser/getModels.ts
··· 1 + import { getType } from '~/openApi/common/parser/type'; 2 + import { reservedJavaScriptKeywordsRegExp } from '~/utils/regexp'; 3 + 1 4 import type { Client } from '../../../types/client'; 2 - import { reservedJavaScriptKeywordsRegExp } from '../../../utils/regexp'; 3 - import { getType } from '../../common/parser/type'; 4 5 import type { OpenApi } from '../interfaces/OpenApi'; 5 6 import { getModel } from './getModel'; 6 7
+8 -7
packages/openapi-ts/src/openApi/v2/parser/getOperationParameter.ts
··· 1 + import type { OperationParameter } from '~/openApi/common/interfaces/client'; 2 + import { getDefault } from '~/openApi/common/parser/getDefault'; 3 + import { getEnums } from '~/openApi/common/parser/getEnums'; 4 + import { getPattern } from '~/openApi/common/parser/getPattern'; 5 + import { getRef } from '~/openApi/common/parser/getRef'; 6 + import { operationParameterNameFn } from '~/openApi/common/parser/operation'; 7 + import { getType } from '~/openApi/common/parser/type'; 8 + 1 9 import type { Client } from '../../../types/client'; 2 - import type { OperationParameter } from '../../common/interfaces/client'; 3 - import { getDefault } from '../../common/parser/getDefault'; 4 - import { getEnums } from '../../common/parser/getEnums'; 5 - import { getPattern } from '../../common/parser/getPattern'; 6 - import { getRef } from '../../common/parser/getRef'; 7 - import { operationParameterNameFn } from '../../common/parser/operation'; 8 - import { getType } from '../../common/parser/type'; 9 10 import type { OpenApi } from '../interfaces/OpenApi'; 10 11 import type { OpenApiParameter } from '../interfaces/OpenApiParameter'; 11 12 import type { OpenApiSchema } from '../interfaces/OpenApiSchema';
+4 -3
packages/openapi-ts/src/openApi/v2/parser/getOperationParameters.ts
··· 1 + import type { OperationParameters } from '~/openApi/common/interfaces/client'; 2 + import { getRef } from '~/openApi/common/parser/getRef'; 3 + import { operationParameterFilterFn } from '~/openApi/common/parser/operation'; 4 + 1 5 import type { Client } from '../../../types/client'; 2 - import type { OperationParameters } from '../../common/interfaces/client'; 3 - import { getRef } from '../../common/parser/getRef'; 4 - import { operationParameterFilterFn } from '../../common/parser/operation'; 5 6 import type { OpenApi } from '../interfaces/OpenApi'; 6 7 import type { OpenApiParameter } from '../interfaces/OpenApiParameter'; 7 8 import { getOperationParameter } from './getOperationParameter';
+5 -4
packages/openapi-ts/src/openApi/v2/parser/getOperationResponse.ts
··· 1 + import type { OperationResponse } from '~/openApi/common/interfaces/client'; 2 + import { getPattern } from '~/openApi/common/parser/getPattern'; 3 + import { getRef } from '~/openApi/common/parser/getRef'; 4 + import { getType } from '~/openApi/common/parser/type'; 5 + 1 6 import type { Client } from '../../../types/client'; 2 - import type { OperationResponse } from '../../common/interfaces/client'; 3 - import { getPattern } from '../../common/parser/getPattern'; 4 - import { getRef } from '../../common/parser/getRef'; 5 - import { getType } from '../../common/parser/type'; 6 7 import type { OpenApi } from '../interfaces/OpenApi'; 7 8 import type { OpenApiResponse } from '../interfaces/OpenApiResponse'; 8 9 import type { OpenApiSchema } from '../interfaces/OpenApiSchema';
+5 -4
packages/openapi-ts/src/openApi/v2/parser/getOperationResponses.ts
··· 1 - import type { Client } from '../../../types/client'; 2 - import type { OperationResponse } from '../../common/interfaces/client'; 3 - import { getRef } from '../../common/parser/getRef'; 1 + import type { OperationResponse } from '~/openApi/common/interfaces/client'; 2 + import { getRef } from '~/openApi/common/parser/getRef'; 4 3 import { 5 4 parseResponseStatusCode, 6 5 sorterByResponseStatusCode, 7 6 tagResponseTypes, 8 - } from '../../common/parser/operation'; 7 + } from '~/openApi/common/parser/operation'; 8 + 9 + import type { Client } from '../../../types/client'; 9 10 import type { OpenApi } from '../interfaces/OpenApi'; 10 11 import type { OpenApiResponse } from '../interfaces/OpenApiResponse'; 11 12 import type { OpenApiResponses } from '../interfaces/OpenApiResponses';
+6 -5
packages/openapi-ts/src/openApi/v2/parser/getOperations.ts
··· 1 - import { createOperationKey } from '../../../ir/operation'; 2 - import { getConfig } from '../../../utils/config'; 3 - import type { Client, Operation } from '../../common/interfaces/client'; 4 - import { operationFilterFn } from '../../common/parser/operation'; 5 - import { allowedServiceMethods } from '../../common/parser/service'; 1 + import { createOperationKey } from '~/ir/operation'; 2 + import type { Client, Operation } from '~/openApi/common/interfaces/client'; 3 + import { operationFilterFn } from '~/openApi/common/parser/operation'; 4 + import { allowedServiceMethods } from '~/openApi/common/parser/service'; 5 + import { getConfig } from '~/utils/config'; 6 + 6 7 import type { OpenApi } from '../interfaces/OpenApi'; 7 8 import { getOperationParameters } from './getOperationParameters'; 8 9 import { getOperation } from './operation';
+3 -2
packages/openapi-ts/src/openApi/v2/parser/getRequiredPropertiesFromComposition.ts
··· 1 + import type { Model } from '~/openApi/common/interfaces/client'; 2 + import { getRef } from '~/openApi/common/parser/getRef'; 3 + 1 4 import type { Client } from '../../../types/client'; 2 - import type { Model } from '../../common/interfaces/client'; 3 - import { getRef } from '../../common/parser/getRef'; 4 5 import type { GetModelFn } from '../interfaces/Model'; 5 6 import type { OpenApi } from '../interfaces/OpenApi'; 6 7 import type { OpenApiSchema } from '../interfaces/OpenApiSchema';
+6 -5
packages/openapi-ts/src/openApi/v2/parser/operation.ts
··· 1 - import type { Client } from '../../../types/client'; 2 - import { getConfig } from '../../../utils/config'; 3 1 import type { 4 2 Operation, 5 3 OperationParameters, 6 - } from '../../common/interfaces/client'; 4 + } from '~/openApi/common/interfaces/client'; 7 5 import { 8 6 getOperationResponseHeader, 9 7 operationNameFn, 10 - } from '../../common/parser/operation'; 11 - import { toSortedByRequired } from '../../common/parser/sort'; 8 + } from '~/openApi/common/parser/operation'; 9 + import { toSortedByRequired } from '~/openApi/common/parser/sort'; 10 + import { getConfig } from '~/utils/config'; 11 + 12 + import type { Client } from '../../../types/client'; 12 13 import type { OpenApi } from '../interfaces/OpenApi'; 13 14 import type { OpenApiOperation } from '../interfaces/OpenApiOperation'; 14 15 import { getOperationParameters } from './getOperationParameters';
+3 -2
packages/openapi-ts/src/openApi/v3/index.ts
··· 1 - import type { Client } from '../common/interfaces/client'; 2 - import { getServiceVersion } from '../common/parser/service'; 1 + import type { Client } from '~/openApi/common/interfaces/client'; 2 + import { getServiceVersion } from '~/openApi/common/parser/service'; 3 + 3 4 import type { OpenApi } from './interfaces/OpenApi'; 4 5 import { getModels } from './parser/getModels'; 5 6 import { getOperations } from './parser/getOperations';
+2 -1
packages/openapi-ts/src/openApi/v3/interfaces/Model.ts
··· 1 + import type { Model, ModelMeta } from '~/openApi/common/interfaces/client'; 2 + 1 3 import type { Client } from '../../../types/client'; 2 - import type { Model, ModelMeta } from '../../common/interfaces/client'; 3 4 import type { OpenApi } from './OpenApi'; 4 5 import type { OpenApiSchema } from './OpenApiSchema'; 5 6
+2 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiComponents.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiCallback } from './OpenApiCallback'; 3 4 import type { OpenApiExample } from './OpenApiExample'; 4 5 import type { OpenApiHeader } from './OpenApiHeader';
+1 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiDiscriminator.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 2 3 3 /** 4 4 * {@link} https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#discriminator-object
+2 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiEncoding.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiHeader } from './OpenApiHeader'; 3 4 4 5 /**
+2 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiHeader.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiExample } from './OpenApiExample'; 3 4 import type { OpenApiReference } from './OpenApiReference'; 4 5 import type { OpenApiSchema } from './OpenApiSchema';
+2 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiLink.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiReference } from './OpenApiReference'; 3 4 import type { OpenApiServer } from './OpenApiServer'; 4 5
+2 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiMediaType.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiEncoding } from './OpenApiEncoding'; 3 4 import type { OpenApiExample } from './OpenApiExample'; 4 5 import type { OpenApiReference } from './OpenApiReference';
+1 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiOAuthFlow.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 2 3 3 /** 4 4 * {@link} https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#oauth-flow-object
+2 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiOperation.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiCallback } from './OpenApiCallback'; 3 4 import type { OpenApiExternalDocs } from './OpenApiExternalDocs'; 4 5 import type { OpenApiParameter } from './OpenApiParameter';
+2 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiParameter.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiExample } from './OpenApiExample'; 3 4 import type { OpenApiReference } from './OpenApiReference'; 4 5 import type { OpenApiSchema } from './OpenApiSchema';
+2 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiRequestBody.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiMediaType } from './OpenApiMediaType'; 3 4 import type { OpenApiReference } from './OpenApiReference'; 4 5
+2 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiResponse.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiHeader } from './OpenApiHeader'; 3 4 import type { OpenApiLink } from './OpenApiLink'; 4 5 import type { OpenApiMediaType } from './OpenApiMediaType';
+3 -2
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiSchema.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 2 - import type { WithEnumExtension } from '../../common/interfaces/WithEnumExtension'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + import type { WithEnumExtension } from '~/openApi/common/interfaces/WithEnumExtension'; 3 + 3 4 import type { OpenApiDiscriminator } from './OpenApiDiscriminator'; 4 5 import type { OpenApiExternalDocs } from './OpenApiExternalDocs'; 5 6 import type { OpenApiReference } from './OpenApiReference';
+2 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiServer.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApiServerVariable } from './OpenApiServerVariable'; 3 4 4 5 /**
+1 -1
packages/openapi-ts/src/openApi/v3/interfaces/OpenApiServerVariable.ts
··· 1 - import type { WithEnumExtension } from '../../common/interfaces/WithEnumExtension'; 1 + import type { WithEnumExtension } from '~/openApi/common/interfaces/WithEnumExtension'; 2 2 3 3 /** 4 4 * {@link} https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-variable-object
+2 -1
packages/openapi-ts/src/openApi/v3/parser/__tests__/getModel.test.ts
··· 1 1 import type ts from 'typescript'; 2 2 import { describe, expect, it, vi } from 'vitest'; 3 3 4 + import { getType } from '~/openApi/common/parser/type'; 5 + 4 6 import type { Config } from '../../../../types/config'; 5 7 import { reservedJavaScriptKeywordsRegExp } from '../../../../utils/regexp'; 6 - import { getType } from '../../../common/parser/type'; 7 8 import { getModel } from '../getModel'; 8 9 9 10 vi.mock('../../../../utils/config', () => {
+4 -3
packages/openapi-ts/src/openApi/v3/parser/discriminator.ts
··· 1 - import type { Model } from '../../common/interfaces/client'; 2 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 3 - import { stripNamespace } from '../../common/parser/stripNamespace'; 1 + import type { Model } from '~/openApi/common/interfaces/client'; 2 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 3 + import { stripNamespace } from '~/openApi/common/parser/stripNamespace'; 4 + 4 5 import type { OpenApi } from '../interfaces/OpenApi'; 5 6 import type { OpenApiDiscriminator } from '../interfaces/OpenApiDiscriminator'; 6 7
+2 -1
packages/openapi-ts/src/openApi/v3/parser/getContent.ts
··· 1 - import type { Dictionary } from '../../common/interfaces/Dictionary'; 1 + import type { Dictionary } from '~/openApi/common/interfaces/Dictionary'; 2 + 2 3 import type { OpenApi } from '../interfaces/OpenApi'; 3 4 import type { OpenApiMediaType } from '../interfaces/OpenApiMediaType'; 4 5 import type { OpenApiSchema } from '../interfaces/OpenApiSchema';
+7 -6
packages/openapi-ts/src/openApi/v3/parser/getModel.ts
··· 1 + import type { Model, ModelMeta } from '~/openApi/common/interfaces/client'; 2 + import { getDefault } from '~/openApi/common/parser/getDefault'; 3 + import { getEnums } from '~/openApi/common/parser/getEnums'; 4 + import { getPattern } from '~/openApi/common/parser/getPattern'; 5 + import { getType } from '~/openApi/common/parser/type'; 6 + import { enumMeta } from '~/utils/enum'; 7 + 1 8 import type { Client } from '../../../types/client'; 2 - import { enumMeta } from '../../../utils/enum'; 3 - import type { Model, ModelMeta } from '../../common/interfaces/client'; 4 - import { getDefault } from '../../common/parser/getDefault'; 5 - import { getEnums } from '../../common/parser/getEnums'; 6 - import { getPattern } from '../../common/parser/getPattern'; 7 - import { getType } from '../../common/parser/type'; 8 9 import type { OpenApi } from '../interfaces/OpenApi'; 9 10 import type { OpenApiSchema } from '../interfaces/OpenApiSchema'; 10 11 import {
+5 -1
packages/openapi-ts/src/openApi/v3/parser/getModelComposition.ts
··· 1 + import type { 2 + Model, 3 + ModelComposition, 4 + } from '~/openApi/common/interfaces/client'; 5 + 1 6 import type { Client } from '../../../types/client'; 2 - import type { Model, ModelComposition } from '../../common/interfaces/client'; 3 7 import type { GetModelFn } from '../interfaces/Model'; 4 8 import type { OpenApi } from '../interfaces/OpenApi'; 5 9 import type { OpenApiSchema } from '../interfaces/OpenApiSchema';
+7 -6
packages/openapi-ts/src/openApi/v3/parser/getModelProperties.ts
··· 1 + import type { Model } from '~/openApi/common/interfaces/client'; 2 + import { getDefault } from '~/openApi/common/parser/getDefault'; 3 + import { getPattern } from '~/openApi/common/parser/getPattern'; 4 + import { getType } from '~/openApi/common/parser/type'; 5 + import { escapeName } from '~/utils/escape'; 6 + import { unique } from '~/utils/unique'; 7 + 1 8 import type { Client } from '../../../types/client'; 2 - import { escapeName } from '../../../utils/escape'; 3 - import { unique } from '../../../utils/unique'; 4 - import type { Model } from '../../common/interfaces/client'; 5 - import { getDefault } from '../../common/parser/getDefault'; 6 - import { getPattern } from '../../common/parser/getPattern'; 7 - import { getType } from '../../common/parser/type'; 8 9 import type { GetModelFn } from '../interfaces/Model'; 9 10 import type { OpenApi } from '../interfaces/OpenApi'; 10 11 import type { OpenApiSchema } from '../interfaces/OpenApiSchema';
+2 -1
packages/openapi-ts/src/openApi/v3/parser/getModels.ts
··· 1 + import { getParametersMeta, getSchemasMeta } from '~/utils/meta'; 2 + 1 3 import type { Client } from '../../../types/client'; 2 - import { getParametersMeta, getSchemasMeta } from '../../../utils/meta'; 3 4 import type { OpenApi } from '../interfaces/OpenApi'; 4 5 import { getModel } from './getModel'; 5 6 import { getParameterSchema } from './parameter';
+9 -8
packages/openapi-ts/src/openApi/v3/parser/getOperationParameter.ts
··· 1 + import type { OperationParameter } from '~/openApi/common/interfaces/client'; 2 + import { getDefault } from '~/openApi/common/parser/getDefault'; 3 + import { getPattern } from '~/openApi/common/parser/getPattern'; 4 + import { getRef } from '~/openApi/common/parser/getRef'; 5 + import { operationParameterNameFn } from '~/openApi/common/parser/operation'; 6 + import { getType } from '~/openApi/common/parser/type'; 7 + import { refParametersPartial } from '~/utils/const'; 8 + import { enumMeta } from '~/utils/enum'; 9 + 1 10 import type { Client } from '../../../types/client'; 2 - import { refParametersPartial } from '../../../utils/const'; 3 - import { enumMeta } from '../../../utils/enum'; 4 - import type { OperationParameter } from '../../common/interfaces/client'; 5 - import { getDefault } from '../../common/parser/getDefault'; 6 - import { getPattern } from '../../common/parser/getPattern'; 7 - import { getRef } from '../../common/parser/getRef'; 8 - import { operationParameterNameFn } from '../../common/parser/operation'; 9 - import { getType } from '../../common/parser/type'; 10 11 import type { OpenApi } from '../interfaces/OpenApi'; 11 12 import type { OpenApiParameter } from '../interfaces/OpenApiParameter'; 12 13 import type { OpenApiSchema } from '../interfaces/OpenApiSchema';
+4 -3
packages/openapi-ts/src/openApi/v3/parser/getOperationParameters.ts
··· 1 + import type { OperationParameters } from '~/openApi/common/interfaces/client'; 2 + import { getRef } from '~/openApi/common/parser/getRef'; 3 + import { operationParameterFilterFn } from '~/openApi/common/parser/operation'; 4 + 1 5 import type { Client } from '../../../types/client'; 2 - import type { OperationParameters } from '../../common/interfaces/client'; 3 - import { getRef } from '../../common/parser/getRef'; 4 - import { operationParameterFilterFn } from '../../common/parser/operation'; 5 6 import type { OpenApi } from '../interfaces/OpenApi'; 6 7 import type { OpenApiParameter } from '../interfaces/OpenApiParameter'; 7 8 import { getOperationParameter } from './getOperationParameter';
+4 -3
packages/openapi-ts/src/openApi/v3/parser/getOperationRequestBody.ts
··· 1 + import type { OperationParameter } from '~/openApi/common/interfaces/client'; 2 + import { getPattern } from '~/openApi/common/parser/getPattern'; 3 + import { getType } from '~/openApi/common/parser/type'; 4 + 1 5 import type { Client } from '../../../types/client'; 2 - import type { OperationParameter } from '../../common/interfaces/client'; 3 - import { getPattern } from '../../common/parser/getPattern'; 4 - import { getType } from '../../common/parser/type'; 5 6 import type { OpenApi } from '../interfaces/OpenApi'; 6 7 import type { OpenApiRequestBody } from '../interfaces/OpenApiRequestBody'; 7 8 import { getContent } from './getContent';
+5 -4
packages/openapi-ts/src/openApi/v3/parser/getOperationResponse.ts
··· 1 + import type { OperationResponse } from '~/openApi/common/interfaces/client'; 2 + import { getPattern } from '~/openApi/common/parser/getPattern'; 3 + import { getRef } from '~/openApi/common/parser/getRef'; 4 + import { getType } from '~/openApi/common/parser/type'; 5 + 1 6 import type { Client } from '../../../types/client'; 2 - import type { OperationResponse } from '../../common/interfaces/client'; 3 - import { getPattern } from '../../common/parser/getPattern'; 4 - import { getRef } from '../../common/parser/getRef'; 5 - import { getType } from '../../common/parser/type'; 6 7 import type { OpenApi } from '../interfaces/OpenApi'; 7 8 import type { OpenApiResponse } from '../interfaces/OpenApiResponse'; 8 9 import type { OpenApiSchema } from '../interfaces/OpenApiSchema';
+5 -4
packages/openapi-ts/src/openApi/v3/parser/getOperationResponses.ts
··· 1 - import type { Client } from '../../../types/client'; 2 - import type { OperationResponse } from '../../common/interfaces/client'; 3 - import { getRef } from '../../common/parser/getRef'; 1 + import type { OperationResponse } from '~/openApi/common/interfaces/client'; 2 + import { getRef } from '~/openApi/common/parser/getRef'; 4 3 import { 5 4 parseResponseStatusCode, 6 5 sorterByResponseStatusCode, 7 6 tagResponseTypes, 8 - } from '../../common/parser/operation'; 7 + } from '~/openApi/common/parser/operation'; 8 + 9 + import type { Client } from '../../../types/client'; 9 10 import type { OpenApi } from '../interfaces/OpenApi'; 10 11 import type { OpenApiResponse } from '../interfaces/OpenApiResponse'; 11 12 import type { OpenApiResponses } from '../interfaces/OpenApiResponses';
+6 -5
packages/openapi-ts/src/openApi/v3/parser/getOperations.ts
··· 1 - import { createOperationKey } from '../../../ir/operation'; 2 - import { getConfig } from '../../../utils/config'; 3 - import type { Client, Operation } from '../../common/interfaces/client'; 4 - import { operationFilterFn } from '../../common/parser/operation'; 5 - import { allowedServiceMethods } from '../../common/parser/service'; 1 + import { createOperationKey } from '~/ir/operation'; 2 + import type { Client, Operation } from '~/openApi/common/interfaces/client'; 3 + import { operationFilterFn } from '~/openApi/common/parser/operation'; 4 + import { allowedServiceMethods } from '~/openApi/common/parser/service'; 5 + import { getConfig } from '~/utils/config'; 6 + 6 7 import type { OpenApi } from '../interfaces/OpenApi'; 7 8 import { getOperationParameters } from './getOperationParameters'; 8 9 import { getOperation } from './operation';
+4 -3
packages/openapi-ts/src/openApi/v3/parser/getRequiredPropertiesFromComposition.ts
··· 1 + import type { Model } from '~/openApi/common/interfaces/client'; 2 + import { getRef } from '~/openApi/common/parser/getRef'; 3 + import { getType } from '~/openApi/common/parser/type'; 4 + 1 5 import type { Client } from '../../../types/client'; 2 - import type { Model } from '../../common/interfaces/client'; 3 - import { getRef } from '../../common/parser/getRef'; 4 - import { getType } from '../../common/parser/type'; 5 6 import type { GetModelFn } from '../interfaces/Model'; 6 7 import type { OpenApi } from '../interfaces/OpenApi'; 7 8 import type { OpenApiSchema } from '../interfaces/OpenApiSchema';
+7 -6
packages/openapi-ts/src/openApi/v3/parser/operation.ts
··· 1 - import type { Client } from '../../../types/client'; 2 - import { getConfig } from '../../../utils/config'; 3 1 import type { 4 2 Operation, 5 3 OperationParameter, 6 4 OperationParameters, 7 - } from '../../common/interfaces/client'; 8 - import { getRef } from '../../common/parser/getRef'; 5 + } from '~/openApi/common/interfaces/client'; 6 + import { getRef } from '~/openApi/common/parser/getRef'; 9 7 import { 10 8 getOperationResponseHeader, 11 9 operationNameFn, 12 - } from '../../common/parser/operation'; 13 - import { toSortedByRequired } from '../../common/parser/sort'; 10 + } from '~/openApi/common/parser/operation'; 11 + import { toSortedByRequired } from '~/openApi/common/parser/sort'; 12 + import { getConfig } from '~/utils/config'; 13 + 14 + import type { Client } from '../../../types/client'; 14 15 import type { OpenApi } from '../interfaces/OpenApi'; 15 16 import type { OpenApiOperation } from '../interfaces/OpenApiOperation'; 16 17 import type { OpenApiRequestBody } from '../interfaces/OpenApiRequestBody';
+1 -1
packages/openapi-ts/src/plugins/@angular/common/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 6 6 | 'class'
+2 -1
packages/openapi-ts/src/plugins/@angular/common/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import { Api } from './api'; 3 4 import { handler } from './plugin'; 4 5 import type { AngularCommonPlugin } from './types';
+8 -7
packages/openapi-ts/src/plugins/@angular/common/httpRequests.ts
··· 1 1 import type { Symbol } from '@hey-api/codegen-core'; 2 2 import type ts from 'typescript'; 3 3 4 - import type { IR } from '../../../ir/types'; 5 - import { buildName } from '../../../openApi/shared/utils/name'; 6 - import { tsc } from '../../../tsc'; 7 - import { stringCase } from '../../../utils/stringCase'; 8 - import { getClientPlugin } from '../../@hey-api/client-core/utils'; 9 - import { operationClasses } from '../../@hey-api/sdk/operation'; 10 - import { isOperationOptionsRequired } from '../../shared/utils/operation'; 4 + import type { IR } from '~/ir/types'; 5 + import { buildName } from '~/openApi/shared/utils/name'; 6 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 7 + import { operationClasses } from '~/plugins/@hey-api/sdk/operation'; 8 + import { isOperationOptionsRequired } from '~/plugins/shared/utils/operation'; 9 + import { tsc } from '~/tsc'; 10 + import { stringCase } from '~/utils/stringCase'; 11 + 11 12 import type { AngularCommonPlugin } from './types'; 12 13 13 14 interface AngularRequestClassEntry {
+7 -6
packages/openapi-ts/src/plugins/@angular/common/httpResources.ts
··· 1 1 import type { Symbol } from '@hey-api/codegen-core'; 2 2 import type ts from 'typescript'; 3 3 4 - import type { IR } from '../../../ir/types'; 5 - import { buildName } from '../../../openApi/shared/utils/name'; 6 - import { tsc } from '../../../tsc'; 7 - import { stringCase } from '../../../utils/stringCase'; 8 - import { operationClasses } from '../../@hey-api/sdk/operation'; 9 - import { isOperationOptionsRequired } from '../../shared/utils/operation'; 4 + import type { IR } from '~/ir/types'; 5 + import { buildName } from '~/openApi/shared/utils/name'; 6 + import { operationClasses } from '~/plugins/@hey-api/sdk/operation'; 7 + import { isOperationOptionsRequired } from '~/plugins/shared/utils/operation'; 8 + import { tsc } from '~/tsc'; 9 + import { stringCase } from '~/utils/stringCase'; 10 + 10 11 import type { AngularCommonPlugin } from './types'; 11 12 12 13 interface AngularServiceClassEntry {
+3 -2
packages/openapi-ts/src/plugins/@angular/common/types.d.ts
··· 1 - import type { StringName } from '../../../types/case'; 2 - import type { DefinePlugin, Plugin } from '../../types'; 1 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 2 + import type { StringName } from '~/types/case'; 3 + 3 4 import type { IApi } from './api'; 4 5 5 6 export type UserConfig = Plugin.Name<'@angular/common'> &
+1 -1
packages/openapi-ts/src/plugins/@hey-api/client-angular/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 'client'; 6 6
+7 -3
packages/openapi-ts/src/plugins/@hey-api/client-angular/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 2 - import { clientDefaultConfig, clientDefaultMeta } from '../client-core/config'; 3 - import { clientPluginHandler } from '../client-core/plugin'; 1 + import { 2 + clientDefaultConfig, 3 + clientDefaultMeta, 4 + } from '~/plugins/@hey-api/client-core/config'; 5 + import { clientPluginHandler } from '~/plugins/@hey-api/client-core/plugin'; 6 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 7 + 4 8 import { Api } from './api'; 5 9 import type { HeyApiClientAngularPlugin } from './types'; 6 10
+3 -2
packages/openapi-ts/src/plugins/@hey-api/client-angular/types.d.ts
··· 1 - import type { DefinePlugin, Plugin } from '../../types'; 2 - import type { Client } from '../client-core/types'; 1 + import type { Client } from '~/plugins/@hey-api/client-core/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 + 3 4 import type { IApi } from './api'; 4 5 5 6 export type UserConfig = Plugin.Name<'@hey-api/client-angular'> &
+1 -1
packages/openapi-ts/src/plugins/@hey-api/client-axios/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 'client'; 6 6
+7 -3
packages/openapi-ts/src/plugins/@hey-api/client-axios/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 2 - import { clientDefaultConfig, clientDefaultMeta } from '../client-core/config'; 3 - import { clientPluginHandler } from '../client-core/plugin'; 1 + import { 2 + clientDefaultConfig, 3 + clientDefaultMeta, 4 + } from '~/plugins/@hey-api/client-core/config'; 5 + import { clientPluginHandler } from '~/plugins/@hey-api/client-core/plugin'; 6 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 7 + 4 8 import { Api } from './api'; 5 9 import type { HeyApiClientAxiosPlugin } from './types'; 6 10
+3 -2
packages/openapi-ts/src/plugins/@hey-api/client-axios/types.d.ts
··· 1 - import type { DefinePlugin, Plugin } from '../../types'; 2 - import type { Client } from '../client-core/types'; 1 + import type { Client } from '~/plugins/@hey-api/client-core/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 + 3 4 import type { IApi } from './api'; 4 5 5 6 export type UserConfig = Plugin.Name<'@hey-api/client-axios'> &
+4 -3
packages/openapi-ts/src/plugins/@hey-api/client-core/client.ts
··· 1 - import { clientFolderAbsolutePath } from '../../../generate/client'; 2 - import { tsc } from '../../../tsc'; 3 - import { parseUrl } from '../../../utils/url'; 1 + import { clientFolderAbsolutePath } from '~/generate/client'; 2 + import { tsc } from '~/tsc'; 3 + import { parseUrl } from '~/utils/url'; 4 + 4 5 import type { PluginHandler } from './types'; 5 6 import { getClientBaseUrlKey } from './utils'; 6 7
+3 -2
packages/openapi-ts/src/plugins/@hey-api/client-core/createClientConfig.ts
··· 1 - import { clientFolderAbsolutePath } from '../../../generate/client'; 2 - import { tsc } from '../../../tsc'; 1 + import { clientFolderAbsolutePath } from '~/generate/client'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import type { PluginHandler } from './types'; 4 5 5 6 export const createClientConfigType = ({
+7 -7
packages/openapi-ts/src/plugins/@hey-api/client-core/types.d.ts
··· 1 - import type { Plugin } from '../../types'; 2 - import type { HeyApiClientAngularPlugin } from '../client-angular'; 3 - import type { HeyApiClientAxiosPlugin } from '../client-axios'; 4 - import type { HeyApiClientFetchPlugin } from '../client-fetch'; 5 - import type { HeyApiClientNextPlugin } from '../client-next'; 6 - import type { HeyApiClientNuxtPlugin } from '../client-nuxt'; 7 - import type { HeyApiClientOfetchPlugin } from '../client-ofetch'; 1 + import type { HeyApiClientAngularPlugin } from '~/plugins/@hey-api/client-angular'; 2 + import type { HeyApiClientAxiosPlugin } from '~/plugins/@hey-api/client-axios'; 3 + import type { HeyApiClientFetchPlugin } from '~/plugins/@hey-api/client-fetch'; 4 + import type { HeyApiClientNextPlugin } from '~/plugins/@hey-api/client-next'; 5 + import type { HeyApiClientNuxtPlugin } from '~/plugins/@hey-api/client-nuxt'; 6 + import type { HeyApiClientOfetchPlugin } from '~/plugins/@hey-api/client-ofetch'; 7 + import type { Plugin } from '~/plugins/types'; 8 8 9 9 export interface PluginHandler { 10 10 (...args: Parameters<HeyApiClientAngularPlugin['Handler']>): void;
+2 -2
packages/openapi-ts/src/plugins/@hey-api/client-core/utils.ts
··· 1 - import type { Config } from '../../../types/config'; 2 - import type { PluginClientNames } from '../../types'; 1 + import type { PluginClientNames } from '~/plugins/types'; 2 + import type { Config } from '~/types/config'; 3 3 4 4 export const getClientBaseUrlKey = (config: Config) => { 5 5 const client = getClientPlugin(config);
+1 -1
packages/openapi-ts/src/plugins/@hey-api/client-fetch/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 'client'; 6 6
+7 -3
packages/openapi-ts/src/plugins/@hey-api/client-fetch/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 2 - import { clientDefaultConfig, clientDefaultMeta } from '../client-core/config'; 3 - import { clientPluginHandler } from '../client-core/plugin'; 1 + import { 2 + clientDefaultConfig, 3 + clientDefaultMeta, 4 + } from '~/plugins/@hey-api/client-core/config'; 5 + import { clientPluginHandler } from '~/plugins/@hey-api/client-core/plugin'; 6 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 7 + 4 8 import { Api } from './api'; 5 9 import type { HeyApiClientFetchPlugin } from './types'; 6 10
+3 -2
packages/openapi-ts/src/plugins/@hey-api/client-fetch/types.d.ts
··· 1 - import type { DefinePlugin, Plugin } from '../../types'; 2 - import type { Client } from '../client-core/types'; 1 + import type { Client } from '~/plugins/@hey-api/client-core/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 + 3 4 import type { IApi } from './api'; 4 5 5 6 export type UserConfig = Plugin.Name<'@hey-api/client-fetch'> &
+1 -1
packages/openapi-ts/src/plugins/@hey-api/client-next/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 'client'; 6 6
+7 -3
packages/openapi-ts/src/plugins/@hey-api/client-next/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 2 - import { clientDefaultConfig, clientDefaultMeta } from '../client-core/config'; 3 - import { clientPluginHandler } from '../client-core/plugin'; 1 + import { 2 + clientDefaultConfig, 3 + clientDefaultMeta, 4 + } from '~/plugins/@hey-api/client-core/config'; 5 + import { clientPluginHandler } from '~/plugins/@hey-api/client-core/plugin'; 6 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 7 + 4 8 import { Api } from './api'; 5 9 import type { HeyApiClientNextPlugin } from './types'; 6 10
+3 -2
packages/openapi-ts/src/plugins/@hey-api/client-next/types.d.ts
··· 1 - import type { DefinePlugin, Plugin } from '../../types'; 2 - import type { Client } from '../client-core/types'; 1 + import type { Client } from '~/plugins/@hey-api/client-core/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 + 3 4 import type { IApi } from './api'; 4 5 5 6 export type UserConfig = Plugin.Name<'@hey-api/client-next'> &
+1 -1
packages/openapi-ts/src/plugins/@hey-api/client-nuxt/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 'client'; 6 6
+7 -3
packages/openapi-ts/src/plugins/@hey-api/client-nuxt/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 2 - import { clientDefaultConfig, clientDefaultMeta } from '../client-core/config'; 3 - import { clientPluginHandler } from '../client-core/plugin'; 1 + import { 2 + clientDefaultConfig, 3 + clientDefaultMeta, 4 + } from '~/plugins/@hey-api/client-core/config'; 5 + import { clientPluginHandler } from '~/plugins/@hey-api/client-core/plugin'; 6 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 7 + 4 8 import { Api } from './api'; 5 9 import type { HeyApiClientNuxtPlugin } from './types'; 6 10
+3 -2
packages/openapi-ts/src/plugins/@hey-api/client-nuxt/types.d.ts
··· 1 - import type { DefinePlugin, Plugin } from '../../types'; 2 - import type { Client } from '../client-core/types'; 1 + import type { Client } from '~/plugins/@hey-api/client-core/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 + 3 4 import type { IApi } from './api'; 4 5 5 6 export type UserConfig = Plugin.Name<'@hey-api/client-nuxt'> & Client.Config;
+1 -1
packages/openapi-ts/src/plugins/@hey-api/client-ofetch/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 'client'; 6 6
+7 -3
packages/openapi-ts/src/plugins/@hey-api/client-ofetch/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 2 - import { clientDefaultConfig, clientDefaultMeta } from '../client-core/config'; 3 - import { clientPluginHandler } from '../client-core/plugin'; 1 + import { 2 + clientDefaultConfig, 3 + clientDefaultMeta, 4 + } from '~/plugins/@hey-api/client-core/config'; 5 + import { clientPluginHandler } from '~/plugins/@hey-api/client-core/plugin'; 6 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 7 + 4 8 import { Api } from './api'; 5 9 import type { HeyApiClientOfetchPlugin } from './types'; 6 10
+3 -2
packages/openapi-ts/src/plugins/@hey-api/client-ofetch/types.d.ts
··· 1 - import type { DefinePlugin, Plugin } from '../../types'; 2 - import type { Client } from '../client-core/types'; 1 + import type { Client } from '~/plugins/@hey-api/client-core/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 + 3 4 import type { IApi } from './api'; 4 5 5 6 export type UserConfig = Plugin.Name<'@hey-api/client-ofetch'> &
+2 -1
packages/openapi-ts/src/plugins/@hey-api/legacy-angular/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import type { HeyApiClientLegacyAngularPlugin } from './types'; 3 4 4 5 export const defaultConfig: HeyApiClientLegacyAngularPlugin['Config'] = {
+2 -2
packages/openapi-ts/src/plugins/@hey-api/legacy-angular/types.d.ts
··· 1 - import type { DefinePlugin, Plugin } from '../../types'; 2 - import type { Client } from '../client-core/types'; 1 + import type { Client } from '~/plugins/@hey-api/client-core/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 3 4 4 export type UserConfig = Plugin.Name<'legacy/angular'> & 5 5 Pick<Client.Config, 'output'>;
+2 -1
packages/openapi-ts/src/plugins/@hey-api/legacy-axios/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import type { HeyApiClientLegacyAxiosPlugin } from './types'; 3 4 4 5 export const defaultConfig: HeyApiClientLegacyAxiosPlugin['Config'] = {
+2 -2
packages/openapi-ts/src/plugins/@hey-api/legacy-axios/types.d.ts
··· 1 - import type { DefinePlugin, Plugin } from '../../types'; 2 - import type { Client } from '../client-core/types'; 1 + import type { Client } from '~/plugins/@hey-api/client-core/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 3 4 4 export type UserConfig = Plugin.Name<'legacy/axios'> & 5 5 Pick<Client.Config, 'output'>;
+2 -1
packages/openapi-ts/src/plugins/@hey-api/legacy-fetch/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import type { HeyApiClientLegacyFetchPlugin } from './types'; 3 4 4 5 export const defaultConfig: HeyApiClientLegacyFetchPlugin['Config'] = {
+2 -2
packages/openapi-ts/src/plugins/@hey-api/legacy-fetch/types.d.ts
··· 1 - import type { DefinePlugin, Plugin } from '../../types'; 2 - import type { Client } from '../client-core/types'; 1 + import type { Client } from '~/plugins/@hey-api/client-core/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 3 4 4 export type UserConfig = Plugin.Name<'legacy/fetch'> & 5 5 Pick<Client.Config, 'output'>;
+2 -1
packages/openapi-ts/src/plugins/@hey-api/legacy-node/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import type { HeyApiClientLegacyNodePlugin } from './types'; 3 4 4 5 export const defaultConfig: HeyApiClientLegacyNodePlugin['Config'] = {
+2 -2
packages/openapi-ts/src/plugins/@hey-api/legacy-node/types.d.ts
··· 1 - import type { DefinePlugin, Plugin } from '../../types'; 2 - import type { Client } from '../client-core/types'; 1 + import type { Client } from '~/plugins/@hey-api/client-core/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 3 4 4 export type UserConfig = Plugin.Name<'legacy/node'> & 5 5 Pick<Client.Config, 'output'>;
+2 -1
packages/openapi-ts/src/plugins/@hey-api/legacy-xhr/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import type { HeyApiClientLegacyXhrPlugin } from './types'; 3 4 4 5 export const defaultConfig: HeyApiClientLegacyXhrPlugin['Config'] = {
+2 -2
packages/openapi-ts/src/plugins/@hey-api/legacy-xhr/types.d.ts
··· 1 - import type { DefinePlugin, Plugin } from '../../types'; 2 - import type { Client } from '../client-core/types'; 1 + import type { Client } from '~/plugins/@hey-api/client-core/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 3 4 4 export type UserConfig = Plugin.Name<'legacy/xhr'> & 5 5 Pick<Client.Config, 'output'>;
+6 -5
packages/openapi-ts/src/plugins/@hey-api/schemas/__tests__/schemas.test.ts
··· 4 4 import type ts from 'typescript'; 5 5 import { describe, expect, it, vi } from 'vitest'; 6 6 7 - import { client, openApi } from '../../../../generate/__tests__/mocks'; 8 - import type { OpenApiV3Schema } from '../../../../openApi'; 9 - import type { Files } from '../../../../types/utils'; 10 - import { setConfig } from '../../../../utils/config'; 11 - import { PluginInstance } from '../../../shared/utils/instance'; 7 + import { client, openApi } from '~/generate/__tests__/mocks'; 8 + import type { OpenApiV3Schema } from '~/openApi'; 9 + import { PluginInstance } from '~/plugins/shared/utils/instance'; 10 + import type { Files } from '~/types/utils'; 11 + import { setConfig } from '~/utils/config'; 12 + 12 13 import { handlerLegacy } from '../plugin-legacy'; 13 14 14 15 vi.mock('node:fs');
+1 -1
packages/openapi-ts/src/plugins/@hey-api/schemas/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 'ref'; 6 6
+2 -1
packages/openapi-ts/src/plugins/@hey-api/schemas/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import { Api } from './api'; 3 4 import { handler } from './plugin'; 4 5 import { handlerLegacy } from './plugin-legacy';
+6 -5
packages/openapi-ts/src/plugins/@hey-api/schemas/plugin-legacy.ts
··· 1 - import { GeneratedFile } from '../../../generate/file'; 2 - import type { OpenApiV2Schema, OpenApiV3Schema } from '../../../openApi'; 3 - import { ensureValidTypeScriptJavaScriptIdentifier } from '../../../openApi'; 4 - import { tsc } from '../../../tsc'; 5 - import { getConfig } from '../../../utils/config'; 1 + import { GeneratedFile } from '~/generate/file'; 2 + import type { OpenApiV2Schema, OpenApiV3Schema } from '~/openApi'; 3 + import { ensureValidTypeScriptJavaScriptIdentifier } from '~/openApi'; 4 + import { tsc } from '~/tsc'; 5 + import { getConfig } from '~/utils/config'; 6 + 6 7 import type { HeyApiSchemasPlugin } from './types'; 7 8 8 9 const ensureValidSchemaOutput = (
+9 -8
packages/openapi-ts/src/plugins/@hey-api/schemas/plugin.ts
··· 1 - import { satisfies } from '../../../config/utils/package'; 2 - import type { IR } from '../../../ir/types'; 3 - import type { OpenApiV2_0_XTypes } from '../../../openApi/2.0.x'; 4 - import type { OpenApiV3_0_XTypes } from '../../../openApi/3.0.x'; 5 - import type { OpenApiV3_1_XTypes } from '../../../openApi/3.1.x'; 6 - import { ensureValidIdentifier } from '../../../openApi/shared/utils/identifier'; 7 - import type { OpenApi } from '../../../openApi/types'; 8 - import { tsc } from '../../../tsc'; 1 + import { satisfies } from '~/config/utils/package'; 2 + import type { IR } from '~/ir/types'; 3 + import type { OpenApiV2_0_XTypes } from '~/openApi/2.0.x'; 4 + import type { OpenApiV3_0_XTypes } from '~/openApi/3.0.x'; 5 + import type { OpenApiV3_1_XTypes } from '~/openApi/3.1.x'; 6 + import { ensureValidIdentifier } from '~/openApi/shared/utils/identifier'; 7 + import type { OpenApi } from '~/openApi/types'; 8 + import { tsc } from '~/tsc'; 9 + 9 10 import type { HeyApiSchemasPlugin } from './types'; 10 11 11 12 const stripSchema = ({
+6 -5
packages/openapi-ts/src/plugins/@hey-api/schemas/types.d.ts
··· 1 - import type { OpenApiV2Schema, OpenApiV3Schema } from '../../../openApi'; 2 - import type { OpenApiV2_0_XTypes } from '../../../openApi/2.0.x'; 3 - import type { OpenApiV3_0_XTypes } from '../../../openApi/3.0.x'; 4 - import type { OpenApiV3_1_XTypes } from '../../../openApi/3.1.x'; 5 - import type { DefinePlugin, Plugin } from '../../types'; 1 + import type { OpenApiV2Schema, OpenApiV3Schema } from '~/openApi'; 2 + import type { OpenApiV2_0_XTypes } from '~/openApi/2.0.x'; 3 + import type { OpenApiV3_0_XTypes } from '~/openApi/3.0.x'; 4 + import type { OpenApiV3_1_XTypes } from '~/openApi/3.1.x'; 5 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 6 + 6 7 import type { IApi } from './api'; 7 8 8 9 export type UserConfig = Plugin.Name<'@hey-api/schemas'> &
+8 -7
packages/openapi-ts/src/plugins/@hey-api/sdk/__tests__/plugin.test.ts
··· 5 5 import type ts from 'typescript'; 6 6 import { describe, expect, it, vi } from 'vitest'; 7 7 8 - import { openApi } from '../../../../generate/__tests__/mocks'; 9 - import { GeneratedFile } from '../../../../generate/file'; 10 - import type { Operation } from '../../../../types/client'; 11 - import type { Config } from '../../../../types/config'; 12 - import type { Files } from '../../../../types/utils'; 13 - import { setConfig } from '../../../../utils/config'; 14 - import { PluginInstance } from '../../../shared/utils/instance'; 8 + import { openApi } from '~/generate/__tests__/mocks'; 9 + import { GeneratedFile } from '~/generate/file'; 10 + import { PluginInstance } from '~/plugins/shared/utils/instance'; 11 + import type { Operation } from '~/types/client'; 12 + import type { Config } from '~/types/config'; 13 + import type { Files } from '~/types/utils'; 14 + import { setConfig } from '~/utils/config'; 15 + 15 16 import { handlerLegacy } from '../plugin-legacy'; 16 17 17 18 vi.mock('node:fs');
+2 -1
packages/openapi-ts/src/plugins/@hey-api/sdk/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 + 4 5 import { createOperationComment } from './comment'; 5 6 6 7 type SelectorType =
+2 -1
packages/openapi-ts/src/plugins/@hey-api/sdk/auth.ts
··· 1 - import type { IR } from '../../../ir/types'; 1 + import type { IR } from '~/ir/types'; 2 + 2 3 import type { Auth } from '../client-core/bundle/auth'; 3 4 import type { HeyApiSdkPlugin } from './types'; 4 5
+3 -3
packages/openapi-ts/src/plugins/@hey-api/sdk/comment.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import type { Comments } from '../../../tsc'; 3 - import { escapeComment } from '../../../utils/escape'; 1 + import type { IR } from '~/ir/types'; 2 + import type { Comments } from '~/tsc'; 3 + import { escapeComment } from '~/utils/escape'; 4 4 5 5 export const createOperationComment = ({ 6 6 operation,
+2 -1
packages/openapi-ts/src/plugins/@hey-api/sdk/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import { Api } from './api'; 3 4 import { handler } from './plugin'; 4 5 import { handlerLegacy } from './plugin-legacy';
+11 -10
packages/openapi-ts/src/plugins/@hey-api/sdk/operation.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { statusCodeToGroup } from '../../../ir/operation'; 4 - import type { IR } from '../../../ir/types'; 5 - import { sanitizeNamespaceIdentifier } from '../../../openApi'; 6 - import { ensureValidIdentifier } from '../../../openApi/shared/utils/identifier'; 7 - import { tsc } from '../../../tsc'; 8 - import type { FunctionParameter, ObjectValue } from '../../../tsc/types'; 9 - import { reservedJavaScriptKeywordsRegExp } from '../../../utils/regexp'; 10 - import { stringCase } from '../../../utils/stringCase'; 11 - import { transformClassName } from '../../../utils/transform'; 3 + import { statusCodeToGroup } from '~/ir/operation'; 4 + import type { IR } from '~/ir/types'; 5 + import { sanitizeNamespaceIdentifier } from '~/openApi'; 6 + import { ensureValidIdentifier } from '~/openApi/shared/utils/identifier'; 7 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 8 + import { tsc } from '~/tsc'; 9 + import type { FunctionParameter, ObjectValue } from '~/tsc/types'; 10 + import { reservedJavaScriptKeywordsRegExp } from '~/utils/regexp'; 11 + import { stringCase } from '~/utils/stringCase'; 12 + import { transformClassName } from '~/utils/transform'; 13 + 12 14 import type { Field, Fields } from '../client-core/bundle/params'; 13 - import { getClientPlugin } from '../client-core/utils'; 14 15 import { operationAuth } from './auth'; 15 16 import { nuxtTypeComposable, nuxtTypeDefault } from './constants'; 16 17 // import { getSignatureParameters } from './signature';
+18 -17
packages/openapi-ts/src/plugins/@hey-api/sdk/plugin-legacy.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { clientModulePath } from '../../../generate/client'; 4 - import { GeneratedFile } from '../../../generate/file'; 5 - import type { IR } from '../../../ir/types'; 6 - import { isOperationParameterRequired } from '../../../openApi'; 7 - import type { Comments, FunctionParameter } from '../../../tsc'; 8 - import { tsc } from '../../../tsc'; 9 - import type { FunctionTypeParameter, ObjectValue } from '../../../tsc/types'; 3 + import { clientModulePath } from '~/generate/client'; 4 + import { GeneratedFile } from '~/generate/file'; 5 + import type { IR } from '~/ir/types'; 6 + import { isOperationParameterRequired } from '~/openApi'; 7 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 8 + import type { Comments, FunctionParameter } from '~/tsc'; 9 + import { tsc } from '~/tsc'; 10 + import type { FunctionTypeParameter, ObjectValue } from '~/tsc/types'; 10 11 import type { 11 12 Client, 12 13 Model, 13 14 Operation, 14 15 OperationParameter, 15 16 Service, 16 - } from '../../../types/client'; 17 - import type { Config as ClientConfig } from '../../../types/config'; 17 + } from '~/types/client'; 18 + import type { Config as ClientConfig } from '~/types/config'; 18 19 import { 19 20 getConfig, 20 21 isLegacyClient, 21 22 legacyNameFromConfig, 22 - } from '../../../utils/config'; 23 - import { escapeComment, escapeName } from '../../../utils/escape'; 24 - import { reservedJavaScriptKeywordsRegExp } from '../../../utils/regexp'; 25 - import { stringCase } from '../../../utils/stringCase'; 26 - import { transformClassName } from '../../../utils/transform'; 27 - import { setUniqueTypeName } from '../../../utils/type'; 28 - import { unique } from '../../../utils/unique'; 29 - import { getClientPlugin } from '../client-core/utils'; 23 + } from '~/utils/config'; 24 + import { escapeComment, escapeName } from '~/utils/escape'; 25 + import { reservedJavaScriptKeywordsRegExp } from '~/utils/regexp'; 26 + import { stringCase } from '~/utils/stringCase'; 27 + import { transformClassName } from '~/utils/transform'; 28 + import { setUniqueTypeName } from '~/utils/type'; 29 + import { unique } from '~/utils/unique'; 30 + 30 31 import type { HeyApiSdkPlugin } from './types'; 31 32 32 33 type OnNode = (node: ts.Node) => void;
+6 -5
packages/openapi-ts/src/plugins/@hey-api/sdk/plugin.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { clientFolderAbsolutePath } from '../../../generate/client'; 4 - import { tsc } from '../../../tsc'; 5 - import { stringCase } from '../../../utils/stringCase'; 6 - import { isOperationOptionsRequired } from '../../shared/utils/operation'; 7 - import { getClientPlugin } from '../client-core/utils'; 3 + import { clientFolderAbsolutePath } from '~/generate/client'; 4 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 5 + import { isOperationOptionsRequired } from '~/plugins/shared/utils/operation'; 6 + import { tsc } from '~/tsc'; 7 + import { stringCase } from '~/utils/stringCase'; 8 + 8 9 import { nuxtTypeComposable, nuxtTypeDefault } from './constants'; 9 10 import { 10 11 operationClasses,
+1 -1
packages/openapi-ts/src/plugins/@hey-api/sdk/signature.ts
··· 1 - import type { IR } from '../../../ir/types'; 1 + import type { IR } from '~/ir/types'; 2 2 3 3 type Location = keyof IR.ParametersObject | 'body'; 4 4
+4 -3
packages/openapi-ts/src/plugins/@hey-api/sdk/typeOptions.ts
··· 1 - import { clientFolderAbsolutePath } from '../../../generate/client'; 2 - import { tsc } from '../../../tsc'; 3 - import { getClientPlugin } from '../client-core/utils'; 1 + import { clientFolderAbsolutePath } from '~/generate/client'; 2 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 3 + import { tsc } from '~/tsc'; 4 + 4 5 import { nuxtTypeDefault, nuxtTypeResponse } from './constants'; 5 6 import type { HeyApiSdkPlugin } from './types'; 6 7
+5 -4
packages/openapi-ts/src/plugins/@hey-api/sdk/types.d.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import type { StringName } from '../../../types/case'; 3 - import type { Operation } from '../../../types/client'; 1 + import type { IR } from '~/ir/types'; 4 2 import type { 5 3 DefinePlugin, 6 4 Plugin, 7 5 PluginClientNames, 8 6 PluginValidatorNames, 9 - } from '../../types'; 7 + } from '~/plugins/types'; 8 + import type { StringName } from '~/types/case'; 9 + import type { Operation } from '~/types/client'; 10 + 10 11 import type { IApi } from './api'; 11 12 12 13 export type UserConfig = Plugin.Name<'@hey-api/sdk'> &
+2 -1
packages/openapi-ts/src/plugins/@hey-api/sdk/validator.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { IR } from '../../../ir/types'; 3 + import type { IR } from '~/ir/types'; 4 + 4 5 import type { HeyApiSdkPlugin } from './types'; 5 6 6 7 interface ValidatorProps {
+1 -1
packages/openapi-ts/src/plugins/@hey-api/transformers/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 'response' | 'response-ref'; 6 6
+2 -1
packages/openapi-ts/src/plugins/@hey-api/transformers/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import { Api } from './api'; 3 4 import { bigIntExpressions, dateExpressions } from './expressions'; 4 5 import { handler } from './plugin';
+3 -2
packages/openapi-ts/src/plugins/@hey-api/transformers/expressions.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { IR } from '../../../ir/types'; 4 - import { tsc } from '../../../tsc'; 3 + import type { IR } from '~/ir/types'; 4 + import { tsc } from '~/tsc'; 5 + 5 6 import type { UserConfig } from './types'; 6 7 7 8 export type ExpressionTransformer = ({
+11 -7
packages/openapi-ts/src/plugins/@hey-api/transformers/plugin-legacy.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { createOperationKey } from '../../../ir/operation'; 4 - import { tsc } from '../../../tsc'; 5 - import type { ModelMeta, OperationResponse } from '../../../types/client'; 6 - import { getConfig } from '../../../utils/config'; 7 - import { isModelDate, unsetUniqueTypeName } from '../../../utils/type'; 3 + import { createOperationKey } from '~/ir/operation'; 8 4 import { 9 5 modelResponseTransformerTypeName, 10 6 operationResponseTransformerTypeName, 11 7 operationResponseTypeName, 12 - } from '../sdk/plugin-legacy'; 13 - import { generateType, type TypesProps } from '../typescript/plugin-legacy'; 8 + } from '~/plugins/@hey-api/sdk/plugin-legacy'; 9 + import { 10 + generateType, 11 + type TypesProps, 12 + } from '~/plugins/@hey-api/typescript/plugin-legacy'; 13 + import { tsc } from '~/tsc'; 14 + import type { ModelMeta, OperationResponse } from '~/types/client'; 15 + import { getConfig } from '~/utils/config'; 16 + import { isModelDate, unsetUniqueTypeName } from '~/utils/type'; 17 + 14 18 import type { HeyApiTransformersPlugin } from './types'; 15 19 16 20 interface ModelProps extends TypesProps {
+6 -8
packages/openapi-ts/src/plugins/@hey-api/transformers/plugin.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { 4 - createOperationKey, 5 - operationResponsesMap, 6 - } from '../../../ir/operation'; 7 - import type { IR } from '../../../ir/types'; 8 - import { buildName } from '../../../openApi/shared/utils/name'; 9 - import { tsc } from '../../../tsc'; 10 - import { refToName } from '../../../utils/ref'; 3 + import { createOperationKey, operationResponsesMap } from '~/ir/operation'; 4 + import type { IR } from '~/ir/types'; 5 + import { buildName } from '~/openApi/shared/utils/name'; 6 + import { tsc } from '~/tsc'; 7 + import { refToName } from '~/utils/ref'; 8 + 11 9 import type { HeyApiTransformersPlugin } from './types'; 12 10 13 11 const dataVariableName = 'data';
+3 -2
packages/openapi-ts/src/plugins/@hey-api/transformers/types.d.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { IR } from '../../../ir/types'; 4 - import type { DefinePlugin, Plugin } from '../../types'; 3 + import type { IR } from '~/ir/types'; 4 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 5 + 5 6 import type { IApi } from './api'; 6 7 import type { ExpressionTransformer } from './expressions'; 7 8
+6 -5
packages/openapi-ts/src/plugins/@hey-api/typescript/__tests__/plugin.test.ts
··· 4 4 import type ts from 'typescript'; 5 5 import { describe, expect, it, vi } from 'vitest'; 6 6 7 - import { openApi } from '../../../../generate/__tests__/mocks'; 8 - import { GeneratedFile } from '../../../../generate/file'; 9 - import type { Config } from '../../../../types/config'; 10 - import { setConfig } from '../../../../utils/config'; 11 - import { PluginInstance } from '../../../shared/utils/instance'; 7 + import { openApi } from '~/generate/__tests__/mocks'; 8 + import { GeneratedFile } from '~/generate/file'; 9 + import { PluginInstance } from '~/plugins/shared/utils/instance'; 10 + import type { Config } from '~/types/config'; 11 + import { setConfig } from '~/utils/config'; 12 + 12 13 import { handlerLegacy } from '../plugin-legacy'; 13 14 14 15 vi.mock('node:fs');
+2 -1
packages/openapi-ts/src/plugins/@hey-api/typescript/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 import type ts from 'typescript'; 3 3 4 - import type { Plugin } from '../../types'; 4 + import type { Plugin } from '~/plugins/types'; 5 + 5 6 import { schemaToType } from './plugin'; 6 7 7 8 type SelectorType =
+8 -4
packages/openapi-ts/src/plugins/@hey-api/typescript/clientOptions.ts
··· 1 1 import type { Symbol } from '@hey-api/codegen-core'; 2 2 import ts from 'typescript'; 3 3 4 - import type { IR } from '../../../ir/types'; 5 - import { tsc } from '../../../tsc'; 6 - import { parseUrl } from '../../../utils/url'; 7 - import { getClientBaseUrlKey, getClientPlugin } from '../client-core/utils'; 4 + import type { IR } from '~/ir/types'; 5 + import { 6 + getClientBaseUrlKey, 7 + getClientPlugin, 8 + } from '~/plugins/@hey-api/client-core/utils'; 9 + import { tsc } from '~/tsc'; 10 + import { parseUrl } from '~/utils/url'; 11 + 8 12 import type { HeyApiTypeScriptPlugin } from './types'; 9 13 10 14 const stringType = tsc.keywordTypeNode({ keyword: 'string' });
+2 -1
packages/openapi-ts/src/plugins/@hey-api/typescript/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import { Api } from './api'; 3 4 import { handler } from './plugin'; 4 5 import { handlerLegacy } from './plugin-legacy';
+6 -5
packages/openapi-ts/src/plugins/@hey-api/typescript/export.ts
··· 1 1 import type { Symbol } from '@hey-api/codegen-core'; 2 2 import type ts from 'typescript'; 3 3 4 - import type { IR } from '../../../ir/types'; 5 - import { tsc } from '../../../tsc'; 6 - import { numberRegExp } from '../../../utils/regexp'; 7 - import { stringCase } from '../../../utils/stringCase'; 8 - import { createSchemaComment } from '../../shared/utils/schema'; 4 + import type { IR } from '~/ir/types'; 5 + import { createSchemaComment } from '~/plugins/shared/utils/schema'; 6 + import { tsc } from '~/tsc'; 7 + import { numberRegExp } from '~/utils/regexp'; 8 + import { stringCase } from '~/utils/stringCase'; 9 + 9 10 import type { HeyApiTypeScriptPlugin } from './types'; 10 11 11 12 const schemaToEnumObject = ({
+6 -5
packages/openapi-ts/src/plugins/@hey-api/typescript/operation.ts
··· 1 - import { operationResponsesMap } from '../../../ir/operation'; 2 - import { deduplicateSchema } from '../../../ir/schema'; 3 - import type { IR } from '../../../ir/types'; 4 - import { buildName } from '../../../openApi/shared/utils/name'; 5 - import { tsc } from '../../../tsc'; 1 + import { operationResponsesMap } from '~/ir/operation'; 2 + import { deduplicateSchema } from '~/ir/schema'; 3 + import type { IR } from '~/ir/types'; 4 + import { buildName } from '~/openApi/shared/utils/name'; 5 + import { tsc } from '~/tsc'; 6 + 6 7 import { schemaToType } from './plugin'; 7 8 import type { HeyApiTypeScriptPlugin } from './types'; 8 9
+15 -19
packages/openapi-ts/src/plugins/@hey-api/typescript/plugin-legacy.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { GeneratedFile } from '../../../generate/file'; 4 - import { isOperationParameterRequired } from '../../../openApi'; 5 - import { type Comments, tsc } from '../../../tsc'; 6 - import type { 7 - Client, 8 - Method, 9 - Model, 10 - OperationParameter, 11 - } from '../../../types/client'; 12 - import { getConfig, isLegacyClient } from '../../../utils/config'; 13 - import { enumEntry, enumUnionType } from '../../../utils/enum'; 14 - import { escapeComment } from '../../../utils/escape'; 15 - import { sortByName, sorterByName } from '../../../utils/sort'; 16 - import { 17 - setUniqueTypeName, 18 - type SetUniqueTypeNameResult, 19 - toType, 20 - } from '../../../utils/type'; 3 + import { GeneratedFile } from '~/generate/file'; 4 + import { isOperationParameterRequired } from '~/openApi'; 21 5 import { 22 6 operationDataTypeName, 23 7 operationErrorTypeName, 24 8 operationResponseTypeName, 25 - } from '../sdk/plugin-legacy'; 9 + } from '~/plugins/@hey-api/sdk/plugin-legacy'; 10 + import { type Comments, tsc } from '~/tsc'; 11 + import type { Client, Method, Model, OperationParameter } from '~/types/client'; 12 + import { getConfig, isLegacyClient } from '~/utils/config'; 13 + import { enumEntry, enumUnionType } from '~/utils/enum'; 14 + import { escapeComment } from '~/utils/escape'; 15 + import { sortByName, sorterByName } from '~/utils/sort'; 16 + import { 17 + setUniqueTypeName, 18 + type SetUniqueTypeNameResult, 19 + toType, 20 + } from '~/utils/type'; 21 + 26 22 import type { HeyApiTypeScriptPlugin } from './types'; 27 23 28 24 export interface TypesProps {
+11 -10
packages/openapi-ts/src/plugins/@hey-api/typescript/plugin.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { deduplicateSchema } from '../../../ir/schema'; 4 - import type { IR } from '../../../ir/types'; 5 - import { buildName } from '../../../openApi/shared/utils/name'; 6 - import type { Property } from '../../../tsc'; 7 - import { tsc } from '../../../tsc'; 8 - import { refToName } from '../../../utils/ref'; 9 - import { stringCase } from '../../../utils/stringCase'; 10 - import type { SchemaWithType } from '../../shared/types/schema'; 11 - import { fieldName } from '../../shared/utils/case'; 12 - import { createSchemaComment } from '../../shared/utils/schema'; 3 + import { deduplicateSchema } from '~/ir/schema'; 4 + import type { IR } from '~/ir/types'; 5 + import { buildName } from '~/openApi/shared/utils/name'; 6 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 7 + import { fieldName } from '~/plugins/shared/utils/case'; 8 + import { createSchemaComment } from '~/plugins/shared/utils/schema'; 9 + import type { Property } from '~/tsc'; 10 + import { tsc } from '~/tsc'; 11 + import { refToName } from '~/utils/ref'; 12 + import { stringCase } from '~/utils/stringCase'; 13 + 13 14 import { createClientOptions } from './clientOptions'; 14 15 import { exportType } from './export'; 15 16 import { operationToType } from './operation';
+3 -2
packages/openapi-ts/src/plugins/@hey-api/typescript/types.d.ts
··· 1 - import type { StringCase, StringName } from '../../../types/case'; 2 - import type { DefinePlugin, Plugin } from '../../types'; 1 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 2 + import type { StringCase, StringName } from '~/types/case'; 3 + 3 4 import type { IApi } from './api'; 4 5 5 6 export type EnumsType = 'javascript' | 'typescript' | 'typescript-const';
+5 -4
packages/openapi-ts/src/plugins/@hey-api/typescript/webhook.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { buildName } from '../../../openApi/shared/utils/name'; 3 - import { tsc } from '../../../tsc'; 4 - import { createSchemaComment } from '../../shared/utils/schema'; 1 + import type { IR } from '~/ir/types'; 2 + import { buildName } from '~/openApi/shared/utils/name'; 3 + import { createSchemaComment } from '~/plugins/shared/utils/schema'; 4 + import { tsc } from '~/tsc'; 5 + 5 6 import { schemaToType } from './plugin'; 6 7 import type { HeyApiTypeScriptPlugin } from './types'; 7 8
+2 -1
packages/openapi-ts/src/plugins/@hey-api/typescript/webhooks.ts
··· 1 1 import type { Symbol } from '@hey-api/codegen-core'; 2 2 3 - import { tsc } from '../../../tsc'; 3 + import { tsc } from '~/tsc'; 4 + 4 5 import type { HeyApiTypeScriptPlugin } from './types'; 5 6 6 7 export const createWebhooks = ({
+1 -1
packages/openapi-ts/src/plugins/@pinia/colada/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 6 6 | '_JSONValue'
+2 -1
packages/openapi-ts/src/plugins/@pinia/colada/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import { Api } from './api'; 3 4 import { handler } from './plugin'; 4 5 import type { PiniaColadaPlugin } from './types';
+3 -2
packages/openapi-ts/src/plugins/@pinia/colada/meta.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { IR } from '../../../ir/types'; 4 - import { tsc } from '../../../tsc'; 3 + import type { IR } from '~/ir/types'; 4 + import { tsc } from '~/tsc'; 5 + 5 6 import type { PiniaColadaPlugin } from './types'; 6 7 7 8 export const handleMeta = (
+4 -3
packages/openapi-ts/src/plugins/@pinia/colada/mutationOptions.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { IR } from '../../../ir/types'; 4 - import { buildName } from '../../../openApi/shared/utils/name'; 5 - import { tsc } from '../../../tsc'; 3 + import type { IR } from '~/ir/types'; 4 + import { buildName } from '~/openApi/shared/utils/name'; 5 + import { tsc } from '~/tsc'; 6 + 6 7 import { handleMeta } from './meta'; 7 8 import type { PiniaColadaPlugin } from './types'; 8 9 import { useTypeData, useTypeError, useTypeResponse } from './useType';
+3 -2
packages/openapi-ts/src/plugins/@pinia/colada/plugin.ts
··· 1 - import { stringCase } from '../../../utils/stringCase'; 2 - import { operationClasses } from '../../@hey-api/sdk/operation'; 1 + import { operationClasses } from '~/plugins/@hey-api/sdk/operation'; 2 + import { stringCase } from '~/utils/stringCase'; 3 + 3 4 import { createMutationOptions } from './mutationOptions'; 4 5 import { createQueryOptions } from './queryOptions'; 5 6 import type { PiniaColadaPlugin } from './types';
+7 -6
packages/openapi-ts/src/plugins/@pinia/colada/queryKey.ts
··· 1 1 import type { Symbol } from '@hey-api/codegen-core'; 2 2 import type { Expression } from 'typescript'; 3 3 4 - import { clientFolderAbsolutePath } from '../../../generate/client'; 5 - import { hasOperationDataRequired } from '../../../ir/operation'; 6 - import type { IR } from '../../../ir/types'; 7 - import { buildName } from '../../../openApi/shared/utils/name'; 8 - import { type Property, tsc } from '../../../tsc'; 4 + import { clientFolderAbsolutePath } from '~/generate/client'; 5 + import { hasOperationDataRequired } from '~/ir/operation'; 6 + import type { IR } from '~/ir/types'; 7 + import { buildName } from '~/openApi/shared/utils/name'; 9 8 import { 10 9 getClientBaseUrlKey, 11 10 getClientPlugin, 12 - } from '../../@hey-api/client-core/utils'; 11 + } from '~/plugins/@hey-api/client-core/utils'; 12 + import { type Property, tsc } from '~/tsc'; 13 + 13 14 import type { PiniaColadaPlugin } from './types'; 14 15 import { useTypeData } from './useType'; 15 16 import { getPublicTypeData } from './utils';
+5 -4
packages/openapi-ts/src/plugins/@pinia/colada/queryOptions.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { IR } from '../../../ir/types'; 4 - import { buildName } from '../../../openApi/shared/utils/name'; 5 - import { tsc } from '../../../tsc'; 3 + import type { IR } from '~/ir/types'; 4 + import { buildName } from '~/openApi/shared/utils/name'; 6 5 import { 7 6 hasOperationSse, 8 7 isOperationOptionsRequired, 9 - } from '../../shared/utils/operation'; 8 + } from '~/plugins/shared/utils/operation'; 9 + import { tsc } from '~/tsc'; 10 + 10 11 import { handleMeta } from './meta'; 11 12 import { 12 13 createQueryKeyFunction,
+4 -3
packages/openapi-ts/src/plugins/@pinia/colada/types.d.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import type { StringCase, StringName } from '../../../types/case'; 3 - import type { DefinePlugin, Plugin } from '../../types'; 1 + import type { IR } from '~/ir/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 + import type { StringCase, StringName } from '~/types/case'; 4 + 4 5 import type { IApi } from './api'; 5 6 6 7 export type UserConfig = Plugin.Name<'@pinia/colada'> &
+4 -3
packages/openapi-ts/src/plugins/@pinia/colada/useType.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { getClientPlugin } from '../../@hey-api/client-core/utils'; 3 - import { operationOptionsType } from '../../@hey-api/sdk/operation'; 1 + import type { IR } from '~/ir/types'; 2 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 3 + import { operationOptionsType } from '~/plugins/@hey-api/sdk/operation'; 4 + 4 5 import type { PiniaColadaPlugin } from './types'; 5 6 6 7 export const useTypeData = ({
+2 -1
packages/openapi-ts/src/plugins/@pinia/colada/utils.ts
··· 1 - import { getClientPlugin } from '../../@hey-api/client-core/utils'; 1 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 2 + 2 3 import type { PiniaColadaPlugin } from './types'; 3 4 4 5 export const getPublicTypeData = ({
+1 -1
packages/openapi-ts/src/plugins/@tanstack/angular-query-experimental/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 6 6 | 'AxiosError'
+4 -3
packages/openapi-ts/src/plugins/@tanstack/angular-query-experimental/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 2 - import { handler } from '../query-core/plugin'; 3 - import { handlerLegacy } from '../query-core/plugin-legacy'; 1 + import { handler } from '~/plugins/@tanstack/query-core/plugin'; 2 + import { handlerLegacy } from '~/plugins/@tanstack/query-core/plugin-legacy'; 3 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 4 + 4 5 import { Api } from './api'; 5 6 import type { TanStackAngularQueryPlugin } from './types'; 6 7
+4 -3
packages/openapi-ts/src/plugins/@tanstack/angular-query-experimental/types.d.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import type { StringCase, StringName } from '../../../types/case'; 3 - import type { DefinePlugin, Plugin } from '../../types'; 1 + import type { IR } from '~/ir/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 + import type { StringCase, StringName } from '~/types/case'; 4 + 4 5 import type { IApi } from './api'; 5 6 6 7 export type UserConfig = Plugin.Name<'@tanstack/angular-query-experimental'> &
+7 -6
packages/openapi-ts/src/plugins/@tanstack/query-core/infiniteQueryOptions.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { operationPagination } from '../../../ir/operation'; 4 - import type { IR } from '../../../ir/types'; 5 - import { buildName } from '../../../openApi/shared/utils/name'; 6 - import { tsc } from '../../../tsc'; 7 - import { tsNodeToString } from '../../../tsc/utils'; 8 - import { isOperationOptionsRequired } from '../../shared/utils/operation'; 3 + import { operationPagination } from '~/ir/operation'; 4 + import type { IR } from '~/ir/types'; 5 + import { buildName } from '~/openApi/shared/utils/name'; 6 + import { isOperationOptionsRequired } from '~/plugins/shared/utils/operation'; 7 + import { tsc } from '~/tsc'; 8 + import { tsNodeToString } from '~/tsc/utils'; 9 + 9 10 import { handleMeta } from './meta'; 10 11 import { 11 12 createQueryKeyFunction,
+3 -2
packages/openapi-ts/src/plugins/@tanstack/query-core/meta.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { IR } from '../../../ir/types'; 4 - import { tsc } from '../../../tsc'; 3 + import type { IR } from '~/ir/types'; 4 + import { tsc } from '~/tsc'; 5 + 5 6 import type { PluginInstance } from './types'; 6 7 7 8 export const handleMeta = (
+4 -3
packages/openapi-ts/src/plugins/@tanstack/query-core/mutationOptions.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { IR } from '../../../ir/types'; 4 - import { buildName } from '../../../openApi/shared/utils/name'; 5 - import { tsc } from '../../../tsc'; 3 + import type { IR } from '~/ir/types'; 4 + import { buildName } from '~/openApi/shared/utils/name'; 5 + import { tsc } from '~/tsc'; 6 + 6 7 import { handleMeta } from './meta'; 7 8 import type { PluginInstance } from './types'; 8 9 import { useTypeData, useTypeError, useTypeResponse } from './useType';
+27 -27
packages/openapi-ts/src/plugins/@tanstack/query-core/plugin-legacy.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { clientModulePath } from '../../../generate/client'; 4 - import { relativeModulePath } from '../../../generate/utils'; 5 - import { createOperationKey } from '../../../ir/operation'; 6 - import { getPaginationKeywordsRegExp } from '../../../ir/pagination'; 7 - import type { IR } from '../../../ir/types'; 8 - import { isOperationParameterRequired } from '../../../openApi'; 9 - import { type Property, tsc } from '../../../tsc'; 10 - import type { ImportExportItem } from '../../../tsc/module'; 11 - import type { ImportExportItemObject } from '../../../tsc/utils'; 12 - import type { 13 - Client, 14 - Method, 15 - Model, 16 - Operation, 17 - OperationParameter, 18 - } from '../../../types/client'; 19 - import type { Config } from '../../../types/config'; 20 - import type { Files } from '../../../types/utils'; 21 - import { getConfig, isLegacyClient } from '../../../utils/config'; 22 - import { transformClassName } from '../../../utils/transform'; 3 + import { clientModulePath } from '~/generate/client'; 4 + import { relativeModulePath } from '~/generate/utils'; 5 + import { createOperationKey } from '~/ir/operation'; 6 + import { getPaginationKeywordsRegExp } from '~/ir/pagination'; 7 + import type { IR } from '~/ir/types'; 8 + import { isOperationParameterRequired } from '~/openApi'; 23 9 import { 24 10 getClientBaseUrlKey, 25 11 getClientPlugin, 26 - } from '../../@hey-api/client-core/utils'; 12 + } from '~/plugins/@hey-api/client-core/utils'; 27 13 import { 28 14 generateImport, 29 15 operationDataTypeName, ··· 31 17 operationOptionsLegacyParserType, 32 18 operationResponseTypeName, 33 19 serviceFunctionIdentifier, 34 - } from '../../@hey-api/sdk/plugin-legacy'; 35 - import type { TanStackAngularQueryPlugin } from '../angular-query-experimental'; 36 - import type { TanStackReactQueryPlugin } from '../react-query'; 37 - import type { TanStackSolidQueryPlugin } from '../solid-query'; 38 - import type { TanStackSvelteQueryPlugin } from '../svelte-query'; 39 - import type { TanStackVueQueryPlugin } from '../vue-query'; 20 + } from '~/plugins/@hey-api/sdk/plugin-legacy'; 21 + import type { TanStackAngularQueryPlugin } from '~/plugins/@tanstack/angular-query-experimental'; 22 + import type { TanStackReactQueryPlugin } from '~/plugins/@tanstack/react-query'; 23 + import type { TanStackSolidQueryPlugin } from '~/plugins/@tanstack/solid-query'; 24 + import type { TanStackSvelteQueryPlugin } from '~/plugins/@tanstack/svelte-query'; 25 + import type { TanStackVueQueryPlugin } from '~/plugins/@tanstack/vue-query'; 26 + import { type Property, tsc } from '~/tsc'; 27 + import type { ImportExportItem } from '~/tsc/module'; 28 + import type { ImportExportItemObject } from '~/tsc/utils'; 29 + import type { 30 + Client, 31 + Method, 32 + Model, 33 + Operation, 34 + OperationParameter, 35 + } from '~/types/client'; 36 + import type { Config } from '~/types/config'; 37 + import type { Files } from '~/types/utils'; 38 + import { getConfig, isLegacyClient } from '~/utils/config'; 39 + import { transformClassName } from '~/utils/transform'; 40 40 41 41 const toInfiniteQueryOptionsName = (operation: Operation) => 42 42 `${serviceFunctionIdentifier({
+3 -2
packages/openapi-ts/src/plugins/@tanstack/query-core/plugin.ts
··· 1 - import { stringCase } from '../../../utils/stringCase'; 2 - import { operationClasses } from '../../@hey-api/sdk/operation'; 1 + import { operationClasses } from '~/plugins/@hey-api/sdk/operation'; 2 + import { stringCase } from '~/utils/stringCase'; 3 + 3 4 import { createInfiniteQueryOptions } from './infiniteQueryOptions'; 4 5 import { createMutationOptions } from './mutationOptions'; 5 6 import { createQueryOptions } from './queryOptions';
+6 -5
packages/openapi-ts/src/plugins/@tanstack/query-core/queryKey.ts
··· 1 1 import type { Symbol } from '@hey-api/codegen-core'; 2 2 import type { Expression } from 'typescript'; 3 3 4 - import { hasOperationDataRequired } from '../../../ir/operation'; 5 - import type { IR } from '../../../ir/types'; 6 - import { buildName } from '../../../openApi/shared/utils/name'; 7 - import { type Property, tsc } from '../../../tsc'; 4 + import { hasOperationDataRequired } from '~/ir/operation'; 5 + import type { IR } from '~/ir/types'; 6 + import { buildName } from '~/openApi/shared/utils/name'; 8 7 import { 9 8 getClientBaseUrlKey, 10 9 getClientPlugin, 11 - } from '../../@hey-api/client-core/utils'; 10 + } from '~/plugins/@hey-api/client-core/utils'; 11 + import { type Property, tsc } from '~/tsc'; 12 + 12 13 import type { PluginInstance } from './types'; 13 14 import { useTypeData } from './useType'; 14 15
+5 -4
packages/openapi-ts/src/plugins/@tanstack/query-core/queryOptions.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { IR } from '../../../ir/types'; 4 - import { buildName } from '../../../openApi/shared/utils/name'; 5 - import { tsc } from '../../../tsc'; 3 + import type { IR } from '~/ir/types'; 4 + import { buildName } from '~/openApi/shared/utils/name'; 6 5 import { 7 6 hasOperationSse, 8 7 isOperationOptionsRequired, 9 - } from '../../shared/utils/operation'; 8 + } from '~/plugins/shared/utils/operation'; 9 + import { tsc } from '~/tsc'; 10 + 10 11 import { handleMeta } from './meta'; 11 12 import { 12 13 createQueryKeyFunction,
+5 -5
packages/openapi-ts/src/plugins/@tanstack/query-core/types.d.ts
··· 1 - import type { TanStackAngularQueryPlugin } from '../angular-query-experimental/types'; 2 - import type { TanStackReactQueryPlugin } from '../react-query/types'; 3 - import type { TanStackSolidQueryPlugin } from '../solid-query/types'; 4 - import type { TanStackSvelteQueryPlugin } from '../svelte-query/types'; 5 - import type { TanStackVueQueryPlugin } from '../vue-query/types'; 1 + import type { TanStackAngularQueryPlugin } from '~/plugins/@tanstack/angular-query-experimental/types'; 2 + import type { TanStackReactQueryPlugin } from '~/plugins/@tanstack/react-query/types'; 3 + import type { TanStackSolidQueryPlugin } from '~/plugins/@tanstack/solid-query/types'; 4 + import type { TanStackSvelteQueryPlugin } from '~/plugins/@tanstack/svelte-query/types'; 5 + import type { TanStackVueQueryPlugin } from '~/plugins/@tanstack/vue-query/types'; 6 6 7 7 export interface PluginHandler { 8 8 (...args: Parameters<TanStackAngularQueryPlugin['Handler']>): void;
+5 -4
packages/openapi-ts/src/plugins/@tanstack/query-core/useQuery.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { buildName } from '../../../openApi/shared/utils/name'; 3 - import { tsc } from '../../../tsc'; 1 + import type { IR } from '~/ir/types'; 2 + import { buildName } from '~/openApi/shared/utils/name'; 4 3 import { 5 4 hasOperationSse, 6 5 isOperationOptionsRequired, 7 - } from '../../shared/utils/operation'; 6 + } from '~/plugins/shared/utils/operation'; 7 + import { tsc } from '~/tsc'; 8 + 8 9 import type { PluginInstance } from './types'; 9 10 import { useTypeData } from './useType'; 10 11
+4 -3
packages/openapi-ts/src/plugins/@tanstack/query-core/useType.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { getClientPlugin } from '../../@hey-api/client-core/utils'; 3 - import { operationOptionsType } from '../../@hey-api/sdk/operation'; 1 + import type { IR } from '~/ir/types'; 2 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 3 + import { operationOptionsType } from '~/plugins/@hey-api/sdk/operation'; 4 + 4 5 import type { PluginInstance } from './types'; 5 6 6 7 export const useTypeData = ({
+1 -1
packages/openapi-ts/src/plugins/@tanstack/react-query/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 6 6 | 'AxiosError'
+4 -3
packages/openapi-ts/src/plugins/@tanstack/react-query/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 2 - import { handler } from '../query-core/plugin'; 3 - import { handlerLegacy } from '../query-core/plugin-legacy'; 1 + import { handler } from '~/plugins/@tanstack/query-core/plugin'; 2 + import { handlerLegacy } from '~/plugins/@tanstack/query-core/plugin-legacy'; 3 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 4 + 4 5 import { Api } from './api'; 5 6 import type { TanStackReactQueryPlugin } from './types'; 6 7
+4 -3
packages/openapi-ts/src/plugins/@tanstack/react-query/types.d.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import type { StringCase, StringName } from '../../../types/case'; 3 - import type { DefinePlugin, Plugin } from '../../types'; 1 + import type { IR } from '~/ir/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 + import type { StringCase, StringName } from '~/types/case'; 4 + 4 5 import type { IApi } from './api'; 5 6 6 7 export type UserConfig = Plugin.Name<'@tanstack/react-query'> &
+1 -1
packages/openapi-ts/src/plugins/@tanstack/solid-query/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 6 6 | 'AxiosError'
+4 -3
packages/openapi-ts/src/plugins/@tanstack/solid-query/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 2 - import { handler } from '../query-core/plugin'; 3 - import { handlerLegacy } from '../query-core/plugin-legacy'; 1 + import { handler } from '~/plugins/@tanstack/query-core/plugin'; 2 + import { handlerLegacy } from '~/plugins/@tanstack/query-core/plugin-legacy'; 3 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 4 + 4 5 import { Api } from './api'; 5 6 import type { TanStackSolidQueryPlugin } from './types'; 6 7
+4 -3
packages/openapi-ts/src/plugins/@tanstack/solid-query/types.d.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import type { StringCase, StringName } from '../../../types/case'; 3 - import type { DefinePlugin, Plugin } from '../../types'; 1 + import type { IR } from '~/ir/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 + import type { StringCase, StringName } from '~/types/case'; 4 + 4 5 import type { IApi } from './api'; 5 6 6 7 export type UserConfig = Plugin.Name<'@tanstack/solid-query'> &
+1 -1
packages/openapi-ts/src/plugins/@tanstack/svelte-query/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 6 6 | 'AxiosError'
+4 -3
packages/openapi-ts/src/plugins/@tanstack/svelte-query/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 2 - import { handler } from '../query-core/plugin'; 3 - import { handlerLegacy } from '../query-core/plugin-legacy'; 1 + import { handler } from '~/plugins/@tanstack/query-core/plugin'; 2 + import { handlerLegacy } from '~/plugins/@tanstack/query-core/plugin-legacy'; 3 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 4 + 4 5 import { Api } from './api'; 5 6 import type { TanStackSvelteQueryPlugin } from './types'; 6 7
+4 -3
packages/openapi-ts/src/plugins/@tanstack/svelte-query/types.d.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import type { StringCase, StringName } from '../../../types/case'; 3 - import type { DefinePlugin, Plugin } from '../../types'; 1 + import type { IR } from '~/ir/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 + import type { StringCase, StringName } from '~/types/case'; 4 + 4 5 import type { IApi } from './api'; 5 6 6 7 export type UserConfig = Plugin.Name<'@tanstack/svelte-query'> &
+1 -1
packages/openapi-ts/src/plugins/@tanstack/vue-query/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 6 6 | 'AxiosError'
+4 -3
packages/openapi-ts/src/plugins/@tanstack/vue-query/config.ts
··· 1 - import { definePluginConfig } from '../../shared/utils/config'; 2 - import { handler } from '../query-core/plugin'; 3 - import { handlerLegacy } from '../query-core/plugin-legacy'; 1 + import { handler } from '~/plugins/@tanstack/query-core/plugin'; 2 + import { handlerLegacy } from '~/plugins/@tanstack/query-core/plugin-legacy'; 3 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 4 + 4 5 import { Api } from './api'; 5 6 import type { TanStackVueQueryPlugin } from './types'; 6 7
+4 -3
packages/openapi-ts/src/plugins/@tanstack/vue-query/types.d.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import type { StringCase, StringName } from '../../../types/case'; 3 - import type { DefinePlugin, Plugin } from '../../types'; 1 + import type { IR } from '~/ir/types'; 2 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 3 + import type { StringCase, StringName } from '~/types/case'; 4 + 4 5 import type { IApi } from './api'; 5 6 6 7 export type UserConfig = Plugin.Name<'@tanstack/vue-query'> &
+2 -1
packages/openapi-ts/src/plugins/arktype/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 import type ts from 'typescript'; 3 3 4 - import type { Plugin } from '../types'; 4 + import type { Plugin } from '~/plugins/types'; 5 + 5 6 import type { ValidatorArgs } from './shared/types'; 6 7 import { createRequestValidatorV2, createResponseValidatorV2 } from './v2/api'; 7 8
+2 -1
packages/openapi-ts/src/plugins/arktype/config.ts
··· 1 - import { definePluginConfig, mappers } from '../shared/utils/config'; 1 + import { definePluginConfig, mappers } from '~/plugins/shared/utils/config'; 2 + 2 3 import { Api } from './api'; 3 4 import { handler } from './plugin'; 4 5 import type { ArktypePlugin } from './types';
+1 -1
packages/openapi-ts/src/plugins/arktype/constants.ts
··· 1 - import { tsc } from '../../tsc'; 1 + import { tsc } from '~/tsc'; 2 2 3 3 export const identifiers = { 4 4 keywords: {
+4 -3
packages/openapi-ts/src/plugins/arktype/shared/export.ts
··· 1 1 import type { Symbol } from '@hey-api/codegen-core'; 2 2 import ts from 'typescript'; 3 3 4 - import type { IR } from '../../../ir/types'; 5 - import { tsc } from '../../../tsc'; 6 - import { createSchemaComment } from '../../shared/utils/schema'; 4 + import type { IR } from '~/ir/types'; 5 + import { createSchemaComment } from '~/plugins/shared/utils/schema'; 6 + import { tsc } from '~/tsc'; 7 + 7 8 import { identifiers } from '../constants'; 8 9 import type { ArktypePlugin } from '../types'; 9 10 import type { Ast } from './types';
+3 -2
packages/openapi-ts/src/plugins/arktype/shared/types.d.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { IR } from '../../../ir/types'; 4 - import type { ToRefs } from '../../shared/types/refs'; 3 + import type { IR } from '~/ir/types'; 4 + import type { ToRefs } from '~/plugins/shared/types/refs'; 5 + 5 6 import type { ArktypePlugin } from '../types'; 6 7 7 8 export type Ast = {
+3 -2
packages/openapi-ts/src/plugins/arktype/types.d.ts
··· 1 - import type { StringCase, StringName } from '../../types/case'; 2 - import type { DefinePlugin, Plugin } from '../types'; 1 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 2 + import type { StringCase, StringName } from '~/types/case'; 3 + 3 4 import type { IApi } from './api'; 4 5 5 6 export type UserConfig = Plugin.Name<'arktype'> &
+2 -1
packages/openapi-ts/src/plugins/arktype/v2/api.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../tsc'; 3 + import { tsc } from '~/tsc'; 4 + 4 5 // import { identifiers } from '../constants'; 5 6 import type { ValidatorArgs } from '../shared/types'; 6 7
+9 -8
packages/openapi-ts/src/plugins/arktype/v2/plugin.ts
··· 1 - import { deduplicateSchema } from '../../../ir/schema'; 2 - import type { IR } from '../../../ir/types'; 3 - import { buildName } from '../../../openApi/shared/utils/name'; 4 - import { tsc } from '../../../tsc'; 5 - import { refToName } from '../../../utils/ref'; 6 - import type { SchemaWithType } from '../../shared/types/schema'; 7 - import { pathToSymbolResourceType } from '../../shared/utils/meta'; 8 - import { toRefs } from '../../shared/utils/refs'; 1 + import { deduplicateSchema } from '~/ir/schema'; 2 + import type { IR } from '~/ir/types'; 3 + import { buildName } from '~/openApi/shared/utils/name'; 4 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 5 + import { pathToSymbolResourceType } from '~/plugins/shared/utils/meta'; 6 + import { toRefs } from '~/plugins/shared/utils/refs'; 7 + import { tsc } from '~/tsc'; 8 + import { refToName } from '~/utils/ref'; 9 + 9 10 import { exportAst } from '../shared/export'; 10 11 import type { Ast, IrSchemaToAstOptions } from '../shared/types'; 11 12 import type { ArktypePlugin } from '../types';
+2 -1
packages/openapi-ts/src/plugins/arktype/v2/toAst/index.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import type { SchemaWithType } from '../../../shared/types/schema'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6 import { nullToAst } from './null'; 6 7 import { objectToAst } from './object';
+2 -1
packages/openapi-ts/src/plugins/arktype/v2/toAst/null.ts
··· 1 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + 2 3 import { identifiers } from '../../constants'; 3 4 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 4 5
+5 -4
packages/openapi-ts/src/plugins/arktype/v2/toAst/object.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import { numberRegExp } from '../../../../utils/regexp'; 5 - import type { SchemaWithType } from '../../../shared/types/schema'; 6 - import { toRef } from '../../../shared/utils/refs'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { toRef } from '~/plugins/shared/utils/refs'; 5 + import { tsc } from '~/tsc'; 6 + import { numberRegExp } from '~/utils/regexp'; 7 + 7 8 // import { identifiers } from '../../constants'; 8 9 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 9 10 import { irSchemaToAst } from '../plugin';
+2 -1
packages/openapi-ts/src/plugins/arktype/v2/toAst/string.ts
··· 1 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + 2 3 import { identifiers } from '../../constants'; 3 4 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 4 5
+53 -53
packages/openapi-ts/src/plugins/config.ts
··· 1 - import type { AngularCommonPlugin } from './@angular/common'; 2 - import { defaultConfig as angularCommon } from './@angular/common'; 3 - import type { HeyApiClientAngularPlugin } from './@hey-api/client-angular'; 4 - import { defaultConfig as heyApiClientAngular } from './@hey-api/client-angular'; 5 - import type { HeyApiClientAxiosPlugin } from './@hey-api/client-axios'; 6 - import { defaultConfig as heyApiClientAxios } from './@hey-api/client-axios'; 7 - import type { HeyApiClientFetchPlugin } from './@hey-api/client-fetch'; 8 - import { defaultConfig as heyApiClientFetch } from './@hey-api/client-fetch'; 9 - import type { HeyApiClientNextPlugin } from './@hey-api/client-next'; 10 - import { defaultConfig as heyApiClientNext } from './@hey-api/client-next'; 11 - import type { HeyApiClientNuxtPlugin } from './@hey-api/client-nuxt'; 12 - import { defaultConfig as heyApiClientNuxt } from './@hey-api/client-nuxt'; 13 - import type { HeyApiClientOfetchPlugin } from './@hey-api/client-ofetch'; 14 - import { defaultConfig as heyApiClientOfetch } from './@hey-api/client-ofetch'; 15 - import type { HeyApiClientLegacyAngularPlugin } from './@hey-api/legacy-angular'; 16 - import { defaultConfig as heyApiLegacyAngular } from './@hey-api/legacy-angular'; 17 - import type { HeyApiClientLegacyAxiosPlugin } from './@hey-api/legacy-axios'; 18 - import { defaultConfig as heyApiLegacyAxios } from './@hey-api/legacy-axios'; 19 - import type { HeyApiClientLegacyFetchPlugin } from './@hey-api/legacy-fetch'; 20 - import { defaultConfig as heyApiLegacyFetch } from './@hey-api/legacy-fetch'; 21 - import type { HeyApiClientLegacyNodePlugin } from './@hey-api/legacy-node'; 22 - import { defaultConfig as heyApiLegacyNode } from './@hey-api/legacy-node'; 23 - import type { HeyApiClientLegacyXhrPlugin } from './@hey-api/legacy-xhr'; 24 - import { defaultConfig as heyApiLegacyXhr } from './@hey-api/legacy-xhr'; 25 - import type { HeyApiSchemasPlugin } from './@hey-api/schemas'; 26 - import { defaultConfig as heyApiSchemas } from './@hey-api/schemas'; 27 - import type { HeyApiSdkPlugin } from './@hey-api/sdk'; 28 - import { defaultConfig as heyApiSdk } from './@hey-api/sdk'; 29 - import type { HeyApiTransformersPlugin } from './@hey-api/transformers'; 30 - import { defaultConfig as heyApiTransformers } from './@hey-api/transformers'; 31 - import type { HeyApiTypeScriptPlugin } from './@hey-api/typescript'; 32 - import { defaultConfig as heyApiTypeScript } from './@hey-api/typescript'; 33 - import type { PiniaColadaPlugin } from './@pinia/colada'; 34 - import { defaultConfig as piniaColada } from './@pinia/colada'; 35 - import type { TanStackAngularQueryPlugin } from './@tanstack/angular-query-experimental'; 36 - import { defaultConfig as tanStackAngularQuery } from './@tanstack/angular-query-experimental'; 37 - import type { TanStackReactQueryPlugin } from './@tanstack/react-query'; 38 - import { defaultConfig as tanStackReactQuery } from './@tanstack/react-query'; 39 - import type { TanStackSolidQueryPlugin } from './@tanstack/solid-query'; 40 - import { defaultConfig as tanStackSolidQuery } from './@tanstack/solid-query'; 41 - import type { TanStackSvelteQueryPlugin } from './@tanstack/svelte-query'; 42 - import { defaultConfig as tanStackSvelteQuery } from './@tanstack/svelte-query'; 43 - import type { TanStackVueQueryPlugin } from './@tanstack/vue-query'; 44 - import { defaultConfig as tanStackVueQuery } from './@tanstack/vue-query'; 45 - import type { ArktypePlugin } from './arktype'; 46 - import { defaultConfig as arktype } from './arktype'; 47 - import type { FastifyPlugin } from './fastify'; 48 - import { defaultConfig as fastify } from './fastify'; 49 - import type { Plugin, PluginNames } from './types'; 50 - import type { ValibotPlugin } from './valibot'; 51 - import { defaultConfig as valibot } from './valibot'; 52 - import type { ZodPlugin } from './zod'; 53 - import { defaultConfig as zod } from './zod'; 1 + import type { AngularCommonPlugin } from '~/plugins/@angular/common'; 2 + import { defaultConfig as angularCommon } from '~/plugins/@angular/common'; 3 + import type { HeyApiClientAngularPlugin } from '~/plugins/@hey-api/client-angular'; 4 + import { defaultConfig as heyApiClientAngular } from '~/plugins/@hey-api/client-angular'; 5 + import type { HeyApiClientAxiosPlugin } from '~/plugins/@hey-api/client-axios'; 6 + import { defaultConfig as heyApiClientAxios } from '~/plugins/@hey-api/client-axios'; 7 + import type { HeyApiClientFetchPlugin } from '~/plugins/@hey-api/client-fetch'; 8 + import { defaultConfig as heyApiClientFetch } from '~/plugins/@hey-api/client-fetch'; 9 + import type { HeyApiClientNextPlugin } from '~/plugins/@hey-api/client-next'; 10 + import { defaultConfig as heyApiClientNext } from '~/plugins/@hey-api/client-next'; 11 + import type { HeyApiClientNuxtPlugin } from '~/plugins/@hey-api/client-nuxt'; 12 + import { defaultConfig as heyApiClientNuxt } from '~/plugins/@hey-api/client-nuxt'; 13 + import type { HeyApiClientOfetchPlugin } from '~/plugins/@hey-api/client-ofetch'; 14 + import { defaultConfig as heyApiClientOfetch } from '~/plugins/@hey-api/client-ofetch'; 15 + import type { HeyApiClientLegacyAngularPlugin } from '~/plugins/@hey-api/legacy-angular'; 16 + import { defaultConfig as heyApiLegacyAngular } from '~/plugins/@hey-api/legacy-angular'; 17 + import type { HeyApiClientLegacyAxiosPlugin } from '~/plugins/@hey-api/legacy-axios'; 18 + import { defaultConfig as heyApiLegacyAxios } from '~/plugins/@hey-api/legacy-axios'; 19 + import type { HeyApiClientLegacyFetchPlugin } from '~/plugins/@hey-api/legacy-fetch'; 20 + import { defaultConfig as heyApiLegacyFetch } from '~/plugins/@hey-api/legacy-fetch'; 21 + import type { HeyApiClientLegacyNodePlugin } from '~/plugins/@hey-api/legacy-node'; 22 + import { defaultConfig as heyApiLegacyNode } from '~/plugins/@hey-api/legacy-node'; 23 + import type { HeyApiClientLegacyXhrPlugin } from '~/plugins/@hey-api/legacy-xhr'; 24 + import { defaultConfig as heyApiLegacyXhr } from '~/plugins/@hey-api/legacy-xhr'; 25 + import type { HeyApiSchemasPlugin } from '~/plugins/@hey-api/schemas'; 26 + import { defaultConfig as heyApiSchemas } from '~/plugins/@hey-api/schemas'; 27 + import type { HeyApiSdkPlugin } from '~/plugins/@hey-api/sdk'; 28 + import { defaultConfig as heyApiSdk } from '~/plugins/@hey-api/sdk'; 29 + import type { HeyApiTransformersPlugin } from '~/plugins/@hey-api/transformers'; 30 + import { defaultConfig as heyApiTransformers } from '~/plugins/@hey-api/transformers'; 31 + import type { HeyApiTypeScriptPlugin } from '~/plugins/@hey-api/typescript'; 32 + import { defaultConfig as heyApiTypeScript } from '~/plugins/@hey-api/typescript'; 33 + import type { PiniaColadaPlugin } from '~/plugins/@pinia/colada'; 34 + import { defaultConfig as piniaColada } from '~/plugins/@pinia/colada'; 35 + import type { TanStackAngularQueryPlugin } from '~/plugins/@tanstack/angular-query-experimental'; 36 + import { defaultConfig as tanStackAngularQuery } from '~/plugins/@tanstack/angular-query-experimental'; 37 + import type { TanStackReactQueryPlugin } from '~/plugins/@tanstack/react-query'; 38 + import { defaultConfig as tanStackReactQuery } from '~/plugins/@tanstack/react-query'; 39 + import type { TanStackSolidQueryPlugin } from '~/plugins/@tanstack/solid-query'; 40 + import { defaultConfig as tanStackSolidQuery } from '~/plugins/@tanstack/solid-query'; 41 + import type { TanStackSvelteQueryPlugin } from '~/plugins/@tanstack/svelte-query'; 42 + import { defaultConfig as tanStackSvelteQuery } from '~/plugins/@tanstack/svelte-query'; 43 + import type { TanStackVueQueryPlugin } from '~/plugins/@tanstack/vue-query'; 44 + import { defaultConfig as tanStackVueQuery } from '~/plugins/@tanstack/vue-query'; 45 + import type { ArktypePlugin } from '~/plugins/arktype'; 46 + import { defaultConfig as arktype } from '~/plugins/arktype'; 47 + import type { FastifyPlugin } from '~/plugins/fastify'; 48 + import { defaultConfig as fastify } from '~/plugins/fastify'; 49 + import type { Plugin, PluginNames } from '~/plugins/types'; 50 + import type { ValibotPlugin } from '~/plugins/valibot'; 51 + import { defaultConfig as valibot } from '~/plugins/valibot'; 52 + import type { ZodPlugin } from '~/plugins/zod'; 53 + import { defaultConfig as zod } from '~/plugins/zod'; 54 54 55 55 export interface PluginConfigMap { 56 56 '@angular/common': AngularCommonPlugin['Types'];
+1 -1
packages/openapi-ts/src/plugins/fastify/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 3 - import type { Plugin } from '../types'; 3 + import type { Plugin } from '~/plugins/types'; 4 4 5 5 type SelectorType = 'RouteHandler'; 6 6
+2 -1
packages/openapi-ts/src/plugins/fastify/config.ts
··· 1 - import { definePluginConfig } from '../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import { Api } from './api'; 3 4 import { handler } from './plugin'; 4 5 import type { FastifyPlugin } from './types';
+5 -4
packages/openapi-ts/src/plugins/fastify/plugin.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { operationResponsesMap } from '../../ir/operation'; 4 - import { hasParameterGroupObjectRequired } from '../../ir/parameter'; 5 - import type { IR } from '../../ir/types'; 6 - import { type Property, tsc } from '../../tsc'; 3 + import { operationResponsesMap } from '~/ir/operation'; 4 + import { hasParameterGroupObjectRequired } from '~/ir/parameter'; 5 + import type { IR } from '~/ir/types'; 6 + import { type Property, tsc } from '~/tsc'; 7 + 7 8 import type { FastifyPlugin } from './types'; 8 9 9 10 const operationToRouteHandler = ({
+2 -1
packages/openapi-ts/src/plugins/fastify/types.d.ts
··· 1 - import type { DefinePlugin, Plugin } from '../types'; 1 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 2 + 2 3 import type { IApi } from './api'; 3 4 4 5 export type UserConfig = Plugin.Name<'fastify'> &
+2 -2
packages/openapi-ts/src/plugins/shared/types/instance.d.ts
··· 1 - import type { IrTopLevelKind } from '../../../ir/graph'; 2 - import type { IR } from '../../../ir/types'; 1 + import type { IrTopLevelKind } from '~/ir/graph'; 2 + import type { IR } from '~/ir/types'; 3 3 4 4 type WalkEvents = 5 5 | {
+1 -1
packages/openapi-ts/src/plugins/shared/types/schema.d.ts
··· 1 - import type { IR } from '../../../ir/types'; 1 + import type { IR } from '~/ir/types'; 2 2 3 3 export interface SchemaWithType< 4 4 T extends
+3 -3
packages/openapi-ts/src/plugins/shared/utils/case.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import type { IR } from '../../../ir/types'; 4 - import { numberRegExp } from '../../../utils/regexp'; 5 - import { stringCase } from '../../../utils/stringCase'; 3 + import type { IR } from '~/ir/types'; 4 + import { numberRegExp } from '~/utils/regexp'; 5 + import { stringCase } from '~/utils/stringCase'; 6 6 7 7 /** 8 8 * Returns final field name for object properties. This might differ from the
+1 -1
packages/openapi-ts/src/plugins/shared/utils/config.ts
··· 1 - import type { Plugin } from '../../types'; 1 + import type { Plugin } from '~/plugins/types'; 2 2 3 3 export const definePluginConfig = 4 4 <T extends Plugin.Types>(defaultConfig: Plugin.Config<T>) =>
+9 -8
packages/openapi-ts/src/plugins/shared/utils/instance.ts
··· 7 7 SymbolIn, 8 8 } from '@hey-api/codegen-core'; 9 9 10 - import { HeyApiError } from '../../../error'; 11 - import type { IrTopLevelKind } from '../../../ir/graph'; 10 + import { HeyApiError } from '~/error'; 11 + import type { IrTopLevelKind } from '~/ir/graph'; 12 12 import { 13 13 irTopLevelKinds, 14 14 matchIrTopLevelPointer, 15 15 walkTopological, 16 - } from '../../../ir/graph'; 17 - import type { IR } from '../../../ir/types'; 18 - import type { OpenApi } from '../../../openApi/types'; 19 - import { jsonPointerToPath } from '../../../utils/ref'; 20 - import type { PluginConfigMap } from '../../config'; 21 - import type { Plugin } from '../../types'; 16 + } from '~/ir/graph'; 17 + import type { IR } from '~/ir/types'; 18 + import type { OpenApi } from '~/openApi/types'; 19 + import type { PluginConfigMap } from '~/plugins/config'; 20 + import type { Plugin } from '~/plugins/types'; 21 + import { jsonPointerToPath } from '~/utils/ref'; 22 + 22 23 import type { WalkEvent, WalkOptions } from '../types/instance'; 23 24 24 25 const defaultGetFilePath = (symbol: Symbol): string | undefined => {
+3 -3
packages/openapi-ts/src/plugins/shared/utils/operation.ts
··· 1 - import { hasOperationDataRequired } from '../../../ir/operation'; 2 - import type { IR } from '../../../ir/types'; 3 - import { getClientPlugin } from '../../@hey-api/client-core/utils'; 1 + import { hasOperationDataRequired } from '~/ir/operation'; 2 + import type { IR } from '~/ir/types'; 3 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 4 4 5 5 export const isOperationOptionsRequired = ({ 6 6 context,
+3 -3
packages/openapi-ts/src/plugins/shared/utils/schema.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import type { Comments } from '../../../tsc'; 3 - import { escapeComment } from '../../../utils/escape'; 1 + import type { IR } from '~/ir/types'; 2 + import type { Comments } from '~/tsc'; 3 + import { escapeComment } from '~/utils/escape'; 4 4 5 5 export const createSchemaComment = ({ 6 6 schema,
+7 -7
packages/openapi-ts/src/plugins/types.d.ts
··· 1 - import type { ValueToObject } from '../config/utils/config'; 2 - import type { Package } from '../config/utils/package'; 3 - import type { IR } from '../ir/types'; 4 - import type { OpenApi as LegacyOpenApi } from '../openApi'; 5 - import type { Client as LegacyClient } from '../types/client'; 6 - import type { Files } from '../types/utils'; 7 - import type { PluginInstance } from './shared/utils/instance'; 1 + import type { ValueToObject } from '~/config/utils/config'; 2 + import type { Package } from '~/config/utils/package'; 3 + import type { IR } from '~/ir/types'; 4 + import type { OpenApi as LegacyOpenApi } from '~/openApi'; 5 + import type { PluginInstance } from '~/plugins/shared/utils/instance'; 6 + import type { Client as LegacyClient } from '~/types/client'; 7 + import type { Files } from '~/types/utils'; 8 8 9 9 export type PluginClientNames = 10 10 | '@hey-api/client-angular'
+2 -1
packages/openapi-ts/src/plugins/valibot/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 import type ts from 'typescript'; 3 3 4 - import type { Plugin } from '../types'; 4 + import type { Plugin } from '~/plugins/types'; 5 + 5 6 import type { ValidatorArgs } from './shared/types'; 6 7 import { createRequestValidatorV1, createResponseValidatorV1 } from './v1/api'; 7 8
+2 -1
packages/openapi-ts/src/plugins/valibot/config.ts
··· 1 - import { definePluginConfig } from '../shared/utils/config'; 1 + import { definePluginConfig } from '~/plugins/shared/utils/config'; 2 + 2 3 import { Api } from './api'; 3 4 import { handler } from './plugin'; 4 5 import type { ValibotPlugin } from './types';
+1 -1
packages/openapi-ts/src/plugins/valibot/shared/numbers.ts
··· 1 - import { tsc } from '../../../tsc'; 1 + import { tsc } from '~/tsc'; 2 2 3 3 export const INTEGER_FORMATS = { 4 4 int16: {
+4 -3
packages/openapi-ts/src/plugins/valibot/shared/types.d.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import type { StringCase, StringName } from '../../../types/case'; 3 - import type { ToRefs } from '../../shared/types/refs'; 1 + import type { IR } from '~/ir/types'; 2 + import type { ToRefs } from '~/plugins/shared/types/refs'; 3 + import type { StringCase, StringName } from '~/types/case'; 4 + 4 5 import type { ValibotPlugin } from '../types'; 5 6 6 7 export type IrSchemaToAstOptions = {
+3 -2
packages/openapi-ts/src/plugins/valibot/types.d.ts
··· 1 - import type { StringCase, StringName } from '../../types/case'; 2 - import type { DefinePlugin, Plugin } from '../types'; 1 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 2 + import type { StringCase, StringName } from '~/types/case'; 3 + 3 4 import type { IApi } from './api'; 4 5 5 6 export type UserConfig = Plugin.Name<'valibot'> &
+2 -1
packages/openapi-ts/src/plugins/valibot/v1/api.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../tsc'; 3 + import { tsc } from '~/tsc'; 4 + 4 5 import type { ValidatorArgs } from '../shared/types'; 5 6 import { identifiers } from './constants'; 6 7
+1 -1
packages/openapi-ts/src/plugins/valibot/v1/constants.ts
··· 1 - import { tsc } from '../../../tsc'; 1 + import { tsc } from '~/tsc'; 2 2 3 3 export const identifiers = { 4 4 /**
+6 -5
packages/openapi-ts/src/plugins/valibot/v1/operation.ts
··· 1 - import { operationResponsesMap } from '../../../ir/operation'; 2 - import type { IR } from '../../../ir/types'; 3 - import { buildName } from '../../../openApi/shared/utils/name'; 4 - import { pathToSymbolResourceType } from '../../shared/utils/meta'; 5 - import { toRef } from '../../shared/utils/refs'; 1 + import { operationResponsesMap } from '~/ir/operation'; 2 + import type { IR } from '~/ir/types'; 3 + import { buildName } from '~/openApi/shared/utils/name'; 4 + import { pathToSymbolResourceType } from '~/plugins/shared/utils/meta'; 5 + import { toRef } from '~/plugins/shared/utils/refs'; 6 + 6 7 import type { IrSchemaToAstOptions } from '../shared/types'; 7 8 import { irSchemaToAst } from './plugin'; 8 9
+2 -1
packages/openapi-ts/src/plugins/valibot/v1/pipesToAst.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../tsc'; 3 + import { tsc } from '~/tsc'; 4 + 4 5 import type { ValibotPlugin } from '../types'; 5 6 import { identifiers } from './constants'; 6 7
+10 -9
packages/openapi-ts/src/plugins/valibot/v1/plugin.ts
··· 1 1 import type { Symbol } from '@hey-api/codegen-core'; 2 2 import type ts from 'typescript'; 3 3 4 - import { deduplicateSchema } from '../../../ir/schema'; 5 - import type { IR } from '../../../ir/types'; 6 - import { buildName } from '../../../openApi/shared/utils/name'; 7 - import { tsc } from '../../../tsc'; 8 - import { refToName } from '../../../utils/ref'; 9 - import type { SchemaWithType } from '../../shared/types/schema'; 10 - import { pathToSymbolResourceType } from '../../shared/utils/meta'; 11 - import { toRef, toRefs } from '../../shared/utils/refs'; 12 - import { createSchemaComment } from '../../shared/utils/schema'; 4 + import { deduplicateSchema } from '~/ir/schema'; 5 + import type { IR } from '~/ir/types'; 6 + import { buildName } from '~/openApi/shared/utils/name'; 7 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 8 + import { pathToSymbolResourceType } from '~/plugins/shared/utils/meta'; 9 + import { toRef, toRefs } from '~/plugins/shared/utils/refs'; 10 + import { createSchemaComment } from '~/plugins/shared/utils/schema'; 11 + import { tsc } from '~/tsc'; 12 + import { refToName } from '~/utils/ref'; 13 + 13 14 import { numberParameter } from '../shared/numbers'; 14 15 import type { IrSchemaToAstOptions, PluginState } from '../shared/types'; 15 16 import type { ValibotPlugin } from '../types';
+5 -4
packages/openapi-ts/src/plugins/valibot/v1/toAst/array.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { deduplicateSchema } from '../../../../ir/schema'; 4 - import { tsc } from '../../../../tsc'; 5 - import type { SchemaWithType } from '../../../shared/types/schema'; 6 - import { toRef } from '../../../shared/utils/refs'; 3 + import { deduplicateSchema } from '~/ir/schema'; 4 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 5 + import { toRef } from '~/plugins/shared/utils/refs'; 6 + import { tsc } from '~/tsc'; 7 + 7 8 import type { IrSchemaToAstOptions } from '../../shared/types'; 8 9 import { identifiers } from '../constants'; 9 10 import { pipesToAst } from '../pipesToAst';
+3 -2
packages/openapi-ts/src/plugins/valibot/v1/toAst/boolean.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import type { IrSchemaToAstOptions } from '../../shared/types'; 4 5 import { identifiers } from '../constants'; 5 6
+3 -2
packages/openapi-ts/src/plugins/valibot/v1/toAst/enum.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import type { SchemaWithType } from '../../../shared/types/schema'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { tsc } from '~/tsc'; 5 + 5 6 import type { IrSchemaToAstOptions } from '../../shared/types'; 6 7 import { identifiers } from '../constants'; 7 8 import { unknownToAst } from './unknown';
+2 -1
packages/openapi-ts/src/plugins/valibot/v1/toAst/index.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { SchemaWithType } from '../../../shared/types/schema'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + 4 5 import type { IrSchemaToAstOptions } from '../../shared/types'; 5 6 import { arrayToAst } from './array'; 6 7 import { booleanToAst } from './boolean';
+3 -2
packages/openapi-ts/src/plugins/valibot/v1/toAst/never.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import type { IrSchemaToAstOptions } from '../../shared/types'; 4 5 import { identifiers } from '../constants'; 5 6
+3 -2
packages/openapi-ts/src/plugins/valibot/v1/toAst/null.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import type { IrSchemaToAstOptions } from '../../shared/types'; 4 5 import { identifiers } from '../constants'; 5 6
+3 -2
packages/openapi-ts/src/plugins/valibot/v1/toAst/number.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import type { SchemaWithType } from '../../../shared/types/schema'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { tsc } from '~/tsc'; 5 + 5 6 import { 6 7 INTEGER_FORMATS, 7 8 isIntegerFormat,
+5 -4
packages/openapi-ts/src/plugins/valibot/v1/toAst/object.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import { numberRegExp } from '../../../../utils/regexp'; 5 - import type { SchemaWithType } from '../../../shared/types/schema'; 6 - import { toRef } from '../../../shared/utils/refs'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { toRef } from '~/plugins/shared/utils/refs'; 5 + import { tsc } from '~/tsc'; 6 + import { numberRegExp } from '~/utils/regexp'; 7 + 7 8 import type { IrSchemaToAstOptions } from '../../shared/types'; 8 9 import { identifiers } from '../constants'; 9 10 import { pipesToAst } from '../pipesToAst';
+3 -2
packages/openapi-ts/src/plugins/valibot/v1/toAst/string.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import type { SchemaWithType } from '../../../shared/types/schema'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { tsc } from '~/tsc'; 5 + 5 6 import type { IrSchemaToAstOptions } from '../../shared/types'; 6 7 import { identifiers } from '../constants'; 7 8 import { pipesToAst } from '../pipesToAst';
+4 -3
packages/openapi-ts/src/plugins/valibot/v1/toAst/tuple.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 3 - import { toRef } from '../../../shared/utils/refs'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { toRef } from '~/plugins/shared/utils/refs'; 3 + import { tsc } from '~/tsc'; 4 + 4 5 import type { IrSchemaToAstOptions } from '../../shared/types'; 5 6 import { identifiers } from '../constants'; 6 7 import { pipesToAst } from '../pipesToAst';
+3 -2
packages/openapi-ts/src/plugins/valibot/v1/toAst/undefined.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import type { IrSchemaToAstOptions } from '../../shared/types'; 4 5 import { identifiers } from '../constants'; 5 6
+3 -2
packages/openapi-ts/src/plugins/valibot/v1/toAst/unknown.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import type { IrSchemaToAstOptions } from '../../shared/types'; 4 5 import { identifiers } from '../constants'; 5 6
+3 -2
packages/openapi-ts/src/plugins/valibot/v1/toAst/void.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import type { IrSchemaToAstOptions } from '../../shared/types'; 4 5 import { identifiers } from '../constants'; 5 6
+4 -3
packages/openapi-ts/src/plugins/valibot/v1/webhook.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { buildName } from '../../../openApi/shared/utils/name'; 3 - import { pathToSymbolResourceType } from '../../shared/utils/meta'; 1 + import type { IR } from '~/ir/types'; 2 + import { buildName } from '~/openApi/shared/utils/name'; 3 + import { pathToSymbolResourceType } from '~/plugins/shared/utils/meta'; 4 + 4 5 import type { IrSchemaToAstOptions } from '../shared/types'; 5 6 import { irSchemaToAst } from './plugin'; 6 7
+2 -1
packages/openapi-ts/src/plugins/zod/api.ts
··· 1 1 import type { Selector } from '@hey-api/codegen-core'; 2 2 import type ts from 'typescript'; 3 3 4 - import type { Plugin } from '../types'; 4 + import type { Plugin } from '~/plugins/types'; 5 + 5 6 import { 6 7 createRequestValidatorMini, 7 8 createResponseValidatorMini,
+2 -1
packages/openapi-ts/src/plugins/zod/config.ts
··· 1 1 import colors from 'ansi-colors'; 2 2 3 - import { definePluginConfig, mappers } from '../shared/utils/config'; 3 + import { definePluginConfig, mappers } from '~/plugins/shared/utils/config'; 4 + 4 5 import { Api } from './api'; 5 6 import { handler } from './plugin'; 6 7 import type { ZodPlugin } from './types';
+1 -1
packages/openapi-ts/src/plugins/zod/constants.ts
··· 1 - import { tsc } from '../../tsc'; 1 + import { tsc } from '~/tsc'; 2 2 3 3 // TODO: this is inaccurate, it combines identifiers for all supported versions 4 4 export const identifiers = {
+2 -1
packages/openapi-ts/src/plugins/zod/mini/api.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../tsc'; 3 + import { tsc } from '~/tsc'; 4 + 4 5 import { identifiers } from '../constants'; 5 6 import type { ValidatorArgs } from '../shared/types'; 6 7
+9 -8
packages/openapi-ts/src/plugins/zod/mini/plugin.ts
··· 1 - import { deduplicateSchema } from '../../../ir/schema'; 2 - import type { IR } from '../../../ir/types'; 3 - import { buildName } from '../../../openApi/shared/utils/name'; 4 - import { tsc } from '../../../tsc'; 5 - import { refToName } from '../../../utils/ref'; 6 - import type { SchemaWithType } from '../../shared/types/schema'; 7 - import { pathToSymbolResourceType } from '../../shared/utils/meta'; 8 - import { toRef, toRefs } from '../../shared/utils/refs'; 1 + import { deduplicateSchema } from '~/ir/schema'; 2 + import type { IR } from '~/ir/types'; 3 + import { buildName } from '~/openApi/shared/utils/name'; 4 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 5 + import { pathToSymbolResourceType } from '~/plugins/shared/utils/meta'; 6 + import { toRef, toRefs } from '~/plugins/shared/utils/refs'; 7 + import { tsc } from '~/tsc'; 8 + import { refToName } from '~/utils/ref'; 9 + 9 10 import { identifiers } from '../constants'; 10 11 import { exportAst } from '../shared/export'; 11 12 import { getZodModule } from '../shared/module';
+5 -4
packages/openapi-ts/src/plugins/zod/mini/toAst/array.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { deduplicateSchema } from '../../../../ir/schema'; 4 - import { tsc } from '../../../../tsc'; 5 - import type { SchemaWithType } from '../../../shared/types/schema'; 6 - import { toRef } from '../../../shared/utils/refs'; 3 + import { deduplicateSchema } from '~/ir/schema'; 4 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 5 + import { toRef } from '~/plugins/shared/utils/refs'; 6 + import { tsc } from '~/tsc'; 7 + 7 8 import { identifiers } from '../../constants'; 8 9 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 9 10 import { irSchemaToAst } from '../plugin';
+3 -2
packages/openapi-ts/src/plugins/zod/mini/toAst/boolean.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/mini/toAst/enum.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import type { SchemaWithType } from '../../../shared/types/schema'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { tsc } from '~/tsc'; 5 + 5 6 import { identifiers } from '../../constants'; 6 7 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 7 8 import { unknownToAst } from './unknown';
+2 -1
packages/openapi-ts/src/plugins/zod/mini/toAst/index.ts
··· 1 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + 2 3 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 3 4 import { arrayToAst } from './array'; 4 5 import { booleanToAst } from './boolean';
+3 -2
packages/openapi-ts/src/plugins/zod/mini/toAst/never.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/mini/toAst/null.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/mini/toAst/number.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import type { SchemaWithType } from '../../../shared/types/schema'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { tsc } from '~/tsc'; 5 + 5 6 import { identifiers } from '../../constants'; 6 7 import { numberParameter } from '../../shared/numbers'; 7 8 import type { Ast, IrSchemaToAstOptions } from '../../shared/types';
+5 -4
packages/openapi-ts/src/plugins/zod/mini/toAst/object.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import { numberRegExp } from '../../../../utils/regexp'; 5 - import type { SchemaWithType } from '../../../shared/types/schema'; 6 - import { toRef } from '../../../shared/utils/refs'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { toRef } from '~/plugins/shared/utils/refs'; 5 + import { tsc } from '~/tsc'; 6 + import { numberRegExp } from '~/utils/regexp'; 7 + 7 8 import { identifiers } from '../../constants'; 8 9 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 9 10 import { irSchemaToAst } from '../plugin';
+3 -2
packages/openapi-ts/src/plugins/zod/mini/toAst/string.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import type { SchemaWithType } from '../../../shared/types/schema'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { tsc } from '~/tsc'; 5 + 5 6 import { identifiers } from '../../constants'; 6 7 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 7 8
+4 -3
packages/openapi-ts/src/plugins/zod/mini/toAst/tuple.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import type { SchemaWithType } from '../../../shared/types/schema'; 5 - import { toRef } from '../../../shared/utils/refs'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { toRef } from '~/plugins/shared/utils/refs'; 5 + import { tsc } from '~/tsc'; 6 + 6 7 import { identifiers } from '../../constants'; 7 8 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 8 9 import { irSchemaToAst } from '../plugin';
+3 -2
packages/openapi-ts/src/plugins/zod/mini/toAst/undefined.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/mini/toAst/unknown.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/mini/toAst/void.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+4 -3
packages/openapi-ts/src/plugins/zod/shared/export.ts
··· 1 1 import type { Symbol } from '@hey-api/codegen-core'; 2 2 import type ts from 'typescript'; 3 3 4 - import type { IR } from '../../../ir/types'; 5 - import { tsc } from '../../../tsc'; 6 - import { createSchemaComment } from '../../shared/utils/schema'; 4 + import type { IR } from '~/ir/types'; 5 + import { createSchemaComment } from '~/plugins/shared/utils/schema'; 6 + import { tsc } from '~/tsc'; 7 + 7 8 import { identifiers } from '../constants'; 8 9 import type { ZodPlugin } from '../types'; 9 10 import type { Ast } from './types';
+1 -1
packages/openapi-ts/src/plugins/zod/shared/numbers.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../tsc'; 3 + import { tsc } from '~/tsc'; 4 4 5 5 export const numberParameter = ({ 6 6 isBigInt,
+5 -4
packages/openapi-ts/src/plugins/zod/shared/operation.ts
··· 1 - import { operationResponsesMap } from '../../../ir/operation'; 2 - import type { IR } from '../../../ir/types'; 3 - import { buildName } from '../../../openApi/shared/utils/name'; 4 - import { pathToSymbolResourceType } from '../../shared/utils/meta'; 1 + import { operationResponsesMap } from '~/ir/operation'; 2 + import type { IR } from '~/ir/types'; 3 + import { buildName } from '~/openApi/shared/utils/name'; 4 + import { pathToSymbolResourceType } from '~/plugins/shared/utils/meta'; 5 + 5 6 import { exportAst } from './export'; 6 7 import type { Ast, IrSchemaToAstOptions } from './types'; 7 8
+3 -2
packages/openapi-ts/src/plugins/zod/shared/types.d.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { IR } from '../../../ir/types'; 4 - import type { ToRefs } from '../../shared/types/refs'; 3 + import type { IR } from '~/ir/types'; 4 + import type { ToRefs } from '~/plugins/shared/types/refs'; 5 + 5 6 import type { ZodPlugin } from '../types'; 6 7 7 8 export type Ast = {
+4 -3
packages/openapi-ts/src/plugins/zod/shared/webhook.ts
··· 1 - import type { IR } from '../../../ir/types'; 2 - import { buildName } from '../../../openApi/shared/utils/name'; 3 - import { pathToSymbolResourceType } from '../../shared/utils/meta'; 1 + import type { IR } from '~/ir/types'; 2 + import { buildName } from '~/openApi/shared/utils/name'; 3 + import { pathToSymbolResourceType } from '~/plugins/shared/utils/meta'; 4 + 4 5 import { exportAst } from './export'; 5 6 import type { Ast, IrSchemaToAstOptions } from './types'; 6 7
+3 -2
packages/openapi-ts/src/plugins/zod/types.d.ts
··· 1 - import type { StringCase, StringName } from '../../types/case'; 2 - import type { DefinePlugin, Plugin } from '../types'; 1 + import type { DefinePlugin, Plugin } from '~/plugins/types'; 2 + import type { StringCase, StringName } from '~/types/case'; 3 + 3 4 import type { IApi } from './api'; 4 5 5 6 export type UserConfig = Plugin.Name<'zod'> &
+2 -1
packages/openapi-ts/src/plugins/zod/v3/api.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../tsc'; 3 + import { tsc } from '~/tsc'; 4 + 4 5 import { identifiers } from '../constants'; 5 6 import type { ValidatorArgs } from '../shared/types'; 6 7
+9 -8
packages/openapi-ts/src/plugins/zod/v3/plugin.ts
··· 1 - import { deduplicateSchema } from '../../../ir/schema'; 2 - import type { IR } from '../../../ir/types'; 3 - import { buildName } from '../../../openApi/shared/utils/name'; 4 - import { tsc } from '../../../tsc'; 5 - import { refToName } from '../../../utils/ref'; 6 - import type { SchemaWithType } from '../../shared/types/schema'; 7 - import { pathToSymbolResourceType } from '../../shared/utils/meta'; 8 - import { toRef, toRefs } from '../../shared/utils/refs'; 1 + import { deduplicateSchema } from '~/ir/schema'; 2 + import type { IR } from '~/ir/types'; 3 + import { buildName } from '~/openApi/shared/utils/name'; 4 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 5 + import { pathToSymbolResourceType } from '~/plugins/shared/utils/meta'; 6 + import { toRef, toRefs } from '~/plugins/shared/utils/refs'; 7 + import { tsc } from '~/tsc'; 8 + import { refToName } from '~/utils/ref'; 9 + 9 10 import { identifiers } from '../constants'; 10 11 import { exportAst } from '../shared/export'; 11 12 import { getZodModule } from '../shared/module';
+5 -4
packages/openapi-ts/src/plugins/zod/v3/toAst/array.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { deduplicateSchema } from '../../../../ir/schema'; 4 - import { tsc } from '../../../../tsc'; 5 - import type { SchemaWithType } from '../../../shared/types/schema'; 6 - import { toRef } from '../../../shared/utils/refs'; 3 + import { deduplicateSchema } from '~/ir/schema'; 4 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 5 + import { toRef } from '~/plugins/shared/utils/refs'; 6 + import { tsc } from '~/tsc'; 7 + 7 8 import { identifiers } from '../../constants'; 8 9 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 9 10 import { irSchemaToAst } from '../plugin';
+3 -2
packages/openapi-ts/src/plugins/zod/v3/toAst/boolean.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/v3/toAst/enum.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import type { SchemaWithType } from '../../../shared/types/schema'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { tsc } from '~/tsc'; 5 + 5 6 import { identifiers } from '../../constants'; 6 7 import type { IrSchemaToAstOptions } from '../../shared/types'; 7 8 import { unknownToAst } from './unknown';
+2 -1
packages/openapi-ts/src/plugins/zod/v3/toAst/index.ts
··· 1 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + 2 3 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 3 4 import { arrayToAst } from './array'; 4 5 import { booleanToAst } from './boolean';
+3 -2
packages/openapi-ts/src/plugins/zod/v3/toAst/never.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/v3/toAst/null.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/v3/toAst/number.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import { numberParameter } from '../../shared/numbers'; 5 6 import type { IrSchemaToAstOptions } from '../../shared/types';
+5 -4
packages/openapi-ts/src/plugins/zod/v3/toAst/object.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import { numberRegExp } from '../../../../utils/regexp'; 5 - import type { SchemaWithType } from '../../../shared/types/schema'; 6 - import { toRef } from '../../../shared/utils/refs'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { toRef } from '~/plugins/shared/utils/refs'; 5 + import { tsc } from '~/tsc'; 6 + import { numberRegExp } from '~/utils/regexp'; 7 + 7 8 import { identifiers } from '../../constants'; 8 9 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 9 10 import { irSchemaToAst } from '../plugin';
+3 -2
packages/openapi-ts/src/plugins/zod/v3/toAst/string.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { IrSchemaToAstOptions } from '../../shared/types'; 5 6
+4 -3
packages/openapi-ts/src/plugins/zod/v3/toAst/tuple.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import type { SchemaWithType } from '../../../shared/types/schema'; 5 - import { toRef } from '../../../shared/utils/refs'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { toRef } from '~/plugins/shared/utils/refs'; 5 + import { tsc } from '~/tsc'; 6 + 6 7 import { identifiers } from '../../constants'; 7 8 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 8 9 import { irSchemaToAst } from '../plugin';
+3 -2
packages/openapi-ts/src/plugins/zod/v3/toAst/undefined.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/v3/toAst/unknown.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/v3/toAst/void.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { IrSchemaToAstOptions } from '../../shared/types'; 5 6
+2 -1
packages/openapi-ts/src/plugins/zod/v4/api.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../tsc'; 3 + import { tsc } from '~/tsc'; 4 + 4 5 import { identifiers } from '../constants'; 5 6 import type { ValidatorArgs } from '../shared/types'; 6 7
+9 -8
packages/openapi-ts/src/plugins/zod/v4/plugin.ts
··· 1 - import { deduplicateSchema } from '../../../ir/schema'; 2 - import type { IR } from '../../../ir/types'; 3 - import { buildName } from '../../../openApi/shared/utils/name'; 4 - import { tsc } from '../../../tsc'; 5 - import { refToName } from '../../../utils/ref'; 6 - import type { SchemaWithType } from '../../shared/types/schema'; 7 - import { pathToSymbolResourceType } from '../../shared/utils/meta'; 8 - import { toRef, toRefs } from '../../shared/utils/refs'; 1 + import { deduplicateSchema } from '~/ir/schema'; 2 + import type { IR } from '~/ir/types'; 3 + import { buildName } from '~/openApi/shared/utils/name'; 4 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 5 + import { pathToSymbolResourceType } from '~/plugins/shared/utils/meta'; 6 + import { toRef, toRefs } from '~/plugins/shared/utils/refs'; 7 + import { tsc } from '~/tsc'; 8 + import { refToName } from '~/utils/ref'; 9 + 9 10 import { identifiers } from '../constants'; 10 11 import { exportAst } from '../shared/export'; 11 12 import { getZodModule } from '../shared/module';
+5 -4
packages/openapi-ts/src/plugins/zod/v4/toAst/array.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { deduplicateSchema } from '../../../../ir/schema'; 4 - import { tsc } from '../../../../tsc'; 5 - import type { SchemaWithType } from '../../../shared/types/schema'; 6 - import { toRef } from '../../../shared/utils/refs'; 3 + import { deduplicateSchema } from '~/ir/schema'; 4 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 5 + import { toRef } from '~/plugins/shared/utils/refs'; 6 + import { tsc } from '~/tsc'; 7 + 7 8 import { identifiers } from '../../constants'; 8 9 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 9 10 import { irSchemaToAst } from '../plugin';
+3 -2
packages/openapi-ts/src/plugins/zod/v4/toAst/boolean.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/v4/toAst/enum.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import type { SchemaWithType } from '../../../shared/types/schema'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { tsc } from '~/tsc'; 5 + 5 6 import { identifiers } from '../../constants'; 6 7 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 7 8 import { unknownToAst } from './unknown';
+2 -1
packages/openapi-ts/src/plugins/zod/v4/toAst/index.ts
··· 1 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + 2 3 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 3 4 import { arrayToAst } from './array'; 4 5 import { booleanToAst } from './boolean';
+3 -2
packages/openapi-ts/src/plugins/zod/v4/toAst/never.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/v4/toAst/null.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/v4/toAst/number.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import { numberParameter } from '../../shared/numbers'; 5 6 import type { Ast, IrSchemaToAstOptions } from '../../shared/types';
+5 -4
packages/openapi-ts/src/plugins/zod/v4/toAst/object.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import { numberRegExp } from '../../../../utils/regexp'; 5 - import type { SchemaWithType } from '../../../shared/types/schema'; 6 - import { toRef } from '../../../shared/utils/refs'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { toRef } from '~/plugins/shared/utils/refs'; 5 + import { tsc } from '~/tsc'; 6 + import { numberRegExp } from '~/utils/regexp'; 7 + 7 8 import { identifiers } from '../../constants'; 8 9 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 9 10 import { irSchemaToAst } from '../plugin';
+3 -2
packages/openapi-ts/src/plugins/zod/v4/toAst/string.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+4 -3
packages/openapi-ts/src/plugins/zod/v4/toAst/tuple.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import { tsc } from '../../../../tsc'; 4 - import type { SchemaWithType } from '../../../shared/types/schema'; 5 - import { toRef } from '../../../shared/utils/refs'; 3 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 4 + import { toRef } from '~/plugins/shared/utils/refs'; 5 + import { tsc } from '~/tsc'; 6 + 6 7 import { identifiers } from '../../constants'; 7 8 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 8 9 import { irSchemaToAst } from '../plugin';
+3 -2
packages/openapi-ts/src/plugins/zod/v4/toAst/undefined.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/v4/toAst/unknown.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+3 -2
packages/openapi-ts/src/plugins/zod/v4/toAst/void.ts
··· 1 - import { tsc } from '../../../../tsc'; 2 - import type { SchemaWithType } from '../../../shared/types/schema'; 1 + import type { SchemaWithType } from '~/plugins/shared/types/schema'; 2 + import { tsc } from '~/tsc'; 3 + 3 4 import { identifiers } from '../../constants'; 4 5 import type { Ast, IrSchemaToAstOptions } from '../../shared/types'; 5 6
+2 -2
packages/openapi-ts/src/processOutput.ts
··· 1 1 import { sync } from 'cross-spawn'; 2 2 3 - import type { Config } from './types/config'; 4 - import type { Formatters, Linters } from './types/output'; 3 + import type { Config } from '~/types/config'; 4 + import type { Formatters, Linters } from '~/types/output'; 5 5 6 6 type OutputProcessor = { 7 7 args: (path: string) => ReadonlyArray<string>;
+2 -1
packages/openapi-ts/src/tsc/transform.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { validTypescriptIdentifierRegExp } from '../utils/regexp'; 3 + import { validTypescriptIdentifierRegExp } from '~/utils/regexp'; 4 + 4 5 import { expressionToStatement } from './convert'; 5 6 import { createCallExpression } from './module'; 6 7 import {
+2 -1
packages/openapi-ts/src/tsc/typedef.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { validTypescriptIdentifierRegExp } from '../utils/regexp'; 3 + import { validTypescriptIdentifierRegExp } from '~/utils/regexp'; 4 + 4 5 import { 5 6 createKeywordTypeNode, 6 7 createMappedTypeNode,
+3 -2
packages/openapi-ts/src/tsc/types.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { escapeName } from '../utils/escape'; 4 - import { validTypescriptIdentifierRegExp } from '../utils/regexp'; 3 + import { escapeName } from '~/utils/escape'; 4 + import { validTypescriptIdentifierRegExp } from '~/utils/regexp'; 5 + 5 6 import { 6 7 addLeadingComments, 7 8 type Comments,
+3 -2
packages/openapi-ts/src/tsc/utils.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { getConfig } from '../utils/config'; 4 - import { unescapeName } from '../utils/escape'; 3 + import { getConfig } from '~/utils/config'; 4 + import { unescapeName } from '~/utils/escape'; 5 + 5 6 import type { AccessLevel } from './types'; 6 7 import { createStringLiteral, syntaxKindKeyword } from './types'; 7 8
+1 -1
packages/openapi-ts/src/types/client.d.ts
··· 6 6 Operation as ParserOperation, 7 7 OperationParameter, 8 8 OperationResponse, 9 - } from '../openApi'; 9 + } from '~/openApi'; 10 10 11 11 export type { Method, Model, ModelMeta, OperationParameter, OperationResponse }; 12 12
+3 -2
packages/openapi-ts/src/types/config.d.ts
··· 1 - import type { PluginConfigMap } from '../plugins/config'; 2 - import type { Plugin, PluginNames } from '../plugins/types'; 1 + import type { PluginConfigMap } from '~/plugins/config'; 2 + import type { Plugin, PluginNames } from '~/plugins/types'; 3 + 3 4 import type { Input, UserInput, Watch } from './input'; 4 5 import type { Logs } from './logs'; 5 6 import type { Output, UserOutput } from './output';
+3 -2
packages/openapi-ts/src/types/parser.d.ts
··· 1 - import type { IR } from '../ir/types'; 1 + import type { IR } from '~/ir/types'; 2 2 import type { 3 3 OpenApiMetaObject, 4 4 OpenApiOperationObject, ··· 6 6 OpenApiRequestBodyObject, 7 7 OpenApiResponseObject, 8 8 OpenApiSchemaObject, 9 - } from '../openApi/types'; 9 + } from '~/openApi/types'; 10 + 10 11 import type { StringCase, StringName } from './case'; 11 12 12 13 type EnumsMode = 'inline' | 'root';
+1 -1
packages/openapi-ts/src/types/utils.d.ts
··· 1 - import type { GeneratedFile } from '../generate/file'; 1 + import type { GeneratedFile } from '~/generate/file'; 2 2 3 3 /** 4 4 * Converts all top-level ReadonlyArray properties to Array (shallow).
+2 -1
packages/openapi-ts/src/utils/__tests__/parse.test.ts
··· 1 1 import { describe, expect, it } from 'vitest'; 2 2 3 - import { operationNameFn } from '../../openApi/common/parser/operation'; 3 + import { operationNameFn } from '~/openApi/common/parser/operation'; 4 + 4 5 import { setConfig } from '../config'; 5 6 6 7 describe('operationNameFn', () => {
+3 -2
packages/openapi-ts/src/utils/__tests__/postprocess.test.ts
··· 1 1 import { describe, expect, it, vi } from 'vitest'; 2 2 3 - import { parseLegacy } from '../../openApi'; 4 - import type { Config } from '../../types/config'; 3 + import { parseLegacy } from '~/openApi'; 4 + import type { Config } from '~/types/config'; 5 + 5 6 import { getServiceName, postProcessClient } from '../postprocess'; 6 7 7 8 vi.mock('../config', () => {
+2 -1
packages/openapi-ts/src/utils/__tests__/sort.test.ts
··· 1 1 import { describe, expect, it } from 'vitest'; 2 2 3 - import type { Model, Service } from '../../types/client'; 3 + import type { Model, Service } from '~/types/client'; 4 + 4 5 import { sort, sortByName } from '../sort'; 5 6 6 7 describe('sort', () => {
+2 -1
packages/openapi-ts/src/utils/__tests__/stringCase.test.ts
··· 1 1 import { describe, expect, it } from 'vitest'; 2 2 3 - import type { StringCase } from '../../types/case'; 3 + import type { StringCase } from '~/types/case'; 4 + 4 5 import { stringCase } from '../stringCase'; 5 6 6 7 const cases: ReadonlyArray<StringCase> = [
+2 -1
packages/openapi-ts/src/utils/__tests__/type.test.ts
··· 1 1 import { describe, expect, it, type MockedFunction, vi } from 'vitest'; 2 2 3 - import type { Config } from '../../types/config'; 3 + import type { Config } from '~/types/config'; 4 + 4 5 import { isLegacyClient } from '../config'; 5 6 import { transformTypeKeyName } from '../type'; 6 7
+1 -1
packages/openapi-ts/src/utils/cli.ts
··· 1 1 import colors from 'ansi-colors'; 2 2 3 - import { loadPackageJson } from '../generate/tsConfig'; 3 + import { loadPackageJson } from '~/generate/tsConfig'; 4 4 5 5 const textAscii = ` 6 6 888 | e 888~-_ 888
+2 -2
packages/openapi-ts/src/utils/config.ts
··· 1 - import { getClientPlugin } from '../plugins/@hey-api/client-core/utils'; 2 - import type { Config } from '../types/config'; 1 + import { getClientPlugin } from '~/plugins/@hey-api/client-core/utils'; 2 + import type { Config } from '~/types/config'; 3 3 4 4 let _config: Config; 5 5
+3 -2
packages/openapi-ts/src/utils/enum.ts
··· 1 - import type { Enum, Model } from '../openApi'; 2 - import { ensureValidTypeScriptJavaScriptIdentifier } from '../openApi'; 1 + import type { Enum, Model } from '~/openApi'; 2 + import { ensureValidTypeScriptJavaScriptIdentifier } from '~/openApi'; 3 + 3 4 import { unescapeName } from './escape'; 4 5 import { sort } from './sort'; 5 6 import { unique } from './unique';
+1 -1
packages/openapi-ts/src/utils/getHttpRequestName.ts
··· 1 - import type { PluginClientNames } from '../plugins/types'; 1 + import type { PluginClientNames } from '~/plugins/types'; 2 2 3 3 /** 4 4 * Generate the HttpRequest filename based on the selected client
+45 -44
packages/openapi-ts/src/utils/handlebars.ts
··· 1 1 import Handlebars from 'handlebars'; 2 2 3 3 // @ts-expect-error 4 - import templateClient from '../legacy/handlebars/compiled/client.js'; 4 + import templateClient from '~/legacy/handlebars/compiled/client'; 5 5 // @ts-expect-error 6 - import angularGetHeaders from '../legacy/handlebars/compiled/core/angular/getHeaders.js'; 6 + import angularGetHeaders from '~/legacy/handlebars/compiled/core/angular/getHeaders'; 7 7 // @ts-expect-error 8 - import angularGetRequestBody from '../legacy/handlebars/compiled/core/angular/getRequestBody.js'; 8 + import angularGetRequestBody from '~/legacy/handlebars/compiled/core/angular/getRequestBody'; 9 9 // @ts-expect-error 10 - import angularGetResponseBody from '../legacy/handlebars/compiled/core/angular/getResponseBody.js'; 10 + import angularGetResponseBody from '~/legacy/handlebars/compiled/core/angular/getResponseBody'; 11 11 // @ts-expect-error 12 - import angularGetResponseHeader from '../legacy/handlebars/compiled/core/angular/getResponseHeader.js'; 12 + import angularGetResponseHeader from '~/legacy/handlebars/compiled/core/angular/getResponseHeader'; 13 13 // @ts-expect-error 14 - import angularRequest from '../legacy/handlebars/compiled/core/angular/request.js'; 14 + import angularRequest from '~/legacy/handlebars/compiled/core/angular/request'; 15 15 // @ts-expect-error 16 - import angularSendRequest from '../legacy/handlebars/compiled/core/angular/sendRequest.js'; 16 + import angularSendRequest from '~/legacy/handlebars/compiled/core/angular/sendRequest'; 17 17 // @ts-expect-error 18 - import templateCoreApiError from '../legacy/handlebars/compiled/core/ApiError.js'; 18 + import templateCoreApiError from '~/legacy/handlebars/compiled/core/ApiError'; 19 19 // @ts-expect-error 20 - import templateCoreApiRequestOptions from '../legacy/handlebars/compiled/core/ApiRequestOptions.js'; 20 + import templateCoreApiRequestOptions from '~/legacy/handlebars/compiled/core/ApiRequestOptions'; 21 21 // @ts-expect-error 22 - import templateCoreApiResult from '../legacy/handlebars/compiled/core/ApiResult.js'; 22 + import templateCoreApiResult from '~/legacy/handlebars/compiled/core/ApiResult'; 23 23 // @ts-expect-error 24 - import axiosGetHeaders from '../legacy/handlebars/compiled/core/axios/getHeaders.js'; 24 + import axiosGetHeaders from '~/legacy/handlebars/compiled/core/axios/getHeaders'; 25 25 // @ts-expect-error 26 - import axiosGetRequestBody from '../legacy/handlebars/compiled/core/axios/getRequestBody.js'; 26 + import axiosGetRequestBody from '~/legacy/handlebars/compiled/core/axios/getRequestBody'; 27 27 // @ts-expect-error 28 - import axiosGetResponseBody from '../legacy/handlebars/compiled/core/axios/getResponseBody.js'; 28 + import axiosGetResponseBody from '~/legacy/handlebars/compiled/core/axios/getResponseBody'; 29 29 // @ts-expect-error 30 - import axiosGetResponseHeader from '../legacy/handlebars/compiled/core/axios/getResponseHeader.js'; 30 + import axiosGetResponseHeader from '~/legacy/handlebars/compiled/core/axios/getResponseHeader'; 31 31 // @ts-expect-error 32 - import axiosRequest from '../legacy/handlebars/compiled/core/axios/request.js'; 32 + import axiosRequest from '~/legacy/handlebars/compiled/core/axios/request'; 33 33 // @ts-expect-error 34 - import axiosSendRequest from '../legacy/handlebars/compiled/core/axios/sendRequest.js'; 34 + import axiosSendRequest from '~/legacy/handlebars/compiled/core/axios/sendRequest'; 35 35 // @ts-expect-error 36 - import templateCoreBaseHttpRequest from '../legacy/handlebars/compiled/core/BaseHttpRequest.js'; 36 + import templateCoreBaseHttpRequest from '~/legacy/handlebars/compiled/core/BaseHttpRequest'; 37 37 // @ts-expect-error 38 - import templateCancelablePromise from '../legacy/handlebars/compiled/core/CancelablePromise.js'; 38 + import templateCancelablePromise from '~/legacy/handlebars/compiled/core/CancelablePromise'; 39 39 // @ts-expect-error 40 - import fetchGetHeaders from '../legacy/handlebars/compiled/core/fetch/getHeaders.js'; 40 + import fetchGetHeaders from '~/legacy/handlebars/compiled/core/fetch/getHeaders'; 41 41 // @ts-expect-error 42 - import fetchGetRequestBody from '../legacy/handlebars/compiled/core/fetch/getRequestBody.js'; 42 + import fetchGetRequestBody from '~/legacy/handlebars/compiled/core/fetch/getRequestBody'; 43 43 // @ts-expect-error 44 - import fetchGetResponseBody from '../legacy/handlebars/compiled/core/fetch/getResponseBody.js'; 44 + import fetchGetResponseBody from '~/legacy/handlebars/compiled/core/fetch/getResponseBody'; 45 45 // @ts-expect-error 46 - import fetchGetResponseHeader from '../legacy/handlebars/compiled/core/fetch/getResponseHeader.js'; 46 + import fetchGetResponseHeader from '~/legacy/handlebars/compiled/core/fetch/getResponseHeader'; 47 47 // @ts-expect-error 48 - import fetchRequest from '../legacy/handlebars/compiled/core/fetch/request.js'; 48 + import fetchRequest from '~/legacy/handlebars/compiled/core/fetch/request'; 49 49 // @ts-expect-error 50 - import fetchSendRequest from '../legacy/handlebars/compiled/core/fetch/sendRequest.js'; 50 + import fetchSendRequest from '~/legacy/handlebars/compiled/core/fetch/sendRequest'; 51 51 // @ts-expect-error 52 - import functionBase64 from '../legacy/handlebars/compiled/core/functions/base64.js'; 52 + import functionBase64 from '~/legacy/handlebars/compiled/core/functions/base64'; 53 53 // @ts-expect-error 54 - import functionCatchErrorCodes from '../legacy/handlebars/compiled/core/functions/catchErrorCodes.js'; 54 + import functionCatchErrorCodes from '~/legacy/handlebars/compiled/core/functions/catchErrorCodes'; 55 55 // @ts-expect-error 56 - import functionGetFormData from '../legacy/handlebars/compiled/core/functions/getFormData.js'; 56 + import functionGetFormData from '~/legacy/handlebars/compiled/core/functions/getFormData'; 57 57 // @ts-expect-error 58 - import functionGetQueryString from '../legacy/handlebars/compiled/core/functions/getQueryString.js'; 58 + import functionGetQueryString from '~/legacy/handlebars/compiled/core/functions/getQueryString'; 59 59 // @ts-expect-error 60 - import functionGetUrl from '../legacy/handlebars/compiled/core/functions/getUrl.js'; 60 + import functionGetUrl from '~/legacy/handlebars/compiled/core/functions/getUrl'; 61 61 // @ts-expect-error 62 - import functionIsBlob from '../legacy/handlebars/compiled/core/functions/isBlob.js'; 62 + import functionIsBlob from '~/legacy/handlebars/compiled/core/functions/isBlob'; 63 63 // @ts-expect-error 64 - import functionIsFormData from '../legacy/handlebars/compiled/core/functions/isFormData.js'; 64 + import functionIsFormData from '~/legacy/handlebars/compiled/core/functions/isFormData'; 65 65 // @ts-expect-error 66 - import functionIsString from '../legacy/handlebars/compiled/core/functions/isString.js'; 66 + import functionIsString from '~/legacy/handlebars/compiled/core/functions/isString'; 67 67 // @ts-expect-error 68 - import functionIsStringWithValue from '../legacy/handlebars/compiled/core/functions/isStringWithValue.js'; 68 + import functionIsStringWithValue from '~/legacy/handlebars/compiled/core/functions/isStringWithValue'; 69 69 // @ts-expect-error 70 - import functionIsSuccess from '../legacy/handlebars/compiled/core/functions/isSuccess.js'; 70 + import functionIsSuccess from '~/legacy/handlebars/compiled/core/functions/isSuccess'; 71 71 // @ts-expect-error 72 - import functionResolve from '../legacy/handlebars/compiled/core/functions/resolve.js'; 72 + import functionResolve from '~/legacy/handlebars/compiled/core/functions/resolve'; 73 73 // @ts-expect-error 74 - import templateCoreHttpRequest from '../legacy/handlebars/compiled/core/HttpRequest.js'; 74 + import templateCoreHttpRequest from '~/legacy/handlebars/compiled/core/HttpRequest'; 75 75 // @ts-expect-error 76 - import templateCoreSettings from '../legacy/handlebars/compiled/core/OpenAPI.js'; 76 + import templateCoreSettings from '~/legacy/handlebars/compiled/core/OpenAPI'; 77 77 // @ts-expect-error 78 - import templateCoreRequest from '../legacy/handlebars/compiled/core/request.js'; 78 + import templateCoreRequest from '~/legacy/handlebars/compiled/core/request'; 79 79 // @ts-expect-error 80 - import xhrGetHeaders from '../legacy/handlebars/compiled/core/xhr/getHeaders.js'; 80 + import xhrGetHeaders from '~/legacy/handlebars/compiled/core/xhr/getHeaders'; 81 81 // @ts-expect-error 82 - import xhrGetRequestBody from '../legacy/handlebars/compiled/core/xhr/getRequestBody.js'; 82 + import xhrGetRequestBody from '~/legacy/handlebars/compiled/core/xhr/getRequestBody'; 83 83 // @ts-expect-error 84 - import xhrGetResponseBody from '../legacy/handlebars/compiled/core/xhr/getResponseBody.js'; 84 + import xhrGetResponseBody from '~/legacy/handlebars/compiled/core/xhr/getResponseBody'; 85 85 // @ts-expect-error 86 - import xhrGetResponseHeader from '../legacy/handlebars/compiled/core/xhr/getResponseHeader.js'; 86 + import xhrGetResponseHeader from '~/legacy/handlebars/compiled/core/xhr/getResponseHeader'; 87 87 // @ts-expect-error 88 - import xhrRequest from '../legacy/handlebars/compiled/core/xhr/request.js'; 88 + import xhrRequest from '~/legacy/handlebars/compiled/core/xhr/request'; 89 89 // @ts-expect-error 90 - import xhrSendRequest from '../legacy/handlebars/compiled/core/xhr/sendRequest.js'; 90 + import xhrSendRequest from '~/legacy/handlebars/compiled/core/xhr/sendRequest'; 91 + 91 92 import { getConfig } from './config'; 92 93 import { stringCase } from './stringCase'; 93 94 import { transformClassName } from './transform';
+1 -1
packages/openapi-ts/src/utils/input/heyApi.ts
··· 1 - import type { Input } from '../../types/input'; 1 + import type { Input } from '~/types/input'; 2 2 3 3 // Regular expression to match Hey API Registry input formats: 4 4 // - {organization}/{project}?{queryParams}
+2 -1
packages/openapi-ts/src/utils/input/index.ts
··· 1 - import type { Input } from '../../types/input'; 1 + import type { Input } from '~/types/input'; 2 + 2 3 import { heyApiRegistryBaseUrl, inputToHeyApiPath } from './heyApi'; 3 4 import { inputToReadmePath } from './readme'; 4 5 import { inputToScalarPath } from './scalar';
+1 -1
packages/openapi-ts/src/utils/input/readme.ts
··· 1 - import type { Input } from '../../types/input'; 1 + import type { Input } from '~/types/input'; 2 2 3 3 // Regular expression to match ReadMe API Registry input formats: 4 4 // - @{organization}/{project}#{uuid}
+1 -1
packages/openapi-ts/src/utils/input/scalar.ts
··· 1 - import type { Input } from '../../types/input'; 1 + import type { Input } from '~/types/input'; 2 2 3 3 // Regular expression to match Scalar API Registry input formats: 4 4 // - @{organization}/{project}
+2 -1
packages/openapi-ts/src/utils/meta.ts
··· 1 - import { getType } from '../openApi'; 1 + import { getType } from '~/openApi'; 2 + 2 3 import { refParametersPartial, refSchemasPartial } from './const'; 3 4 import { reservedJavaScriptKeywordsRegExp } from './regexp'; 4 5 import { cleanAndTransformTypeName } from './transform';
+5 -4
packages/openapi-ts/src/utils/postprocess.ts
··· 1 - import type { Client as ParserClient, Model } from '../openApi'; 2 - import { sanitizeNamespaceIdentifier } from '../openApi'; 3 - import type { Client, Operation, Service } from '../types/client'; 4 - import type { Config } from '../types/config'; 1 + import type { Client as ParserClient, Model } from '~/openApi'; 2 + import { sanitizeNamespaceIdentifier } from '~/openApi'; 3 + import type { Client, Operation, Service } from '~/types/client'; 4 + import type { Config } from '~/types/config'; 5 + 5 6 import { getConfig, legacyNameFromConfig } from './config'; 6 7 import { sort } from './sort'; 7 8 import { stringCase } from './stringCase';
+1 -1
packages/openapi-ts/src/utils/stringCase.ts
··· 1 - import type { StringCase } from '../types/case'; 1 + import type { StringCase } from '~/types/case'; 2 2 3 3 const uppercaseRegExp = /[\p{Lu}]/u; 4 4 const lowercaseRegExp = /[\p{Ll}]/u;
+3 -2
packages/openapi-ts/src/utils/transform.ts
··· 1 - import { ensureValidTypeScriptJavaScriptIdentifier } from '../openApi'; 2 - import type { Config } from '../types/config'; 1 + import { ensureValidTypeScriptJavaScriptIdentifier } from '~/openApi'; 2 + import type { Config } from '~/types/config'; 3 + 3 4 import { getConfig } from './config'; 4 5 import { reservedJavaScriptKeywordsRegExp } from './regexp'; 5 6 import { stringCase } from './stringCase';
+5 -4
packages/openapi-ts/src/utils/type.ts
··· 1 1 import type ts from 'typescript'; 2 2 3 - import type { Model } from '../openApi'; 4 - import { sanitizeOperationParameterName } from '../openApi'; 5 - import { type Property, tsc } from '../tsc'; 6 - import type { Client } from '../types/client'; 3 + import type { Model } from '~/openApi'; 4 + import { sanitizeOperationParameterName } from '~/openApi'; 5 + import { type Property, tsc } from '~/tsc'; 6 + import type { Client } from '~/types/client'; 7 + 7 8 import { getConfig, isLegacyClient } from './config'; 8 9 import { refSchemasPartial } from './const'; 9 10 import { enumValue } from './enum';
+5 -1
packages/openapi-ts/tsconfig.base.json
··· 11 11 "noUnusedParameters": true, 12 12 "strict": true, 13 13 "target": "ES2022", 14 - "useUnknownInCatchVariables": false 14 + "useUnknownInCatchVariables": false, 15 + "baseUrl": "./", 16 + "paths": { 17 + "~/*": ["src/*"] 18 + } 15 19 } 16 20 }
+14 -7
packages/openapi-ts/vitest.config.ts
··· 1 + import path from 'node:path'; 1 2 import { fileURLToPath } from 'node:url'; 2 3 3 4 import { createVitestConfig } from '@config/vite-base'; 4 5 5 - export default createVitestConfig( 6 - fileURLToPath(new URL('./', import.meta.url)), 7 - { 8 - test: { 9 - setupFiles: './setupTests.ts', 10 - }, 6 + const rootDir = fileURLToPath(new URL('./', import.meta.url)); 7 + 8 + export default createVitestConfig(rootDir, { 9 + resolve: { 10 + alias: [ 11 + // Support imports like `~/foo` and `~` -> maps to <root>/src 12 + { find: /^~\/(.*)/, replacement: path.resolve(rootDir, 'src/$1') }, 13 + { find: '~', replacement: path.resolve(rootDir, 'src') }, 14 + ], 15 + }, 16 + test: { 17 + setupFiles: './setupTests.ts', 11 18 }, 12 - ); 19 + });