export type DeleteApiAppsAppNameArgs = {appName: string, tenant?: string | undefined}; export type DeleteApiAppsAppNameOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete app * * DELETE /apps/{appName} */ export const deleteApiAppsAppName = async (args: DeleteApiAppsAppNameArgs, options: DeleteApiAppsAppNameOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.tenant != null) headers.set("tenant", String(args.tenant)) const url = `${baseUrl.replace(/\/+$/, '')}/apps/${encodeURIComponent(String(args.appName))}${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 };