@powersync/common 1.31.1 → 1.32.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.
- package/dist/bundle.mjs +3 -3
- package/lib/client/AbstractPowerSyncDatabase.d.ts +9 -2
- package/lib/client/AbstractPowerSyncDatabase.js +42 -30
- package/lib/client/ConnectionManager.d.ts +80 -0
- package/lib/client/ConnectionManager.js +175 -0
- package/lib/client/sync/stream/AbstractRemote.js +6 -14
- package/lib/client/sync/stream/AbstractStreamingSyncImplementation.js +39 -9
- package/lib/client/sync/stream/WebsocketClientTransport.d.ts +15 -0
- package/lib/client/sync/stream/WebsocketClientTransport.js +60 -0
- package/lib/db/crud/SyncStatus.js +15 -1
- package/lib/index.d.ts +13 -14
- package/lib/index.js +13 -14
- package/package.json +1 -1
|
@@ -123,7 +123,21 @@ export class SyncStatus {
|
|
|
123
123
|
* @returns {boolean} True if the instances are considered equal, false otherwise
|
|
124
124
|
*/
|
|
125
125
|
isEqual(status) {
|
|
126
|
-
|
|
126
|
+
/**
|
|
127
|
+
* By default Error object are serialized to an empty object.
|
|
128
|
+
* This replaces Errors with more useful information before serialization.
|
|
129
|
+
*/
|
|
130
|
+
const replacer = (_, value) => {
|
|
131
|
+
if (value instanceof Error) {
|
|
132
|
+
return {
|
|
133
|
+
name: value.name,
|
|
134
|
+
message: value.message,
|
|
135
|
+
stack: value.stack
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
return value;
|
|
139
|
+
};
|
|
140
|
+
return JSON.stringify(this.options, replacer) == JSON.stringify(status.options, replacer);
|
|
127
141
|
}
|
|
128
142
|
/**
|
|
129
143
|
* Creates a human-readable string representation of the current sync status.
|
package/lib/index.d.ts
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
export * from './client/AbstractPowerSyncDatabase.js';
|
|
2
2
|
export * from './client/AbstractPowerSyncOpenFactory.js';
|
|
3
|
-
export
|
|
3
|
+
export { compilableQueryWatch, CompilableQueryWatchHandler } from './client/compilableQueryWatch.js';
|
|
4
4
|
export * from './client/connection/PowerSyncBackendConnector.js';
|
|
5
5
|
export * from './client/connection/PowerSyncCredentials.js';
|
|
6
|
-
export
|
|
6
|
+
export { MAX_OP_ID } from './client/constants.js';
|
|
7
7
|
export { runOnSchemaChange } from './client/runOnSchemaChange.js';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export * from './client/sync/bucket/SqliteBucketStorage.js';
|
|
8
|
+
export * from './client/SQLOpenFactory.js';
|
|
9
|
+
export * from './client/sync/bucket/BucketStorageAdapter.js';
|
|
11
10
|
export * from './client/sync/bucket/CrudBatch.js';
|
|
11
|
+
export { CrudEntry, OpId, UpdateType } from './client/sync/bucket/CrudEntry.js';
|
|
12
12
|
export * from './client/sync/bucket/CrudTransaction.js';
|
|
13
|
+
export * from './client/sync/bucket/OplogEntry.js';
|
|
14
|
+
export * from './client/sync/bucket/OpType.js';
|
|
15
|
+
export * from './client/sync/bucket/SqliteBucketStorage.js';
|
|
13
16
|
export * from './client/sync/bucket/SyncDataBatch.js';
|
|
14
17
|
export * from './client/sync/bucket/SyncDataBucket.js';
|
|
15
|
-
export * from './client/sync/bucket/OpType.js';
|
|
16
|
-
export * from './client/sync/bucket/OplogEntry.js';
|
|
17
18
|
export * from './client/sync/stream/AbstractRemote.js';
|
|
18
19
|
export * from './client/sync/stream/AbstractStreamingSyncImplementation.js';
|
|
19
20
|
export * from './client/sync/stream/streaming-sync-types.js';
|
|
20
|
-
export
|
|
21
|
+
export * from './client/ConnectionManager.js';
|
|
21
22
|
export { ProgressWithOperations, SyncProgress } from './db/crud/SyncProgress.js';
|
|
22
23
|
export * from './db/crud/SyncStatus.js';
|
|
23
24
|
export * from './db/crud/UploadQueueStatus.js';
|
|
24
|
-
export * from './db/
|
|
25
|
-
export * from './db/schema/
|
|
25
|
+
export * from './db/DBAdapter.js';
|
|
26
|
+
export * from './db/schema/Column.js';
|
|
26
27
|
export * from './db/schema/Index.js';
|
|
27
28
|
export * from './db/schema/IndexedColumn.js';
|
|
28
|
-
export * from './db/schema/
|
|
29
|
+
export * from './db/schema/Schema.js';
|
|
30
|
+
export * from './db/schema/Table.js';
|
|
29
31
|
export * from './db/schema/TableV2.js';
|
|
30
|
-
export * from './db/crud/SyncStatus.js';
|
|
31
|
-
export * from './db/crud/UploadQueueStatus.js';
|
|
32
|
-
export * from './db/DBAdapter.js';
|
|
33
32
|
export * from './utils/AbortOperation.js';
|
|
34
33
|
export * from './utils/BaseObserver.js';
|
|
35
34
|
export * from './utils/DataStream.js';
|
package/lib/index.js
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
export * from './client/AbstractPowerSyncDatabase.js';
|
|
2
2
|
export * from './client/AbstractPowerSyncOpenFactory.js';
|
|
3
|
-
export
|
|
3
|
+
export { compilableQueryWatch } from './client/compilableQueryWatch.js';
|
|
4
4
|
export * from './client/connection/PowerSyncBackendConnector.js';
|
|
5
5
|
export * from './client/connection/PowerSyncCredentials.js';
|
|
6
|
-
export
|
|
6
|
+
export { MAX_OP_ID } from './client/constants.js';
|
|
7
7
|
export { runOnSchemaChange } from './client/runOnSchemaChange.js';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export * from './client/sync/bucket/SqliteBucketStorage.js';
|
|
8
|
+
export * from './client/SQLOpenFactory.js';
|
|
9
|
+
export * from './client/sync/bucket/BucketStorageAdapter.js';
|
|
11
10
|
export * from './client/sync/bucket/CrudBatch.js';
|
|
11
|
+
export { CrudEntry, UpdateType } from './client/sync/bucket/CrudEntry.js';
|
|
12
12
|
export * from './client/sync/bucket/CrudTransaction.js';
|
|
13
|
+
export * from './client/sync/bucket/OplogEntry.js';
|
|
14
|
+
export * from './client/sync/bucket/OpType.js';
|
|
15
|
+
export * from './client/sync/bucket/SqliteBucketStorage.js';
|
|
13
16
|
export * from './client/sync/bucket/SyncDataBatch.js';
|
|
14
17
|
export * from './client/sync/bucket/SyncDataBucket.js';
|
|
15
|
-
export * from './client/sync/bucket/OpType.js';
|
|
16
|
-
export * from './client/sync/bucket/OplogEntry.js';
|
|
17
18
|
export * from './client/sync/stream/AbstractRemote.js';
|
|
18
19
|
export * from './client/sync/stream/AbstractStreamingSyncImplementation.js';
|
|
19
20
|
export * from './client/sync/stream/streaming-sync-types.js';
|
|
20
|
-
export
|
|
21
|
+
export * from './client/ConnectionManager.js';
|
|
21
22
|
export { SyncProgress } from './db/crud/SyncProgress.js';
|
|
22
23
|
export * from './db/crud/SyncStatus.js';
|
|
23
24
|
export * from './db/crud/UploadQueueStatus.js';
|
|
24
|
-
export * from './db/
|
|
25
|
-
export * from './db/schema/
|
|
25
|
+
export * from './db/DBAdapter.js';
|
|
26
|
+
export * from './db/schema/Column.js';
|
|
26
27
|
export * from './db/schema/Index.js';
|
|
27
28
|
export * from './db/schema/IndexedColumn.js';
|
|
28
|
-
export * from './db/schema/
|
|
29
|
+
export * from './db/schema/Schema.js';
|
|
30
|
+
export * from './db/schema/Table.js';
|
|
29
31
|
export * from './db/schema/TableV2.js';
|
|
30
|
-
export * from './db/crud/SyncStatus.js';
|
|
31
|
-
export * from './db/crud/UploadQueueStatus.js';
|
|
32
|
-
export * from './db/DBAdapter.js';
|
|
33
32
|
export * from './utils/AbortOperation.js';
|
|
34
33
|
export * from './utils/BaseObserver.js';
|
|
35
34
|
export * from './utils/DataStream.js';
|