@powersync/service-core 0.0.0-dev-20241021184609 → 0.0.0-dev-20241022094219

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 (50) hide show
  1. package/CHANGELOG.md +5 -5
  2. package/dist/api/RouteAPI.d.ts +6 -4
  3. package/dist/api/diagnostics.js +3 -1
  4. package/dist/api/diagnostics.js.map +1 -1
  5. package/dist/api/schema.js +2 -2
  6. package/dist/api/schema.js.map +1 -1
  7. package/dist/replication/AbstractReplicationJob.js +2 -2
  8. package/dist/replication/AbstractReplicationJob.js.map +1 -1
  9. package/dist/replication/ReplicationModule.d.ts +13 -1
  10. package/dist/replication/ReplicationModule.js +7 -4
  11. package/dist/replication/ReplicationModule.js.map +1 -1
  12. package/dist/routes/configure-fastify.js +12 -12
  13. package/dist/routes/configure-fastify.js.map +1 -1
  14. package/dist/routes/configure-rsocket.js +4 -1
  15. package/dist/routes/configure-rsocket.js.map +1 -1
  16. package/dist/routes/endpoints/admin.js.map +1 -1
  17. package/dist/routes/endpoints/sync-rules.js.map +1 -1
  18. package/dist/routes/router.d.ts +8 -1
  19. package/dist/routes/router.js.map +1 -1
  20. package/dist/storage/BucketStorage.d.ts +16 -11
  21. package/dist/storage/BucketStorage.js +6 -0
  22. package/dist/storage/BucketStorage.js.map +1 -1
  23. package/dist/storage/MongoBucketStorage.d.ts +1 -3
  24. package/dist/storage/MongoBucketStorage.js.map +1 -1
  25. package/dist/storage/mongo/MongoBucketBatch.js +1 -0
  26. package/dist/storage/mongo/MongoBucketBatch.js.map +1 -1
  27. package/dist/storage/mongo/MongoSyncBucketStorage.d.ts +2 -4
  28. package/dist/storage/mongo/MongoSyncBucketStorage.js +3 -2
  29. package/dist/storage/mongo/MongoSyncBucketStorage.js.map +1 -1
  30. package/dist/util/protocol-types.d.ts +2 -1
  31. package/package.json +5 -5
  32. package/src/api/RouteAPI.ts +7 -4
  33. package/src/api/diagnostics.ts +3 -1
  34. package/src/api/schema.ts +3 -3
  35. package/src/replication/AbstractReplicationJob.ts +2 -2
  36. package/src/replication/ReplicationModule.ts +26 -5
  37. package/src/routes/configure-fastify.ts +16 -17
  38. package/src/routes/configure-rsocket.ts +7 -2
  39. package/src/routes/endpoints/admin.ts +2 -2
  40. package/src/routes/endpoints/sync-rules.ts +1 -0
  41. package/src/routes/router.ts +7 -1
  42. package/src/storage/BucketStorage.ts +18 -10
  43. package/src/storage/MongoBucketStorage.ts +1 -3
  44. package/src/storage/mongo/MongoBucketBatch.ts +1 -0
  45. package/src/storage/mongo/MongoSyncBucketStorage.ts +5 -3
  46. package/src/util/protocol-types.ts +1 -1
  47. package/test/src/compacting.test.ts +13 -15
  48. package/test/src/data_storage.test.ts +56 -56
  49. package/test/src/sync.test.ts +10 -9
  50. package/tsconfig.tsbuildinfo +1 -1
@@ -1,3 +1,4 @@
1
+ import { SaveOperationTag } from '@/storage/storage-index.js';
1
2
  import { RequestTracker } from '@/sync/RequestTracker.js';
2
3
  import { streamResponse } from '@/sync/sync.js';
3
4
  import { StreamingSyncLine } from '@/util/protocol-types.js';
@@ -36,7 +37,7 @@ function defineTests(factory: StorageFactory) {
36
37
  const result = await storage.startBatch(BATCH_OPTIONS, async (batch) => {
37
38
  await batch.save({
38
39
  sourceTable: TEST_TABLE,
39
- tag: 'insert',
40
+ tag: SaveOperationTag.INSERT,
40
41
  after: {
41
42
  id: 't1',
42
43
  description: 'Test 1'
@@ -46,7 +47,7 @@ function defineTests(factory: StorageFactory) {
46
47
 
47
48
  await batch.save({
48
49
  sourceTable: TEST_TABLE,
49
- tag: 'insert',
50
+ tag: SaveOperationTag.INSERT,
50
51
  after: {
51
52
  id: 't2',
52
53
  description: 'Test 2'
@@ -87,7 +88,7 @@ function defineTests(factory: StorageFactory) {
87
88
  const result = await storage.startBatch(BATCH_OPTIONS, async (batch) => {
88
89
  await batch.save({
89
90
  sourceTable: TEST_TABLE,
90
- tag: 'insert',
91
+ tag: SaveOperationTag.INSERT,
91
92
  after: {
92
93
  id: 't1',
93
94
  description: 'Test\n"string"',
@@ -174,7 +175,7 @@ function defineTests(factory: StorageFactory) {
174
175
  await storage.startBatch(BATCH_OPTIONS, async (batch) => {
175
176
  await batch.save({
176
177
  sourceTable: TEST_TABLE,
177
- tag: 'insert',
178
+ tag: SaveOperationTag.INSERT,
178
179
  after: {
179
180
  id: 't1',
180
181
  description: 'Test 1'
@@ -190,7 +191,7 @@ function defineTests(factory: StorageFactory) {
190
191
  await storage.startBatch(BATCH_OPTIONS, async (batch) => {
191
192
  await batch.save({
192
193
  sourceTable: TEST_TABLE,
193
- tag: 'insert',
194
+ tag: SaveOperationTag.INSERT,
194
195
  after: {
195
196
  id: 't2',
196
197
  description: 'Test 2'
@@ -257,7 +258,7 @@ function defineTests(factory: StorageFactory) {
257
258
  await storage.startBatch(BATCH_OPTIONS, async (batch) => {
258
259
  await batch.save({
259
260
  sourceTable: TEST_TABLE,
260
- tag: 'insert',
261
+ tag: SaveOperationTag.INSERT,
261
262
  after: {
262
263
  id: 't1',
263
264
  description: 'Test 1'
@@ -267,7 +268,7 @@ function defineTests(factory: StorageFactory) {
267
268
 
268
269
  await batch.save({
269
270
  sourceTable: TEST_TABLE,
270
- tag: 'insert',
271
+ tag: SaveOperationTag.INSERT,
271
272
  after: {
272
273
  id: 't2',
273
274
  description: 'Test 2'
@@ -308,7 +309,7 @@ function defineTests(factory: StorageFactory) {
308
309
  await storage.startBatch(BATCH_OPTIONS, async (batch) => {
309
310
  await batch.save({
310
311
  sourceTable: TEST_TABLE,
311
- tag: 'update',
312
+ tag: SaveOperationTag.UPDATE,
312
313
  after: {
313
314
  id: 't1',
314
315
  description: 'Test 1b'
@@ -318,7 +319,7 @@ function defineTests(factory: StorageFactory) {
318
319
 
319
320
  await batch.save({
320
321
  sourceTable: TEST_TABLE,
321
- tag: 'update',
322
+ tag: SaveOperationTag.UPDATE,
322
323
  after: {
323
324
  id: 't2',
324
325
  description: 'Test 2b'