sf-plugin-data 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +589 -2
- package/bin/run.js +4 -0
- package/docs/artifact-format.md +527 -0
- package/docs/capabilities.md +1208 -0
- package/docs/git-workflow.md +160 -0
- package/docs/handover.md +10446 -0
- package/lib/api.d.ts +7 -0
- package/lib/api.js +7 -0
- package/lib/artifacts/code-fields.d.ts +49 -0
- package/lib/artifacts/code-fields.js +142 -0
- package/lib/artifacts/data-graph-document.d.ts +29 -0
- package/lib/artifacts/data-graph-document.js +52 -0
- package/lib/artifacts/data-space-field.d.ts +65 -0
- package/lib/artifacts/data-space-field.js +98 -0
- package/lib/artifacts/data-stream-document.d.ts +264 -0
- package/lib/artifacts/data-stream-document.js +680 -0
- package/lib/artifacts/data-transform-document.d.ts +152 -0
- package/lib/artifacts/data-transform-document.js +560 -0
- package/lib/artifacts/dependency-selection.d.ts +51 -0
- package/lib/artifacts/dependency-selection.js +154 -0
- package/lib/artifacts/dlo-document.d.ts +93 -0
- package/lib/artifacts/dlo-document.js +253 -0
- package/lib/artifacts/enum-case.d.ts +39 -0
- package/lib/artifacts/enum-case.js +67 -0
- package/lib/artifacts/git-deploy-selection.d.ts +68 -0
- package/lib/artifacts/git-deploy-selection.js +474 -0
- package/lib/artifacts/identity-resolution-document.d.ts +133 -0
- package/lib/artifacts/identity-resolution-document.js +625 -0
- package/lib/artifacts/mapping-document.d.ts +1 -0
- package/lib/artifacts/mapping-document.js +1 -0
- package/lib/artifacts/native-calculated-insight-document.d.ts +142 -0
- package/lib/artifacts/native-calculated-insight-document.js +321 -0
- package/lib/artifacts/native-data-graph-document.d.ts +124 -0
- package/lib/artifacts/native-data-graph-document.js +780 -0
- package/lib/artifacts/native-dmo-document.d.ts +151 -0
- package/lib/artifacts/native-dmo-document.js +313 -0
- package/lib/artifacts/native-mapping-document.d.ts +67 -0
- package/lib/artifacts/native-mapping-document.js +187 -0
- package/lib/artifacts/native-relationship-document.d.ts +76 -0
- package/lib/artifacts/native-relationship-document.js +232 -0
- package/lib/artifacts/path-selector.d.ts +55 -0
- package/lib/artifacts/path-selector.js +167 -0
- package/lib/artifacts/read-deploy-input.d.ts +239 -0
- package/lib/artifacts/read-deploy-input.js +1359 -0
- package/lib/artifacts/segment-document.d.ts +183 -0
- package/lib/artifacts/segment-document.js +570 -0
- package/lib/artifacts/verbatim-document.d.ts +203 -0
- package/lib/artifacts/verbatim-document.js +339 -0
- package/lib/artifacts/write-data-graph.d.ts +17 -0
- package/lib/artifacts/write-data-graph.js +162 -0
- package/lib/artifacts/write-data-stream.d.ts +11 -0
- package/lib/artifacts/write-data-stream.js +175 -0
- package/lib/artifacts/write-data-transform.d.ts +11 -0
- package/lib/artifacts/write-data-transform.js +180 -0
- package/lib/artifacts/write-dlo.d.ts +11 -0
- package/lib/artifacts/write-dlo.js +158 -0
- package/lib/artifacts/write-identity-resolution.d.ts +18 -0
- package/lib/artifacts/write-identity-resolution.js +165 -0
- package/lib/artifacts/write-mapping-definition.d.ts +17 -0
- package/lib/artifacts/write-mapping-definition.js +127 -0
- package/lib/artifacts/write-member-export.d.ts +88 -0
- package/lib/artifacts/write-member-export.js +199 -0
- package/lib/artifacts/write-native-calculated-insight.d.ts +21 -0
- package/lib/artifacts/write-native-calculated-insight.js +176 -0
- package/lib/artifacts/write-native-dmo.d.ts +11 -0
- package/lib/artifacts/write-native-dmo.js +158 -0
- package/lib/artifacts/write-native-mapping.d.ts +11 -0
- package/lib/artifacts/write-native-mapping.js +157 -0
- package/lib/artifacts/write-native-relationship.d.ts +11 -0
- package/lib/artifacts/write-native-relationship.js +157 -0
- package/lib/artifacts/write-segment.d.ts +26 -0
- package/lib/artifacts/write-segment.js +212 -0
- package/lib/commands/data360/delete.d.ts +280 -0
- package/lib/commands/data360/delete.js +2297 -0
- package/lib/commands/data360/deploy.d.ts +303 -0
- package/lib/commands/data360/deploy.js +2400 -0
- package/lib/commands/data360/publish.d.ts +93 -0
- package/lib/commands/data360/publish.js +292 -0
- package/lib/commands/data360/retrieve.d.ts +322 -0
- package/lib/commands/data360/retrieve.js +1963 -0
- package/lib/commands/data360/segment/members/export.d.ts +101 -0
- package/lib/commands/data360/segment/members/export.js +318 -0
- package/lib/errors/codes/calculated-insight.d.ts +2 -0
- package/lib/errors/codes/calculated-insight.js +25 -0
- package/lib/errors/codes/data-graph.d.ts +2 -0
- package/lib/errors/codes/data-graph.js +22 -0
- package/lib/errors/codes/data-stream.d.ts +2 -0
- package/lib/errors/codes/data-stream.js +70 -0
- package/lib/errors/codes/data-transform.d.ts +2 -0
- package/lib/errors/codes/data-transform.js +35 -0
- package/lib/errors/codes/dependency.d.ts +2 -0
- package/lib/errors/codes/dependency.js +11 -0
- package/lib/errors/codes/dlo.d.ts +2 -0
- package/lib/errors/codes/dlo.js +31 -0
- package/lib/errors/codes/dmo.d.ts +2 -0
- package/lib/errors/codes/dmo.js +28 -0
- package/lib/errors/codes/general.d.ts +2 -0
- package/lib/errors/codes/general.js +57 -0
- package/lib/errors/codes/identity-resolution.d.ts +2 -0
- package/lib/errors/codes/identity-resolution.js +24 -0
- package/lib/errors/codes/mapping.d.ts +2 -0
- package/lib/errors/codes/mapping.js +42 -0
- package/lib/errors/codes/relationship.d.ts +2 -0
- package/lib/errors/codes/relationship.js +21 -0
- package/lib/errors/codes/segment.d.ts +2 -0
- package/lib/errors/codes/segment.js +49 -0
- package/lib/errors/registry.d.ts +60 -0
- package/lib/errors/registry.js +123 -0
- package/lib/plugin.d.ts +5 -0
- package/lib/plugin.js +5 -0
- package/lib/services/acquire-retrieve-selection.d.ts +43 -0
- package/lib/services/acquire-retrieve-selection.js +145 -0
- package/lib/services/bind-identity-resolution-dependencies.d.ts +53 -0
- package/lib/services/bind-identity-resolution-dependencies.js +238 -0
- package/lib/services/bind-segment-dependencies.d.ts +49 -0
- package/lib/services/bind-segment-dependencies.js +115 -0
- package/lib/services/bounded-reads.d.ts +17 -0
- package/lib/services/bounded-reads.js +42 -0
- package/lib/services/calculated-insight-sql-checks.d.ts +33 -0
- package/lib/services/calculated-insight-sql-checks.js +193 -0
- package/lib/services/command-dlo.d.ts +48 -0
- package/lib/services/command-dlo.js +103 -0
- package/lib/services/command-native-data-graph.d.ts +54 -0
- package/lib/services/command-native-data-graph.js +485 -0
- package/lib/services/command-native-data-stream.d.ts +104 -0
- package/lib/services/command-native-data-stream.js +257 -0
- package/lib/services/command-native-dmo.d.ts +124 -0
- package/lib/services/command-native-dmo.js +338 -0
- package/lib/services/command-native-mapping.d.ts +65 -0
- package/lib/services/command-native-mapping.js +129 -0
- package/lib/services/command-native-relationship.d.ts +46 -0
- package/lib/services/command-native-relationship.js +103 -0
- package/lib/services/cross-dataspace-deploy.d.ts +111 -0
- package/lib/services/cross-dataspace-deploy.js +493 -0
- package/lib/services/cross-dataspace-rename.d.ts +74 -0
- package/lib/services/cross-dataspace-rename.js +1314 -0
- package/lib/services/cross-dataspace-sql.d.ts +109 -0
- package/lib/services/cross-dataspace-sql.js +1301 -0
- package/lib/services/cross-space-context.d.ts +23 -0
- package/lib/services/cross-space-context.js +36 -0
- package/lib/services/crud-plan.d.ts +137 -0
- package/lib/services/crud-plan.js +408 -0
- package/lib/services/data-space-check.d.ts +89 -0
- package/lib/services/data-space-check.js +162 -0
- package/lib/services/data-space-prefix.d.ts +77 -0
- package/lib/services/data-space-prefix.js +127 -0
- package/lib/services/data-transform-space.d.ts +31 -0
- package/lib/services/data-transform-space.js +79 -0
- package/lib/services/delete-calculated-insight.d.ts +44 -0
- package/lib/services/delete-calculated-insight.js +101 -0
- package/lib/services/delete-data-transform.d.ts +52 -0
- package/lib/services/delete-data-transform.js +222 -0
- package/lib/services/delete-dmo-field.d.ts +211 -0
- package/lib/services/delete-dmo-field.js +472 -0
- package/lib/services/delete-identity-resolution.d.ts +43 -0
- package/lib/services/delete-identity-resolution.js +295 -0
- package/lib/services/delete-segment.d.ts +42 -0
- package/lib/services/delete-segment.js +248 -0
- package/lib/services/deploy-result.d.ts +54 -0
- package/lib/services/deploy-result.js +60 -0
- package/lib/services/escaped-copy.d.ts +23 -0
- package/lib/services/escaped-copy.js +88 -0
- package/lib/services/execute-calculated-insight-deploy.d.ts +42 -0
- package/lib/services/execute-calculated-insight-deploy.js +96 -0
- package/lib/services/execute-data-transform-deploy.d.ts +56 -0
- package/lib/services/execute-data-transform-deploy.js +168 -0
- package/lib/services/execute-native-identity-resolution-deploy.d.ts +48 -0
- package/lib/services/execute-native-identity-resolution-deploy.js +360 -0
- package/lib/services/execute-segment-deploy.d.ts +45 -0
- package/lib/services/execute-segment-deploy.js +393 -0
- package/lib/services/local-file-removal.d.ts +36 -0
- package/lib/services/local-file-removal.js +103 -0
- package/lib/services/native-calculated-insight.d.ts +87 -0
- package/lib/services/native-calculated-insight.js +164 -0
- package/lib/services/native-crm-data-stream.d.ts +91 -0
- package/lib/services/native-crm-data-stream.js +272 -0
- package/lib/services/native-data-graph-context.d.ts +12 -0
- package/lib/services/native-data-graph-context.js +139 -0
- package/lib/services/native-data-graph-crd.d.ts +261 -0
- package/lib/services/native-data-graph-crd.js +866 -0
- package/lib/services/native-data-stream.d.ts +329 -0
- package/lib/services/native-data-stream.js +1830 -0
- package/lib/services/native-dlo.d.ts +163 -0
- package/lib/services/native-dlo.js +402 -0
- package/lib/services/native-dmo.d.ts +191 -0
- package/lib/services/native-dmo.js +614 -0
- package/lib/services/native-mapping.d.ts +255 -0
- package/lib/services/native-mapping.js +1226 -0
- package/lib/services/native-relationship.d.ts +132 -0
- package/lib/services/native-relationship.js +512 -0
- package/lib/services/operation-diagnostic.d.ts +83 -0
- package/lib/services/operation-diagnostic.js +272 -0
- package/lib/services/preflight-calculated-insight-deploy.d.ts +58 -0
- package/lib/services/preflight-calculated-insight-deploy.js +95 -0
- package/lib/services/preflight-data-transform-deploy.d.ts +33 -0
- package/lib/services/preflight-data-transform-deploy.js +104 -0
- package/lib/services/preflight-identity-resolution-deploy.d.ts +107 -0
- package/lib/services/preflight-identity-resolution-deploy.js +281 -0
- package/lib/services/preflight-segment-deploy.d.ts +31 -0
- package/lib/services/preflight-segment-deploy.js +109 -0
- package/lib/services/publish-calculated-insight.d.ts +40 -0
- package/lib/services/publish-calculated-insight.js +95 -0
- package/lib/services/publish-segment.d.ts +65 -0
- package/lib/services/publish-segment.js +194 -0
- package/lib/services/readback-pace.d.ts +16 -0
- package/lib/services/readback-pace.js +23 -0
- package/lib/services/retrieve-data-transform.d.ts +26 -0
- package/lib/services/retrieve-data-transform.js +65 -0
- package/lib/services/retrieve-identity-resolution.d.ts +40 -0
- package/lib/services/retrieve-identity-resolution.js +87 -0
- package/lib/services/retrieve-inventory.d.ts +32 -0
- package/lib/services/retrieve-inventory.js +151 -0
- package/lib/services/retrieve-segment.d.ts +120 -0
- package/lib/services/retrieve-segment.js +502 -0
- package/lib/services/segment-lookup.d.ts +46 -0
- package/lib/services/segment-lookup.js +108 -0
- package/lib/services/segment-members.d.ts +144 -0
- package/lib/services/segment-members.js +402 -0
- package/lib/services/select-native-retrieve.d.ts +60 -0
- package/lib/services/select-native-retrieve.js +226 -0
- package/lib/services/settle-calculated-insight.d.ts +22 -0
- package/lib/services/settle-calculated-insight.js +53 -0
- package/lib/services/sql-tokens.d.ts +58 -0
- package/lib/services/sql-tokens.js +147 -0
- package/lib/transport/api-version.d.ts +36 -0
- package/lib/transport/api-version.js +89 -0
- package/lib/transport/bound-ssot.d.ts +27 -0
- package/lib/transport/bound-ssot.js +116 -0
- package/lib/transport/calculated-insight-rest.d.ts +28 -0
- package/lib/transport/calculated-insight-rest.js +62 -0
- package/lib/transport/connect-client.d.ts +129 -0
- package/lib/transport/connect-client.js +446 -0
- package/lib/transport/connect-diagnostic.d.ts +89 -0
- package/lib/transport/connect-diagnostic.js +331 -0
- package/lib/transport/data-graph-rest.d.ts +27 -0
- package/lib/transport/data-graph-rest.js +76 -0
- package/lib/transport/data-stream-rest.d.ts +62 -0
- package/lib/transport/data-stream-rest.js +348 -0
- package/lib/transport/data-transform-rest.d.ts +25 -0
- package/lib/transport/data-transform-rest.js +100 -0
- package/lib/transport/dlo-native-rest.d.ts +22 -0
- package/lib/transport/dlo-native-rest.js +89 -0
- package/lib/transport/dlo-rest.d.ts +23 -0
- package/lib/transport/dlo-rest.js +135 -0
- package/lib/transport/dmo-native-rest.d.ts +18 -0
- package/lib/transport/dmo-native-rest.js +55 -0
- package/lib/transport/dmo-rest.d.ts +30 -0
- package/lib/transport/dmo-rest.js +163 -0
- package/lib/transport/mapping-rest.d.ts +63 -0
- package/lib/transport/mapping-rest.js +341 -0
- package/lib/transport/project-metadata.d.ts +36 -0
- package/lib/transport/project-metadata.js +118 -0
- package/lib/transport/relationship-rest.d.ts +43 -0
- package/lib/transport/relationship-rest.js +201 -0
- package/package.json +96 -4
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { deleteDataTransform } from '../../services/delete-data-transform.js';
|
|
2
|
+
import { selectGitDeployInputs } from '../../artifacts/git-deploy-selection.js';
|
|
3
|
+
import type { GitDeploySelection } from '../../artifacts/git-deploy-selection.js';
|
|
4
|
+
import type { VerbatimDocument } from '../../artifacts/verbatim-document.js';
|
|
5
|
+
import { createDataTransformClient } from '../../transport/data-transform-rest.js';
|
|
6
|
+
import { deleteSegment } from '../../services/delete-segment.js';
|
|
7
|
+
import { deleteIdentityResolution } from '../../services/delete-identity-resolution.js';
|
|
8
|
+
import { operateNativeDataGraph } from '../../services/command-native-data-graph.js';
|
|
9
|
+
import { nativeDataGraphReadContext } from '../../services/native-data-graph-context.js';
|
|
10
|
+
import { createDataGraphClient } from '../../transport/data-graph-rest.js';
|
|
11
|
+
import { deleteCalculatedInsight } from '../../services/delete-calculated-insight.js';
|
|
12
|
+
import { calculatedInsightReadContext } from '../../services/native-calculated-insight.js';
|
|
13
|
+
import { writeNativeDmoDocument } from '../../artifacts/write-native-dmo.js';
|
|
14
|
+
import { writeNativeMappingDocument } from '../../artifacts/write-native-mapping.js';
|
|
15
|
+
import { createRelationshipClient } from '../../transport/relationship-rest.js';
|
|
16
|
+
import { deleteNativeRelationship, preflightDeleteNativeRelationship } from '../../services/native-relationship.js';
|
|
17
|
+
import type { NativeDmoSettle } from '../../services/native-dmo.js';
|
|
18
|
+
import { createDmoClient } from '../../transport/dmo-rest.js';
|
|
19
|
+
import { createNativeDmoDeleteClient } from '../../transport/dmo-native-rest.js';
|
|
20
|
+
import type { BoundSsot } from '../../transport/bound-ssot.js';
|
|
21
|
+
import { deleteNativeDmo, previewDeleteNativeDmo } from '../../services/native-dmo.js';
|
|
22
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
23
|
+
import { Connection } from '@salesforce/core';
|
|
24
|
+
import { createDloClient } from '../../transport/dlo-rest.js';
|
|
25
|
+
import { createNativeDloDeleteClient } from '../../transport/dlo-native-rest.js';
|
|
26
|
+
import { deleteNativeDlo, previewDeleteNativeDlo } from '../../services/native-dlo.js';
|
|
27
|
+
import { plugin } from '../../plugin.js';
|
|
28
|
+
import type { NativeMappingDocument } from '../../artifacts/native-mapping-document.js';
|
|
29
|
+
import { createMappingClient } from '../../transport/mapping-rest.js';
|
|
30
|
+
import { confirmNativeMappingAbsent, deleteNativeMapping, preflightDeleteNativeMapping } from '../../services/native-mapping.js';
|
|
31
|
+
import { preflightDeleteDataStream, executeDeleteDataStream } from '../../services/command-native-data-stream.js';
|
|
32
|
+
import { retrieveNativeDataStream } from '../../services/native-data-stream.js';
|
|
33
|
+
/** Plugin family of one delete selector (its `family:` prefix). */
|
|
34
|
+
export type DeleteFamily = 'data-transform' | 'segment' | 'identity-resolution' | 'data-graph' | 'calculated-insight' | 'data-stream' | 'dlo' | 'dmo' | 'mapping' | 'relationship';
|
|
35
|
+
/**
|
|
36
|
+
* Read-only: the landing DLO a data stream owns, read from the stream itself.
|
|
37
|
+
* @param {string} apiName Exact stream name.
|
|
38
|
+
* @param {object} clients Native stream readers.
|
|
39
|
+
* @returns {Promise<string | undefined>} The linked DLO name.
|
|
40
|
+
*/
|
|
41
|
+
declare function readStreamLinkedDlo(apiName: string, clients: Parameters<typeof retrieveNativeDataStream>[1]): Promise<string | undefined>;
|
|
42
|
+
/**
|
|
43
|
+
* A source-family component read before any delete: its definition, or `absent` when the org has
|
|
44
|
+
* none of that name. A transform also carries the target ID its name resolved to.
|
|
45
|
+
*/
|
|
46
|
+
type AdmittedSource = {
|
|
47
|
+
absent?: false;
|
|
48
|
+
desired: unknown;
|
|
49
|
+
transformTargetId?: string;
|
|
50
|
+
} | {
|
|
51
|
+
absent: true;
|
|
52
|
+
};
|
|
53
|
+
export type DeleteEnvelope = {
|
|
54
|
+
contract: 'sf-data360-delete';
|
|
55
|
+
contractVersion: '1.1.0';
|
|
56
|
+
status: 'success' | 'blocked' | 'failed';
|
|
57
|
+
metadata: {
|
|
58
|
+
operation: 'delete';
|
|
59
|
+
preview: boolean;
|
|
60
|
+
apiVersion: string;
|
|
61
|
+
plugin: typeof plugin;
|
|
62
|
+
};
|
|
63
|
+
provenance: {
|
|
64
|
+
command: 'sf data360 delete';
|
|
65
|
+
generatedAt: string;
|
|
66
|
+
/** The resolved target org's ID; null when the run stopped before an org was resolved. */
|
|
67
|
+
targetOrgId: string | null;
|
|
68
|
+
/** --changed-since: the resolved commits of the Git range. */
|
|
69
|
+
git?: GitDeploySelection['provenance'];
|
|
70
|
+
};
|
|
71
|
+
diagnostics: {
|
|
72
|
+
warnings: string[];
|
|
73
|
+
errors: Array<{
|
|
74
|
+
code: string;
|
|
75
|
+
message: string;
|
|
76
|
+
retryable: false;
|
|
77
|
+
}>;
|
|
78
|
+
};
|
|
79
|
+
result: {
|
|
80
|
+
/** The run's data space (--dataspace, default `default`). */
|
|
81
|
+
scope: {
|
|
82
|
+
dataSpace: string;
|
|
83
|
+
};
|
|
84
|
+
/** --changed-since: the requested reference; the items are the files deleted in the range. */
|
|
85
|
+
selection?: {
|
|
86
|
+
changedSince: string;
|
|
87
|
+
};
|
|
88
|
+
items: Array<{
|
|
89
|
+
/** Plugin family of the item, as in its selector. */
|
|
90
|
+
family: DeleteFamily;
|
|
91
|
+
identity: {
|
|
92
|
+
dataSpace: string;
|
|
93
|
+
apiName: string;
|
|
94
|
+
};
|
|
95
|
+
operation: 'preview' | 'delete' | 'delete-field';
|
|
96
|
+
/**
|
|
97
|
+
* Selector of the item whose deletion removes this one too (a stream's landing DLO, the last
|
|
98
|
+
* mapping of a DMO); no request is sent for this item, and it reports the owner's outcome.
|
|
99
|
+
*/
|
|
100
|
+
removedWith?: string;
|
|
101
|
+
/** Why the item is planned rather than checked, or why a data stream delete was refused. */
|
|
102
|
+
diagnostics?: Array<{
|
|
103
|
+
code: string;
|
|
104
|
+
message: string;
|
|
105
|
+
}>;
|
|
106
|
+
deleteDlo?: boolean;
|
|
107
|
+
/** Field-level delete: the DMO fields named with --field. */
|
|
108
|
+
fields?: string[];
|
|
109
|
+
/** Field-level delete: fields whose absence a read confirmed. */
|
|
110
|
+
removedFields?: string[];
|
|
111
|
+
/** Field-level delete: mapping pairs whose removal a read confirmed. */
|
|
112
|
+
unmappedPairs?: Array<{
|
|
113
|
+
mapping: string;
|
|
114
|
+
sourceFieldDeveloperName: string;
|
|
115
|
+
targetFieldDeveloperName: string;
|
|
116
|
+
}>;
|
|
117
|
+
/** Field-level delete: project files and what happened to each. */
|
|
118
|
+
refreshedFiles?: Array<{
|
|
119
|
+
path: string;
|
|
120
|
+
outcome: 'refreshed' | 'unchanged' | 'not-present' | 'failed';
|
|
121
|
+
code?: string;
|
|
122
|
+
}>;
|
|
123
|
+
/**
|
|
124
|
+
* Preview: project files an execution would refresh (--field) or remove (every other
|
|
125
|
+
* deletion, unless --keep-local-files).
|
|
126
|
+
*/
|
|
127
|
+
localFiles?: Array<{
|
|
128
|
+
path: string;
|
|
129
|
+
exists: boolean;
|
|
130
|
+
}>;
|
|
131
|
+
/** Confirmed deletion: the item's own local files and what happened to each. */
|
|
132
|
+
removedLocalFiles?: Array<{
|
|
133
|
+
path: string;
|
|
134
|
+
outcome: 'removed' | 'not-present' | 'kept' | 'failed';
|
|
135
|
+
code?: string;
|
|
136
|
+
}>;
|
|
137
|
+
targetApiName?: string;
|
|
138
|
+
targetDloName?: string;
|
|
139
|
+
routes?: Array<{
|
|
140
|
+
operation: string;
|
|
141
|
+
transport: 'native' | 'metadata';
|
|
142
|
+
apiVersion: string;
|
|
143
|
+
}>;
|
|
144
|
+
outcome: 'delete' | 'deleted' | 'deletion-processing' | 'deletion-unconfirmed' | 'unchanged' | 'planned-dependencies' | 'blocked' | 'failed';
|
|
145
|
+
mutation: 'not-attempted' | 'confirmed-deleted' | 'acknowledged-processing' | 'acknowledged' | 'rejected' | 'unknown';
|
|
146
|
+
plan?: Array<{
|
|
147
|
+
operation: 'unmap' | 'delete' | 'delete-field';
|
|
148
|
+
apiName: string;
|
|
149
|
+
fieldName?: string;
|
|
150
|
+
sourceFieldDeveloperName?: string;
|
|
151
|
+
targetFieldDeveloperName?: string;
|
|
152
|
+
developerName?: string;
|
|
153
|
+
}>;
|
|
154
|
+
}>;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
/** Delete exact native DLO definitions, or preview without mutation. */
|
|
158
|
+
export default class Delete extends SfCommand<DeleteEnvelope> {
|
|
159
|
+
static readonly aliases: string[];
|
|
160
|
+
static readonly summary = "Delete exact Data360 Transforms, Segments, IR owners, streams, DLOs, DMOs, single custom DMO fields or mappings.";
|
|
161
|
+
static readonly 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. 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 exits nonzero. --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 exits nonzero with LOCAL_FILE_REMOVAL_FAILED.";
|
|
162
|
+
static readonly flags: {
|
|
163
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
164
|
+
metadata: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
165
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
166
|
+
dataspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
167
|
+
preview: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
168
|
+
'changed-since': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
169
|
+
'confirm-delete': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
170
|
+
'delete-dlo': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
171
|
+
field: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
172
|
+
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
173
|
+
'keep-local-files': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
174
|
+
};
|
|
175
|
+
protected deleteDataTransform: typeof deleteDataTransform;
|
|
176
|
+
protected createDataTransformClient: typeof createDataTransformClient;
|
|
177
|
+
protected nativeGraphContext: typeof nativeDataGraphReadContext;
|
|
178
|
+
protected nativeGraphClient: typeof createDataGraphClient;
|
|
179
|
+
protected operateNativeGraph: typeof operateNativeDataGraph;
|
|
180
|
+
protected selectGitInputs: typeof selectGitDeployInputs;
|
|
181
|
+
protected deleteIdentityResolution: typeof deleteIdentityResolution;
|
|
182
|
+
protected deleteSegment: typeof deleteSegment;
|
|
183
|
+
protected calculatedInsightContext: typeof calculatedInsightReadContext;
|
|
184
|
+
protected deleteCalculatedInsight: typeof deleteCalculatedInsight;
|
|
185
|
+
/** The org ID of the connection this run resolved (provenance only); unset before that. */
|
|
186
|
+
private resolvedOrgId?;
|
|
187
|
+
protected resolveConnection: (alias?: string) => Promise<Connection>;
|
|
188
|
+
/**
|
|
189
|
+
* Resolve the target org's connection and remember its org ID for the envelope's provenance.
|
|
190
|
+
* @param {string} [alias] Target org alias or username.
|
|
191
|
+
* @returns {Promise<Connection>} The resolved connection.
|
|
192
|
+
*/
|
|
193
|
+
private connectTarget;
|
|
194
|
+
protected readStreamLinkedDlo: typeof readStreamLinkedDlo;
|
|
195
|
+
protected preflightDeleteDataStream: typeof preflightDeleteDataStream;
|
|
196
|
+
protected executeDeleteDataStream: typeof executeDeleteDataStream;
|
|
197
|
+
protected createDataStreamClients: (target: string, version: string) => Promise<Parameters<typeof executeDeleteDataStream>[1]>;
|
|
198
|
+
protected createMappingClient: typeof createMappingClient;
|
|
199
|
+
protected createMappingSender: (target: string, version: string) => BoundSsot;
|
|
200
|
+
protected preflightDeleteMapping: typeof preflightDeleteNativeMapping;
|
|
201
|
+
protected deleteMapping: typeof deleteNativeMapping;
|
|
202
|
+
protected confirmMappingAbsent: typeof confirmNativeMappingAbsent;
|
|
203
|
+
/**
|
|
204
|
+
* The authored mapping file of that name, if one is there: its binding names the org mapping.
|
|
205
|
+
* Like deploy, its identity.apiName must be its file name; a file that is there but is not a
|
|
206
|
+
* valid mapping is refused (INVALID_SOURCE) instead of falling back to the exact org name.
|
|
207
|
+
* @param {string} file Canonical path data360/mapping/<name>.mapping-meta.json.
|
|
208
|
+
* @returns {Promise<NativeMappingDocument | undefined>} The validated file; undefined without one.
|
|
209
|
+
*/
|
|
210
|
+
protected readAuthoredMapping(file: string): Promise<NativeMappingDocument | undefined>;
|
|
211
|
+
protected createRelationshipClient: typeof createRelationshipClient;
|
|
212
|
+
protected preflightDeleteRelationship: typeof preflightDeleteNativeRelationship;
|
|
213
|
+
protected deleteRelationship: typeof deleteNativeRelationship;
|
|
214
|
+
protected createRelationshipSender: (target: string, version: string) => BoundSsot;
|
|
215
|
+
protected createDmoClient: typeof createDmoClient;
|
|
216
|
+
protected writeNativeDmo: typeof writeNativeDmoDocument;
|
|
217
|
+
protected writeNativeMapping: typeof writeNativeMappingDocument;
|
|
218
|
+
protected fieldRemovalSettle: NativeDmoSettle | undefined;
|
|
219
|
+
protected createDmoNativeDeleteClient: typeof createNativeDmoDeleteClient;
|
|
220
|
+
protected retrieveDmo: typeof previewDeleteNativeDmo;
|
|
221
|
+
protected deleteDmo: typeof deleteNativeDmo;
|
|
222
|
+
protected createDloClient: typeof createDloClient;
|
|
223
|
+
protected createDloNativeDeleteClient: typeof createNativeDloDeleteClient;
|
|
224
|
+
protected createDataSpaceSender: (target: string, version: string) => BoundSsot;
|
|
225
|
+
protected retrieveDlo: typeof previewDeleteNativeDlo;
|
|
226
|
+
protected deleteDlo: typeof deleteNativeDlo;
|
|
227
|
+
protected resolveTarget: (alias?: string) => Promise<string>;
|
|
228
|
+
/**
|
|
229
|
+
* Read-only: a -m source-family component's current definition, read from the org by name.
|
|
230
|
+
* @param {DeleteFamily} family Source family of the selector.
|
|
231
|
+
* @param {string} name Exact name from the selector.
|
|
232
|
+
* @param {Connection} connection API68 connection of the target org.
|
|
233
|
+
* @param {string} [dataSpace] The run's data space.
|
|
234
|
+
* @returns {Promise<AdmittedSource>} The definition, or absent.
|
|
235
|
+
*/
|
|
236
|
+
protected readDeleteSource(family: DeleteFamily, name: string, connection: Connection, dataSpace?: string): Promise<AdmittedSource>;
|
|
237
|
+
/**
|
|
238
|
+
* Read-only: what a verbatim file deleted in a Git range deletes. It is the file itself (type,
|
|
239
|
+
* data space and name); a transform also carries the target ID its name resolves to.
|
|
240
|
+
* @param {VerbatimDocument} document Base content of the deleted verbatim file.
|
|
241
|
+
* @param {Connection} connection API68 connection of the target org.
|
|
242
|
+
* @returns {Promise<AdmittedSource>} The verbatim definition, or absent.
|
|
243
|
+
*/
|
|
244
|
+
protected verbatimDeleteSource(document: VerbatimDocument, connection: Connection): Promise<AdmittedSource>;
|
|
245
|
+
/**
|
|
246
|
+
* Field-level delete: remove the named custom fields from one DMO, their mapping pairs first,
|
|
247
|
+
* then refresh the project files that already exist. Never throws; the envelope is completed.
|
|
248
|
+
* @param {FieldDeleteFlags} flags Parsed flags.
|
|
249
|
+
* @param {DeleteEnvelope} envelope Envelope to complete.
|
|
250
|
+
* @returns {Promise<void>} Resolves when the envelope is final.
|
|
251
|
+
*/
|
|
252
|
+
private deleteDmoFields;
|
|
253
|
+
/**
|
|
254
|
+
* Delete or preview one relationship by name. The source DMO, named in the selector (or with
|
|
255
|
+
* Git in the deleted file's base content), is listed to find it before, and to confirm its
|
|
256
|
+
* absence after, the single DELETE.
|
|
257
|
+
* @param {string} selector Exact relationship:SourceDmo__dlm:Name (Git: relationship:Name) selector.
|
|
258
|
+
* @param {string} target Resolved username.
|
|
259
|
+
* @param {string} version Native API version.
|
|
260
|
+
* @param {boolean} preview Read-only when true.
|
|
261
|
+
* @param {string} effectiveScope The run's data space.
|
|
262
|
+
* @param {DeleteEnvelope} envelope Envelope receiving the item.
|
|
263
|
+
* @param {Map<DeleteItem, string>} selectorsByItem Human labels.
|
|
264
|
+
* @param {Function} track Registers the item's local file for removal or preview.
|
|
265
|
+
* @param {NativeRelationshipDocument} [baseDocument] Git delete: the file's base content.
|
|
266
|
+
* @param {object} [baseNames] Git delete of a verbatim file: the relationship is then found by
|
|
267
|
+
* name under its source DMO, like -m.
|
|
268
|
+
* @param {string} baseNames.sourceDmo Source DMO the verbatim file keeps.
|
|
269
|
+
* @param {string} baseNames.apiName Relationship name.
|
|
270
|
+
* @returns {Promise<void>} Resolves when the item settled; throws to stop the batch.
|
|
271
|
+
*/
|
|
272
|
+
private deleteOneRelationship;
|
|
273
|
+
/**
|
|
274
|
+
* Execute the selection in dependency order (relationships, mappings, DMOs, DLOs), stopping on
|
|
275
|
+
* the first error.
|
|
276
|
+
* @returns {Promise<DeleteEnvelope>} Payload-free deletion evidence.
|
|
277
|
+
*/
|
|
278
|
+
run(): Promise<DeleteEnvelope>;
|
|
279
|
+
}
|
|
280
|
+
export {};
|