export type DeleteApiApiProjectsProjectIdSecurityTokensTokenIdArgs = {projectId: string, tokenId: string}; export type DeleteApiApiProjectsProjectIdSecurityTokensTokenIdOptions = {baseUrl: string, personalAccessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Revoke a token * * DELETE /api/projects/{projectId}/security/tokens/{tokenId} * * Also accepts auth: internalAuth */ export const deleteApiApiProjectsProjectIdSecurityTokensTokenId = async (args: DeleteApiApiProjectsProjectIdSecurityTokensTokenIdArgs, options: DeleteApiApiProjectsProjectIdSecurityTokensTokenIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, personalAccessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (personalAccessToken !== undefined) headers.set('authorization', `Bearer ${personalAccessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/projects/${encodeURIComponent(String(args.projectId))}/security/tokens/${encodeURIComponent(String(args.tokenId))}${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 };