@salesforce/plugin-data 2.1.21 → 2.1.22
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 +947 -320
- package/lib/api/data/tree/exportApi.js +66 -73
- package/lib/api/data/tree/exportApi.js.map +1 -1
- package/lib/api/data/tree/importApi.js +62 -62
- package/lib/api/data/tree/importApi.js.map +1 -1
- package/lib/batcher.js +80 -101
- package/lib/batcher.js.map +1 -1
- package/lib/commands/data/create/record.js +64 -0
- package/lib/commands/data/create/record.js.map +1 -0
- package/lib/commands/data/delete/bulk.js +78 -0
- package/lib/commands/data/delete/bulk.js.map +1 -0
- package/lib/commands/data/delete/record.js +83 -0
- package/lib/commands/data/delete/record.js.map +1 -0
- package/lib/commands/data/export/tree.js +57 -0
- package/lib/commands/data/export/tree.js.map +1 -0
- package/lib/commands/data/get/record.js +73 -0
- package/lib/commands/data/get/record.js.map +1 -0
- package/lib/commands/data/import/tree.js +85 -0
- package/lib/commands/data/import/tree.js.map +1 -0
- package/lib/commands/data/query/resume.js +55 -0
- package/lib/commands/data/query/resume.js.map +1 -0
- package/lib/commands/data/query.js +283 -0
- package/lib/commands/data/query.js.map +1 -0
- package/lib/commands/data/resume.js +64 -0
- package/lib/commands/data/resume.js.map +1 -0
- package/lib/commands/data/update/record.js +101 -0
- package/lib/commands/data/update/record.js.map +1 -0
- package/lib/commands/data/upsert/bulk.js +88 -0
- package/lib/commands/data/upsert/bulk.js.map +1 -0
- package/lib/dataCommand.js +103 -202
- package/lib/dataCommand.js.map +1 -1
- package/lib/dataSoqlQueryTypes.js +2 -6
- package/lib/dataSoqlQueryTypes.js.map +1 -1
- package/lib/flags.js +27 -0
- package/lib/flags.js.map +1 -0
- package/lib/reporters.js +58 -66
- package/lib/reporters.js.map +1 -1
- package/messages/batcher.md +39 -0
- package/messages/bulk.delete.md +31 -0
- package/messages/bulk.report.md +17 -0
- package/messages/bulk.status.md +29 -0
- package/messages/bulk.upsert.md +43 -0
- package/messages/exportApi.md +25 -0
- package/messages/importApi.md +52 -0
- package/messages/messages.md +20 -0
- package/messages/record.create.md +45 -0
- package/messages/record.delete.md +53 -0
- package/messages/record.get.md +47 -0
- package/messages/record.update.md +61 -0
- package/messages/soql.query.md +72 -0
- package/messages/tree.export.md +41 -0
- package/messages/tree.import.md +37 -0
- package/oclif.manifest.json +1 -1
- package/package.json +50 -51
- package/lib/api/data/tree/exportApi.d.ts +0 -77
- package/lib/api/data/tree/importApi.d.ts +0 -60
- package/lib/batcher.d.ts +0 -79
- package/lib/commands/force/data/bulk/delete.d.ts +0 -11
- package/lib/commands/force/data/bulk/delete.js +0 -58
- package/lib/commands/force/data/bulk/delete.js.map +0 -1
- package/lib/commands/force/data/bulk/status.d.ts +0 -11
- package/lib/commands/force/data/bulk/status.js +0 -61
- package/lib/commands/force/data/bulk/status.js.map +0 -1
- package/lib/commands/force/data/bulk/upsert.d.ts +0 -11
- package/lib/commands/force/data/bulk/upsert.js +0 -76
- package/lib/commands/force/data/bulk/upsert.js.map +0 -1
- package/lib/commands/force/data/record/create.d.ts +0 -10
- package/lib/commands/force/data/record/create.js +0 -58
- package/lib/commands/force/data/record/create.js.map +0 -1
- package/lib/commands/force/data/record/delete.d.ts +0 -10
- package/lib/commands/force/data/record/delete.js +0 -72
- package/lib/commands/force/data/record/delete.js.map +0 -1
- package/lib/commands/force/data/record/get.d.ts +0 -10
- package/lib/commands/force/data/record/get.js +0 -65
- package/lib/commands/force/data/record/get.js.map +0 -1
- package/lib/commands/force/data/record/update.d.ts +0 -10
- package/lib/commands/force/data/record/update.js +0 -90
- package/lib/commands/force/data/record/update.js.map +0 -1
- package/lib/commands/force/data/soql/bulk/report.d.ts +0 -9
- package/lib/commands/force/data/soql/bulk/report.js +0 -45
- package/lib/commands/force/data/soql/bulk/report.js.map +0 -1
- package/lib/commands/force/data/soql/query.d.ts +0 -64
- package/lib/commands/force/data/soql/query.js +0 -300
- package/lib/commands/force/data/soql/query.js.map +0 -1
- package/lib/commands/force/data/tree/export.d.ts +0 -10
- package/lib/commands/force/data/tree/export.js +0 -52
- package/lib/commands/force/data/tree/export.js.map +0 -1
- package/lib/commands/force/data/tree/import.d.ts +0 -19
- package/lib/commands/force/data/tree/import.js +0 -81
- package/lib/commands/force/data/tree/import.js.map +0 -1
- package/lib/dataCommand.d.ts +0 -57
- package/lib/dataSoqlQueryTypes.d.ts +0 -63
- package/lib/index.d.ts +0 -2
- package/lib/reporters.d.ts +0 -57
- package/messages/batcher.json +0 -12
- package/messages/bulk.delete.json +0 -12
- package/messages/bulk.report.json +0 -7
- package/messages/bulk.status.json +0 -12
- package/messages/bulk.upsert.json +0 -14
- package/messages/exportApi.json +0 -8
- package/messages/importApi.json +0 -16
- package/messages/messages.json +0 -11
- package/messages/record.create.json +0 -15
- package/messages/record.delete.json +0 -16
- package/messages/record.get.json +0 -14
- package/messages/record.update.json +0 -18
- package/messages/soql.query.json +0 -26
- package/messages/tree.export.json +0 -11
- package/messages/tree.import.json +0 -13
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Licensed under the BSD 3-Clause license.
|
|
6
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
const os = require("os");
|
|
10
|
-
const command_1 = require("@salesforce/command");
|
|
11
|
-
const core_1 = require("@salesforce/core");
|
|
12
|
-
const dataCommand_1 = require("../../../../dataCommand");
|
|
13
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
|
14
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-data', 'record.create');
|
|
15
|
-
const commonMessages = core_1.Messages.loadMessages('@salesforce/plugin-data', 'messages');
|
|
16
|
-
class Create extends dataCommand_1.DataCommand {
|
|
17
|
-
async run() {
|
|
18
|
-
this.ux.startSpinner(`Creating record for ${this.flags.sobjecttype}`);
|
|
19
|
-
const sobject = this.getConnection().sobject(this.flags.sobjecttype);
|
|
20
|
-
const values = this.stringToDictionary(this.flags.values);
|
|
21
|
-
const result = this.normalize(await sobject.insert(values));
|
|
22
|
-
if (result.success) {
|
|
23
|
-
this.ux.log(messages.getMessage('createSuccess', [result.id || 'unknown id']));
|
|
24
|
-
this.ux.stopSpinner();
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
const errors = this.collectErrorMessages(result);
|
|
28
|
-
this.ux.error(messages.getMessage('createFailure', [errors]));
|
|
29
|
-
this.ux.stopSpinner('failed');
|
|
30
|
-
}
|
|
31
|
-
return result;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.default = Create;
|
|
35
|
-
Create.description = messages.getMessage('description');
|
|
36
|
-
Create.examples = messages.getMessage('examples').split(os.EOL);
|
|
37
|
-
Create.requiresUsername = true;
|
|
38
|
-
Create.flagsConfig = {
|
|
39
|
-
sobjecttype: command_1.flags.string({
|
|
40
|
-
char: 's',
|
|
41
|
-
required: true,
|
|
42
|
-
description: messages.getMessage('sObjectType'),
|
|
43
|
-
}),
|
|
44
|
-
values: command_1.flags.string({
|
|
45
|
-
char: 'v',
|
|
46
|
-
required: true,
|
|
47
|
-
description: messages.getMessage('values'),
|
|
48
|
-
}),
|
|
49
|
-
usetoolingapi: command_1.flags.boolean({
|
|
50
|
-
char: 't',
|
|
51
|
-
description: messages.getMessage('useToolingApi'),
|
|
52
|
-
}),
|
|
53
|
-
perflog: command_1.flags.boolean({
|
|
54
|
-
description: commonMessages.getMessage('perfLogLevelOption'),
|
|
55
|
-
dependsOn: ['json'],
|
|
56
|
-
}),
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/commands/force/data/record/create.ts"],"names":[],"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QAAQ,CAAC,CAAC;SAC/B;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;;AAzCH,yBA0CC;AAzCwB,kBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,eAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AACzD,uBAAgB,GAAG,IAAI,CAAC;AAExB,kBAAW,GAAgB;IAChD,WAAW,EAAE,eAAK,CAAC,MAAM,CAAC;QACxB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC;KAChD,CAAC;IACF,MAAM,EAAE,eAAK,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;KAC3C,CAAC;IACF,aAAa,EAAE,eAAK,CAAC,OAAO,CAAC;QAC3B,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC;KAClD,CAAC;IACF,OAAO,EAAE,eAAK,CAAC,OAAO,CAAC;QACrB,WAAW,EAAE,cAAc,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAC5D,SAAS,EAAE,CAAC,MAAM,CAAC;KACpB,CAAC;CACH,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FlagsConfig } from '@salesforce/command';
|
|
2
|
-
import { SaveResult } from 'jsforce';
|
|
3
|
-
import { DataCommand } from '../../../../dataCommand';
|
|
4
|
-
export default class Delete extends DataCommand {
|
|
5
|
-
static readonly description: string;
|
|
6
|
-
static readonly examples: string[];
|
|
7
|
-
static readonly requiresUsername = true;
|
|
8
|
-
static readonly flagsConfig: FlagsConfig;
|
|
9
|
-
run(): Promise<SaveResult>;
|
|
10
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Licensed under the BSD 3-Clause license.
|
|
6
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
const os = require("os");
|
|
10
|
-
const command_1 = require("@salesforce/command");
|
|
11
|
-
const core_1 = require("@salesforce/core");
|
|
12
|
-
const dataCommand_1 = require("../../../../dataCommand");
|
|
13
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
|
14
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-data', 'record.delete');
|
|
15
|
-
const commonMessages = core_1.Messages.loadMessages('@salesforce/plugin-data', 'messages');
|
|
16
|
-
class Delete extends dataCommand_1.DataCommand {
|
|
17
|
-
async run() {
|
|
18
|
-
this.validateIdXorWhereFlags();
|
|
19
|
-
this.ux.startSpinner('Deleting Record');
|
|
20
|
-
let status = 'Success';
|
|
21
|
-
try {
|
|
22
|
-
const sobject = this.getConnection().sobject(this.flags.sobjecttype);
|
|
23
|
-
const sObjectId = (this.flags.sobjectid || (await this.query(sobject, this.flags.where)).Id);
|
|
24
|
-
const result = this.normalize(await sobject.destroy(sObjectId));
|
|
25
|
-
if (result.success) {
|
|
26
|
-
this.ux.log(messages.getMessage('deleteSuccess', [sObjectId]));
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
status = 'Failed';
|
|
30
|
-
const errors = this.collectErrorMessages(result);
|
|
31
|
-
this.ux.error(messages.getMessage('deleteFailure', [errors]));
|
|
32
|
-
}
|
|
33
|
-
this.ux.stopSpinner(status);
|
|
34
|
-
return result;
|
|
35
|
-
}
|
|
36
|
-
catch (err) {
|
|
37
|
-
status = 'Failed';
|
|
38
|
-
this.ux.stopSpinner(status);
|
|
39
|
-
throw new core_1.SfError(err.name, err.message);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.default = Delete;
|
|
44
|
-
Delete.description = messages.getMessage('description');
|
|
45
|
-
Delete.examples = messages.getMessage('examples').split(os.EOL);
|
|
46
|
-
Delete.requiresUsername = true;
|
|
47
|
-
Delete.flagsConfig = {
|
|
48
|
-
sobjecttype: command_1.flags.string({
|
|
49
|
-
char: 's',
|
|
50
|
-
required: true,
|
|
51
|
-
description: messages.getMessage('sObjectType'),
|
|
52
|
-
}),
|
|
53
|
-
sobjectid: command_1.flags.id({
|
|
54
|
-
char: 'i',
|
|
55
|
-
description: messages.getMessage('sObjectId'),
|
|
56
|
-
exclusive: ['where'],
|
|
57
|
-
}),
|
|
58
|
-
where: command_1.flags.string({
|
|
59
|
-
char: 'w',
|
|
60
|
-
description: messages.getMessage('where'),
|
|
61
|
-
exclusive: ['sobjectid'],
|
|
62
|
-
}),
|
|
63
|
-
usetoolingapi: command_1.flags.boolean({
|
|
64
|
-
char: 't',
|
|
65
|
-
description: messages.getMessage('useToolingApi'),
|
|
66
|
-
}),
|
|
67
|
-
perflog: command_1.flags.boolean({
|
|
68
|
-
description: commonMessages.getMessage('perfLogLevelOption'),
|
|
69
|
-
dependsOn: ['json'],
|
|
70
|
-
}),
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../../src/commands/force/data/record/delete.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,yBAAyB;AAEzB,iDAAyD;AACzD,2CAAqD;AAErD,yDAAsD;AAEtD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC;AACnF,MAAM,cAAc,GAAG,eAAQ,CAAC,YAA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
|
-
import { DataCommand } from '../../../../dataCommand';
|
|
4
|
-
export default class Get extends DataCommand {
|
|
5
|
-
static readonly description: string;
|
|
6
|
-
static readonly examples: string[];
|
|
7
|
-
static readonly requiresUsername = true;
|
|
8
|
-
static readonly flagsConfig: FlagsConfig;
|
|
9
|
-
run(): Promise<Record>;
|
|
10
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Licensed under the BSD 3-Clause license.
|
|
6
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
const os = require("os");
|
|
10
|
-
const command_1 = require("@salesforce/command");
|
|
11
|
-
const core_1 = require("@salesforce/core");
|
|
12
|
-
const ts_types_1 = require("@salesforce/ts-types");
|
|
13
|
-
const dataCommand_1 = require("../../../../dataCommand");
|
|
14
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
|
15
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-data', 'record.get');
|
|
16
|
-
const commonMessages = core_1.Messages.loadMessages('@salesforce/plugin-data', 'messages');
|
|
17
|
-
class Get extends dataCommand_1.DataCommand {
|
|
18
|
-
async run() {
|
|
19
|
-
this.validateIdXorWhereFlags();
|
|
20
|
-
this.ux.startSpinner('Getting Record');
|
|
21
|
-
const sobject = this.getConnection().sobject(this.flags.sobjecttype);
|
|
22
|
-
try {
|
|
23
|
-
const sObjectId = (this.flags.sobjectid || (await this.query(sobject, this.flags.where)).Id);
|
|
24
|
-
const result = await sobject.retrieve(sObjectId);
|
|
25
|
-
if (!this.flags.json)
|
|
26
|
-
this.logNestedObject(result);
|
|
27
|
-
this.ux.stopSpinner();
|
|
28
|
-
return (0, ts_types_1.toAnyJson)(result);
|
|
29
|
-
}
|
|
30
|
-
catch (err) {
|
|
31
|
-
this.ux.stopSpinner('failed');
|
|
32
|
-
throw new core_1.SfError(err.name, err.message);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.default = Get;
|
|
37
|
-
Get.description = messages.getMessage('description');
|
|
38
|
-
Get.examples = messages.getMessage('examples').split(os.EOL);
|
|
39
|
-
Get.requiresUsername = true;
|
|
40
|
-
Get.flagsConfig = {
|
|
41
|
-
sobjecttype: command_1.flags.string({
|
|
42
|
-
char: 's',
|
|
43
|
-
required: true,
|
|
44
|
-
description: messages.getMessage('sObjectType'),
|
|
45
|
-
}),
|
|
46
|
-
sobjectid: command_1.flags.id({
|
|
47
|
-
char: 'i',
|
|
48
|
-
description: messages.getMessage('sObjectId'),
|
|
49
|
-
exclusive: ['where'],
|
|
50
|
-
}),
|
|
51
|
-
where: command_1.flags.string({
|
|
52
|
-
char: 'w',
|
|
53
|
-
description: messages.getMessage('where'),
|
|
54
|
-
exclusive: ['sobjectid'],
|
|
55
|
-
}),
|
|
56
|
-
usetoolingapi: command_1.flags.boolean({
|
|
57
|
-
char: 't',
|
|
58
|
-
description: messages.getMessage('useToolingApi'),
|
|
59
|
-
}),
|
|
60
|
-
perflog: command_1.flags.boolean({
|
|
61
|
-
description: commonMessages.getMessage('perfLogLevelOption'),
|
|
62
|
-
dependsOn: ['json'],
|
|
63
|
-
}),
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=get.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../src/commands/force/data/record/get.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,yBAAyB;AAEzB,iDAAyD;AACzD,2CAAqD;AAErD,mDAAiD;AACjD,yDAAsD;AAEtD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE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G,IAAI,CAAC;AAExB,eAAW,GAAgB;IAChD,WAAW,EAAE,eAAK,CAAC,MAAM,CAAC;QACxB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC;KAChD,CAAC;IACF,SAAS,EAAE,eAAK,CAAC,EAAE,CAAC;QAClB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;QAC7C,SAAS,EAAE,CAAC,OAAO,CAAC;KACrB,CAAC;IACF,KAAK,EAAE,eAAK,CAAC,MAAM,CAAC;QAClB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;QACzC,SAAS,EAAE,CAAC,WAAW,CAAC;KACzB,CAAC;IACF,aAAa,EAAE,eAAK,CAAC,OAAO,CAAC;QAC3B,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC;KAClD,CAAC;IACF,OAAO,EAAE,eAAK,CAAC,OAAO,CAAC;QACrB,WAAW,EAAE,cAAc,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAC5D,SAAS,EAAE,CAAC,MAAM,CAAC;KACpB,CAAC;CACH,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FlagsConfig } from '@salesforce/command';
|
|
2
|
-
import { SaveResult } from 'jsforce';
|
|
3
|
-
import { DataCommand } from '../../../../dataCommand';
|
|
4
|
-
export default class Update extends DataCommand {
|
|
5
|
-
static readonly description: string;
|
|
6
|
-
static readonly examples: string[];
|
|
7
|
-
static readonly requiresUsername = true;
|
|
8
|
-
static readonly flagsConfig: FlagsConfig;
|
|
9
|
-
run(): Promise<SaveResult>;
|
|
10
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Licensed under the BSD 3-Clause license.
|
|
6
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
const os = require("os");
|
|
10
|
-
const command_1 = require("@salesforce/command");
|
|
11
|
-
const core_1 = require("@salesforce/core");
|
|
12
|
-
const dataCommand_1 = require("../../../../dataCommand");
|
|
13
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
|
14
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-data', 'record.update');
|
|
15
|
-
const commonMessages = core_1.Messages.loadMessages('@salesforce/plugin-data', 'messages');
|
|
16
|
-
class Update extends dataCommand_1.DataCommand {
|
|
17
|
-
async run() {
|
|
18
|
-
this.validateIdXorWhereFlags();
|
|
19
|
-
this.ux.startSpinner('Updating Record');
|
|
20
|
-
let status = 'Success';
|
|
21
|
-
const sobject = this.getConnection().sobject(this.flags.sobjecttype);
|
|
22
|
-
const sObjectId = (this.flags.sobjectid || (await this.query(sobject, this.flags.where)).Id);
|
|
23
|
-
try {
|
|
24
|
-
const updateObject = this.stringToDictionary(this.flags.values);
|
|
25
|
-
updateObject.Id = sObjectId;
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
const result = await sobject.update(updateObject);
|
|
29
|
-
if (result.success) {
|
|
30
|
-
this.ux.log(messages.getMessage('updateSuccess', [sObjectId]));
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
const errors = this.collectErrorMessages(result);
|
|
34
|
-
this.ux.error(messages.getMessage('updateFailure', [errors]));
|
|
35
|
-
}
|
|
36
|
-
this.ux.stopSpinner(status);
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
catch (err) {
|
|
40
|
-
status = 'Failed';
|
|
41
|
-
this.ux.stopSpinner(status);
|
|
42
|
-
const error = err;
|
|
43
|
-
if (Reflect.has(error, 'errorCode') && Reflect.has(error, 'fields')) {
|
|
44
|
-
throw new core_1.SfError(messages.getMessage('updateFailureWithFields', [
|
|
45
|
-
Reflect.get(error, 'errorCode'),
|
|
46
|
-
Reflect.get(error, 'message'),
|
|
47
|
-
Reflect.get(error, 'fields'),
|
|
48
|
-
]));
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
throw err;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.default = Update;
|
|
57
|
-
Update.description = messages.getMessage('description');
|
|
58
|
-
Update.examples = messages.getMessage('examples').split(os.EOL);
|
|
59
|
-
Update.requiresUsername = true;
|
|
60
|
-
Update.flagsConfig = {
|
|
61
|
-
sobjecttype: command_1.flags.string({
|
|
62
|
-
char: 's',
|
|
63
|
-
required: true,
|
|
64
|
-
description: messages.getMessage('sObjectType'),
|
|
65
|
-
}),
|
|
66
|
-
sobjectid: command_1.flags.id({
|
|
67
|
-
char: 'i',
|
|
68
|
-
description: messages.getMessage('sObjectId'),
|
|
69
|
-
exclusive: ['where'],
|
|
70
|
-
}),
|
|
71
|
-
where: command_1.flags.string({
|
|
72
|
-
char: 'w',
|
|
73
|
-
description: messages.getMessage('where'),
|
|
74
|
-
exclusive: ['sobjectid'],
|
|
75
|
-
}),
|
|
76
|
-
values: command_1.flags.string({
|
|
77
|
-
char: 'v',
|
|
78
|
-
required: true,
|
|
79
|
-
description: messages.getMessage('values'),
|
|
80
|
-
}),
|
|
81
|
-
usetoolingapi: command_1.flags.boolean({
|
|
82
|
-
char: 't',
|
|
83
|
-
description: messages.getMessage('useToolingApi'),
|
|
84
|
-
}),
|
|
85
|
-
perflog: command_1.flags.boolean({
|
|
86
|
-
description: commonMessages.getMessage('perfLogLevelOption'),
|
|
87
|
-
dependsOn: ['json'],
|
|
88
|
-
}),
|
|
89
|
-
};
|
|
90
|
-
//# sourceMappingURL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MAAM,CAAC;QACxB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC;KAChD,CAAC;IACF,SAAS,EAAE,eAAK,CAAC,EAAE,CAAC;QAClB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;QAC7C,SAAS,EAAE,CAAC,OAAO,CAAC;KACrB,CAAC;IACF,KAAK,EAAE,eAAK,CAAC,MAAM,CAAC;QAClB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;QACzC,SAAS,EAAE,CAAC,WAAW,CAAC;KACzB,CAAC;IACF,MAAM,EAAE,eAAK,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;KAC3C,CAAC;IACF,aAAa,EAAE,eAAK,CAAC,OAAO,CAAC;QAC3B,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC;KAClD,CAAC;IACF,OAAO,EAAE,eAAK,CAAC,OAAO,CAAC;QACrB,WAAW,EAAE,cAAc,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAC5D,SAAS,EAAE,CAAC,MAAM,CAAC;KACpB,CAAC;CACH,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FlagsConfig } from '@salesforce/command';
|
|
2
|
-
import { DataSoqlQueryCommand } from '../query';
|
|
3
|
-
export declare class BulkQueryReport extends DataSoqlQueryCommand {
|
|
4
|
-
static readonly description: string;
|
|
5
|
-
static readonly requiresUsername = true;
|
|
6
|
-
static readonly examples: string[];
|
|
7
|
-
static readonly flagsConfig: FlagsConfig;
|
|
8
|
-
run(): Promise<unknown>;
|
|
9
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BulkQueryReport = 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 = require("os");
|
|
11
|
-
const command_1 = require("@salesforce/command");
|
|
12
|
-
const core_1 = require("@salesforce/core");
|
|
13
|
-
const bulk_1 = require("jsforce/lib/api/bulk");
|
|
14
|
-
const query_1 = require("../query");
|
|
15
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
|
16
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-data', 'bulk.report');
|
|
17
|
-
class BulkQueryReport extends query_1.DataSoqlQueryCommand {
|
|
18
|
-
async run() {
|
|
19
|
-
const job = new bulk_1.QueryJobV2({
|
|
20
|
-
operation: 'query',
|
|
21
|
-
pollingOptions: { pollTimeout: 0, pollInterval: 0 },
|
|
22
|
-
query: '',
|
|
23
|
-
connection: this.org.getConnection(),
|
|
24
|
-
});
|
|
25
|
-
job.jobInfo = { id: this.flags.bulkqueryid };
|
|
26
|
-
const results = await job.getResults();
|
|
27
|
-
const soqlQuery = new query_1.SoqlQuery();
|
|
28
|
-
const queryResult = soqlQuery.transformBulkResults(results, '');
|
|
29
|
-
this.displayResults({ ...queryResult });
|
|
30
|
-
return queryResult.result;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.BulkQueryReport = BulkQueryReport;
|
|
34
|
-
BulkQueryReport.description = messages.getMessage('description');
|
|
35
|
-
BulkQueryReport.requiresUsername = true;
|
|
36
|
-
BulkQueryReport.examples = messages.getMessage('examples').split(os.EOL);
|
|
37
|
-
BulkQueryReport.flagsConfig = {
|
|
38
|
-
bulkqueryid: command_1.flags.string({
|
|
39
|
-
char: 'i',
|
|
40
|
-
required: true,
|
|
41
|
-
description: messages.getMessage('bulkQueryIdDescription'),
|
|
42
|
-
}),
|
|
43
|
-
resultformat: query_1.DataSoqlQueryCommand.flagsConfig.resultformat,
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=report.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../../../../src/commands/force/data/soql/bulk/report.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,iDAAyD;AACzD,2CAA4C;AAC5C,+CAAkD;AAClD,oCAA2D;AAE3D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC;AAEjF,MAAa,eAAgB,SAAQ,4BAAoB;IAahD,KAAK,CAAC,GAAG;QACd,MAAM,GAAG,GAAG,IAAI,iBAAU,CAAC;YACzB,SAAS,EAAE,OAAO;YAClB,cAAc,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;YACnD,KAAK,EAAE,EAAE;YACT,UAAU,EAAE,IAAI,CAAC,GAAI,CAAC,aAAa,EAAE;SACtC,CAAC,CAAC;QACH,GAAG,CAAC,OAAO,GAAG,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,WAAqB,EAAE,CAAC;QACvD,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,UAAU,EAAE,CAAC;QACvC,MAAM,SAAS,GAAG,IAAI,iBAAS,EAAE,CAAC;QAClC,MAAM,WAAW,GAAG,SAAS,CAAC,oBAAoB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAEhE,IAAI,CAAC,cAAc,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC;QACxC,OAAO,WAAW,CAAC,MAAM,CAAC;IAC5B,CAAC;;AA3BH,0CA4BC;AA3BwB,2BAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,gCAAgB,GAAG,IAAI,CAAC;AACxB,wBAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AACzD,2BAAW,GAAgB;IAChD,WAAW,EAAE,eAAK,CAAC,MAAM,CAAC;QACxB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;KAC3D,CAAC;IACF,YAAY,EAAE,4BAAoB,CAAC,WAAW,CAAC,YAAY;CAC5D,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { FlagsConfig, UX } from '@salesforce/command';
|
|
2
|
-
import { Connection, Logger, SfdxConfigAggregator } from '@salesforce/core';
|
|
3
|
-
import { Record } from 'jsforce';
|
|
4
|
-
import { Duration } from '@salesforce/kit';
|
|
5
|
-
import { Field, SoqlQueryResult } from '../../../../dataSoqlQueryTypes';
|
|
6
|
-
import { DataCommand } from '../../../../dataCommand';
|
|
7
|
-
/**
|
|
8
|
-
* Class to handle a soql query
|
|
9
|
-
*
|
|
10
|
-
* Will collect all records and the column metadata of the query
|
|
11
|
-
*/
|
|
12
|
-
export declare class SoqlQuery {
|
|
13
|
-
/**
|
|
14
|
-
* Executs a SOQL query using the bulk 2.0 API
|
|
15
|
-
*
|
|
16
|
-
* @param connection
|
|
17
|
-
* @param query
|
|
18
|
-
* @param timeout
|
|
19
|
-
* @param ux
|
|
20
|
-
*/
|
|
21
|
-
runBulkSoqlQuery(connection: Connection, query: string, timeout: Duration | undefined, ux: UX): Promise<SoqlQueryResult>;
|
|
22
|
-
/**
|
|
23
|
-
* transforms Bulk 2.0 results to match the SOQL query results
|
|
24
|
-
*
|
|
25
|
-
* @param results results object
|
|
26
|
-
* @param query query string
|
|
27
|
-
*/
|
|
28
|
-
transformBulkResults(results: Record[], query: string): SoqlQueryResult;
|
|
29
|
-
runSoqlQuery(connection: Connection, query: string, logger: Logger, configAgg: SfdxConfigAggregator): Promise<SoqlQueryResult>;
|
|
30
|
-
/**
|
|
31
|
-
* Utility to fetch the columns involved in a soql query.
|
|
32
|
-
*
|
|
33
|
-
* Columns are then transformed into one of three types, Field, SubqueryField and FunctionField. List of
|
|
34
|
-
* fields is returned as the product.
|
|
35
|
-
*
|
|
36
|
-
* @param connection
|
|
37
|
-
* @param query
|
|
38
|
-
*/
|
|
39
|
-
retrieveColumns(connection: Connection, query: string, logger?: Logger): Promise<Field[]>;
|
|
40
|
-
private recursivelyFindColumns;
|
|
41
|
-
private searchSubColumnsRecursively;
|
|
42
|
-
}
|
|
43
|
-
export declare class DataSoqlQueryCommand extends DataCommand {
|
|
44
|
-
static readonly description: string;
|
|
45
|
-
static readonly requiresUsername = true;
|
|
46
|
-
static readonly examples: string[];
|
|
47
|
-
static readonly flagsConfig: FlagsConfig;
|
|
48
|
-
/**
|
|
49
|
-
* Command run implementation
|
|
50
|
-
*
|
|
51
|
-
* Returns either a DataSoqlQueryResult or a SfdxResult.
|
|
52
|
-
* When the user is using global '--json' flag an instance of SfdxResult is returned.
|
|
53
|
-
* This is necessary since '--json' flag reports results in the form of SfdxResult
|
|
54
|
-
* and bypasses the definition of start result. The goal is to have the output
|
|
55
|
-
* from '--json' and '--resulformat json' be the same.
|
|
56
|
-
*
|
|
57
|
-
* The DataSoqlQueryResult is necessary to communicate user selections to the reporters.
|
|
58
|
-
* The 'this' object available during display() function does not include user input to
|
|
59
|
-
* the command, which are necessary for reporter selection.
|
|
60
|
-
*
|
|
61
|
-
*/
|
|
62
|
-
run(): Promise<unknown>;
|
|
63
|
-
displayResults(queryResult: SoqlQueryResult): void;
|
|
64
|
-
}
|