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

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #2886 from hey-api/chore/symbol-selector-remove

feat: remove symbol selectors

authored by

Lubos and committed by
GitHub
ef9918dc 128eb187

+263 -368
+3 -3
dev/openapi-ts.config.ts
··· 248 248 // }, 249 249 }, 250 250 { 251 - // asClass: true, 251 + asClass: true, 252 252 // auth: false, 253 253 // classNameBuilder: '{{name}}', 254 - // classNameBuilder: '{{name}}Service', 254 + classNameBuilder: '{{name}}Service', 255 255 // classStructure: 'off', 256 256 // client: false, 257 257 // getSignature: ({ fields, signature, operation }) => { ··· 259 259 // fields.unwrap('path') 260 260 // }, 261 261 // include... 262 - instance: true, 262 + // instance: true, 263 263 name: '@hey-api/sdk', 264 264 // operationId: false, 265 265 // params_EXPERIMENTAL: 'experiment',
+2 -1
packages/codegen-core/src/__tests__/exports.test.ts
··· 11 11 index.ProjectRenderMeta, 12 12 index.SymbolMeta, 13 13 index.File, 14 + index.FileIdentifier, 14 15 index.FileIn, 15 16 index.Output, 16 17 index.IProject, 17 18 index.Renderer, 18 - index.Selector, 19 19 index.Symbol, 20 + index.SymbolIdentifier, 20 21 index.SymbolIn, 21 22 ]; 22 23
+2 -2
packages/codegen-core/src/__tests__/project.test.ts
··· 23 23 // Add a symbol and render output 24 24 const symbol = project.symbols.register({ 25 25 getFilePath: () => 'foo', 26 + meta: { foo: 'bar' }, 26 27 placeholder: 'Foo', 27 - selector: ['foo'], 28 28 }); 29 29 // Add a renderer for .ts files 30 30 // Simulate a file with .ts extension ··· 80 80 // Register a symbol with selector 81 81 project.symbols.register({ 82 82 getFilePath: () => 'bar', 83 + meta: { bar: 'baz' }, 83 84 placeholder: 'Bar', 84 - selector: ['bar'], 85 85 }); 86 86 // Render output (should use fileName override) 87 87 const outputs = project.render();
+28 -47
packages/codegen-core/src/__tests__/symbols.test.ts
··· 11 11 expect(typeof id1).toBe('number'); 12 12 expect(id2).toBe(id1 + 1); 13 13 14 - // Register a symbol with selector 14 + // Register a symbol with meta 15 15 const symbol1 = registry.register({ 16 + meta: { 17 + foo: 'bar', 18 + }, 16 19 placeholder: 'Foo', 17 - selector: ['foo'], 18 20 }); 19 21 expect(symbol1).toEqual({ 20 22 exportFrom: [], 21 23 id: expect.any(Number), 24 + meta: { 25 + foo: 'bar', 26 + }, 22 27 placeholder: 'Foo', 23 - selector: ['foo'], 24 28 }); 25 29 26 - // get by id and selector 30 + // get by id and meta 27 31 expect(registry.get(symbol1.id)).toEqual(symbol1); 28 - expect(registry.get(['foo'])).toEqual(symbol1); 32 + expect(registry.get({ foo: 'bar' })).toEqual(symbol1); 29 33 30 34 // isRegistered should be true for explicitly registered symbols 31 35 expect(registry.isRegistered(symbol1.id)).toBe(true); 32 - expect(registry.isRegistered(['foo'])).toBe(true); 36 + expect(registry.isRegistered({ foo: 'bar' })).toBe(true); 33 37 34 - // Registering again with same selector returns same symbol 35 - const symbol1b = registry.register({ selector: ['foo'] }); 36 - expect(symbol1b).toEqual(symbol1); 38 + // Registering again with same meta creates a new symbol 39 + const symbol1b = registry.register({ meta: { foo: 'bar' } }); 40 + expect(symbol1b).not.toEqual(symbol1); 37 41 38 - // Registering with id returns same symbol 42 + // Registering with id overrides the symbol 39 43 const symbol1c = registry.register({ id: symbol1.id }); 40 - expect(symbol1c).toEqual(symbol1); 44 + expect(symbol1c).not.toEqual(symbol1); 45 + expect(symbol1c.id).toBe(symbol1.id); 41 46 42 - // Reference by id returns same symbol 43 - const ref1 = registry.reference(symbol1.id); 44 - expect(ref1).toEqual(symbol1); 47 + // Reference returns same symbol 48 + const ref1 = registry.reference({ foo: 'bar' }); 49 + expect(ref1).toEqual(symbol1c); 45 50 46 - // Reference by selector returns same symbol 47 - const ref1b = registry.reference(['foo']); 48 - expect(ref1b).toEqual(symbol1); 49 - 50 - // Register a new symbol with a different selector 51 + // Register a new symbol with different meta 51 52 const symbol2 = registry.register({ 52 53 exportFrom: ['x'], 54 + meta: { bar: 'baz' }, 53 55 placeholder: 'Bar', 54 - selector: ['bar'], 55 56 }); 56 57 expect(symbol2).toEqual({ 57 58 exportFrom: ['x'], 58 59 id: expect.any(Number), 60 + meta: { bar: 'baz' }, 59 61 placeholder: 'Bar', 60 - selector: ['bar'], 61 62 }); 62 63 63 - // Registering with same selector and extra exportFrom merges exportFrom 64 - const symbol2b = registry.register({ 65 - exportFrom: ['y'], 66 - selector: ['bar'], 67 - }); 68 - expect(symbol2b.exportFrom).toEqual(['x', 'y']); 69 - 70 64 // Registered symbols are yielded in order 71 65 const registered = Array.from(registry.registered()); 72 66 expect(registered).toEqual([ 73 - expect.objectContaining({ selector: ['foo'] }), 74 - expect.objectContaining({ selector: ['bar'] }), 67 + expect.objectContaining({ id: 2 }), 68 + expect.objectContaining({ meta: { foo: 'bar' } }), 69 + expect.objectContaining({ meta: { bar: 'baz' } }), 75 70 ]); 76 71 77 72 // setValue, getValue, hasValue ··· 80 75 expect(registry.hasValue(symbol1.id)).toBe(true); 81 76 expect(registry.getValue(symbol1.id)).toBe(42); 82 77 83 - // referenced-only symbol should not be registered until register() with data 84 - const symRef = registry.reference(['qux']); 78 + // referenced-only symbol should not be registered until register() 79 + const symRef = registry.reference({ qux: true }); 85 80 expect(registry.isRegistered(symRef.id)).toBe(false); 86 81 const symRegistered = registry.register({ 82 + meta: { qux: true }, 87 83 placeholder: 'Qux', 88 - selector: ['qux'], 89 84 }); 90 85 expect(registry.isRegistered(symRegistered.id)).toBe(true); 91 86 }); ··· 134 129 expect(symC).not.toEqual(refAD); 135 130 expect(symC).not.toEqual(refB); 136 131 expect(symC.meta).toEqual({ a: 0, b: 0, c: 0 }); 137 - }); 138 - 139 - it('throws on invalid register or reference', () => { 140 - const registry = new SymbolRegistry(); 141 - // Register with id that does not exist 142 - expect(() => registry.register({ id: 9999 })).toThrow( 143 - 'Symbol with ID 9999 not found. To register a new symbol, leave the ID undefined.', 144 - ); 145 - // Register with selector that maps to missing id 146 - // Simulate by manually setting selectorToId 147 - registry['selectorToId'].set(JSON.stringify(['missing']), 42); 148 - expect(() => registry.register({ selector: ['missing'] })).toThrow( 149 - 'Symbol with ID 42 not found. The selector ["missing"] matched an ID, but there was no result. This is likely an issue with the application logic.', 150 - ); 151 132 }); 152 133 153 134 it('caches query results and invalidates on relevant updates', () => {
+20 -18
packages/codegen-core/src/files/registry.ts
··· 1 1 import { BiMap } from '../bimap/bimap'; 2 - import type { ISelector } from '../selectors/types'; 3 - import type { IFileIn, IFileOut, IFileRegistry } from './types'; 2 + import type { 3 + IFileIdentifier, 4 + IFileIn, 5 + IFileOut, 6 + IFileRegistry, 7 + } from './types'; 4 8 5 9 export class FileRegistry implements IFileRegistry { 6 10 private _id: number = 0; ··· 9 13 private selectorToId: Map<string, number> = new Map(); 10 14 private values: Map<number, IFileOut> = new Map(); 11 15 12 - get(fileIdOrSelector: number | ISelector): IFileOut | undefined { 13 - const symbol = this.idOrSelector(fileIdOrSelector); 16 + get(identifier: IFileIdentifier): IFileOut | undefined { 17 + const file = this.identifierToFile(identifier); 14 18 15 - if (symbol.id !== undefined) { 16 - return this.values.get(symbol.id); 19 + if (file.id !== undefined) { 20 + return this.values.get(file.id); 17 21 } 18 22 19 23 const selector = 20 - symbol.selector !== undefined 21 - ? JSON.stringify(symbol.selector) 22 - : undefined; 24 + file.selector !== undefined ? JSON.stringify(file.selector) : undefined; 23 25 24 26 if (selector) { 25 27 const id = this.selectorToId.get(selector); ··· 35 37 return this._id++; 36 38 } 37 39 38 - private idOrSelector( 39 - symbolIdOrSelector: number | ISelector, 40 + private identifierToFile( 41 + identifier: IFileIdentifier, 40 42 ): Pick<IFileIn, 'id' | 'selector'> { 41 - return typeof symbolIdOrSelector === 'number' 42 - ? { id: symbolIdOrSelector } 43 - : { selector: symbolIdOrSelector }; 43 + return typeof identifier === 'number' 44 + ? { id: identifier } 45 + : { selector: identifier }; 44 46 } 45 47 46 - isRegistered(fileIdOrSelector: number | ISelector): boolean { 47 - const file = this.get(fileIdOrSelector); 48 + isRegistered(identifier: IFileIdentifier): boolean { 49 + const file = this.get(identifier); 48 50 return file ? this.registerOrder.has(file.id) : false; 49 51 } 50 52 51 - reference(fileIdOrSelector: number | ISelector): IFileOut { 52 - const file = this.idOrSelector(fileIdOrSelector); 53 + reference(identifier: IFileIdentifier): IFileOut { 54 + const file = this.identifierToFile(identifier); 53 55 return this.register(file); 54 56 } 55 57
+20 -13
packages/codegen-core/src/files/types.d.ts
··· 1 1 import type { IBiMap } from '../bimap/types'; 2 - import type { ISelector } from '../selectors/types'; 2 + 3 + /** 4 + * Selector array used to reference files. 5 + * 6 + * @example ["foo", "bar"] 7 + */ 8 + export type IFileSelector = ReadonlyArray<string>; 9 + 10 + export type IFileIdentifier = number | IFileSelector; 3 11 4 12 export interface IFileIn { 5 13 /** ··· 32 40 */ 33 41 readonly path?: string; 34 42 /** 35 - * Selector array used to select this file. It doesn't have to be 36 - * unique, but in practice it might be desirable. 43 + * Selector array used to select this file. 37 44 * 38 - * @example ["zod", "#/components/schemas/Foo"] 45 + * @example ["foo", "bar"] 39 46 */ 40 - readonly selector?: ISelector; 47 + readonly selector?: IFileSelector; 41 48 } 42 49 43 50 export interface IFileOut extends IFileIn { ··· 70 77 71 78 export interface IFileRegistry { 72 79 /** 73 - * Get a file by its ID. 80 + * Get a file. 74 81 * 75 - * @param fileIdOrSelector File ID or selector to reference. 82 + * @param identifier File identifier to reference. 76 83 * @returns The file, or undefined if not found. 77 84 */ 78 - get(fileIdOrSelector: number | ISelector): IFileOut | undefined; 85 + get(identifier: IFileIdentifier): IFileOut | undefined; 79 86 /** 80 87 * Returns the current file ID and increments it. 81 88 * ··· 85 92 /** 86 93 * Returns whether a file is registered in the registry. 87 94 * 88 - * @param fileIdOrSelector File ID or selector to check. 95 + * @param identifier File identifier to check. 89 96 * @returns True if the file is registered, false otherwise. 90 97 */ 91 - isRegistered(fileIdOrSelector: number | ISelector): boolean; 98 + isRegistered(identifier: IFileIdentifier): boolean; 92 99 /** 93 - * Returns a file by ID or selector, registering it if it doesn't exist. 100 + * Returns a file by identifier, registering it if it doesn't exist. 94 101 * 95 - * @param fileIdOrSelector File ID or selector to reference. 102 + * @param identifier File identifier to reference. 96 103 * @returns The referenced or newly registered file. 97 104 */ 98 - reference(fileIdOrSelector: number | ISelector): IFileOut; 105 + reference(identifier: IFileIdentifier): IFileOut; 99 106 /** 100 107 * Get all unregistered files in the order they were referenced. 101 108 *
+5 -2
packages/codegen-core/src/index.ts
··· 5 5 IProjectRenderMeta as ProjectRenderMeta, 6 6 ISymbolMeta as SymbolMeta, 7 7 } from './extensions/types'; 8 - export type { IFileOut as File, IFileIn as FileIn } from './files/types'; 8 + export type { 9 + IFileOut as File, 10 + IFileIdentifier as FileIdentifier, 11 + IFileIn as FileIn, 12 + } from './files/types'; 9 13 export type { IOutput as Output } from './output/types'; 10 14 export { Project } from './project/project'; 11 15 export type { IProject } from './project/types'; 12 16 export type { IRenderer as Renderer } from './renderer/types'; 13 17 export { renderIds } from './renderer/utils'; 14 - export type { ISelector as Selector } from './selectors/types'; 15 18 export type { 16 19 ISymbolOut as Symbol, 17 20 ISymbolIdentifier as SymbolIdentifier,
+2 -3
packages/codegen-core/src/project/project.ts
··· 2 2 3 3 import type { IProjectRenderMeta } from '../extensions/types'; 4 4 import { FileRegistry } from '../files/registry'; 5 - import type { IFileOut } from '../files/types'; 5 + import type { IFileOut, IFileSelector } from '../files/types'; 6 6 import type { IOutput } from '../output/types'; 7 7 import type { IRenderer } from '../renderer/types'; 8 - import type { ISelector } from '../selectors/types'; 9 8 import { SymbolRegistry } from '../symbols/registry'; 10 9 import type { ISymbolOut } from '../symbols/types'; 11 10 import type { IProject } from './types'; ··· 132 131 return Array.from(fileIds ?? []).map((fileId) => this.files.get(fileId)!); 133 132 } 134 133 135 - private symbolToFileSelector(symbol: ISymbolOut): ISelector { 134 + private symbolToFileSelector(symbol: ISymbolOut): IFileSelector { 136 135 if (symbol.external) { 137 136 return [externalSourceSymbol, symbol.external]; 138 137 }
-8
packages/codegen-core/src/selectors/types.d.ts
··· 1 - /** 2 - * Selector array used to reference resources. We don't enforce 3 - * uniqueness, but in practice it's desirable. 4 - * 5 - * @deprecated 6 - * @example ["zod", "#/components/schemas/Foo"] 7 - */ 8 - export type ISelector = ReadonlyArray<string>;
+12 -110
packages/codegen-core/src/symbols/registry.ts
··· 21 21 private queryCacheDependencies: Map<QueryCacheKey, Set<QueryCacheKey>> = 22 22 new Map(); 23 23 private registerOrder: Set<SymbolId> = new Set(); 24 - // TODO: remove after removing selectors 25 - private selectorToId: Map<string, SymbolId> = new Map(); 26 24 private stubCache: Map<QueryCacheKey, SymbolId> = new Map(); 27 25 private stubs: Set<SymbolId> = new Set(); 28 26 private values: Map<SymbolId, ISymbolOut> = new Map(); 29 27 30 28 get(identifier: ISymbolIdentifier): ISymbolOut | undefined { 31 - const symbol = this.identifierToSymbol(identifier); 32 - 33 - if (symbol.id !== undefined) { 34 - return this.values.get(symbol.id); 35 - } 36 - 37 - // TODO: remove after removing selectors 38 - const selector = 39 - symbol.selector !== undefined 40 - ? JSON.stringify(symbol.selector) 41 - : undefined; 42 - 43 - // TODO: remove after removing selectors 44 - if (selector) { 45 - const id = this.selectorToId.get(selector); 46 - if (id !== undefined) { 47 - return this.values.get(id); 48 - } 49 - } 50 - 51 - if (symbol.meta) { 52 - return this.query(symbol.meta)[0]; 53 - } 54 - 55 - return; 29 + return typeof identifier === 'number' 30 + ? this.values.get(identifier) 31 + : this.query(identifier)[0]; 56 32 } 57 33 58 34 getValue(symbolId: SymbolId): unknown { ··· 111 87 return resultIds.map((symbolId) => this.values.get(symbolId)!); 112 88 } 113 89 114 - reference(identifier: ISymbolIdentifier): ISymbolOut { 115 - const symbol = this.identifierToSymbol(identifier); 116 - if (!symbol.meta) { 117 - // TODO: remove/refactor after removing selectors 118 - return this.register(symbol); 119 - } 120 - const [registered] = this.query(symbol.meta); 90 + reference(meta: ISymbolMeta): ISymbolOut { 91 + const [registered] = this.query(meta); 121 92 if (registered) return registered; 122 - const cacheKey = this.buildCacheKey(symbol.meta); 93 + const cacheKey = this.buildCacheKey(meta); 123 94 const cachedId = this.stubCache.get(cacheKey); 124 95 if (cachedId !== undefined) return this.values.get(cachedId)!; 125 96 const id = this.id; 126 97 const stub: ISymbolOut = { 127 98 exportFrom: [], 128 99 id, 129 - meta: symbol.meta, 100 + meta, 130 101 placeholder: wrapId(String(id)), 131 102 }; 132 103 this.values.set(stub.id, stub); ··· 136 107 } 137 108 138 109 register(symbol: ISymbolIn): ISymbolOut { 139 - // TODO: refactor after removing selectors 140 - if (symbol.id !== undefined) { 141 - const result = this.values.get(symbol.id); 142 - if (!result) { 143 - throw new Error( 144 - `Symbol with ID ${symbol.id} not found. To register a new symbol, leave the ID undefined.`, 145 - ); 146 - } 147 - return result; 148 - } 149 - 150 - // TODO: refactor after removing selectors 151 - const hasOtherKeys = Object.keys(symbol).some( 152 - (key) => !['id', 'meta', 'selector'].includes(key), 153 - ); 154 - 155 - let result: ISymbolOut | undefined; 156 - 157 - // TODO: remove after removing selectors 158 - const selector = 159 - symbol.selector !== undefined 160 - ? JSON.stringify(symbol.selector) 161 - : undefined; 162 - if (selector) { 163 - const id = this.selectorToId.get(selector); 164 - if (id !== undefined) { 165 - result = this.values.get(id); 166 - if (!result) { 167 - throw new Error( 168 - `Symbol with ID ${id} not found. The selector ${selector} matched an ID, but there was no result. This is likely an issue with the application logic.`, 169 - ); 170 - } 171 - if (!hasOtherKeys) { 172 - return result; 173 - } 174 - } 175 - } 176 - 177 - const id = result?.id !== undefined ? result.id : this.id; 178 - const exportFrom: Array<string> = result?.exportFrom 179 - ? [...result.exportFrom] 180 - : []; 181 - if (symbol.exportFrom) { 182 - exportFrom.push(...symbol.exportFrom); 183 - } 184 - result = { 185 - ...result, 110 + const id = symbol.id !== undefined ? symbol.id : this.id; 111 + const result: ISymbolOut = { 186 112 ...symbol, // clone to avoid mutation 187 - exportFrom, 113 + exportFrom: symbol.exportFrom ?? [], 188 114 id, 189 - placeholder: 190 - result?.placeholder ?? symbol.placeholder ?? wrapId(String(id)), 115 + placeholder: symbol.placeholder ?? wrapId(String(id)), 191 116 }; 192 117 this.values.set(result.id, result); 193 - 194 - if (hasOtherKeys) { 195 - this.registerOrder.add(result.id); 196 - } 197 - 198 - if (selector) { 199 - // TODO: remove after removing selectors 200 - this.selectorToId.set(selector, result.id); 201 - } 202 - 118 + this.registerOrder.add(result.id); 203 119 if (result.meta) { 204 120 const indexKeySpace = this.buildIndexKeySpace(result.meta); 205 121 this.indexSymbol(result.id, indexKeySpace); 206 122 this.invalidateCache(indexKeySpace); 207 123 this.replaceStubs(result, indexKeySpace); 208 124 } 209 - 210 125 return result; 211 126 } 212 127 ··· 239 154 } 240 155 } 241 156 return entries; 242 - } 243 - 244 - private identifierToSymbol( 245 - identifier: ISymbolIdentifier, 246 - ): Pick<ISymbolIn, 'id' | 'meta' | 'selector'> { 247 - if (typeof identifier === 'number') { 248 - return { id: identifier }; 249 - } 250 - if (identifier instanceof Array) { 251 - // TODO: remove after removing selectors 252 - return { selector: identifier }; 253 - } 254 - return { meta: identifier }; 255 157 } 256 158 257 159 private indexSymbol(symbolId: SymbolId, indexKeySpace: IndexKeySpace): void {
+5 -14
packages/codegen-core/src/symbols/types.d.ts
··· 1 1 import type { ISymbolMeta } from '../extensions/types'; 2 - import type { ISelector } from '../selectors/types'; 3 2 4 - export type ISymbolIdentifier = number | ISymbolMeta | ISelector; 3 + export type ISymbolIdentifier = number | ISymbolMeta; 5 4 6 5 export interface ISymbolIn { 7 6 /** ··· 60 59 * @example "_heyapi_31_" 61 60 */ 62 61 readonly placeholder?: string; 63 - /** 64 - * Selector array used to select this symbol. It doesn't have to be 65 - * unique, but in practice it might be desirable. 66 - * 67 - * @deprecated 68 - * @example ["zod", "#/components/schemas/Foo"] 69 - */ 70 - readonly selector?: ISelector; 71 62 } 72 63 73 64 export interface ISymbolOut extends ISymbolIn { ··· 130 121 */ 131 122 query(filter: ISymbolMeta): ReadonlyArray<ISymbolOut>; 132 123 /** 133 - * Returns a symbol, registers it if it doesn't exist. 124 + * References a symbol. 134 125 * 135 - * @param identifier Symbol identifier to reference. 136 - * @returns The referenced or newly registered symbol. 126 + * @param meta Metadata filter to reference symbol by. 127 + * @returns The referenced symbol. 137 128 */ 138 - reference(identifier: ISymbolIdentifier): ISymbolOut; 129 + reference(meta: ISymbolMeta): ISymbolOut; 139 130 /** 140 131 * Register a symbol globally. 141 132 *
+2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 + 60 61 providers = new Providers({ client: this._client }); 61 62 } 62 63 ··· 74 75 ...options 75 76 }); 76 77 } 78 + 77 79 business = new Business({ client: this._client }); 78 80 }
+2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/sdk.gen.ts
··· 52 52 ...options 53 53 }); 54 54 } 55 + 55 56 static providers = Providers; 56 57 } 57 58 ··· 62 63 ...options 63 64 }); 64 65 } 66 + 65 67 static business = Business; 66 68 }
+2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/sdk.gen.ts
··· 60 60 ...options 61 61 }); 62 62 } 63 + 63 64 bar = new Bar({ client: this._client }); 64 65 } 65 66 ··· 77 78 ...options 78 79 }); 79 80 } 81 + 80 82 foo = new Foo({ client: this._client }); 81 83 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 + 60 61 providers = new Providers({ client: this._client }); 61 62 } 62 63 ··· 74 75 ...options 75 76 }); 76 77 } 78 + 77 79 business = new Business({ client: this._client }); 78 80 }
+2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/sdk.gen.ts
··· 52 52 ...options 53 53 }); 54 54 } 55 + 55 56 static providers = Providers; 56 57 } 57 58 ··· 62 63 ...options 63 64 }); 64 65 } 66 + 65 67 static business = Business; 66 68 }
+2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/sdk.gen.ts
··· 60 60 ...options 61 61 }); 62 62 } 63 + 63 64 bar = new Bar({ client: this._client }); 64 65 } 65 66 ··· 77 78 ...options 78 79 }); 79 80 } 81 + 80 82 foo = new Foo({ client: this._client }); 81 83 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/sdk.gen.ts
··· 57 57 ...options 58 58 }); 59 59 } 60 + 60 61 providers = new Providers({ client: this._client }); 61 62 } 62 63 ··· 74 75 ...options 75 76 }); 76 77 } 78 + 77 79 business = new Business({ client: this._client }); 78 80 }
+2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/client-fetch/sdk-nested-classes/sdk.gen.ts
··· 52 52 ...options 53 53 }); 54 54 } 55 + 55 56 static providers = Providers; 56 57 } 57 58 ··· 62 63 ...options 63 64 }); 64 65 } 66 + 65 67 static business = Business; 66 68 }
+2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/instance/sdk.gen.ts
··· 60 60 ...options 61 61 }); 62 62 } 63 + 63 64 bar = new Bar({ client: this._client }); 64 65 } 65 66 ··· 77 78 ...options 78 79 }); 79 80 } 81 + 80 82 foo = new Foo({ client: this._client }); 81 83 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/asClass/sdk.gen.ts
··· 48 48 ...options 49 49 }); 50 50 } 51 + 51 52 static barService = BarService; 52 53 } 53 54 ··· 58 59 ...options 59 60 }); 60 61 } 62 + 61 63 static fooService = FooService; 62 64 } 63 65 ··· 68 70 ...options 69 71 }); 70 72 } 73 + 71 74 static fooService = FooService; 72 75 }
+2 -6
packages/openapi-ts/src/generate/__tests__/class.test.ts
··· 85 85 ], 86 86 plugins: { 87 87 '@hey-api/schemas': { 88 - api: { 89 - selector: () => [], 90 - }, 88 + api: {}, 91 89 config: { 92 90 name: '@hey-api/schemas', 93 91 }, ··· 96 94 output: '', 97 95 }, 98 96 '@hey-api/sdk': { 99 - api: { 100 - selector: () => [], 101 - }, 97 + api: {}, 102 98 config: { 103 99 name: '@hey-api/sdk', 104 100 },
+6 -18
packages/openapi-ts/src/generate/__tests__/core.test.ts
··· 100 100 ], 101 101 plugins: { 102 102 '@hey-api/schemas': { 103 - api: { 104 - selector: () => [], 105 - }, 103 + api: {}, 106 104 config: { 107 105 name: '@hey-api/schemas', 108 106 }, ··· 111 109 output: '', 112 110 }, 113 111 '@hey-api/sdk': { 114 - api: { 115 - selector: () => [], 116 - }, 112 + api: {}, 117 113 config: { 118 114 name: '@hey-api/sdk', 119 115 }, ··· 256 252 ], 257 253 plugins: { 258 254 '@hey-api/schemas': { 259 - api: { 260 - selector: () => [], 261 - }, 255 + api: {}, 262 256 config: { 263 257 name: '@hey-api/schemas', 264 258 }, ··· 267 261 output: '', 268 262 }, 269 263 '@hey-api/sdk': { 270 - api: { 271 - selector: () => [], 272 - }, 264 + api: {}, 273 265 config: { 274 266 name: '@hey-api/sdk', 275 267 }, ··· 395 387 ], 396 388 plugins: { 397 389 '@hey-api/schemas': { 398 - api: { 399 - selector: () => [], 400 - }, 390 + api: {}, 401 391 config: { 402 392 name: '@hey-api/schemas', 403 393 }, ··· 406 396 output: '', 407 397 }, 408 398 '@hey-api/sdk': { 409 - api: { 410 - selector: () => [], 411 - }, 399 + api: {}, 412 400 config: { 413 401 name: '@hey-api/sdk', 414 402 },
+2 -6
packages/openapi-ts/src/generate/legacy/__tests__/index.test.ts
··· 84 84 ], 85 85 plugins: { 86 86 '@hey-api/schemas': { 87 - api: { 88 - selector: () => [], 89 - }, 87 + api: {}, 90 88 config: { 91 89 name: '@hey-api/schemas', 92 90 }, ··· 95 93 output: '', 96 94 }, 97 95 '@hey-api/sdk': { 98 - api: { 99 - selector: () => [], 100 - }, 96 + api: {}, 101 97 config: { 102 98 name: '@hey-api/sdk', 103 99 },
+2 -6
packages/openapi-ts/src/generate/legacy/__tests__/output.test.ts
··· 97 97 ], 98 98 plugins: { 99 99 '@hey-api/schemas': { 100 - api: { 101 - selector: () => [], 102 - }, 100 + api: {}, 103 101 config: { 104 102 name: '@hey-api/schemas', 105 103 }, ··· 108 106 output: '', 109 107 }, 110 108 '@hey-api/sdk': { 111 - api: { 112 - selector: () => [], 113 - }, 109 + api: {}, 114 110 config: { 115 111 name: '@hey-api/sdk', 116 112 },
+4 -12
packages/openapi-ts/src/plugins/@hey-api/schemas/__tests__/schemas.test.ts
··· 88 88 ], 89 89 plugins: { 90 90 '@hey-api/schemas': { 91 - api: { 92 - selector: () => [], 93 - }, 91 + api: {}, 94 92 config: { 95 93 name: '@hey-api/schemas', 96 94 }, ··· 99 97 output: '', 100 98 }, 101 99 '@hey-api/sdk': { 102 - api: { 103 - selector: () => [], 104 - }, 100 + api: {}, 105 101 config: { 106 102 name: '@hey-api/sdk', 107 103 }, ··· 256 252 ], 257 253 plugins: { 258 254 '@hey-api/schemas': { 259 - api: { 260 - selector: () => [], 261 - }, 255 + api: {}, 262 256 config: { 263 257 name: '@hey-api/schemas', 264 258 nameBuilder: nameFn, ··· 268 262 output: '', 269 263 }, 270 264 '@hey-api/sdk': { 271 - api: { 272 - selector: () => [], 273 - }, 265 + api: {}, 274 266 config: { 275 267 name: '@hey-api/sdk', 276 268 },
+8 -24
packages/openapi-ts/src/plugins/@hey-api/sdk/__tests__/plugin.test.ts
··· 90 90 ], 91 91 plugins: { 92 92 '@hey-api/schemas': { 93 - api: { 94 - selector: () => [], 95 - }, 93 + api: {}, 96 94 config: { 97 95 name: '@hey-api/schemas', 98 96 }, ··· 101 99 output: '', 102 100 }, 103 101 '@hey-api/sdk': { 104 - api: { 105 - selector: () => [], 106 - }, 102 + api: {}, 107 103 config: { 108 104 asClass: true, 109 105 name: '@hey-api/sdk', ··· 331 327 ], 332 328 plugins: { 333 329 '@hey-api/schemas': { 334 - api: { 335 - selector: () => [], 336 - }, 330 + api: {}, 337 331 config: { 338 332 name: '@hey-api/schemas', 339 333 }, ··· 342 336 output: '', 343 337 }, 344 338 '@hey-api/sdk': { 345 - api: { 346 - selector: () => [], 347 - }, 339 + api: {}, 348 340 config: { 349 341 asClass: true, 350 342 name: '@hey-api/sdk', ··· 494 486 ], 495 487 plugins: { 496 488 '@hey-api/schemas': { 497 - api: { 498 - selector: () => [], 499 - }, 489 + api: {}, 500 490 config: { 501 491 name: '@hey-api/schemas', 502 492 }, ··· 505 495 output: '', 506 496 }, 507 497 '@hey-api/sdk': { 508 - api: { 509 - selector: () => [], 510 - }, 498 + api: {}, 511 499 config: { 512 500 asClass: true, 513 501 methodNameBuilder, ··· 660 648 ], 661 649 plugins: { 662 650 '@hey-api/schemas': { 663 - api: { 664 - selector: () => [], 665 - }, 651 + api: {}, 666 652 config: { 667 653 name: '@hey-api/schemas', 668 654 }, ··· 671 657 output: '', 672 658 }, 673 659 '@hey-api/sdk': { 674 - api: { 675 - selector: () => [], 676 - }, 660 + api: {}, 677 661 config: { 678 662 asClass: false, 679 663 methodNameBuilder,
+53 -34
packages/openapi-ts/src/plugins/@hey-api/sdk/shared/class.ts
··· 167 167 }); 168 168 if (!sdkClasses.has(symbolCurrentClass.meta!.resourceId!)) { 169 169 sdkClasses.set(symbolCurrentClass.meta!.resourceId!, { 170 - className: currentClassName, 170 + className: symbolCurrentClass.meta!.resourceId!, 171 171 classes: new Set(), 172 172 id: symbolCurrentClass.id, 173 173 methods: new Set(), ··· 185 185 tool: 'sdk', 186 186 }); 187 187 if ( 188 - symbolParentClass.placeholder !== symbolCurrentClass.placeholder 188 + symbolParentClass.meta?.resourceId !== 189 + symbolCurrentClass.meta?.resourceId 189 190 ) { 190 191 const parentClass = sdkClasses.get( 191 192 symbolParentClass.meta!.resourceId!, ··· 303 304 const childClass = sdkClasses.get(childClassName)!; 304 305 generateClass(childClass); 305 306 306 - currentClass.nodes.push( 307 - tsc.propertyDeclaration({ 308 - initializer: plugin.config.instance 309 - ? tsc.newExpression({ 310 - argumentsArray: plugin.config.instance 311 - ? [ 312 - tsc.objectExpression({ 313 - multiLine: false, 314 - obj: [ 315 - { 316 - key: 'client', 317 - value: tsc.propertyAccessExpression({ 318 - expression: tsc.this(), 319 - name: '_client', 320 - }), 321 - }, 322 - ], 323 - }), 324 - ] 325 - : [], 326 - expression: tsc.identifier({ 327 - text: plugin.referenceSymbol(childClass.id).placeholder, 328 - }), 329 - }) 330 - : tsc.identifier({ 331 - text: plugin.referenceSymbol(childClass.id).placeholder, 307 + const subClassReferenceNode = tsc.propertyDeclaration({ 308 + initializer: plugin.config.instance 309 + ? tsc.newExpression({ 310 + argumentsArray: plugin.config.instance 311 + ? [ 312 + tsc.objectExpression({ 313 + multiLine: false, 314 + obj: [ 315 + { 316 + key: 'client', 317 + value: tsc.propertyAccessExpression({ 318 + expression: tsc.this(), 319 + name: '_client', 320 + }), 321 + }, 322 + ], 323 + }), 324 + ] 325 + : [], 326 + expression: tsc.identifier({ 327 + text: plugin.referenceSymbol({ 328 + category: 'utility', 329 + resource: 'class', 330 + resourceId: childClass.className, 331 + tool: 'sdk', 332 + }).placeholder, 332 333 }), 333 - modifier: plugin.config.instance ? undefined : 'static', 334 - name: stringCase({ 335 - case: 'camelCase', 336 - value: childClass.className, 337 - }), 334 + }) 335 + : tsc.identifier({ 336 + text: plugin.referenceSymbol({ 337 + category: 'utility', 338 + resource: 'class', 339 + resourceId: childClass.className, 340 + tool: 'sdk', 341 + }).placeholder, 342 + }), 343 + modifier: plugin.config.instance ? undefined : 'static', 344 + name: stringCase({ 345 + case: 'camelCase', 346 + value: childClass.className, 338 347 }), 339 - ); 348 + }); 349 + 350 + if (!currentClass.nodes.length) { 351 + currentClass.nodes.push(subClassReferenceNode); 352 + } else { 353 + currentClass.nodes.push( 354 + // @ts-expect-error 355 + tsc.identifier({ text: '\n' }), 356 + subClassReferenceNode, 357 + ); 358 + } 340 359 } 341 360 } 342 361
+2 -6
packages/openapi-ts/src/plugins/@hey-api/typescript/__tests__/plugin.test.ts
··· 88 88 ], 89 89 plugins: { 90 90 '@hey-api/schemas': { 91 - api: { 92 - selector: () => [], 93 - }, 91 + api: {}, 94 92 config: { 95 93 name: '@hey-api/schemas', 96 94 }, ··· 99 97 output: '', 100 98 }, 101 99 '@hey-api/sdk': { 102 - api: { 103 - selector: () => [], 104 - }, 100 + api: {}, 105 101 config: { 106 102 name: '@hey-api/sdk', 107 103 },
+2 -2
packages/openapi-ts/src/plugins/shared/utils/instance.ts
··· 302 302 return this.gen.symbols.query(filter)[0]; 303 303 } 304 304 305 - referenceSymbol(identifier: SymbolIdentifier): Symbol { 306 - return this.gen.symbols.reference(identifier); 305 + referenceSymbol(meta: SymbolMeta): Symbol { 306 + return this.gen.symbols.reference(meta); 307 307 } 308 308 309 309 registerSymbol(symbol: SymbolIn): Symbol {
+4 -12
packages/openapi-ts/src/utils/__tests__/handlebars.test.ts
··· 81 81 ], 82 82 plugins: { 83 83 '@hey-api/schemas': { 84 - api: { 85 - selector: () => [], 86 - }, 84 + api: {}, 87 85 config: { 88 86 name: '@hey-api/schemas', 89 87 }, ··· 92 90 output: '', 93 91 }, 94 92 '@hey-api/sdk': { 95 - api: { 96 - selector: () => [], 97 - }, 93 + api: {}, 98 94 config: { 99 95 name: '@hey-api/sdk', 100 96 }, ··· 210 206 ], 211 207 plugins: { 212 208 '@hey-api/schemas': { 213 - api: { 214 - selector: () => [], 215 - }, 209 + api: {}, 216 210 config: { 217 211 name: '@hey-api/schemas', 218 212 }, ··· 221 215 output: '', 222 216 }, 223 217 '@hey-api/sdk': { 224 - api: { 225 - selector: () => [], 226 - }, 218 + api: {}, 227 219 config: { 228 220 name: '@hey-api/sdk', 229 221 },
+7 -21
packages/openapi-ts/src/utils/__tests__/parse.test.ts
··· 71 71 pluginOrder: ['legacy/fetch', '@hey-api/sdk'], 72 72 plugins: { 73 73 '@hey-api/sdk': { 74 - api: { 75 - selector: () => [], 76 - }, 74 + api: {}, 77 75 config: { 78 76 name: '@hey-api/sdk', 79 77 operationId: true, ··· 101 99 plugins: { 102 100 ...optionsCommon.plugins, 103 101 '@hey-api/sdk': { 104 - api: { 105 - selector: () => [], 106 - }, 102 + api: {}, 107 103 config: { 108 104 name: '@hey-api/sdk', 109 105 operationId: true, ··· 121 117 plugins: { 122 118 ...optionsCommon.plugins, 123 119 '@hey-api/sdk': { 124 - api: { 125 - selector: () => [], 126 - }, 120 + api: {}, 127 121 config: { 128 122 name: '@hey-api/sdk', 129 123 operationId: false, ··· 141 135 pluginOrder: ['@hey-api/client-fetch', '@hey-api/sdk'], 142 136 plugins: { 143 137 '@hey-api/client-fetch': { 144 - api: { 145 - selector: () => [], 146 - }, 138 + api: {}, 147 139 config: { 148 140 name: '@hey-api/client-fetch', 149 141 }, ··· 153 145 tags: ['client'], 154 146 }, 155 147 '@hey-api/sdk': { 156 - api: { 157 - selector: () => [], 158 - }, 148 + api: {}, 159 149 config: { 160 150 name: '@hey-api/sdk', 161 151 operationId: true, ··· 173 163 pluginOrder: ['@hey-api/client-fetch', '@hey-api/sdk'], 174 164 plugins: { 175 165 '@hey-api/client-fetch': { 176 - api: { 177 - selector: () => [], 178 - }, 166 + api: {}, 179 167 config: { 180 168 name: '@hey-api/client-fetch', 181 169 }, ··· 185 173 tags: ['client'], 186 174 }, 187 175 '@hey-api/sdk': { 188 - api: { 189 - selector: () => [], 190 - }, 176 + api: {}, 191 177 config: { 192 178 name: '@hey-api/sdk', 193 179 operationId: false,