export type DeleteApiBaseBaseIdCollaboratorsArgs = {baseId: string, principalId: string, principalType: 'user' | 'department'}; export type DeleteApiBaseBaseIdCollaboratorsOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a base collaborators * * DELETE /base/{baseId}/collaborators */ export const deleteApiBaseBaseIdCollaborators = async (args: DeleteApiBaseBaseIdCollaboratorsArgs, options?: DeleteApiBaseBaseIdCollaboratorsOptions) => { const {baseUrl = "https://app.teable.ai/api", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.principalId != null) query.append("principalId", String(args.principalId)) if (args.principalType != null) query.append("principalType", String(args.principalType)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/base/${encodeURIComponent(String(args.baseId))}/collaborators${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 };