export type DeleteApiApiOrgsOrgIdInvitationsInvitationIdArgs = {org_id: string, invitation_id: string}; export type DeleteApiApiOrgsOrgIdInvitationsInvitationIdOptions = {baseUrl: string, HTTPBearerJWT?: string | undefined, fetch?: typeof fetch | undefined}; /** * Revoke invitation * * DELETE /api/orgs/{org_id}/invitations/{invitation_id} */ export const deleteApiApiOrgsOrgIdInvitationsInvitationId = async (args: DeleteApiApiOrgsOrgIdInvitationsInvitationIdArgs, options: DeleteApiApiOrgsOrgIdInvitationsInvitationIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearerJWT} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearerJWT !== undefined) headers.set('authorization', `Bearer ${HTTPBearerJWT}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/orgs/${encodeURIComponent(String(args.org_id))}/invitations/${encodeURIComponent(String(args.invitation_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 };