@onboardbase/cli
Version:
[](https://www.npmjs.com/package/@onboardbase/cli) [](https://www.npmjs.com/package/@onboardbase/cli) [ • 6.49 kB
TypeScript
import { ChildProcess } from "child_process";
export declare const executeCommandUsingChildProcessExec: (command: string, env?: {
[key: string]: string;
}) => Promise<{
stdout: string;
stderr: string;
}>;
export declare const executeCommand: (command: string, envs: {
[key: string]: string;
}, logProcess?: boolean, stdio?: {
stdio: false;
}) => ChildProcess;
export declare const isExist: (filePath: string) => boolean;
export declare const getEnvironmentId: (project: string, environment: string, accessToken: string) => Promise<string>;
export declare const fetchRawSecretsIncludingSecretProperties: (project: string, environment: string, deviceToken: string) => Promise<{
env: {
[key: string]: string;
};
user: any;
accessToken: any;
environmentId: any;
}>;
export declare const fetchRawSecrets: (project: string, environment: string, cliToken: string) => Promise<{
env: {
[key: string]: any;
};
user: {
name: string;
id: string;
};
accessToken: string;
environmentId: string;
}>;
export declare const throwSecretsNotAccessibleError: (project: string, environment: string, logProcess?: boolean) => void;
/**
*
* @param project string
* @param environment string
* @param passphrase string
*
* This function retrive an access token for this request and fetches the token
* from onboardbase. It also create the backup file for caching purposed.
*
* This function returns a merged version of both local and online secrets.
*
*/
export declare const downloadSecrets: (project: string, environment: string, passphrase?: string, noSystemSecrets?: boolean, logProcess?: boolean, verbose?: boolean, shouldUseCache?: boolean, sourcePath?: string, deviceToken?: string) => Promise<{
user: {
[key: string]: string;
};
env: {
[key: string]: string;
};
}>;
export declare const downloadSecretsForRecommendation: (project: string, environment: string, accessToken: string) => Promise<any[]>;
export declare const addPrefixToEnvs: (prefix: string, envs: {
[key: string]: string;
}) => {
[key: string]: string;
};
export declare const getHomeDirectory: () => string;
export declare const getCurrentWorkingDirectory: () => string;
export declare const parseLocalSecrets: (secrets: {
[key: string]: string;
}[] | {
[key: string]: string;
}) => {
[key: string]: string;
};
export declare const getLocalSecrets: () => {
[key: string]: string;
};
export declare const updateLocalSecrets: (localSecrets: {
[key: string]: string;
}) => void;
export declare const getMachineID: () => Promise<string>;
export declare const getFallbackDirectory: () => string;
export declare const encryptSecrets: (secrets: string, passphrase?: string) => Promise<string>;
export declare const decryptPlainSecretAndReturnPlainValue: (secret: string, passphrase?: string) => Promise<string>;
export declare const decryptGenericSecret: (genericSecrets: string, passphrase?: string) => Promise<string | {
[key: string]: any;
}>;
export declare const decryptRawSecretsAndReturnAllProperties: (secrets: object[], passphrase?: string) => Promise<{
[key: string]: string;
}>;
export declare const decryptSecrets: (secrets: object[], passphrase?: string) => Promise<{
[key: string]: string;
}>;
export declare const createFallbackSecret: (project: string, secrets: string, environment?: string, passphrase?: string) => Promise<void>;
export declare const getFallbackSecret: (project: string, environment?: string, passphrase?: string) => Promise<{
[key: string]: string;
}>;
export declare const deleteRecursiveFiles: (file: RegExp) => Promise<void>;
export declare const deleteFallbackSecret: (project: string) => Promise<void>;
export declare const handleSocketConnection: (project: string, environment: string, userEmail: string) => any;
export declare const recheckUserAccess: (project: string, environment: string) => Promise<void>;
export declare const checkProjectCacheStatus: (project: string, environment: string) => Promise<boolean>;
export declare const generateRsaKeys: () => {
publicKey: string;
privateKey: string;
};
export declare const rsaDecryptSecret: (data: string, privateKey: string) => string;
export declare const getFrontendEncryptionKey: () => string;
export declare const aesDecryptSecret: (secrets: object[]) => Promise<{
[key: string]: string;
}>;
export declare const rsaEncryptSecret: (data: string, publicKey: string) => string;
export declare const encryptWithAESAndRSA: (rsaPublicKey: string, secrets: string) => Promise<string>;
export declare const formatDate: (date: string, sec?: any) => string;
export declare const removeDuplicateSecrete: (data: Object[]) => any[];
export declare const duplicateExistingSecretAndUpdateEnvironment: (project: string, environmentToDuplicateFrom: string, environmentToUpdate: string, cliToken: string) => Promise<void>;
export declare const uploadSecretsToOnboardbase: (currentProject: string, currentEnvironment: string, parsedJSON: Object, deviceToken: string, excludeFromExistingSecrets?: string[], action?: "DELETE" | "UPDATE" | "CREATE" | "DUPLICATE", accessToken?: string) => Promise<void>;
export declare const parseObjectToEnv: (env: {
[key: string]: string;
}) => string;
export declare const parseEnvContentToObject: (envFileContent: string) => {};
export declare const downloadTarballs: (url: string, filePath: string) => Promise<string>;
export declare const getLatestCliVersion: () => Promise<{
latest: string;
}>;
/**
* Keep a record of the current project information, the current path, the team that
* owns the project, the user info & the last time they ran the `onboardbase build` command
*/
export declare const createProjectLogTable: (user: {
email: string;
}, team: {
id: string;
name: string;
}, project: {
id: string;
}) => void;
export declare const getPathToServiceFiles: () => string;
export declare const isOnboardbaseServiceInstalled: () => boolean;
export declare const isSudoUser: () => boolean;
export declare const isUnix: () => boolean;
export declare const makeRandomId: (length: number) => string;
export declare const isDirectoryWritable: (path: string) => Promise<boolean>;
export declare const getShellRc: () => string;
export declare const isValidURL: (url: string) => boolean;
export declare const isAPartialUrl: (sourcePath: string) => boolean;
export declare const isJSON: (data: string) => boolean;