@contember/bindx 0.1.52 → 0.1.53

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 (49) hide show
  1. package/dist/core/ActionDispatcher.d.ts.map +1 -1
  2. package/dist/core/EntityLoader.d.ts +7 -0
  3. package/dist/core/EntityLoader.d.ts.map +1 -1
  4. package/dist/core/actions.d.ts +1 -2
  5. package/dist/core/actions.d.ts.map +1 -1
  6. package/dist/dataview/types.d.ts +6 -6
  7. package/dist/dataview/types.d.ts.map +1 -1
  8. package/dist/handles/EntityHandle.d.ts.map +1 -1
  9. package/dist/handles/HasManyListHandle.d.ts +8 -0
  10. package/dist/handles/HasManyListHandle.d.ts.map +1 -1
  11. package/dist/handles/HasOneHandle.d.ts.map +1 -1
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/store/HasManyStore.d.ts +94 -78
  15. package/dist/store/HasManyStore.d.ts.map +1 -1
  16. package/dist/store/RelationStore.d.ts +21 -12
  17. package/dist/store/RelationStore.d.ts.map +1 -1
  18. package/dist/store/ResponseOccurrenceIndex.d.ts +65 -0
  19. package/dist/store/ResponseOccurrenceIndex.d.ts.map +1 -0
  20. package/dist/store/SnapshotStore.d.ts +49 -14
  21. package/dist/store/SnapshotStore.d.ts.map +1 -1
  22. package/dist/store/hasManyState.d.ts +164 -0
  23. package/dist/store/hasManyState.d.ts.map +1 -0
  24. package/dist/store/relationKey.d.ts +11 -0
  25. package/dist/store/relationKey.d.ts.map +1 -1
  26. package/dist/undo/UndoJournal.d.ts.map +1 -1
  27. package/dist/undo/rekeyJournalEntry.d.ts +4 -4
  28. package/dist/undo/rekeyJournalEntry.d.ts.map +1 -1
  29. package/dist/utils/aliasGenerator.d.ts +1 -1
  30. package/dist/utils/aliasGenerator.d.ts.map +1 -1
  31. package/package.json +2 -2
  32. package/src/core/ActionDispatcher.ts +0 -1
  33. package/src/core/EntityLoader.ts +7 -0
  34. package/src/core/actions.ts +1 -3
  35. package/src/dataview/types.ts +6 -6
  36. package/src/handles/EntityHandle.ts +11 -0
  37. package/src/handles/HasManyListHandle.ts +15 -17
  38. package/src/handles/HasOneHandle.ts +4 -2
  39. package/src/index.ts +6 -0
  40. package/src/store/HasManyStore.ts +312 -488
  41. package/src/store/RelationStore.ts +60 -24
  42. package/src/store/ResponseOccurrenceIndex.ts +224 -0
  43. package/src/store/SnapshotStore.ts +144 -73
  44. package/src/store/hasManyState.ts +408 -0
  45. package/src/store/relationKey.ts +17 -0
  46. package/src/undo/UndoJournal.ts +3 -1
  47. package/src/undo/UndoManager.ts +1 -1
  48. package/src/undo/rekeyJournalEntry.ts +31 -43
  49. package/src/utils/aliasGenerator.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"RelationStore.d.ts","sourceRoot":"","sources":["../../src/store/RelationStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAEN,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAIN,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,MAAM,mBAAmB,CAAA;AAG1B,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,YAAY,EACX,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GAClB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAE5D,MAAM,MAAM,4BAA4B,GAAG,SAAS,GAAG,UAAU,CAAA;AAEjE;;;;;;;;;;;GAWG;AACH,qBA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AC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC;IAItE,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAIpE,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,MAAM,EAAE;IAIxE,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,MAAM,EAAE;IAMtE;;;OAGG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAKnD;;;;OAIG;IACH,KAAK,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI;IAK9B;;OAEG;IACH,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAK5D;;OAEG;IACH,KAAK,IAAI,IAAI;CAIb"}
@@ -0,0 +1,65 @@
1
+ import type { SelectionMeta } from '../selection/types.js';
2
+ /** The schema knowledge the index needs: where a relation points and whether it is a list. */
3
+ export interface RelationTargetResolver {
4
+ getRelationTarget(entityType: string, fieldName: string): string | undefined;
5
+ isHasMany(entityType: string, fieldName: string): boolean;
6
+ }
7
+ type EntityRecord = Record<string, unknown>;
8
+ /**
9
+ * Unites the occurrences of one entity within a single server response.
10
+ *
11
+ * One query can reach the same entity through several paths, each with its own
12
+ * sub-selection (`article.attachments` next to `article.sections.article.attachments`).
13
+ * Every occurrence is later written into the entity's snapshot, so without this
14
+ * the narrower one could replace fields the wider one carried. Occurrences of
15
+ * one response are equally fresh, so they are merged without any recency rule:
16
+ * each maps to the union of all of them, keyed by entity type and id. A scalar two
17
+ * occurrences disagree on (which one server read should not produce) takes the
18
+ * value of the occurrence visited last. The response is walked breadth first,
19
+ * relations in selection order and list items in list order, so the outcome
20
+ * follows from the response and the selection alone.
21
+ *
22
+ * The union is shallow. A relation value in it is one occurrence's raw value, and
23
+ * the related entities inside it resolve to their own unions when they are
24
+ * written, so relations inside relations unite level by level without rewriting
25
+ * the response.
26
+ *
27
+ * Reads never merge across responses: a later read replaces what an earlier one
28
+ * stored, as before.
29
+ */
30
+ export declare class ResponseOccurrenceIndex {
31
+ private readonly unions;
32
+ /**
33
+ * Indexes a response read for `entityType` with `selection`. The type of every
34
+ * nested occurrence comes from the schema through the selection's field names;
35
+ * an occurrence whose type cannot be resolved is left out rather than matched
36
+ * by id alone.
37
+ *
38
+ * Occurrences of one type at one selection node carry the same fields, so
39
+ * their union changes nothing. Only types the selection reaches at two or more
40
+ * nodes are collected, only the relations leading to them are walked, and a
41
+ * selection with none skips the walk entirely (see {@link planOccurrenceWalk}).
42
+ */
43
+ index(entityType: string, data: unknown, selection: SelectionMeta, schema: RelationTargetResolver): void;
44
+ private unite;
45
+ /** The union of every occurrence of this entity in its response, or the occurrence itself when it had no sibling. */
46
+ resolve(occurrence: EntityRecord): EntityRecord;
47
+ }
48
+ /** What walking a response needs from its selection. */
49
+ export interface OccurrenceWalkPlan {
50
+ /** Entity types the selection reaches at two or more nodes, such as `article` and `article.sections.article`. Only these are united. */
51
+ readonly repeatedTypes: ReadonlySet<string>;
52
+ /** Selection nodes on a path to a repeated type. The walk descends into no other. */
53
+ readonly nodesToWalk: ReadonlySet<SelectionMeta>;
54
+ }
55
+ /**
56
+ * Plans the walk of one response. It depends only on the schema, the selection
57
+ * and its root type, and costs one pass over the selection tree, not over the
58
+ * response. It is computed per response rather than cached, because a selection
59
+ * can still grow after its first fetch (`mergeSelections` extends nested
60
+ * selections in place, and a fragment's selection is shared by every place
61
+ * that uses it).
62
+ */
63
+ export declare function planOccurrenceWalk(entityType: string, selection: SelectionMeta, schema: RelationTargetResolver): OccurrenceWalkPlan;
64
+ export {};
65
+ //# sourceMappingURL=ResponseOccurrenceIndex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseOccurrenceIndex.d.ts","sourceRoot":"","sources":["../../src/store/ResponseOccurrenceIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE1D,8FAA8F;AAC9F,MAAM,WAAW,sBAAsB;IACtC,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IAC5E,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAA;CACzD;AAED,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAS3C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,uBAAuB;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgD;IAEvE;;;;;;;;;;OAUG;IACH,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,sBAAsB,GAAG,IAAI;IAgBxG,OAAO,CAAC,KAAK;IAWb,qHAAqH;IACrH,OAAO,CAAC,UAAU,EAAE,YAAY,GAAG,YAAY;CAG/C;AA8BD,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IAClC,wIAAwI;IACxI,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC3C,qFAAqF;IACrF,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,CAAA;CAChD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,sBAAsB,GAAG,kBAAkB,CAInI"}
@@ -1,11 +1,13 @@
1
1
  import type { EntitySnapshot, LoadStatus } from './snapshots.js';
2
2
  import type { FieldError, FieldErrorFilter } from '../errors/types.js';
3
+ import type { SelectionMeta } from '../selection/types.js';
3
4
  import { type SnapshotVersionBumper, type SynchronousResult } from './SubscriptionManager.js';
4
- import { type HasManyRemovalType, type RelationReconciliationResult, type SentHasManyDelta, type SentHasOneTransition, type StoredHasManyState, type StoredRelationState } from './RelationStore.js';
5
+ import { type HasManyRelationProjection, type HasManyRemovalType, type HasManyViewMembership, type HasManyViewProjection, type RelationReconciliationResult, type SentHasManyDelta, type SentHasOneTransition, type StoredHasManyState, type StoredRelationState } from './RelationStore.js';
5
6
  import { type EntityMeta } from './EntityMetaStore.js';
7
+ import { type RelationTargetResolver } from './ResponseOccurrenceIndex.js';
6
8
  import type { Rekeyable } from './RekeyOrchestrator.js';
7
9
  import type { UndoJournal, JournalTarget, JournalCellImage, EntityCellImage, RelationCellImage, HasManyCellImage, EditableWriteCounters } from '../undo/UndoJournal.js';
8
- export type { HasManyRemovalType, RelationReconciliationResult, SentHasManyAddition, SentHasManyDelta, SentHasManyRemoval, SentHasOneTransition, StoredHasManyState, StoredRelationState, } from './RelationStore.js';
10
+ export type { HasManyAdditionKind, HasManyRelationProjection, HasManyRemovalType, HasManyView, HasManyViewMembership, HasManyViewProjection, PlannedHasManyAddition, RelationReconciliationResult, SentHasManyAddition, SentHasManyDelta, SentHasManyRemoval, SentHasOneTransition, StoredHasManyState, StoredRelationState, } from './RelationStore.js';
9
11
  export type { EntityMeta } from './EntityMetaStore.js';
10
12
  export { isTempId, isPlaceholderId, isPersistedId, generatePlaceholderId } from './entityId.js';
11
13
  type Subscriber = () => void;
@@ -44,6 +46,7 @@ export declare class SnapshotStore implements SnapshotVersionBumper, JournalTarg
44
46
  * Keyed by "parentType:parentId:fieldName".
45
47
  */
46
48
  private readonly lastPropagatedData;
49
+ private readonly responseOccurrences;
47
50
  /**
48
51
  * Optional write-journal. When set (by an attached UndoManager), mutating
49
52
  * methods record editable-layer pre-images of the cells they touch so a gesture
@@ -112,6 +115,17 @@ export declare class SnapshotStore implements SnapshotVersionBumper, JournalTarg
112
115
  getEntitySnapshot<T extends object>(entityType: string, id: string): EntitySnapshot<T> | undefined;
113
116
  hasEntity(entityType: string, id: string): boolean;
114
117
  setEntityData<T extends object>(entityType: string, id: string, data: T, isServerData?: boolean, skipNotify?: boolean): EntitySnapshot<T>;
118
+ /**
119
+ * Unites the occurrences of each entity within one server response, so the
120
+ * narrower of two occurrences cannot replace fields the wider one carried.
121
+ * Call it before any of the response is written. See {@link ResponseOccurrenceIndex}.
122
+ */
123
+ indexServerResponse(entityType: string, data: unknown, selection: SelectionMeta, schema: RelationTargetResolver): void;
124
+ /**
125
+ * What to write for an entity occurrence of a server response: the union of
126
+ * its occurrences in that response, or the occurrence itself.
127
+ */
128
+ resolveServerOccurrence(occurrence: Record<string, unknown>): Record<string, unknown>;
115
129
  /**
116
130
  * Refreshes server data from a revalidation read while preserving the user's
117
131
  * local dirty edits. See {@link EntitySnapshotStore.refreshServerData}.
@@ -167,11 +181,32 @@ export declare class SnapshotStore implements SnapshotVersionBumper, JournalTarg
167
181
  mapTempIdToPersistedId(entityType: string, tempId: string, persistedId: string): void;
168
182
  getPersistedId(entityType: string, id: string): string | null;
169
183
  isNewEntity(entityType: string, id: string): boolean;
170
- getOrCreateHasMany(parentType: string, parentId: string, fieldName: string, serverIds?: string[], alias?: string): StoredHasManyState;
171
- getHasMany(parentType: string, parentId: string, fieldName: string, alias?: string): StoredHasManyState | undefined;
184
+ /**
185
+ * Declares what a view read under {@link alias} can leave out, so the store can tell
186
+ * a filtered view from one that merely orders or renames. Only the caller that
187
+ * selected the relation knows the params; the alias is a hash of them.
188
+ */
189
+ declareHasManyViewMembership(entityType: string, fieldName: string, alias: string, membership: HasManyViewMembership): void;
190
+ /**
191
+ * Materializes the relation and one args-view of it, refreshing that view's
192
+ * server baseline when one is supplied.
193
+ *
194
+ * `alias` addresses a VIEW inside the relation state, never a key of its own:
195
+ * the state is always keyed by the schema field name, so everything that names
196
+ * the relation the way the schema and the server do finds it.
197
+ */
198
+ getOrCreateHasMany(parentType: string, parentId: string, fieldName: string, serverIds?: string[], alias?: string): void;
199
+ /** The relation as persistence and dirty tracking see it — server baseline unioned across views. */
200
+ getHasMany(parentType: string, parentId: string, fieldName: string): HasManyRelationProjection | undefined;
201
+ /** Whether the relation carries writes the next persist would send. */
202
+ hasPendingHasManyWrites(parentType: string, parentId: string, fieldName: string): boolean;
203
+ /** Whether one view carries an order its user arranged rather than the default one. */
204
+ hasExplicitHasManyOrder(parentType: string, parentId: string, fieldName: string, alias?: string): boolean;
205
+ /** The relation as ONE mounted has-many handle sees it. */
206
+ getHasManyView(parentType: string, parentId: string, fieldName: string, alias?: string): HasManyViewProjection;
172
207
  setHasManyServerIds(parentType: string, parentId: string, fieldName: string, serverIds: string[], alias?: string): void;
173
- planHasManyRemoval(parentType: string, parentId: string, fieldName: string, itemId: string, type: HasManyRemovalType, alias?: string): void;
174
- getHasManyPlannedRemovals(parentType: string, parentId: string, fieldName: string, alias?: string): Map<string, HasManyRemovalType> | undefined;
208
+ planHasManyRemoval(parentType: string, parentId: string, fieldName: string, itemId: string, type: HasManyRemovalType): void;
209
+ getHasManyPlannedRemovals(parentType: string, parentId: string, fieldName: string): Map<string, HasManyRemovalType> | undefined;
175
210
  /**
176
211
  * Whether some relation plans to delete {@link entityId} through its parent, i.e.
177
212
  * the row goes away with the parent's update rather than with a mutation of its
@@ -179,18 +214,18 @@ export declare class SnapshotStore implements SnapshotVersionBumper, JournalTarg
179
214
  */
180
215
  isPlannedForDeleteByParent(entityId: string): boolean;
181
216
  planHasManyConnection(parentType: string, parentId: string, fieldName: string, itemId: string, alias?: string): void;
182
- getHasManyPlannedConnections(parentType: string, parentId: string, fieldName: string, alias?: string): Set<string> | undefined;
183
- commitHasMany(parentType: string, parentId: string, fieldName: string, newServerIds: string[], alias?: string): void;
184
- reconcileSentHasMany(parentType: string, parentId: string, fieldName: string, delta: SentHasManyDelta, alias?: string): RelationReconciliationResult;
185
- resetHasMany(parentType: string, parentId: string, fieldName: string, alias?: string): void;
217
+ /** The connections the next persist will send — relation-level, not per view. */
218
+ getHasManyPlannedConnections(parentType: string, parentId: string, fieldName: string): Set<string> | undefined;
219
+ reconcileSentHasMany(parentType: string, parentId: string, fieldName: string, delta: SentHasManyDelta): RelationReconciliationResult;
220
+ resetHasMany(parentType: string, parentId: string, fieldName: string): void;
186
221
  addToHasMany(parentType: string, parentId: string, fieldName: string, itemId: string, alias?: string): void;
187
222
  connectExistingToHasMany(parentType: string, parentId: string, fieldName: string, itemId: string): void;
188
- removeFromHasMany(parentType: string, parentId: string, fieldName: string, itemId: string, removalType: HasManyRemovalType, alias?: string): void;
223
+ removeFromHasMany(parentType: string, parentId: string, fieldName: string, itemId: string, removalType: HasManyRemovalType): void;
189
224
  moveInHasMany(parentType: string, parentId: string, fieldName: string, fromIndex: number, toIndex: number, alias?: string): void;
190
225
  getHasManyOrderedIds(parentType: string, parentId: string, fieldName: string, alias?: string): string[];
191
226
  getPresentationHasManyOrderedIds(parentType: string, parentId: string, fieldName: string, alias?: string): string[];
192
- isHasManyItemCreated(parentType: string, parentId: string, fieldName: string, itemId: string, alias?: string): boolean;
193
- getHasManyCreatedEntities(parentType: string, parentId: string, fieldName: string, alias?: string): Set<string> | undefined;
227
+ isHasManyItemCreated(parentType: string, parentId: string, fieldName: string, itemId: string): boolean;
228
+ getHasManyCreatedEntities(parentType: string, parentId: string, fieldName: string): Set<string> | undefined;
194
229
  isPersisting(entityType: string, id: string): boolean;
195
230
  setPersisting(entityType: string, id: string, isPersisting: boolean, pessimistic?: boolean): void;
196
231
  /**
@@ -282,7 +317,7 @@ export declare class SnapshotStore implements SnapshotVersionBumper, JournalTarg
282
317
  * journal's rekey to rebase a pre-image when a just-persisted create became a
283
318
  * permanent member of the list (membership rebase for sealed creates).
284
319
  */
285
- getLiveHasManyServerIds(relationKey: string): Set<string>;
320
+ getLiveHasManyServerIds(relationKey: string): ReadonlyMap<string, ReadonlySet<string>>;
286
321
  exportHasManyCell(key: string): HasManyCellImage;
287
322
  /**
288
323
  * Entry-closure export: starting from the given seed ids, walks and exports the
@@ -1 +1 @@
1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AAC,GAAG,EAAE,MAAM,GAAG,eAAe;IAgB9C,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB;IAWlD;;;;OAIG;IACH,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAItF,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB;IAYhD;;;;;;;OAOG;IACH,gCAAgC,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,gBAAgB,EAAE;IAsClF;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAI;IAgCpD,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,kBAAkB;IA2C1B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,eAAe,IAAI,MAAM;IAQzB,mBAAmB,IAAI,KAAK,CAAC;QAC5B,UAAU,EAAE,MAAM,CAAA;QAClB,QAAQ,EAAE,MAAM,CAAA;QAChB,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;KAC1C,CAAC;IAIF;;;;;;;;OAQG;IACH,uBAAuB,IAAI,IAAI;IAW/B,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;IAI9D,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;IAIjE,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI;IAQ9E,KAAK,IAAI,IAAI;CAgBb"}
@@ -0,0 +1,164 @@
1
+ /**
2
+ * The has-many state algebra: the stored shape plus every pure function over it.
3
+ *
4
+ * Separated from {@link HasManyStore}, which owns the keyed map, the write
5
+ * chokepoint and the three indexes. Nothing here touches the store's state.
6
+ *
7
+ * ## Reads are per view, writes are per relation
8
+ *
9
+ * A has-many selected with params (filter/orderBy/limit/offset) is fetched under an
10
+ * auto-generated alias (`tags_a7x9k2`), and several such VIEWS of one relation can be
11
+ * mounted at once. What the server returned differs per view, so {@link HasManyView}
12
+ * is keyed by alias. The pending mutations do NOT: the backend has one `tags` relation
13
+ * and one mutation input for it, so `plannedAdditions` / `plannedRemovals` live at the
14
+ * relation level and the state is keyed by the SCHEMA FIELD NAME alone.
15
+ *
16
+ * The two directions are deliberately asymmetric, because subset-closure only holds
17
+ * one way:
18
+ *
19
+ * - A **removal** says the item is no longer a member of the relation. Every view is
20
+ * a subset of the relation, so the item is hidden in all of them.
21
+ * - An **addition** says the item is a member of the relation, which does not settle
22
+ * whether it belongs in a *filtered* view — the client cannot evaluate the filter.
23
+ * So an addition renders in the views it was made in ({@link PlannedHasManyAddition.origins})
24
+ * plus every view that cannot exclude anything ({@link HasManyView.membership} `'total'`).
25
+ */
26
+ export type ReconciliationResult = 'applied' | 'conflict';
27
+ export declare function setsEqual<T>(a: Set<T>, b: Set<T>): boolean;
28
+ export declare function arraysEqual(a: string[], b: string[]): boolean;
29
+ /**
30
+ * Removal type for has-many items
31
+ */
32
+ export type HasManyRemovalType = 'disconnect' | 'delete';
33
+ /**
34
+ * Kind of a planned has-many addition:
35
+ * - 'created': a newly created entity (via add())
36
+ * - 'connected': an existing persisted entity being connected (via connect())
37
+ */
38
+ export type HasManyAdditionKind = 'created' | 'connected';
39
+ /**
40
+ * Whether a view's query args can exclude a member of the relation.
41
+ * - 'total': no filter/limit/offset, so every member belongs in this view.
42
+ * - 'partial': the args may exclude members and the client cannot evaluate them.
43
+ */
44
+ export type HasManyViewMembership = 'total' | 'partial';
45
+ /** What the server returned for ONE args-view of the relation, plus its local order. */
46
+ export interface HasManyView {
47
+ /** IDs of items the server returned for this view's args */
48
+ serverIds: Set<string>;
49
+ /** Explicit ordered list of item IDs, null means use the view's default order */
50
+ orderedIds: string[] | null;
51
+ membership: HasManyViewMembership;
52
+ }
53
+ export interface PlannedHasManyAddition {
54
+ kind: HasManyAdditionKind;
55
+ /**
56
+ * Aliases of the views the addition was made in — never empty. Presentation only:
57
+ * it never affects what is sent. A `connect()` of the same id can legitimately
58
+ * arrive from two views, and both are entitled to show it, hence a set.
59
+ */
60
+ origins: Set<string>;
61
+ }
62
+ export interface SentHasManyAddition {
63
+ itemId: string;
64
+ kind: HasManyAdditionKind;
65
+ }
66
+ export interface SentHasManyRemoval {
67
+ itemId: string;
68
+ type: HasManyRemovalType;
69
+ }
70
+ export interface SentHasManyDelta {
71
+ additions: readonly SentHasManyAddition[];
72
+ removals: readonly SentHasManyRemoval[];
73
+ }
74
+ /**
75
+ * Has-many relation state stored in SnapshotStore, keyed by
76
+ * "parentType:parentId:fieldName" — the schema field name, never an alias.
77
+ */
78
+ export interface StoredHasManyState {
79
+ /** Per-args-view server data, keyed by alias; the unparameterized view uses the field name. */
80
+ views: Map<string, HasManyView>;
81
+ /** Planned removals (disconnect or delete) keyed by entity ID. Relation-level. */
82
+ plannedRemovals: Map<string, HasManyRemovalType>;
83
+ /**
84
+ * Planned additions keyed by entity ID. Relation-level: these are exactly the
85
+ * operations the next persist will send. The entries whose kind is 'created' are
86
+ * exactly the created entities, so the "created ⊆ connections" invariant is structural.
87
+ */
88
+ plannedAdditions: Map<string, PlannedHasManyAddition>;
89
+ version: number;
90
+ }
91
+ /**
92
+ * What every consumer that names the relation the way the schema and the server do
93
+ * sees: persistence, dirty tracking, error paths. Views are not its business, so the
94
+ * baseline it reads is the union across them.
95
+ */
96
+ export interface HasManyRelationProjection {
97
+ serverIds: Set<string>;
98
+ plannedRemovals: Map<string, HasManyRemovalType>;
99
+ plannedAdditions: Map<string, HasManyAdditionKind>;
100
+ version: number;
101
+ }
102
+ /**
103
+ * What is this view's own, as opposed to the relation's: the server rows its args
104
+ * returned and the order its user arranged. The pending writes are not here — they
105
+ * belong to the relation, so consumers read {@link HasManyRelationProjection}.
106
+ */
107
+ export interface HasManyViewProjection {
108
+ serverIds: Set<string>;
109
+ orderedIds: string[] | null;
110
+ }
111
+ export declare function createHasManyView(membership: HasManyViewMembership, serverIds?: Iterable<string>): HasManyView;
112
+ export declare function cloneHasManyView(view: HasManyView): HasManyView;
113
+ export declare function cloneViews(views: ReadonlyMap<string, HasManyView>): Map<string, HasManyView>;
114
+ export declare function cloneAddition(addition: PlannedHasManyAddition): PlannedHasManyAddition;
115
+ export declare function cloneAdditions(additions: ReadonlyMap<string, PlannedHasManyAddition>): Map<string, PlannedHasManyAddition>;
116
+ /**
117
+ * Deep clone. Every path that hands a state out or stores a new one goes through
118
+ * this: {@link SnapshotStore}'s dirty-version memo assumes values are REPLACED, never
119
+ * mutated in place, and with two nesting levels a shallow copy would share mutable
120
+ * Sets across store generations.
121
+ */
122
+ export declare function cloneHasManyState(state: StoredHasManyState): StoredHasManyState;
123
+ export declare function emptyHasManyState(): StoredHasManyState;
124
+ /** Whether an addition renders in {@link alias} — see the asymmetry note at the top. */
125
+ export declare function additionRendersIn(views: ReadonlyMap<string, HasManyView>, alias: string, addition: PlannedHasManyAddition): boolean;
126
+ /** The aliases of existing views a confirmed addition folds into. */
127
+ export declare function additionFoldTargets(state: StoredHasManyState, addition: PlannedHasManyAddition): string[];
128
+ /**
129
+ * Default order of one view: its server rows minus the relation's planned removals,
130
+ * then the planned additions that render there.
131
+ */
132
+ export declare function computeViewOrderedIds(state: StoredHasManyState, alias: string): string[];
133
+ /** Explicit order of a view if it has one, otherwise its default order. */
134
+ export declare function viewOrderedIds(state: StoredHasManyState, alias: string): string[];
135
+ /**
136
+ * The relation's server baseline: the union across views.
137
+ * Known limitation: views are never dropped, so a view nobody refetches any more can
138
+ * keep a row the server has since removed in it.
139
+ */
140
+ export declare function relationServerIds(state: StoredHasManyState): Set<string>;
141
+ export declare function toRelationProjection(state: StoredHasManyState): HasManyRelationProjection;
142
+ export declare function toViewProjection(state: StoredHasManyState | undefined, alias: string): HasManyViewProjection;
143
+ /**
144
+ * The single liveness predicate for has-many membership: effective members are
145
+ * (every view's serverIds ∪ plannedAdditions) minus plannedRemovals. Defined once and
146
+ * consumed by the write chokepoint so the forward/reverse index can never drift from it.
147
+ */
148
+ export declare function liveHasManyChildIds(state: StoredHasManyState | undefined): Set<string>;
149
+ export declare function plannedDeleteChildIds(state: StoredHasManyState | undefined): Set<string>;
150
+ export interface HasManyReconciliation {
151
+ state: StoredHasManyState;
152
+ result: ReconciliationResult;
153
+ }
154
+ /**
155
+ * Advances the server baseline by the confirmed sent delta and rebases local edits
156
+ * made after the request went out.
157
+ *
158
+ * The rebase logic is relation-level and unchanged by views — "did the user locally
159
+ * undo this while the request was in flight" has one answer per relation. Only the
160
+ * baseline bookkeeping is per view: a confirmed addition joins the views it renders
161
+ * in, a confirmed removal leaves every view.
162
+ */
163
+ export declare function reconcileHasManyState(existing: StoredHasManyState, delta: SentHasManyDelta, fieldName: string): HasManyReconciliation;
164
+ //# sourceMappingURL=hasManyState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasManyState.d.ts","sourceRoot":"","sources":["../../src/store/hasManyState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,UAAU,CAAA;AAEzD,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAM1D;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAM7D;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,QAAQ,CAAA;AAExD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,WAAW,CAAA;AAEzD;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,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EAAE,MAAM,GAAG,MAAM,EAAE,CAGjF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,MAAM,CAAC,CAMxE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG,yBAAyB,CASzF;AAED,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,kBAAkB,GAAG,SAAS,EACrC,KAAK,EAAE,MAAM,GACX,qBAAqB,CAMvB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAYtF;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAOxF;AAED,MAAM,WAAW,qBAAqB;IACrC,KAAK,EAAE,kBAAkB,CAAA;IACzB,MAAM,EAAE,oBAAoB,CAAA;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,gBAAgB,EACvB,SAAS,EAAE,MAAM,GACf,qBAAqB,CAuDvB"}
@@ -5,6 +5,17 @@
5
5
  * before the last separator.
6
6
  */
7
7
  export declare function parentKeyFromRelationKey(relationKey: string): string;
8
+ /**
9
+ * Derives the parent entity type from a relation key ("parentType:parentId:fieldName").
10
+ * Entity type names never contain ':', so the type is everything before the first separator.
11
+ */
12
+ export declare function entityTypeFromRelationKey(relationKey: string): string;
13
+ /**
14
+ * Derives the field name from a relation key ("parentType:parentId:fieldName").
15
+ * The counterpart of {@link parentKeyFromRelationKey}: entity ids and field names
16
+ * never contain ':', so the field is everything after the last separator.
17
+ */
18
+ export declare function fieldFromRelationKey(relationKey: string): string;
8
19
  /**
9
20
  * Derives the parent composite key ("parentType:parentId") from an owner key
10
21
  * prefix ("parentType:parentId:") by dropping the trailing separator. Callers
@@ -1 +1 @@
1
- {"version":3,"file":"relationKey.d.ts","sourceRoot":"","sources":["../../src/store/relationKey.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpE"}
1
+ {"version":3,"file":"relationKey.d.ts","sourceRoot":"","sources":["../../src/store/relationKey.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"UndoJournal.d.ts","sourceRoot":"","sources":["../../src/undo/UndoJournal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGjE;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,4DAA4D;AAC5D,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,uFAAuF;IACvF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAA;IAClC,QAAQ,CAAC,cAAc,CAAC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C3D,iFAAiF;IACjF,OAAO,CAAC,YAAY,CAAqC;gBAGvC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,EACvC,OAAO,CAAC,GAAE,CAAC,GAAG,EAAE,YAAY,KAAK,IAAI,aAAA,EACrC,OAAO,CAAC,GAAE,MAAM,IAAI,aAAA;IAGtC,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,KAAK,IAAI,IAAI;IAQb,MAAM,IAAI,IAAI;IAgBd;;;;;;OAMG;IACH,OAAO,CAAC,uBAAuB;IAkB/B;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IASnC,mFAAmF;IACnF,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI/B,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIjC,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIhC,OAAO,CAAC,MAAM;IAMd,uFAAuF;IACvF,cAAc,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE;IAa7D,KAAK,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,IAAI;IAItC,yFAAyF;IACzF,KAAK,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI;IAI9B,8FAA8F;IAC9F,KAAK,IAAI,IAAI;CAQb;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
@@ -11,10 +11,10 @@ import type { JournalEntry } from './UndoJournal.js';
11
11
  * server-backed row — only later edits to it remain undoable.
12
12
  */
13
13
  /**
14
- * Looks up the live server-member ids of a has-many list by its key. Lets the
15
- * rekey rebase a pre-image when the just-persisted create has become a permanent
16
- * member of that list.
14
+ * Looks up the live server-member ids of a has-many relation by its key, per
15
+ * args-view. Lets the rekey rebase a pre-image when the just-persisted create has
16
+ * become a permanent member of that list.
17
17
  */
18
- export type LiveServerIdsLookup = (relationKey: string) => Set<string>;
18
+ export type LiveServerIdsLookup = (relationKey: string) => ReadonlyMap<string, ReadonlySet<string>>;
19
19
  export declare function rekeyJournalEntry(entry: JournalEntry, ctx: RekeyContext, liveServerIds: LiveServerIdsLookup): JournalEntry;
20
20
  //# sourceMappingURL=rekeyJournalEntry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rekeyJournalEntry.d.ts","sourceRoot":"","sources":["../../src/undo/rekeyJournalEntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAIjE,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,kBAAkB,CAAA;AAEtE;;;;;;;;;GASG;AACH;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,CAAA;AAEtE,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,YAAY,EACjB,aAAa,EAAE,mBAAmB,GAChC,YAAY,CAOd"}
1
+ {"version":3,"file":"rekeyJournalEntry.d.ts","sourceRoot":"","sources":["../../src/undo/rekeyJournalEntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAIjE,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,kBAAkB,CAAA;AAEtE;;;;;;;;;GASG;AACH;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAA;AAEnG,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,YAAY,EACjB,aAAa,EAAE,mBAAmB,GAChC,YAAY,CAOd"}
@@ -1,2 +1,2 @@
1
- export { generateHasManyAlias } from '@contember/bindx-client';
1
+ export { canHasManyParamsExcludeMembers, generateHasManyAlias } from '@contember/bindx-client';
2
2
  //# sourceMappingURL=aliasGenerator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aliasGenerator.d.ts","sourceRoot":"","sources":["../../src/utils/aliasGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA"}
1
+ {"version":3,"file":"aliasGenerator.d.ts","sourceRoot":"","sources":["../../src/utils/aliasGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contember/bindx",
3
- "version": "0.1.52",
3
+ "version": "0.1.53",
4
4
  "description": "Type-safe data binding framework (core)",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
- "@contember/bindx-client": "0.1.52",
20
+ "@contember/bindx-client": "0.1.53",
21
21
  "@contember/graphql-client": "^2.1.0-beta.1"
22
22
  },
23
23
  "repository": {
@@ -360,7 +360,6 @@ export class ActionDispatcher {
360
360
  action.fieldName,
361
361
  action.itemKey,
362
362
  action.removalType,
363
- action.alias,
364
363
  )
365
364
  break
366
365
 
@@ -60,6 +60,13 @@ export interface LoadEntityListOptions<TEntity = unknown> {
60
60
  /**
61
61
  * Non-React service for loading entities.
62
62
  * Can be used in any JavaScript environment.
63
+ *
64
+ * It writes each response as it arrives, without uniting the occurrences of one
65
+ * entity within it (see `SnapshotStore.indexServerResponse`): that needs the
66
+ * selection and the schema, and the loader has only a `QuerySpec`. A query that
67
+ * reaches one entity through two paths with different sub-selections can
68
+ * therefore lose the wider one's fields, as described in
69
+ * https://github.com/contember/bindx/issues/123. The React hooks do not go through it.
63
70
  */
64
71
  export class EntityLoader {
65
72
  constructor(
@@ -165,7 +165,6 @@ export interface RemoveFromListAction {
165
165
  readonly fieldName: string
166
166
  readonly itemKey: string
167
167
  readonly removalType: 'disconnect' | 'delete'
168
- readonly alias?: string
169
168
  }
170
169
 
171
170
  /**
@@ -581,9 +580,8 @@ export function removeFromList(
581
580
  fieldName: string,
582
581
  itemKey: string,
583
582
  removalType: 'disconnect' | 'delete',
584
- alias?: string,
585
583
  ): RemoveFromListAction {
586
- return { type: 'REMOVE_FROM_LIST', entityType, entityId, fieldName, itemKey, removalType, alias }
584
+ return { type: 'REMOVE_FROM_LIST', entityType, entityId, fieldName, itemKey, removalType }
587
585
  }
588
586
 
589
587
  /**
@@ -60,9 +60,9 @@ export interface BooleanFilterArtifact {
60
60
  /**
61
61
  * Enum filter artifact
62
62
  */
63
- export interface EnumFilterArtifact {
64
- readonly values?: readonly string[]
65
- readonly notValues?: readonly string[]
63
+ export interface EnumFilterArtifact<TValue extends string = string> {
64
+ readonly values?: readonly TValue[]
65
+ readonly notValues?: readonly TValue[]
66
66
  readonly nullCondition?: boolean
67
67
  }
68
68
 
@@ -78,9 +78,9 @@ export interface RelationFilterArtifact {
78
78
  /**
79
79
  * Enum list filter artifact - for array enum fields (uses 'includes' condition)
80
80
  */
81
- export interface EnumListFilterArtifact {
82
- readonly values?: readonly string[]
83
- readonly notValues?: readonly string[]
81
+ export interface EnumListFilterArtifact<TValue extends string = string> {
82
+ readonly values?: readonly TValue[]
83
+ readonly notValues?: readonly TValue[]
84
84
  readonly nullCondition?: boolean
85
85
  }
86
86
 
@@ -13,6 +13,7 @@ import {
13
13
  } from '../core/actions.js'
14
14
  import { FIELD_REF_META, type FieldRefMeta, type FieldAccessor, type HasOneAccessor, type HasManyAccessor, type EntityFieldsAccessor, type Unsubscribe, type EntityAccessor } from './types.js'
15
15
  import { deepEqual } from '../utils/deepEqual.js'
16
+ import { canHasManyParamsExcludeMembers } from '../utils/aliasGenerator.js'
16
17
  import { createClientError, type ErrorInput, type FieldError } from '../errors/types.js'
17
18
  import type {
18
19
  EventTypeMap,
@@ -511,6 +512,16 @@ export class EntityHandle<T extends object = object, TSelected = T> extends Enti
511
512
  // Has-many relation - return HasManyListHandle.
512
513
  // Thread the selected alias so the handle reads data stored under the
513
514
  // auto-generated alias (e.g. `tags_<hash>`) for params-bearing relations.
515
+ // The alias is a hash of the params, so the store cannot tell a filtered
516
+ // view from one that only orders — say so here, where the params are.
517
+ if (fieldMeta && fieldMeta.alias !== schemaFieldName) {
518
+ this.store.declareHasManyViewMembership(
519
+ this.entityType,
520
+ schemaFieldName,
521
+ fieldMeta.alias,
522
+ canHasManyParamsExcludeMembers(fieldMeta.hasManyParams) ? 'partial' : 'total',
523
+ )
524
+ }
514
525
  return this.hasMany(schemaFieldName, fieldMeta?.alias, nestedSelection)
515
526
  }
516
527