@powersync/web 1.30.0 → 1.31.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/index.umd.js +7194 -1835
- package/dist/index.umd.js.map +1 -1
- package/dist/worker/SharedSyncImplementation.umd.js +536 -286
- package/dist/worker/SharedSyncImplementation.umd.js.map +1 -1
- package/dist/worker/WASQLiteDB.umd.js +180 -122
- package/dist/worker/WASQLiteDB.umd.js.map +1 -1
- package/dist/worker/node_modules_bson_lib_bson_mjs.umd.js +3 -3
- package/dist/worker/node_modules_bson_lib_bson_mjs.umd.js.map +1 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite-async_mjs.umd.js +6 -6
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite-async_mjs.umd.js.map +1 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite_mjs.umd.js +6 -6
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite_mjs.umd.js.map +1 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js +6 -6
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js.map +1 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js +6 -6
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js.map +1 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js.umd.js +9 -9
- package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js.umd.js.map +1 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.umd.js +12 -12
- package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.umd.js.map +1 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js.umd.js +9 -9
- package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js.umd.js.map +1 -1
- package/lib/package.json +4 -4
- package/lib/src/db/PowerSyncDatabase.d.ts +1 -1
- package/lib/src/db/PowerSyncDatabase.js +4 -4
- package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.d.ts +17 -0
- package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.js +109 -19
- package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.d.ts +5 -1
- package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js +14 -7
- package/lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js +11 -2
- package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.d.ts +1 -1
- package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.js +2 -2
- package/lib/src/db/sync/SharedWebStreamingSyncImplementation.d.ts +2 -5
- package/lib/src/db/sync/SharedWebStreamingSyncImplementation.js +51 -35
- package/lib/src/worker/sync/SharedSyncImplementation.d.ts +18 -8
- package/lib/src/worker/sync/SharedSyncImplementation.js +204 -108
- package/lib/src/worker/sync/SharedSyncImplementation.worker.js +1 -1
- package/lib/src/worker/sync/WorkerClient.d.ts +4 -5
- package/lib/src/worker/sync/WorkerClient.js +7 -9
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/db/PowerSyncDatabase.ts +13 -15
- package/src/db/adapters/LockedAsyncDatabaseAdapter.ts +126 -25
- package/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.ts +18 -6
- package/src/db/adapters/wa-sqlite/WASQLiteConnection.ts +11 -3
- package/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.ts +3 -3
- package/src/db/sync/SharedWebStreamingSyncImplementation.ts +65 -47
- package/src/worker/db/WASQLiteDB.worker.ts +0 -1
- package/src/worker/sync/SharedSyncImplementation.ts +234 -119
- package/src/worker/sync/SharedSyncImplementation.worker.ts +1 -1
- package/src/worker/sync/WorkerClient.ts +9 -13
|
@@ -3,11 +3,11 @@ var sdk_web;
|
|
|
3
3
|
/******/ "use strict";
|
|
4
4
|
/******/ var __webpack_modules__ = ({
|
|
5
5
|
|
|
6
|
-
/***/ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js"
|
|
6
|
+
/***/ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js"
|
|
7
7
|
/*!*******************************************************************!*\
|
|
8
8
|
!*** ../../node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js ***!
|
|
9
9
|
\*******************************************************************/
|
|
10
|
-
|
|
10
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
11
11
|
|
|
12
12
|
__webpack_require__.r(__webpack_exports__);
|
|
13
13
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -1147,8 +1147,11 @@ function Factory(Module) {
|
|
|
1147
1147
|
// Wait for all pending retry operations to complete. This is
|
|
1148
1148
|
// normally empty on the first loop iteration.
|
|
1149
1149
|
if (Module.retryOps.length) {
|
|
1150
|
-
|
|
1151
|
-
|
|
1150
|
+
try {
|
|
1151
|
+
await Promise.all(Module.retryOps);
|
|
1152
|
+
} finally {
|
|
1153
|
+
Module.retryOps = [];
|
|
1154
|
+
}
|
|
1152
1155
|
}
|
|
1153
1156
|
|
|
1154
1157
|
rc = await f();
|
|
@@ -1193,13 +1196,13 @@ function decl(s) {
|
|
|
1193
1196
|
}
|
|
1194
1197
|
|
|
1195
1198
|
|
|
1196
|
-
/***/ }
|
|
1199
|
+
/***/ },
|
|
1197
1200
|
|
|
1198
|
-
/***/ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js"
|
|
1201
|
+
/***/ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js"
|
|
1199
1202
|
/*!*************************************************************************!*\
|
|
1200
1203
|
!*** ../../node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js ***!
|
|
1201
1204
|
\*************************************************************************/
|
|
1202
|
-
|
|
1205
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1203
1206
|
|
|
1204
1207
|
__webpack_require__.r(__webpack_exports__);
|
|
1205
1208
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -1712,13 +1715,13 @@ const SQLITE_PREPARE_PERSISTENT = 0x01;
|
|
|
1712
1715
|
const SQLITE_PREPARE_NORMALIZED = 0x02;
|
|
1713
1716
|
const SQLITE_PREPARE_NO_VTAB = 0x04;
|
|
1714
1717
|
|
|
1715
|
-
/***/ }
|
|
1718
|
+
/***/ },
|
|
1716
1719
|
|
|
1717
|
-
/***/ "../../node_modules/async-mutex/index.mjs"
|
|
1720
|
+
/***/ "../../node_modules/async-mutex/index.mjs"
|
|
1718
1721
|
/*!************************************************!*\
|
|
1719
1722
|
!*** ../../node_modules/async-mutex/index.mjs ***!
|
|
1720
1723
|
\************************************************/
|
|
1721
|
-
|
|
1724
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1722
1725
|
|
|
1723
1726
|
__webpack_require__.r(__webpack_exports__);
|
|
1724
1727
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -2023,13 +2026,13 @@ function tryAcquire(sync, alreadyAcquiredError = E_ALREADY_LOCKED) {
|
|
|
2023
2026
|
|
|
2024
2027
|
|
|
2025
2028
|
|
|
2026
|
-
/***/ }
|
|
2029
|
+
/***/ },
|
|
2027
2030
|
|
|
2028
|
-
/***/ "../../node_modules/comlink/dist/esm/comlink.mjs"
|
|
2031
|
+
/***/ "../../node_modules/comlink/dist/esm/comlink.mjs"
|
|
2029
2032
|
/*!*******************************************************!*\
|
|
2030
2033
|
!*** ../../node_modules/comlink/dist/esm/comlink.mjs ***!
|
|
2031
2034
|
\*******************************************************/
|
|
2032
|
-
|
|
2035
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
2033
2036
|
|
|
2034
2037
|
__webpack_require__.r(__webpack_exports__);
|
|
2035
2038
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -2404,13 +2407,13 @@ function generateUUID() {
|
|
|
2404
2407
|
//# sourceMappingURL=comlink.mjs.map
|
|
2405
2408
|
|
|
2406
2409
|
|
|
2407
|
-
/***/ }
|
|
2410
|
+
/***/ },
|
|
2408
2411
|
|
|
2409
|
-
/***/ "../common/dist/bundle.mjs"
|
|
2412
|
+
/***/ "../common/dist/bundle.mjs"
|
|
2410
2413
|
/*!*********************************!*\
|
|
2411
2414
|
!*** ../common/dist/bundle.mjs ***!
|
|
2412
2415
|
\*********************************/
|
|
2413
|
-
|
|
2416
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
2414
2417
|
|
|
2415
2418
|
__webpack_require__.r(__webpack_exports__);
|
|
2416
2419
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -2424,6 +2427,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2424
2427
|
/* harmony export */ BaseObserver: () => (/* binding */ BaseObserver),
|
|
2425
2428
|
/* harmony export */ Column: () => (/* binding */ Column),
|
|
2426
2429
|
/* harmony export */ ColumnType: () => (/* binding */ ColumnType),
|
|
2430
|
+
/* harmony export */ ConnectionClosedError: () => (/* binding */ ConnectionClosedError),
|
|
2427
2431
|
/* harmony export */ ConnectionManager: () => (/* binding */ ConnectionManager),
|
|
2428
2432
|
/* harmony export */ ControlledExecutor: () => (/* binding */ ControlledExecutor),
|
|
2429
2433
|
/* harmony export */ CrudBatch: () => (/* binding */ CrudBatch),
|
|
@@ -3228,12 +3232,30 @@ class SyncStatus {
|
|
|
3228
3232
|
return {
|
|
3229
3233
|
connected: this.connected,
|
|
3230
3234
|
connecting: this.connecting,
|
|
3231
|
-
dataFlow:
|
|
3235
|
+
dataFlow: {
|
|
3236
|
+
...this.dataFlowStatus,
|
|
3237
|
+
uploadError: this.serializeError(this.dataFlowStatus.uploadError),
|
|
3238
|
+
downloadError: this.serializeError(this.dataFlowStatus.downloadError)
|
|
3239
|
+
},
|
|
3232
3240
|
lastSyncedAt: this.lastSyncedAt,
|
|
3233
3241
|
hasSynced: this.hasSynced,
|
|
3234
3242
|
priorityStatusEntries: this.priorityStatusEntries
|
|
3235
3243
|
};
|
|
3236
3244
|
}
|
|
3245
|
+
/**
|
|
3246
|
+
* Not all errors are serializable over a MessagePort. E.g. some `DomExceptions` fail to be passed across workers.
|
|
3247
|
+
* This explicitly serializes errors in the SyncStatus.
|
|
3248
|
+
*/
|
|
3249
|
+
serializeError(error) {
|
|
3250
|
+
if (typeof error == 'undefined') {
|
|
3251
|
+
return undefined;
|
|
3252
|
+
}
|
|
3253
|
+
return {
|
|
3254
|
+
name: error.name,
|
|
3255
|
+
message: error.message,
|
|
3256
|
+
stack: error.stack
|
|
3257
|
+
};
|
|
3258
|
+
}
|
|
3237
3259
|
static comparePriorities(a, b) {
|
|
3238
3260
|
return b.priority - a.priority; // Reverse because higher priorities have lower numbers
|
|
3239
3261
|
}
|
|
@@ -4846,7 +4868,7 @@ var hasRequiredBuffer$1;
|
|
|
4846
4868
|
function requireBuffer$1 () {
|
|
4847
4869
|
if (hasRequiredBuffer$1) return buffer$1;
|
|
4848
4870
|
hasRequiredBuffer$1 = 1;
|
|
4849
|
-
(function (exports) {
|
|
4871
|
+
(function (exports$1) {
|
|
4850
4872
|
|
|
4851
4873
|
const base64 = requireBase64Js();
|
|
4852
4874
|
const ieee754 = requireIeee754();
|
|
@@ -4855,12 +4877,12 @@ function requireBuffer$1 () {
|
|
|
4855
4877
|
? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
|
|
4856
4878
|
: null;
|
|
4857
4879
|
|
|
4858
|
-
exports.Buffer = Buffer;
|
|
4859
|
-
exports.SlowBuffer = SlowBuffer;
|
|
4860
|
-
exports.INSPECT_MAX_BYTES = 50;
|
|
4880
|
+
exports$1.Buffer = Buffer;
|
|
4881
|
+
exports$1.SlowBuffer = SlowBuffer;
|
|
4882
|
+
exports$1.INSPECT_MAX_BYTES = 50;
|
|
4861
4883
|
|
|
4862
4884
|
const K_MAX_LENGTH = 0x7fffffff;
|
|
4863
|
-
exports.kMaxLength = K_MAX_LENGTH;
|
|
4885
|
+
exports$1.kMaxLength = K_MAX_LENGTH;
|
|
4864
4886
|
|
|
4865
4887
|
/**
|
|
4866
4888
|
* If `Buffer.TYPED_ARRAY_SUPPORT`:
|
|
@@ -5456,7 +5478,7 @@ function requireBuffer$1 () {
|
|
|
5456
5478
|
|
|
5457
5479
|
Buffer.prototype.inspect = function inspect () {
|
|
5458
5480
|
let str = '';
|
|
5459
|
-
const max = exports.INSPECT_MAX_BYTES;
|
|
5481
|
+
const max = exports$1.INSPECT_MAX_BYTES;
|
|
5460
5482
|
str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim();
|
|
5461
5483
|
if (this.length > max) str += ' ... ';
|
|
5462
5484
|
return '<Buffer ' + str + '>'
|
|
@@ -6964,7 +6986,7 @@ var hasRequiredBuffer;
|
|
|
6964
6986
|
function requireBuffer () {
|
|
6965
6987
|
if (hasRequiredBuffer) return buffer;
|
|
6966
6988
|
hasRequiredBuffer = 1;
|
|
6967
|
-
(function (exports) {
|
|
6989
|
+
(function (exports$1) {
|
|
6968
6990
|
|
|
6969
6991
|
var base64 = requireBase64Js();
|
|
6970
6992
|
var ieee754 = requireIeee754();
|
|
@@ -6973,12 +6995,12 @@ function requireBuffer () {
|
|
|
6973
6995
|
? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
|
|
6974
6996
|
: null;
|
|
6975
6997
|
|
|
6976
|
-
exports.Buffer = Buffer;
|
|
6977
|
-
exports.SlowBuffer = SlowBuffer;
|
|
6978
|
-
exports.INSPECT_MAX_BYTES = 50;
|
|
6998
|
+
exports$1.Buffer = Buffer;
|
|
6999
|
+
exports$1.SlowBuffer = SlowBuffer;
|
|
7000
|
+
exports$1.INSPECT_MAX_BYTES = 50;
|
|
6979
7001
|
|
|
6980
7002
|
var K_MAX_LENGTH = 0x7fffffff;
|
|
6981
|
-
exports.kMaxLength = K_MAX_LENGTH;
|
|
7003
|
+
exports$1.kMaxLength = K_MAX_LENGTH;
|
|
6982
7004
|
|
|
6983
7005
|
/**
|
|
6984
7006
|
* If `Buffer.TYPED_ARRAY_SUPPORT`:
|
|
@@ -7575,7 +7597,7 @@ function requireBuffer () {
|
|
|
7575
7597
|
|
|
7576
7598
|
Buffer.prototype.inspect = function inspect () {
|
|
7577
7599
|
var str = '';
|
|
7578
|
-
var max = exports.INSPECT_MAX_BYTES;
|
|
7600
|
+
var max = exports$1.INSPECT_MAX_BYTES;
|
|
7579
7601
|
str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim();
|
|
7580
7602
|
if (this.length > max) str += ' ... ';
|
|
7581
7603
|
return '<Buffer ' + str + '>'
|
|
@@ -8788,7 +8810,7 @@ var hasRequiredFrames;
|
|
|
8788
8810
|
function requireFrames () {
|
|
8789
8811
|
if (hasRequiredFrames) return Frames;
|
|
8790
8812
|
hasRequiredFrames = 1;
|
|
8791
|
-
(function (exports) {
|
|
8813
|
+
(function (exports$1) {
|
|
8792
8814
|
/*
|
|
8793
8815
|
* Copyright 2021-2022 the original author or authors.
|
|
8794
8816
|
*
|
|
@@ -8804,8 +8826,8 @@ function requireFrames () {
|
|
|
8804
8826
|
* See the License for the specific language governing permissions and
|
|
8805
8827
|
* limitations under the License.
|
|
8806
8828
|
*/
|
|
8807
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8808
|
-
exports.Frame = exports.Lengths = exports.Flags = exports.FrameTypes = void 0;
|
|
8829
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
8830
|
+
exports$1.Frame = exports$1.Lengths = exports$1.Flags = exports$1.FrameTypes = void 0;
|
|
8809
8831
|
var FrameTypes;
|
|
8810
8832
|
(function (FrameTypes) {
|
|
8811
8833
|
FrameTypes[FrameTypes["RESERVED"] = 0] = "RESERVED";
|
|
@@ -8824,7 +8846,7 @@ function requireFrames () {
|
|
|
8824
8846
|
FrameTypes[FrameTypes["RESUME"] = 13] = "RESUME";
|
|
8825
8847
|
FrameTypes[FrameTypes["RESUME_OK"] = 14] = "RESUME_OK";
|
|
8826
8848
|
FrameTypes[FrameTypes["EXT"] = 63] = "EXT";
|
|
8827
|
-
})(FrameTypes = exports.FrameTypes || (exports.FrameTypes = {}));
|
|
8849
|
+
})(FrameTypes = exports$1.FrameTypes || (exports$1.FrameTypes = {}));
|
|
8828
8850
|
(function (Flags) {
|
|
8829
8851
|
Flags[Flags["NONE"] = 0] = "NONE";
|
|
8830
8852
|
Flags[Flags["COMPLETE"] = 64] = "COMPLETE";
|
|
@@ -8835,7 +8857,7 @@ function requireFrames () {
|
|
|
8835
8857
|
Flags[Flags["NEXT"] = 32] = "NEXT";
|
|
8836
8858
|
Flags[Flags["RESPOND"] = 128] = "RESPOND";
|
|
8837
8859
|
Flags[Flags["RESUME_ENABLE"] = 128] = "RESUME_ENABLE";
|
|
8838
|
-
})(exports.Flags || (exports.Flags = {}));
|
|
8860
|
+
})(exports$1.Flags || (exports$1.Flags = {}));
|
|
8839
8861
|
(function (Flags) {
|
|
8840
8862
|
function hasMetadata(flags) {
|
|
8841
8863
|
return (flags & Flags.METADATA) === Flags.METADATA;
|
|
@@ -8869,13 +8891,13 @@ function requireFrames () {
|
|
|
8869
8891
|
return (flags & Flags.RESUME_ENABLE) === Flags.RESUME_ENABLE;
|
|
8870
8892
|
}
|
|
8871
8893
|
Flags.hasResume = hasResume;
|
|
8872
|
-
})(exports.Flags || (exports.Flags = {}));
|
|
8894
|
+
})(exports$1.Flags || (exports$1.Flags = {}));
|
|
8873
8895
|
(function (Lengths) {
|
|
8874
8896
|
Lengths[Lengths["FRAME"] = 3] = "FRAME";
|
|
8875
8897
|
Lengths[Lengths["HEADER"] = 6] = "HEADER";
|
|
8876
8898
|
Lengths[Lengths["METADATA"] = 3] = "METADATA";
|
|
8877
8899
|
Lengths[Lengths["REQUEST"] = 3] = "REQUEST";
|
|
8878
|
-
})(exports.Lengths || (exports.Lengths = {}));
|
|
8900
|
+
})(exports$1.Lengths || (exports$1.Lengths = {}));
|
|
8879
8901
|
(function (Frame) {
|
|
8880
8902
|
function isConnection(frame) {
|
|
8881
8903
|
return frame.streamId === 0;
|
|
@@ -8886,7 +8908,7 @@ function requireFrames () {
|
|
|
8886
8908
|
frame.type <= FrameTypes.REQUEST_CHANNEL);
|
|
8887
8909
|
}
|
|
8888
8910
|
Frame.isRequest = isRequest;
|
|
8889
|
-
})(exports.Frame || (exports.Frame = {}));
|
|
8911
|
+
})(exports$1.Frame || (exports$1.Frame = {}));
|
|
8890
8912
|
|
|
8891
8913
|
} (Frames));
|
|
8892
8914
|
return Frames;
|
|
@@ -8897,7 +8919,7 @@ var hasRequiredCodecs;
|
|
|
8897
8919
|
function requireCodecs () {
|
|
8898
8920
|
if (hasRequiredCodecs) return Codecs;
|
|
8899
8921
|
hasRequiredCodecs = 1;
|
|
8900
|
-
(function (exports) {
|
|
8922
|
+
(function (exports$1) {
|
|
8901
8923
|
var __generator = (Codecs && Codecs.__generator) || function (thisArg, body) {
|
|
8902
8924
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
8903
8925
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
@@ -8925,22 +8947,22 @@ function requireCodecs () {
|
|
|
8925
8947
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
8926
8948
|
}
|
|
8927
8949
|
};
|
|
8928
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8929
|
-
exports.Deserializer = exports.sizeOfFrame = exports.serializeFrame = exports.deserializeFrame = exports.serializeFrameWithLength = exports.deserializeFrames = exports.deserializeFrameWithLength = exports.writeUInt64BE = exports.readUInt64BE = exports.writeUInt24BE = exports.readUInt24BE = exports.MAX_VERSION = exports.MAX_TTL = exports.MAX_STREAM_ID = exports.MAX_RESUME_LENGTH = exports.MAX_REQUEST_N = exports.MAX_REQUEST_COUNT = exports.MAX_MIME_LENGTH = exports.MAX_METADATA_LENGTH = exports.MAX_LIFETIME = exports.MAX_KEEPALIVE = exports.MAX_CODE = exports.FRAME_TYPE_OFFFSET = exports.FLAGS_MASK = void 0;
|
|
8950
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
8951
|
+
exports$1.Deserializer = exports$1.sizeOfFrame = exports$1.serializeFrame = exports$1.deserializeFrame = exports$1.serializeFrameWithLength = exports$1.deserializeFrames = exports$1.deserializeFrameWithLength = exports$1.writeUInt64BE = exports$1.readUInt64BE = exports$1.writeUInt24BE = exports$1.readUInt24BE = exports$1.MAX_VERSION = exports$1.MAX_TTL = exports$1.MAX_STREAM_ID = exports$1.MAX_RESUME_LENGTH = exports$1.MAX_REQUEST_N = exports$1.MAX_REQUEST_COUNT = exports$1.MAX_MIME_LENGTH = exports$1.MAX_METADATA_LENGTH = exports$1.MAX_LIFETIME = exports$1.MAX_KEEPALIVE = exports$1.MAX_CODE = exports$1.FRAME_TYPE_OFFFSET = exports$1.FLAGS_MASK = void 0;
|
|
8930
8952
|
var Frames_1 = requireFrames();
|
|
8931
|
-
exports.FLAGS_MASK = 0x3ff; // low 10 bits
|
|
8932
|
-
exports.FRAME_TYPE_OFFFSET = 10; // frame type is offset 10 bytes within the uint16 containing type + flags
|
|
8933
|
-
exports.MAX_CODE = 0x7fffffff; // uint31
|
|
8934
|
-
exports.MAX_KEEPALIVE = 0x7fffffff; // uint31
|
|
8935
|
-
exports.MAX_LIFETIME = 0x7fffffff; // uint31
|
|
8936
|
-
exports.MAX_METADATA_LENGTH = 0xffffff; // uint24
|
|
8937
|
-
exports.MAX_MIME_LENGTH = 0xff; // int8
|
|
8938
|
-
exports.MAX_REQUEST_COUNT = 0x7fffffff; // uint31
|
|
8939
|
-
exports.MAX_REQUEST_N = 0x7fffffff; // uint31
|
|
8940
|
-
exports.MAX_RESUME_LENGTH = 0xffff; // uint16
|
|
8941
|
-
exports.MAX_STREAM_ID = 0x7fffffff; // uint31
|
|
8942
|
-
exports.MAX_TTL = 0x7fffffff; // uint31
|
|
8943
|
-
exports.MAX_VERSION = 0xffff; // uint16
|
|
8953
|
+
exports$1.FLAGS_MASK = 0x3ff; // low 10 bits
|
|
8954
|
+
exports$1.FRAME_TYPE_OFFFSET = 10; // frame type is offset 10 bytes within the uint16 containing type + flags
|
|
8955
|
+
exports$1.MAX_CODE = 0x7fffffff; // uint31
|
|
8956
|
+
exports$1.MAX_KEEPALIVE = 0x7fffffff; // uint31
|
|
8957
|
+
exports$1.MAX_LIFETIME = 0x7fffffff; // uint31
|
|
8958
|
+
exports$1.MAX_METADATA_LENGTH = 0xffffff; // uint24
|
|
8959
|
+
exports$1.MAX_MIME_LENGTH = 0xff; // int8
|
|
8960
|
+
exports$1.MAX_REQUEST_COUNT = 0x7fffffff; // uint31
|
|
8961
|
+
exports$1.MAX_REQUEST_N = 0x7fffffff; // uint31
|
|
8962
|
+
exports$1.MAX_RESUME_LENGTH = 0xffff; // uint16
|
|
8963
|
+
exports$1.MAX_STREAM_ID = 0x7fffffff; // uint31
|
|
8964
|
+
exports$1.MAX_TTL = 0x7fffffff; // uint31
|
|
8965
|
+
exports$1.MAX_VERSION = 0xffff; // uint16
|
|
8944
8966
|
/**
|
|
8945
8967
|
* Mimimum value that would overflow bitwise operators (2^32).
|
|
8946
8968
|
*/
|
|
@@ -8954,7 +8976,7 @@ function requireCodecs () {
|
|
|
8954
8976
|
var val3 = buffer.readUInt8(offset + 2);
|
|
8955
8977
|
return val1 | val2 | val3;
|
|
8956
8978
|
}
|
|
8957
|
-
exports.readUInt24BE = readUInt24BE;
|
|
8979
|
+
exports$1.readUInt24BE = readUInt24BE;
|
|
8958
8980
|
/**
|
|
8959
8981
|
* Writes a uint24 to a buffer starting at the given offset, returning the
|
|
8960
8982
|
* offset of the next byte.
|
|
@@ -8964,7 +8986,7 @@ function requireCodecs () {
|
|
|
8964
8986
|
offset = buffer.writeUInt8((value >>> 8) & 0xff, offset); // 2nd byte
|
|
8965
8987
|
return buffer.writeUInt8(value & 0xff, offset); // 1st byte
|
|
8966
8988
|
}
|
|
8967
|
-
exports.writeUInt24BE = writeUInt24BE;
|
|
8989
|
+
exports$1.writeUInt24BE = writeUInt24BE;
|
|
8968
8990
|
/**
|
|
8969
8991
|
* Read a uint64 (technically supports up to 53 bits per JS number
|
|
8970
8992
|
* representation).
|
|
@@ -8974,7 +8996,7 @@ function requireCodecs () {
|
|
|
8974
8996
|
var low = buffer.readUInt32BE(offset + 4);
|
|
8975
8997
|
return high * BITWISE_OVERFLOW + low;
|
|
8976
8998
|
}
|
|
8977
|
-
exports.readUInt64BE = readUInt64BE;
|
|
8999
|
+
exports$1.readUInt64BE = readUInt64BE;
|
|
8978
9000
|
/**
|
|
8979
9001
|
* Write a uint64 (technically supports up to 53 bits per JS number
|
|
8980
9002
|
* representation).
|
|
@@ -8985,7 +9007,7 @@ function requireCodecs () {
|
|
|
8985
9007
|
offset = buffer.writeUInt32BE(high, offset); // first half of uint64
|
|
8986
9008
|
return buffer.writeUInt32BE(low, offset); // second half of uint64
|
|
8987
9009
|
}
|
|
8988
|
-
exports.writeUInt64BE = writeUInt64BE;
|
|
9010
|
+
exports$1.writeUInt64BE = writeUInt64BE;
|
|
8989
9011
|
/**
|
|
8990
9012
|
* Frame header is:
|
|
8991
9013
|
* - stream id (uint32 = 4)
|
|
@@ -9003,7 +9025,7 @@ function requireCodecs () {
|
|
|
9003
9025
|
var frameLength = readUInt24BE(buffer, 0);
|
|
9004
9026
|
return deserializeFrame(buffer.slice(UINT24_SIZE, UINT24_SIZE + frameLength));
|
|
9005
9027
|
}
|
|
9006
|
-
exports.deserializeFrameWithLength = deserializeFrameWithLength;
|
|
9028
|
+
exports$1.deserializeFrameWithLength = deserializeFrameWithLength;
|
|
9007
9029
|
/**
|
|
9008
9030
|
* Given a buffer that may contain zero or more length-prefixed frames followed
|
|
9009
9031
|
* by zero or more bytes of a (partial) subsequent frame, returns an array of
|
|
@@ -9036,7 +9058,7 @@ function requireCodecs () {
|
|
|
9036
9058
|
}
|
|
9037
9059
|
});
|
|
9038
9060
|
}
|
|
9039
|
-
exports.deserializeFrames = deserializeFrames;
|
|
9061
|
+
exports$1.deserializeFrames = deserializeFrames;
|
|
9040
9062
|
/**
|
|
9041
9063
|
* Writes a frame to a buffer with a length prefix.
|
|
9042
9064
|
*/
|
|
@@ -9047,7 +9069,7 @@ function requireCodecs () {
|
|
|
9047
9069
|
buffer.copy(lengthPrefixed, UINT24_SIZE);
|
|
9048
9070
|
return lengthPrefixed;
|
|
9049
9071
|
}
|
|
9050
|
-
exports.serializeFrameWithLength = serializeFrameWithLength;
|
|
9072
|
+
exports$1.serializeFrameWithLength = serializeFrameWithLength;
|
|
9051
9073
|
/**
|
|
9052
9074
|
* Read a frame from the buffer.
|
|
9053
9075
|
*/
|
|
@@ -9062,8 +9084,8 @@ function requireCodecs () {
|
|
|
9062
9084
|
// );
|
|
9063
9085
|
var typeAndFlags = buffer.readUInt16BE(offset);
|
|
9064
9086
|
offset += 2;
|
|
9065
|
-
var type = typeAndFlags >>> exports.FRAME_TYPE_OFFFSET; // keep highest 6 bits
|
|
9066
|
-
var flags = typeAndFlags & exports.FLAGS_MASK; // keep lowest 10 bits
|
|
9087
|
+
var type = typeAndFlags >>> exports$1.FRAME_TYPE_OFFFSET; // keep highest 6 bits
|
|
9088
|
+
var flags = typeAndFlags & exports$1.FLAGS_MASK; // keep lowest 10 bits
|
|
9067
9089
|
switch (type) {
|
|
9068
9090
|
case Frames_1.FrameTypes.SETUP:
|
|
9069
9091
|
return deserializeSetupFrame(buffer, streamId, flags);
|
|
@@ -9100,7 +9122,7 @@ function requireCodecs () {
|
|
|
9100
9122
|
// );
|
|
9101
9123
|
}
|
|
9102
9124
|
}
|
|
9103
|
-
exports.deserializeFrame = deserializeFrame;
|
|
9125
|
+
exports$1.deserializeFrame = deserializeFrame;
|
|
9104
9126
|
/**
|
|
9105
9127
|
* Convert the frame to a (binary) buffer.
|
|
9106
9128
|
*/
|
|
@@ -9139,7 +9161,7 @@ function requireCodecs () {
|
|
|
9139
9161
|
// );
|
|
9140
9162
|
}
|
|
9141
9163
|
}
|
|
9142
|
-
exports.serializeFrame = serializeFrame;
|
|
9164
|
+
exports$1.serializeFrame = serializeFrame;
|
|
9143
9165
|
/**
|
|
9144
9166
|
* Byte size of frame without size prefix
|
|
9145
9167
|
*/
|
|
@@ -9178,7 +9200,7 @@ function requireCodecs () {
|
|
|
9178
9200
|
// );
|
|
9179
9201
|
}
|
|
9180
9202
|
}
|
|
9181
|
-
exports.sizeOfFrame = sizeOfFrame;
|
|
9203
|
+
exports$1.sizeOfFrame = sizeOfFrame;
|
|
9182
9204
|
/**
|
|
9183
9205
|
* Writes a SETUP frame into a new buffer and returns it.
|
|
9184
9206
|
*
|
|
@@ -9813,7 +9835,7 @@ function requireCodecs () {
|
|
|
9813
9835
|
function writeHeader(frame, buffer) {
|
|
9814
9836
|
var offset = buffer.writeInt32BE(frame.streamId, 0);
|
|
9815
9837
|
// shift frame to high 6 bits, extract lowest 10 bits from flags
|
|
9816
|
-
return buffer.writeUInt16BE((frame.type << exports.FRAME_TYPE_OFFFSET) | (frame.flags & exports.FLAGS_MASK), offset);
|
|
9838
|
+
return buffer.writeUInt16BE((frame.type << exports$1.FRAME_TYPE_OFFFSET) | (frame.flags & exports$1.FLAGS_MASK), offset);
|
|
9817
9839
|
}
|
|
9818
9840
|
/**
|
|
9819
9841
|
* Determine the length of the payload section of a frame. Only applies to
|
|
@@ -9894,7 +9916,7 @@ function requireCodecs () {
|
|
|
9894
9916
|
};
|
|
9895
9917
|
return Deserializer;
|
|
9896
9918
|
}());
|
|
9897
|
-
exports.Deserializer = Deserializer;
|
|
9919
|
+
exports$1.Deserializer = Deserializer;
|
|
9898
9920
|
|
|
9899
9921
|
} (Codecs));
|
|
9900
9922
|
return Codecs;
|
|
@@ -10040,7 +10062,7 @@ var hasRequiredErrors;
|
|
|
10040
10062
|
function requireErrors () {
|
|
10041
10063
|
if (hasRequiredErrors) return Errors;
|
|
10042
10064
|
hasRequiredErrors = 1;
|
|
10043
|
-
(function (exports) {
|
|
10065
|
+
(function (exports$1) {
|
|
10044
10066
|
/*
|
|
10045
10067
|
* Copyright 2021-2022 the original author or authors.
|
|
10046
10068
|
*
|
|
@@ -10071,8 +10093,8 @@ function requireErrors () {
|
|
|
10071
10093
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
10072
10094
|
};
|
|
10073
10095
|
})();
|
|
10074
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10075
|
-
exports.ErrorCodes = exports.RSocketError = void 0;
|
|
10096
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
10097
|
+
exports$1.ErrorCodes = exports$1.RSocketError = void 0;
|
|
10076
10098
|
var RSocketError = /** @class */ (function (_super) {
|
|
10077
10099
|
__extends(RSocketError, _super);
|
|
10078
10100
|
function RSocketError(code, message) {
|
|
@@ -10082,7 +10104,7 @@ function requireErrors () {
|
|
|
10082
10104
|
}
|
|
10083
10105
|
return RSocketError;
|
|
10084
10106
|
}(Error));
|
|
10085
|
-
exports.RSocketError = RSocketError;
|
|
10107
|
+
exports$1.RSocketError = RSocketError;
|
|
10086
10108
|
(function (ErrorCodes) {
|
|
10087
10109
|
ErrorCodes[ErrorCodes["RESERVED"] = 0] = "RESERVED";
|
|
10088
10110
|
ErrorCodes[ErrorCodes["INVALID_SETUP"] = 1] = "INVALID_SETUP";
|
|
@@ -10096,7 +10118,7 @@ function requireErrors () {
|
|
|
10096
10118
|
ErrorCodes[ErrorCodes["CANCELED"] = 515] = "CANCELED";
|
|
10097
10119
|
ErrorCodes[ErrorCodes["INVALID"] = 516] = "INVALID";
|
|
10098
10120
|
ErrorCodes[ErrorCodes["RESERVED_EXTENSION"] = 4294967295] = "RESERVED_EXTENSION";
|
|
10099
|
-
})(exports.ErrorCodes || (exports.ErrorCodes = {}));
|
|
10121
|
+
})(exports$1.ErrorCodes || (exports$1.ErrorCodes = {}));
|
|
10100
10122
|
|
|
10101
10123
|
} (Errors));
|
|
10102
10124
|
return Errors;
|
|
@@ -10138,7 +10160,7 @@ var hasRequiredClientServerMultiplexerDemultiplexer;
|
|
|
10138
10160
|
function requireClientServerMultiplexerDemultiplexer () {
|
|
10139
10161
|
if (hasRequiredClientServerMultiplexerDemultiplexer) return ClientServerMultiplexerDemultiplexer;
|
|
10140
10162
|
hasRequiredClientServerMultiplexerDemultiplexer = 1;
|
|
10141
|
-
(function (exports) {
|
|
10163
|
+
(function (exports$1) {
|
|
10142
10164
|
/*
|
|
10143
10165
|
* Copyright 2021-2022 the original author or authors.
|
|
10144
10166
|
*
|
|
@@ -10205,8 +10227,8 @@ function requireClientServerMultiplexerDemultiplexer () {
|
|
|
10205
10227
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
10206
10228
|
}
|
|
10207
10229
|
};
|
|
10208
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10209
|
-
exports.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = exports.ResumableClientServerInputMultiplexerDemultiplexer = exports.ClientServerInputMultiplexerDemultiplexer = exports.StreamIdGenerator = void 0;
|
|
10230
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
10231
|
+
exports$1.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = exports$1.ResumableClientServerInputMultiplexerDemultiplexer = exports$1.ClientServerInputMultiplexerDemultiplexer = exports$1.StreamIdGenerator = void 0;
|
|
10210
10232
|
var _1 = requireDist();
|
|
10211
10233
|
var Deferred_1 = requireDeferred();
|
|
10212
10234
|
var Errors_1 = requireErrors();
|
|
@@ -10229,7 +10251,7 @@ function requireClientServerMultiplexerDemultiplexer () {
|
|
|
10229
10251
|
};
|
|
10230
10252
|
return StreamIdGeneratorImpl;
|
|
10231
10253
|
}());
|
|
10232
|
-
})(exports.StreamIdGenerator || (exports.StreamIdGenerator = {}));
|
|
10254
|
+
})(exports$1.StreamIdGenerator || (exports$1.StreamIdGenerator = {}));
|
|
10233
10255
|
var ClientServerInputMultiplexerDemultiplexer = /** @class */ (function (_super) {
|
|
10234
10256
|
__extends(ClientServerInputMultiplexerDemultiplexer, _super);
|
|
10235
10257
|
function ClientServerInputMultiplexerDemultiplexer(streamIdSupplier, outbound, closeable) {
|
|
@@ -10318,7 +10340,7 @@ function requireClientServerMultiplexerDemultiplexer () {
|
|
|
10318
10340
|
};
|
|
10319
10341
|
return ClientServerInputMultiplexerDemultiplexer;
|
|
10320
10342
|
}(Deferred_1.Deferred));
|
|
10321
|
-
exports.ClientServerInputMultiplexerDemultiplexer = ClientServerInputMultiplexerDemultiplexer;
|
|
10343
|
+
exports$1.ClientServerInputMultiplexerDemultiplexer = ClientServerInputMultiplexerDemultiplexer;
|
|
10322
10344
|
var ResumableClientServerInputMultiplexerDemultiplexer = /** @class */ (function (_super) {
|
|
10323
10345
|
__extends(ResumableClientServerInputMultiplexerDemultiplexer, _super);
|
|
10324
10346
|
function ResumableClientServerInputMultiplexerDemultiplexer(streamIdSupplier, outbound, closeable, frameStore, token, sessionStoreOrReconnector, sessionTimeout) {
|
|
@@ -10475,7 +10497,7 @@ function requireClientServerMultiplexerDemultiplexer () {
|
|
|
10475
10497
|
};
|
|
10476
10498
|
return ResumableClientServerInputMultiplexerDemultiplexer;
|
|
10477
10499
|
}(ClientServerInputMultiplexerDemultiplexer));
|
|
10478
|
-
exports.ResumableClientServerInputMultiplexerDemultiplexer = ResumableClientServerInputMultiplexerDemultiplexer;
|
|
10500
|
+
exports$1.ResumableClientServerInputMultiplexerDemultiplexer = ResumableClientServerInputMultiplexerDemultiplexer;
|
|
10479
10501
|
var ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = /** @class */ (function () {
|
|
10480
10502
|
function ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer(outbound, closeable, delegate) {
|
|
10481
10503
|
this.outbound = outbound;
|
|
@@ -10532,7 +10554,7 @@ function requireClientServerMultiplexerDemultiplexer () {
|
|
|
10532
10554
|
};
|
|
10533
10555
|
return ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer;
|
|
10534
10556
|
}());
|
|
10535
|
-
exports.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer;
|
|
10557
|
+
exports$1.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer;
|
|
10536
10558
|
|
|
10537
10559
|
} (ClientServerMultiplexerDemultiplexer));
|
|
10538
10560
|
return ClientServerMultiplexerDemultiplexer;
|
|
@@ -13518,7 +13540,7 @@ var hasRequiredDist;
|
|
|
13518
13540
|
function requireDist () {
|
|
13519
13541
|
if (hasRequiredDist) return dist;
|
|
13520
13542
|
hasRequiredDist = 1;
|
|
13521
|
-
(function (exports) {
|
|
13543
|
+
(function (exports$1) {
|
|
13522
13544
|
/*
|
|
13523
13545
|
* Copyright 2021-2022 the original author or authors.
|
|
13524
13546
|
*
|
|
@@ -13541,19 +13563,19 @@ function requireDist () {
|
|
|
13541
13563
|
if (k2 === undefined) k2 = k;
|
|
13542
13564
|
o[k2] = m[k];
|
|
13543
13565
|
}));
|
|
13544
|
-
var __exportStar = (dist && dist.__exportStar) || function(m, exports) {
|
|
13545
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
13566
|
+
var __exportStar = (dist && dist.__exportStar) || function(m, exports$1) {
|
|
13567
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
|
|
13546
13568
|
};
|
|
13547
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13548
|
-
__exportStar(requireCodecs(), exports);
|
|
13549
|
-
__exportStar(requireCommon(), exports);
|
|
13550
|
-
__exportStar(requireDeferred(), exports);
|
|
13551
|
-
__exportStar(requireErrors(), exports);
|
|
13552
|
-
__exportStar(requireFrames(), exports);
|
|
13553
|
-
__exportStar(requireRSocket(), exports);
|
|
13554
|
-
__exportStar(requireRSocketConnector(), exports);
|
|
13555
|
-
__exportStar(requireRSocketServer(), exports);
|
|
13556
|
-
__exportStar(requireTransport(), exports);
|
|
13569
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
13570
|
+
__exportStar(requireCodecs(), exports$1);
|
|
13571
|
+
__exportStar(requireCommon(), exports$1);
|
|
13572
|
+
__exportStar(requireDeferred(), exports$1);
|
|
13573
|
+
__exportStar(requireErrors(), exports$1);
|
|
13574
|
+
__exportStar(requireFrames(), exports$1);
|
|
13575
|
+
__exportStar(requireRSocket(), exports$1);
|
|
13576
|
+
__exportStar(requireRSocketConnector(), exports$1);
|
|
13577
|
+
__exportStar(requireRSocketServer(), exports$1);
|
|
13578
|
+
__exportStar(requireTransport(), exports$1);
|
|
13557
13579
|
|
|
13558
13580
|
} (dist));
|
|
13559
13581
|
return dist;
|
|
@@ -13561,7 +13583,7 @@ function requireDist () {
|
|
|
13561
13583
|
|
|
13562
13584
|
var distExports = requireDist();
|
|
13563
13585
|
|
|
13564
|
-
var version = "1.
|
|
13586
|
+
var version = "1.45.0";
|
|
13565
13587
|
var PACKAGE = {
|
|
13566
13588
|
version: version};
|
|
13567
13589
|
|
|
@@ -17050,6 +17072,27 @@ class SyncDataBatch {
|
|
|
17050
17072
|
}
|
|
17051
17073
|
}
|
|
17052
17074
|
|
|
17075
|
+
/**
|
|
17076
|
+
* Thrown when an underlying database connection is closed.
|
|
17077
|
+
* This is particularly relevant when worker connections are marked as closed while
|
|
17078
|
+
* operations are still in progress.
|
|
17079
|
+
*/
|
|
17080
|
+
class ConnectionClosedError extends Error {
|
|
17081
|
+
static NAME = 'ConnectionClosedError';
|
|
17082
|
+
static MATCHES(input) {
|
|
17083
|
+
/**
|
|
17084
|
+
* If there are weird package issues which cause multiple versions of classes to be present, the instanceof
|
|
17085
|
+
* check might fail. This also performs a failsafe check.
|
|
17086
|
+
* This might also happen if the Error is serialized and parsed over a bridging channel like a MessagePort.
|
|
17087
|
+
*/
|
|
17088
|
+
return (input instanceof ConnectionClosedError || (input instanceof Error && input.name == ConnectionClosedError.NAME));
|
|
17089
|
+
}
|
|
17090
|
+
constructor(message) {
|
|
17091
|
+
super(message);
|
|
17092
|
+
this.name = ConnectionClosedError.NAME;
|
|
17093
|
+
}
|
|
17094
|
+
}
|
|
17095
|
+
|
|
17053
17096
|
// https://www.sqlite.org/lang_expr.html#castexpr
|
|
17054
17097
|
var ColumnType;
|
|
17055
17098
|
(function (ColumnType) {
|
|
@@ -17608,13 +17651,13 @@ const parseQuery = (query, parameters) => {
|
|
|
17608
17651
|
//# sourceMappingURL=bundle.mjs.map
|
|
17609
17652
|
|
|
17610
17653
|
|
|
17611
|
-
/***/ }
|
|
17654
|
+
/***/ },
|
|
17612
17655
|
|
|
17613
|
-
/***/ "./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js"
|
|
17656
|
+
/***/ "./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js"
|
|
17614
17657
|
/*!*************************************************************!*\
|
|
17615
17658
|
!*** ./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js ***!
|
|
17616
17659
|
\*************************************************************/
|
|
17617
|
-
|
|
17660
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
17618
17661
|
|
|
17619
17662
|
__webpack_require__.r(__webpack_exports__);
|
|
17620
17663
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -17713,9 +17756,10 @@ const DEFAULT_MODULE_FACTORIES = {
|
|
|
17713
17756
|
}
|
|
17714
17757
|
// @ts-expect-error The types for this static method are missing upstream
|
|
17715
17758
|
const { OPFSCoopSyncVFS } = await __webpack_require__.e(/*! import() */ "node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js").then(__webpack_require__.bind(__webpack_require__, /*! @journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js */ "../../node_modules/@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js"));
|
|
17759
|
+
const vfs = await OPFSCoopSyncVFS.create(options.dbFileName, module);
|
|
17716
17760
|
return {
|
|
17717
17761
|
module,
|
|
17718
|
-
vfs
|
|
17762
|
+
vfs
|
|
17719
17763
|
};
|
|
17720
17764
|
}
|
|
17721
17765
|
};
|
|
@@ -17941,7 +17985,15 @@ class WASqliteConnection extends _powersync_common__WEBPACK_IMPORTED_MODULE_1__.
|
|
|
17941
17985
|
}
|
|
17942
17986
|
async close() {
|
|
17943
17987
|
this.broadcastChannel?.close();
|
|
17944
|
-
await this.
|
|
17988
|
+
await this.acquireExecuteLock(async () => {
|
|
17989
|
+
/**
|
|
17990
|
+
* Running the close operation inside the same execute mutex prevents errors like:
|
|
17991
|
+
* ```
|
|
17992
|
+
* unable to close due to unfinalized statements or unfinished backups
|
|
17993
|
+
* ```
|
|
17994
|
+
*/
|
|
17995
|
+
await this.sqliteAPI.close(this.dbP);
|
|
17996
|
+
});
|
|
17945
17997
|
}
|
|
17946
17998
|
async registerOnTableChange(callback) {
|
|
17947
17999
|
return this.registerListener({
|
|
@@ -18023,13 +18075,13 @@ class WASqliteConnection extends _powersync_common__WEBPACK_IMPORTED_MODULE_1__.
|
|
|
18023
18075
|
}
|
|
18024
18076
|
|
|
18025
18077
|
|
|
18026
|
-
/***/ }
|
|
18078
|
+
/***/ },
|
|
18027
18079
|
|
|
18028
|
-
/***/ "./lib/src/shared/navigator.js"
|
|
18080
|
+
/***/ "./lib/src/shared/navigator.js"
|
|
18029
18081
|
/*!*************************************!*\
|
|
18030
18082
|
!*** ./lib/src/shared/navigator.js ***!
|
|
18031
18083
|
\*************************************/
|
|
18032
|
-
|
|
18084
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
18033
18085
|
|
|
18034
18086
|
__webpack_require__.r(__webpack_exports__);
|
|
18035
18087
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -18043,13 +18095,13 @@ const getNavigatorLocks = () => {
|
|
|
18043
18095
|
};
|
|
18044
18096
|
|
|
18045
18097
|
|
|
18046
|
-
/***/ }
|
|
18098
|
+
/***/ },
|
|
18047
18099
|
|
|
18048
|
-
/***/ "./lib/src/worker/db/SharedWASQLiteConnection.js"
|
|
18100
|
+
/***/ "./lib/src/worker/db/SharedWASQLiteConnection.js"
|
|
18049
18101
|
/*!*******************************************************!*\
|
|
18050
18102
|
!*** ./lib/src/worker/db/SharedWASQLiteConnection.js ***!
|
|
18051
18103
|
\*******************************************************/
|
|
18052
|
-
|
|
18104
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
18053
18105
|
|
|
18054
18106
|
__webpack_require__.r(__webpack_exports__);
|
|
18055
18107
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -18147,35 +18199,35 @@ class SharedWASQLiteConnection {
|
|
|
18147
18199
|
}
|
|
18148
18200
|
|
|
18149
18201
|
|
|
18150
|
-
/***/ }
|
|
18202
|
+
/***/ },
|
|
18151
18203
|
|
|
18152
|
-
/***/ "./lib/src/worker/db/WorkerWASQLiteConnection.js"
|
|
18204
|
+
/***/ "./lib/src/worker/db/WorkerWASQLiteConnection.js"
|
|
18153
18205
|
/*!*******************************************************!*\
|
|
18154
18206
|
!*** ./lib/src/worker/db/WorkerWASQLiteConnection.js ***!
|
|
18155
18207
|
\*******************************************************/
|
|
18156
|
-
|
|
18208
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
18157
18209
|
|
|
18158
18210
|
__webpack_require__.r(__webpack_exports__);
|
|
18159
18211
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
18160
18212
|
/* harmony export */ WorkerWASQLiteConnection: () => (/* binding */ WorkerWASQLiteConnection)
|
|
18161
18213
|
/* harmony export */ });
|
|
18162
|
-
/* harmony import */ var
|
|
18163
|
-
/* harmony import */ var
|
|
18214
|
+
/* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! comlink */ "../../node_modules/comlink/dist/esm/comlink.mjs");
|
|
18215
|
+
/* harmony import */ var _db_adapters_wa_sqlite_WASQLiteConnection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../db/adapters/wa-sqlite/WASQLiteConnection */ "./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js");
|
|
18164
18216
|
|
|
18165
18217
|
|
|
18166
18218
|
/**
|
|
18167
18219
|
* A Small proxy wrapper around the WASqliteConnection.
|
|
18168
18220
|
* This ensures that certain return types are properly proxied.
|
|
18169
18221
|
*/
|
|
18170
|
-
class WorkerWASQLiteConnection extends
|
|
18222
|
+
class WorkerWASQLiteConnection extends _db_adapters_wa_sqlite_WASQLiteConnection__WEBPACK_IMPORTED_MODULE_1__.WASqliteConnection {
|
|
18171
18223
|
async registerOnTableChange(callback) {
|
|
18172
18224
|
// Proxy the callback remove function
|
|
18173
|
-
return
|
|
18225
|
+
return comlink__WEBPACK_IMPORTED_MODULE_0__.proxy(await super.registerOnTableChange(callback));
|
|
18174
18226
|
}
|
|
18175
18227
|
}
|
|
18176
18228
|
|
|
18177
18229
|
|
|
18178
|
-
/***/ }
|
|
18230
|
+
/***/ }
|
|
18179
18231
|
|
|
18180
18232
|
/******/ });
|
|
18181
18233
|
/************************************************************************/
|
|
@@ -18189,6 +18241,12 @@ class WorkerWASQLiteConnection extends _db_adapters_wa_sqlite_WASQLiteConnection
|
|
|
18189
18241
|
/******/ if (cachedModule !== undefined) {
|
|
18190
18242
|
/******/ return cachedModule.exports;
|
|
18191
18243
|
/******/ }
|
|
18244
|
+
/******/ // Check if module exists (development only)
|
|
18245
|
+
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
18246
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
18247
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
18248
|
+
/******/ throw e;
|
|
18249
|
+
/******/ }
|
|
18192
18250
|
/******/ // Create a new module (and put it into the cache)
|
|
18193
18251
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
18194
18252
|
/******/ // no module.id needed
|
|
@@ -18343,10 +18401,10 @@ var __webpack_exports__ = {};
|
|
|
18343
18401
|
__webpack_require__.r(__webpack_exports__);
|
|
18344
18402
|
/* harmony import */ var _journeyapps_wa_sqlite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @journeyapps/wa-sqlite */ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js");
|
|
18345
18403
|
/* harmony import */ var _powersync_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @powersync/common */ "../common/dist/bundle.mjs");
|
|
18346
|
-
/* harmony import */ var
|
|
18347
|
-
/* harmony import */ var
|
|
18348
|
-
/* harmony import */ var
|
|
18349
|
-
/* harmony import */ var
|
|
18404
|
+
/* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! comlink */ "../../node_modules/comlink/dist/esm/comlink.mjs");
|
|
18405
|
+
/* harmony import */ var _shared_navigator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/navigator */ "./lib/src/shared/navigator.js");
|
|
18406
|
+
/* harmony import */ var _SharedWASQLiteConnection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SharedWASQLiteConnection */ "./lib/src/worker/db/SharedWASQLiteConnection.js");
|
|
18407
|
+
/* harmony import */ var _WorkerWASQLiteConnection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./WorkerWASQLiteConnection */ "./lib/src/worker/db/WorkerWASQLiteConnection.js");
|
|
18350
18408
|
/**
|
|
18351
18409
|
* Supports both shared and dedicated workers, based on how the worker is constructed (new SharedWorker vs new Worker()).
|
|
18352
18410
|
*/
|
|
@@ -18364,14 +18422,14 @@ const OPEN_DB_LOCK = 'open-wasqlite-db';
|
|
|
18364
18422
|
let nextClientId = 1;
|
|
18365
18423
|
const openDBShared = async (options) => {
|
|
18366
18424
|
// Prevent multiple simultaneous opens from causing race conditions
|
|
18367
|
-
return (0,
|
|
18425
|
+
return (0,_shared_navigator__WEBPACK_IMPORTED_MODULE_3__.getNavigatorLocks)().request(OPEN_DB_LOCK, async () => {
|
|
18368
18426
|
const clientId = nextClientId++;
|
|
18369
18427
|
const { dbFilename, logLevel } = options;
|
|
18370
18428
|
logger.setLevel(logLevel);
|
|
18371
18429
|
if (!DBMap.has(dbFilename)) {
|
|
18372
18430
|
const clientIds = new Set();
|
|
18373
18431
|
// This format returns proxy objects for function callbacks
|
|
18374
|
-
const connection = new
|
|
18432
|
+
const connection = new _WorkerWASQLiteConnection__WEBPACK_IMPORTED_MODULE_5__.WorkerWASQLiteConnection(options);
|
|
18375
18433
|
await connection.init();
|
|
18376
18434
|
connection.registerListener({
|
|
18377
18435
|
holdOverwritten: async () => {
|
|
@@ -18389,13 +18447,13 @@ const openDBShared = async (options) => {
|
|
|
18389
18447
|
});
|
|
18390
18448
|
}
|
|
18391
18449
|
// Associates this clientId with the shared connection entry
|
|
18392
|
-
const sharedConnection = new
|
|
18450
|
+
const sharedConnection = new _SharedWASQLiteConnection__WEBPACK_IMPORTED_MODULE_4__.SharedWASQLiteConnection({
|
|
18393
18451
|
dbMap: DBMap,
|
|
18394
18452
|
dbFilename,
|
|
18395
18453
|
clientId,
|
|
18396
18454
|
logger
|
|
18397
18455
|
});
|
|
18398
|
-
return
|
|
18456
|
+
return comlink__WEBPACK_IMPORTED_MODULE_2__.proxy(sharedConnection);
|
|
18399
18457
|
});
|
|
18400
18458
|
};
|
|
18401
18459
|
// Check if we're in a SharedWorker context
|
|
@@ -18403,12 +18461,12 @@ if (typeof SharedWorkerGlobalScope !== 'undefined') {
|
|
|
18403
18461
|
const _self = self;
|
|
18404
18462
|
_self.onconnect = function (event) {
|
|
18405
18463
|
const port = event.ports[0];
|
|
18406
|
-
|
|
18464
|
+
comlink__WEBPACK_IMPORTED_MODULE_2__.expose(openDBShared, port);
|
|
18407
18465
|
};
|
|
18408
18466
|
}
|
|
18409
18467
|
else {
|
|
18410
18468
|
// A dedicated worker can be shared externally
|
|
18411
|
-
|
|
18469
|
+
comlink__WEBPACK_IMPORTED_MODULE_2__.expose(openDBShared);
|
|
18412
18470
|
}
|
|
18413
18471
|
addEventListener('unload', () => {
|
|
18414
18472
|
Array.from(DBMap.values()).forEach(async (dbConnection) => {
|