sf-plugin-data 0.4.0 → 0.5.1
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 +31 -12
- package/docs/capabilities.md +8 -8
- 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 +193 -43
- package/lib/commands/data360/deploy.d.ts +14 -2
- package/lib/commands/data360/deploy.js +35 -22
- package/lib/commands/data360/list/dataspace.js +12 -5
- package/lib/commands/data360/publish.d.ts +2 -2
- package/lib/commands/data360/publish.js +18 -14
- package/lib/commands/data360/retrieve.js +15 -7
- package/lib/commands/data360/segment/members/export.js +4 -1
- package/lib/errors/codes/general.js +4 -2
- package/lib/errors/codes/segment.js +1 -1
- package/lib/services/command-native-data-graph.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.js +3 -0
- package/lib/transport/connect-client.d.ts +8 -0
- package/lib/transport/connect-client.js +25 -1
- package/package.json +1 -1
|
@@ -470,11 +470,43 @@ function fieldDeleteLines(item) {
|
|
|
470
470
|
: `refresh failed (${file.code}): ${file.path}`);
|
|
471
471
|
return lines;
|
|
472
472
|
}
|
|
473
|
+
/**
|
|
474
|
+
* A fresh, blocked envelope for one run.
|
|
475
|
+
* @param {DeleteFlags} flags Parsed flags.
|
|
476
|
+
* @returns {DeleteEnvelope} Envelope without items.
|
|
477
|
+
*/
|
|
478
|
+
function newEnvelope(flags) {
|
|
479
|
+
return {
|
|
480
|
+
contract: 'sf-data360-delete',
|
|
481
|
+
contractVersion: '1.1.0',
|
|
482
|
+
status: 'blocked',
|
|
483
|
+
metadata: {
|
|
484
|
+
operation: 'delete',
|
|
485
|
+
preview: flags.preview,
|
|
486
|
+
apiVersion: flags['api-version'] ?? 'auto',
|
|
487
|
+
plugin,
|
|
488
|
+
},
|
|
489
|
+
provenance: {
|
|
490
|
+
command: 'sf data360 delete',
|
|
491
|
+
generatedAt: new Date().toISOString(),
|
|
492
|
+
// eslint-disable-next-line unicorn/no-null -- Stable JSON represents unresolved target identity explicitly.
|
|
493
|
+
targetOrgId: null,
|
|
494
|
+
},
|
|
495
|
+
diagnostics: { warnings: [], errors: [] },
|
|
496
|
+
result: { scope: { dataSpace: flags.dataspace ?? 'default' }, items: [] },
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* A preview item the real run would delete: now, after its dependents, or with its owner.
|
|
501
|
+
* @param {DeleteItem} item Preview item.
|
|
502
|
+
* @returns {boolean} True when the real run would delete it.
|
|
503
|
+
*/
|
|
504
|
+
const wouldDelete = (item) => item.outcome === 'delete' || item.outcome === 'planned-dependencies';
|
|
473
505
|
/** Delete exact native DLO definitions, or preview without mutation. */
|
|
474
506
|
export default class Delete extends SfCommand {
|
|
475
507
|
static aliases = ['datacloud:delete', 'd360:delete', 'dc:delete'];
|
|
476
508
|
static summary = 'Delete exact Data360 Transforms, Segments, IR owners, streams, DLOs, DMOs, single custom DMO fields or mappings.';
|
|
477
|
-
static description = "One delete can carry any mix of families, each named exactly with -m. It runs them in reverse dependency order, one phase after the other: graphs, then identity resolution, calculated insights and Segments (a dependent before the component it needs, including a graph or CI/Segment on the unified DMO of a selected IR), then data transforms, then relationships, mappings, DMOs and DLOs, then data streams. A phase starts only after every item of the previous one settled; a blocked, failed or unconfirmed item stops the run, and an item Salesforce is still processing stops the later phases with DELETE_PHASE_NOT_SETTLED (status processing, exit 69, when nothing failed). A -m delete needs no confirmation flag: check the selection with --preview first. Before the first delete, the current definition of each selected transform, Segment, IR, CI and graph is read from the org by its name (read-only); one the org does not have reports unchanged. A transform name resolves to its target ID through the complete transform list: no match is unchanged, two or more matches (ignoring case) are refused with TRANSFORM_TARGET_NOT_RESOLVED. --changed-since <ref> selects the canonical plugin files deleted since the merge base with that reference (every family; changed files are ignored) and deletes their components in the same phase order. Identity and definition come from each file's base content; a path present again is not a delete, while a rename (also one split across commit, index and worktree), an unstaged deletion or a deleted file of no known family blocks before any org call (BLOCKED_GIT_LIFECYCLE). A --changed-since delete needs --confirm-delete (--preview runs without it; --confirm-delete is accepted only with --changed-since), takes no -m or --delete-dlo, and removes no local file. A deleted data transform is resolved by its name like a -m one; a relationship takes its source DMO from the base content; a stream file deleted together with its landing DLO file deletes the stream with its DLO. --preview runs every phase read-only and reports an item whose selected dependents an earlier phase deletes as planned-dependencies (DEPENDENCIES_PLANNED) without checking it further. A stream selected together with its landing DLO is deleted with --delete-dlo semantics and the DLO item reports removedWith the stream; the last mapping of a custom DMO selected together with that DMO is not sent on its own and reports removedWith the DMO; it reports deleted only once its own read answers 404 after the DMO deletion, otherwise deletion-unconfirmed (MAPPING_DELETION_UNCONFIRMED). data-transform:Name uses auto/API68 in the run data space (TRANSFORM_DATASPACE_MISMATCH for another). Preview is GET-only. A target of any owner or namespace is deleted with one native DELETE (Salesforce decides; a 4xx answer is reported as rejected); one whose status is PROCESSING is refused before it (TRANSFORM_DELETE_PROCESSING, in --preview too); settlement needs complete bounded inventory omission of both ID and name, otherwise the result is deletion-unconfirmed (never replay). No DLO, run or data cleanup; exhaustive external-consumer exclusion is not established. segment:Name uses auto/API68 in the run data space (the stored name, <prefix>_<Name> outside default; SEGMENT_DATASPACE_MISMATCH for another). Fresh source bindings and exact runtime/private identity are checked before one native DELETE. Only independent absence or a preserved DELETING/PROCESSING read acknowledges the result; HTTP204 alone is insufficient. No replay, Segment XML, shared-DMO deletion or physical-output cleanup guarantee. identity-resolution:ObjectApiName uses auto/API68 in the run data space (the stored name, <prefix>_<type>_<rulesetId> outside default; IDENTITY_RESOLUTION_DATASPACE_MISMATCH for another) and deletes a present owner that is not PUBLISHING or DELETING. A fresh target-local ID is resolved before one native68 DELETE; bounded exact ID/name absence confirms owner-definition deletion only. Exhaustive external-consumer exclusion and physical profile/output cleanup remain unverified. IR never cascades, runs processing, replays writes or falls back to another API. data-graph:Name uses auto/API68 in the run data space (graph names are unique in the org; DATA_GRAPH_DATASPACE_MISMATCH for a graph of another). Fresh identity, created date, definition, root and ready checks plus explicit empty native dependency/related-segment arrays are mandatory. A draft graph (never built, retrieved as-is) is deleted by name with the same scope and dependency checks. Exhaustive external-consumer exclusion remains unverified; no generated-resource cleanup, storage or credit guarantee. A Graph delete never cascades. calculated-insight:Name__cio uses --api-version auto (68.0) or 68.0 in the run data space (the GET must name it, CI_IDENTITY_CHANGED otherwise). The insight is read by name with the API 68 GET (absent is unchanged; it must answer with that name and data space), deleted with one DELETE in any status, schedule or SQL (Salesforce decides; a 4xx answer is reported as rejected), then read until it answers 404. CI never cascades; no compute, storage or credits guarantee. Exact data-stream:ApiName selects guarded IngestApi stream deletion at auto/API68 in the run data space (its DLO must belong to it). The linked DLO is preserved by default; --delete-dlo explicitly acknowledges deleting that exclusively linked DLO. Selected stream and linked DLO checks only, not unrelated-org preservation. Native routes default to API68; explicit numeric pins are preserved. Relationship deletion (relationship:SourceDmo__dlm:Name; a bare relationship:Name is refused with INVALID_SELECTION) runs first in its phase, before mappings, DMOs and DLOs. The relationships of the named source DMO are listed and the name is looked up ignoring letter case: no match is unchanged, two matches are refused (AMBIGUOUS_RELATIONSHIP_TARGET), and a match whose source object is another DMO is refused (RELATIONSHIP_TARGET_BINDING_MISMATCH). In a --changed-since delete the source DMO and binding come from the deleted file, and when its name is absent but the binding exists under another name the delete is refused with RELATIONSHIP_NAME_MISMATCH. Otherwise one DELETE is sent and its absence confirmed by listing again; a 4xx answer is reported as rejected. --preview only lists. A mapping:Name with a valid local data360/mapping/Name.mapping-meta.json file (with --changed-since, the deleted file's base content) is found in the org the way deploy finds it: by the file's source DLO and target DMO, whatever Salesforce named it (the org name is reported as targetApiName). No org mapping with that binding is unchanged; two or more are refused with AMBIGUOUS_MAPPING_TARGET before any write. Otherwise the exact name is read, and a mapping that reads absent (404) reports unchanged. Mapping deletion runs at native API 61 and up (default 68) and deletes the whole mapping with one Metadata API destructive deployment (ObjectSourceTargetMap), whatever pairs it holds, also onto a standard DMO (Salesforce refuses the last mapping onto a standard DMO copy in a data space other than default; a Failed destructive deployment is reported as rejected). Afterwards the mapping must read absent and the other mappings and the fields of the DMO must be unchanged. The last mapping of a custom DMO is refused before any write (MAPPING_LAST_MAPPING_DELETE_BLOCKED) because Salesforce does not delete it; delete the DMO instead, which removes its mapping. Qualification uses empty custom fixtures, not populated-data guarantees. --preview performs zero writes and reports the planned step. Any partial failure stops the batch; no retries or rollback. Whole-DMO deletion is sent for every DMO, a standard one (creationType Standard) and one read without a creationType included, and Salesforce decides: a 4xx answer is reported as rejected (for example, Salesforce refuses to delete a platform-generated DMO while the identity resolution or graph that owns it exists). Field-level delete: exactly one dmo:Name__dlm with one or more --field Name__c removes the named fields from that DMO. It is the one delete operation that changes mappings it was not given and writes project files. Reads first: every field must exist on the DMO. Any field but the primary key may be named, also the standard, system and generated fields of any DMO: Salesforce decides, and a refused destructive change is reported as rejected. This is the only command that removes such platform-owned fields; every mapping pair targeting a named field is collected, and a mapped field is refused only when the mapping list fails; one that no mapping lists a pair for has no pair to lose and is removed. Then one Metadata API destructive change for all fields, sent once and never retried; Salesforce drops the mapping pairs of the removed fields itself. Fresh reads right before it must still match the plan, and polled reads afterwards must show the fields absent, exactly the collected pairs gone and every other mapping, pair, DMO property and field unchanged; any other difference fails with DMO_FIELD_REMOVAL_SIDE_EFFECT. Nothing is rolled back. After success the existing data360/dmo and data360/mapping files under --output-dir (default: current directory) are overwritten with the current definitions; absent files are not created and no file is deleted. A failed file refresh keeps the confirmed org result and the run is partial (exit 68, LOCAL_REFRESH_FAILED). --field --preview writes nothing and reports pairs, fields and files. --field cannot be combined with another selector, --changed-since or --delete-dlo. Local files: after a confirmed deletion (deleted, or a DLO, DMO, Segment or IR Salesforce accepted and is still deleting) the component's own local file is removed by default, one regular file at a time at its canonical path and never a folder: data360/dlo, data360/dmo, data360/relationship, data360/data-stream, data360/dataTransforms, data360/identityResolution and data360/dataGraphs files, both files of a CI (data360/calculatedInsights/Name__cio.calculatedInsight-meta.json and .calculatedInsight-meta.sql) and the Segment files (data360/segments/Name.segment.json and every Name.segment.*.sql beside it) under the current directory (with --delete-dlo also the linked DLO's file), and the mapping file of that name or the one whose binding matches. Links, hard-linked files and paths outside those folders are refused. Nothing is removed on --preview, which lists the files instead, nor for unchanged, blocked, failed, rejected or unconfirmed deletions. --keep-local-files keeps them. A failed removal keeps the confirmed org result and the run is partial (exit 68) with LOCAL_FILE_REMOVAL_FAILED when a deletion is confirmed, otherwise processing (exit 69).";
|
|
509
|
+
static description = "One delete can carry any mix of families, each named exactly with -m. It runs them in reverse dependency order, one phase after the other: graphs, then identity resolution, calculated insights and Segments (a dependent before the component it needs, including a graph or CI/Segment on the unified DMO of a selected IR), then data transforms, then relationships, mappings, DMOs and DLOs, then data streams. A phase starts only after every item of the previous one settled; a blocked, failed or unconfirmed item stops the run, and an item Salesforce is still processing stops the later phases with DELETE_PHASE_NOT_SETTLED (status processing, exit 69, when nothing failed). Without --preview the delete first runs the same selection read-only, lists every component it would delete and asks once (y/yes deletes; no, no answer within 30 seconds or a failed question sends nothing and reports DELETE_CANCELLED with exit 0); nothing to delete asks nothing. Without a terminal, or with --json, a delete needs --no-prompt (-r) and is otherwise refused before any org call with CONFIRMATION_REQUIRED. --preview never asks. Before the first delete, the current definition of each selected transform, Segment, IR, CI and graph is read from the org by its name (read-only); one the org does not have reports unchanged. A transform name resolves to its target ID through the complete transform list: no match is unchanged, two or more matches (ignoring case) are refused with TRANSFORM_TARGET_NOT_RESOLVED. --changed-since <ref> selects the canonical plugin files deleted since the merge base with that reference (every family; changed files are ignored) and deletes their components in the same phase order. Identity and definition come from each file's base content; a path present again is not a delete, while a rename (also one split across commit, index and worktree), an unstaged deletion or a deleted file of no known family blocks before any org call (BLOCKED_GIT_LIFECYCLE). A --changed-since delete takes no -m or --delete-dlo, and removes no local file. A deleted data transform is resolved by its name like a -m one; a relationship takes its source DMO from the base content; a stream file deleted together with its landing DLO file deletes the stream with its DLO. --preview runs every phase read-only and reports an item whose selected dependents an earlier phase deletes as planned-dependencies (DEPENDENCIES_PLANNED) without checking it further. A stream selected together with its landing DLO is deleted with --delete-dlo semantics and the DLO item reports removedWith the stream; the last mapping of a custom DMO selected together with that DMO is not sent on its own and reports removedWith the DMO; it reports deleted only once its own read answers 404 after the DMO deletion, otherwise deletion-unconfirmed (MAPPING_DELETION_UNCONFIRMED). data-transform:Name uses auto/API68 in the run data space (TRANSFORM_DATASPACE_MISMATCH for another). Preview is GET-only. A target of any owner or namespace is deleted with one native DELETE (Salesforce decides; a 4xx answer is reported as rejected); one whose status is PROCESSING is refused before it (TRANSFORM_DELETE_PROCESSING, in --preview too); settlement needs complete bounded inventory omission of both ID and name, otherwise the result is deletion-unconfirmed (never replay). No DLO, run or data cleanup; exhaustive external-consumer exclusion is not established. segment:Name uses auto/API68 in the run data space (the stored name, <prefix>_<Name> outside default; SEGMENT_DATASPACE_MISMATCH for another). Fresh source bindings and exact runtime/private identity are checked before one native DELETE. Only independent absence or a preserved DELETING/PROCESSING read acknowledges the result; HTTP204 alone is insufficient. No replay, Segment XML, shared-DMO deletion or physical-output cleanup guarantee. identity-resolution:ObjectApiName uses auto/API68 in the run data space (the stored name, <prefix>_<type>_<rulesetId> outside default; IDENTITY_RESOLUTION_DATASPACE_MISMATCH for another) and deletes a present owner that is not PUBLISHING or DELETING. A fresh target-local ID is resolved before one native68 DELETE; bounded exact ID/name absence confirms owner-definition deletion only. Exhaustive external-consumer exclusion and physical profile/output cleanup remain unverified. IR never cascades, runs processing, replays writes or falls back to another API. data-graph:Name uses auto/API68 in the run data space (graph names are unique in the org; DATA_GRAPH_DATASPACE_MISMATCH for a graph of another). Fresh identity, created date, definition, root and ready checks plus explicit empty native dependency/related-segment arrays are mandatory. A draft graph (never built, retrieved as-is) is deleted by name with the same scope and dependency checks. Exhaustive external-consumer exclusion remains unverified; no generated-resource cleanup, storage or credit guarantee. A Graph delete never cascades. calculated-insight:Name__cio uses --api-version auto (68.0) or 68.0 in the run data space (the GET must name it, CI_IDENTITY_CHANGED otherwise). The insight is read by name with the API 68 GET (absent is unchanged; it must answer with that name and data space), deleted with one DELETE in any status, schedule or SQL (Salesforce decides; a 4xx answer is reported as rejected), then read until it answers 404. CI never cascades; no compute, storage or credits guarantee. Exact data-stream:ApiName selects guarded IngestApi stream deletion at auto/API68 in the run data space (its DLO must belong to it). The linked DLO is preserved by default; --delete-dlo explicitly acknowledges deleting that exclusively linked DLO. Selected stream and linked DLO checks only, not unrelated-org preservation. Native routes default to API68; explicit numeric pins are preserved. Relationship deletion (relationship:SourceDmo__dlm:Name; a bare relationship:Name is refused with INVALID_SELECTION) runs first in its phase, before mappings, DMOs and DLOs. The relationships of the named source DMO are listed and the name is looked up ignoring letter case: no match is unchanged, two matches are refused (AMBIGUOUS_RELATIONSHIP_TARGET), and a match whose source object is another DMO is refused (RELATIONSHIP_TARGET_BINDING_MISMATCH). In a --changed-since delete the source DMO and binding come from the deleted file, and when its name is absent but the binding exists under another name the delete is refused with RELATIONSHIP_NAME_MISMATCH. Otherwise one DELETE is sent and its absence confirmed by listing again; a 4xx answer is reported as rejected. --preview only lists. A mapping:Name with a valid local data360/mapping/Name.mapping-meta.json file (with --changed-since, the deleted file's base content) is found in the org the way deploy finds it: by the file's source DLO and target DMO, whatever Salesforce named it (the org name is reported as targetApiName). No org mapping with that binding is unchanged; two or more are refused with AMBIGUOUS_MAPPING_TARGET before any write. Otherwise the exact name is read, and a mapping that reads absent (404) reports unchanged. Mapping deletion runs at native API 61 and up (default 68) and deletes the whole mapping with one Metadata API destructive deployment (ObjectSourceTargetMap), whatever pairs it holds, also onto a standard DMO (Salesforce refuses the last mapping onto a standard DMO copy in a data space other than default; a Failed destructive deployment is reported as rejected). Afterwards the mapping must read absent and the other mappings and the fields of the DMO must be unchanged. The last mapping of a custom DMO is refused before any write (MAPPING_LAST_MAPPING_DELETE_BLOCKED) because Salesforce does not delete it; delete the DMO instead, which removes its mapping. Qualification uses empty custom fixtures, not populated-data guarantees. --preview performs zero writes and reports the planned step. Any partial failure stops the batch; no retries or rollback. Whole-DMO deletion is sent for every DMO, a standard one (creationType Standard) and one read without a creationType included, and Salesforce decides: a 4xx answer is reported as rejected (for example, Salesforce refuses to delete a platform-generated DMO while the identity resolution or graph that owns it exists). Field-level delete: exactly one dmo:Name__dlm with one or more --field Name__c removes the named fields from that DMO. It is the one delete operation that changes mappings it was not given and writes project files. Reads first: every field must exist on the DMO. Any field but the primary key may be named, also the standard, system and generated fields of any DMO: Salesforce decides, and a refused destructive change is reported as rejected. This is the only command that removes such platform-owned fields; every mapping pair targeting a named field is collected, and a mapped field is refused only when the mapping list fails; one that no mapping lists a pair for has no pair to lose and is removed. Then one Metadata API destructive change for all fields, sent once and never retried; Salesforce drops the mapping pairs of the removed fields itself. Fresh reads right before it must still match the plan, and polled reads afterwards must show the fields absent, exactly the collected pairs gone and every other mapping, pair, DMO property and field unchanged; any other difference fails with DMO_FIELD_REMOVAL_SIDE_EFFECT. Nothing is rolled back. After success the existing data360/dmo and data360/mapping files under --output-dir (default: current directory) are overwritten with the current definitions; absent files are not created and no file is deleted. A failed file refresh keeps the confirmed org result and the run is partial (exit 68, LOCAL_REFRESH_FAILED). --field --preview writes nothing and reports pairs, fields and files. --field cannot be combined with another selector, --changed-since or --delete-dlo. Local files: after a confirmed deletion (deleted, or a DLO, DMO, Segment or IR Salesforce accepted and is still deleting) the component's own local file is removed by default, one regular file at a time at its canonical path and never a folder: data360/dlo, data360/dmo, data360/relationship, data360/data-stream, data360/dataTransforms, data360/identityResolution and data360/dataGraphs files, both files of a CI (data360/calculatedInsights/Name__cio.calculatedInsight-meta.json and .calculatedInsight-meta.sql) and the Segment files (data360/segments/Name.segment.json and every Name.segment.*.sql beside it) under the current directory (with --delete-dlo also the linked DLO's file), and the mapping file of that name or the one whose binding matches. Links, hard-linked files and paths outside those folders are refused. Nothing is removed on --preview, which lists the files instead, nor for unchanged, blocked, failed, rejected or unconfirmed deletions. --keep-local-files keeps them. A failed removal keeps the confirmed org result and the run is partial (exit 68) with LOCAL_FILE_REMOVAL_FAILED when a deletion is confirmed, otherwise processing (exit 69).";
|
|
478
510
|
static flags = {
|
|
479
511
|
'target-org': Flags.string({
|
|
480
512
|
char: 'o',
|
|
@@ -496,12 +528,13 @@ export default class Delete extends SfCommand {
|
|
|
496
528
|
}),
|
|
497
529
|
preview: Flags.boolean({ default: false, summary: 'Look up and report only; never delete.' }),
|
|
498
530
|
'changed-since': Flags.string({
|
|
499
|
-
summary: 'Delete in the org the components whose canonical plugin files were deleted since the merge base with a commit reference
|
|
531
|
+
summary: 'Delete in the org the components whose canonical plugin files were deleted since the merge base with a commit reference.',
|
|
500
532
|
exclusive: ['metadata'],
|
|
501
533
|
}),
|
|
502
|
-
'
|
|
503
|
-
|
|
504
|
-
|
|
534
|
+
'no-prompt': Flags.boolean({
|
|
535
|
+
char: 'r',
|
|
536
|
+
default: false,
|
|
537
|
+
summary: 'Delete without asking for confirmation.',
|
|
505
538
|
}),
|
|
506
539
|
'delete-dlo': Flags.boolean({
|
|
507
540
|
default: false,
|
|
@@ -533,7 +566,8 @@ export default class Delete extends SfCommand {
|
|
|
533
566
|
deleteCalculatedInsight = deleteCalculatedInsight;
|
|
534
567
|
/** The org ID of the connection this run resolved (provenance only); unset before that. */
|
|
535
568
|
resolvedOrgId;
|
|
536
|
-
//
|
|
569
|
+
// Without --target-org an unusable org is TARGET_ORG_REQUIRED; a given one is
|
|
570
|
+
// AUTHENTICATION_FAILED, as in publish.
|
|
537
571
|
resolveConnection = async (alias) => {
|
|
538
572
|
try {
|
|
539
573
|
const aggregator = await ConfigAggregator.create();
|
|
@@ -547,7 +581,7 @@ export default class Delete extends SfCommand {
|
|
|
547
581
|
});
|
|
548
582
|
}
|
|
549
583
|
catch {
|
|
550
|
-
throw new DloError('TARGET_ORG_REQUIRED');
|
|
584
|
+
throw new DloError(alias === undefined ? 'TARGET_ORG_REQUIRED' : 'AUTHENTICATION_FAILED');
|
|
551
585
|
}
|
|
552
586
|
};
|
|
553
587
|
/**
|
|
@@ -566,11 +600,13 @@ export default class Delete extends SfCommand {
|
|
|
566
600
|
readStreamLinkedDlo = readStreamLinkedDlo;
|
|
567
601
|
preflightDeleteDataStream = preflightDeleteDataStream;
|
|
568
602
|
executeDeleteDataStream = executeDeleteDataStream;
|
|
603
|
+
// The Connection the stream clients read and delete on; the library passes its caller's.
|
|
604
|
+
streamConnection = async (target, version) => Connection.create({
|
|
605
|
+
authInfo: await AuthInfo.create({ username: target }),
|
|
606
|
+
connectionOptions: { version },
|
|
607
|
+
});
|
|
569
608
|
createDataStreamClients = async (target, version) => {
|
|
570
|
-
const connection = await
|
|
571
|
-
authInfo: await AuthInfo.create({ username: target }),
|
|
572
|
-
connectionOptions: { version },
|
|
573
|
-
});
|
|
609
|
+
const connection = await this.streamConnection(target, version);
|
|
574
610
|
const reader = new ConnectClient(connection, version);
|
|
575
611
|
return {
|
|
576
612
|
// DELETE (including the DLO cascade) is sent once on this same bound Connection.
|
|
@@ -715,7 +751,7 @@ export default class Delete extends SfCommand {
|
|
|
715
751
|
const fields = [...new Set(flags.field)];
|
|
716
752
|
// The run's data space, always explicit: --dataspace, or default.
|
|
717
753
|
const effectiveScope = flags.dataspace ?? 'default';
|
|
718
|
-
const root = path.resolve(flags['output-dir'] ??
|
|
754
|
+
const root = path.resolve(this.projectDirectory(), flags['output-dir'] ?? '.');
|
|
719
755
|
const item = {
|
|
720
756
|
family: 'dmo',
|
|
721
757
|
identity: { dataSpace: effectiveScope, apiName },
|
|
@@ -896,8 +932,8 @@ export default class Delete extends SfCommand {
|
|
|
896
932
|
item.identity.apiName = apiName;
|
|
897
933
|
const files = [
|
|
898
934
|
{
|
|
899
|
-
path: path.join(
|
|
900
|
-
boundary: path.join(
|
|
935
|
+
path: path.join(this.projectDirectory(), 'data360', 'relationship', `${apiName}.relationship-meta.json`),
|
|
936
|
+
boundary: path.join(this.projectDirectory(), 'data360'),
|
|
901
937
|
},
|
|
902
938
|
];
|
|
903
939
|
if (preview) {
|
|
@@ -931,32 +967,148 @@ export default class Delete extends SfCommand {
|
|
|
931
967
|
*/
|
|
932
968
|
async run() {
|
|
933
969
|
const { flags } = await this.parse(Delete);
|
|
934
|
-
|
|
970
|
+
if (flags.preview || flags['no-prompt'])
|
|
971
|
+
return this.execute(flags, false);
|
|
972
|
+
// Refused before any org read when nobody can answer the question.
|
|
973
|
+
if (this.jsonEnabled() || !this.interactiveTerminal()) {
|
|
974
|
+
const envelope = newEnvelope(flags);
|
|
975
|
+
envelope.diagnostics.errors.push({
|
|
976
|
+
code: 'CONFIRMATION_REQUIRED',
|
|
977
|
+
message: 'Deleting needs confirmation: run it in a terminal, or pass --no-prompt. Check the selection with --preview first.',
|
|
978
|
+
retryable: false,
|
|
979
|
+
});
|
|
980
|
+
process.exitCode = exitCodeOf(envelope);
|
|
981
|
+
annotateDiagnostics(envelope);
|
|
982
|
+
if (!this.jsonEnabled()) {
|
|
983
|
+
this.log('Delete: blocked.');
|
|
984
|
+
for (const diagnostic of envelope.diagnostics.errors)
|
|
985
|
+
this.log(formatDiagnostic(diagnostic));
|
|
986
|
+
}
|
|
987
|
+
return envelope;
|
|
988
|
+
}
|
|
989
|
+
// The same delete, read-only and silent, shows what would be deleted.
|
|
990
|
+
const preview = await this.execute({ ...flags, preview: true }, true);
|
|
991
|
+
// A preview that was refused or failed asks nothing: its refusal is the run's result.
|
|
992
|
+
if (preview.status !== 'success')
|
|
993
|
+
return this.refusedPreview(preview);
|
|
994
|
+
const planned = preview.result.items.filter((item) => wouldDelete(item));
|
|
995
|
+
if (planned.length === 0)
|
|
996
|
+
return this.execute(flags, false);
|
|
997
|
+
const { dataSpace } = preview.result.scope;
|
|
998
|
+
const message = [
|
|
999
|
+
`Delete ${planned.length} component(s) from data space ${dataSpace}?`,
|
|
1000
|
+
...planned.map((item) => ` ${item.family}:${item.identity.apiName}${item.fields?.length ? ` fields ${item.fields.join(', ')}` : ''}${item.removedWith ? ` (removed with ${item.removedWith})` : ''}`),
|
|
1001
|
+
'Dependent mappings, DLOs and fields may be found during the run.',
|
|
1002
|
+
].join('\n');
|
|
1003
|
+
let confirmed = false;
|
|
1004
|
+
try {
|
|
1005
|
+
confirmed = await this.confirmDeletion(message);
|
|
1006
|
+
}
|
|
1007
|
+
catch {
|
|
1008
|
+
confirmed = false;
|
|
1009
|
+
}
|
|
1010
|
+
if (confirmed)
|
|
1011
|
+
return this.execute(flags, false);
|
|
1012
|
+
return this.cancelled(preview);
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* Whether a person can answer the confirmation question: stdin and stdout are terminals.
|
|
1016
|
+
* @returns {boolean} True in an interactive terminal.
|
|
1017
|
+
*/
|
|
1018
|
+
interactiveTerminal() {
|
|
1019
|
+
return process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Report data graph progress while the delete waits (for example a retried graph DELETE).
|
|
1023
|
+
* oclif logToStderr suppresses output in JSON mode; progress must remain visible.
|
|
1024
|
+
* @param {string} message One progress line.
|
|
1025
|
+
*/
|
|
1026
|
+
graphProgress(message) {
|
|
1027
|
+
process.stderr.write(`${message}\n`);
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* The project root: where data360/ lives (local files removed or refreshed, relative
|
|
1031
|
+
* --output-dir) and the Git selection runs. The CLI uses the current directory.
|
|
1032
|
+
* @returns {string} Absolute project root.
|
|
1033
|
+
*/
|
|
1034
|
+
projectDirectory() {
|
|
1035
|
+
return process.cwd();
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* Ask once whether to delete; no answer within 30 seconds is no.
|
|
1039
|
+
* @param {string} message Question and the components it deletes.
|
|
1040
|
+
* @returns {Promise<boolean>} True only for an explicit yes.
|
|
1041
|
+
*/
|
|
1042
|
+
async confirmDeletion(message) {
|
|
1043
|
+
return this.confirm({ message, ms: 30_000, defaultAnswer: false });
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* The envelope of a delete whose silent preview did not succeed: its refusal, nothing sent and
|
|
1047
|
+
* nothing asked.
|
|
1048
|
+
* @param {DeleteEnvelope} preview Envelope of the silent preview (blocked, failed or other).
|
|
1049
|
+
* @returns {DeleteEnvelope} The preview's status, items and diagnostics.
|
|
1050
|
+
*/
|
|
1051
|
+
refusedPreview(preview) {
|
|
935
1052
|
const envelope = {
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
1053
|
+
...preview,
|
|
1054
|
+
metadata: { ...preview.metadata, preview: false },
|
|
1055
|
+
};
|
|
1056
|
+
const exitCode = exitCodeOf(envelope);
|
|
1057
|
+
if (exitCode !== 0)
|
|
1058
|
+
process.exitCode = exitCode;
|
|
1059
|
+
if (!this.jsonEnabled()) {
|
|
1060
|
+
this.log(`Delete: ${envelope.status}; nothing was deleted.`);
|
|
1061
|
+
for (const diagnostic of envelope.diagnostics.errors)
|
|
1062
|
+
this.log(formatDiagnostic(diagnostic));
|
|
1063
|
+
}
|
|
1064
|
+
return envelope;
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* The envelope of a delete the user did not confirm: the preview items, nothing sent.
|
|
1068
|
+
* @param {DeleteEnvelope} preview Envelope of the silent preview.
|
|
1069
|
+
* @returns {DeleteEnvelope} Cancelled envelope, status success.
|
|
1070
|
+
*/
|
|
1071
|
+
cancelled(preview) {
|
|
1072
|
+
const reason = 'The delete was not confirmed, so nothing was sent to the org.';
|
|
1073
|
+
const envelope = {
|
|
1074
|
+
...preview,
|
|
1075
|
+
status: 'success',
|
|
1076
|
+
metadata: { ...preview.metadata, preview: false },
|
|
1077
|
+
diagnostics: {
|
|
1078
|
+
warnings: [`DELETE_CANCELLED: ${reason}`, ...preview.diagnostics.warnings],
|
|
1079
|
+
errors: preview.diagnostics.errors,
|
|
950
1080
|
},
|
|
951
|
-
diagnostics: { warnings: [], errors: [] },
|
|
952
|
-
result: { scope: { dataSpace: effectiveScope }, items: [] },
|
|
953
1081
|
};
|
|
1082
|
+
for (const item of envelope.result.items) {
|
|
1083
|
+
item.mutation = 'not-attempted';
|
|
1084
|
+
item.diagnostics = [
|
|
1085
|
+
...(item.diagnostics ?? []),
|
|
1086
|
+
{ code: 'DELETE_CANCELLED', message: reason },
|
|
1087
|
+
];
|
|
1088
|
+
}
|
|
1089
|
+
annotateDiagnostics(envelope);
|
|
1090
|
+
if (!this.jsonEnabled()) {
|
|
1091
|
+
this.log('Delete: cancelled; nothing was deleted.');
|
|
1092
|
+
for (const item of envelope.result.items)
|
|
1093
|
+
this.log(`Not deleted: ${item.family}:${item.identity.apiName}.`);
|
|
1094
|
+
}
|
|
1095
|
+
return envelope;
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Run the delete, or its preview, and complete the envelope.
|
|
1099
|
+
* @param {DeleteFlags} flags Parsed flags.
|
|
1100
|
+
* @param {boolean} quiet No output and no exit code: the preview before the question.
|
|
1101
|
+
* @returns {Promise<DeleteEnvelope>} Payload-free deletion evidence.
|
|
1102
|
+
*/
|
|
1103
|
+
async execute(flags, quiet) {
|
|
1104
|
+
const effectiveScope = flags.dataspace ?? 'default';
|
|
1105
|
+
const envelope = newEnvelope(flags);
|
|
954
1106
|
const selectorsByItem = new Map();
|
|
955
1107
|
const keepLocalFiles = flags['keep-local-files'];
|
|
956
1108
|
const changedSince = flags['changed-since'];
|
|
957
1109
|
// A file deleted in the Git range is already gone: no local file is listed or removed.
|
|
958
1110
|
const gitMode = changedSince !== undefined;
|
|
959
|
-
const projectData = path.join(
|
|
1111
|
+
const projectData = path.join(this.projectDirectory(), 'data360');
|
|
960
1112
|
// The local files of each item; removed once its deletion is confirmed.
|
|
961
1113
|
const localFiles = new Map();
|
|
962
1114
|
const inProject = (...segments) => ({
|
|
@@ -1081,10 +1233,10 @@ export default class Delete extends SfCommand {
|
|
|
1081
1233
|
await removeConfirmedFiles();
|
|
1082
1234
|
envelope.status = settledStatus();
|
|
1083
1235
|
const exitCode = exitCodeOf(envelope);
|
|
1084
|
-
if (exitCode !== 0)
|
|
1236
|
+
if (exitCode !== 0 && !quiet)
|
|
1085
1237
|
process.exitCode = exitCode;
|
|
1086
1238
|
annotateDiagnostics(envelope);
|
|
1087
|
-
if (!this.jsonEnabled()) {
|
|
1239
|
+
if (!quiet && !this.jsonEnabled()) {
|
|
1088
1240
|
this.log(`Delete${flags.preview ? ' preview' : ''}: ${envelope.status}.`);
|
|
1089
1241
|
// The default data space goes without saying; any other is named.
|
|
1090
1242
|
if (effectiveScope !== 'default')
|
|
@@ -1219,7 +1371,10 @@ export default class Delete extends SfCommand {
|
|
|
1219
1371
|
let gitDeletions = [];
|
|
1220
1372
|
if (changedSince !== undefined) {
|
|
1221
1373
|
envelope.result.selection = { changedSince };
|
|
1222
|
-
const selected = await this.selectGitInputs({
|
|
1374
|
+
const selected = await this.selectGitInputs({
|
|
1375
|
+
cwd: this.projectDirectory(),
|
|
1376
|
+
ref: changedSince,
|
|
1377
|
+
});
|
|
1223
1378
|
envelope.provenance.git = selected.provenance;
|
|
1224
1379
|
gitDeletions = selected.deletions ?? [];
|
|
1225
1380
|
if (gitDeletions.length === 0) {
|
|
@@ -1317,12 +1472,6 @@ export default class Delete extends SfCommand {
|
|
|
1317
1472
|
: new DloError('INVALID_SELECTION');
|
|
1318
1473
|
admitted.set(selector, { desired: source.desired });
|
|
1319
1474
|
}
|
|
1320
|
-
// A Git delete is never an implicit destructive run; a -m delete needs no confirmation.
|
|
1321
|
-
if (gitMode && !flags.preview && flags['confirm-delete'] !== true) {
|
|
1322
|
-
const error = new DloError('DESTRUCTIVE_CONFIRMATION_REQUIRED');
|
|
1323
|
-
replaceExplanation(error, 'Files deleted in the Git range are deleted in the org only with --confirm-delete. Check the selection with --preview, then rerun with --confirm-delete. Nothing was deleted.');
|
|
1324
|
-
throw error;
|
|
1325
|
-
}
|
|
1326
1475
|
// Right before each stage: a file deleted in the range must still be gone.
|
|
1327
1476
|
const stillDeleted = async (candidate) => {
|
|
1328
1477
|
if (candidate === undefined)
|
|
@@ -1488,6 +1637,7 @@ export default class Delete extends SfCommand {
|
|
|
1488
1637
|
preview: flags.preview,
|
|
1489
1638
|
confirmed: true,
|
|
1490
1639
|
verifyInput,
|
|
1640
|
+
progress: (message) => this.graphProgress(message),
|
|
1491
1641
|
});
|
|
1492
1642
|
const item = {
|
|
1493
1643
|
family: 'data-graph',
|
|
@@ -1602,7 +1752,7 @@ export default class Delete extends SfCommand {
|
|
|
1602
1752
|
}
|
|
1603
1753
|
if (result.outcome === 'blocked') {
|
|
1604
1754
|
envelope.diagnostics.errors.push({
|
|
1605
|
-
code: '
|
|
1755
|
+
code: 'CONFIRMATION_REQUIRED',
|
|
1606
1756
|
message: 'The transform delete was not confirmed; nothing was changed.',
|
|
1607
1757
|
retryable: false,
|
|
1608
1758
|
});
|
|
@@ -2099,7 +2249,7 @@ export default class Delete extends SfCommand {
|
|
|
2099
2249
|
if (resolved !== undefined)
|
|
2100
2250
|
return [canonical];
|
|
2101
2251
|
try {
|
|
2102
|
-
const found = await mappingLocalFile(normalizeNativeMapping(firstRead, effectiveScope, 'retrieve'),
|
|
2252
|
+
const found = await mappingLocalFile(normalizeNativeMapping(firstRead, effectiveScope, 'retrieve'), this.projectDirectory());
|
|
2103
2253
|
return [{ path: found.path, boundary: projectData }];
|
|
2104
2254
|
}
|
|
2105
2255
|
catch {
|
|
@@ -201,7 +201,7 @@ export type DeployEnvelope = {
|
|
|
201
201
|
export default class Deploy extends SfCommand<DeployEnvelope> {
|
|
202
202
|
static readonly aliases: string[];
|
|
203
203
|
static readonly summary = "Deploy explicit authored Data360 configuration or preview without writes.";
|
|
204
|
-
static readonly description = "Data transforms (data-transform:Name, data360/dataTransforms/Name.dataTransform.json, auto/API68, in the run data space: c__dataSpace must name it and equal definition.dataSpaceName when the definition names one; TRANSFORM_DATASPACE_MISMATCH otherwise, also for an org transform of that name in another data space, resolved from its dataSpaceName or, without one, from its MktDataTransform record read with SOQL (one without any data space is handled in default only); a create outside default needs definition.dataSpaceName) deploy by name: the complete transform list is read, no match creates, one match updates or is unchanged (the file equals the transform as retrieve writes it), a match that differs only in letter case is refused (TRANSFORM_IDENTITY_MISMATCH), two or more are refused (TRANSFORM_TARGET_NOT_RESOLVED). The file is sent as written and Salesforce decides, for a transform of any owner (Salesforce refuses writes to system transforms; a 4xx answer to the first write is reported as rejected); --allow-processing is not needed. Create is validated by Salesforce first; preview is GET-only. The optional schedule key of the file is the desired schedule: absent leaves the schedule alone; otherwise, when it differs from the org schedule as retrieve projects it, it is sent with one schedule PUT after the definition and read back, and an explicit {\"frequency\":\"None\"} turns it off (retrieve leaves the key out for a transform without a schedule). A deployed schedule makes the transform run in the target org (TRANSFORM_SCHEDULE_CHANGE in preview and deploy). No run writes. Several transforms deploy one after another in their phase, selected by member, file, directory or --changed-since. Exact data-stream:ApiName deploys canonical data360/data-stream/ApiName.data-stream-meta.json using auto/API68 in the run data space: its c__dataSpace list must name it and, for an existing stream, equal the data spaces of its DLO (a new stream lists the run data space alone, sent as the DLO dataspaceInfo of the create); data spaces change only through the DLO file (STREAM_DATASPACE_MISMATCH). An Ingestion API stream file is sent as written and Salesforce decides: create carries the primary key, the additive and formula mappings and the refresh mode (Salesforce creates UPSERT only); update sends new, changed and removed additive and formula mappings in one PATCH, a removed one as an empty formula (Salesforce refuses changing or removing an existing mapping; reported as rejected). Refused before any write: an additive mapping whose source label names no event field, or several (UNSUPPORTED_STREAM_MAPPING_SOURCE; Salesforce would store a mapping that never carries data), and a change of the refresh mode, DLO label, category, event time field or primary key (UNSUPPORTED_STREAM_SETTINGS_CHANGE; Salesforce answers 200 and keeps the old value). Create/update requires --allow-processing. A stream file of any other connector (connectorInfo.connectorType, for example SalesforceDotCom; only Salesforce CRM is tested live) is translated into the create input (GET spellings renamed, plain field mappings left out) and sent as written: absent (404) creates, otherwise one PATCH of datastreamType and the changed parts, or unchanged; Salesforce decides and its answer is reported (it refuses a CRM refresh mode change); a plain mapping change cannot be sent (UNSUPPORTED_STREAM_SETTINGS_CHANGE). A stream label change (CRM and Ingestion API) is sent as one Metadata API updateMetadata of the DataStreamDefinition of the stream (refusal STREAM_LABEL_UPDATE_REJECTED; a failed read of the record before it STREAM_LABEL_READ_FAILED, with nothing sent; a label still unchanged is STREAM_CHANGE_NOT_APPLIED). Generated target identities are independently resolved; mismatching label intent blocks. Requires explicit files/directories OR exact family:ApiName selectors OR --changed-since Git selection (every family; files deleted in the range are reported in result.selection.deletions and never deleted by deploy (sf data360 delete --changed-since deletes them)). Canonical native DLO/DMO/mapping/relationship JSON defaults to API68 (auto); numeric pins >=61 are retained without upgrade. Any mix of families runs in phases: data streams, then native DLO/DMO/mapping/relationship, then data transforms, then IR/CI/Segment, then data graphs; a phase starts only after every item of the previous phase settled, and the first blocked or failed item stops the run. A DLO file named like the landing DLO of a stream this deploy creates is refused after the read-only comparison of that stream and before any write (DATA_STREAM_DLO_COLLISION); beside an existing stream it deploys and Salesforce decides. Native mixed selections execute DLO then DMO then mapping then relationship, independently settling parents before mapping and relationship dependency checks. A selection with a mapping or relationship may also hold IR, CI and Segment inputs: they run afterwards in the ordered batch, only once every native item settled; preview reports items whose parent an earlier phase creates as planned-dependencies (DEPENDENCIES_PLANNED; MAPPING_DEPENDENCIES_PLANNED for a mapping): a mapping or transform on the landing DLO of a stream preview creates, items on a DLO or DMO the native phase creates, and a graph on a DMO or IR output created earlier. An IR runs before a CI or Segment that uses its unified or link DMO (name derived from the ruleset file), and those start only after the IR is PUBLISHED. A relationship (relationship:Name, data360/relationship/Name.relationship-meta.json) is matched to the org by the name in the file, otherwise by its binding (source DMO and field, target object and field; the target may be a DMO or a CRM object with owner SObject): absent is created with one POST and read back until ACTIVE (a stated label is then set), present with the values of the file (and stated label) is unchanged, and other values are sent as one Metadata API updateMetadata of the whole FieldSrcTrgtRelationship record over the connection of the command and read back (updated); Salesforce decides, and its refusal is RELATIONSHIP_UPDATE_REJECTED (it accepts label, cardinality, source and target field, not target object or owner); after an UNKNOWN_EXCEPTION answer the relationship is read again and, if unchanged, the update is sent once more. Deploy never deletes relationships. The source DMO and a target DMO must be mapped; otherwise Salesforce answers 400 and that answer is reported. Mapping uses exact mapping:ApiName from data360/mapping/ApiName.mapping-meta.json, unique target binding lookup and server-generated target names; create and unchanged repeats are supported; desired-state updates at native API 61 and up remove the authored pairs the file drops, one at a time, then add the new pairs in one batch; any data type, same-name or not, and one source onto several targets are sent as listed and Salesforce decides (preview names pairs of different data types with MAPPING_FIELD_TYPES_DIFFER). The key pair, its key-qualifier pair and the system pairs are never removed (MAPPING_PROTECTED_PAIR_REQUIRED when a file drops one; MAPPING_PROTECTED_LAYOUT_UNPROVEN when the key pair cannot be identified). Generated/key pairs and retained selectors are protected. A pair is removed even when another mapping of the same DMO targets the same field; the field stays mapped until the last such pair is gone. The optional label of a mapping file (spec.label; absent leaves the org label alone) is compared with the org label read through the Metadata API; when it differs, one Metadata API updateMetadata of the ObjectSourceTargetMap record is sent after the create or pair writes settled, carrying the new label and every pair the mapping currently has and no other (a pair left out is kept, a pair sent is added), and the label and pairs are read back; preview shows the planned change (labelChange). A refusal is MAPPING_LABEL_UPDATE_REJECTED (rejected when the label is the only change, unknown after other writes); a failed read MAPPING_LABEL_READ_FAILED. Any DMO may be the mapping target and Salesforce decides (it refuses platform-generated DMOs; that answer is reported). On a target other than an unprefixed custom DMO the generated system and key qualifier pairs are recognised from the target read and never sent, and the first mapping onto a standard DMO (creationType Standard) that is not yet enabled activates it permanently: preview and create carry the notice MAPPING_ACTIVATES_STANDARD_DMO without changing outcome or exit status. Qualification is limited to empty custom fixtures; populated-data behavior is not established. Preview never writes and reports planned dependencies without claiming nonexistent parents are ready. A native DMO changed since a Git reference or selected beside Segment/CI/IR inputs joins the ordered batch on the native route. Prerequisites are checked, never pulled in: each must be selected explicitly or already exist in the target. Native DMO target-name lookup selects confirmed-404 POST or existing-name PATCH with independent GET confirmation. A custom DMO field missing from the file blocks the update unless --allow-field-removal is set; then one Metadata API destructive change for CustomField removes those fields after the PATCH, and readback confirms their absence. A mapped field is removed only when the same selection contains every mapping holding its pair and each mapping file omits that pair; all-native selections check this before the first write (DMO_FIELD_REMOVAL_MAPPED otherwise), then remove the field in the DMO position with one Metadata API destructive change. Salesforce drops the mapping pairs of the field with it; reads before and after confirm that exactly those pairs went and nothing else changed (DMO_FIELD_REMOVAL_SIDE_EFFECT otherwise), and the mappings deployed afterwards find the pairs already gone. A deploy never removes the primary key or a standard, system or generated field: retrieve leaves generated fields out of the file, so a field missing from the file is kept. Platform-owned fields are removed only with sf data360 delete --field. An existing DMO other than an unprefixed custom one (a standard DMO, a platform-generated one such as Derived, Bridge or Adg, or a namespaced custom DMO) takes custom-field additions, label edits and removals plus object label and description changes only: its standard, system and generated fields are never sent or removed by a deploy, may be absent from the file and must match the target when listed (UNSUPPORTED_DMO_FIELD_CHANGE); a new field must be a plain custom field (UNSUPPORTED_DMO_FIELD_ADDITION); its category is ignored and its label is sent only when it differs. A new namespaced name is refused (UNSUPPORTED_DMO_TARGET); Salesforce answers for the rest. Native DLOs use dlo:Name__dll from data360/dlo/Name__dll.dlo-meta.json, whose top-level c__dataSpace list names every data space of the DLO and must hold the run data space (DLO_DATASPACE_MISMATCH); before any read or write the run data space and every listed name are checked against the org (one GET /ssot/data-spaces; UNKNOWN_DATASPACE). A new DLO is created in the run data space, then added to the other listed ones; an existing one is added to listed data spaces it is not in (one PUT naming only this DLO, which keeps every other member, then the DLO is read until it lists them) and removed from unlisted ones only with --allow-dataspace-removal (DLO_DATASPACE_REMOVAL_NOT_ALLOWED otherwise). Target lookup selects PATCH by target ID, or POST only on confirmed HTTP404; auth/permission/lookup failures stop. Preview is read-only; native DLO deploy does not require --allow-processing. Inventory is unavailable. Graph artifacts (*.native-dataGraph.json) use native API68 (auto or explicit 68.0; other versions are rejected) in the run data space (c__dataSpace; definition.dataspaceName, when present, must equal it, and the create sends it; a file of another data space, or an org graph of that name in another one, is DATA_GRAPH_DATASPACE_MISMATCH before any write; a root DMO the read names in another data space is DATA_GRAPH_DEPENDENCY_OTHER_DATASPACE): confirmed absence creates with --allow-processing; an existing graph is updated with one PUT of the file as written, confirmed by independent ready reads; Salesforce decides and a 4xx answer is reported as rejected (it refuses removed fields and related objects, a root change and another related object in place of an existing one). Key-qualifier fields Salesforce added are kept when the file leaves them out. A join change of an existing related object is refused before any write (DATA_GRAPH_JOIN_CHANGE), because Salesforce accepts it but keeps the old join; a graph read back with another join than sent is DATA_GRAPH_CHANGE_NOT_APPLIED. Settings the file leaves out keep their org values; clearing one needs an explicit value. Name and data space identify the graph: a file with another name creates or addresses another graph, and the old graph is not renamed. Identical ready configuration is unchanged without acknowledgement. --wait-timeout sets the native Graph invocation budget in integer seconds (default 1800); readiness retries wait at least 20 seconds with stderr progress. Processing can take seconds to many minutes, up to 30 minutes depending on objects, fields, data volume and service load. In a mixed deploy graphs run last; a graph whose root or related object is the unified or link DMO of a selected IR starts only after that IR is PUBLISHED. --wait-timeout applies to every graph and needs at least one graph in the selection. Calculated insights (calculated-insight:Name__cio, data360/calculatedInsights/Name__cio.calculatedInsight-meta.json joined with its .calculatedInsight-meta.sql) use auto or 68.0 in the run data space, which c__dataSpace in the JSON must name (CI_DATASPACE_MISMATCH); c__dataSpace is sent as dataSpaceName in every create and update. The insight is read by name: absent (HTTP 404) creates it with one POST, present is unchanged when the org holds every key of the file and is updated with one PATCH otherwise; afterwards it is read until it holds the file. The file is sent as written and Salesforce decides (a 4xx answer is reported as rejected); only what the create/update input names differently is translated: dataSpace as dataSpaceName, isFromPackage as createdFromPackage, sourceCiDevName as sourceDeveloperName, UPPER_SNAKE values of definitionType, publishScheduleInterval, historyPublishScheduleInterval and queryDialect as PascalCase, null values are left out, and a PATCH leaves out a definitionType equal to the org value (Salesforce refuses any definitionType on PATCH). The insight runs after the selected DMOs, IRs and insights its SQL names. --draft creates a draft and sends draft: true on update; an update of a DRAFT insight stays a draft. Publication is never implicit (sf data360 publish). --allow-processing is not needed. Repeated selections coalesce. Bare types and implicit deploy-all are forbidden. Preview is strictly read-only. Each phase stage preflights all of its own items before its first write: a batch of Segment, CI or IR inputs (with DLO/DMO beside them when no mapping or relationship is selected) is preflighted as a whole, and an IR dependent stage only after the IR is PUBLISHED; all-native DLO/DMO/mapping execution admits each ordered item only after earlier parents settle. In a selection that also holds a mapping or relationship, only the local checks of the IR/CI/Segment inputs (version, data space, file shape, dependency identities and order) run before the native writes; their Git snapshot, prerequisite and target checks run in their later stage, so a blocker there can follow earlier native writes, which stay reported. Preview runs every stage read-only, also after a blocked one. Segment (segment:Name, the portable Name.segment.json joined with one Name.segment.<model>.sql per model; a missing or extra SQL file or SQL left in the JSON is INVALID_SOURCE) uses auto or 68.0 in the run data space, which c__dataSpace must name (SEGMENT_DATASPACE_MISMATCH); its segmentOn DMO and Waterfall children are in the same data space (SEGMENT_DEPENDENCY_OTHER_DATASPACE). The file carries the name Salesforce stores (<prefix>_<Name> in a non-default data space; a name without the prefix is SEGMENT_NAME_NOT_STORED), sent unchanged; the create names the data space (?dataspace=). Other versions are refused (INVALID_SCOPE). It is read by its exact name: absent (HTTP 404 ITEM_NOT_FOUND) creates it with one POST, present updates it with one PATCH or is unchanged. The authored definition (label, description, segmentOn DMO, DBT SQL models, UI criteria or another segment type, lookback) is sent as written and Salesforce decides; its error is reported. The optional schedule key of the file is the desired refresh schedule: absent leaves the schedule alone; otherwise, when it differs from the org schedule as retrieve projects it, the POST or PATCH carries it, and an explicit {\"frequency\":\"None\"} turns it off (Salesforce refuses that for DBT segments; retrieve leaves the key out for a segment without a schedule). A deployed schedule makes the segment publish in the target org (SEGMENT_SCHEDULE_CHANGE in preview and deploy). The segmentOn DMO must exist (one native read binds its ID for the readback). A Waterfall file lists its child segments by API name (childSegments): each is read in the target and sent by its ID there, a selected child is deployed first (preview: planned-dependencies), and the children the selection does not hold are read before the first write of the run, so a child neither in the target nor selected stops it before any write (SEGMENT_CHILD_NOT_FOUND); a file without childSegments keeps the children of the org segment. Create and update require --allow-processing; identical configuration is unchanged without acknowledgement. Parameters have no write in the API, so a segment with parameters is retrieved as-is (UNSUPPORTED_SEGMENT_VARIANT). Segment XML is unsupported input. Segment deletion is separate: sf data360 delete -m segment:Name reads the segment from the org by name and runs fresh checks. Native IR uses auto or numeric68 in the run data space (c__dataSpace; every DMO, field, DLO source and output it names is in that data space, named as stored there, ds2_Individual__dlm with FirstName__c outside default; the ruleset name is <prefix>_<type>_<rulesetId> outside default, IDENTITY_RESOLUTION_NAME_NOT_STORED before any write otherwise; a ruleset or component of another data space is IDENTITY_RESOLUTION_DATASPACE_MISMATCH or IDENTITY_RESOLUTION_DEPENDENCY_OTHER_DATASPACE): confirmed exact absence supports CREATE with --allow-processing acknowledging processing and generated-output provisioning; existing settled owners support complete matching and reconciliation PATCH with --allow-processing or read-only identical no-op without acknowledgement. Ordered source priorities, object defaults and explicit field overrides are preserved; fields:[] restores inheritance. Automatic run, explicit run and delete are unsupported; no API67 fallback is attempted. --async (IR only) returns as soon as Salesforce accepts an IR create or update (creation-processing / update-processing, mutation acknowledged-processing) instead of waiting minutes for PUBLISHED: publish, settings and generated outputs are not confirmed; rerun the same deploy to check (IDENTITY_RESOLUTION_NOT_SETTLED while in flight, unchanged once settled). --async is refused when the selection holds a graph, CI or Segment on the unified DMO of that IR (IDENTITY_RESOLUTION_ASYNC_DEPENDENTS). Selections mixing IR with other non-native families require auto. Other changes block before writes. Stops on first blocked or failed item; no retry or rollback. No local report/artifact writes.";
|
|
204
|
+
static readonly description = "Data transforms (data-transform:Name, data360/dataTransforms/Name.dataTransform.json, auto/API68, in the run data space: c__dataSpace must name it and equal definition.dataSpaceName when the definition names one; TRANSFORM_DATASPACE_MISMATCH otherwise, also for an org transform of that name in another data space, resolved from its dataSpaceName or, without one, from its MktDataTransform record read with SOQL (one without any data space is handled in default only); a create outside default needs definition.dataSpaceName) deploy by name: the complete transform list is read, no match creates, one match updates or is unchanged (the file equals the transform as retrieve writes it), a match that differs only in letter case is refused (TRANSFORM_IDENTITY_MISMATCH), two or more are refused (TRANSFORM_TARGET_NOT_RESOLVED). The file is sent as written and Salesforce decides, for a transform of any owner (Salesforce refuses writes to system transforms; a 4xx answer to the first write is reported as rejected); --allow-processing is not needed. Create is validated by Salesforce first; preview is GET-only. The optional schedule key of the file is the desired schedule: absent leaves the schedule alone; otherwise, when it differs from the org schedule as retrieve projects it, it is sent with one schedule PUT after the definition and read back, and an explicit {\"frequency\":\"None\"} turns it off (retrieve leaves the key out for a transform without a schedule). A deployed schedule makes the transform run in the target org (TRANSFORM_SCHEDULE_CHANGE in preview and deploy). No run writes. Several transforms deploy one after another in their phase, selected by member, file, directory or --changed-since. Exact data-stream:ApiName deploys canonical data360/data-stream/ApiName.data-stream-meta.json using auto/API68 in the run data space: its c__dataSpace list must name it and, for an existing stream, equal the data spaces of its DLO (a new stream lists the run data space alone, sent as the DLO dataspaceInfo of the create); data spaces change only through the DLO file (STREAM_DATASPACE_MISMATCH). An Ingestion API stream file is sent as written and Salesforce decides: create carries the primary key, the additive and formula mappings and the refresh mode (Salesforce creates UPSERT only); update sends new, changed and removed additive and formula mappings in one PATCH, a removed one as an empty formula (Salesforce refuses changing or removing an existing mapping; reported as rejected). Refused before any write: an additive mapping whose source label names no event field, or several (UNSUPPORTED_STREAM_MAPPING_SOURCE; Salesforce would store a mapping that never carries data), and a change of the refresh mode, DLO label, category, event time field or primary key (UNSUPPORTED_STREAM_SETTINGS_CHANGE; Salesforce answers 200 and keeps the old value). Create/update requires --allow-processing. A stream file of any other connector (connectorInfo.connectorType, for example SalesforceDotCom; only Salesforce CRM is tested live) is translated into the create input (GET spellings renamed, plain field mappings left out) and sent as written: absent (404) creates, otherwise one PATCH of datastreamType and the changed parts, or unchanged; Salesforce decides and its answer is reported (it refuses a CRM refresh mode change); a plain mapping change cannot be sent (UNSUPPORTED_STREAM_SETTINGS_CHANGE). A stream label change (CRM and Ingestion API) is sent as one Metadata API updateMetadata of the DataStreamDefinition of the stream (refusal STREAM_LABEL_UPDATE_REJECTED; a failed read of the record before it STREAM_LABEL_READ_FAILED, with nothing sent; a label still unchanged is STREAM_CHANGE_NOT_APPLIED). Generated target identities are independently resolved; mismatching label intent blocks. Requires explicit files/directories OR exact family:ApiName selectors OR --changed-since Git selection (every family; files deleted in the range are reported in result.selection.deletions and never deleted by deploy (sf data360 delete --changed-since deletes them)). Canonical native DLO/DMO/mapping/relationship JSON defaults to API68 (auto); numeric pins >=61 are retained without upgrade. Any mix of families runs in phases: data streams, then native DLO/DMO/mapping/relationship, then data transforms, then IR/CI/Segment, then data graphs; a phase starts only after every item of the previous phase settled, and the first blocked or failed item stops the run. A DLO file named like the landing DLO of a stream this deploy creates is refused after the read-only comparison of that stream and before any write (DATA_STREAM_DLO_COLLISION); beside an existing stream it deploys and Salesforce decides. Native mixed selections execute DLO then DMO then mapping then relationship, independently settling parents before mapping and relationship dependency checks. A selection with a mapping or relationship may also hold IR, CI and Segment inputs: they run afterwards in the ordered batch, only once every native item settled; preview reports items whose parent an earlier phase creates as planned-dependencies (DEPENDENCIES_PLANNED; MAPPING_DEPENDENCIES_PLANNED for a mapping): a mapping or transform on the landing DLO of a stream preview creates, items on a DLO or DMO the native phase creates, and a graph on a DMO or IR output created earlier. An IR runs before a CI or Segment that uses its unified or link DMO (name derived from the ruleset file), and those start only after the IR is PUBLISHED. A relationship (relationship:Name, data360/relationship/Name.relationship-meta.json) is matched to the org by the name in the file, otherwise by its binding (source DMO and field, target object and field; the target may be a DMO or a CRM object with owner SObject): absent is created with one POST and read back until ACTIVE (a stated label is then set), present with the values of the file (and stated label) is unchanged, and other values are sent as one Metadata API updateMetadata of the whole FieldSrcTrgtRelationship record over the connection of the command and read back (updated); Salesforce decides, and its refusal is RELATIONSHIP_UPDATE_REJECTED (it accepts label, cardinality, source and target field, not target object or owner); after an UNKNOWN_EXCEPTION answer the relationship is read again and, if unchanged, the update is sent once more. Deploy never deletes relationships. The source DMO and a target DMO must be mapped; otherwise Salesforce answers 400 and that answer is reported. Mapping uses exact mapping:ApiName from data360/mapping/ApiName.mapping-meta.json, unique target binding lookup and server-generated target names; create and unchanged repeats are supported; desired-state updates at native API 61 and up remove the authored pairs the file drops, one at a time, then add the new pairs in one batch; any data type, same-name or not, and one source onto several targets are sent as listed and Salesforce decides (preview names pairs of different data types with MAPPING_FIELD_TYPES_DIFFER). The key pair, its key-qualifier pair and the system pairs are never removed (MAPPING_PROTECTED_PAIR_REQUIRED when a file drops one; MAPPING_PROTECTED_LAYOUT_UNPROVEN when the key pair cannot be identified). Generated/key pairs and retained selectors are protected. A pair is removed even when another mapping of the same DMO targets the same field; the field stays mapped until the last such pair is gone. The optional label of a mapping file (spec.label; absent leaves the org label alone) is compared with the org label read through the Metadata API; when it differs, one Metadata API updateMetadata of the ObjectSourceTargetMap record is sent after the create or pair writes settled, carrying the new label and every pair the mapping currently has and no other (a pair left out is kept, a pair sent is added), and the label and pairs are read back; preview shows the planned change (labelChange). A refusal is MAPPING_LABEL_UPDATE_REJECTED (rejected when the label is the only change, unknown after other writes); a failed read MAPPING_LABEL_READ_FAILED. Any DMO may be the mapping target and Salesforce decides (it refuses platform-generated DMOs; that answer is reported). On a target other than an unprefixed custom DMO the generated system and key qualifier pairs are recognised from the target read and never sent, and the first mapping onto a standard DMO (creationType Standard) that is not yet enabled activates it permanently: preview and create carry the notice MAPPING_ACTIVATES_STANDARD_DMO without changing outcome or exit status. Qualification is limited to empty custom fixtures; populated-data behavior is not established. Preview never writes and reports planned dependencies without claiming nonexistent parents are ready. A native DMO changed since a Git reference or selected beside Segment/CI/IR inputs joins the ordered batch on the native route. Prerequisites are checked, never pulled in: each must be selected explicitly or already exist in the target. Native DMO target-name lookup selects confirmed-404 POST or existing-name PATCH with independent GET confirmation. A custom DMO field missing from the file blocks the update unless --allow-field-removal is set; then one Metadata API destructive change for CustomField removes those fields after the PATCH, and readback confirms their absence. A mapped field is removed only when the same selection contains every mapping holding its pair and each mapping file omits that pair; all-native selections check this before the first write (DMO_FIELD_REMOVAL_MAPPED otherwise), then remove the field in the DMO position with one Metadata API destructive change. Salesforce drops the mapping pairs of the field with it; reads before and after confirm that exactly those pairs went and nothing else changed (DMO_FIELD_REMOVAL_SIDE_EFFECT otherwise), and the mappings deployed afterwards find the pairs already gone. A deploy never removes the primary key or a standard, system or generated field: retrieve leaves generated fields out of the file, so a field missing from the file is kept. Platform-owned fields are removed only with sf data360 delete --field. An existing DMO other than an unprefixed custom one (a standard DMO, a platform-generated one such as Derived, Bridge or Adg, or a namespaced custom DMO) takes custom-field additions, label edits and removals plus object label and description changes only: its standard, system and generated fields are never sent or removed by a deploy, may be absent from the file and must match the target when listed (UNSUPPORTED_DMO_FIELD_CHANGE); a new field must be a plain custom field (UNSUPPORTED_DMO_FIELD_ADDITION); its category is ignored and its label is sent only when it differs. A new namespaced name is refused (UNSUPPORTED_DMO_TARGET); Salesforce answers for the rest. Native DLOs use dlo:Name__dll from data360/dlo/Name__dll.dlo-meta.json, whose top-level c__dataSpace list names every data space of the DLO and must hold the run data space (DLO_DATASPACE_MISMATCH); before any read or write the run data space and every listed name are checked against the org (one GET /ssot/data-spaces; UNKNOWN_DATASPACE). A new DLO is created in the run data space, then added to the other listed ones; an existing one is added to listed data spaces it is not in (one PUT naming only this DLO, which keeps every other member, then the DLO is read until it lists them) and removed from unlisted ones only with --allow-dataspace-removal (DLO_DATASPACE_REMOVAL_NOT_ALLOWED otherwise). Target lookup selects PATCH by target ID, or POST only on confirmed HTTP404; auth/permission/lookup failures stop. Preview is read-only; native DLO deploy does not require --allow-processing. Inventory is unavailable. Graph artifacts (*.native-dataGraph.json) use native API68 (auto or explicit 68.0; other versions are rejected) in the run data space (c__dataSpace; definition.dataspaceName, when present, must equal it, and the create sends it; a file of another data space, or an org graph of that name in another one, is DATA_GRAPH_DATASPACE_MISMATCH before any write; a root DMO the read names in another data space is DATA_GRAPH_DEPENDENCY_OTHER_DATASPACE): confirmed absence creates with --allow-processing; an existing graph is updated with one PUT of the file as written, confirmed by independent ready reads; Salesforce decides and a 4xx answer is reported as rejected (it refuses removed fields and related objects, a root change and another related object in place of an existing one). Key-qualifier fields Salesforce added are kept when the file leaves them out. A join change of an existing related object is refused before any write (DATA_GRAPH_JOIN_CHANGE), because Salesforce accepts it but keeps the old join; a graph read back with another join than sent is DATA_GRAPH_CHANGE_NOT_APPLIED. Settings the file leaves out keep their org values; clearing one needs an explicit value. Name and data space identify the graph: a file with another name creates or addresses another graph, and the old graph is not renamed. Identical ready configuration is unchanged without acknowledgement. --wait (-w) sets the native Graph invocation budget in whole minutes (default 30); readiness retries wait at least 20 seconds with stderr progress. Processing can take seconds to many minutes, up to 30 minutes depending on objects, fields, data volume and service load. In a mixed deploy graphs run last; a graph whose root or related object is the unified or link DMO of a selected IR starts only after that IR is PUBLISHED. --wait applies to every graph and needs at least one graph in the selection. Calculated insights (calculated-insight:Name__cio, data360/calculatedInsights/Name__cio.calculatedInsight-meta.json joined with its .calculatedInsight-meta.sql) use auto or 68.0 in the run data space, which c__dataSpace in the JSON must name (CI_DATASPACE_MISMATCH); c__dataSpace is sent as dataSpaceName in every create and update. The insight is read by name: absent (HTTP 404) creates it with one POST, present is unchanged when the org holds every key of the file and is updated with one PATCH otherwise; afterwards it is read until it holds the file. The file is sent as written and Salesforce decides (a 4xx answer is reported as rejected); only what the create/update input names differently is translated: dataSpace as dataSpaceName, isFromPackage as createdFromPackage, sourceCiDevName as sourceDeveloperName, UPPER_SNAKE values of definitionType, publishScheduleInterval, historyPublishScheduleInterval and queryDialect as PascalCase, null values are left out, and a PATCH leaves out a definitionType equal to the org value (Salesforce refuses any definitionType on PATCH). The insight runs after the selected DMOs, IRs and insights its SQL names. --draft creates a draft and sends draft: true on update; an update of a DRAFT insight stays a draft. Publication is never implicit (sf data360 publish). --allow-processing is not needed. Repeated selections coalesce. Bare types and implicit deploy-all are forbidden. Preview is strictly read-only. Each phase stage preflights all of its own items before its first write: a batch of Segment, CI or IR inputs (with DLO/DMO beside them when no mapping or relationship is selected) is preflighted as a whole, and an IR dependent stage only after the IR is PUBLISHED; all-native DLO/DMO/mapping execution admits each ordered item only after earlier parents settle. In a selection that also holds a mapping or relationship, only the local checks of the IR/CI/Segment inputs (version, data space, file shape, dependency identities and order) run before the native writes; their Git snapshot, prerequisite and target checks run in their later stage, so a blocker there can follow earlier native writes, which stay reported. Preview runs every stage read-only, also after a blocked one. Segment (segment:Name, the portable Name.segment.json joined with one Name.segment.<model>.sql per model; a missing or extra SQL file or SQL left in the JSON is INVALID_SOURCE) uses auto or 68.0 in the run data space, which c__dataSpace must name (SEGMENT_DATASPACE_MISMATCH); its segmentOn DMO and Waterfall children are in the same data space (SEGMENT_DEPENDENCY_OTHER_DATASPACE). The file carries the name Salesforce stores (<prefix>_<Name> in a non-default data space; a name without the prefix is SEGMENT_NAME_NOT_STORED), sent unchanged; the create names the data space (?dataspace=). Other versions are refused (INVALID_SCOPE). It is read by its exact name: absent (HTTP 404 ITEM_NOT_FOUND) creates it with one POST, present updates it with one PATCH or is unchanged. The authored definition (label, description, segmentOn DMO, DBT SQL models, UI criteria or another segment type, lookback) is sent as written and Salesforce decides; its error is reported. The optional schedule key of the file is the desired refresh schedule: absent leaves the schedule alone; otherwise, when it differs from the org schedule as retrieve projects it, the POST or PATCH carries it, and an explicit {\"frequency\":\"None\"} turns it off (Salesforce refuses that for DBT segments; retrieve leaves the key out for a segment without a schedule). A deployed schedule makes the segment publish in the target org (SEGMENT_SCHEDULE_CHANGE in preview and deploy). The segmentOn DMO must exist (one native read binds its ID for the readback). A Waterfall file lists its child segments by API name (childSegments): each is read in the target and sent by its ID there, a selected child is deployed first (preview: planned-dependencies), and the children the selection does not hold are read before the first write of the run, so a child neither in the target nor selected stops it before any write (SEGMENT_CHILD_NOT_FOUND); a file without childSegments keeps the children of the org segment. Create and update require --allow-processing; identical configuration is unchanged without acknowledgement. Parameters have no write in the API, so a segment with parameters is retrieved as-is (UNSUPPORTED_SEGMENT_VARIANT). Segment XML is unsupported input. Segment deletion is separate: sf data360 delete -m segment:Name reads the segment from the org by name and runs fresh checks. Native IR uses auto or numeric68 in the run data space (c__dataSpace; every DMO, field, DLO source and output it names is in that data space, named as stored there, ds2_Individual__dlm with FirstName__c outside default; the ruleset name is <prefix>_<type>_<rulesetId> outside default, IDENTITY_RESOLUTION_NAME_NOT_STORED before any write otherwise; a ruleset or component of another data space is IDENTITY_RESOLUTION_DATASPACE_MISMATCH or IDENTITY_RESOLUTION_DEPENDENCY_OTHER_DATASPACE): confirmed exact absence supports CREATE with --allow-processing acknowledging processing and generated-output provisioning; existing settled owners support complete matching and reconciliation PATCH with --allow-processing or read-only identical no-op without acknowledgement. Ordered source priorities, object defaults and explicit field overrides are preserved; fields:[] restores inheritance. Automatic run, explicit run and delete are unsupported; no API67 fallback is attempted. --async (IR only) returns as soon as Salesforce accepts an IR create or update (creation-processing / update-processing, mutation acknowledged-processing) instead of waiting minutes for PUBLISHED: publish, settings and generated outputs are not confirmed; rerun the same deploy to check (IDENTITY_RESOLUTION_NOT_SETTLED while in flight, unchanged once settled). --async is refused when the selection holds a graph, CI or Segment on the unified DMO of that IR (IDENTITY_RESOLUTION_ASYNC_DEPENDENTS). Selections mixing IR with other non-native families require auto. Other changes block before writes. Stops on first blocked or failed item; no retry or rollback. No local report/artifact writes.";
|
|
205
205
|
static readonly flags: {
|
|
206
206
|
'target-org': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
207
207
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -214,10 +214,22 @@ export default class Deploy extends SfCommand<DeployEnvelope> {
|
|
|
214
214
|
'allow-cross-dataspace': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
215
215
|
'allow-dataspace-removal': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
216
216
|
async: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
217
|
-
|
|
217
|
+
wait: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
218
218
|
draft: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
219
219
|
preview: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
220
220
|
};
|
|
221
|
+
/**
|
|
222
|
+
* Report data graph progress while the deploy waits. oclif logToStderr suppresses output in
|
|
223
|
+
* JSON mode; progress must remain visible.
|
|
224
|
+
* @param {string} message One progress line.
|
|
225
|
+
*/
|
|
226
|
+
protected graphProgress(message: string): void;
|
|
227
|
+
/**
|
|
228
|
+
* The project root: where data360/ lives, relative --source-dir paths resolve and the Git
|
|
229
|
+
* selection runs. The CLI uses the current directory.
|
|
230
|
+
* @returns {string} Absolute project root.
|
|
231
|
+
*/
|
|
232
|
+
protected projectDirectory(): string;
|
|
221
233
|
protected createDataTransformClient: typeof createDataTransformClient;
|
|
222
234
|
protected preflightDataTransform: typeof preflightDataTransformDeploy;
|
|
223
235
|
protected executeDataTransform: typeof executeDataTransformDeploy;
|