@openhi/constructs 0.0.189 → 0.0.190

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 (37) hide show
  1. package/lib/{chunk-7GMTHOYF.mjs → chunk-2TLJKOJL.mjs} +2 -2
  2. package/lib/{chunk-VQY57NOV.mjs → chunk-3PS5R367.mjs} +2 -2
  3. package/lib/{chunk-DIVYB6GD.mjs → chunk-4WFHISV3.mjs} +4 -4
  4. package/lib/{chunk-3M4QTQH6.mjs → chunk-4YQD4PFR.mjs} +2 -2
  5. package/lib/{chunk-JJ3AQ6G5.mjs → chunk-63POQTMP.mjs} +2 -2
  6. package/lib/{chunk-F2LY4TEI.mjs → chunk-7WBLBIQJ.mjs} +4 -4
  7. package/lib/{chunk-4LQR32D2.mjs → chunk-AYHBFK3Y.mjs} +2 -2
  8. package/lib/{chunk-PIQISEGW.mjs → chunk-RGE4WDND.mjs} +2 -2
  9. package/lib/{chunk-V6KLFEHC.mjs → chunk-UWVPF6GB.mjs} +2 -2
  10. package/lib/{chunk-Q4KQD2NB.mjs → chunk-V6AO5T57.mjs} +9 -2
  11. package/lib/chunk-V6AO5T57.mjs.map +1 -0
  12. package/lib/counter-reconciliation.handler.js.map +1 -1
  13. package/lib/counter-reconciliation.handler.mjs +4 -4
  14. package/lib/index.js.map +1 -1
  15. package/lib/index.mjs +8 -8
  16. package/lib/pre-token-generation.handler.js.map +1 -1
  17. package/lib/pre-token-generation.handler.mjs +4 -4
  18. package/lib/provision-default-workspace.handler.js +4 -1
  19. package/lib/provision-default-workspace.handler.js.map +1 -1
  20. package/lib/provision-default-workspace.handler.mjs +3 -3
  21. package/lib/rest-api-lambda.handler.js +8 -1
  22. package/lib/rest-api-lambda.handler.js.map +1 -1
  23. package/lib/rest-api-lambda.handler.mjs +8 -8
  24. package/lib/seed-demo-data.handler.js +4 -1
  25. package/lib/seed-demo-data.handler.js.map +1 -1
  26. package/lib/seed-demo-data.handler.mjs +7 -7
  27. package/package.json +1 -1
  28. package/lib/chunk-Q4KQD2NB.mjs.map +0 -1
  29. /package/lib/{chunk-7GMTHOYF.mjs.map → chunk-2TLJKOJL.mjs.map} +0 -0
  30. /package/lib/{chunk-VQY57NOV.mjs.map → chunk-3PS5R367.mjs.map} +0 -0
  31. /package/lib/{chunk-DIVYB6GD.mjs.map → chunk-4WFHISV3.mjs.map} +0 -0
  32. /package/lib/{chunk-3M4QTQH6.mjs.map → chunk-4YQD4PFR.mjs.map} +0 -0
  33. /package/lib/{chunk-JJ3AQ6G5.mjs.map → chunk-63POQTMP.mjs.map} +0 -0
  34. /package/lib/{chunk-F2LY4TEI.mjs.map → chunk-7WBLBIQJ.mjs.map} +0 -0
  35. /package/lib/{chunk-4LQR32D2.mjs.map → chunk-AYHBFK3Y.mjs.map} +0 -0
  36. /package/lib/{chunk-PIQISEGW.mjs.map → chunk-RGE4WDND.mjs.map} +0 -0
  37. /package/lib/{chunk-V6KLFEHC.mjs.map → chunk-UWVPF6GB.mjs.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  createRoleAssignmentOperation,
4
4
  createTenantOperation,
5
5
  createWorkspaceOperation
6
- } from "./chunk-3M4QTQH6.mjs";
6
+ } from "./chunk-4YQD4PFR.mjs";
7
7
  import "./chunk-BUAYVN3C.mjs";
8
8
  import "./chunk-5S6VFBLT.mjs";
9
9
  import "./chunk-I6LUPJUY.mjs";
@@ -12,9 +12,9 @@ import {
12
12
  findUserBySubOperation,
13
13
  idFromReference,
14
14
  parseUserResource
15
- } from "./chunk-V6KLFEHC.mjs";
15
+ } from "./chunk-UWVPF6GB.mjs";
16
16
  import "./chunk-6BB4CRSS.mjs";
17
- import "./chunk-Q4KQD2NB.mjs";
17
+ import "./chunk-V6AO5T57.mjs";
18
18
  import "./chunk-APVVG7BO.mjs";
19
19
  import "./chunk-FYHBHHWK.mjs";
20
20
  import {
@@ -3550,6 +3550,9 @@ function mergeAuditIntoMeta(meta, audit) {
3550
3550
 
3551
3551
  // src/data/operations/data-operations-common.ts
3552
3552
  var DATA_ENTITY_SK = "CURRENT";
3553
+ function deriveVid(lastUpdated) {
3554
+ return lastUpdated.replace(/\D/g, "") || Date.now().toString(36);
3555
+ }
3553
3556
  async function getDataEntityById(entity, tenantId, workspaceId, id, resourceLabel) {
3554
3557
  const result = await entity.get({
3555
3558
  tenantId,
@@ -3678,7 +3681,7 @@ async function listDataEntitiesByWorkspace(entity, tenantId, workspaceId, mode =
3678
3681
  }
3679
3682
  async function createDataEntityRecord(entity, tenantId, workspaceId, id, resourceWithAudit, fallbackDate) {
3680
3683
  const lastUpdated = resourceWithAudit.meta?.lastUpdated ?? fallbackDate ?? (/* @__PURE__ */ new Date()).toISOString();
3681
- const vid = lastUpdated.replace(/[-:T.Z]/g, "").slice(0, 12) || Date.now().toString(36);
3684
+ const vid = deriveVid(lastUpdated);
3682
3685
  const resourceLike = resourceWithAudit;
3683
3686
  const summary = JSON.stringify((0, import_types4.extractSummary)(resourceLike));
3684
3687
  const gsi1sk = (0, import_types4.extractSortKey)(resourceLike);
@@ -3749,6 +3752,10 @@ async function updateDataEntityById(entity, tenantId, workspaceId, id, resourceL
3749
3752
  }).set({
3750
3753
  resource: compressResource(JSON.stringify(resource)),
3751
3754
  summary,
3755
+ // A fresh vid is what makes this UPDATE visible to the search tier:
3756
+ // the replication upsert rejects any event whose version does not
3757
+ // strictly exceed the stored row's. See deriveVid.
3758
+ vid: deriveVid(lastUpdated),
3752
3759
  lastUpdated,
3753
3760
  gsi1sk
3754
3761
  }).go();