@capgo/cli
Version:
A CLI to upload to capgo servers
28 lines (27 loc) • 1.08 kB
TypeScript
import type { SaveKeyOptions } from '../auth/session';
interface BrowserLoginOptions extends SaveKeyOptions {
local: boolean;
}
interface BrowserLoginEvent {
channel: 'user-login';
event: 'User CLI login';
tracking_version: 2;
org_id: string;
description: string;
notifyConsole: true;
notify: false;
}
interface BrowserLoginDependencies {
createSession: () => string;
openUrl: (url: string) => Promise<unknown>;
promptForKey: () => Promise<string | undefined>;
validateKey: (key: string, options: SaveKeyOptions) => Promise<{
userId: string;
}>;
listOrganizationIds: (key: string, options: BrowserLoginOptions) => Promise<string[]>;
sendEvent: (key: string, payload: BrowserLoginEvent) => Promise<void>;
writeUrl: (message: string) => void;
}
export declare function shouldStartInitBrowserLogin(resolvedKey: string | undefined, interactive: boolean): boolean;
export declare function loginInitInBrowser(options: BrowserLoginOptions, overrides?: Partial<BrowserLoginDependencies>): Promise<string>;
export {};