/** * Platform-admin (superuser) surface — quotas, audit logs, invitations, * JWT key rotation, plan governance. Consumed by the internal Console * "Admin" sections; ordinary operators do not call these. * * Mirrors `apps/api/src/server/platform/routes/admin/**`. Paths are * sourced from `@sylphx/contract` admin-* endpoint modules. */ import type { AdminAuditAnalyticsResult, AdminAuditChartsResult, AdminAuditDashboardResult, AdminAuditHealthResult, AdminBillingUnknownResult, AdminConsentUnknownResult, AdminErrorsOverviewResult, AdminGetAuditLogsResult, AdminGetPlanResult, AdminGetProjectResult, AdminGetUserResult, AdminGetUserSessionsResult, AdminListBroadcastsResult, AdminListInvitationsResult, AdminListProjectsResult, AdminOAuthProvidersResult, AdminOverviewResult, AdminPlan, AdminSearchUsersResult, AdminUpdateUserRoleResult, AdminUserRole } from '@sylphx/contract'; import type { Client } from './client.js'; export type DashboardStats = AdminAuditDashboardResult; export type DashboardCharts = AdminAuditChartsResult; export type DashboardHealth = AdminAuditHealthResult; export declare const getDashboardStats: (client: Client) => Promise; export declare const getDashboardCharts: (client: Client) => Promise; export declare const getDashboardHealth: (client: Client) => Promise; export type AdminAnalyticsOverview = AdminAuditAnalyticsResult; export type AdminBillingStats = AdminBillingUnknownResult; export type AdminConfigOverview = AdminOverviewResult; export type AdminConsentOverview = AdminConsentUnknownResult; export type AdminErrorsOverview = AdminErrorsOverviewResult; export type AdminTeamInvitations = Extract; export type AdminTeamStats = Extract; export type AdminUserSearch = Extract; export type AdminSecurityStats = Extract; export type AdminAuditLogSearch = Extract; export type AdminAuditStats = Extract; export declare const getFlagsOverview: (client: Client) => Promise; export declare const getNotificationsOverview: (client: Client) => Promise; export declare const getErrorsOverview: (client: Client) => Promise; export declare const getAnalyticsOverview: (client: Client) => Promise; export declare const getBillingStats: (client: Client) => Promise; export declare const getConsentOverview: (client: Client) => Promise; export declare const getReferralsOverview: (client: Client) => Promise; export declare const getWebhooksOverview: (client: Client) => Promise; export interface ProjectQuota { readonly resource: string; readonly limit: number; readonly usage: number; readonly windowSeconds: number; } export declare const getProjectQuotas: (client: Client, projectId: string) => Promise<{ quotas: readonly ProjectQuota[]; }>; export declare const getQuotaStats: (client: Client, projectId: string) => Promise>; export declare const getQuotaAlerts: (client: Client, projectId: string) => Promise<{ alerts: readonly { readonly id: string; readonly resource: string; readonly firedAt: string; }[]; }>; export declare const updateProjectQuotas: (client: Client, projectId: string, body: { readonly quotas: readonly { readonly resource: string; readonly limit: number; }[]; }) => Promise<{ quotas: readonly ProjectQuota[]; }>; export declare const acknowledgeQuotaAlert: (client: Client, alertId: string) => Promise<{ success: boolean; }>; export interface AuditLogEntry { readonly id: string; readonly actor: string; readonly action: string; readonly target: string; readonly at: string; readonly metadata: Record; } export declare const getAuditLogs: (client: Client, query?: { readonly from?: string; readonly to?: string; readonly actor?: string; }) => Promise<{ logs: readonly AuditLogEntry[]; }>; export declare const getAuditActivity: (client: Client) => Promise<{ entries: readonly AuditLogEntry[]; }>; export declare const getAuditLogEntries: (client: Client, query?: { readonly page?: string; readonly limit?: string; readonly action?: string; readonly resourceType?: string; readonly userId?: string; readonly actorId?: string; }) => Promise; export declare const getAuditStats: (client: Client, query?: { readonly days?: string; }) => Promise; export interface Invitation { readonly id: string; readonly email: string; readonly role: string; readonly orgId: string | null; readonly invitedBy: string; readonly createdAt: string; readonly expiresAt: string; readonly acceptedAt: string | null; } export declare const listInvitations: (client: Client) => Promise<{ invitations: readonly Invitation[]; }>; export declare const listTeamInvitations: (client: Client) => Promise; export declare const getTeamStats: (client: Client) => Promise; export declare const createInvitation: (client: Client, body: { readonly email: string; readonly role: string; readonly orgId?: string; }) => Promise<{ invitation: Invitation; }>; export declare const revokeInvitation: (client: Client, id: string) => Promise<{ success: boolean; }>; export declare const resendInvitation: (client: Client, id: string) => Promise<{ invitation: Invitation; }>; export interface JwtKey { readonly id: string; readonly alg: string; readonly status: 'active' | 'retired'; readonly createdAt: string; readonly retiredAt: string | null; } export declare const listJwtKeys: (client: Client) => Promise<{ keys: readonly JwtKey[]; }>; export declare const rotateJwtKeys: (client: Client) => Promise<{ newKey: JwtKey; }>; export declare const retireJwtKey: (client: Client, keyId: string) => Promise<{ key: JwtKey; }>; /** * Trigger a project migration between regions. Phase 4b Matrix-2 gap. * Underlying endpoint on the platform API is * `POST /operator/projects/:id/migrate` — the SDK wraps it directly rather * than going through `adminProjectsEndpoints` because migration is its * own operational concern (drain → cut-over → warm-up). */ export declare const migrateProject: (client: Client, projectId: string, body: { readonly targetRegion: string; readonly strategy?: "drain-cutover" | "live-replication"; readonly dryRun?: boolean; }) => Promise<{ jobId: string; startedAt: string; }>; /** * Regenerate an environment's deploy / API key. Already exposed on * `adminProjectsEndpoints.regenerateKey`; surfaced here under the `admin` * namespace so Console wiring is one-stop. */ export declare const regenerateEnvironmentKey: (client: Client, environmentId: string) => Promise<{ key: string; keyId: string; }>; export declare const listProjects: (client: Client) => Promise; export declare const getProject: (client: Client, id: string) => Promise; export declare const getOAuthProviders: (client: Client) => Promise; export declare const listPlans: (client: Client, projectId: string) => Promise<{ readonly plans: readonly AdminPlan[]; readonly total: number; }>; export declare const getPlan: (client: Client, planId: string) => Promise; export declare const getAiPlaygroundStream: (client: Client, streamId: string) => { readonly url: string; readonly token: string; }; export declare const listBroadcasts: (client: Client, projectId: string) => Promise; export interface AdminUserView { readonly id: string; readonly email: string; readonly role: string; readonly createdAt: string; readonly lastSeenAt: string | null; readonly suspended: boolean; } export declare const listUsers: (client: Client) => Promise<{ users: readonly AdminUserView[]; }>; export declare const searchUsers: (client: Client) => Promise; export declare const getSecurityStats: (client: Client) => Promise; export declare const getUser: (client: Client, userId: string) => Promise<{ user: AdminUserView; }>; export declare const getUserDetail: (client: Client, userId: string) => Promise; export declare const listUserSessions: (client: Client, userId: string) => Promise; export declare const updateUserRole: (client: Client, userId: string, body: { readonly role: AdminUserRole; }) => Promise; /** * L-15 (2026-05-02): manually verify a user's email. Super-admin only on the * platform tenant. The Management API endpoint exists at * `POST /admin/users/users/:userId/verify-email`; the SDK helper was the * missing piece blocking operators from validating the new-user E2E flow * without (a) a real email inbox or (b) a forbidden direct DB UPDATE. */ export declare const verifyUserEmail: (client: Client, userId: string) => Promise<{ readonly id: string; readonly email: string; }>; /** * L-15 (2026-05-02): soft-delete a platform user. Super-admin only; * cannot delete oneself. Existing sessions are revoked first. */ export declare const deleteUser: (client: Client, userId: string) => Promise<{ readonly id: string; readonly email: string; }>; /** * L-15 (2026-05-02): revoke ALL sessions for a user (force re-login). * Super-admin only. */ export declare const revokeUserSessions: (client: Client, userId: string) => Promise<{ readonly userId: string; readonly revokedCount: number; }>; //# sourceMappingURL=admin.d.ts.map