effect-dynamodb 1.5.0 → 1.7.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/Errors.d.ts CHANGED
@@ -270,5 +270,104 @@ export declare class VersionConflict extends VersionConflict_base<{
270
270
  readonly expectedVersion: number;
271
271
  }> {
272
272
  }
273
+ declare const CompositeKeyHoleError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
274
+ readonly _tag: "CompositeKeyHoleError";
275
+ } & Readonly<A>;
276
+ /**
277
+ * EDD-9024 — A GSI composite at half-position `i` was absent while a composite
278
+ * at position `j > i` was still present, AND the half's `indexPolicy` is
279
+ * `'preserve'`. Composed keys can't carry holes meaningfully — `acc#A#child#Y`
280
+ * with `parent` cleared composes to a syntactically invalid prefix that no
281
+ * `begins_with` query would match. Under `'preserve'`, the library refuses to
282
+ * silently drop the trailing composite and raises this error instead. Under
283
+ * `'sparse'`, the trailing composite is silently truncated to the leading
284
+ * prefix and no error is raised (and when the leading prefix is empty,
285
+ * the half collapses to whole-half-empty which sparse drops together with
286
+ * the other half).
287
+ *
288
+ * Raised at write time (Entity.update / time-series .append). The error
289
+ * names the GSI, the absent composite at position `i`, and the still-present
290
+ * trailing composite at position `j` so callers can locate the offending
291
+ * payload field.
292
+ *
293
+ * Resolutions: supply a value for the absent composite, clear (omit or
294
+ * `Entity.remove(...)`) all trailing composites too, or set
295
+ * `indexPolicy.<key>` to `'sparse'` to opt into truncate-on-hole semantics.
296
+ *
297
+ * See `DESIGN.md §7 Policy-Aware GSI Composition`.
298
+ */
299
+ export declare class CompositeKeyHoleError extends CompositeKeyHoleError_base<{
300
+ readonly entityType: string;
301
+ readonly indexName: string;
302
+ readonly clearedComposite: string;
303
+ readonly trailingComposite: string;
304
+ readonly clearedPosition: number;
305
+ readonly trailingPosition: number;
306
+ /** Which GSI key attribute the hole is in — `"pk"` (gsiNpk) or `"sk"` (gsiNsk). */
307
+ readonly key: "pk" | "sk";
308
+ /** Human-readable description, prefixed with `EDD-9024`. */
309
+ readonly message: string;
310
+ }> {
311
+ }
312
+ /**
313
+ * Build a {@link CompositeKeyHoleError} with a formatted message. Centralises
314
+ * the message format so call sites (KeyComposer, Entity) stay consistent.
315
+ */
316
+ export declare const makeCompositeKeyHoleError: (params: {
317
+ readonly entityType: string;
318
+ readonly indexName: string;
319
+ readonly clearedComposite: string;
320
+ readonly trailingComposite: string;
321
+ readonly clearedPosition: number;
322
+ readonly trailingPosition: number;
323
+ readonly key: "pk" | "sk";
324
+ }) => CompositeKeyHoleError;
325
+ declare const CompositeNullableError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
326
+ readonly _tag: "CompositeNullableError";
327
+ } & Readonly<A>;
328
+ /**
329
+ * EDD-9025 — A composite attribute on `primaryKey`, `indexes`, or a `unique`
330
+ * constraint has a Schema whose type union includes `null`. Composites
331
+ * participate in string composition (`acc#X#alert#Y`); `null` is not a
332
+ * meaningful slot value — only present-with-value or absent. Allowing
333
+ * `Schema.NullOr` / `Schema.NullishOr` / `Schema.Union([..., Schema.Null])`
334
+ * on a composite would let `set({ composite: null })` typecheck, then either
335
+ * blow up at runtime or silently produce a key with the literal string
336
+ * `"null"` as a slot.
337
+ *
338
+ * Raised at `Entity.make()` time. The error names the entity, the
339
+ * surface where the composite is declared (primary key / a GSI / a unique
340
+ * constraint), the offending composite attribute, and the resolved Schema
341
+ * path that contains `null`.
342
+ *
343
+ * Resolution: declare the attribute as `Schema.optional(...)` (which
344
+ * produces `T | undefined` without `null`). Sparse-pattern usage is fully
345
+ * supported under v3's two-way payload classification — `undefined` is
346
+ * "absent" for GSI composition purposes.
347
+ *
348
+ * See `DESIGN.md §7 Policy-Aware GSI Composition` (EDD-9025 footgun gate).
349
+ */
350
+ export declare class CompositeNullableError extends CompositeNullableError_base<{
351
+ readonly entityType: string;
352
+ /** "primaryKey" | "index:<name>" | "unique:<name>" */
353
+ readonly surface: string;
354
+ readonly compositeAttribute: string;
355
+ /** Resolved schema path that revealed the `null` branch. */
356
+ readonly schemaPath: string;
357
+ /** Human-readable description, prefixed with `EDD-9025`. */
358
+ readonly message: string;
359
+ }> {
360
+ }
361
+ /**
362
+ * Build a {@link CompositeNullableError} with a formatted message. Centralises
363
+ * the message format so call sites (Entity.make validation paths) stay
364
+ * consistent.
365
+ */
366
+ export declare const makeCompositeNullableError: (params: {
367
+ readonly entityType: string;
368
+ readonly surface: string;
369
+ readonly compositeAttribute: string;
370
+ readonly schemaPath: string;
371
+ }) => CompositeNullableError;
273
372
  export {};
274
373
  //# sourceMappingURL=Errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../src/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAA;;;;AAE1C,oDAAoD;AACpD,qBAAa,WAAY,SAAQ,iBAAgC;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB,CAAC;CAAG;;;;AAEL,kDAAkD;AAClD,qBAAa,eAAgB,SAAQ,qBAAoC;IACvE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB,CAAC;CAAG;;;;AAEL,oDAAoD;AACpD,qBAAa,qBAAsB,SAAQ,2BAA0C;IACnF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB,CAAC;CAAG;;;;AAEL,yDAAyD;AACzD,qBAAa,mBAAoB,SAAQ,yBAAwC;IAC/E,QAAQ,CAAC,SAAS,EAAE,MAAM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CAAA"}
package/dist/Errors.js CHANGED
@@ -127,4 +127,81 @@ export class CascadePartialFailure extends Data.TaggedError("CascadePartialFailu
127
127
  /** Optimistic concurrency conflict — stream version did not match */
128
128
  export class VersionConflict extends Data.TaggedError("VersionConflict") {
129
129
  }
130
+ /**
131
+ * EDD-9024 — A GSI composite at half-position `i` was absent while a composite
132
+ * at position `j > i` was still present, AND the half's `indexPolicy` is
133
+ * `'preserve'`. Composed keys can't carry holes meaningfully — `acc#A#child#Y`
134
+ * with `parent` cleared composes to a syntactically invalid prefix that no
135
+ * `begins_with` query would match. Under `'preserve'`, the library refuses to
136
+ * silently drop the trailing composite and raises this error instead. Under
137
+ * `'sparse'`, the trailing composite is silently truncated to the leading
138
+ * prefix and no error is raised (and when the leading prefix is empty,
139
+ * the half collapses to whole-half-empty which sparse drops together with
140
+ * the other half).
141
+ *
142
+ * Raised at write time (Entity.update / time-series .append). The error
143
+ * names the GSI, the absent composite at position `i`, and the still-present
144
+ * trailing composite at position `j` so callers can locate the offending
145
+ * payload field.
146
+ *
147
+ * Resolutions: supply a value for the absent composite, clear (omit or
148
+ * `Entity.remove(...)`) all trailing composites too, or set
149
+ * `indexPolicy.<key>` to `'sparse'` to opt into truncate-on-hole semantics.
150
+ *
151
+ * See `DESIGN.md §7 Policy-Aware GSI Composition`.
152
+ */
153
+ export class CompositeKeyHoleError extends Data.TaggedError("CompositeKeyHoleError") {
154
+ }
155
+ /**
156
+ * Build a {@link CompositeKeyHoleError} with a formatted message. Centralises
157
+ * the message format so call sites (KeyComposer, Entity) stay consistent.
158
+ */
159
+ export const makeCompositeKeyHoleError = (params) => new CompositeKeyHoleError({
160
+ ...params,
161
+ message: `[EDD-9024] Composite key hole on GSI "${params.indexName}" of entity "${params.entityType}": ` +
162
+ `composite "${params.clearedComposite}" at ${params.key} position ${params.clearedPosition} is absent, ` +
163
+ `but composite "${params.trailingComposite}" at ${params.key} position ${params.trailingPosition} is still present, ` +
164
+ `and indexPolicy.${params.key} is 'preserve'. ` +
165
+ `Composed keys cannot carry holes — either supply a value for "${params.clearedComposite}", ` +
166
+ `clear all trailing composites (>= position ${params.trailingPosition}) too, ` +
167
+ `set indexPolicy.${params.key} = 'sparse' to opt into truncate-on-hole, ` +
168
+ `or use Entity.remove(["${params.clearedComposite}"]) to drop the whole GSI.`,
169
+ });
170
+ /**
171
+ * EDD-9025 — A composite attribute on `primaryKey`, `indexes`, or a `unique`
172
+ * constraint has a Schema whose type union includes `null`. Composites
173
+ * participate in string composition (`acc#X#alert#Y`); `null` is not a
174
+ * meaningful slot value — only present-with-value or absent. Allowing
175
+ * `Schema.NullOr` / `Schema.NullishOr` / `Schema.Union([..., Schema.Null])`
176
+ * on a composite would let `set({ composite: null })` typecheck, then either
177
+ * blow up at runtime or silently produce a key with the literal string
178
+ * `"null"` as a slot.
179
+ *
180
+ * Raised at `Entity.make()` time. The error names the entity, the
181
+ * surface where the composite is declared (primary key / a GSI / a unique
182
+ * constraint), the offending composite attribute, and the resolved Schema
183
+ * path that contains `null`.
184
+ *
185
+ * Resolution: declare the attribute as `Schema.optional(...)` (which
186
+ * produces `T | undefined` without `null`). Sparse-pattern usage is fully
187
+ * supported under v3's two-way payload classification — `undefined` is
188
+ * "absent" for GSI composition purposes.
189
+ *
190
+ * See `DESIGN.md §7 Policy-Aware GSI Composition` (EDD-9025 footgun gate).
191
+ */
192
+ export class CompositeNullableError extends Data.TaggedError("CompositeNullableError") {
193
+ }
194
+ /**
195
+ * Build a {@link CompositeNullableError} with a formatted message. Centralises
196
+ * the message format so call sites (Entity.make validation paths) stay
197
+ * consistent.
198
+ */
199
+ export const makeCompositeNullableError = (params) => new CompositeNullableError({
200
+ ...params,
201
+ message: `[EDD-9025] Entity "${params.entityType}": composite attribute "${params.compositeAttribute}" ` +
202
+ `on ${params.surface} resolves to a Schema that includes \`null\` (${params.schemaPath}). ` +
203
+ `Composites participate in string composition and cannot be null — only present-with-value or absent. ` +
204
+ `Replace the nullable wrapper with \`Schema.optional(...)\` (T | undefined) to express the sparse ` +
205
+ `pattern, or supply a non-nullable schema for "${params.compositeAttribute}".`,
206
+ });
130
207
  //# sourceMappingURL=Errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Errors.js","sourceRoot":"","sources":["../src/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,QAAQ,CAAA;AAE1C,oDAAoD;AACpD,MAAM,OAAO,WAAY,SAAQ,IAAI,CAAC,WAAW,CAAC,aAAa,CAG7D;CAAG;AAEL,kDAAkD;AAClD,MAAM,OAAO,eAAgB,SAAQ,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAGrE;CAAG;AAEL,oDAAoD;AACpD,MAAM,OAAO,qBAAsB,SAAQ,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAGjF;CAAG;AAEL,yDAAyD;AACzD,MAAM,OAAO,mBAAoB,SAAQ,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAG7E;CAAG;AAEL,wDAAwD;AACxD,MAAM,OAAO,qBAAsB,SAAQ,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAGjF;CAAG;AAEL,iDAAiD;AACjD,MAAM,OAAO,YAAa,SAAQ,IAAI,CAAC,WAAW,CAAC,cAAc,CAG/D;CAAG;AAEL;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,sBAAuB,SAAQ,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAInF;CAAG;AAEL;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,WAAY,SAAQ,IAAI,CAAC,WAAW,CAAC,aAAa,CAK7D;CAAG;AAEL,6CAA6C;AAC7C,MAAM,OAAO,eAAgB,SAAQ,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAIrE;CAAG;AAEL,mEAAmE;AACnE,MAAM,OAAO,oBAAqB,SAAQ,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAO/E;CAAG;AAEL,+DAA+D;AAC/D,MAAM,OAAO,yBAA0B,SAAQ,IA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B,KAAK;QAC7F,8CAA8C,MAAM,CAAC,gBAAgB,SAAS;QAC9E,mBAAmB,MAAM,CAAC,GAAG,4CAA4C;QACzE,0BAA0B,MAAM,CAAC,gBAAgB,4BAA4B;CAChF,CAAC,CAAA;AAEJ;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,sBAAuB,SAAQ,IAAI,CAAC,WAAW,CAAC,wBAAwB,CASnF;CAAG;AAEL;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,MAK1C,EAA0B,EAAE,CAC3B,IAAI,sBAAsB,CAAC;IACzB,GAAG,MAAM;IACT,OAAO,EACL,sBAAsB,MAAM,CAAC,UAAU,2BAA2B,MAAM,CAAC,kBAAkB,IAAI;QAC/F,MAAM,MAAM,CAAC,OAAO,iDAAiD,MAAM,CAAC,UAAU,KAAK;QAC3F,uGAAuG;QACvG,mGAAmG;QACnG,iDAAiD,MAAM,CAAC,kBAAkB,IAAI;CACjF,CAAC,CAAA"}
@@ -6,30 +6,44 @@
6
6
  * the key format; KeyComposer extracts attribute values and delegates.
7
7
  */
8
8
  import type * as DynamoSchema from "./DynamoSchema.js";
9
+ import { type CompositeKeyHoleError } from "./Errors.js";
9
10
  /** Index key part definition (pk or sk of an index) */
10
11
  export interface KeyPart {
11
12
  readonly field: string;
12
13
  readonly composite: ReadonlyArray<string>;
13
14
  }
14
15
  /**
15
- * Per-composite policy value controlling how `Entity.update` and time-series
16
- * `.append` handle a composite attribute that is absent from the merged update
17
- * payload.
16
+ * Per-half policy value controlling how `Entity.update` and time-series
17
+ * `.append` handle a GSI half whose composites are absent from the merged
18
+ * update payload.
18
19
  *
19
- * - `"sparse"` — absent → REMOVE `gsiNpk`/`gsiNsk`; item drops out of the GSI.
20
- * - `"preserve"` — absent → leave the stored GSI key field untouched.
20
+ * - `"sparse"` — when the half's composites are entirely absent (whole-half
21
+ * empty), REMOVE both `gsiNpk` and `gsiNsk` (item drops out of the GSI).
22
+ * On a hole pattern (`[A, _, C]`), truncate the half to the leading prefix
23
+ * `[A]` and ignore trailing values.
24
+ * - `"preserve"` — whole-half-empty is a no-op; the stored values for that
25
+ * half stay intact. On a hole pattern, throw `CompositeKeyHoleError`
26
+ * (EDD-9024) at write time.
21
27
  *
22
- * Attributes not covered by an `indexPolicy` default to `"preserve"`. See
23
- * `DESIGN.md §7 Policy-Aware GSI Composition` for full decision rules.
28
+ * Halves not declared in `indexPolicy` default to `"preserve"`. See
29
+ * `DESIGN.md §7 Policy-Aware GSI Composition` for the full decision rules
30
+ * (structural composition, two drop triggers, decision table).
24
31
  */
25
- export type IndexPolicyAttr = "sparse" | "preserve";
32
+ export type IndexPolicyKey = "sparse" | "preserve";
26
33
  /**
27
- * Function form of an index policy. Receives the merged record
28
- * (`primaryKey + payload` at update time, `primaryKey + appendInput` at append
29
- * time) and returns a per-attribute policy map. Only keys corresponding to
30
- * composite attributes of this GSI are consulted; additional keys are ignored.
34
+ * Per-half index policy declaration. Both halves default to `"preserve"`
35
+ * when omitted (or when `indexPolicy` is omitted entirely from the GSI
36
+ * config).
37
+ *
38
+ * The standard composition path has only payload-level information (no
39
+ * read-before-write), so per-attribute policy callbacks were removed in
40
+ * v3 — within a single half, per-attribute mixing has no coherent semantic
41
+ * because a half is a single concatenated string.
31
42
  */
32
- export type IndexPolicy = (item: Readonly<Record<string, unknown>>) => Partial<Record<string, IndexPolicyAttr>>;
43
+ export interface IndexPolicy {
44
+ readonly pk?: IndexPolicyKey | undefined;
45
+ readonly sk?: IndexPolicyKey | undefined;
46
+ }
33
47
  /** Index definition for primary or secondary index (internal format) */
34
48
  export interface IndexDefinition {
35
49
  readonly index?: string | undefined;
@@ -39,9 +53,9 @@ export interface IndexDefinition {
39
53
  readonly sk: KeyPart;
40
54
  readonly casing?: DynamoSchema.Casing | undefined;
41
55
  /**
42
- * Optional per-composite policy for `Entity.update` and `.append`. Not
43
- * consulted on `put()` — put always omits a GSI's keys when any of its
44
- * composites is missing.
56
+ * Optional per-half policy for `Entity.update` and `.append`. Not consulted
57
+ * on `put()` — put always omits a GSI's keys when any of its composites is
58
+ * missing.
45
59
  */
46
60
  readonly indexPolicy?: IndexPolicy | undefined;
47
61
  }
@@ -59,13 +73,9 @@ export interface GsiConfig {
59
73
  /** Sort key: physical field name + composite attributes. */
60
74
  readonly sk: KeyPart;
61
75
  /**
62
- * Per-composite sparse/preserve policy. Applied by `Entity.update` and
63
- * time-series `.append`. Defaults to `"preserve"` for any composite the
64
- * function does not specify. Not applied on `put()`.
65
- *
66
- * At append-time, returned keys must be members of the `appendInput`
67
- * schema (enforced at `Entity.make()`) — composites owned by other writers
68
- * cannot have policy at append-time, since `.append` cannot touch them.
76
+ * Per-half sparse/preserve policy. Applied by `Entity.update` and
77
+ * time-series `.append`. Defaults to `"preserve"` on each half. Not
78
+ * applied on `put()`. See `DESIGN.md §7 Policy-Aware GSI Composition`.
69
79
  */
70
80
  readonly indexPolicy?: IndexPolicy | undefined;
71
81
  }
@@ -140,30 +150,56 @@ export interface GsiUpdateResult {
140
150
  readonly sets: Record<string, string>;
141
151
  readonly removes: ReadonlyArray<string>;
142
152
  }
153
+ /**
154
+ * Compose a sort key from the leading prefix `[sk_0, ..., sk_(stopBefore-1)]`
155
+ * of an index's SK composites. Used by v3's structural composition rule when a
156
+ * trailing SK composite is absent and the half's `indexPolicy.sk` is
157
+ * `"preserve"` (or absent — defaults to preserve), or when a hole pattern is
158
+ * encountered under `"sparse"`.
159
+ *
160
+ * `stopBefore === 0` produces the bare entity/collection prefix with no
161
+ * composite values (the item still belongs to the GSI but at the broadest
162
+ * scope — `begins_with(sk, "<prefix>")` matches it).
163
+ *
164
+ * See `DESIGN.md §7 Policy-Aware GSI Composition`.
165
+ */
166
+ export declare const composeSkPrefixUpTo: (schema: DynamoSchema.DynamoSchema, entityType: string, entityVersion: number, index: IndexDefinition, record: Record<string, unknown>, stopBefore: number) => string;
143
167
  /**
144
168
  * Policy-aware GSI key composition for `Entity.update` and time-series
145
- * `.append`.
146
- *
147
- * Each touched GSI is resolved via its `indexPolicy` (if any) and returns a
148
- * combination of SET and REMOVE operations for the index's key fields. See
149
- * `DESIGN.md §7 Policy-Aware GSI Composition` for the full decision table.
150
- *
151
- * Rules (per touched GSI):
152
- * 1. **Cascade (REMOVE of a composite attr)** — any composite in `removedSet`
153
- * forces REMOVE of both key fields, overriding `indexPolicy`.
154
- * 2. **Sparse wins** — if any composite is absent and its policy is `"sparse"`,
155
- * REMOVE both key fields.
156
- * 3. **Full recompose** — if all composites are present, SET both halves.
157
- * 4. **Mixed (some `"preserve"` absent, no `"sparse"` absent)** — evaluate pk
158
- * and sk independently: the half whose composites are all present is SET;
159
- * the half missing a preserve attr is left alone (no SET, no REMOVE).
169
+ * `.append` — v3 per-half structural composition.
170
+ *
171
+ * Implements two-way payload classification:
172
+ * - **present** (`attr: <value>` in payload, or inherited from `keyRecord`)
173
+ * — value is used in composition.
174
+ * - **absent** (key omitted, or `attr: null`, or `attr: undefined`) — the
175
+ * structural rule treats all three identically.
176
+ *
177
+ * For each touched GSI half (PK and SK independently), walk the composite
178
+ * list left-to-right and build the longest valid leading prefix. Policy is
179
+ * consulted only for the hole pattern (truncate under sparse, throw EDD-9024
180
+ * under preserve) and the whole-half-empty case (drop both keys under
181
+ * sparse, no-op under preserve).
182
+ *
183
+ * Cascade (`Entity.remove([attr])`) overrides everything: any composite in
184
+ * `removedSet` forces a full GSI drop (REMOVE both `gsiNpk` and `gsiNsk`).
160
185
  *
161
186
  * A GSI is considered "touched" when any of its composites appears in
162
- * `updatePayload` or `removedSet`. Untouched GSIs are skipped.
187
+ * `updatePayload`, or `removedSet`. GSIs without an `indexPolicy` are skipped
188
+ * when none of their composites are touched. GSIs with a policy are always
189
+ * evaluated — the policy is a declarative statement about the GSI's
190
+ * membership invariant.
191
+ *
192
+ * See `DESIGN.md §7 Policy-Aware GSI Composition` for the full decision
193
+ * algorithm, decision table, and the two-drop-trigger framing.
194
+ *
195
+ * @throws {CompositeKeyHoleError} EDD-9024 on hole-pattern detection under
196
+ * `'preserve'` policy.
163
197
  */
164
198
  export declare const composeGsiKeysForUpdatePolicyAware: (schema: DynamoSchema.DynamoSchema, entityType: string, entityVersion: number, indexes: Record<string, IndexDefinition>, updatePayload: Record<string, unknown>, keyRecord: Record<string, unknown>, options?: {
165
199
  readonly removedSet?: ReadonlySet<string> | undefined;
166
200
  }) => GsiUpdateResult;
201
+ /** @internal — re-export for documentation cross-reference. */
202
+ export type { CompositeKeyHoleError };
167
203
  /**
168
204
  * Compose a partial sort key prefix for query operations.
169
205
  * Used when not all SK composite attributes are provided.
@@ -1 +1 @@
1
- {"version":3,"file":"KeyComposer.d.ts","sourceRoot":"","sources":["../src/KeyComposer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAStD,uDAAuD;AACvD,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CAC1C;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,CACxB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KACpC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAA;AAE7C,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IAChE,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,SAAS,CAAA;IACpD,QAAQ,CAAC,EAAE,E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