@capgo/cli
Version:
A CLI to upload to capgo servers
99 lines (98 loc) • 3.04 kB
TypeScript
export interface SimulatorCommandOptions {
apikey?: string;
apiHost?: string;
platform?: string;
name?: string;
json?: boolean;
buildJobId?: string;
deviceCommand?: string;
x?: number;
y?: number;
bundleId?: string;
}
export interface SimulatorPayload {
data?: {
id?: string;
url?: string;
status?: string;
kind?: string;
remoteConfig?: unknown;
image_base64?: string;
image_media_type?: string;
command?: string;
result?: unknown;
};
}
export declare function simulatorApiRequest(host: string, command: 'start' | 'stop' | 'get' | 'command', input: {
appId: string;
platform?: string;
name?: string;
id?: string;
buildJobId?: string;
deviceCommand?: string;
x?: number;
y?: number;
bundleId?: string;
}): {
method: "POST";
url: string;
body: {
build_job_id?: string | undefined;
app_id: string;
platform: string | undefined;
name: string | undefined;
};
} | {
method: "POST";
url: string;
body: {
app_id: string;
};
} | {
method: "POST";
url: string;
body: {
bundle_id?: string | undefined;
y?: number | undefined;
x?: number | undefined;
app_id: string;
command: string | undefined;
};
} | {
method: "GET";
url: string;
body: undefined;
};
export declare function executeSimulator(command: 'start' | 'stop' | 'get' | 'command', appId: string, sessionId: string | undefined, options: SimulatorCommandOptions): Promise<SimulatorPayload>;
export declare function simulatorMcpContent(payload: SimulatorPayload): {
content: ({
type: "text";
text: string;
} | {
type: "image";
data: string;
mimeType: string;
})[];
};
export declare function simulatorCommandTextOutput(payload: SimulatorPayload): {
text: string;
screenshot?: {
name: string;
base64: string;
};
};
export declare function simulatorStartOptions(options: SimulatorCommandOptions & {
buildJob?: string;
}): SimulatorCommandOptions;
export declare function writeSimulatorScreenshot(filePath: string, base64: string): void;
export declare function simulatorTextOutput(data: {
id?: string;
url?: string;
status?: string;
} | undefined): string;
export declare function startSimulatorCommand(appId: string | undefined, options: SimulatorCommandOptions & {
buildJob?: string;
}): Promise<void>;
export declare function stopSimulatorCommand(sessionId: string | undefined, appId: string | undefined, options: SimulatorCommandOptions): Promise<void>;
export declare function getSimulatorCommand(sessionId: string | undefined, appId: string | undefined, options: SimulatorCommandOptions): Promise<void>;
export declare function sendSimulatorCommand(deviceCommand: string | undefined, sessionId: string | undefined, appId: string | undefined, options: SimulatorCommandOptions): Promise<void>;