effect-dynamodb 1.42.0 → 1.42.2

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.
@@ -107,7 +107,8 @@ export interface ListOptions<Model = Record<string, unknown>> {
107
107
  * number has no text prefix: on a numeric composite it matches the whole value, as without the
108
108
  * option. A date (any composite whose schema transforms its value) is read as a whole value of
109
109
  * its type, so this is for text composites. With no list sort key composite given, it changes
110
- * nothing.
110
+ * nothing, and neither does it when a value is given after a composite left out: such a value
111
+ * is matched whole, by its key text, as it would be in the key.
111
112
  */
112
113
  readonly prefix?: boolean;
113
114
  }
@@ -227,7 +228,14 @@ export interface Aggregate<TSchema extends Schema.Top, TKey extends Record<strin
227
228
  * Requires `list` config on the aggregate. Queries the list collection GSI using
228
229
  * filter as key composites. PK composites are required (or empty for shared
229
230
  * partition); leading SK composites narrow the list to those values, each
230
- * matched whole, or the last one as a prefix with `options.prefix`.
231
+ * matched whole, or the last one as a prefix with `options.prefix`. A value
232
+ * given after an SK composite left out can't be in the key condition, and
233
+ * matches a root row as it would there: where the key text composed from it
234
+ * is the text composed from the row's value (the schema's casing, `escapeKeys`,
235
+ * number and date key text alike), whole. A number, or any value under a
236
+ * casing that doesn't fold text, is compared in the root-item
237
+ * `FilterExpression`; text under a folding casing (the default `lowercase`) is
238
+ * matched on the root items read, before any is assembled.
231
239
  *
232
240
  * Supports cursor-based pagination via `options.limit` and `options.cursor`.
233
241
  * When `limit` is specified, returns at most that many aggregates plus a cursor
@@ -1 +1 @@
1
- {"version":3,"file":"Aggregate.d.ts","sourceRoot":"","sources":["../src/Aggregate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,MAAM,IAAI,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAEtF,OAAO,KAAK,WAAW,MAAM,wCAAwC,CAAA;AACrE,OAAO,KAAK,KAAK,kBAAkB,MAAM,yCAAyC,CAAA;AAQlF,OAAO,EACL,sBAAsB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IACxB,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC3C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC,YAAY,CAAA;IAChD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IACtC,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CACtF;AA0UD;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,WAAW,OAAO,EAClB,SAAS,aAAa,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,EAC3E,WAAW,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,KACrC;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SA+BjF,CAAA"}
package/dist/Aggregate.js CHANGED
@@ -13,7 +13,7 @@ import * as DynamoModel from "@effect-dynamodb/schema/DynamoModel.js";
13
13
  import { composeCollectionKey, composeKey, composeUniqueKey, KEY_DELIMITER, } from "@effect-dynamodb/schema/DynamoSchema.js";
14
14
  import { AggregateAssemblyError, AggregateDecompositionError, AggregateTransactionOverflow, ConditionalCheckFailed, DynamoError, DynamoValidationError, isAwsTransactionCancelled, RefNotFound, TRANSACT_WRITE_ITEMS_LIMIT, TransactionCancelled, ValidationError, } from "@effect-dynamodb/schema/Errors.js";
15
15
  import { fieldAtPath, kindReadingOf, kindTargets, makeCompositeKeyForm, readBackAs, readBackUnsure, readsBackOtherwise, refuseInexact, storedNaNKeyForm, toCompositeKeyRecord, } from "@effect-dynamodb/schema/internal/CompositeCodec.js";
16
- import { buildDateTransform, containedKindOf, containedOperand, containsWireTransform, matchDateRepresentation, optionalField, refHeldTarget, resolveSystemFields, substituteSchemaDeep, validateNoTransformOverride, } from "@effect-dynamodb/schema/internal/EntitySchemas.js";
16
+ import { buildDateTransform, containedKindOf, containedOperand, containsWireTransform, entityRefsOf, heldRefMember, keepsAsGiven, matchDateRepresentation, optionalField, refHeldTarget, resolveSystemFields, substituteSchemaDeep, unionHoldsRef, validateNoTransformOverride, } from "@effect-dynamodb/schema/internal/EntitySchemas.js";
17
17
  import { failingAsBefore, issueDecoding } from "@effect-dynamodb/schema/internal/FailingAsBefore.js";
18
18
  import { readingInstances } from "@effect-dynamodb/schema/internal/InstanceReads.js";
19
19
  import { keyReadings } from "@effect-dynamodb/schema/internal/KeyReadings.js";
@@ -34,7 +34,7 @@ import { entityNaming } from "./internal/BoundQuery.js";
34
34
  import * as Capacity from "./internal/Capacity.js";
35
35
  import { decodeKeyCursor, encodeKeyCursor } from "./internal/Cursor.js";
36
36
  import { digest } from "./internal/Digest.js";
37
- import { compileExpr, createConditionOps, emptyPartProblem, isEmptyExpr, isPrimitiveOperand, parseSimpleShorthand, } from "./internal/Expr.js";
37
+ import { and as andExpr, compileExpr, createConditionOps, emptyPartProblem, isEmptyExpr, parseSimpleShorthand, } from "./internal/Expr.js";
38
38
  import { asReadGuard, preferredGuard, wholeRowGuard, } from "./internal/ExpressionLimits.js";
39
39
  import { packRequests, transactWriteShape, transactWriteUnit } from "./internal/ItemSize.js";
40
40
  import { hasStoredForm, packItemSync, unpackItemSync, withRegistry } from "./internal/Packed.js";
@@ -850,6 +850,58 @@ const validateNestedDiscriminators = (aggregateName, edges, inherited = new Map(
850
850
  validateNestedDiscriminators(aggregateName, bound.aggregate.edges, next, here);
851
851
  }
852
852
  };
853
+ /**
854
+ * Whether the walker re-points a ref field within the wrapper its model declares: the ref itself, or
855
+ * `Schema.optional` / `Schema.optionalKey` directly around it, which it re-applies. Not a union
856
+ * (`NullOr`, one with other members, `optionalKey` over one), which it would replace whole.
857
+ */
858
+ const keepsWrapper = (field) => {
859
+ const optional = optionalField(field);
860
+ return optional === undefined
861
+ ? !SchemaAST.isUnion(field.ast)
862
+ : optional.union === undefined && !SchemaAST.isUnion(optional.inner.ast);
863
+ };
864
+ /** What a field holds beneath the `Schema.optional` / `Schema.optionalKey` wrapper it declares. */
865
+ const beneathOptional = (field) => {
866
+ const optional = optionalField(field);
867
+ return optional?.union ?? optional?.inner ?? field;
868
+ };
869
+ /**
870
+ * A ref declared in a union (`Schema.NullOr(DynamoModel.ref(Team))`, `Schema.NullOr(Team.annotate(…))`),
871
+ * beneath an optional wrapper or not, as an entity's read holds it, where that union is walked member
872
+ * by member ({@link unionHoldsRef}): the union, each member that holds the ref taken as
873
+ * {@link heldRefMember} takes it (what a read of the ref's entity returns, where the walker can't see
874
+ * into the member), in a union among the members too, and every other member as declared.
875
+ * `undefined` where that changes no member, or the union isn't walked so. The walker re-applies the
876
+ * optional wrapper.
877
+ */
878
+ const heldInUnion = (field, model) => {
879
+ const union = beneathOptional(field);
880
+ if (!SchemaAST.isUnion(union.ast) || !unionHoldsRef(union, model))
881
+ return undefined;
882
+ const held = (schema) => {
883
+ const members = schema.members;
884
+ if (!SchemaAST.isUnion(schema.ast) || members === undefined)
885
+ return undefined;
886
+ const each = members.map((member) => held(member) ?? heldRefMember(member, model) ?? member);
887
+ return each.every((member, at) => member === members[at])
888
+ ? undefined
889
+ : Schema.Union(each);
890
+ };
891
+ return held(union);
892
+ };
893
+ /**
894
+ * Whether the walker, given a ref field as its model declares it, holds the ref as a read of the
895
+ * ref's entity does: a union holding a member taken for the ref ({@link unionHoldsRef}, which
896
+ * {@link heldInUnion} re-points where it must), or a member {@link heldRefMember} takes as declared
897
+ * (the model's class itself, which the walker walks).
898
+ */
899
+ const walkerHoldsRef = (field, model) => {
900
+ const value = beneathOptional(field);
901
+ return SchemaAST.isUnion(value.ast)
902
+ ? unionHoldsRef(value, model)
903
+ : heldRefMember(value, model) === value;
904
+ };
853
905
  const unwrapEntityModel = (model) => DynamoModel.isConfiguredModel(model) ? model.model : model;
854
906
  /**
855
907
  * Map each ref FIELD SCHEMA the aggregate's schema walker cannot see into to the
@@ -874,7 +926,7 @@ const unwrapEntityModel = (model) => DynamoModel.isConfiguredModel(model) ? mode
874
926
  * re-pointed at `Schema.Array(<entity model>)`, since the walker can only
875
927
  * re-point fields, not array elements;
876
928
  * - **refs nested inside an edge entity's own model** (`maker` on a `supplier`
877
- * edge entity, #116).
929
+ * edge entity, #116), and in their entities' models in turn.
878
930
  *
879
931
  * Keyed by schema IDENTITY. The resolver is consulted at every depth of the
880
932
  * walk, so the former name-keyed table re-pointed every same-named field
@@ -910,13 +962,57 @@ const collectRefTargets = (rootFields, rootEdges) => {
910
962
  if (held !== inner)
911
963
  targets.set(field, held);
912
964
  };
965
+ // Edge entities, in the walk's order, whose models' refs `registerHeldRefs` takes after the walk.
966
+ const edgeEntities = [];
967
+ // 1.42.1's registration of an edge entity's refs, made where and as 1.42.1 made it: a pure
968
+ // definition's own (`_data.resolvedRefs`, one level down), each field replaced whole by its target.
969
+ // Left out only where the walker holds the ref as the field declares it (`walkerHoldsRef`).
913
970
  const registerNested = (entity) => {
914
971
  if (entity?.model === undefined)
915
972
  return;
916
- const entityFields = getSchemaFields(unwrapEntityModel(entity.model));
917
- for (const nested of entity._data?.resolvedRefs ?? []) {
918
- register(ownValue(entityFields, nested.fieldName), nested.refEntity?.model, false);
973
+ const fields = getSchemaFields(unwrapEntityModel(entity.model));
974
+ for (const ref of entity._data?.resolvedRefs ?? []) {
975
+ const field = ownValue(fields, ref.fieldName);
976
+ const target = ref.refEntity?.model;
977
+ if (field !== undefined && target !== undefined) {
978
+ if (!walkerHoldsRef(field, unwrapEntityModel(target)))
979
+ register(field, target, false);
980
+ }
919
981
  }
982
+ edgeEntities.push(entity);
983
+ };
984
+ // Then the refs of an edge entity's model, and of their entities' models in turn (`entityRefsOf`),
985
+ // into fields still unregistered: a read of the edge entity holds each as a read of its own entity
986
+ // returns it. One the walker can't see into (a declaration without fields, a `Schema.suspend`) is
987
+ // registered, a class only where its read holds less (`registerHeld`), as for an edge, within the
988
+ // wrapper its model declares (`keepsWrapper`); in a union, the members that hold the ref
989
+ // (`heldInUnion`). Up to 1.42.1 an entity made with this package's `Entity.make` had none
990
+ // registered, so a `DynamoModel.ref` in its model stored a date as a marshalled map. A ref back to
991
+ // a model on the way (A → B → A) isn't followed.
992
+ const registerHeldRefs = (entity) => {
993
+ const nested = (model, refs, on) => {
994
+ const fields = getSchemaFields(model);
995
+ for (const [name, held] of Object.entries(refs)) {
996
+ if (on.has(held.model))
997
+ continue;
998
+ const field = ownValue(fields, name);
999
+ if (field !== undefined && keepsWrapper(field)) {
1000
+ if (isOpaqueRefField(field) || SchemaAST.isSuspend(unwrapOptionalField(field).ast)) {
1001
+ register(field, held.model, false);
1002
+ }
1003
+ else
1004
+ registerHeld(field);
1005
+ }
1006
+ else if (field !== undefined && !targets.has(field)) {
1007
+ const union = heldInUnion(field, held.model);
1008
+ if (union !== undefined)
1009
+ targets.set(field, union);
1010
+ }
1011
+ nested(held.model, held.refs, new Set([...on, held.model]));
1012
+ }
1013
+ };
1014
+ const model = unwrapEntityModel(entity.model);
1015
+ nested(model, entityRefsOf(entity), new Set([model]));
920
1016
  };
921
1017
  const walk = (fields, edges, isRoot, heldOnly) => {
922
1018
  for (const [edgeName, edge] of Object.entries(edges)) {
@@ -985,6 +1081,8 @@ const collectRefTargets = (rootFields, rootEdges) => {
985
1081
  }
986
1082
  };
987
1083
  walk(rootFields, rootEdges, true, false);
1084
+ for (const entity of edgeEntities)
1085
+ registerHeldRefs(entity);
988
1086
  return targets;
989
1087
  };
990
1088
  /**
@@ -1169,13 +1267,12 @@ const makeAggregate = (schema, config) => {
1169
1267
  * schema's. The value itself where the field has no encoder or it doesn't take the value, or
1170
1268
  * what it gives DynamoDB can't store, and at a nested path (the encoders are per attribute). A
1171
1269
  * list filter's operand that is one of Effect's instances or a `Date` is sent in this form
1172
- * (`operandsAsStored`).
1270
+ * (`operandsAsStored`), and so is a primitive the row stores as a primitive of another type (`5`
1271
+ * where a `Schema.NumberFromString` stores `"5"`), as an entity's operand is (`keepsAsGiven`):
1272
+ * up to 1.42.1 every primitive was sent as given, and compared with that field matched nothing.
1273
+ * Text where text is stored could be a substring or a prefix, so it is still sent as given.
1173
1274
  */
1174
1275
  const rootStoredFormAt = (segments, value, kind) => {
1175
- // A primitive is sent as given, as up to 1.41.0: the root's encoders don't tell a value the
1176
- // attribute stores as another type from one it doesn't, as an entity's `operand` does.
1177
- if (isPrimitiveOperand(value))
1178
- return value;
1179
1276
  const name = String(segments[0]);
1180
1277
  const encode = segments.length === 1 ? attrEncoders[name] : undefined;
1181
1278
  const field = schemaFields?.[name];
@@ -1199,7 +1296,30 @@ const makeAggregate = (schema, config) => {
1199
1296
  const list = storedOf([element])?.stored;
1200
1297
  return Array.isArray(list) && list.length === 1 ? { stored: list[0] } : undefined;
1201
1298
  })(value);
1202
- return stored === undefined ? value : stored.stored;
1299
+ return stored === undefined || keepsAsGiven(value, stored.stored) ? value : stored.stored;
1300
+ };
1301
+ /**
1302
+ * What a write of `value` in the root field `name` stores on the root row: its attribute
1303
+ * encoder's form, as `create` stores it, or the value itself where the field has no encoder.
1304
+ * Undefined where the encoder doesn't take the value or gives what DynamoDB can't store. A list
1305
+ * key's value after a gap is a whole value, so where it can be it's compared with this (`list`),
1306
+ * where a filter operand could be a substring or a prefix and keeps text as given
1307
+ * (`rootStoredFormAt`).
1308
+ */
1309
+ const rootStoredValue = (name, value) => {
1310
+ const encode = ownValue(attrEncoders, name);
1311
+ if (encode === undefined)
1312
+ return { stored: value };
1313
+ let asGiven = false;
1314
+ try {
1315
+ const stored = encode(value, () => {
1316
+ asGiven = true;
1317
+ });
1318
+ return asGiven || unstorableIn({ stored }) !== undefined ? undefined : { stored };
1319
+ }
1320
+ catch {
1321
+ return undefined;
1322
+ }
1203
1323
  };
1204
1324
  // Decode schema for read/assemble + input validation. Mirrors the raw `schema`
1205
1325
  // but recursively substitutes EVERY date / Redacted / transformed leaf — root
@@ -1393,10 +1513,11 @@ const makeAggregate = (schema, config) => {
1393
1513
  // assembly decodes the root row. `create` composes the key from the value it holds, so a key
1394
1514
  // composed again from a stored row (`list`, `rekey`) is composed from these, never from the
1395
1515
  // stored form: a transformation that isn't its own inverse on the other side (a value stored
1396
- // divided by ten, an `Option` holding one) keys the stored form elsewhere.
1397
- const decodeRootKey = (() => {
1516
+ // divided by ten, an `Option` holding one) keys the stored form elsewhere. The list sort key's
1517
+ // composites are read the same way where `list` matches a value given after a gap (`gapMatch`).
1518
+ const decodeAsRead = (attrs) => {
1398
1519
  const fields = {};
1399
- for (const attr of config.pk.composite) {
1520
+ for (const attr of attrs) {
1400
1521
  const field = ownValue(schemaFields, attr);
1401
1522
  if (field !== undefined)
1402
1523
  setOwn(fields, attr, field);
@@ -1407,7 +1528,53 @@ const makeAggregate = (schema, config) => {
1407
1528
  resolveRef,
1408
1529
  absentReads: true,
1409
1530
  }));
1410
- })();
1531
+ };
1532
+ const decodeRootKey = decodeAsRead(config.pk.composite);
1533
+ // A list sort key composite's value as a read takes it, one composite at a time (built when
1534
+ // first asked): `list` reads only the composites a key gives after a gap, so a row from an index
1535
+ // that doesn't project the others is still matched.
1536
+ const listCompositeReads = new Map();
1537
+ const readListComposite = (row, attr) => {
1538
+ const stored = ownValue(row, attr);
1539
+ if (stored == null)
1540
+ return undefined;
1541
+ let read = listCompositeReads.get(attr);
1542
+ if (read === undefined) {
1543
+ read = decodeAsRead([attr]);
1544
+ listCompositeReads.set(attr, read);
1545
+ }
1546
+ const given = {};
1547
+ setOwn(given, attr, stored);
1548
+ const value = read(given);
1549
+ return Option.isSome(value) ? ownValue(value.value, attr) : undefined;
1550
+ };
1551
+ /**
1552
+ * Does a root row `list` read hold, for each composite named, the key text given? Its text is the
1553
+ * one `create` composed into its list sort key: its value as a read takes it, through the key
1554
+ * encoder and the key form. Only the composites named are read. A row without a readable value
1555
+ * for one (the index doesn't project it, or a read can't take what it holds) has no such text,
1556
+ * so it's neither kept nor dropped: the call is refused (`EDD-9168`).
1557
+ */
1558
+ const listGapMatch = (texts) => (row) => {
1559
+ const keyed = {};
1560
+ for (const [attr] of texts) {
1561
+ const value = readListComposite(row, attr);
1562
+ if (value == null) {
1563
+ throw new KeyValueError({
1564
+ value: ownValue(row, attr),
1565
+ reason: `the list index row holds no readable value for "${attr}"`,
1566
+ message: `[EDD-9168] Aggregate "${aggregateName}" list: the list index row of a root item ` +
1567
+ `holds no readable value for "${attr}", a list sort key composite given after a ` +
1568
+ `gap, so it has no key text to match against. Project "${attr}" onto the list ` +
1569
+ "index, or give the key without the gap. Nothing was returned.",
1570
+ });
1571
+ }
1572
+ const encode = ownValue(keyAttrEncoders, attr);
1573
+ setOwn(keyed, attr, encode !== undefined ? encode(value) : value);
1574
+ }
1575
+ const composites = keyRecord(keyed);
1576
+ return texts.every(([attr, text]) => KeyComposer.keyValueText(config.schema, ownValue(composites, attr), config.schema.casing) === text);
1577
+ };
1411
1578
  /**
1412
1579
  * `row` (a stored root row) with its partition key composites as a read takes them. A row whose
1413
1580
  * composites a read can't take is left as it is: its key composes as the stored form does, and its
@@ -3657,10 +3824,10 @@ const makeAggregate = (schema, config) => {
3657
3824
  const listConfig = config.list;
3658
3825
  const limit = options?.limit;
3659
3826
  const pageSize = options?.pageSize;
3660
- // Root-item FilterExpression. Compiled once — the same two forms
3661
- // `BoundQuery.filter()` takes, through the same `Expr` compiler, so
3662
- // there is one filter vocabulary rather than a second dialect here.
3663
- const rootFilter = yield* compileListFilter(options?.filter, aggregateName, rootStoredFormAt, storedBelowFields(schemaFields), schema);
3827
+ // Root-item FilterExpression — the same two forms `BoundQuery.filter()` takes, through
3828
+ // the same `Expr` compiler, so there is one filter vocabulary rather than a second dialect
3829
+ // here. Compiled below, with the key's values after a gap.
3830
+ const userFilter = yield* listFilterExpr(options?.filter, aggregateName, schema);
3664
3831
  // Attribute names that make up a resume key on the list index: the index
3665
3832
  // key plus the table key. A `LastEvaluatedKey` supplies them when there
3666
3833
  // is one; this is the fallback for the case a filtered request over-reads
@@ -3689,11 +3856,56 @@ const makeAggregate = (schema, config) => {
3689
3856
  break; // Stop at first gap (prefix matching)
3690
3857
  }
3691
3858
  const skComplete = skValues.length === listConfig.sk.composite.length;
3859
+ // A value for a composite after the first one not given can't be in the key condition,
3860
+ // which holds only the leading values. It matches a row as it would there: where the key
3861
+ // text composed from it is the text composed from the row's value for that composite
3862
+ // (up to 1.42.1 it was dropped, and the list returned aggregates of every value there).
3863
+ // Where comparing the stored attribute is that test (a casing that doesn't fold text, or
3864
+ // a number, whose key text is a function of it), the value is compared in the root-item
3865
+ // filter with what a write of it stores (`rootStoredValue`). Otherwise DynamoDB can't
3866
+ // compare it: the root items read are matched on their key text (`gapMatch`), before
3867
+ // any is assembled, which reads the same capacity as a filter.
3868
+ const afterGap = [];
3869
+ const gapTexts = [];
3870
+ for (const attr of listConfig.sk.composite.slice(skValues.length)) {
3871
+ const keyForm = ownValue(listSkFilter, attr);
3872
+ if (keyForm === undefined)
3873
+ continue;
3874
+ const value = rootStoredValue(attr, givenEntry(filter ?? {}, attr)?.value);
3875
+ if (value !== undefined &&
3876
+ (config.schema.casing === "preserve" || !KeyComposer.matchesTextPrefix(keyForm))) {
3877
+ afterGap.push(parseSimpleShorthand({ [attr]: value.stored }));
3878
+ }
3879
+ else {
3880
+ gapTexts.push([
3881
+ attr,
3882
+ KeyComposer.keyValueText(config.schema, keyForm, config.schema.casing),
3883
+ ]);
3884
+ }
3885
+ }
3886
+ const gapMatch = gapTexts.length === 0 ? undefined : listGapMatch(gapTexts);
3887
+ const filterBy = options?.filterBy;
3888
+ const accept = gapMatch === undefined || filterBy === undefined
3889
+ ? (gapMatch ?? filterBy)
3890
+ : (row) => gapMatch(row) && filterBy(row);
3891
+ // A value no condition can compare (`NaN`) is refused as a filter's is, nothing sent.
3892
+ const gapProblem = afterGap.length === 0 ? undefined : emptyPartProblem(andExpr(...afterGap));
3893
+ if (gapProblem !== undefined) {
3894
+ return yield* new ValidationError({
3895
+ entityType: aggregateName,
3896
+ operation: "list",
3897
+ cause: `Aggregate "${aggregateName}" list key: ${gapProblem} Nothing was sent.`,
3898
+ });
3899
+ }
3900
+ const rootFilter = compileListFilter(afterGap, userFilter, rootStoredFormAt, storedBelowFields(schemaFields));
3692
3901
  // `prefix: true` matches the last value given as a prefix of its key text, unless it's a
3693
3902
  // number, which has no text prefix and is matched whole (`matchesTextPrefix`, the rule
3694
- // an entity's `.where()` `beginsWith` follows).
3903
+ // an entity's `.where()` `beginsWith` follows), or it sits after a gap, where every value
3904
+ // is matched whole.
3695
3905
  const lastGiven = listConfig.sk.composite[skValues.length - 1];
3696
3906
  const skPrefix = options?.prefix === true &&
3907
+ afterGap.length === 0 &&
3908
+ gapTexts.length === 0 &&
3697
3909
  lastGiven !== undefined &&
3698
3910
  KeyComposer.matchesTextPrefix(ownValue(listSkFilter, lastGiven));
3699
3911
  let rootItems;
@@ -3731,7 +3943,7 @@ const makeAggregate = (schema, config) => {
3731
3943
  limit,
3732
3944
  pageSize,
3733
3945
  filter: rootFilter,
3734
- accept: options?.filterBy,
3946
+ accept,
3735
3947
  reverse: options?.reverse === true,
3736
3948
  keyFields: listKeyFields,
3737
3949
  }, aggregateName));
@@ -3764,7 +3976,7 @@ const makeAggregate = (schema, config) => {
3764
3976
  pageSize,
3765
3977
  startKey,
3766
3978
  filter: rootFilter,
3767
- accept: options?.filterBy,
3979
+ accept,
3768
3980
  reverse: options?.reverse === true,
3769
3981
  keyFields: listKeyFields,
3770
3982
  }, aggregateName);
@@ -6511,7 +6723,7 @@ const DELETE_BASE_DELAY_MS = 100;
6511
6723
  // Internal: list filter compilation
6512
6724
  // ---------------------------------------------------------------------------
6513
6725
  /**
6514
- * @internal Compile a {@link ListFilter} to a `FilterExpression` fragment.
6726
+ * @internal A {@link ListFilter} as an expression, `undefined` for one that asserts nothing.
6515
6727
  *
6516
6728
  * Both forms route through the same `Expr` compiler `BoundQuery.filter()` uses,
6517
6729
  * so `{ status: "shipped" }` and `(t, { eq }) => eq(t.status, "shipped")` mean
@@ -6520,10 +6732,9 @@ const DELETE_BASE_DELAY_MS = 100;
6520
6732
  * empty part directly under `and` is left out, and one anywhere else — or an
6521
6733
  * `or()` with no parts — is refused with a `ValidationError` before anything
6522
6734
  * is sent. An `isIn` with no values is sent, and DynamoDB's rejection of its
6523
- * `IN ()` diagnosed (#144). Each path is named as an entity query's filter names it (#238): below
6524
- * a field, a struct that renames its keys as it's stored is named by its stored names (`below`).
6735
+ * `IN ()` diagnosed (#144).
6525
6736
  */
6526
- const compileListFilter = (filter, aggregateName, storedAt, below,
6737
+ const listFilterExpr = (filter, aggregateName,
6527
6738
  /** The aggregate's model: a callback's `.entry()` resolves on its sparse maps (`pathBuilderOf`). */
6528
6739
  model) => {
6529
6740
  if (filter === undefined)
@@ -6539,10 +6750,23 @@ model) => {
6539
6750
  cause: `list filter: ${problem} Nothing was sent.`,
6540
6751
  }));
6541
6752
  }
6542
- // Its operands in the form the root row holds (#242), named as an entity query's filter names
6543
- // them (#238).
6544
- const named = entityNaming(undefined, storedAt, undefined, below).renameExpr?.(expr) ?? expr;
6545
- return Effect.succeed(isEmptyExpr(expr) ? undefined : compileExpr(named));
6753
+ return Effect.succeed(isEmptyExpr(expr) ? undefined : expr);
6754
+ };
6755
+ /**
6756
+ * @internal The root-item `FilterExpression` of a list: the key's conditions on the values after a
6757
+ * gap (their operands already in the root row's stored form), then the list's own `filter`, ANDed,
6758
+ * or none. The filter's operands are sent in the form the root row holds them (#242), and each of
6759
+ * its paths named as an entity query's filter names it (#238): below a field, a struct that renames
6760
+ * its keys as it's stored is named by its stored names (`below`).
6761
+ */
6762
+ const compileListFilter = (keyParts, filter, storedAt, below) => {
6763
+ const named = filter === undefined
6764
+ ? undefined
6765
+ : (entityNaming(undefined, storedAt, undefined, below).renameExpr?.(filter) ?? filter);
6766
+ const parts = named === undefined ? keyParts : [...keyParts, named];
6767
+ if (parts.length === 0)
6768
+ return undefined;
6769
+ return compileExpr(parts.length === 1 ? parts[0] : andExpr(...parts));
6546
6770
  };
6547
6771
  /**
6548
6772
  * @internal DynamoDB `Limit` for the next request — the same rule `Query.ts`