sf-plugin-data 0.3.0 → 0.5.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 +34 -15
- package/docs/artifact-format.md +4 -4
- package/docs/capabilities.md +10 -10
- package/docs/git-workflow.md +5 -6
- package/docs/handover.md +32 -32
- package/lib/api.d.ts +7 -0
- package/lib/api.js +5 -1
- package/lib/commands/data360/delete.d.ts +57 -12
- package/lib/commands/data360/delete.js +191 -42
- package/lib/commands/data360/deploy.d.ts +14 -2
- package/lib/commands/data360/deploy.js +32 -20
- package/lib/commands/data360/publish.d.ts +2 -2
- package/lib/commands/data360/publish.js +14 -12
- package/lib/commands/data360/retrieve.d.ts +1 -4
- package/lib/commands/data360/retrieve.js +17 -32
- package/lib/errors/codes/calculated-insight.js +1 -1
- package/lib/errors/codes/data-graph.js +2 -2
- package/lib/errors/codes/data-stream.js +1 -1
- package/lib/errors/codes/data-transform.js +1 -1
- package/lib/errors/codes/dlo.js +1 -1
- package/lib/errors/codes/dmo.js +1 -1
- package/lib/errors/codes/general.js +6 -4
- package/lib/errors/codes/identity-resolution.js +1 -1
- package/lib/errors/codes/mapping.js +1 -1
- package/lib/errors/codes/relationship.js +1 -1
- package/lib/errors/codes/segment.js +2 -2
- package/lib/services/command-native-data-graph.js +1 -1
- package/lib/services/command-native-dmo.js +1 -1
- package/lib/services/delete-calculated-insight.js +1 -1
- package/lib/services/delete-identity-resolution.js +1 -1
- package/lib/services/delete-segment.js +1 -1
- package/lib/services/native-data-graph-crd.d.ts +2 -2
- package/lib/services/native-data-graph-crd.js +2 -2
- package/lib/services/operation-diagnostic.js +1 -1
- package/lib/services/publish-segment.d.ts +1 -1
- package/lib/services/run-delete.d.ts +43 -0
- package/lib/services/run-delete.js +111 -0
- package/lib/services/run-deploy.d.ts +51 -0
- package/lib/services/run-deploy.js +107 -0
- package/lib/services/run-options.d.ts +23 -0
- package/lib/services/run-options.js +38 -0
- package/lib/services/run-retrieve.d.ts +3 -3
- package/lib/services/run-retrieve.js +6 -2
- package/lib/transport/connect-client.d.ts +8 -0
- package/lib/transport/connect-client.js +25 -1
- package/package.json +1 -1
|
@@ -210,7 +210,7 @@ function verbatimStreamNative(response) {
|
|
|
210
210
|
export default class Retrieve extends SfCommand {
|
|
211
211
|
static aliases = ['datacloud:retrieve', 'd360:retrieve', 'dc:retrieve'];
|
|
212
212
|
static summary = 'Retrieve any mix of Data360 DLOs, DMOs, mappings, relationships, data streams, data transforms, data graphs, Segments, calculated insights and identity resolution configuration.';
|
|
213
|
-
static description = 'Any mix of selectors is retrieved in one run with one result: every selector is checked before the org is read, and a refused selector blocks the whole run (with several families selected, the refusal names its family). The families are then read one after another (DLO, DMO, mapping, relationship, Segment, calculated insight and identity resolution first, then data streams, data transforms and data graphs), each with its own API version and data space rules; one family failing does not stop the others. Exact -m data-transform:Name retrieves a transform (custom, system or packaged) at API68 in the run data space (c__dataSpace: its dataSpaceName or, without one, the data space of its MktDataTransform record read with SOQL; one without any data space is handled in default only; another data space is TRANSFORM_DATASPACE_MISMATCH, never a verbatim file) into data360/dataTransforms/<Name>.dataTransform.json: its create/update input as Salesforce returns it (definition or definitions, fullRunFrequency, write mode and the rest as read), without server-owned output object fields, plus its schedule projected onto the keys the schedule PUT takes (no schedule key when the transform has none, so a deploy of the file leaves the schedule alone; also left out, with a warning, when the schedule read fails). A transform with both definition and definitions is written as-is (verbatim), and deploy refuses that file. Bare -m data-transform retrieves every transform of the run data space the API lists (kept by the dataSpaceName of each entry, or its MktDataTransform record for an entry without one), each through the same path; one failing transform never blocks the others. Exact -m data-stream:ApiName retrieves an Ingestion API stream (any refresh mode and DLO category) as portable JSON using native API68 reads, when its DLO belongs to the run data space (the file lists every data space of the DLO in c__dataSpace); a stream of any other connector (for example Salesforce CRM, SalesforceDotCom) is written as its GET without server-owned keys and the system fields and mappings Salesforce adds, formulas decoded. Bare -m data-stream retrieves every stream the API lists (unless its DLO names only other data spaces), each through the same path. Native DLO, DMO and mapping retrieval writes canonical JSON under data360/<type>, retaining definition fields without source record IDs. A DLO file lists every data space the DLO belongs to in its top-level c__dataSpace key; the DLOs of the run data space are retrieved. Every retrieve first checks that the org has the run data space (one GET /ssot/data-spaces; UNKNOWN_DATASPACE otherwise). Default/auto uses API68; explicit numeric versions >=61 are preserved, and <=60 is rejected before calls. Omit -m to retrieve every family (dlo, dmo, mapping, relationship, data-stream, data-transform, data-graph, segment, identity-resolution and calculated-insight), each as if named bare, in the run data space; -m narrows the run to the families and names it lists. Families fixed at API68 (for example data graphs, Segments, calculated insights and identity resolution) refuse another explicit --api-version, which blocks a run without -m; to pin an older native version, name the native families with -m. Use -m dlo, -m dmo or -m mapping for complete type inventory, or repeat type:ApiName for exact selections. Omitted selectors and -m dlo (also beside other families) retrieve every DLO the Data 360 API lists in the data space, connector- and stream-created ones included; a DLO whose read or file fails gets its own diagnostic and the others are still retrieved. Mapping JSON uses the native APIs; only its label (spec.label) is read with the Metadata API (readMetadata of ObjectSourceTargetMap, up to 10 names per call), left out when it equals the mapping name (the default) and, with a warning, when that read fails. DMOs retrieved beside other families use the same native JSON at the native version. Prerequisites are checked, never pulled in; select every component to retrieve explicitly. Every DMO selection uses this native route, and --api-version latest is not accepted. Exact -m relationship:Dmo__dlm writes every relationship whose source is that DMO as native JSON under data360/relationship/<Name>.relationship-meta.json; bare -m relationship does so for every DMO the API lists, one DMO after another. Repeat -m dmo:ApiName, -m segment:ApiName, -m calculated-insight:ApiName__cio, -m data-graph:ApiName or -m identity-resolution:ExactObjectApiName for exact selection. Graph retrieval uses native API68 (auto or explicit 68.0; other versions are rejected) and writes *.native-dataGraph.json authored intent without generated identities in the run data space (c__dataSpace, and definition.dataspaceName as read; a graph of another data space is DATA_GRAPH_DATASPACE_MISMATCH, never a verbatim file); repeat data-graph:ApiName for several graphs, read one after another. Bare -m data-graph retrieves every graph of the run data space the API lists. Calculated insights use the API68 GET only (auto or 68.0, in the run data space, written to c__dataSpace): -m calculated-insight:ApiName__cio retrieves that insight and bare -m calculated-insight every insight the API lists, whatever its status, schedule or SQL; each is written as data360/calculatedInsights/<ApiName>.calculatedInsight-meta.json (the GET body as returned, without status, run history, source-CI links, creation type, sub type and the dimensions and measures Salesforce derives from the SQL) plus its SQL as plain text in <ApiName>.calculatedInsight-meta.sql. IR uses native API68 owner reads in the run data space (c__dataSpace; the file keeps the names Salesforce stores, ds2_Individual_<id> and ds2_Individual__dlm outside default; a ruleset of another data space is IDENTITY_RESOLUTION_DATASPACE_MISMATCH, never a verbatim file); auto and explicit numeric68 are supported, while numeric67 is rejected. -m identity-resolution:ExactObjectApiName retrieves that ruleset and bare -m identity-resolution every ruleset of the run data space the API lists (kept by the dataSpaceName of each entry, as the list answers every data space). Auto selects fixed qualified routes, never probes or upgrades an explicit numeric pin. Segment uses auto or 68.0 in the run data space (c__dataSpace; a segment of another data space is SEGMENT_DATASPACE_MISMATCH; the file carries the stored name, <prefix>_<Name> in a non-default data space; other versions are refused): -m segment:ApiName retrieves that segment and bare -m segment every segment of the run data space the API lists (kept by the dataSpace of each entry). A SQL (DBT) segment is written as one portable data360/segments/<Name>.segment.json with its DBT model names, and the SQL of each model as Salesforce returns it in <Name>.segment.<model>.sql beside it; a UI segment (built in the segment canvas) is written as a normal <Name>.segment.json with its criteria as JSON. Any other segment type is written with the same keys, without SQL files (a Waterfall with its child segments by API name in childSegments, named with one segment list read); the lookback and the refresh schedule are kept (schedule in the write shape; no schedule key for a segment that does not refresh), and a key the plugin does not know stays in the file and deploy refuses it. A segment with parameters (no write takes them), schedule details the plugin does not know or UI criteria that are not a JSON object is written as-is (verbatim) and deploy refuses that file. Use -m dmo or omit selectors for existing DMO inventory. Unsupported objects produce per-object diagnostics while successful files are retained: the run is partial (exit 68) when some files were written, otherwise exit 1.
|
|
213
|
+
static description = 'Any mix of selectors is retrieved in one run with one result: every selector is checked before the org is read, and a refused selector blocks the whole run (with several families selected, the refusal names its family). The families are then read one after another (DLO, DMO, mapping, relationship, Segment, calculated insight and identity resolution first, then data streams, data transforms and data graphs), each with its own API version and data space rules; one family failing does not stop the others. Exact -m data-transform:Name retrieves a transform (custom, system or packaged) at API68 in the run data space (c__dataSpace: its dataSpaceName or, without one, the data space of its MktDataTransform record read with SOQL; one without any data space is handled in default only; another data space is TRANSFORM_DATASPACE_MISMATCH, never a verbatim file) into data360/dataTransforms/<Name>.dataTransform.json: its create/update input as Salesforce returns it (definition or definitions, fullRunFrequency, write mode and the rest as read), without server-owned output object fields, plus its schedule projected onto the keys the schedule PUT takes (no schedule key when the transform has none, so a deploy of the file leaves the schedule alone; also left out, with a warning, when the schedule read fails). A transform with both definition and definitions is written as-is (verbatim), and deploy refuses that file. Bare -m data-transform retrieves every transform of the run data space the API lists (kept by the dataSpaceName of each entry, or its MktDataTransform record for an entry without one), each through the same path; one failing transform never blocks the others. Exact -m data-stream:ApiName retrieves an Ingestion API stream (any refresh mode and DLO category) as portable JSON using native API68 reads, when its DLO belongs to the run data space (the file lists every data space of the DLO in c__dataSpace); a stream of any other connector (for example Salesforce CRM, SalesforceDotCom) is written as its GET without server-owned keys and the system fields and mappings Salesforce adds, formulas decoded. Bare -m data-stream retrieves every stream the API lists (unless its DLO names only other data spaces), each through the same path. Native DLO, DMO and mapping retrieval writes canonical JSON under data360/<type>, retaining definition fields without source record IDs. A DLO file lists every data space the DLO belongs to in its top-level c__dataSpace key; the DLOs of the run data space are retrieved. Every retrieve first checks that the org has the run data space (one GET /ssot/data-spaces; UNKNOWN_DATASPACE otherwise). Default/auto uses API68; explicit numeric versions >=61 are preserved, and <=60 is rejected before calls. Omit -m to retrieve every family (dlo, dmo, mapping, relationship, data-stream, data-transform, data-graph, segment, identity-resolution and calculated-insight), each as if named bare, in the run data space; -m narrows the run to the families and names it lists. Families fixed at API68 (for example data graphs, Segments, calculated insights and identity resolution) refuse another explicit --api-version, which blocks a run without -m; to pin an older native version, name the native families with -m. Use -m dlo, -m dmo or -m mapping for complete type inventory, or repeat type:ApiName for exact selections. Omitted selectors and -m dlo (also beside other families) retrieve every DLO the Data 360 API lists in the data space, connector- and stream-created ones included; a DLO whose read or file fails gets its own diagnostic and the others are still retrieved. Mapping JSON uses the native APIs; only its label (spec.label) is read with the Metadata API (readMetadata of ObjectSourceTargetMap, up to 10 names per call), left out when it equals the mapping name (the default) and, with a warning, when that read fails. DMOs retrieved beside other families use the same native JSON at the native version. Prerequisites are checked, never pulled in; select every component to retrieve explicitly. Every DMO selection uses this native route, and --api-version latest is not accepted. Exact -m relationship:Dmo__dlm writes every relationship whose source is that DMO as native JSON under data360/relationship/<Name>.relationship-meta.json; bare -m relationship does so for every DMO the API lists, one DMO after another. Repeat -m dmo:ApiName, -m segment:ApiName, -m calculated-insight:ApiName__cio, -m data-graph:ApiName or -m identity-resolution:ExactObjectApiName for exact selection. Graph retrieval uses native API68 (auto or explicit 68.0; other versions are rejected) and writes *.native-dataGraph.json authored intent without generated identities in the run data space (c__dataSpace, and definition.dataspaceName as read; a graph of another data space is DATA_GRAPH_DATASPACE_MISMATCH, never a verbatim file); repeat data-graph:ApiName for several graphs, read one after another. Bare -m data-graph retrieves every graph of the run data space the API lists. Calculated insights use the API68 GET only (auto or 68.0, in the run data space, written to c__dataSpace): -m calculated-insight:ApiName__cio retrieves that insight and bare -m calculated-insight every insight the API lists, whatever its status, schedule or SQL; each is written as data360/calculatedInsights/<ApiName>.calculatedInsight-meta.json (the GET body as returned, without status, run history, source-CI links, creation type, sub type and the dimensions and measures Salesforce derives from the SQL) plus its SQL as plain text in <ApiName>.calculatedInsight-meta.sql. IR uses native API68 owner reads in the run data space (c__dataSpace; the file keeps the names Salesforce stores, ds2_Individual_<id> and ds2_Individual__dlm outside default; a ruleset of another data space is IDENTITY_RESOLUTION_DATASPACE_MISMATCH, never a verbatim file); auto and explicit numeric68 are supported, while numeric67 is rejected. -m identity-resolution:ExactObjectApiName retrieves that ruleset and bare -m identity-resolution every ruleset of the run data space the API lists (kept by the dataSpaceName of each entry, as the list answers every data space). Auto selects fixed qualified routes, never probes or upgrades an explicit numeric pin. Segment uses auto or 68.0 in the run data space (c__dataSpace; a segment of another data space is SEGMENT_DATASPACE_MISMATCH; the file carries the stored name, <prefix>_<Name> in a non-default data space; other versions are refused): -m segment:ApiName retrieves that segment and bare -m segment every segment of the run data space the API lists (kept by the dataSpace of each entry). A SQL (DBT) segment is written as one portable data360/segments/<Name>.segment.json with its DBT model names, and the SQL of each model as Salesforce returns it in <Name>.segment.<model>.sql beside it; a UI segment (built in the segment canvas) is written as a normal <Name>.segment.json with its criteria as JSON. Any other segment type is written with the same keys, without SQL files (a Waterfall with its child segments by API name in childSegments, named with one segment list read); the lookback and the refresh schedule are kept (schedule in the write shape; no schedule key for a segment that does not refresh), and a key the plugin does not know stays in the file and deploy refuses it. A segment with parameters (no write takes them), schedule details the plugin does not know or UI criteria that are not a JSON object is written as-is (verbatim) and deploy refuses that file. Use -m dmo or omit selectors for existing DMO inventory. Unsupported objects produce per-object diagnostics while successful files are retained: the run is partial (exit 68) when some files were written, otherwise exit 1. A file whose bytes differ is replaced; identical bytes are unchanged. Retrieval never mutates the org.';
|
|
214
214
|
static examples = [
|
|
215
215
|
'Retrieve every family of the default data space:\n<%= config.bin %> <%= command.id %> --target-org my-org',
|
|
216
216
|
'Retrieve every family of another data space:\n<%= config.bin %> <%= command.id %> --target-org my-org --dataspace marketing',
|
|
@@ -237,15 +237,9 @@ export default class Retrieve extends SfCommand {
|
|
|
237
237
|
summary: 'Repeat to mix families in one run. Native dlo/dmo/mapping type or type:ApiName JSON selections; bare dlo is every DLO the API lists; omitted selects every family below, each bare. relationship:Dmo__dlm (relationships whose source is that DMO), data-stream:ApiName, data-transform:Name, data-graph:ApiName, segment:ApiName, identity-resolution:ExactObjectApiName and calculated-insight:ApiName__cio, or the bare family name for every one the API lists (bare relationship: those of every listed DMO).',
|
|
238
238
|
}),
|
|
239
239
|
'output-dir': Flags.directory({
|
|
240
|
-
char: 'd',
|
|
241
240
|
exists: false,
|
|
242
241
|
summary: 'Project root for JSON; defaults to the current directory.',
|
|
243
242
|
}),
|
|
244
|
-
overwrite: Flags.boolean({
|
|
245
|
-
char: 'x',
|
|
246
|
-
default: false,
|
|
247
|
-
summary: 'Permit replacing differing selected files.',
|
|
248
|
-
}),
|
|
249
243
|
};
|
|
250
244
|
acquireDataTransform = retrieveDataTransform;
|
|
251
245
|
createDataTransformClient = createDataTransformClient;
|
|
@@ -480,7 +474,7 @@ export default class Retrieve extends SfCommand {
|
|
|
480
474
|
if (document === undefined)
|
|
481
475
|
return caught;
|
|
482
476
|
try {
|
|
483
|
-
const receipt = await this.documentWriter(target.kind)(document, target.root,
|
|
477
|
+
const receipt = await this.documentWriter(target.kind)(document, target.root, true);
|
|
484
478
|
const family = verbatimFamily(target.kind);
|
|
485
479
|
target.push({
|
|
486
480
|
identity: { ...target.identity },
|
|
@@ -505,10 +499,9 @@ export default class Retrieve extends SfCommand {
|
|
|
505
499
|
* @param {string} version Native API version.
|
|
506
500
|
* @param {string} effectiveScope The run's data space.
|
|
507
501
|
* @param {string} root Project root.
|
|
508
|
-
* @param {boolean} overwrite Permit replacing differing files.
|
|
509
502
|
* @returns {Promise<object>} Items, diagnostics and whether a failure was not local.
|
|
510
503
|
*/
|
|
511
|
-
async retrieveRelationshipFamily(dmoNames, connection, target, version, effectiveScope, root
|
|
504
|
+
async retrieveRelationshipFamily(dmoNames, connection, target, version, effectiveScope, root) {
|
|
512
505
|
const items = [];
|
|
513
506
|
const errors = [];
|
|
514
507
|
const warnings = [];
|
|
@@ -564,7 +557,7 @@ export default class Retrieve extends SfCommand {
|
|
|
564
557
|
];
|
|
565
558
|
for (const document of documents)
|
|
566
559
|
try {
|
|
567
|
-
const receipt = await (this.writeRelationship ?? writeNativeRelationshipDocument)(document, root,
|
|
560
|
+
const receipt = await (this.writeRelationship ?? writeNativeRelationshipDocument)(document, root, true);
|
|
568
561
|
items.push({
|
|
569
562
|
identity: reportedIdentity(document, effectiveScope),
|
|
570
563
|
operation: 'retrieve',
|
|
@@ -582,7 +575,6 @@ export default class Retrieve extends SfCommand {
|
|
|
582
575
|
identity: reportedIdentity(document, effectiveScope),
|
|
583
576
|
routes,
|
|
584
577
|
root,
|
|
585
|
-
overwrite,
|
|
586
578
|
warnings,
|
|
587
579
|
push: (item) => items.push(item),
|
|
588
580
|
});
|
|
@@ -681,7 +673,7 @@ export default class Retrieve extends SfCommand {
|
|
|
681
673
|
// A transform of another data space is an item failure; nothing is written.
|
|
682
674
|
if (observed.document.c__dataSpace !== effectiveScope)
|
|
683
675
|
throw dataTransformSpaceMismatch(apiName, observed.document.c__dataSpace, effectiveScope);
|
|
684
|
-
const receipt = await this.writeDataTransform(observed.document, outputDirectory,
|
|
676
|
+
const receipt = await this.writeDataTransform(observed.document, outputDirectory, true);
|
|
685
677
|
envelope.result.items.push({
|
|
686
678
|
identity: { dataSpace: effectiveScope, apiName },
|
|
687
679
|
operation: 'retrieve',
|
|
@@ -697,7 +689,6 @@ export default class Retrieve extends SfCommand {
|
|
|
697
689
|
identity: { dataSpace: effectiveScope, apiName },
|
|
698
690
|
routes,
|
|
699
691
|
root: outputDirectory,
|
|
700
|
-
overwrite: flags.overwrite,
|
|
701
692
|
warnings: envelope.diagnostics.warnings,
|
|
702
693
|
push: (item) => envelope.result.items.push(item),
|
|
703
694
|
});
|
|
@@ -790,7 +781,7 @@ export default class Retrieve extends SfCommand {
|
|
|
790
781
|
const reads = recordNativeReads(clients.streams, verbatimStreamNative);
|
|
791
782
|
nativeOf = reads.nativeOf;
|
|
792
783
|
const document = await this.acquireDataStream(apiName, clients.streams ? { ...clients, streams: reads.client } : clients, effectiveScope, false, 'retrieve');
|
|
793
|
-
const receipt = await this.writeDataStream(document, outputDirectory,
|
|
784
|
+
const receipt = await this.writeDataStream(document, outputDirectory, true);
|
|
794
785
|
envelope.result.items.push({
|
|
795
786
|
identity: reportedIdentity(document, effectiveScope),
|
|
796
787
|
// Every data space of the stream's DLO (its file's c__dataSpace).
|
|
@@ -820,7 +811,6 @@ export default class Retrieve extends SfCommand {
|
|
|
820
811
|
identity: { dataSpace: effectiveScope, apiName },
|
|
821
812
|
routes,
|
|
822
813
|
root: outputDirectory,
|
|
823
|
-
overwrite: flags.overwrite,
|
|
824
814
|
warnings: envelope.diagnostics.warnings,
|
|
825
815
|
push: (item) => envelope.result.items.push(item),
|
|
826
816
|
}));
|
|
@@ -913,7 +903,7 @@ export default class Retrieve extends SfCommand {
|
|
|
913
903
|
for (const apiName of names) {
|
|
914
904
|
try {
|
|
915
905
|
const document = await this.retrieveNativeGraph(apiName, graphContext);
|
|
916
|
-
const receipt = await this.writeDataGraph(document, outputDirectory,
|
|
906
|
+
const receipt = await this.writeDataGraph(document, outputDirectory, true);
|
|
917
907
|
envelope.result.items.push({
|
|
918
908
|
identity: { dataSpace: effectiveScope, apiName },
|
|
919
909
|
operation: 'retrieve',
|
|
@@ -929,7 +919,6 @@ export default class Retrieve extends SfCommand {
|
|
|
929
919
|
identity: { dataSpace: effectiveScope, apiName },
|
|
930
920
|
routes,
|
|
931
921
|
root: outputDirectory,
|
|
932
|
-
overwrite: flags.overwrite,
|
|
933
922
|
warnings: envelope.diagnostics.warnings,
|
|
934
923
|
push: (item) => envelope.result.items.push(item),
|
|
935
924
|
});
|
|
@@ -1151,10 +1140,10 @@ export default class Retrieve extends SfCommand {
|
|
|
1151
1140
|
: await (this.acquireNativeDmo ?? retrieveNativeDmo)(apiName, reads.wrap(this.createDmoClient(target, version, undefined, this.ssotSender(target, version, connection), listed.dmo)), effectiveScope, 'retrieve');
|
|
1152
1141
|
const root = outputDirectory;
|
|
1153
1142
|
const receipt = document.kind === 'mapping'
|
|
1154
|
-
? await this.writeNativeMapping(document, root,
|
|
1143
|
+
? await this.writeNativeMapping(document, root, true)
|
|
1155
1144
|
: document.kind === 'dlo'
|
|
1156
|
-
? await this.writeDlo(document, root,
|
|
1157
|
-
: await (this.writeNativeDmo ?? writeNativeDmoDocument)(document, root,
|
|
1145
|
+
? await this.writeDlo(document, root, true)
|
|
1146
|
+
: await (this.writeNativeDmo ?? writeNativeDmoDocument)(document, root, true);
|
|
1158
1147
|
envelope.result.items.push({
|
|
1159
1148
|
...(document.kind === 'dlo'
|
|
1160
1149
|
? {
|
|
@@ -1184,7 +1173,6 @@ export default class Retrieve extends SfCommand {
|
|
|
1184
1173
|
identity: { dataSpace: effectiveScope, apiName },
|
|
1185
1174
|
routes,
|
|
1186
1175
|
root: outputDirectory,
|
|
1187
|
-
overwrite: flags.overwrite,
|
|
1188
1176
|
warnings: envelope.diagnostics.warnings,
|
|
1189
1177
|
push: (item) => envelope.result.items.push(item),
|
|
1190
1178
|
});
|
|
@@ -1211,7 +1199,7 @@ export default class Retrieve extends SfCommand {
|
|
|
1211
1199
|
}
|
|
1212
1200
|
if (relationshipNames.length > 0 || selectors.includes('relationship')) {
|
|
1213
1201
|
outputTypes.add('relationship');
|
|
1214
|
-
const relationships = await this.retrieveRelationshipFamily(relationshipNames, connection, target, version, effectiveScope, outputDirectory
|
|
1202
|
+
const relationships = await this.retrieveRelationshipFamily(relationshipNames, connection, target, version, effectiveScope, outputDirectory);
|
|
1215
1203
|
envelope.result.items.push(...relationships.items);
|
|
1216
1204
|
envelope.diagnostics.errors.push(...relationships.errors);
|
|
1217
1205
|
envelope.diagnostics.warnings.push(...relationships.warnings);
|
|
@@ -1452,7 +1440,7 @@ export default class Retrieve extends SfCommand {
|
|
|
1452
1440
|
const reads = recordNativeReads(this.createDloClient(target, '68.0', this.ssotSender(target, '68.0', org.getConnection()), listed.dlo));
|
|
1453
1441
|
nativeOf = reads.nativeOf;
|
|
1454
1442
|
const document = await this.acquireDlo(apiName, reads.client, effectiveScope, 'retrieve');
|
|
1455
|
-
const receipt = await this.writeDlo(document, outputDirectory,
|
|
1443
|
+
const receipt = await this.writeDlo(document, outputDirectory, true);
|
|
1456
1444
|
envelope.result.items.push({
|
|
1457
1445
|
identity: { dataSpace: effectiveScope, apiName },
|
|
1458
1446
|
operation: 'retrieve',
|
|
@@ -1468,7 +1456,6 @@ export default class Retrieve extends SfCommand {
|
|
|
1468
1456
|
identity: { dataSpace: effectiveScope, apiName },
|
|
1469
1457
|
routes: dloRoutes,
|
|
1470
1458
|
root: outputDirectory,
|
|
1471
|
-
overwrite: flags.overwrite,
|
|
1472
1459
|
warnings: envelope.diagnostics.warnings,
|
|
1473
1460
|
push: (item) => envelope.result.items.push(item),
|
|
1474
1461
|
});
|
|
@@ -1512,7 +1499,7 @@ export default class Retrieve extends SfCommand {
|
|
|
1512
1499
|
try {
|
|
1513
1500
|
if (failure)
|
|
1514
1501
|
throw failure.error;
|
|
1515
|
-
const receipt = await this.writeNativeMapping(document, outputDirectory,
|
|
1502
|
+
const receipt = await this.writeNativeMapping(document, outputDirectory, true);
|
|
1516
1503
|
envelope.result.items.push({
|
|
1517
1504
|
identity: { dataSpace: effectiveScope, apiName },
|
|
1518
1505
|
operation: 'retrieve',
|
|
@@ -1527,7 +1514,6 @@ export default class Retrieve extends SfCommand {
|
|
|
1527
1514
|
identity: { dataSpace: effectiveScope, apiName },
|
|
1528
1515
|
routes,
|
|
1529
1516
|
root: outputDirectory,
|
|
1530
|
-
overwrite: flags.overwrite,
|
|
1531
1517
|
warnings: envelope.diagnostics.warnings,
|
|
1532
1518
|
push: (item) => envelope.result.items.push(item),
|
|
1533
1519
|
});
|
|
@@ -1571,7 +1557,7 @@ export default class Retrieve extends SfCommand {
|
|
|
1571
1557
|
if (relationshipNames.length > 0) {
|
|
1572
1558
|
const target = flags['target-org'] ?? org.getConnection().getUsername();
|
|
1573
1559
|
if (target) {
|
|
1574
|
-
const relationships = await this.retrieveRelationshipFamily(relationshipNames, org.getConnection(), target, nativeApiVersion(flags['api-version']), effectiveScope, outputDirectory
|
|
1560
|
+
const relationships = await this.retrieveRelationshipFamily(relationshipNames, org.getConnection(), target, nativeApiVersion(flags['api-version']), effectiveScope, outputDirectory);
|
|
1575
1561
|
envelope.result.items.push(...relationships.items);
|
|
1576
1562
|
envelope.diagnostics.errors.push(...relationships.errors);
|
|
1577
1563
|
envelope.diagnostics.warnings.push(...relationships.warnings);
|
|
@@ -1778,8 +1764,8 @@ export default class Retrieve extends SfCommand {
|
|
|
1778
1764
|
];
|
|
1779
1765
|
try {
|
|
1780
1766
|
const receipt = 'insight' in entry
|
|
1781
|
-
? await this.writeCalculatedInsight(entry.insight, outputDirectory,
|
|
1782
|
-
: await this.documentWriter(kind)(document, outputDirectory,
|
|
1767
|
+
? await this.writeCalculatedInsight(entry.insight, outputDirectory, true)
|
|
1768
|
+
: await this.documentWriter(kind)(document, outputDirectory, true);
|
|
1783
1769
|
envelope.result.items.push({
|
|
1784
1770
|
identity: reportedIdentity(document, effectiveScope),
|
|
1785
1771
|
...(kind === 'dmo' ? {} : { family: kind }),
|
|
@@ -1800,7 +1786,6 @@ export default class Retrieve extends SfCommand {
|
|
|
1800
1786
|
identity: reportedIdentity(document, effectiveScope),
|
|
1801
1787
|
routes,
|
|
1802
1788
|
root: outputDirectory,
|
|
1803
|
-
overwrite: flags.overwrite,
|
|
1804
1789
|
warnings: envelope.diagnostics.warnings,
|
|
1805
1790
|
push: (item) => envelope.result.items.push(item),
|
|
1806
1791
|
});
|
|
@@ -1892,7 +1877,7 @@ export default class Retrieve extends SfCommand {
|
|
|
1892
1877
|
*/
|
|
1893
1878
|
async retrieveOutcome(flags) {
|
|
1894
1879
|
const effectiveScope = flags.dataspace ?? 'default';
|
|
1895
|
-
// Writers require an absolute project root; resolve a relative -
|
|
1880
|
+
// Writers require an absolute project root; resolve a relative --output-dir against the cwd once.
|
|
1896
1881
|
const outputDirectory = path.resolve(flags['output-dir'] ?? process.cwd());
|
|
1897
1882
|
const plugin = {
|
|
1898
1883
|
name: packageMetadata.name,
|
|
@@ -21,5 +21,5 @@ export const hints = {
|
|
|
21
21
|
INVALID_CI_DOCUMENT: 'The calculated insight document lacks its API name, data space or SQL, or is not a JSON object. Retrieve the calculated insight again.',
|
|
22
22
|
INVALID_CI_NAME: 'The calculated insight API name is not valid. Use the full API name that starts with a letter and ends in __cio, for example ExampleInsight__cio.',
|
|
23
23
|
INVALID_CI_SCOPE: 'The calculated insight request used an unsupported API version, data space name or option. Use --api-version auto or 68.0 and a valid data space name.',
|
|
24
|
-
PARTIAL_CI_OUTPUT: 'Only one of the two calculated insight files was written to disk. Check the JSON and SQL files, then rerun the retrieve
|
|
24
|
+
PARTIAL_CI_OUTPUT: 'Only one of the two calculated insight files was written to disk. Check the JSON and SQL files, then rerun the retrieve.',
|
|
25
25
|
};
|
|
@@ -16,7 +16,7 @@ export const hints = {
|
|
|
16
16
|
DATA_GRAPH_ROOT_NOT_FOUND: 'The root DMO of the graph does not exist in the target org. Deploy that DMO, or the identity resolution ruleset that creates it, then preview the graph again.',
|
|
17
17
|
INVALID_NATIVE_DATA_GRAPH_NAME: 'The data graph name is not a valid API name. Use a name that starts with a letter and has only letters, digits and underscores, at most 200 characters.',
|
|
18
18
|
INVALID_NATIVE_DATA_GRAPH_SCOPE: 'Data graphs work only with API version 68.0. Use --api-version auto or 68.0, then rerun.',
|
|
19
|
-
NATIVE_GRAPH_RETRIEVE_BLOCKED: 'The data graph could not be retrieved or written to disk. Check the graph name, your org access and the output folder
|
|
20
|
-
PARTIAL_DATA_GRAPH_OUTPUT: 'The graph file was written, but the final check of it failed, so it may not match the org. Inspect the .native-dataGraph.json file and retrieve again
|
|
19
|
+
NATIVE_GRAPH_RETRIEVE_BLOCKED: 'The data graph could not be retrieved or written to disk. Check the graph name, your org access and the output folder, then rerun.',
|
|
20
|
+
PARTIAL_DATA_GRAPH_OUTPUT: 'The graph file was written, but the final check of it failed, so it may not match the org. Inspect the .native-dataGraph.json file and retrieve again.',
|
|
21
21
|
UNSUPPORTED_DATA_GRAPH_CONFIGURATION: 'The data graph definition or the answer from the org has a shape the plugin cannot check. Retrieve the graph again to get a supported file, or simplify the definition, then rerun.',
|
|
22
22
|
};
|
|
@@ -28,7 +28,7 @@ export const hints = {
|
|
|
28
28
|
INVALID_STREAM_RESPONSE: 'Salesforce accepted the stream create or update but its answer was not a JSON object. The write may have happened; inspect the stream in the org before you deploy again.',
|
|
29
29
|
INVALID_STREAM_SCHEMA: "The connection's event does not match the stream: no event of that name, unsupported availability, or fields without a type or label, or named twice. Check spec.event and the schema.",
|
|
30
30
|
INVALID_STREAM_TARGET_ID: 'The stream record ID or delete option for an update or delete request was not valid. Nothing was sent; rerun the command and report it if it happens again.',
|
|
31
|
-
PARTIAL_STREAM_OUTPUT: 'The stream file was written, but the final check of its contents failed. Open data360/data-stream/<ApiName>.data-stream-meta.json, then retrieve again
|
|
31
|
+
PARTIAL_STREAM_OUTPUT: 'The stream file was written, but the final check of its contents failed. Open data360/data-stream/<ApiName>.data-stream-meta.json, then retrieve again.',
|
|
32
32
|
STREAM_BINDING_DRIFT: 'The stream, its event or its connection changed between two reads, or reads disagreed. Wait until nobody changes the stream, then rerun; inspect the org first if mutation is unknown.',
|
|
33
33
|
STREAM_CHANGE_NOT_APPLIED: 'Salesforce accepted the stream write, but the stream still differs from the file in the named parts. Retrieve the stream to see what it holds; change the rest in Salesforce.',
|
|
34
34
|
STREAM_CONNECTION_MISMATCH: "The stream's Ingestion API connection was found but is not connected or its details differ. Check the connection's status in the org, then rerun.",
|
|
@@ -7,7 +7,7 @@ export const hints = {
|
|
|
7
7
|
INVALID_TRANSFORM_SCOPE: 'Data transforms are only supported with API version auto or 68.0. Remove another --api-version value and rerun.',
|
|
8
8
|
INVALID_TRANSFORM_SELECTION: 'A data transform name or record ID has an invalid format. Use the API name as in the org (letters, digits, underscores) or the 18-character ID starting with 1dt, then rerun.',
|
|
9
9
|
INVALID_TRANSFORM_TARGET_ID: 'A data transform record ID does not have the expected format (1dt followed by 15 letters or digits). Nothing was changed; check the transform in Data Cloud, then rerun.',
|
|
10
|
-
PARTIAL_TRANSFORM_OUTPUT: 'The transform file was written, but the final check of its contents failed. Open data360/dataTransforms/<Name>.dataTransform.json, then rerun the retrieve
|
|
10
|
+
PARTIAL_TRANSFORM_OUTPUT: 'The transform file was written, but the final check of its contents failed. Open data360/dataTransforms/<Name>.dataTransform.json, then rerun the retrieve.',
|
|
11
11
|
TRANSFORM_CONNECTION_DRIFT: 'The connection to the org changed while the command was running. Check that your org login is stable, then rerun the command.',
|
|
12
12
|
TRANSFORM_DATASPACE_MISMATCH: "The data transform (its file's c__dataSpace, or the transform of that name in the org) is in another data space than the run. A transform without any data space in the org is handled in default. Run with the --dataspace the message names, then rerun.",
|
|
13
13
|
TRANSFORM_DATASPACE_UNREADABLE: 'The plugin could not read the data space of the transform from the org (SOQL on MktDataTransform), so nothing was retrieved, changed or deleted. Check the org login and the message, then rerun.',
|
package/lib/errors/codes/dlo.js
CHANGED
|
@@ -20,7 +20,7 @@ export const hints = {
|
|
|
20
20
|
INVALID_DLO_PRIMARY_KEY: 'The DLO does not have exactly one usable primary-key field. Mark one ordinary field (not KQ_ or a system field) with isPrimaryKey true, then rerun.',
|
|
21
21
|
INVALID_DLO_RESPONSE: 'Salesforce returned a DLO answer the plugin could not read. Inspect the DLO in the org, especially if a write was sent, then rerun.',
|
|
22
22
|
INVALID_DLO_TARGET_ID: 'The org returned a DLO record ID in an unexpected form, so the write or delete was not sent. Inspect the DLO in the org and rerun.',
|
|
23
|
-
PARTIAL_DLO_OUTPUT: 'The DLO file was written but could not be verified afterwards. Check the file under data360/dlo, then rerun the retrieve
|
|
23
|
+
PARTIAL_DLO_OUTPUT: 'The DLO file was written but could not be verified afterwards. Check the file under data360/dlo, then rerun the retrieve.',
|
|
24
24
|
UNSUPPORTED_DLO_CATEGORY_CHANGE: 'The category of an existing DLO cannot be changed. Set category in the file back to the org value, or create the DLO under a new name.',
|
|
25
25
|
UNSUPPORTED_DLO_DATASPACE: 'The DLO in the org lists no usable data space, or not the data space of the run. Pass a --dataspace the DLO belongs to (its c__dataSpace list) and rerun.',
|
|
26
26
|
UNSUPPORTED_DLO_EVENT_FIELD_CHANGE: 'The event date field of an existing DLO cannot be changed. Set eventDateTimeFieldName back to the org value, or leave it out of the file.',
|
package/lib/errors/codes/dmo.js
CHANGED
|
@@ -19,7 +19,7 @@ export const hints = {
|
|
|
19
19
|
INVALID_DMO_FIELD: 'A DMO field name or definition is not valid. Use exact custom field names ending in __c; for a field read from the org, inspect that field.',
|
|
20
20
|
INVALID_DMO_NAME: 'The DMO API name is not valid. Use the exact name: a letter first, then letters, digits or underscores, ending in __dlm.',
|
|
21
21
|
INVALID_DMO_RESPONSE: 'Salesforce returned a DMO answer the plugin could not read. Inspect the DMO in the org, especially if a write was sent, then rerun.',
|
|
22
|
-
PARTIAL_DMO_OUTPUT: 'The DMO file was written but could not be verified afterwards. Check the file under data360/dmo, then rerun the retrieve
|
|
22
|
+
PARTIAL_DMO_OUTPUT: 'The DMO file was written but could not be verified afterwards. Check the file under data360/dmo, then rerun the retrieve.',
|
|
23
23
|
UNSUPPORTED_DMO_DATASPACE: 'The DMO in the org is not in the data space of the run. Pass the --dataspace that holds the DMO (its c__dataSpace), or leave the flag out for default, and rerun.',
|
|
24
24
|
UNSUPPORTED_DMO_FIELD_ADDITION: 'This field cannot be added to the existing DMO. New fields must not be primary keys or generated, and on a standard DMO need a name without a namespace.',
|
|
25
25
|
UNSUPPORTED_DMO_FIELD_CHANGE: 'The file changes or removes a DMO field in a way the plugin cannot apply. Restore it as in the org; to remove a custom field, deploy with --allow-field-removal.',
|
|
@@ -3,11 +3,13 @@ export const hints = {
|
|
|
3
3
|
ACQUISITION_FAILED: 'The plugin could not read a DMO definition through the Metadata API. Check that the org session is valid and the DMO exists in the target, then rerun.',
|
|
4
4
|
AUTHENTICATION_FAILED: 'Salesforce rejected the session or the org could not be loaded. Check the org with sf org display, log in again with sf org login web if needed, then rerun.',
|
|
5
5
|
BLOCKED_GIT_LIFECYCLE: 'The Git changes include a rename (also one split across commit, index and worktree), a conflict or a deleted file the plugin cannot identify. Stage renames so Git can detect them, or select the files with --source-dir or -m.',
|
|
6
|
+
CONFIRMATION_REQUIRED: 'Deleting needs a yes at the confirmation question, and nobody could answer it here. Run the delete in a terminal, or pass --no-prompt after checking it with --preview.',
|
|
6
7
|
CROSS_DATASPACE_COPY_CONFLICT: 'The translated copy of a file would go to a path that already holds other content. Existing files are never changed, so nothing was sent. Move or remove that file, then rerun.',
|
|
7
8
|
CROSS_DATASPACE_RULESETS_READ_FAILED: 'A file of another data space names an identity resolution output, and the ruleset list that places it could not be read. Nothing was sent; check the org session, then rerun.',
|
|
8
9
|
CROSS_DATASPACE_UNRESOLVED: "A name in a file of another data space cannot be placed in the run's data space by rule, so nothing was sent. Read which name and why, change the selection or the file, then rerun.",
|
|
9
10
|
CROSS_DATASPACE_UNSUPPORTED: '--allow-cross-dataspace cannot translate this kind of file yet (STL transforms with an unknown node, transforms other than STL and DCSQL, streams). Nothing was sent. Deploy those in their own data space.',
|
|
10
11
|
DATASPACE_READ_FAILED: 'The list of data spaces could not be read completely from the org, so nothing was read or written. Check the org session and Data Cloud access, then rerun.',
|
|
12
|
+
DELETE_CANCELLED: 'The delete was not confirmed (no, no answer within 30 seconds, or the question failed), so nothing was sent. Rerun it and answer yes, or pass --no-prompt.',
|
|
11
13
|
DELETE_FAILED: 'The delete stopped for a reason without a more specific code. Read the message, check the item outcome and inspect the target before trying again; nothing is retried.',
|
|
12
14
|
DELETE_PHASE_NOT_SETTLED: 'Salesforce is still processing a deletion of this run, so the later phases were not started. Wait until it reads absent, then rerun the same delete.',
|
|
13
15
|
DEPLOY_EXECUTION_BLOCKED: 'At least one item was blocked, so the deploy stopped before or between writes. Read the item lines above for the reason, fix it, then rerun the same deploy.',
|
|
@@ -15,7 +17,6 @@ export const hints = {
|
|
|
15
17
|
DEPLOY_FRESH_ADMISSION_BLOCKED: 'Right before writing this item, a fresh check found something different from the earlier check, so it and later items were not written. Run deploy --preview to see the current state, then rerun.',
|
|
16
18
|
DEPLOY_PREVIEW_BLOCKED: 'The preview found at least one item that a deploy would refuse. Read the item lines above for the reason and fix it before running the deploy without --preview.',
|
|
17
19
|
DEPLOY_PREVIEW_FAILED: 'The preview could not finish. Read the message for the cause, such as session, selection or target access, fix it and run the preview again. Nothing was written.',
|
|
18
|
-
DESTRUCTIVE_CONFIRMATION_REQUIRED: 'A delete with --changed-since needs explicit confirmation. Check it with --preview first, then rerun the same delete with --confirm-delete.',
|
|
19
20
|
DUPLICATE_IDENTITY: 'Two selected files describe the same component. Keep one file per component in the selection, for example by narrowing --source-dir, then rerun.',
|
|
20
21
|
EXECUTION_UNCONFIRMED: 'A write was sent but its result could not be confirmed, so it may have taken effect. Inspect the target with retrieve or deploy --preview before running the deploy again.',
|
|
21
22
|
HTML_ESCAPED_FILE: 'The file holds HTML-escaped text (such as & or ') where the org holds the character itself; Salesforce would store the entities literally, so nothing was written. Retrieve the component again, or write the characters themselves.',
|
|
@@ -24,14 +25,15 @@ export const hints = {
|
|
|
24
25
|
INVALID_DRAFT_SCOPE: '--draft applies only to calculated insights at API auto or 68.0. Select only calculated insights and drop other API versions.',
|
|
25
26
|
INVALID_FIELD_DELETE_SELECTION: '--field needs exactly one -m dmo:<Name__dlm> and no other selector, --changed-since or --delete-dlo; --output-dir works only with --field.',
|
|
26
27
|
INVALID_GIT_SELECTION: 'The --changed-since reference or the Git output could not be used. Pass a commit, branch or tag that exists locally and run the command inside the Git repository.',
|
|
28
|
+
INVALID_OPTION: 'A library call got options the Salesforce CLI would refuse while parsing its flags, so nothing was read or sent. Fix the options named in the message, then call again.',
|
|
27
29
|
INVALID_REQUEST: 'The plugin refused to build the Salesforce request from these inputs. Check --target-org, --api-version and the selected names, and that the org uses an https instance URL.',
|
|
28
30
|
INVALID_SCOPE: 'This family does not support the requested --api-version, or the run could not use the data space. Use --api-version auto (or a version the family allows), then rerun.',
|
|
29
31
|
INVALID_SELECTION: 'The selection is not valid for this command. Check the -m type:ApiName syntax, the --source-dir paths and flags that cannot be combined, then rerun.',
|
|
30
32
|
INVALID_SOURCE: 'A selected file is not a valid definition for its file type, or its content names a different component than its file name. Fix the file, or retrieve it again, then rerun.',
|
|
31
|
-
|
|
33
|
+
INVALID_WAIT_SCOPE: '--wait applies only to a deploy that holds a data graph or to a segment publish, and must be whole minutes (1 or more). Remove it, or select a data graph or a segment.',
|
|
32
34
|
LEGACY_DATASPACE_KEY: 'The file still has an old data space key (identity.dataSpace, spec.segmentOn.dataSpace, or dataSpace in a calculated insight or an identity resolution reference). Move it to the top-level c__dataSpace key, or retrieve again.',
|
|
33
35
|
LOCAL_FILE_REMOVAL_FAILED: 'The deletion in the org is confirmed, but a local file was not removed. Do not repeat the delete; check the file named in the message and remove it yourself.',
|
|
34
|
-
LOCAL_REFRESH_FAILED: 'The fields were deleted in the org, but some project files were not refreshed. Do not repeat the delete; run sf data360 retrieve
|
|
36
|
+
LOCAL_REFRESH_FAILED: 'The fields were deleted in the org, but some project files were not refreshed. Do not repeat the delete; run sf data360 retrieve for the DMO and its mappings.',
|
|
35
37
|
NATIVE_INVENTORY_FAILED: 'Listing the DLOs, DMOs or mappings in the org failed, so nothing was retrieved. Check the org session and permissions in the message, then rerun or select exact type:ApiName members.',
|
|
36
38
|
NATIVE_INVENTORY_UNCONFIRMED: 'The list of DLOs or DMOs from the org could not be confirmed complete, so nothing was retrieved. Retrieve exact members with -m dmo:<Name> or -m dlo:<Name>, or rerun later.',
|
|
37
39
|
NATIVE_PARENT_SETTLEMENT_UNCONFIRMED: 'A parent DLO or DMO was written but could not be confirmed ready, so dependent items were not deployed. Wait, check the parent with deploy --preview, then rerun.',
|
|
@@ -39,7 +41,7 @@ export const hints = {
|
|
|
39
41
|
NOTHING_TO_DEPLOY: 'Every selected file was a verbatim file and was skipped, so there was nothing to deploy and nothing was sent. Select files the plugin can represent, or retrieve the objects again.',
|
|
40
42
|
OUTPUT_CHANGED: 'The target file changed on disk while the plugin was writing it, so the write stopped. Make sure nothing else edits the project during the run, then rerun.',
|
|
41
43
|
OUTPUT_FAILED: 'The retrieved definition could not be written to the project. Check that the output folder is writable, has free space and that the temp folder settings are valid, then rerun.',
|
|
42
|
-
OVERWRITE_REQUIRED: 'A
|
|
44
|
+
OVERWRITE_REQUIRED: 'A file of that name already exists in the project with other content. A deploy never changes an existing file when it writes a cross-data-space copy: compare the two, then move or remove the existing file and rerun.',
|
|
43
45
|
PREFLIGHT_FAILED: 'Checking this item against the target failed, so nothing was deployed. Read the message for the cause, such as session, permissions or input, fix it and run deploy --preview again.',
|
|
44
46
|
PROCESSING_ACKNOWLEDGEMENT_REQUIRED: 'This create or update starts processing in Data Cloud and needs your explicit consent. Check it with --preview, then rerun with --allow-processing.',
|
|
45
47
|
REMOVE_FAILED: 'Removing this local file failed after a confirmed deletion. Close programs that hold the file, check permissions, then delete it yourself; do not repeat the delete.',
|
|
@@ -19,6 +19,6 @@ export const hints = {
|
|
|
19
19
|
IDENTITY_RESOLUTION_TARGET_UNQUALIFIED: 'The ruleset could not be looked up in the target org; the error was not a plain not found. Check your Data Cloud access and any Salesforce detail, then rerun.',
|
|
20
20
|
IDENTITY_RESOLUTION_UPDATE_UNQUALIFIED: 'The file changes the configuration type or secondary DMO of an existing ruleset, which an update cannot carry. Revert those fields, or delete the ruleset and deploy it again.',
|
|
21
21
|
INCOMPLETE_IDENTITY_RESOLUTION: 'The answer for the ruleset was incomplete, so no file was written. Rerun the retrieve; if it repeats, check the ruleset in Data Cloud.',
|
|
22
|
-
PARTIAL_IDENTITY_RESOLUTION_OUTPUT: 'The ruleset file was written, but the final check of it failed, so it may not match the org. Inspect the .identityResolution.json file and retrieve again
|
|
22
|
+
PARTIAL_IDENTITY_RESOLUTION_OUTPUT: 'The ruleset file was written, but the final check of it failed, so it may not match the org. Inspect the .identityResolution.json file and retrieve again.',
|
|
23
23
|
UNSUPPORTED_IDENTITY_RESOLUTION_CONFIGURATION: 'The ruleset lacks a required key or has a shape, value or name deploy cannot send. Retrieve keeps unknown keys and nulls, or writes the ruleset as-is; deploy refuses and names the key path.',
|
|
24
24
|
};
|
|
@@ -36,7 +36,7 @@ export const hints = {
|
|
|
36
36
|
MAPPING_TARGET_NOT_SETTLED: 'The mapping in the org is not ACTIVE yet, for example because Salesforce is still processing an earlier change. Wait until it is ACTIVE, then rerun.',
|
|
37
37
|
MAPPING_UNMAP_PERSISTENCE_UNCONFIRMED: "A field pair was removed, but reading the mappings back did not confirm the expected result. Inspect the DMO's mappings in the org before trying again; nothing was rolled back.",
|
|
38
38
|
MAPPING_UNMAP_PLAN_CHANGED: "The DMO's mappings changed between planning and the first write, so nothing was removed. Rerun the command to plan again against the current org.",
|
|
39
|
-
PARTIAL_MAPPING_OUTPUT: 'The mapping file was written, but checking it afterwards failed, so its content may be incomplete. Inspect the file, delete it if needed, and rerun the retrieve
|
|
39
|
+
PARTIAL_MAPPING_OUTPUT: 'The mapping file was written, but checking it afterwards failed, so its content may be incomplete. Inspect the file, delete it if needed, and rerun the retrieve.',
|
|
40
40
|
UNSUPPORTED_MAPPING_DATASPACE: 'Salesforce reported the mapping in a different data space than the one this command works in. Rerun with that data space in --dataspace, or select a mapping of this data space.',
|
|
41
41
|
UNSUPPORTED_MAPPING_SELECTION: 'The target org value cannot be passed on safely: it is empty, starts with a dash or contains control characters. Pass a valid alias or username with --target-org.',
|
|
42
42
|
};
|
|
@@ -5,7 +5,7 @@ export const hints = {
|
|
|
5
5
|
INVALID_RELATIONSHIP_DOCUMENT: 'A relationship does not fit the file format: the source must be a DMO API name with a custom field (__c), the target any object and field API name (a DMO or a CRM object), and cardinality and owner must be set. Check it in the org.',
|
|
6
6
|
INVALID_RELATIONSHIP_NAME: 'The relationship name is not a valid API name: it must start with a letter and use only letters, digits and underscores. Use the exact name from the org.',
|
|
7
7
|
INVALID_RELATIONSHIP_RESPONSE: 'Salesforce answered the relationship list in a shape the plugin does not expect. Rerun the command; if it repeats, inspect the raw list response for the DMO.',
|
|
8
|
-
PARTIAL_RELATIONSHIP_OUTPUT: 'The relationship file was written, but a later step of saving it failed, so the file may not be complete. Inspect it under data360/relationship and retrieve again
|
|
8
|
+
PARTIAL_RELATIONSHIP_OUTPUT: 'The relationship file was written, but a later step of saving it failed, so the file may not be complete. Inspect it under data360/relationship and retrieve again.',
|
|
9
9
|
RELATIONSHIP_DELETION_UNCONFIRMED: "The relationship delete was sent, but the relationship still appears in the source DMO's list. Check it in the org before deleting again; nothing is retried.",
|
|
10
10
|
RELATIONSHIP_DEPENDENCIES_PLANNED: 'This batch creates a DMO the relationship uses, so the preview cannot compare the relationship yet. No action is needed; the deploy checks it after the DMO exists.',
|
|
11
11
|
RELATIONSHIP_FILE_IDENTITY_MISMATCH: "The relationship definition the delete checks names a different relationship than the one selected. Nothing was deleted; with --changed-since, fix the deleted file's content, otherwise report it.",
|
|
@@ -3,7 +3,7 @@ export const hints = {
|
|
|
3
3
|
INCOMPLETE_SEGMENT: 'The segment read finished without a usable definition and without a more specific reason. Rerun the retrieve; if it repeats, read the segment directly with the API.',
|
|
4
4
|
INVALID_SEGMENT_DOCUMENT: 'A segment value is not text the plugin can send (missing, empty, too long, control characters), the models are not a list, or a model name cannot name a SQL file. Retrieve writes such a segment as-is; fix the file for deploy.',
|
|
5
5
|
INVALID_SEGMENT_RESPONSE: 'Salesforce answered the segment read in a shape the plugin does not expect (not exactly one segment). Rerun the retrieve; if it repeats, inspect the raw API response.',
|
|
6
|
-
PARTIAL_SEGMENT_OUTPUT: 'A segment file was written, but a later step of saving the JSON and SQL files failed, so the files on disk may not be complete. Inspect the .segment.json and .sql files and retrieve again
|
|
6
|
+
PARTIAL_SEGMENT_OUTPUT: 'A segment file was written, but a later step of saving the JSON and SQL files failed, so the files on disk may not be complete. Inspect the .segment.json and .sql files and retrieve again.',
|
|
7
7
|
SEGMENT_ACQUISITION_FAILED: 'The plugin could not read the segment, or a complete segment list, from the org. Check the segment name, the target org login and the Salesforce API detail in the message, then rerun.',
|
|
8
8
|
SEGMENT_ADMISSION_FAILED: 'The checks right before the segment write failed, so nothing was sent. Make sure the .segment.json file did not change during the run, check the org, and run the deploy again.',
|
|
9
9
|
SEGMENT_CHILD_NOT_FOUND: 'A child segment named in spec.childSegments of a Waterfall file is not in the target org, so nothing was written. Deploy the child first (or select it in the same deploy) or fix the name.',
|
|
@@ -33,7 +33,7 @@ export const hints = {
|
|
|
33
33
|
SEGMENT_PUBLISH_FAILED: 'Salesforce ran the publish and reports publishStatus FAILED. Check the segment and its source DMO in Data Cloud before publishing again; nothing was resent.',
|
|
34
34
|
SEGMENT_PUBLISH_REJECTED: 'Salesforce refused the publish request; its answer is in the message. Fix the cause it names, then run the publish again; nothing was resent.',
|
|
35
35
|
SEGMENT_PUBLISH_STARTED: 'With --async the publish was started and Salesforce accepted it; the command did not wait for the result. Read the segment later for its publish status; nothing was resent.',
|
|
36
|
-
SEGMENT_PUBLISH_STILL_PROCESSING: 'Salesforce accepted the publish and is still processing it when --wait
|
|
36
|
+
SEGMENT_PUBLISH_STILL_PROCESSING: 'Salesforce accepted the publish and is still processing it when --wait ran out. It did not fail and was not resent; read the segment later for the result.',
|
|
37
37
|
SEGMENT_PUBLISH_UNCONFIRMED: 'The publish was sent, but its answer or the status after it could not be read, so the publish may be running. Read the segment before publishing again; nothing was resent.',
|
|
38
38
|
SEGMENT_READBACK_MISMATCH: 'After the write, the segment read back differently from the file, or other settings or its DMO changed. Inspect the segment in the org before any further deploy.',
|
|
39
39
|
SEGMENT_SCHEDULE_CHANGE: 'The deploy sends the schedule of the file, so the segment publishes on that schedule in the target org ({ "frequency": "None" } turns it off). Remove the schedule key from the file to leave the org schedule alone.',
|
|
@@ -397,7 +397,7 @@ export async function operateNativeDataGraph(value, context, client, options) {
|
|
|
397
397
|
safeToDelete: async () => false,
|
|
398
398
|
pause: options.pause,
|
|
399
399
|
now,
|
|
400
|
-
// Keep waiting while the created graph is still building, up to --wait
|
|
400
|
+
// Keep waiting while the created graph is still building, up to --wait.
|
|
401
401
|
creation: { started, end, pause: waitPause, progress },
|
|
402
402
|
});
|
|
403
403
|
creating = true;
|
|
@@ -122,7 +122,7 @@ function mappedRemovalMessage(apiName, mapped, lookupFailed, guide) {
|
|
|
122
122
|
];
|
|
123
123
|
return [
|
|
124
124
|
`${lead}${summary}. Salesforce would drop the mapping pair(s) together with the field(s), so remove the pair(s) from the mapping file(s) and deploy the mapping(s) and the DMO in one command:`,
|
|
125
|
-
`sf data360 retrieve${scope}${selectors} -m dmo:${apiName}
|
|
125
|
+
`sf data360 retrieve${scope}${selectors} -m dmo:${apiName}`,
|
|
126
126
|
edits.join(' '),
|
|
127
127
|
`sf data360 deploy${scope}${selectors} -m dmo:${apiName} --allow-field-removal`,
|
|
128
128
|
'',
|
|
@@ -73,7 +73,7 @@ export async function deleteCalculatedInsight(value, connection, selection, data
|
|
|
73
73
|
if (options.preview === true)
|
|
74
74
|
return result('delete', 'not-attempted');
|
|
75
75
|
if (options.confirmDelete !== true)
|
|
76
|
-
return result('blocked', 'not-attempted', '
|
|
76
|
+
return result('blocked', 'not-attempted', 'CONFIRMATION_REQUIRED');
|
|
77
77
|
const client = options.nativeClient ?? createCalculatedInsightClient(connection, '68.0', dataSpace);
|
|
78
78
|
context.check();
|
|
79
79
|
attempted = true;
|
|
@@ -233,7 +233,7 @@ export async function deleteIdentityResolution(value, connection, selection, dat
|
|
|
233
233
|
if (preview)
|
|
234
234
|
return result('delete');
|
|
235
235
|
if (options.confirmDelete !== true)
|
|
236
|
-
return result('blocked', '
|
|
236
|
+
return result('blocked', 'CONFIRMATION_REQUIRED');
|
|
237
237
|
attempted = true;
|
|
238
238
|
await client.deleteIdentityResolution(id);
|
|
239
239
|
check();
|
|
@@ -206,7 +206,7 @@ export async function deleteSegment(value, connection, selection, dataSpace, opt
|
|
|
206
206
|
if (preview)
|
|
207
207
|
return result('delete');
|
|
208
208
|
if (options.confirmDelete !== true)
|
|
209
|
-
return result('blocked', '
|
|
209
|
+
return result('blocked', 'CONFIRMATION_REQUIRED');
|
|
210
210
|
check();
|
|
211
211
|
attempted = true;
|
|
212
212
|
// HTTP204 proves only acknowledgement. A failed/uncertain DELETE never becomes success.
|
|
@@ -105,7 +105,7 @@ export declare function settleNativeDataGraph(context: NativeGraphContext, docum
|
|
|
105
105
|
* @param {object} timing Invocation clock, deadline, delay and progress sink.
|
|
106
106
|
* @param {Function} timing.now Invocation clock.
|
|
107
107
|
* @param {number} timing.started Invocation start time.
|
|
108
|
-
* @param {number} timing.end Invocation deadline (--wait
|
|
108
|
+
* @param {number} timing.end Invocation deadline (--wait).
|
|
109
109
|
* @param {Function} timing.pause Read-only delay.
|
|
110
110
|
* @param {Function} timing.progress Stderr-only progress sink.
|
|
111
111
|
* @returns {Promise<NativeGraphAcquisition>} Ready evidence or unknown.
|
|
@@ -238,7 +238,7 @@ export type NativeGraphCreateCheck = 'request' | 'response' | 'settlement' | 'id
|
|
|
238
238
|
* @param {Function} [guards.pause] Injectable polling delay.
|
|
239
239
|
* @param {object} [guards.creation] Invocation budget; create settlement waits while building.
|
|
240
240
|
* @param {number} guards.creation.started Invocation start time.
|
|
241
|
-
* @param {number} guards.creation.end Invocation deadline (--wait
|
|
241
|
+
* @param {number} guards.creation.end Invocation deadline (--wait).
|
|
242
242
|
* @param {Function} guards.creation.pause Paced read-only delay.
|
|
243
243
|
* @param {Function} guards.creation.progress Stderr-only progress sink.
|
|
244
244
|
* @returns {{create: Function; delete: Function}} Internal lifecycle, no UPDATE or name-only delete.
|
|
@@ -324,7 +324,7 @@ export async function settleNativeDataGraph(context, document, goal, pause = del
|
|
|
324
324
|
* @param {object} timing Invocation clock, deadline, delay and progress sink.
|
|
325
325
|
* @param {Function} timing.now Invocation clock.
|
|
326
326
|
* @param {number} timing.started Invocation start time.
|
|
327
|
-
* @param {number} timing.end Invocation deadline (--wait
|
|
327
|
+
* @param {number} timing.end Invocation deadline (--wait).
|
|
328
328
|
* @param {Function} timing.pause Read-only delay.
|
|
329
329
|
* @param {Function} timing.progress Stderr-only progress sink.
|
|
330
330
|
* @returns {Promise<NativeGraphAcquisition>} Ready evidence or unknown.
|
|
@@ -684,7 +684,7 @@ export async function updateNativeDataGraph(context, client, document, baseline,
|
|
|
684
684
|
* @param {Function} [guards.pause] Injectable polling delay.
|
|
685
685
|
* @param {object} [guards.creation] Invocation budget; create settlement waits while building.
|
|
686
686
|
* @param {number} guards.creation.started Invocation start time.
|
|
687
|
-
* @param {number} guards.creation.end Invocation deadline (--wait
|
|
687
|
+
* @param {number} guards.creation.end Invocation deadline (--wait).
|
|
688
688
|
* @param {Function} guards.creation.pause Paced read-only delay.
|
|
689
689
|
* @param {Function} guards.creation.progress Stderr-only progress sink.
|
|
690
690
|
* @returns {{create: Function; delete: Function}} Internal lifecycle, no UPDATE or name-only delete.
|
|
@@ -223,7 +223,7 @@ export function explainSpaceMismatch(error, apiName, fileSpace, runSpace, crossS
|
|
|
223
223
|
* @returns {string} The sentence, with a leading space.
|
|
224
224
|
*/
|
|
225
225
|
export function crossSpaceSentence(runSpace) {
|
|
226
|
-
return ` To deploy it into ${printableKey(runSpace)} instead, add --allow-cross-dataspace
|
|
226
|
+
return ` To deploy it into ${printableKey(runSpace)} instead, add --allow-cross-dataspace.`;
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
229
229
|
* Reuse existing diagnostic messages while distinguishing local verification from API rejection.
|
|
@@ -13,7 +13,7 @@ export type SegmentPublishOptions = {
|
|
|
13
13
|
async?: boolean;
|
|
14
14
|
/** Seconds to wait for SUCCESS or FAILED after Salesforce accepted the publish. */
|
|
15
15
|
waitTimeoutSeconds: number;
|
|
16
|
-
/** The segment file of a
|
|
16
|
+
/** The segment file of a `--source-dir` selection: the org must hold this definition. */
|
|
17
17
|
desired?: SegmentDocument;
|
|
18
18
|
/** The run's data space: the segment read must name it (default: default). */
|
|
19
19
|
dataSpace?: string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Connection } from '@salesforce/core';
|
|
2
|
+
import type { DeleteEnvelope } from '../commands/data360/delete.js';
|
|
3
|
+
/** The flags of `sf data360 delete`, for a caller that holds its own Connection. */
|
|
4
|
+
export type DeleteOptions = {
|
|
5
|
+
/** `--preview`: look up and report only, nothing deleted; default false. */
|
|
6
|
+
preview?: boolean;
|
|
7
|
+
/** Selectors (`-m`), e.g. `dlo:Name__dll`; not with `changedSince`. */
|
|
8
|
+
metadata?: string[];
|
|
9
|
+
/** `--changed-since`: Git reference; deletes the components whose files were deleted since. */
|
|
10
|
+
changedSince?: string;
|
|
11
|
+
/** Run data space (`--dataspace`); default `default`. */
|
|
12
|
+
dataspace?: string;
|
|
13
|
+
/** `--api-version`; default `auto`. */
|
|
14
|
+
apiVersion?: string;
|
|
15
|
+
/** Project root holding data360/ and the Git repository; default the current directory. */
|
|
16
|
+
projectDir?: string;
|
|
17
|
+
/** `--delete-dlo` (data streams only); default false. */
|
|
18
|
+
deleteDlo?: boolean;
|
|
19
|
+
/** `--field`: custom fields removed from the one selected `dmo:Name__dlm`. */
|
|
20
|
+
field?: string[];
|
|
21
|
+
/** `--keep-local-files`; default false (a confirmed deletion removes its local file). */
|
|
22
|
+
keepLocalFiles?: boolean;
|
|
23
|
+
/** `--output-dir` (with `field` only), relative to `projectDir`; default `projectDir`. */
|
|
24
|
+
outputDir?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Run `sf data360 delete` over a Connection the caller holds and return its envelope (what
|
|
28
|
+
* `--json` shows). It never asks: the caller confirmed the delete (as `--no-prompt`). Nothing is
|
|
29
|
+
* printed and `process.exitCode` is left alone; use exitCodeOf on the envelope for the Salesforce
|
|
30
|
+
* CLI exit code. A refusal is returned as a blocked envelope, not thrown. The delete services run
|
|
31
|
+
* at API 68.0 on the Connection; its API version is restored afterwards.
|
|
32
|
+
*
|
|
33
|
+
* Every REST and Metadata API call goes over the given Connection. The one exception: a mapping
|
|
34
|
+
* delete and a field-level delete (`field`) send their Metadata API destructive change through
|
|
35
|
+
* the Salesforce CLI child `sf project deploy start -o <username>`, so they need a global `sf`
|
|
36
|
+
* and a stored sf CLI authorization for the Connection's username.
|
|
37
|
+
* @param {Connection} connection Authenticated @salesforce/core Connection of the target org.
|
|
38
|
+
* @param {DeleteOptions} [options] The command's flags.
|
|
39
|
+
* @returns {Promise<DeleteEnvelope>} The delete envelope.
|
|
40
|
+
* @throws {OptionError} For flag misuse the CLI refuses at parse time (exit 2): `changedSince`
|
|
41
|
+
* with `metadata`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function runDelete(connection: Connection, options?: DeleteOptions): Promise<DeleteEnvelope>;
|