import { ComponentEvent, LocalGitRepoState, SuperblocksResourceType } from "@superblocksteam/util"; import { StdISocketRPCClient } from "./socket"; import { Api, ApiWithPb, Page, RemoteCommitDto, UserMeDto, ViewMode, DeploymentDto } from "./types"; export interface UploadFile { name: string; filename: string; ContentType: string; } export interface ApplicationWrapper { application: Record; page: Page; apis: ApiWithPb[]; } export interface MultiPageApplicationWrapper { application: Record; pages: Page[]; apis: Record[]; } export type PushMultiPageApplicationWithCommitConfig = MultiPageApplicationWrapper & { commitId?: string; commitMessage?: string; gitState: LocalGitRepoState; skipCommit: boolean; }; export interface ApiWrapper { apiPb: Api; name?: string; } export type PushApiWithCommitConfig = { apiPb: Record; commitId?: string; commitMessage?: string; gitState: LocalGitRepoState; skipCommit: boolean; }; export type Branches = { branches: Branch[]; }; export type Branch = { name: string; isDefault: boolean; }; export interface CommitDto { commitMessage: string; committer: { name?: string; email: string; }; commitId: string; commitDate: number; branch?: string; autosave?: boolean; tag: string; externalCommitId?: string | null; externalCommitDate?: number | null; } export interface GetCommitsResponseBody { autosaves: CommitDto[]; commits: CommitDto[]; } export declare function fetchApplication({ cliVersion, applicationId, branch, token, superblocksBaseUrl, viewMode, commitId, skipSigningVerification, injectedHeaders, }: { cliVersion: string; applicationId: string; branch?: string; token: string; superblocksBaseUrl: string; viewMode: ViewMode; commitId?: string; skipSigningVerification?: boolean; injectedHeaders: Record; }): Promise; export declare function fetchApplicationBranches({ cliVersion, applicationId, token, superblocksBaseUrl, injectedHeaders, }: { cliVersion: string; applicationId: string; token: string; superblocksBaseUrl: string; injectedHeaders: Record; }): Promise; export declare function fetchApplicationWithComponents({ cliVersion, applicationId, branch, token, superblocksBaseUrl, viewMode, commitId, skipSigningVerification, injectedHeaders, }: { cliVersion: string; applicationId: string; branch: string; token: string; superblocksBaseUrl: string; viewMode: ViewMode; commitId?: string; skipSigningVerification?: boolean; injectedHeaders: Record; }): Promise<(MultiPageApplicationWrapper & { componentFiles: any; }) | undefined>; 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: ViewMode, 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 registerComponents(cliVersion: string, applicationId: string, componentConfigs: Record, token: string, superblocksBaseUrl: string, branch: string | null, injectedHeaders: Record): Promise; export declare function uploadComponents({ cliVersion, applicationId, componentConfigs, files, token, superblocksBaseUrl, branch, }: { cliVersion: string; applicationId: string; componentConfigs: Record; files: string[]; token: string; superblocksBaseUrl: string; branch: string | null; }): Promise; export declare function fetchCurrentUser(cliVersion: string, token: string, superblocksBaseUrl: string): Promise; export declare const createSocketConnectionIfNeeded: (cliVersion: string, token: string, superblocksBaseUrl: string) => 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 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, token, superblocksBaseUrl, injectedHeaders, limit, offset, }: { cliVersion: string; applicationId: string; branch?: string; token: string; superblocksBaseUrl: string; injectedHeaders: Record; limit?: number; offset?: number; }): Promise; export declare function fetchApiCommits({ cliVersion, applicationId, branch, token, superblocksBaseUrl, injectedHeaders, limit, offset, }: { cliVersion: string; applicationId: string; branch?: string; 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;