@powersync/service-core 0.0.0-dev-20241128134723 → 0.0.0-dev-20241219110735
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 +65 -4
- package/dist/auth/KeySpec.d.ts +1 -0
- package/dist/auth/KeySpec.js +10 -8
- package/dist/auth/KeySpec.js.map +1 -1
- package/dist/auth/RemoteJWKSCollector.js +2 -2
- package/dist/auth/RemoteJWKSCollector.js.map +1 -1
- package/dist/entry/commands/compact-action.js +15 -15
- package/dist/entry/commands/compact-action.js.map +1 -1
- package/dist/entry/commands/migrate-action.js +15 -4
- package/dist/entry/commands/migrate-action.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/migrations/PowerSyncMigrationManager.d.ts +17 -0
- package/dist/migrations/PowerSyncMigrationManager.js +22 -0
- package/dist/migrations/PowerSyncMigrationManager.js.map +1 -0
- package/dist/migrations/ensure-automatic-migrations.d.ts +4 -0
- package/dist/migrations/ensure-automatic-migrations.js +14 -0
- package/dist/migrations/ensure-automatic-migrations.js.map +1 -0
- package/dist/migrations/migrations-index.d.ts +2 -3
- package/dist/migrations/migrations-index.js +2 -3
- package/dist/migrations/migrations-index.js.map +1 -1
- package/dist/routes/RouterEngine.js +2 -1
- package/dist/routes/RouterEngine.js.map +1 -1
- package/dist/routes/configure-fastify.d.ts +28 -28
- package/dist/routes/endpoints/admin.d.ts +24 -24
- package/dist/storage/BucketStorage.d.ts +41 -1
- package/dist/storage/BucketStorage.js +26 -0
- package/dist/storage/BucketStorage.js.map +1 -1
- package/dist/storage/storage-index.d.ts +2 -14
- package/dist/storage/storage-index.js +2 -14
- package/dist/storage/storage-index.js.map +1 -1
- package/dist/sync/sync.js +12 -3
- package/dist/sync/sync.js.map +1 -1
- package/dist/system/ServiceContext.d.ts +3 -0
- package/dist/system/ServiceContext.js +11 -3
- package/dist/system/ServiceContext.js.map +1 -1
- package/dist/util/config/types.d.ts +2 -2
- package/dist/util/utils.d.ts +14 -1
- package/dist/util/utils.js +56 -0
- package/dist/util/utils.js.map +1 -1
- package/package.json +6 -7
- package/src/auth/KeySpec.ts +12 -9
- package/src/auth/RemoteJWKSCollector.ts +2 -2
- package/src/entry/commands/compact-action.ts +20 -15
- package/src/entry/commands/migrate-action.ts +17 -4
- package/src/index.ts +1 -4
- package/src/migrations/PowerSyncMigrationManager.ts +43 -0
- package/src/migrations/ensure-automatic-migrations.ts +15 -0
- package/src/migrations/migrations-index.ts +2 -3
- package/src/routes/RouterEngine.ts +2 -1
- package/src/storage/BucketStorage.ts +44 -1
- package/src/storage/storage-index.ts +3 -15
- package/src/sync/sync.ts +12 -3
- package/src/system/ServiceContext.ts +17 -4
- package/src/util/config/types.ts +2 -2
- package/src/util/utils.ts +59 -1
- package/test/src/auth.test.ts +54 -21
- package/test/src/env.ts +0 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/db/db-index.d.ts +0 -1
- package/dist/db/db-index.js +0 -2
- package/dist/db/db-index.js.map +0 -1
- package/dist/db/mongo.d.ts +0 -35
- package/dist/db/mongo.js +0 -73
- package/dist/db/mongo.js.map +0 -1
- package/dist/locks/LockManager.d.ts +0 -10
- package/dist/locks/LockManager.js +0 -7
- package/dist/locks/LockManager.js.map +0 -1
- package/dist/locks/MongoLocks.d.ts +0 -36
- package/dist/locks/MongoLocks.js +0 -81
- package/dist/locks/MongoLocks.js.map +0 -1
- package/dist/locks/locks-index.d.ts +0 -2
- package/dist/locks/locks-index.js +0 -3
- package/dist/locks/locks-index.js.map +0 -1
- package/dist/migrations/db/migrations/1684951997326-init.d.ts +0 -3
- package/dist/migrations/db/migrations/1684951997326-init.js +0 -33
- package/dist/migrations/db/migrations/1684951997326-init.js.map +0 -1
- package/dist/migrations/db/migrations/1688556755264-initial-sync-rules.d.ts +0 -2
- package/dist/migrations/db/migrations/1688556755264-initial-sync-rules.js +0 -5
- package/dist/migrations/db/migrations/1688556755264-initial-sync-rules.js.map +0 -1
- package/dist/migrations/db/migrations/1702295701188-sync-rule-state.d.ts +0 -3
- package/dist/migrations/db/migrations/1702295701188-sync-rule-state.js +0 -56
- package/dist/migrations/db/migrations/1702295701188-sync-rule-state.js.map +0 -1
- package/dist/migrations/db/migrations/1711543888062-write-checkpoint-index.d.ts +0 -3
- package/dist/migrations/db/migrations/1711543888062-write-checkpoint-index.js +0 -29
- package/dist/migrations/db/migrations/1711543888062-write-checkpoint-index.js.map +0 -1
- package/dist/migrations/db/migrations/1727099539247-custom-write-checkpoint-index.d.ts +0 -3
- package/dist/migrations/db/migrations/1727099539247-custom-write-checkpoint-index.js +0 -31
- package/dist/migrations/db/migrations/1727099539247-custom-write-checkpoint-index.js.map +0 -1
- package/dist/migrations/definitions.d.ts +0 -18
- package/dist/migrations/definitions.js +0 -6
- package/dist/migrations/definitions.js.map +0 -1
- package/dist/migrations/executor.d.ts +0 -16
- package/dist/migrations/executor.js +0 -64
- package/dist/migrations/executor.js.map +0 -1
- package/dist/migrations/migrations.d.ts +0 -18
- package/dist/migrations/migrations.js +0 -110
- package/dist/migrations/migrations.js.map +0 -1
- package/dist/migrations/store/migration-store.d.ts +0 -11
- package/dist/migrations/store/migration-store.js +0 -46
- package/dist/migrations/store/migration-store.js.map +0 -1
- package/dist/storage/MongoBucketStorage.d.ts +0 -48
- package/dist/storage/MongoBucketStorage.js +0 -426
- package/dist/storage/MongoBucketStorage.js.map +0 -1
- package/dist/storage/mongo/MongoBucketBatch.d.ts +0 -67
- package/dist/storage/mongo/MongoBucketBatch.js +0 -643
- package/dist/storage/mongo/MongoBucketBatch.js.map +0 -1
- package/dist/storage/mongo/MongoCompactor.d.ts +0 -40
- package/dist/storage/mongo/MongoCompactor.js +0 -309
- package/dist/storage/mongo/MongoCompactor.js.map +0 -1
- package/dist/storage/mongo/MongoIdSequence.d.ts +0 -12
- package/dist/storage/mongo/MongoIdSequence.js +0 -21
- package/dist/storage/mongo/MongoIdSequence.js.map +0 -1
- package/dist/storage/mongo/MongoPersistedSyncRules.d.ts +0 -9
- package/dist/storage/mongo/MongoPersistedSyncRules.js +0 -9
- package/dist/storage/mongo/MongoPersistedSyncRules.js.map +0 -1
- package/dist/storage/mongo/MongoPersistedSyncRulesContent.d.ts +0 -20
- package/dist/storage/mongo/MongoPersistedSyncRulesContent.js +0 -26
- package/dist/storage/mongo/MongoPersistedSyncRulesContent.js.map +0 -1
- package/dist/storage/mongo/MongoStorageProvider.d.ts +0 -5
- package/dist/storage/mongo/MongoStorageProvider.js +0 -26
- package/dist/storage/mongo/MongoStorageProvider.js.map +0 -1
- package/dist/storage/mongo/MongoSyncBucketStorage.d.ts +0 -38
- package/dist/storage/mongo/MongoSyncBucketStorage.js +0 -531
- package/dist/storage/mongo/MongoSyncBucketStorage.js.map +0 -1
- package/dist/storage/mongo/MongoSyncRulesLock.d.ts +0 -16
- package/dist/storage/mongo/MongoSyncRulesLock.js +0 -65
- package/dist/storage/mongo/MongoSyncRulesLock.js.map +0 -1
- package/dist/storage/mongo/MongoWriteCheckpointAPI.d.ts +0 -20
- package/dist/storage/mongo/MongoWriteCheckpointAPI.js +0 -103
- package/dist/storage/mongo/MongoWriteCheckpointAPI.js.map +0 -1
- package/dist/storage/mongo/OperationBatch.d.ts +0 -35
- package/dist/storage/mongo/OperationBatch.js +0 -119
- package/dist/storage/mongo/OperationBatch.js.map +0 -1
- package/dist/storage/mongo/PersistedBatch.d.ts +0 -46
- package/dist/storage/mongo/PersistedBatch.js +0 -213
- package/dist/storage/mongo/PersistedBatch.js.map +0 -1
- package/dist/storage/mongo/config.d.ts +0 -19
- package/dist/storage/mongo/config.js +0 -26
- package/dist/storage/mongo/config.js.map +0 -1
- package/dist/storage/mongo/db.d.ts +0 -36
- package/dist/storage/mongo/db.js +0 -47
- package/dist/storage/mongo/db.js.map +0 -1
- package/dist/storage/mongo/models.d.ts +0 -156
- package/dist/storage/mongo/models.js +0 -27
- package/dist/storage/mongo/models.js.map +0 -1
- package/dist/storage/mongo/util.d.ts +0 -40
- package/dist/storage/mongo/util.js +0 -151
- package/dist/storage/mongo/util.js.map +0 -1
- package/src/db/db-index.ts +0 -1
- package/src/db/mongo.ts +0 -81
- package/src/locks/LockManager.ts +0 -16
- package/src/locks/MongoLocks.ts +0 -142
- package/src/locks/locks-index.ts +0 -2
- package/src/migrations/db/migrations/1684951997326-init.ts +0 -38
- package/src/migrations/db/migrations/1688556755264-initial-sync-rules.ts +0 -5
- package/src/migrations/db/migrations/1702295701188-sync-rule-state.ts +0 -102
- package/src/migrations/db/migrations/1711543888062-write-checkpoint-index.ts +0 -34
- package/src/migrations/db/migrations/1727099539247-custom-write-checkpoint-index.ts +0 -37
- package/src/migrations/definitions.ts +0 -21
- package/src/migrations/executor.ts +0 -87
- package/src/migrations/migrations.ts +0 -142
- package/src/migrations/store/migration-store.ts +0 -63
- package/src/storage/MongoBucketStorage.ts +0 -540
- package/src/storage/mongo/MongoBucketBatch.ts +0 -841
- package/src/storage/mongo/MongoCompactor.ts +0 -392
- package/src/storage/mongo/MongoIdSequence.ts +0 -24
- package/src/storage/mongo/MongoPersistedSyncRules.ts +0 -16
- package/src/storage/mongo/MongoPersistedSyncRulesContent.ts +0 -50
- package/src/storage/mongo/MongoStorageProvider.ts +0 -31
- package/src/storage/mongo/MongoSyncBucketStorage.ts +0 -636
- package/src/storage/mongo/MongoSyncRulesLock.ts +0 -85
- package/src/storage/mongo/MongoWriteCheckpointAPI.ts +0 -151
- package/src/storage/mongo/OperationBatch.ts +0 -131
- package/src/storage/mongo/PersistedBatch.ts +0 -272
- package/src/storage/mongo/config.ts +0 -40
- package/src/storage/mongo/db.ts +0 -88
- package/src/storage/mongo/models.ts +0 -179
- package/src/storage/mongo/util.ts +0 -158
- package/test/src/__snapshots__/sync.test.ts.snap +0 -332
- package/test/src/bucket_validation.test.ts +0 -142
- package/test/src/bucket_validation.ts +0 -116
- package/test/src/compacting.test.ts +0 -295
- package/test/src/data_storage.test.ts +0 -1499
- package/test/src/stream_utils.ts +0 -42
- package/test/src/sync.test.ts +0 -511
- package/test/src/util.ts +0 -148
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,76 @@
|
|
|
1
1
|
# @powersync/service-core
|
|
2
2
|
|
|
3
|
-
## 0.0.0-dev-
|
|
3
|
+
## 0.0.0-dev-20241219110735
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- 697d44b: Moved MongoDB sync bucket storage implementation to the MongoDB module.
|
|
8
8
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
|
-
- Updated
|
|
12
|
-
|
|
11
|
+
- 697d44b: Updated ts-codec to 1.3.0 for better decode error responses
|
|
12
|
+
- Updated dependencies [697d44b]
|
|
13
|
+
- Updated dependencies [697d44b]
|
|
14
|
+
- Updated dependencies [a66be3b]
|
|
15
|
+
- Updated dependencies [697d44b]
|
|
16
|
+
- @powersync/lib-services-framework@0.0.0-dev-20241219110735
|
|
17
|
+
- @powersync/service-sync-rules@0.0.0-dev-20241219110735
|
|
18
|
+
- @powersync/service-types@0.0.0-dev-20241219110735
|
|
19
|
+
- @powersync/service-rsocket-router@0.0.0-dev-20241219110735
|
|
20
|
+
|
|
21
|
+
## 0.12.2
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 320e646: Fix bucket parameters grouping.
|
|
26
|
+
- e3a9343: Reduce noise in log output
|
|
27
|
+
|
|
28
|
+
## 0.12.1
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- 889ac46: Fix "BSONObj size is invalid" error during replication.
|
|
33
|
+
|
|
34
|
+
## 0.12.0
|
|
35
|
+
|
|
36
|
+
### Minor Changes
|
|
37
|
+
|
|
38
|
+
- ebc62ff: Add EdDSA support for JWTs.
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- Updated dependencies [ebc62ff]
|
|
43
|
+
- @powersync/service-types@0.5.0
|
|
44
|
+
|
|
45
|
+
## 0.11.0
|
|
46
|
+
|
|
47
|
+
### Minor Changes
|
|
48
|
+
|
|
49
|
+
- 62e97f3: Support resuming initial replication for Postgres.
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- 8c6ce90: Workaround for Aurora Postgres write checkpoint bug
|
|
54
|
+
- Updated dependencies [a235c9f]
|
|
55
|
+
- @powersync/service-sync-rules@0.22.0
|
|
56
|
+
|
|
57
|
+
## 0.10.1
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- 2a4f020: Fix regression for missing HTTP probes. Reported in [issue](https://github.com/powersync-ja/powersync-service/issues/144).
|
|
62
|
+
|
|
63
|
+
## 0.10.0
|
|
64
|
+
|
|
65
|
+
### Minor Changes
|
|
66
|
+
|
|
67
|
+
- 35c267f: Add "supabase_jwt_secret" config option to simplify static Supabase auth.
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- 2c18ad2: Fix compact action
|
|
72
|
+
- Updated dependencies [35c267f]
|
|
73
|
+
- @powersync/service-types@0.4.0
|
|
13
74
|
|
|
14
75
|
## 0.9.0
|
|
15
76
|
|
package/dist/auth/KeySpec.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as jose from 'jose';
|
|
2
2
|
export declare const HS_ALGORITHMS: string[];
|
|
3
3
|
export declare const RSA_ALGORITHMS: string[];
|
|
4
|
+
export declare const OKP_ALGORITHMS: string[];
|
|
4
5
|
export declare const SUPPORTED_ALGORITHMS: string[];
|
|
5
6
|
export interface KeyOptions {
|
|
6
7
|
/**
|
package/dist/auth/KeySpec.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as jose from 'jose';
|
|
2
2
|
export const HS_ALGORITHMS = ['HS256', 'HS384', 'HS512'];
|
|
3
3
|
export const RSA_ALGORITHMS = ['RS256', 'RS384', 'RS512'];
|
|
4
|
-
export const
|
|
4
|
+
export const OKP_ALGORITHMS = ['EdDSA'];
|
|
5
|
+
export const SUPPORTED_ALGORITHMS = [...HS_ALGORITHMS, ...RSA_ALGORITHMS, ...OKP_ALGORITHMS];
|
|
5
6
|
export class KeySpec {
|
|
6
7
|
static async importKey(key, options) {
|
|
7
8
|
const parsed = (await jose.importJWK(key));
|
|
@@ -17,18 +18,19 @@ export class KeySpec {
|
|
|
17
18
|
}
|
|
18
19
|
matchesAlgorithm(jwtAlg) {
|
|
19
20
|
if (this.source.alg) {
|
|
20
|
-
return jwtAlg
|
|
21
|
+
return jwtAlg === this.source.alg;
|
|
21
22
|
}
|
|
22
|
-
else if (this.source.kty
|
|
23
|
+
else if (this.source.kty === 'RSA') {
|
|
23
24
|
return RSA_ALGORITHMS.includes(jwtAlg);
|
|
24
25
|
}
|
|
25
|
-
else if (this.source.kty
|
|
26
|
+
else if (this.source.kty === 'oct') {
|
|
26
27
|
return HS_ALGORITHMS.includes(jwtAlg);
|
|
27
28
|
}
|
|
28
|
-
else {
|
|
29
|
-
|
|
30
|
-
return false;
|
|
29
|
+
else if (this.source.kty === 'OKP') {
|
|
30
|
+
return OKP_ALGORITHMS.includes(jwtAlg);
|
|
31
31
|
}
|
|
32
|
+
// 'EC' is unsupported
|
|
33
|
+
return false;
|
|
32
34
|
}
|
|
33
35
|
async isValidSignature(token) {
|
|
34
36
|
try {
|
|
@@ -36,7 +38,7 @@ export class KeySpec {
|
|
|
36
38
|
return true;
|
|
37
39
|
}
|
|
38
40
|
catch (e) {
|
|
39
|
-
if (e.code
|
|
41
|
+
if (e.code === 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED') {
|
|
40
42
|
return false;
|
|
41
43
|
}
|
|
42
44
|
else {
|
package/dist/auth/KeySpec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeySpec.js","sourceRoot":"","sources":["../../src/auth/KeySpec.ts"],"names":[],"mappings":"AAAA,O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OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;IACzB,CAAC;IAED,gBAAgB,CAAC,MAAc;QAC7B,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;YACpB,OAAO,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;QACpC,CAAC;aAAM,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,KAAK,EAAE,CAAC;YACrC,OAAO,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACzC,CAAC;aAAM,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,KAAK,EAAE,CAAC;YACrC,OAAO,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC;aAAM,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,KAAK,EAAE,CAAC;YACrC,OAAO,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACzC,CAAC;QAED,sBAAsB;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,KAAa;QAClC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAC1C,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,CAAC,IAAI,KAAK,uCAAuC,EAAE,CAAC;gBACvD,OAAO,KAAK,CAAC;YACf,CAAC;iBAAM,CAAC;gBACN,iCAAiC;gBACjC,MAAM,CAAC,CAAC;YACV,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -50,8 +50,8 @@ export class RemoteJWKSCollector {
|
|
|
50
50
|
}
|
|
51
51
|
let keys = [];
|
|
52
52
|
for (let keyData of data.keys) {
|
|
53
|
-
if (keyData.kty != 'RSA') {
|
|
54
|
-
//
|
|
53
|
+
if (keyData.kty != 'RSA' && keyData.kty != 'OKP') {
|
|
54
|
+
// HS (oct) keys not allowed because they are symmetric
|
|
55
55
|
continue;
|
|
56
56
|
}
|
|
57
57
|
if (typeof keyData.use == 'string') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteJWKSCollector.js","sourceRoot":"","sources":["../../src/auth/RemoteJWKSCollector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAUvC;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAG9B,YACE,GAAW,EACD,OAAoC;QAApC,YAAO,GAAP,OAAO,CAA6B;QAE9C,IAAI,CAAC;YACH,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;QAC9C,CAAC;QAED,sDAAsD;QACtD,kEAAkE;QAClE,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,IAAI,QAAQ,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,EAAE,CAAC;YAClE,MAAM,IAAI,KAAK,CAAC,gDAAgD,GAAG,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;QAC9C,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,eA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AAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YAC1B,KAAK,OAAO;gBACV,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACjC,KAAK,QAAQ;gBACX,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;CACF"}
|
|
@@ -50,10 +50,11 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
50
50
|
var e = new Error(message);
|
|
51
51
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
52
|
});
|
|
53
|
-
import { logger } from '@powersync/lib-services-framework';
|
|
53
|
+
import { container, logger } from '@powersync/lib-services-framework';
|
|
54
54
|
import * as v8 from 'v8';
|
|
55
|
-
import * as
|
|
55
|
+
import * as system from '../../system/system-index.js';
|
|
56
56
|
import * as utils from '../../util/util-index.js';
|
|
57
|
+
import { modules } from '../../index.js';
|
|
57
58
|
import { extractRunnerOptions, wrapConfigCommand } from './config-command.js';
|
|
58
59
|
const COMMAND_NAME = 'compact';
|
|
59
60
|
/**
|
|
@@ -73,26 +74,24 @@ export function registerCompactAction(program) {
|
|
|
73
74
|
wrapConfigCommand(compactCommand);
|
|
74
75
|
return compactCommand.description('Compact storage').action(async (options) => {
|
|
75
76
|
const buckets = options.buckets?.split(',');
|
|
76
|
-
if (buckets
|
|
77
|
+
if (buckets == null) {
|
|
77
78
|
logger.info('Compacting storage for all buckets...');
|
|
78
79
|
}
|
|
79
80
|
else {
|
|
80
|
-
logger.info(`Compacting storage for ${buckets
|
|
81
|
+
logger.info(`Compacting storage for ${buckets?.join(', ')}...`);
|
|
81
82
|
}
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
const
|
|
83
|
+
const config = await utils.loadConfig(extractRunnerOptions(options));
|
|
84
|
+
const serviceContext = new system.ServiceContextContainer(config);
|
|
85
|
+
// Register modules in order to allow custom module compacting
|
|
86
|
+
const moduleManager = container.getImplementation(modules.ModuleManager);
|
|
87
|
+
await moduleManager.initialize(serviceContext);
|
|
86
88
|
logger.info('Connecting to storage...');
|
|
87
|
-
const psdb = storage.createPowerSyncMongo(storageConfig);
|
|
88
|
-
const client = psdb.client;
|
|
89
|
-
await client.connect();
|
|
90
89
|
try {
|
|
91
90
|
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
92
91
|
try {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
// Start the storage engine in order to create the appropriate BucketStorage
|
|
93
|
+
await serviceContext.lifeCycleEngine.start();
|
|
94
|
+
const bucketStorage = serviceContext.storageEngine.activeBucketStorage;
|
|
96
95
|
const active = await bucketStorage.getActiveSyncRulesContent();
|
|
97
96
|
if (active == null) {
|
|
98
97
|
logger.info('No active instance to compact');
|
|
@@ -113,10 +112,11 @@ export function registerCompactAction(program) {
|
|
|
113
112
|
}
|
|
114
113
|
catch (e) {
|
|
115
114
|
logger.error(`Failed to compact: ${e.toString()}`);
|
|
115
|
+
// Indirectly triggers lifeCycleEngine.stop
|
|
116
116
|
process.exit(1);
|
|
117
117
|
}
|
|
118
118
|
finally {
|
|
119
|
-
|
|
119
|
+
// Indirectly triggers lifeCycleEngine.stop
|
|
120
120
|
process.exit(0);
|
|
121
121
|
}
|
|
122
122
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact-action.js","sourceRoot":"","sources":["../../../src/entry/commands/compact-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"compact-action.js","sourceRoot":"","sources":["../../../src/entry/commands/compact-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { logger } from '@powersync/lib-services-framework';
|
|
2
|
-
import * as
|
|
1
|
+
import { container, logger } from '@powersync/lib-services-framework';
|
|
2
|
+
import * as modules from '../../modules/modules-index.js';
|
|
3
|
+
import * as system from '../../system/system-index.js';
|
|
4
|
+
import * as utils from '../../util/util-index.js';
|
|
3
5
|
import { extractRunnerOptions, wrapConfigCommand } from './config-command.js';
|
|
4
6
|
const COMMAND_NAME = 'migrate';
|
|
5
7
|
export function registerMigrationAction(program) {
|
|
@@ -9,11 +11,20 @@ export function registerMigrationAction(program) {
|
|
|
9
11
|
.description('Run migrations')
|
|
10
12
|
.argument('<direction>', 'Migration direction. `up` or `down`')
|
|
11
13
|
.action(async (direction, options) => {
|
|
14
|
+
const config = await utils.loadConfig(extractRunnerOptions(options));
|
|
15
|
+
const serviceContext = new system.ServiceContextContainer(config);
|
|
16
|
+
// Register modules in order to allow custom module migrations
|
|
17
|
+
const moduleManager = container.getImplementation(modules.ModuleManager);
|
|
18
|
+
await moduleManager.initialize(serviceContext);
|
|
12
19
|
try {
|
|
13
|
-
await migrations.migrate({
|
|
20
|
+
await serviceContext.migrations.migrate({
|
|
14
21
|
direction,
|
|
15
|
-
|
|
22
|
+
// Give the migrations access to the service context
|
|
23
|
+
migrationContext: {
|
|
24
|
+
service_context: serviceContext
|
|
25
|
+
}
|
|
16
26
|
});
|
|
27
|
+
await serviceContext.migrations[Symbol.asyncDispose]();
|
|
17
28
|
process.exit(0);
|
|
18
29
|
}
|
|
19
30
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-action.js","sourceRoot":"","sources":["../../../src/entry/commands/migrate-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"migrate-action.js","sourceRoot":"","sources":["../../../src/entry/commands/migrate-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,S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EAAE,CAAC;YACX,MAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;YACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,15 +2,13 @@ export * from './api/api-index.js';
|
|
|
2
2
|
export * as api from './api/api-index.js';
|
|
3
3
|
export * from './auth/auth-index.js';
|
|
4
4
|
export * as auth from './auth/auth-index.js';
|
|
5
|
-
export * from './db/db-index.js';
|
|
6
|
-
export * as db from './db/db-index.js';
|
|
7
5
|
export * from './entry/entry-index.js';
|
|
8
6
|
export * as entry from './entry/entry-index.js';
|
|
9
7
|
export * as framework from '@powersync/lib-services-framework';
|
|
10
8
|
export * from './metrics/Metrics.js';
|
|
11
9
|
export * as metrics from './metrics/Metrics.js';
|
|
10
|
+
export * from './migrations/migrations-index.js';
|
|
12
11
|
export * as migrations from './migrations/migrations-index.js';
|
|
13
|
-
export * from './migrations/migrations.js';
|
|
14
12
|
export * from './modules/modules-index.js';
|
|
15
13
|
export * as modules from './modules/modules-index.js';
|
|
16
14
|
export * from './replication/replication-index.js';
|
package/dist/index.js
CHANGED
|
@@ -3,16 +3,14 @@ export * from './api/api-index.js';
|
|
|
3
3
|
export * as api from './api/api-index.js';
|
|
4
4
|
export * from './auth/auth-index.js';
|
|
5
5
|
export * as auth from './auth/auth-index.js';
|
|
6
|
-
export * from './db/db-index.js';
|
|
7
|
-
export * as db from './db/db-index.js';
|
|
8
6
|
export * from './entry/entry-index.js';
|
|
9
7
|
export * as entry from './entry/entry-index.js';
|
|
10
8
|
// Re-export framework for easy use of Container API
|
|
11
9
|
export * as framework from '@powersync/lib-services-framework';
|
|
12
10
|
export * from './metrics/Metrics.js';
|
|
13
11
|
export * as metrics from './metrics/Metrics.js';
|
|
12
|
+
export * from './migrations/migrations-index.js';
|
|
14
13
|
export * as migrations from './migrations/migrations-index.js';
|
|
15
|
-
export * from './migrations/migrations.js';
|
|
16
14
|
export * from './modules/modules-index.js';
|
|
17
15
|
export * as modules from './modules/modules-index.js';
|
|
18
16
|
export * from './replication/replication-index.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AAEzC,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,sBAAsB,CAAC;AAE7C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AAEzC,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,sBAAsB,CAAC;AAE7C,cAAc,wBAAwB,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,wBAAwB,CAAC;AAEhD,oDAAoD;AACpD,OAAO,KAAK,SAAS,MAAM,mCAAmC,CAAC;AAE/D,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,cAAc,kCAAkC,CAAC;AACjD,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAE/D,cAAc,4BAA4B,CAAC;AAC3C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAEtD,cAAc,oCAAoC,CAAC;AACnD,OAAO,KAAK,WAAW,MAAM,oCAAoC,CAAC;AAElE,cAAc,0BAA0B,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AAEnD,cAAc,4BAA4B,CAAC;AAC3C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAEtD,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,sBAAsB,CAAC;AAE7C,cAAc,0BAA0B,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AAEnD,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as framework from '@powersync/lib-services-framework';
|
|
2
|
+
import * as system from '../system/system-index.js';
|
|
3
|
+
/**
|
|
4
|
+
* PowerSync service migrations each have this context available to the `up` and `down` methods.
|
|
5
|
+
*/
|
|
6
|
+
export interface PowerSyncMigrationContext {
|
|
7
|
+
service_context: system.ServiceContext;
|
|
8
|
+
}
|
|
9
|
+
export interface PowerSyncMigrationGenerics extends framework.MigrationAgentGenerics {
|
|
10
|
+
MIGRATION_CONTEXT: PowerSyncMigrationContext;
|
|
11
|
+
}
|
|
12
|
+
export type PowerSyncMigrationFunction = framework.MigrationFunction<PowerSyncMigrationContext>;
|
|
13
|
+
export declare abstract class AbstractPowerSyncMigrationAgent extends framework.AbstractMigrationAgent<PowerSyncMigrationGenerics> {
|
|
14
|
+
abstract getInternalScriptsDir(): string;
|
|
15
|
+
loadInternalMigrations(): Promise<framework.Migration<PowerSyncMigrationContext>[]>;
|
|
16
|
+
}
|
|
17
|
+
export type PowerSyncMigrationManager = framework.MigrationManager<PowerSyncMigrationGenerics>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as framework from '@powersync/lib-services-framework';
|
|
2
|
+
import fs from 'fs/promises';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
export class AbstractPowerSyncMigrationAgent extends framework.AbstractMigrationAgent {
|
|
5
|
+
async loadInternalMigrations() {
|
|
6
|
+
const migrationsDir = this.getInternalScriptsDir();
|
|
7
|
+
const files = await fs.readdir(migrationsDir);
|
|
8
|
+
const migrations = files.filter((file) => {
|
|
9
|
+
// Vitest resolves ts files
|
|
10
|
+
return ['.js', '.ts'].includes(path.extname(file));
|
|
11
|
+
});
|
|
12
|
+
return await Promise.all(migrations.map(async (migration) => {
|
|
13
|
+
const module = await import(path.resolve(migrationsDir, migration));
|
|
14
|
+
return {
|
|
15
|
+
name: path.basename(migration).replace(path.extname(migration), ''),
|
|
16
|
+
up: module.up,
|
|
17
|
+
down: module.down
|
|
18
|
+
};
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=PowerSyncMigrationManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PowerSyncMigrationManager.js","sourceRoot":"","sources":["../../src/migrations/PowerSyncMigrationManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAgBxB,MAAM,OAAgB,+BAAgC,SAAQ,SAAS,CAAC,sBAAkD;IAGxH,KAAK,CAAC,sBAAsB;QAC1B,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC9C,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;YACvC,2BAA2B;YAC3B,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,OAAO,CAAC,GAAG,CACtB,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;YACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;YACpE,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC;gBACnE,EAAE,EAAE,MAAM,CAAC,EAAE;gBACb,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as framework from '@powersync/lib-services-framework';
|
|
2
|
+
export const ensureAutomaticMigrations = async (options) => {
|
|
3
|
+
const { serviceContext } = options;
|
|
4
|
+
if (serviceContext.configuration.migrations?.disable_auto_migration) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
await serviceContext.migrations.migrate({
|
|
8
|
+
direction: framework.migrations.Direction.Up,
|
|
9
|
+
migrationContext: {
|
|
10
|
+
service_context: serviceContext
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=ensure-automatic-migrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensure-automatic-migrations.js","sourceRoot":"","sources":["../../src/migrations/ensure-automatic-migrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,mCAAmC,CAAC;AAG/D,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,EAAE,OAAkD,EAAE,EAAE;IACpG,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IACnC,IAAI,cAAc,CAAC,aAAa,CAAC,UAAU,EAAE,sBAAsB,EAAE,CAAC;QACpE,OAAO;IACT,CAAC;IACD,MAAM,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC;QACtC,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QAC5C,gBAAgB,EAAE;YAChB,eAAe,EAAE,cAAc;SAChC;KACF,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './migrations.js';
|
|
1
|
+
export * from './ensure-automatic-migrations.js';
|
|
2
|
+
export * from './PowerSyncMigrationManager.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations-index.js","sourceRoot":"","sources":["../../src/migrations/migrations-index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"migrations-index.js","sourceRoot":"","sources":["../../src/migrations/migrations-index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { logger } from '@powersync/lib-services-framework';
|
|
2
2
|
import { ADMIN_ROUTES } from './endpoints/admin.js';
|
|
3
3
|
import { CHECKPOINT_ROUTES } from './endpoints/checkpointing.js';
|
|
4
|
+
import { PROBES_ROUTES } from './endpoints/probes.js';
|
|
4
5
|
import { syncStreamReactive } from './endpoints/socket-route.js';
|
|
5
6
|
import { SYNC_RULES_ROUTES } from './endpoints/sync-rules.js';
|
|
6
7
|
import { SYNC_STREAM_ROUTES } from './endpoints/sync-stream.js';
|
|
@@ -16,7 +17,7 @@ export class RouterEngine {
|
|
|
16
17
|
this.closed = false;
|
|
17
18
|
// Default routes
|
|
18
19
|
this.routes = {
|
|
19
|
-
api_routes: [...ADMIN_ROUTES, ...CHECKPOINT_ROUTES, ...SYNC_RULES_ROUTES],
|
|
20
|
+
api_routes: [...ADMIN_ROUTES, ...CHECKPOINT_ROUTES, ...SYNC_RULES_ROUTES, ...PROBES_ROUTES],
|
|
20
21
|
stream_routes: [...SYNC_STREAM_ROUTES],
|
|
21
22
|
socket_routes: [syncStreamReactive]
|
|
22
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouterEngine.js","sourceRoot":"","sources":["../../src/routes/RouterEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mCA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;QAC1D,KAAK,IAAI,OAAO,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAEhC,8BAA8B;QAC9B,MAAM,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;QAE9B,yBAAyB;QACzB,MAAM,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;IACvD,CAAC;IAED;;;OAGG;IACH,cAAc,CAAC,OAAmB;QAChC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;YACV,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;QAClB,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC/B,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpC,CAAC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -31,11 +31,11 @@ export declare const DEFAULT_ROUTE_OPTIONS: {
|
|
|
31
31
|
};
|
|
32
32
|
connection_id?: string | undefined;
|
|
33
33
|
}, {
|
|
34
|
+
success: boolean;
|
|
34
35
|
results: {
|
|
35
36
|
columns: string[];
|
|
36
37
|
rows: (string | number | boolean | null)[][];
|
|
37
38
|
};
|
|
38
|
-
success: boolean;
|
|
39
39
|
error?: string | undefined;
|
|
40
40
|
}, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<{
|
|
41
41
|
sql: {
|
|
@@ -50,11 +50,11 @@ export declare const DEFAULT_ROUTE_OPTIONS: {
|
|
|
50
50
|
};
|
|
51
51
|
connection_id?: string | undefined;
|
|
52
52
|
}, import("./router.js").Context, import("./router.js").BasicRouterRequest>, {
|
|
53
|
+
success: boolean;
|
|
53
54
|
results: {
|
|
54
55
|
columns: string[];
|
|
55
56
|
rows: (string | number | boolean | null)[][];
|
|
56
57
|
};
|
|
57
|
-
success: boolean;
|
|
58
58
|
error?: string | undefined;
|
|
59
59
|
}>> & {
|
|
60
60
|
path: string;
|
|
@@ -80,11 +80,11 @@ export declare const DEFAULT_ROUTE_OPTIONS: {
|
|
|
80
80
|
};
|
|
81
81
|
connection_id?: string | undefined;
|
|
82
82
|
}, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<{
|
|
83
|
+
success: boolean;
|
|
83
84
|
results: {
|
|
84
85
|
columns: string[];
|
|
85
86
|
rows: (string | number | boolean | null)[][];
|
|
86
87
|
};
|
|
87
|
-
success: boolean;
|
|
88
88
|
error?: string | undefined;
|
|
89
89
|
}>;
|
|
90
90
|
}) | (import("@powersync/lib-services-framework").Endpoint<{
|
|
@@ -426,8 +426,8 @@ export declare const DEFAULT_ROUTE_OPTIONS: {
|
|
|
426
426
|
level: "warning" | "fatal";
|
|
427
427
|
}[];
|
|
428
428
|
connections: {
|
|
429
|
-
id: string;
|
|
430
429
|
tag: string;
|
|
430
|
+
id: string;
|
|
431
431
|
slot_name: string;
|
|
432
432
|
initial_replication_done: boolean;
|
|
433
433
|
tables: {
|
|
@@ -442,9 +442,9 @@ export declare const DEFAULT_ROUTE_OPTIONS: {
|
|
|
442
442
|
parameter_queries: boolean;
|
|
443
443
|
pattern?: string | undefined;
|
|
444
444
|
}[];
|
|
445
|
-
last_checkpoint_ts?: string | undefined;
|
|
446
|
-
last_keepalive_ts?: string | undefined;
|
|
447
445
|
last_lsn?: string | undefined;
|
|
446
|
+
last_keepalive_ts?: string | undefined;
|
|
447
|
+
last_checkpoint_ts?: string | undefined;
|
|
448
448
|
replication_lag_bytes?: number | undefined;
|
|
449
449
|
}[];
|
|
450
450
|
content?: string | undefined;
|
|
@@ -458,8 +458,8 @@ export declare const DEFAULT_ROUTE_OPTIONS: {
|
|
|
458
458
|
level: "warning" | "fatal";
|
|
459
459
|
}[];
|
|
460
460
|
connections: {
|
|
461
|
-
id: string;
|
|
462
461
|
tag: string;
|
|
462
|
+
id: string;
|
|
463
463
|
slot_name: string;
|
|
464
464
|
initial_replication_done: boolean;
|
|
465
465
|
tables: {
|
|
@@ -474,9 +474,9 @@ export declare const DEFAULT_ROUTE_OPTIONS: {
|
|
|
474
474
|
parameter_queries: boolean;
|
|
475
475
|
pattern?: string | undefined;
|
|
476
476
|
}[];
|
|
477
|
-
last_checkpoint_ts?: string | undefined;
|
|
478
|
-
last_keepalive_ts?: string | undefined;
|
|
479
477
|
last_lsn?: string | undefined;
|
|
478
|
+
last_keepalive_ts?: string | undefined;
|
|
479
|
+
last_checkpoint_ts?: string | undefined;
|
|
480
480
|
replication_lag_bytes?: number | undefined;
|
|
481
481
|
}[];
|
|
482
482
|
content?: string | undefined;
|
|
@@ -501,8 +501,8 @@ export declare const DEFAULT_ROUTE_OPTIONS: {
|
|
|
501
501
|
level: "warning" | "fatal";
|
|
502
502
|
}[];
|
|
503
503
|
connections: {
|
|
504
|
-
id: string;
|
|
505
504
|
tag: string;
|
|
505
|
+
id: string;
|
|
506
506
|
slot_name: string;
|
|
507
507
|
initial_replication_done: boolean;
|
|
508
508
|
tables: {
|
|
@@ -517,9 +517,9 @@ export declare const DEFAULT_ROUTE_OPTIONS: {
|
|
|
517
517
|
parameter_queries: boolean;
|
|
518
518
|
pattern?: string | undefined;
|
|
519
519
|
}[];
|
|
520
|
-
last_checkpoint_ts?: string | undefined;
|
|
521
|
-
last_keepalive_ts?: string | undefined;
|
|
522
520
|
last_lsn?: string | undefined;
|
|
521
|
+
last_keepalive_ts?: string | undefined;
|
|
522
|
+
last_checkpoint_ts?: string | undefined;
|
|
523
523
|
replication_lag_bytes?: number | undefined;
|
|
524
524
|
}[];
|
|
525
525
|
content?: string | undefined;
|
|
@@ -580,6 +580,22 @@ export declare const DEFAULT_ROUTE_OPTIONS: {
|
|
|
580
580
|
}, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<{
|
|
581
581
|
write_checkpoint: string;
|
|
582
582
|
}>;
|
|
583
|
+
}) | (import("@powersync/lib-services-framework").Endpoint<unknown, import("@powersync/lib-services-framework").RouterResponse<{
|
|
584
|
+
ready: boolean;
|
|
585
|
+
started: boolean;
|
|
586
|
+
touched_at: Date;
|
|
587
|
+
}>, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<unknown, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<unknown, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").RouterResponse<{
|
|
588
|
+
ready: boolean;
|
|
589
|
+
started: boolean;
|
|
590
|
+
touched_at: Date;
|
|
591
|
+
}>>> & {
|
|
592
|
+
path: import("./endpoints/probes.js").ProbeRoutes;
|
|
593
|
+
method: import("@powersync/lib-services-framework").HTTPMethod.GET;
|
|
594
|
+
handler: () => Promise<import("@powersync/lib-services-framework").RouterResponse<{
|
|
595
|
+
ready: boolean;
|
|
596
|
+
started: boolean;
|
|
597
|
+
touched_at: Date;
|
|
598
|
+
}>>;
|
|
583
599
|
}) | (import("@powersync/lib-services-framework").Endpoint<{
|
|
584
600
|
content: string;
|
|
585
601
|
}, {
|
|
@@ -663,22 +679,6 @@ export declare const DEFAULT_ROUTE_OPTIONS: {
|
|
|
663
679
|
handler: (payload: import("./router.js").RequestEndpointHandlerPayload<{}, import("./router.js").Context, import("./router.js").BasicRouterRequest>) => Promise<{
|
|
664
680
|
slot_name: string;
|
|
665
681
|
}>;
|
|
666
|
-
}) | (import("@powersync/lib-services-framework").Endpoint<unknown, import("@powersync/lib-services-framework").RouterResponse<{
|
|
667
|
-
ready: boolean;
|
|
668
|
-
started: boolean;
|
|
669
|
-
touched_at: Date;
|
|
670
|
-
}>, import("./router.js").Context, import("./router.js").RequestEndpointHandlerPayload<unknown, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").EndpointHandler<import("./router.js").RequestEndpointHandlerPayload<unknown, import("./router.js").Context, import("./router.js").BasicRouterRequest>, import("@powersync/lib-services-framework").RouterResponse<{
|
|
671
|
-
ready: boolean;
|
|
672
|
-
started: boolean;
|
|
673
|
-
touched_at: Date;
|
|
674
|
-
}>>> & {
|
|
675
|
-
path: import("./endpoints/probes.js").ProbeRoutes;
|
|
676
|
-
method: import("@powersync/lib-services-framework").HTTPMethod.GET;
|
|
677
|
-
handler: () => Promise<import("@powersync/lib-services-framework").RouterResponse<{
|
|
678
|
-
ready: boolean;
|
|
679
|
-
started: boolean;
|
|
680
|
-
touched_at: Date;
|
|
681
|
-
}>>;
|
|
682
682
|
}))[];
|
|
683
683
|
queue_options: {
|
|
684
684
|
concurrency: number;
|