export type DeleteApiApplicationsOwnerSlugArgs = {owner: string, slug: string}; export type DeleteApiApplicationsOwnerSlugOptions = {baseUrl: string, JWTAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Application * * DELETE /applications/{owner}/{slug} * * Also accepts auth: APIKeyAuth */ export const deleteApiApplicationsOwnerSlug = async (args: DeleteApiApplicationsOwnerSlugArgs, options: DeleteApiApplicationsOwnerSlugOptions) => { const {baseUrl, fetch: fetchFn = fetch, JWTAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (JWTAuth !== undefined) headers.set('authorization', `Bearer ${JWTAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/applications/${encodeURIComponent(String(args.owner))}/${encodeURIComponent(String(args.slug))}${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 };