@salesforce/plugin-org 1.10.0 → 1.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,44 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.11.2](https://github.com/salesforcecli/plugin-org/compare/v1.11.1...v1.11.2) (2022-02-21)
6
+
7
+ ### Bug Fixes
8
+
9
+ - only local config ([54e7b93](https://github.com/salesforcecli/plugin-org/commit/54e7b934008bae5a12934932c239c6ff59e2f22e))
10
+ - try to create local config first ([f84c64f](https://github.com/salesforcecli/plugin-org/commit/f84c64f46ed5141bab3167cba04f75ad4e59484b))
11
+ - use Aliases.parseAndUpdate ([0b1860f](https://github.com/salesforcecli/plugin-org/commit/0b1860fb1b535ff2b5a84e4dcb1b691c4b85cdba))
12
+
13
+ ### [1.11.1](https://github.com/salesforcecli/plugin-org/compare/v1.11.0...v1.11.1) (2022-01-28)
14
+
15
+ ### Features
16
+
17
+ - scratchOrg create ([955667e](https://github.com/salesforcecli/plugin-org/commit/955667e2d3e7e6444903c89ad065b9161444b22b))
18
+
19
+ ### Bug Fixes
20
+
21
+ - add initial org:beta:create command ([1cf6bdb](https://github.com/salesforcecli/plugin-org/commit/1cf6bdb1399e20e2fc72a9f0c15080e95b26e219))
22
+ - add initial org:beta:create command ([d2a89e2](https://github.com/salesforcecli/plugin-org/commit/d2a89e24a956136bb11d161618234b33842787e7))
23
+ - add org:beta:create command for sandboxes, UTs ([654ca50](https://github.com/salesforcecli/plugin-org/commit/654ca50ee2192342c6df382e9e20f8b33f9fd73f))
24
+ - add sandbox create/open/delete NUT ([60c81aa](https://github.com/salesforcecli/plugin-org/commit/60c81aa6330b87cecb06a84cca2994c7d466c3f5))
25
+ - bump testkit to fix yarn.lock ([454afbd](https://github.com/salesforcecli/plugin-org/commit/454afbd6649e2ceaabdaeeb27ce9a3d5e5f9c813))
26
+ - disable nuts-on-windows w/latest ([0bf02b1](https://github.com/salesforcecli/plugin-org/commit/0bf02b191d2ef039c5800ef233bba142b82bf975))
27
+ - manual release for beta:org:create ([a33137f](https://github.com/salesforcecli/plugin-org/commit/a33137f04602bb36033c73132098e311206ebafe))
28
+ - merge conflicts ([cd02453](https://github.com/salesforcecli/plugin-org/commit/cd024538fe2616fe3b46ef477d268e41f2516bea))
29
+ - use compatible types from command/test ([a4de0b0](https://github.com/salesforcecli/plugin-org/commit/a4de0b06be0f899b07a6651b61febf6732069ef0))
30
+
31
+ ## [1.11.0](https://github.com/salesforcecli/plugin-org/compare/v1.10.1...v1.11.0) (2021-12-02)
32
+
33
+ ### Features
34
+
35
+ - bump deps ([fbd44e7](https://github.com/salesforcecli/plugin-org/commit/fbd44e7872c691c290a62f8ad739e323854f8de0))
36
+
37
+ ### [1.10.1](https://github.com/salesforcecli/plugin-org/compare/v1.10.0...v1.10.1) (2021-12-01)
38
+
39
+ ### Bug Fixes
40
+
41
+ - org:delete scratch org + sandboxes ([#228](https://github.com/salesforcecli/plugin-org/issues/228)) ([ab4b7a2](https://github.com/salesforcecli/plugin-org/commit/ab4b7a234c22d226aa148002daf578ee8a7975e6))
42
+
5
43
  ## [1.10.0](https://github.com/salesforcecli/plugin-org/compare/v1.9.2...v1.10.0) (2021-11-30)
6
44
 
7
45
  ### Features
package/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2018, Salesforce.com, Inc.
1
+ Copyright (c) 2022, Salesforce.com, Inc.
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
package/README.md CHANGED
@@ -78,20 +78,120 @@ sfdx plugins
78
78
 
79
79
  <!-- commands -->
80
80
 
81
+ - [`sfdx force:org:beta:create [name=value...] [-t scratch|sandbox] [-f <filepath>] [-n] [-c] [-i <string>] [-s] [-a <string>] [-w <minutes>] [-d <integer>] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forceorgbetacreate-namevalue--t-scratchsandbox--f-filepath--n--c--i-string--s--a-string--w-minutes--d-integer--v-string--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
82
+ - [`sfdx force:org:delete [-p] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forceorgdelete--p--v-string--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
81
83
  - [`sfdx force:org:display [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forceorgdisplay--u-string---apiversion-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
82
84
  - [`sfdx force:org:list [--all] [-p --clean] [--skipconnectionstatus] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forceorglist---all--p---clean---skipconnectionstatus---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
83
85
  - [`sfdx force:org:open [-b <string> | -r] [-p <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forceorgopen--b-string---r--p-string--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
84
86
 
85
- ## `sfdx force:org:display [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
87
+ ## `sfdx force:org:beta:create [name=value...] [-t scratch|sandbox] [-f <filepath>] [-n] [-c] [-i <string>] [-s] [-a <string>] [-w <minutes>] [-d <integer>] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
86
88
 
87
- get the description for the current or target org
89
+ create a scratch or sandbox org
90
+
91
+ ```
92
+ USAGE
93
+ $ sfdx force:org:beta:create [name=value...] [-t scratch|sandbox] [-f <filepath>] [-n] [-c] [-i <string>] [-s] [-a
94
+ <string>] [-w <minutes>] [-d <integer>] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
95
+ trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
96
+
97
+ OPTIONS
98
+ -a, --setalias=setalias alias for the created org
99
+
100
+ -c, --noancestors do not include second-generation
101
+ package ancestors in the scratch org
102
+
103
+ -d, --durationdays=durationdays duration of the scratch org (in
104
+ days) (default:7, min:1, max:30)
105
+
106
+ -f, --definitionfile=definitionfile path to an org definition file
107
+
108
+ -i, --clientid=clientid connected app consumer key; not
109
+ supported for sandbox org creation
110
+
111
+ -n, --nonamespace create the scratch org with no
112
+ namespace
113
+
114
+ -s, --setdefaultusername set the created org as the default
115
+ username
116
+
117
+ -t, --type=(scratch|sandbox) [default: scratch] type of org to
118
+ create
119
+
120
+ -u, --targetusername=targetusername username or alias for the target
121
+ org; overrides default target org
122
+
123
+ -v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
124
+ org; overrides default dev hub org
125
+
126
+ -w, --wait=wait [default: 6 minutes] the streaming
127
+ client socket timeout (in minutes)
128
+
129
+ --apiversion=apiversion override the api version used for
130
+ api requests made by this command
131
+
132
+ --json format output as json
133
+
134
+ --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
135
+ this command invocation
136
+
137
+ DESCRIPTION
138
+ Creates a scratch org or a sandbox org using the values specified in a configuration file or key=value pairs that you
139
+ specify on the command line. Values specified on the command line override values in the configuration file. Specify a
140
+ configuration file or provide key=value pairs while creating a scratch org or a sandbox. When creating scratch orgs,
141
+ —targetdevhubusername (-v) must be a Dev Hub org. When creating sandboxes, the --targetusername (-u) must be a
142
+ production org with sandbox licenses. The —type (-t) is required if creating a sandbox.
143
+
144
+ EXAMPLES
145
+ $ sfdx force:org:create -f config/enterprise-scratch-def.json -a MyScratchOrg
146
+ $ sfdx force:org:create edition=Developer -a MyScratchOrg -s -v devHub
147
+ $ sfdx force:org:create -f config/enterprise-scratch-def.json -a ScratchOrgWithOverrides
148
+ username=testuser1@mycompany.org
149
+ $ sfdx force:org:create -t sandbox -f config/dev-sandbox-def.json -a MyDevSandbox -u prodOrg
150
+ ```
151
+
152
+ _See code: [src/commands/force/org/beta/create.ts](https://github.com/salesforcecli/plugin-org/blob/v1.11.1/src/commands/force/org/beta/create.ts)_
153
+
154
+ ## `sfdx force:org:delete [-p] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
155
+
156
+ mark a scratch or sandbox org for deletion
88
157
 
89
158
  ```
159
+ USAGE
160
+ $ sfdx force:org:delete [-p] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
161
+ trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
162
+
163
+ OPTIONS
164
+ -p, --noprompt no prompt to confirm deletion
165
+
166
+ -u, --targetusername=targetusername username or alias for the target
167
+ org; overrides default target org
168
+
169
+ -v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
170
+ org; overrides default dev hub org
171
+
172
+ --apiversion=apiversion override the api version used for
173
+ api requests made by this command
174
+
175
+ --json format output as json
176
+
177
+ --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
178
+ this command invocation
179
+
180
+ DESCRIPTION
181
+ To mark the org for deletion without being prompted to confirm, specify --noprompt.
182
+
183
+ EXAMPLES
184
+ $ sfdx force:org:delete -u me@my.org
185
+ $ sfdx force:org:delete -u MyOrgAlias -p
186
+ ```
187
+
188
+ _See code: [src/commands/force/org/delete.ts](https://github.com/salesforcecli/plugin-org/blob/v1.11.1/src/commands/force/org/delete.ts)_
189
+
190
+ ## `sfdx force:org:display [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
191
+
90
192
  get the description for the current or target org
91
- Output includes your access token, client Id, connected status, org ID, instance URL, username, and alias, if applicable.
92
- Use --verbose to include the SFDX auth URL. WARNING: The SFDX auth URL contains sensitive information, such as a refresh token that can be used to access an org. Don't share or distribute this URL or token.
93
- Including --verbose displays the sfdxAuthUrl property only if you authenticated to the org using auth:web:login (not auth:jwt:grant)
94
193
 
194
+ ```
95
195
  USAGE
96
196
  $ sfdx force:org:display [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel
97
197
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
@@ -126,15 +226,13 @@ EXAMPLES
126
226
  sfdx force:org:display -u TestOrg1 --json > tmp/MyOrgDesc.json
127
227
  ```
128
228
 
129
- _See code: [src/commands/force/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/v1.9.2/src/commands/force/org/display.ts)_
229
+ _See code: [src/commands/force/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/v1.11.1/src/commands/force/org/display.ts)_
130
230
 
131
231
  ## `sfdx force:org:list [--all] [-p --clean] [--skipconnectionstatus] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
132
232
 
133
233
  list all orgs you’ve created or authenticated to
134
234
 
135
235
  ```
136
- list all orgs you’ve created or authenticated to
137
-
138
236
  USAGE
139
237
  $ sfdx force:org:list [--all] [-p --clean] [--skipconnectionstatus] [--verbose] [--json] [--loglevel
140
238
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
@@ -164,19 +262,13 @@ EXAMPLES
164
262
  sfdx force:org:list --verbose --json > tmp/MyOrgList.json
165
263
  ```
166
264
 
167
- _See code: [src/commands/force/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/v1.9.2/src/commands/force/org/list.ts)_
265
+ _See code: [src/commands/force/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/v1.11.1/src/commands/force/org/list.ts)_
168
266
 
169
267
  ## `sfdx force:org:open [-b <string> | -r] [-p <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
170
268
 
171
269
  open your default scratch org, or another specified org
172
270
 
173
271
  ```
174
- open your default scratch org, or another specified org
175
- To open a specific page, specify the portion of the URL after "https://MyDomainName.my.salesforce.com/" as --path.
176
- For example, specify "--path lightning" to open Lightning Experience, or specify "--path /apex/YourPage" to open a Visualforce page.
177
- To generate a URL but not launch it in your browser, specify --urlonly.
178
- To open in a specific browser, use the --browser parameter. Supported browsers are "chrome", "edge", and "firefox". If you don't specify --browser, the org opens in your default browser.
179
-
180
272
  USAGE
181
273
  $ sfdx force:org:open [-b <string> | -r] [-p <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
182
274
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
@@ -205,7 +297,7 @@ DESCRIPTION
205
297
  Visualforce page.
206
298
  To generate a URL but not launch it in your browser, specify --urlonly.
207
299
  To open in a specific browser, use the --browser parameter. Supported browsers are "chrome", "edge", and "firefox". If
208
- you don't specify --browser, the org opens in your default browser.
300
+ you don't specify --browser, the org opens in your default browser.
209
301
 
210
302
  EXAMPLES
211
303
  sfdx force:org:open
@@ -215,6 +307,6 @@ EXAMPLES
215
307
  sfdx force:org:open -u me@my.org -b firefox
216
308
  ```
217
309
 
218
- _See code: [src/commands/force/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/v1.9.2/src/commands/force/org/open.ts)_
310
+ _See code: [src/commands/force/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/v1.11.1/src/commands/force/org/open.ts)_
219
311
 
220
312
  <!-- commandsstop -->
@@ -0,0 +1,27 @@
1
+ import { FlagsConfig, SfdxCommand } from '@salesforce/command';
2
+ import { AuthFields, SandboxProcessObject, ScratchOrgInfo } from '@salesforce/core';
3
+ export interface ScratchOrgProcessObject {
4
+ username?: string;
5
+ scratchOrgInfo: ScratchOrgInfo;
6
+ authFields?: AuthFields;
7
+ warnings: string[];
8
+ orgId: string;
9
+ }
10
+ export declare class Create extends SfdxCommand {
11
+ static readonly description: string;
12
+ static readonly examples: string[];
13
+ static readonly supportsDevhubUsername = true;
14
+ static readonly supportsUsername = true;
15
+ static readonly varargs = true;
16
+ static readonly flagsConfig: FlagsConfig;
17
+ protected readonly lifecycleEventNames: string[];
18
+ private sandboxAuth?;
19
+ run(): Promise<SandboxProcessObject | ScratchOrgProcessObject>;
20
+ private validateSandboxFlags;
21
+ private lowerToUpper;
22
+ private createSandboxRequest;
23
+ private createSandbox;
24
+ private readJsonDefFile;
25
+ private setAliasAndDefaultUsername;
26
+ private createScratchOrg;
27
+ }
@@ -0,0 +1,310 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2021, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.Create = void 0;
10
+ const os = require("os");
11
+ const fs = require("fs");
12
+ const command_1 = require("@salesforce/command");
13
+ const kit_1 = require("@salesforce/kit");
14
+ const core_1 = require("@salesforce/core");
15
+ const sandboxReporter_1 = require("../../../../shared/sandboxReporter");
16
+ core_1.Messages.importMessagesDirectory(__dirname);
17
+ const messages = core_1.Messages.loadMessages('@salesforce/plugin-org', 'create');
18
+ class Create extends command_1.SfdxCommand {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.lifecycleEventNames = ['postorgcreate'];
22
+ }
23
+ async run() {
24
+ this.logger.debug('Create started with args %s ', this.flags);
25
+ if (this.flags.type === core_1.OrgTypes.Sandbox) {
26
+ this.validateSandboxFlags();
27
+ return this.createSandbox();
28
+ }
29
+ else {
30
+ // default to scratch org
31
+ return this.createScratchOrg();
32
+ }
33
+ }
34
+ validateSandboxFlags() {
35
+ if (!this.flags.targetusername) {
36
+ throw core_1.SfdxError.create('@salesforce/plugin-org', 'create', 'requiresUsername');
37
+ }
38
+ if (this.flags.retry !== 0) {
39
+ throw core_1.SfdxError.create('@salesforce/plugin-org', 'create', 'retryIsNotValidForSandboxes');
40
+ }
41
+ if (this.flags.clientid) {
42
+ this.ux.warn(messages.getMessage('clientIdNotSupported', [this.flags.clientid]));
43
+ }
44
+ if (this.flags.nonamespace) {
45
+ this.ux.warn(messages.getMessage('noNamespaceNotSupported', [this.flags.nonamespace]));
46
+ }
47
+ if (this.flags.noancestors) {
48
+ this.ux.warn(messages.getMessage('noAncestorsNotSupported', [this.flags.noancestors]));
49
+ }
50
+ if (this.flags.durationdays) {
51
+ this.ux.warn(messages.getMessage('durationDaysNotSupported', [this.flags.durationdays]));
52
+ }
53
+ }
54
+ lowerToUpper(object) {
55
+ // the API has keys defined in capital camel case, while the definition schema has them as lower camel case
56
+ // we need to convert lower camel case to upper before merging options so they will override properly
57
+ Object.keys(object).map((key) => {
58
+ const upperCase = key.charAt(0).toUpperCase();
59
+ if (key.charAt(0) !== upperCase) {
60
+ const capitalKey = upperCase + key.slice(1);
61
+ object[capitalKey] = object[key];
62
+ delete object[key];
63
+ }
64
+ });
65
+ return object;
66
+ }
67
+ createSandboxRequest() {
68
+ this.logger.debug('Create Varargs: %s ', this.varargs);
69
+ let sandboxDefFileContents = this.readJsonDefFile();
70
+ let capitalizedVarArgs = {};
71
+ if (sandboxDefFileContents) {
72
+ sandboxDefFileContents = this.lowerToUpper(sandboxDefFileContents);
73
+ }
74
+ if (this.varargs) {
75
+ capitalizedVarArgs = this.lowerToUpper(this.varargs);
76
+ }
77
+ // varargs override file input
78
+ const sandboxReq = { SandboxName: undefined, ...sandboxDefFileContents, ...capitalizedVarArgs };
79
+ if (!sandboxReq.SandboxName) {
80
+ // sandbox names are 10 chars or less, a radix of 36 = [a-z][0-9]
81
+ // technically without querying the production org, the generated name could already exist, but the chances of that are lower than the perf penalty of querying and verifying
82
+ sandboxReq.SandboxName = `sbx${Date.now().toString(36).slice(-7)}`;
83
+ this.ux.warn(`No SandboxName defined, generating new SandboxName: ${sandboxReq.SandboxName}`);
84
+ }
85
+ if (!sandboxReq.LicenseType) {
86
+ throw core_1.SfdxError.create('@salesforce/plugin-org', 'create', 'missingLicenseType');
87
+ }
88
+ return sandboxReq;
89
+ }
90
+ async createSandbox() {
91
+ const prodOrg = await core_1.Org.create({ aliasOrUsername: this.flags.targetusername });
92
+ const lifecycle = core_1.Lifecycle.getInstance();
93
+ // register the sandbox event listeners before calling `prodOrg.createSandbox()`
94
+ // `on` doesn't support synchronous methods
95
+ // eslint-disable-next-line @typescript-eslint/require-await
96
+ lifecycle.on(core_1.SandboxEvents.EVENT_ASYNC_RESULT, async (results) => {
97
+ this.ux.log(messages.getMessage('sandboxSuccess', [results.Id, results.SandboxName, this.flags.targetusername]));
98
+ });
99
+ // eslint-disable-next-line @typescript-eslint/require-await
100
+ lifecycle.on(core_1.SandboxEvents.EVENT_STATUS, async (results) => {
101
+ this.ux.log(sandboxReporter_1.SandboxReporter.sandboxProgress(results));
102
+ });
103
+ // eslint-disable-next-line @typescript-eslint/require-await
104
+ lifecycle.on(core_1.SandboxEvents.EVENT_AUTH, async (results) => {
105
+ this.sandboxAuth = results;
106
+ });
107
+ lifecycle.on(core_1.SandboxEvents.EVENT_RESULT, async (results) => {
108
+ var _a;
109
+ const { sandboxReadyForUse, data } = sandboxReporter_1.SandboxReporter.logSandboxProcessResult(results);
110
+ this.ux.log(sandboxReadyForUse);
111
+ this.ux.styledHeader('Sandbox Org Creation Status');
112
+ this.ux.table(data, {
113
+ columns: [
114
+ { key: 'key', label: 'Name' },
115
+ { key: 'value', label: 'Value' },
116
+ ],
117
+ });
118
+ if ((_a = results.sandboxRes) === null || _a === void 0 ? void 0 : _a.authUserName) {
119
+ if (this.flags.setalias) {
120
+ const alias = await core_1.Aliases.create(core_1.Aliases.getDefaultOptions());
121
+ alias.set(this.flags.setalias, results.sandboxRes.authUserName);
122
+ const result = await alias.write();
123
+ this.logger.debug('Set Alias: %s result: %s', this.flags.setalias, result);
124
+ }
125
+ if (this.flags.setdefaultusername) {
126
+ const globalConfig = this.configAggregator.getGlobalConfig();
127
+ globalConfig.set(core_1.Config.DEFAULT_USERNAME, results.sandboxRes.authUserName);
128
+ const result = await globalConfig.write();
129
+ this.logger.debug('Set defaultUsername: %s result: %s', this.flags.setdefaultusername, result);
130
+ }
131
+ }
132
+ });
133
+ const sandboxReq = this.createSandboxRequest();
134
+ this.logger.debug('Calling create with SandboxRequest: %s ', sandboxReq);
135
+ const wait = this.flags.wait;
136
+ try {
137
+ return prodOrg.createSandbox(sandboxReq, { wait });
138
+ }
139
+ catch (e) {
140
+ // guaranteed to be SfdxError from core;
141
+ const err = e;
142
+ if (err === null || err === void 0 ? void 0 : err.message.includes('The org cannot be found')) {
143
+ // there was most likely an issue with DNS when auth'ing to the new sandbox, but it was created.
144
+ if (this.flags.setalias && this.sandboxAuth) {
145
+ const alias = await core_1.Aliases.create(core_1.Aliases.getDefaultOptions());
146
+ alias.set(this.flags.setalias, this.sandboxAuth.authUserName);
147
+ const result = await alias.write();
148
+ this.logger.debug('Set Alias: %s result: %s', this.flags.setalias, result);
149
+ }
150
+ if (this.flags.setdefaultusername && this.sandboxAuth) {
151
+ const globalConfig = this.configAggregator.getGlobalConfig();
152
+ globalConfig.set(core_1.Config.DEFAULT_USERNAME, this.sandboxAuth.authUserName);
153
+ const result = await globalConfig.write();
154
+ this.logger.debug('Set defaultUsername: %s result: %s', this.flags.setdefaultusername, result);
155
+ }
156
+ err.actions = [messages.getMessage('dnsTimeout'), messages.getMessage('partialSuccess')];
157
+ err.exitCode = 68;
158
+ throw err;
159
+ }
160
+ }
161
+ }
162
+ readJsonDefFile() {
163
+ // the -f option
164
+ if (this.flags.definitionfile) {
165
+ this.logger.debug('Reading JSON DefFile %s ', this.flags.definitionfile);
166
+ return JSON.parse(fs.readFileSync(this.flags.definitionfile, 'utf-8'));
167
+ }
168
+ }
169
+ async setAliasAndDefaultUsername(username) {
170
+ const aliases = await core_1.Aliases.create(core_1.Aliases.getDefaultOptions());
171
+ if (this.flags.setalias) {
172
+ await aliases.updateValue(this.flags.setalias, username);
173
+ this.logger.debug('Set Alias: %s result: %s', this.flags.setalias);
174
+ }
175
+ if (this.flags.setdefaultusername) {
176
+ let config;
177
+ try {
178
+ config = await core_1.Config.create({ isGlobal: false });
179
+ }
180
+ catch {
181
+ config = await core_1.Config.create({ isGlobal: true });
182
+ }
183
+ const value = aliases.getKeysByValue(username)[0] || username;
184
+ const result = config.set(core_1.Config.DEFAULT_USERNAME, value);
185
+ await config.write();
186
+ this.logger.debug('Set defaultUsername: %s result: %s', this.flags.setdefaultusername, result);
187
+ }
188
+ }
189
+ async createScratchOrg() {
190
+ this.logger.debug('OK, will do scratch org creation');
191
+ if (!this.hubOrg) {
192
+ throw core_1.SfdxError.create('@salesforce/plugin-org', 'create', 'RequiresDevhubUsernameError');
193
+ }
194
+ // Ensure we have an org config input source.
195
+ if (!this.flags.definitionfile && Object.keys(this.varargs).length === 0) {
196
+ throw new core_1.SfdxError(messages.getMessage('noConfig'));
197
+ }
198
+ this.logger.debug('validation complete');
199
+ let secret;
200
+ if (this.flags.clientid) {
201
+ // If the user supplied a specific client ID, we have no way of knowing if it's
202
+ // a certificate-based Connected App or not. Therefore, we have to assume that
203
+ // we'll need the client secret, so prompt the user for it.
204
+ secret = await this.ux.prompt(messages.getMessage('secretPrompt'), {
205
+ type: 'mask',
206
+ });
207
+ }
208
+ const createCommandOptions = {
209
+ connectedAppConsumerKey: this.flags.clientid,
210
+ durationDays: this.flags.durationdays,
211
+ nonamespace: this.flags.nonamespace,
212
+ noancestors: this.flags.noancestors,
213
+ wait: this.flags.wait,
214
+ retry: this.flags.retry,
215
+ apiversion: this.flags.apiversion,
216
+ definitionfile: this.flags.definitionfile,
217
+ orgConfig: this.varargs,
218
+ clientSecret: secret,
219
+ };
220
+ const { username, scratchOrgInfo, authFields, warnings } = await this.hubOrg.scratchOrgCreate(createCommandOptions);
221
+ await core_1.Lifecycle.getInstance().emit('scratchOrgInfo', scratchOrgInfo);
222
+ await this.setAliasAndDefaultUsername(username);
223
+ // emit postorgcreate event for hook
224
+ const postOrgCreateHookInfo = [authFields].map((element) => ({
225
+ accessToken: element.accessToken,
226
+ clientId: element.clientId,
227
+ created: element.created,
228
+ createdOrgInstance: element.createdOrgInstance,
229
+ devHubUsername: element.devHubUsername,
230
+ expirationDate: element.expirationDate,
231
+ instanceUrl: element.instanceUrl,
232
+ loginUrl: element.loginUrl,
233
+ orgId: element.orgId,
234
+ username: element.username,
235
+ }))[0];
236
+ await core_1.Lifecycle.getInstance().emit('postorgcreate', postOrgCreateHookInfo);
237
+ this.logger.debug(`orgConfig.loginUrl: ${authFields.loginUrl}`);
238
+ this.logger.debug(`orgConfig.instanceUrl: ${authFields.instanceUrl}`);
239
+ this.ux.log(messages.getMessage('scratchOrgCreateSuccess', [authFields.orgId, username]));
240
+ if (warnings.length > 0) {
241
+ warnings.forEach((warning) => {
242
+ this.ux.warn(warning);
243
+ });
244
+ }
245
+ return {
246
+ username,
247
+ scratchOrgInfo,
248
+ authFields,
249
+ warnings,
250
+ orgId: authFields.orgId,
251
+ };
252
+ }
253
+ }
254
+ exports.Create = Create;
255
+ Create.description = messages.getMessage('description');
256
+ Create.examples = messages.getMessage('examples').split(os.EOL);
257
+ Create.supportsDevhubUsername = true;
258
+ Create.supportsUsername = true;
259
+ Create.varargs = true;
260
+ Create.flagsConfig = {
261
+ type: command_1.flags.enum({
262
+ char: 't',
263
+ description: messages.getMessage('flags.type'),
264
+ options: [core_1.OrgTypes.Scratch, core_1.OrgTypes.Sandbox],
265
+ default: core_1.OrgTypes.Scratch,
266
+ }),
267
+ definitionfile: command_1.flags.filepath({
268
+ char: 'f',
269
+ description: messages.getMessage('flags.definitionFile'),
270
+ }),
271
+ nonamespace: command_1.flags.boolean({
272
+ char: 'n',
273
+ description: messages.getMessage('flags.noNamespace'),
274
+ }),
275
+ noancestors: command_1.flags.boolean({
276
+ char: 'c',
277
+ description: messages.getMessage('flags.noAncestors'),
278
+ }),
279
+ clientid: command_1.flags.string({
280
+ char: 'i',
281
+ description: messages.getMessage('flags.clientId'),
282
+ }),
283
+ setdefaultusername: command_1.flags.boolean({
284
+ char: 's',
285
+ description: messages.getMessage('flags.setDefaultUsername'),
286
+ }),
287
+ setalias: command_1.flags.string({
288
+ char: 'a',
289
+ description: messages.getMessage('flags.setAlias'),
290
+ }),
291
+ wait: command_1.flags.minutes({
292
+ char: 'w',
293
+ description: messages.getMessage('flags.wait'),
294
+ min: 6,
295
+ default: kit_1.Duration.minutes(6),
296
+ }),
297
+ durationdays: command_1.flags.integer({
298
+ char: 'd',
299
+ description: messages.getMessage('flags.durationDays'),
300
+ min: 1,
301
+ max: 30,
302
+ }),
303
+ retry: command_1.flags.number({
304
+ hidden: true,
305
+ default: 0,
306
+ max: 10,
307
+ description: messages.getMessage('flags.retry'),
308
+ }),
309
+ };
310
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/commands/force/org/beta/create.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yBAAyB;AACzB,yBAAyB;AACzB,iDAAsE;AACtE,yCAA2C;AAC3C,2CAiB0B;AAE1B,wEAAqE;AAErE,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAA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BAAmB,CAAC;KACtD,CAAC;IACF,QAAQ,EAAE,eAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC;KACnD,CAAC;IACF,kBAAkB,EAAE,eAAK,CAAC,OAAO,CAAC;QAChC,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;KAC7D,CAAC;IACF,QAAQ,EAAE,eAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC;KACnD,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,OAAO,CAAC;QAClB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC;QAC9C,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,cAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;KAC7B,CAAC;IACF,YAAY,EAAE,eAAK,CAAC,OAAO,CAAC;QAC1B,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QACtD,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,EAAE;KACR,CAAC;IACF,KAAK,EAAE,eAAK,CAAC,MAAM,CAAC;QAClB,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,CAAC;QACV,GAAG,EAAE,EAAE;QACP,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC;KAChD,CAAC;CACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { FlagsConfig, SfdxCommand } from '@salesforce/command';
2
+ declare type DeleteResult = {
3
+ orgId: string;
4
+ username: string;
5
+ };
6
+ export declare class Delete extends SfdxCommand {
7
+ static readonly requiresUsername = true;
8
+ static readonly supportsDevhubUsername = true;
9
+ static readonly description: string;
10
+ static readonly examples: string[];
11
+ static readonly flagsConfig: FlagsConfig;
12
+ run(): Promise<DeleteResult>;
13
+ }
14
+ export {};
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Delete = void 0;
4
+ /*
5
+ * Copyright (c) 2020, salesforce.com, inc.
6
+ * All rights reserved.
7
+ * Licensed under the BSD 3-Clause license.
8
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
9
+ */
10
+ const os = require("os");
11
+ const command_1 = require("@salesforce/command");
12
+ const core_1 = require("@salesforce/core");
13
+ core_1.Messages.importMessagesDirectory(__dirname);
14
+ const messages = core_1.Messages.loadMessages('@salesforce/plugin-org', 'delete');
15
+ class Delete extends command_1.SfdxCommand {
16
+ async run() {
17
+ const username = this.org.getUsername();
18
+ const orgId = this.org.getOrgId();
19
+ const isSandbox = await this.org.isSandbox();
20
+ // read the config file for the org to be deleted, if it has a PROD_ORG_USERNAME entry, it's a sandbox
21
+ // we either need permission to proceed without a prompt OR get the user to confirm
22
+ if (this.flags.noprompt ||
23
+ (await this.ux.confirm(messages.getMessage('confirmDelete', [isSandbox ? 'sandbox' : 'scratch', username])))) {
24
+ let alreadyDeleted = false;
25
+ let successMessageKey = 'commandSandboxSuccess';
26
+ try {
27
+ // will determine if it's a scratch org or sandbox and will delete from the appropriate parent org (DevHub or Production)
28
+ await this.org.delete();
29
+ }
30
+ catch (e) {
31
+ if (e instanceof Error && e.name === 'ScratchOrgNotFound') {
32
+ alreadyDeleted = true;
33
+ }
34
+ else if (e instanceof Error && e.name === 'SandboxNotFound') {
35
+ successMessageKey = 'sandboxConfigOnlySuccess';
36
+ }
37
+ else {
38
+ throw e;
39
+ }
40
+ }
41
+ this.ux.log(isSandbox
42
+ ? messages.getMessage(successMessageKey, [username])
43
+ : messages.getMessage(alreadyDeleted ? 'deleteOrgConfigOnlyCommandSuccess' : 'deleteOrgCommandSuccess', [
44
+ username,
45
+ ]));
46
+ }
47
+ return { username, orgId };
48
+ }
49
+ }
50
+ exports.Delete = Delete;
51
+ Delete.requiresUsername = true;
52
+ Delete.supportsDevhubUsername = true;
53
+ Delete.description = messages.getMessage('description');
54
+ Delete.examples = messages.getMessage('examples').split(os.EOL);
55
+ Delete.flagsConfig = {
56
+ noprompt: command_1.flags.boolean({
57
+ char: 'p',
58
+ description: messages.getMessage('flags.noprompt'),
59
+ }),
60
+ };
61
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/force/org/delete.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,iDAAsE;AACtE,2CAA4C;AAE5C,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC;AAO3E,MAAa,MAAO,SAAQ,qBAAW;IAY9B,KAAK,CAAC,GAAG;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAClC,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;QAC7C,sGAAsG;QACtG,mFAAmF;QACnF,IACE,IAAI,CAAC,KAAK,CAAC,QAAQ;YACnB,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC5G;YACA,IAAI,cAAc,GAAG,KAAK,CAAC;YAC3B,IAAI,iBAAiB,GAAG,uBAAuB,CAAC;YAChD,IAAI;gBACF,yHAAyH;gBACzH,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;aACzB;YAAC,OAAO,CAAC,EAAE;gBACV,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,IAAI,KAAK,oBAAoB,EAAE;oBACzD,cAAc,GAAG,IAAI,CAAC;iBACvB;qBAAM,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,IAAI,KAAK,iBAAiB,EAAE;oBAC7D,iBAAiB,GAAG,0BAA0B,CAAC;iBAChD;qBAAM;oBACL,MAAM,CAAC,CAAC;iBACT;aACF;YAED,IAAI,CAAC,EAAE,CAAC,GAAG,CACT,SAAS;gBACP,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,CAAC;gBACpD,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,yBAAyB,EAAE;oBACpG,QAAQ;iBACT,CAAC,CACP,CAAC;SACH;QACD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC7B,CAAC;;AA9CH,wBA+CC;AA9CwB,uBAAgB,GAAG,IAAI,CAAC;AACxB,6BAAsB,GAAG,IAAI,CAAC;AAC9B,kBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,eAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AACzD,kBAAW,GAAgB;IAChD,QAAQ,EAAE,eAAK,CAAC,OAAO,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC;KACnD,CAAC;CACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ import * as Config from '@oclif/config';
2
+ import { Optional } from '@salesforce/ts-types';
3
+ import { AuthFields } from '@salesforce/core';
4
+ declare type HookOpts<T> = {
5
+ Command: Config.Command.Class;
6
+ argv: string[];
7
+ commandId: string;
8
+ result: Optional<T>;
9
+ };
10
+ export declare type OrgCreateResult = Pick<AuthFields, 'accessToken' | 'clientId' | 'created' | 'createdOrgInstance' | 'devHubUsername' | 'expirationDate' | 'instanceUrl' | 'loginUrl' | 'orgId' | 'username'>;
11
+ declare type PostOrgCreateOpts = HookOpts<OrgCreateResult>;
12
+ /**
13
+ * Extends OCLIF's Hooks interface to add types for hooks that run on sfdx org commands
14
+ */
15
+ export interface OrgHooks extends Config.Hooks {
16
+ postorgcreate: PostOrgCreateOpts;
17
+ }
18
+ export declare type OrgHook<T> = (this: Config.Hook.Context, options: T extends keyof Config.Hooks ? OrgHooks[T] : T) => any;
19
+ export declare namespace OrgHook {
20
+ type PostOrgCreate = Config.Hook<OrgHooks['postorgcreate']>;
21
+ }
22
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2021, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ //# sourceMappingURL=orgHooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orgHooks.js","sourceRoot":"","sources":["../../src/shared/orgHooks.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
@@ -263,7 +263,7 @@ class OrgListUtil {
263
263
  const logger = await OrgListUtil.retrieveLogger();
264
264
  logger.trace(`error refreshing auth for org: ${org.getUsername()}`);
265
265
  logger.trace(error);
266
- return (_a = error.code) !== null && _a !== void 0 ? _a : error.message;
266
+ return ((_a = error.code) !== null && _a !== void 0 ? _a : error.message);
267
267
  }
268
268
  }
269
269
  catch (err) {
@@ -271,7 +271,7 @@ class OrgListUtil {
271
271
  const logger = await OrgListUtil.retrieveLogger();
272
272
  logger.trace(`error refreshing auth for org: ${username}`);
273
273
  logger.trace(error);
274
- return (_c = (_b = error.code) !== null && _b !== void 0 ? _b : error.message) !== null && _c !== void 0 ? _c : 'Unknown';
274
+ return ((_c = (_b = error.code) !== null && _b !== void 0 ? _b : error.message) !== null && _c !== void 0 ? _c : 'Unknown');
275
275
  }
276
276
  }
277
277
  }
@@ -1 +1 @@
1
- {"version":3,"file":"orgListUtil.js","sourceRoot":"","sources":["../../src/shared/orgListUtil.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,+BAAsC;AAEtC,2CAAoH;AAGpH,6CAA2C;AAC3C,mCAA6C;AAa7C,MAAa,WAAW;IAGf,MAAM,CAAC,KAAK,CAAC,cAAc;QAChC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;YACvB,WAAW,CAAC,MAAM,GAAG,MAAM,aAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;SACxD;QACD,OAAO,WAAW,CAAC,MAAM,CAAC;IAC5B,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,KAAK,CAAC,+CAA+C,CACjE,aAAuB,EACvB,KAAmC;QAEnC,MAAM,QAAQ,GAAe,MAAM,WAAW,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAC5E,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAEnD,8CAA8C;QAC9C,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACtD,OAAO,CAAC,GAAG,CACT,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;gBACvC,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE;oBAC/B,mDAAmD;oBACnD,MAAM,CAAC,eAAe,GAAG,MAAM,WAAW,CAAC,wCAAwC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;oBACrG,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,eAAe,KAAK,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usEvent): string;
4
+ static logSandboxProcessResult(result: ResultEvent): {
5
+ sandboxReadyForUse: string;
6
+ data: Array<{
7
+ key: string;
8
+ value: string | number;
9
+ }>;
10
+ };
11
+ private static getSecondsToHuman;
12
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SandboxReporter = void 0;
4
+ const kit_1 = require("@salesforce/kit");
5
+ class SandboxReporter {
6
+ static sandboxProgress(update) {
7
+ const { retries, interval, sandboxProcessObj, waitingOnAuth } = update;
8
+ const waitTimeInSec = retries * interval;
9
+ const waitTime = SandboxReporter.getSecondsToHuman(waitTimeInSec);
10
+ const waitTimeMsg = `Sleeping ${interval} seconds. Will wait ${waitTime} more before timing out.`;
11
+ const sandboxIdentifierMsg = `${sandboxProcessObj.SandboxName}(${sandboxProcessObj.Id})`;
12
+ const waitingOnAuthMessage = waitingOnAuth ? ', waiting on JWT auth' : '';
13
+ const completionMessage = `(${sandboxProcessObj.CopyProgress}% completed${waitingOnAuthMessage})`;
14
+ return `Sandbox request ${sandboxIdentifierMsg} is ${sandboxProcessObj.Status} ${completionMessage}. ${waitTimeMsg}`;
15
+ }
16
+ static logSandboxProcessResult(result
17
+ // sandboxProcessObj.CopyProgress is a number
18
+ ) {
19
+ const { sandboxProcessObj, sandboxRes } = result;
20
+ const sandboxReadyForUse = `Sandbox ${sandboxProcessObj.SandboxName}(${sandboxProcessObj.Id}) is ready for use.`;
21
+ const data = [
22
+ { key: 'Id', value: sandboxProcessObj.Id },
23
+ { key: 'SandboxName', value: sandboxProcessObj.SandboxName },
24
+ { key: 'Status', value: sandboxProcessObj.Status },
25
+ { key: 'CopyProgress', value: sandboxProcessObj.CopyProgress },
26
+ { key: 'Description', value: sandboxProcessObj.Description },
27
+ { key: 'LicenseType', value: sandboxProcessObj.LicenseType },
28
+ { key: 'SandboxInfoId', value: sandboxProcessObj.SandboxInfoId },
29
+ { key: 'SourceId', value: sandboxProcessObj.SourceId },
30
+ { key: 'SandboxOrg', value: sandboxProcessObj.SandboxOrganization },
31
+ { key: 'Created Date', value: sandboxProcessObj.CreatedDate },
32
+ { key: 'ApexClassId', value: sandboxProcessObj.ApexClassId },
33
+ { key: 'Authorized Sandbox Username', value: sandboxRes.authUserName },
34
+ ];
35
+ return { sandboxReadyForUse, data };
36
+ }
37
+ static getSecondsToHuman(waitTimeInSec) {
38
+ const hours = kit_1.Duration.hours(Math.floor(waitTimeInSec / 3600));
39
+ const minutes = kit_1.Duration.minutes(Math.floor((waitTimeInSec % 3600) / 60));
40
+ const seconds = kit_1.Duration.seconds(Math.floor(waitTimeInSec % 60));
41
+ const hDisplay = hours.hours > 0 ? hours.toString() + ' ' : '';
42
+ const mDisplay = minutes.minutes > 0 ? minutes.toString() + ' ' : '';
43
+ const sDisplay = seconds.seconds > 0 ? seconds.toString() : '';
44
+ return (hDisplay + mDisplay + sDisplay).trim();
45
+ }
46
+ }
47
+ exports.SandboxReporter = SandboxReporter;
48
+ //# sourceMappingURL=sandboxReporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandboxReporter.js","sourceRoot":"","sources":["../../src/shared/sandboxReporter.ts"],"names":[],"mappings":";;;AAOA,yCAA2C;AAE3C,MAAa,eAAe;IACnB,MAAM,CAAC,eAAe,CAAC,MAAmB;QAC/C,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;QACvE,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC;QAEzC,MAAM,QAAQ,GAAW,eAAe,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QAC1E,MAAM,WAAW,GAAG,YAAY,QAAQ,uBAAuB,QAAQ,0BAA0B,CAAC;QAClG,MAAM,oBAAoB,GAAG,GAAG,iBAAiB,CAAC,WAAW,IAAI,iBAAiB,CAAC,EAAE,GAAG,CAAC;QACzF,MAAM,oBAAoB,GAAW,aAAa,CAAC,CAAC,CAAC,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AAG,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB,CAAC,WAAW,EAAE;YAC5D,EAAE,GAAG,EAAE,6BAA6B,EAAE,KAAK,EAAE,UAAU,CAAC,YAAY,EAAE;SACvE,CAAC;QAEF,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;IACtC,CAAC;IAEO,MAAM,CAAC,iBAAiB,CAAC,aAAqB;QACpD,MAAM,KAAK,GAAG,cAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC;QAC/D,MAAM,OAAO,GAAG,cAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC1E,MAAM,OAAO,GAAG,cAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,EAAE,CAAC,CAAC,CAAC;QAEjE,MAAM,QAAQ,GAAW,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,MAAM,QAAQ,GAAW,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7E,MAAM,QAAQ,GAAW,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAEvE,OAAO,CAAC,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IACjD,CAAC;CACF;AAlDD,0CAkDC"}
@@ -0,0 +1,37 @@
1
+ {
2
+ "description": "create a scratch or sandbox org \nCreates a scratch org or a sandbox org using the values specified in a configuration file or key=value pairs that you specify on the command line. Values specified on the command line override values in the configuration file. Specify a configuration file or provide key=value pairs while creating a scratch org or a sandbox. When creating scratch orgs, —targetdevhubusername (-v) must be a Dev Hub org. When creating sandboxes, the --targetusername (-u) must be a production org with sandbox licenses. The —type (-t) is required if creating a sandbox.\n\n",
3
+ "examples": [
4
+ "$ sfdx force:org:create -f config/enterprise-scratch-def.json -a MyScratchOrg",
5
+ "$ sfdx force:org:create edition=Developer -a MyScratchOrg -s -v devHub",
6
+ "$ sfdx force:org:create -f config/enterprise-scratch-def.json -a ScratchOrgWithOverrides username=testuser1@mycompany.org",
7
+ "$ sfdx force:org:create -t sandbox -f config/dev-sandbox-def.json -a MyDevSandbox -u prodOrg"
8
+ ],
9
+ "flags": {
10
+ "clientId": "connected app consumer key; not supported for sandbox org creation",
11
+ "setDefaultUsername": "set the created org as the default username",
12
+ "setAlias": "alias for the created org",
13
+ "definitionFile": "path to an org definition file",
14
+ "definitionJson": "org definition in JSON format",
15
+ "noNamespace": "create the scratch org with no namespace",
16
+ "noAncestors": "do not include second-generation package ancestors in the scratch org",
17
+ "env": "environment where the scratch org is created: %s",
18
+ "type": "type of org to create",
19
+ "durationDays": "duration of the scratch org (in days) (default:7, min:1, max:30)",
20
+ "retry": "Number of scratch org auth retries after scratch org is successfully signed up.",
21
+ "wait": "the streaming client socket timeout (in minutes)"
22
+ },
23
+ "scratchOrgCreateSuccess": "Successfully created scratch org: %s, username: %s.",
24
+ "clientIdNotSupported": "-i | --clientid is not supported for the sandbox org create command. Its value, %s, has been ignored.",
25
+ "noNamespaceNotSupported": "-n | --nonamespace is not supported for the sandbox org create command. Its value, %s, has been ignored.",
26
+ "noAncestorsNotSupported": "-c | --noancestors is not supported for the sandbox org create command. Its value, %s, has been ignored.",
27
+ "durationDaysNotSupported": "-d | --durationdays is not supported for the sandbox org create command. Its value, %s, has been ignored.",
28
+ "retryIsNotValidForSandboxes": "One cannot use flag retry with Sandbox org create.",
29
+ "sandboxSuccess": "The sandbox org creation process %s is in progress. Run \"sfdx force:org:status -n %s -u %s\" to check for status. If the org is ready, checking the status also authorizes the org for use with Salesforce CLI.",
30
+ "requiresUsername": "This command requires a username. Specify it with the -u parameter or with the \"sfdx config:set defaultusername=<username>\" command.",
31
+ "missingLicenseType": "The sandbox license type is required, but you didn't provide a value. Specify the license type in the sandbox definition file with the \"licenseType\" option, or specify the option as a name-value pair at the command-line. See https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_sandbox_definition.htm for more information.",
32
+ "dnsTimeout": "The sandbox was successfully created and authenticated. However, the sandbox DNS records aren't ready yet and so the sandbox may not be available. Run \"force:org:list\" and check if the sandbox is listed correctly. If it isn't listed, run \"force:org:status\" to view its status and, if necessary, authenticate to it again. If this issue happens frequently, try setting the SFDX_DNS_TIMEOUT environment variable to a larger number; the default value is 3 seconds.",
33
+ "partialSuccess": "If you specified the -a or -s parameters, but the sandbox wasn't immediately available, the \"force:org:create\" command may not have finished setting the alias or defaultusername. If so, set the alias manually with \"sfdx alias:set\" and the defaultusername with \"sfdx config:set\".",
34
+ "noConfig": "Please specify an org configuration via file and/or key=value pairs.",
35
+ "RequiresDevhubUsernameError": "This command requires a dev hub org username set either with a flag or by default in the config.",
36
+ "secretPrompt": "OAuth client secret of personal connected app?"
37
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "description": "mark a scratch or sandbox org for deletion \nTo mark the org for deletion without being prompted to confirm, specify --noprompt.",
3
+ "examples": ["$ sfdx force:org:delete -u me@my.org", "$ sfdx force:org:delete -u MyOrgAlias -p"],
4
+ "flags": {
5
+ "noprompt": "no prompt to confirm deletion"
6
+ },
7
+ "confirmDelete": "Enqueue %s org with name: %s for deletion? Are you sure (y/n)?",
8
+ "sandboxConfigOnlySuccess": "Successfully deleted sandbox org %s.",
9
+ "ScratchOrgNotFound": "Attempting to delete an expired or deleted org",
10
+ "deleteOrgConfigOnlyCommandSuccess": "Successfully deleted scratch org %s.'",
11
+ "deleteOrgCommandSuccess": "Successfully marked scratch org %s for deletion",
12
+ "commandSandboxSuccess": "The sandbox org %s has been successfully removed from your list of CLI authorized orgs. If you created the sandbox with one of the force:org commands, it has also been marked for deletion."
13
+ }
@@ -1 +1 @@
1
- {"version":"1.10.0","commands":{"force:org:display":{"id":"force:org:display","description":"get the description for the current or target org\nOutput includes your access token, client Id, connected status, org ID, instance URL, username, and alias, if applicable.\nUse --verbose to include the SFDX auth URL. WARNING: The SFDX auth URL contains sensitive information, such as a refresh token that can be used to access an org. Don't share or distribute this URL or token.\nIncluding --verbose displays the sfdxAuthUrl property only if you authenticated to the org using auth:web:login (not auth:jwt:grant)","usage":"<%= command.id %> [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@salesforce/plugin-org","pluginType":"core","aliases":[],"examples":["sfdx force:org:display","sfdx force:org:display -u me@my.org","sfdx force:org:display -u TestOrg1 --json","sfdx force:org:display -u TestOrg1 --json > tmp/MyOrgDesc.json"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"verbose":{"name":"verbose","type":"boolean","description":"emit additional command output to stdout","allowNo":false}},"args":[]},"force:org:list":{"id":"force:org:list","description":"list all orgs you’ve created or authenticated to","usage":"<%= command.id %> [--all] [-p --clean] [--skipconnectionstatus] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@salesforce/plugin-org","pluginType":"core","aliases":[],"examples":["sfdx force:org:list","sfdx force:org:list --verbose --json","sfdx force:org:list --verbose --json > tmp/MyOrgList.json"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"verbose":{"name":"verbose","type":"boolean","description":"list more information about each org","allowNo":false},"all":{"name":"all","type":"boolean","description":"include expired, deleted, and unknown-status scratch orgs","allowNo":false},"clean":{"name":"clean","type":"boolean","description":"remove all local org authorizations for non-active orgs","allowNo":false},"noprompt":{"name":"noprompt","type":"boolean","char":"p","description":"do not prompt for confirmation","allowNo":false},"skipconnectionstatus":{"name":"skipconnectionstatus","type":"boolean","description":"skip retrieving the connection status of non-scratch orgs","allowNo":false}},"args":[]},"force:org:open":{"id":"force:org:open","description":"open your default scratch org, or another specified org\nTo open a specific page, specify the portion of the URL after \"https://MyDomainName.my.salesforce.com/\" as --path.\nFor example, specify \"--path lightning\" to open Lightning Experience, or specify \"--path /apex/YourPage\" to open a Visualforce page.\nTo generate a URL but not launch it in your browser, specify --urlonly.\nTo open in a specific browser, use the --browser parameter. Supported browsers are \"chrome\", \"edge\", and \"firefox\". If you don't specify --browser, the org opens in your default browser.","usage":"<%= command.id %> [-b <string> | -r] [-p <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@salesforce/plugin-org","pluginType":"core","aliases":[],"examples":["sfdx force:org:open","sfdx force:org:open -u me@my.org","sfdx force:org:open -u MyTestOrg1","sfdx force:org:open -r -p lightning","sfdx force:org:open -u me@my.org -b firefox"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"browser":{"name":"browser","type":"option","char":"b","description":"browser where the org opens","options":["chrome","edge","firefox"]},"path":{"name":"path","type":"option","char":"p","description":"navigation URL path"},"urlonly":{"name":"urlonly","type":"boolean","char":"r","description":"display navigation URL, but don’t launch browser","allowNo":false}},"args":[]}}}
1
+ {"version":"1.11.2","commands":{"force:org:delete":{"id":"force:org:delete","description":"mark a scratch or sandbox org for deletion \nTo mark the org for deletion without being prompted to confirm, specify --noprompt.","usage":"<%= command.id %> [-p] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@salesforce/plugin-org","pluginType":"core","aliases":[],"examples":["$ sfdx force:org:delete -u me@my.org","$ sfdx force:org:delete -u MyOrgAlias -p"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetdevhubusername":{"name":"targetdevhubusername","type":"option","char":"v","description":"username or alias for the dev hub org; overrides default dev hub org"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"noprompt":{"name":"noprompt","type":"boolean","char":"p","description":"no prompt to confirm deletion","allowNo":false}},"args":[]},"force:org:display":{"id":"force:org:display","description":"get the description for the current or target org\nOutput includes your access token, client Id, connected status, org ID, instance URL, username, and alias, if applicable.\nUse --verbose to include the SFDX auth URL. WARNING: The SFDX auth URL contains sensitive information, such as a refresh token that can be used to access an org. Don't share or distribute this URL or token.\nIncluding --verbose displays the sfdxAuthUrl property only if you authenticated to the org using auth:web:login (not auth:jwt:grant)","usage":"<%= command.id %> [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@salesforce/plugin-org","pluginType":"core","aliases":[],"examples":["sfdx force:org:display","sfdx force:org:display -u me@my.org","sfdx force:org:display -u TestOrg1 --json","sfdx force:org:display -u TestOrg1 --json > tmp/MyOrgDesc.json"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"verbose":{"name":"verbose","type":"boolean","description":"emit additional command output to stdout","allowNo":false}},"args":[]},"force:org:list":{"id":"force:org:list","description":"list all orgs you’ve created or authenticated to","usage":"<%= command.id %> [--all] [-p --clean] [--skipconnectionstatus] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@salesforce/plugin-org","pluginType":"core","aliases":[],"examples":["sfdx force:org:list","sfdx force:org:list --verbose --json","sfdx force:org:list --verbose --json > tmp/MyOrgList.json"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"verbose":{"name":"verbose","type":"boolean","description":"list more information about each org","allowNo":false},"all":{"name":"all","type":"boolean","description":"include expired, deleted, and unknown-status scratch orgs","allowNo":false},"clean":{"name":"clean","type":"boolean","description":"remove all local org authorizations for non-active orgs","allowNo":false},"noprompt":{"name":"noprompt","type":"boolean","char":"p","description":"do not prompt for confirmation","allowNo":false},"skipconnectionstatus":{"name":"skipconnectionstatus","type":"boolean","description":"skip retrieving the connection status of non-scratch orgs","allowNo":false}},"args":[]},"force:org:open":{"id":"force:org:open","description":"open your default scratch org, or another specified org\nTo open a specific page, specify the portion of the URL after \"https://MyDomainName.my.salesforce.com/\" as --path.\nFor example, specify \"--path lightning\" to open Lightning Experience, or specify \"--path /apex/YourPage\" to open a Visualforce page.\nTo generate a URL but not launch it in your browser, specify --urlonly.\nTo open in a specific browser, use the --browser parameter. Supported browsers are \"chrome\", \"edge\", and \"firefox\". If you don't specify --browser, the org opens in your default browser.","usage":"<%= command.id %> [-b <string> | -r] [-p <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@salesforce/plugin-org","pluginType":"core","aliases":[],"examples":["sfdx force:org:open","sfdx force:org:open -u me@my.org","sfdx force:org:open -u MyTestOrg1","sfdx force:org:open -r -p lightning","sfdx force:org:open -u me@my.org -b firefox"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"browser":{"name":"browser","type":"option","char":"b","description":"browser where the org opens","options":["chrome","edge","firefox"]},"path":{"name":"path","type":"option","char":"p","description":"navigation URL path"},"urlonly":{"name":"urlonly","type":"boolean","char":"r","description":"display navigation URL, but don’t launch browser","allowNo":false}},"args":[]},"force:org:beta:create":{"id":"force:org:beta:create","description":"create a scratch or sandbox org \nCreates a scratch org or a sandbox org using the values specified in a configuration file or key=value pairs that you specify on the command line. Values specified on the command line override values in the configuration file. Specify a configuration file or provide key=value pairs while creating a scratch org or a sandbox. When creating scratch orgs, —targetdevhubusername (-v) must be a Dev Hub org. When creating sandboxes, the --targetusername (-u) must be a production org with sandbox licenses. The —type (-t) is required if creating a sandbox.\n\n","usage":"<%= command.id %> [name=value...] [-t scratch|sandbox] [-f <filepath>] [-n] [-c] [-i <string>] [-s] [-a <string>] [-w <minutes>] [-d <integer>] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@salesforce/plugin-org","pluginType":"core","aliases":[],"examples":["$ sfdx force:org:create -f config/enterprise-scratch-def.json -a MyScratchOrg","$ sfdx force:org:create edition=Developer -a MyScratchOrg -s -v devHub","$ sfdx force:org:create -f config/enterprise-scratch-def.json -a ScratchOrgWithOverrides username=testuser1@mycompany.org","$ sfdx force:org:create -t sandbox -f config/dev-sandbox-def.json -a MyDevSandbox -u prodOrg"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetdevhubusername":{"name":"targetdevhubusername","type":"option","char":"v","description":"username or alias for the dev hub org; overrides default dev hub org"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"type":{"name":"type","type":"option","char":"t","description":"type of org to create","helpValue":"(scratch|sandbox)","options":["scratch","sandbox"],"default":"scratch"},"definitionfile":{"name":"definitionfile","type":"option","char":"f","description":"path to an org definition file"},"nonamespace":{"name":"nonamespace","type":"boolean","char":"n","description":"create the scratch org with no namespace","allowNo":false},"noancestors":{"name":"noancestors","type":"boolean","char":"c","description":"do not include second-generation package ancestors in the scratch org","allowNo":false},"clientid":{"name":"clientid","type":"option","char":"i","description":"connected app consumer key; not supported for sandbox org creation"},"setdefaultusername":{"name":"setdefaultusername","type":"boolean","char":"s","description":"set the created org as the default username","allowNo":false},"setalias":{"name":"setalias","type":"option","char":"a","description":"alias for the created org"},"wait":{"name":"wait","type":"option","char":"w","description":"the streaming client socket timeout (in minutes)","default":{"quantity":6,"unit":0}},"durationdays":{"name":"durationdays","type":"option","char":"d","description":"duration of the scratch org (in days) (default:7, min:1, max:30)"},"retry":{"name":"retry","type":"option","description":"Number of scratch org auth retries after scratch org is successfully signed up.","hidden":true,"default":0}},"args":[]}}}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-org",
3
3
  "description": "A template repository for sfdx plugins",
4
- "version": "1.10.0",
4
+ "version": "1.11.2",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
8
- "@oclif/config": "^1.17.1",
9
- "@salesforce/command": "^4.1.3",
10
- "@salesforce/core": "^2.28.0",
8
+ "@oclif/config": "^1.18.1",
9
+ "@salesforce/command": "^4.2.2",
10
+ "@salesforce/core": "^2.35.0",
11
11
  "@salesforce/kit": "^1.5.17",
12
12
  "open": "8.4.0",
13
13
  "tslib": "^2"
@@ -15,12 +15,13 @@
15
15
  "devDependencies": {
16
16
  "@oclif/dev-cli": "^1",
17
17
  "@oclif/plugin-command-snapshot": "^2.2.2",
18
- "@salesforce/cli-plugins-testkit": "^1.4.10",
19
- "@salesforce/dev-config": "^2.1.2",
20
- "@salesforce/dev-scripts": "^1.0.0",
18
+ "@salesforce/cli-plugins-testkit": "^1.5.3",
19
+ "@salesforce/dev-config": "^3.0.0",
20
+ "@salesforce/dev-scripts": "^2.0.0",
21
21
  "@salesforce/plugin-command-reference": "^1.3.0",
22
22
  "@salesforce/prettier-config": "^0.0.2",
23
23
  "@salesforce/ts-sinon": "1.3.21",
24
+ "@types/shelljs": "^0.8.10",
24
25
  "@typescript-eslint/eslint-plugin": "^4.33.0",
25
26
  "@typescript-eslint/parser": "^4.33.0",
26
27
  "chai": "^4.2.0",
@@ -32,20 +33,20 @@
32
33
  "eslint-config-salesforce-license": "^0.1.6",
33
34
  "eslint-config-salesforce-typescript": "^0.2.8",
34
35
  "eslint-plugin-header": "^3.0.0",
35
- "eslint-plugin-import": "2.25.2",
36
+ "eslint-plugin-import": "2.25.4",
36
37
  "eslint-plugin-jsdoc": "^35.1.2",
37
38
  "eslint-plugin-prettier": "^3.1.3",
38
39
  "husky": "^7.0.4",
39
40
  "lint-staged": "^11.0.0",
40
- "mocha": "^8.4.0",
41
+ "mocha": "^9.1.3",
41
42
  "moment": "^2.29.1",
42
43
  "nyc": "^15.1.0",
43
44
  "prettier": "^2.4.1",
44
45
  "pretty-quick": "^3.1.0",
45
- "shx": "0.3.3",
46
+ "shx": "0.3.4",
46
47
  "sinon": "10.0.0",
47
48
  "ts-node": "^10.0.0",
48
- "typescript": "^4.1.3"
49
+ "typescript": "^4.4.4"
49
50
  },
50
51
  "config": {
51
52
  "commitizen": {
@@ -108,13 +109,14 @@
108
109
  "test:command-reference": "./bin/run commandreference:generate --erroronwarnings",
109
110
  "test:deprecation-policy": "./bin/run snapshot:compare",
110
111
  "test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
112
+ "test:nuts:sandbox": "nyc mocha \"**/*.sandboxNut.ts\" --slow 450000 --timeout 7200000",
111
113
  "version": "oclif-dev readme"
112
114
  },
113
115
  "publishConfig": {
114
116
  "access": "public"
115
117
  },
116
118
  "sfdx": {
117
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/1.10.0.crt",
118
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/1.10.0.sig"
119
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/1.11.2.crt",
120
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/1.11.2.sig"
119
121
  }
120
122
  }