@powersync/service-core 0.0.0-dev-20241023230541 → 0.0.0-dev-20241028131228

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/CHANGELOG.md CHANGED
@@ -1,10 +1,12 @@
1
1
  # @powersync/service-core
2
2
 
3
- ## 0.0.0-dev-20241023230541
3
+ ## 0.0.0-dev-20241028131228
4
4
 
5
5
  ### Minor Changes
6
6
 
7
7
  - d2ece1b: Added ability to emit data replication events
8
+ - 8610431: Introduced alpha support for MySQL as a datasource for replication.
9
+ Bunch of cleanup
8
10
  - 2ccd6af: Moved Write Checkpoint APIs to SyncBucketStorage
9
11
  - d51921f: - Introduced modules to the powersync service architecture
10
12
  - Core functionality has been moved to "engine" classes. Modules can register additional functionality with these engines.
@@ -20,13 +22,14 @@
20
22
  - e4d19b2: Moved tag variable initialization in diagnostics route to ensure it is initialized before usage
21
23
  - Updated dependencies [d2ece1b]
22
24
  - Updated dependencies [d2ece1b]
25
+ - Updated dependencies [8610431]
23
26
  - Updated dependencies [d2ece1b]
24
27
  - Updated dependencies [d51921f]
25
28
  - Updated dependencies [4ecaee2]
26
- - @powersync/lib-services-framework@0.0.0-dev-20241023230541
27
- - @powersync/service-sync-rules@0.0.0-dev-20241023230541
28
- - @powersync/service-rsocket-router@0.0.0-dev-20241023230541
29
- - @powersync/service-types@0.0.0-dev-20241023230541
29
+ - @powersync/lib-services-framework@0.0.0-dev-20241028131228
30
+ - @powersync/service-sync-rules@0.0.0-dev-20241028131228
31
+ - @powersync/service-rsocket-router@0.0.0-dev-20241028131228
32
+ - @powersync/service-types@0.0.0-dev-20241028131228
30
33
 
31
34
  ## 0.8.5
32
35
 
@@ -84,11 +84,11 @@ export interface BucketStorageFactory extends DisposableObserverClient<BucketSto
84
84
  */
85
85
  getPowerSyncInstanceId(): Promise<string>;
86
86
  }
87
- export interface Checkpoint {
87
+ export interface ReplicationCheckpoint {
88
88
  readonly checkpoint: util.OpId;
89
89
  readonly lsn: string | null;
90
90
  }
91
- export interface ActiveCheckpoint extends Checkpoint {
91
+ export interface ActiveCheckpoint extends ReplicationCheckpoint {
92
92
  hasSyncRules(): boolean;
93
93
  getBucketStorage(): Promise<SyncRulesBucketStorage | null>;
94
94
  }
@@ -170,7 +170,7 @@ export interface SyncRulesBucketStorage extends DisposableObserverClient<SyncRul
170
170
  readonly factory: BucketStorageFactory;
171
171
  resolveTable(options: ResolveTableOptions): Promise<ResolveTableResult>;
172
172
  startBatch(options: StartBatchOptions, callback: (batch: BucketStorageBatch) => Promise<void>): Promise<FlushedResult | null>;
173
- getCheckpoint(): Promise<Checkpoint>;
173
+ getCheckpoint(): Promise<ReplicationCheckpoint>;
174
174
  getParsedSyncRules(options: ParseSyncRulesOptions): SqlSyncRules;
175
175
  getParameterSets(checkpoint: util.OpId, lookups: SqliteJsonValue[][]): Promise<SqliteJsonRow[]>;
176
176
  /**
@@ -1,7 +1,7 @@
1
1
  import { SqliteJsonRow, SqliteJsonValue, SqlSyncRules } from '@powersync/service-sync-rules';
2
2
  import { DisposableObserver } from '@powersync/lib-services-framework';
3
3
  import * as util from '../../util/util-index.js';
4
- import { BucketDataBatchOptions, BucketStorageBatch, Checkpoint, CompactOptions, FlushedResult, ParseSyncRulesOptions, PersistedSyncRulesContent, ResolveTableOptions, ResolveTableResult, StartBatchOptions, SyncBucketDataBatch, SyncRulesBucketStorage, SyncRulesBucketStorageListener, SyncRuleStatus, TerminateOptions } from '../BucketStorage.js';
4
+ import { BucketDataBatchOptions, BucketStorageBatch, ReplicationCheckpoint, CompactOptions, FlushedResult, ParseSyncRulesOptions, PersistedSyncRulesContent, ResolveTableOptions, ResolveTableResult, StartBatchOptions, SyncBucketDataBatch, SyncRulesBucketStorage, SyncRulesBucketStorageListener, SyncRuleStatus, TerminateOptions } from '../BucketStorage.js';
5
5
  import { MongoBucketStorage } from '../MongoBucketStorage.js';
6
6
  import { BatchedCustomWriteCheckpointOptions, ManagedWriteCheckpointOptions, SyncStorageLastWriteCheckpointFilters, WriteCheckpointMode } from '../WriteCheckpointAPI.js';
7
7
  export declare class MongoSyncBucketStorage extends DisposableObserver<SyncRulesBucketStorageListener> implements SyncRulesBucketStorage {
@@ -21,7 +21,7 @@ export declare class MongoSyncBucketStorage extends DisposableObserver<SyncRules
21
21
  createManagedWriteCheckpoint(checkpoint: ManagedWriteCheckpointOptions): Promise<bigint>;
22
22
  lastWriteCheckpoint(filters: SyncStorageLastWriteCheckpointFilters): Promise<bigint | null>;
23
23
  getParsedSyncRules(options: ParseSyncRulesOptions): SqlSyncRules;
24
- getCheckpoint(): Promise<Checkpoint>;
24
+ getCheckpoint(): Promise<ReplicationCheckpoint>;
25
25
  startBatch(options: StartBatchOptions, callback: (batch: BucketStorageBatch) => Promise<void>): Promise<FlushedResult | null>;
26
26
  resolveTable(options: ResolveTableOptions): Promise<ResolveTableResult>;
27
27
  getParameterSets(checkpoint: util.OpId, lookups: SqliteJsonValue[][]): Promise<SqliteJsonRow[]>;
@@ -71,7 +71,7 @@ export type StreamingSyncLine = StreamingSyncData | StreamingSyncCheckpoint | St
71
71
  * 64-bit unsigned number, as a base-10 string.
72
72
  */
73
73
  export type OpId = string;
74
- interface Checkpoint {
74
+ export interface Checkpoint {
75
75
  last_op_id: OpId;
76
76
  write_checkpoint?: OpId;
77
77
  buckets: BucketChecksum[];
@@ -119,4 +119,3 @@ export interface BucketChecksum {
119
119
  */
120
120
  count: number;
121
121
  }
122
- export {};
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "version": "0.0.0-dev-20241023230541",
8
+ "version": "0.0.0-dev-20241028131228",
9
9
  "main": "dist/index.js",
10
10
  "license": "FSL-1.1-Apache-2.0",
11
11
  "type": "module",
@@ -33,11 +33,11 @@
33
33
  "uuid": "^9.0.1",
34
34
  "winston": "^3.13.0",
35
35
  "yaml": "^2.3.2",
36
- "@powersync/lib-services-framework": "0.0.0-dev-20241023230541",
36
+ "@powersync/lib-services-framework": "0.0.0-dev-20241028131228",
37
37
  "@powersync/service-jsonbig": "0.17.10",
38
- "@powersync/service-rsocket-router": "0.0.0-dev-20241023230541",
39
- "@powersync/service-sync-rules": "0.0.0-dev-20241023230541",
40
- "@powersync/service-types": "0.0.0-dev-20241023230541"
38
+ "@powersync/service-rsocket-router": "0.0.0-dev-20241028131228",
39
+ "@powersync/service-sync-rules": "0.0.0-dev-20241028131228",
40
+ "@powersync/service-types": "0.0.0-dev-20241028131228"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/async": "^3.2.24",
@@ -105,12 +105,12 @@ export interface BucketStorageFactory extends DisposableObserverClient<BucketSto
105
105
  getPowerSyncInstanceId(): Promise<string>;
106
106
  }
107
107
 
108
- export interface Checkpoint {
108
+ export interface ReplicationCheckpoint {
109
109
  readonly checkpoint: util.OpId;
110
110
  readonly lsn: string | null;
111
111
  }
112
112
 
113
- export interface ActiveCheckpoint extends Checkpoint {
113
+ export interface ActiveCheckpoint extends ReplicationCheckpoint {
114
114
  hasSyncRules(): boolean;
115
115
 
116
116
  getBucketStorage(): Promise<SyncRulesBucketStorage | null>;
@@ -222,7 +222,7 @@ export interface SyncRulesBucketStorage
222
222
  callback: (batch: BucketStorageBatch) => Promise<void>
223
223
  ): Promise<FlushedResult | null>;
224
224
 
225
- getCheckpoint(): Promise<Checkpoint>;
225
+ getCheckpoint(): Promise<ReplicationCheckpoint>;
226
226
 
227
227
  getParsedSyncRules(options: ParseSyncRulesOptions): SqlSyncRules;
228
228
 
@@ -9,7 +9,7 @@ import * as util from '../../util/util-index.js';
9
9
  import {
10
10
  BucketDataBatchOptions,
11
11
  BucketStorageBatch,
12
- Checkpoint,
12
+ ReplicationCheckpoint,
13
13
  CompactOptions,
14
14
  DEFAULT_DOCUMENT_BATCH_LIMIT,
15
15
  DEFAULT_DOCUMENT_CHUNK_LIMIT_BYTES,
@@ -108,7 +108,7 @@ export class MongoSyncBucketStorage
108
108
  return this.parsedSyncRulesCache;
109
109
  }
110
110
 
111
- async getCheckpoint(): Promise<Checkpoint> {
111
+ async getCheckpoint(): Promise<ReplicationCheckpoint> {
112
112
  const doc = await this.db.sync_rules.findOne(
113
113
  { _id: this.group_id },
114
114
  {
@@ -88,7 +88,7 @@ export type StreamingSyncLine =
88
88
  */
89
89
  export type OpId = string;
90
90
 
91
- interface Checkpoint {
91
+ export interface Checkpoint {
92
92
  last_op_id: OpId;
93
93
  write_checkpoint?: OpId;
94
94
  buckets: BucketChecksum[];