export type DeleteApiScriptsInstancesInstanceIdArgs = {instanceId: string}; export type DeleteApiScriptsInstancesInstanceIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes a script instance. * * DELETE /scripts/instances/{instanceId} */ export const deleteApiScriptsInstancesInstanceId = async (args: DeleteApiScriptsInstancesInstanceIdArgs, options?: DeleteApiScriptsInstancesInstanceIdOptions) => { const {baseUrl = "https://connect.signl4.com/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/scripts/instances/${encodeURIComponent(String(args.instanceId))}${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 };