Adds a username to the user config for this org. For convenience this
object is returned.
const org: Org = await Org.create({
connection: await Connection.create({
authInfo: await AuthInfo.create('foo@example.com')
})
});
const userAuth: AuthInfo = await AuthInfo.create({
username: 'bar@example.com'
});
await org.addUsername(userAuth);
The AuthInfo for the username to add.
Check that this org is a scratch org by asking the dev hub if it knows about it.
Throws SfError{ name: 'NotADevHubError' } Not a Dev Hub.
Throws SfError{ name: 'NoResultsError' } No results.
Optional
devHubUsernameOrAlias: stringThe username or alias of the dev hub org.
Clean all data files in the org's data path. Usually
Optional
orgDataPath: stringA relative path other than "orgs/".
Should the remove org operations throw an error on failure?
SandboxRequest options to create the sandbox with
the name of the sandbox that your new sandbox will be based on
Wait: The amount of time to wait before timing out, defaults to 0, Interval: The time interval between polling defaults to 30 seconds
Optional
interval?: DurationOptional
wait?: Durationthe newly created sandbox process object
create a sandbox from a production org 'this' needs to be a production org with sandbox licenses available
SandboxRequest options to create the sandbox with
Wait: The amount of time to wait before timing out, Interval: The time interval between polling
Optional
async?: booleanOptional
interval?: DurationOptional
wait?: DurationWill delete 'this' instance remotely and any files locally
username or Org that 'this.devhub' or 'this.production' refers to. AKA a DevHub for a scratch org, or a Production Org for a sandbox
Returns true
if the org is a Dev Hub.
Use a cached value. If the cached value is not set, then check access to the ScratchOrgInfo object to determine if the org is a dev hub.
Ignore the cached value and go straight to the server which will be required if the org flips on the dev hub after the value is already cached locally.
Returns true
if the org is a sandbox.
Use a cached value. If the cached value is not set, then check
Organization.IsSandbox == true && Organization.TrialExpirationDate == null
using Org.retrieveOrganizationInformation.
Returns true
if the org is a scratch org.
Use a cached value. If the cached value is not set, then check
Organization.IsSandbox == true && Organization.TrialExpirationDate != null
using Org.retrieveOrganizationInformation.
Returns for the config aggregator.
Returns the JSForce connection for the org. side effect: If you pass it an apiVersion, it will set it on the Org so that future calls to getConnection() will also use that version.
Optional
apiVersion: stringThe API version to use for the connection.
get the sandbox config for the given orgId
{string} orgId of the sandbox
Returns true
if the org is a Dev Hub.
Note This relies on a cached value in the auth file. If that property is not cached, this method will always return false even if the org is a dev hub. If you need accuracy, use the Org.determineIfDevHubOrg method.
Returns true
if the org is a scratch org.
Note This relies on a cached value in the auth file. If that property is not cached, this method will always return false even if the org is a scratch org. If you need accuracy, use the Org.determineIfScratch method.
query SandboxProcess via Id
SandboxProcessId to query for
query SandboxProcess via SandboxOrganization (sandbox Org ID)
SandboxOrganization ID to query for
query SandboxProcess via SandboxInfoId
SandboxInfoId to query for
query SandboxProcess via sandbox name
SandboxName to query for
Refresh (update) a sandbox from a production org. 'this' needs to be a production org with sandbox licenses available
SandboxInfo to update the sandbox with
Wait: The amount of time to wait before timing out, Interval: The time interval between polling
Optional
async?: booleanOptional
interval?: DurationOptional
wait?: DurationRemoves a username from the user config for this object. For convenience this
object is returned.
Throws SfError{ name: 'MissingAuthInfoError' } Auth info is missing.
The AuthInfo containing the username to remove.
Resume a sandbox create or refresh from a production org.
this
needs to be a production org with sandbox licenses available.
SandboxRequest options to create/refresh the sandbox with
Wait: The amount of time to wait (default: 0 minutes) before timing out, Interval: The time interval (default: 30 seconds) between polling
Optional
async?: booleanOptional
interval?: DurationOptional
wait?: DurationRetrieves the highest api version that is supported by the target server instance. If the apiVersion configured for Sfdx is greater than the one returned in this call an api version mismatch occurs. In the case of the CLI that results in a warning.
Retrieve a handful of fields from the Organization table in Salesforce. If this does not have the
data you need, just use Connection.singleRecordQuery with SELECT <needed fields> FROM Organization
.
org information
Reports sandbox org creation status. If the org is ready, authenticates to the org.
Wait: The amount of time to wait before timing out, Interval: The time interval between polling
Optional
interval?: DurationOptional
wait?: Durationthe sandbox process object
Creates a scratchOrg 'this' needs to be a valid dev-hub
set the sandbox config related to this given org
{string} orgId of the sandbox
{SandboxFields} config of the sandbox
Some organization information is locally cached, such as if the org name or if it is a scratch org. This method populates/updates the filesystem from information retrieved from the org.
Provides a way to manage a locally authenticated Org.
See AuthInfo
See Connection
See Aliases
See Config
See https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_usernames_orgs.htm