import { RestrictedReason } from "@stackframe/stack-shared/dist/schema-fields"; import { StackAdminInterface } from "@stackframe/stack-shared"; import { Result } from "@stackframe/stack-shared/dist/utils/results"; import * as _stackframe_stack_shared_dist_interface_handler_urls0 from "@stackframe/stack-shared/dist/interface/handler-urls"; import * as _stackframe_stack_shared_dist_sessions0 from "@stackframe/stack-shared/dist/sessions"; import * as __0 from ".."; import * as _____0 from "../.."; import { AdminEmailOutbox, AdminSentEmail } from "../.."; import * as ______common0 from "../../common"; import { EmailConfig, stackAppInternalsSymbol } from "../../common"; import * as __session_replay0 from "./session-replay"; import * as _stackframe_stack_shared_dist_interface_crud_current_user0 from "@stackframe/stack-shared/dist/interface/crud/current-user"; import * as _stackframe_stack_shared_dist_interface_client_interface0 from "@stackframe/stack-shared/dist/interface/client-interface"; import { InternalApiKeyCreateCrudResponse } from "@stackframe/stack-shared/dist/interface/admin-interface"; import { MetricsResponse } from "@stackframe/stack-shared/dist/interface/admin-metrics"; import { AnalyticsQueryOptions, AnalyticsQueryResponse } from "@stackframe/stack-shared/dist/interface/crud/analytics"; import { EmailTemplateCrud } from "@stackframe/stack-shared/dist/interface/crud/email-templates"; import { InternalApiKeysCrud } from "@stackframe/stack-shared/dist/interface/crud/internal-api-keys"; import { ProjectsCrud } from "@stackframe/stack-shared/dist/interface/crud/projects"; import { AdminGetSessionReplayChunkEventsResponse } from "@stackframe/stack-shared/dist/interface/crud/session-replays"; import { Transaction, TransactionType } from "@stackframe/stack-shared/dist/interface/crud/transactions"; import { MoneyAmount } from "@stackframe/stack-shared/dist/utils/currency-constants"; import { AdminEmailTemplate } from "../../email-templates"; import { InternalApiKey, InternalApiKeyBase, InternalApiKeyBaseCrudRead, InternalApiKeyCreateOptions, InternalApiKeyFirstView } from "../../internal-api-keys"; import { AdminProjectPermission, AdminProjectPermissionDefinition, AdminProjectPermissionDefinitionCreateOptions, AdminProjectPermissionDefinitionUpdateOptions, AdminTeamPermission, AdminTeamPermissionDefinition, AdminTeamPermissionDefinitionCreateOptions, AdminTeamPermissionDefinitionUpdateOptions } from "../../permissions"; import { AdminOwnedProject, AdminProject } from "../../projects"; import { ListSessionReplayChunksOptions, ListSessionReplayChunksResult, ListSessionReplaysOptions, ListSessionReplaysResult, SessionReplayAllEventsResult } from "../../session-replays"; import { EmailOutboxUpdateOptions, ManagedEmailProviderListItem, ManagedEmailProviderSetupResult, ManagedEmailProviderStatus, StackAdminApp, StackAdminAppConstructorOptions } from "../interfaces/admin-app"; import { _StackServerAppImplIncomplete } from "./server-app-impl"; import { CompleteConfig } from "@stackframe/stack-shared/dist/config/schema"; //#region src/lib/stack-app/apps/implementations/admin-app-impl.d.ts declare class _StackAdminAppImplIncomplete extends _StackServerAppImplIncomplete implements StackAdminApp { protected _interface: StackAdminInterface; private readonly _adminProjectCache; private readonly _internalApiKeysCache; private readonly _adminEmailThemeCache; private readonly _adminEmailThemesCache; private readonly _adminEmailTemplatesCache; private readonly _adminEmailDraftsCache; private readonly _adminTeamPermissionDefinitionsCache; private readonly _adminProjectPermissionDefinitionsCache; private readonly _svixTokenCache; private readonly _metricsCache; private readonly _emailPreviewCache; private readonly _emailPreviewWithEditableMarkersCache; private readonly _configOverridesCache; private readonly _stripeAccountInfoCache; private readonly _transactionsCache; constructor(options: StackAdminAppConstructorOptions, extraOptions?: { uniqueIdentifier?: string; checkString?: string; interface?: StackAdminInterface; }); _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; getProject(): Promise; useProject(): AdminProject; protected _createInternalApiKeyBaseFromCrud(data: InternalApiKeyBaseCrudRead): InternalApiKeyBase; protected _createInternalApiKeyFromCrud(data: InternalApiKeysCrud["Admin"]["Read"]): InternalApiKey; protected _createInternalApiKeyFirstViewFromCrud(data: InternalApiKeyCreateCrudResponse): InternalApiKeyFirstView; listInternalApiKeys(): Promise; useInternalApiKeys(): InternalApiKey[]; createInternalApiKey(options: InternalApiKeyCreateOptions): Promise; useEmailThemes(): { id: string; displayName: string; }[]; useEmailTemplates(): { id: string; displayName: string; themeId?: string; tsxSource: string; }[]; useEmailDrafts(): { id: string; displayName: string; themeId: string | undefined | false; tsxSource: string; sentAt: Date | null; }[]; listEmailThemes(): Promise<{ id: string; displayName: string; }[]>; listEmailTemplates(): Promise<{ id: string; displayName: string; themeId?: string; tsxSource: 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; useTeamPermissionDefinitions(): AdminTeamPermissionDefinition[]; createProjectPermissionDefinition(data: AdminProjectPermissionDefinitionCreateOptions): Promise; updateProjectPermissionDefinition(permissionId: string, data: AdminProjectPermissionDefinitionUpdateOptions): Promise; deleteProjectPermissionDefinition(permissionId: string): Promise; listProjectPermissionDefinitions(): Promise; useProjectPermissionDefinitions(): AdminProjectPermissionDefinition[]; useSvixToken(): { token: string; url: string | undefined; }; protected _refreshProject(): Promise; protected _refreshProjectConfig(): Promise; protected _refreshInternalApiKeys(): Promise; protected _refreshUsers(): Promise; get [stackAppInternalsSymbol](): { useMetrics: (includeAnonymous?: boolean) => MetricsResponse; toClientJson: () => { baseUrl?: string | { browser: string; server: string; }; extraRequestHeaders?: Record; projectId?: ProjectId | undefined; publishableClientKey?: string; urls?: _stackframe_stack_shared_dist_interface_handler_urls0.HandlerUrlOptions; oauthScopesOnSignIn?: Partial<_____0.OAuthScopesOnSignIn>; tokenStore?: ______common0.TokenStoreInit | undefined; redirectMethod?: ______common0.RedirectMethod; inheritsFrom?: __0.StackClientApp; noAutomaticPrefetch?: boolean; analytics?: __session_replay0.AnalyticsOptions; } & { tokenStore: ______common0.TokenStoreInit; } & (string extends ProjectId ? unknown : { projectId: ProjectId; } | { inheritsFrom: __0.StackClientApp; }) & { inheritsFrom?: undefined; } & { uniqueIdentifier: string; }; setCurrentUser: (userJsonPromise: Promise<_stackframe_stack_shared_dist_interface_crud_current_user0.CurrentUserCrud["Client"]["Read"] | null>) => void; getConstructorOptions: () => { baseUrl?: string | { browser: string; server: string; }; extraRequestHeaders?: Record; projectId?: ProjectId | undefined; publishableClientKey?: string; urls?: _stackframe_stack_shared_dist_interface_handler_urls0.HandlerUrlOptions; oauthScopesOnSignIn?: Partial<_____0.OAuthScopesOnSignIn>; tokenStore?: ______common0.TokenStoreInit | undefined; redirectMethod?: ______common0.RedirectMethod; inheritsFrom?: __0.StackClientApp; noAutomaticPrefetch?: boolean; analytics?: __session_replay0.AnalyticsOptions; } & { tokenStore: ______common0.TokenStoreInit; } & (string extends ProjectId ? unknown : { projectId: ProjectId; } | { inheritsFrom: __0.StackClientApp; }) & { inheritsFrom?: undefined; }; sendSessionReplayBatch: (body: string, options: { keepalive: boolean; }) => Promise>; sendAnalyticsEventBatch: (body: string, options: { keepalive: boolean; }) => Promise>; addRequestListener: (listener: _stackframe_stack_shared_dist_interface_client_interface0.RequestListener) => () => void; sendRequest: (path: string, requestOptions: RequestInit, requestType?: "client" | "server" | "admin") => Promise; refreshOwnedProjects: () => Promise; signInWithTokens: (tokens: { accessToken: string; refreshToken: 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"; }>; 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; useEmailPreview(options: { themeId?: string | null | false; themeTsxSource?: string; templateId?: string; templateTsxSource?: string; }): string; getEmailPreviewWithEditableMarkers(options: { themeId?: string | null | false; themeTsxSource?: string; templateId?: string; templateTsxSource?: string; editableSource?: 'template' | 'theme' | 'both'; }): Promise<{ html: string; editableRegions?: Record; }>; useEmailPreviewWithEditableMarkers(options: { themeId?: string | null | false; themeTsxSource?: string; templateId?: string; templateTsxSource?: string; editableSource?: 'template' | 'theme' | 'both'; }): { html: string; editableRegions?: Record; }; useEmailTheme(id: string): { displayName: string; tsxSource: string; }; 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; refundEntries: Array<{ entryIndex: number; quantity: number; amountUsd: MoneyAmount; }>; }): Promise; listTransactions(params: { cursor?: string; limit?: number; type?: TransactionType; customerType?: 'user' | 'team' | 'custom'; }): Promise<{ transactions: Transaction[]; nextCursor: string | null; }>; private _emailOutboxCrudToAdmin; listOutboxEmails(options?: { status?: string; simpleStatus?: 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; useTransactions(params: { cursor?: string; limit?: number; type?: TransactionType; customerType?: 'user' | 'team' | 'custom'; }): { transactions: Transaction[]; nextCursor: string | null; }; getStripeAccountInfo(): Promise; useStripeAccountInfo(): { account_id: string; charges_enabled: boolean; details_submitted: boolean; payouts_enabled: boolean; } | null; queryAnalytics(options: AnalyticsQueryOptions): Promise; listSessionReplays(options?: ListSessionReplaysOptions): 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 { _StackAdminAppImplIncomplete }; //# sourceMappingURL=admin-app-impl.d.ts.map