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,255 @@
|
|
|
1
|
+
import type { DloField } from '../artifacts/dlo-document.js';
|
|
2
|
+
import type { NativeDmoField } from '../artifacts/native-dmo-document.js';
|
|
3
|
+
import type { NativeMappingDocument, NativeMappingField } from '../artifacts/native-mapping-document.js';
|
|
4
|
+
import type { MappingClient, MappingWriteBody } from '../transport/mapping-rest.js';
|
|
5
|
+
import type { DloClient } from '../transport/dlo-rest.js';
|
|
6
|
+
import type { DmoClient } from '../transport/dmo-rest.js';
|
|
7
|
+
import type { DocumentMode } from '../artifacts/verbatim-document.js';
|
|
8
|
+
export type MappingDependencies = {
|
|
9
|
+
source: Pick<DloClient, 'get'>;
|
|
10
|
+
target: Pick<DmoClient, 'get'>;
|
|
11
|
+
/**
|
|
12
|
+
* Prefix of the run's data space as the org's data space list names it (`ds2`), outside the
|
|
13
|
+
* default data space only. It lets a mapping onto a standard DMO copy that is not activated yet
|
|
14
|
+
* be sent with the default spelling (see {@link activationSpelling}).
|
|
15
|
+
*/
|
|
16
|
+
dataSpacePrefix?: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The default spelling of a standard DMO copy that is not activated yet. Salesforce creates the
|
|
20
|
+
* copy `<prefix>_<Name>__dlm` of a standard DMO `ssot__<Name>__dlm` in a non-default data space
|
|
21
|
+
* with the first mapping onto it, and that first mapping must name the default spelling
|
|
22
|
+
* (`ssot__<Name>__dlm`, fields as the default object names them); Salesforce stores it under the
|
|
23
|
+
* copy name (live API 68, DB entry data360:dataspace-identity-resolution-api68).
|
|
24
|
+
*/
|
|
25
|
+
export type MappingActivation = {
|
|
26
|
+
/** The default spelling of the target, `ssot__<Name>__dlm`. */
|
|
27
|
+
targetEntityDeveloperName: string;
|
|
28
|
+
/** Default field name by copy field name (`ssot__X__c` by `X__c`; others unchanged). */
|
|
29
|
+
fields: Map<string, string>;
|
|
30
|
+
};
|
|
31
|
+
export type NativeMappingDeployPlan = {
|
|
32
|
+
operation: 'create' | 'update' | 'noop';
|
|
33
|
+
desired: NativeMappingDocument;
|
|
34
|
+
target?: NativeMappingDocument;
|
|
35
|
+
writes: {
|
|
36
|
+
body: MappingWriteBody;
|
|
37
|
+
}[];
|
|
38
|
+
removals?: NativeMappingField[];
|
|
39
|
+
retained?: NativeMappingField[];
|
|
40
|
+
evidence?: NativeMappingUnmapPlan;
|
|
41
|
+
/** Pairs whose source and target data types differ; Salesforce accepts them. */
|
|
42
|
+
typeDifferences?: Array<{
|
|
43
|
+
source: string;
|
|
44
|
+
target: string;
|
|
45
|
+
sourceType: string;
|
|
46
|
+
targetType: string;
|
|
47
|
+
}>;
|
|
48
|
+
/** Set when this create is the first mapping of a standard DMO that is not yet enabled. */
|
|
49
|
+
activatesStandardDmo?: true;
|
|
50
|
+
/**
|
|
51
|
+
* Set only when the target, a standard DMO copy, read 404 and its default spelling was found:
|
|
52
|
+
* the create is sent once more in the default spelling when Salesforce answers it with 404.
|
|
53
|
+
*/
|
|
54
|
+
activationRetry?: {
|
|
55
|
+
body: MappingWriteBody;
|
|
56
|
+
activation: MappingActivation;
|
|
57
|
+
};
|
|
58
|
+
/** The label of the file when it differs from the org's (absent `from` on a create). */
|
|
59
|
+
labelChange?: {
|
|
60
|
+
from?: string;
|
|
61
|
+
to: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Resolve a unique exact pair through filtered inventory, never source-name 404 fallback.
|
|
66
|
+
* Deploy and delete both find the org mapping of an authored file this way, by its binding.
|
|
67
|
+
* @param {NativeMappingDocument} desired Logical binding.
|
|
68
|
+
* @param {MappingClient} client Target mapping transport.
|
|
69
|
+
* @returns {Promise<NativeMappingDocument | undefined>} Verified detail or confirmed absence.
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveNativeMappingTarget(desired: NativeMappingDocument, client: MappingClient): Promise<NativeMappingDocument | undefined>;
|
|
72
|
+
/**
|
|
73
|
+
* Fresh fields of a mapping's source DLO and target DMO, the target's write scope, and the
|
|
74
|
+
* mapping's own pairs (they tie a relationship's key qualifier pair to its field).
|
|
75
|
+
*/
|
|
76
|
+
export type MappingPairContext = {
|
|
77
|
+
sources: Map<string, DloField>;
|
|
78
|
+
targets: Map<string, NativeDmoField>;
|
|
79
|
+
standard: boolean;
|
|
80
|
+
pairs: NativeMappingField[];
|
|
81
|
+
/** Outside the default data space, where a standard DMO is a copy whose fields drop `ssot__`. */
|
|
82
|
+
copy?: boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Whether a pair of an existing mapping is one Salesforce generated. This one predicate decides
|
|
86
|
+
* both which org pairs a deploy keeps when the file does not list them and which pairs a
|
|
87
|
+
* retrieve leaves out of the file, so the two cannot diverge. A pair whose source or target
|
|
88
|
+
* field is not read is never generated.
|
|
89
|
+
* @param {NativeMappingField} pair Mapping pair.
|
|
90
|
+
* @param {MappingPairContext} context Fresh source and target fields.
|
|
91
|
+
* @returns {boolean} Whether the pair is generated, not authored.
|
|
92
|
+
*/
|
|
93
|
+
export declare function isGeneratedMappingPair(pair: NativeMappingField, context: MappingPairContext): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Name the pairs of a mapping that Salesforce generated, from fresh reads of its source DLO and
|
|
96
|
+
* target DMO, with the same predicate a deploy uses to keep them.
|
|
97
|
+
* @param {NativeMappingDocument} document Mapping as read.
|
|
98
|
+
* @param {MappingDependencies} dependencies Fresh source and target readers.
|
|
99
|
+
* @param {DocumentMode} [mode] `retrieve` reads the parents leniently.
|
|
100
|
+
* @returns {Promise<NativeMappingField[]>} Generated pairs, in document order.
|
|
101
|
+
*/
|
|
102
|
+
export declare function generatedMappingPairs(document: NativeMappingDocument, dependencies: MappingDependencies, mode?: DocumentMode): Promise<NativeMappingField[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Retrieve one mapping with its authored pairs only: the pairs Salesforce generated are left
|
|
105
|
+
* out, decided by {@link generatedMappingPairs}. When the source DLO or the target DMO cannot be
|
|
106
|
+
* read nothing is guessed: the retrieve is refused, as a file missing a pair a deploy does not
|
|
107
|
+
* recognise as generated would remove it from the org.
|
|
108
|
+
* @param {string} apiName Observed target mapping name.
|
|
109
|
+
* @param {MappingClient} client Target mapping transport.
|
|
110
|
+
* @param {string} requestScope The run's data space.
|
|
111
|
+
* @param {MappingDependencies} [dependencies] Fresh source and target readers; required.
|
|
112
|
+
* @param {DocumentMode} [mode] `retrieve` keeps pairs the plugin cannot deploy, and may leave
|
|
113
|
+
* none; other callers stay strict.
|
|
114
|
+
* @returns {Promise<NativeMappingDocument>} Authored portable definition.
|
|
115
|
+
*/
|
|
116
|
+
export declare function retrieveLeanNativeMapping(apiName: string, client: MappingClient, requestScope: string, dependencies?: MappingDependencies, mode?: DocumentMode): Promise<NativeMappingDocument>;
|
|
117
|
+
/**
|
|
118
|
+
* The labels (Metadata API masterLabel) of mappings, read in batches of up to 10 names over the
|
|
119
|
+
* bound Connection. Without a Metadata API reader, or for a name without a record, there is none.
|
|
120
|
+
* @param {string[]} names Mapping names.
|
|
121
|
+
* @param {Pick<MappingClient, 'readDefinitions'>} client Mapping reader.
|
|
122
|
+
* @returns {Promise<Map<string, string>>} Label by name.
|
|
123
|
+
*/
|
|
124
|
+
export declare function readMappingLabels(names: string[], client: Pick<MappingClient, 'readDefinitions'>): Promise<Map<string, string>>;
|
|
125
|
+
/**
|
|
126
|
+
* Add the org's label to retrieved mapping documents as `spec.label`, reading up to 10 names per
|
|
127
|
+
* Metadata API call. A label equal to the mapping's own name is the default Salesforce gives a
|
|
128
|
+
* mapping created without one, so it is left out. A failed read leaves the label out of the
|
|
129
|
+
* documents of that batch and returns one warning for the batch; it never fails the retrieve.
|
|
130
|
+
* @param {unknown[]} documents Retrieved documents, changed in place; others are skipped.
|
|
131
|
+
* @param {Pick<MappingClient, 'readDefinitions'>} client Mapping reader.
|
|
132
|
+
* @returns {Promise<string[]>} Warnings for the mappings whose label could not be read.
|
|
133
|
+
*/
|
|
134
|
+
export declare function labelRetrievedMappings(documents: unknown[], client: Pick<MappingClient, 'readDefinitions'>): Promise<string[]>;
|
|
135
|
+
/**
|
|
136
|
+
* Retrieve one exact mapping with all runtime KQ/system pairs retained in portable JSON.
|
|
137
|
+
* @param {string} apiName Observed target mapping name.
|
|
138
|
+
* @param {MappingClient} client Target mapping transport.
|
|
139
|
+
* @param {string} requestScope The run's data space.
|
|
140
|
+
* @param {DocumentMode} [mode] `retrieve` keeps pairs the plugin cannot deploy as returned.
|
|
141
|
+
* @returns {Promise<NativeMappingDocument>} Complete portable definition.
|
|
142
|
+
*/
|
|
143
|
+
export declare function retrieveNativeMapping(apiName: string, client: MappingClient, requestScope: string, mode?: DocumentMode): Promise<NativeMappingDocument>;
|
|
144
|
+
/**
|
|
145
|
+
* Plan create, desired-state reconciliation, or no-op without mutation.
|
|
146
|
+
* @param {unknown} value Portable desired mapping.
|
|
147
|
+
* @param {MappingClient} client Target mapping transport.
|
|
148
|
+
* @param {MappingDependencies} dependencies Fresh source/target definition readers.
|
|
149
|
+
* @param {string} requestScope The run's data space.
|
|
150
|
+
* @returns {Promise<NativeMappingDeployPlan>} Bounded operation plan.
|
|
151
|
+
*/
|
|
152
|
+
export declare function preflightNativeMapping(value: unknown, client: MappingClient, dependencies: MappingDependencies, requestScope: string): Promise<NativeMappingDeployPlan>;
|
|
153
|
+
/**
|
|
154
|
+
* Dispatch ordered unmaps then one additions batch, settling with GETs and no write retries.
|
|
155
|
+
* @param {unknown} value Portable desired definition.
|
|
156
|
+
* @param {MappingClient} client Target mapping transport.
|
|
157
|
+
* @param {MappingDependencies} dependencies Source/target readers.
|
|
158
|
+
* @param {Function} [onUpdated] Receive confirmed pair changes for human output only.
|
|
159
|
+
* @param {string} requestScope The run's data space.
|
|
160
|
+
* @returns {Promise<{operation: 'create' | 'update' | 'noop', document: NativeMappingDocument}>} Confirmed definition.
|
|
161
|
+
*/
|
|
162
|
+
export declare function deployNativeMapping(value: unknown, client: MappingClient, dependencies: MappingDependencies, onUpdated: ((changes: {
|
|
163
|
+
deleted: NativeMappingField[];
|
|
164
|
+
added: NativeMappingField[];
|
|
165
|
+
label?: string;
|
|
166
|
+
}) => void) | undefined, requestScope: string): Promise<{
|
|
167
|
+
operation: 'create' | 'update' | 'noop';
|
|
168
|
+
document: NativeMappingDocument;
|
|
169
|
+
activatesStandardDmo?: true;
|
|
170
|
+
}>;
|
|
171
|
+
export type NativeMappingUnmapPlan = {
|
|
172
|
+
selected: NativeMappingDocument;
|
|
173
|
+
removals: NativeMappingField[];
|
|
174
|
+
protectedPairs: NativeMappingField[];
|
|
175
|
+
inventory: Record<string, unknown>[];
|
|
176
|
+
sourceNames: string[];
|
|
177
|
+
parents: unknown[];
|
|
178
|
+
target: Record<string, unknown>;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Classify exact metadata-backed protected pairs and qualified authored identity pairs.
|
|
182
|
+
* @param {NativeMappingDocument} selected Fresh target definition.
|
|
183
|
+
* @param {MappingClient} client Version-bearing mapping reader.
|
|
184
|
+
* @param {MappingDependencies} dependencies Fresh parent readers.
|
|
185
|
+
* @param {NativeMappingField[]} requestedRemovals Desired-state omissions.
|
|
186
|
+
* @param {string} requestScope The run's data space.
|
|
187
|
+
* @returns {Promise<NativeMappingUnmapPlan>} Complete removal evidence, without mutation.
|
|
188
|
+
*/
|
|
189
|
+
export declare function preflightUnmapNativeMapping(selected: NativeMappingDocument, client: MappingClient, dependencies: MappingDependencies, requestedRemovals: NativeMappingField[], requestScope: string): Promise<NativeMappingUnmapPlan>;
|
|
190
|
+
/**
|
|
191
|
+
* Unmap qualified observed selectors once each, checking exact schema after every dispatch.
|
|
192
|
+
* This helper never deletes a parent mapping or admits desired-state retargeting.
|
|
193
|
+
* @param {NativeMappingUnmapPlan} evidence Fresh complete preflight snapshot.
|
|
194
|
+
* @param {MappingClient} client Mapping transport.
|
|
195
|
+
* @param {MappingDependencies} dependencies Parent readers.
|
|
196
|
+
* @param {Function} onDispatch Called before awaiting each mutation, including lost responses.
|
|
197
|
+
* @param {string} requestScope The run's data space.
|
|
198
|
+
* @returns {Promise<NativeMappingUnmapPlan>} Settled retained-pair snapshot for the next operation.
|
|
199
|
+
*/
|
|
200
|
+
export declare function unmapNativeMappingFields(evidence: NativeMappingUnmapPlan, client: MappingClient, dependencies: MappingDependencies, onDispatch: () => void, requestScope: string): Promise<NativeMappingUnmapPlan>;
|
|
201
|
+
export type NativeMappingDeletePlan = {
|
|
202
|
+
selected: NativeMappingDocument;
|
|
203
|
+
/** Every other mapping of the same DMO, ordered by name. */
|
|
204
|
+
others: NativeMappingDocument[];
|
|
205
|
+
/** Field names of the target DMO, ordered. */
|
|
206
|
+
targetFields: string[];
|
|
207
|
+
/**
|
|
208
|
+
* Only for a standard DMO copy: the copy fields that only the selected mapping targets, ordered.
|
|
209
|
+
* A copy holds only mapped fields, so Salesforce drops such a field with the mapping (live API
|
|
210
|
+
* 68, DB entry data360:plugin-dataspace-native-acceptance-api68); the deletion check accepts
|
|
211
|
+
* their removal and nothing else.
|
|
212
|
+
*/
|
|
213
|
+
releasableFields?: string[];
|
|
214
|
+
};
|
|
215
|
+
export type NativeMappingDeleteSettle = {
|
|
216
|
+
attempts: number;
|
|
217
|
+
delayMs: number;
|
|
218
|
+
sleep: (ms: number) => Promise<void>;
|
|
219
|
+
};
|
|
220
|
+
export declare const defaultMappingDeleteSettle: NativeMappingDeleteSettle;
|
|
221
|
+
/**
|
|
222
|
+
* Qualify a whole-mapping deletion without writing. Salesforce cannot delete the last mapping of
|
|
223
|
+
* a custom DMO, so that case is refused here with its way out; a standard DMO has no such limit.
|
|
224
|
+
* @param {string} apiName Exact target-native mapping name.
|
|
225
|
+
* @param {MappingClient} client Target mapping reader.
|
|
226
|
+
* @param {Pick<MappingDependencies, 'target' | 'dataSpacePrefix'>} dependencies Fresh DMO reader
|
|
227
|
+
* and the run's data space prefix (which tells a standard DMO copy).
|
|
228
|
+
* @param {string} requestScope The run's data space.
|
|
229
|
+
* @returns {Promise<NativeMappingDeletePlan>} What must be unchanged after the deletion.
|
|
230
|
+
*/
|
|
231
|
+
export declare function preflightDeleteNativeMapping(apiName: string, client: MappingClient, dependencies: Pick<MappingDependencies, 'target' | 'dataSpacePrefix'>, requestScope: string): Promise<NativeMappingDeletePlan>;
|
|
232
|
+
/**
|
|
233
|
+
* Delete a mapping with one Metadata API destructive deployment, then confirm its absence and
|
|
234
|
+
* that the DMO's other mappings and its fields are what they were. On a standard DMO copy the
|
|
235
|
+
* fields only the deleted mapping targeted may be gone (see {@link NativeMappingDeletePlan}).
|
|
236
|
+
* @param {string} apiName Exact native name, never a source artifact alias.
|
|
237
|
+
* @param {MappingClient} client Mapping transport.
|
|
238
|
+
* @param {MappingDependencies} dependencies Fresh parent readers and the data space prefix.
|
|
239
|
+
* @param {string} requestScope The run's data space.
|
|
240
|
+
* @param {NativeMappingDeleteSettle} [settle] Bounded readback budget.
|
|
241
|
+
* @returns {Promise<{apiName: string}>} Independently verified absence.
|
|
242
|
+
*/
|
|
243
|
+
export declare function deleteNativeMapping(apiName: string, client: MappingClient, dependencies: Pick<MappingDependencies, 'target' | 'dataSpacePrefix'>, requestScope: string, settle?: NativeMappingDeleteSettle): Promise<{
|
|
244
|
+
apiName: string;
|
|
245
|
+
}>;
|
|
246
|
+
/**
|
|
247
|
+
* Confirm by its own reads that a mapping is gone after another deletion removed it (the last
|
|
248
|
+
* mapping of a custom DMO goes with the DMO). Only the typed 404 counts as absence.
|
|
249
|
+
* @param {string} apiName Exact org mapping name.
|
|
250
|
+
* @param {MappingClient} client Mapping reader.
|
|
251
|
+
* @param {string} requestScope The run's data space.
|
|
252
|
+
* @param {NativeMappingDeleteSettle} [settle] Bounded readback budget.
|
|
253
|
+
* @returns {Promise<boolean>} True once a read answers 404; false while it stays readable.
|
|
254
|
+
*/
|
|
255
|
+
export declare function confirmNativeMappingAbsent(apiName: string, client: Pick<MappingClient, 'get'>, requestScope: string, settle?: NativeMappingDeleteSettle): Promise<boolean>;
|