@salesforce/plugin-signups 1.5.6 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +66 -66
- package/lib/commands/org/create/shape.d.ts +3 -3
- package/lib/commands/org/create/shape.js +20 -22
- package/lib/commands/org/create/shape.js.map +1 -1
- package/lib/commands/org/create/snapshot.d.ts +7 -7
- package/lib/commands/org/create/snapshot.js +46 -50
- package/lib/commands/org/create/snapshot.js.map +1 -1
- package/lib/commands/org/delete/shape.d.ts +5 -20
- package/lib/commands/org/delete/shape.js +28 -73
- package/lib/commands/org/delete/shape.js.map +1 -1
- package/lib/commands/org/delete/snapshot.d.ts +4 -4
- package/lib/commands/org/delete/snapshot.js +28 -30
- package/lib/commands/org/delete/snapshot.js.map +1 -1
- package/lib/commands/org/get/snapshot.d.ts +5 -5
- package/lib/commands/org/get/snapshot.js +27 -29
- package/lib/commands/org/get/snapshot.js.map +1 -1
- package/lib/commands/org/list/shape.d.ts +3 -7
- package/lib/commands/org/list/shape.js +22 -34
- package/lib/commands/org/list/shape.js.map +1 -1
- package/lib/commands/org/list/snapshot.d.ts +4 -4
- package/lib/commands/org/list/snapshot.js +21 -23
- package/lib/commands/org/list/snapshot.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/shared/deleteUtils.d.ts +19 -0
- package/lib/shared/deleteUtils.js +58 -0
- package/lib/shared/deleteUtils.js.map +1 -0
- package/lib/shared/orgShapeListUtils.d.ts +13 -0
- package/lib/shared/orgShapeListUtils.js +26 -13
- package/lib/shared/orgShapeListUtils.js.map +1 -1
- package/lib/shared/snapshot.js +19 -24
- package/lib/shared/snapshot.js.map +1 -1
- package/messages/messages.md +4 -0
- package/oclif.lock +611 -718
- package/oclif.manifest.json +573 -245
- package/package.json +35 -55
package/README.md
CHANGED
@@ -78,25 +78,25 @@ sfdx plugins
|
|
78
78
|
|
79
79
|
<!-- commands -->
|
80
80
|
|
81
|
-
- [`
|
82
|
-
- [`
|
83
|
-
- [`
|
84
|
-
- [`
|
85
|
-
- [`
|
86
|
-
- [`
|
87
|
-
- [`
|
81
|
+
- [`sf org create shape`](#sf-org-create-shape)
|
82
|
+
- [`sf org create snapshot`](#sf-org-create-snapshot)
|
83
|
+
- [`sf org delete shape`](#sf-org-delete-shape)
|
84
|
+
- [`sf org delete snapshot`](#sf-org-delete-snapshot)
|
85
|
+
- [`sf org get snapshot`](#sf-org-get-snapshot)
|
86
|
+
- [`sf org list shape`](#sf-org-list-shape)
|
87
|
+
- [`sf org list snapshot`](#sf-org-list-snapshot)
|
88
88
|
|
89
|
-
## `
|
89
|
+
## `sf org create shape`
|
90
90
|
|
91
91
|
Create a scratch org configuration (shape) based on the specified source org.
|
92
92
|
|
93
93
|
```
|
94
94
|
USAGE
|
95
|
-
$
|
95
|
+
$ sf org create shape -o <value> [--json] [--api-version <value>]
|
96
96
|
|
97
97
|
FLAGS
|
98
|
-
-o, --target-org=<value>
|
99
|
-
|
98
|
+
-o, --target-org=<value> (required) Username or alias of the target org.
|
99
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
100
100
|
|
101
101
|
GLOBAL FLAGS
|
102
102
|
--json Format output as json.
|
@@ -107,36 +107,36 @@ DESCRIPTION
|
|
107
107
|
Scratch org shapes mimic the baseline setup (features, limits, edition, and Metadata API settings) of a source org
|
108
108
|
without the extraneous data and metadata.
|
109
109
|
|
110
|
-
Run "
|
110
|
+
Run "sf org list shape" to view the available org shapes and their IDs.
|
111
111
|
|
112
112
|
To create a scratch org from an org shape, include the "sourceOrg" property in the scratch org definition file and set
|
113
|
-
it to the org ID of the source org. Then create a scratch org with the "
|
113
|
+
it to the org ID of the source org. Then create a scratch org with the "sf force:org:create" command.
|
114
114
|
|
115
115
|
ALIASES
|
116
|
-
$
|
116
|
+
$ sf force org shape create
|
117
117
|
|
118
118
|
EXAMPLES
|
119
119
|
Create an org shape for the source org with alias SourceOrg:
|
120
120
|
|
121
|
-
$
|
121
|
+
$ sf org create shape --target-org SourceOrg
|
122
122
|
```
|
123
123
|
|
124
|
-
_See code: [src/commands/org/create/shape.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.
|
124
|
+
_See code: [src/commands/org/create/shape.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.7/src/commands/org/create/shape.ts)_
|
125
125
|
|
126
|
-
## `
|
126
|
+
## `sf org create snapshot`
|
127
127
|
|
128
128
|
Create a snapshot of a scratch org.
|
129
129
|
|
130
130
|
```
|
131
131
|
USAGE
|
132
|
-
$
|
132
|
+
$ sf org create snapshot -v <value> -o <value> -n <value> [--json] [--api-version <value>] [-d <value>]
|
133
133
|
|
134
134
|
FLAGS
|
135
135
|
-d, --description=<value> Description of snapshot.
|
136
136
|
-n, --name=<value> (required) Unique name of snapshot.
|
137
137
|
-o, --source-org=<value> (required) ID or locally authenticated username or alias of scratch org to snapshot.
|
138
138
|
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org.
|
139
|
-
|
139
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
140
140
|
|
141
141
|
GLOBAL FLAGS
|
142
142
|
--json Format output as json.
|
@@ -147,25 +147,25 @@ DESCRIPTION
|
|
147
147
|
A snapshot is a point-in-time copy of a scratch org. The copy is referenced by its unique name in a scratch org
|
148
148
|
definition file.
|
149
149
|
|
150
|
-
Use "
|
150
|
+
Use "sf org get snapshot" to get details, including status, about a snapshot creation request.
|
151
151
|
|
152
152
|
To create a scratch org from a snapshot, include the "snapshot" option (instead of "edition") in the scratch org
|
153
|
-
definition file and set it to the name of the snapshot. Then use "
|
153
|
+
definition file and set it to the name of the snapshot. Then use "sf force:org:create" to create the scratch org.
|
154
154
|
|
155
155
|
ALIASES
|
156
|
-
$
|
156
|
+
$ sf force org snapshot create
|
157
157
|
|
158
158
|
EXAMPLES
|
159
159
|
Create a snapshot called "Dependencies" using the source scratch org ID and your default Dev Hub org:
|
160
160
|
|
161
|
-
$
|
161
|
+
$ sf org create snapshot --source-org 00Dxx0000000000 --name Dependencies --description 'Contains PackageA \
|
162
162
|
v1.1.0'
|
163
163
|
|
164
164
|
Create a snapshot called "NightlyBranch" using the source scratch org username and a Dev Hub org with alias
|
165
165
|
NightlyDevHub:
|
166
166
|
|
167
|
-
$
|
168
|
-
|
167
|
+
$ sf org create snapshot --source-org myuser@myorg --name NightlyBranch --description 'Contains PkgA v2.1.0 and \
|
168
|
+
PkgB 3.3.0' --target-dev-hub NightlyDevHub
|
169
169
|
|
170
170
|
FLAG DESCRIPTIONS
|
171
171
|
-d, --description=<value> Description of snapshot.
|
@@ -174,20 +174,20 @@ FLAG DESCRIPTIONS
|
|
174
174
|
as a version control system tag or commit ID.
|
175
175
|
```
|
176
176
|
|
177
|
-
_See code: [src/commands/org/create/snapshot.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.
|
177
|
+
_See code: [src/commands/org/create/snapshot.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.7/src/commands/org/create/snapshot.ts)_
|
178
178
|
|
179
|
-
## `
|
179
|
+
## `sf org delete shape`
|
180
180
|
|
181
181
|
Delete all org shapes for a target org.
|
182
182
|
|
183
183
|
```
|
184
184
|
USAGE
|
185
|
-
$
|
185
|
+
$ sf org delete shape -o <value> [--json] [--api-version <value>] [-p]
|
186
186
|
|
187
187
|
FLAGS
|
188
|
-
-o, --target-org=<value>
|
189
|
-
-p, --no-prompt
|
190
|
-
|
188
|
+
-o, --target-org=<value> (required) Username or alias of the target org.
|
189
|
+
-p, --no-prompt Don't prompt for confirmation.
|
190
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
191
191
|
|
192
192
|
GLOBAL FLAGS
|
193
193
|
--json Format output as json.
|
@@ -200,32 +200,32 @@ DESCRIPTION
|
|
200
200
|
orgs based on this shape, you can delete the org shape.
|
201
201
|
|
202
202
|
ALIASES
|
203
|
-
$
|
203
|
+
$ sf force org shape delete
|
204
204
|
|
205
205
|
EXAMPLES
|
206
206
|
Delete all org shapes for the source org with alias SourceOrg:
|
207
207
|
|
208
|
-
$
|
208
|
+
$ sf org delete shape --target-org SourceOrg
|
209
209
|
|
210
210
|
Delete all org shapes without prompting:
|
211
211
|
|
212
|
-
$
|
212
|
+
$ sf org delete shape --target-org SourceOrg --no-prompt
|
213
213
|
```
|
214
214
|
|
215
|
-
_See code: [src/commands/org/delete/shape.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.
|
215
|
+
_See code: [src/commands/org/delete/shape.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.7/src/commands/org/delete/shape.ts)_
|
216
216
|
|
217
|
-
## `
|
217
|
+
## `sf org delete snapshot`
|
218
218
|
|
219
219
|
Delete a scratch org snapshot.
|
220
220
|
|
221
221
|
```
|
222
222
|
USAGE
|
223
|
-
$
|
223
|
+
$ sf org delete snapshot -v <value> -s <value> [--json] [--api-version <value>]
|
224
224
|
|
225
225
|
FLAGS
|
226
226
|
-s, --snapshot=<value> (required) Name or ID of snapshot to delete.
|
227
227
|
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org.
|
228
|
-
|
228
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
229
229
|
|
230
230
|
GLOBAL FLAGS
|
231
231
|
--json Format output as json.
|
@@ -237,16 +237,16 @@ DESCRIPTION
|
|
237
237
|
Modify All permissions.
|
238
238
|
|
239
239
|
ALIASES
|
240
|
-
$
|
240
|
+
$ sf force org snapshot delete
|
241
241
|
|
242
242
|
EXAMPLES
|
243
243
|
Delete a snapshot from the default Dev Hub using the snapshot ID:
|
244
244
|
|
245
|
-
$
|
245
|
+
$ sf org delete snapshot --snapshot 0Oo...
|
246
246
|
|
247
247
|
Delete a snapshot from the specified Dev Hub using the snapshot name:
|
248
248
|
|
249
|
-
$
|
249
|
+
$ sf org delete snapshot --snapshot BaseSnapshot --target-dev-hub SnapshotDevHub
|
250
250
|
|
251
251
|
FLAG DESCRIPTIONS
|
252
252
|
-s, --snapshot=<value> Name or ID of snapshot to delete.
|
@@ -254,20 +254,20 @@ FLAG DESCRIPTIONS
|
|
254
254
|
The IDs of scratch org snapshots start with 0Oo.
|
255
255
|
```
|
256
256
|
|
257
|
-
_See code: [src/commands/org/delete/snapshot.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.
|
257
|
+
_See code: [src/commands/org/delete/snapshot.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.7/src/commands/org/delete/snapshot.ts)_
|
258
258
|
|
259
|
-
## `
|
259
|
+
## `sf org get snapshot`
|
260
260
|
|
261
261
|
Get details about a scratch org snapshot.
|
262
262
|
|
263
263
|
```
|
264
264
|
USAGE
|
265
|
-
$
|
265
|
+
$ sf org get snapshot -v <value> -s <value> [--json] [--api-version <value>]
|
266
266
|
|
267
267
|
FLAGS
|
268
268
|
-s, --snapshot=<value> (required) Name or ID of snapshot to retrieve.
|
269
269
|
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org.
|
270
|
-
|
270
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
271
271
|
|
272
272
|
GLOBAL FLAGS
|
273
273
|
--json Format output as json.
|
@@ -278,20 +278,20 @@ DESCRIPTION
|
|
278
278
|
Snapshot creation can take a while. Use this command with the snapshot name or ID to check its creation status. After
|
279
279
|
the status changes to Active, you can use the snapshot to create scratch orgs.
|
280
280
|
|
281
|
-
To create a snapshot, use the "
|
282
|
-
|
281
|
+
To create a snapshot, use the "sf org create snapshot" command. To retrieve a list of all snapshots, use "sf org list
|
282
|
+
snapshot".
|
283
283
|
|
284
284
|
ALIASES
|
285
|
-
$
|
285
|
+
$ sf force org snapshot get
|
286
286
|
|
287
287
|
EXAMPLES
|
288
288
|
Get snapshot details using its ID and the default Dev Hub org:
|
289
289
|
|
290
|
-
$
|
290
|
+
$ sf org get snapshot --snapshot 0Oo...
|
291
291
|
|
292
292
|
Get snapshot details using its name from a Dev Hub org with alias SnapshotDevHub:
|
293
293
|
|
294
|
-
$
|
294
|
+
$ sf org get snapshot --snapshot Dependencies --target-dev-hub SnapshotDevHub
|
295
295
|
|
296
296
|
FLAG DESCRIPTIONS
|
297
297
|
-s, --snapshot=<value> Name or ID of snapshot to retrieve.
|
@@ -299,15 +299,15 @@ FLAG DESCRIPTIONS
|
|
299
299
|
The IDs of scratch org snapshots start with 0Oo.
|
300
300
|
```
|
301
301
|
|
302
|
-
_See code: [src/commands/org/get/snapshot.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.
|
302
|
+
_See code: [src/commands/org/get/snapshot.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.7/src/commands/org/get/snapshot.ts)_
|
303
303
|
|
304
|
-
## `
|
304
|
+
## `sf org list shape`
|
305
305
|
|
306
306
|
List all org shapes you’ve created.
|
307
307
|
|
308
308
|
```
|
309
309
|
USAGE
|
310
|
-
$
|
310
|
+
$ sf org list shape [--json]
|
311
311
|
|
312
312
|
GLOBAL FLAGS
|
313
313
|
--json Format output as json.
|
@@ -319,31 +319,31 @@ DESCRIPTION
|
|
319
319
|
the org ID to update your scratch org configuration file so you can create a scratch org based on this org shape.
|
320
320
|
|
321
321
|
ALIASES
|
322
|
-
$
|
322
|
+
$ sf force org shape list
|
323
323
|
|
324
324
|
EXAMPLES
|
325
325
|
List all org shapes you've created:
|
326
326
|
|
327
|
-
$
|
327
|
+
$ sf org list shape
|
328
328
|
|
329
329
|
List all org shapes in JSON format and write the output to a file:
|
330
330
|
|
331
|
-
$
|
331
|
+
$ sf org list shape --json > tmp/MyOrgShapeList.json
|
332
332
|
```
|
333
333
|
|
334
|
-
_See code: [src/commands/org/list/shape.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.
|
334
|
+
_See code: [src/commands/org/list/shape.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.7/src/commands/org/list/shape.ts)_
|
335
335
|
|
336
|
-
## `
|
336
|
+
## `sf org list snapshot`
|
337
337
|
|
338
338
|
List scratch org snapshots.
|
339
339
|
|
340
340
|
```
|
341
341
|
USAGE
|
342
|
-
$
|
342
|
+
$ sf org list snapshot -v <value> [--json] [--api-version <value>]
|
343
343
|
|
344
344
|
FLAGS
|
345
345
|
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org.
|
346
|
-
|
346
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
347
347
|
|
348
348
|
GLOBAL FLAGS
|
349
349
|
--json Format output as json.
|
@@ -355,22 +355,22 @@ DESCRIPTION
|
|
355
355
|
associated with the Dev Hub org. If you’re a user, you can see only your snapshots unless a Dev Hub admin gives you
|
356
356
|
View All permissions.
|
357
357
|
|
358
|
-
To create a snapshot, use the "
|
359
|
-
|
358
|
+
To create a snapshot, use the "sf org create snapshot" command. To get details about a snapshot request, use "sf org
|
359
|
+
get snapshot".
|
360
360
|
|
361
361
|
ALIASES
|
362
|
-
$
|
362
|
+
$ sf force org snapshot list
|
363
363
|
|
364
364
|
EXAMPLES
|
365
365
|
List snapshots in the default Dev Hub:
|
366
366
|
|
367
|
-
$
|
367
|
+
$ sf org list snapshot
|
368
368
|
|
369
369
|
List snapshots in the Dev Hub with alias SnapshotDevHub:
|
370
370
|
|
371
|
-
$
|
371
|
+
$ sf org list snapshot --target-dev-hub SnapshotDevHub
|
372
372
|
```
|
373
373
|
|
374
|
-
_See code: [src/commands/org/list/snapshot.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.
|
374
|
+
_See code: [src/commands/org/list/snapshot.ts](https://github.com/salesforcecli/plugin-signups/blob/1.5.7/src/commands/org/list/snapshot.ts)_
|
375
375
|
|
376
376
|
<!-- commandsstop -->
|
@@ -11,9 +11,9 @@ export declare class OrgShapeCreateCommand extends SfCommand<ShapeCreateResult>
|
|
11
11
|
static readonly aliases: string[];
|
12
12
|
static readonly deprecateAliases = true;
|
13
13
|
static readonly flags: {
|
14
|
-
'target-org': import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
15
|
-
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
16
|
-
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
14
|
+
'target-org': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
15
|
+
'api-version': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
16
|
+
loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
17
17
|
};
|
18
18
|
run(): Promise<ShapeCreateResult>;
|
19
19
|
}
|
@@ -1,27 +1,36 @@
|
|
1
|
-
"use strict";
|
2
1
|
/*
|
3
2
|
* Copyright (c) 2022, salesforce.com, inc.
|
4
3
|
* All rights reserved.
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
7
6
|
*/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
const messages =
|
15
|
-
class OrgShapeCreateCommand extends
|
7
|
+
import { dirname } from 'node:path';
|
8
|
+
import { fileURLToPath } from 'node:url';
|
9
|
+
import { SfCommand, requiredOrgFlagWithDeprecations, orgApiVersionFlagWithDeprecations, loglevel, } from '@salesforce/sf-plugins-core';
|
10
|
+
import { Messages, Logger } from '@salesforce/core';
|
11
|
+
import { isShapeEnabled } from '../../../shared/orgShapeListUtils.js';
|
12
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
13
|
+
const messages = Messages.loadMessages('@salesforce/plugin-signups', 'shape.create');
|
14
|
+
export class OrgShapeCreateCommand extends SfCommand {
|
15
|
+
static summary = messages.getMessage('summary');
|
16
|
+
static description = messages.getMessage('description');
|
17
|
+
static examples = messages.getMessages('examples');
|
18
|
+
static aliases = ['force:org:shape:create'];
|
19
|
+
static deprecateAliases = true;
|
20
|
+
static flags = {
|
21
|
+
'target-org': requiredOrgFlagWithDeprecations,
|
22
|
+
'api-version': orgApiVersionFlagWithDeprecations,
|
23
|
+
loglevel,
|
24
|
+
};
|
16
25
|
async run() {
|
17
26
|
const { flags } = await this.parse(OrgShapeCreateCommand);
|
18
27
|
const conn = flags['target-org'].getConnection(flags['api-version']);
|
19
|
-
if (!(await
|
28
|
+
if (!(await isShapeEnabled(conn))) {
|
20
29
|
throw messages.createError('ShapeRepresentationNoAccess', [flags['target-org'].getUsername()]);
|
21
30
|
}
|
22
31
|
const createShapeResponse = await createShapeOrg(conn);
|
23
32
|
if (createShapeResponse.success !== true) {
|
24
|
-
(await
|
33
|
+
(await Logger.child('OrgShapeCreateCommand')).error('Shape create failed', createShapeResponse['errors']);
|
25
34
|
throw messages.createError('ShapeCreateFailed');
|
26
35
|
}
|
27
36
|
const output = {
|
@@ -33,17 +42,6 @@ class OrgShapeCreateCommand extends sf_plugins_core_1.SfCommand {
|
|
33
42
|
return output;
|
34
43
|
}
|
35
44
|
}
|
36
|
-
exports.OrgShapeCreateCommand = OrgShapeCreateCommand;
|
37
|
-
OrgShapeCreateCommand.summary = messages.getMessage('summary');
|
38
|
-
OrgShapeCreateCommand.description = messages.getMessage('description');
|
39
|
-
OrgShapeCreateCommand.examples = messages.getMessages('examples');
|
40
|
-
OrgShapeCreateCommand.aliases = ['force:org:shape:create'];
|
41
|
-
OrgShapeCreateCommand.deprecateAliases = true;
|
42
|
-
OrgShapeCreateCommand.flags = {
|
43
|
-
'target-org': sf_plugins_core_1.requiredOrgFlagWithDeprecations,
|
44
|
-
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
45
|
-
loglevel: sf_plugins_core_1.loglevel,
|
46
|
-
};
|
47
45
|
const createShapeOrg = async (conn) => {
|
48
46
|
try {
|
49
47
|
return await conn.sobject('ShapeRepresentation').create({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"shape.js","sourceRoot":"","sources":["../../../../src/commands/org/create/shape.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"shape.js","sourceRoot":"","sources":["../../../../src/commands/org/create/shape.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,SAAS,EACT,+BAA+B,EAC/B,iCAAiC,EACjC,QAAQ,GACT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAc,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAgB,MAAM,sCAAsC,CAAC;AAEpF,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAAC;AAQrF,MAAM,OAAO,qBAAsB,SAAQ,SAA4B;IAC9D,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,OAAO,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACrD,MAAM,CAAU,gBAAgB,GAAG,IAAI,CAAC;IAExC,MAAM,CAAU,KAAK,GAAG;QAC7B,YAAY,EAAE,+BAA+B;QAC7C,aAAa,EAAE,iCAAiC;QAChD,QAAQ;KACT,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,C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,KAAK,eAAe,EAAE;YAC1G,MAAM,QAAQ,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;SACvD;aAAM;YACL,MAAM,UAAU,CAAC;SAClB;KACF;AACH,CAAC,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
2
|
-
import { OrgSnapshot } from '../../../shared/snapshot';
|
2
|
+
import { OrgSnapshot } from '../../../shared/snapshot.js';
|
3
3
|
export declare class SnapshotCreate extends SfCommand<OrgSnapshot> {
|
4
4
|
static readonly summary: string;
|
5
5
|
static readonly description: string;
|
@@ -8,12 +8,12 @@ export declare class SnapshotCreate extends SfCommand<OrgSnapshot> {
|
|
8
8
|
static readonly deprecateAliases = true;
|
9
9
|
static readonly state = "closedPilot";
|
10
10
|
static readonly flags: {
|
11
|
-
'target-dev-hub': import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").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
|
-
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
14
|
-
'source-org': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
15
|
-
name: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
16
|
-
description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
11
|
+
'target-dev-hub': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
12
|
+
'api-version': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
13
|
+
loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
14
|
+
'source-org': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
15
|
+
name: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
16
|
+
description: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
17
17
|
};
|
18
18
|
run(): Promise<OrgSnapshot>;
|
19
19
|
}
|
@@ -1,21 +1,52 @@
|
|
1
|
-
"use strict";
|
2
|
-
var _a;
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.SnapshotCreate = void 0;
|
5
1
|
/*
|
6
2
|
* Copyright (c) 2020, salesforce.com, inc.
|
7
3
|
* All rights reserved.
|
8
4
|
* Licensed under the BSD 3-Clause license.
|
9
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
10
6
|
*/
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
import { dirname } from 'node:path';
|
8
|
+
import { fileURLToPath } from 'node:url';
|
9
|
+
import { Flags, SfCommand, loglevel, orgApiVersionFlagWithDeprecations, requiredHubFlagWithDeprecations, } from '@salesforce/sf-plugins-core';
|
10
|
+
import { StateAggregator, Messages, SfError } from '@salesforce/core';
|
11
|
+
import { queryByNameOrId, printSingleRecordTable } from '../../../shared/snapshot.js';
|
12
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
13
|
+
const messages = Messages.loadMessages('@salesforce/plugin-signups', 'snapshot.create');
|
14
|
+
export class SnapshotCreate extends SfCommand {
|
15
|
+
static summary = messages.getMessage('summary');
|
16
|
+
static description = messages.getMessage('description');
|
17
|
+
static examples = messages.getMessages('examples');
|
18
|
+
static aliases = ['force:org:snapshot:create'];
|
19
|
+
static deprecateAliases = true;
|
20
|
+
static state = 'closedPilot';
|
21
|
+
static flags = {
|
22
|
+
'target-dev-hub': requiredHubFlagWithDeprecations,
|
23
|
+
'api-version': orgApiVersionFlagWithDeprecations,
|
24
|
+
loglevel,
|
25
|
+
'source-org': Flags.string({
|
26
|
+
// command doesn't use target-org, so dash-o is fine
|
27
|
+
// eslint-disable-next-line sf-plugin/dash-o
|
28
|
+
char: 'o',
|
29
|
+
summary: messages.getMessage('flags.source-org.summary'),
|
30
|
+
required: true,
|
31
|
+
aliases: ['sourceorg'],
|
32
|
+
deprecateAliases: true,
|
33
|
+
parse: async (input) => (input.startsWith('00D') ? input : resolveSourceOrgId(input)),
|
34
|
+
}),
|
35
|
+
name: Flags.string({
|
36
|
+
char: 'n',
|
37
|
+
summary: messages.getMessage('flags.name.summary'),
|
38
|
+
required: true,
|
39
|
+
aliases: ['snapshotname'],
|
40
|
+
deprecateAliases: true,
|
41
|
+
}),
|
42
|
+
description: Flags.string({
|
43
|
+
char: 'd',
|
44
|
+
summary: messages.getMessage('flags.description.summary'),
|
45
|
+
description: messages.getMessage('flags.description.description'),
|
46
|
+
}),
|
47
|
+
};
|
17
48
|
async run() {
|
18
|
-
const { flags } = await this.parse(
|
49
|
+
const { flags } = await this.parse(SnapshotCreate);
|
19
50
|
const conn = flags['target-dev-hub'].getConnection(flags['api-version']);
|
20
51
|
const createResponse = await conn.sobject('OrgSnapshot').create({
|
21
52
|
SourceOrg: flags['source-org'],
|
@@ -24,52 +55,17 @@ class SnapshotCreate extends sf_plugins_core_1.SfCommand {
|
|
24
55
|
Content: 'metadatadata',
|
25
56
|
});
|
26
57
|
if (createResponse.success === false) {
|
27
|
-
throw new
|
58
|
+
throw new SfError('An error while created the org snapshot');
|
28
59
|
}
|
29
|
-
const result = await
|
60
|
+
const result = await queryByNameOrId(conn, createResponse.id);
|
30
61
|
if (!flags.json) {
|
31
|
-
|
62
|
+
printSingleRecordTable(result);
|
32
63
|
}
|
33
64
|
return result;
|
34
65
|
}
|
35
66
|
}
|
36
|
-
exports.SnapshotCreate = SnapshotCreate;
|
37
|
-
_a = SnapshotCreate;
|
38
|
-
SnapshotCreate.summary = messages.getMessage('summary');
|
39
|
-
SnapshotCreate.description = messages.getMessage('description');
|
40
|
-
SnapshotCreate.examples = messages.getMessages('examples');
|
41
|
-
SnapshotCreate.aliases = ['force:org:snapshot:create'];
|
42
|
-
SnapshotCreate.deprecateAliases = true;
|
43
|
-
SnapshotCreate.state = 'closedPilot';
|
44
|
-
SnapshotCreate.flags = {
|
45
|
-
'target-dev-hub': sf_plugins_core_1.requiredHubFlagWithDeprecations,
|
46
|
-
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
47
|
-
loglevel: sf_plugins_core_1.loglevel,
|
48
|
-
'source-org': sf_plugins_core_1.Flags.string({
|
49
|
-
// command doesn't use target-org, so dash-o is fine
|
50
|
-
// eslint-disable-next-line sf-plugin/dash-o
|
51
|
-
char: 'o',
|
52
|
-
summary: messages.getMessage('flags.source-org.summary'),
|
53
|
-
required: true,
|
54
|
-
aliases: ['sourceorg'],
|
55
|
-
deprecateAliases: true,
|
56
|
-
parse: async (input) => (input.startsWith('00D') ? input : resolveSourceOrgId(input)),
|
57
|
-
}),
|
58
|
-
name: sf_plugins_core_1.Flags.string({
|
59
|
-
char: 'n',
|
60
|
-
summary: messages.getMessage('flags.name.summary'),
|
61
|
-
required: true,
|
62
|
-
aliases: ['snapshotname'],
|
63
|
-
deprecateAliases: true,
|
64
|
-
}),
|
65
|
-
description: sf_plugins_core_1.Flags.string({
|
66
|
-
char: 'd',
|
67
|
-
summary: messages.getMessage('flags.description.summary'),
|
68
|
-
description: messages.getMessage('flags.description.description'),
|
69
|
-
}),
|
70
|
-
};
|
71
67
|
const resolveSourceOrgId = async (sourceOrgUsernameOrId) => {
|
72
|
-
const stateAggregator = await
|
68
|
+
const stateAggregator = await StateAggregator.create();
|
73
69
|
const username = stateAggregator.aliases.getValue(sourceOrgUsernameOrId) ?? sourceOrgUsernameOrId;
|
74
70
|
const org = await stateAggregator.orgs.read(username);
|
75
71
|
if (!org?.orgId) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../../src/commands/org/create/snapshot.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../../src/commands/org/create/snapshot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAe,eAAe,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAEnG,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,4BAA4B,EAAE,iBAAiB,CAAC,CAAC;AAExF,MAAM,OAAO,cAAe,SAAQ,SAAsB;IACjD,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,OAAO,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACxD,MAAM,CAAU,gBAAgB,GA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GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC;YAC9D,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;YAC9B,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,YAAY,EAAE,KAAK,CAAC,IAAI;YACxB,OAAO,EAAE,cAAc;SACxB,CAAC,CAAC;QACH,IAAI,cAAc,CAAC,OAAO,KAAK,KAAK,EAAE;YACpC,MAAM,IAAI,OAAO,CAAC,yCAAyC,CAAC,CAAC;SAC9D;QACD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC;QAC9D,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACf,sBAAsB,CAAC,MAAM,CAAC,CAAC;SAChC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;;AAGH,MAAM,kBAAkB,GAAG,KAAK,EAAE,qBAA6B,EAAmB,EAAE;IAClF,MAAM,eAAe,GAAG,MAAM,eAAe,CAAC,MAAM,EAAE,CAAC;IACvD,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,qBAAqB,CAAC;IAClG,MAAM,GAAG,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtD,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,oBAAoB,qBAAqB,EAAE,CAAC,CAAC;KAC9D;IACD,OAAO,GAAG,CAAC,KAAK,CAAC;AACnB,CAAC,CAAC"}
|
@@ -1,13 +1,5 @@
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
2
|
-
import {
|
3
|
-
type FailureMsg = {
|
4
|
-
shapeId: string;
|
5
|
-
message: string;
|
6
|
-
};
|
7
|
-
type DeleteAllResult = {
|
8
|
-
shapeIds: string[];
|
9
|
-
failures: FailureMsg[];
|
10
|
-
};
|
2
|
+
import { DeleteAllResult } from '../../../shared/deleteUtils.js';
|
11
3
|
export interface OrgShapeDeleteResult extends DeleteAllResult {
|
12
4
|
orgId: string;
|
13
5
|
}
|
@@ -18,17 +10,10 @@ export declare class OrgShapeDeleteCommand extends SfCommand<OrgShapeDeleteResul
|
|
18
10
|
static readonly aliases: string[];
|
19
11
|
static readonly deprecateAliases = true;
|
20
12
|
static readonly flags: {
|
21
|
-
'target-org': import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
22
|
-
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
23
|
-
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
24
|
-
'no-prompt': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
13
|
+
'target-org': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
14
|
+
'api-version': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
15
|
+
loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
16
|
+
'no-prompt': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
25
17
|
};
|
26
18
|
run(): Promise<OrgShapeDeleteResult | undefined>;
|
27
19
|
}
|
28
|
-
/**
|
29
|
-
* Delete all ShapeRepresentation records for the shapeOrg.
|
30
|
-
*
|
31
|
-
* @return List of SR IDs that were deleted
|
32
|
-
*/
|
33
|
-
export declare const deleteAll: (conn: Connection, username: string) => Promise<DeleteAllResult>;
|
34
|
-
export {};
|