@reventlessdev/reventless-aws 3.0.0-alpha.302 → 3.0.0-alpha.304

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 (26) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/package.json +8 -8
  3. package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res +21 -0
  4. package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res.mjs +20 -0
  5. package/src/adapter/QueryDb/PgQueryResolver_Lambda.res +41 -3
  6. package/src/adapter/QueryDb/PgQueryResolver_Lambda.res.mjs +27 -6
  7. package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res +34 -4
  8. package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res.mjs +16 -5
  9. package/src/adapter/Runtime/DcbCommandTopicEntryPoint.mjs +12 -0
  10. package/src/adapter/Runtime/PgQueryResolverEntryPoint_Ops.res +10 -0
  11. package/src/adapter/Runtime/PgQueryResolverEntryPoint_Ops.res.mjs +4 -1
  12. package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res +16 -2
  13. package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res.mjs +4 -2
  14. package/src/adapter/Runtime/StateTopicPublish.mjs +38 -5
  15. package/src/adapter/StateTopic/StateTopic_AppSync.res +49 -1
  16. package/src/adapter/StateTopic/StateTopic_AppSync.res.mjs +28 -3
  17. package/src/adapter/StateTopic/StateTopic_AppSync_Ops.res +73 -2
  18. package/src/adapter/StateTopic/StateTopic_AppSync_Ops.res.mjs +39 -4
  19. package/tests/PgQueryResolver_LambdaTest.res +16 -1
  20. package/tests/PgQueryResolver_LambdaTest.res.mjs +46 -32
  21. package/tests/Platform_ComponentDefinitions_Lambda_OpsTest.res +65 -0
  22. package/tests/Platform_ComponentDefinitions_Lambda_OpsTest.res.mjs +36 -0
  23. package/tests/QueryDbResolvers_AppSyncTest.res.mjs +3 -3
  24. package/tests/StateChangeDescriptorParityTest.res +82 -1
  25. package/tests/StateChangeDescriptorParityTest.res.mjs +97 -1
  26. package/tests/stateChangeDescriptorParity.mjs +72 -3
@@ -49,6 +49,59 @@ const CASES = [
49
49
  entityKey: "p3",
50
50
  state: { id: "p3", blob: "x".repeat(70 * 1024), updatedAt: "2026-05-19T12:00:00Z" },
51
51
  },
52
+ // Retirement: the row is withdrawn, so every implementation must publish the
53
+ // metadata-only shape — no state, and no sortKeyValue either, even though this
54
+ // row carries an updatedAt that the same row would publish while live.
55
+ {
56
+ name: "retired row degrades to metadata only",
57
+ changeKind: "Updated",
58
+ entityKey: "p4",
59
+ state: { id: "p4", name: "Widget", archived: true, updatedAt: "2026-05-19T12:00:00Z" },
60
+ retiredField: "archived",
61
+ },
62
+ // The control: same field declared, flag false, so nothing changes. Without
63
+ // this, an implementation that dropped the payload unconditionally whenever a
64
+ // retiredField was configured would still pass the case above.
65
+ {
66
+ name: "live row with a retirement flag carries the row",
67
+ changeKind: "Updated",
68
+ entityKey: "p5",
69
+ state: { id: "p5", name: "Widget", archived: false, updatedAt: "2026-05-19T12:00:00Z" },
70
+ retiredField: "archived",
71
+ },
72
+ // The state form, and the reason it is a set: a lifecycle may end in more than
73
+ // one way, and both ways withdraw the row identically. Two cases rather than
74
+ // one so an implementation comparing against only the first member fails.
75
+ {
76
+ name: "row in the first retired state degrades to metadata only",
77
+ changeKind: "Updated",
78
+ entityKey: "p6",
79
+ state: { id: "p6", name: "Widget", shelfStatus: "Archived", updatedAt: "2026-05-19T12:00:00Z" },
80
+ retiredField: "shelfStatus",
81
+ retiredValues: ["Archived", "Discontinued"],
82
+ },
83
+ {
84
+ name: "row in the second retired state degrades to metadata only",
85
+ changeKind: "Updated",
86
+ entityKey: "p7",
87
+ state: {
88
+ id: "p7",
89
+ name: "Widget",
90
+ shelfStatus: "Discontinued",
91
+ updatedAt: "2026-05-19T12:00:00Z",
92
+ },
93
+ retiredField: "shelfStatus",
94
+ retiredValues: ["Archived", "Discontinued"],
95
+ },
96
+ // The state-form control: a live state on the same declared lifecycle.
97
+ {
98
+ name: "row in a live state carries the row",
99
+ changeKind: "Updated",
100
+ entityKey: "p8",
101
+ state: { id: "p8", name: "Widget", shelfStatus: "Listed", updatedAt: "2026-05-19T12:00:00Z" },
102
+ retiredField: "shelfStatus",
103
+ retiredValues: ["Archived", "Discontinued"],
104
+ },
52
105
  {
53
106
  name: "delete carries no row",
54
107
  changeKind: "Removed",
@@ -79,10 +132,17 @@ export async function buildAll() {
79
132
  return { ...descriptor, seq: "<seq>" };
80
133
  };
81
134
 
82
- return CASES.map(({ name, changeKind, entityKey, state }) => ({
135
+ return CASES.map(({ name, changeKind, entityKey, state, retiredField, retiredValues }) => ({
83
136
  name,
84
137
  local: normalise(
85
- local.make(changeKind, entityKey, state === undefined ? undefined : state, local.nextSequence()),
138
+ local.make(
139
+ changeKind,
140
+ entityKey,
141
+ state === undefined ? undefined : state,
142
+ local.nextSequence(),
143
+ retiredField,
144
+ retiredValues,
145
+ ),
86
146
  ),
87
147
  relay: normalise(
88
148
  relay.makeDescriptor(
@@ -93,10 +153,19 @@ export async function buildAll() {
93
153
  // OldImage, which makeDescriptor then drops.
94
154
  state === undefined ? { id: entityKey } : state,
95
155
  "49590300000000016818000000",
156
+ retiredField,
157
+ retiredValues,
96
158
  ),
97
159
  ),
98
160
  postgres: normalise(
99
- postgres.makeDescriptor({ changeKind, entityKey, state, seq: postgres.nextSequence() }),
161
+ postgres.makeDescriptor({
162
+ changeKind,
163
+ entityKey,
164
+ state,
165
+ seq: postgres.nextSequence(),
166
+ retiredField,
167
+ retiredValues,
168
+ }),
100
169
  ),
101
170
  }));
102
171
  }