@abloatai/transaction 0.55.0 → 0.56.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.
Files changed (45) hide show
  1. package/dist/auth/hostedEndpoints.d.ts +21 -5
  2. package/dist/auth/hostedEndpoints.d.ts.map +1 -1
  3. package/dist/auth/hostedEndpoints.js +21 -5
  4. package/dist/auth/hostedEndpoints.js.map +1 -1
  5. package/dist/auth/index.d.ts +1 -1
  6. package/dist/auth/index.d.ts.map +1 -1
  7. package/dist/auth/index.js +1 -1
  8. package/dist/auth/index.js.map +1 -1
  9. package/dist/coordination/index.d.ts +1 -1
  10. package/dist/coordination/index.d.ts.map +1 -1
  11. package/dist/coordination/index.js +1 -1
  12. package/dist/coordination/index.js.map +1 -1
  13. package/dist/coordination/schema.d.ts +6 -2
  14. package/dist/coordination/schema.d.ts.map +1 -1
  15. package/dist/coordination/schema.js +8 -5
  16. package/dist/coordination/schema.js.map +1 -1
  17. package/dist/errors.d.ts.map +1 -1
  18. package/dist/errors.js +4 -1
  19. package/dist/errors.js.map +1 -1
  20. package/dist/log/syncDeltaRow.d.ts +3 -3
  21. package/dist/resources/writeOptionsSchema.d.ts.map +1 -1
  22. package/dist/resources/writeOptionsSchema.js +3 -2
  23. package/dist/resources/writeOptionsSchema.js.map +1 -1
  24. package/dist/syncLog/contract.d.ts +50 -2
  25. package/dist/syncLog/contract.d.ts.map +1 -1
  26. package/dist/syncLog/contract.js +50 -4
  27. package/dist/syncLog/contract.js.map +1 -1
  28. package/dist/wire/auth.d.ts.map +1 -1
  29. package/dist/wire/auth.js +6 -3
  30. package/dist/wire/auth.js.map +1 -1
  31. package/dist/wire/commit.js +5 -4
  32. package/dist/wire/commit.js.map +1 -1
  33. package/dist/wire/modelMutations.js +3 -2
  34. package/dist/wire/modelMutations.js.map +1 -1
  35. package/package.json +1 -1
  36. package/src/auth/hostedEndpoints.ts +23 -5
  37. package/src/auth/index.ts +2 -0
  38. package/src/coordination/index.ts +1 -1
  39. package/src/coordination/schema.ts +10 -6
  40. package/src/errors.ts +4 -1
  41. package/src/resources/writeOptionsSchema.ts +2 -2
  42. package/src/syncLog/contract.ts +54 -5
  43. package/src/wire/auth.ts +6 -3
  44. package/src/wire/commit.ts +4 -4
  45. package/src/wire/modelMutations.ts +2 -2
package/src/wire/auth.ts CHANGED
@@ -34,9 +34,12 @@ export const ephemeralKeyRequestSchema = z.object({
34
34
  /** The participant this session acts as. */
35
35
  user: ephemeralKeyUserSchema,
36
36
  /**
37
- * Mint into this organization instead of the caller's own. Requires the
38
- * `organization:act-as` scope without it a secret key can never mint a
39
- * session into another tenant.
37
+ * Open the session in a DIFFERENT organization, one the caller does not
38
+ * belong to. Requires the `organization:act-as` scope. This is the identity
39
+ * provider case, where each organization is an account in its own right.
40
+ *
41
+ * A platform serving its own customers does not use this: its customers are
42
+ * rows in its own schema, and a session reaches them through `syncGroups`.
40
43
  */
41
44
  organizationId: z.string().min(1).optional(),
42
45
  /**
@@ -18,6 +18,7 @@
18
18
  */
19
19
 
20
20
  import { z } from 'zod';
21
+ import { logPositionSchema } from '../syncLog/contract.js';
21
22
  import {
22
23
  onStaleModeSchema,
23
24
  MAX_READ_SET_ENTRIES,
@@ -25,7 +26,6 @@ import {
25
26
  readSetRowTargetSchema,
26
27
  readSetProjectionEntryCount,
27
28
  readSetSchema,
28
- readSetWatermarkSchema,
29
29
  participantKindSchema,
30
30
  staleNotificationSchema,
31
31
  trackDependencyListSchema,
@@ -61,7 +61,7 @@ export const confirmedCommitStatusSchema = z
61
61
  .strictObject({
62
62
  status: confirmedStatusSchema,
63
63
  statusAt: commitTimestampSchema,
64
- lastSyncId: readSetWatermarkSchema,
64
+ lastSyncId: logPositionSchema,
65
65
  correlationId: correlationIdSchema.optional(),
66
66
  })
67
67
  .refine(({ correlationId, lastSyncId }) => correlationId === undefined || lastSyncId > 0, {
@@ -375,7 +375,7 @@ export type MutationCommitResult = z.infer<typeof mutationCommitResultSchema>;
375
375
  export const clientCommitReceiptSchema = z.strictObject({
376
376
  id: z.string().min(1),
377
377
  status: z.union([queuedStatusSchema, confirmedStatusSchema]),
378
- lastSyncId: readSetWatermarkSchema.optional(),
378
+ lastSyncId: logPositionSchema.optional(),
379
379
  notifications: notificationsSchema.optional(),
380
380
  missingIds: missingIdsSchema.optional(),
381
381
  operationResults: operationResultsSchema.optional(),
@@ -400,7 +400,7 @@ export const commitOperationControlShape = {
400
400
  id: z.string().nullish(),
401
401
  transactionId: z.string().nullish(),
402
402
  claimId: z.string().min(1).nullish(),
403
- readAt: readSetWatermarkSchema.nullish(),
403
+ readAt: logPositionSchema.nullish(),
404
404
  onStale: onStaleModeSchema.nullish(),
405
405
  fenceToken: z.number().nullish(),
406
406
  };
@@ -16,12 +16,12 @@
16
16
  */
17
17
 
18
18
  import { z } from 'zod';
19
+ import { logPositionSchema } from '../syncLog/contract.js';
19
20
  import {
20
21
  onStaleModeSchema,
21
22
  MAX_READ_SET_ENTRIES,
22
23
  readDependencyListSchema,
23
24
  readSetProjectionEntryCount,
24
- readSetWatermarkSchema,
25
25
  trackDependencyListSchema,
26
26
  } from '../coordination/schema.js';
27
27
 
@@ -50,7 +50,7 @@ export const modelMutationRequestSchema = z.object({
50
50
  * the read. Ablo rejects the write if the row moved in between, which is
51
51
  * what makes read → decide → write safe without a lock across the deciding.
52
52
  */
53
- readAt: readSetWatermarkSchema.nullish(),
53
+ readAt: logPositionSchema.nullish(),
54
54
  /** Commit-lifetime dependencies checked with the single model operation. */
55
55
  reads: readDependencyListSchema.nullish(),
56
56
  /** Durable dependencies registered with the single model operation. */