UNPKG

@capgo/cli

Version:
67 lines (66 loc) • 3.33 kB
import type { CapgoClient } from '../utils'; import type { AppRow } from '../types/api'; import type { CliPreflightResult } from './preflight'; export declare function checkAppExists(apikey: string, appid: string, options?: { apiHost?: string; }, silent?: boolean): Promise<boolean>; export type PendingOnboardingApp = Pick<AppRow, 'app_id' | 'name' | 'icon_url' | 'need_onboarding' | 'existing_app' | 'ios_store_url' | 'android_store_url'>; export type ExistingOrganizationApp = Pick<AppRow, 'app_id' | 'name' | 'owner_org' | 'need_onboarding'>; export declare function listPendingOnboardingApps(apikey: string, orgId: string, options?: { apiHost?: string; }): Promise<PendingOnboardingApp[]>; export declare function findAppInOrganization(apikey: string, orgId: string, appId: string, options?: { apiHost?: string; }): Promise<ExistingOrganizationApp | null>; export declare function completePendingOnboardingApp(_client: CapgoClient, orgId: string, appId: string, apikey: string, options?: { apiHost?: string; }): Promise<void>; export interface AppOnboardingProgressPatch { source?: 'manual' | 'cli' | 'mcp' | 'ai'; outcome?: 'in_progress' | 'completed' | 'skipped' | 'switched_to_manual'; steps?: Record<string, { status: 'done' | 'skipped'; at?: string; }>; } export declare function reportAppOnboardingProgress(apikey: string, appId: string, onboarding: AppOnboardingProgressPatch, options?: { apiHost?: string; }): Promise<void>; /** * Check multiple app IDs at once for batch validation (e.g., for suggestions) */ export declare function checkAppIdsExist(apikey: string, appids: string[], options?: { apiHost?: string; }): Promise<{ appid: string; exists: boolean; }[]>; /** * Fail unless the org 2FA policy lets this key act on the app. Returns the preflight * result (user and org ids) so callers need no extra lookup; null when Capgo was unreachable. */ export declare function check2FAComplianceForApp(client: CapgoClient, appid: string, silent?: boolean): Promise<CliPreflightResult | null>; /** * Fail unless the app exists for this key and the key holds `requiredPermissionKey` * (2FA policy included unless `skip2FACheck`). One backend preflight call; its result * carries the app's org id and the key's user id. The result is null only when Capgo was * unreachable and the check is non-blocking; with `skip2FACheck` a network failure throws. */ export declare function checkAppExistsAndHasPermissionOrgErr(client: CapgoClient, _apikey: string, appid: string, requiredPermissionKey: string, silent?: boolean, skip2FACheck?: boolean, channelId?: number | null): Promise<CliPreflightResult | null>; export type { AppOptions as Options } from '../schemas/app'; export declare const newIconPath = "assets/icon.png"; export declare function resolveAppSetIconPath(explicitIcon?: string): string | undefined; export declare function getAppIconStoragePath(organizationUid: string, appId: string): string; export interface UploadAppIconResult { path?: string; conflict?: boolean; error?: Error | null; } export declare function uploadAppIconHttp(apikey: string, params: { appId: string; orgId: string; contentBase64: string; contentType: string; upsert?: boolean; apiHost?: string; }): Promise<UploadAppIconResult>;