export type DeleteApiApiUserMobileSessionArgs = {'X-Mobile-Token': string}; export type DeleteApiApiUserMobileSessionOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /api/user/mobile/session */ export const deleteApiApiUserMobileSession = async (args: DeleteApiApiUserMobileSessionArgs, options?: DeleteApiApiUserMobileSessionOptions) => { const {baseUrl = "https://demo.thingsboard.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Mobile-Token'] != null) headers.set("X-Mobile-Token", String(args['X-Mobile-Token'])) const url = `${baseUrl.replace(/\/+$/, '')}/api/user/mobile/session${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 };