@salesforce/plugin-data 2.1.21 → 2.1.23
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 +1233 -1
- package/package.json +55 -56
- 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
|
@@ -0,0 +1,101 @@
|
|
|
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 core_1 = require("@salesforce/core");
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
11
|
+
const flags_1 = require("../../../flags");
|
|
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 sf_plugins_core_1.SfCommand {
|
|
17
|
+
async run() {
|
|
18
|
+
const { flags } = await this.parse(Update);
|
|
19
|
+
this.spinner.start('Updating Record');
|
|
20
|
+
let status = 'Success';
|
|
21
|
+
const conn = flags['use-tooling-api']
|
|
22
|
+
? flags['target-org'].getConnection(flags['api-version']).tooling
|
|
23
|
+
: flags['target-org'].getConnection(flags['api-version']);
|
|
24
|
+
// oclif isn't smart of enough to know that if record-id is not set, then where is set
|
|
25
|
+
const sObjectId = flags['record-id'] ?? (await (0, dataCommand_1.query)(conn, flags.sobject, flags.where)).Id;
|
|
26
|
+
try {
|
|
27
|
+
const updateObject = { ...(0, dataCommand_1.stringToDictionary)(flags.values), Id: sObjectId };
|
|
28
|
+
const result = await conn.sobject(flags.sobject).update(updateObject);
|
|
29
|
+
if (result.success) {
|
|
30
|
+
this.log(messages.getMessage('updateSuccess', [sObjectId]));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const errors = (0, dataCommand_1.collectErrorMessages)(result);
|
|
34
|
+
this.error(messages.getMessage('updateFailure', [errors]));
|
|
35
|
+
}
|
|
36
|
+
this.spinner.stop(status);
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
status = 'Failed';
|
|
41
|
+
this.spinner.stop(status);
|
|
42
|
+
if (isSaveResult(err)) {
|
|
43
|
+
throw new core_1.SfError(messages.getMessage('updateFailureWithFields', [err.errorCode, err.message, (err.fields ?? []).join(',')]));
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
throw err;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = Update;
|
|
52
|
+
Update.summary = messages.getMessage('summary');
|
|
53
|
+
Update.description = messages.getMessage('description');
|
|
54
|
+
Update.examples = messages.getMessages('examples');
|
|
55
|
+
Update.aliases = ['force:data:record:update'];
|
|
56
|
+
Update.deprecateAliases = true;
|
|
57
|
+
Update.flags = {
|
|
58
|
+
...flags_1.orgFlags,
|
|
59
|
+
sobject: sf_plugins_core_1.Flags.string({
|
|
60
|
+
char: 's',
|
|
61
|
+
required: true,
|
|
62
|
+
summary: messages.getMessage('flags.sobject'),
|
|
63
|
+
aliases: ['sobjecttype'],
|
|
64
|
+
deprecateAliases: true,
|
|
65
|
+
}),
|
|
66
|
+
'record-id': sf_plugins_core_1.Flags.salesforceId({
|
|
67
|
+
char: 'i',
|
|
68
|
+
summary: messages.getMessage('flags.recordId'),
|
|
69
|
+
exactlyOne: ['where', 'record-id'],
|
|
70
|
+
aliases: ['sobjectid'],
|
|
71
|
+
deprecateAliases: true,
|
|
72
|
+
}),
|
|
73
|
+
where: sf_plugins_core_1.Flags.string({
|
|
74
|
+
char: 'w',
|
|
75
|
+
summary: messages.getMessage('flags.where'),
|
|
76
|
+
exactlyOne: ['where', 'record-id'],
|
|
77
|
+
}),
|
|
78
|
+
values: sf_plugins_core_1.Flags.string({
|
|
79
|
+
char: 'v',
|
|
80
|
+
required: true,
|
|
81
|
+
summary: messages.getMessage('flags.values'),
|
|
82
|
+
}),
|
|
83
|
+
'use-tooling-api': sf_plugins_core_1.Flags.boolean({
|
|
84
|
+
char: 't',
|
|
85
|
+
summary: messages.getMessage('flags.useToolingApi'),
|
|
86
|
+
aliases: ['usetoolingapi'],
|
|
87
|
+
deprecateAliases: true,
|
|
88
|
+
}),
|
|
89
|
+
perflog: sf_plugins_core_1.Flags.boolean({
|
|
90
|
+
summary: commonMessages.getMessage('perfLogLevelOption'),
|
|
91
|
+
hidden: true,
|
|
92
|
+
deprecated: {
|
|
93
|
+
version: '57',
|
|
94
|
+
},
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
const isSaveResult = (error) => {
|
|
98
|
+
const se = error;
|
|
99
|
+
return Boolean(se.fields && se.errorCode && se.message);
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.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AAsB,EAAE;IAC9E,MAAM,EAAE,GAAG,KAAkB,CAAC;IAC9B,OAAO,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,SAAS,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC;AAC1D,CAAC,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
* Licensed under the BSD 3-Clause license.
|
|
7
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
|
+
*/
|
|
9
|
+
const fs = require("fs");
|
|
10
|
+
const core_1 = require("@salesforce/core");
|
|
11
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
|
+
const kit_1 = require("@salesforce/kit");
|
|
13
|
+
const flags_1 = require("../../../flags");
|
|
14
|
+
const batcher_1 = require("../../../batcher");
|
|
15
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
16
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-data', 'bulk.upsert');
|
|
17
|
+
class Upsert extends sf_plugins_core_1.SfCommand {
|
|
18
|
+
async run() {
|
|
19
|
+
const { flags } = await this.parse(Upsert);
|
|
20
|
+
const conn = flags['target-org'].getConnection(flags['api-version']);
|
|
21
|
+
this.spinner.start('Bulk Upsert');
|
|
22
|
+
const batcher = new batcher_1.Batcher(conn, new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }));
|
|
23
|
+
const csvStream = fs.createReadStream(flags.file, { encoding: 'utf-8' });
|
|
24
|
+
const concurrencyMode = flags.serial ? 'Serial' : 'Parallel';
|
|
25
|
+
const job = conn.bulk.createJob(flags.sobject, 'upsert', {
|
|
26
|
+
extIdField: flags['external-id'],
|
|
27
|
+
concurrencyMode,
|
|
28
|
+
});
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises,no-async-promise-executor
|
|
30
|
+
return new Promise(async (resolve, reject) => {
|
|
31
|
+
job.on('error', (err) => {
|
|
32
|
+
reject(err);
|
|
33
|
+
});
|
|
34
|
+
try {
|
|
35
|
+
resolve(await batcher.createAndExecuteBatches(job, csvStream, flags.sobject, flags.wait?.minutes));
|
|
36
|
+
this.spinner.stop();
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
this.spinner.stop('error');
|
|
40
|
+
reject(e);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = Upsert;
|
|
46
|
+
Upsert.summary = messages.getMessage('summary');
|
|
47
|
+
Upsert.description = messages.getMessage('description');
|
|
48
|
+
Upsert.examples = messages.getMessages('examples');
|
|
49
|
+
Upsert.aliases = ['force:data:bulk:upsert'];
|
|
50
|
+
Upsert.deprecateAliases = true;
|
|
51
|
+
Upsert.flags = {
|
|
52
|
+
...flags_1.orgFlags,
|
|
53
|
+
'external-id': sf_plugins_core_1.Flags.string({
|
|
54
|
+
char: 'i',
|
|
55
|
+
summary: messages.getMessage('flags.externalid'),
|
|
56
|
+
required: true,
|
|
57
|
+
aliases: ['externalid'],
|
|
58
|
+
deprecateAliases: true,
|
|
59
|
+
}),
|
|
60
|
+
file: sf_plugins_core_1.Flags.file({
|
|
61
|
+
exists: true,
|
|
62
|
+
char: 'f',
|
|
63
|
+
summary: messages.getMessage('flags.csvfile'),
|
|
64
|
+
required: true,
|
|
65
|
+
aliases: ['csvfile'],
|
|
66
|
+
deprecateAliases: true,
|
|
67
|
+
}),
|
|
68
|
+
sobject: sf_plugins_core_1.Flags.string({
|
|
69
|
+
char: 's',
|
|
70
|
+
summary: messages.getMessage('flags.sobjecttype'),
|
|
71
|
+
required: true,
|
|
72
|
+
aliases: ['sobjecttype'],
|
|
73
|
+
deprecateAliases: true,
|
|
74
|
+
}),
|
|
75
|
+
wait: sf_plugins_core_1.Flags.duration({
|
|
76
|
+
char: 'w',
|
|
77
|
+
unit: 'minutes',
|
|
78
|
+
summary: messages.getMessage('flags.wait'),
|
|
79
|
+
min: 0,
|
|
80
|
+
default: kit_1.Duration.minutes(0),
|
|
81
|
+
}),
|
|
82
|
+
serial: sf_plugins_core_1.Flags.boolean({
|
|
83
|
+
char: 'r',
|
|
84
|
+
summary: messages.getMessage('flags.serial'),
|
|
85
|
+
default: false,
|
|
86
|
+
}),
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=bulk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk.js","sourceRoot":"","sources":["../../../../src/commands/data/upsert/bulk.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,2CAA4C;AAC5C,iEAAmE;AACnE,yCAA2C;AAC3C,0CAA0C;AAC1C,8CAA8D;AAE9D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC;AAEjF,MAAqB,MAAO,SAAQ,2BAA4B;IA6CvD,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QACrE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAElC,MAAM,OAAO,GAAG,IAAI,iBAAO,CAAC,IAAI,EAAE,IAAI,oBAAE,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC;QAC/E,MAAM,SAAS,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,EA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;IACX,aAAa,EAAE,uBAAK,CAAC,MAAM,CAAC;QAC1B,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,kBAAkB,CAAC;QAChD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,CAAC,YAAY,CAAC;QACvB,gBAAgB,EAAE,IAAI;KACvB,CAAC;IACF,IAAI,EAAE,uBAAK,CAAC,IAAI,CAAC;QACf,MAAM,EAAE,IAAI;QACZ,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC;QAC7C,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,CAAC,SAAS,CAAC;QACpB,gBAAgB,EAAE,IAAI;KACvB,CAAC;IACF,OAAO,EAAE,uBAAK,CAAC,MAAM,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,mBAAmB,CAAC;QACjD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,CAAC,aAAa,CAAC;QACxB,gBAAgB,EAAE,IAAI;KACvB,CAAC;IACF,IAAI,EAAE,uBAAK,CAAC,QAAQ,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC;QAC1C,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,cAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;KAC7B,CAAC;IACF,MAAM,EAAE,uBAAK,CAAC,OAAO,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC;QAC5C,OAAO,EAAE,KAAK;KACf,CAAC;CACH,CAAC"}
|
package/lib/dataCommand.js
CHANGED
|
@@ -6,223 +6,124 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
10
|
-
const fse = require("fs-extra");
|
|
11
|
-
const command_1 = require("@salesforce/command");
|
|
12
|
-
const ts_types_1 = require("@salesforce/ts-types");
|
|
9
|
+
exports.query = exports.collectErrorMessages = exports.stringToDictionary = exports.logNestedObject = void 0;
|
|
13
10
|
const core_1 = require("@salesforce/core");
|
|
14
|
-
const
|
|
11
|
+
const core_2 = require("@oclif/core");
|
|
15
12
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
16
13
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-data', 'messages');
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
requestPath: `/services${req?.url?.split('/services')[1]}`,
|
|
27
|
-
perfMetrics: JSON.parse(metrics),
|
|
28
|
-
});
|
|
14
|
+
const logNestedObject = (obj, indentation = 0) => {
|
|
15
|
+
const space = ' '.repeat(indentation);
|
|
16
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
17
|
+
if (!!value && typeof value === 'object') {
|
|
18
|
+
core_2.CliUx.ux.log(`${space}${key}:`);
|
|
19
|
+
(0, exports.logNestedObject)(value, indentation + 2);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
core_2.CliUx.ux.log(`${space}${key}: ${value}`);
|
|
29
23
|
}
|
|
30
24
|
});
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
32
|
-
// @ts-ignore
|
|
33
|
-
return originalRequestMethod.call(this, req, ...args);
|
|
34
25
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
exports.logNestedObject = logNestedObject;
|
|
27
|
+
/**
|
|
28
|
+
* Takes a sequence of key=value string pairs and produces an object out of them.
|
|
29
|
+
* If you repeat the key, it replaces the value with the subsequent value.
|
|
30
|
+
*
|
|
31
|
+
* @param [keyValuePairs] - The list of key=value pair strings.
|
|
32
|
+
*/
|
|
33
|
+
const transformKeyValueSequence = (keyValuePairs) => {
|
|
34
|
+
const constructedObject = {};
|
|
35
|
+
keyValuePairs.forEach((pair) => {
|
|
36
|
+
// Look for the *first* '=' and splits there, ignores any subsequent '=' for this pair
|
|
37
|
+
const eqPosition = pair.indexOf('=');
|
|
38
|
+
if (eqPosition === -1) {
|
|
39
|
+
throw new Error(messages.getMessage('TextUtilMalformedKeyValuePair', [pair]));
|
|
48
40
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
else {
|
|
42
|
+
const key = pair.substr(0, eqPosition);
|
|
43
|
+
if (pair.includes('{') && pair.includes('}')) {
|
|
44
|
+
try {
|
|
45
|
+
constructedObject[key] = JSON.parse(pair.substr(eqPosition + 1));
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// the data contained { and }, but wasn't valid JSON, default to parsing as-is
|
|
49
|
+
constructedObject[key] = convertToBooleanIfApplicable(pair.substr(eqPosition + 1));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
constructedObject[key] = convertToBooleanIfApplicable(pair.substr(eqPosition + 1));
|
|
54
|
+
}
|
|
57
55
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
});
|
|
57
|
+
return constructedObject;
|
|
58
|
+
};
|
|
59
|
+
const convertToBooleanIfApplicable = (input) => {
|
|
60
|
+
if (input.trim().toLowerCase() === 'false')
|
|
61
|
+
return false;
|
|
62
|
+
if (input.trim().toLowerCase() === 'true')
|
|
63
|
+
return true;
|
|
64
|
+
return input;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Splits a sequence of 'key=value key="leftValue rightValue" key=value'
|
|
68
|
+
* into a list of key=value pairs, paying attention to quoted whitespace.
|
|
69
|
+
*
|
|
70
|
+
* This is NOT a full push down-automaton so do NOT expect full error handling/recovery.
|
|
71
|
+
*
|
|
72
|
+
* @param {string} text - The sequence to split
|
|
73
|
+
*/
|
|
74
|
+
const parseKeyValueSequence = (text) => {
|
|
75
|
+
const separator = /\s/;
|
|
76
|
+
let inSingleQuote = false;
|
|
77
|
+
let inDoubleQuote = false;
|
|
78
|
+
let currentToken = [];
|
|
79
|
+
const keyValuePairs = [];
|
|
80
|
+
const trimmedText = text.trim();
|
|
81
|
+
const singleQuoteCount = (trimmedText.match(/'/g) ?? []).length;
|
|
82
|
+
const doubleQuoteCount = (trimmedText.match(/"/g) ?? []).length;
|
|
83
|
+
for (const currentChar of trimmedText) {
|
|
84
|
+
const isSeparator = separator.test(currentChar);
|
|
85
|
+
if (currentChar === "'" && !inDoubleQuote && singleQuoteCount >= 2) {
|
|
86
|
+
inSingleQuote = !inSingleQuote;
|
|
87
|
+
continue;
|
|
63
88
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const perfMetrics = DataCommand.getMetrics();
|
|
68
|
-
if (perfMetrics.length)
|
|
69
|
-
final.perfMetrics = perfMetrics;
|
|
70
|
-
return final;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Necessary where plugin commands are extending a base class that extends SfdxCommand
|
|
74
|
-
*
|
|
75
|
-
* @returns Org
|
|
76
|
-
*/
|
|
77
|
-
ensureOrg() {
|
|
78
|
-
if (!this.org) {
|
|
79
|
-
throw new core_1.SfError('This command requires a username. Specify it with the -u parameter or with the "sfdx config:set defaultusername=<username>" command.');
|
|
89
|
+
else if (currentChar === '"' && !inSingleQuote && doubleQuoteCount >= 2) {
|
|
90
|
+
inDoubleQuote = !inDoubleQuote;
|
|
91
|
+
continue;
|
|
80
92
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
86
|
-
// @ts-ignore
|
|
87
|
-
const connection = this.flags.usetoolingapi
|
|
88
|
-
? safeOrg.getConnection().tooling
|
|
89
|
-
: safeOrg.getConnection();
|
|
90
|
-
if (this.flags.perflog) {
|
|
91
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
92
|
-
if (!connection._callOptions) {
|
|
93
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
94
|
-
connection._callOptions = {};
|
|
93
|
+
if (!inSingleQuote && !inDoubleQuote && isSeparator) {
|
|
94
|
+
if (currentToken.length > 0) {
|
|
95
|
+
keyValuePairs.push(currentToken.join(''));
|
|
96
|
+
currentToken = [];
|
|
95
97
|
}
|
|
96
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
97
|
-
connection._callOptions.perfOption = 'MINIMUM';
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
102
|
-
// @ts-ignore enable any typing here
|
|
103
|
-
async query(sobject, where) {
|
|
104
|
-
const queryObject = this.stringToDictionary(where);
|
|
105
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access
|
|
106
|
-
const records = await sobject.find(queryObject, 'id');
|
|
107
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
108
|
-
if (!records || records.length === 0) {
|
|
109
|
-
throw new core_1.SfError('DataRecordGetNoRecord', messages.getMessage('DataRecordGetNoRecord'));
|
|
99
|
+
else {
|
|
100
|
+
currentToken.push(currentChar);
|
|
110
101
|
}
|
|
111
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
112
|
-
if (records.length > 1) {
|
|
113
|
-
throw new core_1.SfError('DataRecordGetMultipleRecords',
|
|
114
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
115
|
-
messages.getMessage('DataRecordGetMultipleRecords', [where, this.flags.sobjecttype, records.length]));
|
|
116
|
-
}
|
|
117
|
-
return this.normalize(records);
|
|
118
|
-
}
|
|
119
|
-
stringToDictionary(str) {
|
|
120
|
-
const keyValuePairs = this.parseKeyValueSequence(str);
|
|
121
|
-
return this.transformKeyValueSequence(keyValuePairs);
|
|
122
102
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
// get back a single SaveResult. Nevertheless, we ensure that it's a
|
|
127
|
-
// single SaveResult to make Typescript happy
|
|
128
|
-
return Array.isArray(results) ? results[0] : results;
|
|
103
|
+
// For the case of only one key=value pair with no separator
|
|
104
|
+
if (currentToken.length > 0) {
|
|
105
|
+
keyValuePairs.push(currentToken.join(''));
|
|
129
106
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
* If you repeat the key, it replaces the value with the subsequent value.
|
|
146
|
-
*
|
|
147
|
-
* @param [keyValuePairs] - The list of key=value pair strings.
|
|
148
|
-
*/
|
|
149
|
-
transformKeyValueSequence(keyValuePairs) {
|
|
150
|
-
const constructedObject = {};
|
|
151
|
-
keyValuePairs.forEach((pair) => {
|
|
152
|
-
// Look for the *first* '=' and splits there, ignores any subsequent '=' for this pair
|
|
153
|
-
const eqPosition = pair.indexOf('=');
|
|
154
|
-
if (eqPosition === -1) {
|
|
155
|
-
throw new Error(messages.getMessage('TextUtilMalformedKeyValuePair', [pair]));
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
const key = pair.substr(0, eqPosition);
|
|
159
|
-
if (pair.includes('{') && pair.includes('}')) {
|
|
160
|
-
try {
|
|
161
|
-
constructedObject[key] = JSON.parse(pair.substr(eqPosition + 1));
|
|
162
|
-
}
|
|
163
|
-
catch {
|
|
164
|
-
// the data contained { and }, but wasn't valid JSON, default to parsing as-is
|
|
165
|
-
constructedObject[key] = this.convertToBooleanIfApplicable(pair.substr(eqPosition + 1));
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
constructedObject[key] = this.convertToBooleanIfApplicable(pair.substr(eqPosition + 1));
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
return constructedObject;
|
|
174
|
-
}
|
|
175
|
-
convertToBooleanIfApplicable(input) {
|
|
176
|
-
if (input.trim().toLowerCase() === 'false')
|
|
177
|
-
return false;
|
|
178
|
-
if (input.trim().toLowerCase() === 'true')
|
|
179
|
-
return true;
|
|
180
|
-
return input;
|
|
107
|
+
return keyValuePairs;
|
|
108
|
+
};
|
|
109
|
+
const stringToDictionary = (str) => {
|
|
110
|
+
const keyValuePairs = parseKeyValueSequence(str);
|
|
111
|
+
return transformKeyValueSequence(keyValuePairs);
|
|
112
|
+
};
|
|
113
|
+
exports.stringToDictionary = stringToDictionary;
|
|
114
|
+
const collectErrorMessages = (result) => result.success === false ? ['\nErrors:', ...result.errors.map((err) => ` ${err.message}`)].join('\n') : '';
|
|
115
|
+
exports.collectErrorMessages = collectErrorMessages;
|
|
116
|
+
const query = async (conn, objectType, where) => {
|
|
117
|
+
const queryObject = (0, exports.stringToDictionary)(where);
|
|
118
|
+
const sobject = conn.sobject(objectType);
|
|
119
|
+
const records = await sobject.find(queryObject, 'id');
|
|
120
|
+
if (!records || records.length === 0) {
|
|
121
|
+
throw new core_1.SfError(messages.getMessage('DataRecordGetNoRecord'), 'DataRecordGetNoRecord');
|
|
181
122
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
* into a list of key=value pairs, paying attention to quoted whitespace.
|
|
185
|
-
*
|
|
186
|
-
* This is NOT a full push down-automaton so do NOT expect full error handling/recovery.
|
|
187
|
-
*
|
|
188
|
-
* @param {string} text - The sequence to split
|
|
189
|
-
*/
|
|
190
|
-
parseKeyValueSequence(text) {
|
|
191
|
-
const separator = /\s/;
|
|
192
|
-
let inSingleQuote = false;
|
|
193
|
-
let inDoubleQuote = false;
|
|
194
|
-
let currentToken = [];
|
|
195
|
-
const keyValuePairs = [];
|
|
196
|
-
const trimmedText = text.trim();
|
|
197
|
-
const singleQuoteCount = (trimmedText.match(/'/g) || []).length;
|
|
198
|
-
const doubleQuoteCount = (trimmedText.match(/"/g) || []).length;
|
|
199
|
-
for (const currentChar of trimmedText) {
|
|
200
|
-
const isSeparator = separator.test(currentChar);
|
|
201
|
-
if (currentChar === "'" && !inDoubleQuote && singleQuoteCount >= 2) {
|
|
202
|
-
inSingleQuote = !inSingleQuote;
|
|
203
|
-
continue;
|
|
204
|
-
}
|
|
205
|
-
else if (currentChar === '"' && !inSingleQuote && doubleQuoteCount >= 2) {
|
|
206
|
-
inDoubleQuote = !inDoubleQuote;
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
if (!inSingleQuote && !inDoubleQuote && isSeparator) {
|
|
210
|
-
if (currentToken.length > 0) {
|
|
211
|
-
keyValuePairs.push(currentToken.join(''));
|
|
212
|
-
currentToken = [];
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
currentToken.push(currentChar);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
// For the case of only one key=value pair with no separator
|
|
220
|
-
if (currentToken.length > 0) {
|
|
221
|
-
keyValuePairs.push(currentToken.join(''));
|
|
222
|
-
}
|
|
223
|
-
return keyValuePairs;
|
|
123
|
+
if (records.length > 1) {
|
|
124
|
+
throw new core_1.SfError(messages.getMessage('DataRecordGetMultipleRecords', [where, objectType, records.length]), 'DataRecordGetMultipleRecords');
|
|
224
125
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
126
|
+
return records[0];
|
|
127
|
+
};
|
|
128
|
+
exports.query = query;
|
|
228
129
|
//# sourceMappingURL=dataCommand.js.map
|
package/lib/dataCommand.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataCommand.js","sourceRoot":"","sources":["../src/dataCommand.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"dataCommand.js","sourceRoot":"","sources":["../src/dataCommand.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2CAAiE;AAGjE,sCAAoC;AACpC,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,UAAU,CAAC,CAAC;AAEvE,MAAM,eAAe,GAAG,CAAC,GAA4B,EAAE,WAAW,GAAG,CAAC,EAAQ,EAAE;IACrF,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACtC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC3C,IAAI,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACxC,YAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC;YAChC,IAAA,uBAAe,EAAC,KAAgC,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC;SACpE;aAAM;YACL,YAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,KAAK,KAAe,EAAE,CAAC,CAAC;SACpD;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAVW,QAAA,eAAe,mBAU1B;AACF;;;;;GAKG;AACH,MAAM,yBAAyB,GAAG,CAChC,aAAuB,EACqC,EAAE;IAC9D,MAAM,iBAAiB,GAA+D,EAAE,C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cAAO,CACf,QAAQ,CAAC,UAAU,CAAC,8BAA8B,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,EACxF,8BAA8B,CAC/B,CAAC;KACH;IACD,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC;AAnBW,QAAA,KAAK,SAmBhB"}
|
|
@@ -13,12 +13,8 @@ var FieldType;
|
|
|
13
13
|
FieldType[FieldType["subqueryField"] = 1] = "subqueryField";
|
|
14
14
|
FieldType[FieldType["functionField"] = 2] = "functionField";
|
|
15
15
|
})(FieldType = exports.FieldType || (exports.FieldType = {}));
|
|
16
|
-
const hasNestedRecords = (element) =>
|
|
17
|
-
return Array.isArray(element?.records);
|
|
18
|
-
};
|
|
16
|
+
const hasNestedRecords = (element) => Array.isArray(element?.records);
|
|
19
17
|
exports.hasNestedRecords = hasNestedRecords;
|
|
20
|
-
const isAttributesElement = (element) =>
|
|
21
|
-
return (!!element.referenceId && !!element.type);
|
|
22
|
-
};
|
|
18
|
+
const isAttributesElement = (element) => !!element.referenceId && !!element.type;
|
|
23
19
|
exports.isAttributesElement = isAttributesElement;
|
|
24
20
|
//# sourceMappingURL=dataSoqlQueryTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataSoqlQueryTypes.js","sourceRoot":"","sources":["../src/dataSoqlQueryTypes.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAKH,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,2CAAK,CAAA;IACL,2DAAa,CAAA;IACb,2DAAa,CAAA;AACf,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB;AAoDM,MAAM,gBAAgB,GAAG,CAAI,OAAmC,EAA+B,EAAE
|
|
1
|
+
{"version":3,"file":"dataSoqlQueryTypes.js","sourceRoot":"","sources":["../src/dataSoqlQueryTypes.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAKH,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,2CAAK,CAAA;IACL,2DAAa,CAAA;IACb,2DAAa,CAAA;AACf,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB;AAoDM,MAAM,gBAAgB,GAAG,CAAI,OAAmC,EAA+B,EAAE,CACtG,KAAK,CAAC,OAAO,CAAE,OAA4B,EAAE,OAAO,CAAC,CAAC;AAD3C,QAAA,gBAAgB,oBAC2B;AAEjD,MAAM,mBAAmB,GAAG,CACjC,OAAiD,EACN,EAAE,CAC7C,CAAC,CAAE,OAA0C,CAAC,WAAW,IAAI,CAAC,CAAE,OAA0C,CAAC,IAAI,CAAC;AAHrG,QAAA,mBAAmB,uBAGkF"}
|
package/lib/flags.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.orgFlags = exports.perflogFlag = 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 core_1 = require("@salesforce/core");
|
|
11
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
13
|
+
const messages = core_1.Messages.load('@salesforce/plugin-data', 'messages', ['perfLogLevelOption', 'perfLogLevelOptionLong']);
|
|
14
|
+
exports.perflogFlag = sf_plugins_core_1.Flags.boolean({
|
|
15
|
+
summary: messages.getMessage('perfLogLevelOption'),
|
|
16
|
+
description: messages.getMessage('perfLogLevelOptionLong'),
|
|
17
|
+
hidden: true,
|
|
18
|
+
deprecated: {
|
|
19
|
+
version: '57',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
exports.orgFlags = {
|
|
23
|
+
'target-org': sf_plugins_core_1.requiredOrgFlagWithDeprecations,
|
|
24
|
+
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
25
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=flags.js.map
|
package/lib/flags.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAA4C;AAC5C,iEAKqC;AAErC,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,IAAI,CAAC,yBAAyB,EAAE,UAAU,EAAE,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,CAAC,CAAC;AAE3G,QAAA,WAAW,GAAG,uBAAK,CAAC,OAAO,CAAC;IACvC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;IAClD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;IAC1D,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE;QACV,OAAO,EAAE,IAAI;KACd;CACF,CAAC,CAAC;AAEU,QAAA,QAAQ,GAAG;IACtB,YAAY,EAAE,iDAA+B;IAC7C,aAAa,EAAE,mDAAiC;IAChD,QAAQ,EAAR,0BAAQ;CACT,CAAC"}
|