@syncular/server 0.0.1-122 → 0.0.1-124

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 (68) hide show
  1. package/dist/compaction.d.ts +1 -1
  2. package/dist/compaction.js +1 -1
  3. package/dist/{shapes → handlers}/create-handler.d.ts +5 -5
  4. package/dist/handlers/create-handler.d.ts.map +1 -0
  5. package/dist/{shapes → handlers}/create-handler.js +11 -1
  6. package/dist/handlers/create-handler.js.map +1 -0
  7. package/dist/handlers/index.d.ts.map +1 -0
  8. package/dist/handlers/index.js.map +1 -0
  9. package/dist/handlers/registry.d.ts.map +1 -0
  10. package/dist/handlers/registry.js.map +1 -0
  11. package/dist/{shapes → handlers}/types.d.ts +7 -7
  12. package/dist/{shapes → handlers}/types.d.ts.map +1 -1
  13. package/dist/{shapes → handlers}/types.js.map +1 -1
  14. package/dist/helpers/conflict.d.ts +1 -1
  15. package/dist/helpers/conflict.d.ts.map +1 -1
  16. package/dist/helpers/emitted-change.d.ts +1 -1
  17. package/dist/helpers/emitted-change.d.ts.map +1 -1
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/proxy/handler.d.ts +1 -1
  23. package/dist/proxy/handler.d.ts.map +1 -1
  24. package/dist/proxy/handler.js +7 -7
  25. package/dist/proxy/handler.js.map +1 -1
  26. package/dist/proxy/oplog.d.ts +1 -1
  27. package/dist/proxy/oplog.d.ts.map +1 -1
  28. package/dist/proxy/oplog.js +6 -6
  29. package/dist/proxy/oplog.js.map +1 -1
  30. package/dist/pull.d.ts +2 -2
  31. package/dist/pull.d.ts.map +1 -1
  32. package/dist/pull.js +9 -9
  33. package/dist/pull.js.map +1 -1
  34. package/dist/push.d.ts +2 -2
  35. package/dist/push.d.ts.map +1 -1
  36. package/dist/push.js +1 -1
  37. package/dist/push.js.map +1 -1
  38. package/dist/subscriptions/resolve.d.ts +6 -6
  39. package/dist/subscriptions/resolve.d.ts.map +1 -1
  40. package/dist/subscriptions/resolve.js +53 -14
  41. package/dist/subscriptions/resolve.js.map +1 -1
  42. package/package.json +2 -2
  43. package/src/compaction.ts +1 -1
  44. package/src/{shapes → handlers}/create-handler.ts +24 -4
  45. package/src/{shapes → handlers}/types.ts +10 -7
  46. package/src/helpers/conflict.ts +1 -1
  47. package/src/helpers/emitted-change.ts +1 -1
  48. package/src/index.ts +1 -1
  49. package/src/notify.test.ts +26 -26
  50. package/src/proxy/handler.test.ts +3 -3
  51. package/src/proxy/handler.ts +8 -8
  52. package/src/proxy/oplog.ts +7 -7
  53. package/src/pull.ts +11 -11
  54. package/src/push.ts +3 -3
  55. package/src/subscriptions/resolve.ts +73 -18
  56. package/dist/shapes/create-handler.d.ts.map +0 -1
  57. package/dist/shapes/create-handler.js.map +0 -1
  58. package/dist/shapes/index.d.ts.map +0 -1
  59. package/dist/shapes/index.js.map +0 -1
  60. package/dist/shapes/registry.d.ts.map +0 -1
  61. package/dist/shapes/registry.js.map +0 -1
  62. /package/dist/{shapes → handlers}/index.d.ts +0 -0
  63. /package/dist/{shapes → handlers}/index.js +0 -0
  64. /package/dist/{shapes → handlers}/registry.d.ts +0 -0
  65. /package/dist/{shapes → handlers}/registry.js +0 -0
  66. /package/dist/{shapes → handlers}/types.js +0 -0
  67. /package/src/{shapes → handlers}/index.ts +0 -0
  68. /package/src/{shapes → handlers}/registry.ts +0 -0
@@ -1,12 +1,12 @@
1
1
  import { afterEach, beforeEach, describe, expect, it } from 'bun:test';
2
2
  import { createBunSqliteDb } from '../../dialect-bun-sqlite/src';
3
3
  import { createSqliteServerDialect } from '../../server-dialect-sqlite/src';
4
+ import { createServerHandler } from './handlers';
5
+ import { TableRegistry } from './handlers/registry';
4
6
  import { ensureSyncSchema } from './migrate';
5
7
  import { EXTERNAL_CLIENT_ID, notifyExternalDataChange } from './notify';
6
8
  import { pull } from './pull';
7
9
  import type { SyncCoreDb } from './schema';
8
- import { createServerHandler } from './shapes';
9
- import { TableRegistry } from './shapes/registry';
10
10
 
11
11
  interface TasksTable {
12
12
  id: string;
@@ -227,14 +227,14 @@ describe('pull re-bootstrap after external data change', () => {
227
227
  resolveScopes: async () => ({ catalog_id: '*' }),
228
228
  });
229
229
 
230
- const shapes = new TableRegistry<TestDb>();
231
- shapes.register(codesHandler);
230
+ const handlers = new TableRegistry<TestDb>();
231
+ handlers.register(codesHandler);
232
232
 
233
233
  // 1. Initial bootstrap pull
234
234
  const firstPull = await pull({
235
235
  db,
236
236
  dialect,
237
- shapes,
237
+ handlers,
238
238
  actorId: 'u1',
239
239
  request: {
240
240
  clientId: 'client-1',
@@ -244,7 +244,7 @@ describe('pull re-bootstrap after external data change', () => {
244
244
  subscriptions: [
245
245
  {
246
246
  id: 'sub-codes',
247
- shape: 'codes',
247
+ table: 'codes',
248
248
  scopes: { catalog_id: 'icd' },
249
249
  cursor: -1,
250
250
  },
@@ -261,7 +261,7 @@ describe('pull re-bootstrap after external data change', () => {
261
261
  const incrementalPull = await pull({
262
262
  db,
263
263
  dialect,
264
- shapes,
264
+ handlers,
265
265
  actorId: 'u1',
266
266
  request: {
267
267
  clientId: 'client-1',
@@ -271,7 +271,7 @@ describe('pull re-bootstrap after external data change', () => {
271
271
  subscriptions: [
272
272
  {
273
273
  id: 'sub-codes',
274
- shape: 'codes',
274
+ table: 'codes',
275
275
  scopes: { catalog_id: 'icd' },
276
276
  cursor: cursorAfterBootstrap,
277
277
  },
@@ -295,7 +295,7 @@ describe('pull re-bootstrap after external data change', () => {
295
295
  const rebootstrapPull = await pull({
296
296
  db,
297
297
  dialect,
298
- shapes,
298
+ handlers,
299
299
  actorId: 'u1',
300
300
  request: {
301
301
  clientId: 'client-1',
@@ -305,7 +305,7 @@ describe('pull re-bootstrap after external data change', () => {
305
305
  subscriptions: [
306
306
  {
307
307
  id: 'sub-codes',
308
- shape: 'codes',
308
+ table: 'codes',
309
309
  scopes: { catalog_id: 'icd' },
310
310
  cursor: cursorAfterBootstrap,
311
311
  },
@@ -341,15 +341,15 @@ describe('pull re-bootstrap after external data change', () => {
341
341
  resolveScopes: async () => ({ catalog_id: '*' }),
342
342
  });
343
343
 
344
- const shapes = new TableRegistry<TestDb>();
345
- shapes.register(tasksHandler);
346
- shapes.register(codesHandler);
344
+ const handlers = new TableRegistry<TestDb>();
345
+ handlers.register(tasksHandler);
346
+ handlers.register(codesHandler);
347
347
 
348
348
  // 1. Bootstrap pull for tasks
349
349
  const firstPull = await pull({
350
350
  db,
351
351
  dialect,
352
- shapes,
352
+ handlers,
353
353
  actorId: 'u1',
354
354
  request: {
355
355
  clientId: 'client-1',
@@ -359,7 +359,7 @@ describe('pull re-bootstrap after external data change', () => {
359
359
  subscriptions: [
360
360
  {
361
361
  id: 'sub-tasks',
362
- shape: 'tasks',
362
+ table: 'tasks',
363
363
  scopes: { user_id: 'u1' },
364
364
  cursor: -1,
365
365
  },
@@ -381,7 +381,7 @@ describe('pull re-bootstrap after external data change', () => {
381
381
  const pullAfterNotify = await pull({
382
382
  db,
383
383
  dialect,
384
- shapes,
384
+ handlers,
385
385
  actorId: 'u1',
386
386
  request: {
387
387
  clientId: 'client-1',
@@ -391,7 +391,7 @@ describe('pull re-bootstrap after external data change', () => {
391
391
  subscriptions: [
392
392
  {
393
393
  id: 'sub-tasks',
394
- shape: 'tasks',
394
+ table: 'tasks',
395
395
  scopes: { user_id: 'u1' },
396
396
  cursor: cursorAfterBootstrap,
397
397
  },
@@ -437,15 +437,15 @@ describe('pull re-bootstrap after external data change', () => {
437
437
  resolveScopes: async () => ({ catalog_id: '*' }),
438
438
  });
439
439
 
440
- const shapes = new TableRegistry<TestDb>();
441
- shapes.register(tasksHandler);
442
- shapes.register(codesHandler);
440
+ const handlers = new TableRegistry<TestDb>();
441
+ handlers.register(tasksHandler);
442
+ handlers.register(codesHandler);
443
443
 
444
444
  // 1. Bootstrap both subscriptions
445
445
  const firstPull = await pull({
446
446
  db,
447
447
  dialect,
448
- shapes,
448
+ handlers,
449
449
  actorId: 'u1',
450
450
  request: {
451
451
  clientId: 'client-1',
@@ -455,13 +455,13 @@ describe('pull re-bootstrap after external data change', () => {
455
455
  subscriptions: [
456
456
  {
457
457
  id: 'sub-tasks',
458
- shape: 'tasks',
458
+ table: 'tasks',
459
459
  scopes: { user_id: 'u1' },
460
460
  cursor: -1,
461
461
  },
462
462
  {
463
463
  id: 'sub-codes',
464
- shape: 'codes',
464
+ table: 'codes',
465
465
  scopes: { catalog_id: 'icd' },
466
466
  cursor: -1,
467
467
  },
@@ -479,7 +479,7 @@ describe('pull re-bootstrap after external data change', () => {
479
479
  const pullAfter = await pull({
480
480
  db,
481
481
  dialect,
482
- shapes,
482
+ handlers,
483
483
  actorId: 'u1',
484
484
  request: {
485
485
  clientId: 'client-1',
@@ -489,13 +489,13 @@ describe('pull re-bootstrap after external data change', () => {
489
489
  subscriptions: [
490
490
  {
491
491
  id: 'sub-tasks',
492
- shape: 'tasks',
492
+ table: 'tasks',
493
493
  scopes: { user_id: 'u1' },
494
494
  cursor: tasksCursor,
495
495
  },
496
496
  {
497
497
  id: 'sub-codes',
498
- shape: 'codes',
498
+ table: 'codes',
499
499
  scopes: { catalog_id: 'icd' },
500
500
  cursor: codesCursor,
501
501
  },
@@ -21,7 +21,7 @@ interface ProxyTestDb extends SyncCoreDb {
21
21
  describe('executeProxyQuery', () => {
22
22
  let db: Kysely<ProxyTestDb>;
23
23
  const dialect = createSqliteServerDialect();
24
- const shapes = new ProxyTableRegistry().register({
24
+ const handlers = new ProxyTableRegistry().register({
25
25
  table: 'tasks',
26
26
  computeScopes: (row) => ({
27
27
  user_id: String(row.user_id),
@@ -59,7 +59,7 @@ describe('executeProxyQuery', () => {
59
59
  const result = await executeProxyQuery({
60
60
  db,
61
61
  dialect,
62
- shapes,
62
+ handlers,
63
63
  ctx: { actorId: 'actor-1', clientId: 'proxy-client-1' },
64
64
  sqlQuery:
65
65
  '/* admin */ UPDATE tasks SET title = $1, server_version = server_version + 1 WHERE id = $2',
@@ -95,7 +95,7 @@ describe('executeProxyQuery', () => {
95
95
  executeProxyQuery({
96
96
  db,
97
97
  dialect,
98
- shapes,
98
+ handlers,
99
99
  ctx: { actorId: 'actor-1', clientId: 'proxy-client-1' },
100
100
  sqlQuery: 'UPDATE tasks SET title = $1 WHERE id = $2 RETURNING id',
101
101
  parameters: ['blocked title', 't1'],
@@ -24,7 +24,7 @@ export interface ExecuteProxyQueryArgs<DB extends SyncCoreDb = SyncCoreDb> {
24
24
  /** Server sync dialect */
25
25
  dialect: ServerSyncDialect;
26
26
  /** Proxy table registry for oplog generation */
27
- shapes: ProxyTableRegistry;
27
+ handlers: ProxyTableRegistry;
28
28
  /** Query context (actor/client IDs) */
29
29
  ctx: ProxyQueryContext;
30
30
  /** SQL query string */
@@ -100,7 +100,7 @@ function buildRawQuery(
100
100
  export async function executeProxyQuery<DB extends SyncCoreDb>(
101
101
  args: ExecuteProxyQueryArgs<DB>
102
102
  ): Promise<ExecuteProxyQueryResult> {
103
- const { db, dialect, shapes, ctx, sqlQuery, parameters } = args;
103
+ const { db, dialect, handlers, ctx, sqlQuery, parameters } = args;
104
104
 
105
105
  const mutation = detectMutation(sqlQuery);
106
106
 
@@ -110,10 +110,10 @@ export async function executeProxyQuery<DB extends SyncCoreDb>(
110
110
  return { rows: result.rows };
111
111
  }
112
112
 
113
- // Check if this table has a registered shape
114
- const shape = shapes.get(mutation.tableName);
115
- if (!shape) {
116
- // No shape registered - execute without oplog
113
+ // Check if this table has a registered handler
114
+ const handler = handlers.get(mutation.tableName);
115
+ if (!handler) {
116
+ // No handler registered - execute without oplog
117
117
  // This allows proxy operations on non-synced tables
118
118
  const result = await buildRawQuery(sqlQuery, parameters).execute(db);
119
119
  return {
@@ -122,7 +122,7 @@ export async function executeProxyQuery<DB extends SyncCoreDb>(
122
122
  };
123
123
  }
124
124
 
125
- // Mutation with registered shape - append RETURNING * and create oplog
125
+ // Mutation with registered handler - append RETURNING * and create oplog
126
126
  const hasReturning = hasReturningClause(sqlQuery);
127
127
  if (hasReturning && !hasReturningWildcard(sqlQuery)) {
128
128
  throw new Error(
@@ -146,7 +146,7 @@ export async function executeProxyQuery<DB extends SyncCoreDb>(
146
146
  actorId: ctx.actorId,
147
147
  clientId: ctx.clientId,
148
148
  partitionId: ctx.partitionId,
149
- shape,
149
+ handler,
150
150
  operation: mutation.operation,
151
151
  rows: affectedRows,
152
152
  });
@@ -30,19 +30,19 @@ export async function createOplogEntries<DB extends SyncCoreDb>(args: {
30
30
  actorId: string;
31
31
  clientId: string;
32
32
  partitionId?: string;
33
- shape: ProxyTableHandler;
33
+ handler: ProxyTableHandler;
34
34
  operation: SyncOp;
35
35
  rows: Record<string, unknown>[];
36
36
  }): Promise<{ commitSeq: number; affectedTables: string[] }> {
37
- const { trx, dialect, actorId, clientId, shape, operation, rows } = args;
37
+ const { trx, dialect, actorId, clientId, handler, operation, rows } = args;
38
38
  const partitionId = args.partitionId ?? 'default';
39
39
 
40
40
  if (rows.length === 0) {
41
41
  return { commitSeq: 0, affectedTables: [] };
42
42
  }
43
43
 
44
- const pk = shape.primaryKey ?? 'id';
45
- const versionCol = shape.versionColumn ?? 'server_version';
44
+ const pk = handler.primaryKey ?? 'id';
45
+ const versionCol = handler.versionColumn ?? 'server_version';
46
46
 
47
47
  // Create commit record
48
48
  const commitResult = await sql<{ commit_seq: number }>`
@@ -73,15 +73,15 @@ export async function createOplogEntries<DB extends SyncCoreDb>(args: {
73
73
 
74
74
  // Compute scopes for all rows and collect changes
75
75
  const affectedTablesSet = new Set<string>();
76
- affectedTablesSet.add(shape.table);
76
+ affectedTablesSet.add(handler.table);
77
77
 
78
78
  const changes = rows.map((row) => {
79
- const scopes = shape.computeScopes(row);
79
+ const scopes = handler.computeScopes(row);
80
80
 
81
81
  return {
82
82
  commit_seq: commitSeq,
83
83
  partition_id: partitionId,
84
- table: shape.table,
84
+ table: handler.table,
85
85
  row_id: String(row[pk]),
86
86
  op: operation,
87
87
  row_json: operation === 'delete' ? null : row,
package/src/pull.ts CHANGED
@@ -21,9 +21,9 @@ import {
21
21
  } from '@syncular/core';
22
22
  import type { Kysely } from 'kysely';
23
23
  import type { DbExecutor, ServerSyncDialect } from './dialect/types';
24
+ import type { TableRegistry } from './handlers/registry';
24
25
  import { EXTERNAL_CLIENT_ID } from './notify';
25
26
  import type { SyncCoreDb } from './schema';
26
- import type { TableRegistry } from './shapes/registry';
27
27
  import {
28
28
  insertSnapshotChunk,
29
29
  readSnapshotChunkRefByPageKey,
@@ -302,7 +302,7 @@ async function readExternalDataChanges<DB extends SyncCoreDb>(
302
302
  export async function pull<DB extends SyncCoreDb>(args: {
303
303
  db: Kysely<DB>;
304
304
  dialect: ServerSyncDialect;
305
- shapes: TableRegistry<DB>;
305
+ handlers: TableRegistry<DB>;
306
306
  actorId: string;
307
307
  partitionId?: string;
308
308
  request: SyncPullRequest;
@@ -353,7 +353,7 @@ export async function pull<DB extends SyncCoreDb>(args: {
353
353
  db,
354
354
  actorId: args.actorId,
355
355
  subscriptions: request.subscriptions ?? [],
356
- shapes: args.shapes,
356
+ handlers: args.handlers,
357
357
  });
358
358
 
359
359
  const result = await dialect.executeInTransaction(db, async (trx) => {
@@ -395,8 +395,8 @@ export async function pull<DB extends SyncCoreDb>(args: {
395
395
 
396
396
  for (const sub of resolved) {
397
397
  const cursor = Math.max(-1, sub.cursor ?? -1);
398
- // Validate shape exists (throws if not registered)
399
- args.shapes.getOrThrow(sub.shape);
398
+ // Validate table handler exists (throws if not registered)
399
+ args.handlers.getOrThrow(sub.table);
400
400
 
401
401
  if (
402
402
  sub.status === 'revoked' ||
@@ -422,12 +422,12 @@ export async function pull<DB extends SyncCoreDb>(args: {
422
422
  cursor > maxCommitSeq ||
423
423
  (minCommitSeq > 0 && cursor < minCommitSeq - 1) ||
424
424
  externalDataChanges.some(
425
- (c) => c.commitSeq > cursor && c.tables.includes(sub.shape)
425
+ (c) => c.commitSeq > cursor && c.tables.includes(sub.table)
426
426
  );
427
427
 
428
428
  if (needsBootstrap) {
429
- const tables = args.shapes
430
- .getBootstrapOrderFor(sub.shape)
429
+ const tables = args.handlers
430
+ .getBootstrapOrderFor(sub.table)
431
431
  .map((handler) => handler.table);
432
432
 
433
433
  const initState: SyncBootstrapState = {
@@ -601,7 +601,7 @@ export async function pull<DB extends SyncCoreDb>(args: {
601
601
  break;
602
602
  }
603
603
 
604
- const tableHandler = args.shapes.getOrThrow(nextTableName);
604
+ const tableHandler = args.handlers.getOrThrow(nextTableName);
605
605
  if (!activeBundle || activeBundle.table !== nextTableName) {
606
606
  if (activeBundle) {
607
607
  await flushSnapshotBundle(activeBundle);
@@ -685,7 +685,7 @@ export async function pull<DB extends SyncCoreDb>(args: {
685
685
  partitionId,
686
686
  cursor,
687
687
  limitCommits,
688
- tables: [sub.shape],
688
+ tables: [sub.table],
689
689
  });
690
690
  const maxScannedCommitSeq =
691
691
  scannedCommitSeqs.length > 0
@@ -710,7 +710,7 @@ export async function pull<DB extends SyncCoreDb>(args: {
710
710
 
711
711
  for await (const row of dialect.iterateIncrementalPullRows(trx, {
712
712
  partitionId,
713
- table: sub.shape,
713
+ table: sub.table,
714
714
  scopes: effectiveScopes,
715
715
  cursor,
716
716
  limitCommits,
package/src/push.ts CHANGED
@@ -16,8 +16,8 @@ import type {
16
16
  } from 'kysely';
17
17
  import { sql } from 'kysely';
18
18
  import type { ServerSyncDialect } from './dialect/types';
19
+ import type { TableRegistry } from './handlers/registry';
19
20
  import type { SyncCoreDb } from './schema';
20
- import type { TableRegistry } from './shapes/registry';
21
21
 
22
22
  // biome-ignore lint/complexity/noBannedTypes: Kysely uses `{}` as the initial "no selected columns yet" marker.
23
23
  type EmptySelection = {};
@@ -136,7 +136,7 @@ function recordPushMetrics(args: {
136
136
  export async function pushCommit<DB extends SyncCoreDb>(args: {
137
137
  db: Kysely<DB>;
138
138
  dialect: ServerSyncDialect;
139
- shapes: TableRegistry<DB>;
139
+ handlers: TableRegistry<DB>;
140
140
  actorId: string;
141
141
  partitionId?: string;
142
142
  request: SyncPushRequest;
@@ -377,7 +377,7 @@ export async function pushCommit<DB extends SyncCoreDb>(args: {
377
377
 
378
378
  for (let i = 0; i < ops.length; i++) {
379
379
  const op = ops[i]!;
380
- const handler = args.shapes.getOrThrow(op.table);
380
+ const handler = args.handlers.getOrThrow(op.table);
381
381
  const applied = await handler.applyOperation(
382
382
  {
383
383
  db: trx,
@@ -1,7 +1,11 @@
1
- import type { ScopeValues, SyncSubscriptionRequest } from '@syncular/core';
1
+ import {
2
+ extractScopeVars,
3
+ type ScopeValues,
4
+ type SyncSubscriptionRequest,
5
+ } from '@syncular/core';
2
6
  import type { Kysely } from 'kysely';
7
+ import type { TableRegistry } from '../handlers/registry';
3
8
  import type { SyncCoreDb } from '../schema';
4
- import type { TableRegistry } from '../shapes/registry';
5
9
 
6
10
  export class InvalidSubscriptionScopeError extends Error {
7
11
  constructor(message: string) {
@@ -15,7 +19,7 @@ export class InvalidSubscriptionScopeError extends Error {
15
19
  */
16
20
  export interface ResolvedSubscription {
17
21
  id: string;
18
- shape: string;
22
+ table: string;
19
23
  scopes: ScopeValues;
20
24
  params: Record<string, unknown> | undefined;
21
25
  cursor: number;
@@ -83,12 +87,46 @@ function scopesEmpty(scopes: ScopeValues): boolean {
83
87
  return true;
84
88
  }
85
89
 
90
+ /**
91
+ * Collect valid scope keys from handler scope patterns.
92
+ */
93
+ function collectScopeKeys(scopePatterns: readonly string[]): Set<string> {
94
+ const keys = new Set<string>();
95
+ for (const pattern of scopePatterns) {
96
+ for (const key of extractScopeVars(pattern)) {
97
+ keys.add(key);
98
+ }
99
+ }
100
+ return keys;
101
+ }
102
+
103
+ function validateScopeKeys(args: {
104
+ scopeValues: ScopeValues;
105
+ validScopeKeys: Set<string>;
106
+ source: string;
107
+ subscriptionId: string;
108
+ table: string;
109
+ }): void {
110
+ for (const scopeKey of Object.keys(args.scopeValues)) {
111
+ if (args.validScopeKeys.has(scopeKey)) {
112
+ continue;
113
+ }
114
+ const expectedKeys =
115
+ args.validScopeKeys.size > 0
116
+ ? Array.from(args.validScopeKeys).sort().join(', ')
117
+ : '(none)';
118
+ throw new InvalidSubscriptionScopeError(
119
+ `Invalid scope key "${scopeKey}" in ${args.source} for subscription "${args.subscriptionId}" on table "${args.table}". Expected keys: ${expectedKeys}`
120
+ );
121
+ }
122
+ }
123
+
86
124
  /**
87
125
  * Resolve effective scopes for subscriptions.
88
126
  *
89
127
  * For each subscription:
90
- * 1. Look up the shape by subscription.shape
91
- * 2. Call shape.resolveScopes() to get allowed scopes for this actor
128
+ * 1. Look up the table handler by subscription.table
129
+ * 2. Call handler.resolveScopes() to get allowed scopes for this actor
92
130
  * 3. Intersect requested scopes with allowed scopes
93
131
  * 4. Mark as revoked if no effective scopes
94
132
  */
@@ -98,7 +136,7 @@ export async function resolveEffectiveScopesForSubscriptions<
98
136
  db: Kysely<DB>;
99
137
  actorId: string;
100
138
  subscriptions: SyncSubscriptionRequest[];
101
- shapes: TableRegistry<DB>;
139
+ handlers: TableRegistry<DB>;
102
140
  }): Promise<ResolvedSubscription[]> {
103
141
  const out: ResolvedSubscription[] = [];
104
142
  const seenIds = new Set<string>();
@@ -114,23 +152,33 @@ export async function resolveEffectiveScopesForSubscriptions<
114
152
  }
115
153
  seenIds.add(sub.id);
116
154
 
117
- if (!sub.shape || typeof sub.shape !== 'string') {
155
+ if (!sub.table || typeof sub.table !== 'string') {
118
156
  throw new InvalidSubscriptionScopeError(
119
- `Subscription ${sub.id} requires a shape (table name)`
157
+ `Subscription ${sub.id} requires a table name`
120
158
  );
121
159
  }
122
160
 
123
- const shape = args.shapes.get(sub.shape);
124
- if (!shape) {
161
+ const handler = args.handlers.get(sub.table);
162
+ if (!handler) {
125
163
  throw new InvalidSubscriptionScopeError(
126
- `Unknown shape: ${sub.shape} for subscription ${sub.id}`
164
+ `Unknown table: ${sub.table} for subscription ${sub.id}`
127
165
  );
128
166
  }
129
167
 
130
- // Get allowed scopes from the shape
168
+ const validScopeKeys = collectScopeKeys(handler.scopePatterns);
169
+ const requested = sub.scopes ?? {};
170
+ validateScopeKeys({
171
+ scopeValues: requested,
172
+ validScopeKeys,
173
+ source: 'requested scopes',
174
+ subscriptionId: sub.id,
175
+ table: sub.table,
176
+ });
177
+
178
+ // Get allowed scopes from the handler
131
179
  let allowed: ScopeValues;
132
180
  try {
133
- allowed = await shape.resolveScopes({
181
+ allowed = await handler.resolveScopes({
134
182
  db: args.db,
135
183
  actorId: args.actorId,
136
184
  });
@@ -138,12 +186,12 @@ export async function resolveEffectiveScopesForSubscriptions<
138
186
  // Scope resolution failed - mark subscription as revoked
139
187
  // rather than failing the entire pull
140
188
  console.error(
141
- `[resolveScopes] Failed for shape ${sub.shape}, subscription ${sub.id}:`,
189
+ `[resolveScopes] Failed for table ${sub.table}, subscription ${sub.id}:`,
142
190
  resolveErr
143
191
  );
144
192
  out.push({
145
193
  id: sub.id,
146
- shape: sub.shape,
194
+ table: sub.table,
147
195
  scopes: {},
148
196
  params: sub.params,
149
197
  cursor: sub.cursor,
@@ -153,14 +201,21 @@ export async function resolveEffectiveScopesForSubscriptions<
153
201
  continue;
154
202
  }
155
203
 
204
+ validateScopeKeys({
205
+ scopeValues: allowed,
206
+ validScopeKeys,
207
+ source: 'resolveScopes() result',
208
+ subscriptionId: sub.id,
209
+ table: sub.table,
210
+ });
211
+
156
212
  // Intersect with requested scopes
157
- const requested = sub.scopes ?? {};
158
213
  const effective = intersectScopes(requested, allowed);
159
214
 
160
215
  if (scopesEmpty(effective)) {
161
216
  out.push({
162
217
  id: sub.id,
163
- shape: sub.shape,
218
+ table: sub.table,
164
219
  scopes: {},
165
220
  params: sub.params,
166
221
  cursor: sub.cursor,
@@ -172,7 +227,7 @@ export async function resolveEffectiveScopesForSubscriptions<
172
227
 
173
228
  out.push({
174
229
  id: sub.id,
175
- shape: sub.shape,
230
+ table: sub.table,
176
231
  scopes: effective,
177
232
  params: sub.params,
178
233
  cursor: sub.cursor,
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-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B,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,UAAU,GAAG,OAAO,CAAC;QAC3B,MAAM,UAAU,GAAI,UAAU,CAAC,aAAa,CAAY,IAAI,CAAC,CAAC;QAE9D,kCAAkC;QAClC,MAAM,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAE7C,wCAAwC;QACxC,MAAM,OAAO,GAAG,iBAAiB;YAC/B,CAAC,CAAC,iBAAiB,CAAC,OAA0C,CAAC;YAC/D,CAAC,CAAC,OAAO,CAAC;QAEZ,MAAM,OAAO,GAAkB;YAC7B,KAAK;YACL,MAAM,EAAE,EAAE,CAAC,MAAM;YACjB,EAAE,EAAE,QAAQ;YACZ,QAAQ,EAAE,OAAO;YACjB,WAAW,EAAE,UAAU;YACvB,MAAM;SACP,CAAC;QAEF,OAAO;YACL,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE;YACtC,cAAc,EAAE,CAAC,OAAO,CAAC;SAC1B,CAAC;IAAA,CACH,CAAC;IAEF,OAAO;QACL,KAAK;QACL,aAAa;QACb,SAAS;QACT,kBAAkB;QAClB,aAAa;QACb,aAAa,EAAE,iBAAiB;QAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,eAAe;QAC7C,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,qBAAqB;KAChE,CAAC;AAAA,CACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shapes/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shapes/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/shapes/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,qBAAa,aAAa,CAAC,EAAE,SAAS,UAAU,GAAG,UAAU;IAC3D,OAAO,CAAC,MAAM,CAA6C;IAE3D,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC,EAAE,CAAC,GAAG,IAAI,CAgB9C;IAED,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,CAAC,EAAE,CAAC,GAAG,SAAS,CAErD;IAED,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,CAAC,EAAE,CAAC,CAIhD;IAED,MAAM,IAAI,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAEjC;IAED;;;OAGG;IACH,iBAAiB,IAAI,kBAAkB,CAAC,EAAE,CAAC,EAAE,CA8B5C;IAED;;;OAGG;IACH,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,CAAC,EAAE,CAAC,EAAE,CA6B5D;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/shapes/registry.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,aAAa;IAChB,MAAM,GAAG,IAAI,GAAG,EAAkC,CAAC;IAE3D,QAAQ,CAAC,OAA+B,EAAQ;QAC9C,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,UAAU,OAAO,CAAC,KAAK,yBAAyB,CAAC,CAAC;QACpE,CAAC;QAED,8BAA8B;QAC9B,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,SAAS,IAA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,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACnB,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC;gBAC1C,KAAK,CAAC,GAAG,CAAC,CAAC;YACb,CAAC;YACD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACtB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAAA,CACtB,CAAC;QAEF,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,OAAO,MAAM,CAAC;IAAA,CACf;CACF"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes