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,103 @@
|
|
|
1
|
+
import { operationDiagnostic } from './operation-diagnostic.js';
|
|
2
|
+
import { NativeRelationshipError } from '../artifacts/native-relationship-document.js';
|
|
3
|
+
import { deployNativeRelationship, preflightNativeRelationship } from './native-relationship.js';
|
|
4
|
+
import { WriteLedger, rejectedNextAction } from './deploy-result.js';
|
|
5
|
+
/**
|
|
6
|
+
* Compare a relationship with the org read-only, matched by name, else by its binding.
|
|
7
|
+
* @param {unknown} value Portable relationship.
|
|
8
|
+
* @param {Pick<RelationshipClient, 'list' | 'readDefinitions'>} client Relationship reader.
|
|
9
|
+
* @param {string} requestScope The run's data space.
|
|
10
|
+
* @returns {Promise<object>} Payload-free preview.
|
|
11
|
+
*/
|
|
12
|
+
export async function preflightRelationship(value, client, requestScope) {
|
|
13
|
+
const plan = await preflightNativeRelationship(value, client, requestScope);
|
|
14
|
+
return {
|
|
15
|
+
family: 'relationship',
|
|
16
|
+
outcome: plan.operation === 'noop' ? 'unchanged' : plan.operation,
|
|
17
|
+
target: plan.operation === 'create' ? 'absent' : 'existing',
|
|
18
|
+
absenceProof: plan.operation === 'create' ? 'confirmed-binding-lookup' : 'none',
|
|
19
|
+
...(plan.existing ? { targetApiName: plan.existing } : {}),
|
|
20
|
+
...(plan.changes ? { changes: plan.changes } : {}),
|
|
21
|
+
diagnostics: [],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create a relationship when absent, update it through the Metadata API when it differs, and
|
|
26
|
+
* report independently confirmed settlement. Salesforce's refusal of the item's first write is
|
|
27
|
+
* `rejected`: nothing was written.
|
|
28
|
+
* @param {unknown} value Portable relationship.
|
|
29
|
+
* @param {RelationshipClient} client Relationship transport.
|
|
30
|
+
* @param {string} requestScope The run's data space.
|
|
31
|
+
* @returns {Promise<object>} Payload-free execution outcome.
|
|
32
|
+
*/
|
|
33
|
+
export async function executeRelationship(value, client, requestScope) {
|
|
34
|
+
const ledger = new WriteLedger();
|
|
35
|
+
let writes = 0;
|
|
36
|
+
// Updates Salesforce refused; a refused update is resent once only when the org is unchanged.
|
|
37
|
+
let refused = 0;
|
|
38
|
+
const guarded = {
|
|
39
|
+
list: client.list,
|
|
40
|
+
readDefinitions: client.readDefinitions,
|
|
41
|
+
create: async (body) => {
|
|
42
|
+
writes++;
|
|
43
|
+
return ledger.run(async () => client.create(body));
|
|
44
|
+
},
|
|
45
|
+
...(client.update
|
|
46
|
+
? {
|
|
47
|
+
update: async (definition) => {
|
|
48
|
+
writes++;
|
|
49
|
+
try {
|
|
50
|
+
return await ledger.run(async () => client.update(definition));
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
if (error instanceof NativeRelationshipError &&
|
|
54
|
+
error.code === 'RELATIONSHIP_UPDATE_REJECTED')
|
|
55
|
+
refused++;
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
: {}),
|
|
61
|
+
};
|
|
62
|
+
try {
|
|
63
|
+
const result = await deployNativeRelationship(value, guarded, requestScope);
|
|
64
|
+
return {
|
|
65
|
+
outcome: result.operation === 'noop'
|
|
66
|
+
? 'unchanged'
|
|
67
|
+
: result.operation === 'update'
|
|
68
|
+
? 'updated'
|
|
69
|
+
: 'created',
|
|
70
|
+
mutation: result.operation === 'noop'
|
|
71
|
+
? 'not-attempted'
|
|
72
|
+
: result.operation === 'update'
|
|
73
|
+
? 'confirmed-updated'
|
|
74
|
+
: 'confirmed-created',
|
|
75
|
+
targetApiName: result.apiName,
|
|
76
|
+
diagnostics: [],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
// Salesforce refusing every write (a Metadata API update, and its one resend after an
|
|
81
|
+
// unexpected error on an unchanged org) changed nothing.
|
|
82
|
+
const failure = error instanceof NativeRelationshipError &&
|
|
83
|
+
error.code === 'RELATIONSHIP_UPDATE_REJECTED' &&
|
|
84
|
+
writes === refused
|
|
85
|
+
? { outcome: 'failed', mutation: 'rejected' }
|
|
86
|
+
: ledger.failure(error);
|
|
87
|
+
return {
|
|
88
|
+
...failure,
|
|
89
|
+
diagnostics: [
|
|
90
|
+
{
|
|
91
|
+
code: error instanceof NativeRelationshipError
|
|
92
|
+
? error.code
|
|
93
|
+
: 'RELATIONSHIP_REQUEST_UNCONFIRMED',
|
|
94
|
+
message: operationDiagnostic(error, failure.mutation === 'rejected'
|
|
95
|
+
? rejectedNextAction
|
|
96
|
+
: failure.mutation === 'unknown'
|
|
97
|
+
? 'Write outcome is unknown; list the source DMO relationships before another attempt. No automatic retry.'
|
|
98
|
+
: 'No write attempted; correct the reported check before another attempt.'),
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { DeployInput } from '../artifacts/read-deploy-input.js';
|
|
2
|
+
import type { NativeMappingDocument } from '../artifacts/native-mapping-document.js';
|
|
3
|
+
import type { DataSpaceSender, OrgDataSpace } from './data-space-check.js';
|
|
4
|
+
import type { CrossSpaceRewrite, CrossSpaceUnresolved, RulesetEntry } from './cross-dataspace-rename.js';
|
|
5
|
+
/** One file of another data space, translated into the run's data space. */
|
|
6
|
+
export type CrossSpaceFile = {
|
|
7
|
+
path: string;
|
|
8
|
+
family: string;
|
|
9
|
+
from: string;
|
|
10
|
+
rewrites: CrossSpaceRewrite[];
|
|
11
|
+
unresolved: CrossSpaceUnresolved[];
|
|
12
|
+
};
|
|
13
|
+
/** A file of a kind the translation does not cover yet. */
|
|
14
|
+
export type CrossSpaceRefusedFile = {
|
|
15
|
+
path: string;
|
|
16
|
+
family: string;
|
|
17
|
+
from: string;
|
|
18
|
+
reason: string;
|
|
19
|
+
};
|
|
20
|
+
/** The translated selection of a cross-data-space deploy. */
|
|
21
|
+
export type CrossSpacePlan = {
|
|
22
|
+
/** The selection with every translated input replaced. */
|
|
23
|
+
inputs: DeployInput[];
|
|
24
|
+
files: CrossSpaceFile[];
|
|
25
|
+
unsupported: CrossSpaceRefusedFile[];
|
|
26
|
+
};
|
|
27
|
+
/** Payload-free refusal of a cross-data-space deploy. */
|
|
28
|
+
export declare class CrossSpaceError extends Error {
|
|
29
|
+
readonly code: string;
|
|
30
|
+
constructor(code: string);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The data spaces a file names: a list for a DLO or data stream, one name otherwise (a
|
|
34
|
+
* calculated insight in its identity).
|
|
35
|
+
* @param {Record<string, unknown>} document Admitted file.
|
|
36
|
+
* @returns {string[]} Data space names.
|
|
37
|
+
*/
|
|
38
|
+
export declare function fileDataSpaces(document: Record<string, unknown>): string[];
|
|
39
|
+
/**
|
|
40
|
+
* The data space a file comes from when it is not the run's: the one it names, or for a DLO or
|
|
41
|
+
* stream whose list lacks the run's data space, its first listed space.
|
|
42
|
+
* @param {Record<string, unknown>} document Admitted file.
|
|
43
|
+
* @param {string} run The run's data space.
|
|
44
|
+
* @returns {string | undefined} Source data space, or undefined for a file of the run's space.
|
|
45
|
+
*/
|
|
46
|
+
export declare function crossSpaceSource(document: Record<string, unknown>, run: string): string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Whether a selected file of another data space names an identity resolution output (by the
|
|
49
|
+
* rule's spelling, or an output of the oldest default ruleset without suffix such as
|
|
50
|
+
* `UnifiedIndividual__dlm`): only then does the deploy read the ruleset list, once.
|
|
51
|
+
* @param {readonly DeployInput[]} inputs The admitted selection.
|
|
52
|
+
* @param {string} run The run's data space.
|
|
53
|
+
* @param {readonly OrgDataSpace[]} spaces The org's data spaces.
|
|
54
|
+
* @returns {boolean} Whether the ruleset list is needed.
|
|
55
|
+
*/
|
|
56
|
+
export declare function crossSpaceNeedsRulesets(inputs: readonly DeployInput[], run: string, spaces: readonly OrgDataSpace[]): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Read the org's identity resolution rulesets with one `GET /ssot/identity-resolutions`: each
|
|
59
|
+
* one's name, data space, type and the unified and link output of each reconciliation entity.
|
|
60
|
+
* The list answers every data space at once (live API 68). An entry without a name, data space or
|
|
61
|
+
* type is left out; a malformed answer is CROSS_DATASPACE_RULESETS_READ_FAILED.
|
|
62
|
+
* @param {DataSpaceSender} open Opens the command's shared bound sender.
|
|
63
|
+
* @returns {Promise<RulesetEntry[]>} Rulesets.
|
|
64
|
+
*/
|
|
65
|
+
export declare function readRulesetEntries(open: DataSpaceSender): Promise<RulesetEntry[]>;
|
|
66
|
+
/**
|
|
67
|
+
* Translate every selected file of another data space into the run's data space, in memory. The
|
|
68
|
+
* files on disk never change; each translated input still checks the file's own bytes.
|
|
69
|
+
* @param {readonly DeployInput[]} inputs The admitted selection.
|
|
70
|
+
* @param {string} run The run's data space.
|
|
71
|
+
* @param {readonly OrgDataSpace[]} spaces The org's data spaces with their prefixes.
|
|
72
|
+
* @param {readonly RulesetEntry[]} [rulesets] The ruleset list, read when a file names an
|
|
73
|
+
* identity resolution output (crossSpaceNeedsRulesets).
|
|
74
|
+
* @returns {CrossSpacePlan} The translated selection and its report.
|
|
75
|
+
*/
|
|
76
|
+
export declare function planCrossSpaceInputs(inputs: readonly DeployInput[], run: string, spaces: readonly OrgDataSpace[], rulesets?: readonly RulesetEntry[]): CrossSpacePlan;
|
|
77
|
+
/**
|
|
78
|
+
* The refusal of a plan that holds an unsupported file or a name it cannot place, or undefined.
|
|
79
|
+
* @param {CrossSpacePlan} plan Translated selection.
|
|
80
|
+
* @param {string} run The run's data space.
|
|
81
|
+
* @param {(file: string) => string} shown How a file path is shown.
|
|
82
|
+
* @returns {CrossSpaceError | undefined} Refusal with its explanation.
|
|
83
|
+
*/
|
|
84
|
+
export declare function crossSpaceRefusal(plan: CrossSpacePlan, run: string, shown: (file: string) => string): CrossSpaceError | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Check, before any write, that the copy file of a translated item named before the write (DMO,
|
|
87
|
+
* segment, data graph, ruleset, transform) can be written: a
|
|
88
|
+
* new path, or an existing file with exactly the same content (reused). Mapping and
|
|
89
|
+
* relationship copies are named by Salesforce, so they are checked when they are written.
|
|
90
|
+
* @param {readonly DeployInput[]} inputs Translated inputs.
|
|
91
|
+
* @param {(file: string) => string} shown How a file path is shown.
|
|
92
|
+
* @returns {Promise<string[]>} Copy paths planned (new or reused).
|
|
93
|
+
*/
|
|
94
|
+
export declare function precheckCopyFiles(inputs: readonly DeployInput[], shown: (file: string) => string): Promise<string[]>;
|
|
95
|
+
/** What happened to one copy file. */
|
|
96
|
+
export type CopyOutcome = {
|
|
97
|
+
source: string;
|
|
98
|
+
path?: string;
|
|
99
|
+
outcome: 'written' | 'unchanged' | 'not-written';
|
|
100
|
+
reason?: string;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Write the translated copy of one deployed item, only to a new path; an existing file with the
|
|
104
|
+
* same content is reused, one with other content is left alone and reported. A DLO gets no copy
|
|
105
|
+
* (only its data space list changed in the org).
|
|
106
|
+
* @param {DeployInput} input Translated input.
|
|
107
|
+
* @param {string} [orgName] The name Salesforce returned, for a relationship.
|
|
108
|
+
* @param {NativeMappingDocument} [orgMapping] For a mapping, the document the deploy read back.
|
|
109
|
+
* @returns {Promise<CopyOutcome | undefined>} Outcome; undefined for a DLO.
|
|
110
|
+
*/
|
|
111
|
+
export declare function writeCopyFile(input: DeployInput, orgName?: string, orgMapping?: NativeMappingDocument): Promise<CopyOutcome | undefined>;
|