export type DeleteApiTrashResetItemsArgs = {resourceId: string, resourceType: 'base' | 'table', cursor?: (string | null) | undefined, pageSize?: number | undefined}; export type DeleteApiTrashResetItemsOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reset trash items for a base or table * * DELETE /trash/reset-items */ export const deleteApiTrashResetItems = async (args: DeleteApiTrashResetItemsArgs, options?: DeleteApiTrashResetItemsOptions) => { const {baseUrl = "https://app.teable.ai/api", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.resourceId != null) query.append("resourceId", String(args.resourceId)) if (args.resourceType != null) query.append("resourceType", String(args.resourceType)) if (args.cursor != null) query.append("cursor", String(args.cursor)) if (args.pageSize != null) query.append("pageSize", String(args.pageSize)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/trash/reset-items${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 };