@haverstack/core 0.33.0 → 0.34.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/changes.d.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * property of one function here, not a convention every emission site has
14
14
  * to remember. See docs/spec/events.md.
15
15
  */
16
- import type { Association, ChangeActor, JournalEntryInput, ChangeFilter, ChangeKind, ChangeOp, RecordChange, StackRecord, SubscribeOptions, Unsubscribe } from './types.js';
16
+ import type { AssociationChange, ChangeActor, JournalEntryInput, ChangeFilter, ChangeKind, ChangeOp, RecordChange, StackRecord, SubscribeOptions, Unsubscribe } from './types.js';
17
17
  /**
18
18
  * What the emitter knows: the envelope, plus the record it describes.
19
19
  * `record` is the filtering input and is never delivered unprojected —
@@ -117,42 +117,69 @@ export declare class RelayDelivery {
117
117
  close(): void;
118
118
  }
119
119
  /**
120
- * Assemble what the emitter knows about one mutation.
120
+ * One change, held between the two halves it is written in.
121
121
  *
122
- * The actor is read off the record for every version-bumping op, because
123
- * `updatedBy`/`updatedVia` were stamped by that same write and so agree
124
- * with what was persisted by construction. `associate`/`dissociate` don't
125
- * bump, so they stamp nothing on the record either — their actor travels
126
- * as `opts.actor` instead, the same way hard delete's does, since reading
127
- * the record would report whoever's *last version-bumping write* this is,
128
- * not who just changed the association. Hard delete stamps nothing and
129
- * leaves nothing to read, so its actor is the requester, passed in. A
130
- * purge also drops `parentId` and the create-time `appId`: the frame says
131
- * that a record of some type was destroyed, and nothing further about
132
- * whose it was. See docs/spec/events.md § Purged records carry nothing.
122
+ * A change lands twice: the durable half travels into the adapter's
123
+ * transaction ahead of the write, and the live half is built from the
124
+ * record that write produced. Naming the change once — its ops, its kind,
125
+ * its actor, what it moved — is what makes "the entry set is the event
126
+ * set" true by construction rather than by convention. No verb can journal
127
+ * one thing and announce another, and a verb that writes only one half has
128
+ * to say so where it does it. See docs/spec/journal.md § The entry set is
129
+ * the event set.
133
130
  */
134
- export declare function buildEmission(ops: ChangeOp | ChangeOp[], record: StackRecord, opts?: {
135
- actor?: ChangeActor;
136
- at?: Date;
137
- previousParentId?: string | null;
138
- associationsAdded?: Association[];
139
- associationsRemoved?: Association[];
140
- }): EmittedChange;
141
- /**
142
- * The durable half of a change, built before the write that it describes
143
- * — where an emission is built after one. The two carry the same facts
144
- * about what moved and who moved it; they differ in what they can read
145
- * off the record, which at this point has not been written yet. So the
146
- * adapter stamps the record-derived fields and this names the rest.
147
- * See docs/spec/versioning.md § The change journal.
148
- */
149
- export declare function buildJournalEntry(ops: ChangeOp | ChangeOp[], opts?: {
150
- actor?: ChangeActor;
151
- previousParentId?: string | null;
152
- associationsAdded?: Association[];
153
- associationsRemoved?: Association[];
154
- associationsReplaced?: Association[];
155
- }): JournalEntryInput;
131
+ export declare class PendingChange {
132
+ private readonly moved;
133
+ readonly ops: ChangeOp[];
134
+ readonly kind: ChangeKind;
135
+ constructor(ops: ChangeOp | ChangeOp[], moved?: {
136
+ /**
137
+ * The requester behind a write that stamps nothing on the record
138
+ * itself. A version-bumping write stamps `updatedBy`/`updatedVia`,
139
+ * so its emission reads them back instead — see emission() below.
140
+ */
141
+ actor?: ChangeActor;
142
+ previousParentId?: string | null;
143
+ /**
144
+ * What the write moved, association by association. One list for
145
+ * both halves: the journal takes it as it stands and the feed is
146
+ * flattened out of it, so neither can report an edit the other
147
+ * doesn't.
148
+ */
149
+ associations?: AssociationChange[];
150
+ });
151
+ /**
152
+ * The durable half, handed to the adapter as `journal` so that it lands
153
+ * in the same write as the mutation it describes.
154
+ *
155
+ * Absent for a purge, which destroys the log an entry would be appended
156
+ * to. The rule lives here rather than at each call site that would
157
+ * otherwise have to remember it. See docs/spec/journal.md § A hard
158
+ * delete destroys the journal.
159
+ */
160
+ get journal(): JournalEntryInput | undefined;
161
+ /**
162
+ * The live half, built from the record the write produced — for a purge,
163
+ * from the record as it stood immediately before destruction.
164
+ *
165
+ * The actor is read off the record for every version-bumping op, because
166
+ * `updatedBy`/`updatedVia` were stamped by that same write and so agree
167
+ * with what was persisted by construction. `associate`/`dissociate`
168
+ * don't bump, so they stamp nothing and the requester travels here
169
+ * instead — reading the record would report whoever's last
170
+ * version-bumping write this is, not who just changed the association.
171
+ * Hard delete leaves nothing to read at all, and its frame also drops
172
+ * `parentId` and the create-time `appId`: it says that a record of some
173
+ * type was destroyed and nothing further about whose it was. See
174
+ * docs/spec/events.md § Purged records carry nothing.
175
+ */
176
+ emission(record: StackRecord, at?: Date): EmittedChange;
177
+ /**
178
+ * The frame's two flat lists, flattened out of the one the journal
179
+ * takes. Present only where non-empty.
180
+ */
181
+ private associationDeltas;
182
+ }
156
183
  /**
157
184
  * The subscriber registry. One per `Stack`; `ScopedStack` filters the same
158
185
  * stream rather than opening its own, so a scoped view can never observe a
@@ -1 +1 @@
1
- {"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../src/changes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,WAAW,EACZ,MAAM,YAAY,CAAC;AAIpB;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IACrC;;;;OAIG;IACH,MAAM,EAAE,WAAW,CAAC;IACpB;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC;AAKF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,OAAO,CA0BpF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,EAAE,eAAe,CAAC,EAAE,OAAO,GAAG,OAAO,CAIjG;AAED;;;;;;;;;;;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AO,MAAM,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,CAcrD,CAAC;AAUF;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI,CAgBzF"}
package/dist/changes.js CHANGED
@@ -14,7 +14,7 @@
14
14
  * to remember. See docs/spec/events.md.
15
15
  */
16
16
  import { StackQueryError } from './errors.js';
17
- import { bumpsVersion } from './record-changes.js';
17
+ import { bumpsVersion, feedAssociationDelta } from './record-changes.js';
18
18
  /** The `baseId@version` split, as grants and query filters read it. */
19
19
  const baseIdOf = (typeId) => typeId.split('@')[0];
20
20
  /**
@@ -197,83 +197,111 @@ class UnscopedSubscription extends Subscription {
197
197
  }
198
198
  }
199
199
  /**
200
- * Assemble what the emitter knows about one mutation.
200
+ * One change, held between the two halves it is written in.
201
201
  *
202
- * The actor is read off the record for every version-bumping op, because
203
- * `updatedBy`/`updatedVia` were stamped by that same write and so agree
204
- * with what was persisted by construction. `associate`/`dissociate` don't
205
- * bump, so they stamp nothing on the record either — their actor travels
206
- * as `opts.actor` instead, the same way hard delete's does, since reading
207
- * the record would report whoever's *last version-bumping write* this is,
208
- * not who just changed the association. Hard delete stamps nothing and
209
- * leaves nothing to read, so its actor is the requester, passed in. A
210
- * purge also drops `parentId` and the create-time `appId`: the frame says
211
- * that a record of some type was destroyed, and nothing further about
212
- * whose it was. See docs/spec/events.md § Purged records carry nothing.
202
+ * A change lands twice: the durable half travels into the adapter's
203
+ * transaction ahead of the write, and the live half is built from the
204
+ * record that write produced. Naming the change once — its ops, its kind,
205
+ * its actor, what it moved — is what makes "the entry set is the event
206
+ * set" true by construction rather than by convention. No verb can journal
207
+ * one thing and announce another, and a verb that writes only one half has
208
+ * to say so where it does it. See docs/spec/journal.md § The entry set is
209
+ * the event set.
213
210
  */
214
- export function buildEmission(ops, record, opts = {}) {
215
- const list = Array.isArray(ops) ? ops : [ops];
216
- if (list.length === 0) {
217
- throw new Error('buildEmission: a change reports at least one op');
211
+ export class PendingChange {
212
+ moved;
213
+ ops;
214
+ kind;
215
+ constructor(ops, moved = {}) {
216
+ this.moved = moved;
217
+ const list = Array.isArray(ops) ? ops : [ops];
218
+ if (list.length === 0) {
219
+ throw new Error('PendingChange: a change reports at least one op');
220
+ }
221
+ this.ops = list;
222
+ this.kind = resolveKind(list);
218
223
  }
219
- const kind = resolveKind(list);
220
- if (kind === 'purged') {
224
+ /**
225
+ * The durable half, handed to the adapter as `journal` so that it lands
226
+ * in the same write as the mutation it describes.
227
+ *
228
+ * Absent for a purge, which destroys the log an entry would be appended
229
+ * to. The rule lives here rather than at each call site that would
230
+ * otherwise have to remember it. See docs/spec/journal.md § A hard
231
+ * delete destroys the journal.
232
+ */
233
+ get journal() {
234
+ if (this.kind === 'purged')
235
+ return undefined;
236
+ const { actor, previousParentId, associations } = this.moved;
237
+ return {
238
+ ops: this.ops,
239
+ kind: this.kind,
240
+ ...(actor && { actor }),
241
+ ...(previousParentId !== undefined && { previousParentId }),
242
+ ...(associations?.length && { associations }),
243
+ };
244
+ }
245
+ /**
246
+ * The live half, built from the record the write produced — for a purge,
247
+ * from the record as it stood immediately before destruction.
248
+ *
249
+ * The actor is read off the record for every version-bumping op, because
250
+ * `updatedBy`/`updatedVia` were stamped by that same write and so agree
251
+ * with what was persisted by construction. `associate`/`dissociate`
252
+ * don't bump, so they stamp nothing and the requester travels here
253
+ * instead — reading the record would report whoever's last
254
+ * version-bumping write this is, not who just changed the association.
255
+ * Hard delete leaves nothing to read at all, and its frame also drops
256
+ * `parentId` and the create-time `appId`: it says that a record of some
257
+ * type was destroyed and nothing further about whose it was. See
258
+ * docs/spec/events.md § Purged records carry nothing.
259
+ */
260
+ emission(record, at) {
261
+ if (this.kind === 'purged') {
262
+ return {
263
+ record,
264
+ change: {
265
+ kind: this.kind,
266
+ ops: this.ops,
267
+ recordId: record.id,
268
+ typeId: record.typeId,
269
+ version: record.version,
270
+ updatedAt: at ?? new Date(),
271
+ ...(this.moved.actor && { actor: this.moved.actor }),
272
+ },
273
+ };
274
+ }
275
+ const actor = bumpsVersion(this.ops) ? actorOf(record, this.kind) : this.moved.actor;
221
276
  return {
222
277
  record,
278
+ ...(this.moved.previousParentId !== undefined && {
279
+ previousParentId: this.moved.previousParentId,
280
+ }),
223
281
  change: {
224
- kind,
225
- ops: list,
282
+ kind: this.kind,
283
+ ops: this.ops,
226
284
  recordId: record.id,
227
285
  typeId: record.typeId,
228
286
  version: record.version,
229
- updatedAt: opts.at ?? new Date(),
230
- ...(opts.actor && { actor: opts.actor }),
287
+ updatedAt: record.updatedAt,
288
+ ...(record.parentId !== undefined && { parentId: record.parentId }),
289
+ ...(actor && { actor }),
290
+ ...this.associationDeltas(),
231
291
  },
232
292
  };
233
293
  }
234
- // A non-bumping write (associate/dissociate) never stamped the record,
235
- // so `record.updatedBy` reports whoever's last *bumping* write this is,
236
- // not who just changed the association — only opts.actor is trustworthy.
237
- const actor = bumpsVersion(list) ? (opts.actor ?? actorOf(record, kind)) : opts.actor;
238
- return {
239
- record,
240
- ...(opts.previousParentId !== undefined && { previousParentId: opts.previousParentId }),
241
- change: {
242
- kind,
243
- ops: list,
244
- recordId: record.id,
245
- typeId: record.typeId,
246
- version: record.version,
247
- updatedAt: record.updatedAt,
248
- ...(record.parentId !== undefined && { parentId: record.parentId }),
249
- ...(actor && { actor }),
250
- ...(opts.associationsAdded?.length && { associationsAdded: opts.associationsAdded }),
251
- ...(opts.associationsRemoved?.length && { associationsRemoved: opts.associationsRemoved }),
252
- },
253
- };
254
- }
255
- /**
256
- * The durable half of a change, built before the write that it describes
257
- * — where an emission is built after one. The two carry the same facts
258
- * about what moved and who moved it; they differ in what they can read
259
- * off the record, which at this point has not been written yet. So the
260
- * adapter stamps the record-derived fields and this names the rest.
261
- * See docs/spec/versioning.md § The change journal.
262
- */
263
- export function buildJournalEntry(ops, opts = {}) {
264
- const list = Array.isArray(ops) ? ops : [ops];
265
- if (list.length === 0) {
266
- throw new Error('buildJournalEntry: a change reports at least one op');
294
+ /**
295
+ * The frame's two flat lists, flattened out of the one the journal
296
+ * takes. Present only where non-empty.
297
+ */
298
+ associationDeltas() {
299
+ const { added, removed } = feedAssociationDelta(this.moved.associations ?? []);
300
+ return {
301
+ ...(added.length && { associationsAdded: added }),
302
+ ...(removed.length && { associationsRemoved: removed }),
303
+ };
267
304
  }
268
- return {
269
- ops: list,
270
- kind: resolveKind(list),
271
- ...(opts.actor && { actor: opts.actor }),
272
- ...(opts.previousParentId !== undefined && { previousParentId: opts.previousParentId }),
273
- ...(opts.associationsAdded?.length && { associationsAdded: opts.associationsAdded }),
274
- ...(opts.associationsRemoved?.length && { associationsRemoved: opts.associationsRemoved }),
275
- ...(opts.associationsReplaced?.length && { associationsReplaced: opts.associationsReplaced }),
276
- };
277
305
  }
278
306
  /**
279
307
  * The acting identity a stored record reports. `appId` rides along only on
@@ -1 +1 @@
1
- {"version":3,"file":"changes.js","sourceRoot":"","sources":["../src/changes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAcH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA2BnD,uEAAuE;AACvE,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;AAEnE;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAsB,EAAE,MAAqB;IACzE,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAEnC,IAAI,MAAM,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAEtE,IAAI,MA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AS;IAChB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,SAAS;IACjB,aAAa,EAAE,QAAQ;IACvB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,SAAS;CACpB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAyB,EAAE,aAAsB;IACjF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO;IAChC,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,eAAe,CACvB,yFAAyF;YACvF,sFAAsF;YACtF,qEAAqE,CACxE,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,eAAe,CACvB,6CAA6C,KAAK,wCAAwC;YACxF,sFAAsF;YACtF,6DAA6D,CAChE,CAAC;IACJ,CAAC;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -16,10 +16,10 @@
16
16
  */
17
17
  export { Stack } from './stack.js';
18
18
  export { ScopedStack } from './scoped-stack.js';
19
- export type { StackClient, CreateRecordOptions, BackdatableCreateRecordOptions, StackOptions, GetRecordOptions, DeleteRecordOptions, IfVersionOptions, CollectAttachmentGarbageOptions, CollectAttachmentGarbageResult, } from './stack.js';
19
+ export type { StackClient, CreateRecordOptions, BackdatableCreateRecordOptions, StackOptions, GetRecordOptions, DeleteRecordOptions, DeleteResult, IfVersionOptions, CollectAttachmentGarbageOptions, CollectAttachmentGarbageResult, } from './stack.js';
20
20
  export { StackError, StackValidationError, StackMigrationError, StackPermissionError, StackNotFoundError, StackConflictError, StackVersionConflictError, StackQueryError, StackSchemaDriftError, StackPayloadTooLargeError, StackTimeoutError, StackClosedError, StackRelayScopeError, } from './errors.js';
21
21
  export type { StackErrorCode } from './errors.js';
22
- export type { RecordId, TypeId, FileId, EntityId, AttachmentContent, StackRecord, RecordChanges, RecordVersion, RecordJournalEntry, JournalEntryInput, JournalOptions, JournalQuery, ActorOptions, ChangeKind, ChangeOp, ChangeActor, RecordChange, ChangeFilter, SubscribeOptions, Unsubscribe, ExpectedVersionOptions, SnapshotOptions, BumpVersionOptions, StackType, TypeSchema, FieldDef, ScalarFieldDef, ArrayFieldDef, ObjectFieldDef, ScalarFieldKind, Association, TagAssociation, AttachmentAssociation, RelationshipAssociation, RelationshipTarget, RecordTarget, EntityTarget, ExternalTarget, Permission, StackQuery, RecordFilter, RelatedToFilter, RelationshipTargetPattern, QuerySort, NativeSortField, ContentFilterReach, MissingCapability, QueryResult, DateRange, Migration, MigrationFn, StackAdapter, StackFeatures, TokenSession, EntityContent, AppContent, GroupContent, GrantAction, GrantContent, ConfigContent, } from './types.js';
22
+ export type { RecordId, TypeId, FileId, EntityId, AttachmentContent, StackRecord, RecordChanges, RecordVersion, RecordJournalEntry, JournalEntryInput, JournalOptions, JournalQuery, ActorOptions, ChangeKind, ChangeOp, ChangeActor, RecordChange, ChangeFilter, SubscribeOptions, Unsubscribe, ExpectedVersionOptions, SnapshotOptions, BumpVersionOptions, StackType, TypeSchema, FieldDef, ScalarFieldDef, ArrayFieldDef, ObjectFieldDef, ScalarFieldKind, Association, TagAssociation, AttachmentAssociation, RelationshipAssociation, AssociationChange, RelationshipTarget, RecordTarget, EntityTarget, ExternalTarget, Permission, StackQuery, RecordFilter, RelatedToFilter, RelationshipTargetPattern, QuerySort, NativeSortField, ContentFilterReach, MissingCapability, QueryResult, DateRange, Migration, MigrationFn, StackAdapter, StackFeatures, TokenSession, EntityContent, AppContent, GroupContent, GrantAction, GrantContent, ConfigContent, } from './types.js';
23
23
  export { SYSTEM_TYPES, NATIVE_SORT_FIELDS } from './types.js';
24
24
  export { generateId } from './id.js';
25
25
  export { hashSchema, isCompatible } from './schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,8BAA8B,EAC9B,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,YAAY,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,cAAc,EACd,aAAa,EACb,cAAc,EACd,eAAe,EACf,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,UAAU,EACV,UAAU,EACV,YAAY,EACZ,eAAe,EACf,yBAAyB,EACzB,SAAS,EACT,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jB,WAAW,EACX,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,cAAc,EACd,aAAa,EACb,cAAc,EACd,eAAe,EACf,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,UAAU,EACV,UAAU,EACV,YAAY,EACZ,eAAe,EACf,yBAAyB,EACzB,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,aAAa,EACb,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAM9D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACvD,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,kCAAkC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,m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export declare function assertSortCapability(sort: QuerySort | undefined, capabi
71
71
  */
72
72
  export declare function validateAssociation(association: Association, path?: string): ValidationError[];
73
73
  /** validateAssociation() over a create's `associations` array. */
74
+ /**
75
+ * Every association in a list, plus the one rule a list has that a single
76
+ * association does not: **identities are distinct**. A list naming one
77
+ * identity twice describes a state no store can hold — an adapter keys
78
+ * associations by identity, so the second entry displaces the first — and
79
+ * which of the two the record ends up with is a question the caller did
80
+ * not mean to ask. Refused rather than collapsed, for the reason an empty
81
+ * change set is refused: every way of producing one is a caller bug.
82
+ * See docs/spec/data-model.md § Associations.
83
+ */
74
84
  export declare function validateAssociations(associations: Association[] | undefined, path?: string): ValidationError[];
75
85
  /**
76
86
  * Reject a relationship filter that names neither a label nor a target,
@@ -1 +1 @@
1
- {"version":3,"file":"query-validation.d.ts","sourceRoot":"","sources":["../src/query-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,SAAS,EACT,YAAY,EAGZ,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,GAAG,SAAS,EAChC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,GAC1C,IAAI,CAmCN;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,OAAO,CAE/E;AAKD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAwB3D;AAYD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI,CA2BjE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,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AAG,IAAI,CA2BjE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,GACxC,IAAI,CAmBN;AA0CD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,IAAI,SAAgB,GACnB,eAAe,EAAE,CAGnB;AAED,kEAAkE;AAClE;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,WAAW,EAAE,GAAG,SAAS,EACvC,IAAI,SAAiB,GACpB,eAAe,EAAE,CAenB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,GAAG,IAAI,CAY/E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI,CAW7E"}
@@ -17,6 +17,7 @@
17
17
  * See docs/spec/data-model.md § Capability-gated filters.
18
18
  */
19
19
  import { StackQueryError } from './errors.js';
20
+ import { associationEqual } from './record-changes.js';
20
21
  import { CONTENT_SEGMENT_METACHARACTERS, SEGMENT_METACHARACTER_RE } from './validate.js';
21
22
  import { NATIVE_SORT_FIELDS } from './types.js';
22
23
  /**
@@ -201,8 +202,29 @@ export function validateAssociation(association, path = 'association') {
201
202
  return targetErrors(association.target, `${path}.target`);
202
203
  }
203
204
  /** validateAssociation() over a create's `associations` array. */
205
+ /**
206
+ * Every association in a list, plus the one rule a list has that a single
207
+ * association does not: **identities are distinct**. A list naming one
208
+ * identity twice describes a state no store can hold — an adapter keys
209
+ * associations by identity, so the second entry displaces the first — and
210
+ * which of the two the record ends up with is a question the caller did
211
+ * not mean to ask. Refused rather than collapsed, for the reason an empty
212
+ * change set is refused: every way of producing one is a caller bug.
213
+ * See docs/spec/data-model.md § Associations.
214
+ */
204
215
  export function validateAssociations(associations, path = 'associations') {
205
- return (associations ?? []).flatMap((a, i) => validateAssociation(a, `${path}[${i}]`));
216
+ const list = associations ?? [];
217
+ return [
218
+ ...list.flatMap((a, i) => validateAssociation(a, `${path}[${i}]`)),
219
+ ...list.flatMap((a, i) => list.slice(0, i).some((b) => associationEqual(a, b))
220
+ ? [
221
+ {
222
+ path: `${path}[${i}]`,
223
+ message: `Duplicate association identity: ${a.kind} "${a.label}" is named more than once.`,
224
+ },
225
+ ]
226
+ : []),
227
+ ];
206
228
  }
207
229
  /**
208
230
  * Reject a relationship filter that names neither a label nor a target,
@@ -1 +1 @@
1
- {"version":3,"file":"query-validation.js","sourceRoot":"","sources":["../src/query-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAEzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAWhD;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAgC,EAChC,YAA2C;IAE3C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC;IACvE,IAAI,MAAM,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;QAC9B,MAAM,IAAI,eAAe,CACvB,2FAA2F,EAC3F,eAAe,CAChB,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;IACnF,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,OAAO;QAAE,OAAO;IACzC,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QACrB,oEAAoE;QACpE,kEAAkE;QAClE,MAAM,IAAI,eAAe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Ae,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AACtE,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAA+B;IACrE,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,KAAK,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,CAAU,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,KAAK,KAAK,SAAS;YAAE,SAAS;QAClC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YAC1C,MAAM,IAAI,eAAe,CACvB,mBAAmB,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,oCAAoC,CAC5E,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -12,7 +12,7 @@
12
12
  * See docs/spec/events.md § The event shape and docs/spec/versioning.md
13
13
  * § The tombstone is literal.
14
14
  */
15
- import type { Association, ChangeOp, EntityId, Permission, RecordChanges, RecordVersion, RelationshipTarget, StackRecord } from './types.js';
15
+ import type { Association, AssociationChange, ChangeOp, EntityId, Permission, RecordChanges, RecordVersion, RelationshipTarget, StackRecord } from './types.js';
16
16
  /**
17
17
  * Association identity — what dissociate() matches and a second associate()
18
18
  * of the same reference is a repeat of. Matches the SQLite adapter's
@@ -40,16 +40,28 @@ export declare function associationIdentical(a: Association, b: Association): bo
40
40
  export declare function stripAssociationAnnotation(association: Association): Association;
41
41
  /**
42
42
  * What a `changes.associations` list moves against a record's current
43
- * associations — the same comparison `changeSetOps` decides `associate`/
44
- * `dissociate` from, so a change event's added/removed lists can never
45
- * disagree with whether those ops fired. `added` is each entry as it now
46
- * stands (current annotation included, a re-point included under its new
47
- * value); `removed` is identity only, per stripAssociationAnnotation().
43
+ * associations, one tagged edit per association — the same comparison
44
+ * `changeSetOps` decides `associate`/`dissociate` from, so which ops fired
45
+ * and what these report can never disagree.
46
+ *
47
+ * An entry that matches something already there by identity displaced it
48
+ * rather than joining it, which is a `repoint`: the association is still
49
+ * on the record and only its annotation moved, so no `remove` can describe
50
+ * it. `previous` is the prior association in full, annotation included —
51
+ * the only place an overwritten or removed `attachmentRecordId` survives.
52
+ * See docs/spec/journal.md § The entry.
53
+ */
54
+ export declare function associationDelta(before: Association[], after: Association[]): AssociationChange[];
55
+ /**
56
+ * The two flat lists a change frame carries, derived from the tagged
57
+ * list. The feed reports what is true now, so a `repoint` appears only
58
+ * under its new value and a `remove` by identity alone — the prior state
59
+ * the journal keeps has no place on a notification.
60
+ * See docs/spec/events.md § The event shape.
48
61
  */
49
- export declare function associationDelta(before: Association[], after: Association[]): {
62
+ export declare function feedAssociationDelta(changes: AssociationChange[]): {
50
63
  added: Association[];
51
64
  removed: Association[];
52
- replaced: Association[];
53
65
  };
54
66
  /** Structural equality per target arm — what dissociate() matches on. */
55
67
  export declare function targetEqual(a: RelationshipTarget, b: RelationshipTarget): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"record-changes.d.ts","sourceRoot":"","sources":["../src/record-changes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAOxE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAM5E;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAIhF;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAA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