sf-plugin-data 0.1.0 → 0.3.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.
Files changed (277) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +618 -240
  3. package/docs/artifact-format.md +528 -633
  4. package/docs/capabilities.md +1160 -168
  5. package/docs/git-workflow.md +135 -12
  6. package/docs/handover.md +7826 -12
  7. package/lib/api.d.ts +13 -0
  8. package/lib/api.js +10 -0
  9. package/lib/artifacts/code-fields.d.ts +49 -0
  10. package/lib/artifacts/code-fields.js +142 -0
  11. package/lib/artifacts/data-graph-document.d.ts +29 -0
  12. package/lib/artifacts/data-graph-document.js +52 -0
  13. package/lib/artifacts/data-space-field.d.ts +65 -0
  14. package/lib/artifacts/data-space-field.js +98 -0
  15. package/lib/artifacts/data-stream-document.d.ts +264 -0
  16. package/lib/artifacts/data-stream-document.js +680 -0
  17. package/lib/artifacts/data-transform-document.d.ts +152 -0
  18. package/lib/artifacts/data-transform-document.js +560 -0
  19. package/lib/artifacts/dependency-selection.d.ts +51 -0
  20. package/lib/artifacts/dependency-selection.js +154 -0
  21. package/lib/artifacts/dlo-document.d.ts +93 -0
  22. package/lib/artifacts/dlo-document.js +253 -0
  23. package/lib/artifacts/enum-case.d.ts +39 -0
  24. package/lib/artifacts/enum-case.js +67 -0
  25. package/lib/artifacts/git-deploy-selection.d.ts +68 -0
  26. package/lib/artifacts/git-deploy-selection.js +474 -0
  27. package/lib/artifacts/identity-resolution-document.d.ts +133 -0
  28. package/lib/artifacts/identity-resolution-document.js +625 -0
  29. package/lib/artifacts/mapping-document.d.ts +1 -0
  30. package/lib/artifacts/mapping-document.js +1 -0
  31. package/lib/artifacts/native-calculated-insight-document.d.ts +142 -0
  32. package/lib/artifacts/native-calculated-insight-document.js +321 -0
  33. package/lib/artifacts/native-data-graph-document.d.ts +124 -0
  34. package/lib/artifacts/native-data-graph-document.js +780 -0
  35. package/lib/artifacts/native-dmo-document.d.ts +151 -0
  36. package/lib/artifacts/native-dmo-document.js +313 -0
  37. package/lib/artifacts/native-mapping-document.d.ts +67 -0
  38. package/lib/artifacts/native-mapping-document.js +187 -0
  39. package/lib/artifacts/native-relationship-document.d.ts +76 -0
  40. package/lib/artifacts/native-relationship-document.js +232 -0
  41. package/lib/artifacts/path-selector.d.ts +55 -0
  42. package/lib/artifacts/path-selector.js +167 -0
  43. package/lib/artifacts/read-deploy-input.d.ts +222 -6
  44. package/lib/artifacts/read-deploy-input.js +1213 -53
  45. package/lib/artifacts/segment-document.d.ts +183 -0
  46. package/lib/artifacts/segment-document.js +570 -0
  47. package/lib/artifacts/verbatim-document.d.ts +203 -0
  48. package/lib/artifacts/verbatim-document.js +339 -0
  49. package/lib/artifacts/write-data-graph.d.ts +17 -0
  50. package/lib/artifacts/write-data-graph.js +162 -0
  51. package/lib/artifacts/write-data-stream.d.ts +11 -0
  52. package/lib/artifacts/write-data-stream.js +175 -0
  53. package/lib/artifacts/write-data-transform.d.ts +11 -0
  54. package/lib/artifacts/write-data-transform.js +180 -0
  55. package/lib/artifacts/write-dlo.d.ts +11 -0
  56. package/lib/artifacts/write-dlo.js +158 -0
  57. package/lib/artifacts/write-identity-resolution.d.ts +18 -0
  58. package/lib/artifacts/write-identity-resolution.js +165 -0
  59. package/lib/artifacts/write-mapping-definition.d.ts +17 -0
  60. package/lib/artifacts/write-mapping-definition.js +127 -0
  61. package/lib/artifacts/write-member-export.d.ts +88 -0
  62. package/lib/artifacts/write-member-export.js +199 -0
  63. package/lib/artifacts/write-native-calculated-insight.d.ts +21 -0
  64. package/lib/artifacts/write-native-calculated-insight.js +176 -0
  65. package/lib/artifacts/write-native-dmo.d.ts +11 -0
  66. package/lib/artifacts/write-native-dmo.js +158 -0
  67. package/lib/artifacts/write-native-mapping.d.ts +11 -0
  68. package/lib/artifacts/write-native-mapping.js +157 -0
  69. package/lib/artifacts/write-native-relationship.d.ts +11 -0
  70. package/lib/artifacts/write-native-relationship.js +157 -0
  71. package/lib/artifacts/write-segment.d.ts +26 -0
  72. package/lib/artifacts/write-segment.js +212 -0
  73. package/lib/commands/data360/delete.d.ts +280 -0
  74. package/lib/commands/data360/delete.js +2347 -0
  75. package/lib/commands/data360/deploy.d.ts +235 -16
  76. package/lib/commands/data360/deploy.js +2339 -102
  77. package/lib/commands/data360/list/dataspace.d.ts +53 -0
  78. package/lib/commands/data360/list/dataspace.js +109 -0
  79. package/lib/commands/data360/publish.d.ts +93 -0
  80. package/lib/commands/data360/publish.js +298 -0
  81. package/lib/commands/data360/retrieve.d.ts +283 -14
  82. package/lib/commands/data360/retrieve.js +1945 -95
  83. package/lib/commands/data360/segment/members/export.d.ts +101 -0
  84. package/lib/commands/data360/segment/members/export.js +320 -0
  85. package/lib/errors/codes/calculated-insight.d.ts +2 -0
  86. package/lib/errors/codes/calculated-insight.js +25 -0
  87. package/lib/errors/codes/data-graph.d.ts +2 -0
  88. package/lib/errors/codes/data-graph.js +22 -0
  89. package/lib/errors/codes/data-stream.d.ts +2 -0
  90. package/lib/errors/codes/data-stream.js +70 -0
  91. package/lib/errors/codes/data-transform.d.ts +2 -0
  92. package/lib/errors/codes/data-transform.js +35 -0
  93. package/lib/errors/codes/dependency.d.ts +2 -0
  94. package/lib/errors/codes/dependency.js +11 -0
  95. package/lib/errors/codes/dlo.d.ts +2 -0
  96. package/lib/errors/codes/dlo.js +31 -0
  97. package/lib/errors/codes/dmo.d.ts +2 -0
  98. package/lib/errors/codes/dmo.js +28 -0
  99. package/lib/errors/codes/general.d.ts +2 -0
  100. package/lib/errors/codes/general.js +58 -0
  101. package/lib/errors/codes/identity-resolution.d.ts +2 -0
  102. package/lib/errors/codes/identity-resolution.js +24 -0
  103. package/lib/errors/codes/mapping.d.ts +2 -0
  104. package/lib/errors/codes/mapping.js +42 -0
  105. package/lib/errors/codes/relationship.d.ts +2 -0
  106. package/lib/errors/codes/relationship.js +21 -0
  107. package/lib/errors/codes/segment.d.ts +2 -0
  108. package/lib/errors/codes/segment.js +49 -0
  109. package/lib/errors/registry.d.ts +60 -0
  110. package/lib/errors/registry.js +123 -0
  111. package/lib/exit-code.d.ts +10 -0
  112. package/lib/exit-code.js +24 -0
  113. package/lib/plugin.d.ts +1 -0
  114. package/lib/plugin.js +3 -1
  115. package/lib/services/acquire-retrieve-selection.d.ts +43 -0
  116. package/lib/services/acquire-retrieve-selection.js +145 -0
  117. package/lib/services/bind-identity-resolution-dependencies.d.ts +53 -0
  118. package/lib/services/bind-identity-resolution-dependencies.js +238 -0
  119. package/lib/services/bind-segment-dependencies.d.ts +49 -0
  120. package/lib/services/bind-segment-dependencies.js +115 -0
  121. package/lib/services/bounded-reads.d.ts +17 -0
  122. package/lib/services/bounded-reads.js +42 -0
  123. package/lib/services/calculated-insight-sql-checks.d.ts +33 -0
  124. package/lib/services/calculated-insight-sql-checks.js +193 -0
  125. package/lib/services/command-dlo.d.ts +48 -0
  126. package/lib/services/command-dlo.js +103 -0
  127. package/lib/services/command-native-data-graph.d.ts +54 -0
  128. package/lib/services/command-native-data-graph.js +485 -0
  129. package/lib/services/command-native-data-stream.d.ts +104 -0
  130. package/lib/services/command-native-data-stream.js +257 -0
  131. package/lib/services/command-native-dmo.d.ts +124 -0
  132. package/lib/services/command-native-dmo.js +338 -0
  133. package/lib/services/command-native-mapping.d.ts +65 -0
  134. package/lib/services/command-native-mapping.js +129 -0
  135. package/lib/services/command-native-relationship.d.ts +46 -0
  136. package/lib/services/command-native-relationship.js +103 -0
  137. package/lib/services/cross-dataspace-deploy.d.ts +111 -0
  138. package/lib/services/cross-dataspace-deploy.js +493 -0
  139. package/lib/services/cross-dataspace-rename.d.ts +74 -0
  140. package/lib/services/cross-dataspace-rename.js +1314 -0
  141. package/lib/services/cross-dataspace-sql.d.ts +109 -0
  142. package/lib/services/cross-dataspace-sql.js +1301 -0
  143. package/lib/services/cross-space-context.d.ts +23 -0
  144. package/lib/services/cross-space-context.js +38 -0
  145. package/lib/services/crud-plan.d.ts +137 -0
  146. package/lib/services/crud-plan.js +408 -0
  147. package/lib/services/data-space-check.d.ts +92 -0
  148. package/lib/services/data-space-check.js +169 -0
  149. package/lib/services/data-space-prefix.d.ts +77 -0
  150. package/lib/services/data-space-prefix.js +127 -0
  151. package/lib/services/data-transform-space.d.ts +31 -0
  152. package/lib/services/data-transform-space.js +79 -0
  153. package/lib/services/delete-calculated-insight.d.ts +44 -0
  154. package/lib/services/delete-calculated-insight.js +101 -0
  155. package/lib/services/delete-data-transform.d.ts +52 -0
  156. package/lib/services/delete-data-transform.js +222 -0
  157. package/lib/services/delete-dmo-field.d.ts +211 -0
  158. package/lib/services/delete-dmo-field.js +472 -0
  159. package/lib/services/delete-identity-resolution.d.ts +43 -0
  160. package/lib/services/delete-identity-resolution.js +295 -0
  161. package/lib/services/delete-segment.d.ts +42 -0
  162. package/lib/services/delete-segment.js +248 -0
  163. package/lib/services/deploy-result.d.ts +54 -0
  164. package/lib/services/deploy-result.js +60 -0
  165. package/lib/services/escaped-copy.d.ts +23 -0
  166. package/lib/services/escaped-copy.js +88 -0
  167. package/lib/services/execute-calculated-insight-deploy.d.ts +42 -0
  168. package/lib/services/execute-calculated-insight-deploy.js +96 -0
  169. package/lib/services/execute-data-transform-deploy.d.ts +56 -0
  170. package/lib/services/execute-data-transform-deploy.js +168 -0
  171. package/lib/services/execute-native-identity-resolution-deploy.d.ts +48 -0
  172. package/lib/services/execute-native-identity-resolution-deploy.js +360 -0
  173. package/lib/services/execute-segment-deploy.d.ts +45 -0
  174. package/lib/services/execute-segment-deploy.js +393 -0
  175. package/lib/services/list-data-spaces.d.ts +17 -0
  176. package/lib/services/list-data-spaces.js +24 -0
  177. package/lib/services/local-file-removal.d.ts +36 -0
  178. package/lib/services/local-file-removal.js +103 -0
  179. package/lib/services/native-calculated-insight.d.ts +87 -0
  180. package/lib/services/native-calculated-insight.js +164 -0
  181. package/lib/services/native-crm-data-stream.d.ts +91 -0
  182. package/lib/services/native-crm-data-stream.js +272 -0
  183. package/lib/services/native-data-graph-context.d.ts +12 -0
  184. package/lib/services/native-data-graph-context.js +139 -0
  185. package/lib/services/native-data-graph-crd.d.ts +261 -0
  186. package/lib/services/native-data-graph-crd.js +866 -0
  187. package/lib/services/native-data-stream.d.ts +329 -0
  188. package/lib/services/native-data-stream.js +1830 -0
  189. package/lib/services/native-dlo.d.ts +163 -0
  190. package/lib/services/native-dlo.js +402 -0
  191. package/lib/services/native-dmo.d.ts +191 -0
  192. package/lib/services/native-dmo.js +614 -0
  193. package/lib/services/native-mapping.d.ts +255 -0
  194. package/lib/services/native-mapping.js +1226 -0
  195. package/lib/services/native-relationship.d.ts +132 -0
  196. package/lib/services/native-relationship.js +512 -0
  197. package/lib/services/operation-diagnostic.d.ts +83 -0
  198. package/lib/services/operation-diagnostic.js +272 -0
  199. package/lib/services/preflight-calculated-insight-deploy.d.ts +58 -0
  200. package/lib/services/preflight-calculated-insight-deploy.js +95 -0
  201. package/lib/services/preflight-data-transform-deploy.d.ts +33 -0
  202. package/lib/services/preflight-data-transform-deploy.js +104 -0
  203. package/lib/services/preflight-identity-resolution-deploy.d.ts +107 -0
  204. package/lib/services/preflight-identity-resolution-deploy.js +281 -0
  205. package/lib/services/preflight-segment-deploy.d.ts +31 -0
  206. package/lib/services/preflight-segment-deploy.js +109 -0
  207. package/lib/services/publish-calculated-insight.d.ts +40 -0
  208. package/lib/services/publish-calculated-insight.js +95 -0
  209. package/lib/services/publish-segment.d.ts +65 -0
  210. package/lib/services/publish-segment.js +194 -0
  211. package/lib/services/readback-pace.d.ts +16 -0
  212. package/lib/services/readback-pace.js +23 -0
  213. package/lib/services/retrieve-data-transform.d.ts +26 -0
  214. package/lib/services/retrieve-data-transform.js +65 -0
  215. package/lib/services/retrieve-identity-resolution.d.ts +40 -0
  216. package/lib/services/retrieve-identity-resolution.js +87 -0
  217. package/lib/services/retrieve-inventory.d.ts +32 -0
  218. package/lib/services/retrieve-inventory.js +151 -0
  219. package/lib/services/retrieve-segment.d.ts +120 -0
  220. package/lib/services/retrieve-segment.js +502 -0
  221. package/lib/services/run-retrieve.d.ts +24 -0
  222. package/lib/services/run-retrieve.js +51 -0
  223. package/lib/services/segment-lookup.d.ts +46 -0
  224. package/lib/services/segment-lookup.js +108 -0
  225. package/lib/services/segment-members.d.ts +144 -0
  226. package/lib/services/segment-members.js +402 -0
  227. package/lib/services/select-native-retrieve.d.ts +60 -0
  228. package/lib/services/select-native-retrieve.js +226 -0
  229. package/lib/services/settle-calculated-insight.d.ts +22 -0
  230. package/lib/services/settle-calculated-insight.js +53 -0
  231. package/lib/services/sql-tokens.d.ts +58 -0
  232. package/lib/services/sql-tokens.js +147 -0
  233. package/lib/transport/api-version.d.ts +36 -0
  234. package/lib/transport/api-version.js +89 -0
  235. package/lib/transport/bound-ssot.d.ts +27 -0
  236. package/lib/transport/bound-ssot.js +116 -0
  237. package/lib/transport/calculated-insight-rest.d.ts +28 -0
  238. package/lib/transport/calculated-insight-rest.js +62 -0
  239. package/lib/transport/connect-client.d.ts +94 -32
  240. package/lib/transport/connect-client.js +318 -178
  241. package/lib/transport/connect-diagnostic.d.ts +89 -0
  242. package/lib/transport/connect-diagnostic.js +331 -0
  243. package/lib/transport/data-graph-rest.d.ts +27 -0
  244. package/lib/transport/data-graph-rest.js +76 -0
  245. package/lib/transport/data-stream-rest.d.ts +62 -0
  246. package/lib/transport/data-stream-rest.js +348 -0
  247. package/lib/transport/data-transform-rest.d.ts +25 -0
  248. package/lib/transport/data-transform-rest.js +100 -0
  249. package/lib/transport/dlo-native-rest.d.ts +22 -0
  250. package/lib/transport/dlo-native-rest.js +89 -0
  251. package/lib/transport/dlo-rest.d.ts +23 -0
  252. package/lib/transport/dlo-rest.js +135 -0
  253. package/lib/transport/dmo-native-rest.d.ts +18 -0
  254. package/lib/transport/dmo-native-rest.js +55 -0
  255. package/lib/transport/dmo-rest.d.ts +30 -0
  256. package/lib/transport/dmo-rest.js +163 -0
  257. package/lib/transport/mapping-rest.d.ts +63 -0
  258. package/lib/transport/mapping-rest.js +341 -0
  259. package/lib/transport/project-metadata.d.ts +36 -0
  260. package/lib/transport/project-metadata.js +118 -0
  261. package/lib/transport/relationship-rest.d.ts +43 -0
  262. package/lib/transport/relationship-rest.js +201 -0
  263. package/package.json +29 -6
  264. package/lib/artifacts/dmo-document.d.ts +0 -181
  265. package/lib/artifacts/dmo-document.js +0 -848
  266. package/lib/artifacts/dmo-update-delta.d.ts +0 -28
  267. package/lib/artifacts/dmo-update-delta.js +0 -86
  268. package/lib/artifacts/write-other-dmo.d.ts +0 -17
  269. package/lib/artifacts/write-other-dmo.js +0 -140
  270. package/lib/services/execute-dmo-create.d.ts +0 -24
  271. package/lib/services/execute-dmo-create.js +0 -118
  272. package/lib/services/execute-dmo-deploy.d.ts +0 -33
  273. package/lib/services/execute-dmo-deploy.js +0 -197
  274. package/lib/services/preflight-dmo-deploy.d.ts +0 -69
  275. package/lib/services/preflight-dmo-deploy.js +0 -161
  276. package/lib/services/retrieve-other-dmo.d.ts +0 -46
  277. package/lib/services/retrieve-other-dmo.js +0 -140
@@ -0,0 +1,329 @@
1
+ import { DataStreamError } from '../artifacts/data-stream-document.js';
2
+ import type { DataStreamDocument, DataStreamMapping } from '../artifacts/data-stream-document.js';
3
+ import type { DataStreamClient, DataStreamReferenceReader } from '../transport/data-stream-rest.js';
4
+ type Json = Record<string, unknown>;
5
+ export type DataStreamReadClients = {
6
+ streams: Pick<DataStreamClient, 'get' | 'list'>;
7
+ connections: DataStreamReferenceReader['connections'];
8
+ dependencies: DataStreamReferenceReader['dependencies'];
9
+ dlo: {
10
+ get: (name: string) => Promise<unknown>;
11
+ };
12
+ };
13
+ export type DataStreamBinding = {
14
+ connectionId: string;
15
+ connectionName: string;
16
+ event: string;
17
+ availability: 'Available' | 'In Use';
18
+ sourceFields: Array<{
19
+ name: string;
20
+ label: string;
21
+ dataType: string;
22
+ }>;
23
+ inventory: Json[];
24
+ target?: Json;
25
+ };
26
+ /** Retrieve reads leniently; deploy (the default) keeps every strict check. */
27
+ export type DataStreamReadMode = 'retrieve' | 'deploy';
28
+ /**
29
+ * Order a native mapping inventory by target field, then source field, then formula.
30
+ * Comparisons stay order-insensitive (sameStreamMappings); this only makes retrieved bytes stable.
31
+ * @param {unknown[]} mappings Native mapping inventory.
32
+ * @returns {unknown[]} Sorted copy.
33
+ */
34
+ export declare function sortedStreamMappings(mappings: unknown[]): unknown[];
35
+ /**
36
+ * Validate the independently observed supported stream scope, not runtime settlement.
37
+ * @param {unknown} value Native stream detail/inventory entry.
38
+ * @returns {Json} Raw detached response preserving all inventory fields.
39
+ */
40
+ export declare function inspectNativeDataStream(value: unknown): Json;
41
+ /**
42
+ * The item checks of a retrieved stream GET: a stream of another name, or one whose DLO does not
43
+ * belong to the run's data space (selection is per data space), stays an item failure.
44
+ * @param {unknown} value Stream GET response.
45
+ * @param {string} apiName Requested stream name.
46
+ * @param {string} dataSpace The run's data space.
47
+ * @returns {Json} The GET.
48
+ */
49
+ export declare function checkRetrievedStreamScope(value: unknown, apiName: string, dataSpace: string): Json;
50
+ /**
51
+ * The data spaces of a stream's landing DLO, sorted: the names the stream GET lists, or, when it
52
+ * names none, the DLO's own `dataSpaceInfo` read by name. A GET that names no space is never taken
53
+ * as the run's. The run's data space must be among them (UNSUPPORTED_STREAM_DATASPACE otherwise).
54
+ * @param {unknown} value Stream GET response.
55
+ * @param {string} apiName Stream name.
56
+ * @param {string} dataSpace The run's data space.
57
+ * @param {Pick<DataStreamReadClients, 'dlo'>} [clients] DLO reader, needed when the GET names no
58
+ * data space (INVALID_STREAM_DLO without one).
59
+ * @returns {Promise<string[]>} The data spaces.
60
+ */
61
+ export declare function streamSpaces(value: unknown, apiName: string, dataSpace: string, clients?: Partial<Pick<DataStreamReadClients, 'dlo'>>): Promise<string[]>;
62
+ /**
63
+ * Whether two data space lists name the same spaces.
64
+ * @param {readonly string[]} left One list.
65
+ * @param {readonly string[]} right The other list.
66
+ * @returns {boolean} Same spaces.
67
+ */
68
+ export declare function sameSpaces(left: readonly string[], right: readonly string[]): boolean;
69
+ /**
70
+ * The refusal of a stream file whose c__dataSpace list differs from its DLO's data spaces.
71
+ * @param {string} apiName Stream name.
72
+ * @param {readonly string[]} file The file's list.
73
+ * @param {readonly string[]} org The DLO's data spaces.
74
+ * @returns {DataStreamError} STREAM_DATASPACE_MISMATCH with an explanation.
75
+ */
76
+ export declare function spacesDiffer(apiName: string, file: readonly string[], org: readonly string[]): DataStreamError;
77
+ /**
78
+ * The event of a connection a stream reads. The stream GET does not name it; Salesforce names an
79
+ * Ingestion API stream `<connection>_<event>_<hash>` and labels it `<connection>-<event>`. A
80
+ * connection with one event needs no match. When several events fit the name or label, the one
81
+ * whose fields equal the stream's source fields is taken.
82
+ * @param {Json} stream Stream GET.
83
+ * @param {unknown[]} events Event schemas of the stream's connection.
84
+ * @returns {string} Event name.
85
+ */
86
+ export declare function streamEvent(stream: Json, events: unknown[]): string;
87
+ /**
88
+ * Resolve an exact portable connection/event independently from generated stream names.
89
+ * A missing source name alone never authorizes creation; this read result authorizes no write.
90
+ * @param {object} selection Portable requested name, connection/event and Text primary key.
91
+ * @param {string} selection.apiName Portable stream name.
92
+ * @param {string} selection.connectionName Connection developer name.
93
+ * @param {string} selection.event Uploaded event name.
94
+ * @param {string} selection.primaryKey Explicit Text primary key.
95
+ * @param {DataStreamReadClients} clients Read-only dependency boundaries.
96
+ * @param {boolean} postWrite Whether this read belongs to bounded create/update settlement.
97
+ * @param {DataStreamReadMode} mode `retrieve` lists connections leniently (every page, extra
98
+ * envelope keys ignored); `deploy` keeps the strict single-page envelope check.
99
+ * @returns {Promise<DataStreamBinding>} Private target-local binding and complete inventory.
100
+ */
101
+ export declare function resolveDataStreamBinding(selection: {
102
+ apiName: string;
103
+ connectionName: string;
104
+ event: string;
105
+ primaryKey: string;
106
+ }, clients: DataStreamReadClients, postWrite?: boolean, mode?: DataStreamReadMode): Promise<DataStreamBinding>;
107
+ /**
108
+ * Retrieve exact supported native state as a portable document, retaining generated inventory.
109
+ * Unsupported mappings block projection rather than silently dropping authored intent.
110
+ * @param {string} apiName Exact server-generated stream name.
111
+ * @param {DataStreamReadClients} clients Internal read clients.
112
+ * @param {string} dataSpace The run's data space: the stream's DLO must belong to it.
113
+ * @param {boolean} postWrite Whether this read belongs to bounded create/update settlement.
114
+ * @param {DataStreamReadMode} mode `retrieve` lists connections leniently; `deploy` strictly.
115
+ * @returns {Promise<DataStreamDocument>} Detached validated portable document without runtime IDs.
116
+ */
117
+ export declare function retrieveNativeDataStream(apiName: string, clients: DataStreamReadClients, dataSpace?: string, postWrite?: boolean, mode?: DataStreamReadMode): Promise<DataStreamDocument>;
118
+ /**
119
+ * Project an Ingestion API stream GET into its portable document (see retrieveNativeDataStream).
120
+ * @param {unknown} read Stream GET response.
121
+ * @param {string} apiName Exact stream name.
122
+ * @param {DataStreamReadClients} clients Internal read clients.
123
+ * @param {string} dataSpace The run's data space: the stream's DLO must belong to it.
124
+ * @param {boolean} postWrite Whether this read belongs to bounded create/update settlement.
125
+ * @param {DataStreamReadMode} mode `retrieve` lists connections leniently; `deploy` strictly.
126
+ * @returns {Promise<DataStreamDocument>} Detached validated portable document; its c__dataSpace
127
+ * lists every data space of the DLO.
128
+ */
129
+ export declare function projectNativeDataStream(read: unknown, apiName: string, clients: DataStreamReadClients, dataSpace?: string, postWrite?: boolean, mode?: DataStreamReadMode): Promise<DataStreamDocument>;
130
+ export type DataStreamDeployClients = DataStreamReadClients & {
131
+ streams: DataStreamReadClients['streams'] & Pick<DataStreamClient, 'create' | 'update' | 'patch' | 'relabel'>;
132
+ };
133
+ export type DataStreamCreatePlan = {
134
+ operation: 'create';
135
+ document: DataStreamDocument;
136
+ binding: DataStreamBinding;
137
+ };
138
+ export type DataStreamUpdatePlan = {
139
+ operation: 'update' | 'noop';
140
+ document: DataStreamDocument;
141
+ patch: DataStreamDocument;
142
+ binding: DataStreamBinding;
143
+ target: DataStreamDocument;
144
+ dlo: Json;
145
+ additions: DataStreamMapping[];
146
+ /** Formula mappings to send: added or changed formulas, and removed ones with an empty formula. */
147
+ formulaChanges: Array<{
148
+ targetFieldName: string;
149
+ transformationFormula: string;
150
+ targetFieldReturntype?: string;
151
+ }>;
152
+ /** Whether the file's stream label differs from the org's (sent; Salesforce keeps its own). */
153
+ labelChange: boolean;
154
+ };
155
+ /** A part of the file Salesforce accepted but did not apply. */
156
+ export type DataStreamNotice = {
157
+ code: string;
158
+ message: string;
159
+ };
160
+ export type DataStreamDeployOptions = {
161
+ allowProcessing: boolean;
162
+ /** The run's data space (default when absent): the file's c__dataSpace must list it. */
163
+ dataSpace?: string;
164
+ verifyInput: () => Promise<void>;
165
+ now?: () => number;
166
+ wait?: (milliseconds: number) => Promise<unknown>;
167
+ };
168
+ /**
169
+ * Keep the error behind a failed stream deploy result, so the command can report its explanation.
170
+ * @template {object} T
171
+ * @param {T} result The item result built from the error.
172
+ * @param {unknown} error The caught error.
173
+ * @returns {T} The same result.
174
+ */
175
+ export declare function retainStreamFailure<T extends object>(result: T, error: unknown): T;
176
+ /**
177
+ * The error behind a failed stream deploy result, when the executor kept it.
178
+ * @param {object} result Item result.
179
+ * @returns {unknown} The caught error, or undefined.
180
+ */
181
+ export declare function streamFailureCause(result: object): unknown;
182
+ /**
183
+ * Refuse a stream file whose c__dataSpace list does not name the run's data space.
184
+ * @param {DataStreamDocument} document Stream file.
185
+ * @param {string} dataSpace The run's data space.
186
+ */
187
+ export declare function requireRunSpace(document: Pick<DataStreamDocument, 'c__dataSpace' | 'identity'>, dataSpace: string): void;
188
+ /**
189
+ * Admit a create with independent name and binding absence; its additive mappings must name
190
+ * source fields of the event. The file must list the run's data space alone: the create puts
191
+ * the landing DLO into it.
192
+ * @param {unknown} value Portable authored stream.
193
+ * @param {DataStreamReadClients} clients Independent read boundaries.
194
+ * @param {string} [dataSpace] The run's data space.
195
+ * @returns {Promise<DataStreamCreatePlan>} Private read-only create admission, never dispatch authority.
196
+ */
197
+ export declare function preflightNativeDataStreamCreate(value: unknown, clients: DataStreamReadClients, dataSpace?: string): Promise<DataStreamCreatePlan>;
198
+ /**
199
+ * Dispatch one freshly guarded create and independently settle generated stream and DLO identities.
200
+ * No public command calls this create-only subchunk; errors after dispatch must remain unknown.
201
+ * @param {unknown} value Portable authored stream.
202
+ * @param {DataStreamDeployClients} clients Internal read/write boundaries.
203
+ * @param {DataStreamDeployOptions} options Explicit processing acknowledgement and immutable input guard.
204
+ * @returns {Promise<object>} Confirmed generated identities and portable independent readback.
205
+ */
206
+ export declare function createNativeDataStream(value: unknown, clients: DataStreamDeployClients, options: DataStreamDeployOptions): Promise<{
207
+ operation: 'create';
208
+ targetApiName: string;
209
+ targetDloName: string;
210
+ document: DataStreamDocument;
211
+ notices: DataStreamNotice[];
212
+ }>;
213
+ /**
214
+ * Compare the file with the stream. Mapping changes are sent as the file holds them and Salesforce
215
+ * decides (live, API 68, it refuses any change or removal of an existing mapping on an Ingestion
216
+ * API stream); settings Salesforce answers with 200 but ignores are refused before any write.
217
+ * The file's c__dataSpace list must name the run's data space and equal the DLO's data spaces
218
+ * (check only: spaces change through the DLO file).
219
+ * @param {unknown} value The stream file (desired state of its mappings).
220
+ * @param {DataStreamReadClients} clients Independent binding, source and parent readers.
221
+ * @param {string} [dataSpace] The run's data space.
222
+ * @returns {Promise<DataStreamUpdatePlan>} Private update/noop comparison without dispatch.
223
+ */
224
+ export declare function preflightNativeDataStreamUpdate(value: unknown, clients: DataStreamReadClients, dataSpace?: string): Promise<DataStreamUpdatePlan>;
225
+ /**
226
+ * The PATCH of an update with formula or label parts: `datastreamType` plus the mappings to add,
227
+ * change or remove and, when it is not sent through the Metadata API, the label.
228
+ * @param {DataStreamUpdatePlan} plan Update plan.
229
+ * @param {boolean} [withLabel] Whether the PATCH carries the label change.
230
+ * @returns {Json} PATCH body.
231
+ */
232
+ export declare function ingestDataStreamPatchBody(plan: DataStreamUpdatePlan, withLabel?: boolean): Json;
233
+ /**
234
+ * Execute one guarded additive PATCH or return accurate zero-write noop, then settle independently.
235
+ * @param {unknown} value Portable additive intent.
236
+ * @param {DataStreamDeployClients} clients Independent read/write boundaries.
237
+ * @param {DataStreamDeployOptions} options Processing acknowledgement and exact local input guards.
238
+ * @returns {Promise<object>} Independently confirmed operation and actual target identities.
239
+ */
240
+ export declare function updateNativeDataStream(value: unknown, clients: DataStreamDeployClients, options: DataStreamDeployOptions): Promise<{
241
+ operation: 'update' | 'noop';
242
+ targetApiName: string;
243
+ targetDloName: string;
244
+ document: DataStreamDocument;
245
+ notices: DataStreamNotice[];
246
+ }>;
247
+ export type DataStreamDeleteClients = DataStreamReadClients & {
248
+ streams: DataStreamReadClients['streams'] & Pick<DataStreamClient, 'delete'>;
249
+ };
250
+ export type DataStreamDeleteOptions = {
251
+ deleteDlo: boolean;
252
+ /** The run's data space (default when absent): the stream's DLO must belong to it. */
253
+ dataSpace?: string;
254
+ verifyInput: () => Promise<void>;
255
+ survivorDloNames: readonly string[];
256
+ /**
257
+ * Preview only: whether the same delete deletes this dependent in an earlier phase. Without
258
+ * it every dependent other than the DLO's own stream entry blocks.
259
+ */
260
+ covered?: (dependent: StreamDependent, dloName: string) => Promise<boolean>;
261
+ now?: () => number;
262
+ wait?: (milliseconds: number) => Promise<unknown>;
263
+ };
264
+ export type DataStreamDeletePlan = {
265
+ operation: 'delete';
266
+ apiName: string;
267
+ deleteDlo: boolean;
268
+ document: DataStreamDocument;
269
+ binding: DataStreamBinding;
270
+ dlo: Json;
271
+ streamDependencies: Json;
272
+ dloDependencies: Json;
273
+ survivors: Json[];
274
+ /** Preview only: dependents of the stream or its DLO that the same delete deletes earlier. */
275
+ plannedDependencies?: StreamDependent[];
276
+ };
277
+ /**
278
+ * Delete plan of a stream the plugin cannot model (any connector, any settings): it is deleted
279
+ * by name from its raw GET. Name, record ID, data space, ACTIVE status and the stream's and its
280
+ * DLO's dependents are still checked; the IngestApi connection and schema are not read.
281
+ */
282
+ export type UnmodelledDataStreamDeletePlan = {
283
+ operation: 'delete';
284
+ unmodelled: true;
285
+ apiName: string;
286
+ deleteDlo: boolean;
287
+ recordId: string;
288
+ label: unknown;
289
+ /** The landing DLO named in the GET. */
290
+ dlo: Json;
291
+ streamDependencies: Json;
292
+ dloDependencies: Json;
293
+ plannedDependencies?: StreamDependent[];
294
+ };
295
+ /** One dependent of a stream or its DLO, by type and name. */
296
+ export type StreamDependent = {
297
+ componentType: string;
298
+ name: string;
299
+ };
300
+ /**
301
+ * A stream read answered by Salesforce with HTTP 404: that stream does not exist.
302
+ * @param {unknown} error Error of a native stream read.
303
+ * @returns {boolean} True only for a genuine HTTP 404 of the stream route.
304
+ */
305
+ export declare function isStreamNotFound(error: unknown): boolean;
306
+ /**
307
+ * Snapshot exact selected target, source, linked parent and explicitly protected survivors.
308
+ * @param {string} apiName Exact selected target developer name, never a portable proposal.
309
+ * @param {DataStreamReadClients} clients Independent native readers.
310
+ * @param {object} options Explicit cascade choice and protected unrelated parent names.
311
+ * @param {boolean} options.deleteDlo Explicit acknowledgement of linked-parent deletion.
312
+ * @param {readonly string[]} options.survivorDloNames Unselected parents to preserve independently.
313
+ * @param {Function} [options.covered] Preview only: a dependent the same delete deletes earlier.
314
+ * @returns {Promise<DataStreamDeletePlan>} Private guarded plan, not dispatch authority.
315
+ */
316
+ export declare function preflightNativeDataStreamDelete(apiName: string, clients: DataStreamReadClients, options: Pick<DataStreamDeleteOptions, 'deleteDlo' | 'survivorDloNames' | 'covered' | 'dataSpace'>): Promise<DataStreamDeletePlan | UnmodelledDataStreamDeletePlan>;
317
+ /**
318
+ * Delete once after fresh complete guards; HTTP204 never substitutes for independent settlement.
319
+ * @param {string} apiName Exact target developer name.
320
+ * @param {DataStreamDeleteClients} clients Native single-attempt DELETE and independent readers.
321
+ * @param {DataStreamDeleteOptions} options Cascade acknowledgement, immutable input and read bounds.
322
+ * @returns {Promise<object>} Confirmed deletion only after binding release and parent/survivor checks.
323
+ */
324
+ export declare function deleteNativeDataStream(apiName: string, clients: DataStreamDeleteClients, options: DataStreamDeleteOptions): Promise<{
325
+ operation: 'delete';
326
+ targetApiName: string;
327
+ targetDloName: string;
328
+ }>;
329
+ export {};