salesforce-alm
Version:
This package contains tools, and APIs, for an improved salesforce.com developer experience.
107 lines (106 loc) • 3.79 kB
TypeScript
import { Config as CoreConfig } from '@salesforce/core';
/**
* Represents a config json file in the state folder that consumers can interact with.
*
* TODO Extract out
* TODO Make async. Has huge implications on source*.js files
* TODO remove config with workspace.js in sfdx-core
*/
declare class StateFile {
[property: string]: any;
constructor(config: any, filePath: any, contents?: {});
_read(filePath: any): any;
_write(filePath: any, contents: any): void;
_exist(filePath: any): any;
_delete(filePath: any): any;
read(): any;
write(newContents: any): any;
exist(): any;
delete(): any;
backup(): void;
revert(): any;
}
/**
* @deprecated The functionality is moving to sfdx-core
*/
declare class Org {
[property: string]: any;
/**
* Org types that can be set as a default for local and global configs.
* All commands target USERNAME, except commands that specify a different
* default, like org:create specifing DEVHUB has a default.
*/
static Defaults: {
DEVHUB: string;
USERNAME: string;
list(): string[];
};
/**
* Construct a new org. No configuration is initialized at this point. To
* get any auth data, getConfig must first be called which will try to get
* the default org of the given type unless the setName method is called.
* Any calls to org.force will call getConfig.
*
* @param {Force} force The force api
* @param {string} type The type of org for the CLI. This is used to store
* and find defaults for the project.
* @constructor
*/
constructor(force?: any, type?: string);
retrieveMaxApiVersion(): any;
/**
* Gets the name of this scratch org.
*/
getName(): any;
resolveDefaultName(): Promise<void>;
/**
* Sets the name of this scratch org. After setting the name any call to getConfig will result in the org associated
* with $HOME/.sfdx/[name].json being returned.
*
* @param name - the name of the org.
*/
setName(name: any): void;
resolvedAggregator(): Promise<any>;
initializeConfig(): Promise<CoreConfig>;
getDataPath(filename?: any): string;
/**
* Clean all data files in the org's data path, then remove the data directory.
* Usually <workspace>/.sfdx/orgs/<username>
*/
cleanData(orgDataPath: any): void;
/**
* Get the full path to the file storing the maximum revision value from the last valid pull from workspace scratch org
*
* @param wsPath - The root path of the workspace
* @returns {*}
*/
getMaxRevision(): StateFile;
/**
* Get the full path to the file storing the workspace source path information
*
* @param wsPath - The root path of the workspace
* @returns {*}
*/
getSourcePathInfos(): StateFile;
/**
* Returns a promise to retrieve the ScratchOrg configuration for this workspace.
*
* @returns {BBPromise}
*/
getConfig(): any;
getFileName(): string;
/**
* Returns a promise to save a valid workspace scratch org configuration to disk.
*
* @param configObject - The object to save. If the object isn't valid an error will be thrown.
* { orgId:, redirectUri:, accessToken:, refreshToken:, instanceUrl:, clientId: }
* @param saveAsDefault {boolean} - whether to save this org as the default for this workspace.
* @returns {BBPromise.<Object>} Not the access tokens will be encrypted. Call get config to get decrypted access tokens.
*/
saveConfig(configObject: any, saveAsDefault?: any): any;
/**
* @deprecated See Org.ts in sfdx-core
*/
static create(username?: any, defaultType?: any): Promise<Org>;
}
export = Org;