export type DeleteApiV10NotesNoteIdArgs = {noteId: number, Authorization: string, 'Content-Type': string}; export type DeleteApiV10NotesNoteIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Note * * DELETE /v1.0/notes/{noteId} */ export const deleteApiV10NotesNoteId = async (args: DeleteApiV10NotesNoteIdArgs, options?: DeleteApiV10NotesNoteIdOptions) => { const {baseUrl = "https://api.lofty.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1.0/notes/${encodeURIComponent(String(args.noteId))}${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 };