@salesforce/plugin-org 1.11.0 → 1.11.1

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,24 @@
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.1](https://github.com/salesforcecli/plugin-org/compare/v1.11.0...v1.11.1) (2022-01-28)
6
+
7
+ ### Features
8
+
9
+ - scratchOrg create ([955667e](https://github.com/salesforcecli/plugin-org/commit/955667e2d3e7e6444903c89ad065b9161444b22b))
10
+
11
+ ### Bug Fixes
12
+
13
+ - add initial org:beta:create command ([1cf6bdb](https://github.com/salesforcecli/plugin-org/commit/1cf6bdb1399e20e2fc72a9f0c15080e95b26e219))
14
+ - add initial org:beta:create command ([d2a89e2](https://github.com/salesforcecli/plugin-org/commit/d2a89e24a956136bb11d161618234b33842787e7))
15
+ - add org:beta:create command for sandboxes, UTs ([654ca50](https://github.com/salesforcecli/plugin-org/commit/654ca50ee2192342c6df382e9e20f8b33f9fd73f))
16
+ - add sandbox create/open/delete NUT ([60c81aa](https://github.com/salesforcecli/plugin-org/commit/60c81aa6330b87cecb06a84cca2994c7d466c3f5))
17
+ - bump testkit to fix yarn.lock ([454afbd](https://github.com/salesforcecli/plugin-org/commit/454afbd6649e2ceaabdaeeb27ce9a3d5e5f9c813))
18
+ - disable nuts-on-windows w/latest ([0bf02b1](https://github.com/salesforcecli/plugin-org/commit/0bf02b191d2ef039c5800ef233bba142b82bf975))
19
+ - manual release for beta:org:create ([a33137f](https://github.com/salesforcecli/plugin-org/commit/a33137f04602bb36033c73132098e311206ebafe))
20
+ - merge conflicts ([cd02453](https://github.com/salesforcecli/plugin-org/commit/cd024538fe2616fe3b46ef477d268e41f2516bea))
21
+ - use compatible types from command/test ([a4de0b0](https://github.com/salesforcecli/plugin-org/commit/a4de0b06be0f899b07a6651b61febf6732069ef0))
22
+
5
23
  ## [1.11.0](https://github.com/salesforcecli/plugin-org/compare/v1.10.1...v1.11.0) (2021-12-02)
6
24
 
7
25
  ### 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,11 +78,84 @@ 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)
81
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)
82
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)
83
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)
84
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)
85
86
 
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]`
88
+
89
+ create a scratch or sandbox org
90
+
91
+ ```
92
+ create a scratch or sandbox org
93
+ Creates 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.
94
+
95
+
96
+
97
+ USAGE
98
+ $ sfdx force:org:beta:create [name=value...] [-t scratch|sandbox] [-f <filepath>] [-n] [-c] [-i <string>] [-s] [-a
99
+ <string>] [-w <minutes>] [-d <integer>] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
100
+ trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
101
+
102
+ OPTIONS
103
+ -a, --setalias=setalias alias for the created org
104
+
105
+ -c, --noancestors do not include second-generation
106
+ package ancestors in the scratch org
107
+
108
+ -d, --durationdays=durationdays duration of the scratch org (in
109
+ days) (default:7, min:1, max:30)
110
+
111
+ -f, --definitionfile=definitionfile path to an org definition file
112
+
113
+ -i, --clientid=clientid connected app consumer key; not
114
+ supported for sandbox org creation
115
+
116
+ -n, --nonamespace create the scratch org with no
117
+ namespace
118
+
119
+ -s, --setdefaultusername set the created org as the default
120
+ username
121
+
122
+ -t, --type=(scratch|sandbox) [default: scratch] type of org to
123
+ create
124
+
125
+ -u, --targetusername=targetusername username or alias for the target
126
+ org; overrides default target org
127
+
128
+ -v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
129
+ org; overrides default dev hub org
130
+
131
+ -w, --wait=wait [default: 6 minutes] the streaming
132
+ client socket timeout (in minutes)
133
+
134
+ --apiversion=apiversion override the api version used for
135
+ api requests made by this command
136
+
137
+ --json format output as json
138
+
139
+ --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
140
+ this command invocation
141
+
142
+ DESCRIPTION
143
+ Creates a scratch org or a sandbox org using the values specified in a configuration file or key=value pairs that you
144
+ specify on the command line. Values specified on the command line override values in the configuration file. Specify a
145
+ configuration file or provide key=value pairs while creating a scratch org or a sandbox. When creating scratch orgs,
146
+ —targetdevhubusername (-v) must be a Dev Hub org. When creating sandboxes, the --targetusername (-u) must be a
147
+ production org with sandbox licenses. The —type (-t) is required if creating a sandbox.
148
+
149
+ EXAMPLES
150
+ $ sfdx force:org:create -f config/enterprise-scratch-def.json -a MyScratchOrg
151
+ $ sfdx force:org:create edition=Developer -a MyScratchOrg -s -v devHub
152
+ $ sfdx force:org:create -f config/enterprise-scratch-def.json -a ScratchOrgWithOverrides
153
+ username=testuser1@mycompany.org
154
+ $ sfdx force:org:create -t sandbox -f config/dev-sandbox-def.json -a MyDevSandbox -u prodOrg
155
+ ```
156
+
157
+ _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)_
158
+
86
159
  ## `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]`
87
160
 
88
161
  mark a scratch or sandbox org for deletion
@@ -120,7 +193,7 @@ EXAMPLES
120
193
  $ sfdx force:org:delete -u MyOrgAlias -p
121
194
  ```
122
195
 
123
- _See code: [src/commands/force/org/delete.ts](https://github.com/salesforcecli/plugin-org/blob/v1.10.1/src/commands/force/org/delete.ts)_
196
+ _See code: [src/commands/force/org/delete.ts](https://github.com/salesforcecli/plugin-org/blob/v1.11.1/src/commands/force/org/delete.ts)_
124
197
 
125
198
  ## `sfdx force:org:display [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
126
199
 
@@ -166,7 +239,7 @@ EXAMPLES
166
239
  sfdx force:org:display -u TestOrg1 --json > tmp/MyOrgDesc.json
167
240
  ```
168
241
 
169
- _See code: [src/commands/force/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/v1.10.1/src/commands/force/org/display.ts)_
242
+ _See code: [src/commands/force/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/v1.11.1/src/commands/force/org/display.ts)_
170
243
 
171
244
  ## `sfdx force:org:list [--all] [-p --clean] [--skipconnectionstatus] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
172
245
 
@@ -204,7 +277,7 @@ EXAMPLES
204
277
  sfdx force:org:list --verbose --json > tmp/MyOrgList.json
205
278
  ```
206
279
 
207
- _See code: [src/commands/force/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/v1.10.1/src/commands/force/org/list.ts)_
280
+ _See code: [src/commands/force/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/v1.11.1/src/commands/force/org/list.ts)_
208
281
 
209
282
  ## `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]`
210
283
 
@@ -255,6 +328,6 @@ EXAMPLES
255
328
  sfdx force:org:open -u me@my.org -b firefox
256
329
  ```
257
330
 
258
- _See code: [src/commands/force/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/v1.10.1/src/commands/force/org/open.ts)_
331
+ _See code: [src/commands/force/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/v1.11.1/src/commands/force/org/open.ts)_
259
332
 
260
333
  <!-- 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,304 @@
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
+ if (this.flags.setalias) {
171
+ const alias = await core_1.Aliases.create(core_1.Aliases.getDefaultOptions());
172
+ alias.set(this.flags.setalias, username);
173
+ const result = await alias.write();
174
+ this.logger.debug('Set Alias: %s result: %s', this.flags.setalias, result);
175
+ }
176
+ if (this.flags.setdefaultusername) {
177
+ const globalConfig = this.configAggregator.getGlobalConfig();
178
+ globalConfig.set(core_1.Config.DEFAULT_USERNAME, username);
179
+ const result = await globalConfig.write();
180
+ this.logger.debug('Set defaultUsername: %s result: %s', this.flags.setdefaultusername, result);
181
+ }
182
+ }
183
+ async createScratchOrg() {
184
+ this.logger.debug('OK, will do scratch org creation');
185
+ if (!this.hubOrg) {
186
+ throw core_1.SfdxError.create('@salesforce/plugin-org', 'create', 'RequiresDevhubUsernameError');
187
+ }
188
+ // Ensure we have an org config input source.
189
+ if (!this.flags.definitionfile && Object.keys(this.varargs).length === 0) {
190
+ throw new core_1.SfdxError(messages.getMessage('noConfig'));
191
+ }
192
+ this.logger.debug('validation complete');
193
+ let secret;
194
+ if (this.flags.clientid) {
195
+ // If the user supplied a specific client ID, we have no way of knowing if it's
196
+ // a certificate-based Connected App or not. Therefore, we have to assume that
197
+ // we'll need the client secret, so prompt the user for it.
198
+ secret = await this.ux.prompt(messages.getMessage('secretPrompt'), {
199
+ type: 'mask',
200
+ });
201
+ }
202
+ const createCommandOptions = {
203
+ connectedAppConsumerKey: this.flags.clientid,
204
+ durationDays: this.flags.durationdays,
205
+ nonamespace: this.flags.nonamespace,
206
+ noancestors: this.flags.noancestors,
207
+ wait: this.flags.wait,
208
+ retry: this.flags.retry,
209
+ apiversion: this.flags.apiversion,
210
+ definitionfile: this.flags.definitionfile,
211
+ orgConfig: this.varargs,
212
+ clientSecret: secret,
213
+ };
214
+ const { username, scratchOrgInfo, authFields, warnings } = await this.hubOrg.scratchOrgCreate(createCommandOptions);
215
+ await core_1.Lifecycle.getInstance().emit('scratchOrgInfo', scratchOrgInfo);
216
+ await this.setAliasAndDefaultUsername(username);
217
+ // emit postorgcreate event for hook
218
+ const postOrgCreateHookInfo = [authFields].map((element) => ({
219
+ accessToken: element.accessToken,
220
+ clientId: element.clientId,
221
+ created: element.created,
222
+ createdOrgInstance: element.createdOrgInstance,
223
+ devHubUsername: element.devHubUsername,
224
+ expirationDate: element.expirationDate,
225
+ instanceUrl: element.instanceUrl,
226
+ loginUrl: element.loginUrl,
227
+ orgId: element.orgId,
228
+ username: element.username,
229
+ }))[0];
230
+ await core_1.Lifecycle.getInstance().emit('postorgcreate', postOrgCreateHookInfo);
231
+ this.logger.debug(`orgConfig.loginUrl: ${authFields.loginUrl}`);
232
+ this.logger.debug(`orgConfig.instanceUrl: ${authFields.instanceUrl}`);
233
+ this.ux.log(messages.getMessage('scratchOrgCreateSuccess', [authFields.orgId, username]));
234
+ if (warnings.length > 0) {
235
+ warnings.forEach((warning) => {
236
+ this.ux.warn(warning);
237
+ });
238
+ }
239
+ return {
240
+ username,
241
+ scratchOrgInfo,
242
+ authFields,
243
+ warnings,
244
+ orgId: authFields.orgId,
245
+ };
246
+ }
247
+ }
248
+ exports.Create = Create;
249
+ Create.description = messages.getMessage('description');
250
+ Create.examples = messages.getMessage('examples').split(os.EOL);
251
+ Create.supportsDevhubUsername = true;
252
+ Create.supportsUsername = true;
253
+ Create.varargs = true;
254
+ Create.flagsConfig = {
255
+ type: command_1.flags.enum({
256
+ char: 't',
257
+ description: messages.getMessage('flags.type'),
258
+ options: [core_1.OrgTypes.Scratch, core_1.OrgTypes.Sandbox],
259
+ default: core_1.OrgTypes.Scratch,
260
+ }),
261
+ definitionfile: command_1.flags.filepath({
262
+ char: 'f',
263
+ description: messages.getMessage('flags.definitionFile'),
264
+ }),
265
+ nonamespace: command_1.flags.boolean({
266
+ char: 'n',
267
+ description: messages.getMessage('flags.noNamespace'),
268
+ }),
269
+ noancestors: command_1.flags.boolean({
270
+ char: 'c',
271
+ description: messages.getMessage('flags.noAncestors'),
272
+ }),
273
+ clientid: command_1.flags.string({
274
+ char: 'i',
275
+ description: messages.getMessage('flags.clientId'),
276
+ }),
277
+ setdefaultusername: command_1.flags.boolean({
278
+ char: 's',
279
+ description: messages.getMessage('flags.setDefaultUsername'),
280
+ }),
281
+ setalias: command_1.flags.string({
282
+ char: 'a',
283
+ description: messages.getMessage('flags.setAlias'),
284
+ }),
285
+ wait: command_1.flags.minutes({
286
+ char: 'w',
287
+ description: messages.getMessage('flags.wait'),
288
+ min: 6,
289
+ default: kit_1.Duration.minutes(6),
290
+ }),
291
+ durationdays: command_1.flags.integer({
292
+ char: 'd',
293
+ description: messages.getMessage('flags.durationDays'),
294
+ min: 1,
295
+ max: 30,
296
+ }),
297
+ retry: command_1.flags.number({
298
+ hidden: true,
299
+ default: 0,
300
+ max: 10,
301
+ description: messages.getMessage('flags.retry'),
302
+ }),
303
+ };
304
+ //# 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,CA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O,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,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"}
@@ -0,0 +1,12 @@
1
+ import { StatusEvent, ResultEvent } from '@salesforce/core';
2
+ export declare class SandboxReporter {
3
+ static sandboxProgress(update: StatusEvent): 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,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC;QAClF,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,YAAY,cAAc,oBAAoB,GAAG,CAAC;QAElG,OAAO,mBAAmB,oBAAoB,OAAO,iBAAiB,CAAC,MAAM,IAAI,iBAAiB,KAAK,WAAW,EAAE,CAAC;IACvH,CAAC;IAEM,MAAM,CAAC,uBAAuB,CACnC,MAAmB;IACnB,6CAA6C;;QAE7C,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QACjD,MAAM,kBAAkB,GAAG,WAAW,iBAAiB,CAAC,WAAW,IAAI,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;QAEjH,MAAM,IAAI,GAAG;YACX,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,CAAC,EAAE,EAAE;Y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AO,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
+ }
@@ -1 +1 @@
1
- {"version":"1.11.0","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":[]}}}
1
+ {"version":"1.11.1","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.11.0",
4
+ "version": "1.11.1",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
8
8
  "@oclif/config": "^1.18.1",
9
- "@salesforce/command": "^4.2.0",
10
- "@salesforce/core": "^2.31.0",
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,17 +33,17 @@
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.3",
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
49
  "typescript": "^4.4.4"
@@ -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.11.0.crt",
118
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/1.11.0.sig"
119
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/1.11.1.crt",
120
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/1.11.1.sig"
119
121
  }
120
122
  }