prodlysfcli 1.2.1 → 1.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 +57 -16
- package/lib/commands/prodly/change-types.d.ts +18 -0
- package/lib/commands/prodly/change-types.js +100 -0
- package/lib/commands/prodly/change-types.js.map +1 -0
- package/lib/commands/prodly/version.d.ts +2 -1
- package/lib/commands/prodly/version.js +23 -3
- package/lib/commands/prodly/version.js.map +1 -1
- package/lib/services/change-types.d.ts +11 -0
- package/lib/services/change-types.js +12 -0
- package/lib/services/change-types.js.map +1 -0
- package/lib/services/manage-instances.d.ts +3 -2
- package/lib/services/manage-instances.js +9 -1
- package/lib/services/manage-instances.js.map +1 -1
- package/lib/services/manage-instances.types.d.ts +8 -0
- package/lib/types/generic.d.ts +1 -1
- package/lib/types/prodly.d.ts +26 -0
- package/messages/prodly.change-types.md +14 -0
- package/messages/prodly.checkin.md +1 -1
- package/messages/prodly.checkout.md +1 -1
- package/messages/prodly.deploy.md +2 -2
- package/messages/prodly.json +7 -0
- package/messages/prodly.manage.md +1 -1
- package/messages/prodly.version.md +3 -0
- package/npm-shrinkwrap.json +2641 -1341
- package/oclif.lock +1665 -1191
- package/oclif.manifest.json +119 -8
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -42,12 +42,51 @@ sf plugins
|
|
|
42
42
|
|
|
43
43
|
<!-- commands -->
|
|
44
44
|
|
|
45
|
+
- [`sf prodly:change-types`](#sf-prodlychange-types)
|
|
45
46
|
- [`sf prodly:checkin`](#sf-prodlycheckin)
|
|
46
47
|
- [`sf prodly:checkout`](#sf-prodlycheckout)
|
|
47
48
|
- [`sf prodly:deploy`](#sf-prodlydeploy)
|
|
48
49
|
- [`sf prodly:manage`](#sf-prodlymanage)
|
|
49
50
|
- [`sf prodly:jobs`](#sf-prodlyjobs)
|
|
50
51
|
|
|
52
|
+
## `sf prodly:change-types`
|
|
53
|
+
|
|
54
|
+
prodly:change-types command
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
USAGE
|
|
58
|
+
$ sf prodly:change-types -v <value> [--json] [--api-version <value>] [-t <value>] [-l] [-c] [-n
|
|
59
|
+
<value>] [-u <value>]
|
|
60
|
+
|
|
61
|
+
FLAGS
|
|
62
|
+
-c, --create create a scratch org from a change type
|
|
63
|
+
-l, --list list all change types or specific change type
|
|
64
|
+
-n, --name=<value> name to use for the scratch org
|
|
65
|
+
-t, --id=<value> change type ID
|
|
66
|
+
-u, --username=<value> username to use for the scratch org
|
|
67
|
+
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org. Not required if the `target-dev-hub`
|
|
68
|
+
configuration variable is already set.
|
|
69
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
70
|
+
|
|
71
|
+
GLOBAL FLAGS
|
|
72
|
+
--json Format output as json.
|
|
73
|
+
|
|
74
|
+
DESCRIPTION
|
|
75
|
+
prodly:change-types command
|
|
76
|
+
|
|
77
|
+
List all or a specific change type and create scratch org from a change type.
|
|
78
|
+
|
|
79
|
+
EXAMPLES
|
|
80
|
+
$ sf prodly:change-types --target-dev-hub jsmith@acme.com -l
|
|
81
|
+
Lists all the change types
|
|
82
|
+
|
|
83
|
+
$ sf prodly:change-types --target-dev-hub jsmith@acme.com -l -t a1h3t00000JN9lhAAD
|
|
84
|
+
Lists a specific change type
|
|
85
|
+
|
|
86
|
+
$ sf prodly:change-types --target-dev-hub jsmith@acme.com -c -n "SO FROM CLI" -u "username@example.com" -t a1h3t00000JN9lhAAD
|
|
87
|
+
Creates a scratch org based on a change type
|
|
88
|
+
```
|
|
89
|
+
|
|
51
90
|
## `sf prodly:checkin`
|
|
52
91
|
|
|
53
92
|
```
|
|
@@ -81,7 +120,7 @@ EXAMPLES
|
|
|
81
120
|
Save managed data to the branch associated with the managed instance identified by the target username.
|
|
82
121
|
The instance should be managed by the Prodly account associated with the provided DevHub control org.
|
|
83
122
|
|
|
84
|
-
$ sf prodly:checkin -
|
|
123
|
+
$ sf prodly:checkin --target-org test-utxac7gbati9@example.com
|
|
85
124
|
Save managed data to the branch associated with the managed instance identified by the target username.
|
|
86
125
|
The instance should be managed by the Prodly account associated with the default DevHub control org.
|
|
87
126
|
|
|
@@ -120,16 +159,16 @@ DESCRIPTION
|
|
|
120
159
|
Deploy data from a VCS repository branch to a Salesforce environment.
|
|
121
160
|
|
|
122
161
|
EXAMPLES
|
|
123
|
-
$ sf prodly:
|
|
124
|
-
|
|
162
|
+
$ sf prodly:checkout --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com
|
|
163
|
+
Deploy managed data to the managed instance identified by the target org from the associated branch.
|
|
125
164
|
The instance should be managed by the Prodly account associated with the provided DevHub control org.
|
|
126
165
|
|
|
127
|
-
$ sf prodly:
|
|
128
|
-
|
|
166
|
+
$ sf prodly:checkout --target-org test-utxac7gbati9@example.com
|
|
167
|
+
Deploy managed data to the managed instance org identified by the target username from the associated branch.
|
|
129
168
|
The instance should be managed by the Prodly account associated with the default DevHub control org.
|
|
130
169
|
|
|
131
|
-
$ sf prodly:
|
|
132
|
-
|
|
170
|
+
$ sf prodly:checkout -i f50616b6-57b1-4941-802f-ee0e2506f217
|
|
171
|
+
Deploy managed data to the managed instance org from the associated branch.
|
|
133
172
|
The instance should be managed by the Prodly account associated with the default DevHub control org.
|
|
134
173
|
```
|
|
135
174
|
|
|
@@ -165,14 +204,14 @@ DESCRIPTION
|
|
|
165
204
|
Deploy data from one Salesforce environment directly to another Salesforce environment.
|
|
166
205
|
|
|
167
206
|
EXAMPLES
|
|
168
|
-
$ sf prodly:deploy -n scratchorg -
|
|
207
|
+
$ sf prodly:deploy -n scratchorg --target-org FixesScratchOrg -v MainDevHub
|
|
169
208
|
Command output... deploying from the dev hub, the control org, to the scratch org, auto managed with provided name.
|
|
170
209
|
Command output...
|
|
171
210
|
|
|
172
211
|
$ sf prodly:deploy --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com
|
|
173
212
|
Command output... deploying from the dev hub, the control org, to the scratch org. Long param names.
|
|
174
213
|
|
|
175
|
-
$ sf prodly:deploy -
|
|
214
|
+
$ sf prodly:deploy --target-org test-utxac7gbati9@example.com -v jsmith@acme.com -d "UAT Sandbox Connection"
|
|
176
215
|
Command output... deploying from the scratch org to the UAT sandbox, using the named connection record in the dev hub, control org.
|
|
177
216
|
|
|
178
217
|
$ sf prodly:deploy --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com --source "UAT Sandbox Connection"
|
|
@@ -217,7 +256,7 @@ EXAMPLES
|
|
|
217
256
|
$ sf prodly:manage -m --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com
|
|
218
257
|
Manage the org associated with the target username under the Prodly account associated with the provided DevHub control org.
|
|
219
258
|
|
|
220
|
-
$ sf prodly:manage -m -
|
|
259
|
+
$ sf prodly:manage -m --target-org test-utxac7gbati9@example.com -n dev7sbx
|
|
221
260
|
Manage and version the org associated with the target username under the Prodly account associated with the default DevHub control org.
|
|
222
261
|
|
|
223
262
|
```
|
|
@@ -250,17 +289,19 @@ EXAMPLES
|
|
|
250
289
|
|
|
251
290
|
```
|
|
252
291
|
USAGE
|
|
253
|
-
$ sf prodly:version -
|
|
292
|
+
$ sf prodly:version -v <value> -o <value> [--json] [-b <value>] [-s <value>] [-i <value>]
|
|
293
|
+
[-x]
|
|
254
294
|
|
|
255
295
|
FLAGS
|
|
256
296
|
-b, --new-branch=<value> if provided it creates a new branch based on the source branch that will be used for
|
|
257
297
|
version control
|
|
258
298
|
-i, --instance=<value> managed instance ID on which to perform the action
|
|
259
|
-
-o, --target-org=<value> (required)
|
|
260
|
-
|
|
261
|
-
-s, --source-branch=<value>
|
|
262
|
-
-v, --target-dev-hub=<value> (required)
|
|
263
|
-
|
|
299
|
+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
300
|
+
configuration variable is already set.
|
|
301
|
+
-s, --source-branch=<value> the version control branch or the base for the new branch (if provided)
|
|
302
|
+
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org. Not required if the `target-dev-hub`
|
|
303
|
+
configuration variable is already set.
|
|
304
|
+
-x, --unlink unlink the branch from the managed instance
|
|
264
305
|
|
|
265
306
|
GLOBAL FLAGS
|
|
266
307
|
--json Format output as json.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { JSONObject } from '../../types/generic.js';
|
|
3
|
+
export default class ProdlyChangeTypes extends SfCommand<JSONObject> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'target-dev-hub': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
list: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
create: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
username: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<JSONObject>;
|
|
17
|
+
private logChangeType;
|
|
18
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
2
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { getChangeType, getChangeTypes } from '../../services/change-types.js';
|
|
4
|
+
import { postInstances } from '../../services/manage-instances.js';
|
|
5
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
6
|
+
const commandMessages = Messages.loadMessages('prodlysfcli', 'prodly.change-types');
|
|
7
|
+
const prodlyMessages = Messages.loadMessages('prodlysfcli', 'prodly');
|
|
8
|
+
export default class ProdlyChangeTypes extends SfCommand {
|
|
9
|
+
static summary = commandMessages.getMessage('summary');
|
|
10
|
+
static description = prodlyMessages.getMessage('descriptionChangeTypesCommand');
|
|
11
|
+
static examples = commandMessages.getMessages('examples');
|
|
12
|
+
static flags = {
|
|
13
|
+
'api-version': Flags.orgApiVersion(),
|
|
14
|
+
'target-dev-hub': Flags.requiredHub(),
|
|
15
|
+
id: Flags.string({ char: 't', summary: prodlyMessages.getMessage('changeTypeIdFlagDescription') }),
|
|
16
|
+
list: Flags.boolean({ char: 'l', summary: prodlyMessages.getMessage('listChangeTypesFlagDescription') }),
|
|
17
|
+
create: Flags.boolean({ char: 'c', summary: prodlyMessages.getMessage('createFromChangeTypeFlagDescription') }),
|
|
18
|
+
name: Flags.string({ char: 'n', summary: prodlyMessages.getMessage('createFromChangeTypeNameFlagDescription') }),
|
|
19
|
+
username: Flags.string({
|
|
20
|
+
char: 'u',
|
|
21
|
+
summary: prodlyMessages.getMessage('createFromChangeTypeUsernameFlagDescription'),
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
// eslint-disable-next-line complexity
|
|
25
|
+
async run() {
|
|
26
|
+
const { flags } = await this.parse(ProdlyChangeTypes);
|
|
27
|
+
const { create, id, list, name, username } = flags;
|
|
28
|
+
if (!create && !list) {
|
|
29
|
+
throw new SfError('Must provide either --create or --list flag');
|
|
30
|
+
}
|
|
31
|
+
if (create && list) {
|
|
32
|
+
throw new SfError('Cannot use --create and --list flags together');
|
|
33
|
+
}
|
|
34
|
+
if (create && (!name || !username || !id)) {
|
|
35
|
+
throw new SfError('Must provide --name, --username, and --id flags when using --create');
|
|
36
|
+
}
|
|
37
|
+
const hubOrg = flags['target-dev-hub'];
|
|
38
|
+
const hubConn = hubOrg.getConnection(flags['api-version']);
|
|
39
|
+
if (list) {
|
|
40
|
+
if (id) {
|
|
41
|
+
const changeType = await getChangeType({ id, hubConn });
|
|
42
|
+
if (!changeType)
|
|
43
|
+
throw new SfError(`No change type found with id ${id}`);
|
|
44
|
+
this.logChangeType(changeType);
|
|
45
|
+
return changeType ?? {};
|
|
46
|
+
}
|
|
47
|
+
const changeTypes = await getChangeTypes({ hubConn });
|
|
48
|
+
if (!changeTypes)
|
|
49
|
+
throw new SfError('No change types found');
|
|
50
|
+
changeTypes.forEach((changeType) => this.logChangeType(changeType));
|
|
51
|
+
return changeTypes;
|
|
52
|
+
}
|
|
53
|
+
if (create && id && name && username) {
|
|
54
|
+
const changeType = await getChangeType({ id, hubConn });
|
|
55
|
+
if (!changeType)
|
|
56
|
+
throw new SfError(`No change type found with id ${id}`);
|
|
57
|
+
const { jobId } = await postInstances({
|
|
58
|
+
body: {
|
|
59
|
+
environment: {
|
|
60
|
+
dataSetIds: changeType.dataset?.id ? [changeType.dataset.id] : [],
|
|
61
|
+
deploymentPlanIds: changeType.deploymentPlan?.id ? [changeType.deploymentPlan.id] : [],
|
|
62
|
+
durationDays: changeType.durationDays,
|
|
63
|
+
envType: 'scratch_org',
|
|
64
|
+
forceDataDeployment: changeType.skipDataOnMetadataFailure,
|
|
65
|
+
metadataFilterId: changeType.metadataFilter?.id,
|
|
66
|
+
metadataRollbackOnError: changeType.metadataRollbackOnFailure,
|
|
67
|
+
orgName: name,
|
|
68
|
+
packageIds: changeType.salesforcePackageIds,
|
|
69
|
+
sourcePlatformInstanceId: changeType.managedEnvironment?.instanceId,
|
|
70
|
+
username,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
hubConn,
|
|
74
|
+
});
|
|
75
|
+
this.log(`Scratch org creation job submitted with id ${jobId}`);
|
|
76
|
+
return { jobId, message: 'Scratch org creation job submitted' };
|
|
77
|
+
}
|
|
78
|
+
return {};
|
|
79
|
+
}
|
|
80
|
+
logChangeType(changeType) {
|
|
81
|
+
this.log('Name:', changeType.name);
|
|
82
|
+
this.log('Id:', changeType.id);
|
|
83
|
+
this.log('Generated Environment Type:', changeType.generatedEnvironmentType);
|
|
84
|
+
this.log('Source:', `${changeType.managedEnvironment.instanceName} (${changeType.managedEnvironment.instanceId})`);
|
|
85
|
+
if (changeType.salesforcePackageIds) {
|
|
86
|
+
this.log('Salesforce Package Ids:', changeType.salesforcePackageIds.join(', '));
|
|
87
|
+
}
|
|
88
|
+
if (changeType.metadataFilter) {
|
|
89
|
+
this.log('Metadata Filter:', `${changeType.metadataFilter.name} (${changeType.metadataFilter.id})`);
|
|
90
|
+
}
|
|
91
|
+
if (changeType.dataset) {
|
|
92
|
+
this.log('Dataset:', `${changeType.dataset.name} (${changeType.dataset.id})`);
|
|
93
|
+
}
|
|
94
|
+
if (changeType.deploymentPlan) {
|
|
95
|
+
this.log('Deployment Plan:', `${changeType.deploymentPlan.name} (${changeType.deploymentPlan.id})`);
|
|
96
|
+
}
|
|
97
|
+
this.log('Duration (days):', `${changeType.durationDays}\n`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=change-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-types.js","sourceRoot":"","sources":["../../../src/commands/prodly/change-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAInE,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,eAAe,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;AACpF,MAAM,cAAc,GAAG,QAAQ,CAA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6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
8
|
'new-branch': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
-
'source-branch': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'source-branch': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
'target-dev-hub': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
instance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
unlink: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
};
|
|
14
15
|
run(): Promise<JSONObject>;
|
|
15
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Messages, SfError } from '@salesforce/core';
|
|
2
2
|
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import { getManagedInstance, getManagedInstances, postInstances } from '../../services/manage-instances.js';
|
|
3
|
+
import { getManagedInstance, getManagedInstances, postInstances, putInstances, } from '../../services/manage-instances.js';
|
|
4
4
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
5
5
|
const messages = Messages.loadMessages('prodlysfcli', 'prodly.version');
|
|
6
6
|
const prodlyMessages = Messages.loadMessages('prodlysfcli', 'prodly');
|
|
@@ -17,7 +17,7 @@ export default class ProdlyVersion extends SfCommand {
|
|
|
17
17
|
'source-branch': Flags.string({
|
|
18
18
|
summary: prodlyMessages.getMessage('sourceBranchFlagSummary'),
|
|
19
19
|
char: 's',
|
|
20
|
-
required:
|
|
20
|
+
required: false,
|
|
21
21
|
}),
|
|
22
22
|
'target-dev-hub': Flags.requiredHub(),
|
|
23
23
|
'target-org': Flags.requiredOrg(),
|
|
@@ -26,6 +26,7 @@ export default class ProdlyVersion extends SfCommand {
|
|
|
26
26
|
char: 'i',
|
|
27
27
|
required: false,
|
|
28
28
|
}),
|
|
29
|
+
unlink: Flags.boolean({ char: 'x', summary: prodlyMessages.getMessage('unlinkBranchFlagDescription') }),
|
|
29
30
|
};
|
|
30
31
|
async run() {
|
|
31
32
|
const { flags } = await this.parse(ProdlyVersion);
|
|
@@ -33,7 +34,10 @@ export default class ProdlyVersion extends SfCommand {
|
|
|
33
34
|
const hubOrg = flags['target-dev-hub'];
|
|
34
35
|
const hubConn = hubOrg.getConnection();
|
|
35
36
|
const print = (message, ...args) => this.log(message, ...args);
|
|
36
|
-
const { instance } = flags;
|
|
37
|
+
const { instance, unlink } = flags;
|
|
38
|
+
if (!unlink && !flags['source-branch']) {
|
|
39
|
+
throw new SfError('Flag source-branch is required to version control managed environment');
|
|
40
|
+
}
|
|
37
41
|
let managedInstance;
|
|
38
42
|
// Check if managed instance Id is provided else get the managed instance from the target org
|
|
39
43
|
if (instance) {
|
|
@@ -49,6 +53,22 @@ export default class ProdlyVersion extends SfCommand {
|
|
|
49
53
|
if (!managedInstance) {
|
|
50
54
|
throw new SfError(prodlyMessages.getMessage('errorManagedInstaceNotFound'));
|
|
51
55
|
}
|
|
56
|
+
if (unlink) {
|
|
57
|
+
await putInstances({
|
|
58
|
+
hubConn,
|
|
59
|
+
body: {
|
|
60
|
+
options: { checkin: false, checkout: false, commitMessage: '', environmentExists: true },
|
|
61
|
+
platformInstance: {
|
|
62
|
+
branchName: null,
|
|
63
|
+
connectionId: managedInstance.connectionId,
|
|
64
|
+
platformInstanceId: managedInstance.platformInstanceId,
|
|
65
|
+
sourceBranchName: null,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
print('Version control managed environment unlinked');
|
|
70
|
+
return {};
|
|
71
|
+
}
|
|
52
72
|
const { jobId } = await postInstances({
|
|
53
73
|
hubConn,
|
|
54
74
|
body: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/commands/prodly/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/commands/prodly/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,YAAY,GACb,MAAM,oCAAoC,CAAC;AAG5C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;AACxE,MAAM,cAAc,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,SAAqB;IACvD,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,cAAc,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;IACrF,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE5D,MAAM,CAAU,KAAK,GAAG;QAC7B,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC,sBAAsB,CAAC;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AAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE;gBACtF,gBAAgB,EAAE;oBAChB,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC;oBAC/B,YAAY,EAAE,eAAe,CAAC,YAAY;oBAC1C,kBAAkB,EAAE,eAAe,CAAC,kBAAkB;oBACtD,gBAAgB,EAAE,KAAK,CAAC,eAAe,CAAC;iBACzC;aACF;SACF,CAAC,CAAC;QAEH,KAAK,CAAC,6DAA6D,KAAK,EAAE,CAAC,CAAC;QAC5E,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Connection } from '@salesforce/core';
|
|
2
|
+
import { ChangeType } from '../types/prodly.js';
|
|
3
|
+
export type GetChangeTypesFn = ({ hubConn }: {
|
|
4
|
+
hubConn: Connection;
|
|
5
|
+
}) => Promise<ChangeType[] | undefined>;
|
|
6
|
+
export declare const getChangeTypes: GetChangeTypesFn;
|
|
7
|
+
export type GetChangeTypeFn = ({ id, hubConn }: {
|
|
8
|
+
id: string;
|
|
9
|
+
hubConn: Connection;
|
|
10
|
+
}) => Promise<ChangeType | undefined>;
|
|
11
|
+
export declare const getChangeType: GetChangeTypeFn;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const BASE_PATH = '/services/apexrest/PDRI/v1/change-types';
|
|
2
|
+
export const getChangeTypes = async ({ hubConn }) => {
|
|
3
|
+
const res = await hubConn.request(`${hubConn.instanceUrl}${BASE_PATH}`);
|
|
4
|
+
const responseData = JSON.parse(res);
|
|
5
|
+
return responseData.changeTypes;
|
|
6
|
+
};
|
|
7
|
+
export const getChangeType = async ({ id, hubConn }) => {
|
|
8
|
+
const res = await hubConn.request(`${hubConn.instanceUrl}${BASE_PATH}/${id}`);
|
|
9
|
+
const responseData = JSON.parse(res);
|
|
10
|
+
return responseData.changeTypes[0];
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=change-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-types.js","sourceRoot":"","sources":["../../src/services/change-types.ts"],"names":[],"mappings":"AAGA,MAAM,SAAS,GAAG,yCAAyC,CAAC;AAI5D,MAAM,CAAC,MAAM,cAAc,GAAqB,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IACpE,MAAM,GAAG,GAAW,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,EAAE,CAAC,CAAC;IAChF,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkC,CAAC;IACtE,OAAO,YAAY,CAAC,WAAW,CAAC;AAClC,CAAC,CAAC;AAIF,MAAM,CAAC,MAAM,aAAa,GAAoB,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IACtE,MAAM,GAAG,GAAW,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,IAAI,EAAE,EAAE,CAAC,CAAC;IACtF,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkC,CAAC;IACtE,OAAO,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { GetManagedInstanceFn, GetManagedInstancesFn, ManageInstanceAsyncFn, ManageInstanceFn, PostInstancesFn, UnmanageInstanceFn } from './manage-instances.types.js';
|
|
1
|
+
import { GetManagedInstanceFn, GetManagedInstancesFn, ManageInstanceAsyncFn, ManageInstanceFn, PostInstancesFn, PutInstancesFn, UnmanageInstanceFn } from './manage-instances.types.js';
|
|
2
2
|
declare const getManagedInstances: GetManagedInstancesFn;
|
|
3
3
|
declare const getManagedInstance: GetManagedInstanceFn;
|
|
4
4
|
declare const manageInstance: ManageInstanceFn;
|
|
5
5
|
declare const manageInstanceAsync: ManageInstanceAsyncFn;
|
|
6
6
|
declare const postInstances: PostInstancesFn;
|
|
7
|
+
declare const putInstances: PutInstancesFn;
|
|
7
8
|
declare const unmanageInstance: UnmanageInstanceFn;
|
|
8
|
-
export { getManagedInstance, getManagedInstances, manageInstance, manageInstanceAsync, postInstances, unmanageInstance, };
|
|
9
|
+
export { getManagedInstance, getManagedInstances, manageInstance, manageInstanceAsync, postInstances, putInstances, unmanageInstance, };
|
|
@@ -93,6 +93,14 @@ const postInstances = async ({ body, hubConn }) => {
|
|
|
93
93
|
}
|
|
94
94
|
return { jobId };
|
|
95
95
|
};
|
|
96
|
+
const putInstances = async ({ body, hubConn }) => {
|
|
97
|
+
const request = {
|
|
98
|
+
body: JSON.stringify(body),
|
|
99
|
+
method: 'PUT',
|
|
100
|
+
url: BASE_PATH,
|
|
101
|
+
};
|
|
102
|
+
await hubConn.request(request);
|
|
103
|
+
};
|
|
96
104
|
const unmanageInstance = async ({ hubConn, instanceId, print }) => {
|
|
97
105
|
if (print)
|
|
98
106
|
print(`Unmanaging instance with ID ${instanceId}.`);
|
|
@@ -104,5 +112,5 @@ const unmanageInstance = async ({ hubConn, instanceId, print }) => {
|
|
|
104
112
|
await hubConn.request(request);
|
|
105
113
|
return;
|
|
106
114
|
};
|
|
107
|
-
export { getManagedInstance, getManagedInstances, manageInstance, manageInstanceAsync, postInstances, unmanageInstance, };
|
|
115
|
+
export { getManagedInstance, getManagedInstances, manageInstance, manageInstanceAsync, postInstances, putInstances, unmanageInstance, };
|
|
108
116
|
//# sourceMappingURL=manage-instances.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manage-instances.js","sourceRoot":"","sources":["../../src/services/manage-instances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,aAAa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stancesFn = ({ body, hubConn, }: {
|
|
|
47
47
|
}) => Promise<{
|
|
48
48
|
jobId: string;
|
|
49
49
|
}>;
|
|
50
|
+
export type PutInstancesFn = ({ body, hubConn, }: {
|
|
51
|
+
hubConn: Connection;
|
|
52
|
+
body: {
|
|
53
|
+
[key: string]: {
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}) => Promise<void>;
|
|
50
58
|
export {};
|
package/lib/types/generic.d.ts
CHANGED
package/lib/types/prodly.d.ts
CHANGED
|
@@ -67,3 +67,29 @@ export type CheckinOptions = {
|
|
|
67
67
|
hubConn: Connection;
|
|
68
68
|
mangedInstanceId: string;
|
|
69
69
|
};
|
|
70
|
+
export type ChangeType = {
|
|
71
|
+
dataset: NameAndId;
|
|
72
|
+
deploymentPlan: NameAndId;
|
|
73
|
+
durationDays: number;
|
|
74
|
+
generatedEnvironmentType: string;
|
|
75
|
+
id: string;
|
|
76
|
+
managedEnvironment: CTManagedEnvironment;
|
|
77
|
+
metadataFilter: NameAndId;
|
|
78
|
+
metadataRollbackOnFailure: boolean;
|
|
79
|
+
name: string;
|
|
80
|
+
salesforcePackageIds: string[];
|
|
81
|
+
skipDataOnMetadataFailure: boolean;
|
|
82
|
+
};
|
|
83
|
+
export type CTManagedEnvironment = {
|
|
84
|
+
controlInstance: boolean;
|
|
85
|
+
id: string;
|
|
86
|
+
instanceId: string;
|
|
87
|
+
instanceName: string;
|
|
88
|
+
instanceType: string;
|
|
89
|
+
instanceUrl: string;
|
|
90
|
+
licenseType: string;
|
|
91
|
+
};
|
|
92
|
+
export type NameAndId = {
|
|
93
|
+
id: string;
|
|
94
|
+
name: string;
|
|
95
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
prodly:change-types command
|
|
4
|
+
|
|
5
|
+
# examples
|
|
6
|
+
|
|
7
|
+
- <%= config.bin %> prodly:change-types --target-dev-hub jsmith@acme.com -l
|
|
8
|
+
Lists all the change types
|
|
9
|
+
|
|
10
|
+
- <%= config.bin %> prodly:change-types --target-dev-hub jsmith@acme.com -l -t a1h3t00000JN9lhAAD
|
|
11
|
+
Lists a specific change type
|
|
12
|
+
|
|
13
|
+
- <%= config.bin %> prodly:change-types --target-dev-hub jsmith@acme.com -c -n "SO FROM CLI" -u "username@example.com" -t a1h3t00000JN9lhAAD
|
|
14
|
+
Creates a scratch org based on a change type
|
|
@@ -7,7 +7,7 @@ prodly:checkin command
|
|
|
7
7
|
- <%= config.bin %> prodly:checkin --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com
|
|
8
8
|
Save managed data to the branch associated with the managed instance identified by the target username.
|
|
9
9
|
The instance should be managed by the Prodly account associated with the provided DevHub control org.
|
|
10
|
-
- <%= config.bin %> prodly:checkin -
|
|
10
|
+
- <%= config.bin %> prodly:checkin --target-org test-utxac7gbati9@example.com
|
|
11
11
|
Save managed data to the branch associated with the managed instance identified by the target username.
|
|
12
12
|
The instance should be managed by the Prodly account associated with the default DevHub control org.
|
|
13
13
|
- <%= config.bin %> prodly:checkin -i f50616b6-57b1-4941-802f-ee0e2506f217
|
|
@@ -7,7 +7,7 @@ prodly:checkout command
|
|
|
7
7
|
- <%= config.bin %> prodly:checkout --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com
|
|
8
8
|
Deploy managed data to the managed instance identified by the target org from the associated branch.
|
|
9
9
|
The instance should be managed by the Prodly account associated with the provided DevHub control org.
|
|
10
|
-
- <%= config.bin %> prodly:checkout -
|
|
10
|
+
- <%= config.bin %> prodly:checkout --target-org test-utxac7gbati9@example.com
|
|
11
11
|
Deploy managed data to the managed instance org identified by the target username from the associated branch.
|
|
12
12
|
The instance should be managed by the Prodly account associated with the default DevHub control org.
|
|
13
13
|
- <%= config.bin %> prodly:checkout -i f50616b6-57b1-4941-802f-ee0e2506f217
|
|
@@ -4,11 +4,11 @@ prodly:deploy command
|
|
|
4
4
|
|
|
5
5
|
# examples
|
|
6
6
|
|
|
7
|
-
- <%= config.bin %> prodly:deploy -n scratchorg -
|
|
7
|
+
- <%= config.bin %> prodly:deploy -n scratchorg --target-org FixesScratchOrg -v MainDevHub
|
|
8
8
|
Command output... deploying from the dev hub, the control org, to the scratch org, auto managed with provided name.
|
|
9
9
|
- <%= config.bin %> prodly:deploy --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com
|
|
10
10
|
Command output... deploying from the dev hub, the control org, to the scratch org. Long param names.
|
|
11
|
-
- <%= config.bin %> prodly:deploy -
|
|
11
|
+
- <%= config.bin %> prodly:deploy --target-org test-utxac7gbati9@example.com -v jsmith@acme.com -d "UAT Sandbox Connection"
|
|
12
12
|
Command output... deploying from the scratch org to the UAT sandbox, using the named connection record in the dev hub, control org.
|
|
13
13
|
- <%= config.bin %> prodly:deploy --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com --source "UAT Sandbox Connection"
|
|
14
14
|
Command output... deploying to the scratch org from the UAT sandbox, using the named connection record in the dev hub, control org. Long param names.
|
package/messages/prodly.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"branchFlagDescription": "branch name for deployment",
|
|
3
|
+
"changeTypeIdFlagDescription": "change type ID",
|
|
3
4
|
"commentFlagDescription": "comment for the command versioning commit",
|
|
4
5
|
"connectionFlagDescription": "connection to use for the managed instance",
|
|
6
|
+
"createFromChangeTypeFlagDescription": "create a scratch org from a change type",
|
|
7
|
+
"createFromChangeTypeNameFlagDescription": "name to use for the scratch org",
|
|
8
|
+
"createFromChangeTypeUsernameFlagDescription": "username to use for the scratch org",
|
|
5
9
|
"dataSetFlagDescription": "name or record ID of the data set to deploy",
|
|
6
10
|
"deactivateFlagDescription": "deactivate all events for the deployment",
|
|
7
11
|
"deplomentNameFlagDescription": "name for the deployment",
|
|
@@ -10,6 +14,7 @@
|
|
|
10
14
|
"instanceFlagDescription": "managed instance ID on which to perform the action",
|
|
11
15
|
"instanceNameFlagDescription": "connection and managed instance name",
|
|
12
16
|
"jobIdFlagSummary": "Prodly Job ID",
|
|
17
|
+
"listChangeTypesFlagDescription": "list all change types or specific change type",
|
|
13
18
|
"listFlagDescription": "list all managed instances",
|
|
14
19
|
"manageFlagDescription": "manage a new instance",
|
|
15
20
|
"newBranchFlagSummary": "if provided it creates a new branch based on the source branch that will be used for version control",
|
|
@@ -19,6 +24,7 @@
|
|
|
19
24
|
"simulationFlagDescription": "perform a data simulation",
|
|
20
25
|
"sourceBranchFlagSummary": "the version control branch or the base for the new branch (if provided)",
|
|
21
26
|
"sourceFlagDescription": "source managed instance ID",
|
|
27
|
+
"unlinkBranchFlagDescription": "unlink the branch from the managed instance",
|
|
22
28
|
"unmanageFlagDescription": "unmanage the specified instance",
|
|
23
29
|
"versionFlagDescription": "version the new managed instance, branch created and data deployed to the org",
|
|
24
30
|
|
|
@@ -43,6 +49,7 @@
|
|
|
43
49
|
|
|
44
50
|
"unmanageInstancePrompt": "Unmanaging is a destructive and irreversible change which will delete all record mappings for this instance. Provide the instance ID if you are sure you want to continue? ",
|
|
45
51
|
|
|
52
|
+
"descriptionChangeTypesCommand": "List all or a specific change type and create scratch org from a change type.",
|
|
46
53
|
"descriptionCheckinCommand": "Save data from a Salesforce environment to a VCS repository branch.",
|
|
47
54
|
"descriptionCheckoutCommand": "Deploy data from a VCS repository branch to a Salesforce environment.",
|
|
48
55
|
"descriptionDeployCommand": "Deploy data from one Salesforce environment directly to another Salesforce environment.",
|
|
@@ -8,5 +8,5 @@ prodly:manage command
|
|
|
8
8
|
List and print all of the managed instances for the Prodly account associated with the default DevHub control org.
|
|
9
9
|
- <%= config.bin %> prodly:manage -m --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com
|
|
10
10
|
Manage the org associated with the target username under the Prodly account associated with the provided DevHub control org.
|
|
11
|
-
- <%= config.bin %> prodly:manage -m -
|
|
11
|
+
- <%= config.bin %> prodly:manage -m --target-org test-utxac7gbati9@example.com -n dev7sbx
|
|
12
12
|
Manage and version the org associated with the target username under the Prodly account associated with the default DevHub control org.
|
|
@@ -10,3 +10,6 @@ prodly:version command
|
|
|
10
10
|
- <%= config.bin %> prodly:version -s main -b cli-branch -i f50616b6-57b1-4941-802f-ee0e2506f217
|
|
11
11
|
Add version control to the managed instance identified by the provided ID. Use the "main" branch as a base for a new branch called "cli-branch"
|
|
12
12
|
The instance should be managed by the Prodly account associated with the default DevHub control org.
|
|
13
|
+
- <%= config.bin %> prodly:version -x -i f50616b6-57b1-4941-802f-ee0e2506f217
|
|
14
|
+
Remove version control from the managed instance identified by the provided ID.
|
|
15
|
+
The instance should be managed by the Prodly account associated with the default DevHub control org.
|