@builder.io/dev-tools
Version:
Builder.io Visual CMS Devtools
51 lines (50 loc) • 1.97 kB
TypeScript
export interface BuilderCredentials {
builderPublicKey: string;
builderPrivateKey: string;
userId: string;
}
export interface PushProgress {
onGitPushing(branch: string): void;
onGitPushed(branch: string): void;
onBranchLookupStart(): void;
onBranchFound(name: string): void;
onBranchCreating(): void;
onBranchCreated(name: string): void;
onSyncDone(): void;
onSyncWarning(message: string): void;
}
export interface PushResult {
builderBranchName: string;
projectId: string;
branchUrl: string;
}
export interface PullProgress {
onBranchResolving(builderBranch: string): void;
onBranchResolved(gitBranch: string): void;
onFetchStart(gitBranch: string): void;
onFetchDone(gitBranch: string): void;
onFetchFailed(gitBranch: string): void;
onCheckoutStart(gitBranch: string): void;
onCheckoutDone(gitBranch: string): void;
onPullStart(): void;
onPullDone(builderBranch: string, hadChanges: boolean): void;
onNoRemote(gitBranch: string): void;
}
export interface PullResult {
gitBranch: string;
hadChanges: boolean;
}
/**
* Core push orchestration: pushes the git branch to origin, then ensures a
* corresponding Builder.io branch exists. No UX concerns — progress is
* communicated through the PushProgress interface so CLI and MCP callers can
* each implement appropriate feedback.
*/
export declare function corePush(credentials: BuilderCredentials, gitBranch: string, projectId: string, progress: PushProgress): Promise<PushResult>;
/**
* Core pull orchestration: resolves a Builder.io branch to a git branch, then
* fetches and checks it out locally. No UX concerns — progress is communicated
* through the PullProgress interface so CLI and MCP callers can each implement
* appropriate feedback.
*/
export declare function corePull(credentials: BuilderCredentials, projectId: string, builderBranchArg: string, progress: PullProgress): Promise<PullResult>;