@powersync/service-sync-rules 0.0.0-dev-20261005120023 → 0.0.0-dev-20261007110800
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/HydratedSyncConfig.js +4 -1
- package/dist/HydratedSyncConfig.js.map +1 -1
- package/dist/SourceTableConfig.d.ts +11 -6
- package/dist/SourceTableConfig.js +33 -31
- package/dist/SourceTableConfig.js.map +1 -1
- package/dist/SqlSyncRules.d.ts +0 -12
- package/dist/SqlSyncRules.js +1 -3
- package/dist/SqlSyncRules.js.map +1 -1
- package/dist/SyncConfig.d.ts +0 -5
- package/dist/SyncConfig.js +0 -4
- package/dist/SyncConfig.js.map +1 -1
- package/dist/SyncConfigDiagnostics.d.ts +12 -0
- package/dist/SyncConfigDiagnostics.js +2 -0
- package/dist/SyncConfigDiagnostics.js.map +1 -0
- package/dist/from_yaml.d.ts +0 -13
- package/dist/from_yaml.js +77 -71
- package/dist/from_yaml.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/json_schema.d.ts +1 -2
- package/dist/json_schema.js +4 -9
- package/dist/json_schema.js.map +1 -1
- package/dist/legacy/streams/from_sql.js +1 -1
- package/dist/legacy/streams/from_sql.js.map +1 -1
- package/dist/mongo/MongoBsonValidators.d.ts +61 -0
- package/dist/mongo/MongoBsonValidators.js +112 -0
- package/dist/mongo/MongoBsonValidators.js.map +1 -0
- package/dist/mongo/MongoFilterExpression.d.ts +56 -0
- package/dist/mongo/MongoFilterExpression.js +172 -0
- package/dist/mongo/MongoFilterExpression.js.map +1 -0
- package/dist/mongo/MongoFilterValidation.d.ts +28 -0
- package/dist/mongo/MongoFilterValidation.js +47 -0
- package/dist/mongo/MongoFilterValidation.js.map +1 -0
- package/dist/sync_plan/evaluator/index.js +0 -1
- package/dist/sync_plan/evaluator/index.js.map +1 -1
- package/dist/sync_plan/plan.d.ts +0 -4
- package/dist/sync_plan/serialize.d.ts +0 -5
- package/dist/sync_plan/serialize.js +1 -20
- package/dist/sync_plan/serialize.js.map +1 -1
- package/dist/yaml_source_locations.d.ts +2 -2
- package/dist/yaml_source_locations.js +7 -12
- package/dist/yaml_source_locations.js.map +1 -1
- package/package.json +4 -2
- package/schema/sync_config.json +361 -4
- package/schema/sync_rules.json +361 -4
- package/dist/SyncConfigParserHooks.d.ts +0 -103
- package/dist/SyncConfigParserHooks.js +0 -11
- package/dist/SyncConfigParserHooks.js.map +0 -1
package/schema/sync_config.json
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
"properties": {
|
|
4
4
|
"bucket_definitions": {
|
|
5
5
|
"type": "object",
|
|
6
|
-
"
|
|
6
|
+
"deprecated": true,
|
|
7
|
+
"description": "Deprecated: legacy Sync Rules bucket definitions. They will be removed in the next major version of the PowerSync Service. Use `streams:` (Sync Streams) instead: https://docs.powersync.com/sync/rules/migrate-to-sync-streams",
|
|
7
8
|
"examples": [
|
|
8
9
|
{
|
|
9
10
|
"global": {
|
|
@@ -176,12 +177,368 @@
|
|
|
176
177
|
"type": "object",
|
|
177
178
|
"propertyNames": {
|
|
178
179
|
"minLength": 1,
|
|
179
|
-
"pattern": "^(?:[^.\"]+|\"(?:[^\"]|\"\")+\")(?:\\.(?:[^.\"]+|\"(?:[^\"]|\"\")+\")){0,2}$"
|
|
180
|
-
"patternErrorMessage": "Use <table>, <database>.<table>, or <connection>.<database>.<table>. Double-quote names containing dots or quotes."
|
|
180
|
+
"pattern": "^(?:[^.\"]+|\"(?:[^\"]|\"\")+\")(?:\\.(?:[^.\"]+|\"(?:[^\"]|\"\")+\")){0,2}$"
|
|
181
181
|
},
|
|
182
182
|
"additionalProperties": {
|
|
183
183
|
"type": "object",
|
|
184
|
-
"properties": {
|
|
184
|
+
"properties": {
|
|
185
|
+
"mongodb_filter_expression": {
|
|
186
|
+
"anyOf": [
|
|
187
|
+
{
|
|
188
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
189
|
+
"anyOf": [
|
|
190
|
+
{
|
|
191
|
+
"type": "object",
|
|
192
|
+
"properties": {
|
|
193
|
+
"$eq": {
|
|
194
|
+
"type": "array",
|
|
195
|
+
"items": [
|
|
196
|
+
{
|
|
197
|
+
"$ref": "#/definitions/__schema0"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"$ref": "#/definitions/__schema1"
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"minItems": 2,
|
|
204
|
+
"maxItems": 2,
|
|
205
|
+
"description": "Compare a source field with a scalar constant.",
|
|
206
|
+
"examples": [
|
|
207
|
+
[
|
|
208
|
+
"$$doc.status",
|
|
209
|
+
"active"
|
|
210
|
+
]
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"required": [
|
|
215
|
+
"$eq"
|
|
216
|
+
],
|
|
217
|
+
"additionalProperties": false
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"type": "object",
|
|
221
|
+
"properties": {
|
|
222
|
+
"$in": {
|
|
223
|
+
"type": "array",
|
|
224
|
+
"items": [
|
|
225
|
+
{
|
|
226
|
+
"$ref": "#/definitions/__schema0"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"$ref": "#/definitions/__schema5"
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"minItems": 2,
|
|
233
|
+
"maxItems": 2,
|
|
234
|
+
"examples": [
|
|
235
|
+
[
|
|
236
|
+
"$$doc.status",
|
|
237
|
+
[
|
|
238
|
+
"pending",
|
|
239
|
+
"shipped"
|
|
240
|
+
]
|
|
241
|
+
]
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"required": [
|
|
246
|
+
"$in"
|
|
247
|
+
],
|
|
248
|
+
"additionalProperties": false
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"type": "object",
|
|
252
|
+
"properties": {
|
|
253
|
+
"$and": {
|
|
254
|
+
"minItems": 1,
|
|
255
|
+
"type": "array",
|
|
256
|
+
"items": {
|
|
257
|
+
"$ref": "#"
|
|
258
|
+
},
|
|
259
|
+
"examples": [
|
|
260
|
+
[
|
|
261
|
+
{
|
|
262
|
+
"$eq": [
|
|
263
|
+
"$$doc.active",
|
|
264
|
+
true
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"required": [
|
|
272
|
+
"$and"
|
|
273
|
+
],
|
|
274
|
+
"additionalProperties": false
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"type": "object",
|
|
278
|
+
"properties": {
|
|
279
|
+
"$or": {
|
|
280
|
+
"minItems": 1,
|
|
281
|
+
"type": "array",
|
|
282
|
+
"items": {
|
|
283
|
+
"$ref": "#"
|
|
284
|
+
},
|
|
285
|
+
"examples": [
|
|
286
|
+
[
|
|
287
|
+
{
|
|
288
|
+
"$eq": [
|
|
289
|
+
"$$doc.status",
|
|
290
|
+
"pending"
|
|
291
|
+
]
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"$eq": [
|
|
295
|
+
"$$doc.priority",
|
|
296
|
+
true
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"required": [
|
|
304
|
+
"$or"
|
|
305
|
+
],
|
|
306
|
+
"additionalProperties": false
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"definitions": {
|
|
310
|
+
"__schema0": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"pattern": "^\\$\\$doc(?:\\.(?![0-9]+(?:\\.|$))[^.$][^.]*)+$"
|
|
313
|
+
},
|
|
314
|
+
"__schema1": {
|
|
315
|
+
"anyOf": [
|
|
316
|
+
{
|
|
317
|
+
"type": "boolean"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"type": "number"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"type": "string",
|
|
324
|
+
"pattern": "^(?!\\$)"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"anyOf": [
|
|
328
|
+
{
|
|
329
|
+
"type": "object",
|
|
330
|
+
"properties": {
|
|
331
|
+
"$literal": {
|
|
332
|
+
"type": "string"
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"required": [
|
|
336
|
+
"$literal"
|
|
337
|
+
],
|
|
338
|
+
"additionalProperties": false
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"type": "object",
|
|
342
|
+
"properties": {
|
|
343
|
+
"$oid": {
|
|
344
|
+
"type": "string",
|
|
345
|
+
"pattern": "^[0-9a-fA-F]{24}$"
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
"required": [
|
|
349
|
+
"$oid"
|
|
350
|
+
],
|
|
351
|
+
"additionalProperties": false
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"type": "object",
|
|
355
|
+
"properties": {
|
|
356
|
+
"$numberInt": {
|
|
357
|
+
"allOf": [
|
|
358
|
+
{
|
|
359
|
+
"$ref": "#/definitions/__schema2"
|
|
360
|
+
}
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
"required": [
|
|
365
|
+
"$numberInt"
|
|
366
|
+
],
|
|
367
|
+
"additionalProperties": false
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"type": "object",
|
|
371
|
+
"properties": {
|
|
372
|
+
"$numberLong": {
|
|
373
|
+
"allOf": [
|
|
374
|
+
{
|
|
375
|
+
"$ref": "#/definitions/__schema2"
|
|
376
|
+
}
|
|
377
|
+
]
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
"required": [
|
|
381
|
+
"$numberLong"
|
|
382
|
+
],
|
|
383
|
+
"additionalProperties": false
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"type": "object",
|
|
387
|
+
"properties": {
|
|
388
|
+
"$numberDouble": {
|
|
389
|
+
"type": "string",
|
|
390
|
+
"pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$"
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
"required": [
|
|
394
|
+
"$numberDouble"
|
|
395
|
+
],
|
|
396
|
+
"additionalProperties": false
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"type": "object",
|
|
400
|
+
"properties": {
|
|
401
|
+
"$numberDecimal": {
|
|
402
|
+
"type": "string"
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
"required": [
|
|
406
|
+
"$numberDecimal"
|
|
407
|
+
],
|
|
408
|
+
"additionalProperties": false
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"type": "object",
|
|
412
|
+
"properties": {
|
|
413
|
+
"$uuid": {
|
|
414
|
+
"type": "string",
|
|
415
|
+
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
"required": [
|
|
419
|
+
"$uuid"
|
|
420
|
+
],
|
|
421
|
+
"additionalProperties": false
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"type": "object",
|
|
425
|
+
"properties": {
|
|
426
|
+
"$date": {
|
|
427
|
+
"anyOf": [
|
|
428
|
+
{
|
|
429
|
+
"type": "string",
|
|
430
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"type": "object",
|
|
434
|
+
"properties": {
|
|
435
|
+
"$numberLong": {
|
|
436
|
+
"allOf": [
|
|
437
|
+
{
|
|
438
|
+
"$ref": "#/definitions/__schema2"
|
|
439
|
+
}
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
"required": [
|
|
444
|
+
"$numberLong"
|
|
445
|
+
],
|
|
446
|
+
"additionalProperties": false
|
|
447
|
+
}
|
|
448
|
+
]
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"required": [
|
|
452
|
+
"$date"
|
|
453
|
+
],
|
|
454
|
+
"additionalProperties": false
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"type": "object",
|
|
458
|
+
"properties": {
|
|
459
|
+
"$timestamp": {
|
|
460
|
+
"type": "object",
|
|
461
|
+
"properties": {
|
|
462
|
+
"t": {
|
|
463
|
+
"type": "integer",
|
|
464
|
+
"minimum": 0,
|
|
465
|
+
"maximum": 4294967295
|
|
466
|
+
},
|
|
467
|
+
"i": {
|
|
468
|
+
"type": "integer",
|
|
469
|
+
"minimum": 0,
|
|
470
|
+
"maximum": 4294967295
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
"required": [
|
|
474
|
+
"t",
|
|
475
|
+
"i"
|
|
476
|
+
],
|
|
477
|
+
"additionalProperties": false
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
"required": [
|
|
481
|
+
"$timestamp"
|
|
482
|
+
],
|
|
483
|
+
"additionalProperties": false
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"type": "object",
|
|
487
|
+
"properties": {
|
|
488
|
+
"$binary": {
|
|
489
|
+
"type": "object",
|
|
490
|
+
"properties": {
|
|
491
|
+
"base64": {
|
|
492
|
+
"$ref": "#/definitions/__schema3"
|
|
493
|
+
},
|
|
494
|
+
"subType": {
|
|
495
|
+
"$ref": "#/definitions/__schema4"
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
"required": [
|
|
499
|
+
"base64",
|
|
500
|
+
"subType"
|
|
501
|
+
],
|
|
502
|
+
"additionalProperties": false
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
"required": [
|
|
506
|
+
"$binary"
|
|
507
|
+
],
|
|
508
|
+
"additionalProperties": false
|
|
509
|
+
}
|
|
510
|
+
]
|
|
511
|
+
}
|
|
512
|
+
]
|
|
513
|
+
},
|
|
514
|
+
"__schema2": {
|
|
515
|
+
"type": "string",
|
|
516
|
+
"pattern": "^-?(?:0|[1-9][0-9]*)$"
|
|
517
|
+
},
|
|
518
|
+
"__schema3": {
|
|
519
|
+
"type": "string",
|
|
520
|
+
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/][AQgw]==|[A-Za-z0-9+/]{2}[AEIMQUYcgkosw048]=)?$"
|
|
521
|
+
},
|
|
522
|
+
"__schema4": {
|
|
523
|
+
"type": "string",
|
|
524
|
+
"pattern": "^[0-9a-fA-F]{2}$"
|
|
525
|
+
},
|
|
526
|
+
"__schema5": {
|
|
527
|
+
"minItems": 1,
|
|
528
|
+
"type": "array",
|
|
529
|
+
"items": {
|
|
530
|
+
"$ref": "#/definitions/__schema1"
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
"$id": "https://powersync.com/schemas/mongodb-filter-expression"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"const": "disabled"
|
|
538
|
+
}
|
|
539
|
+
]
|
|
540
|
+
}
|
|
541
|
+
},
|
|
185
542
|
"additionalProperties": false
|
|
186
543
|
}
|
|
187
544
|
},
|