@powersync/service-core 0.5.1 → 0.7.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 (44) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/routes/configure-fastify.d.ts +712 -0
  3. package/dist/routes/configure-fastify.js +57 -0
  4. package/dist/routes/configure-fastify.js.map +1 -0
  5. package/dist/routes/configure-rsocket.d.ts +13 -0
  6. package/dist/routes/configure-rsocket.js +46 -0
  7. package/dist/routes/configure-rsocket.js.map +1 -0
  8. package/dist/routes/endpoints/admin.d.ts +0 -34
  9. package/dist/routes/endpoints/admin.js +2 -22
  10. package/dist/routes/endpoints/admin.js.map +1 -1
  11. package/dist/routes/endpoints/route-endpoints-index.d.ts +0 -1
  12. package/dist/routes/endpoints/route-endpoints-index.js +0 -1
  13. package/dist/routes/endpoints/route-endpoints-index.js.map +1 -1
  14. package/dist/routes/endpoints/socket-route.js +3 -10
  15. package/dist/routes/endpoints/socket-route.js.map +1 -1
  16. package/dist/routes/route-register.d.ts +1 -1
  17. package/dist/routes/route-register.js +1 -1
  18. package/dist/routes/route-register.js.map +1 -1
  19. package/dist/routes/router-socket.d.ts +4 -4
  20. package/dist/routes/router-socket.js.map +1 -1
  21. package/dist/routes/router.d.ts +1 -0
  22. package/dist/routes/router.js.map +1 -1
  23. package/dist/routes/routes-index.d.ts +2 -0
  24. package/dist/routes/routes-index.js +2 -0
  25. package/dist/routes/routes-index.js.map +1 -1
  26. package/dist/sync/sync-index.d.ts +1 -0
  27. package/dist/sync/sync-index.js +1 -0
  28. package/dist/sync/sync-index.js.map +1 -1
  29. package/package.json +3 -3
  30. package/src/routes/configure-fastify.ts +101 -0
  31. package/src/routes/configure-rsocket.ts +59 -0
  32. package/src/routes/endpoints/admin.ts +2 -24
  33. package/src/routes/endpoints/route-endpoints-index.ts +0 -1
  34. package/src/routes/endpoints/socket-route.ts +3 -10
  35. package/src/routes/route-register.ts +2 -2
  36. package/src/routes/router-socket.ts +5 -5
  37. package/src/routes/router.ts +2 -0
  38. package/src/routes/routes-index.ts +2 -0
  39. package/src/sync/sync-index.ts +1 -0
  40. package/tsconfig.tsbuildinfo +1 -1
  41. package/dist/routes/endpoints/dev.d.ts +0 -312
  42. package/dist/routes/endpoints/dev.js +0 -172
  43. package/dist/routes/endpoints/dev.js.map +0 -1
  44. package/src/routes/endpoints/dev.ts +0 -199
@@ -0,0 +1,712 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import type fastify from 'fastify';
3
+ import * as system from '../system/system-index.js';
4
+ import { CreateRequestQueueParams } from './hooks.js';
5
+ import { RouteDefinition } from './router.js';
6
+ /**
7
+ * A list of route definitions to be registered as endpoints.
8
+ * Supplied concurrency limits will be applied to the grouped routes.
9
+ */
10
+ export type RouteRegistrationOptions = {
11
+ routes: RouteDefinition[];
12
+ queueOptions: CreateRequestQueueParams;
13
+ };
14
+ /**
15
+ * HTTP routes separated by API and Sync stream categories.
16
+ * This allows for separate concurrency limits.
17
+ */
18
+ export type RouteDefinitions = {
19
+ api?: Partial<RouteRegistrationOptions>;
20
+ syncStream?: Partial<RouteRegistrationOptions>;
21
+ };
22
+ export type FastifyServerConfig = {
23
+ system: system.CorePowerSyncSystem;
24
+ routes?: RouteDefinitions;
25
+ };
26
+ export declare const DEFAULT_ROUTE_OPTIONS: {
27
+ api: {
28
+ routes: ((import("@powersync/lib-services-framework").Endpoint<{
29
+ sql: {
30
+ query: string;
31
+ args: (string | number | boolean)[];
32
+ };
33
+ connection_id?: string | undefined;
34
+ }, {
35
+ results: {
36
+ columns: string[];
37
+ rows: (string | number | boolean | null)[][];
38
+ };
39
+ success: boolean;
40
+ error?: string | undefined;
41
+ }, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<{
42
+ sql: {
43
+ query: string;
44
+ args: (string | number | boolean)[];
45
+ };
46
+ connection_id?: string | undefined;
47
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<{
48
+ sql: {
49
+ query: string;
50
+ args: (string | number | boolean)[];
51
+ };
52
+ connection_id?: string | undefined;
53
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>, {
54
+ results: {
55
+ columns: string[];
56
+ rows: (string | number | boolean | null)[][];
57
+ };
58
+ success: boolean;
59
+ error?: string | undefined;
60
+ }>> & {
61
+ path: string;
62
+ method: import("@powersync/lib-services-framework").HTTPMethod.POST;
63
+ authorize: (payload: import("./router.js").RequestEndpointHandlerPayload) => {
64
+ authorized: boolean;
65
+ errors: string[];
66
+ } | {
67
+ authorized: boolean;
68
+ errors?: undefined;
69
+ };
70
+ validator: import("@powersync/lib-services-framework").MicroValidator<{
71
+ sql: {
72
+ query: string;
73
+ args: (string | number | boolean)[];
74
+ };
75
+ connection_id?: string | undefined;
76
+ }, string[]>;
77
+ handler: (payload: import("./router.js").RequestEndpointHandlerPayload<{
78
+ sql: {
79
+ query: string;
80
+ args: (string | number | boolean)[];
81
+ };
82
+ connection_id?: string | undefined;
83
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<{
84
+ results: {
85
+ columns: string[];
86
+ rows: (string | number | boolean | null)[][];
87
+ };
88
+ success: boolean;
89
+ error?: string | undefined;
90
+ }>;
91
+ }) | (import("@powersync/lib-services-framework").Endpoint<{
92
+ sync_rules_content?: boolean | undefined;
93
+ }, {
94
+ connections: {
95
+ errors: {
96
+ message: string;
97
+ level: "warning" | "fatal";
98
+ }[];
99
+ id: string;
100
+ postgres_uri: string;
101
+ connected: boolean;
102
+ }[];
103
+ active_sync_rules?: {
104
+ errors: {
105
+ level: "warning" | "fatal";
106
+ message: string;
107
+ }[];
108
+ connections: {
109
+ id: string;
110
+ tag: string;
111
+ slot_name: string;
112
+ initial_replication_done: boolean;
113
+ tables: {
114
+ schema: string;
115
+ name: string;
116
+ replication_id: string[];
117
+ data_queries: boolean;
118
+ parameter_queries: boolean;
119
+ errors: {
120
+ level: "warning" | "fatal";
121
+ message: string;
122
+ }[];
123
+ pattern?: string | undefined;
124
+ }[];
125
+ last_lsn?: string | undefined;
126
+ last_keepalive_ts?: string | undefined;
127
+ last_checkpoint_ts?: string | undefined;
128
+ replication_lag_bytes?: number | undefined;
129
+ }[];
130
+ content?: string | undefined;
131
+ } | undefined;
132
+ deploying_sync_rules?: {
133
+ errors: {
134
+ level: "warning" | "fatal";
135
+ message: string;
136
+ }[];
137
+ connections: {
138
+ id: string;
139
+ tag: string;
140
+ slot_name: string;
141
+ initial_replication_done: boolean;
142
+ tables: {
143
+ schema: string;
144
+ name: string;
145
+ replication_id: string[];
146
+ data_queries: boolean;
147
+ parameter_queries: boolean;
148
+ errors: {
149
+ level: "warning" | "fatal";
150
+ message: string;
151
+ }[];
152
+ pattern?: string | undefined;
153
+ }[];
154
+ last_lsn?: string | undefined;
155
+ last_keepalive_ts?: string | undefined;
156
+ last_checkpoint_ts?: string | undefined;
157
+ replication_lag_bytes?: number | undefined;
158
+ }[];
159
+ content?: string | undefined;
160
+ } | undefined;
161
+ }, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<{
162
+ sync_rules_content?: boolean | undefined;
163
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<{
164
+ sync_rules_content?: boolean | undefined;
165
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>, {
166
+ connections: {
167
+ errors: {
168
+ message: string;
169
+ level: "warning" | "fatal";
170
+ }[];
171
+ id: string;
172
+ postgres_uri: string;
173
+ connected: boolean;
174
+ }[];
175
+ active_sync_rules?: {
176
+ errors: {
177
+ level: "warning" | "fatal";
178
+ message: string;
179
+ }[];
180
+ connections: {
181
+ id: string;
182
+ tag: string;
183
+ slot_name: string;
184
+ initial_replication_done: boolean;
185
+ tables: {
186
+ schema: string;
187
+ name: string;
188
+ replication_id: string[];
189
+ data_queries: boolean;
190
+ parameter_queries: boolean;
191
+ errors: {
192
+ level: "warning" | "fatal";
193
+ message: string;
194
+ }[];
195
+ pattern?: string | undefined;
196
+ }[];
197
+ last_lsn?: string | undefined;
198
+ last_keepalive_ts?: string | undefined;
199
+ last_checkpoint_ts?: string | undefined;
200
+ replication_lag_bytes?: number | undefined;
201
+ }[];
202
+ content?: string | undefined;
203
+ } | undefined;
204
+ deploying_sync_rules?: {
205
+ errors: {
206
+ level: "warning" | "fatal";
207
+ message: string;
208
+ }[];
209
+ connections: {
210
+ id: string;
211
+ tag: string;
212
+ slot_name: string;
213
+ initial_replication_done: boolean;
214
+ tables: {
215
+ schema: string;
216
+ name: string;
217
+ replication_id: string[];
218
+ data_queries: boolean;
219
+ parameter_queries: boolean;
220
+ errors: {
221
+ level: "warning" | "fatal";
222
+ message: string;
223
+ }[];
224
+ pattern?: string | undefined;
225
+ }[];
226
+ last_lsn?: string | undefined;
227
+ last_keepalive_ts?: string | undefined;
228
+ last_checkpoint_ts?: string | undefined;
229
+ replication_lag_bytes?: number | undefined;
230
+ }[];
231
+ content?: string | undefined;
232
+ } | undefined;
233
+ }>> & {
234
+ path: string;
235
+ method: import("@powersync/lib-services-framework").HTTPMethod.POST;
236
+ authorize: (payload: import("./router.js").RequestEndpointHandlerPayload) => {
237
+ authorized: boolean;
238
+ errors: string[];
239
+ } | {
240
+ authorized: boolean;
241
+ errors?: undefined;
242
+ };
243
+ validator: import("@powersync/lib-services-framework").MicroValidator<{
244
+ sync_rules_content?: boolean | undefined;
245
+ }, string[]>;
246
+ handler: (payload: import("./router.js").RequestEndpointHandlerPayload<{
247
+ sync_rules_content?: boolean | undefined;
248
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<{
249
+ connections: {
250
+ errors: {
251
+ message: string;
252
+ level: "warning" | "fatal";
253
+ }[];
254
+ id: string;
255
+ postgres_uri: string;
256
+ connected: boolean;
257
+ }[];
258
+ active_sync_rules?: {
259
+ errors: {
260
+ level: "warning" | "fatal";
261
+ message: string;
262
+ }[];
263
+ connections: {
264
+ id: string;
265
+ tag: string;
266
+ slot_name: string;
267
+ initial_replication_done: boolean;
268
+ tables: {
269
+ schema: string;
270
+ name: string;
271
+ replication_id: string[];
272
+ data_queries: boolean;
273
+ parameter_queries: boolean;
274
+ errors: {
275
+ level: "warning" | "fatal";
276
+ message: string;
277
+ }[];
278
+ pattern?: string | undefined;
279
+ }[];
280
+ last_lsn?: string | undefined;
281
+ last_keepalive_ts?: string | undefined;
282
+ last_checkpoint_ts?: string | undefined;
283
+ replication_lag_bytes?: number | undefined;
284
+ }[];
285
+ content?: string | undefined;
286
+ } | undefined;
287
+ deploying_sync_rules?: {
288
+ errors: {
289
+ level: "warning" | "fatal";
290
+ message: string;
291
+ }[];
292
+ connections: {
293
+ id: string;
294
+ tag: string;
295
+ slot_name: string;
296
+ initial_replication_done: boolean;
297
+ tables: {
298
+ schema: string;
299
+ name: string;
300
+ replication_id: string[];
301
+ data_queries: boolean;
302
+ parameter_queries: boolean;
303
+ errors: {
304
+ level: "warning" | "fatal";
305
+ message: string;
306
+ }[];
307
+ pattern?: string | undefined;
308
+ }[];
309
+ last_lsn?: string | undefined;
310
+ last_keepalive_ts?: string | undefined;
311
+ last_checkpoint_ts?: string | undefined;
312
+ replication_lag_bytes?: number | undefined;
313
+ }[];
314
+ content?: string | undefined;
315
+ } | undefined;
316
+ }>;
317
+ }) | (import("@powersync/lib-services-framework").Endpoint<{}, {
318
+ connections: {
319
+ tag: string;
320
+ schemas: {
321
+ name: string;
322
+ tables: {
323
+ name: string;
324
+ columns: {
325
+ type: string;
326
+ name: string;
327
+ pg_type: string;
328
+ }[];
329
+ }[];
330
+ }[];
331
+ id?: string | undefined;
332
+ }[];
333
+ }, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>, {
334
+ connections: {
335
+ tag: string;
336
+ schemas: {
337
+ name: string;
338
+ tables: {
339
+ name: string;
340
+ columns: {
341
+ type: string;
342
+ name: string;
343
+ pg_type: string;
344
+ }[];
345
+ }[];
346
+ }[];
347
+ id?: string | undefined;
348
+ }[];
349
+ }>> & {
350
+ path: string;
351
+ method: import("@powersync/lib-services-framework").HTTPMethod.POST;
352
+ authorize: (payload: import("./router.js").RequestEndpointHandlerPayload) => {
353
+ authorized: boolean;
354
+ errors: string[];
355
+ } | {
356
+ authorized: boolean;
357
+ errors?: undefined;
358
+ };
359
+ validator: import("@powersync/lib-services-framework").MicroValidator<{}, string[]>;
360
+ handler: (payload: import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<{
361
+ connections: {
362
+ tag: string;
363
+ schemas: {
364
+ name: string;
365
+ tables: {
366
+ name: string;
367
+ columns: {
368
+ type: string;
369
+ name: string;
370
+ pg_type: string;
371
+ }[];
372
+ }[];
373
+ }[];
374
+ id?: string | undefined;
375
+ }[];
376
+ }>;
377
+ }) | (import("@powersync/lib-services-framework").Endpoint<{}, {
378
+ connections: {
379
+ tag: string;
380
+ slot_name: string;
381
+ id?: string | undefined;
382
+ }[];
383
+ }, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>, {
384
+ connections: {
385
+ tag: string;
386
+ slot_name: string;
387
+ id?: string | undefined;
388
+ }[];
389
+ }>> & {
390
+ path: string;
391
+ method: import("@powersync/lib-services-framework").HTTPMethod.POST;
392
+ authorize: (payload: import("./router.js").RequestEndpointHandlerPayload) => {
393
+ authorized: boolean;
394
+ errors: string[];
395
+ } | {
396
+ authorized: boolean;
397
+ errors?: undefined;
398
+ };
399
+ validator: import("@powersync/lib-services-framework").MicroValidator<{}, string[]>;
400
+ handler: (payload: import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<{
401
+ connections: {
402
+ tag: string;
403
+ slot_name: string;
404
+ id?: string | undefined;
405
+ }[];
406
+ }>;
407
+ }) | (import("@powersync/lib-services-framework").Endpoint<{
408
+ sync_rules: string;
409
+ }, {
410
+ errors: {
411
+ message: string;
412
+ level: "warning" | "fatal";
413
+ }[];
414
+ connections: {
415
+ id: string;
416
+ tag: string;
417
+ slot_name: string;
418
+ initial_replication_done: boolean;
419
+ tables: {
420
+ errors: {
421
+ message: string;
422
+ level: "warning" | "fatal";
423
+ }[];
424
+ name: string;
425
+ schema: string;
426
+ replication_id: string[];
427
+ data_queries: boolean;
428
+ parameter_queries: boolean;
429
+ pattern?: string | undefined;
430
+ }[];
431
+ last_checkpoint_ts?: string | undefined;
432
+ last_keepalive_ts?: string | undefined;
433
+ last_lsn?: string | undefined;
434
+ replication_lag_bytes?: number | undefined;
435
+ }[];
436
+ content?: string | undefined;
437
+ }, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<{
438
+ sync_rules: string;
439
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<{
440
+ sync_rules: string;
441
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>, {
442
+ errors: {
443
+ message: string;
444
+ level: "warning" | "fatal";
445
+ }[];
446
+ connections: {
447
+ id: string;
448
+ tag: string;
449
+ slot_name: string;
450
+ initial_replication_done: boolean;
451
+ tables: {
452
+ errors: {
453
+ message: string;
454
+ level: "warning" | "fatal";
455
+ }[];
456
+ name: string;
457
+ schema: string;
458
+ replication_id: string[];
459
+ data_queries: boolean;
460
+ parameter_queries: boolean;
461
+ pattern?: string | undefined;
462
+ }[];
463
+ last_checkpoint_ts?: string | undefined;
464
+ last_keepalive_ts?: string | undefined;
465
+ last_lsn?: string | undefined;
466
+ replication_lag_bytes?: number | undefined;
467
+ }[];
468
+ content?: string | undefined;
469
+ }>> & {
470
+ path: string;
471
+ method: import("@powersync/lib-services-framework").HTTPMethod.POST;
472
+ authorize: (payload: import("./router.js").RequestEndpointHandlerPayload) => {
473
+ authorized: boolean;
474
+ errors: string[];
475
+ } | {
476
+ authorized: boolean;
477
+ errors?: undefined;
478
+ };
479
+ validator: import("@powersync/lib-services-framework").MicroValidator<{
480
+ sync_rules: string;
481
+ }, string[]>;
482
+ handler: (payload: import("./router.js").RequestEndpointHandlerPayload<{
483
+ sync_rules: string;
484
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<{
485
+ errors: {
486
+ message: string;
487
+ level: "warning" | "fatal";
488
+ }[];
489
+ connections: {
490
+ id: string;
491
+ tag: string;
492
+ slot_name: string;
493
+ initial_replication_done: boolean;
494
+ tables: {
495
+ errors: {
496
+ message: string;
497
+ level: "warning" | "fatal";
498
+ }[];
499
+ name: string;
500
+ schema: string;
501
+ replication_id: string[];
502
+ data_queries: boolean;
503
+ parameter_queries: boolean;
504
+ pattern?: string | undefined;
505
+ }[];
506
+ last_checkpoint_ts?: string | undefined;
507
+ last_keepalive_ts?: string | undefined;
508
+ last_lsn?: string | undefined;
509
+ replication_lag_bytes?: number | undefined;
510
+ }[];
511
+ content?: string | undefined;
512
+ }>;
513
+ }) | (import("@powersync/lib-services-framework").Endpoint<{}, {
514
+ checkpoint: string;
515
+ }, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>, {
516
+ checkpoint: string;
517
+ }>> & {
518
+ path: string;
519
+ method: import("@powersync/lib-services-framework").HTTPMethod.GET;
520
+ authorize: (payload: import("./router.js").RequestEndpointHandlerPayload) => Promise<{
521
+ authorized: boolean;
522
+ errors: any[];
523
+ } | {
524
+ authorized: boolean;
525
+ errors?: undefined;
526
+ }>;
527
+ validator: import("@powersync/lib-services-framework").MicroValidator<{}, string[]>;
528
+ handler: (payload: import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<{
529
+ checkpoint: string;
530
+ }>;
531
+ }) | (import("@powersync/lib-services-framework").Endpoint<{}, {
532
+ write_checkpoint: string;
533
+ }, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>, {
534
+ write_checkpoint: string;
535
+ }>> & {
536
+ path: string;
537
+ method: import("@powersync/lib-services-framework").HTTPMethod.GET;
538
+ authorize: (payload: import("./router.js").RequestEndpointHandlerPayload) => Promise<{
539
+ authorized: boolean;
540
+ errors: any[];
541
+ } | {
542
+ authorized: boolean;
543
+ errors?: undefined;
544
+ }>;
545
+ validator: import("@powersync/lib-services-framework").MicroValidator<{}, string[]>;
546
+ handler: (payload: import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<{
547
+ write_checkpoint: string;
548
+ }>;
549
+ }) | (import("@powersync/lib-services-framework").Endpoint<{
550
+ content: string;
551
+ }, {
552
+ slot_name: string;
553
+ }, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<{
554
+ content: string;
555
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<{
556
+ content: string;
557
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>, {
558
+ slot_name: string;
559
+ }>> & {
560
+ path: string;
561
+ method: import("@powersync/lib-services-framework").HTTPMethod.POST;
562
+ authorize: (payload: import("./router.js").RequestEndpointHandlerPayload) => {
563
+ authorized: boolean;
564
+ errors: string[];
565
+ } | {
566
+ authorized: boolean;
567
+ errors?: undefined;
568
+ };
569
+ parse: boolean;
570
+ plugins: fastify.FastifyPluginAsync[];
571
+ validator: import("@powersync/lib-services-framework").MicroValidator<{
572
+ content: string;
573
+ }, string[]>;
574
+ handler: (payload: import("./router.js").RequestEndpointHandlerPayload<{
575
+ content: string;
576
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<{
577
+ slot_name: string;
578
+ }>;
579
+ }) | (import("@powersync/lib-services-framework").Endpoint<{
580
+ content: string;
581
+ }, import("@powersync/lib-services-framework").RouterResponse<string>, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<{
582
+ content: string;
583
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<{
584
+ content: string;
585
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").RouterResponse<string>>> & {
586
+ path: string;
587
+ method: import("@powersync/lib-services-framework").HTTPMethod.POST;
588
+ authorize: (payload: import("./router.js").RequestEndpointHandlerPayload) => {
589
+ authorized: boolean;
590
+ errors: string[];
591
+ } | {
592
+ authorized: boolean;
593
+ errors?: undefined;
594
+ };
595
+ parse: boolean;
596
+ plugins: fastify.FastifyPluginAsync[];
597
+ validator: import("@powersync/lib-services-framework").MicroValidator<{
598
+ content: string;
599
+ }, string[]>;
600
+ handler: (payload: import("./router.js").RequestEndpointHandlerPayload<{
601
+ content: string;
602
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<import("@powersync/lib-services-framework").RouterResponse<string>>;
603
+ }) | (import("@powersync/lib-services-framework").Endpoint<any, import("@powersync/lib-services-framework").RouterResponse<string>, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<any, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<any, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").RouterResponse<string>>> & {
604
+ path: string;
605
+ method: import("@powersync/lib-services-framework").HTTPMethod.GET;
606
+ authorize: (payload: import("./router.js").RequestEndpointHandlerPayload) => {
607
+ authorized: boolean;
608
+ errors: string[];
609
+ } | {
610
+ authorized: boolean;
611
+ errors?: undefined;
612
+ };
613
+ handler: (payload: import("./router.js").RequestEndpointHandlerPayload<any, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<import("@powersync/lib-services-framework").RouterResponse<string>>;
614
+ }) | (import("@powersync/lib-services-framework").Endpoint<{}, {
615
+ slot_name: string;
616
+ }, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>, {
617
+ slot_name: string;
618
+ }>> & {
619
+ path: string;
620
+ method: import("@powersync/lib-services-framework").HTTPMethod.POST;
621
+ authorize: (payload: import("./router.js").RequestEndpointHandlerPayload) => {
622
+ authorized: boolean;
623
+ errors: string[];
624
+ } | {
625
+ authorized: boolean;
626
+ errors?: undefined;
627
+ };
628
+ validator: import("@powersync/lib-services-framework").MicroValidator<{}, string[]>;
629
+ handler: (payload: import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<{
630
+ slot_name: string;
631
+ }>;
632
+ }))[];
633
+ queueOptions: {
634
+ concurrency: number;
635
+ max_queue_depth: number;
636
+ };
637
+ };
638
+ syncStream: {
639
+ routes: (import("@powersync/lib-services-framework").Endpoint<{
640
+ parameters?: Record<string, any> | undefined;
641
+ buckets?: {
642
+ name: string;
643
+ after: string;
644
+ }[] | undefined;
645
+ only?: string[] | undefined;
646
+ include_checksum?: boolean | undefined;
647
+ raw_data?: boolean | undefined;
648
+ binary_data?: boolean | undefined;
649
+ }, import("@powersync/lib-services-framework").RouterResponse<import("stream").Readable> | undefined, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<{
650
+ parameters?: Record<string, any> | undefined;
651
+ buckets?: {
652
+ name: string;
653
+ after: string;
654
+ }[] | undefined;
655
+ only?: string[] | undefined;
656
+ include_checksum?: boolean | undefined;
657
+ raw_data?: boolean | undefined;
658
+ binary_data?: boolean | undefined;
659
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<{
660
+ parameters?: Record<string, any> | undefined;
661
+ buckets?: {
662
+ name: string;
663
+ after: string;
664
+ }[] | undefined;
665
+ only?: string[] | undefined;
666
+ include_checksum?: boolean | undefined;
667
+ raw_data?: boolean | undefined;
668
+ binary_data?: boolean | undefined;
669
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").RouterResponse<import("stream").Readable> | undefined>> & {
670
+ path: import("./endpoints/sync-stream.js").SyncRoutes;
671
+ method: import("@powersync/lib-services-framework").HTTPMethod.POST;
672
+ authorize: (payload: import("./router.js").RequestEndpointHandlerPayload) => Promise<{
673
+ authorized: boolean;
674
+ errors: any[];
675
+ } | {
676
+ authorized: boolean;
677
+ errors?: undefined;
678
+ }>;
679
+ validator: import("@powersync/lib-services-framework").MicroValidator<{
680
+ parameters?: Record<string, any> | undefined;
681
+ buckets?: {
682
+ name: string;
683
+ after: string;
684
+ }[] | undefined;
685
+ only?: string[] | undefined;
686
+ include_checksum?: boolean | undefined;
687
+ raw_data?: boolean | undefined;
688
+ binary_data?: boolean | undefined;
689
+ }, string[]>;
690
+ handler: (payload: import("./router.js").RequestEndpointHandlerPayload<{
691
+ parameters?: Record<string, any> | undefined;
692
+ buckets?: {
693
+ name: string;
694
+ after: string;
695
+ }[] | undefined;
696
+ only?: string[] | undefined;
697
+ include_checksum?: boolean | undefined;
698
+ raw_data?: boolean | undefined;
699
+ binary_data?: boolean | undefined;
700
+ }, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<import("@powersync/lib-services-framework").RouterResponse<import("stream").Readable> | undefined>;
701
+ })[];
702
+ queueOptions: {
703
+ concurrency: number;
704
+ max_queue_depth: number;
705
+ };
706
+ };
707
+ };
708
+ /**
709
+ * Registers default routes on a Fastify server. Consumers can optionally configure
710
+ * concurrency queue limits or override routes.
711
+ */
712
+ export declare function configureFastifyServer(server: fastify.FastifyInstance, options: FastifyServerConfig): void;