@salesforce/plugin-org 2.8.7 → 2.9.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/lib/commands/org/create/scratch.d.ts +5 -3
- package/lib/commands/org/create/scratch.js +13 -28
- package/lib/commands/org/create/scratch.js.map +1 -1
- package/lib/shared/scratchOrgRequest.d.ts +31 -0
- package/lib/shared/scratchOrgRequest.js +46 -0
- package/lib/shared/scratchOrgRequest.js.map +1 -0
- package/messages/create_scratch.md +10 -0
- package/oclif.manifest.json +17 -2
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Duration } from '@salesforce/kit';
|
|
2
1
|
import { Org } from '@salesforce/core';
|
|
3
2
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { Duration } from '@salesforce/kit';
|
|
4
4
|
import { ScratchCreateResponse } from '../../../shared/orgTypes';
|
|
5
5
|
export declare const secretTimeout = 60000;
|
|
6
6
|
export default class EnvCreateScratch extends SfCommand<ScratchCreateResponse> {
|
|
@@ -18,8 +18,8 @@ export default class EnvCreateScratch extends SfCommand<ScratchCreateResponse> {
|
|
|
18
18
|
'no-ancestors': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
19
|
edition: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
20
20
|
'no-namespace': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
21
|
-
'duration-days': import("@oclif/core/lib/interfaces").OptionFlag<Duration
|
|
22
|
-
wait: import("@oclif/core/lib/interfaces").OptionFlag<Duration
|
|
21
|
+
'duration-days': import("@oclif/core/lib/interfaces").OptionFlag<Duration, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
22
|
+
wait: import("@oclif/core/lib/interfaces").OptionFlag<Duration, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
23
23
|
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
24
24
|
'client-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
25
25
|
'track-source': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -27,6 +27,8 @@ export default class EnvCreateScratch extends SfCommand<ScratchCreateResponse> {
|
|
|
27
27
|
description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
28
28
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
29
29
|
release: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
30
|
+
'admin-email': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
31
|
+
'source-org': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
30
32
|
};
|
|
31
33
|
run(): Promise<ScratchCreateResponse>;
|
|
32
34
|
private clientSecretPrompt;
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.secretTimeout = void 0;
|
|
10
|
-
const fs = require("fs");
|
|
11
|
-
const kit_1 = require("@salesforce/kit");
|
|
12
10
|
const core_1 = require("@salesforce/core");
|
|
13
11
|
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
|
+
const kit_1 = require("@salesforce/kit");
|
|
13
|
+
const scratchOrgRequest_1 = require("../../../shared/scratchOrgRequest");
|
|
14
14
|
const scratchOrgOutput_1 = require("../../../shared/scratchOrgOutput");
|
|
15
15
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
16
16
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-org', 'create_scratch');
|
|
@@ -23,30 +23,7 @@ class EnvCreateScratch extends sf_plugins_core_1.SfCommand {
|
|
|
23
23
|
if (!baseUrl) {
|
|
24
24
|
throw new core_1.SfError('No instance URL found for the dev hub');
|
|
25
25
|
}
|
|
26
|
-
const
|
|
27
|
-
...(flags['definition-file']
|
|
28
|
-
? JSON.parse(await fs.promises.readFile(flags['definition-file'], 'utf-8'))
|
|
29
|
-
: {}),
|
|
30
|
-
...(flags.edition ? { edition: flags.edition } : {}),
|
|
31
|
-
...(flags.username ? { username: flags.username } : {}),
|
|
32
|
-
...(flags.description ? { description: flags.description } : {}),
|
|
33
|
-
...(flags.name ? { orgName: flags.name } : {}),
|
|
34
|
-
...(flags.release ? { release: flags.release } : {}),
|
|
35
|
-
};
|
|
36
|
-
const createCommandOptions = {
|
|
37
|
-
hubOrg: flags['target-dev-hub'],
|
|
38
|
-
clientSecret: flags['client-id'] ? await this.clientSecretPrompt() : undefined,
|
|
39
|
-
connectedAppConsumerKey: flags['client-id'],
|
|
40
|
-
durationDays: flags['duration-days'].days,
|
|
41
|
-
nonamespace: flags['no-namespace'],
|
|
42
|
-
noancestors: flags['no-ancestors'],
|
|
43
|
-
wait: flags.async ? kit_1.Duration.minutes(0) : flags.wait,
|
|
44
|
-
apiversion: flags['api-version'],
|
|
45
|
-
orgConfig,
|
|
46
|
-
alias: flags.alias,
|
|
47
|
-
setDefault: flags['set-default'],
|
|
48
|
-
tracksSource: flags['track-source'],
|
|
49
|
-
};
|
|
26
|
+
const createCommandOptions = await (0, scratchOrgRequest_1.buildScratchOrgRequest)(flags, flags['client-id'] ? await this.clientSecretPrompt() : undefined);
|
|
50
27
|
let lastStatus;
|
|
51
28
|
if (!flags.async) {
|
|
52
29
|
lifecycle.on(core_1.scratchOrgLifecycleEventName, async (data) => {
|
|
@@ -155,7 +132,7 @@ EnvCreateScratch.flags = {
|
|
|
155
132
|
}),
|
|
156
133
|
'duration-days': sf_plugins_core_1.Flags.duration({
|
|
157
134
|
unit: 'days',
|
|
158
|
-
|
|
135
|
+
default: kit_1.Duration.days(7),
|
|
159
136
|
min: 1,
|
|
160
137
|
max: 30,
|
|
161
138
|
char: 'y',
|
|
@@ -164,7 +141,7 @@ EnvCreateScratch.flags = {
|
|
|
164
141
|
}),
|
|
165
142
|
wait: sf_plugins_core_1.Flags.duration({
|
|
166
143
|
unit: 'minutes',
|
|
167
|
-
|
|
144
|
+
default: kit_1.Duration.minutes(5),
|
|
168
145
|
min: 2,
|
|
169
146
|
char: 'w',
|
|
170
147
|
helpValue: '<minutes>',
|
|
@@ -198,5 +175,13 @@ EnvCreateScratch.flags = {
|
|
|
198
175
|
description: messages.getMessage('flags.release.description'),
|
|
199
176
|
options: ['preview', 'previous'],
|
|
200
177
|
}),
|
|
178
|
+
'admin-email': sf_plugins_core_1.Flags.string({
|
|
179
|
+
summary: messages.getMessage('flags.adminEmail.summary'),
|
|
180
|
+
}),
|
|
181
|
+
'source-org': sf_plugins_core_1.Flags.salesforceId({
|
|
182
|
+
summary: messages.getMessage('flags.sourceOrg.summary'),
|
|
183
|
+
startsWith: '00D',
|
|
184
|
+
length: 15,
|
|
185
|
+
}),
|
|
201
186
|
};
|
|
202
187
|
//# sourceMappingURL=scratch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scratch.js","sourceRoot":"","sources":["../../../../src/commands/org/create/scratch.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"scratch.js","sourceRoot":"","sources":["../../../../src/commands/org/create/scratch.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2CAQ0B;AAC1B,iEAA+D;AAC/D,yCAA2C;AAC3C,yEAA2E;AAC3E,uEAA+D;AAE/D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,wBAAwB,EA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AAE,QAAQ,CAAC,UAAU,CAAC,2BAA2B,CAAC;QAC7D,OAAO,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;KACjC,CAAC;IACF,aAAa,EAAE,uBAAK,CAAC,MAAM,CAAC;QAC1B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;KACzD,CAAC;IACF,YAAY,EAAE,uBAAK,CAAC,YAAY,CAAC;QAC/B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC;QACvD,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,EAAE;KACX,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Interfaces } from '@oclif/core';
|
|
2
|
+
import { ScratchOrgCreateOptions } from '@salesforce/core';
|
|
3
|
+
import { Duration } from '@salesforce/kit';
|
|
4
|
+
import EnvCreateScratch from '../commands/org/create/scratch';
|
|
5
|
+
/**
|
|
6
|
+
* Provide the parsed flags
|
|
7
|
+
* Returns the objet necessary to create a scratch org
|
|
8
|
+
*/
|
|
9
|
+
export declare const buildScratchOrgRequest: (flags: {
|
|
10
|
+
alias: string | undefined;
|
|
11
|
+
async: boolean;
|
|
12
|
+
'set-default': boolean;
|
|
13
|
+
'definition-file': string | undefined;
|
|
14
|
+
'target-dev-hub': import("@salesforce/core").Org;
|
|
15
|
+
'no-ancestors': boolean;
|
|
16
|
+
edition: string | undefined;
|
|
17
|
+
'no-namespace': boolean;
|
|
18
|
+
'duration-days': Duration;
|
|
19
|
+
wait: Duration;
|
|
20
|
+
'api-version': string | undefined;
|
|
21
|
+
'client-id': string | undefined;
|
|
22
|
+
'track-source': boolean;
|
|
23
|
+
username: string | undefined;
|
|
24
|
+
description: string | undefined;
|
|
25
|
+
name: string | undefined;
|
|
26
|
+
release: string | undefined;
|
|
27
|
+
'admin-email': string | undefined;
|
|
28
|
+
'source-org': string | undefined;
|
|
29
|
+
} & {
|
|
30
|
+
json: boolean | undefined;
|
|
31
|
+
}, clientSecret?: string) => Promise<ScratchOrgCreateOptions>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023, 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.buildScratchOrgRequest = void 0;
|
|
10
|
+
const fs = require("fs");
|
|
11
|
+
const kit_1 = require("@salesforce/kit");
|
|
12
|
+
/**
|
|
13
|
+
* Provide the parsed flags
|
|
14
|
+
* Returns the objet necessary to create a scratch org
|
|
15
|
+
*/
|
|
16
|
+
const buildScratchOrgRequest = async (flags, clientSecret) => {
|
|
17
|
+
const orgConfig = {
|
|
18
|
+
...(flags['definition-file']
|
|
19
|
+
? JSON.parse(await fs.promises.readFile(flags['definition-file'], 'utf-8'))
|
|
20
|
+
: {}),
|
|
21
|
+
...(flags.edition ? { edition: flags.edition } : {}),
|
|
22
|
+
...(flags.username ? { username: flags.username } : {}),
|
|
23
|
+
...(flags.description ? { description: flags.description } : {}),
|
|
24
|
+
...(flags.name ? { orgName: flags.name } : {}),
|
|
25
|
+
...(flags.release ? { release: flags.release } : {}),
|
|
26
|
+
...(flags['source-org'] ? { sourceOrg: flags['source-org'] } : {}),
|
|
27
|
+
...(flags['admin-email'] ? { adminEmail: flags['admin-email'] } : {}),
|
|
28
|
+
};
|
|
29
|
+
const createCommandOptions = {
|
|
30
|
+
hubOrg: flags['target-dev-hub'],
|
|
31
|
+
clientSecret,
|
|
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
|
+
return createCommandOptions;
|
|
44
|
+
};
|
|
45
|
+
exports.buildScratchOrgRequest = buildScratchOrgRequest;
|
|
46
|
+
//# sourceMappingURL=scratchOrgRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scratchOrgRequest.js","sourceRoot":"","sources":["../../src/shared/scratchOrgRequest.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yBAAyB;AAGzB,yCAA2C;AAE3C;;;GAGG;AACI,MAAM,sBAAsB,GAAG,KAAK,EACzC,KAA8D,EAC9D,YAAqB,EACa,EAAE;IACpC,MAAM,SAAS,GAAG;QAChB,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC;YAC1B,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,CAAC;QACP,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,O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|
15
15
|
* --edition
|
|
16
|
+
* --admin-email (equivalent to the "adminEmail" option)
|
|
17
|
+
* --source-org (equivalent to the "sourceOrg" option)
|
|
16
18
|
|
|
17
19
|
If you want to set options other than the preceding ones, such as org features or settings, you must use a definition file.
|
|
18
20
|
|
|
@@ -84,6 +86,14 @@ The scratch org definition file is a blueprint for the scratch org. It mimics th
|
|
|
84
86
|
|
|
85
87
|
Consumer key of the Dev Hub connected app.
|
|
86
88
|
|
|
89
|
+
# flags.adminEmail.summary
|
|
90
|
+
|
|
91
|
+
Email address that will be applied to the org's admin user. Overrides the value of the "adminEmail" option in the definition file, if set.
|
|
92
|
+
|
|
93
|
+
# flags.sourceOrg.summary
|
|
94
|
+
|
|
95
|
+
15-character ID of the org whose shape the new scratch org will be based on. Overrides the value of the "sourceOrg" option in the definition file, if set.
|
|
96
|
+
|
|
87
97
|
# flags.wait.summary
|
|
88
98
|
|
|
89
99
|
Number of minutes to wait for the scratch org to be ready.
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.9.0",
|
|
3
3
|
"commands": {
|
|
4
4
|
"org:display": {
|
|
5
5
|
"id": "org:display",
|
|
@@ -875,7 +875,7 @@
|
|
|
875
875
|
"org:create:scratch": {
|
|
876
876
|
"id": "org:create:scratch",
|
|
877
877
|
"summary": "Create a scratch org.",
|
|
878
|
-
"description": "There are two ways to create a scratch org: either specify a definition file that contains the options or use the --edition flag to specify the one required option.\n\nFor either method, you can also use these flags; if you use them with --definition-file, they override their equivalent option in the scratch org definition file:\n\n * --description\n * --name (equivalent to the \"orgName\" option)\n * --username\n * --release\n * --edition\n\nIf you want to set options other than the preceding ones, such as org features or settings, you must use a definition file.\n\nYou must specify a Dev Hub to create a scratch org, either with the --target-dev-hub flag or by setting your default Dev Hub with the target-dev-hub configuration variable.",
|
|
878
|
+
"description": "There are two ways to create a scratch org: either specify a definition file that contains the options or use the --edition flag to specify the one required option.\n\nFor either method, you can also use these flags; if you use them with --definition-file, they override their equivalent option in the scratch org definition file:\n\n * --description\n * --name (equivalent to the \"orgName\" option)\n * --username\n * --release\n * --edition\n * --admin-email (equivalent to the \"adminEmail\" option)\n * --source-org (equivalent to the \"sourceOrg\" option)\n\nIf you want to set options other than the preceding ones, such as org features or settings, you must use a definition file.\n\nYou must specify a Dev Hub to create a scratch org, either with the --target-dev-hub flag or by setting your default Dev Hub with the target-dev-hub configuration variable.",
|
|
879
879
|
"strict": true,
|
|
880
880
|
"pluginName": "@salesforce/plugin-org",
|
|
881
881
|
"pluginAlias": "@salesforce/plugin-org",
|
|
@@ -1063,6 +1063,21 @@
|
|
|
1063
1063
|
"previous"
|
|
1064
1064
|
],
|
|
1065
1065
|
"deprecateAliases": true
|
|
1066
|
+
},
|
|
1067
|
+
"admin-email": {
|
|
1068
|
+
"name": "admin-email",
|
|
1069
|
+
"type": "option",
|
|
1070
|
+
"summary": "Email address that will be applied to the org's admin user. Overrides the value of the \"adminEmail\" option in the definition file, if set.",
|
|
1071
|
+
"multiple": false,
|
|
1072
|
+
"deprecateAliases": true
|
|
1073
|
+
},
|
|
1074
|
+
"source-org": {
|
|
1075
|
+
"name": "source-org",
|
|
1076
|
+
"type": "option",
|
|
1077
|
+
"char": "i",
|
|
1078
|
+
"summary": "15-character ID of the org whose shape the new scratch org will be based on. Overrides the value of the \"sourceOrg\" option in the definition file, if set.",
|
|
1079
|
+
"multiple": false,
|
|
1080
|
+
"deprecateAliases": true
|
|
1066
1081
|
}
|
|
1067
1082
|
},
|
|
1068
1083
|
"args": {},
|
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": "2.
|
|
4
|
+
"version": "2.9.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
237
|
"sfdx": {
|
|
238
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/2.
|
|
239
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/2.
|
|
238
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/2.9.0.crt",
|
|
239
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/2.9.0.sig"
|
|
240
240
|
}
|
|
241
241
|
}
|