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
@@ -1,633 +1,528 @@
1
- # Internal DMO field contract
2
-
3
- The approved Git artifact is the authored-only document below. Runtime source
4
- expectations and joined projections remain internal, never part of that file.
5
- The validator/serializer, mappers and raw field projection are offline helpers;
6
- request mapping alone does not establish deployment acceptance. Explicit CLI
7
- retrieval now delegates to the existing service and writer; filesystem discovery,
8
- published JSON Schema and general deployment remain unimplemented. The future layout remains
9
- `data360/<logical-data-space>/<family>/<api-name>.json`. The internal bounded
10
- DMO writer below implements only `default/dmo`; explicit CLI retrieval is wired
11
- to the service and this writer without adding command-level profile restrictions.
12
-
13
- ## Retrieval selection and aggregate outcomes
14
-
15
- `selectDmos(connection, selectors, apiVersion, dataSpace)` validates API 65.0/default
16
- and selector syntax. Exact-only names need no inventory; `dmo` or omitted selectors
17
- expand the complete transport inventory for default space, coalescing and sorting
18
- with exact selections. No-selector means all currently implemented families (DMO
19
- only), not a promise about unimplemented families. There is no `--all` flag.
20
- The command validates before resolving core org authentication. Each selected name
21
- still passes `retrieveDmo` and `writeDmoDocument`; no category is silently filtered.
22
- Envelope `result.selection` records expanded exact selectors. Successful items
23
- retain their writer receipts even when other objects fail. Object errors carry
24
- `identity: { dataSpace, apiName }` and a payload-free precise code. Any error yields
25
- blocked/failed and exit 1; transport/output failures yield failed. Empty inventory
26
- is success with no items. File shape, canonical bytes and overwrite rules are unchanged.
27
-
28
- ## Internal read-only deploy input resolver
29
-
30
- `readDeployInputs({cwd, sourceDir?, metadata?})` returns sorted
31
- `Array<{path: string, document: DmoDocument}>`. Exactly one nonempty mode is required:
32
- explicit files/directories, or exact `dmo:ApiName` selectors resolving
33
- `<cwd>/data360/default/dmo/<ApiName>.json`. Repeated identical selections and
34
- overlapping paths coalesce; distinct files with case-conflicting identities reject.
35
- Metadata filenames must exactly match their document identity. No implicit all or
36
- bare-type selection exists. `deploy --preview` now calls this resolver using
37
- repeatable non-greedy source-dir or metadata flags, before target inspection.
38
-
39
- All directory descendants are selected, so non-JSON members reject rather than
40
- silently narrowing a directory. Limits: 256 files, 1024 visited entries, 16 nested
41
- levels and 1 MiB per file. Absolute or cwd-relative explicit paths are supported;
42
- wildcards, parent traversal, drive-relative paths, filesystem roots as directory
43
- selections, links/junctions/aliased ancestors and hardlinked files reject. Existing
44
- paths only: no mkdir, artifact, report or scratch writes. File handles are bounded
45
- and checked against observed identity/size/timestamps; ancestor checks narrow but
46
- do not eliminate hostile concurrent filesystem replacement races.
47
-
48
- UTF-8 must decode strictly, without a BOM. JSON must parse with unique object keys
49
- (including escaped equivalents), and pass both authored validation and independent
50
- default-space mapping. Raw projections, observations and unknown keys reject.
51
- Payload-free `DeployInputError` codes: INVALID_SELECTION, UNSAFE_SOURCE,
52
- INVALID_SOURCE, DUPLICATE_IDENTITY. No connection or mutation transport is used.
53
-
54
- ## Internal read-only deploy preflight
55
-
56
- `preflightDmoDeploy(document: unknown, connection: ReadConnection,
57
- apiVersion: unknown, dataSpace: unknown, allowLabelUpdates = false): Promise<DmoDeployPreview>` accepts one
58
- standalone authored document and explicit API 65.0/default target binding. It maps
59
- the source independently before reads and detaches the mapped request in memory.
60
- Shared execution admission rejects non-Other categories and non-Text/dynamic primary
61
- keys with `SOURCE_EXECUTION_UNSUPPORTED` before target reads; the offline mapper
62
- remains broader, without authored-count or unrelated field-type restrictions.
63
- Metadata qualification uses `readDmoMetadata(connection, objectApiName)` with an
64
- operation-local Metadata receiver and redirect-refusing transport. Core retains
65
- SOAP credentials/envelope/parsing; caller connection and global defaults are unchanged.
66
- Redirects fail with payload-free `METADATA_REDIRECT_REFUSED` before any follow-up.
67
- No file discovery, saved plan or mutation route is introduced by this service.
68
-
69
- The result is `{outcome, target, absenceProof, diagnostics}`. Outcomes are `create`,
70
- `update` (when opted in), `unchanged`, `blocked-changes` or `blocked`; target is `absent`, `present` or
71
- `unknown`. Only a successful complete offset inventory filtered by exact default
72
- space/API-name identity yields `absenceProof: 'complete-inventory'`; otherwise it
73
- is `none`. No 404 or other error establishes absence. Existing inventory entries
74
- require common `retrieveDmo` qualification including Metadata and relationships.
75
- A race after inventory acquisition fails closed on retrieval; inventory is not a
76
- transactional snapshot or permission to execute a later create.
77
-
78
- Comparison uses fixed authored properties and exact identity-keyed fields, ignoring
79
- field array order but preserving absent versus empty strings, case, primary/type,
80
- category, dynamic flags and date designations. Static reasons distinguish object,
81
- category, field-set, field and immutable changes in default create-only mode. With
82
- `allowLabelUpdates`, the bounded executable delta gate admits only labels and rejects
83
- unsupported or mixed changes with `UPDATE_UNSUPPORTED`. Unqualified target semantics produce `blocked`, never no-op.
84
- Diagnostics contain code/message only, without authored values or remote payloads.
85
- The public command enforces CMS-style explicit deploy selection, never bare types
86
- or implicit deploy-all. `--preview` is strictly read-only; omission enables bounded execution.
87
- Core JSON wraps `sf-data360-deploy` version 1.0.0 with metadata operation deploy /
88
- preview boolean, diagnostics, targetOrgId provenance and result scope/selection/items.
89
- Each item includes authored identity, local path, operation preview and the unchanged
90
- service outcome/target/absenceProof/diagnostics. Aggregate success means preview
91
- only; any blocked item yields blocked/exit 1, unexpected failure yields failed/exit 1.
92
- All input resolution precedes command-owned org inspection. No writes or mutation
93
- transport; parser/auth flag errors use core diagnostics.
94
-
95
- ## Pure offline update-delta contract candidate
96
-
97
- `buildDmoUpdateDelta(desired: unknown, current: unknown, targetDataSpace: unknown):
98
- DmoUpdateDelta` independently validates both authored documents. The caller must
99
- already have acquired/qualified current state; this helper cannot establish org
100
- provenance, generated/status or relationship qualification from authored JSON.
101
- Both identities and explicit target scope must be case-sensitive default; object
102
- API names must match exactly. Invalid document shapes throw `DmoDocumentError`;
103
- scope/identity/unsupported changes return `{status: 'blocked', blockers: string[]}`
104
- without a patch or expected state. Unknown keys (including status, relationships,
105
- runtime projections and tombstones) reject rather than disappear.
106
-
107
- The candidate allowlist is object label, explicitly supplied changed nonblank
108
- object description, existing field label identified by exact name plus unchanged
109
- `dataType`, and new nonprimary/nondynamic authored fields. New fields map only
110
- name/label/dataType and explicitly supplied category/nonblank description; false
111
- primary/dynamic flags remain in the overlay, not the minimal PATCH. No create body
112
- reuse, object name/dataSpaceName/category/date/status/generated values enter it.
113
- Existing field description differences (including clearing), category presence or
114
- value differences, primary/dynamic/type changes, object category and either date
115
- designation changes block the entire candidate, even alongside admitted changes.
116
- A changed empty/whitespace object description or new-field description blocks;
117
- identical existing empty descriptions are no-ops, not clearing operations.
118
-
119
- Omitted object/field descriptions preserve current values. Desired missing target
120
- fields preserve them, never delete them: there is no tombstone and no heuristic
121
- rename inference. A different new name is an addition while the old field remains;
122
- a case-only collision blocks. Existing field order alone is unchanged. Candidate
123
- field entries and additions are sorted by exact name; the expected overlay retains
124
- target order and appends sorted additions. The overlay is detached from both inputs
125
- and the PATCH. Any blocker returns no partial payload. Unchanged returns
126
- `{status: 'unchanged', blockers: [], expected: DmoDocument}`; admitted differences
127
- return `{status: 'candidate', blockers: [], patch: DmoUpdatePatch, expected: DmoDocument}`.
128
- Neither status is a public update-enabled result or mutation authorization.
129
-
130
- Authoritative supplied checkpoint (2026-10-26): the official
131
- [Connect Data Model Object Input reference](https://developer.salesforce.com/docs/data/connectapi/references/spec?meta=type%3AData+Model+Object+Input)
132
- documents API 65 `PATCH /ssot/data-model-objects/{qualifiedName__dlm}`. Name/type
133
- changes are forbidden; its additions example does not prove omission preservation
134
- or existing-field label behavior. HTTP 200 may return the old state; future
135
- execution must separately GET and qualify actual post-state. Existing-label entry
136
- encoding above remains an internal candidate, not public update support. Retained
137
- synthetic PATCH2 readback now qualifies offline against the entire expected authored
138
- overlay with unchanged raw runtime observations: the changed Connect label matches
139
- Metadata labelOverride, while Metadata base/master labels retain their old values.
140
- This bounded checkpoint does not establish arbitrary omission or new-field behavior.
141
- Public preview/execution now admit only the bounded label subset below; the broader
142
- candidate is not execution permission. New-field preservation still needs a separately
143
- authorized experiment.
144
- No live calls or PATCH transport were added in the label-reconciliation slice.
145
-
146
- ## Bounded public label-update execution
147
-
148
- `executeDmoDeploy(document, connection, apiVersion, dataSpace)` and
149
- `executeDmoDeploySelection(documents, connection, apiVersion, dataSpace)` expose
150
- internal create/unchanged/update orchestration. `preflightDmoDeploy` accepts an
151
- optional fifth `allowLabelUpdates` boolean (default false); public preview/selection
152
- admission and internal execution opt in. Public CLI invokes `executeDmoDeploy` per
153
- item after whole-selection admission and never reports an update as a creation.
154
-
155
- Admission retains Other/default/API 65 and nondynamic Text primary-key restrictions.
156
- Only object labels and existing non-primary field labels execute. Primary-key labels
157
- would conflict with the current generated qualifier recipe; they remain blocked.
158
- New fields, object/field descriptions and every other unproven delta block atomically,
159
- even when mixed with labels. Omitted fields/descriptions preserve target values;
160
- field reordering is a no-op. The offline delta helper remains deliberately broader.
161
-
162
- Selection snapshots all valid inputs before reads and rejects duplicate identities.
163
- It preflights every item before the first write, then requalifies each executing target
164
- and derives its delta anew immediately before dispatch. One mutation per item, no
165
- retry/rollback. PATCH bodies (including stale HTTP 200 state) are never confirmation.
166
- Independent Connect detail, Metadata read and complete relationship inventory must
167
- qualify the expected authored overlay AND exact raw runtime preservation. Only the
168
- changed Connect/object Metadata label slots and existing-field Metadata labelOverride
169
- may differ; base/master field labels, generated qualifiers and all other raw values
170
- must remain. Only Connect/Metadata field collections normalize identity ordering.
171
-
172
- Results include `outcome: updated` with `mutation: confirmed-updated` only after all
173
- checks pass. Pre-write refusal is `not-attempted`; dispatch/readback ambiguity is
174
- `failed`/`unknown` and stops the selection with an unattempted tail. The recorded
175
- Other preservation checkpoint informs this narrow policy, not proof for other
176
- categories, new fields or general update semantics. No live calls were made here.
177
-
178
- ## Internal guarded create executor
179
-
180
- `executeDmoCreate(document: unknown, connection: TargetConnection, apiVersion: unknown,
181
- dataSpace: unknown): Promise<DmoCreateExecution>` accepts independently validated
182
- authored input and actual core connection subset (instanceUrl/request/metadata/
183
- getApiVersion), with explicit API65/default. It reconstructs a detached artifact
184
- before awaiting, then repeats preflight at execution time. No saved preview is
185
- accepted. Qualified unchanged targets do nothing; any existing differences block.
186
- Only complete-inventory absence authorizes the single fixed-route POST.
187
-
188
- Result `{outcome, mutation, preflight?, diagnostics}` uses outcome unchanged/blocked/
189
- created/failed and mutation not-attempted/confirmed-created/unknown. POST errors
190
- are unknown even when a status exists: creation may have occurred. POST bodies,
191
- including empty or malformed success bodies, are not completion evidence or trusted
192
- identities. Independent exact-name Connect detail + core Metadata read + complete
193
- relationships must pass common projector generated/qualifier integrity and
194
- identity-keyed authored comparison before confirmed-created. Missing/unqualified
195
- readback is READBACK_UNQUALIFIED; qualified semantic differences READBACK_MISMATCH.
196
- Unknown outcomes require target inspection; no automatic retry or rollback exists.
197
- The transport disables network retries and masks only the per-call JSforce refresh
198
- delegate to prevent its automatic 401 POST replay, without changing the original
199
- connection. Redirects, arbitrary write paths, PATCH and DELETE are unavailable.
200
- Inventory is not a transaction: concurrent creation cannot be ruled out. Tests are
201
- synthetic only; the mapper's wider input admission does not establish broader
202
- projector qualification or live deployment acceptance. Public CLI execution delegates
203
- creation here through `executeDmoDeploy`, after resolving/validating all inputs and preflighting the whole
204
- selection. A known blocked item or any preflight error prevents all execution.
205
- Each execution item carries operation execute, authored identity/path, outcome
206
- created/updated/unchanged/blocked/failed/not-attempted, mutation evidence (including
207
- confirmed-updated for qualified label readback), optional preflight
208
- and diagnostics in the same version 1.0.0 envelope. Sequential execution stops on the
209
- first blocked/failure/unknown mutation; prior receipts survive and remaining items
210
- are explicitly not-attempted. An unexpected executor throw conservatively retains
211
- unknown mutation. Aggregate success requires every execution to be created, updated or
212
- unchanged; otherwise blocked/failed exits 1, even when earlier mutations succeeded.
213
- No transaction, concurrency guarantee, retry, rollback or saved plan.
214
-
215
- ## Internal common authored DMO file writer
216
-
217
- `writeDmoDocument(value: unknown, projectRoot: string, overwrite: boolean)`
218
- returns `{ path: string, outcome: 'retrieved' | 'unchanged' }`. First independently
219
- validate through `buildDmoCreateRequestFromDocument(value, 'default')`, then
220
- use `serializeDmoDocument`. Persist only the approved authored document, never
221
- expectations, source IDs or runtime observations. Output is exactly
222
- `<project-root>/data360/default/dmo/<api-name>.json`; the CLI must supply cwd when
223
- `-d` is absent. No stale-file deletion or directory discovery exists.
224
-
225
- Identical bytes preserve the existing file even without overwrite; differing
226
- bytes require explicit overwrite. All existing ancestors are checked with lstat
227
- and canonical path checks; symlinks/junctions, directory destinations and file
228
- ancestors reject. Parents may be created but failed publication is never success.
229
- Complete flushed staging is created under verified OS temp, then atomically
230
- renamed for replacement or exclusively hard-linked for a new destination. The
231
- staging file entry is removed after hard-link publication, leaving no writable
232
- staging alias. Roots/ownership markers are retained; no recursive cleanup occurs.
233
- Cross-volume publication fails closed (no copy fallback). The caller must report
234
- OUTPUT_FAILED as failure and inspect the destination before retrying: publication
235
- may have completed before a subsequent filesystem failure. Rechecking ancestors
236
- and prior bytes narrows but cannot eliminate concurrent path-replacement races;
237
- this is not a filesystem sandbox against a hostile concurrent local process.
238
- Payload-free DmoWriteError codes: UNSAFE_PATH, OVERWRITE_REQUIRED, OUTPUT_FAILED.
239
-
240
- ## Authored document
241
-
242
- `validateDmoDocument(value: unknown): DmoDocument` checks without mutation;
243
- `serializeDmoDocument(value: unknown): string` sorts object keys, preserves array
244
- order and string contents, indents two spaces and appends LF. Only ordinary JSON
245
- records with enumerated keys are accepted. Unknown keys block, even null/false.
246
-
247
- - `schemaVersion: 1`, `kind: 'dmo'`.
248
- - `identity: { dataSpace, apiName }`: explicit logical data space and canonical
249
- non-namespaced custom name ending `__dlm`.
250
- - `spec`: nonblank `label`, optional string `description`, `category`
251
- (`Profile | Other | Engagement`), ordered nonempty `fields`. Optional
252
- `eventDateTimeFieldName` and `recordModifiedFieldName` resolve exactly to a
253
- DateTime field. Engagement requires its event reference.
254
- - Fields: canonical custom `name` ending `__c`, nonblank `label`, `dataType`,
255
- boolean `isPrimaryKey`, boolean `isDynamicLookup`; optional string `description`
256
- and `category`. Types: `Number`, `Text`, `Date`, `DateTime`, `Url`, `Phone`,
257
- `Email`, `Percent`, `Boolean`, `Currency`, `ArrayOfFloats`, `ArrayOfTexts`.
258
- - Exactly one primary key and case-insensitively unique field names are local
259
- subset constraints. Name stems begin with a letter, do not begin with SSOT,
260
- and have no trailing or consecutive underscores. Data-space identifiers use
261
- ASCII letters/digits/underscores and begin with a letter.
262
-
263
- These are authored-shape constraints, not selected-version deployment acceptance.
264
- Namespaced/standard objects, extra object categories, SQL/flex DMOs and object
265
- execution/status inputs remain outside this subset.
266
-
267
- ## Lossless diagnostic projection, explicitly incomplete
268
-
269
- `projectDmoRawFields(value: unknown): DmoFieldProjection` accepts custom raw detail
270
- only and returns `{ status: 'incomplete', blockers, candidate, configuration }`.
271
- It never returns a complete portable export. `candidate` is the writable-field
272
- subset for inspection only. `configuration` independently retains every admitted
273
- raw configuration property, including field order, original category spelling,
274
- flag presence, custom qualifiers and all system fields. It is not deploy input.
275
- Do not serialize this incomplete candidate as a portable retrieval result.
276
- Only a separately qualified strict retrieval may emit the approved authored document.
277
-
278
- - Read `type` maps to candidate `dataType`; missing boolean flags become false
279
- only in the candidate. Explicit invalid flags block. Uppercase PROFILE/OTHER/
280
- ENGAGEMENT map to title-case only in the candidate. Original values survive.
281
- - `creationType: System` fields remain in configuration, never silently disappear.
282
- They add `GENERATED_FIELD_REPLAY_UNVERIFIED`. No hardcoded name pattern proves
283
- generation; recreation and collisions still need target evidence.
284
- - Custom `keyQualifierName`, `isDistinct` and `usageTag` are retained and add
285
- `FIELD_SEMANTICS_REPLAY_UNVERIFIED`, even when false or apparently default.
286
- The nested input contract does not make these directly writable.
287
- - Every result includes `RELATIONSHIPS_NOT_ACQUIRED`. DMO detail does not establish
288
- incoming/outgoing relationship completeness. An empty detail field list of
289
- relationships is not evidence of absence. The separate raw acquisition helper
290
- below is not yet bound to this projection.
291
- - Unknown keys, nested semantic values, accessors, duplicate names, unsupported
292
- creation variants and invalid candidates throw payload-free `DmoDocumentError`.
293
-
294
- Raw object observations excluded from configuration are exactly `id`,
295
- `hasExternalDataLakeObjectMappings`, `isEditable`, `isEnabled`, `isSegmentable`.
296
- All other admitted object keys are configuration. Field configuration includes
297
- `name`, `label`, `description`, `category`, `type`, `isPrimaryKey`,
298
- `isDynamicLookup`, `creationType`, `keyQualifierName`, `isDistinct`, `usageTag`.
299
- No field-ID exemption or generic unknown-metadata stripping exists.
300
-
301
- ## Common object projection (retrieval-integrated)
302
-
303
- `projectCommonDmoConnectMetadata(connect: unknown, metadata: unknown,
304
- relationships: unknown): DmoCommonProjection` returns status `projected` or
305
- `incomplete`, blockers, optional validated candidate, verified local createIdentity,
306
- exact qualifierBindings and independent expectations containing all three inputs.
307
- Candidate is absent for missing Engagement event designation; it is diagnostic
308
- only whenever blockers remain. Inputs must be complete separately acquired
309
- collections; the projector cannot establish acquisition completeness itself.
310
-
311
- One common path composes the shared field join for all authored types/counts.
312
- Exact object name/label/description/default space and creation type must agree.
313
- Unknown meaningful properties reject, not disappear. The observed Other taxonomy
314
- and disabled/unmapped defaults qualify; unfamiliar taxonomy/category, execution,
315
- metrics and mapping semantics have specific blockers. Explicit Connect event and
316
- modified references must resolve exactly to authored DateTime fields. No Metadata
317
- designation key is invented. Missing Engagement event returns
318
- `ENGAGEMENT_EVENT_DESIGNATION_UNAVAILABLE`, even with one DateTime field.
319
-
320
- The retained cross-org Other experiment establishes the generated recipe: three
321
- standard system Text defaults and the explicit primary-key qualifier, joined by
322
- metadata reference, with their observed labels/usage/default storage semantics.
323
- The common recognizer checks those identities and defaults, not merely a System
324
- tag or suffix. Recognition resolves generated/qualifier and observed length-60
325
- storage blockers, without requiring two authored or six total fields. Other Text
326
- lengths, required/distinct semantics and unfamiliar generated variants stay blocked.
327
- Synthetic varied-count/type success is offline qualification, not new live proof.
328
- No-generated shapes also retain an unverified recipe blocker. Complete nonempty
329
- relationships remain retained with `RELATIONSHIP_REPLAY_UNSUPPORTED`; malformed,
330
- foreign or unknown relationship shapes reject. Empty auxiliary Metadata
331
- collections are checked, not silently dropped. The read service now runs this common
332
- projection and requires projected status, empty blockers and a common-mapper-validated
333
- candidate before returning success. The command repeats the completeness gate; the
334
- writer independently validates authored JSON, never a runtime projection.
335
-
336
- ## Common offline field join (composed by common projection)
337
-
338
- `joinDmoConnectMetadataFields(connectFields: unknown, metadataFields: unknown):
339
- DmoJoinedFields` returns `{ fields, qualifierBindings, blockers, expectations }`.
340
- It is the shared field-level slice, **not** a complete DMO projection, portable
341
- export or deployment gate. Existing narrow compatibility helpers are unchanged.
342
-
343
- Complete collections join one-to-one by exact qualified Connect `name` / Metadata
344
- `fullName`, regardless of order. Any nonempty count and all 12 authored types are
345
- admitted. Types/creation semantics must agree. Connect field labels must equal the
346
- Metadata `mktDataModelFieldAttributes.labelOverride` when present, otherwise the
347
- Metadata field `label`. A present override must be nonblank text of at most 255
348
- characters; malformed/empty values do not trigger fallback. The Metadata base
349
- `label` remains independently validated, and an optional `masterLabel` must still
350
- equal that base as this projector's bounded qualification (not a universal
351
- Salesforce equality claim). Independent raw expectations retain all three label
352
- representations unchanged. This API 65 effective-label contract is documented in
353
- the official [CustomField reference, MktDataModelFieldAttributes section](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm).
354
- Optional descriptions and categories preserve presence and value. Exactly one authored primary is designated
355
- by Metadata `primaryIndexOrder: '1'`; a supplied Connect flag must agree. Dynamic
356
- lookup uses a supplied Metadata string boolean or a supplied Connect boolean;
357
- conflicts or absence in both sources reject, never silently default false.
358
-
359
- System fields never enter authored `fields`. Explicit qualifier references bind
360
- Connect `keyQualifierName` to unique Metadata `refAttrDeveloperName`, then exact
361
- System field identity, with complete reference consumption. Multiple qualifiers
362
- and no qualifiers are supported without suffix inference or fixed field counts.
363
- Unknown keys, unsupported usage/creation values, nonempty summary semantics,
364
- ambiguous/dangling references and incomplete collections throw payload-free
365
- `DmoDocumentError`. Other admitted non-authored semantics remain diagnostics:
366
- required true, arbitrary positive Text storage length, distinct true, generated
367
- fields, generated qualifiers and generated descriptions/categories add specific
368
- `*_REPLAY_UNVERIFIED` blockers. Even an empty blocker array proves only this field
369
- join; it does not qualify object taxonomy, relationships or generated recreation.
370
- Independent full admitted collections remain in `expectations`.
371
-
372
- The common object projector composes this join with object/category/taxonomy
373
- validation, explicit event/modified references and complete relationship inputs.
374
- The common retrieval service acquires those inputs; missing Engagement designation
375
- is a specific blocker rather than field-count/type inference. Live acceptance is
376
- not expanded beyond retained evidence.
377
-
378
- ## Strict Connect/Metadata Other diagnostic slice
379
-
380
- `projectDmoConnectMetadata(connect: unknown, metadata: unknown, relationships: unknown):
381
- DmoConnectMetadataProjection` joins the exact DMO identity and every field's
382
- Connect `name` to Metadata `fullName`, independently of field-array order. Only
383
- one proven API 65 Other variant is admitted: two authored fields (Text primary,
384
- DateTime nonprimary), four System Text fields including one explicit qualifier,
385
- no relationships, disabled/unsegmentable/unmapped custom schema. Profile and
386
- Engagement are not accepted by this helper.
387
-
388
- Metadata `primaryIndexOrder: '1'` and `isDynamicLookup: 'false'` are authoritative;
389
- Connect flags, if present, must agree. Qualifiers bind only through exact
390
- `keyQualifierName` to `refAttrDeveloperName`, then the joined generated field
391
- identity. No suffix conversion or field-name inference occurs. Required false,
392
- Text length 60, DateTime length absence, usage tags, distinctness, labels and
393
- creation types are checked. Unknown properties, nonempty Metadata collections,
394
- extra/missing/duplicate fields and incompatible semantics throw payload-free
395
- `DmoDocumentError` rather than being discarded. These constraints describe the
396
- observed narrow variant, not all valid Salesforce schemas.
397
-
398
- The result has `status: 'projected'`, `blockers: []`, a two-field `candidate`,
399
- `createIdentity: { status: 'verified', name, sourceApiName }`, `qualifierBindings`,
400
- and independently copied full `expectations: { connect, metadata }`. Only after
401
- all existing profile checks pass, `name` removes exactly one terminal case-sensitive
402
- `__dlm` from the validated qualified `sourceApiName`. The base starts with an ASCII
403
- letter, contains only ASCII letters/digits and internal single underscores, and
404
- cannot start with SSOT (case-insensitive). Missing/wrong/repeated suffixes,
405
- namespace-like doubles, invalid characters and trailing underscores reject;
406
- there is no sanitization, case folding or internal replacement. Candidate and
407
- both expectations retain the original qualified name. Metadata `fullName` equals
408
- Connect `name`; no separate developerName is inferred.
409
-
410
- Expectations retain generated fields, primary/dynamic attributes, length/required
411
- presence and all admitted readback metadata; they are not writable Metadata API
412
- input. The source Connect ID remains an observation. `projected` establishes only
413
- this offline profile projection and identity, not general deployment support.
414
- The projection itself is not a Git artifact. After strict retrieval qualification,
415
- only the authored candidate belongs in the approved Git file; its runtime source
416
- expectations remain internal. A detached document is not proof of runtime source
417
- state or deployment acceptance. No request execution exists. The bounded offline
418
- mappers below distinguish source revalidation from authored-file mapping.
419
-
420
- Offline evidence inspected 2026-10-25: a separately authorized Other experiment
421
- reported full Connect/Metadata equality across orgs, excluding only Connect ID
422
- and field-array ordering, with no source drift. This gate is satisfied only for
423
- that fixture and does not establish repeat no-op/update behavior,
424
- Profile/Engagement support or generic generated schemas.
425
- No live calls occur in this helper or its independently authored synthetic tests.
426
-
427
- ## Bounded offline Other create request
428
-
429
- `buildOtherDmoCreateRequest(value: unknown, targetDataSpace: unknown):
430
- OtherDmoCreateRequest` accepts the complete joined projection, not a detached
431
- portable candidate. It re-runs the existing strict profile against the independent
432
- Connect/Metadata expectations and checks candidate, create identity, qualifier
433
- binding and empty blocker agreement. Relationships must already have been acquired
434
- and checked by the projection caller; this pure mapper performs no acquisition.
435
- It does not authenticate the origin of supplied JSON or prove an org snapshot.
436
-
437
- Both source and explicit target must equal case-sensitive `default`. Other spaces,
438
- missing bindings and implicit fallback reject; cross-space remapping is not proven.
439
- The fresh body contains only `name` (verified unsuffixed object base), `label`,
440
- optional `description`, `dataSpaceName`, `category: 'Other'`, and exactly the two
441
- authored `fields` with `name`, `label`, `dataType`, `isPrimaryKey`,
442
- `isDynamicLookup`. Exact authored custom `__c` names survive unchanged. Generated
443
- fields/qualifier references, org IDs, usage/distinctness, taxonomy, length/required
444
- and other readback metadata never enter the request. No POST, update/no-op,
445
- Profile/Engagement, CLI wiring or general deployment acceptance is implemented.
446
-
447
- Nested-name reconciliation checked 2026-10-25: local text mirrors have no nested
448
- input contract. The official reference linked below labels `fields` as Data Object
449
- Field Input and its paired example submits unsuffixed field names. That example
450
- shows one accepted spelling, not an explicit prohibition of qualified names.
451
- Direct nested-page retrieval timed out; indexed full reference text was inspected,
452
- not unrelated mapping/stream search synthesis. The existing separately authorized
453
- API 65 experiment submitted `ContractKey__c` and `ObservedAt__c` unchanged and
454
- read back identical authored identities, plus all four generated identities, in
455
- both orgs. Its comparison passed with no source drift. That observed evidence
456
- resolves this exact Other/default profile: field-name inversion is unnecessary.
457
- It does not establish every naming form, arbitrary spaces or every API version.
458
- No live org call or write was made while implementing this mapper.
459
-
460
- ## Common authored-document request mapper
461
-
462
- `buildDmoCreateRequestFromDocument(value: unknown, targetDataSpace: unknown):
463
- DmoCreateRequest` independently validates authored schemaVersion/kind/identity/spec.
464
- It maps all three authored categories, all 12 documented nested types, any nonempty
465
- field count, one primary key, and true/false dynamic lookup. Field category and
466
- field/object description retain absence versus empty strings. Explicit event and
467
- record-modified names retain exact spelling and must resolve to DateTime fields;
468
- Engagement requires an event reference. Source and explicit target remain default.
469
- Unsupported scope errors name only the affected property, never its supplied value.
470
- Unknown/runtime properties still reject through the existing strict validator.
471
-
472
- The fresh allowlisted object maps identity.apiName to the terminal-suffix-stripped
473
- name, explicit target to dataSpaceName, and spec label/description/category/date
474
- references individually. Each fresh field maps only name/label/dataType/description/
475
- category/isPrimaryKey/isDynamicLookup. No spec spread, generated fields, response
476
- flags, source expectations or relationships are accepted. Existing narrow Other
477
- mappers and their compatibility tests remain unchanged but no longer drive retrieval.
478
- Service/writer/command now use the common path. No new runtime acceptance is implied
479
- by construction.
480
-
481
- Evidence rechecked 2026-10-25 after local mirror gaps: official nested page fetches
482
- timed out. Indexed full official [Connect endpoint reference](https://developer.salesforce.com/docs/data/connectapi/references/spec?meta=type%3AData+Model+Object+Input)
483
- explicitly lists the three title-case categories, eventDateTimeFieldName and
484
- recordModifiedFieldName as input (object base properties from 59.0; fields/category/
485
- references from 60.0; custom DMO POST from 61.0). Its uppercase example is not used
486
- as the enum. Official Data360 MCP payload_examples for d360_dmo_create independently
487
- confirms the seven nested properties, optional string category/description,
488
- boolean dynamic/primary flags and all 12 enum types. That schema omits the object
489
- date references, so the endpoint contract supplies those mappings. It provides
490
- no nested per-property minimum versions; true dynamic lookup and additional types
491
- are schema-level mappings, not newly observed API 65 behavior. Exact authored
492
- qualified field names retain the earlier naming evidence without claiming a live
493
- round trip for every category/type/flag combination. SQL/flex/extra categories
494
- remain outside the authored contract, not silently dropped.
495
-
496
- ## Standalone authored-document Other mapper
497
-
498
- `buildOtherDmoCreateRequestFromDocument(value: unknown, targetDataSpace: unknown):
499
- OtherDmoCreateRequest` first calls `validateDmoDocument`. It accepts the standalone
500
- approved `{ schemaVersion, kind, identity, spec }` JSON after serialize/parse,
501
- without a projection, source expectations, qualifier binding or fabricated metadata.
502
- The existing `buildOtherDmoCreateRequest` remains the separate strict runtime
503
- projection revalidator; its forged-projection checks are unchanged.
504
-
505
- Source and explicit target must both equal case-sensitive `default`. The supported
506
- spec is exactly Other with two authored fields: one Text primary key and one
507
- DateTime nonprimary, both `isDynamicLookup: false`. Field description/category and
508
- object event/record-modified references are rejected even if empty. Unknown keys,
509
- relationships and runtime projection keys reject rather than disappear.
510
-
511
- The fresh request derives the object base using the already validated terminal
512
- `__dlm` rule, preserves exact authored `__c` field names, labels and array order,
513
- and preserves optional object description presence, including empty text. It does
514
- not mutate or share field objects with its input. No expectations are fabricated.
515
- This is offline request construction only: deployment must independently validate
516
- the authored file and later compare actual target readback, with internal runtime
517
- expectations acquired as needed. It does not provide CLI/file handling, transport,
518
- target preflight, create/update/no-op orchestration or general DMO acceptance.
519
-
520
- ## Internal common read-only DMO retrieval
521
-
522
- `retrieveDmo(connection: ReadConnection, objectApiName: unknown,
523
- apiVersion: unknown, dataSpace: unknown): Promise<DmoCommonProjection & { candidate: DmoDocument }>`
524
- is internal; ReadConnection is a Pick of core Connection's instanceUrl, request,
525
- metadata and getApiVersion. Caller supplies existing authenticated core connection.
526
- Both explicit API and the connection version must be 65.0; data space must be
527
- case-sensitive default; object identity must be the supported local custom __dlm
528
- form. Unsupported inputs fail before acquisition, without version mutation.
529
-
530
- The service uses ConnectClient GET for exact detail, core
531
- `connection.metadata.read('CustomObject', [objectApiName])`, then the existing
532
- complete incoming/outgoing relationship helper with explicit default scope.
533
- Installed core/JSforce source confirms array input returns the decoded records
534
- array, not a SOAP result/records wrapper, using the connection's SOAP API version.
535
- Exactly one record with exact fullName is mandatory; empty, missing, wrapped,
536
- foreign and ambiguous responses block. Every admitted Metadata property reaches
537
- the strict projector unchanged; there is no property-stripping envelope adapter.
538
- The retained successful API 65 Other experiment used the same core metadata.read
539
- seam with scalar input. No new live execution was needed here.
540
-
541
- Common joined projection and buildDmoCreateRequestFromDocument both run before success.
542
- Return value retains complete independent expectations, create identity and
543
- qualifier binding; no detached candidate or create request is returned instead.
544
- Acquisition errors have payload-free diagnostics; failures never return a partial
545
- projection. Existing ConnectError/DmoDocumentError remain intact; other failures
546
- become DmoRetrieveError with ACQUISITION_FAILED. INVALID_SCOPE and
547
- INVALID_METADATA identify rejected scope or decoded record cardinality/identity.
548
- Incomplete variants expose a specific projector blocker (missing Engagement event
549
- is preferred when present), not a candidate. No snapshot consistency, authenticity
550
- of arbitrary JSON, general category acceptance, request execution or mutation is
551
- claimed. Existing module paths remain unchanged; common export names replace the
552
- unpublished narrow service/writer names without compatibility aliases.
553
-
554
- ## Authoritative contract evidence (2026-10-25)
555
-
556
- The coordinator's resolved official naming research uses the
557
- [Connect Data Model Object Input contract](https://developer.salesforce.com/docs/data/connectapi/references/spec?meta=type%3AData+Model+Object+Input):
558
- its paired create/read example maps `CustomDMO` to `CustomDMO__dlm`. Documented
559
- name diagnostics require a leading letter, alphanumeric/underscore characters,
560
- no consecutive or trailing underscores, and no custom SSOT prefix. The official
561
- object reference identifies the `__dlm` DMO suffix. Together these support the
562
- narrow inverse above for the already admitted non-namespaced custom profile,
563
- without retaining an old create request or introducing a provenance subsystem.
564
- This slice uses that supplied research offline; it performs no online/org calls.
565
-
566
- Local official mirrors had no nested field contract. The
567
- [official Connect REST reference](https://developer.salesforce.com/docs/data/connectapi/references/spec)
568
- provides the custom DMO endpoint from 61.0 and Date/DateTime examples, not a type
569
- restriction. Its HTML links a YAML asset that returned HTTP 404; direct nested
570
- rendering timed out. Search summaries mixed unrelated contracts and were not
571
- used to infer the enum.
572
-
573
- The official Salesforce Data360 MCP `payload_examples('d360_dmo_create')`
574
- returned the nested `DataModelObjectInputRepresentation` schema. Its field item
575
- has exactly `category`, `dataType` (the 12-value enum above), `description`,
576
- `isDynamicLookup`, `isPrimaryKey`, `label`, `name`; no nested required list.
577
- The tool schema is current metadata without per-property minimum API versions.
578
- Its description/example disagree about suffixes; the separate official naming
579
- contract resolves object create identity; the bounded API 65 Other replay above
580
- independently resolves preservation of the exact authored nested field names.
581
- Neither establishes general version-specific runtime acceptance. The wider object schema also
582
- exposes additional categories and SQL/flex settings; these are explicitly blocked
583
- rather than added to this bounded custom-schema slice.
584
-
585
- `payload_examples('d360_dmo_relationship_list')` independently describes a
586
- separate source-or-target relationship list, required `dataModelObjectName`,
587
- optional `dataspace`, `status`, `creationType`. No org call was executed.
588
-
589
- ## Read-only relationship acquisition
590
-
591
- The full official endpoint section (checked 2026-10-25) establishes API 64.0
592
- `GET /ssot/data-model-objects/{dataModelObjectName}/relationships`, covering the
593
- selected DMO as either source or target. Query parameters: `creationType`,
594
- `dataspace` (server default is default), `limit` (default 20), `offset`, `orderBy`,
595
- `sortBy`, `status`. Acquisition deliberately omits status/creation filters.
596
- The documented response has `relationships`, `count`, `totalSize`, `sortBy` and
597
- current/next/previous page token/URL pairs. Its sample links use an older v63
598
- route absent from the operation table; no equivalence is inferred from those URLs.
599
-
600
- `ConnectClient.listDataModelObjectRelationships(dataModelObjectName: string,
601
- dataSpace: string): Promise<Array<Record<string, unknown>>>` uses explicit scope,
602
- API >=64.0 and the documented route only. It requests 20 rows, offsets 0..2000,
603
- ASC/DeveloperName; 2000 is a local budget, not an endpoint limit claim. It ignores
604
- response links/tokens for navigation and never forwards them. A terminal page
605
- requires accumulated rows equal totalSize and absent/null/empty next URL/token.
606
- Missing total, inconsistent optional count, changing totals, overlap, out-of-scope records, unknown
607
- envelope keys, premature short pages or budget exhaustion block without returning
608
- partial data. The helper accepts only identifier-form data spaces and DMO names
609
- ending __dlm (including namespaces); other names block before network access.
610
-
611
- Raw entry fields, including unknown nested metadata, qualifiers, cardinality,
612
- status, owner, generated names and optional/absent targetField, survive untouched.
613
- This is transport preservation, not approval of unknown semantics for portable
614
- export. Entries require unique nonblank names and sourceObject/targetObject names;
615
- at least one endpoint must match the requested DMO. Data-space scope relies on
616
- the server query, not an invented per-record data-space field. Offset pagination
617
- has no snapshot guarantee and equal-total concurrent changes can evade detection.
618
- Read-only API 65.0 acceptance on 2026-10-25 corrected the reference sample's
619
- assumptions: count/sortBy are absent, endpoints are sourceObject/targetObject,
620
- and the empty synthetic DMO returns HTTP 204. The helper uses JSforce's private
621
- noContentResponse sentinel to distinguish 204 from a missing/malformed JSON body;
622
- 204 is accepted only on the initial page, never after an advertised nonzero total.
623
- A standard DMO returned 142 records across eight pages of limit 20, ending with
624
- two records and no next URL. Qualifier properties were null in that inspected set;
625
- this is not evidence that populated qualifier structures may be discarded.
626
-
627
- The prior synthetic custom Engagement DMO has two custom and four system fields,
628
- a qualifier reference lacking the __c suffix of its generated field, and no
629
- eventDateTimeFieldName in detail. Its projection therefore fails closed: a single
630
- DateTime field does not prove event-time designation. No suffix-based binding or
631
- portable output is claimed. The next prerequisite is an authoritative metadata
632
- source for the designated event field (and record-modified designation), followed
633
- by generated-qualifier replay evidence. No rows or org changes were used.
1
+ # Artifact formats
2
+
3
+ ## Public Graph document
4
+
5
+ Retrieve writes each data graph as `data360/dataGraphs/Name.native-dataGraph.json` at the
6
+ project root: `schemaVersion: 1`, `kind: native-data-graph`, `apiVersion: 68.0`, the
7
+ graph's data space in `c__dataSpace` and the `definition` as the API 68 GET returns it
8
+ (name, label, description, data space, root object, type, schedules, real-time settings, and
9
+ the root node with its fields, joins (`path`) and related objects), without server facts such
10
+ as IDs, status and dates. The file name must equal `definition.name`.
11
+
12
+ `c__dataSpace` must equal `definition.dataspaceName` when the definition names it
13
+ (`INVALID_DATASPACE_FIELD` otherwise); a definition without `dataspaceName` takes it from
14
+ `c__dataSpace`, and the create sends it. The file's data space must be the run's
15
+ (`--dataspace`, `default` when omitted; `DATA_GRAPH_DATASPACE_MISMATCH` otherwise, also for an
16
+ org graph of that name in another data space: graph names are unique in the org). Object
17
+ names are the names Salesforce stores in that data space (`ds2_Individual__dlm` for a
18
+ standard DMO copy outside `default`).
19
+
20
+ Deploy treats the file as the desired state of an existing graph. Fields and related objects
21
+ are sent as the file lists them, so a field or related object the file leaves out is not
22
+ sent; Salesforce decides and, at API 68, refuses removals, a root change and another related
23
+ object in place of an existing one with 400, reported as rejected. Key-qualifier fields that
24
+ Salesforce added (`KQ_` fields named by another field's `keyQualifierName`) are kept when
25
+ the file leaves them out. Generated names (node and field `devName`, join `devName`,
26
+ `fragmentDMOName` and the graph's generated DMO, mapping and transform names) are taken
27
+ from the org for objects it already holds and left out for new ones. Omitted settings keep
28
+ the org values. The plugin refuses, before any write, a join change of an existing related
29
+ object (`DATA_GRAPH_JOIN_CHANGE`: Salesforce accepts it but keeps the old join) and a
30
+ different type, reference or projected name of an existing node (assigned by Salesforce).
31
+ A node's `type` may be left out: a create then sends none and Salesforce assigns it, and an
32
+ update keeps the org value. The name and the data space identify the graph; a file with
33
+ another name addresses another graph.
34
+
35
+ ## Public identity resolution file
36
+
37
+ Retrieve writes each ruleset as
38
+ `data360/identityResolution/<Name>.identityResolution.json` at the project root:
39
+ `schemaVersion: 1`, `kind: identity-resolution`, the ruleset's data space in `c__dataSpace`,
40
+ `identity: {apiName}` and `spec` with the configuration. Its references (the secondary DMO,
41
+ the match and reconciliation entities and fields, the DLO sources and the unified and link
42
+ outputs) carry no data space: they are all in the ruleset's data space and named as
43
+ Salesforce stores them there. Outside `default` that is `<prefix>_<type>_<rulesetId>` for the
44
+ ruleset (`ds2_Individual_cx2a`), `ds2_Individual__dlm` with `FirstName__c` for a standard DMO
45
+ copy and its fields. The old `identity.dataSpace` and a `dataSpace` key in a reference are
46
+ refused (`LEGACY_DATASPACE_KEY`). The file's data space must be the run's
47
+ (`IDENTITY_RESOLUTION_DATASPACE_MISMATCH` otherwise, also for an org ruleset of that name in
48
+ another data space), and a non-default file whose name lacks the prefix of the org's data
49
+ space list is refused before any write (`IDENTITY_RESOLUTION_NAME_NOT_STORED`).
50
+
51
+ ## Public calculated insight files
52
+
53
+ Retrieve writes each calculated insight as
54
+ `data360/calculatedInsights/Name__cio.calculatedInsight-meta.json` (the API 68 GET body,
55
+ key names and enums as returned, without status, run and derived fields) and
56
+ `data360/calculatedInsights/Name__cio.calculatedInsight-meta.sql` (the expression as
57
+ plain SQL, ending with one LF), under the project root. Trailing line breaks of the SQL
58
+ file are not part of the `expression` that deploy sends and compares.
59
+
60
+ The JSON names the insight's data space in the top-level `c__dataSpace` string instead of
61
+ Salesforce's `dataSpace` key: retrieve checks that the GET names the run's data space and
62
+ writes it there, and deploy sends it as `dataSpaceName`. A file that still has `dataSpace`
63
+ is refused (`LEGACY_DATASPACE_KEY`), a missing or blank `c__dataSpace` is
64
+ `INVALID_DATASPACE_FIELD`, and one that is not the run's data space (`--dataspace`,
65
+ `default` when omitted) is `CI_DATASPACE_MISMATCH`.
66
+
67
+ Deploy, publish and delete read the same two files. Either file or the exact selector
68
+ selects the insight; the JSON is joined with exactly its SQL file. A missing JSON or
69
+ SQL file, an `expression` kept in the JSON, any other `Name__cio.calculatedInsight-meta.*`
70
+ file beside them, duplicate keys, a name that differs from the file name, links and
71
+ hard links block. A length-prefixed SHA256 digest binds the bytes of both files;
72
+ revalidation checks bytes and the frozen document before dispatch. Any key, status,
73
+ schedule and SQL is admitted; deploy sends the document as written (input key names and
74
+ enum forms translated, an unchanged `definitionType` left out of a PATCH) and Salesforce
75
+ decides.
76
+
77
+ ## Public segment files
78
+
79
+ Retrieve writes each segment as
80
+ `data360/segments/<Name>.segment.json` at the project root (identity, label,
81
+ description, segment type, `segmentOn` DMO, lookback, an optional `schedule`, and the list
82
+ of model names) and one `<Name>.segment.<model>.sql` per model beside it (that model's
83
+ `sql`, plain text, bytes as returned). A UI segment holds its criteria as a JSON object in
84
+ `includeCriteria` instead of models; other types (for example Waterfall or Dynamic) hold
85
+ neither, and the lookback only when the segment has one. A Waterfall holds its child
86
+ segments as `childSegments`, a list of segment API names in priority order (Salesforce
87
+ stores definition IDs; retrieve names them, deploy sends the IDs of the target org). A
88
+ file without `childSegments` leaves the children of the org segment alone; an empty list
89
+ is refused (`INVALID_SEGMENT_DOCUMENT`). `schedule` is the refresh
90
+ schedule in the shape the write takes (`frequency`, `interval`, `daysOfWeek` as a list,
91
+ `startDateTime`, `endDate`, `endDateTime`, optional `time` with `hour`, `minute` and
92
+ `timeZone`, or an hourly `publishInterval` when the read has no schedule details);
93
+ retrieve leaves it out for a segment that does not refresh, and `nextScheduledDate` is not
94
+ kept. On deploy, a file without `schedule` leaves the org schedule alone; one with it is
95
+ sent when a key it states differs from the org schedule (keys it leaves out keep their org
96
+ value), and `{"frequency": "None"}` turns it off.
97
+ The top-level `c__dataSpace` string names the segment's data space (the old
98
+ `identity.dataSpace` and `spec.segmentOn.dataSpace` keys are `LEGACY_DATASPACE_KEY`); the
99
+ `segmentOn` DMO and every Waterfall child are in that data space. `identity.apiName` and the
100
+ file name are the name Salesforce stores: `<prefix>_<Name>` in a non-default data space
101
+ (`ds2_Spring` in `dataspace2`), sent unchanged as `developerName` on create (Salesforce keeps a
102
+ name that has the prefix); a file there without the prefix is `SEGMENT_NAME_NOT_STORED`, and a
103
+ file of another data space than the run's is `SEGMENT_DATASPACE_MISMATCH`.
104
+ The file holds no `parameters` (the API has no write for them). A model name must start with a letter or digit and hold only
105
+ letters, digits and underscores, and two model names may not differ only in case; another
106
+ name is refused with `INVALID_SEGMENT_DOCUMENT`. A repeat retrieve of an unchanged segment
107
+ writes nothing (`unchanged`); with `--overwrite`, the SQL file of a model the segment no
108
+ longer has is removed.
109
+
110
+ Deploy, delete and `--changed-since` read the same files. The JSON or any of its SQL files,
111
+ or the exact selector, selects the segment; the JSON is joined with exactly one SQL file
112
+ per model. A missing JSON or SQL file, a `sql` kept in the JSON, any other
113
+ `<Name>.segment.*` file beside them, duplicate keys, a name that differs from the file
114
+ name, links and hard links block (`INVALID_SOURCE`). A length-prefixed SHA256 digest binds
115
+ the bytes of all files; revalidation checks bytes and the frozen document before dispatch.
116
+
117
+ ## Public data transform document
118
+
119
+ Retrieve writes each data transform as `data360/dataTransforms/<Name>.dataTransform.json`
120
+ under the project root, for custom, system and packaged transforms alike:
121
+
122
+ ```json
123
+ {
124
+ "apiVersion": "68.0",
125
+ "c__dataSpace": "default",
126
+ "definition": { "name": "Name", "label": "…", "type": "BATCH", "definition": { "…": "…" } },
127
+ "kind": "data-transform",
128
+ "schedule": {
129
+ "frequency": "Daily",
130
+ "interval": 1,
131
+ "time": { "hour": 3, "minute": 15, "timeZone": "GMT" }
132
+ },
133
+ "schemaVersion": 1
134
+ }
135
+ ```
136
+
137
+ `c__dataSpace` names the transform's data space and must agree with `definition.dataSpaceName`
138
+ when the definition names one (`INVALID_DATASPACE_FIELD` otherwise; kept and sent as written). A
139
+ transform whose GET has no `dataSpaceName` takes its data space from its MktDataTransform record
140
+ (SOQL); one without any data space there (a system transform) is in `default` only. A file of
141
+ another data space than the run's, or one whose name the org holds in another data space, is
142
+ `TRANSFORM_DATASPACE_MISMATCH`.
143
+
144
+ `definition` is the native create/update input as the API 68 GET returns it, without
145
+ server-owned keys, the schedule inside a definition, or the server-owned keys of each
146
+ output object. `schedule` is the schedule GET projected onto the keys its PUT takes:
147
+ `frequency`, `interval`, `daysOfWeek`, and `time` with `hour`, `minute` and `timeZone`
148
+ (from `time.timezone.zoneId`); `nextScheduledDate` and `type` are left out. A file may add
149
+ the write-only `shouldForceSpecifiedMinutes`: the PUT takes it, the GET never returns it,
150
+ and it is not compared. A transform that is never scheduled or turned
151
+ off gets no `schedule` key, so a deploy of the file leaves the target org's schedule alone. A system transform's per-definition map
152
+ (`{ "schedule": { "<Day0Name>": { … } }, "type": "Transform" }`) keeps the map with each
153
+ entry projected the same way and without the outer `type`. When the schedule read fails,
154
+ the file has no `schedule`, with a warning.
155
+
156
+ `schedule` is optional. Without it, deploy leaves the org schedule alone. With it, deploy
157
+ compares it with the org's projected schedule (frequency ignoring letter case,
158
+ `shouldForceSpecifiedMinutes` not compared) and, when it differs, sends it as written with
159
+ `PUT …/data-transforms/{name}/schedule`, then reads it back (it must have the file's
160
+ frequency). After a definition write it first waits, at most 5 minutes, until the transform
161
+ is no longer `PROCESSING` (`TRANSFORM_SCHEDULE_NOT_SENT` otherwise);
162
+ `TRANSFORM_SCHEDULE_REJECTED` reports Salesforce's refusal of that schedule PUT. `{ "frequency": "None" }`
163
+ turns the schedule off. A schedule that is not an object is refused
164
+ (`UNSUPPORTED_TRANSFORM_INPUT`). A schedule copied to another org makes the transform run
165
+ there (`TRANSFORM_SCHEDULE_CHANGE`).
166
+
167
+ ## Public data stream document
168
+
169
+ Retrieve writes each data stream as `data360/data-stream/<ApiName>.data-stream-meta.json`
170
+ in one of two shapes, both with `schemaVersion: 1`, `kind: "data-stream"`, the top-level
171
+ `c__dataSpace` (every data space of the landing DLO, sorted, read from the DLO) and
172
+ `identity: {apiName}`. The list only mirrors the DLO: deploy refuses a list without the run's
173
+ data space, one that differs from the DLO's data spaces, and, for a new stream (whose create
174
+ puts the DLO into the run's data space), more than one entry (`STREAM_DATASPACE_MISMATCH`).
175
+ The old `identity.dataSpace` is refused (`LEGACY_DATASPACE_KEY`).
176
+
177
+ - **Ingestion API stream:** `spec` holds `connectorType` (`IngestApi`), `connectionName`,
178
+ `event`, `datastreamType` (`INGEST_API`), `refreshMode`, `label`, `newDlo` (`name`,
179
+ `label`, `category` when the DLO has one, `eventDateTimeFieldName`, `primaryKey`),
180
+ `additiveFieldMappings` (`sourceFieldLabel`, `targetFieldName` without `__c`,
181
+ `targetFieldReturntype`) and `formulaMappings` (`targetFieldName`, `formula` plain,
182
+ `targetFieldReturntype`), plus the read-only `observed` section.
183
+ - **Any other connector** (Salesforce CRM `SalesforceDotCom` tested live; others such as
184
+ S3 untested): `spec` is the stream GET without server-owned keys, system fields and
185
+ system mappings, with `connectorInfo.connectorType` naming the connector. Its
186
+ `dataLakeObjectInfo.dataSpaceInfo` (Salesforce's own list) must name the same data spaces
187
+ as `c__dataSpace` (`STREAM_DATASPACE_MISMATCH`); deploy fills it from `c__dataSpace` when
188
+ the file leaves it out.
189
+
190
+ Create and update send the file as written and Salesforce decides; its 4xx answer to the
191
+ first write is reported as rejected, and a failure after an earlier write as unknown. Of
192
+ the Ingestion API file, the plugin itself refuses only an additive mapping whose
193
+ `sourceFieldLabel` names no event field, or several (`UNSUPPORTED_STREAM_MAPPING_SOURCE`:
194
+ Salesforce stores it unchecked as a mapping that never carries data), and a change of
195
+ `refreshMode`, the DLO label, category, event time field or primary key of an existing
196
+ stream (`UNSUPPORTED_STREAM_SETTINGS_CHANGE`: Salesforce answers 200 and keeps the old
197
+ value). A mapping left out of the file is sent as a removal (an empty formula). Of the
198
+ other-connector file, a plain mapping change is refused (`UNSUPPORTED_STREAM_SETTINGS_CHANGE`):
199
+ the stream update takes no `sourceFieldName`.
200
+
201
+ ## Public native DMO document
202
+
203
+ Exact `dmo:ApiName__dlm` retrieval writes
204
+ `<project-root>/data360/dmo/<ApiName>__dlm.dmo-meta.json`. The full API name,
205
+ including `__dlm`, is kept in the filename and in the identity. This is the only
206
+ DMO artifact format.
207
+
208
+ ```json
209
+ {
210
+ "schemaVersion": 1,
211
+ "kind": "dmo",
212
+ "c__dataSpace": "default",
213
+ "identity": { "apiName": "Customer__dlm" },
214
+ "spec": {
215
+ "label": "Customer",
216
+ "category": "Profile",
217
+ "description": "Customer master records",
218
+ "fields": [
219
+ { "name": "CustomerId__c", "label": "Customer Id", "dataType": "Text", "isPrimaryKey": true },
220
+ { "name": "SignupDate__c", "label": "Signup Date", "dataType": "Date", "isPrimaryKey": false }
221
+ ]
222
+ }
223
+ }
224
+ ```
225
+
226
+ ### Shape checks
227
+
228
+ The plugin validates the shape only:
229
+
230
+ - The document has exactly `schemaVersion: 1`, `kind: "dmo"`, `c__dataSpace`, `identity`
231
+ and `spec`.
232
+ - `c__dataSpace` is the DMO's data space: a nonblank, trimmed name. It must be the run's
233
+ data space (`--dataspace`, `default` when omitted; `DMO_DATASPACE_MISMATCH` otherwise).
234
+ The old `identity.dataSpace` key is refused (`LEGACY_DATASPACE_KEY`); any other invalid
235
+ value is `INVALID_DATASPACE_FIELD`.
236
+ - `identity` has exactly `apiName` (a letter, then letters, digits or underscores,
237
+ ending `__dlm`). In a non-default data space it is the name Salesforce stores there: a
238
+ standard DMO copy is `<prefix>_<Name>__dlm` (`ds2_Individual__dlm`) with fields without
239
+ `ssot__`, and a custom DMO keeps its own name.
240
+ - `spec` needs a nonblank `label`, a nonblank `category`, an optional string
241
+ `description` and a nonempty `fields` array. Other `spec` keys are allowed.
242
+ - Each field needs a `name` ending `__c` that is unique regardless of case, a
243
+ nonblank `label`, a nonempty string `dataType` and a boolean `isPrimaryKey`. Other
244
+ field keys are allowed, except the runtime keys `id`, `recordId`, `recordID`,
245
+ `createdDate`, `lastModifiedDate`, `isEnabled`, `isEditable`, `isSegmentable`,
246
+ `status` and `type`.
247
+
248
+ Shape failures are reported as `INVALID_DMO_DOCUMENT` or `INVALID_DMO_FIELD`. There
249
+ is no allowlist for categories, data types, label length, the number of primary
250
+ keys or extra keys. Those values are sent as authored and Salesforce decides.
251
+
252
+ ### What retrieval saves
253
+
254
+ - The object label, category, a nonempty description and all returned fields.
255
+ The category is saved in the input spelling (`Profile`, `Engagement`, `Other`),
256
+ although reads return upper case.
257
+ - The field `type` returned by reads is saved as `dataType`. A missing
258
+ `isPrimaryKey` is saved as `false`. The runtime keys listed above are dropped.
259
+ - Generated fields are left out: fields read as `creationType` `System`, the
260
+ system fields `DataSource__c`, `DataSourceObject__c` and
261
+ `InternalOrganization__c`, and names starting with `KQ_`. A primary key is always
262
+ saved, and so are the standard fields of a standard DMO. Keys that only reads
263
+ return (`creationType`, `isDistinct`, `usageTag`, `keyQualifierName`) are kept.
264
+ - Record IDs and other runtime observations of the object are not saved.
265
+
266
+ The file is indented with two spaces and ends with LF. Identical bytes are
267
+ unchanged; a differing file requires `--overwrite` (DMO names are unique in the org,
268
+ so the file at the path is the same DMO whatever data space it names). The
269
+ writer rejects linked paths and files above 1 MiB, stages the complete file under
270
+ the OS temp directory and publishes it by rename or exclusive hard link. Writer
271
+ codes: `UNSAFE_PATH`, `OVERWRITE_REQUIRED`, `OUTPUT_CHANGED`, `OUTPUT_FAILED`,
272
+ `PARTIAL_DMO_OUTPUT`.
273
+
274
+ ### What deployment sends
275
+
276
+ - Object and field names are sent without their `__dlm` / `__c` suffix.
277
+ - `creationType`, `isDistinct`, `usageTag` and `keyQualifierName` are never sent. A
278
+ file value that differs from the org is reported with the warning
279
+ `DMO_FIELD_KEY_NOT_SENT`; the outcome stays `created`, `updated` or `unchanged`.
280
+ - Generated fields (`DataSource__c`, `DataSourceObject__c`,
281
+ `InternalOrganization__c`, names starting with `KQ_`, or `creationType: System`)
282
+ are left out of a create. A definition may also omit them for an update; a deploy
283
+ never removes them (`delete --field` does on request).
284
+ - An absent `spec.description` is not managed: an update leaves the target value as
285
+ is. An explicit empty string clears it.
286
+ - Field `description` and `isDynamicLookup` are accepted by the API but never
287
+ returned by reads, and a field description does not appear in the Data Model UI.
288
+ They are sent when a field is created or otherwise edited; a change to them alone
289
+ cannot be detected or confirmed.
290
+ - An update sends the object label, a changed description, a changed category
291
+ (Salesforce rejects category changes), changed extra `spec` keys, and the edited
292
+ and added fields.
293
+ - A standard DMO (`creationType` `Standard` in the target, for example
294
+ `ssot__Brand__dlm`) uses the same file. An update sends only the edited and added
295
+ custom fields, the label when it differs, a changed description and changed extra
296
+ `spec` keys. `spec.category` is required by the file shape but ignored: it is
297
+ never sent or compared. Standard and system fields may be left out of
298
+ `spec.fields`; one that is listed must equal the target (`isMapped` and
299
+ `keyQualifierName` are not compared), otherwise the deploy is refused with
300
+ `UNSUPPORTED_DMO_FIELD_CHANGE`. A new field must be a plain custom field: no double
301
+ underscore before `__c` and no `creationType` other than `Custom`
302
+ (`UNSUPPORTED_DMO_FIELD_ADDITION`).
303
+ - A mapping file (`data360/mapping/<MappingApiName>.mapping-meta.json`) holds
304
+ `schemaVersion` 1, `kind` `mapping`, the top-level `c__dataSpace` (the mapping's data
305
+ space, which must be the run's: `MAPPING_DATASPACE_MISMATCH` otherwise;
306
+ `LEGACY_DATASPACE_KEY` for the old `identity.dataSpace`), `identity` with `apiName`
307
+ only, and `spec`. Mapping names are unique in the org, so the file at the path is the
308
+ same mapping whatever data space it names (`--overwrite` replaces it). It may name a
309
+ custom or a standard DMO in `spec.targetEntityDeveloperName`, under the name Salesforce
310
+ stores in the mapping's data space (`ds2_ContactPointEmail__dlm` with `EmailAddress__c`
311
+ for a standard DMO copy in `dataspace2`). The first mapping onto a standard DMO copy that
312
+ does not exist yet is sent once more in the default spelling when Salesforce answers the
313
+ copy spelling with 404 (see [mapping reference](types/mapping.md)). On a standard DMO the
314
+ authored pairs use the standard field names (for example `Id__c` to `ssot__Id__c`)
315
+ and the generated pairs read `DataSource__c` to `ssot__DataSourceId__c`,
316
+ `DataSourceObject__c` to `ssot__DataSourceObjectId__c`, `InternalOrganization__c`
317
+ to `ssot__InternalOrganizationId__c` and `KQ_Id__c` to `KQ_Id__c`; on a custom DMO
318
+ the generated pairs are same-name. Retrieve saves the authored pairs only and deploy
319
+ never sends generated pairs. Both decide which pairs are generated with one rule,
320
+ from fresh reads of the source data lake object and the target DMO, so a pair that
321
+ retrieve leaves out is never read as a removal. When those reads fail, retrieve
322
+ refuses the mapping with `MAPPING_GENERATED_PAIRS_UNPROVEN` and writes nothing for
323
+ it. The authored key pair is always saved. A file may list only the authored pairs, for a create and for a
324
+ deploy onto the existing mapping alike: the generated pairs are taken from the
325
+ org's copy and treated as part of the file. The authored primary-key pair must stay
326
+ in the file (`MAPPING_PROTECTED_PAIR_REQUIRED`). A deploy removes every authored
327
+ pair that the file no longer lists, including a pair onto a standard field; the
328
+ generated pairs and the key pair (source primary key onto target primary key, any
329
+ name and type) stay in the mapping. Pairs are sent as the file lists them, whatever
330
+ their data types and names, one source onto several targets and targets another
331
+ mapping also holds; Salesforce decides. Pairs whose data types differ get the
332
+ preview notice `MAPPING_FIELD_TYPES_DIFFER`. Salesforce requires a pair joining the
333
+ two primary keys when a mapping is created.
334
+ `sf data360 delete -m mapping:<MappingApiName>` deletes a mapping whatever pairs it
335
+ holds and then removes its local file (see Local files after delete). Only the last mapping of a custom DMO is refused
336
+ (`MAPPING_LAST_MAPPING_DELETE_BLOCKED`); delete the DMO instead. Creating the first mapping onto a standard
337
+ DMO that is not yet enabled activates it permanently; preview and create report
338
+ `MAPPING_ACTIVATES_STANDARD_DMO`. A pair may be removed from a mapping file even
339
+ when another mapping targets the same field. Observed at API 68 through the plugin:
340
+ a mapping created onto an already active standard DMO from a file with two authored
341
+ pairs, the retrieved file deploying back unchanged, the activation notice in a
342
+ preview, a first mapping created onto an inactive standard DMO, a pair onto a
343
+ standard field removed by deploying the retrieved file without it, the removal
344
+ of a field shared by two mappings of a custom DMO, and hand-written mapping files
345
+ with the authored pairs only deploying back unchanged onto a custom and a standard
346
+ DMO, one of them adding a pair and dropping another.
347
+ The optional `spec.label` is the mapping's label (Metadata API `masterLabel` of
348
+ `ObjectSourceTargetMap`, which the native routes do not carry). Retrieve fills it,
349
+ except when it equals the mapping's own name (the default Salesforce gives a mapping
350
+ created without one) or when its Metadata API read fails (then with a warning). A
351
+ file without `spec.label` leaves the org's label alone; a different label is set by
352
+ one Metadata API `updateMetadata` after the pair writes, carrying every pair the
353
+ mapping currently has and no other (a pair left out is kept, a pair sent is added).
354
+ - A data lake object file (`data360/dlo/<FullApiName>__dll.dlo-meta.json`) for an
355
+ existing data lake object may omit the fields Salesforce generated:
356
+ `cdp_sys_SourceVersion__c`, `DataSource__c`, `DataSourceObject__c`,
357
+ `InternalOrganization__c`, `cdp_sys_PartitionDate__c` on Engagement data lake
358
+ objects and the key qualifier `KQ_<Name>__c` of another field (`KQ_Id__c` for the
359
+ primary key, `KQ_RefId__c` for a relationship source field). They stay as they
360
+ are, and retrieve leaves them out of the file; the fields named by
361
+ `eventDateTimeFieldName` and `recordModifiedFieldName` are always saved. Any other field of the target that the file
362
+ omits is refused (`UNSUPPORTED_DLO_FIELD_CHANGE`). A listed field is compared on
363
+ the keys the file states: keys only the org's copy carries are ignored, and a
364
+ stated key that differs is refused with the same code.
365
+ - A data lake object file holds `schemaVersion` 1, `kind` `dlo`, the top-level key
366
+ `c__dataSpace` (every data space the DLO belongs to: a list of names sorted by name, at
367
+ least one, none repeated), `identity` with `apiName` only, and `spec`. The old
368
+ `identity.dataSpace` key is refused (`LEGACY_DATASPACE_KEY`); a filtered membership
369
+ `{ "name": …, "filter": … }` is recognised but refused until a filter is proven live
370
+ (`UNSUPPORTED_DATASPACE_FILTER`); any other invalid value is `INVALID_DATASPACE_FIELD`.
371
+ The list must hold the run's data space (`--dataspace`, `default` when omitted;
372
+ `DLO_DATASPACE_MISMATCH` otherwise). Deploy adds the DLO to listed data spaces it is not
373
+ in, and removes it from unlisted ones only with `--allow-dataspace-removal`.
374
+ - The data lake object `spec` holds `label`, `category`, `fields` and, optionally,
375
+ `eventDateTimeFieldName`: the full name (with `__c`) of one of the listed fields
376
+ that dates each record. Engagement data lake objects need it; create sends it
377
+ without the suffix and retrieval saves it. The category is sent as written and
378
+ Salesforce decides. Neither the category nor the event field can change after
379
+ create: a changed value is refused with `UNSUPPORTED_DLO_CATEGORY_CHANGE` or
380
+ `UNSUPPORTED_DLO_EVENT_FIELD_CHANGE` before any write.
381
+ - The data lake object `spec` may also hold `recordModifiedFieldName`, the full name
382
+ (with `__c`) of the field that marks the newest version of a record. Create sends
383
+ it without the suffix; an update sends it only when it differs from the org, and
384
+ Salesforce decides (it sets the field on a DLO without one and refuses a change once
385
+ one is set). The data model object file never holds `isSegmentable`: Salesforce
386
+ derives it and rejects it as input.
387
+
388
+ - A custom field that exists in the target and is missing from the file is a
389
+ removal. `sf data360 deploy --allow-field-removal` removes such fields with one
390
+ Metadata API destructive change for `CustomField`
391
+ `<ObjectName>__dlm.<FieldName>__c`, after the PATCH for other changes. The
392
+ primary-key field must stay in the file. A field that is currently mapped is
393
+ removed only when the same command also deploys every
394
+ `data360/mapping/<MappingApiName>.mapping-meta.json` file whose mapping holds a
395
+ pair with that `targetFieldDeveloperName`, with the pair removed from the file.
396
+ The removal runs in the DMO position; Salesforce drops the field's pairs with it,
397
+ and those mapping files deploy afterwards and find the pairs already gone.
398
+ Otherwise the deploy is refused with `DMO_FIELD_REMOVAL_MAPPED` before any write,
399
+ naming those files and the single command.
400
+ - `sf data360 delete -m dmo:<Name__dlm> --field <Field__c>` removes
401
+ named custom fields in the org with one destructive change (Salesforce drops their
402
+ mapping pairs with them), then overwrites this file
403
+ and the `data360/mapping/<MappingApiName>.mapping-meta.json` file of every mapping
404
+ that lost a pair with the current definition. Only files that already exist under
405
+ `--output-dir` (default: current directory) are refreshed in the same form retrieve
406
+ writes; none is created or removed.
407
+ - The `isMapped` marker on a field is saved as retrieved but describes the mapping,
408
+ not the DMO: it is never sent, compared or required.
409
+
410
+ Refused before any write: changing an existing field's `dataType` or
411
+ `isPrimaryKey`, omitting a custom field that exists in the target without
412
+ `--allow-field-removal`, omitting the target's primary-key field
413
+ (`UNSUPPORTED_DMO_FIELD_CHANGE`), adding a generated field or a second primary key
414
+ (`UNSUPPORTED_DMO_FIELD_ADDITION`) and creating a namespaced DMO
415
+ (`UNSUPPORTED_DMO_TARGET`). A whole-DMO delete is sent for every DMO, standard ones
416
+ included, and Salesforce decides. Every DMO other than a standard one and an
417
+ unprefixed custom one (platform-generated and namespaced DMOs included) is written
418
+ like a standard DMO, and Salesforce decides the rest.
419
+
420
+ Field removal is observed at API 68 on empty custom DMOs, unmapped and mapped by two
421
+ mappings, and on one standard DMO. Removing a data-bearing field is not verified.
422
+ Standard DMO writes are observed at API 68 through the plugin on one standard DMO in
423
+ two orgs, active in only one of them (add and relabel a custom field; remove it with
424
+ `--allow-field-removal` and with `delete --field`; object description set and
425
+ cleared); a category change and standard DMOs in active use are not tested. Writes to
426
+ platform-generated DMOs are observed at API 68 through the raw API.
427
+
428
+ The values Salesforce accepted in live verification at API 68 (categories, field
429
+ data types, label length and key rules) are listed in the [DMO reference](types/dmo.md).
430
+ That verification used empty, unmapped custom DMOs in the default data space.
431
+ Data-bearing DMOs, non-default data spaces, other API versions,
432
+ relationships and SQL/flex DMOs are not qualified.
433
+
434
+ DMOs use only `data360/dmo/<ApiName>__dlm.dmo-meta.json`.
435
+
436
+ ## Public native relationship document
437
+
438
+ `sf data360 retrieve -m relationship:<Dmo__dlm>` writes one file per relationship
439
+ whose source is that DMO, at
440
+ `<project-root>/data360/relationship/<Name>.relationship-meta.json`.
441
+
442
+ ```json
443
+ {
444
+ "schemaVersion": 1,
445
+ "kind": "relationship",
446
+ "c__dataSpace": "default",
447
+ "identity": {
448
+ "apiName": "Order_CustomerId_map_Customer_Id_1794467679481"
449
+ },
450
+ "spec": {
451
+ "sourceObjectName": "Order__dlm",
452
+ "sourceFieldName": "CustomerId__c",
453
+ "targetObjectName": "Customer__dlm",
454
+ "targetFieldName": "Id__c",
455
+ "cardinality": "ManyToOne",
456
+ "relationshipOwner": "DataCloud",
457
+ "label": "Order to customer"
458
+ }
459
+ }
460
+ ```
461
+
462
+ Shape checks:
463
+
464
+ - The document has exactly `schemaVersion: 1`, `kind: "relationship"`, `c__dataSpace`,
465
+ `identity` and `spec`; `c__dataSpace` is the relationship's data space (the run's,
466
+ `UNSUPPORTED_RELATIONSHIP_DATASPACE` otherwise; `LEGACY_DATASPACE_KEY` for the old
467
+ `identity.dataSpace`), and `identity` has exactly `apiName` (a letter, then letters,
468
+ digits or underscores).
469
+ - `spec` has the six keys shown and may have `label` (a nonblank, trimmed text). The source object ends `__dlm` and the
470
+ source field `__c`; the target object and field are any API names: a DMO and its
471
+ custom field, or a CRM object and field with `relationshipOwner` `SObject` (for
472
+ example `Account` and `Id`). `cardinality` and `relationshipOwner` are nonblank strings sent as written;
473
+ Salesforce decides which values it accepts.
474
+ - The file name must equal `identity.apiName` and the file must sit in a
475
+ `data360/relationship/` folder. Shape failures are reported as
476
+ `INVALID_RELATIONSHIP_DOCUMENT`.
477
+
478
+ Salesforce generates the relationship name (the example's shape). Retrieval saves
479
+ that name, the six authored values and the label (the Metadata API `masterLabel`;
480
+ left out when there is no record); the id, object and field labels, status and
481
+ creation type are not saved. A hand-written file may use any valid name, because
482
+ deploy finds the relationship by the file's name and otherwise by its binding:
483
+ source object and field, target object and field. A file without `label` leaves the
484
+ org's label as it is. Other values than the org's are sent as one Metadata API
485
+ `updateMetadata` of the whole record; Salesforce decides which it accepts. Two
486
+ files with the same binding in one command are refused (`DUPLICATE_IDENTITY`).
487
+ Delete uses the file to learn the source DMO, and the selector name must be the
488
+ org's relationship name; if the binding exists only under another name, delete
489
+ refuses with `RELATIONSHIP_NAME_MISMATCH` and names it.
490
+
491
+ The file is indented with two spaces and ends with LF. Identical bytes are
492
+ unchanged; a differing file requires `--overwrite` (relationship names are unique in the
493
+ org). Writer codes:
494
+ `UNSAFE_PATH`, `OVERWRITE_REQUIRED`, `OUTPUT_CHANGED`, `OUTPUT_FAILED`,
495
+ `PARTIAL_RELATIONSHIP_OUTPUT`.
496
+
497
+ ## Local files after delete
498
+
499
+ After a confirmed deletion, `sf data360 delete` removes the deleted component's local
500
+ file: on the outcome `deleted` (mutation `confirmed-deleted`) and on
501
+ `deletion-processing` (mutation `acknowledged-processing`, Salesforce accepted the
502
+ deletion and is finishing it). Removed are the files under `data360/` in the current
503
+ directory for `dlo`, `dmo` and `relationship`, and `data-stream` (with
504
+ `--delete-dlo` also the linked data lake object's file); for a mapping the file of
505
+ that name or the hand-written file whose binding matches; for a data transform
506
+ `data360/dataTransforms/<Name>.dataTransform.json` and for a calculated insight both
507
+ `data360/calculatedInsights/<Name>.calculatedInsight-meta.json` and
508
+ `.calculatedInsight-meta.sql` in the current directory; for a segment
509
+ `data360/segments/<Name>.segment.json` and every `<Name>.segment.*.sql` beside it; and for
510
+ an identity resolution or data graph its canonical file
511
+ (`data360/identityResolution/<Name>.identityResolution.json`,
512
+ `data360/dataGraphs/<Name>.native-dataGraph.json`), all in the current directory. Files are found by name at these paths; only the
513
+ segments folder is listed, for the segment's SQL files. Mapping files of mappings
514
+ Salesforce removes together with a deleted DMO are not removed, because those
515
+ mappings are not items of the command.
516
+
517
+ Each file is removed on its own with one unlink. Only regular files are removed:
518
+ directories, symbolic links, junctions, files reached through a linked folder and
519
+ hard-linked files are refused (`UNSAFE_PATH`), as is any path outside the project's
520
+ `data360` folder. Each result item lists
521
+ `removedLocalFiles` with an outcome per file: `removed`, `not-present`, `kept` or
522
+ `failed`. A failed removal keeps the confirmed org result, and the run is `partial`
523
+ (exit code 68) with `LOCAL_FILE_REMOVAL_FAILED` when at least one deletion is confirmed,
524
+ otherwise (deletions still processing only) `processing` (exit code 69). `--keep-local-files` keeps every file
525
+ (outcome `kept`). `--preview` removes nothing and lists the files as `localFiles` with
526
+ `exists`. The outcomes unchanged, blocked, failed, unknown, rejected and
527
+ deletion-unconfirmed remove
528
+ nothing. `delete --field` removes no file; it refreshes the DMO and mapping files.