@salesforce/plugin-signups 1.2.16 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commands/org/create/shape.d.ts +19 -0
- package/lib/commands/org/create/shape.js +63 -0
- package/lib/commands/org/create/shape.js.map +1 -0
- package/lib/commands/org/create/snapshot.d.ts +18 -0
- package/lib/commands/org/create/snapshot.js +79 -0
- package/lib/commands/org/create/snapshot.js.map +1 -0
- package/lib/commands/org/delete/shape.d.ts +34 -0
- package/lib/commands/org/delete/shape.js +126 -0
- package/lib/commands/org/delete/shape.js.map +1 -0
- package/lib/commands/org/delete/snapshot.d.ts +16 -0
- package/lib/commands/org/delete/snapshot.js +52 -0
- package/lib/commands/org/delete/snapshot.js.map +1 -0
- package/lib/commands/org/get/snapshot.d.ts +16 -0
- package/lib/commands/org/get/snapshot.js +42 -0
- package/lib/commands/org/get/snapshot.js.map +1 -0
- package/lib/commands/org/list/shape.d.ts +15 -0
- package/lib/commands/org/list/shape.js +64 -0
- package/lib/commands/org/list/shape.js.map +1 -0
- package/lib/commands/org/list/snapshot.d.ts +15 -0
- package/lib/commands/org/list/snapshot.js +36 -0
- package/lib/commands/org/list/snapshot.js.map +1 -0
- package/lib/shared/orgShapeListUtils.d.ts +2 -2
- package/lib/shared/orgShapeListUtils.js +1 -1
- package/lib/shared/orgShapeListUtils.js.map +1 -1
- package/lib/shared/snapshot.d.ts +2 -2
- package/lib/shared/snapshot.js +4 -5
- package/lib/shared/snapshot.js.map +1 -1
- package/messages/shape.create.md +33 -0
- package/messages/shape.delete.md +37 -0
- package/messages/shape.list.md +29 -0
- package/messages/snapshot.create.md +37 -0
- package/messages/snapshot.delete.md +29 -0
- package/messages/snapshot.get.md +27 -0
- package/messages/snapshot.list.md +19 -0
- package/messages/snapshot.md +7 -0
- package/oclif.manifest.json +1 -1
- package/package.json +27 -31
- package/lib/commands/force/org/shape/create.d.ts +0 -14
- package/lib/commands/force/org/shape/create.js +0 -68
- package/lib/commands/force/org/shape/create.js.map +0 -1
- package/lib/commands/force/org/shape/delete.d.ts +0 -27
- package/lib/commands/force/org/shape/delete.js +0 -122
- package/lib/commands/force/org/shape/delete.js.map +0 -1
- package/lib/commands/force/org/shape/list.d.ts +0 -9
- package/lib/commands/force/org/shape/list.js +0 -63
- package/lib/commands/force/org/shape/list.js.map +0 -1
- package/lib/commands/force/org/snapshot/create.d.ts +0 -9
- package/lib/commands/force/org/snapshot/create.js +0 -64
- package/lib/commands/force/org/snapshot/create.js.map +0 -1
- package/lib/commands/force/org/snapshot/delete.d.ts +0 -9
- package/lib/commands/force/org/snapshot/delete.js +0 -47
- package/lib/commands/force/org/snapshot/delete.js.map +0 -1
- package/lib/commands/force/org/snapshot/get.d.ts +0 -9
- package/lib/commands/force/org/snapshot/get.js +0 -37
- package/lib/commands/force/org/snapshot/get.js.map +0 -1
- package/lib/commands/force/org/snapshot/list.d.ts +0 -8
- package/lib/commands/force/org/snapshot/list.js +0 -29
- package/lib/commands/force/org/snapshot/list.js.map +0 -1
- package/messages/shape.create.json +0 -16
- package/messages/shape.delete.json +0 -25
- package/messages/shape.list.json +0 -13
- package/messages/snapshot.create.json +0 -19
- package/messages/snapshot.delete.json +0 -16
- package/messages/snapshot.get.json +0 -15
- package/messages/snapshot.json +0 -4
- package/messages/snapshot.list.json +0 -9
@@ -1,68 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*
|
3
|
-
* Copyright (c) 2022, 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.OrgShapeCreateCommand = void 0;
|
10
|
-
const os_1 = require("os");
|
11
|
-
const command_1 = require("@salesforce/command");
|
12
|
-
const core_1 = require("@salesforce/core");
|
13
|
-
const orgShapeListUtils_1 = require("../../../../shared/orgShapeListUtils");
|
14
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
15
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-signups', 'shape.create');
|
16
|
-
class OrgShapeCreateCommand extends command_1.SfdxCommand {
|
17
|
-
async run() {
|
18
|
-
this.conn = this.org.getConnection();
|
19
|
-
if (!(await (0, orgShapeListUtils_1.isShapeEnabled)(this.conn))) {
|
20
|
-
const err = messages.createError('noAccess', [this.org.getUsername()]);
|
21
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
22
|
-
// @ts-ignore override readonly .name field
|
23
|
-
err.name = 'noAccess';
|
24
|
-
throw err;
|
25
|
-
}
|
26
|
-
const createShapeResponse = await this.createShapeOrg();
|
27
|
-
if (createShapeResponse.success !== true) {
|
28
|
-
this.logger.error('Shape create failed', createShapeResponse['errors']);
|
29
|
-
const err = messages.createError('shape_create_failed_message');
|
30
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
31
|
-
// @ts-ignore override readonly .name field
|
32
|
-
err.name = 'shape_create_failed_message';
|
33
|
-
throw err;
|
34
|
-
}
|
35
|
-
const output = {
|
36
|
-
shapeId: createShapeResponse.id,
|
37
|
-
success: true,
|
38
|
-
errors: [],
|
39
|
-
};
|
40
|
-
this.ux.log(messages.getMessage('create_shape_command_success_id', [output.shapeId]));
|
41
|
-
return output;
|
42
|
-
}
|
43
|
-
createShapeOrg() {
|
44
|
-
try {
|
45
|
-
return this.conn.sobject('ShapeRepresentation').create({
|
46
|
-
Description: '',
|
47
|
-
});
|
48
|
-
}
|
49
|
-
catch (err) {
|
50
|
-
const JsForceErr = err;
|
51
|
-
if (JsForceErr.errorCode && JsForceErr.errorCode === 'NOT_FOUND' && JsForceErr['name'] === 'ACCESS_DENIED') {
|
52
|
-
const e = messages.createError('create_shape_command_no_crud_access');
|
53
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
54
|
-
// @ts-ignore override readonly .name field
|
55
|
-
e.name = 'create_shape_command_no_crud_access';
|
56
|
-
throw e;
|
57
|
-
}
|
58
|
-
else {
|
59
|
-
throw JsForceErr;
|
60
|
-
}
|
61
|
-
}
|
62
|
-
}
|
63
|
-
}
|
64
|
-
exports.OrgShapeCreateCommand = OrgShapeCreateCommand;
|
65
|
-
OrgShapeCreateCommand.description = messages.getMessage('create_shape_command_description');
|
66
|
-
OrgShapeCreateCommand.examples = messages.getMessage('create_shape_command_help').split(os_1.EOL);
|
67
|
-
OrgShapeCreateCommand.requiresUsername = true;
|
68
|
-
//# sourceMappingURL=create.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/commands/force/org/shape/create.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2BAAyB;AACzB,iDAAkD;AAClD,2CAAwD;AAExD,4EAAoF;AAEpF,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAAC;AAQrF,MAAa,qBAAsB,SAAQ,qBAAW;IAM7C,KAAK,CAAC,GAAG;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QAErC,IAAI,CAAC,CAAC,MAAM,IAAA,kCAAc,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE;YACtC,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;YACvE,6DAA6D;YAC7D,2CAA2C;YAC3C,GAAG,CAAC,IAAI,GAAG,UAAU,CAAC;YACtB,MAAM,GAAG,CAAC;SACX;QAED,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAExD,IAAI,mBAAmB,CAAC,OAAO,KAAK,IAAI,EAAE;YACxC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBA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,CAAC,QAAG,CAAC,CAAC;AACvE,sCAAgB,GAAG,IAAI,CAAC"}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import { FlagsConfig, SfdxCommand } from '@salesforce/command';
|
2
|
-
interface FailureMsg {
|
3
|
-
shapeId: string;
|
4
|
-
message: string;
|
5
|
-
}
|
6
|
-
interface DeleteAllResult {
|
7
|
-
shapeIds: string[];
|
8
|
-
failures: FailureMsg[];
|
9
|
-
}
|
10
|
-
export interface OrgShapeDeleteResult extends DeleteAllResult {
|
11
|
-
orgId: string;
|
12
|
-
}
|
13
|
-
export declare class OrgShapeDeleteCommand extends SfdxCommand {
|
14
|
-
static readonly description: string;
|
15
|
-
static readonly examples: string[];
|
16
|
-
static readonly requiresUsername = true;
|
17
|
-
static readonly flagsConfig: FlagsConfig;
|
18
|
-
private conn;
|
19
|
-
run(): Promise<OrgShapeDeleteResult>;
|
20
|
-
/**
|
21
|
-
* Delete all ShapeRepresentation records for the shapeOrg.
|
22
|
-
*
|
23
|
-
* @return List of SR IDs that were deleted
|
24
|
-
*/
|
25
|
-
private deleteAll;
|
26
|
-
}
|
27
|
-
export {};
|
@@ -1,122 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*
|
3
|
-
* Copyright (c) 2022, 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.OrgShapeDeleteCommand = void 0;
|
10
|
-
const os_1 = require("os");
|
11
|
-
const command_1 = require("@salesforce/command");
|
12
|
-
const core_1 = require("@salesforce/core");
|
13
|
-
const orgShapeListUtils_1 = require("../../../../shared/orgShapeListUtils");
|
14
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
15
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-signups', 'shape.delete');
|
16
|
-
class OrgShapeDeleteCommand extends command_1.SfdxCommand {
|
17
|
-
async run() {
|
18
|
-
if (!this.flags.noprompt) {
|
19
|
-
if (!(await this.ux.confirm(messages.getMessage('deleteCommandYesNo', [this.org.getUsername()])))) {
|
20
|
-
return;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
this.conn = this.org.getConnection();
|
24
|
-
if (!(await (0, orgShapeListUtils_1.isShapeEnabled)(this.conn))) {
|
25
|
-
const err = messages.createError('noAccess', [this.org.getUsername()]);
|
26
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
27
|
-
// @ts-ignore override readonly .name field
|
28
|
-
err.name = 'noAccess';
|
29
|
-
throw err;
|
30
|
-
}
|
31
|
-
const deleteRes = await this.deleteAll();
|
32
|
-
if (deleteRes.shapeIds.length === 0) {
|
33
|
-
this.ux.log(messages.getMessage('noShapesHumanSuccess', [this.org.getOrgId()]));
|
34
|
-
return;
|
35
|
-
}
|
36
|
-
if (deleteRes.failures.length > 0 && deleteRes.shapeIds.length > 0) {
|
37
|
-
setExitCode(68);
|
38
|
-
this.ux.styledHeader('Partial Success');
|
39
|
-
this.ux.log(messages.getMessage('humanSuccess', [this.org.getOrgId()]));
|
40
|
-
this.ux.log('');
|
41
|
-
this.ux.styledHeader('Failures');
|
42
|
-
const columns = {
|
43
|
-
shapeId: { header: 'Shape ID' },
|
44
|
-
message: { header: 'Error Message' },
|
45
|
-
};
|
46
|
-
this.ux.table(deleteRes.failures, columns);
|
47
|
-
}
|
48
|
-
else if (deleteRes.failures.length > 0) {
|
49
|
-
setExitCode(1);
|
50
|
-
}
|
51
|
-
else if (deleteRes.shapeIds.length > 0) {
|
52
|
-
setExitCode(0);
|
53
|
-
this.ux.log(messages.getMessage('humanSuccess', [this.org.getOrgId()]));
|
54
|
-
}
|
55
|
-
return {
|
56
|
-
orgId: this.org.getOrgId(),
|
57
|
-
shapeIds: deleteRes.shapeIds,
|
58
|
-
failures: deleteRes.failures,
|
59
|
-
};
|
60
|
-
}
|
61
|
-
/**
|
62
|
-
* Delete all ShapeRepresentation records for the shapeOrg.
|
63
|
-
*
|
64
|
-
* @return List of SR IDs that were deleted
|
65
|
-
*/
|
66
|
-
async deleteAll() {
|
67
|
-
const deleteAllResult = {
|
68
|
-
shapeIds: [],
|
69
|
-
failures: [],
|
70
|
-
};
|
71
|
-
let shapeIds = [];
|
72
|
-
try {
|
73
|
-
const result = await this.conn.query('SELECT Id FROM ShapeRepresentation');
|
74
|
-
if (result.totalSize === 0) {
|
75
|
-
return deleteAllResult;
|
76
|
-
}
|
77
|
-
shapeIds = result.records.map((shape) => shape.Id);
|
78
|
-
}
|
79
|
-
catch (err) {
|
80
|
-
const JsForceErr = err;
|
81
|
-
if (JsForceErr.errorCode && JsForceErr.errorCode === 'INVALID_TYPE') {
|
82
|
-
// ShapeExportPref is not enabled, or user does not have CRUD access
|
83
|
-
const e = messages.createError('noAccess', [this.org.getUsername()]);
|
84
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
85
|
-
// @ts-ignore override readonly .name field
|
86
|
-
e.name = 'noAccess';
|
87
|
-
throw e;
|
88
|
-
}
|
89
|
-
// non-access error
|
90
|
-
throw JsForceErr;
|
91
|
-
}
|
92
|
-
await Promise.allSettled(shapeIds.map(async (id) => {
|
93
|
-
try {
|
94
|
-
const delResult = await this.conn.sobject('ShapeRepresentation').delete(id);
|
95
|
-
if (delResult.success) {
|
96
|
-
deleteAllResult.shapeIds.push(id);
|
97
|
-
}
|
98
|
-
}
|
99
|
-
catch (err) {
|
100
|
-
deleteAllResult.failures.push({
|
101
|
-
shapeId: id,
|
102
|
-
message: err instanceof Error ? err.message : 'error contained no message',
|
103
|
-
});
|
104
|
-
}
|
105
|
-
}));
|
106
|
-
return deleteAllResult;
|
107
|
-
}
|
108
|
-
}
|
109
|
-
exports.OrgShapeDeleteCommand = OrgShapeDeleteCommand;
|
110
|
-
OrgShapeDeleteCommand.description = messages.getMessage('description');
|
111
|
-
OrgShapeDeleteCommand.examples = messages.getMessage('help').split(os_1.EOL);
|
112
|
-
OrgShapeDeleteCommand.requiresUsername = true;
|
113
|
-
OrgShapeDeleteCommand.flagsConfig = {
|
114
|
-
noprompt: command_1.flags.boolean({
|
115
|
-
char: 'p',
|
116
|
-
description: messages.getMessage('noPrompt'),
|
117
|
-
}),
|
118
|
-
};
|
119
|
-
const setExitCode = (code) => {
|
120
|
-
process.exitCode = code;
|
121
|
-
};
|
122
|
-
//# sourceMappingURL=delete.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../../src/commands/force/org/shape/delete.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2BAAyB;AACzB,iDAAsE;AACtE,2CAAwD;AACxD,4EAAoF;AAEpF,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAAC;AA0BrF,MAAa,qBAAsB,SAAQ,qBAAW;IAY7C,KAAK,CAAC,GAAG;QACd,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACxB,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;gBACjG,OAAO;aACR;SACF;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QAErC,IAAI,CAAC,CAAC,MAAM,IAAA,kCAAc,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE;YACtC,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;YACvE,6DAA6D;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ShapeListUtils';
|
3
|
-
export declare class OrgShapeListCommand extends SfdxCommand {
|
4
|
-
static readonly description: string;
|
5
|
-
static readonly examples: string[];
|
6
|
-
static readonly flagsConfig: FlagsConfig;
|
7
|
-
run(): Promise<OrgShapeListResult[]>;
|
8
|
-
getAllOrgShapesFromAuthenticatedOrgs(): Promise<OrgShapeListResult[]>;
|
9
|
-
}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/*
|
3
|
-
* Copyright (c) 2022, 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.OrgShapeListCommand = void 0;
|
10
|
-
const os_1 = require("os");
|
11
|
-
const command_1 = require("@salesforce/command");
|
12
|
-
const core_1 = require("@salesforce/core");
|
13
|
-
const chalk = require("chalk");
|
14
|
-
const orgShapeListUtils_1 = require("../../../../shared/orgShapeListUtils");
|
15
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
16
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-signups', 'shape.list');
|
17
|
-
// default columns for the shape list
|
18
|
-
const orgShapeColumns = {
|
19
|
-
alias: {
|
20
|
-
header: 'ALIAS',
|
21
|
-
get: (data) => data.alias ?? '',
|
22
|
-
},
|
23
|
-
username: { header: 'USERNAME' },
|
24
|
-
orgId: { header: 'ORG ID' },
|
25
|
-
status: { header: 'SHAPE STATUS' },
|
26
|
-
createdBy: { header: 'CREATED BY' },
|
27
|
-
createdDate: { header: 'CREATED DATE' },
|
28
|
-
};
|
29
|
-
class OrgShapeListCommand extends command_1.SfdxCommand {
|
30
|
-
async run() {
|
31
|
-
const shapes = await this.getAllOrgShapesFromAuthenticatedOrgs();
|
32
|
-
if (shapes.length === 0) {
|
33
|
-
this.ux.log(messages.getMessage('noOrgShapes'));
|
34
|
-
return shapes;
|
35
|
-
}
|
36
|
-
this.ux.styledHeader('Org Shapes');
|
37
|
-
this.ux.table(shapes.map((shape) => (shape.status === 'Active' ? { ...shape, status: chalk.green(shape.status) } : shape)), orgShapeColumns);
|
38
|
-
return shapes;
|
39
|
-
}
|
40
|
-
// is public because tests mock it
|
41
|
-
// eslint-disable-next-line class-methods-use-this
|
42
|
-
async getAllOrgShapesFromAuthenticatedOrgs() {
|
43
|
-
const orgs = await core_1.AuthInfo.listAllAuthorizations((orgAuth) => !orgAuth.error && !orgAuth.isScratchOrg);
|
44
|
-
if (orgs.length === 0) {
|
45
|
-
const e = messages.createError('noAuthFound');
|
46
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
47
|
-
// @ts-ignore override readonly .name field
|
48
|
-
e.name = 'noAuthFound';
|
49
|
-
throw e;
|
50
|
-
}
|
51
|
-
const shapes = await Promise.all(orgs.map((o) => (0, orgShapeListUtils_1.getAllShapesFromOrg)(o)));
|
52
|
-
return shapes.flat();
|
53
|
-
}
|
54
|
-
}
|
55
|
-
exports.OrgShapeListCommand = OrgShapeListCommand;
|
56
|
-
OrgShapeListCommand.description = messages.getMessage('description');
|
57
|
-
OrgShapeListCommand.examples = messages.getMessage('help').split(os_1.EOL);
|
58
|
-
OrgShapeListCommand.flagsConfig = {
|
59
|
-
verbose: command_1.flags.builtin({
|
60
|
-
description: messages.getMessage('verbose'),
|
61
|
-
}),
|
62
|
-
};
|
63
|
-
//# sourceMappingURL=list.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/commands/force/org/shape/list.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2BAAyB;AACzB,iDAAsE;AACtE,2CAAsD;AACtD,+BAA+B;AAC/B,4EAA+F;AAE/F,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC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,MAAM,eAAQ,CAAC,qBAAqB,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QACxG,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,MAAM,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;YAC9C,6DAA6D;YAC7D,2CAA2C;YAC3C,CAAC,CAAC,IAAI,GAAG,aAAa,CAAC;YACvB,MAAM,CAAC,CAAC;SACT;QACD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,uCAAmB,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1E,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;;AArCH,kDAsCC;AArCwB,+BAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,4BAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,QAAG,CAAC,CAAC;AAClD,+BAAW,GAAgB;IAChD,OAAO,EAAE,eAAK,CAAC,OAAO,CAAC;QACrB,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;KAC5C,CAAC;CACH,CAAC"}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { SfdxCommand, FlagsConfig } from '@salesforce/command';
|
2
|
-
import { OrgSnapshot } from '../../../../shared/snapshot';
|
3
|
-
export declare class SnapshotGet extends SfdxCommand {
|
4
|
-
static readonly description: string;
|
5
|
-
static readonly examples: string[];
|
6
|
-
static readonly requiresDevhubUsername = true;
|
7
|
-
static readonly flagsConfig: FlagsConfig;
|
8
|
-
run(): Promise<OrgSnapshot>;
|
9
|
-
}
|
@@ -1,64 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.SnapshotGet = void 0;
|
4
|
-
/*
|
5
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
6
|
-
* All rights reserved.
|
7
|
-
* Licensed under the BSD 3-Clause license.
|
8
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
9
|
-
*/
|
10
|
-
const os_1 = require("os");
|
11
|
-
const command_1 = require("@salesforce/command");
|
12
|
-
const core_1 = require("@salesforce/core");
|
13
|
-
const snapshot_1 = require("../../../../shared/snapshot");
|
14
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
15
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-signups', 'snapshot.create');
|
16
|
-
class SnapshotGet extends command_1.SfdxCommand {
|
17
|
-
async run() {
|
18
|
-
// sourceorg might be a username or alias, but we need an orgId
|
19
|
-
let sourceOrgId = this.flags.sourceorg;
|
20
|
-
if (!sourceOrgId.startsWith('00D')) {
|
21
|
-
const stateAggregator = await core_1.StateAggregator.create();
|
22
|
-
const username = stateAggregator.aliases.getValue(sourceOrgId) ?? sourceOrgId;
|
23
|
-
sourceOrgId = (await stateAggregator.orgs.read(username))?.orgId;
|
24
|
-
}
|
25
|
-
const createResponse = await this.hubOrg
|
26
|
-
.getConnection()
|
27
|
-
.sobject('OrgSnapshot')
|
28
|
-
.create({
|
29
|
-
SourceOrg: sourceOrgId,
|
30
|
-
Description: this.flags.description,
|
31
|
-
SnapshotName: this.flags.snapshotname,
|
32
|
-
Content: 'metadatadata',
|
33
|
-
});
|
34
|
-
const result = await (0, snapshot_1.queryByNameOrId)(this.hubOrg.getConnection(), createResponse.id);
|
35
|
-
if (!this.flags.json) {
|
36
|
-
(0, snapshot_1.printSingleRecordTable)(result);
|
37
|
-
}
|
38
|
-
return result;
|
39
|
-
}
|
40
|
-
}
|
41
|
-
exports.SnapshotGet = SnapshotGet;
|
42
|
-
SnapshotGet.description = messages.getMessage('description');
|
43
|
-
SnapshotGet.examples = messages.getMessage('examples').split(os_1.EOL);
|
44
|
-
SnapshotGet.requiresDevhubUsername = true;
|
45
|
-
SnapshotGet.flagsConfig = {
|
46
|
-
sourceorg: command_1.flags.string({
|
47
|
-
char: 'o',
|
48
|
-
description: messages.getMessage('flags.sourceorg'),
|
49
|
-
longDescription: messages.getMessage('flagsLong.sourceorg'),
|
50
|
-
required: true,
|
51
|
-
}),
|
52
|
-
snapshotname: command_1.flags.string({
|
53
|
-
char: 'n',
|
54
|
-
description: messages.getMessage('flags.snapshotname'),
|
55
|
-
longDescription: messages.getMessage('flagsLong.snapshotname'),
|
56
|
-
required: true,
|
57
|
-
}),
|
58
|
-
description: command_1.flags.string({
|
59
|
-
char: 'd',
|
60
|
-
description: messages.getMessage('flags.description'),
|
61
|
-
longDescription: messages.getMessage('flagsLong.description'),
|
62
|
-
}),
|
63
|
-
};
|
64
|
-
//# sourceMappingURL=create.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/commands/force/org/snapshot/create.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2BAAyB;AACzB,iDAAsE;AACtE,2CAA6D;AAC7D,0DAAmG;AAEnG,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,4BAA4B,EAAE,iBAAiB,CAAC,CAAC;AAExF,MAAa,WAAY,SAAQ,qBAAW;IAyBnC,KAAK,CAAC,GAAG;QACd,+DAA+D;QAC/D,IAAI,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,SAAmB,CAAC;QAEjD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;YAClC,MAAM,eAAe,GAAG,MAAM,sBAAe,CAAC,MAAM,EAAE,CAAC;YACvD,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,IA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;QACtD,eAAe,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;QAC9D,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,WAAW,EAAE,eAAK,CAAC,MAAM,CAAC;QACxB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,mBAAmB,CAAC;QACrD,eAAe,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;KAC9D,CAAC;CACH,CAAC"}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { SfdxCommand, FlagsConfig } from '@salesforce/command';
|
2
|
-
import { SaveResult } from 'jsforce';
|
3
|
-
export declare class SnapshotGet extends SfdxCommand {
|
4
|
-
static readonly description: string;
|
5
|
-
static readonly examples: string[];
|
6
|
-
static readonly requiresDevhubUsername = true;
|
7
|
-
static readonly flagsConfig: FlagsConfig;
|
8
|
-
run(): Promise<SaveResult>;
|
9
|
-
}
|
@@ -1,47 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.SnapshotGet = void 0;
|
4
|
-
/*
|
5
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
6
|
-
* All rights reserved.
|
7
|
-
* Licensed under the BSD 3-Clause license.
|
8
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
9
|
-
*/
|
10
|
-
const os_1 = require("os");
|
11
|
-
const command_1 = require("@salesforce/command");
|
12
|
-
const core_1 = require("@salesforce/core");
|
13
|
-
const snapshot_1 = require("../../../../shared/snapshot");
|
14
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
15
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-signups', 'snapshot.delete');
|
16
|
-
// jsforce can return SaveError[] or never[]
|
17
|
-
const isSaveError = (error) => error.message !== undefined;
|
18
|
-
class SnapshotGet extends command_1.SfdxCommand {
|
19
|
-
async run() {
|
20
|
-
// resolve the query to an ID. This also verifies the snapshot exists in the org
|
21
|
-
const result = await (0, snapshot_1.queryByNameOrId)(this.hubOrg.getConnection(), this.flags.snapshot);
|
22
|
-
const deleteResult = await this.hubOrg.getConnection().sobject('OrgSnapshot').delete(result.Id);
|
23
|
-
if (deleteResult.success) {
|
24
|
-
this.ux.log(messages.getMessage('success', [this.flags.snapshot]));
|
25
|
-
return deleteResult;
|
26
|
-
}
|
27
|
-
else if (deleteResult.errors) {
|
28
|
-
throw new Error(deleteResult.errors
|
29
|
-
.filter(isSaveError)
|
30
|
-
.map((error) => error.message)
|
31
|
-
.join(os_1.EOL));
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
exports.SnapshotGet = SnapshotGet;
|
36
|
-
SnapshotGet.description = messages.getMessage('description');
|
37
|
-
SnapshotGet.examples = messages.getMessage('examples').split(os_1.EOL);
|
38
|
-
SnapshotGet.requiresDevhubUsername = true;
|
39
|
-
SnapshotGet.flagsConfig = {
|
40
|
-
snapshot: command_1.flags.string({
|
41
|
-
char: 's',
|
42
|
-
description: messages.getMessage('flags.snapshot'),
|
43
|
-
longDescription: messages.getMessage('flagsLong.snapshot'),
|
44
|
-
required: true,
|
45
|
-
}),
|
46
|
-
};
|
47
|
-
//# sourceMappingURL=delete.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../../src/commands/force/org/snapshot/delete.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2BAAyB;AACzB,iDAAsE;AACtE,2CAA4C;AAE5C,0DAA8D;AAE9D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,4BAA4B,EAAE,iBAAiB,CAAC,CAAC;AAExF,4CAA4C;AAC5C,MAAM,WAAW,GAAG,CAAC,KAA0B,EAAsB,EAAE,CAAE,KAAmB,CAAC,OAAO,KAAK,SAAS,CAAC;AAEnH,M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AAI;KACf,CAAC;CACH,CAAC"}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { SfdxCommand, FlagsConfig } from '@salesforce/command';
|
2
|
-
import { OrgSnapshot } from '../../../../shared/snapshot';
|
3
|
-
export declare class SnapshotGet extends SfdxCommand {
|
4
|
-
static readonly description: string;
|
5
|
-
static readonly examples: string[];
|
6
|
-
static readonly requiresDevhubUsername = true;
|
7
|
-
static readonly flagsConfig: FlagsConfig;
|
8
|
-
run(): Promise<OrgSnapshot>;
|
9
|
-
}
|
@@ -1,37 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.SnapshotGet = void 0;
|
4
|
-
/*
|
5
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
6
|
-
* All rights reserved.
|
7
|
-
* Licensed under the BSD 3-Clause license.
|
8
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
9
|
-
*/
|
10
|
-
const os_1 = require("os");
|
11
|
-
const command_1 = require("@salesforce/command");
|
12
|
-
const core_1 = require("@salesforce/core");
|
13
|
-
const snapshot_1 = require("../../../../shared/snapshot");
|
14
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
15
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-signups', 'snapshot.get');
|
16
|
-
class SnapshotGet extends command_1.SfdxCommand {
|
17
|
-
async run() {
|
18
|
-
const result = await (0, snapshot_1.queryByNameOrId)(this.hubOrg.getConnection(), this.flags.snapshot);
|
19
|
-
if (!this.flags.json) {
|
20
|
-
(0, snapshot_1.printSingleRecordTable)(result);
|
21
|
-
}
|
22
|
-
return result;
|
23
|
-
}
|
24
|
-
}
|
25
|
-
exports.SnapshotGet = SnapshotGet;
|
26
|
-
SnapshotGet.description = messages.getMessage('description');
|
27
|
-
SnapshotGet.examples = messages.getMessage('examples').split(os_1.EOL);
|
28
|
-
SnapshotGet.requiresDevhubUsername = true;
|
29
|
-
SnapshotGet.flagsConfig = {
|
30
|
-
snapshot: command_1.flags.string({
|
31
|
-
char: 's',
|
32
|
-
description: messages.getMessage('flags.snapshot'),
|
33
|
-
longDescription: messages.getMessage('flagsLong.snapshot'),
|
34
|
-
required: true,
|
35
|
-
}),
|
36
|
-
};
|
37
|
-
//# sourceMappingURL=get.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../src/commands/force/org/snapshot/get.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2BAAyB;AACzB,iDAAsE;AACtE,2CAA4C;AAC5C,0DAAmG;AAEnG,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAAC;AAErF,MAAa,WAAY,SAAQ,qBAAW;IAcnC,KAAK,CAAC,GAAG;QACd,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAe,EAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,QAAkB,CAAC,CAAC;QACjG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACpB,IAAA,iCAAsB,EAAC,MAAM,CAAC,CAAC;SAChC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;;AApBH,kCAqBC;AApBwB,uBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,oBAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,QAAG,CAAC,CAAC;AACtD,kCAAsB,GAAG,IAAI,CAAC;AAE9B,uBAAW,GAAgB;IAChD,QAAQ,EAAE,eAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC;QAClD,eAAe,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAC1D,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC"}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { SfdxCommand } from '@salesforce/command';
|
2
|
-
import { OrgSnapshot } from '../../../../shared/snapshot';
|
3
|
-
export declare class SnapshotGet extends SfdxCommand {
|
4
|
-
static readonly description: string;
|
5
|
-
static readonly examples: string[];
|
6
|
-
static readonly requiresDevhubUsername = true;
|
7
|
-
run(): Promise<OrgSnapshot[]>;
|
8
|
-
}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.SnapshotGet = void 0;
|
4
|
-
/*
|
5
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
6
|
-
* All rights reserved.
|
7
|
-
* Licensed under the BSD 3-Clause license.
|
8
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
9
|
-
*/
|
10
|
-
const os_1 = require("os");
|
11
|
-
const command_1 = require("@salesforce/command");
|
12
|
-
const core_1 = require("@salesforce/core");
|
13
|
-
const snapshot_1 = require("../../../../shared/snapshot");
|
14
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
15
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-signups', 'snapshot.list');
|
16
|
-
class SnapshotGet extends command_1.SfdxCommand {
|
17
|
-
async run() {
|
18
|
-
const results = await (0, snapshot_1.queryAll)(this.hubOrg.getConnection());
|
19
|
-
if (!this.flags.json) {
|
20
|
-
(0, snapshot_1.printRecordTable)(results);
|
21
|
-
}
|
22
|
-
return results;
|
23
|
-
}
|
24
|
-
}
|
25
|
-
exports.SnapshotGet = SnapshotGet;
|
26
|
-
SnapshotGet.description = messages.getMessage('description');
|
27
|
-
SnapshotGet.examples = messages.getMessage('examples').split(os_1.EOL);
|
28
|
-
SnapshotGet.requiresDevhubUsername = true;
|
29
|
-
//# sourceMappingURL=list.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/commands/force/org/snapshot/list.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2BAAyB;AACzB,iDAAkD;AAClD,2CAA4C;AAC5C,0DAAsF;AAEtF,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,4BAA4B,EAAE,eAAe,CAAC,CAAC;AAEtF,MAAa,WAAY,SAAQ,qBAAW;IAKnC,KAAK,CAAC,GAAG;QACd,MAAM,OAAO,GAAG,MAAM,IAAA,mBAAQ,EAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACpB,IAAA,2BAAgB,EAAC,OAAO,CAAC,CAAC;SAC3B;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;;AAXH,kCAYC;AAXwB,uBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,oBAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,QAAG,CAAC,CAAC;AACtD,kCAAsB,GAAG,IAAI,CAAC"}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"create_shape_command_no_crud_access": "Can't create org shape. Contact the org admin to grant you access to the ShapeRepresentation object. Then try again.",
|
3
|
-
"create_shape_command_success_id": "Successfully created org shape for %s.",
|
4
|
-
"shape_create_failed_message": "Error creating scratch definition file. Please contact Salesforce support.",
|
5
|
-
"shape_get_not_a_shape_id": "the value passed in was not a shape id",
|
6
|
-
|
7
|
-
"create_shape_command_description": "Create a scratch org configuration (shape) based on the specified source org",
|
8
|
-
"create_shape_command_description_long": "Create a scratch org configuration (shape) based on the specified source org.",
|
9
|
-
"create_shape_command_help": [
|
10
|
-
"$ sfdx force:org:shape:create -u me@my.org",
|
11
|
-
"$ sfdx force:org:shape:create -u me@my.org --json --loglevel debug"
|
12
|
-
],
|
13
|
-
"create_shape_command_username": "a username or alias for the target org",
|
14
|
-
"create_shape_command_username_long": "Username or alias of the previously authorized org from which you want to create an org shape.",
|
15
|
-
"noAccess": "The org needs to be enabled for org shape before one can be created. %s"
|
16
|
-
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"description": "Delete all org shapes for a target org",
|
3
|
-
"longDescription": "Deletes all org shapes that you’ve created for an org using the Salesforce CLI.",
|
4
|
-
"verbose": "list more information about each org shape",
|
5
|
-
"verboseLong": "Lists more information about each org shape.",
|
6
|
-
"usernameOption": "username for the target org",
|
7
|
-
"usernameOptionLong": "Username for the target org.",
|
8
|
-
"targetUsernameOption": "username for the target org",
|
9
|
-
"targetUsernameOptionLong": "Username for the target org.",
|
10
|
-
"noPrompt": "do not prompt for confirmation",
|
11
|
-
"noPromptLong": "Do not prompt for confirmation.",
|
12
|
-
"noAccess": "The org with name: %s needs to be enabled for org shape before shapes can be deleted.",
|
13
|
-
"deleteCommandYesNo": "Delete shapes for org with name: %s? Are you sure (y/n)?",
|
14
|
-
"humanSuccess": "Successfully deleted org shape for %s.",
|
15
|
-
"noShapesHumanSuccess": "Can't delete org shape. No org shape found for org %s.",
|
16
|
-
"help": [
|
17
|
-
"$ sfdx force:org:shape:delete -u me@my.org",
|
18
|
-
|
19
|
-
"$ sfdx force:org:shape:delete -u MyOrgAlias -p",
|
20
|
-
|
21
|
-
"$ sfdx force:org:shape:delete -u me@my.org --json",
|
22
|
-
|
23
|
-
"$ sfdx force:org:shape:delete -u me@my.org -p --json > tmp/MyOrgShapeDelete.json"
|
24
|
-
]
|
25
|
-
}
|
package/messages/shape.list.json
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"description": "List all org shapes you’ve created",
|
3
|
-
"longDescription": "Lists all org shapes that you’ve created using the Salesforce CLI.",
|
4
|
-
"verbose": "list more information about each org shape",
|
5
|
-
"verboseLong": "Lists more information about each org shape.",
|
6
|
-
"noOrgShapes": "No org shapes found.",
|
7
|
-
"noAuthFound": "No authenticated orgs found.",
|
8
|
-
"help": [
|
9
|
-
"$ sfdx force:org:shape:list",
|
10
|
-
"$ sfdx force:org:shape:list --json",
|
11
|
-
"$ sfdx force:org:shape:list --json > tmp/MyOrgShapeList.json"
|
12
|
-
]
|
13
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"description": "create a snapshot of a scratch org\nA snapshot is a point-in-time copy of a scratch org. The copy is stored in Salesforce and referenced by its unique name in a scratch org definition file.\n\nUse \"sfdx force:org:snapshot:get\" to get details, including status, about a snapshot creation request.\n\nTo create a scratch org from a snapshot, include the \"snapshot\" entry (instead of \"edition\") in the scratch org definition file and set it to the name of the snapshot. Then use \"sfdx force:org:create\" to create the scratch org.",
|
3
|
-
"examples": [
|
4
|
-
"Create a snapshot called \"Dependencies\" using the source scratch org ID:",
|
5
|
-
"$ sfdx force:org:snapshot:create --sourceorg 00Dxx0000000000 --snapshotname Dependencies --description 'Contains PackageA v1.1.0'",
|
6
|
-
"Create a snapshot called \"NightlyBranch\" using the source scratch org username:",
|
7
|
-
"$ sfdx force:org:snapshot:create -o myuser@myorg -n NightlyBranch -d 'Contains PkgA v2.1.0 and PkgB 3.3.0'"
|
8
|
-
],
|
9
|
-
"flags": {
|
10
|
-
"snapshotname": "unique name of snapshot",
|
11
|
-
"description": "description of snapshot",
|
12
|
-
"sourceorg": "ID or locally authenticated username or alias of scratch org to snapshot"
|
13
|
-
},
|
14
|
-
"flagsLong": {
|
15
|
-
"snapshotname": "The unique name of the snapshot. Use this name to create scratch orgs from the snapshot.",
|
16
|
-
"description": "A description of the snapshot. Use this description to document the contents of the snapshot.\nWe suggest that you include a reference point, such as a version control system tag or commit ID.'",
|
17
|
-
"sourceorg": "The org ID, or a locally authenticated username or alias, of the scratch org to snapshot."
|
18
|
-
}
|
19
|
-
}
|