import { AnalyticsClickmapOptions, AnalyticsClickmapResponse, AnalyticsClickmapTokenResponse } from "@hexclave/shared/dist/interface/admin-metrics"; import { HexclaveAdminInterface } from "@hexclave/shared"; import { Result } from "@hexclave/shared/dist/utils/results"; import { EmailConfig, hexclaveAppInternalsSymbol } from "../../common.js"; import { InternalApiKey, InternalApiKeyBase, InternalApiKeyBaseCrudRead, InternalApiKeyCreateOptions, InternalApiKeyFirstView } from "../../internal-api-keys/index.js"; import { AdminProjectPermission, AdminProjectPermissionDefinition, AdminProjectPermissionDefinitionCreateOptions, AdminProjectPermissionDefinitionUpdateOptions, AdminTeamPermission, AdminTeamPermissionDefinition, AdminTeamPermissionDefinitionCreateOptions, AdminTeamPermissionDefinitionUpdateOptions } from "../../permissions/index.js"; import { AdminOwnedProject, AdminProject } from "../../projects/index.js"; import { AdminWorkflow, AdminWorkflowRun, AdminWorkflowRunDetails, AdminWorkflowRunsFilter, AdminWorkflowSyncResult, AdminWorkflowUpgradeResult, AdminWorkflowVersion } from "../../workflows.js"; import { _HexclaveServerAppImplIncomplete } from "./server-app-impl.js"; import { InternalApiKeyCreateCrudResponse } from "@hexclave/shared/dist/interface/admin-interface"; import { EmailTemplateCrud } from "@hexclave/shared/dist/interface/crud/email-templates"; import { InternalApiKeysCrud } from "@hexclave/shared/dist/interface/crud/internal-api-keys"; import { ProjectsCrud } from "@hexclave/shared/dist/interface/crud/projects"; import { AdminGetSessionReplayChunkEventsResponse } from "@hexclave/shared/dist/interface/crud/session-replays"; import { Transaction, TransactionType } from "@hexclave/shared/dist/interface/crud/transactions"; import { RestrictedReason } from "@hexclave/shared/dist/schema-fields"; import { MoneyAmount } from "@hexclave/shared/dist/utils/currency-constants"; import { AdminEmailOutbox, AdminSentEmail } from "../../index.js"; import { AdminEmailTemplate } from "../../email-templates/index.js"; import { PlanUsage } from "../../plan-usage/index.js"; import { AdminSessionReplay, ListSessionReplayChunksOptions, ListSessionReplayChunksResult, ListSessionReplaysOptions, ListSessionReplaysResult, SessionReplayAllEventsResult } from "../../session-replays/index.js"; import { EmailOutboxUpdateOptions, ManagedEmailProviderListItem, ManagedEmailProviderSetupResult, ManagedEmailProviderStatus, StackAdminApp, StackAdminAppConstructorOptions } from "../interfaces/admin-app.js"; import { CompleteConfig } from "@hexclave/shared/dist/config/schema"; //#region src/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts type PlanUsageResponse = Awaited>; declare class _HexclaveAdminAppImplIncomplete extends _HexclaveServerAppImplIncomplete implements StackAdminApp { protected _interface: HexclaveAdminInterface; private readonly _adminProjectCache; private readonly _planUsageCache; private readonly _internalApiKeysCache; private readonly _adminEmailThemeCache; private readonly _adminEmailThemesCache; private readonly _adminEmailTemplatesCache; private readonly _adminEmailDraftsCache; private readonly _adminWorkflowsCache; private readonly _adminTeamPermissionDefinitionsCache; private readonly _adminProjectPermissionDefinitionsCache; private readonly _svixTokenCache; private readonly _metricsCache; private readonly _userActivityCache; private readonly _metricsUserCountsCache; private readonly _emailPreviewCache; private readonly _emailPreviewWithEditableMarkersCache; private readonly _configOverridesCache; private readonly _stripeAccountInfoCache; private readonly _transactionsCache; constructor(options: StackAdminAppConstructorOptions, extraOptions?: { uniqueIdentifier?: string; checkString?: string; interface?: HexclaveAdminInterface; }); _adminConfigFromCrud(data: { config_string: string; }): CompleteConfig; _adminOwnedProjectFromCrud(data: ProjectsCrud['Admin']['Read'], onRefresh: () => Promise): AdminOwnedProject; _adminProjectFromCrud(data: ProjectsCrud['Admin']['Read'], onRefresh: () => Promise): AdminProject; _adminEmailTemplateFromCrud(data: EmailTemplateCrud['Admin']['Read']): AdminEmailTemplate; _planUsageFromCrud(data: PlanUsageResponse): PlanUsage; getProject(): Promise; getPlanUsage(): Promise; protected _createInternalApiKeyBaseFromCrud(data: InternalApiKeyBaseCrudRead): InternalApiKeyBase; protected _createInternalApiKeyFromCrud(data: InternalApiKeysCrud["Admin"]["Read"]): InternalApiKey; protected _createInternalApiKeyFirstViewFromCrud(data: InternalApiKeyCreateCrudResponse): InternalApiKeyFirstView; listInternalApiKeys(): Promise; createInternalApiKey(options: InternalApiKeyCreateOptions): Promise; listEmailThemes(): Promise<{ id: string; displayName: string; }[]>; listEmailTemplates(): Promise<{ id: string; displayName: string; themeId?: string; tsxSource: string; }[]>; listWorkflows(): Promise; createWorkflow(options: { id: string; displayName?: string; source: string; }): Promise; updateWorkflowSource(workflowId: string, source: string): Promise; deleteWorkflow(workflowId: string): Promise; setWorkflowPaused(workflowId: string, isPaused: boolean): Promise; listWorkflowVersions(workflowId: string): Promise; listWorkflowRuns(workflowId: string, filter: AdminWorkflowRunsFilter & { includeState: true; }): Promise<{ runs: AdminWorkflowRunDetails[]; nextCursor: string | null; }>; listWorkflowRuns(workflowId: string, filter?: AdminWorkflowRunsFilter): Promise<{ runs: AdminWorkflowRun[]; nextCursor: string | null; }>; getWorkflowRun(runId: string): Promise; cancelWorkflowRuns(workflowId: string, filter?: { runKey?: string; runId?: string; state?: "queued" | "running" | "sleeping"; version?: number; }): Promise<{ canceledCount: number; }>; upgradeWorkflowRuns(workflowId: string, options: { toVersion: number; runKey?: string; fromVersion?: number; }): Promise; retryWorkflowRun(runId: string): Promise; sendWorkflowEvent(name: string, data?: unknown): Promise<{ eventId: string; }>; listEmailDrafts(): Promise<{ id: string; displayName: string; themeId: string | undefined | false; tsxSource: string; sentAt: Date | null; }[]>; createTeamPermissionDefinition(data: AdminTeamPermissionDefinitionCreateOptions): Promise; updateTeamPermissionDefinition(permissionId: string, data: AdminTeamPermissionDefinitionUpdateOptions): Promise; deleteTeamPermissionDefinition(permissionId: string): Promise; listTeamPermissionDefinitions(): Promise; listTeamPermissionDefinitionsPaginated(options: { limit: number; cursor?: string; query?: string; }): Promise<{ items: AdminTeamPermissionDefinition[]; nextCursor: string | null; }>; createProjectPermissionDefinition(data: AdminProjectPermissionDefinitionCreateOptions): Promise; updateProjectPermissionDefinition(permissionId: string, data: AdminProjectPermissionDefinitionUpdateOptions): Promise; deleteProjectPermissionDefinition(permissionId: string): Promise; listProjectPermissionDefinitions(): Promise; protected _refreshProject(): Promise; protected _refreshProjectConfig(): Promise; protected _refreshInternalApiKeys(): Promise; protected _refreshUsers(): Promise; get [hexclaveAppInternalsSymbol](): { toClientJson: () => { baseUrl?: string | { browser: string; server: string; }; extraRequestHeaders?: Record; projectId?: ProjectId | undefined; publishableClientKey?: string; urls?: import("@hexclave/shared/dist/handler-urls-BHt3v8Ai").i; oauthScopesOnSignIn?: Partial; tokenStore?: import("../../common").TokenStoreInit | undefined; redirectMethod?: import("../../common").RedirectMethod; inheritsFrom?: import("..").StackClientApp; devTool?: boolean | "auto"; noAutomaticPrefetch?: boolean; automaticSideEffects?: boolean; analytics?: import("./session-replay").AnalyticsOptions; } & { tokenStore: import("../../common").TokenStoreInit; } & (string extends ProjectId ? unknown : { projectId: ProjectId; } | { inheritsFrom: import("..").StackClientApp; }) & { inheritsFrom?: undefined; } & { uniqueIdentifier: string; }; setCurrentUser: (userJsonPromise: Promise) => void; getConstructorOptions: () => { baseUrl?: string | { browser: string; server: string; }; extraRequestHeaders?: Record; projectId?: ProjectId | undefined; publishableClientKey?: string; urls?: import("@hexclave/shared/dist/handler-urls-BHt3v8Ai").i; oauthScopesOnSignIn?: Partial; tokenStore?: import("../../common").TokenStoreInit | undefined; redirectMethod?: import("../../common").RedirectMethod; inheritsFrom?: import("..").StackClientApp; devTool?: boolean | "auto"; noAutomaticPrefetch?: boolean; automaticSideEffects?: boolean; analytics?: import("./session-replay").AnalyticsOptions; } & { tokenStore: import("../../common").TokenStoreInit; } & (string extends ProjectId ? unknown : { projectId: ProjectId; } | { inheritsFrom: import("..").StackClientApp; }) & { inheritsFrom?: undefined; }; sendSessionReplayBatch: (body: string, options: { keepalive: boolean; }) => Promise>; sendAnalyticsEventBatch: (body: string, options: { keepalive: boolean; }) => Promise>; addRequestListener: (listener: import("@hexclave/shared/dist/client-interface-BoIICu7a").a) => () => void; sendRequest: (path: string, requestOptions: RequestInit, requestType?: "client" | "server" | "admin") => Promise; getUrls: () => Readonly; getRedirectMethod: () => import("../../common").RedirectMethod; redirectToUrl: (url: string | URL, options?: { replace?: boolean; } | undefined) => Promise; getRedirectToHandlerUrl: (handlerName: keyof import("@hexclave/shared/dist/handler-urls-BHt3v8Ai").o, options?: import("../../common").RedirectToOptions) => Promise; redirectToHandler: (handlerName: keyof import("@hexclave/shared/dist/handler-urls-BHt3v8Ai").o, options?: import("../../common").RedirectToOptions) => Promise; getRawAfterAuthReturnTo: () => string | null; refreshOwnedProjects: () => Promise; signInWithTokens: (tokens: { accessToken: string; refreshToken: string; }) => Promise; awaitPendingAuthResolutions: () => Promise; isTrustedRedirectUrl: (url: string) => Promise; }; sendTestEmail(options: { recipientEmail: string; emailConfig: EmailConfig; }): Promise>; sendTestWebhook(options: { endpointId: string; }): Promise>; listSentEmails(): Promise; setupManagedEmailProvider(options: { subdomain: string; senderLocalPart: string; }): Promise; checkManagedEmailStatus(options: { domainId: string; subdomain: string; senderLocalPart: string; }): Promise; listManagedEmailDomains(): Promise; applyManagedEmailProvider(options: { domainId: string; }): Promise<{ status: "applied"; }>; deleteManagedEmailDomain(options: { resendDomainId: string; }): Promise<{ status: "deleted"; }>; sendSignInInvitationEmail(email: string, callbackUrl: string): Promise; createEmailTemplate(displayName: string): Promise<{ id: string; }>; deleteEmailTemplate(id: string): Promise; createEmailDraft(options: { displayName: string; themeId?: string | false; tsxSource?: string; }): Promise<{ id: string; }>; updateEmailDraft(id: string, data: { displayName?: string; themeId?: string | undefined | false; tsxSource?: string; }): Promise; deleteEmailDraft(id: string): Promise; refreshEmailDrafts(): Promise; saveChatMessage(threadId: string, message: any): Promise; listChatMessages(threadId: string): Promise<{ messages: Array; }>; rewriteTemplateSourceWithAI(templateTsxSource: string): Promise<{ tsxSource: string; }>; createEmailTheme(displayName: string): Promise<{ id: string; }>; getEmailPreview(options: { themeId?: string | null | false; themeTsxSource?: string; templateId?: string; templateTsxSource?: string; }): Promise; getEmailPreviewWithEditableMarkers(options: { themeId?: string | null | false; themeTsxSource?: string; templateId?: string; templateTsxSource?: string; editableSource?: 'template' | 'theme' | 'both'; }): Promise<{ html: string; editableRegions?: Record; }>; updateEmailTheme(id: string, tsxSource: string): Promise; deleteEmailTheme(id: string): Promise; updateEmailTemplate(id: string, tsxSource: string, themeId: string | null | false): Promise<{ renderedHtml: string; }>; setupPayments(): Promise<{ url: string; }>; createStripeWidgetAccountSession(): Promise<{ client_secret: string; }>; getPaymentMethodConfigs(): Promise<{ configId: string; methods: Array<{ id: string; name: string; enabled: boolean; available: boolean; overridable: boolean; }>; } | null>; updatePaymentMethodConfigs(configId: string, updates: Record): Promise; createItemQuantityChange(options: ({ userId: string; itemId: string; quantity: number; expiresAt?: string; description?: string; } | { teamId: string; itemId: string; quantity: number; expiresAt?: string; description?: string; } | { customCustomerId: string; itemId: string; quantity: number; expiresAt?: string; description?: string; })): Promise; refundTransaction(options: { type: "subscription" | "one-time-purchase"; id: string; invoiceId?: string; amountUsd: MoneyAmount; endAction?: "now" | "at-period-end"; }): Promise<{ refundTransactionId: string; }>; listTransactions(params: { cursor?: string; limit?: number; type?: TransactionType; customerType?: 'user' | 'team' | 'custom'; customerId?: string; }): Promise<{ transactions: Transaction[]; nextCursor: string | null; }>; private _emailOutboxCrudToAdmin; listOutboxEmails(options?: { status?: string; simpleStatus?: string; userId?: string; limit?: number; cursor?: string; }): Promise<{ items: AdminEmailOutbox[]; nextCursor: string | null; }>; getOutboxEmail(id: string): Promise; updateOutboxEmail(id: string, options: EmailOutboxUpdateOptions): Promise; pauseOutboxEmail(id: string): Promise; unpauseOutboxEmail(id: string): Promise; cancelOutboxEmail(id: string): Promise; getStripeAccountInfo(): Promise; getAnalyticsClickmap(options: AnalyticsClickmapOptions): Promise; createAnalyticsClickmapToken(options: { origin: string; }): Promise; listSessionReplays(options?: ListSessionReplaysOptions): Promise; getSessionReplay(sessionReplayId: string): Promise; listSessionReplayChunks(sessionReplayId: string, options?: ListSessionReplayChunksOptions): Promise; getSessionReplayChunkEvents(sessionReplayId: string, chunkId: string): Promise; getSessionReplayEvents(sessionReplayId: string, options?: { offset?: number; limit?: number; }): Promise; previewAffectedUsersByOnboardingChange(onboarding: { requireEmailVerification?: boolean; }, limit?: number): Promise<{ affectedUsers: Array<{ id: string; displayName: string | null; primaryEmail: string | null; restrictedReason: RestrictedReason; }>; totalAffectedCount: number; }>; } //#endregion export { _HexclaveAdminAppImplIncomplete }; //# sourceMappingURL=admin-app-impl.d.ts.map