@salesforce/plugin-data 2.6.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -113
- package/lib/BulkBaseCommand.js +26 -26
- package/lib/BulkBaseCommand.js.map +1 -1
- package/lib/api/data/tree/exportApi.js +31 -30
- package/lib/api/data/tree/exportApi.js.map +1 -1
- package/lib/api/data/tree/importApi.js +46 -43
- package/lib/api/data/tree/importApi.js.map +1 -1
- package/lib/batcher.js +24 -17
- package/lib/batcher.js.map +1 -1
- package/lib/bulkDataRequestCache.js +21 -26
- package/lib/bulkDataRequestCache.js.map +1 -1
- package/lib/bulkOperationCommand.js +55 -57
- package/lib/bulkOperationCommand.js.map +1 -1
- package/lib/bulkUtils.js +20 -20
- package/lib/bulkUtils.js.map +1 -1
- package/lib/commands/data/create/record.js +38 -39
- package/lib/commands/data/create/record.js.map +1 -1
- package/lib/commands/data/delete/bulk.js +14 -15
- package/lib/commands/data/delete/bulk.js.map +1 -1
- package/lib/commands/data/delete/record.js +48 -49
- package/lib/commands/data/delete/record.js.map +1 -1
- package/lib/commands/data/delete/resume.js +16 -17
- package/lib/commands/data/delete/resume.js.map +1 -1
- package/lib/commands/data/export/tree.js +38 -39
- package/lib/commands/data/export/tree.js.map +1 -1
- package/lib/commands/data/get/record.js +50 -51
- package/lib/commands/data/get/record.js.map +1 -1
- package/lib/commands/data/import/tree.js +45 -46
- package/lib/commands/data/import/tree.js.map +1 -1
- package/lib/commands/data/query/resume.js +40 -42
- package/lib/commands/data/query/resume.js.map +1 -1
- package/lib/commands/data/query.js +91 -93
- package/lib/commands/data/query.js.map +1 -1
- package/lib/commands/data/resume.js +45 -40
- package/lib/commands/data/resume.js.map +1 -1
- package/lib/commands/data/update/record.js +61 -62
- package/lib/commands/data/update/record.js.map +1 -1
- package/lib/commands/data/upsert/bulk.js +24 -25
- package/lib/commands/data/upsert/bulk.js.map +1 -1
- package/lib/commands/data/upsert/resume.js +15 -16
- package/lib/commands/data/upsert/resume.js.map +1 -1
- package/lib/commands/force/data/bulk/delete.js +42 -43
- package/lib/commands/force/data/bulk/delete.js.map +1 -1
- package/lib/commands/force/data/bulk/status.js +40 -35
- package/lib/commands/force/data/bulk/status.js.map +1 -1
- package/lib/commands/force/data/bulk/upsert.js +54 -55
- package/lib/commands/force/data/bulk/upsert.js.map +1 -1
- package/lib/dataCommand.js +16 -21
- package/lib/dataCommand.js.map +1 -1
- package/lib/dataSoqlQueryTypes.js +4 -9
- package/lib/dataSoqlQueryTypes.js.map +1 -1
- package/lib/flags.js +12 -13
- package/lib/flags.js.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/queryUtils.js +8 -13
- package/lib/queryUtils.js.map +1 -1
- package/lib/reporters.js +52 -59
- package/lib/reporters.js.map +1 -1
- package/lib/resumeBulkCommand.js +37 -39
- package/lib/resumeBulkCommand.js.map +1 -1
- package/lib/types.js +1 -2
- package/oclif.lock +8086 -0
- package/oclif.manifest.json +1664 -904
- package/package.json +33 -50
|
@@ -1,19 +1,55 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
import { dirname } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
10
|
+
import { toAnyJson } from '@salesforce/ts-types';
|
|
11
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
12
|
+
import { orgFlags, perflogFlag } from '../../../flags.js';
|
|
13
|
+
import { query, logNestedObject } from '../../../dataCommand.js';
|
|
14
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
15
|
+
const messages = Messages.loadMessages('@salesforce/plugin-data', 'record.get');
|
|
16
|
+
export default class Get extends SfCommand {
|
|
17
|
+
static summary = messages.getMessage('summary');
|
|
18
|
+
static description = messages.getMessage('description');
|
|
19
|
+
static examples = messages.getMessages('examples');
|
|
20
|
+
static aliases = ['force:data:record:get'];
|
|
21
|
+
static deprecateAliases = true;
|
|
22
|
+
static flags = {
|
|
23
|
+
...orgFlags,
|
|
24
|
+
sobject: Flags.string({
|
|
25
|
+
char: 's',
|
|
26
|
+
required: true,
|
|
27
|
+
summary: messages.getMessage('flags.sobject.summary'),
|
|
28
|
+
aliases: ['sobjecttype'],
|
|
29
|
+
deprecateAliases: true,
|
|
30
|
+
}),
|
|
31
|
+
// eslint-disable-next-line sf-plugin/id-flag-suggestions
|
|
32
|
+
'record-id': Flags.salesforceId({
|
|
33
|
+
length: 'both',
|
|
34
|
+
char: 'i',
|
|
35
|
+
summary: messages.getMessage('flags.record-id.summary'),
|
|
36
|
+
exactlyOne: ['where', 'record-id'],
|
|
37
|
+
aliases: ['sobjectid'],
|
|
38
|
+
deprecateAliases: true,
|
|
39
|
+
}),
|
|
40
|
+
where: Flags.string({
|
|
41
|
+
char: 'w',
|
|
42
|
+
summary: messages.getMessage('flags.where.summary'),
|
|
43
|
+
exactlyOne: ['where', 'record-id'],
|
|
44
|
+
}),
|
|
45
|
+
'use-tooling-api': Flags.boolean({
|
|
46
|
+
char: 't',
|
|
47
|
+
summary: messages.getMessage('flags.use-tooling-api.summary'),
|
|
48
|
+
aliases: ['usetoolingapi'],
|
|
49
|
+
deprecateAliases: true,
|
|
50
|
+
}),
|
|
51
|
+
perflog: perflogFlag,
|
|
52
|
+
};
|
|
17
53
|
async run() {
|
|
18
54
|
const { flags } = await this.parse(Get);
|
|
19
55
|
this.spinner.start('Getting Record');
|
|
@@ -21,55 +57,18 @@ class Get extends sf_plugins_core_1.SfCommand {
|
|
|
21
57
|
? flags['target-org'].getConnection(flags['api-version']).tooling
|
|
22
58
|
: flags['target-org'].getConnection(flags['api-version']);
|
|
23
59
|
try {
|
|
24
|
-
const sObjectId = flags['record-id'] ?? (await
|
|
60
|
+
const sObjectId = flags['record-id'] ?? (await query(conn, flags.sobject, flags.where)).Id;
|
|
25
61
|
const result = await conn.sobject(flags.sobject).retrieve(sObjectId);
|
|
26
62
|
if (!this.jsonEnabled()) {
|
|
27
|
-
|
|
63
|
+
logNestedObject(result);
|
|
28
64
|
}
|
|
29
65
|
this.spinner.stop();
|
|
30
|
-
return
|
|
66
|
+
return toAnyJson(result);
|
|
31
67
|
}
|
|
32
68
|
catch (err) {
|
|
33
69
|
this.spinner.stop('failed');
|
|
34
|
-
throw new
|
|
70
|
+
throw new SfError(err.message, err.name);
|
|
35
71
|
}
|
|
36
72
|
}
|
|
37
73
|
}
|
|
38
|
-
Get.summary = messages.getMessage('summary');
|
|
39
|
-
Get.description = messages.getMessage('description');
|
|
40
|
-
Get.examples = messages.getMessages('examples');
|
|
41
|
-
Get.aliases = ['force:data:record:get'];
|
|
42
|
-
Get.deprecateAliases = true;
|
|
43
|
-
Get.flags = {
|
|
44
|
-
...flags_1.orgFlags,
|
|
45
|
-
sobject: sf_plugins_core_1.Flags.string({
|
|
46
|
-
char: 's',
|
|
47
|
-
required: true,
|
|
48
|
-
summary: messages.getMessage('flags.sobject.summary'),
|
|
49
|
-
aliases: ['sobjecttype'],
|
|
50
|
-
deprecateAliases: true,
|
|
51
|
-
}),
|
|
52
|
-
// eslint-disable-next-line sf-plugin/id-flag-suggestions
|
|
53
|
-
'record-id': sf_plugins_core_1.Flags.salesforceId({
|
|
54
|
-
length: 'both',
|
|
55
|
-
char: 'i',
|
|
56
|
-
summary: messages.getMessage('flags.record-id.summary'),
|
|
57
|
-
exactlyOne: ['where', 'record-id'],
|
|
58
|
-
aliases: ['sobjectid'],
|
|
59
|
-
deprecateAliases: true,
|
|
60
|
-
}),
|
|
61
|
-
where: sf_plugins_core_1.Flags.string({
|
|
62
|
-
char: 'w',
|
|
63
|
-
summary: messages.getMessage('flags.where.summary'),
|
|
64
|
-
exactlyOne: ['where', 'record-id'],
|
|
65
|
-
}),
|
|
66
|
-
'use-tooling-api': sf_plugins_core_1.Flags.boolean({
|
|
67
|
-
char: 't',
|
|
68
|
-
summary: messages.getMessage('flags.use-tooling-api.summary'),
|
|
69
|
-
aliases: ['usetoolingapi'],
|
|
70
|
-
deprecateAliases: true,
|
|
71
|
-
}),
|
|
72
|
-
perflog: flags_1.perflogFlag,
|
|
73
|
-
};
|
|
74
|
-
exports.default = Get;
|
|
75
74
|
//# sourceMappingURL=record.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../../src/commands/data/get/record.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../../src/commands/data/get/record.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEjE,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAA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"}
|
|
@@ -1,25 +1,58 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
import { dirname } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { Messages } from '@salesforce/core';
|
|
10
|
+
import { getString } from '@salesforce/ts-types';
|
|
11
|
+
import { SfCommand, Flags, arrayWithDeprecation } from '@salesforce/sf-plugins-core';
|
|
12
|
+
import { ImportApi } from '../../../api/data/tree/importApi.js';
|
|
13
|
+
import { orgFlags } from '../../../flags.js';
|
|
14
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
15
|
+
const messages = Messages.loadMessages('@salesforce/plugin-data', 'tree.import');
|
|
16
16
|
/**
|
|
17
17
|
* Command that provides data import capability via the SObject Tree Save API.
|
|
18
18
|
*/
|
|
19
|
-
class Import extends
|
|
19
|
+
export default class Import extends SfCommand {
|
|
20
|
+
static summary = messages.getMessage('summary');
|
|
21
|
+
static description = messages.getMessage('description');
|
|
22
|
+
static examples = messages.getMessages('examples');
|
|
23
|
+
static aliases = ['force:data:tree:import'];
|
|
24
|
+
static deprecateAliases = true;
|
|
25
|
+
static flags = {
|
|
26
|
+
...orgFlags,
|
|
27
|
+
files: arrayWithDeprecation({
|
|
28
|
+
char: 'f',
|
|
29
|
+
summary: messages.getMessage('flags.files.summary'),
|
|
30
|
+
exclusive: ['plan'],
|
|
31
|
+
aliases: ['sobjecttreefiles'],
|
|
32
|
+
deprecateAliases: true,
|
|
33
|
+
}),
|
|
34
|
+
plan: Flags.file({
|
|
35
|
+
char: 'p',
|
|
36
|
+
summary: messages.getMessage('flags.plan.summary'),
|
|
37
|
+
exists: true,
|
|
38
|
+
}),
|
|
39
|
+
'content-type': Flags.string({
|
|
40
|
+
char: 'c',
|
|
41
|
+
summary: messages.getMessage('flags.content-type.summary'),
|
|
42
|
+
hidden: true,
|
|
43
|
+
aliases: ['contenttype'],
|
|
44
|
+
deprecateAliases: true,
|
|
45
|
+
}),
|
|
46
|
+
// displays the schema for a data import plan
|
|
47
|
+
'config-help': Flags.boolean({
|
|
48
|
+
summary: messages.getMessage('flags.config-help.summary'),
|
|
49
|
+
aliases: ['confighelp'],
|
|
50
|
+
deprecateAliases: true,
|
|
51
|
+
}),
|
|
52
|
+
};
|
|
20
53
|
async run() {
|
|
21
54
|
const { flags } = await this.parse(Import);
|
|
22
|
-
const importApi = new
|
|
55
|
+
const importApi = new ImportApi(flags['target-org'], this.config.bin, this.config.pjson.oclif.topicSeparator ?? ':');
|
|
23
56
|
if (flags['config-help']) {
|
|
24
57
|
// Display config help and return
|
|
25
58
|
const schema = importApi.getSchema();
|
|
@@ -33,7 +66,7 @@ class Import extends sf_plugins_core_1.SfCommand {
|
|
|
33
66
|
};
|
|
34
67
|
const importResults = await importApi.import(importConfig);
|
|
35
68
|
const processedResult = (importResults.responseRefs ?? []).map((ref) => {
|
|
36
|
-
const type =
|
|
69
|
+
const type = getString(importResults.sobjectTypes, ref.referenceId, 'Unknown');
|
|
37
70
|
return { refId: ref.referenceId, type, id: ref.id };
|
|
38
71
|
});
|
|
39
72
|
this.styledHeader('Import Results');
|
|
@@ -45,38 +78,4 @@ class Import extends sf_plugins_core_1.SfCommand {
|
|
|
45
78
|
return processedResult;
|
|
46
79
|
}
|
|
47
80
|
}
|
|
48
|
-
Import.summary = messages.getMessage('summary');
|
|
49
|
-
Import.description = messages.getMessage('description');
|
|
50
|
-
Import.examples = messages.getMessages('examples');
|
|
51
|
-
Import.aliases = ['force:data:tree:import'];
|
|
52
|
-
Import.deprecateAliases = true;
|
|
53
|
-
Import.flags = {
|
|
54
|
-
...flags_1.orgFlags,
|
|
55
|
-
files: (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
56
|
-
char: 'f',
|
|
57
|
-
summary: messages.getMessage('flags.files.summary'),
|
|
58
|
-
exclusive: ['plan'],
|
|
59
|
-
aliases: ['sobjecttreefiles'],
|
|
60
|
-
deprecateAliases: true,
|
|
61
|
-
}),
|
|
62
|
-
plan: sf_plugins_core_1.Flags.file({
|
|
63
|
-
char: 'p',
|
|
64
|
-
summary: messages.getMessage('flags.plan.summary'),
|
|
65
|
-
exists: true,
|
|
66
|
-
}),
|
|
67
|
-
'content-type': sf_plugins_core_1.Flags.string({
|
|
68
|
-
char: 'c',
|
|
69
|
-
summary: messages.getMessage('flags.content-type.summary'),
|
|
70
|
-
hidden: true,
|
|
71
|
-
aliases: ['contenttype'],
|
|
72
|
-
deprecateAliases: true,
|
|
73
|
-
}),
|
|
74
|
-
// displays the schema for a data import plan
|
|
75
|
-
'config-help': sf_plugins_core_1.Flags.boolean({
|
|
76
|
-
summary: messages.getMessage('flags.config-help.summary'),
|
|
77
|
-
aliases: ['confighelp'],
|
|
78
|
-
deprecateAliases: true,
|
|
79
|
-
}),
|
|
80
|
-
};
|
|
81
|
-
exports.default = Import;
|
|
82
81
|
//# sourceMappingURL=tree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../../src/commands/data/import/tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../../src/commands/data/import/tree.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAW,MAAM,s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AC,CAAC,GAAG,EAAE,EAAE;YACrF,MAAM,IAAI,GAAG,SAAS,CAAC,aAAa,CAAC,YAAY,EAAE,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;YAC/E,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;QACtD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE;YAC1B,KAAK,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE;YACjC,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;YACxB,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACrB,CAAC,CAAC;QACH,OAAO,eAAe,CAAC;IACzB,CAAC"}
|
|
@@ -1,62 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BulkQueryReport = void 0;
|
|
4
1
|
/*
|
|
5
2
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
6
3
|
* All rights reserved.
|
|
7
4
|
* Licensed under the BSD 3-Clause license.
|
|
8
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
6
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
import { dirname } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { Messages } from '@salesforce/core';
|
|
10
|
+
import { QueryJobV2 } from 'jsforce/lib/api/bulk.js';
|
|
11
|
+
import { Flags, loglevel, optionalOrgFlagWithDeprecations, orgApiVersionFlagWithDeprecations, SfCommand, } from '@salesforce/sf-plugins-core';
|
|
12
|
+
import { resultFormatFlag } from '../../../flags.js';
|
|
13
|
+
import { displayResults, transformBulkResults } from '../../../queryUtils.js';
|
|
14
|
+
import { BulkQueryRequestCache } from '../../../bulkDataRequestCache.js';
|
|
15
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
16
|
+
const reportMessages = Messages.loadMessages('@salesforce/plugin-data', 'bulk.report');
|
|
18
17
|
// needed by the flags loaded from the other command
|
|
19
|
-
const queryMessages =
|
|
20
|
-
class BulkQueryReport extends
|
|
18
|
+
const queryMessages = Messages.loadMessages('@salesforce/plugin-data', 'soql.query');
|
|
19
|
+
export class BulkQueryReport extends SfCommand {
|
|
20
|
+
static summary = reportMessages.getMessage('summary');
|
|
21
|
+
static description = reportMessages.getMessage('description');
|
|
22
|
+
static examples = reportMessages.getMessages('examples');
|
|
23
|
+
static aliases = ['force:data:soql:bulk:report'];
|
|
24
|
+
static deprecateAliases = true;
|
|
25
|
+
static flags = {
|
|
26
|
+
'target-org': { ...optionalOrgFlagWithDeprecations, summary: queryMessages.getMessage('flags.targetOrg.summary') },
|
|
27
|
+
'api-version': orgApiVersionFlagWithDeprecations,
|
|
28
|
+
loglevel,
|
|
29
|
+
'result-format': resultFormatFlag,
|
|
30
|
+
'bulk-query-id': Flags.salesforceId({
|
|
31
|
+
length: 18,
|
|
32
|
+
char: 'i',
|
|
33
|
+
startsWith: '750',
|
|
34
|
+
summary: reportMessages.getMessage('flags.bulkQueryId.summary'),
|
|
35
|
+
aliases: ['bulkqueryid'],
|
|
36
|
+
deprecateAliases: true,
|
|
37
|
+
}),
|
|
38
|
+
'use-most-recent': Flags.boolean({
|
|
39
|
+
summary: reportMessages.getMessage('flags.useMostRecent.summary'),
|
|
40
|
+
exclusive: ['bulk-query-id'],
|
|
41
|
+
}),
|
|
42
|
+
};
|
|
21
43
|
async run() {
|
|
22
44
|
const { flags } = await this.parse(BulkQueryReport);
|
|
23
|
-
const cache = await
|
|
45
|
+
const cache = await BulkQueryRequestCache.create();
|
|
24
46
|
const resumeOptions = await cache.resolveResumeOptionsFromCache(flags['bulk-query-id'], flags['use-most-recent'], flags['target-org'], flags['api-version']);
|
|
25
|
-
const job = new
|
|
47
|
+
const job = new QueryJobV2({ ...resumeOptions.options, operation: 'query' });
|
|
26
48
|
job.jobInfo = resumeOptions.jobInfo;
|
|
27
49
|
const results = await job.getResults();
|
|
28
|
-
const queryResult =
|
|
50
|
+
const queryResult = transformBulkResults(results, '');
|
|
29
51
|
if (!this.jsonEnabled()) {
|
|
30
|
-
|
|
52
|
+
displayResults({ ...queryResult }, flags['result-format']);
|
|
31
53
|
}
|
|
32
54
|
if (queryResult.result.done) {
|
|
33
|
-
await
|
|
55
|
+
await BulkQueryRequestCache.unset(resumeOptions.jobInfo.id);
|
|
34
56
|
}
|
|
35
57
|
return queryResult.result;
|
|
36
58
|
}
|
|
37
59
|
}
|
|
38
|
-
exports.BulkQueryReport = BulkQueryReport;
|
|
39
|
-
BulkQueryReport.summary = reportMessages.getMessage('summary');
|
|
40
|
-
BulkQueryReport.description = reportMessages.getMessage('description');
|
|
41
|
-
BulkQueryReport.examples = reportMessages.getMessages('examples');
|
|
42
|
-
BulkQueryReport.aliases = ['force:data:soql:bulk:report'];
|
|
43
|
-
BulkQueryReport.deprecateAliases = true;
|
|
44
|
-
BulkQueryReport.flags = {
|
|
45
|
-
'target-org': { ...sf_plugins_core_1.optionalOrgFlagWithDeprecations, summary: queryMessages.getMessage('flags.targetOrg.summary') },
|
|
46
|
-
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
47
|
-
loglevel: sf_plugins_core_1.loglevel,
|
|
48
|
-
'result-format': flags_1.resultFormatFlag,
|
|
49
|
-
'bulk-query-id': sf_plugins_core_1.Flags.salesforceId({
|
|
50
|
-
length: 18,
|
|
51
|
-
char: 'i',
|
|
52
|
-
startsWith: '750',
|
|
53
|
-
summary: reportMessages.getMessage('flags.bulkQueryId.summary'),
|
|
54
|
-
aliases: ['bulkqueryid'],
|
|
55
|
-
deprecateAliases: true,
|
|
56
|
-
}),
|
|
57
|
-
'use-most-recent': sf_plugins_core_1.Flags.boolean({
|
|
58
|
-
summary: reportMessages.getMessage('flags.useMostRecent.summary'),
|
|
59
|
-
exclusive: ['bulk-query-id'],
|
|
60
|
-
}),
|
|
61
|
-
};
|
|
62
60
|
//# sourceMappingURL=resume.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resume.js","sourceRoot":"","sources":["../../../../src/commands/data/query/resume.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resume.js","sourceRoot":"","sources":["../../../../src/commands/data/query/resume.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACL,KAAK,EACL,QAAQ,EACR,+BAA+B,EAC/B,iCAAiC,EACjC,SAAS,GACV,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,MAAM,cAAc,GAAG,QAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC;AACvF,oDAAoD;AACpD,MAAM,aAAa,GAAG,QAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,YAAY,CAAC,CAAC;AAErF,MAAM,OAAO,eAAgB,SAAQ,SAAkB;IAC9C,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