// Auto-generated by scripts/generate-bindings.mjs — do not edit. export interface GapmindClientConfig { baseUrl: string; token?: string; } export class GapmindClient { private baseUrl: string; private token?: string; constructor(config: GapmindClientConfig) { this.baseUrl = config.baseUrl.replace(/\/$/, ''); this.token = config.token; } private headers(): Record { const h: Record = { 'Content-Type': 'application/json' }; if (this.token) h["Authorization"] = "Bearer " + this.token; return h; } private async request(method: string, path: string, body?: unknown): Promise { const res = await fetch(this.baseUrl + path, { method, headers: this.headers(), body: body ? JSON.stringify(body) : undefined }); if (!res.ok) throw new Error("API error " + res.status + ": " + (await res.text())); return res.json() as Promise; } async health(): Promise { return this.request("GET", `/health`); } async routes(): Promise { return this.request("GET", `/api/routes`); } async ips_get(path: string): Promise { return this.request("GET", `/ips/${path}`); } async ips_post(path: string): Promise { return this.request("POST", `/ips/${path}`); } async ips_put(path: string): Promise { return this.request("PUT", `/ips/${path}`); } async ips_delete(path: string): Promise { return this.request("DELETE", `/ips/${path}`); } async ips_patch(path: string): Promise { return this.request("PATCH", `/ips/${path}`); } async socials_get(path: string): Promise { return this.request("GET", `/socials/${path}`); } async socials_post(path: string): Promise { return this.request("POST", `/socials/${path}`); } async socials_put(path: string): Promise { return this.request("PUT", `/socials/${path}`); } async socials_delete(path: string): Promise { return this.request("DELETE", `/socials/${path}`); } async socials_patch(path: string): Promise { return this.request("PATCH", `/socials/${path}`); } }