export type DeleteApiApiV1PwaTemplateArgs = {pwa_template_id: string}; export type DeleteApiApiV1PwaTemplateOptions = {baseUrl: string, OAuth2PasswordBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete PWA * * DELETE /api/v1/pwa_template */ export const deleteApiApiV1PwaTemplate = async (args: DeleteApiApiV1PwaTemplateArgs, options: DeleteApiApiV1PwaTemplateOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2PasswordBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.pwa_template_id != null) query.append("pwa_template_id", String(args.pwa_template_id)) if (OAuth2PasswordBearer !== undefined) headers.set('authorization', `Bearer ${OAuth2PasswordBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/pwa_template${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 };