UNPKG

@salesforce/core

Version:

Core libraries to interact with SFDX projects, orgs, and APIs.

57 lines (56 loc) 1.97 kB
import { JsonMap } from '@salesforce/ts-types'; import { Org } from './org'; import { ScratchOrgInfo } from './scratchOrgInfoApi'; export declare enum RequestStatus { Pending = "Pending", InProgress = "InProgress", Succeeded = "Succeeded", SucceededPartial = "SucceededPartial", Failed = "Failed", Canceling = "Canceling", Canceled = "Canceled" } export interface ObjectSetting extends JsonMap { sharingModel?: string; defaultRecordType?: string; } export interface BusinessProcessFileContent extends JsonMap { fullName: string; isActive: boolean; values: [ { fullName: string; default?: boolean; } ]; } /** * Helper class for dealing with the settings that are defined in a scratch definition file. This class knows how to extract the * settings from the definition, how to expand them into a MD directory and how to generate a package.xml. */ export default class SettingsGenerator { private settingData?; private objectSettingsData?; private logger; private writer; private shapeDirName; constructor(); /** extract the settings from the scratch def file, if they are present. */ extract(scratchDef: ScratchOrgInfo): Promise<void>; /** True if we are currently tracking setting or object setting data. */ hasSettings(): boolean; /** Create temporary deploy directory used to upload the scratch org shape. * This will create the dir, all of the .setting files and minimal object files needed for objectSettings */ createDeploy(): Promise<void>; /** * Deploys the settings to the org. */ deploySettingsViaFolder(scratchOrg: Org, apiVersion: string): Promise<void>; private writeObjectSettingsIfNeeded; private writeSettingsIfNeeded; private createPackageXml; private createObjectFileContent; private createRecordTypeFileContent; private createBusinessProcessFileContent; }