Files
zerobyte/openapi-ts.config.ts
2026-06-09 19:50:27 +02:00

21 lines
693 B
TypeScript

import { execFileSync } from "node:child_process";
import { defaultPlugins, defineConfig } from "@hey-api/openapi-ts";
const openApiInput = `${execFileSync("portless", ["get", "zerobyte"], { encoding: "utf8" }).trim().replace(/\/$/, "")}/api/v1/openapi.json`;
export default defineConfig({
input: openApiInput,
output: {
path: "./app/client/api-client",
header: ["// @ts-nocheck", "// This file is auto-generated by @hey-api/openapi-ts"],
postProcess: [
{
command: "vp",
args: ["fmt", "--write", "{{path}}"],
},
{ command: "node", args: ["scripts/patch-api-client.ts"] },
],
},
plugins: [...defaultPlugins, "@tanstack/react-query", "@hey-api/client-fetch"],
});