export type CreateOverrideRequest = {policy_id: string, policy_type: 'static' | 'dynamic', tool_signature?: string | undefined, override_reason: string, ttl_seconds?: number | undefined}; export type CreateApiApiV1OverridesArgs = {'X-User-Email': string, 'X-Tenant-ID': string, 'X-Org-ID'?: string | undefined, body: CreateOverrideRequest}; export type CreateApiApiV1OverridesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create a session-scoped policy override (retired in v11) * * POST /api/v1/overrides */ export const createApiApiV1Overrides = async (args: CreateApiApiV1OverridesArgs, options?: CreateApiApiV1OverridesOptions) => { const {baseUrl = "https://orchestrator.getaxonflow.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-User-Email'] != null) headers.set("X-User-Email", String(args['X-User-Email'])) if (args['X-Tenant-ID'] != null) headers.set("X-Tenant-ID", String(args['X-Tenant-ID'])) if (args['X-Org-ID'] != null) headers.set("X-Org-ID", String(args['X-Org-ID'])) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/overrides${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };