@jini-ai/cms 0.3.10 → 0.3.11

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.
@@ -146,8 +146,10 @@ export interface WriteServiceDeps {
146
146
  terms: TermRepoPort;
147
147
  entryTerms: EntryTermRepoPort;
148
148
  revisions: TaxonomyRevisionRepoPort;
149
- /** `core/gated-mutations.stampWatermark`-shaped, injected — same-transaction stamp per mutation. */
150
- stampWatermark: (tx?: unknown) => void;
149
+ /** `core/gated-mutations.stampWatermark`-shaped, injected — same-transaction stamp per mutation.
150
+ * May be sync (SQLite) or async (PGlite/Postgres); every call site awaits it, so an async stamp
151
+ * finishes, and its failure fails the write, before the mutation returns. */
152
+ stampWatermark: (tx?: unknown) => Promise<void> | void;
151
153
  outbox: {
152
154
  enqueue: (event: unknown) => Promise<void>;
153
155
  };
@@ -73,7 +73,7 @@ export async function createTaxonomy(required, _optional = {}) {
73
73
  actorId: principalId,
74
74
  recordedAt: now,
75
75
  });
76
- deps.stampWatermark();
76
+ await deps.stampWatermark();
77
77
  await deps.outbox.enqueue({ name: "taxonomy.created", taxonomyId: taxonomy.id, actorId: principalId, occurredAt: now });
78
78
  return taxonomy;
79
79
  }
@@ -114,7 +114,7 @@ export async function createTerm(required, _optional = {}) {
114
114
  };
115
115
  await deps.terms.insert(term);
116
116
  await deps.revisions.insert({ taxonomyId, op: "create", previousState: null, actorId: principalId, recordedAt: now });
117
- deps.stampWatermark();
117
+ await deps.stampWatermark();
118
118
  await deps.outbox.enqueue({ name: "taxonomy.term_created", termId: term.id, actorId: principalId, occurredAt: now });
119
119
  return term;
120
120
  }
@@ -167,7 +167,7 @@ export async function importTaxonomy(required, _optional = {}) {
167
167
  actorId: principalId,
168
168
  recordedAt: now,
169
169
  });
170
- deps.stampWatermark();
170
+ await deps.stampWatermark();
171
171
  await deps.outbox.enqueue({ name: "taxonomy.imported", taxonomyId: taxonomy.id, actorId: principalId, occurredAt: now });
172
172
  return taxonomy;
173
173
  }
@@ -265,7 +265,7 @@ export async function importTerm(required, _optional = {}) {
265
265
  actorId: principalId,
266
266
  recordedAt: now,
267
267
  });
268
- deps.stampWatermark();
268
+ await deps.stampWatermark();
269
269
  await deps.outbox.enqueue({ name: "taxonomy.term_imported", termId: term.id, actorId: principalId, occurredAt: now });
270
270
  return term;
271
271
  }
@@ -297,7 +297,7 @@ export async function renameTerm(required, _optional = {}) {
297
297
  actorId: principalId,
298
298
  recordedAt: now,
299
299
  });
300
- deps.stampWatermark();
300
+ await deps.stampWatermark();
301
301
  await deps.outbox.enqueue({ name: "taxonomy.term_renamed", termId, actorId: principalId, occurredAt: now });
302
302
  return updated;
303
303
  }
@@ -368,7 +368,7 @@ export async function assignTerms(required, _optional = {}) {
368
368
  for (const termId of termIds) {
369
369
  await deps.entryTerms.upsert({ contentType, contentId, termId, addedAt: now });
370
370
  }
371
- deps.stampWatermark();
371
+ await deps.stampWatermark();
372
372
  await deps.outbox.enqueue({
373
373
  name: "taxonomy.terms_assigned",
374
374
  contentType,
@@ -394,7 +394,7 @@ export async function unassignTerms(required, _optional = {}) {
394
394
  await deps.entryTerms.remove({ contentType, contentId, termId });
395
395
  }
396
396
  const now = deps.clock.nowIso();
397
- deps.stampWatermark();
397
+ await deps.stampWatermark();
398
398
  await deps.outbox.enqueue({
399
399
  name: "taxonomy.terms_unassigned",
400
400
  contentType,
@@ -494,7 +494,7 @@ export async function deleteTerm(required, _optional = {}) {
494
494
  actorId: principalId,
495
495
  recordedAt: now,
496
496
  });
497
- deps.stampWatermark();
497
+ await deps.stampWatermark();
498
498
  await deps.outbox.enqueue({
499
499
  name: "taxonomy.term_deleted",
500
500
  termId,
@@ -553,7 +553,7 @@ export async function deleteTaxonomy(required, _optional = {}) {
553
553
  actorId: principalId,
554
554
  recordedAt: now,
555
555
  });
556
- deps.stampWatermark();
556
+ await deps.stampWatermark();
557
557
  await deps.outbox.enqueue({
558
558
  name: "taxonomy.deleted",
559
559
  taxonomyId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/cms",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
4
4
  "description": "Content-model capability for Jini-hosted products: framework-free contracts, ports, and domain services in `/core` and per-domain subpaths; Node-bound persistence adapters in `/server`.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {