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.
- package/dist/Aggregate.d.ts +119 -15
- package/dist/Aggregate.d.ts.map +1 -1
- package/dist/Aggregate.js +2286 -670
- package/dist/Aggregate.js.map +1 -1
- package/dist/Batch.d.ts +9 -5
- package/dist/Batch.d.ts.map +1 -1
- package/dist/Batch.js +97 -232
- package/dist/Batch.js.map +1 -1
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +27 -21
- package/dist/Collection.js.map +1 -1
- package/dist/ConsumedCapacity.js +1 -1
- package/dist/ConsumedCapacity.js.map +1 -1
- package/dist/DynamoClient.d.ts +44 -16
- package/dist/DynamoClient.d.ts.map +1 -1
- package/dist/DynamoClient.js +299 -166
- package/dist/DynamoClient.js.map +1 -1
- package/dist/Entity.d.ts +94 -104
- package/dist/Entity.d.ts.map +1 -1
- package/dist/Entity.js +3673 -3022
- package/dist/Entity.js.map +1 -1
- package/dist/EventStore.d.ts +39 -17
- package/dist/EventStore.d.ts.map +1 -1
- package/dist/EventStore.js +392 -366
- package/dist/EventStore.js.map +1 -1
- package/dist/Marshaller.d.ts +39 -9
- package/dist/Marshaller.d.ts.map +1 -1
- package/dist/Marshaller.js +421 -70
- package/dist/Marshaller.js.map +1 -1
- package/dist/Query.d.ts +93 -32
- package/dist/Query.d.ts.map +1 -1
- package/dist/Query.js +550 -83
- package/dist/Query.js.map +1 -1
- package/dist/StorageEncoding.d.ts +7 -1
- package/dist/StorageEncoding.d.ts.map +1 -1
- package/dist/StorageEncoding.js +8 -2
- package/dist/StorageEncoding.js.map +1 -1
- package/dist/Table.d.ts +71 -4
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +7 -0
- package/dist/Table.js.map +1 -1
- package/dist/Transaction.d.ts +2 -18
- package/dist/Transaction.d.ts.map +1 -1
- package/dist/Transaction.js +11 -62
- package/dist/Transaction.js.map +1 -1
- package/dist/change-feed/ChangeFeed.d.ts +8 -3
- package/dist/change-feed/ChangeFeed.d.ts.map +1 -1
- package/dist/change-feed/ChangeFeed.js +76 -9
- package/dist/change-feed/ChangeFeed.js.map +1 -1
- package/dist/change-feed/CheckpointStore.js +1 -1
- package/dist/change-feed/CheckpointStore.js.map +1 -1
- package/dist/change-feed/DynamoStreamsClient.d.ts +12 -5
- package/dist/change-feed/DynamoStreamsClient.d.ts.map +1 -1
- package/dist/change-feed/DynamoStreamsClient.js +15 -9
- package/dist/change-feed/DynamoStreamsClient.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/BoundCrud.d.ts +40 -32
- package/dist/internal/BoundCrud.d.ts.map +1 -1
- package/dist/internal/BoundCrud.js.map +1 -1
- package/dist/internal/BoundQuery.d.ts +12 -9
- package/dist/internal/BoundQuery.d.ts.map +1 -1
- package/dist/internal/BoundQuery.js +26 -12
- package/dist/internal/BoundQuery.js.map +1 -1
- package/dist/internal/BoundVectorQuery.d.ts.map +1 -1
- package/dist/internal/BoundVectorQuery.js +2 -1
- package/dist/internal/BoundVectorQuery.js.map +1 -1
- package/dist/internal/Capacity.d.ts +44 -4
- package/dist/internal/Capacity.d.ts.map +1 -1
- package/dist/internal/Capacity.js +89 -15
- package/dist/internal/Capacity.js.map +1 -1
- package/dist/internal/ClientOptions.d.ts +72 -0
- package/dist/internal/ClientOptions.d.ts.map +1 -0
- package/dist/internal/ClientOptions.js +79 -0
- package/dist/internal/ClientOptions.js.map +1 -0
- package/dist/internal/Cursor.d.ts +28 -14
- package/dist/internal/Cursor.d.ts.map +1 -1
- package/dist/internal/Cursor.js +37 -12
- package/dist/internal/Cursor.js.map +1 -1
- package/dist/internal/EntityCombinators.d.ts +22 -7
- package/dist/internal/EntityCombinators.d.ts.map +1 -1
- package/dist/internal/EntityCombinators.js +6 -2
- package/dist/internal/EntityCombinators.js.map +1 -1
- package/dist/internal/EntityOps.d.ts +11 -1
- package/dist/internal/EntityOps.d.ts.map +1 -1
- package/dist/internal/EntityOps.js.map +1 -1
- package/dist/internal/EventProjection.d.ts +15 -3
- package/dist/internal/EventProjection.d.ts.map +1 -1
- package/dist/internal/EventProjection.js +27 -8
- package/dist/internal/EventProjection.js.map +1 -1
- package/dist/internal/Expr.d.ts.map +1 -1
- package/dist/internal/Expr.js +53 -2
- package/dist/internal/Expr.js.map +1 -1
- package/dist/internal/ExpressionLimits.d.ts +57 -1
- package/dist/internal/ExpressionLimits.d.ts.map +1 -1
- package/dist/internal/ExpressionLimits.js +90 -1
- package/dist/internal/ExpressionLimits.js.map +1 -1
- package/dist/internal/ItemSize.d.ts +108 -4
- package/dist/internal/ItemSize.d.ts.map +1 -1
- package/dist/internal/ItemSize.js +190 -3
- package/dist/internal/ItemSize.js.map +1 -1
- package/dist/internal/MultiProjection.d.ts +7 -2
- package/dist/internal/MultiProjection.d.ts.map +1 -1
- package/dist/internal/MultiProjection.js +9 -3
- package/dist/internal/MultiProjection.js.map +1 -1
- package/dist/internal/PathBuilder.d.ts +15 -4
- package/dist/internal/PathBuilder.d.ts.map +1 -1
- package/dist/internal/PathBuilder.js +20 -10
- package/dist/internal/PathBuilder.js.map +1 -1
- package/dist/internal/ProjectionEngine.d.ts +78 -18
- package/dist/internal/ProjectionEngine.d.ts.map +1 -1
- package/dist/internal/ProjectionEngine.js +402 -257
- package/dist/internal/ProjectionEngine.js.map +1 -1
- package/dist/internal/RangePlanner.d.ts +0 -76
- package/dist/internal/RangePlanner.d.ts.map +1 -1
- package/dist/internal/RangePlanner.js +2 -206
- package/dist/internal/RangePlanner.js.map +1 -1
- package/dist/internal/Rekey.d.ts +49 -7
- package/dist/internal/Rekey.d.ts.map +1 -1
- package/dist/internal/Rekey.js +113 -10
- package/dist/internal/Rekey.js.map +1 -1
- package/dist/internal/RoundTrip.d.ts +36 -0
- package/dist/internal/RoundTrip.d.ts.map +1 -0
- package/dist/internal/RoundTrip.js +79 -0
- package/dist/internal/RoundTrip.js.map +1 -0
- package/dist/internal/SentRequest.d.ts +14 -0
- package/dist/internal/SentRequest.d.ts.map +1 -0
- package/dist/internal/SentRequest.js +31 -0
- package/dist/internal/SentRequest.js.map +1 -0
- package/dist/internal/ShardMerge.d.ts +83 -0
- package/dist/internal/ShardMerge.d.ts.map +1 -0
- package/dist/internal/ShardMerge.js +182 -0
- package/dist/internal/ShardMerge.js.map +1 -0
- package/dist/internal/TransactPlan.d.ts +1 -8
- package/dist/internal/TransactPlan.d.ts.map +1 -1
- package/dist/internal/TransactPlan.js +2 -9
- package/dist/internal/TransactPlan.js.map +1 -1
- package/dist/internal/TransactWriteOps.d.ts +75 -24
- package/dist/internal/TransactWriteOps.d.ts.map +1 -1
- package/dist/internal/TransactWriteOps.js +147 -186
- package/dist/internal/TransactWriteOps.js.map +1 -1
- package/dist/internal/TransactableOps.d.ts +123 -29
- package/dist/internal/TransactableOps.d.ts.map +1 -1
- package/dist/internal/TransactableOps.js +255 -87
- package/dist/internal/TransactableOps.js.map +1 -1
- package/dist/internal/WriteDiagnosis.d.ts +31 -3
- package/dist/internal/WriteDiagnosis.d.ts.map +1 -1
- package/dist/internal/WriteDiagnosis.js +128 -11
- package/dist/internal/WriteDiagnosis.js.map +1 -1
- 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
|
|
24
|
-
*
|
|
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
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
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
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
* `
|
|
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">,
|
|
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
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
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,
|
|
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)
|
|
203
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
213
|
-
* where a composite has no key text (`NaN`,
|
|
214
|
-
* multi-item ops (`Batch.get`, `Batch.write`
|
|
215
|
-
* `transactWrite` deletes and condition checks), as an
|
|
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
|
|
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;
|
|
1
|
+
{"version":3,"file":"TransactableOps.d.ts","sourceRoot":"","sources":["../../src/internal/TransactableOps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,w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