fork of hey-api/openapi-ts because I need some additional things
at feat/use-mutation-hooks 32 lines 726 B view raw
1import { pydantic, sdk } from './plugins'; 2 3export const presets = { 4 sdk: () => [ 5 /** SDK */ 6 sdk({ 7 '~hooks': { 8 symbols: { 9 // getExportFromFilePath(symbol) { 10 // console.log(symbol.toString()); 11 // return undefined; 12 // }, 13 }, 14 }, 15 }), 16 ], 17 validated: () => [ 18 /** SDK + Pydantic validation */ 19 sdk(), 20 pydantic(), 21 ], 22} as const; 23 24export type PresetKey = keyof typeof presets; 25 26export function getPreset(key: PresetKey = (process.env.PRESET as PresetKey) || 'sdk') { 27 const preset = presets[key]; 28 if (!preset) { 29 throw new Error(`Unknown preset: ${key}. Available: ${Object.keys(presets).join(', ')}`); 30 } 31 return preset(); 32}