sf-plugin-data 0.1.0 → 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.
Files changed (269) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +572 -240
  3. package/docs/artifact-format.md +527 -633
  4. package/docs/capabilities.md +1159 -168
  5. package/docs/git-workflow.md +135 -12
  6. package/docs/handover.md +7826 -12
  7. package/lib/api.d.ts +7 -0
  8. package/lib/api.js +7 -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 +2297 -0
  75. package/lib/commands/data360/deploy.d.ts +234 -15
  76. package/lib/commands/data360/deploy.js +2292 -100
  77. package/lib/commands/data360/publish.d.ts +93 -0
  78. package/lib/commands/data360/publish.js +292 -0
  79. package/lib/commands/data360/retrieve.d.ts +260 -13
  80. package/lib/commands/data360/retrieve.js +1880 -85
  81. package/lib/commands/data360/segment/members/export.d.ts +101 -0
  82. package/lib/commands/data360/segment/members/export.js +318 -0
  83. package/lib/errors/codes/calculated-insight.d.ts +2 -0
  84. package/lib/errors/codes/calculated-insight.js +25 -0
  85. package/lib/errors/codes/data-graph.d.ts +2 -0
  86. package/lib/errors/codes/data-graph.js +22 -0
  87. package/lib/errors/codes/data-stream.d.ts +2 -0
  88. package/lib/errors/codes/data-stream.js +70 -0
  89. package/lib/errors/codes/data-transform.d.ts +2 -0
  90. package/lib/errors/codes/data-transform.js +35 -0
  91. package/lib/errors/codes/dependency.d.ts +2 -0
  92. package/lib/errors/codes/dependency.js +11 -0
  93. package/lib/errors/codes/dlo.d.ts +2 -0
  94. package/lib/errors/codes/dlo.js +31 -0
  95. package/lib/errors/codes/dmo.d.ts +2 -0
  96. package/lib/errors/codes/dmo.js +28 -0
  97. package/lib/errors/codes/general.d.ts +2 -0
  98. package/lib/errors/codes/general.js +57 -0
  99. package/lib/errors/codes/identity-resolution.d.ts +2 -0
  100. package/lib/errors/codes/identity-resolution.js +24 -0
  101. package/lib/errors/codes/mapping.d.ts +2 -0
  102. package/lib/errors/codes/mapping.js +42 -0
  103. package/lib/errors/codes/relationship.d.ts +2 -0
  104. package/lib/errors/codes/relationship.js +21 -0
  105. package/lib/errors/codes/segment.d.ts +2 -0
  106. package/lib/errors/codes/segment.js +49 -0
  107. package/lib/errors/registry.d.ts +60 -0
  108. package/lib/errors/registry.js +123 -0
  109. package/lib/plugin.d.ts +1 -0
  110. package/lib/plugin.js +3 -1
  111. package/lib/services/acquire-retrieve-selection.d.ts +43 -0
  112. package/lib/services/acquire-retrieve-selection.js +145 -0
  113. package/lib/services/bind-identity-resolution-dependencies.d.ts +53 -0
  114. package/lib/services/bind-identity-resolution-dependencies.js +238 -0
  115. package/lib/services/bind-segment-dependencies.d.ts +49 -0
  116. package/lib/services/bind-segment-dependencies.js +115 -0
  117. package/lib/services/bounded-reads.d.ts +17 -0
  118. package/lib/services/bounded-reads.js +42 -0
  119. package/lib/services/calculated-insight-sql-checks.d.ts +33 -0
  120. package/lib/services/calculated-insight-sql-checks.js +193 -0
  121. package/lib/services/command-dlo.d.ts +48 -0
  122. package/lib/services/command-dlo.js +103 -0
  123. package/lib/services/command-native-data-graph.d.ts +54 -0
  124. package/lib/services/command-native-data-graph.js +485 -0
  125. package/lib/services/command-native-data-stream.d.ts +104 -0
  126. package/lib/services/command-native-data-stream.js +257 -0
  127. package/lib/services/command-native-dmo.d.ts +124 -0
  128. package/lib/services/command-native-dmo.js +338 -0
  129. package/lib/services/command-native-mapping.d.ts +65 -0
  130. package/lib/services/command-native-mapping.js +129 -0
  131. package/lib/services/command-native-relationship.d.ts +46 -0
  132. package/lib/services/command-native-relationship.js +103 -0
  133. package/lib/services/cross-dataspace-deploy.d.ts +111 -0
  134. package/lib/services/cross-dataspace-deploy.js +493 -0
  135. package/lib/services/cross-dataspace-rename.d.ts +74 -0
  136. package/lib/services/cross-dataspace-rename.js +1314 -0
  137. package/lib/services/cross-dataspace-sql.d.ts +109 -0
  138. package/lib/services/cross-dataspace-sql.js +1301 -0
  139. package/lib/services/cross-space-context.d.ts +23 -0
  140. package/lib/services/cross-space-context.js +36 -0
  141. package/lib/services/crud-plan.d.ts +137 -0
  142. package/lib/services/crud-plan.js +408 -0
  143. package/lib/services/data-space-check.d.ts +89 -0
  144. package/lib/services/data-space-check.js +162 -0
  145. package/lib/services/data-space-prefix.d.ts +77 -0
  146. package/lib/services/data-space-prefix.js +127 -0
  147. package/lib/services/data-transform-space.d.ts +31 -0
  148. package/lib/services/data-transform-space.js +79 -0
  149. package/lib/services/delete-calculated-insight.d.ts +44 -0
  150. package/lib/services/delete-calculated-insight.js +101 -0
  151. package/lib/services/delete-data-transform.d.ts +52 -0
  152. package/lib/services/delete-data-transform.js +222 -0
  153. package/lib/services/delete-dmo-field.d.ts +211 -0
  154. package/lib/services/delete-dmo-field.js +472 -0
  155. package/lib/services/delete-identity-resolution.d.ts +43 -0
  156. package/lib/services/delete-identity-resolution.js +295 -0
  157. package/lib/services/delete-segment.d.ts +42 -0
  158. package/lib/services/delete-segment.js +248 -0
  159. package/lib/services/deploy-result.d.ts +54 -0
  160. package/lib/services/deploy-result.js +60 -0
  161. package/lib/services/escaped-copy.d.ts +23 -0
  162. package/lib/services/escaped-copy.js +88 -0
  163. package/lib/services/execute-calculated-insight-deploy.d.ts +42 -0
  164. package/lib/services/execute-calculated-insight-deploy.js +96 -0
  165. package/lib/services/execute-data-transform-deploy.d.ts +56 -0
  166. package/lib/services/execute-data-transform-deploy.js +168 -0
  167. package/lib/services/execute-native-identity-resolution-deploy.d.ts +48 -0
  168. package/lib/services/execute-native-identity-resolution-deploy.js +360 -0
  169. package/lib/services/execute-segment-deploy.d.ts +45 -0
  170. package/lib/services/execute-segment-deploy.js +393 -0
  171. package/lib/services/local-file-removal.d.ts +36 -0
  172. package/lib/services/local-file-removal.js +103 -0
  173. package/lib/services/native-calculated-insight.d.ts +87 -0
  174. package/lib/services/native-calculated-insight.js +164 -0
  175. package/lib/services/native-crm-data-stream.d.ts +91 -0
  176. package/lib/services/native-crm-data-stream.js +272 -0
  177. package/lib/services/native-data-graph-context.d.ts +12 -0
  178. package/lib/services/native-data-graph-context.js +139 -0
  179. package/lib/services/native-data-graph-crd.d.ts +261 -0
  180. package/lib/services/native-data-graph-crd.js +866 -0
  181. package/lib/services/native-data-stream.d.ts +329 -0
  182. package/lib/services/native-data-stream.js +1830 -0
  183. package/lib/services/native-dlo.d.ts +163 -0
  184. package/lib/services/native-dlo.js +402 -0
  185. package/lib/services/native-dmo.d.ts +191 -0
  186. package/lib/services/native-dmo.js +614 -0
  187. package/lib/services/native-mapping.d.ts +255 -0
  188. package/lib/services/native-mapping.js +1226 -0
  189. package/lib/services/native-relationship.d.ts +132 -0
  190. package/lib/services/native-relationship.js +512 -0
  191. package/lib/services/operation-diagnostic.d.ts +83 -0
  192. package/lib/services/operation-diagnostic.js +272 -0
  193. package/lib/services/preflight-calculated-insight-deploy.d.ts +58 -0
  194. package/lib/services/preflight-calculated-insight-deploy.js +95 -0
  195. package/lib/services/preflight-data-transform-deploy.d.ts +33 -0
  196. package/lib/services/preflight-data-transform-deploy.js +104 -0
  197. package/lib/services/preflight-identity-resolution-deploy.d.ts +107 -0
  198. package/lib/services/preflight-identity-resolution-deploy.js +281 -0
  199. package/lib/services/preflight-segment-deploy.d.ts +31 -0
  200. package/lib/services/preflight-segment-deploy.js +109 -0
  201. package/lib/services/publish-calculated-insight.d.ts +40 -0
  202. package/lib/services/publish-calculated-insight.js +95 -0
  203. package/lib/services/publish-segment.d.ts +65 -0
  204. package/lib/services/publish-segment.js +194 -0
  205. package/lib/services/readback-pace.d.ts +16 -0
  206. package/lib/services/readback-pace.js +23 -0
  207. package/lib/services/retrieve-data-transform.d.ts +26 -0
  208. package/lib/services/retrieve-data-transform.js +65 -0
  209. package/lib/services/retrieve-identity-resolution.d.ts +40 -0
  210. package/lib/services/retrieve-identity-resolution.js +87 -0
  211. package/lib/services/retrieve-inventory.d.ts +32 -0
  212. package/lib/services/retrieve-inventory.js +151 -0
  213. package/lib/services/retrieve-segment.d.ts +120 -0
  214. package/lib/services/retrieve-segment.js +502 -0
  215. package/lib/services/segment-lookup.d.ts +46 -0
  216. package/lib/services/segment-lookup.js +108 -0
  217. package/lib/services/segment-members.d.ts +144 -0
  218. package/lib/services/segment-members.js +402 -0
  219. package/lib/services/select-native-retrieve.d.ts +60 -0
  220. package/lib/services/select-native-retrieve.js +226 -0
  221. package/lib/services/settle-calculated-insight.d.ts +22 -0
  222. package/lib/services/settle-calculated-insight.js +53 -0
  223. package/lib/services/sql-tokens.d.ts +58 -0
  224. package/lib/services/sql-tokens.js +147 -0
  225. package/lib/transport/api-version.d.ts +36 -0
  226. package/lib/transport/api-version.js +89 -0
  227. package/lib/transport/bound-ssot.d.ts +27 -0
  228. package/lib/transport/bound-ssot.js +116 -0
  229. package/lib/transport/calculated-insight-rest.d.ts +28 -0
  230. package/lib/transport/calculated-insight-rest.js +62 -0
  231. package/lib/transport/connect-client.d.ts +94 -32
  232. package/lib/transport/connect-client.js +318 -178
  233. package/lib/transport/connect-diagnostic.d.ts +89 -0
  234. package/lib/transport/connect-diagnostic.js +331 -0
  235. package/lib/transport/data-graph-rest.d.ts +27 -0
  236. package/lib/transport/data-graph-rest.js +76 -0
  237. package/lib/transport/data-stream-rest.d.ts +62 -0
  238. package/lib/transport/data-stream-rest.js +348 -0
  239. package/lib/transport/data-transform-rest.d.ts +25 -0
  240. package/lib/transport/data-transform-rest.js +100 -0
  241. package/lib/transport/dlo-native-rest.d.ts +22 -0
  242. package/lib/transport/dlo-native-rest.js +89 -0
  243. package/lib/transport/dlo-rest.d.ts +23 -0
  244. package/lib/transport/dlo-rest.js +135 -0
  245. package/lib/transport/dmo-native-rest.d.ts +18 -0
  246. package/lib/transport/dmo-native-rest.js +55 -0
  247. package/lib/transport/dmo-rest.d.ts +30 -0
  248. package/lib/transport/dmo-rest.js +163 -0
  249. package/lib/transport/mapping-rest.d.ts +63 -0
  250. package/lib/transport/mapping-rest.js +341 -0
  251. package/lib/transport/project-metadata.d.ts +36 -0
  252. package/lib/transport/project-metadata.js +118 -0
  253. package/lib/transport/relationship-rest.d.ts +43 -0
  254. package/lib/transport/relationship-rest.js +201 -0
  255. package/package.json +29 -6
  256. package/lib/artifacts/dmo-document.d.ts +0 -181
  257. package/lib/artifacts/dmo-document.js +0 -848
  258. package/lib/artifacts/dmo-update-delta.d.ts +0 -28
  259. package/lib/artifacts/dmo-update-delta.js +0 -86
  260. package/lib/artifacts/write-other-dmo.d.ts +0 -17
  261. package/lib/artifacts/write-other-dmo.js +0 -140
  262. package/lib/services/execute-dmo-create.d.ts +0 -24
  263. package/lib/services/execute-dmo-create.js +0 -118
  264. package/lib/services/execute-dmo-deploy.d.ts +0 -33
  265. package/lib/services/execute-dmo-deploy.js +0 -197
  266. package/lib/services/preflight-dmo-deploy.d.ts +0 -69
  267. package/lib/services/preflight-dmo-deploy.js +0 -161
  268. package/lib/services/retrieve-other-dmo.d.ts +0 -46
  269. package/lib/services/retrieve-other-dmo.js +0 -140
@@ -1,10 +1,42 @@
1
+ import { writeDataTransformDocument } from '../../artifacts/write-data-transform.js';
2
+ import { retrieveDataTransform } from '../../services/retrieve-data-transform.js';
3
+ import { createDataTransformClient } from '../../transport/data-transform-rest.js';
4
+ import { nativeDataGraphReadContext } from '../../services/native-data-graph-context.js';
5
+ import { retrieveNativeDataGraph } from '../../services/command-native-data-graph.js';
6
+ import { writeDataStreamDocument } from '../../artifacts/write-data-stream.js';
7
+ import { retrieveDataStreamDocument } from '../../services/native-crm-data-stream.js';
8
+ import { retrieveNativeDataStream } from '../../services/native-data-stream.js';
9
+ import { listNativeNames, listNativeMappingNames } from '../../services/select-native-retrieve.js';
10
+ import { retrieveLeanNativeMapping } from '../../services/native-mapping.js';
11
+ import type { MappingDependencies } from '../../services/native-mapping.js';
12
+ import { createMappingClient, createMappingInventoryReader } from '../../transport/mapping-rest.js';
13
+ import { writeNativeMappingDocument } from '../../artifacts/write-native-mapping.js';
14
+ import { retrieveNativeDmo } from '../../services/native-dmo.js';
15
+ import { createDmoClient } from '../../transport/dmo-rest.js';
16
+ import { writeNativeDmoDocument } from '../../artifacts/write-native-dmo.js';
17
+ import { retrieveNativeDlo } from '../../services/native-dlo.js';
18
+ import { createDloClient } from '../../transport/dlo-rest.js';
19
+ import { writeDloDocument } from '../../artifacts/write-dlo.js';
20
+ import { writeNativeRelationshipDocument } from '../../artifacts/write-native-relationship.js';
21
+ import { retrieveUnlabelledRelationships } from '../../services/native-relationship.js';
22
+ import { createRelationshipClient } from '../../transport/relationship-rest.js';
23
+ import { openBoundSsot } from '../../transport/bound-ssot.js';
24
+ import type { BoundSsot } from '../../transport/bound-ssot.js';
25
+ import { writeDataGraphDocument } from '../../artifacts/write-data-graph.js';
26
+ import { listCalculatedInsightNames, retrieveNativeCalculatedInsight } from '../../services/native-calculated-insight.js';
27
+ import { createCalculatedInsightClient } from '../../transport/calculated-insight-rest.js';
28
+ import { writeNativeCalculatedInsightDocument } from '../../artifacts/write-native-calculated-insight.js';
1
29
  import { SfCommand } from '@salesforce/sf-plugins-core';
2
- import { Org } from '@salesforce/core';
3
- import { writeDmoDocument } from '../../artifacts/write-other-dmo.js';
4
- import { retrieveDmo, selectDmos } from '../../services/retrieve-other-dmo.js';
30
+ import { Connection, Org } from '@salesforce/core';
31
+ import { listIdentityResolutionNames, retrieveIdentityResolution } from '../../services/retrieve-identity-resolution.js';
32
+ import { writeIdentityResolutionDocument } from '../../artifacts/write-identity-resolution.js';
33
+ import { writeSegmentDocument } from '../../artifacts/write-segment.js';
34
+ import { listSegmentNames, retrieveSegment } from '../../services/retrieve-segment.js';
35
+ import { listDataGraphNames, listDataStreamNames, listDataTransformNames } from '../../services/retrieve-inventory.js';
36
+ import { acquireRetrieveSelection } from '../../services/acquire-retrieve-selection.js';
5
37
  export type RetrieveEnvelope = {
6
38
  contract: 'sf-data360-retrieve';
7
- contractVersion: '1.0.0';
39
+ contractVersion: '1.1.0';
8
40
  status: 'success' | 'blocked' | 'failed';
9
41
  metadata: {
10
42
  operation: 'retrieve';
@@ -13,6 +45,7 @@ export type RetrieveEnvelope = {
13
45
  version: string;
14
46
  };
15
47
  apiVersion: string;
48
+ soapApiVersion?: string;
16
49
  };
17
50
  diagnostics: {
18
51
  warnings: string[];
@@ -24,6 +57,7 @@ export type RetrieveEnvelope = {
24
57
  dataSpace: string;
25
58
  apiName: string;
26
59
  };
60
+ family?: RetrieveFamily;
27
61
  }>;
28
62
  };
29
63
  provenance: {
@@ -47,29 +81,242 @@ export type RetrieveEnvelope = {
47
81
  operation: 'retrieve';
48
82
  outcome: 'retrieved' | 'unchanged';
49
83
  path: string;
84
+ companionPath?: string;
85
+ /** Segment: the SQL file of each model, in model order. */
86
+ codePaths?: string[];
87
+ paths?: string[];
88
+ family?: 'segment' | 'identity-resolution' | 'calculated-insight' | 'data-graph' | 'data-stream' | 'data-transform' | 'dlo' | 'relationship' | 'mapping';
89
+ routes?: Array<{
90
+ operation: string;
91
+ apiVersion: string;
92
+ transport: 'native' | 'metadata';
93
+ }>;
94
+ /** DLO and data stream: every data space of the DLO (the file's c__dataSpace), sorted. */
95
+ dataSpaces?: string[];
96
+ /** Written as Salesforce returned it: the plugin cannot represent it (reason: error code). */
97
+ verbatim?: {
98
+ reason: string;
99
+ };
50
100
  }>;
51
101
  };
52
102
  };
53
- /** Retrieve selected DMO configuration through existing service-owned capability checks. */
103
+ /** One run's DLO and DMO listing entries by name, filled by listNativeNames. */
104
+ type ListedEntries = {
105
+ dlo: Map<string, unknown>;
106
+ dmo: Map<string, unknown>;
107
+ };
108
+ declare const retrieveFamilies: readonly ["dlo", "dmo", "mapping", "relationship", "segment", "calculated-insight", "identity-resolution", "data-stream", "data-transform", "data-graph"];
109
+ /** Family named on a diagnostic. */
110
+ export type RetrieveFamily = (typeof retrieveFamilies)[number];
54
111
  export default class Retrieve extends SfCommand<RetrieveEnvelope> {
55
112
  static readonly aliases: string[];
56
- static readonly summary = "Retrieve Data360 DMOs into a local project.";
57
- static readonly description = "Repeat -m dmo:ApiName for exact selection, use -m dmo for all DMOs in the selected space, or omit selectors for all implemented families (currently DMO only). Unsupported objects produce per-object diagnostics and a nonzero aggregate while successful files are retained. Differing files require --overwrite; identical bytes are unchanged. Retrieval never mutates the org.";
113
+ static readonly summary = "Retrieve any mix of Data360 DLOs, DMOs, mappings, relationships, data streams, data transforms, data graphs, Segments, calculated insights and identity resolution configuration.";
114
+ static readonly description = "Any mix of selectors is retrieved in one run with one result: every selector is checked before the org is read, and a refused selector blocks the whole run (with several families selected, the refusal names its family). The families are then read one after another (DLO, DMO, mapping, relationship, Segment, calculated insight and identity resolution first, then data streams, data transforms and data graphs), each with its own API version and data space rules; one family failing does not stop the others. Exact -m data-transform:Name retrieves a transform (custom, system or packaged) at API68 in the run data space (c__dataSpace: its dataSpaceName or, without one, the data space of its MktDataTransform record read with SOQL; one without any data space is handled in default only; another data space is TRANSFORM_DATASPACE_MISMATCH, never a verbatim file) into data360/dataTransforms/<Name>.dataTransform.json: its create/update input as Salesforce returns it (definition or definitions, fullRunFrequency, write mode and the rest as read), without server-owned output object fields, plus its schedule projected onto the keys the schedule PUT takes (no schedule key when the transform has none, so a deploy of the file leaves the schedule alone; also left out, with a warning, when the schedule read fails). A transform with both definition and definitions is written as-is (verbatim), and deploy refuses that file. Bare -m data-transform retrieves every transform of the run data space the API lists (kept by the dataSpaceName of each entry, or its MktDataTransform record for an entry without one), each through the same path; one failing transform never blocks the others. Exact -m data-stream:ApiName retrieves an Ingestion API stream (any refresh mode and DLO category) as portable JSON using native API68 reads, when its DLO belongs to the run data space (the file lists every data space of the DLO in c__dataSpace); a stream of any other connector (for example Salesforce CRM, SalesforceDotCom) is written as its GET without server-owned keys and the system fields and mappings Salesforce adds, formulas decoded. Bare -m data-stream retrieves every stream the API lists (unless its DLO names only other data spaces), each through the same path. Native DLO, DMO and mapping retrieval writes canonical JSON under data360/<type>, retaining definition fields without source record IDs. A DLO file lists every data space the DLO belongs to in its top-level c__dataSpace key; the DLOs of the run data space are retrieved. Every retrieve first checks that the org has the run data space (one GET /ssot/data-spaces; UNKNOWN_DATASPACE otherwise). Default/auto uses API68; explicit numeric versions >=61 are preserved, and <=60 is rejected before calls. Omit selectors for all three native families, use -m dlo, -m dmo or -m mapping for complete type inventory, or repeat type:ApiName for exact selections. Omitted selectors and -m dlo (also beside other families) retrieve every DLO the Data 360 API lists in the data space, connector- and stream-created ones included; a DLO whose read or file fails gets its own diagnostic and the others are still retrieved. Mapping JSON uses the native APIs; only its label (spec.label) is read with the Metadata API (readMetadata of ObjectSourceTargetMap, up to 10 names per call), left out when it equals the mapping name (the default) and, with a warning, when that read fails. DMOs retrieved beside other families use the same native JSON at the native version. Prerequisites are checked, never pulled in; select every component to retrieve explicitly. Every DMO selection uses this native route, and --api-version latest is not accepted. Exact -m relationship:Dmo__dlm writes every relationship whose source is that DMO as native JSON under data360/relationship/<Name>.relationship-meta.json; bare -m relationship does so for every DMO the API lists, one DMO after another. Repeat -m dmo:ApiName, -m segment:ApiName, -m calculated-insight:ApiName__cio, -m data-graph:ApiName or -m identity-resolution:ExactObjectApiName for exact selection. Graph retrieval uses native API68 (auto or explicit 68.0; other versions are rejected) and writes *.native-dataGraph.json authored intent without generated identities in the run data space (c__dataSpace, and definition.dataspaceName as read; a graph of another data space is DATA_GRAPH_DATASPACE_MISMATCH, never a verbatim file); repeat data-graph:ApiName for several graphs, read one after another. Bare -m data-graph retrieves every graph of the run data space the API lists. Calculated insights use the API68 GET only (auto or 68.0, in the run data space, written to c__dataSpace): -m calculated-insight:ApiName__cio retrieves that insight and bare -m calculated-insight every insight the API lists, whatever its status, schedule or SQL; each is written as data360/calculatedInsights/<ApiName>.calculatedInsight-meta.json (the GET body as returned, without status, run history, source-CI links, creation type, sub type and the dimensions and measures Salesforce derives from the SQL) plus its SQL as plain text in <ApiName>.calculatedInsight-meta.sql. IR uses native API68 owner reads in the run data space (c__dataSpace; the file keeps the names Salesforce stores, ds2_Individual_<id> and ds2_Individual__dlm outside default; a ruleset of another data space is IDENTITY_RESOLUTION_DATASPACE_MISMATCH, never a verbatim file); auto and explicit numeric68 are supported, while numeric67 is rejected. -m identity-resolution:ExactObjectApiName retrieves that ruleset and bare -m identity-resolution every ruleset of the run data space the API lists (kept by the dataSpaceName of each entry, as the list answers every data space). Auto selects fixed qualified routes, never probes or upgrades an explicit numeric pin. Segment uses auto or 68.0 in the run data space (c__dataSpace; a segment of another data space is SEGMENT_DATASPACE_MISMATCH; the file carries the stored name, <prefix>_<Name> in a non-default data space; other versions are refused): -m segment:ApiName retrieves that segment and bare -m segment every segment of the run data space the API lists (kept by the dataSpace of each entry). A SQL (DBT) segment is written as one portable data360/segments/<Name>.segment.json with its DBT model names, and the SQL of each model as Salesforce returns it in <Name>.segment.<model>.sql beside it; a UI segment (built in the segment canvas) is written as a normal <Name>.segment.json with its criteria as JSON. Any other segment type is written with the same keys, without SQL files (a Waterfall with its child segments by API name in childSegments, named with one segment list read); the lookback and the refresh schedule are kept (schedule in the write shape; no schedule key for a segment that does not refresh), and a key the plugin does not know stays in the file and deploy refuses it. A segment with parameters (no write takes them), schedule details the plugin does not know or UI criteria that are not a JSON object is written as-is (verbatim) and deploy refuses that file. Use -m dmo or omit selectors for existing DMO inventory; omitted selectors do not include segments. Unsupported objects produce per-object diagnostics and a nonzero aggregate while successful files are retained. Differing files require --overwrite; identical bytes are unchanged. Retrieval never mutates the org.";
58
115
  static readonly flags: {
59
116
  'target-org': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
60
117
  'api-version': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
61
- 'data-space': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
118
+ dataspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
62
119
  metadata: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
63
120
  'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
64
121
  overwrite: import("@oclif/core/interfaces").BooleanFlag<boolean>;
65
122
  };
66
- protected acquire: typeof retrieveDmo;
67
- protected selectDocuments: typeof selectDmos;
68
- protected resolveOrg: (aliasOrUsername?: string) => Promise<Org>;
69
- protected writeDocument: typeof writeDmoDocument;
123
+ protected acquireDataTransform: typeof retrieveDataTransform;
124
+ protected createDataTransformClient: typeof createDataTransformClient;
125
+ protected writeDataTransform: typeof writeDataTransformDocument;
126
+ protected nativeGraphContext: typeof nativeDataGraphReadContext;
127
+ protected retrieveNativeGraph: typeof retrieveNativeDataGraph;
128
+ protected acquireDataStream: typeof retrieveDataStreamDocument;
129
+ protected writeDataStream: typeof writeDataStreamDocument;
130
+ protected createDataStreamClients: (connection: Connection, target: string, version: string) => Parameters<typeof retrieveNativeDataStream>[1];
131
+ protected acquireNativeDmo: typeof retrieveNativeDmo;
132
+ protected createDmoClient: typeof createDmoClient;
133
+ protected writeNativeDmo: typeof writeNativeDmoDocument;
134
+ protected acquireDlo: typeof retrieveNativeDlo;
135
+ protected createDloClient: typeof createDloClient;
136
+ protected writeDlo: typeof writeDloDocument;
137
+ protected acquireNativeMapping: typeof retrieveLeanNativeMapping;
138
+ protected createMappingClient: typeof createMappingClient;
139
+ protected createMappingInventoryReader: typeof createMappingInventoryReader;
140
+ protected writeNativeMapping: typeof writeNativeMappingDocument;
141
+ protected createSsotSender: typeof openBoundSsot;
142
+ private ssotSenders?;
143
+ /**
144
+ * One shared bound sender per org and API version.
145
+ * @param {string} target Target org alias or username.
146
+ * @param {string} version Numeric API version.
147
+ * @param {Connection} connection The run's authenticated Connection for that org.
148
+ * @returns {BoundSsot} Shared sender.
149
+ */
150
+ protected ssotSender(target: string, version: string, connection: Connection): BoundSsot;
151
+ /**
152
+ * Readers of a mapping's source DLO and target DMO; clients are created on the first read.
153
+ * @param {string} target Target org alias or username.
154
+ * @param {string} version Native API version.
155
+ * @param {BoundSsot} sender Shared bound sender for the reads.
156
+ * @param {ListedEntries} [listed] This run's DLO and DMO listing entries at the same version.
157
+ * @param {Map<string, Promise<unknown>>} [shared] This run's parent reads: a DLO or DMO that
158
+ * several mappings name is read once (a failed read is not kept); each caller gets a copy.
159
+ * @returns {MappingDependencies} Lazy source and target readers.
160
+ */
161
+ protected mappingParents(target: string, version: string, sender: BoundSsot, listed?: ListedEntries, shared?: Map<string, Promise<unknown>>): MappingDependencies;
162
+ protected listNativeNames: typeof listNativeNames;
163
+ protected listNativeMappingNames: typeof listNativeMappingNames;
164
+ protected acquireRelationships: typeof retrieveUnlabelledRelationships;
165
+ /**
166
+ * A relationship client on the run's shared bound sender: every DMO's reads go through one
167
+ * in-process connection, never a CLI process. Tests replace this seam.
168
+ * @param {Connection} connection The run's authenticated Connection.
169
+ * @param {string} target Target org alias or username.
170
+ * @param {string} version Native API version.
171
+ * @param {string} dataSpace The run's data space.
172
+ * @returns {ReturnType<typeof createRelationshipClient>} Relationship client.
173
+ */
174
+ protected createRelationshipClient(connection: Connection, target: string, version: string, dataSpace: string): ReturnType<typeof createRelationshipClient>;
175
+ protected writeRelationship: typeof writeNativeRelationshipDocument;
176
+ protected writeDataGraph: typeof writeDataGraphDocument;
177
+ protected createCalculatedInsightClient: typeof createCalculatedInsightClient;
178
+ protected acquireCalculatedInsight: typeof retrieveNativeCalculatedInsight;
179
+ protected listCalculatedInsightNames: typeof listCalculatedInsightNames;
180
+ protected listSegmentNames?: typeof listSegmentNames;
181
+ protected listIdentityResolutionNames?: typeof listIdentityResolutionNames;
182
+ protected listDataStreamNames?: typeof listDataStreamNames;
183
+ protected listDataTransformNames?: typeof listDataTransformNames;
184
+ protected listDataGraphNames?: typeof listDataGraphNames;
185
+ protected writeCalculatedInsight: typeof writeNativeCalculatedInsightDocument;
186
+ protected acquireIdentityResolution: typeof retrieveIdentityResolution;
187
+ protected writeIdentityResolution: typeof writeIdentityResolutionDocument;
188
+ protected acquireSegment: typeof retrieveSegment;
189
+ protected acquireSelection: typeof acquireRetrieveSelection;
190
+ protected writeSegment: typeof writeSegmentDocument;
191
+ protected resolveOrg: (aliasOrUsername?: string) => Promise<Pick<Org, "getConnection" | "getOrgId">>;
192
+ /**
193
+ * The writer of a document kind; every writer also writes a verbatim document of its kind.
194
+ * @param {VerbatimKind} kind Document kind.
195
+ * @returns {DocumentWriter} Family writer.
196
+ */
197
+ private documentWriter;
70
198
  /**
71
- * Acquire the complete runtime projection, then publish only its authored candidate.
199
+ * Warn when a retrieved component that users make themselves (custom DMO, insight, transform,
200
+ * graph) breaks the prefix rule of its data space. The prefixes come from the run's one data
201
+ * space list read; without it, or in an org whose spaces have no prefix, nothing is reported.
202
+ * @param {PrefixType} type Kind of component.
203
+ * @param {string} name Its name.
204
+ * @param {unknown} native Its raw read.
205
+ * @param {string} space The run's data space.
206
+ * @param {string[]} warnings Envelope warnings.
207
+ * @returns {Promise<void>} Resolves once checked.
208
+ */
209
+ private notePrefixMismatch;
210
+ /**
211
+ * Report a written verbatim document: a warning naming the reason (and a calculated insight's
212
+ * SQL file left from an earlier retrieve), plus the item marker.
213
+ * @param {VerbatimDocument} document Written verbatim document.
214
+ * @param {string} file Its path.
215
+ * @param {string[]} warnings Envelope warnings.
216
+ * @returns {Promise<{verbatim: {reason: string}}>} Item marker.
217
+ */
218
+ private noteVerbatim;
219
+ /**
220
+ * The verbatim document for a failed projection or validation, or undefined when the failure
221
+ * stays an item failure (HTTP error, not found, identity/target mismatch, no response read).
222
+ * @param {unknown} error Caught error.
223
+ * @param {{native: unknown} | undefined} read Raw GET response of the item.
224
+ * @param {VerbatimKind} kind Normal document kind.
225
+ * @param {object} identity Normal identity.
226
+ * @param {string} identity.dataSpace Data space.
227
+ * @param {string} identity.apiName API name.
228
+ * @returns {VerbatimDocument | undefined} Verbatim document.
229
+ */
230
+ private verbatimFor;
231
+ /**
232
+ * Catch-all of every family: an item whose projection or validation failed is written as
233
+ * Salesforce returned it, at its normal path, with a warning; it is not an item failure.
234
+ * @param {unknown} caught Caught error.
235
+ * @param {{native: unknown} | undefined} read Raw GET response of the item.
236
+ * @param {VerbatimTarget} target Kind, identity, routes, output and where to report.
237
+ * @returns {Promise<unknown>} Undefined when written; otherwise the error to report (the
238
+ * original one, or the verbatim write's own).
239
+ */
240
+ private verbatimFallback;
241
+ /**
242
+ * Retrieve every relationship whose source is one of the DMOs, one file each. Each DMO's
243
+ * inventory is read completely before its files are written; failures stay per DMO or file.
244
+ * @param {string[]} dmoNames Exact sorted source DMOs.
245
+ * @param {Connection} connection Command-owned connection for the bound reads.
246
+ * @param {string} target Resolved username.
247
+ * @param {string} version Native API version.
248
+ * @param {string} effectiveScope The run's data space.
249
+ * @param {string} root Project root.
250
+ * @param {boolean} overwrite Permit replacing differing files.
251
+ * @returns {Promise<object>} Items, diagnostics and whether a failure was not local.
252
+ */
253
+ private retrieveRelationshipFamily;
254
+ /**
255
+ * Report a family listing that could not be read; the family's named items are still read.
256
+ * @param {RetrieveEnvelope} envelope Shared envelope.
257
+ * @param {Map<RetrieveDiagnostic, string>} errorTypes Output type of each diagnostic.
258
+ * @param {unknown} error The listing failure.
259
+ * @param {RetrieveFamily} family Family whose listing failed.
260
+ */
261
+ private inventoryFailure;
262
+ /**
263
+ * Validate exact and bare data transform selectors, then read them one after another.
264
+ * @param {string[]} selectors The data-transform group.
265
+ * @param {RetrieveRun} context Shared command state.
266
+ * @returns {GroupPlan} A refusal, or the group's read.
267
+ */
268
+ private prepareDataTransforms;
269
+ /**
270
+ * Validate exact data stream selectors, then read them one after another.
271
+ * @param {string[]} selectors The data-stream group.
272
+ * @param {RetrieveRun} context Shared command state.
273
+ * @returns {GroupPlan} A refusal, or the group's read.
274
+ */
275
+ private prepareDataStreams;
276
+ /**
277
+ * Validate exact data graph selectors, then read the graphs one after another. A failure of
278
+ * the shared org context blocks the group; a failure of one graph is reported for that graph.
279
+ * @param {string[]} selectors The data-graph group.
280
+ * @param {RetrieveRun} context Shared command state.
281
+ * @returns {GroupPlan} A refusal, or the group's read.
282
+ */
283
+ private prepareDataGraphs;
284
+ /**
285
+ * Validate every other selector (DLO, DMO, mapping, relationship, Segment, calculated
286
+ * insight, identity resolution); an empty selection is every native family.
287
+ * @param {string[]} selectors The selectors of no other group.
288
+ * @param {RetrieveRun} context Shared command state.
289
+ * @returns {GroupPlan} A refusal, or the group's read.
290
+ */
291
+ private prepareRest;
292
+ /**
293
+ * Native-only DLO, DMO, mapping and relationship selection, including type inventory.
294
+ * @param {string[]} selectors The rest group, native families only.
295
+ * @param {string[]} relationshipDmos Exact sorted relationship source DMOs.
296
+ * @param {RetrieveRun} context Shared command state.
297
+ * @returns {GroupPlan} A refusal, or the group's read.
298
+ */
299
+ private prepareNativeRest;
300
+ /**
301
+ * DLO, mapping, relationship, DMO, Segment, calculated insight and identity resolution
302
+ * selections that are not native-only.
303
+ * @param {string[]} selectors The rest group.
304
+ * @param {string[]} relationshipDmos Exact sorted relationship source DMOs.
305
+ * @param {RetrieveRun} context Shared command state.
306
+ * @returns {GroupPlan} A refusal, or the group's read.
307
+ */
308
+ private prepareMixedRest;
309
+ /**
310
+ * Retrieve any mix of families. Every selector group is validated before any org access; the
311
+ * groups then run one after another (rest, data-stream, data-transform, data-graph) into one
312
+ * envelope.
72
313
  * @returns {Promise<RetrieveEnvelope>} Versioned retrieval outcome and payload-free diagnostics.
73
314
  */
74
315
  run(): Promise<RetrieveEnvelope>;
316
+ /**
317
+ * The run itself; see run.
318
+ * @returns {Promise<RetrieveEnvelope>} Versioned retrieval outcome and payload-free diagnostics.
319
+ */
320
+ private retrieveAll;
75
321
  }
322
+ export {};