export type McpEventsDeliveryMode = 'webhook'; export type McpEventsUnsubscribeDeliveryIn = {mode: McpEventsDeliveryMode, url: string}; export type McpEventsUnsubscribeIn = {arguments?: Record | undefined, delivery: McpEventsUnsubscribeDeliveryIn, name: string}; export type CreateApiApiV1AppAppIdMcpEventsUnsubscribeArgs = {app_id: string, 'idempotency-key'?: string | undefined, body: McpEventsUnsubscribeIn}; export type CreateApiApiV1AppAppIdMcpEventsUnsubscribeOptions = {baseUrl?: string | undefined, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unsubscribe from MCP Events * * POST /api/v1/app/{app_id}/mcp-events/unsubscribe */ export const createApiApiV1AppAppIdMcpEventsUnsubscribe = async (args: CreateApiApiV1AppAppIdMcpEventsUnsubscribeArgs, options?: CreateApiApiV1AppAppIdMcpEventsUnsubscribeOptions) => { const {baseUrl = "https://api.eu.svix.com", fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['idempotency-key'] != null) headers.set("idempotency-key", String(args['idempotency-key'])) if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/app/${encodeURIComponent(String(args.app_id))}/mcp-events/unsubscribe${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 };