@htilabs/platform-common-models 0.68.0 → 0.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,6 +16,30 @@ Package exports are organized into a public root API and a small number of
16
16
  dedicated subpaths (`/validation`, `/cvcs`) — consult `package.json` for the
17
17
  authoritative `exports` map.
18
18
 
19
+ ## 0.69.0 — the merge is in the package: `@htilabs/platform-common-models/org-merge`
20
+
21
+ The merge step of 0.68.0 lived in `scripts/` and so was not published. Its
22
+ plan, write and undo (`planMerges`, `executeMerges`, `rollbackMerges`,
23
+ `ORG_REFERENCES`, `appDatabaseProblem`) now ship as the server-only subpath
24
+ `/org-merge`, so the Platform's Admin Hub can fold a copy into the kept
25
+ organization by the same rules the developer-run tool uses. Nothing about a
26
+ merge changes: the code moved (`scripts/lib/orgMerge.ts` to
27
+ `src/orgMerge/orgMerge.ts`), the spreadsheet reader stayed in `scripts/`
28
+ (`scripts/lib/orgMergeSheet.ts`), and `rollbackMerges` takes the smaller
29
+ `MergeBeforeImages` (the fill's before-images file is one).
30
+
31
+ One change makes it usable outside this package: `/org-merge` imports neither
32
+ mongoose nor the MongoDB driver. Database handles are typed structurally, and
33
+ each call takes the caller's own ObjectId class and EJSON as its last argument
34
+ (`MergeDriver`: with `mongodb`, `{ ObjectId, EJSON: BSON.EJSON }`; with
35
+ mongoose, `mongoose.mongo.ObjectId` and `mongoose.mongo.BSON.EJSON`).
36
+ The tool binds mongoose's in `scripts/lib/orgMerge.ts`; its commands, sheet
37
+ and runbook are unchanged.
38
+
39
+ One refusal moved down a level with it: `planMerges` now refuses a line whose
40
+ copy and kept row are the same row. The sheet reader already did; a caller
41
+ that has no sheet (the Admin Hub) gets the same answer from the plan.
42
+
19
43
  ## 0.68.0 — folding a copy into the real organization: the merge step (scripts only)
20
44
 
21
45
  One record per real-world organization. Where the same organization was typed