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,264 @@
|
|
|
1
|
+
import type { DocumentMode } from './verbatim-document.js';
|
|
2
|
+
/** An additive mapping: a source field (by label) onto a DLO field Salesforce creates from it. */
|
|
3
|
+
export type DataStreamMapping = {
|
|
4
|
+
sourceFieldLabel: string;
|
|
5
|
+
targetFieldName: string;
|
|
6
|
+
targetFieldReturntype: string;
|
|
7
|
+
};
|
|
8
|
+
/** A formula mapping onto a DLO field Salesforce creates from it; the formula as plain text. */
|
|
9
|
+
export type DataStreamFormulaMapping = {
|
|
10
|
+
targetFieldName: string;
|
|
11
|
+
formula: string;
|
|
12
|
+
targetFieldReturntype: string;
|
|
13
|
+
};
|
|
14
|
+
export type DataStreamDocument = {
|
|
15
|
+
schemaVersion: 1;
|
|
16
|
+
kind: 'data-stream';
|
|
17
|
+
/**
|
|
18
|
+
* The data spaces of the landing DLO (file key `c__dataSpace`), sorted. It mirrors the DLO:
|
|
19
|
+
* deploy only checks it, and spaces change through the DLO file.
|
|
20
|
+
*/
|
|
21
|
+
c__dataSpace: string[];
|
|
22
|
+
identity: {
|
|
23
|
+
apiName: string;
|
|
24
|
+
};
|
|
25
|
+
spec: {
|
|
26
|
+
/** `IngestApi` in any letter case. */
|
|
27
|
+
connectorType: string;
|
|
28
|
+
connectionName: string;
|
|
29
|
+
event: string;
|
|
30
|
+
/** `INGEST_API` in any letter case. */
|
|
31
|
+
datastreamType: string;
|
|
32
|
+
/** Sent as written on create (Salesforce creates Ingestion API streams with UPSERT only). */
|
|
33
|
+
refreshMode: string;
|
|
34
|
+
label: string;
|
|
35
|
+
newDlo: {
|
|
36
|
+
name: string;
|
|
37
|
+
label: string;
|
|
38
|
+
/** Absent when the DLO has no category. */
|
|
39
|
+
category?: string;
|
|
40
|
+
eventDateTimeFieldName?: string;
|
|
41
|
+
primaryKey: {
|
|
42
|
+
name: string;
|
|
43
|
+
label: string;
|
|
44
|
+
dataType: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
additiveFieldMappings: DataStreamMapping[];
|
|
48
|
+
formulaMappings?: DataStreamFormulaMapping[];
|
|
49
|
+
};
|
|
50
|
+
observed?: {
|
|
51
|
+
mappings: {
|
|
52
|
+
sourceFieldName?: string;
|
|
53
|
+
formula?: string;
|
|
54
|
+
targetFieldName: string;
|
|
55
|
+
}[];
|
|
56
|
+
sourceFields: {
|
|
57
|
+
name: string;
|
|
58
|
+
datatype: string;
|
|
59
|
+
}[];
|
|
60
|
+
dloFields: {
|
|
61
|
+
name: string;
|
|
62
|
+
label: string;
|
|
63
|
+
dataType: string;
|
|
64
|
+
isPrimaryKey: boolean;
|
|
65
|
+
}[];
|
|
66
|
+
actualDloName: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
/** Payload-free refusal at the portable stream boundary. */
|
|
70
|
+
export declare class DataStreamError extends Error {
|
|
71
|
+
readonly code: string;
|
|
72
|
+
constructor(code: string);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Validate authored intent separately from retained, read-only schema evidence. Deploy mode (the
|
|
76
|
+
* default) admits only what a deploy can send and names the first offending key path; retrieve
|
|
77
|
+
* mode lifts the 500-character text limit and the 40-character DLO label limit. Unknown keys
|
|
78
|
+
* inside `observed`, which deploy never sends, are kept in both modes.
|
|
79
|
+
* @param {unknown} value Untrusted portable document.
|
|
80
|
+
* @param {DocumentMode} [mode] `deploy` (strict) or `retrieve` (lenient).
|
|
81
|
+
* @returns {DataStreamDocument} Detached deeply frozen document.
|
|
82
|
+
*/
|
|
83
|
+
export declare function validateDataStreamDocument(value: unknown, mode?: DocumentMode): DataStreamDocument;
|
|
84
|
+
/**
|
|
85
|
+
* The refusal of a new stream whose file lists more than one data space: the create puts the
|
|
86
|
+
* landing DLO into one space, and the plugin never changes spaces through a stream file.
|
|
87
|
+
* @param {readonly string[]} spaces The file's c__dataSpace list.
|
|
88
|
+
* @returns {DataStreamError} STREAM_DATASPACE_MISMATCH with an explanation.
|
|
89
|
+
*/
|
|
90
|
+
export declare function createSpacesRefusal(spaces: readonly string[]): DataStreamError;
|
|
91
|
+
/**
|
|
92
|
+
* Build the proven PK-only object-shaped POST; no observed fields are replayed. Salesforce creates
|
|
93
|
+
* every other DLO field from the event schema. Additive mappings are sent in the create's source-
|
|
94
|
+
* label shape (live API 68: 201, read back as plain source mappings). Formula mappings are sent
|
|
95
|
+
* with the event's typed source fields (the proven formula create); without formulas the source
|
|
96
|
+
* fields stay empty.
|
|
97
|
+
* @param {unknown} value Portable document.
|
|
98
|
+
* @param {Array<{name: string; dataType: string}>} [sourceFields] Event schema fields (name, type).
|
|
99
|
+
* @returns {object} Native create body, not dispatch authorization.
|
|
100
|
+
*/
|
|
101
|
+
export declare function buildDataStreamCreateBody(value: unknown, sourceFields?: ReadonlyArray<{
|
|
102
|
+
name: string;
|
|
103
|
+
dataType: string;
|
|
104
|
+
}>): {
|
|
105
|
+
name: string;
|
|
106
|
+
label: string;
|
|
107
|
+
datastreamType: string;
|
|
108
|
+
connectorInfo: {
|
|
109
|
+
connectorType: string;
|
|
110
|
+
connectorDetails: {
|
|
111
|
+
name: string;
|
|
112
|
+
events: string[];
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
dataLakeObjectInfo: {
|
|
116
|
+
dataspaceInfo: {
|
|
117
|
+
name: string;
|
|
118
|
+
}[];
|
|
119
|
+
dataLakeFieldInputRepresentations: {
|
|
120
|
+
isPrimaryKey: boolean;
|
|
121
|
+
name: string;
|
|
122
|
+
label: string;
|
|
123
|
+
dataType: string;
|
|
124
|
+
}[];
|
|
125
|
+
eventDateTimeFieldName?: string | undefined;
|
|
126
|
+
category?: string | undefined;
|
|
127
|
+
name: string;
|
|
128
|
+
label: string;
|
|
129
|
+
};
|
|
130
|
+
mappings: (DataStreamMapping | {
|
|
131
|
+
targetFieldName: string;
|
|
132
|
+
transformationFormula: string;
|
|
133
|
+
targetFieldReturntype: string;
|
|
134
|
+
})[];
|
|
135
|
+
sourceFields: {
|
|
136
|
+
name: string;
|
|
137
|
+
dataType: string;
|
|
138
|
+
}[];
|
|
139
|
+
refreshConfig: {
|
|
140
|
+
refreshMode: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Serialize explicit additive intent only; target binding and missing-pair selection belong to the service.
|
|
145
|
+
* @param {unknown} value Portable document containing only additions selected for dispatch.
|
|
146
|
+
* @returns {object} Proven source-label PATCH shape, not dispatch authorization.
|
|
147
|
+
*/
|
|
148
|
+
export declare function buildDataStreamPatchBody(value: unknown): {
|
|
149
|
+
datastreamType: string;
|
|
150
|
+
mappings: DataStreamMapping[];
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Convert a stream target selector to the independently read DLO field name.
|
|
154
|
+
* @param {unknown} value Unsuffixed mapping target.
|
|
155
|
+
* @returns {string} Persisted DLO field selector.
|
|
156
|
+
*/
|
|
157
|
+
export declare function dataStreamTargetFieldName(value: string): string;
|
|
158
|
+
/**
|
|
159
|
+
* A data stream of any connector other than the Ingestion API (`connectorInfo.connectorType`, for
|
|
160
|
+
* example `SalesforceDotCom` for Salesforce CRM): `spec` is the stream GET without server-owned
|
|
161
|
+
* keys and without the fields and mappings Salesforce adds itself. Formulas are stored as read
|
|
162
|
+
* (plain text, plainTextHeaders). Only Salesforce CRM streams are tested live; other connectors are
|
|
163
|
+
* sent the same way and Salesforce decides.
|
|
164
|
+
*/
|
|
165
|
+
export type CrmDataStreamDocument = {
|
|
166
|
+
schemaVersion: 1;
|
|
167
|
+
kind: 'data-stream';
|
|
168
|
+
/** The data spaces of the landing DLO, sorted (see DataStreamDocument). */
|
|
169
|
+
c__dataSpace: string[];
|
|
170
|
+
identity: {
|
|
171
|
+
apiName: string;
|
|
172
|
+
};
|
|
173
|
+
spec: Record<string, unknown>;
|
|
174
|
+
};
|
|
175
|
+
type Bag = Record<string, unknown>;
|
|
176
|
+
/**
|
|
177
|
+
* Whether a field, source field or mapping target is one Salesforce adds to every CRM stream.
|
|
178
|
+
* @param {unknown} fieldName Field name.
|
|
179
|
+
* @returns {boolean} A system field the create input must not carry.
|
|
180
|
+
*/
|
|
181
|
+
export declare function isCrmSystemField(fieldName: unknown): boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Whether a stream GET (or a stream spec) names a connector other than the Ingestion API, such as
|
|
184
|
+
* Salesforce CRM; those streams use the GET-shaped file.
|
|
185
|
+
* @param {unknown} value Stream GET or spec.
|
|
186
|
+
* @returns {boolean} A connector type other than IngestApi.
|
|
187
|
+
*/
|
|
188
|
+
export declare function isCrmDataStream(value: unknown): boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Whether a stream document is a GET-shaped document (its spec names a connector other than the
|
|
191
|
+
* Ingestion API).
|
|
192
|
+
* @param {unknown} value Candidate document.
|
|
193
|
+
* @returns {boolean} CRM stream document.
|
|
194
|
+
*/
|
|
195
|
+
export declare function isCrmDataStreamDocument(value: unknown): value is CrmDataStreamDocument;
|
|
196
|
+
/**
|
|
197
|
+
* The spec of a CRM stream file: the GET without server-owned keys, system fields and system
|
|
198
|
+
* mappings, fields, source fields and mappings in a stable order. Formulas read as stored: the
|
|
199
|
+
* client asks Salesforce for plain text (plainTextHeaders).
|
|
200
|
+
* @param {unknown} value Stream GET response.
|
|
201
|
+
* @returns {Bag} Spec as stored in the file.
|
|
202
|
+
*/
|
|
203
|
+
export declare function crmDataStreamSpec(value: unknown): Bag;
|
|
204
|
+
/**
|
|
205
|
+
* The data space names of a stream GET's `dataLakeObjectInfo.dataSpaceInfo`.
|
|
206
|
+
* @param {unknown} value The list.
|
|
207
|
+
* @returns {string[] | undefined} Names, or undefined when an entry names no usable data space.
|
|
208
|
+
*/
|
|
209
|
+
export declare function crmSpaceNames(value: unknown): string[] | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* The CRM stream spec deploy sends: the file's spec with Salesforce's data space list filled from
|
|
212
|
+
* c__dataSpace when the file leaves it out (the validator has checked that a kept list agrees).
|
|
213
|
+
* @param {CrmDataStreamDocument} document Validated CRM stream file.
|
|
214
|
+
* @returns {Bag} Spec to send.
|
|
215
|
+
*/
|
|
216
|
+
export declare function crmDeploySpec(document: CrmDataStreamDocument): Bag;
|
|
217
|
+
/**
|
|
218
|
+
* Validate a CRM stream document. Only what names and places the file is checked; everything
|
|
219
|
+
* else is sent as written on deploy and Salesforce decides.
|
|
220
|
+
* @param {unknown} value Untrusted document.
|
|
221
|
+
* @param {DocumentMode} [mode] `deploy` bounds the label length; `retrieve` does not.
|
|
222
|
+
* @returns {CrmDataStreamDocument} Detached deeply frozen document.
|
|
223
|
+
*/
|
|
224
|
+
export declare function validateCrmDataStreamDocument(value: unknown, mode?: DocumentMode): CrmDataStreamDocument;
|
|
225
|
+
/**
|
|
226
|
+
* Validate either stream document: a CRM stream document, otherwise an Ingestion API one.
|
|
227
|
+
* @param {unknown} value Untrusted document.
|
|
228
|
+
* @param {DocumentMode} [mode] `deploy` (strict) or `retrieve` (lenient).
|
|
229
|
+
* @returns {DataStreamDocument | CrmDataStreamDocument} Detached deeply frozen document.
|
|
230
|
+
*/
|
|
231
|
+
export declare function validateAnyDataStreamDocument(value: unknown, mode?: DocumentMode): DataStreamDocument | CrmDataStreamDocument;
|
|
232
|
+
/**
|
|
233
|
+
* Translate a CRM stream spec into the create input: the GET spellings the input names
|
|
234
|
+
* differently are renamed, the data space keeps its name only, plain field mappings are left
|
|
235
|
+
* out (Salesforce maps source fields itself) and formula mappings carry the DLO field type.
|
|
236
|
+
* @param {Bag} spec CRM stream spec.
|
|
237
|
+
* @returns {Bag} Create (POST) body.
|
|
238
|
+
*/
|
|
239
|
+
export declare function crmDataStreamWriteBody(spec: Bag): Bag;
|
|
240
|
+
/**
|
|
241
|
+
* Stream keys whose values are enums Salesforce may store in its own letter case (a DLO
|
|
242
|
+
* category or field type, a refresh mode); a case-only difference is no change. Names, labels
|
|
243
|
+
* and formulas are compared exactly.
|
|
244
|
+
*/
|
|
245
|
+
export declare const streamEnumKeys: ReadonlySet<string>;
|
|
246
|
+
/**
|
|
247
|
+
* The PATCH that brings a CRM stream from its current spec to the file's spec: `datastreamType`
|
|
248
|
+
* plus each changed part only. Formula mappings are compared one by one (a removed formula is
|
|
249
|
+
* sent with an empty formula); refresh settings key by key; every other changed key is sent
|
|
250
|
+
* whole. The DLO fields of formula targets are left to the mappings. No parts means unchanged.
|
|
251
|
+
* Differences no write input can carry are returned as `unsupported`, never as parts: a plain
|
|
252
|
+
* source-to-target mapping added, removed or changed (`sourceFieldName` is no PATCH input). A
|
|
253
|
+
* changed formula return type is sent with the formula, and Salesforce decides.
|
|
254
|
+
* @param {Bag} wanted Spec of the file.
|
|
255
|
+
* @param {Bag} current Spec of the org's stream.
|
|
256
|
+
* @returns {{body: Bag; parts: string[]; unsupported: string[]}} PATCH body, the changed key
|
|
257
|
+
* paths, and the differing key paths that cannot be sent.
|
|
258
|
+
*/
|
|
259
|
+
export declare function crmDataStreamPatch(wanted: Bag, current: Bag): {
|
|
260
|
+
body: Bag;
|
|
261
|
+
parts: string[];
|
|
262
|
+
unsupported: string[];
|
|
263
|
+
};
|
|
264
|
+
export {};
|