@salesforce/plugin-org 2.2.24 → 2.3.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 +4 -0
- package/lib/commands/force/org/clone.d.ts +21 -9
- package/lib/commands/force/org/clone.js +52 -83
- package/lib/commands/force/org/clone.js.map +1 -1
- package/lib/commands/force/org/create.d.ts +27 -12
- package/lib/commands/force/org/create.js +87 -106
- package/lib/commands/force/org/create.js.map +1 -1
- package/lib/commands/force/org/delete.d.ts +14 -7
- package/lib/commands/force/org/delete.js +26 -16
- package/lib/commands/force/org/delete.js.map +1 -1
- package/lib/commands/force/org/status.d.ts +18 -6
- package/lib/commands/force/org/status.js +43 -37
- package/lib/commands/force/org/status.js.map +1 -1
- package/lib/commands/org/create/sandbox.d.ts +40 -0
- package/lib/commands/org/create/sandbox.js +245 -0
- package/lib/commands/org/create/sandbox.js.map +1 -0
- package/lib/commands/org/create/scratch.d.ts +30 -0
- package/lib/commands/org/create/scratch.js +183 -0
- package/lib/commands/org/create/scratch.js.map +1 -0
- package/lib/commands/org/delete/sandbox.d.ts +18 -0
- package/lib/commands/org/delete/sandbox.js +59 -0
- package/lib/commands/org/delete/sandbox.js.map +1 -0
- package/lib/commands/org/delete/scratch.d.ts +18 -0
- package/lib/commands/org/delete/scratch.js +52 -0
- package/lib/commands/org/delete/scratch.js.map +1 -0
- package/lib/commands/org/display.d.ts +20 -0
- package/lib/commands/{force/org → org}/display.js +38 -27
- package/lib/commands/org/display.js.map +1 -0
- package/lib/commands/org/list.d.ts +26 -0
- package/lib/commands/org/list.js +192 -0
- package/lib/commands/org/list.js.map +1 -0
- package/lib/commands/org/open.d.ts +25 -0
- package/lib/commands/{force/org → org}/open.js +47 -33
- package/lib/commands/org/open.js.map +1 -0
- package/lib/commands/org/resume/sandbox.d.ts +26 -0
- package/lib/commands/org/resume/sandbox.js +199 -0
- package/lib/commands/org/resume/sandbox.js.map +1 -0
- package/lib/commands/org/resume/scratch.d.ts +14 -0
- package/lib/commands/org/resume/scratch.js +61 -0
- package/lib/commands/org/resume/scratch.js.map +1 -0
- package/lib/shared/orgHighlighter.d.ts +2 -2
- package/lib/shared/orgHighlighter.js +7 -5
- package/lib/shared/orgHighlighter.js.map +1 -1
- package/lib/shared/orgHooks.d.ts +24 -0
- package/lib/shared/orgHooks.js +9 -0
- package/lib/shared/orgHooks.js.map +1 -0
- package/lib/shared/orgListUtil.d.ts +15 -25
- package/lib/shared/orgListUtil.js +71 -81
- package/lib/shared/orgListUtil.js.map +1 -1
- package/lib/shared/orgTypes.d.ts +39 -11
- package/lib/shared/sandboxCommandBase.d.ts +33 -0
- package/lib/shared/sandboxCommandBase.js +168 -0
- package/lib/shared/sandboxCommandBase.js.map +1 -0
- package/lib/shared/sandboxProgress.d.ts +28 -0
- package/lib/shared/sandboxProgress.js +104 -0
- package/lib/shared/sandboxProgress.js.map +1 -0
- package/lib/shared/sandboxReporter.d.ts +1 -1
- package/lib/shared/sandboxRequest.d.ts +9 -0
- package/lib/shared/sandboxRequest.js +58 -0
- package/lib/shared/sandboxRequest.js.map +1 -0
- package/lib/shared/scratchOrgOutput.d.ts +9 -0
- package/lib/shared/scratchOrgOutput.js +47 -0
- package/lib/shared/scratchOrgOutput.js.map +1 -0
- package/lib/shared/stagedProgress.d.ts +33 -0
- package/lib/shared/stagedProgress.js +98 -0
- package/lib/shared/stagedProgress.js.map +1 -0
- package/lib/shared/timeUtils.d.ts +10 -0
- package/lib/shared/timeUtils.js +37 -0
- package/lib/shared/timeUtils.js.map +1 -0
- package/lib/shared/utils.d.ts +1 -1
- package/lib/shared/utils.js.map +1 -1
- package/messages/clone.md +67 -0
- package/messages/create.md +125 -0
- package/messages/create.sandbox.md +123 -0
- package/messages/create_scratch.md +109 -0
- package/messages/delete.md +47 -0
- package/messages/delete_sandbox.md +46 -0
- package/messages/delete_scratch.md +42 -0
- package/messages/display.md +33 -0
- package/messages/list.md +65 -0
- package/messages/messages.md +81 -0
- package/messages/open.md +63 -0
- package/messages/resume.sandbox.md +71 -0
- package/messages/resume_scratch.md +41 -0
- package/messages/sandboxbase.md +17 -0
- package/messages/status.md +33 -0
- package/oclif.manifest.json +1191 -1
- package/package.json +136 -26
- package/lib/commands/force/org/display.d.ts +0 -11
- package/lib/commands/force/org/display.js.map +0 -1
- package/lib/commands/force/org/list.d.ts +0 -15
- package/lib/commands/force/org/list.js +0 -191
- package/lib/commands/force/org/list.js.map +0 -1
- package/lib/commands/force/org/open.d.ts +0 -15
- package/lib/commands/force/org/open.js.map +0 -1
- package/messages/clone.json +0 -24
- package/messages/create.json +0 -37
- package/messages/delete.json +0 -13
- package/messages/display.json +0 -11
- package/messages/list.json +0 -19
- package/messages/messages.json +0 -24
- package/messages/open.json +0 -19
- package/messages/status.json +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../../../src/commands/org/create/sandbox.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iEAAoD;AACpD,2CAAqH;AAGrH,mEAAsE;AACtE,2EAAwE;AAExE,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,CAAC;AAEnF,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,6CAAuB,CAAA;IACvB,oDAA8B,CAAA;IAC9B,yCAAmB,CAAA;IACnB,mCAAa,CAAA;AACf,CAAC,EALW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAK7B;AAED,MAAM,eAAe,GAAG,GAAa,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAI1E,MAAqB,aAAc,SAAQ,uCAAwC;IA6F1E,KAAK,CAAC,GAAG;QACd,IAAI,CAAC,oBAAoB,GAAG,MAAM,IAAI,CAAC,uBAAuB,EAAE,CAAC;QACjE,IAAI,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/D,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,WAAW,EAAE,uBAAK,CAAC,OAAO,CAAC;QACzB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;KACvD,CAAC;IACF,iBAAiB,EAAE,uBAAK,CAAC,OAAO,CAAC;QAC/B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,+BAA+B,CAAC;QAC7D,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,mCAAmC,CAAC;QACrE,OAAO,EAAE,KAAK;KACf,CAAC;CACH,CAAC;AACqB,mBAAK,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Duration } from '@salesforce/kit';
|
|
2
|
+
import { Org } from '@salesforce/core';
|
|
3
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
4
|
+
import { ScratchCreateResponse } from '../../../shared/orgTypes';
|
|
5
|
+
export declare const secretTimeout = 60000;
|
|
6
|
+
export default class EnvCreateScratch extends SfCommand<ScratchCreateResponse> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
static readonly aliases: string[];
|
|
11
|
+
static readonly deprecateAliases = true;
|
|
12
|
+
static readonly state = "beta";
|
|
13
|
+
static readonly flags: {
|
|
14
|
+
alias: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
+
async: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
'set-default': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
'definition-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
18
|
+
'target-dev-hub': import("@oclif/core/lib/interfaces").OptionFlag<Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
19
|
+
'no-ancestors': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
edition: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
21
|
+
'no-namespace': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
22
|
+
'duration-days': import("@oclif/core/lib/interfaces").OptionFlag<Duration | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
23
|
+
wait: import("@oclif/core/lib/interfaces").OptionFlag<Duration | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
24
|
+
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
25
|
+
'client-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
26
|
+
'track-source': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
27
|
+
};
|
|
28
|
+
run(): Promise<ScratchCreateResponse>;
|
|
29
|
+
private clientSecretPrompt;
|
|
30
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
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.secretTimeout = void 0;
|
|
10
|
+
const fs = require("fs");
|
|
11
|
+
const kit_1 = require("@salesforce/kit");
|
|
12
|
+
const core_1 = require("@salesforce/core");
|
|
13
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
14
|
+
const scratchOrgOutput_1 = require("../../../shared/scratchOrgOutput");
|
|
15
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
16
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-org', 'create_scratch');
|
|
17
|
+
exports.secretTimeout = 60000;
|
|
18
|
+
class EnvCreateScratch extends sf_plugins_core_1.SfCommand {
|
|
19
|
+
async run() {
|
|
20
|
+
const lifecycle = core_1.Lifecycle.getInstance();
|
|
21
|
+
const { flags } = await this.parse(EnvCreateScratch);
|
|
22
|
+
const baseUrl = flags['target-dev-hub'].getField(core_1.Org.Fields.INSTANCE_URL)?.toString();
|
|
23
|
+
if (!baseUrl) {
|
|
24
|
+
throw new core_1.SfError('No instance URL found for the dev hub');
|
|
25
|
+
}
|
|
26
|
+
const orgConfig = flags['definition-file']
|
|
27
|
+
? JSON.parse(await fs.promises.readFile(flags['definition-file'], 'utf-8'))
|
|
28
|
+
: { edition: flags.edition };
|
|
29
|
+
const createCommandOptions = {
|
|
30
|
+
hubOrg: flags['target-dev-hub'],
|
|
31
|
+
clientSecret: flags['client-id'] ? await this.clientSecretPrompt() : undefined,
|
|
32
|
+
connectedAppConsumerKey: flags['client-id'],
|
|
33
|
+
durationDays: flags['duration-days'].days,
|
|
34
|
+
nonamespace: flags['no-namespace'],
|
|
35
|
+
noancestors: flags['no-ancestors'],
|
|
36
|
+
wait: flags.async ? kit_1.Duration.minutes(0) : flags.wait,
|
|
37
|
+
apiversion: flags['api-version'],
|
|
38
|
+
orgConfig,
|
|
39
|
+
alias: flags.alias,
|
|
40
|
+
setDefault: flags['set-default'],
|
|
41
|
+
tracksSource: flags['track-source'],
|
|
42
|
+
};
|
|
43
|
+
let lastStatus;
|
|
44
|
+
if (!flags.async) {
|
|
45
|
+
lifecycle.on(core_1.scratchOrgLifecycleEventName, async (data) => {
|
|
46
|
+
lastStatus = (0, scratchOrgOutput_1.buildStatus)(data, baseUrl);
|
|
47
|
+
this.spinner.status = lastStatus;
|
|
48
|
+
return Promise.resolve();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
this.log();
|
|
52
|
+
this.spinner.start(flags.async ? 'Requesting Scratch Org (will not wait for completion because --async)' : 'Creating Scratch Org');
|
|
53
|
+
try {
|
|
54
|
+
const { username, scratchOrgInfo, authFields, warnings } = await (0, core_1.scratchOrgCreate)(createCommandOptions);
|
|
55
|
+
this.spinner.stop(lastStatus);
|
|
56
|
+
if (!scratchOrgInfo) {
|
|
57
|
+
throw new core_1.SfError('The scratch org did not return with any information');
|
|
58
|
+
}
|
|
59
|
+
this.log();
|
|
60
|
+
if (flags.async) {
|
|
61
|
+
this.info(messages.getMessage('action.resume', [this.config.bin, scratchOrgInfo.Id]));
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
this.logSuccess(messages.getMessage('success'));
|
|
65
|
+
}
|
|
66
|
+
return { username, scratchOrgInfo, authFields, warnings, orgId: scratchOrgInfo.Id };
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (error instanceof core_1.SfError && error.name === 'ScratchOrgInfoTimeoutError') {
|
|
70
|
+
this.spinner.stop(lastStatus);
|
|
71
|
+
const scratchOrgInfoId = error.data.scratchOrgInfoId;
|
|
72
|
+
const resumeMessage = messages.getMessage('action.resume', [this.config.bin, scratchOrgInfoId]);
|
|
73
|
+
this.info(resumeMessage);
|
|
74
|
+
this.error('The scratch org did not complete within your wait time', { code: '69', exit: 69 });
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async clientSecretPrompt() {
|
|
82
|
+
const { secret } = await this.timedPrompt([
|
|
83
|
+
{
|
|
84
|
+
name: 'secret',
|
|
85
|
+
message: messages.getMessage('prompt.secret'),
|
|
86
|
+
type: 'password',
|
|
87
|
+
},
|
|
88
|
+
], exports.secretTimeout);
|
|
89
|
+
return secret;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.default = EnvCreateScratch;
|
|
93
|
+
EnvCreateScratch.summary = messages.getMessage('summary');
|
|
94
|
+
EnvCreateScratch.description = messages.getMessage('description');
|
|
95
|
+
EnvCreateScratch.examples = messages.getMessages('examples');
|
|
96
|
+
EnvCreateScratch.aliases = ['env:create:scratch'];
|
|
97
|
+
EnvCreateScratch.deprecateAliases = true;
|
|
98
|
+
EnvCreateScratch.state = 'beta';
|
|
99
|
+
EnvCreateScratch.flags = {
|
|
100
|
+
alias: sf_plugins_core_1.Flags.string({
|
|
101
|
+
char: 'a',
|
|
102
|
+
summary: messages.getMessage('flags.alias.summary'),
|
|
103
|
+
description: messages.getMessage('flags.alias.description'),
|
|
104
|
+
}),
|
|
105
|
+
async: sf_plugins_core_1.Flags.boolean({
|
|
106
|
+
summary: messages.getMessage('flags.async.summary'),
|
|
107
|
+
description: messages.getMessage('flags.async.description'),
|
|
108
|
+
}),
|
|
109
|
+
'set-default': sf_plugins_core_1.Flags.boolean({
|
|
110
|
+
char: 'd',
|
|
111
|
+
summary: messages.getMessage('flags.set-default.summary'),
|
|
112
|
+
}),
|
|
113
|
+
'definition-file': sf_plugins_core_1.Flags.file({
|
|
114
|
+
exists: true,
|
|
115
|
+
char: 'f',
|
|
116
|
+
summary: messages.getMessage('flags.definition-file.summary'),
|
|
117
|
+
description: messages.getMessage('flags.definition-file.description'),
|
|
118
|
+
exactlyOne: ['definition-file', 'edition'],
|
|
119
|
+
}),
|
|
120
|
+
'target-dev-hub': sf_plugins_core_1.Flags.requiredHub({
|
|
121
|
+
char: 'v',
|
|
122
|
+
summary: messages.getMessage('flags.target-hub.summary'),
|
|
123
|
+
description: messages.getMessage('flags.target-hub.description'),
|
|
124
|
+
required: true,
|
|
125
|
+
}),
|
|
126
|
+
'no-ancestors': sf_plugins_core_1.Flags.boolean({
|
|
127
|
+
char: 'c',
|
|
128
|
+
summary: messages.getMessage('flags.no-ancestors.summary'),
|
|
129
|
+
helpGroup: 'Packaging',
|
|
130
|
+
}),
|
|
131
|
+
edition: sf_plugins_core_1.Flags.string({
|
|
132
|
+
char: 'e',
|
|
133
|
+
summary: messages.getMessage('flags.edition.summary'),
|
|
134
|
+
description: messages.getMessage('flags.edition.description'),
|
|
135
|
+
options: [
|
|
136
|
+
'developer',
|
|
137
|
+
'enterprise',
|
|
138
|
+
'group',
|
|
139
|
+
'professional',
|
|
140
|
+
'partner-developer',
|
|
141
|
+
'partner-enterprise',
|
|
142
|
+
'partner-group',
|
|
143
|
+
'partner-professional',
|
|
144
|
+
],
|
|
145
|
+
exactlyOne: ['definition-file', 'edition'],
|
|
146
|
+
}),
|
|
147
|
+
'no-namespace': sf_plugins_core_1.Flags.boolean({
|
|
148
|
+
char: 'm',
|
|
149
|
+
summary: messages.getMessage('flags.no-namespace.summary'),
|
|
150
|
+
helpGroup: 'Packaging',
|
|
151
|
+
}),
|
|
152
|
+
'duration-days': sf_plugins_core_1.Flags.duration({
|
|
153
|
+
unit: 'days',
|
|
154
|
+
defaultValue: 7,
|
|
155
|
+
min: 1,
|
|
156
|
+
max: 30,
|
|
157
|
+
char: 'y',
|
|
158
|
+
helpValue: '<days>',
|
|
159
|
+
summary: messages.getMessage('flags.duration-days.summary'),
|
|
160
|
+
}),
|
|
161
|
+
wait: sf_plugins_core_1.Flags.duration({
|
|
162
|
+
unit: 'minutes',
|
|
163
|
+
defaultValue: 5,
|
|
164
|
+
min: 2,
|
|
165
|
+
char: 'w',
|
|
166
|
+
helpValue: '<minutes>',
|
|
167
|
+
summary: messages.getMessage('flags.wait.summary'),
|
|
168
|
+
description: messages.getMessage('flags.wait.description'),
|
|
169
|
+
}),
|
|
170
|
+
'api-version': sf_plugins_core_1.Flags.orgApiVersion(),
|
|
171
|
+
'client-id': sf_plugins_core_1.Flags.string({
|
|
172
|
+
char: 'i',
|
|
173
|
+
summary: messages.getMessage('flags.client-id.summary'),
|
|
174
|
+
}),
|
|
175
|
+
'track-source': sf_plugins_core_1.Flags.boolean({
|
|
176
|
+
default: true,
|
|
177
|
+
char: 't',
|
|
178
|
+
summary: messages.getMessage('flags.track-source.summary'),
|
|
179
|
+
description: messages.getMessage('flags.track-source.description'),
|
|
180
|
+
allowNo: true,
|
|
181
|
+
}),
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=scratch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scratch.js","sourceRoot":"","sources":["../../../../src/commands/org/create/scratch.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yBAAyB;AACzB,yCAA2C;AAC3C,2CAS0B;AAC1B,iEAA+D;AAC/D,uEAA+D;AAE/D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,CAAC;AAEtE,QAAA,aAAa,GAAG,KAAK,CAAC;AAEnC,MAAqB,gBAAiB,SAAQ,2BAAgC;IA4FrE,KAAK,CAAC,GAAG;QACd,MAAM,SAAS,GAAG,gBAAS,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,UAAG,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;QACtF,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,cAAO,CAAC,uCAAuC,CAAC,CAAC;SAC5D;QACD,MAAM,SAAS,GAAG,KAAK,CAAC,iBAAiB,CAAC;YACxC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAA6B;YACxG,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAE/B,MAAM,oBAAoB,GAA4B;YACpD,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC;YAC/B,YAA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AAC,6BAA6B,CAAC;KAC5D,CAAC;IACF,IAAI,EAAE,uBAAK,CAAC,QAAQ,CAAC;QACnB,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,CAAC;QACf,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,GAAG;QACT,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAClD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;KAC3D,CAAC;IACF,aAAa,EAAE,uBAAK,CAAC,aAAa,EAAE;IACpC,WAAW,EAAE,uBAAK,CAAC,MAAM,CAAC;QACxB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC;KACxD,CAAC;IACF,cAAc,EAAE,uBAAK,CAAC,OAAO,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,4BAA4B,CAAC;QAC1D,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,gCAAgC,CAAC;QAClE,OAAO,EAAE,IAAI;KACd,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export interface SandboxDeleteResponse {
|
|
3
|
+
orgId: string;
|
|
4
|
+
username: string;
|
|
5
|
+
}
|
|
6
|
+
export default class EnvDeleteSandbox extends SfCommand<SandboxDeleteResponse> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
static readonly aliases: string[];
|
|
11
|
+
static readonly deprecateAliases = true;
|
|
12
|
+
static readonly flags: {
|
|
13
|
+
'target-org': import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
+
'no-prompt': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
static readonly state = "beta";
|
|
17
|
+
run(): Promise<SandboxDeleteResponse>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2021, salesforce.com, inc.
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
* Licensed under the BSD 3-Clause license.
|
|
7
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
|
+
*/
|
|
9
|
+
const core_1 = require("@salesforce/core");
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
11
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
12
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-org', 'delete_sandbox');
|
|
13
|
+
class EnvDeleteSandbox extends sf_plugins_core_1.SfCommand {
|
|
14
|
+
async run() {
|
|
15
|
+
const flags = (await this.parse(EnvDeleteSandbox)).flags;
|
|
16
|
+
const org = flags['target-org'];
|
|
17
|
+
const username = org.getUsername();
|
|
18
|
+
if (!username) {
|
|
19
|
+
throw new core_1.SfError('The org does not have a username.');
|
|
20
|
+
}
|
|
21
|
+
if (!(await org.isSandbox())) {
|
|
22
|
+
throw messages.createError('error.isNotSandbox', [username]);
|
|
23
|
+
}
|
|
24
|
+
if (flags['no-prompt'] || (await this.confirm(messages.getMessage('prompt.confirm', [username])))) {
|
|
25
|
+
try {
|
|
26
|
+
await org.delete();
|
|
27
|
+
this.logSuccess(messages.getMessage('success', [username]));
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
if (e instanceof Error && e.name === 'SandboxNotFound') {
|
|
31
|
+
this.logSuccess(messages.getMessage('success.Idempotent', [username]));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
throw e;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return { username, orgId: org.getOrgId() };
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = EnvDeleteSandbox;
|
|
42
|
+
EnvDeleteSandbox.summary = messages.getMessage('summary');
|
|
43
|
+
EnvDeleteSandbox.description = messages.getMessage('description');
|
|
44
|
+
EnvDeleteSandbox.examples = messages.getMessages('examples');
|
|
45
|
+
EnvDeleteSandbox.aliases = ['env:delete:sandbox'];
|
|
46
|
+
EnvDeleteSandbox.deprecateAliases = true;
|
|
47
|
+
EnvDeleteSandbox.flags = {
|
|
48
|
+
'target-org': sf_plugins_core_1.Flags.requiredOrg({
|
|
49
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
50
|
+
char: 'o',
|
|
51
|
+
required: true,
|
|
52
|
+
}),
|
|
53
|
+
'no-prompt': sf_plugins_core_1.Flags.boolean({
|
|
54
|
+
char: 'p',
|
|
55
|
+
summary: messages.getMessage('flags.no-prompt.summary'),
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
EnvDeleteSandbox.state = 'beta';
|
|
59
|
+
//# sourceMappingURL=sandbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../../../src/commands/org/delete/sandbox.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,2CAAqD;AACrD,iEAA+D;AAE/D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,CAAC;AAMnF,MAAqB,gBAAiB,SAAQ,2BAAgC;IAmBrE,KAAK,CAAC,GAAG;QACd,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC;QACzD,MAAM,GAAG,GAAG,KAAK,CA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AC,oBAAoB,CAAC,CAAC;AACjC,iCAAgB,GAAG,IAAI,CAAC;AACxB,sBAAK,GAAG;IAC7B,YAAY,EAAE,uBAAK,CAAC,WAAW,CAAC;QAC9B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QACxD,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,WAAW,EAAE,uBAAK,CAAC,OAAO,CAAC;QACzB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC;KACxD,CAAC;CACH,CAAC;AACqB,sBAAK,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export interface ScratchDeleteResponse {
|
|
3
|
+
orgId: string;
|
|
4
|
+
username: string;
|
|
5
|
+
}
|
|
6
|
+
export default class EnvDeleteScratch extends SfCommand<ScratchDeleteResponse> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
static readonly aliases: string[];
|
|
11
|
+
static readonly deprecateAliases = true;
|
|
12
|
+
static readonly flags: {
|
|
13
|
+
'target-org': import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
+
'no-prompt': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
static readonly state = "beta";
|
|
17
|
+
run(): Promise<ScratchDeleteResponse>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
const core_1 = require("@salesforce/core");
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
11
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
12
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-org', 'delete_scratch');
|
|
13
|
+
class EnvDeleteScratch extends sf_plugins_core_1.SfCommand {
|
|
14
|
+
async run() {
|
|
15
|
+
const flags = (await this.parse(EnvDeleteScratch)).flags;
|
|
16
|
+
const org = flags['target-org'];
|
|
17
|
+
if (flags['no-prompt'] || (await this.confirm(messages.getMessage('prompt.confirm', [org.getUsername()])))) {
|
|
18
|
+
try {
|
|
19
|
+
await org.delete();
|
|
20
|
+
this.logSuccess(messages.getMessage('success', [org.getUsername()]));
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
if (e instanceof Error && e.name === 'ScratchOrgNotFound') {
|
|
24
|
+
this.logSuccess(messages.getMessage('success.Idempotent', [org.getUsername()]));
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
throw e;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return { username: org.getUsername(), orgId: org.getOrgId() };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = EnvDeleteScratch;
|
|
35
|
+
EnvDeleteScratch.summary = messages.getMessage('summary');
|
|
36
|
+
EnvDeleteScratch.description = messages.getMessage('description');
|
|
37
|
+
EnvDeleteScratch.examples = messages.getMessages('examples');
|
|
38
|
+
EnvDeleteScratch.aliases = ['env:delete:scratch'];
|
|
39
|
+
EnvDeleteScratch.deprecateAliases = true;
|
|
40
|
+
EnvDeleteScratch.flags = {
|
|
41
|
+
'target-org': sf_plugins_core_1.Flags.requiredOrg({
|
|
42
|
+
char: 'o',
|
|
43
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
44
|
+
required: true,
|
|
45
|
+
}),
|
|
46
|
+
'no-prompt': sf_plugins_core_1.Flags.boolean({
|
|
47
|
+
char: 'p',
|
|
48
|
+
summary: messages.getMessage('flags.no-prompt.summary'),
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
EnvDeleteScratch.state = 'beta';
|
|
52
|
+
//# sourceMappingURL=scratch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scratch.js","sourceRoot":"","sources":["../../../../src/commands/org/delete/scratch.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,2CAA4C;AAC5C,iEAA+D;AAE/D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,CAAC;AAOnF,MAAqB,gBAAiB,SAAQ,2BAAgC;IAmBrE,KAAK,CAAC,GAAG;QACd,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC;QACzD,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;QAEhC,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;YAC1G,IAAI;gBACF,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC;gBACnB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;aACtE;YAAC,OAAO,CAAC,EAAE;gBACV,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,IAAI,KAAK,oBAAoB,EAAE;oBACzD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;iBACjF;qBAAM;oBACL,MAAM,CAAC,CAAC;iBACT;aACF;SACF;QACD,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,WAAW,EAAY,EAAE,KAAK,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC1E,CAAC;;AApCH,mCAqCC;AApCwB,wBAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,4BAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,yBAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,wBAAO,GAAG,CAAC,oBAAoB,CAAC,CAAC;AACjC,iCAAgB,GAAG,IAAI,CAAC;AACxB,sBAAK,GAAG;IAC7B,YAAY,EAAE,uBAAK,CAAC,WAAW,CAAC;QAC9B,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QACxD,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,WAAW,EAAE,uBAAK,CAAC,OAAO,CAAC;QACzB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC;KACxD,CAAC;CACH,CAAC;AACqB,sBAAK,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { Org } from '@salesforce/core';
|
|
3
|
+
import { OrgDisplayReturn } from '../../shared/orgTypes';
|
|
4
|
+
export declare class OrgDisplayCommand extends SfCommand<OrgDisplayReturn> {
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly description: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static aliases: string[];
|
|
9
|
+
static deprecateAliases: boolean;
|
|
10
|
+
static readonly flags: {
|
|
11
|
+
'target-org': import("@oclif/core/lib/interfaces").OptionFlag<Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
+
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
private org;
|
|
17
|
+
run(): Promise<OrgDisplayReturn>;
|
|
18
|
+
private print;
|
|
19
|
+
private getScratchOrgInformation;
|
|
20
|
+
}
|
|
@@ -7,31 +7,33 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.OrgDisplayCommand = void 0;
|
|
10
|
-
const
|
|
11
|
-
const command_1 = require("@salesforce/command");
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
11
|
const core_1 = require("@salesforce/core");
|
|
13
12
|
const kit_1 = require("@salesforce/kit");
|
|
14
|
-
const utils_1 = require("
|
|
15
|
-
const orgHighlighter_1 = require("
|
|
16
|
-
const orgListUtil_1 = require("
|
|
13
|
+
const utils_1 = require("../../shared/utils");
|
|
14
|
+
const orgHighlighter_1 = require("../../shared/orgHighlighter");
|
|
15
|
+
const orgListUtil_1 = require("../../shared/orgListUtil");
|
|
17
16
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
18
17
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-org', 'display');
|
|
19
18
|
const sharedMessages = core_1.Messages.loadMessages('@salesforce/plugin-org', 'messages');
|
|
20
|
-
class OrgDisplayCommand extends
|
|
19
|
+
class OrgDisplayCommand extends sf_plugins_core_1.SfCommand {
|
|
21
20
|
async run() {
|
|
21
|
+
const { flags } = await this.parse(OrgDisplayCommand);
|
|
22
|
+
this.org = flags['target-org'];
|
|
23
|
+
this.org.getConnection(flags['api-version']);
|
|
22
24
|
try {
|
|
23
25
|
// the auth file might have a stale access token. We want to refresh it before getting the fields
|
|
24
26
|
await this.org.refreshAuth();
|
|
25
27
|
}
|
|
26
28
|
catch (error) {
|
|
27
29
|
// even if this fails, we want to display the information we can read from the auth file
|
|
28
|
-
this.
|
|
30
|
+
this.warn('unable to refresh auth for org');
|
|
29
31
|
}
|
|
30
32
|
// translate to alias if necessary
|
|
31
33
|
const authInfo = await core_1.AuthInfo.create({ username: this.org.getUsername() });
|
|
32
34
|
const fields = authInfo.getFields(true);
|
|
33
|
-
const isScratchOrg = fields.devHubUsername;
|
|
34
|
-
const scratchOrgInfo = isScratchOrg ? await this.getScratchOrgInformation(fields.orgId) : {};
|
|
35
|
+
const isScratchOrg = Boolean(fields.devHubUsername);
|
|
36
|
+
const scratchOrgInfo = isScratchOrg && fields.orgId ? await this.getScratchOrgInformation(fields.orgId) : {};
|
|
35
37
|
const returnValue = {
|
|
36
38
|
// renamed properties
|
|
37
39
|
id: fields.orgId,
|
|
@@ -47,54 +49,63 @@ class OrgDisplayCommand extends command_1.SfdxCommand {
|
|
|
47
49
|
connectedStatus: isScratchOrg
|
|
48
50
|
? undefined
|
|
49
51
|
: await orgListUtil_1.OrgListUtil.determineConnectedStatusForNonScratchOrg(fields.username),
|
|
50
|
-
sfdxAuthUrl:
|
|
52
|
+
sfdxAuthUrl: flags.verbose && fields.refreshToken ? authInfo.getSfdxAuthUrl() : undefined,
|
|
51
53
|
alias: await (0, utils_1.getAliasByUsername)(fields.username),
|
|
52
54
|
};
|
|
53
|
-
this.
|
|
54
|
-
if (!
|
|
55
|
+
this.warn(sharedMessages.getMessage('SecurityWarning'));
|
|
56
|
+
if (!flags.json) {
|
|
55
57
|
this.print(returnValue);
|
|
56
58
|
}
|
|
57
59
|
return returnValue;
|
|
58
60
|
}
|
|
59
61
|
print(result) {
|
|
60
|
-
this.
|
|
61
|
-
const tableRows = Object.
|
|
62
|
-
.filter((
|
|
62
|
+
this.log('');
|
|
63
|
+
const tableRows = Object.entries(result)
|
|
64
|
+
.filter(([, value]) => value !== undefined && value !== null) // some values won't exist
|
|
63
65
|
.sort() // this command always alphabetizes the table rows
|
|
64
|
-
.map((key) => ({
|
|
66
|
+
.map(([key, value]) => ({
|
|
65
67
|
key: (0, kit_1.camelCaseToTitleCase)(key),
|
|
66
|
-
|
|
67
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument
|
|
68
|
-
value: (0, orgHighlighter_1.getStyledValue)(key, result[key]),
|
|
68
|
+
value: typeof value === 'string' ? (0, orgHighlighter_1.getStyledValue)(key, value) : value,
|
|
69
69
|
}));
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
70
|
+
this.styledHeader('Org Description');
|
|
71
|
+
this.table(tableRows, {
|
|
72
72
|
key: { header: 'KEY' },
|
|
73
73
|
value: { header: 'VALUE' },
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
async getScratchOrgInformation(orgId) {
|
|
77
77
|
const hubOrg = await this.org.getDevHubOrg();
|
|
78
|
-
|
|
78
|
+
// we know this is a scratch org so it must have a hubOrg and that'll have a username
|
|
79
|
+
const hubUsername = hubOrg?.getUsername();
|
|
80
|
+
const result = (await orgListUtil_1.OrgListUtil.retrieveScratchOrgInfoFromDevHub(hubUsername, [(0, core_1.trimTo15)(orgId)]))[0];
|
|
79
81
|
if (result) {
|
|
80
82
|
return {
|
|
81
83
|
status: result.Status,
|
|
84
|
+
devHubId: hubUsername,
|
|
82
85
|
expirationDate: result.ExpirationDate,
|
|
83
86
|
createdBy: result.CreatedBy?.Username,
|
|
84
87
|
edition: result.Edition ?? undefined,
|
|
85
88
|
namespace: result.Namespace ?? undefined,
|
|
86
89
|
orgName: result.OrgName,
|
|
87
90
|
createdDate: result.CreatedDate,
|
|
91
|
+
signupUsername: result.SignupUsername,
|
|
88
92
|
};
|
|
89
93
|
}
|
|
90
|
-
throw new core_1.SfError(messages.getMessage('noScratchOrgInfoError', [core_1.sfdc.trimTo15(orgId),
|
|
94
|
+
throw new core_1.SfError(messages.getMessage('noScratchOrgInfoError', [core_1.sfdc.trimTo15(orgId), hubUsername]), 'NoScratchInfo', [messages.getMessage('noScratchOrgInfoAction')]);
|
|
91
95
|
}
|
|
92
96
|
}
|
|
93
97
|
exports.OrgDisplayCommand = OrgDisplayCommand;
|
|
98
|
+
OrgDisplayCommand.summary = messages.getMessage('summary');
|
|
94
99
|
OrgDisplayCommand.description = messages.getMessage('description');
|
|
95
|
-
OrgDisplayCommand.examples = messages.
|
|
96
|
-
OrgDisplayCommand.
|
|
97
|
-
OrgDisplayCommand.
|
|
98
|
-
|
|
100
|
+
OrgDisplayCommand.examples = messages.getMessages('examples');
|
|
101
|
+
OrgDisplayCommand.aliases = ['force:org:display'];
|
|
102
|
+
OrgDisplayCommand.deprecateAliases = true;
|
|
103
|
+
OrgDisplayCommand.flags = {
|
|
104
|
+
'target-org': sf_plugins_core_1.requiredOrgFlagWithDeprecations,
|
|
105
|
+
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
106
|
+
verbose: sf_plugins_core_1.Flags.boolean({
|
|
107
|
+
summary: messages.getMessage('flags.verbose.summary'),
|
|
108
|
+
}),
|
|
109
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
99
110
|
};
|
|
100
111
|
//# sourceMappingURL=display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../../src/commands/org/display.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iEAMqC;AACrC,2CAAoF;AACpF,yCAAuD;AAEvD,8CAAwD;AACxD,gEAA6D;AAC7D,0DAAuD;AAEvD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,e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AC,CAChD,CAAC;IACJ,CAAC;;AAzGH,8CA0GC;AAzGwB,yBAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,6BAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,0BAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AACrD,yBAAO,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAChC,kCAAgB,GAAG,IAAI,CAAC;AAEf,uBAAK,GAAG;IAC7B,YAAY,EAAE,iDAA+B;IAC7C,aAAa,EAAE,mDAAiC;IAChD,OAAO,EAAE,uBAAK,CAAC,OAAO,CAAC;QACrB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;KACtD,CAAC;IACF,QAAQ,EAAR,0BAAQ;CACT,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { Interfaces } from '@oclif/core';
|
|
3
|
+
import { ExtendedAuthFields, FullyPopulatedScratchOrgFields } from '../../shared/orgTypes';
|
|
4
|
+
export type OrgListResult = {
|
|
5
|
+
nonScratchOrgs: ExtendedAuthFields[];
|
|
6
|
+
scratchOrgs: FullyPopulatedScratchOrgFields[];
|
|
7
|
+
};
|
|
8
|
+
export declare class OrgListCommand extends SfCommand<OrgListResult> {
|
|
9
|
+
static readonly summary: string;
|
|
10
|
+
static readonly examples: string[];
|
|
11
|
+
static aliases: string[];
|
|
12
|
+
static deprecateAliases: boolean;
|
|
13
|
+
static readonly flags: {
|
|
14
|
+
verbose: Interfaces.BooleanFlag<boolean>;
|
|
15
|
+
all: Interfaces.BooleanFlag<boolean>;
|
|
16
|
+
clean: Interfaces.BooleanFlag<boolean>;
|
|
17
|
+
'no-prompt': Interfaces.BooleanFlag<boolean>;
|
|
18
|
+
'skip-connection-status': Interfaces.BooleanFlag<boolean>;
|
|
19
|
+
loglevel: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
20
|
+
};
|
|
21
|
+
private flags;
|
|
22
|
+
run(): Promise<OrgListResult>;
|
|
23
|
+
protected cleanScratchOrgs(scratchOrgs: ExtendedAuthFields[], prompt?: boolean): Promise<void>;
|
|
24
|
+
protected printOrgTable(nonScratchOrgs: ExtendedAuthFields[], skipconnectionstatus: boolean): void;
|
|
25
|
+
private printScratchOrgTable;
|
|
26
|
+
}
|