effect-dynamodb 1.38.0 → 1.40.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 (152) hide show
  1. package/dist/Aggregate.d.ts +119 -15
  2. package/dist/Aggregate.d.ts.map +1 -1
  3. package/dist/Aggregate.js +2286 -670
  4. package/dist/Aggregate.js.map +1 -1
  5. package/dist/Batch.d.ts +9 -5
  6. package/dist/Batch.d.ts.map +1 -1
  7. package/dist/Batch.js +97 -232
  8. package/dist/Batch.js.map +1 -1
  9. package/dist/Collection.d.ts.map +1 -1
  10. package/dist/Collection.js +27 -21
  11. package/dist/Collection.js.map +1 -1
  12. package/dist/ConsumedCapacity.js +1 -1
  13. package/dist/ConsumedCapacity.js.map +1 -1
  14. package/dist/DynamoClient.d.ts +44 -16
  15. package/dist/DynamoClient.d.ts.map +1 -1
  16. package/dist/DynamoClient.js +299 -166
  17. package/dist/DynamoClient.js.map +1 -1
  18. package/dist/Entity.d.ts +94 -104
  19. package/dist/Entity.d.ts.map +1 -1
  20. package/dist/Entity.js +3673 -3022
  21. package/dist/Entity.js.map +1 -1
  22. package/dist/EventStore.d.ts +39 -17
  23. package/dist/EventStore.d.ts.map +1 -1
  24. package/dist/EventStore.js +392 -366
  25. package/dist/EventStore.js.map +1 -1
  26. package/dist/Marshaller.d.ts +39 -9
  27. package/dist/Marshaller.d.ts.map +1 -1
  28. package/dist/Marshaller.js +421 -70
  29. package/dist/Marshaller.js.map +1 -1
  30. package/dist/Query.d.ts +93 -32
  31. package/dist/Query.d.ts.map +1 -1
  32. package/dist/Query.js +550 -83
  33. package/dist/Query.js.map +1 -1
  34. package/dist/StorageEncoding.d.ts +7 -1
  35. package/dist/StorageEncoding.d.ts.map +1 -1
  36. package/dist/StorageEncoding.js +8 -2
  37. package/dist/StorageEncoding.js.map +1 -1
  38. package/dist/Table.d.ts +71 -4
  39. package/dist/Table.d.ts.map +1 -1
  40. package/dist/Table.js +7 -0
  41. package/dist/Table.js.map +1 -1
  42. package/dist/Transaction.d.ts +2 -18
  43. package/dist/Transaction.d.ts.map +1 -1
  44. package/dist/Transaction.js +11 -62
  45. package/dist/Transaction.js.map +1 -1
  46. package/dist/change-feed/ChangeFeed.d.ts +8 -3
  47. package/dist/change-feed/ChangeFeed.d.ts.map +1 -1
  48. package/dist/change-feed/ChangeFeed.js +76 -9
  49. package/dist/change-feed/ChangeFeed.js.map +1 -1
  50. package/dist/change-feed/CheckpointStore.js +1 -1
  51. package/dist/change-feed/CheckpointStore.js.map +1 -1
  52. package/dist/change-feed/DynamoStreamsClient.d.ts +12 -5
  53. package/dist/change-feed/DynamoStreamsClient.d.ts.map +1 -1
  54. package/dist/change-feed/DynamoStreamsClient.js +15 -9
  55. package/dist/change-feed/DynamoStreamsClient.js.map +1 -1
  56. package/dist/index.d.ts +1 -1
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/index.js.map +1 -1
  60. package/dist/internal/BoundCrud.d.ts +40 -32
  61. package/dist/internal/BoundCrud.d.ts.map +1 -1
  62. package/dist/internal/BoundCrud.js.map +1 -1
  63. package/dist/internal/BoundQuery.d.ts +12 -9
  64. package/dist/internal/BoundQuery.d.ts.map +1 -1
  65. package/dist/internal/BoundQuery.js +26 -12
  66. package/dist/internal/BoundQuery.js.map +1 -1
  67. package/dist/internal/BoundVectorQuery.d.ts.map +1 -1
  68. package/dist/internal/BoundVectorQuery.js +2 -1
  69. package/dist/internal/BoundVectorQuery.js.map +1 -1
  70. package/dist/internal/Capacity.d.ts +44 -4
  71. package/dist/internal/Capacity.d.ts.map +1 -1
  72. package/dist/internal/Capacity.js +89 -15
  73. package/dist/internal/Capacity.js.map +1 -1
  74. package/dist/internal/ClientOptions.d.ts +72 -0
  75. package/dist/internal/ClientOptions.d.ts.map +1 -0
  76. package/dist/internal/ClientOptions.js +79 -0
  77. package/dist/internal/ClientOptions.js.map +1 -0
  78. package/dist/internal/Cursor.d.ts +28 -14
  79. package/dist/internal/Cursor.d.ts.map +1 -1
  80. package/dist/internal/Cursor.js +37 -12
  81. package/dist/internal/Cursor.js.map +1 -1
  82. package/dist/internal/EntityCombinators.d.ts +22 -7
  83. package/dist/internal/EntityCombinators.d.ts.map +1 -1
  84. package/dist/internal/EntityCombinators.js +6 -2
  85. package/dist/internal/EntityCombinators.js.map +1 -1
  86. package/dist/internal/EntityOps.d.ts +11 -1
  87. package/dist/internal/EntityOps.d.ts.map +1 -1
  88. package/dist/internal/EntityOps.js.map +1 -1
  89. package/dist/internal/EventProjection.d.ts +15 -3
  90. package/dist/internal/EventProjection.d.ts.map +1 -1
  91. package/dist/internal/EventProjection.js +27 -8
  92. package/dist/internal/EventProjection.js.map +1 -1
  93. package/dist/internal/Expr.d.ts.map +1 -1
  94. package/dist/internal/Expr.js +53 -2
  95. package/dist/internal/Expr.js.map +1 -1
  96. package/dist/internal/ExpressionLimits.d.ts +57 -1
  97. package/dist/internal/ExpressionLimits.d.ts.map +1 -1
  98. package/dist/internal/ExpressionLimits.js +90 -1
  99. package/dist/internal/ExpressionLimits.js.map +1 -1
  100. package/dist/internal/ItemSize.d.ts +108 -4
  101. package/dist/internal/ItemSize.d.ts.map +1 -1
  102. package/dist/internal/ItemSize.js +190 -3
  103. package/dist/internal/ItemSize.js.map +1 -1
  104. package/dist/internal/MultiProjection.d.ts +7 -2
  105. package/dist/internal/MultiProjection.d.ts.map +1 -1
  106. package/dist/internal/MultiProjection.js +9 -3
  107. package/dist/internal/MultiProjection.js.map +1 -1
  108. package/dist/internal/PathBuilder.d.ts +15 -4
  109. package/dist/internal/PathBuilder.d.ts.map +1 -1
  110. package/dist/internal/PathBuilder.js +20 -10
  111. package/dist/internal/PathBuilder.js.map +1 -1
  112. package/dist/internal/ProjectionEngine.d.ts +78 -18
  113. package/dist/internal/ProjectionEngine.d.ts.map +1 -1
  114. package/dist/internal/ProjectionEngine.js +402 -257
  115. package/dist/internal/ProjectionEngine.js.map +1 -1
  116. package/dist/internal/RangePlanner.d.ts +0 -76
  117. package/dist/internal/RangePlanner.d.ts.map +1 -1
  118. package/dist/internal/RangePlanner.js +2 -206
  119. package/dist/internal/RangePlanner.js.map +1 -1
  120. package/dist/internal/Rekey.d.ts +49 -7
  121. package/dist/internal/Rekey.d.ts.map +1 -1
  122. package/dist/internal/Rekey.js +113 -10
  123. package/dist/internal/Rekey.js.map +1 -1
  124. package/dist/internal/RoundTrip.d.ts +36 -0
  125. package/dist/internal/RoundTrip.d.ts.map +1 -0
  126. package/dist/internal/RoundTrip.js +79 -0
  127. package/dist/internal/RoundTrip.js.map +1 -0
  128. package/dist/internal/SentRequest.d.ts +14 -0
  129. package/dist/internal/SentRequest.d.ts.map +1 -0
  130. package/dist/internal/SentRequest.js +31 -0
  131. package/dist/internal/SentRequest.js.map +1 -0
  132. package/dist/internal/ShardMerge.d.ts +83 -0
  133. package/dist/internal/ShardMerge.d.ts.map +1 -0
  134. package/dist/internal/ShardMerge.js +182 -0
  135. package/dist/internal/ShardMerge.js.map +1 -0
  136. package/dist/internal/TransactPlan.d.ts +1 -8
  137. package/dist/internal/TransactPlan.d.ts.map +1 -1
  138. package/dist/internal/TransactPlan.js +2 -9
  139. package/dist/internal/TransactPlan.js.map +1 -1
  140. package/dist/internal/TransactWriteOps.d.ts +75 -24
  141. package/dist/internal/TransactWriteOps.d.ts.map +1 -1
  142. package/dist/internal/TransactWriteOps.js +147 -186
  143. package/dist/internal/TransactWriteOps.js.map +1 -1
  144. package/dist/internal/TransactableOps.d.ts +123 -29
  145. package/dist/internal/TransactableOps.d.ts.map +1 -1
  146. package/dist/internal/TransactableOps.js +255 -87
  147. package/dist/internal/TransactableOps.js.map +1 -1
  148. package/dist/internal/WriteDiagnosis.d.ts +31 -3
  149. package/dist/internal/WriteDiagnosis.d.ts.map +1 -1
  150. package/dist/internal/WriteDiagnosis.js +128 -11
  151. package/dist/internal/WriteDiagnosis.js.map +1 -1
  152. package/package.json +4 -2
@@ -11,6 +11,7 @@ import { DateTime, Effect, Option, Schema } from "effect";
11
11
  import type { DynamoClientError, DynamoClientService } from "../DynamoClient.js";
12
12
  import type { Entity } from "../Entity.js";
13
13
  import type { ConditionInput } from "../Expression.js";
14
+ import { type TableConfig } from "../Table.js";
14
15
  import type { ReturnValuesMode, UpdateState } from "./EntityOps.js";
15
16
  /**
16
17
  * @internal Hidden per-incarnation token of a versioned entity (#133): set
@@ -19,23 +20,76 @@ import type { ReturnValuesMode, UpdateState } from "./EntityOps.js";
19
20
  * `__edd_e__` so it cannot collide with a model field; never decoded.
20
21
  */
21
22
  export declare const INCARNATION_TOKEN = "__edd_i__";
23
+ /** @internal What an attribute a projection keeps on its read model's rows is for. */
24
+ export type ProjectionRole = "checkpoint" | "checkpoint map" | "checkpoint owner" | "revision";
22
25
  /**
23
- * @internal What a projection with `removal` records on its read model (#154):
24
- * the fields its tombstones keep (checkpoints, owners) and its revision field.
26
+ * @internal What a projection records on its read model (#154): each attribute its rows hold for
27
+ * it (domain field names), with its role, in the order its tombstone stores them (its revision
28
+ * last), whether it has `removal` (its rows may become tombstones), and whether its tombstones set
29
+ * the table's TTL attribute (`removal.ttl`). `label` names the projection in a refusal. A field
30
+ * the projection gives two roles is listed once per role.
25
31
  */
26
- export interface ProjectionTombstones {
27
- readonly kept: ReadonlyArray<string>;
28
- readonly revision: string | undefined;
32
+ export interface ProjectionLayout {
33
+ readonly label: string;
34
+ readonly roles: ReadonlyArray<readonly [field: string, role: ProjectionRole]>;
35
+ readonly removal: boolean;
36
+ readonly ttl: boolean;
29
37
  }
30
- /** @internal */
31
- export declare const projectionTombstonesOf: (entity: object) => ProjectionTombstones | undefined;
32
38
  /**
33
- * @internal `create` over a projection tombstone (#154): read the key, and
34
- * when it holds the entity's tombstone, carry the projection's kept fields
35
- * over into `item` (stored names, wire values) — its checkpoints, so a late
36
- * redelivery is still recognised — with the revision one higher, and return
37
- * the guard naming that very tombstone. `None` when there is no tombstone:
38
- * `create`'s own guard applies.
39
+ * @internal The layout of every projection defined on the read model, one entry per distinct
40
+ * layout; `undefined` when none is.
41
+ */
42
+ export declare const projectionLayoutsOf: (entity: object) => ReadonlyArray<ProjectionLayout> | undefined;
43
+ /**
44
+ * @internal Whether a projection defined on the read model has `removal`: its rows may be
45
+ * tombstones, which `create` takes the place of (`overTombstone`), so `create` reads first.
46
+ */
47
+ export declare const hasProjectionTombstones: (entity: object) => boolean;
48
+ /**
49
+ * @internal Record a projection's layout on its read model, beside those of the other projections
50
+ * defined on it, and whether it has `removal`. On a read model one of whose projections has
51
+ * `removal`, a stored attribute one projection names in two roles is refused (`[EDD-9133]`), before
52
+ * anything is recorded: its tombstone carries a checkpoint as it is and raises a revision, so the
53
+ * two would overwrite each other's values. The refusal comes at whichever definition completes the
54
+ * conflict (the projection's own, or the first `removal`), so the order projections are defined in
55
+ * doesn't decide it. Without `removal` nothing is refused: rows are never tombstones. Two
56
+ * projections naming one attribute in different roles are not refused (`roleConflict`). A layout
57
+ * already there moves to the end rather than being added again, so a projection defined over and
58
+ * over (in a function, say) doesn't grow the list.
59
+ */
60
+ export declare const addProjectionLayout: (entity: {
61
+ readonly entityType: string;
62
+ readonly _renameToDynamo: (item: Record<string, unknown>) => void;
63
+ }, layout: ProjectionLayout) => void;
64
+ /**
65
+ * @internal Whether the read model's TTL attribute must be checked against the attributes its
66
+ * projections keep (`projectionTtlConflict`): a projection's tombstones set it (`removal.ttl`).
67
+ * Only then is the table resolved for it.
68
+ */
69
+ export declare const projectionTtlChecked: (entity: object) => boolean;
70
+ /**
71
+ * @internal `[EDD-9133]` at run time, once the table's TTL attribute is known: an attribute a
72
+ * projection keeps on the read model's rows that is stored as the TTL attribute, which another's
73
+ * tombstones set (`removal.ttl`). The problem, or `undefined` when there is none. Like the
74
+ * definition's refusal, only on a read model one of whose projections has `removal`.
75
+ */
76
+ export declare const projectionTtlConflict: (entity: {
77
+ readonly entityType: string;
78
+ readonly _renameToDynamo: (item: Record<string, unknown>) => void;
79
+ }, ttlAttribute: string) => string | undefined;
80
+ /**
81
+ * @internal `create` over a projection tombstone (#154): read the key, and when it holds the
82
+ * entity's tombstone, carry what the projections with `removal` keep on one over into `item`
83
+ * (stored names, wire values), and return the guard naming that very tombstone. `None` when there
84
+ * is no tombstone: `create`'s own guard applies. A tombstone holds the attributes of the projection
85
+ * that wrote it, which may be any of those with `removal`: each one's checkpoints (and map, and
86
+ * owners) the tombstone holds are carried as they are, so a late redelivery is still recognised,
87
+ * and its revision one higher. An attribute two of them name is taken in the role the one defined
88
+ * last gives it, as 1.39.0 took every attribute from that one. A projection without `removal`
89
+ * writes no tombstone, and isn't consulted. When a projection's tombstones set the table's TTL
90
+ * attribute, it is never carried, so the row doesn't expire with the tombstone: a projection
91
+ * naming it is refused when it writes (`projectionTtlConflict`), and one defined after a tombstone
92
+ * was written would otherwise carry its expiry onto the row.
39
93
  */
40
94
  export declare const overTombstone: (entity: {
41
95
  readonly entityType: string;
@@ -50,7 +104,18 @@ export declare const overTombstone: (entity: {
50
104
  };
51
105
  };
52
106
  readonly _renameToDynamo: (item: Record<string, unknown>) => void;
53
- }, client: Pick<DynamoClientService, "getItem">, tableName: string, item: Record<string, unknown>) => Effect.Effect<Option.Option<ConditionInput>, DynamoClientError>;
107
+ }, client: Pick<DynamoClientService, "getItem">, table: TableConfig, item: Record<string, unknown>) => Effect.Effect<Option.Option<ConditionInput>, DynamoClientError>;
108
+ /**
109
+ * @internal Flatten `entity`'s sparse-map fields on `item` (stored names) into per-entry
110
+ * attributes, refusing a key it can't store with a `ValidationError` for `operation`. The
111
+ * transactional put and a projection's tombstone (on a copy) go through it, and `Entity.put`
112
+ * refuses through the same `_serializeSparseFields`, so each refuses the same key the same way,
113
+ * before sending anything.
114
+ */
115
+ export declare const serializeSparseOrFail: (entity: {
116
+ readonly entityType: string;
117
+ readonly _serializeSparseFields: (item: Record<string, unknown>) => void;
118
+ }, item: Record<string, unknown>, operation: string) => Effect.Effect<void, ValidationError>;
54
119
  /**
55
120
  * A projection tombstone (#154) of `entityType` — written at a removed row's
56
121
  * own key to keep its checkpoints. Every read by key reports it as absent.
@@ -61,10 +126,11 @@ export declare const isProjectionTombstone: (item: {
61
126
  } | undefined;
62
127
  } | undefined, entityType: string) => boolean;
63
128
  /**
64
- * Marks a projection's row tombstone or outbox item written under the key
65
- * text 1.37 composes (#171). They hold no values to tell whose key they are
66
- * at, and `foo bar`'s current key is `foo%20bar`'s 1.36 key: one without the
67
- * mark is 1.36's, the row its key reads back as.
129
+ * Marks a projection's row tombstone or outbox item with the key text it's
130
+ * under (#171, #183). They hold no values to tell whose key they are at, and
131
+ * `foo bar`'s escaped key is `foo%20bar`'s unescaped one, so `rekey` reads the
132
+ * key back by the mark (`KeyText136.formOfMark`): none is the text 1.36
133
+ * composed, which `escapeKeys` off composes too.
68
134
  */
69
135
  export declare const KEY_TEXT = "__edd_kt__";
70
136
  /** The read-model row an outbox item was written for: its key attributes' text. */
@@ -193,27 +259,50 @@ input?: unknown, details?: {
193
259
  */
194
260
  export declare const resolveTableNames: (infos: ReadonlyArray<{
195
261
  readonly entity: Entity;
196
- }>) => Effect.Effect<Map<Entity<Schema.Top, string, Record<string, KeyComposer.IndexDefinition>, import("@effect-dynamodb/schema/internal/EntityConfig.js").TimestampsConfig | undefined, import("@effect-dynamodb/schema/internal/EntityConfig.js").VersionedConfig | undefined, import("@effect-dynamodb/schema/internal/EntityConfig.js").SoftDeleteConfig | undefined, import("@effect-dynamodb/schema/internal/EntityConfig.js").UniqueConfig | undefined, undefined, undefined, undefined, undefined, undefined, never>, string>, never, import("../Table.js").TableConfig>;
262
+ }>) => Effect.Effect<Map<Entity<Schema.Top, string, Record<string, KeyComposer.IndexDefinition>, import("@effect-dynamodb/schema/internal/EntityConfig.js").TimestampsConfig | undefined, import("@effect-dynamodb/schema/internal/EntityConfig.js").VersionedConfig | undefined, import("@effect-dynamodb/schema/internal/EntityConfig.js").SoftDeleteConfig | undefined, import("@effect-dynamodb/schema/internal/EntityConfig.js").UniqueConfig | undefined, undefined, undefined, undefined, undefined, undefined, never, never>, string>, never, TableConfig>;
197
263
  /**
198
264
  * @internal Run a key composer, turning a value it can't place into a
199
265
  * `ValidationError` for `operation`: a Z-order value (`[EDD-9092]`,
200
266
  * `ZOrderValueError`: `NaN`, an unparseable date, a value outside a `literals`
201
267
  * list — #171), or a composite with no key text (`[EDD-9096]`,
202
- * `KeyValueError`: `NaN`, a bigint past 1,000 digits). Every write path that
203
- * composes an item's keys goes through this, so the failure is typed instead
268
+ * `KeyValueError`: `NaN`, a bigint past 1,000 digits), or a sharded index's
269
+ * missing shard source (`[EDD-9100]`, `ShardSourceError`, #183). Every write path
270
+ * that composes an item's keys goes through this, so the failure is typed instead
204
271
  * of a defect. Any other throw stays a defect.
205
272
  */
206
273
  export declare const composeKeysOrFail: <A>(entityType: string, operation: string, compose: () => A) => Effect.Effect<A, ValidationError>;
207
274
  /**
208
- * Compose the primary key for an entity item.
275
+ * Marshal an item holding a caller's values. A value DynamoDB can't store (an
276
+ * empty set in a list, `NaN`, a number past `Number.MAX_SAFE_INTEGER`, …) fails with
277
+ * a `ValidationError` naming the field; `fieldOf` names a stored attribute by its
278
+ * model field. So does a value it composes into a key and can't place, as
279
+ * {@link composeKeysOrFail} says. Any other throw stays a defect.
280
+ */
281
+ export declare const marshalOrFail: <A>(entityType: string, operation: string, marshal: () => A, options?: {
282
+ readonly fieldOf?: (attribute: string) => string;
283
+ readonly outcome?: string;
284
+ }) => Effect.Effect<A, ValidationError>;
285
+ /**
286
+ * The primary key of the row a caller's DOMAIN key record names: the key
287
+ * `Entity.put` wrote for it (`_domainKeyForm`). The projection engine reads a
288
+ * read-model row, writes its tombstone and keys its outbox items through this,
289
+ * as the row itself is written by the read model's own `put`.
209
290
  */
210
291
  export declare const composePrimaryKey: (entity: Entity, key: Record<string, unknown>) => Record<string, unknown>;
211
292
  /**
212
- * {@link composePrimaryKey}, failing with a `ValidationError` for `operation`
213
- * where a composite has no key text (`NaN`, `[EDD-9096]`) — the key-taking
214
- * multi-item ops (`Batch.get`, `Batch.write` deletes, `transactGet`,
215
- * `transactWrite` deletes and condition checks), as an entity's own `get` and
216
- * `delete` do.
293
+ * The primary key of the item a caller's key names, failing with a
294
+ * `ValidationError` for `operation` where a composite has no key text (`NaN`,
295
+ * `[EDD-9096]`) — the key-taking multi-item ops (`Batch.get`, `Batch.write`
296
+ * deletes, `transactGet`, `transactWrite` deletes and condition checks), as an
297
+ * entity's own `get` and `delete` do.
298
+ *
299
+ * The caller's key is a DOMAIN record (`{ takenAt: DateTime }`), as an entity's
300
+ * own `get` takes it, so it goes through `_domainKeyForm`: the key `Entity.put`
301
+ * wrote for it, the key that `get` composes. For a codec `encode` takes on its
302
+ * own output (`x:` prepended), that is the key of the stored text: a domain
303
+ * value that is also such a text (`"x:MiX"`) is encoded first, as `put` does.
304
+ * It sends the key it sent on 1.39.0, whose `put` keyed the stored text encoded
305
+ * once more, so it found nothing there.
217
306
  */
218
307
  export declare const composePrimaryKeyOrFail: (entity: Entity, key: Record<string, unknown>, operation: string) => Effect.Effect<Record<string, unknown>, ValidationError>;
219
308
  /**
@@ -229,13 +318,18 @@ export declare const composePrimaryKeyOrFail: (entity: Entity, key: Record<strin
229
318
  * `createdAt`. `Entity._planPut` needs them to derive uniqueness sentinels and
230
319
  * the retain snapshot from the same values that were written (#113), and to
231
320
  * keep a replaced item's `createdAt` (#133); re-deriving `now` there would risk
232
- * a skew between an item's `createdAt` and its snapshot's TTL.
321
+ * a skew between an item's `createdAt` and its snapshot's TTL. `options.createdAt`
322
+ * is the `createdAt` of a row being rewritten, which no input supplies.
233
323
  */
234
- export declare const validateAndBuildPutItem: (entity: Entity, input: Record<string, unknown>, operation: string) => Effect.Effect<{
324
+ export declare const validateAndBuildPutItem: (entity: Entity, input: Record<string, unknown>, operation: string, options?: {
325
+ readonly createdAt?: DateTime.Utc | undefined;
326
+ }) => Effect.Effect<{
235
327
  readonly item: Record<string, unknown>;
236
328
  readonly marshalled: Record<string, import("@aws-sdk/client-dynamodb").AttributeValue>;
237
329
  readonly now: DateTime.Utc;
238
330
  /** Whether the input supplied `createdAt` (a replacing put keeps the stored one otherwise). */
239
331
  readonly createdAtSupplied: boolean;
332
+ /** The item's keys, were these system fields what a guarded put carries over from the stored item. */
333
+ readonly composeKeys: (carried: Record<string, unknown>) => Effect.Effect<Record<string, unknown>, ValidationError>;
240
334
  }, ValidationError>;
241
335
  //# sourceMappingURL=TransactableOps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransactableOps.d.ts","sourceRoot":"","sources":["../../src/internal/TransactableOps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AAMnE,OAAO,KAAK,WAAW,MAAM,wCAAwC,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,cAAc,CAAA;AAE5C;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CACtC;AAED,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,KAAG,oBAAoB,GAAG,SACc,CAAA;AAE7F;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ;IACN,QAA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