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

chore(pinia-colada): clean up query key generation (remove body / headers)

+7 -108
+1 -8
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts
··· 6 6 import { client } from '../client.gen'; 7 7 8 8 export type QueryKey<TOptions extends Options> = [ 9 - Pick<TOptions, 'body' | 'path'> & { 9 + Pick<TOptions, 'path'> & { 10 10 _id: string; 11 11 baseUrl?: _JSONValue; 12 - headers?: _JSONValue; 13 12 query?: _JSONValue; 14 13 tags?: _JSONValue; 15 14 } ··· 21 20 const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0]; 22 21 if (tags) { 23 22 params.tags = tags as unknown as _JSONValue; 24 - } 25 - if (options?.body) { 26 - params.body = options.body; 27 - } 28 - if (options?.headers) { 29 - params.headers = options.headers as unknown as _JSONValue; 30 23 } 31 24 if (options?.path) { 32 25 params.path = options.path;
+1 -8
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts
··· 6 6 import { client } from '../client.gen'; 7 7 8 8 export type QueryKey<TOptions extends Options> = [ 9 - Pick<TOptions, 'body' | 'path'> & { 9 + Pick<TOptions, 'path'> & { 10 10 _id: string; 11 11 baseUrl?: _JSONValue; 12 - headers?: _JSONValue; 13 12 query?: _JSONValue; 14 13 tags?: _JSONValue; 15 14 } ··· 21 20 const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0]; 22 21 if (tags) { 23 22 params.tags = tags as unknown as _JSONValue; 24 - } 25 - if (options?.body) { 26 - params.body = options.body; 27 - } 28 - if (options?.headers) { 29 - params.headers = options.headers as unknown as _JSONValue; 30 23 } 31 24 if (options?.path) { 32 25 params.path = options.path;
+1 -8
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts
··· 6 6 import { client } from '../client.gen'; 7 7 8 8 export type QueryKey<TOptions extends Options> = [ 9 - Pick<TOptions, 'body' | 'path'> & { 9 + Pick<TOptions, 'path'> & { 10 10 _id: string; 11 11 baseUrl?: _JSONValue; 12 - headers?: _JSONValue; 13 12 query?: _JSONValue; 14 13 tags?: _JSONValue; 15 14 } ··· 21 20 const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0]; 22 21 if (tags) { 23 22 params.tags = tags as unknown as _JSONValue; 24 - } 25 - if (options?.body) { 26 - params.body = options.body; 27 - } 28 - if (options?.headers) { 29 - params.headers = options.headers as unknown as _JSONValue; 30 23 } 31 24 if (options?.path) { 32 25 params.path = options.path;
+1 -8
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts
··· 6 6 import { client } from '../client.gen'; 7 7 8 8 export type QueryKey<TOptions extends Options> = [ 9 - Pick<TOptions, 'body' | 'path'> & { 9 + Pick<TOptions, 'path'> & { 10 10 _id: string; 11 11 baseUrl?: _JSONValue; 12 - headers?: _JSONValue; 13 12 query?: _JSONValue; 14 13 tags?: _JSONValue; 15 14 } ··· 21 20 const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0]; 22 21 if (tags) { 23 22 params.tags = tags as unknown as _JSONValue; 24 - } 25 - if (options?.body) { 26 - params.body = options.body; 27 - } 28 - if (options?.headers) { 29 - params.headers = options.headers as unknown as _JSONValue; 30 23 } 31 24 if (options?.path) { 32 25 params.path = options.path;
+1 -8
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts
··· 6 6 import { client } from '../client.gen'; 7 7 8 8 export type QueryKey<TOptions extends Options> = [ 9 - Pick<TOptions, 'body' | 'path'> & { 9 + Pick<TOptions, 'path'> & { 10 10 _id: string; 11 11 baseUrl?: _JSONValue; 12 - headers?: _JSONValue; 13 12 query?: _JSONValue; 14 13 tags?: _JSONValue; 15 14 } ··· 21 20 const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0]; 22 21 if (tags) { 23 22 params.tags = tags as unknown as _JSONValue; 24 - } 25 - if (options?.body) { 26 - params.body = options.body; 27 - } 28 - if (options?.headers) { 29 - params.headers = options.headers as unknown as _JSONValue; 30 23 } 31 24 if (options?.path) { 32 25 params.path = options.path;
+1 -8
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts
··· 6 6 import { client } from '../client.gen'; 7 7 8 8 export type QueryKey<TOptions extends Options> = [ 9 - Pick<TOptions, 'body' | 'path'> & { 9 + Pick<TOptions, 'path'> & { 10 10 _id: string; 11 11 baseUrl?: _JSONValue; 12 - headers?: _JSONValue; 13 12 query?: _JSONValue; 14 13 tags?: _JSONValue; 15 14 } ··· 21 20 const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0]; 22 21 if (tags) { 23 22 params.tags = tags as unknown as _JSONValue; 24 - } 25 - if (options?.body) { 26 - params.body = options.body; 27 - } 28 - if (options?.headers) { 29 - params.headers = options.headers as unknown as _JSONValue; 30 23 } 31 24 if (options?.path) { 32 25 params.path = options.path;
+1 -60
packages/openapi-ts/src/plugins/@pinia/colada/queryKey.ts
··· 136 136 expression: tsc.propertyAccessExpression({ 137 137 expression: optionsIdentifier, 138 138 isOptional: true, 139 - name: tsc.identifier({ text: 'body' }), 140 - }), 141 - thenStatement: tsc.block({ 142 - statements: [ 143 - tsc.expressionToStatement({ 144 - expression: tsc.binaryExpression({ 145 - left: tsc.propertyAccessExpression({ 146 - expression: 'params', 147 - name: 'body', 148 - }), 149 - right: tsc.propertyAccessExpression({ 150 - expression: 'options', 151 - name: 'body', 152 - }), 153 - }), 154 - }), 155 - ], 156 - }), 157 - }), 158 - tsc.ifStatement({ 159 - expression: tsc.propertyAccessExpression({ 160 - expression: optionsIdentifier, 161 - isOptional: true, 162 - name: tsc.identifier({ text: 'headers' }), 163 - }), 164 - thenStatement: tsc.block({ 165 - statements: [ 166 - tsc.expressionToStatement({ 167 - expression: tsc.binaryExpression({ 168 - left: tsc.propertyAccessExpression({ 169 - expression: 'params', 170 - name: 'headers', 171 - }), 172 - right: tsc.asExpression({ 173 - expression: tsc.asExpression({ 174 - expression: tsc.propertyAccessExpression({ 175 - expression: 'options', 176 - name: 'headers', 177 - }), 178 - type: tsc.keywordTypeNode({ keyword: 'unknown' }), 179 - }), 180 - type: tsc.typeReferenceNode({ 181 - typeName: symbolJsonValue.placeholder, 182 - }), 183 - }), 184 - }), 185 - }), 186 - ], 187 - }), 188 - }), 189 - tsc.ifStatement({ 190 - expression: tsc.propertyAccessExpression({ 191 - expression: optionsIdentifier, 192 - isOptional: true, 193 139 name: tsc.identifier({ text: 'path' }), 194 140 }), 195 141 thenStatement: tsc.block({ ··· 316 262 }, 317 263 { 318 264 isRequired: false, 319 - name: 'headers', 320 - type: tsc.typeReferenceNode({ typeName: symbolJsonValue.placeholder }), 321 - }, 322 - { 323 - isRequired: false, 324 265 name: 'query', 325 266 type: tsc.typeReferenceNode({ typeName: symbolJsonValue.placeholder }), 326 267 }, ··· 346 287 tsc.typeIntersectionNode({ 347 288 types: [ 348 289 tsc.typeReferenceNode({ 349 - typeName: `Pick<${TOptionsType}, 'body' | 'path'>`, 290 + typeName: `Pick<${TOptionsType}, 'path'>`, 350 291 }), 351 292 tsc.typeInterfaceNode({ 352 293 properties,