export type DeleteApiV1CustomActionsContextActionIdArgs = {'App-ID': string, 'Auth-Token': string, context: string, action_id: string}; export type DeleteApiV1CustomActionsContextActionIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Deletes a custom action * * DELETE /v1/custom_actions/{context}/{action_id}/ */ export const deleteApiV1CustomActionsContextActionId = async (args: DeleteApiV1CustomActionsContextActionIdArgs, options: DeleteApiV1CustomActionsContextActionIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1/custom_actions/${encodeURIComponent(String(args.context))}/${encodeURIComponent(String(args.action_id))}/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };