import { n as Result } from "./results-DP3BzoL6.js"; import { u as EnvironmentConfigOverrideOverride } from "./schema-CqV4a9e5.js"; import { O as DeploymentSourceManifest, x as DeploymentMemorySize } from "./deployments--S2KluCd.js"; import { a as KnownErrors } from "./known-errors-C-1Klj6h.js"; import { n as MoneyAmount } from "./currency-constants-Cq_q8twn.js"; import { _ as branchConfigSourceSchema, s as RestrictedReason, t as ConfigAgentRunApi } from "./schema-fields-Din3rFg5.js"; import { i as RefreshToken, r as InternalSession, t as AccessToken } from "./sessions-DofA-1Lc.js"; import { J as UserActivityResponse, K as MetricsUserCounts, R as MetricsResponse, a as AnalyticsClickmapKind, c as AnalyticsClickmapResponse, r as AnalyticsClickmapDevice, u as AnalyticsClickmapTokenResponse } from "./admin-metrics-T0Zu7mRq.js"; import { t as EmailOutboxCrud } from "./email-outbox-Bh9MoBgh.js"; import { t as InternalEmailsCrud } from "./emails-Ba4yEaCS.js"; import { t as InternalApiKeysCrud } from "./internal-api-keys-D8IYDodH.js"; import { t as ProjectPermissionDefinitionsCrud } from "./project-permissions-kdi675F-.js"; import { r as ProjectsCrud } from "./projects-BMqpwc-l.js"; import { t as SvixTokenCrud } from "./svix-token-BsMrLGvy.js"; import { t as TeamPermissionDefinitionsCrud } from "./team-permissions-DqOpaOWh.js"; import { i as TransactionType, n as Transaction } from "./transactions-CZPe5PDC.js"; import { n as PlanUsageResponse } from "./plan-usage-BaDxcLZ1.js"; import { n as ServerAuthApplicationOptions, t as HexclaveServerInterface } from "./server-interface-BRumRG5k.js"; import { C as WorkflowSummaryJson, D as WorkflowVersionJson, E as WorkflowUpgradeRunsResultJson, _ as WorkflowRunJson, d as WorkflowCancelRunsResultJson, h as WorkflowRunDetailsJson, w as WorkflowSyncResultJson, y as WorkflowRunsFilterJson } from "./workflows-UE-4M1fy.js"; import * as yup$1 from "yup"; //#region src/interface/admin-interface.d.ts type BranchConfigSourceApi = yup$1.InferType; type ChatContent = Array<{ type: "text"; text: string; } | { type: "tool-call"; toolName: string; toolCallId: string; args: any; argsText: string; result: any; }>; type AdminDeploymentServiceLogLineJson = { at_millis: number; stream: "stdout" | "stderr" | "system"; instance: string | null; text: string; }; type AdminDeploymentServiceOutcomeJson = { service_id: string; status: "pending" | "building" | "deploying" | "deployed" | "failed" | "skipped"; url: string | null; revision: string | null; image: string | null; error: string | null; }; type AdminDeploymentEnvVarJson = { key: string; type: "plain" | "secret" | "connection"; value: string | null; secret_key: string | null; }; type AdminDeploymentJson = { id: string; number: number; deployment_source_id: string; status: "queued" | "building" | "deploying" | "deployed" | "failed" | "canceled"; triggered_by: string; created_at_millis: number; finished_at_millis: number | null; error: string | null; has_build_logs: boolean; source_manifest: DeploymentSourceManifest | null; services: AdminDeploymentServiceOutcomeJson[]; }; type AdminDeploymentServiceJson = { id: string; deployment_source_id: string; type: "server" | "serverless"; public: boolean; ports: Record; min_instances: number | null; max_instances: number | null; memory: DeploymentMemorySize; cpu: { count: number; shared: boolean; }; root_directory: string | null; dockerfile_path: string | null; image: string | null; build_command: string | null; start_command: string | null; persistent_volumes: Record | null; provisioned: boolean; parked_at: string | null; parked_reason: string | null; status: "not_deployed" | "queued" | "building" | "deploying" | "deployed" | "failed" | "canceled"; has_successful_deploy: boolean; url: string | null; env: AdminDeploymentEnvVarJson[]; domains: { hostname: string; port: number | null; is_primary: boolean; verified: boolean; }[]; latest_deployment_id: string | null; }; type AdminProjectSecretJson = { key: string; created_at_millis: number; updated_at_millis: number; }; type AdminDeploymentDomainJson = { hostname: string; is_primary: boolean; verified: boolean; /** * Finer-grained than `verified`. "issuing" means the deployment runtime has accepted the * DNS and is waiting on the certificate authority; without it that window looks exactly * like the user having created no records at all. */ status: "awaiting_dns" | "issuing" | "verified"; pending_first_deploy: boolean; dns_records: { type: string; name: string; value: string; }[]; }; type AdminAuthApplicationOptions = ServerAuthApplicationOptions & ({ superSecretAdminKey: string; } | { projectOwnerSession: InternalSession | (() => Promise); }); type InternalApiKeyCreateCrudRequest = { has_publishable_client_key: boolean; has_secret_server_key: boolean; has_super_secret_admin_key: boolean; expires_at_millis: number; description: string; }; type InternalApiKeyCreateCrudResponse = InternalApiKeysCrud["Admin"]["Read"] & { publishable_client_key?: string; secret_server_key?: string; super_secret_admin_key?: string; }; declare class HexclaveAdminInterface extends HexclaveServerInterface { readonly options: AdminAuthApplicationOptions; constructor(options: AdminAuthApplicationOptions); sendAdminRequest(path: string, options: RequestInit, session: InternalSession | null, requestType?: "admin"): Promise; protected sendAdminRequestAndCatchKnownError(path: string, requestOptions: RequestInit, tokenStoreOrNull: InternalSession | null, errorsToCatch: readonly E[]): Promise>>; getProject(): Promise; updateProject(update: ProjectsCrud["Admin"]["Update"]): Promise; createInternalApiKey(options: InternalApiKeyCreateCrudRequest): Promise; listInternalApiKeys(): Promise; revokeInternalApiKeyById(id: string): Promise; getInternalApiKey(id: string, session: InternalSession): Promise; listInternalEmailTemplates(): Promise<{ id: string; display_name: string; theme_id?: string; tsx_source: string; }[]>; listWorkflows(): Promise; createWorkflow(options: { id: string; display_name?: string; source: string; }): Promise; updateWorkflowSource(workflowId: string, source: string): Promise; setWorkflowPaused(workflowId: string, isPaused: boolean): Promise<{ is_paused: boolean; paused_at_millis: number | null; }>; deleteWorkflow(workflowId: string): Promise; listWorkflowVersions(workflowId: string): Promise; listWorkflowRuns(workflowId: string, filter?: WorkflowRunsFilterJson): Promise<{ runs: WorkflowRunJson[]; next_cursor: string | null; }>; getWorkflowRun(runId: string): Promise; cancelWorkflowRuns(workflowId: string, filter: { run_key?: string; run_id?: string; state?: string; version?: number; }): Promise; upgradeWorkflowRuns(workflowId: string, options: { to_version: number; run_key?: string; from_version?: number; }): Promise; retryWorkflowRun(runId: string): Promise<{ run_id: string; }>; sendWorkflowEvent(name: string, data: unknown): Promise<{ event_id: string; }>; listInternalEmailDrafts(): Promise<{ id: string; display_name: string; theme_id?: string | undefined | false; tsx_source: string; sent_at_millis?: number | null; }[]>; createEmailDraft(options: { display_name?: string; theme_id?: string | false; tsx_source?: string; }): Promise<{ id: string; }>; updateEmailDraft(id: string, data: { display_name?: string; theme_id?: string | null | false; tsx_source?: string; sent_at_millis?: number | null; }): Promise; deleteEmailDraft(id: string): Promise; listEmailThemes(): Promise<{ id: string; display_name: string; }[]>; listTeamPermissionDefinitions(): Promise; listTeamPermissionDefinitionsPaginated(options: { limit: number; cursor?: string; query?: string; }): Promise<{ items: TeamPermissionDefinitionsCrud['Admin']['Read'][]; nextCursor: string | null; }>; createTeamPermissionDefinition(data: TeamPermissionDefinitionsCrud['Admin']['Create']): Promise; updateTeamPermissionDefinition(permissionId: string, data: TeamPermissionDefinitionsCrud['Admin']['Update']): Promise; deleteTeamPermissionDefinition(permissionId: string): Promise; listProjectPermissionDefinitions(): Promise; createProjectPermissionDefinition(data: ProjectPermissionDefinitionsCrud['Admin']['Create']): Promise; updateProjectPermissionDefinition(permissionId: string, data: ProjectPermissionDefinitionsCrud['Admin']['Update']): Promise; deleteProjectPermissionDefinition(permissionId: string): Promise; getSvixToken(): Promise; deleteProject(): Promise; getMetrics(includeAnonymous?: boolean, filters?: { country_code?: string; referrer?: string; browser?: string; os?: string; device?: string; since?: string; until?: string; }): Promise; getPlanUsage(): Promise; getUserActivity(userId: string): Promise; getAnalyticsClickmap(options: { kind: AnalyticsClickmapKind; member_user_ids?: string[]; route_path?: string; route_regex?: string; url_pattern?: string; user_id?: string; replay_id?: string; device?: AnalyticsClickmapDevice; viewport_width_min?: number; viewport_width_max?: number; sampling?: number; since: string; until: string; }): Promise; createAnalyticsClickmapToken(options: { origin: string; }): Promise; getMetricsUserCounts(): Promise; sendTestEmail(data: { recipient_email: string; email_config: { host: string; port: number; username: string; password: string; sender_email: string; sender_name: string; }; }): Promise<{ success: boolean; error_message?: string; }>; sendTestWebhook(data: { endpoint_id: string; }): Promise<{ success: boolean; error_message?: string; }>; listSentEmails(): Promise; setupManagedEmailProvider(data: { subdomain: string; sender_local_part: string; }): Promise<{ domain_id: string; subdomain: string; sender_local_part: string; name_server_records: string[]; status: "pending_dns" | "pending_verification" | "verified" | "applied" | "failed"; }>; checkManagedEmailStatus(data: { domain_id: string; subdomain: string; sender_local_part: string; }): Promise<{ status: "pending_dns" | "pending_verification" | "verified" | "applied" | "failed"; }>; listManagedEmailDomains(): Promise<{ items: Array<{ domain_id: string; subdomain: string; sender_local_part: string; status: "pending_dns" | "pending_verification" | "verified" | "applied" | "failed"; name_server_records: string[]; }>; }>; deleteManagedEmailDomain(data: { resend_domain_id: string; }): Promise<{ status: "deleted"; }>; applyManagedEmailProvider(data: { domain_id: string; }): Promise<{ status: "applied"; }>; sendSignInInvitationEmail(email: string, callbackUrl: string): Promise; saveChatMessage(threadId: string, message: any): Promise; listChatMessages(threadId: string): Promise<{ messages: Array; }>; renderEmailPreview(options: { themeId?: string | null | false; themeTsxSource?: string; templateId?: string; templateTsxSource?: string; editableMarkers?: boolean; editableSource?: 'template' | 'theme' | 'both'; }): Promise<{ html: string; editable_regions?: Record; }>; rewriteTemplateSourceWithAI(templateTsxSource: string): Promise<{ tsx_source: string; }>; createEmailTheme(displayName: string): Promise<{ id: string; }>; getEmailTheme(id: string): Promise<{ display_name: string; tsx_source: string; }>; updateEmailTheme(id: string, tsxSource: string): Promise; deleteEmailTheme(id: string): Promise; updateEmailTemplate(id: string, tsxSource: string, themeId: string | null | false): Promise<{ rendered_html: string; }>; getConfig(): Promise<{ config_string: string; }>; getConfigOverride(level: "project" | "branch" | "environment"): Promise<{ config_string: string; }>; setConfigOverride(level: "project" | "branch" | "environment", configOverride: any, source?: BranchConfigSourceApi): Promise; updateConfigOverride(level: "project" | "branch" | "environment", configOverrideOverride: any): Promise; getPushedConfigSource(): Promise; unlinkPushedConfigSource(): Promise; /** * Reads a specific config-agent run's state (or `null`) for the linked GitHub * repo. Polled by the dashboard — using the id returned by `applyConfigViaAgent` * — for live progress and the review diff. Runs are independent, so each is * addressed by its own id rather than "the" run on the branch. */ getConfigAgentRun(runId: string): Promise; /** * Applies a dashboard config change to the linked GitHub repo by running the * config agent in a sandbox (server-side). Returns immediately with the new run's * `id`; poll `getConfigAgentRun(id)` for progress. The GitHub access token is the * caller's own OAuth token and is used transiently server-side. */ applyConfigViaAgent(options: { configUpdate: EnvironmentConfigOverrideOverride; githubAccessToken: string; }): Promise<{ status: "started"; id: string; }>; /** * Cancels a specific in-flight agent-driven config write: hard-stops the sandbox * so the agent stops mid-work. Also cancels runs in `awaiting_review`. No revert * — if the agent already pushed, the commit stays. Returns `not-running` if the * run is gone or already terminal. */ cancelConfigAgentRun(runId: string): Promise<{ status: "cancelling" | "not-running"; }>; /** * Commits a specific run's reviewed change to GitHub. Only valid when that run is in * `awaiting_review` status; the change (diff + base commit) was captured at apply time * and is rebuilt + pushed via the GitHub API here, so no live sandbox is involved. * Returns `not-awaiting-review` if the run isn't in a committable state. */ commitConfigAgentRun(runId: string, options: { githubAccessToken: string; commitMessage?: string; }): Promise<{ status: "committing" | "not-awaiting-review"; }>; resetConfigOverrideKeys(level: "branch" | "environment", keys: string[]): Promise; createEmailTemplate(displayName: string): Promise<{ id: string; }>; deleteEmailTemplate(id: string): Promise; setupPayments(): Promise<{ url: string; }>; getStripeAccountInfo(): Promise; getPaymentMethodConfigs(): Promise<{ configId: string; methods: Array<{ id: string; name: string; enabled: boolean; available: boolean; overridable: boolean; }>; } | null>; updatePaymentMethodConfigs(configId: string, updates: Record): Promise; createStripeWidgetAccountSession(): Promise<{ client_secret: string; }>; listTransactions(params?: { cursor?: string; limit?: number; type?: TransactionType; customerType?: 'user' | 'team' | 'custom'; customerId?: string; }): Promise<{ transactions: Transaction[]; nextCursor: string | null; }>; refundTransaction(options: { type: "subscription" | "one-time-purchase"; id: string; invoiceId?: string; amountUsd: MoneyAmount; /** * Lifecycle action for the source purchase: * "now" — end product access immediately (revokes product, * expires item grants, cancels Stripe sub if any). * "at-period-end" — schedule sub cancel-at-period-end; subscriptions * only — rejected for one-time purchases. * undefined — no lifecycle change; refund money only. */ endAction?: "now" | "at-period-end"; }): Promise<{ success: boolean; refundTransactionId: string; }>; previewAffectedUsersByOnboardingChange(onboarding: { require_email_verification?: boolean; }, limit?: number): Promise<{ affected_users: Array<{ id: string; display_name: string | null; primary_email: string | null; restricted_reason: RestrictedReason; }>; total_affected_count: number; }>; listOutboxEmails(options?: { status?: string; simple_status?: string; user_id?: string; limit?: number; cursor?: string; }): Promise; getOutboxEmail(id: string): Promise; updateOutboxEmail(id: string, data: EmailOutboxCrud["Server"]["Update"]): Promise; listDeploymentServices(): Promise; listProjectSecrets(): Promise; setProjectSecret(key: string, value: string): Promise; deleteProjectSecret(key: string): Promise; listDeployments(options?: { limit?: number; }): Promise; getDeployment(deploymentId: string): Promise; getDeploymentBuildLogs(deploymentId: string, options?: { signal?: AbortSignal; }): Promise; /** * Follows a service's runtime logs, calling `onLine` for each line as it arrives. * * The endpoint streams NDJSON and follows for a few minutes before closing, so * this resolves when the server stops following rather than when the service * stops running — there is no end to a runtime log. Resume by calling again * with the largest `at_millis` seen; omit it to start at the tail. * * Rejects if the stream ends in an error, AFTER delivering everything that * arrived before it: the lines already handed to `onLine` are real output and * the caller should keep them. */ getDeploymentServiceLogs(serviceId: string, options: { sinceMillis?: number; /** False returns what is available right now instead of following. */ follow?: boolean; signal?: AbortSignal; onLine: (line: AdminDeploymentServiceLogLineJson) => void; }): Promise; addDeploymentServiceDomain(serviceId: string, hostname: string, options?: { isPrimary?: boolean; }): Promise; getDeploymentServiceDomain(serviceId: string, hostname: string): Promise; deleteDeploymentServiceDomain(serviceId: string, hostname: string): Promise; } //#endregion export { AdminDeploymentServiceJson as a, AdminProjectSecretJson as c, InternalApiKeyCreateCrudRequest as d, InternalApiKeyCreateCrudResponse as f, AdminDeploymentJson as i, ChatContent as l, AdminDeploymentDomainJson as n, AdminDeploymentServiceLogLineJson as o, AdminDeploymentEnvVarJson as r, AdminDeploymentServiceOutcomeJson as s, AdminAuthApplicationOptions as t, HexclaveAdminInterface as u }; //# sourceMappingURL=admin-interface-CfeuhTcD.d.ts.map