import { defineConfig } from '@hey-api/openapi-ts'

export default defineConfig({
  // Requires apps/server openapi snapshot generated by scripts/export-openapi.ts
  input: '../server/openapi.json',
  output: {
    path: './src/api-gen',
    clean: true,
    preferExportAll: true,
  },
  plugins: [
    {
      name: '@hey-api/client-fetch',
      runtimeConfigPath: '~/lib/client.config',
      exportFromIndex: true,
    },
    {
      name: '@tanstack/react-query',
    },
    {
      name: 'zod',
      responses: false,
    },
    {
      name: '@hey-api/sdk',
      validator: true,
    },
  ],
})
