import { type AiChatMessagePayload, CommitType, ExportViewMode, type AssignmentDto, type OCSFAuditEvent, type AuditLogDto, type AuditLogEntity, type FactDto, type FactListQuery, type GetApplicationCommitsResponseBody, type GetPublicOrganizationSummaryResponseBody, type IHomepageApplicationV2Dto } from "@superblocksteam/shared"; import { ComponentEvent } from "@superblocksteam/util"; import type { LocalGitRepoState, SuperblocksResourceType } from "@superblocksteam/util"; import type { ApiWithPb, DeploymentDto, DeploymentHistoryEntryDto, Page, RemoteCommitDto, UserMeDto } from "./types/index.js"; export interface ApplicationWrapper { application: Record; page: Page; apis: ApiWithPb[]; } export interface MultiPageApplicationWrapper { application: Record; deployedCommitId?: string | null; pages: Page[]; apis: Record[]; } export interface TypedMultiPageApplicationWrapper { type: "multi-page"; application: Record; pages: Page[]; apis: Record[]; } export interface CodeModeApplicationWrapper { type: "code-mode"; application: Record; } export type PushMultiPageApplicationWithCommitConfig = MultiPageApplicationWrapper & { commitId: string; commitMessage: string; gitState: LocalGitRepoState; skipCommit: boolean; }; export type PushApiWithCommitConfig = { apiPb: Record; commitId: string; commitMessage: string; gitState: LocalGitRepoState; skipCommit: boolean; }; type Branches = { branches: Branch[]; }; type Branch = { name: string; isDefault: boolean; }; export type GetCommitsResponseBody = GetApplicationCommitsResponseBody; export declare enum BranchSource { DEV_ENVIRONMENT = "dev environment config file", COMMAND_LINE = "command line", GIT_REPO = "current git repository", DEFAULT = "default" } export declare class CurrentBranch { readonly branchName: string; readonly source: BranchSource; readonly sourcePath?: string; readonly userSpecifiedBranch?: string; constructor({ branchName, source, sourcePath, userSpecifiedBranch, }: { branchName: string; source: BranchSource; sourcePath?: string; userSpecifiedBranch?: string; }); isDevEnvironmentWithUserSpecifiedBranch(): boolean; isDefinedInDevEnvironmentConfig(): boolean; isDefaultBranch(): boolean; isGitBranch(): boolean; } /** * Returns the current branch name, in the following order of precedence: * 1. If a branch name is specified in the dev environment config, use that * 2. If a branch name is specified, use that * 3. If this is in a git repo, use the current branch * 4. If this is not in a git repo, use the default branch * @param userSpecifiedBranch - The branch name specified by the user * @param pathPrefix - The path prefix to use when looking for the dev environment config * @returns The current branch information */ export declare function getCurrentBranchInfo(userSpecifiedBranch?: string, pathPrefix?: string): Promise; export declare function fetchApplication({ cliVersion, applicationId, branch, token, superblocksBaseUrl, viewMode, commitId, skipSigningVerification, injectedHeaders, keepOriginalNotFoundError, }: { cliVersion: string; applicationId: string; branch?: string; token: string; superblocksBaseUrl: string; viewMode: ExportViewMode; commitId?: string; skipSigningVerification?: boolean; injectedHeaders: Record; keepOriginalNotFoundError?: boolean; }): Promise; export declare function fetchApplicationBranches({ cliVersion, applicationId, token, superblocksBaseUrl, injectedHeaders, }: { cliVersion: string; applicationId: string; token: string; superblocksBaseUrl: string; injectedHeaders: Record; }): Promise; export declare function fetchTypedApplication({ cliVersion, applicationId, branch, token, superblocksBaseUrl, viewMode, commitId, skipSigningVerification, injectedHeaders, keepOriginalNotFoundError, }: { cliVersion: string; applicationId: string; branch: string; token: string; superblocksBaseUrl: string; viewMode: ExportViewMode; commitId?: string; skipSigningVerification?: boolean; injectedHeaders: Record; keepOriginalNotFoundError?: boolean; }): Promise; export declare function fetchApplications(cliVersion: string, token: string, superblocksBaseUrl: string, injectedHeaders?: Record): Promise; export declare function fetchApi(cliVersion: string, apiId: string, token: string, superblocksBaseUrl: string, viewMode: ExportViewMode, branch?: string, commitId?: string, skipSigningVerification?: boolean): Promise; export declare function fetchApis(cliVersion: string, token: string, superblocksBaseUrl: string): Promise; export declare function validateGitSetup(cliVersion: string, resourceId: string, resourceType: SuperblocksResourceType, event: ComponentEvent, localGitRepoState: LocalGitRepoState, token: string, superblocksBaseUrl: string, injectedHeaders?: Record): Promise<{ branchName: string | null; }>; export declare function fetchCurrentUser(cliVersion: string, token: string, superblocksBaseUrl: string): Promise; export declare function fetchOrganizationSummary(cliVersion: string, token: string, superblocksBaseUrl: string, organizationId: string): Promise; interface CreateApplicationParams { cliVersion: string; token: string; superblocksBaseUrl: string; name: string; organizationId: string; codeMode?: boolean; templateName?: string; folderId?: string; } export interface CreateApplicationResult { id: string; name: string; organizationId: string; devEnvEnabled?: boolean; } export declare function createApplication({ cliVersion, token, superblocksBaseUrl, name, organizationId, codeMode, templateName, folderId, }: CreateApplicationParams): Promise; export interface ApplicationGitConfig { gitRemoteUrl: string; hasCredential: boolean; } export interface GitFreshToken { username: string; token: string; } export interface SyncRequest { directoryHash: string; sha: string; } export interface SyncResponse { applicationId: string; branch: string; directoryHash: string; sha: string; commitId?: string; } export declare function getApplicationGitConfig(token: string, superblocksBaseUrl: string, applicationId: string): Promise; export declare function getGitFreshToken(token: string, superblocksBaseUrl: string, host: string, applicationId: string): Promise; export declare function sync(token: string, superblocksBaseUrl: string, applicationId: string, payload: SyncRequest): Promise; export declare function pushApplication({ cliVersion, applicationId, token, superblocksBaseUrl, applicationConfig, branch, injectedHeaders, }: { cliVersion: string; applicationId: string; token: string; superblocksBaseUrl: string; branch: string; injectedHeaders: Record; applicationConfig: PushMultiPageApplicationWithCommitConfig; }): Promise; export declare function pushApplicationCodeMode({ applicationId, token, superblocksBaseUrl, localDirectoryPath, branch, commitMessage, commitId, forcePush, gitState, skipCommit, }: { applicationId: string; token: string; superblocksBaseUrl: string; localDirectoryPath: string; branch: string; commitMessage: string; commitId: string; forcePush?: boolean; gitState: LocalGitRepoState; skipCommit?: boolean; }): Promise<{ commitId: string; } | { updated: Date; } | undefined>; export declare function pushApi({ cliVersion, apiId, token, superblocksBaseUrl, apiConfig, branch, injectedHeaders, }: { cliVersion: string; apiId: string; token: string; superblocksBaseUrl: string; apiConfig: PushApiWithCommitConfig; branch: string; injectedHeaders: Record; }): Promise<{ commitId: string; } | { updated: Date; } | undefined>; export declare function fetchApplicationCommits({ cliVersion, applicationId, branch, commitType, token, superblocksBaseUrl, injectedHeaders, limit, offset, }: { cliVersion: string; applicationId: string; branch?: string; commitType?: CommitType; token: string; superblocksBaseUrl: string; injectedHeaders: Record; limit?: number; offset?: number; }): Promise; export declare function fetchApiCommits({ cliVersion, applicationId, branch, commitType, token, superblocksBaseUrl, injectedHeaders, limit, offset, }: { cliVersion: string; applicationId: string; branch?: string; commitType?: CommitType; token: string; superblocksBaseUrl: string; injectedHeaders: Record; limit?: number; offset?: number; }): Promise; export declare function deployApplication(cliVersion: string, applicationId: string, token: string, superblocksBaseUrl: string, commitId?: string): Promise; export declare function deployApi(cliVersion: string, apiId: string, token: string, superblocksBaseUrl: string, commitId?: string): Promise; export declare function undeployApplication(cliVersion: string, applicationId: string, token: string, superblocksBaseUrl: string, undeployMessage?: string): Promise<{ success: boolean; }>; export declare function fetchApplicationDeployments(cliVersion: string, applicationId: string, token: string, superblocksBaseUrl: string): Promise; export declare function uploadApplication({ files, scopedJwt, url, cliVersion, appRoot, }: { files: string[]; scopedJwt: string; url: string; cliVersion: string; appRoot?: string; }): Promise; export declare function fetchRbacAssignments({ cliVersion, token, superblocksBaseUrl, resourceType, resourceId, }: { cliVersion: string; token: string; superblocksBaseUrl: string; resourceType: string; resourceId: string; }): Promise; export interface CreateRbacAssignmentsRequest { assignments: Array<{ assignmentType: string; assignmentId: string; resourceType: string; resourceId: string; principalType: string; principalId: string; organizationId: string; }>; } export interface UpdateRbacAssignmentRequest { assignmentType: string; assignmentId: string; } export declare function createRbacAssignments({ cliVersion, token, superblocksBaseUrl, payload, }: { cliVersion: string; token: string; superblocksBaseUrl: string; payload: CreateRbacAssignmentsRequest; }): Promise; export declare function updateRbacAssignment({ cliVersion, token, superblocksBaseUrl, assignmentRecordId, payload, }: { cliVersion: string; token: string; superblocksBaseUrl: string; assignmentRecordId: string; payload: UpdateRbacAssignmentRequest; }): Promise; export declare function deleteRbacAssignment({ cliVersion, token, superblocksBaseUrl, assignmentRecordId, }: { cliVersion: string; token: string; superblocksBaseUrl: string; assignmentRecordId: string; }): Promise; export interface AuditLogFilters { startTime: string; endTime: string; entityType?: number; auditEntityId?: string; auditEntityType?: number; status?: string; deployed?: boolean; triggeredBy?: string[]; } export declare function fetchAuditLogs({ cliVersion, token, superblocksBaseUrl, filters, }: { cliVersion: string; token: string; superblocksBaseUrl: string; filters: AuditLogFilters; }): Promise; interface AuditEventFilters { timeStart: string; timeEnd: string; activityId?: number; actor?: string; applicationId?: string; classUid?: number; cursor?: string; limit?: number; resourceId?: string; resourceType?: string; search?: string; severity?: number; status?: number; } interface AuditEventsResponse { events: OCSFAuditEvent[]; next_cursor: string | null; } interface ChatHistoryMessage { id: string; created: string; chatPayload: AiChatMessagePayload; version: number; authorId?: string | null; authorEmail?: string | null; authorName?: string | null; } export interface ChatHistoryResponse { applicationId: string; messages: ChatHistoryMessage[]; nextCursor: string | null; hasMore: boolean; limit: number; } export declare function fetchAuditEvents({ cliVersion, token, superblocksBaseUrl, filters, }: { cliVersion: string; token: string; superblocksBaseUrl: string; filters: AuditEventFilters; }): Promise; export interface AuditEventsAggregateFilters { timeStart: string; timeEnd: string; metric: "count" | "unique_actors" | "unique_resources"; groupBy?: "activity_id" | "actor_user_uid" | "application_id" | "class_uid" | "day" | "hour" | "resource_type"; activityId?: number; actor?: string; applicationId?: string; classUid?: number; resourceId?: string; resourceType?: string; search?: string; severity?: number; status?: number; } export interface AuditEventsAggregateResponse { value: number; groups: Array<{ key: string; value: number; }> | null; } interface ChatHistoryRequest { cliVersion: string; token: string; superblocksBaseUrl: string; applicationId: string; userId?: string; limit?: number; cursor?: string; } export declare function fetchChatHistory(request: ChatHistoryRequest): Promise; export declare function fetchEditorChatHistory(request: Omit): Promise; export declare function fetchAuditEventsAggregate({ cliVersion, token, superblocksBaseUrl, filters, }: { cliVersion: string; token: string; superblocksBaseUrl: string; filters: AuditEventsAggregateFilters; }): Promise; export interface IntegrationFilters { kind?: string[]; slug?: string[]; } export interface IntegrationSummary { id: string; name: string; pluginId: string; organizationId: string; kind: string; slug?: string; created: string; updated: string; ownerEmail?: string; creator?: { id: string; email: string; name: string; }; isUserConfigured: boolean; /** Set when the integration belongs to one application, as App Database integrations do. */ applicationId?: string | null; /** Which subsystem owns the integration (for example `database_lifecycle`), or null when a person does. */ managedBy?: string | null; /** False when the owning subsystem forbids editing or deleting it through the integrations API. */ userEditable?: boolean; } export interface IntegrationDetail extends IntegrationSummary { configurations?: unknown[]; demoIntegrationId?: string; enabledForV2?: boolean; } export interface IntegrationMutationPayload { [key: string]: unknown; } export declare function fetchIntegrations({ cliVersion, token, superblocksBaseUrl, filters, }: { cliVersion: string; token: string; superblocksBaseUrl: string; filters?: IntegrationFilters; }): Promise; export declare function fetchIntegrationById({ cliVersion, token, superblocksBaseUrl, integrationId, }: { cliVersion: string; token: string; superblocksBaseUrl: string; integrationId: string; }): Promise; export declare function createIntegration({ cliVersion, token, superblocksBaseUrl, payload, }: { cliVersion: string; token: string; superblocksBaseUrl: string; payload: IntegrationMutationPayload; }): Promise; export declare function updateIntegration({ cliVersion, token, superblocksBaseUrl, integrationId, payload, }: { cliVersion: string; token: string; superblocksBaseUrl: string; integrationId: string; payload: IntegrationMutationPayload; }): Promise; export declare function deleteIntegration({ cliVersion, token, superblocksBaseUrl, integrationId, }: { cliVersion: string; token: string; superblocksBaseUrl: string; integrationId: string; }): Promise; export interface FolderSummary { id: string; name: string; organizationId: string; totalResources?: number; updated?: string; } export interface FolderMutationPayload { name: string; } export declare function fetchFolders({ cliVersion, token, superblocksBaseUrl, }: { cliVersion: string; token: string; superblocksBaseUrl: string; }): Promise; export declare function createFolder({ cliVersion, token, superblocksBaseUrl, payload, }: { cliVersion: string; token: string; superblocksBaseUrl: string; payload: FolderMutationPayload; }): Promise; export declare function updateFolder({ cliVersion, token, superblocksBaseUrl, folderId, payload, }: { cliVersion: string; token: string; superblocksBaseUrl: string; folderId: string; payload: FolderMutationPayload; }): Promise; export declare function deleteFolder({ cliVersion, token, superblocksBaseUrl, folderId, }: { cliVersion: string; token: string; superblocksBaseUrl: string; folderId: string; }): Promise; export interface DailyUsageRow { date: string; creditsUsed: number; } export interface UsageRecordRow { actorId?: string; actorType?: "ai_agent" | "user"; date: string; email: string; name: string; creditsUsed: number; source: string; } interface AgentUsageRow { agentId: string; name: string; creditsUsed: number; } interface ApplicationUsageRow { applicationId: string; applicationName: string; creditsUsed: number; usageType: "ai_credits"; } export interface DollarLedgerRow { amountCents: number; applicationId: string | null; applicationName: string | null; chargeKind: "committed" | "overage"; creditsUsed: number | null; date: string; email: string | null; entryType: string; name: string | null; usageType: "ai_credits" | "deployed_app"; } export interface UsageGroupRow { actorId: string | null; actorType: "ai_agent" | "user"; /** Where the row sits in the app column: a resolved app, the dashboard * Clark chat (no app by design), or neither. Absent on servers that * predate it. */ applicationBucket?: "application" | "dashboard" | "none"; applicationId: string | null; applicationName: string | null; /** Checkpoint (accepted AI change) this usage rolled up to; null = no * checkpoint. Absent entirely on servers that predate checkpoint mapping. */ checkpointId?: string | null; /** Checkpoint commit message; null when the commit has no message, or when * there is no checkpoint. */ checkpointLabel: string | null; creditsUsed?: number; date: string; email: string | null; name: string | null; onDemandCreditsUsed?: number; recordedAt: string | null; unbilledCreditsUsed?: number; } export interface BillingUsageRecordsResponse { agentUsage?: AgentUsageRow[]; applicationUsageRows?: ApplicationUsageRow[]; dollarCommitUsedCents?: number; dollarLedgerRows?: DollarLedgerRow[]; rows: UsageRecordRow[]; seatAssignments?: unknown[]; usageGroupRows?: UsageGroupRow[]; } export interface UserCreditLimit { amountLimitCents: number | null; creditLimit: number | null; id: string; orgId: string; updatedAt: string; updatedBy: string | null; userId: string | null; } export type OrgCreditLimit = Omit; export interface BillingUsageLimitsResponse { limits: UserCreditLimit[]; orgLimit: OrgCreditLimit | null; } type BillingUsageLimitValue = { amountLimitCents: number; creditLimit?: never; } | { amountLimitCents?: never; creditLimit: number; }; export type UpdateUserBillingUsageLimitRequest = BillingUsageLimitValue & { userId: string | null; }; export type UpdateOrgBillingUsageLimitRequest = BillingUsageLimitValue; export interface PlanSummary { billingInterval: "annual" | "monthly"; builderSeatsAssigned?: number; builderSeatsTotal?: number; contractEnd?: string | null; contractStart?: string | null; contractType?: string | null; currentPlanCredits: number; currentUsageCredits: number; cycleStart: string | null; cycleEnd: string | null; creditsPerSeat: number | null; deployedAppsAdditional: number; deployedAppPriceAnnual: number | null; deployedAppPriceMonthly: number | null; deployedAppsIncluded: number; deployedAppsLimit: number; deployedAppsUsed: number; deployedAppCostCents?: number | null; dollarCommitAmountCents?: number | null; dollarCommitUsedCents?: number | null; overageAppsEnabled?: boolean; overageCreditsEnabled?: boolean; overageSeatsEnabled?: boolean; pricePerSeatAnnual: number | null; pricePerSeatMonthly: number | null; seatsUnlimited?: boolean; subscriptionStatus: string | null; topupCreditsPurchased: number; topupCreditsUsed: number; usageResetPeriodLimit: number; usageResetPeriodType: "annual" | "contract_term" | "monthly"; } export declare function fetchBillingUsageDaily({ cliVersion, token, superblocksBaseUrl, startDate, endDate, }: { cliVersion: string; token: string; superblocksBaseUrl: string; startDate: string; endDate: string; }): Promise; export declare function fetchBillingUsageRecords({ cliVersion, token, superblocksBaseUrl, startDate, endDate, }: { cliVersion: string; token: string; superblocksBaseUrl: string; startDate: string; endDate: string; }): Promise; export declare function fetchBillingUsageRecordsResponse({ cliVersion, token, superblocksBaseUrl, startDate, endDate, }: { cliVersion: string; token: string; superblocksBaseUrl: string; startDate: string; endDate: string; }): Promise; export declare function fetchBillingPlanSummary({ cliVersion, token, superblocksBaseUrl, }: { cliVersion: string; token: string; superblocksBaseUrl: string; }): Promise; export declare function fetchBillingUsageLimits({ cliVersion, token, superblocksBaseUrl, }: { cliVersion: string; token: string; superblocksBaseUrl: string; }): Promise; export declare function updateUserBillingUsageLimit({ amountLimitCents, cliVersion, creditLimit, token, superblocksBaseUrl, userId, }: UpdateUserBillingUsageLimitRequest & { cliVersion: string; token: string; superblocksBaseUrl: string; }): Promise<{ success: boolean; }>; export declare function updateOrgBillingUsageLimit({ amountLimitCents, cliVersion, creditLimit, token, superblocksBaseUrl, }: UpdateOrgBillingUsageLimitRequest & { cliVersion: string; token: string; superblocksBaseUrl: string; }): Promise<{ success: boolean; }>; export declare function fetchFacts({ cliVersion, token, superblocksBaseUrl, query, }: { cliVersion: string; token: string; superblocksBaseUrl: string; query?: FactListQuery; }): Promise; export declare function fetchFact({ cliVersion, token, superblocksBaseUrl, factId, }: { cliVersion: string; token: string; superblocksBaseUrl: string; factId: string; }): Promise; export declare function fetchAuditEntities({ cliVersion, token, superblocksBaseUrl, }: { cliVersion: string; token: string; superblocksBaseUrl: string; }): Promise; export {}; //# sourceMappingURL=client.d.ts.map