export type DeleteApiTokenV1TokenIdArgs = {'token-id': string}; export type DeleteApiTokenV1TokenIdOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an API (admin or application instance) token of the organization * * DELETE /token/v1/{token-id} */ export const deleteApiTokenV1TokenId = async (args: DeleteApiTokenV1TokenIdArgs, options: DeleteApiTokenV1TokenIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/token/v1/${encodeURIComponent(String(args['token-id']))}${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 };