@salesforce/plugin-org 4.6.0 → 4.6.1-dev.0
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/README.md +14 -14
- package/lib/commands/org/create/scratch.js +46 -15
- package/lib/commands/org/create/scratch.js.map +1 -1
- package/lib/commands/org/resume/scratch.js +43 -9
- package/lib/commands/org/resume/scratch.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +6 -4
- package/lib/shared/scratchOrgOutput.d.ts +0 -9
- package/lib/shared/scratchOrgOutput.js +0 -36
- package/lib/shared/scratchOrgOutput.js.map +0 -1
package/README.md
CHANGED
|
@@ -229,7 +229,7 @@ FLAG DESCRIPTIONS
|
|
|
229
229
|
sandbox.
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
-
_See code: [src/commands/org/create/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/create/sandbox.ts)_
|
|
232
|
+
_See code: [src/commands/org/create/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/create/sandbox.ts)_
|
|
233
233
|
|
|
234
234
|
## `sf org create scratch`
|
|
235
235
|
|
|
@@ -383,7 +383,7 @@ FLAG DESCRIPTIONS
|
|
|
383
383
|
Omit this flag to have Salesforce generate a unique username for your org.
|
|
384
384
|
```
|
|
385
385
|
|
|
386
|
-
_See code: [src/commands/org/create/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/create/scratch.ts)_
|
|
386
|
+
_See code: [src/commands/org/create/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/create/scratch.ts)_
|
|
387
387
|
|
|
388
388
|
## `sf org delete sandbox`
|
|
389
389
|
|
|
@@ -429,7 +429,7 @@ EXAMPLES
|
|
|
429
429
|
$ sf org delete sandbox --target-org my-sandbox --no-prompt
|
|
430
430
|
```
|
|
431
431
|
|
|
432
|
-
_See code: [src/commands/org/delete/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/delete/sandbox.ts)_
|
|
432
|
+
_See code: [src/commands/org/delete/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/delete/sandbox.ts)_
|
|
433
433
|
|
|
434
434
|
## `sf org delete scratch`
|
|
435
435
|
|
|
@@ -473,7 +473,7 @@ EXAMPLES
|
|
|
473
473
|
$ sf org delete scratch --target-org my-scratch-org --no-prompt
|
|
474
474
|
```
|
|
475
475
|
|
|
476
|
-
_See code: [src/commands/org/delete/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/delete/scratch.ts)_
|
|
476
|
+
_See code: [src/commands/org/delete/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/delete/scratch.ts)_
|
|
477
477
|
|
|
478
478
|
## `sf org disable tracking`
|
|
479
479
|
|
|
@@ -512,7 +512,7 @@ EXAMPLES
|
|
|
512
512
|
$ sf org disable tracking
|
|
513
513
|
```
|
|
514
514
|
|
|
515
|
-
_See code: [src/commands/org/disable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/disable/tracking.ts)_
|
|
515
|
+
_See code: [src/commands/org/disable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/disable/tracking.ts)_
|
|
516
516
|
|
|
517
517
|
## `sf org display`
|
|
518
518
|
|
|
@@ -557,7 +557,7 @@ EXAMPLES
|
|
|
557
557
|
$ sf org display --target-org TestOrg1 --verbose
|
|
558
558
|
```
|
|
559
559
|
|
|
560
|
-
_See code: [src/commands/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/display.ts)_
|
|
560
|
+
_See code: [src/commands/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/display.ts)_
|
|
561
561
|
|
|
562
562
|
## `sf org enable tracking`
|
|
563
563
|
|
|
@@ -599,7 +599,7 @@ EXAMPLES
|
|
|
599
599
|
$ sf org enable tracking
|
|
600
600
|
```
|
|
601
601
|
|
|
602
|
-
_See code: [src/commands/org/enable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/enable/tracking.ts)_
|
|
602
|
+
_See code: [src/commands/org/enable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/enable/tracking.ts)_
|
|
603
603
|
|
|
604
604
|
## `sf org list`
|
|
605
605
|
|
|
@@ -638,7 +638,7 @@ EXAMPLES
|
|
|
638
638
|
$ sf org list --clean
|
|
639
639
|
```
|
|
640
640
|
|
|
641
|
-
_See code: [src/commands/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/list.ts)_
|
|
641
|
+
_See code: [src/commands/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/list.ts)_
|
|
642
642
|
|
|
643
643
|
## `sf org list metadata`
|
|
644
644
|
|
|
@@ -705,7 +705,7 @@ FLAG DESCRIPTIONS
|
|
|
705
705
|
Examples of metadata types that use folders are Dashboard, Document, EmailTemplate, and Report.
|
|
706
706
|
```
|
|
707
707
|
|
|
708
|
-
_See code: [src/commands/org/list/metadata.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/list/metadata.ts)_
|
|
708
|
+
_See code: [src/commands/org/list/metadata.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/list/metadata.ts)_
|
|
709
709
|
|
|
710
710
|
## `sf org list metadata-types`
|
|
711
711
|
|
|
@@ -760,7 +760,7 @@ FLAG DESCRIPTIONS
|
|
|
760
760
|
Override the api version used for api requests made by this command
|
|
761
761
|
```
|
|
762
762
|
|
|
763
|
-
_See code: [src/commands/org/list/metadata-types.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/list/metadata-types.ts)_
|
|
763
|
+
_See code: [src/commands/org/list/metadata-types.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/list/metadata-types.ts)_
|
|
764
764
|
|
|
765
765
|
## `sf org open`
|
|
766
766
|
|
|
@@ -832,7 +832,7 @@ EXAMPLES
|
|
|
832
832
|
$ sf org open --source-file force-app/main/default/flows/Hello.flow-meta.xml
|
|
833
833
|
```
|
|
834
834
|
|
|
835
|
-
_See code: [src/commands/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/open.ts)_
|
|
835
|
+
_See code: [src/commands/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/open.ts)_
|
|
836
836
|
|
|
837
837
|
## `sf org refresh sandbox`
|
|
838
838
|
|
|
@@ -909,7 +909,7 @@ FLAG DESCRIPTIONS
|
|
|
909
909
|
By default, a sandbox auto-activates after a refresh. Use this flag to control sandbox activation manually.
|
|
910
910
|
```
|
|
911
911
|
|
|
912
|
-
_See code: [src/commands/org/refresh/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/refresh/sandbox.ts)_
|
|
912
|
+
_See code: [src/commands/org/refresh/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/refresh/sandbox.ts)_
|
|
913
913
|
|
|
914
914
|
## `sf org resume sandbox`
|
|
915
915
|
|
|
@@ -972,7 +972,7 @@ FLAG DESCRIPTIONS
|
|
|
972
972
|
returns the job ID. To resume checking the sandbox creation, rerun this command.
|
|
973
973
|
```
|
|
974
974
|
|
|
975
|
-
_See code: [src/commands/org/resume/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/resume/sandbox.ts)_
|
|
975
|
+
_See code: [src/commands/org/resume/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/resume/sandbox.ts)_
|
|
976
976
|
|
|
977
977
|
## `sf org resume scratch`
|
|
978
978
|
|
|
@@ -1019,6 +1019,6 @@ FLAG DESCRIPTIONS
|
|
|
1019
1019
|
The job ID is valid for 24 hours after you start the scratch org creation.
|
|
1020
1020
|
```
|
|
1021
1021
|
|
|
1022
|
-
_See code: [src/commands/org/resume/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.0/src/commands/org/resume/scratch.ts)_
|
|
1022
|
+
_See code: [src/commands/org/resume/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.6.1-dev.0/src/commands/org/resume/scratch.ts)_
|
|
1023
1023
|
|
|
1024
1024
|
<!-- commandsstop -->
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* Licensed under the BSD 3-Clause license.
|
|
5
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { MultiStageOutput } from '@oclif/multi-stage-output';
|
|
8
|
+
import { Lifecycle, Messages, Org, scratchOrgCreate, scratchOrgLifecycleEventName, scratchOrgLifecycleStages, SfError, } from '@salesforce/core';
|
|
8
9
|
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
9
10
|
import { Duration } from '@salesforce/kit';
|
|
11
|
+
import terminalLink from 'terminal-link';
|
|
10
12
|
import { buildScratchOrgRequest } from '../../../shared/scratchOrgRequest.js';
|
|
11
|
-
import { buildStatus } from '../../../shared/scratchOrgOutput.js';
|
|
12
13
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
13
14
|
const messages = Messages.loadMessages('@salesforce/plugin-org', 'create_scratch');
|
|
14
15
|
const definitionFileHelpGroupName = 'Definition File Override';
|
|
@@ -149,24 +150,54 @@ export default class OrgCreateScratch extends SfCommand {
|
|
|
149
150
|
throw new SfError('No instance URL found for the dev hub');
|
|
150
151
|
}
|
|
151
152
|
const createCommandOptions = await buildScratchOrgRequest(flags, flags['client-id'] ? await this.secretPrompt({ message: messages.getMessage('prompt.secret') }) : undefined);
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
153
|
+
const mso = new MultiStageOutput({
|
|
154
|
+
stages: flags.async ? ['prepare request', 'send request', 'done'] : scratchOrgLifecycleStages,
|
|
155
|
+
title: flags.async ? 'Creating Scratch Org (async)' : 'Creating Scratch Org',
|
|
156
|
+
data: { alias: flags.alias },
|
|
157
|
+
jsonEnabled: this.jsonEnabled(),
|
|
158
|
+
postStagesBlock: [
|
|
159
|
+
{
|
|
160
|
+
label: 'Request Id',
|
|
161
|
+
type: 'dynamic-key-value',
|
|
162
|
+
get: (data) => data?.scratchOrgInfo?.Id && terminalLink(data.scratchOrgInfo.Id, `${baseUrl}/${data.scratchOrgInfo.Id}`),
|
|
163
|
+
bold: true,
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
label: 'OrgId',
|
|
167
|
+
type: 'dynamic-key-value',
|
|
168
|
+
get: (data) => data?.scratchOrgInfo?.ScratchOrg,
|
|
169
|
+
bold: true,
|
|
170
|
+
color: 'cyan',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
label: 'Username',
|
|
174
|
+
type: 'dynamic-key-value',
|
|
175
|
+
get: (data) => data?.scratchOrgInfo?.SignupUsername,
|
|
176
|
+
bold: true,
|
|
177
|
+
color: 'cyan',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
label: 'Alias',
|
|
181
|
+
type: 'static-key-value',
|
|
182
|
+
get: (data) => data?.alias,
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
});
|
|
186
|
+
lifecycle.on(scratchOrgLifecycleEventName, async (data) => {
|
|
187
|
+
mso.skipTo(data.stage, data);
|
|
188
|
+
if (data.stage === 'done') {
|
|
189
|
+
mso.stop();
|
|
190
|
+
}
|
|
191
|
+
return Promise.resolve();
|
|
192
|
+
});
|
|
162
193
|
try {
|
|
163
194
|
const { username, scratchOrgInfo, authFields, warnings } = await scratchOrgCreate(createCommandOptions);
|
|
164
|
-
this.spinner.stop(lastStatus);
|
|
165
195
|
if (!scratchOrgInfo) {
|
|
166
196
|
throw new SfError('The scratch org did not return with any information');
|
|
167
197
|
}
|
|
168
|
-
this.log();
|
|
169
198
|
if (flags.async) {
|
|
199
|
+
mso.skipTo('done', { scratchOrgInfo });
|
|
200
|
+
mso.stop();
|
|
170
201
|
this.info(messages.getMessage('action.resume', [this.config.bin, scratchOrgInfo.Id]));
|
|
171
202
|
}
|
|
172
203
|
else {
|
|
@@ -175,8 +206,8 @@ export default class OrgCreateScratch extends SfCommand {
|
|
|
175
206
|
return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };
|
|
176
207
|
}
|
|
177
208
|
catch (error) {
|
|
209
|
+
mso.error();
|
|
178
210
|
if (error instanceof SfError && error.name === 'ScratchOrgInfoTimeoutError') {
|
|
179
|
-
this.spinner.stop(lastStatus);
|
|
180
211
|
const scratchOrgInfoId = error.data.scratchOrgInfoId;
|
|
181
212
|
const resumeMessage = messages.getMessage('action.resume', [this.config.bin, scratchOrgInfoId]);
|
|
182
213
|
this.info(resumeMessage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scratch.js","sourceRoot":"","sources":["../../../../src/commands/org/create/scratch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,SAAS,EACT,QAAQ,EACR,GAAG,EACH,gBAAgB,EAEhB,4BAA4B,EAC5B,OAAO,GACR,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"scratch.js","sourceRoot":"","sources":["../../../../src/commands/org/create/scratch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,C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chOrgCache, scratchOrgLifecycleEventName, scratchOrgResume, SfError, } from '@salesforce/core';
|
|
10
|
-
import
|
|
9
|
+
import { Lifecycle, Messages, ScratchOrgCache, scratchOrgLifecycleEventName, scratchOrgLifecycleStages, scratchOrgResume, SfError, } from '@salesforce/core';
|
|
10
|
+
import terminalLink from 'terminal-link';
|
|
11
|
+
import { MultiStageOutput } from '@oclif/multi-stage-output';
|
|
11
12
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
12
13
|
const messages = Messages.loadMessages('@salesforce/plugin-org', 'resume_scratch');
|
|
13
14
|
export default class OrgResumeScratch extends SfCommand {
|
|
@@ -40,23 +41,56 @@ export default class OrgResumeScratch extends SfCommand {
|
|
|
40
41
|
throw messages.createError('error.NoRecentJobId');
|
|
41
42
|
// oclif doesn't know that the exactlyOne flag will ensure that one of these is set, and there we definitely have a jobID.
|
|
42
43
|
assert(jobId);
|
|
43
|
-
const
|
|
44
|
-
|
|
44
|
+
const cached = cache.get(jobId);
|
|
45
|
+
const hubBaseUrl = cached?.hubBaseUrl;
|
|
46
|
+
const mso = new MultiStageOutput({
|
|
47
|
+
stages: scratchOrgLifecycleStages,
|
|
48
|
+
title: 'Resuming Scratch Org',
|
|
49
|
+
data: { alias: cached?.alias },
|
|
50
|
+
jsonEnabled: this.jsonEnabled(),
|
|
51
|
+
postStagesBlock: [
|
|
52
|
+
{
|
|
53
|
+
label: 'Request Id',
|
|
54
|
+
type: 'dynamic-key-value',
|
|
55
|
+
get: (data) => data?.scratchOrgInfo?.Id && terminalLink(data.scratchOrgInfo.Id, `${hubBaseUrl}/${data.scratchOrgInfo.Id}`),
|
|
56
|
+
bold: true,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: 'OrgId',
|
|
60
|
+
type: 'dynamic-key-value',
|
|
61
|
+
get: (data) => data?.scratchOrgInfo?.ScratchOrg,
|
|
62
|
+
bold: true,
|
|
63
|
+
color: 'cyan',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: 'Username',
|
|
67
|
+
type: 'dynamic-key-value',
|
|
68
|
+
get: (data) => data?.scratchOrgInfo?.SignupUsername,
|
|
69
|
+
bold: true,
|
|
70
|
+
color: 'cyan',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: 'Alias',
|
|
74
|
+
type: 'static-key-value',
|
|
75
|
+
get: (data) => data?.alias,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
});
|
|
45
79
|
lifecycle.on(scratchOrgLifecycleEventName, async (data) => {
|
|
46
|
-
|
|
47
|
-
|
|
80
|
+
mso.skipTo(data.stage, data);
|
|
81
|
+
if (data.stage === 'done') {
|
|
82
|
+
mso.stop();
|
|
83
|
+
}
|
|
48
84
|
return Promise.resolve();
|
|
49
85
|
});
|
|
50
|
-
this.log();
|
|
51
|
-
this.spinner.start('Creating Scratch Org');
|
|
52
86
|
try {
|
|
53
87
|
const { username, scratchOrgInfo, authFields, warnings } = await scratchOrgResume(jobId);
|
|
54
|
-
this.spinner.stop(lastStatus);
|
|
55
88
|
this.log();
|
|
56
89
|
this.logSuccess(messages.getMessage('success'));
|
|
57
90
|
return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };
|
|
58
91
|
}
|
|
59
92
|
catch (e) {
|
|
93
|
+
mso.error();
|
|
60
94
|
if (cache.keys() && e instanceof Error && e.name === 'CacheMissError') {
|
|
61
95
|
// we have something in the cache, but it didn't match what the user passed in
|
|
62
96
|
throw messages.createError('error.jobIdMismatch', [jobId]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scratch.js","sourceRoot":"","sources":["../../../../src/commands/org/resume/scratch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,SAAS,EACT,QAAQ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,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC;YACzF,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;YAChD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;QACtF,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,GAAG,CAAC,KAAK,EAAE,CAAC;YAEZ,IAAI,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;gBACtE,8EAA8E;gBAC9E,MAAM,QAAQ,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;YAC7D,CAAC;iBAAM,CAAC;gBACN,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC"}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-org",
|
|
3
3
|
"description": "Commands to interact with Salesforce orgs",
|
|
4
|
-
"version": "4.6.0",
|
|
4
|
+
"version": "4.6.1-dev.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@oclif/core": "^4.0.16",
|
|
9
|
+
"@oclif/multi-stage-output": "^0.7.0",
|
|
9
10
|
"@salesforce/core": "^8.6.1",
|
|
10
11
|
"@salesforce/kit": "^3.2.3",
|
|
11
12
|
"@salesforce/sf-plugins-core": "^11.3.7",
|
|
@@ -13,7 +14,8 @@
|
|
|
13
14
|
"ansis": "^3.2.0",
|
|
14
15
|
"change-case": "^5.4.4",
|
|
15
16
|
"is-wsl": "^3.1.0",
|
|
16
|
-
"open": "^10.1.0"
|
|
17
|
+
"open": "^10.1.0",
|
|
18
|
+
"terminal-link": "^3.0.0"
|
|
17
19
|
},
|
|
18
20
|
"devDependencies": {
|
|
19
21
|
"@oclif/plugin-command-snapshot": "^5.2.15",
|
|
@@ -233,7 +235,7 @@
|
|
|
233
235
|
"exports": "./lib/index.js",
|
|
234
236
|
"type": "module",
|
|
235
237
|
"sfdx": {
|
|
236
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/4.6.0.crt",
|
|
237
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/4.6.0.sig"
|
|
238
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/4.6.1-dev.0.crt",
|
|
239
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/4.6.1-dev.0.sig"
|
|
238
240
|
}
|
|
239
241
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ScratchOrgLifecycleEvent } from '@salesforce/core';
|
|
2
|
-
export declare const buildStatus: (data: ScratchOrgLifecycleEvent, baseUrl: string) => string;
|
|
3
|
-
export declare const formatStage: (currentStage: ScratchOrgLifecycleEvent["stage"]) => string;
|
|
4
|
-
export declare const formatRequest: (baseUrl: string, id?: string) => string;
|
|
5
|
-
export declare const formatUsername: (username?: string) => string;
|
|
6
|
-
export declare const formatOrgId: (id?: string) => string;
|
|
7
|
-
export declare const formatCurrentStage: (stage: string) => string;
|
|
8
|
-
export declare const formatCompletedStage: (stage: string) => string;
|
|
9
|
-
export declare const formatFutureStage: (stage: string) => string;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* Licensed under the BSD 3-Clause license.
|
|
5
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
-
*/
|
|
7
|
-
import { scratchOrgLifecycleStages } from '@salesforce/core';
|
|
8
|
-
import ansis from 'ansis';
|
|
9
|
-
import { capitalCase } from 'change-case';
|
|
10
|
-
import { StandardColors } from '@salesforce/sf-plugins-core';
|
|
11
|
-
const boldBlue = (input) => ansis.rgb(81, 176, 235).bold(input);
|
|
12
|
-
const boldPurple = (input) => ansis.rgb(157, 129, 221).bold(input);
|
|
13
|
-
export const buildStatus = (data, baseUrl) => `
|
|
14
|
-
RequestId: ${formatRequest(baseUrl, data.scratchOrgInfo?.Id)}
|
|
15
|
-
OrgId: ${formatOrgId(data.scratchOrgInfo?.ScratchOrg)}
|
|
16
|
-
Username: ${formatUsername(data.scratchOrgInfo?.SignupUsername)}
|
|
17
|
-
${formatStage(data.stage)}`;
|
|
18
|
-
export const formatStage = (currentStage) => scratchOrgLifecycleStages
|
|
19
|
-
.map((stage, stageIndex) => {
|
|
20
|
-
// current stage
|
|
21
|
-
if (currentStage === stage)
|
|
22
|
-
return formatCurrentStage(stage);
|
|
23
|
-
// completed stages
|
|
24
|
-
if (scratchOrgLifecycleStages.indexOf(currentStage) > stageIndex)
|
|
25
|
-
return formatCompletedStage(stage);
|
|
26
|
-
// future stage
|
|
27
|
-
return formatFutureStage(stage);
|
|
28
|
-
})
|
|
29
|
-
.join('\n');
|
|
30
|
-
export const formatRequest = (baseUrl, id) => `${id ? `${ansis.bold(id)} (${baseUrl}/${id})` : ''}`;
|
|
31
|
-
export const formatUsername = (username) => `${username ? `${boldBlue(username)} ` : ''}`;
|
|
32
|
-
export const formatOrgId = (id) => `${id ? `${boldBlue(id)} ` : ''}`;
|
|
33
|
-
export const formatCurrentStage = (stage) => boldPurple(capitalCase(stage));
|
|
34
|
-
export const formatCompletedStage = (stage) => StandardColors.success.bold(`✓ ${capitalCase(stage)}`);
|
|
35
|
-
export const formatFutureStage = (stage) => StandardColors.info(capitalCase(stage));
|
|
36
|
-
//# sourceMappingURL=scratchOrgOutput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scratchOrgOutput.js","sourceRoot":"","sources":["../../src/shared/scratchOrgOutput.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAA4B,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChF,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAEnF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAA8B,EAAE,OAAe,EAAU,EAAE,CAAC;aAC3E,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;SACnD,WAAW,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC;YACzC,cAAc,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC;EAC7D,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;AAE5B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,YAA+C,EAAU,EAAE,CACrF,yBAAyB;KACtB,GAAG,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;IACzB,gBAAgB;IAChB,IAAI,YAAY,KAAK,KAAK;QAAE,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC7D,mBAAmB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