@amplitude/ampli
Version:
Amplitude CLI
102 lines (101 loc) • 3.11 kB
TypeScript
import * as Conf from 'conf';
import { Data, Token } from 'client-oauth2';
import { Runtime, Zone } from '../types';
export declare type Workspace = {
id: string;
name: string;
};
export declare type UserOrg = {
id: string;
name: string;
workspaces: Workspace[];
};
export declare type UserId = {
id: string;
zone: Zone;
};
export declare type User = {
id: string;
firstName: string;
lastName: string;
email: string;
zone: Zone;
orgs: UserOrg[];
};
export declare class Settings {
private createUserConfig;
private createProjectConfig;
private createUserTokensConfig;
private userConfig;
private projectConfig;
private userTokensConfig;
init(createUserConfig: () => Conf, createProjectConfig: () => Conf, createUserTokensConfig: (() => Conf) | undefined): void;
get user(): Conf;
get project(): Conf;
get userTokens(): Conf;
private set;
private get;
private setUserValue;
private setProjectValue;
private getUserValue;
private getProjectValue;
private hasProjectValue;
private unsetProjectValue;
projectUser(): User | undefined;
getOrgId(): any;
setOrgId(orgId: string): void;
getWorkspaceId(): any;
setWorkspaceId(workspaceId: string): void;
setUser(user: User): void;
getSourceId(): any;
setSourceId(sourceId: string): void;
getRuntime(allRuntimes: Runtime[]): Runtime | undefined;
getRawRuntime(): {
code: string | undefined;
platform: string | undefined;
language: string | undefined;
sdk: string | undefined;
};
setRuntime(runtime: Runtime): void;
getBranch(): any;
setBranch(branch: string): void;
unsetBranch(): void;
getVersion(): string;
setVersion(version: string): void;
getVersionId(): string;
setVersionId(versionId: string): void;
getPath(): string;
setPath(projectPath: string): void;
getZone(): Zone | undefined;
setZone(zone: Zone): void;
getOmitApiKeys(): boolean | undefined;
setOmitApiKeys(omitApiKeys: boolean): void;
getSourceDirs(): string[] | undefined;
setSourceDirs(sourceDirs: string[]): void;
getInstanceNames(): string[] | undefined;
setInstanceNames(instanceNames: string[]): void;
hasOAuthToken(): boolean;
getOAuthToken(userId?: UserId): {
userId: UserId | undefined;
token: Data;
};
setOAuthToken(userId: UserId, accessToken: Token): void;
users(zone?: string, includeExpired?: boolean): User[];
deleteUserData(user: User): void;
}
export declare function initSettings(config?: {
userDir: string;
projectDir: string;
userTokensDir?: string;
}): Settings;
export declare function getSettings(): Settings;
export declare function userConfigPaths(dir: string): {
legacy: string;
current: string;
};
export declare function projectConfigPaths(dir: string): {
legacy: string;
current: string;
};
export declare function deserializeConfig(text: string): {};
export declare function userKey(userId: string, zone: Zone, key: string): string;