@capgo/cli
Version:
A CLI to upload to capgo servers
23 lines (22 loc) • 1.1 kB
TypeScript
import type { Command } from 'commander';
type CliPosthogExceptionKind = 'unhandled_error';
interface CapturePosthogExceptionPayload {
error: unknown;
functionName: string;
kind: CliPosthogExceptionKind;
status?: number;
}
export declare function isTruthyEnvValue(value: string | undefined): boolean;
export declare function getPosthogToken(): string | undefined;
/**
* Expected user-configuration failures: a bad or missing API key (401
* `invalid_apikey` / `no_key_provided`) or an app that has not been created
* yet. These are real user errors, not CLI bugs — they are still counted via
* `trackCommandFailed`, but must NOT be sent to error tracking as exceptions.
*/
export declare function isExpectedUserError(error: unknown): boolean;
export declare function shouldCapturePosthogException(error: unknown): boolean;
export declare function getCommandPath(command: Command): string;
export declare function getInstallId(configDir?: string): string;
export declare function capturePosthogException(payload: CapturePosthogExceptionPayload): Promise<boolean>;
export {};