export type DeleteApiApiV3MetaBasesBaseIdScriptsScriptIdArgs = {scriptId: string, baseId: string}; export type DeleteApiApiV3MetaBasesBaseIdScriptsScriptIdOptions = {baseUrl?: string | undefined, xcToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete script * * DELETE /api/v3/meta/bases/{baseId}/scripts/{scriptId} * * Also accepts auth: bearerAuth */ export const deleteApiApiV3MetaBasesBaseIdScriptsScriptId = async (args: DeleteApiApiV3MetaBasesBaseIdScriptsScriptIdArgs, options?: DeleteApiApiV3MetaBasesBaseIdScriptsScriptIdOptions) => { const {baseUrl = "https://app.nocodb.com", fetch: fetchFn = fetch, xcToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (xcToken !== undefined) headers.set("xc-token", xcToken) const url = `${baseUrl.replace(/\/+$/, '')}/api/v3/meta/bases/${encodeURIComponent(String(args.baseId))}/scripts/${encodeURIComponent(String(args.scriptId))}${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 };