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

fix(pinia-colada): do not export query key when `queryKeys` disabled

+29 -17
+1 -1
packages/openapi-ts/src/plugins/@pinia/colada/queryKey.ts
··· 321 321 const typeData = useTypeData({ operation, plugin }); 322 322 const { strippedTypeData } = getPublicTypeData({ plugin, typeData }); 323 323 const statement = tsc.constVariable({ 324 - exportConst: true, 324 + exportConst: plugin.config.queryKeys.enabled, 325 325 expression: tsc.arrowFunction({ 326 326 parameters: [ 327 327 {
+28 -16
packages/openapi-ts/src/plugins/@pinia/colada/queryOptions.ts
··· 48 48 f.addImport({ from: plugin.name, names: ['defineQueryOptions'] }); 49 49 50 50 state.hasUsedQueryFn = true; 51 + const symbolCreateQueryKey = f.ensureSymbol({ 52 + selector: plugin.api.getSelector('createQueryKey'), 53 + }); 51 54 52 - const symbolQueryKey = f.addSymbol({ 53 - name: buildName({ 54 - config: plugin.config.queryKeys, 55 - name: operation.id, 56 - }), 57 - }); 58 - const node = queryKeyStatement({ 59 - operation, 60 - plugin, 61 - symbol: symbolQueryKey, 62 - }); 63 - symbolQueryKey.update({ value: node }); 55 + let keyExpression: ts.Expression; 56 + if (plugin.config.queryKeys.enabled) { 57 + const symbolQueryKey = f.addSymbol({ 58 + name: buildName({ 59 + config: plugin.config.queryKeys, 60 + name: operation.id, 61 + }), 62 + }); 63 + const node = queryKeyStatement({ 64 + operation, 65 + plugin, 66 + symbol: symbolQueryKey, 67 + }); 68 + symbolQueryKey.update({ value: node }); 69 + keyExpression = tsc.callExpression({ 70 + functionName: symbolQueryKey.placeholder, 71 + parameters: [optionsParamName], 72 + }); 73 + } else { 74 + keyExpression = tsc.callExpression({ 75 + functionName: symbolCreateQueryKey.placeholder, 76 + parameters: [tsc.ots.string(operation.id), optionsParamName], 77 + }); 78 + } 64 79 65 80 const typeData = useTypeData({ operation, plugin }); 66 81 const { strippedTypeData } = getPublicTypeData({ ··· 106 121 const queryOptionsObj: Array<{ key: string; value: ts.Expression }> = [ 107 122 { 108 123 key: 'key', 109 - value: tsc.callExpression({ 110 - functionName: symbolQueryKey.placeholder, 111 - parameters: [optionsParamName], 112 - }), 124 + value: keyExpression, 113 125 }, 114 126 { 115 127 key: 'query',