@mesh-tech/mesh-cli
Version:
CLI for Mesh platform development utilities
54 lines (53 loc) • 2.47 kB
TypeScript
export declare const REGISTRY_LOGIN_FIX = "mesh registry login";
export declare const REGISTRY_LOGIN_FIX_AWS = "mesh registry login --profile mesh-dev";
export declare function registryLoginFix(): string;
export declare const SSO_LOGIN_FIX = "aws sso login --sso-session=mesh # or: pnpm sso";
export declare const SSO_SESSION_SNIPPET = "[sso-session mesh]\nsso_start_url = https://trabian.awsapps.com/start\nsso_region = us-east-1\nsso_registration_scopes = sso:account:access";
export declare function homeNpmrcPath(): string;
export interface NpmrcRegistryAuth {
endpoint: string;
token: string;
}
export declare function parseNpmrcRegistryAuth(content: string): NpmrcRegistryAuth | null;
export declare function findUnscopedCodeArtifactRegistry(content: string): string | null;
export declare function stripUnscopedCodeArtifactRegistry(content: string): {
content: string;
removed: string | null;
};
export declare function npmrcAuthKeyForEndpoint(endpoint: string): string;
export declare function upsertNpmrcLines(content: string, entries: ReadonlyArray<{
key: string;
value: string;
}>): string;
export type RegistryTokenState = "fresh" | "expired" | "missing" | "unreachable";
export declare function classifyRegistryStatus(status: number): "fresh" | "expired";
export interface RegistryProbe {
state: RegistryTokenState;
detail?: string;
}
export declare function probeRegistryToken(opts?: {
npmrcPath?: string;
timeoutMs?: number;
fetchFn?: typeof fetch;
}): Promise<RegistryProbe>;
export interface RegistryPreflight {
state: "valid" | "missing" | "expired" | "unreachable";
email?: string;
fix: string;
detail?: string;
}
export declare function classifyRegistryPreflight(probe: RegistryProbe, session: {
email: string;
} | null): RegistryPreflight;
export declare function registryPreflight(opts?: {
npmrcPath?: string;
timeoutMs?: number;
fetchFn?: typeof fetch;
}): Promise<RegistryPreflight>;
export declare function isNpmAuthErrorText(text: string): boolean;
export declare function isNpmAuthError(err: unknown): boolean;
export declare function isExpiredAwsTokenMessage(message: string): boolean;
export declare function parseSsoSessionNames(content: string): string[];
export declare function awsConfigHasProfile(content: string, profile: string): boolean;
export declare function readAwsConfig(): string;
export declare function appUsesMeshPackages(appRoot: string): boolean;