UNPKG

@capgo/cli

Version:
45 lines (44 loc) 2.44 kB
import type { TailEffectDeps } from '../tail/flow.js'; import type { AppflowProgress } from './types.js'; /** * The tail-facing progress shape. The shared tail reads `appId` (required), * plus the tail-input fields the appflow driver records on `AppflowProgress` * (setupMode / ciSecretTarget / selectedPackageManager / buildScriptChoice / * envExportTargetPath). `AppflowProgress` carries every one of those as an * optional field, so it satisfies `TailEffectProgress` once `appId` is present. */ export type AppflowTailProgress = AppflowProgress & { appId: string; }; /** * Build the saved-credential SHAPE for the chosen platform from the migrated * Capgo creds. The migration already mapped Appflow's signing/distribution into * the Capgo field names (progress.ios / progress.android are Record<string,string>), * so the "build" here is just selecting the right platform map. Throws on an empty * map — the same fail-fast guard the native builders use. */ export declare function buildAppflowSavedCredentials(progress: AppflowTailProgress, platform: 'ios' | 'android'): Record<string, string>; export interface AppflowTailDepsOptions { /** Capgo API key flag (overrides the saved key, like the native drivers). */ apikey?: string; /** Gateway override threaded into the build request options. */ supaHost?: string; /** Builder journey id threaded into the build request options. */ journeyId?: string; /** Build VIEWER sink — every requesting-build line streams here (fullscreen pane). */ onBuildOutput?: (line: string) => void; /** Side-log sink (✔ Credentials saved, ✔ Uploaded …). */ onLog?: (message: string, color?: string) => void; /** The driver-held transient threaded back into each effect (NEVER persisted). */ carried?: TailEffectDeps<AppflowTailProgress>['carried']; signal?: AbortSignal; } /** * Adapt the appflow flow's collected state into a platform-neutral * `TailEffectDeps` for `platform`, reusing the SAME shared CLI building blocks * the iOS/Android drivers inject. Mirrors ios/flow.ts's `toTailDeps` 1:1; the * only appflow-specific pieces are the credential SHAPE (selected straight from * the migrated maps) and the thin no-disk persistence (the migration keeps no * progress.json). */ export declare function toAppflowTailDeps(platform: 'ios' | 'android', options?: AppflowTailDepsOptions): TailEffectDeps<AppflowTailProgress>;