import type { Workspace } from "../_internal/types.gen"; import type { RequestOptions } from "../base-client"; import { RequestBuilder } from "../request-builder"; /** Attributes accepted when creating a workspace. Mirrors the `accept` list of * the `:create` action in `lib/gpt_core/tenancy/resources/workspace.ex`. */ export interface CreateWorkspaceAttributes { name: string; slug: string; tenant_id: string; is_default?: boolean; low_balance_threshold?: number; expires_at?: string; description?: string; renewal_params?: Record; settings?: Record; app?: string; deduplicate_uploads?: boolean; vanity_slug?: string; } /** Attributes accepted when updating a workspace. Mirrors the `accept` list of * the `:update` action in `lib/gpt_core/tenancy/resources/workspace.ex`. */ export interface UpdateWorkspaceAttributes { name?: string; slug?: string; low_balance_threshold?: number; is_default?: boolean; settings?: Record; application_id?: string; deduplicate_uploads?: boolean; vanity_slug?: string; properties?: Record; } export type AdminWorkspaceHomeSnapshotWindow = "today" | "7d" | "30d"; export type AdminPanelEnvelope = { status: "ok"; data: T; } | { status: "unavailable"; reason: string; }; export type AdminWorkspaceHomeSnapshotCase = { id: string; title: string; state: string; priority: string; sla_due_at: string | null; sla_tone: "default" | "warn" | "danger"; opened_at: string | null; }; export type AdminWorkspaceHomeSnapshotAttentionSummary = { open: number; sla_overdue: number; sla_within_24h: number; sla_within_7d: number; }; export type AdminWorkspaceHomeSnapshotReviewQueue = { queue_id: string; slug: string; name: string; pending_count: number; sla_overdue_count: number; }; export type AdminWorkspaceHomeSnapshotThroughputBucket = { start_at: string; end_at: string; count: number; unit: "hour" | "day"; }; export type AdminWorkspaceHomeSnapshotThroughput = { metrics: { decided: number; completed: number; failed: number; median_cycle_seconds: number | null; }; buckets: AdminWorkspaceHomeSnapshotThroughputBucket[]; }; export type AdminWorkspaceHomeSnapshotActivity = { id: string; action: string; resource_type: string | null; resource_id: string | null; target_type: string | null; target_id: string | null; target_name: string | null; created_at: string | null; }; export type AdminWorkspaceHomeSnapshotClinicalReview = { pending_notes: number; pending_meal_plans: number; pending_goals: number; phi_flagged_notes: number; expiring_authorizations: number; }; export type AdminWorkspaceHomeSnapshot = { workspace_id: string; tenant_id: string; window: AdminWorkspaceHomeSnapshotWindow; generated_at: string; attention: AdminPanelEnvelope<{ items: AdminWorkspaceHomeSnapshotCase[]; summary: AdminWorkspaceHomeSnapshotAttentionSummary; }>; review_queues: AdminPanelEnvelope; throughput: AdminPanelEnvelope; activity: AdminPanelEnvelope; clinical_review: AdminPanelEnvelope; }; export declare function createWorkspacesNamespace(rb: RequestBuilder): { /** * List all workspaces visible to the current actor. * * @param options - Optional request options (pagination, filters, sorting). * @returns A list of `Workspace` records. * * @example * ```ts * const workspaces = await admin.workspaces.list(); * ``` */ list: (options?: RequestOptions) => Promise; /** * Get a workspace by ID. * * @param id - The UUID of the workspace. * @param options - Optional request options. * @returns The `Workspace` record. * * @example * ```ts * const workspace = await admin.workspaces.get("workspace-uuid"); * ``` */ get: (id: string, options?: RequestOptions) => Promise; /** * Retrieve the composite workspace home snapshot. * * @param workspaceId - Workspace UUID. * @param window - Optional reporting window. Defaults to `7d` server-side. * @param options - Optional request settings. * @returns Attention, review queue, throughput, and activity panels. * @example * const snapshot = await admin.workspaces.homeSnapshot( * "workspace-uuid", * "30d", * ); */ homeSnapshot: (workspaceId: string, window?: AdminWorkspaceHomeSnapshotWindow, options?: RequestOptions) => Promise; /** * Create a new workspace. * * @param attributes - Workspace attributes. * @param options - Optional request options. * @returns The created `Workspace`. * * @example * ```ts * const workspace = await admin.workspaces.create({ name: "Engineering" }); * ``` */ create: (attributes: CreateWorkspaceAttributes, options?: RequestOptions) => Promise; /** * Update a workspace. * * @param id - The UUID of the workspace. * @param attributes - Fields to update. * @param options - Optional request options. * @returns The updated `Workspace`. * * @example * ```ts * const workspace = await admin.workspaces.update("workspace-uuid", { name: "New Name" }); * ``` */ update: (id: string, attributes: UpdateWorkspaceAttributes, options?: RequestOptions) => Promise; /** * Delete a workspace. * * @param id - The UUID of the workspace. * @param options - Optional request options. * @returns `true` on success. * * @example * ```ts * await admin.workspaces.delete("workspace-uuid"); * ``` */ delete: (id: string, options?: RequestOptions) => Promise; /** * Transition a workspace to `:active` status via the `:go_live` action. * * @param id - UUID of the workspace. * @param options - Optional request options. * @returns The updated `Workspace` with `status: "active"`. * @example * const workspace = await admin.workspaces.goLive("workspace-uuid"); */ goLive: (id: string, options?: RequestOptions) => Promise; /** * Transition a workspace to `:suspended` status via the `:take_offline` * action. * * @param id - UUID of the workspace. * @param options - Optional request options. * @returns The updated `Workspace` with `status: "suspended"`. * @example * const workspace = await admin.workspaces.takeOffline("workspace-uuid"); */ takeOffline: (id: string, options?: RequestOptions) => Promise; /** * List workspaces owned by the current user. * * @param options - Optional request options. * @returns A list of `Workspace` records. * * @example * ```ts * const mine = await admin.workspaces.mine(); * ``` */ mine: (options?: RequestOptions) => Promise; /** * List workspaces shared with the current user. * * @param options - Optional request options. * @returns A list of `Workspace` records. * * @example * ```ts * const shared = await admin.workspaces.shared(); * ``` */ shared: (options?: RequestOptions) => Promise; /** * Allocate credits to a workspace. * * @param id - The UUID of the workspace. * @param amount - Number of credits to allocate. * @param options - Optional request options. * @returns The updated `Workspace`. * * @example * ```ts * const workspace = await admin.workspaces.allocateCredits("workspace-uuid", 500); * ``` */ allocateCredits: (id: string, amount: number, options?: RequestOptions) => Promise; /** * Update storage settings for a workspace. * * @param id - The UUID of the workspace. * @param settings - Storage settings to update. * @param options - Optional request options. * @returns The updated `Workspace`. * * @example * ```ts * const workspace = await admin.workspaces.updateStorageSettings("workspace-uuid", { * max_storage_bytes: 10737418240, * }); * ``` */ updateStorageSettings: (id: string, settings: Record, options?: RequestOptions) => Promise; /** * Populate content hashes for all documents in a workspace. * * @param id - The UUID of the workspace. * @param options - Optional request options. * @returns The updated `Workspace`. * * @example * ```ts * const workspace = await admin.workspaces.populateHashes("workspace-uuid"); * ``` */ populateHashes: (id: string, options?: RequestOptions) => Promise; }; //# sourceMappingURL=workspaces.d.ts.map