@salesforce/plugin-org 4.3.1-dev.0 → 4.3.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/README.md +14 -14
- package/lib/commands/org/create/scratch.js +41 -117
- package/lib/commands/org/create/scratch.js.map +1 -1
- package/lib/commands/org/display.js +5 -3
- package/lib/commands/org/display.js.map +1 -1
- package/lib/shared/orgTypes.d.ts +0 -1
- package/lib/shared/orgTypes.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +4 -15
- package/lib/components/baseComponent.d.ts +0 -21
- package/lib/components/baseComponent.js +0 -51
- package/lib/components/baseComponent.js.map +0 -1
- package/lib/components/spinner.d.ts +0 -26
- package/lib/components/spinner.js +0 -40
- package/lib/components/spinner.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.3.1
|
|
232
|
+
_See code: [src/commands/org/create/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/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.3.1
|
|
386
|
+
_See code: [src/commands/org/create/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/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.3.1
|
|
432
|
+
_See code: [src/commands/org/delete/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/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.3.1
|
|
476
|
+
_See code: [src/commands/org/delete/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/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.3.1
|
|
515
|
+
_See code: [src/commands/org/disable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/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.3.1
|
|
560
|
+
_See code: [src/commands/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/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.3.1
|
|
602
|
+
_See code: [src/commands/org/enable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/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.3.1
|
|
641
|
+
_See code: [src/commands/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/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.3.1
|
|
708
|
+
_See code: [src/commands/org/list/metadata.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/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.3.1
|
|
763
|
+
_See code: [src/commands/org/list/metadata-types.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/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.3.1
|
|
835
|
+
_See code: [src/commands/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/src/commands/org/open.ts)_
|
|
836
836
|
|
|
837
837
|
## `sf org refresh sandbox`
|
|
838
838
|
|
|
@@ -911,7 +911,7 @@ FLAG DESCRIPTIONS
|
|
|
911
911
|
By default, a sandbox auto-activates after a refresh. Use this flag to control sandbox activation manually.
|
|
912
912
|
```
|
|
913
913
|
|
|
914
|
-
_See code: [src/commands/org/refresh/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1
|
|
914
|
+
_See code: [src/commands/org/refresh/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/src/commands/org/refresh/sandbox.ts)_
|
|
915
915
|
|
|
916
916
|
## `sf org resume sandbox`
|
|
917
917
|
|
|
@@ -974,7 +974,7 @@ FLAG DESCRIPTIONS
|
|
|
974
974
|
returns the job ID. To resume checking the sandbox creation, rerun this command.
|
|
975
975
|
```
|
|
976
976
|
|
|
977
|
-
_See code: [src/commands/org/resume/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1
|
|
977
|
+
_See code: [src/commands/org/resume/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/src/commands/org/resume/sandbox.ts)_
|
|
978
978
|
|
|
979
979
|
## `sf org resume scratch`
|
|
980
980
|
|
|
@@ -1021,6 +1021,6 @@ FLAG DESCRIPTIONS
|
|
|
1021
1021
|
The job ID is valid for 24 hours after you start the scratch org creation.
|
|
1022
1022
|
```
|
|
1023
1023
|
|
|
1024
|
-
_See code: [src/commands/org/resume/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1
|
|
1024
|
+
_See code: [src/commands/org/resume/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1/src/commands/org/resume/scratch.ts)_
|
|
1025
1025
|
|
|
1026
1026
|
<!-- commandsstop -->
|
|
@@ -4,124 +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 { Lifecycle, Messages, Org, scratchOrgCreate, scratchOrgLifecycleEventName,
|
|
7
|
+
import { Lifecycle, Messages, Org, scratchOrgCreate, scratchOrgLifecycleEventName, SfError, } from '@salesforce/core';
|
|
8
8
|
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
9
9
|
import { Duration } from '@salesforce/kit';
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import { Box, Newline, Text } from 'ink';
|
|
12
|
-
import { capitalCase } from 'change-case';
|
|
13
|
-
import { Spinner, SpinnerOrError } from '../../../components/spinner.js';
|
|
14
10
|
import { buildScratchOrgRequest } from '../../../shared/scratchOrgRequest.js';
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
function Status(props) {
|
|
18
|
-
return (React.createElement(Box, { flexDirection: "column" },
|
|
19
|
-
React.createElement(Text, { bold: true }, "Creating Scratch Org"),
|
|
20
|
-
React.createElement(Box, { flexDirection: "column", marginRight: 2, padding: 1 },
|
|
21
|
-
(props.data?.scratchOrgInfo?.Id && (React.createElement(Text, null,
|
|
22
|
-
"Request Id: ",
|
|
23
|
-
formatRequest(props.baseUrl, props.data?.scratchOrgInfo?.Id)))) ?? (React.createElement(Box, null,
|
|
24
|
-
React.createElement(Text, null, "Request Id: "),
|
|
25
|
-
React.createElement(SpinnerOrError, { error: props.error, type: "simpleDotsScrolling" }))),
|
|
26
|
-
(props.data?.scratchOrgInfo?.ScratchOrg && (React.createElement(Text, null,
|
|
27
|
-
"OrgId: ",
|
|
28
|
-
formatOrgId(props.data?.scratchOrgInfo?.ScratchOrg)))) ?? (React.createElement(Box, null,
|
|
29
|
-
React.createElement(Text, null, "OrgId: "),
|
|
30
|
-
React.createElement(SpinnerOrError, { error: props.error, type: "simpleDotsScrolling" }))),
|
|
31
|
-
(props.data?.scratchOrgInfo?.SignupUsername && (React.createElement(Text, null,
|
|
32
|
-
"Username: ",
|
|
33
|
-
formatUsername(props.data?.scratchOrgInfo?.SignupUsername)))) ?? (React.createElement(Box, null,
|
|
34
|
-
React.createElement(Text, null, "Username: "),
|
|
35
|
-
React.createElement(SpinnerOrError, { error: props.error, type: "simpleDotsScrolling" })))),
|
|
36
|
-
React.createElement(Box, { flexDirection: "column" }, scratchOrgLifecycleStages.map((stage, stageIndex) => {
|
|
37
|
-
// current stage
|
|
38
|
-
if (props.data.stage === stage && stage !== 'done')
|
|
39
|
-
return (React.createElement(Box, { key: stage },
|
|
40
|
-
React.createElement(SpinnerOrError, { isBold: true, error: props.error, type: "arc" }),
|
|
41
|
-
React.createElement(Text, { bold: true, color: "magenta" },
|
|
42
|
-
' ',
|
|
43
|
-
capitalCase(stage))));
|
|
44
|
-
// completed stages
|
|
45
|
-
if (scratchOrgLifecycleStages.indexOf(props.data.stage) > stageIndex)
|
|
46
|
-
return (React.createElement(Text, { key: stage, bold: true, color: "green" },
|
|
47
|
-
"\u2713 ",
|
|
48
|
-
capitalCase(stage)));
|
|
49
|
-
// done stage
|
|
50
|
-
if (props.data.stage === stage && stage === 'done')
|
|
51
|
-
return (React.createElement(Text, { key: stage, bold: true, color: "blue" }, capitalCase(stage)));
|
|
52
|
-
if (stage !== 'done') {
|
|
53
|
-
// future stage
|
|
54
|
-
return (React.createElement(Text, { key: stage, color: "dim" },
|
|
55
|
-
"\u25FC ",
|
|
56
|
-
capitalCase(stage)));
|
|
57
|
-
}
|
|
58
|
-
})),
|
|
59
|
-
props.data?.stage === 'done' && (React.createElement(Text, { bold: true, color: "green" },
|
|
60
|
-
React.createElement(Newline, null),
|
|
61
|
-
messages.getMessage('success')))));
|
|
62
|
-
}
|
|
63
|
-
class CreateScratchView extends BaseComponent {
|
|
64
|
-
state = {};
|
|
65
|
-
constructor(props) {
|
|
66
|
-
super(props);
|
|
67
|
-
}
|
|
68
|
-
async componentDidMount() {
|
|
69
|
-
if (!this.props.async) {
|
|
70
|
-
const lifecycle = Lifecycle.getInstance();
|
|
71
|
-
lifecycle.on(scratchOrgLifecycleEventName, async (data) => {
|
|
72
|
-
this.setState({ data });
|
|
73
|
-
return Promise.resolve();
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
try {
|
|
77
|
-
const { username, scratchOrgInfo, authFields, warnings } = await scratchOrgCreate(this.props.createCommandOptions);
|
|
78
|
-
if (!scratchOrgInfo) {
|
|
79
|
-
this.setError(new SfError('The scratch org did not return with any information'));
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
this.setState({ scratchOrgInfoId: scratchOrgInfo.Id });
|
|
83
|
-
}
|
|
84
|
-
this.setState({
|
|
85
|
-
result: {
|
|
86
|
-
username,
|
|
87
|
-
scratchOrgInfo,
|
|
88
|
-
authFields,
|
|
89
|
-
warnings,
|
|
90
|
-
orgId: authFields?.orgId,
|
|
91
|
-
},
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
if (error instanceof SfError && error.name === 'ScratchOrgInfoTimeoutError') {
|
|
96
|
-
this.setError(error);
|
|
97
|
-
const scratchOrgInfoId = error.data.scratchOrgInfoId;
|
|
98
|
-
this.setState({ showResumeMessage: true, scratchOrgInfoId });
|
|
99
|
-
}
|
|
100
|
-
if (error instanceof SfError || error instanceof Error) {
|
|
101
|
-
this.setError(error);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
render() {
|
|
106
|
-
if (this.props.async) {
|
|
107
|
-
if (this.state.scratchOrgInfoId) {
|
|
108
|
-
return (React.createElement(Text, { color: "dim" }, messages.getMessage('action.resume', [this.props.config.bin, this.state.scratchOrgInfoId])));
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
return (React.createElement(Box, null,
|
|
112
|
-
React.createElement(Text, null, "Requesting Scratch Org (will not wait for completion because --async) "),
|
|
113
|
-
React.createElement(Spinner, { type: "dots" })));
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (this.state.data) {
|
|
117
|
-
return (React.createElement(Box, { flexDirection: "column" },
|
|
118
|
-
React.createElement(Status, { data: this.state.data, baseUrl: this.props.baseUrl, error: this.getError() }),
|
|
119
|
-
this.state.showResumeMessage && this.state.scratchOrgInfoId && (React.createElement(Box, { flexDirection: "column" },
|
|
120
|
-
React.createElement(Newline, null),
|
|
121
|
-
React.createElement(Text, { color: "dim" }, messages.getMessage('action.resume', [this.props.config.bin, this.state.scratchOrgInfoId]))))));
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
11
|
+
import { buildStatus } from '../../../shared/scratchOrgOutput.js';
|
|
12
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
125
13
|
const messages = Messages.loadMessages('@salesforce/plugin-org', 'create_scratch');
|
|
126
14
|
const definitionFileHelpGroupName = 'Definition File Override';
|
|
127
15
|
export default class OrgCreateScratch extends SfCommand {
|
|
@@ -254,14 +142,50 @@ export default class OrgCreateScratch extends SfCommand {
|
|
|
254
142
|
}),
|
|
255
143
|
};
|
|
256
144
|
async run() {
|
|
145
|
+
const lifecycle = Lifecycle.getInstance();
|
|
257
146
|
const { flags } = await this.parse(OrgCreateScratch);
|
|
258
147
|
const baseUrl = flags['target-dev-hub'].getField(Org.Fields.INSTANCE_URL)?.toString();
|
|
259
148
|
if (!baseUrl) {
|
|
260
149
|
throw new SfError('No instance URL found for the dev hub');
|
|
261
150
|
}
|
|
262
151
|
const createCommandOptions = await buildScratchOrgRequest(flags, flags['client-id'] ? await this.secretPrompt({ message: messages.getMessage('prompt.secret') }) : undefined);
|
|
263
|
-
|
|
264
|
-
|
|
152
|
+
let lastStatus;
|
|
153
|
+
if (!flags.async) {
|
|
154
|
+
lifecycle.on(scratchOrgLifecycleEventName, async (data) => {
|
|
155
|
+
lastStatus = buildStatus(data, baseUrl);
|
|
156
|
+
this.spinner.status = lastStatus;
|
|
157
|
+
return Promise.resolve();
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
this.log();
|
|
161
|
+
this.spinner.start(flags.async ? 'Requesting Scratch Org (will not wait for completion because --async)' : 'Creating Scratch Org');
|
|
162
|
+
try {
|
|
163
|
+
const { username, scratchOrgInfo, authFields, warnings } = await scratchOrgCreate(createCommandOptions);
|
|
164
|
+
this.spinner.stop(lastStatus);
|
|
165
|
+
if (!scratchOrgInfo) {
|
|
166
|
+
throw new SfError('The scratch org did not return with any information');
|
|
167
|
+
}
|
|
168
|
+
this.log();
|
|
169
|
+
if (flags.async) {
|
|
170
|
+
this.info(messages.getMessage('action.resume', [this.config.bin, scratchOrgInfo.Id]));
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
this.logSuccess(messages.getMessage('success'));
|
|
174
|
+
}
|
|
175
|
+
return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
if (error instanceof SfError && error.name === 'ScratchOrgInfoTimeoutError') {
|
|
179
|
+
this.spinner.stop(lastStatus);
|
|
180
|
+
const scratchOrgInfoId = error.data.scratchOrgInfoId;
|
|
181
|
+
const resumeMessage = messages.getMessage('action.resume', [this.config.bin, scratchOrgInfoId]);
|
|
182
|
+
this.info(resumeMessage);
|
|
183
|
+
this.error('The scratch org did not complete within your wait time', { code: '69', exit: 69 });
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
throw error;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
265
189
|
}
|
|
266
190
|
}
|
|
267
191
|
//# sourceMappingURL=scratch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scratch.js","sourceRoot":"","sources":["../../../../src/commands/org/create/scratch.
|
|
1
|
+
{"version":3,"file":"scratch.js","sourceRoot":"","sources":["../../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AI,EAAE,EAAE,EAAE,CAAC,CAAC;YACjG,CAAC;iBAAM,CAAC;gBACN,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC"}
|
|
@@ -44,7 +44,7 @@ export class OrgDisplayCommand extends SfCommand {
|
|
|
44
44
|
const authInfo = await AuthInfo.create({ username: this.org.getUsername() });
|
|
45
45
|
const fields = authInfo.getFields(true);
|
|
46
46
|
const isScratchOrg = Boolean(fields.devHubUsername);
|
|
47
|
-
const scratchOrgInfo = isScratchOrg && fields.orgId ? await this.getScratchOrgInformation(fields.orgId) : {};
|
|
47
|
+
const scratchOrgInfo = isScratchOrg && fields.orgId ? await this.getScratchOrgInformation(fields.orgId, fields.username) : {};
|
|
48
48
|
const returnValue = {
|
|
49
49
|
// renamed properties
|
|
50
50
|
id: fields.orgId,
|
|
@@ -83,11 +83,13 @@ export class OrgDisplayCommand extends SfCommand {
|
|
|
83
83
|
value: { header: 'VALUE' },
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
async getScratchOrgInformation(orgId) {
|
|
86
|
+
async getScratchOrgInformation(orgId, username) {
|
|
87
87
|
const hubOrg = await this.org.getDevHubOrg();
|
|
88
88
|
// we know this is a scratch org so it must have a hubOrg and that'll have a username
|
|
89
89
|
const hubUsername = hubOrg?.getUsername();
|
|
90
|
-
|
|
90
|
+
// this query can return multiple records that match the 15 char ID because `ScratchOrgInfo.ScratchOrg` isn't a case-sensitive field
|
|
91
|
+
// so we look for the record that matches the scratch org username in the auth file.
|
|
92
|
+
const result = (await OrgListUtil.retrieveScratchOrgInfoFromDevHub(hubUsername, [trimTo15(orgId)])).find((rec) => rec.SignupUsername === username);
|
|
91
93
|
if (result) {
|
|
92
94
|
return {
|
|
93
95
|
status: result.Status,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../../src/commands/org/display.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,EAC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WAAW,CAAC,gCAAgC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CACtG,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,cAAc,KAAK,QAAQ,CACzC,CAAC;QAEF,IAAI,MAAM,EAAE,CAAC;YACX,OAAO;gBACL,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,QAAQ,EAAE,WAAW;gBACrB,cAAc,EAAE,MAAM,CAAC,cAAc;gBACrC,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,QAAQ;gBACrC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,SAAS,EAAE,6FAA6F;gBACnI,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,SAAS,EAAE,wBAAwB;gBAClE,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,cAAc,EAAE,MAAM,CAAC,cAAc;aACtC,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,uBAAuB,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,eAAe,EAAE;YAC/G,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;SAC9C,CAAC,CAAC;IACL,CAAC"}
|
package/lib/shared/orgTypes.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ export type FullyPopulatedScratchOrgFields = ScratchOrgFields & ExtendedAuthFiel
|
|
|
34
34
|
isExpired: boolean;
|
|
35
35
|
};
|
|
36
36
|
export type ScratchOrgInfoSObject = {
|
|
37
|
-
Id: string;
|
|
38
37
|
CreatedDate: string;
|
|
39
38
|
Status: 'New' | 'Deleted' | 'Active' | 'Error';
|
|
40
39
|
ExpirationDate: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orgTypes.js","sourceRoot":"","sources":["../../src/shared/orgTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"orgTypes.js","sourceRoot":"","sources":["../../src/shared/orgTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8FH,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,6CAAuB,CAAA;IACvB,oDAA8B,CAAA;IAC9B,yCAAmB,CAAA;IACnB,mCAAa,CAAA;AACf,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B"}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-org",
|
|
3
3
|
"description": "Commands to interact with Salesforce orgs",
|
|
4
|
-
"version": "4.3.1
|
|
4
|
+
"version": "4.3.1",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -12,11 +12,8 @@
|
|
|
12
12
|
"@salesforce/source-deploy-retrieve": "^12.0.1",
|
|
13
13
|
"ansis": "^3.2.0",
|
|
14
14
|
"change-case": "^5.4.4",
|
|
15
|
-
"cli-spinners": "^2",
|
|
16
|
-
"ink": "^5.0.1",
|
|
17
15
|
"is-wsl": "^3.1.0",
|
|
18
|
-
"open": "^10.1.0"
|
|
19
|
-
"react": "^18.3.1"
|
|
16
|
+
"open": "^10.1.0"
|
|
20
17
|
},
|
|
21
18
|
"devDependencies": {
|
|
22
19
|
"@oclif/plugin-command-snapshot": "^5.2.3",
|
|
@@ -24,11 +21,6 @@
|
|
|
24
21
|
"@salesforce/dev-scripts": "^10.2.2",
|
|
25
22
|
"@salesforce/plugin-command-reference": "^3.1.5",
|
|
26
23
|
"@salesforce/ts-sinon": "1.4.22",
|
|
27
|
-
"@types/react": "^18.3.3",
|
|
28
|
-
"eslint-config-xo": "^0.45.0",
|
|
29
|
-
"eslint-config-xo-react": "^0.27.0",
|
|
30
|
-
"eslint-plugin-react": "^7.34.3",
|
|
31
|
-
"eslint-plugin-react-hooks": "^4.6.2",
|
|
32
24
|
"eslint-plugin-sf-plugin": "^1.18.8",
|
|
33
25
|
"moment": "^2.30.1",
|
|
34
26
|
"oclif": "^4.13.9",
|
|
@@ -94,9 +86,6 @@
|
|
|
94
86
|
"description": "Manage your sandbox and scratch orgs."
|
|
95
87
|
}
|
|
96
88
|
}
|
|
97
|
-
},
|
|
98
|
-
"foo": {
|
|
99
|
-
"description": "description for foo"
|
|
100
89
|
}
|
|
101
90
|
},
|
|
102
91
|
"flexibleTaxonomy": true,
|
|
@@ -244,7 +233,7 @@
|
|
|
244
233
|
"exports": "./lib/index.js",
|
|
245
234
|
"type": "module",
|
|
246
235
|
"sfdx": {
|
|
247
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/4.3.1
|
|
248
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/4.3.1
|
|
236
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/4.3.1.crt",
|
|
237
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/4.3.1.sig"
|
|
249
238
|
}
|
|
250
239
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Instance } from 'ink';
|
|
3
|
-
import { SfError } from '@salesforce/core';
|
|
4
|
-
declare const ERROR_KEY: unique symbol;
|
|
5
|
-
declare const Context: React.Context<(_state: any) => void>;
|
|
6
|
-
type BaseState<T = Record<string | symbol, unknown>> = T & {
|
|
7
|
-
readonly [ERROR_KEY]?: SfError | Error;
|
|
8
|
-
};
|
|
9
|
-
export declare abstract class BaseComponent<Props = Record<string, unknown>, State = Readonly<BaseState>> extends React.Component<Props, State> {
|
|
10
|
-
static contextType: React.Context<(_state: any) => void>;
|
|
11
|
-
context: React.ContextType<typeof Context>;
|
|
12
|
-
private error;
|
|
13
|
-
componentWillUnmount(): void;
|
|
14
|
-
setError(error: SfError | Error | undefined): void;
|
|
15
|
-
getError(): SfError | Error | undefined;
|
|
16
|
-
}
|
|
17
|
-
export declare function render<T extends Record<string | symbol, unknown>>(component: React.ReactElement, jsonEnabled?: boolean): Promise<{
|
|
18
|
-
instance: Instance;
|
|
19
|
-
finalState: T;
|
|
20
|
-
}>;
|
|
21
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2023, 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 { WriteStream } from 'node:tty';
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import { render as inkRender } from 'ink';
|
|
10
|
-
const ERROR_KEY = Symbol('error');
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
|
12
|
-
const Context = React.createContext((_state) => { });
|
|
13
|
-
export class BaseComponent extends React.Component {
|
|
14
|
-
static contextType = Context;
|
|
15
|
-
error;
|
|
16
|
-
componentWillUnmount() {
|
|
17
|
-
this.context(this.state);
|
|
18
|
-
}
|
|
19
|
-
setError(error) {
|
|
20
|
-
this.error = error;
|
|
21
|
-
this.context({ ...this.state, [ERROR_KEY]: error });
|
|
22
|
-
}
|
|
23
|
-
getError() {
|
|
24
|
-
return this.error;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function getStream(channel, jsonEnabled) {
|
|
28
|
-
if (jsonEnabled) {
|
|
29
|
-
// If JSON is enabled, we need to return a stream that does nothing
|
|
30
|
-
const stream = new WriteStream(0);
|
|
31
|
-
stream.write = () => true;
|
|
32
|
-
return stream;
|
|
33
|
-
}
|
|
34
|
-
return process[channel];
|
|
35
|
-
}
|
|
36
|
-
export async function render(component, jsonEnabled = false) {
|
|
37
|
-
let finalState = {};
|
|
38
|
-
const cb = (state) => {
|
|
39
|
-
finalState = { ...finalState, ...state };
|
|
40
|
-
};
|
|
41
|
-
const instance = inkRender(React.createElement(Context.Provider, { value: cb }, component), {
|
|
42
|
-
stdout: getStream('stdout', jsonEnabled),
|
|
43
|
-
stderr: getStream('stderr', jsonEnabled),
|
|
44
|
-
});
|
|
45
|
-
await instance.waitUntilExit();
|
|
46
|
-
if (finalState[ERROR_KEY]) {
|
|
47
|
-
throw finalState[ERROR_KEY];
|
|
48
|
-
}
|
|
49
|
-
return { instance, finalState };
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=baseComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"baseComponent.js","sourceRoot":"","sources":["../../src/components/baseComponent.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,SAAS,EAAY,MAAM,KAAK,CAAC;AAGpD,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAElC,iGAAiG;AACjG,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,MAAW,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;AAMzD,MAAM,OAAgB,aAGpB,SAAQ,KAAK,CAAC,SAAuB;IAC9B,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC;IAK5B,KAAK,CAA8B;IAEpC,oBAAoB;QACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAEM,QAAQ,CAAC,KAAkC;QAChD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,KA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
export type UseSpinnerProps = {
|
|
4
|
-
/**
|
|
5
|
-
* Type of a spinner.
|
|
6
|
-
* See [cli-spinners](https://github.com/sindresorhus/cli-spinners) for available spinners.
|
|
7
|
-
*
|
|
8
|
-
* @default dots
|
|
9
|
-
*/
|
|
10
|
-
readonly type?: SpinnerName;
|
|
11
|
-
};
|
|
12
|
-
export type UseSpinnerResult = {
|
|
13
|
-
frame: string;
|
|
14
|
-
};
|
|
15
|
-
export declare function useSpinner({ type }: UseSpinnerProps): UseSpinnerResult;
|
|
16
|
-
export type SpinnerProps = UseSpinnerProps & {
|
|
17
|
-
/**
|
|
18
|
-
* Label to show near the spinner.
|
|
19
|
-
*/
|
|
20
|
-
readonly label?: string;
|
|
21
|
-
readonly isBold?: boolean;
|
|
22
|
-
};
|
|
23
|
-
export declare function Spinner({ isBold, label, type }: SpinnerProps): JSX.Element;
|
|
24
|
-
export declare function SpinnerOrError({ error, ...props }: SpinnerProps & {
|
|
25
|
-
readonly error?: Error;
|
|
26
|
-
}): JSX.Element;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024, 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 React, { useEffect, useState } from 'react';
|
|
8
|
-
import spinners from 'cli-spinners';
|
|
9
|
-
import { Box, Text } from 'ink';
|
|
10
|
-
export function useSpinner({ type = 'dots' }) {
|
|
11
|
-
const [frame, setFrame] = useState(0);
|
|
12
|
-
const spinner = spinners[type];
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const timer = setInterval(() => {
|
|
15
|
-
setFrame((previousFrame) => {
|
|
16
|
-
const isLastFrame = previousFrame === spinner.frames.length - 1;
|
|
17
|
-
return isLastFrame ? 0 : previousFrame + 1;
|
|
18
|
-
});
|
|
19
|
-
}, spinner.interval);
|
|
20
|
-
return () => {
|
|
21
|
-
clearInterval(timer);
|
|
22
|
-
};
|
|
23
|
-
}, [spinner]);
|
|
24
|
-
return {
|
|
25
|
-
frame: spinner.frames[frame] ?? '',
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export function Spinner({ isBold, label, type }) {
|
|
29
|
-
const { frame } = useSpinner({ type });
|
|
30
|
-
return (React.createElement(Box, null,
|
|
31
|
-
isBold ? (React.createElement(Text, { bold: true, color: "magenta" }, frame)) : (React.createElement(Text, { color: "magenta" }, frame)),
|
|
32
|
-
label && React.createElement(Text, null, label)));
|
|
33
|
-
}
|
|
34
|
-
export function SpinnerOrError({ error, ...props }) {
|
|
35
|
-
if (error) {
|
|
36
|
-
return React.createElement(Text, { color: "red" }, "\u2716");
|
|
37
|
-
}
|
|
38
|
-
return React.createElement(Spinner, { ...props });
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=spinner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/components/spinner.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,QAA8B,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAgBhC,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,GAAG,MAAM,EAAmB;IAC3D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE/B,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;YAC7B,QAAQ,CAAC,CAAC,aAAa,EAAE,EAAE;gBACzB,MAAM,WAAW,GA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