@powersync/web 0.0.0-dev-20251209082930 → 0.0.0-dev-20260112083235
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/README.md +1 -1
- package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-89f0ba.index.umd.js +1875 -0
- package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-89f0ba.index.umd.js.map +1 -0
- package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-685f6c0.index.umd.js +567 -0
- package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-685f6c0.index.umd.js.map +1 -0
- package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-685f6c1.index.umd.js +567 -0
- package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-685f6c1.index.umd.js.map +1 -0
- package/dist/index.umd.js +6938 -1827
- package/dist/index.umd.js.map +1 -1
- package/dist/worker/SharedSyncImplementation.umd.js +222 -196
- package/dist/worker/SharedSyncImplementation.umd.js.map +1 -1
- package/dist/worker/WASQLiteDB.umd.js +159 -119
- 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 +18 -13
- package/lib/src/db/PowerSyncDatabase.d.ts +3 -1
- package/lib/src/db/PowerSyncDatabase.js +19 -7
- package/lib/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.d.ts +1 -1
- package/lib/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.js +1 -1
- package/lib/src/db/adapters/AbstractWebSQLOpenFactory.d.ts +2 -2
- package/lib/src/db/adapters/AbstractWebSQLOpenFactory.js +2 -2
- package/lib/src/db/adapters/AsyncDatabaseConnection.d.ts +1 -9
- package/lib/src/db/adapters/AsyncDatabaseConnection.js +1 -11
- package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.d.ts +3 -3
- package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.js +13 -7
- package/lib/src/db/adapters/WebDBAdapter.d.ts +1 -1
- package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.d.ts +2 -2
- package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js +1 -2
- package/lib/src/db/adapters/wa-sqlite/WASQLiteConnection.d.ts +2 -2
- package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.d.ts +3 -3
- package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.js +5 -5
- package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.d.ts +4 -4
- package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.js +6 -6
- package/lib/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.d.ts +1 -1
- package/lib/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.js +3 -3
- package/lib/src/db/sync/SharedWebStreamingSyncImplementation.d.ts +4 -4
- package/lib/src/db/sync/SharedWebStreamingSyncImplementation.js +5 -5
- package/lib/src/db/sync/WebRemote.js +1 -1
- package/lib/src/db/sync/WebStreamingSyncImplementation.d.ts +1 -1
- package/lib/src/db/sync/WebStreamingSyncImplementation.js +1 -1
- package/lib/src/index.d.ts +12 -12
- package/lib/src/index.js +12 -12
- package/lib/src/worker/db/SharedWASQLiteConnection.d.ts +2 -2
- package/lib/src/worker/db/WASQLiteDB.worker.js +3 -3
- package/lib/src/worker/db/WorkerWASQLiteConnection.d.ts +2 -2
- package/lib/src/worker/db/WorkerWASQLiteConnection.js +1 -1
- package/lib/src/worker/db/open-worker-database.d.ts +2 -2
- package/lib/src/worker/db/open-worker-database.js +1 -1
- package/lib/src/worker/sync/BroadcastLogger.d.ts +1 -1
- package/lib/src/worker/sync/SharedSyncImplementation.d.ts +4 -4
- package/lib/src/worker/sync/SharedSyncImplementation.js +13 -5
- package/lib/src/worker/sync/SharedSyncImplementation.worker.js +2 -2
- package/lib/src/worker/sync/WorkerClient.d.ts +1 -1
- package/lib/src/worker/sync/WorkerClient.js +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -14
- package/src/db/PowerSyncDatabase.ts +23 -8
- package/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.ts +1 -1
- package/src/db/adapters/AbstractWebSQLOpenFactory.ts +3 -3
- package/src/db/adapters/AsyncDatabaseConnection.ts +1 -13
- package/src/db/adapters/LockedAsyncDatabaseAdapter.ts +17 -9
- package/src/db/adapters/WebDBAdapter.ts +1 -1
- package/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.ts +3 -4
- package/src/db/adapters/wa-sqlite/WASQLiteConnection.ts +2 -2
- package/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.ts +7 -7
- package/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.ts +7 -7
- package/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.ts +3 -3
- package/src/db/sync/SharedWebStreamingSyncImplementation.ts +7 -7
- package/src/db/sync/WebRemote.ts +1 -1
- package/src/db/sync/WebStreamingSyncImplementation.ts +2 -2
- package/src/index.ts +12 -12
- package/src/worker/db/SharedWASQLiteConnection.ts +2 -2
- package/src/worker/db/WASQLiteDB.worker.ts +5 -5
- package/src/worker/db/WorkerWASQLiteConnection.ts +2 -2
- package/src/worker/db/open-worker-database.ts +2 -2
- package/src/worker/sync/BroadcastLogger.ts +1 -1
- package/src/worker/sync/SharedSyncImplementation.ts +17 -8
- package/src/worker/sync/SharedSyncImplementation.worker.ts +2 -2
- package/src/worker/sync/WorkerClient.ts +2 -2
- /package/bin/{powersync.js → powersync.cjs} +0 -0
|
@@ -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__, {
|
|
@@ -1196,13 +1196,13 @@ function decl(s) {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
|
|
1198
1198
|
|
|
1199
|
-
/***/ }
|
|
1199
|
+
/***/ },
|
|
1200
1200
|
|
|
1201
|
-
/***/ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js"
|
|
1201
|
+
/***/ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js"
|
|
1202
1202
|
/*!*************************************************************************!*\
|
|
1203
1203
|
!*** ../../node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js ***!
|
|
1204
1204
|
\*************************************************************************/
|
|
1205
|
-
|
|
1205
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1206
1206
|
|
|
1207
1207
|
__webpack_require__.r(__webpack_exports__);
|
|
1208
1208
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -1715,13 +1715,13 @@ const SQLITE_PREPARE_PERSISTENT = 0x01;
|
|
|
1715
1715
|
const SQLITE_PREPARE_NORMALIZED = 0x02;
|
|
1716
1716
|
const SQLITE_PREPARE_NO_VTAB = 0x04;
|
|
1717
1717
|
|
|
1718
|
-
/***/ }
|
|
1718
|
+
/***/ },
|
|
1719
1719
|
|
|
1720
|
-
/***/ "../../node_modules/async-mutex/index.mjs"
|
|
1720
|
+
/***/ "../../node_modules/async-mutex/index.mjs"
|
|
1721
1721
|
/*!************************************************!*\
|
|
1722
1722
|
!*** ../../node_modules/async-mutex/index.mjs ***!
|
|
1723
1723
|
\************************************************/
|
|
1724
|
-
|
|
1724
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1725
1725
|
|
|
1726
1726
|
__webpack_require__.r(__webpack_exports__);
|
|
1727
1727
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -2026,13 +2026,13 @@ function tryAcquire(sync, alreadyAcquiredError = E_ALREADY_LOCKED) {
|
|
|
2026
2026
|
|
|
2027
2027
|
|
|
2028
2028
|
|
|
2029
|
-
/***/ }
|
|
2029
|
+
/***/ },
|
|
2030
2030
|
|
|
2031
|
-
/***/ "../../node_modules/comlink/dist/esm/comlink.mjs"
|
|
2031
|
+
/***/ "../../node_modules/comlink/dist/esm/comlink.mjs"
|
|
2032
2032
|
/*!*******************************************************!*\
|
|
2033
2033
|
!*** ../../node_modules/comlink/dist/esm/comlink.mjs ***!
|
|
2034
2034
|
\*******************************************************/
|
|
2035
|
-
|
|
2035
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
2036
2036
|
|
|
2037
2037
|
__webpack_require__.r(__webpack_exports__);
|
|
2038
2038
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -2407,13 +2407,13 @@ function generateUUID() {
|
|
|
2407
2407
|
//# sourceMappingURL=comlink.mjs.map
|
|
2408
2408
|
|
|
2409
2409
|
|
|
2410
|
-
/***/ }
|
|
2410
|
+
/***/ },
|
|
2411
2411
|
|
|
2412
|
-
/***/ "../common/dist/bundle.mjs"
|
|
2412
|
+
/***/ "../common/dist/bundle.mjs"
|
|
2413
2413
|
/*!*********************************!*\
|
|
2414
2414
|
!*** ../common/dist/bundle.mjs ***!
|
|
2415
2415
|
\*********************************/
|
|
2416
|
-
|
|
2416
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
2417
2417
|
|
|
2418
2418
|
__webpack_require__.r(__webpack_exports__);
|
|
2419
2419
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -2427,6 +2427,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2427
2427
|
/* harmony export */ BaseObserver: () => (/* binding */ BaseObserver),
|
|
2428
2428
|
/* harmony export */ Column: () => (/* binding */ Column),
|
|
2429
2429
|
/* harmony export */ ColumnType: () => (/* binding */ ColumnType),
|
|
2430
|
+
/* harmony export */ ConnectionClosedError: () => (/* binding */ ConnectionClosedError),
|
|
2430
2431
|
/* harmony export */ ConnectionManager: () => (/* binding */ ConnectionManager),
|
|
2431
2432
|
/* harmony export */ ControlledExecutor: () => (/* binding */ ControlledExecutor),
|
|
2432
2433
|
/* harmony export */ CrudBatch: () => (/* binding */ CrudBatch),
|
|
@@ -3241,6 +3242,10 @@ class SyncStatus {
|
|
|
3241
3242
|
priorityStatusEntries: this.priorityStatusEntries
|
|
3242
3243
|
};
|
|
3243
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
|
+
*/
|
|
3244
3249
|
serializeError(error) {
|
|
3245
3250
|
if (typeof error == 'undefined') {
|
|
3246
3251
|
return undefined;
|
|
@@ -4863,7 +4868,7 @@ var hasRequiredBuffer$1;
|
|
|
4863
4868
|
function requireBuffer$1 () {
|
|
4864
4869
|
if (hasRequiredBuffer$1) return buffer$1;
|
|
4865
4870
|
hasRequiredBuffer$1 = 1;
|
|
4866
|
-
(function (exports) {
|
|
4871
|
+
(function (exports$1) {
|
|
4867
4872
|
|
|
4868
4873
|
const base64 = requireBase64Js();
|
|
4869
4874
|
const ieee754 = requireIeee754();
|
|
@@ -4872,12 +4877,12 @@ function requireBuffer$1 () {
|
|
|
4872
4877
|
? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
|
|
4873
4878
|
: null;
|
|
4874
4879
|
|
|
4875
|
-
exports.Buffer = Buffer;
|
|
4876
|
-
exports.SlowBuffer = SlowBuffer;
|
|
4877
|
-
exports.INSPECT_MAX_BYTES = 50;
|
|
4880
|
+
exports$1.Buffer = Buffer;
|
|
4881
|
+
exports$1.SlowBuffer = SlowBuffer;
|
|
4882
|
+
exports$1.INSPECT_MAX_BYTES = 50;
|
|
4878
4883
|
|
|
4879
4884
|
const K_MAX_LENGTH = 0x7fffffff;
|
|
4880
|
-
exports.kMaxLength = K_MAX_LENGTH;
|
|
4885
|
+
exports$1.kMaxLength = K_MAX_LENGTH;
|
|
4881
4886
|
|
|
4882
4887
|
/**
|
|
4883
4888
|
* If `Buffer.TYPED_ARRAY_SUPPORT`:
|
|
@@ -5473,7 +5478,7 @@ function requireBuffer$1 () {
|
|
|
5473
5478
|
|
|
5474
5479
|
Buffer.prototype.inspect = function inspect () {
|
|
5475
5480
|
let str = '';
|
|
5476
|
-
const max = exports.INSPECT_MAX_BYTES;
|
|
5481
|
+
const max = exports$1.INSPECT_MAX_BYTES;
|
|
5477
5482
|
str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim();
|
|
5478
5483
|
if (this.length > max) str += ' ... ';
|
|
5479
5484
|
return '<Buffer ' + str + '>'
|
|
@@ -6981,7 +6986,7 @@ var hasRequiredBuffer;
|
|
|
6981
6986
|
function requireBuffer () {
|
|
6982
6987
|
if (hasRequiredBuffer) return buffer;
|
|
6983
6988
|
hasRequiredBuffer = 1;
|
|
6984
|
-
(function (exports) {
|
|
6989
|
+
(function (exports$1) {
|
|
6985
6990
|
|
|
6986
6991
|
var base64 = requireBase64Js();
|
|
6987
6992
|
var ieee754 = requireIeee754();
|
|
@@ -6990,12 +6995,12 @@ function requireBuffer () {
|
|
|
6990
6995
|
? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
|
|
6991
6996
|
: null;
|
|
6992
6997
|
|
|
6993
|
-
exports.Buffer = Buffer;
|
|
6994
|
-
exports.SlowBuffer = SlowBuffer;
|
|
6995
|
-
exports.INSPECT_MAX_BYTES = 50;
|
|
6998
|
+
exports$1.Buffer = Buffer;
|
|
6999
|
+
exports$1.SlowBuffer = SlowBuffer;
|
|
7000
|
+
exports$1.INSPECT_MAX_BYTES = 50;
|
|
6996
7001
|
|
|
6997
7002
|
var K_MAX_LENGTH = 0x7fffffff;
|
|
6998
|
-
exports.kMaxLength = K_MAX_LENGTH;
|
|
7003
|
+
exports$1.kMaxLength = K_MAX_LENGTH;
|
|
6999
7004
|
|
|
7000
7005
|
/**
|
|
7001
7006
|
* If `Buffer.TYPED_ARRAY_SUPPORT`:
|
|
@@ -7592,7 +7597,7 @@ function requireBuffer () {
|
|
|
7592
7597
|
|
|
7593
7598
|
Buffer.prototype.inspect = function inspect () {
|
|
7594
7599
|
var str = '';
|
|
7595
|
-
var max = exports.INSPECT_MAX_BYTES;
|
|
7600
|
+
var max = exports$1.INSPECT_MAX_BYTES;
|
|
7596
7601
|
str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim();
|
|
7597
7602
|
if (this.length > max) str += ' ... ';
|
|
7598
7603
|
return '<Buffer ' + str + '>'
|
|
@@ -8805,7 +8810,7 @@ var hasRequiredFrames;
|
|
|
8805
8810
|
function requireFrames () {
|
|
8806
8811
|
if (hasRequiredFrames) return Frames;
|
|
8807
8812
|
hasRequiredFrames = 1;
|
|
8808
|
-
(function (exports) {
|
|
8813
|
+
(function (exports$1) {
|
|
8809
8814
|
/*
|
|
8810
8815
|
* Copyright 2021-2022 the original author or authors.
|
|
8811
8816
|
*
|
|
@@ -8821,8 +8826,8 @@ function requireFrames () {
|
|
|
8821
8826
|
* See the License for the specific language governing permissions and
|
|
8822
8827
|
* limitations under the License.
|
|
8823
8828
|
*/
|
|
8824
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8825
|
-
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;
|
|
8826
8831
|
var FrameTypes;
|
|
8827
8832
|
(function (FrameTypes) {
|
|
8828
8833
|
FrameTypes[FrameTypes["RESERVED"] = 0] = "RESERVED";
|
|
@@ -8841,7 +8846,7 @@ function requireFrames () {
|
|
|
8841
8846
|
FrameTypes[FrameTypes["RESUME"] = 13] = "RESUME";
|
|
8842
8847
|
FrameTypes[FrameTypes["RESUME_OK"] = 14] = "RESUME_OK";
|
|
8843
8848
|
FrameTypes[FrameTypes["EXT"] = 63] = "EXT";
|
|
8844
|
-
})(FrameTypes = exports.FrameTypes || (exports.FrameTypes = {}));
|
|
8849
|
+
})(FrameTypes = exports$1.FrameTypes || (exports$1.FrameTypes = {}));
|
|
8845
8850
|
(function (Flags) {
|
|
8846
8851
|
Flags[Flags["NONE"] = 0] = "NONE";
|
|
8847
8852
|
Flags[Flags["COMPLETE"] = 64] = "COMPLETE";
|
|
@@ -8852,7 +8857,7 @@ function requireFrames () {
|
|
|
8852
8857
|
Flags[Flags["NEXT"] = 32] = "NEXT";
|
|
8853
8858
|
Flags[Flags["RESPOND"] = 128] = "RESPOND";
|
|
8854
8859
|
Flags[Flags["RESUME_ENABLE"] = 128] = "RESUME_ENABLE";
|
|
8855
|
-
})(exports.Flags || (exports.Flags = {}));
|
|
8860
|
+
})(exports$1.Flags || (exports$1.Flags = {}));
|
|
8856
8861
|
(function (Flags) {
|
|
8857
8862
|
function hasMetadata(flags) {
|
|
8858
8863
|
return (flags & Flags.METADATA) === Flags.METADATA;
|
|
@@ -8886,13 +8891,13 @@ function requireFrames () {
|
|
|
8886
8891
|
return (flags & Flags.RESUME_ENABLE) === Flags.RESUME_ENABLE;
|
|
8887
8892
|
}
|
|
8888
8893
|
Flags.hasResume = hasResume;
|
|
8889
|
-
})(exports.Flags || (exports.Flags = {}));
|
|
8894
|
+
})(exports$1.Flags || (exports$1.Flags = {}));
|
|
8890
8895
|
(function (Lengths) {
|
|
8891
8896
|
Lengths[Lengths["FRAME"] = 3] = "FRAME";
|
|
8892
8897
|
Lengths[Lengths["HEADER"] = 6] = "HEADER";
|
|
8893
8898
|
Lengths[Lengths["METADATA"] = 3] = "METADATA";
|
|
8894
8899
|
Lengths[Lengths["REQUEST"] = 3] = "REQUEST";
|
|
8895
|
-
})(exports.Lengths || (exports.Lengths = {}));
|
|
8900
|
+
})(exports$1.Lengths || (exports$1.Lengths = {}));
|
|
8896
8901
|
(function (Frame) {
|
|
8897
8902
|
function isConnection(frame) {
|
|
8898
8903
|
return frame.streamId === 0;
|
|
@@ -8903,7 +8908,7 @@ function requireFrames () {
|
|
|
8903
8908
|
frame.type <= FrameTypes.REQUEST_CHANNEL);
|
|
8904
8909
|
}
|
|
8905
8910
|
Frame.isRequest = isRequest;
|
|
8906
|
-
})(exports.Frame || (exports.Frame = {}));
|
|
8911
|
+
})(exports$1.Frame || (exports$1.Frame = {}));
|
|
8907
8912
|
|
|
8908
8913
|
} (Frames));
|
|
8909
8914
|
return Frames;
|
|
@@ -8914,7 +8919,7 @@ var hasRequiredCodecs;
|
|
|
8914
8919
|
function requireCodecs () {
|
|
8915
8920
|
if (hasRequiredCodecs) return Codecs;
|
|
8916
8921
|
hasRequiredCodecs = 1;
|
|
8917
|
-
(function (exports) {
|
|
8922
|
+
(function (exports$1) {
|
|
8918
8923
|
var __generator = (Codecs && Codecs.__generator) || function (thisArg, body) {
|
|
8919
8924
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
8920
8925
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
@@ -8942,22 +8947,22 @@ function requireCodecs () {
|
|
|
8942
8947
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
8943
8948
|
}
|
|
8944
8949
|
};
|
|
8945
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8946
|
-
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;
|
|
8947
8952
|
var Frames_1 = requireFrames();
|
|
8948
|
-
exports.FLAGS_MASK = 0x3ff; // low 10 bits
|
|
8949
|
-
exports.FRAME_TYPE_OFFFSET = 10; // frame type is offset 10 bytes within the uint16 containing type + flags
|
|
8950
|
-
exports.MAX_CODE = 0x7fffffff; // uint31
|
|
8951
|
-
exports.MAX_KEEPALIVE = 0x7fffffff; // uint31
|
|
8952
|
-
exports.MAX_LIFETIME = 0x7fffffff; // uint31
|
|
8953
|
-
exports.MAX_METADATA_LENGTH = 0xffffff; // uint24
|
|
8954
|
-
exports.MAX_MIME_LENGTH = 0xff; // int8
|
|
8955
|
-
exports.MAX_REQUEST_COUNT = 0x7fffffff; // uint31
|
|
8956
|
-
exports.MAX_REQUEST_N = 0x7fffffff; // uint31
|
|
8957
|
-
exports.MAX_RESUME_LENGTH = 0xffff; // uint16
|
|
8958
|
-
exports.MAX_STREAM_ID = 0x7fffffff; // uint31
|
|
8959
|
-
exports.MAX_TTL = 0x7fffffff; // uint31
|
|
8960
|
-
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
|
|
8961
8966
|
/**
|
|
8962
8967
|
* Mimimum value that would overflow bitwise operators (2^32).
|
|
8963
8968
|
*/
|
|
@@ -8971,7 +8976,7 @@ function requireCodecs () {
|
|
|
8971
8976
|
var val3 = buffer.readUInt8(offset + 2);
|
|
8972
8977
|
return val1 | val2 | val3;
|
|
8973
8978
|
}
|
|
8974
|
-
exports.readUInt24BE = readUInt24BE;
|
|
8979
|
+
exports$1.readUInt24BE = readUInt24BE;
|
|
8975
8980
|
/**
|
|
8976
8981
|
* Writes a uint24 to a buffer starting at the given offset, returning the
|
|
8977
8982
|
* offset of the next byte.
|
|
@@ -8981,7 +8986,7 @@ function requireCodecs () {
|
|
|
8981
8986
|
offset = buffer.writeUInt8((value >>> 8) & 0xff, offset); // 2nd byte
|
|
8982
8987
|
return buffer.writeUInt8(value & 0xff, offset); // 1st byte
|
|
8983
8988
|
}
|
|
8984
|
-
exports.writeUInt24BE = writeUInt24BE;
|
|
8989
|
+
exports$1.writeUInt24BE = writeUInt24BE;
|
|
8985
8990
|
/**
|
|
8986
8991
|
* Read a uint64 (technically supports up to 53 bits per JS number
|
|
8987
8992
|
* representation).
|
|
@@ -8991,7 +8996,7 @@ function requireCodecs () {
|
|
|
8991
8996
|
var low = buffer.readUInt32BE(offset + 4);
|
|
8992
8997
|
return high * BITWISE_OVERFLOW + low;
|
|
8993
8998
|
}
|
|
8994
|
-
exports.readUInt64BE = readUInt64BE;
|
|
8999
|
+
exports$1.readUInt64BE = readUInt64BE;
|
|
8995
9000
|
/**
|
|
8996
9001
|
* Write a uint64 (technically supports up to 53 bits per JS number
|
|
8997
9002
|
* representation).
|
|
@@ -9002,7 +9007,7 @@ function requireCodecs () {
|
|
|
9002
9007
|
offset = buffer.writeUInt32BE(high, offset); // first half of uint64
|
|
9003
9008
|
return buffer.writeUInt32BE(low, offset); // second half of uint64
|
|
9004
9009
|
}
|
|
9005
|
-
exports.writeUInt64BE = writeUInt64BE;
|
|
9010
|
+
exports$1.writeUInt64BE = writeUInt64BE;
|
|
9006
9011
|
/**
|
|
9007
9012
|
* Frame header is:
|
|
9008
9013
|
* - stream id (uint32 = 4)
|
|
@@ -9020,7 +9025,7 @@ function requireCodecs () {
|
|
|
9020
9025
|
var frameLength = readUInt24BE(buffer, 0);
|
|
9021
9026
|
return deserializeFrame(buffer.slice(UINT24_SIZE, UINT24_SIZE + frameLength));
|
|
9022
9027
|
}
|
|
9023
|
-
exports.deserializeFrameWithLength = deserializeFrameWithLength;
|
|
9028
|
+
exports$1.deserializeFrameWithLength = deserializeFrameWithLength;
|
|
9024
9029
|
/**
|
|
9025
9030
|
* Given a buffer that may contain zero or more length-prefixed frames followed
|
|
9026
9031
|
* by zero or more bytes of a (partial) subsequent frame, returns an array of
|
|
@@ -9053,7 +9058,7 @@ function requireCodecs () {
|
|
|
9053
9058
|
}
|
|
9054
9059
|
});
|
|
9055
9060
|
}
|
|
9056
|
-
exports.deserializeFrames = deserializeFrames;
|
|
9061
|
+
exports$1.deserializeFrames = deserializeFrames;
|
|
9057
9062
|
/**
|
|
9058
9063
|
* Writes a frame to a buffer with a length prefix.
|
|
9059
9064
|
*/
|
|
@@ -9064,7 +9069,7 @@ function requireCodecs () {
|
|
|
9064
9069
|
buffer.copy(lengthPrefixed, UINT24_SIZE);
|
|
9065
9070
|
return lengthPrefixed;
|
|
9066
9071
|
}
|
|
9067
|
-
exports.serializeFrameWithLength = serializeFrameWithLength;
|
|
9072
|
+
exports$1.serializeFrameWithLength = serializeFrameWithLength;
|
|
9068
9073
|
/**
|
|
9069
9074
|
* Read a frame from the buffer.
|
|
9070
9075
|
*/
|
|
@@ -9079,8 +9084,8 @@ function requireCodecs () {
|
|
|
9079
9084
|
// );
|
|
9080
9085
|
var typeAndFlags = buffer.readUInt16BE(offset);
|
|
9081
9086
|
offset += 2;
|
|
9082
|
-
var type = typeAndFlags >>> exports.FRAME_TYPE_OFFFSET; // keep highest 6 bits
|
|
9083
|
-
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
|
|
9084
9089
|
switch (type) {
|
|
9085
9090
|
case Frames_1.FrameTypes.SETUP:
|
|
9086
9091
|
return deserializeSetupFrame(buffer, streamId, flags);
|
|
@@ -9117,7 +9122,7 @@ function requireCodecs () {
|
|
|
9117
9122
|
// );
|
|
9118
9123
|
}
|
|
9119
9124
|
}
|
|
9120
|
-
exports.deserializeFrame = deserializeFrame;
|
|
9125
|
+
exports$1.deserializeFrame = deserializeFrame;
|
|
9121
9126
|
/**
|
|
9122
9127
|
* Convert the frame to a (binary) buffer.
|
|
9123
9128
|
*/
|
|
@@ -9156,7 +9161,7 @@ function requireCodecs () {
|
|
|
9156
9161
|
// );
|
|
9157
9162
|
}
|
|
9158
9163
|
}
|
|
9159
|
-
exports.serializeFrame = serializeFrame;
|
|
9164
|
+
exports$1.serializeFrame = serializeFrame;
|
|
9160
9165
|
/**
|
|
9161
9166
|
* Byte size of frame without size prefix
|
|
9162
9167
|
*/
|
|
@@ -9195,7 +9200,7 @@ function requireCodecs () {
|
|
|
9195
9200
|
// );
|
|
9196
9201
|
}
|
|
9197
9202
|
}
|
|
9198
|
-
exports.sizeOfFrame = sizeOfFrame;
|
|
9203
|
+
exports$1.sizeOfFrame = sizeOfFrame;
|
|
9199
9204
|
/**
|
|
9200
9205
|
* Writes a SETUP frame into a new buffer and returns it.
|
|
9201
9206
|
*
|
|
@@ -9830,7 +9835,7 @@ function requireCodecs () {
|
|
|
9830
9835
|
function writeHeader(frame, buffer) {
|
|
9831
9836
|
var offset = buffer.writeInt32BE(frame.streamId, 0);
|
|
9832
9837
|
// shift frame to high 6 bits, extract lowest 10 bits from flags
|
|
9833
|
-
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);
|
|
9834
9839
|
}
|
|
9835
9840
|
/**
|
|
9836
9841
|
* Determine the length of the payload section of a frame. Only applies to
|
|
@@ -9911,7 +9916,7 @@ function requireCodecs () {
|
|
|
9911
9916
|
};
|
|
9912
9917
|
return Deserializer;
|
|
9913
9918
|
}());
|
|
9914
|
-
exports.Deserializer = Deserializer;
|
|
9919
|
+
exports$1.Deserializer = Deserializer;
|
|
9915
9920
|
|
|
9916
9921
|
} (Codecs));
|
|
9917
9922
|
return Codecs;
|
|
@@ -10057,7 +10062,7 @@ var hasRequiredErrors;
|
|
|
10057
10062
|
function requireErrors () {
|
|
10058
10063
|
if (hasRequiredErrors) return Errors;
|
|
10059
10064
|
hasRequiredErrors = 1;
|
|
10060
|
-
(function (exports) {
|
|
10065
|
+
(function (exports$1) {
|
|
10061
10066
|
/*
|
|
10062
10067
|
* Copyright 2021-2022 the original author or authors.
|
|
10063
10068
|
*
|
|
@@ -10088,8 +10093,8 @@ function requireErrors () {
|
|
|
10088
10093
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
10089
10094
|
};
|
|
10090
10095
|
})();
|
|
10091
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10092
|
-
exports.ErrorCodes = exports.RSocketError = void 0;
|
|
10096
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
10097
|
+
exports$1.ErrorCodes = exports$1.RSocketError = void 0;
|
|
10093
10098
|
var RSocketError = /** @class */ (function (_super) {
|
|
10094
10099
|
__extends(RSocketError, _super);
|
|
10095
10100
|
function RSocketError(code, message) {
|
|
@@ -10099,7 +10104,7 @@ function requireErrors () {
|
|
|
10099
10104
|
}
|
|
10100
10105
|
return RSocketError;
|
|
10101
10106
|
}(Error));
|
|
10102
|
-
exports.RSocketError = RSocketError;
|
|
10107
|
+
exports$1.RSocketError = RSocketError;
|
|
10103
10108
|
(function (ErrorCodes) {
|
|
10104
10109
|
ErrorCodes[ErrorCodes["RESERVED"] = 0] = "RESERVED";
|
|
10105
10110
|
ErrorCodes[ErrorCodes["INVALID_SETUP"] = 1] = "INVALID_SETUP";
|
|
@@ -10113,7 +10118,7 @@ function requireErrors () {
|
|
|
10113
10118
|
ErrorCodes[ErrorCodes["CANCELED"] = 515] = "CANCELED";
|
|
10114
10119
|
ErrorCodes[ErrorCodes["INVALID"] = 516] = "INVALID";
|
|
10115
10120
|
ErrorCodes[ErrorCodes["RESERVED_EXTENSION"] = 4294967295] = "RESERVED_EXTENSION";
|
|
10116
|
-
})(exports.ErrorCodes || (exports.ErrorCodes = {}));
|
|
10121
|
+
})(exports$1.ErrorCodes || (exports$1.ErrorCodes = {}));
|
|
10117
10122
|
|
|
10118
10123
|
} (Errors));
|
|
10119
10124
|
return Errors;
|
|
@@ -10155,7 +10160,7 @@ var hasRequiredClientServerMultiplexerDemultiplexer;
|
|
|
10155
10160
|
function requireClientServerMultiplexerDemultiplexer () {
|
|
10156
10161
|
if (hasRequiredClientServerMultiplexerDemultiplexer) return ClientServerMultiplexerDemultiplexer;
|
|
10157
10162
|
hasRequiredClientServerMultiplexerDemultiplexer = 1;
|
|
10158
|
-
(function (exports) {
|
|
10163
|
+
(function (exports$1) {
|
|
10159
10164
|
/*
|
|
10160
10165
|
* Copyright 2021-2022 the original author or authors.
|
|
10161
10166
|
*
|
|
@@ -10222,8 +10227,8 @@ function requireClientServerMultiplexerDemultiplexer () {
|
|
|
10222
10227
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
10223
10228
|
}
|
|
10224
10229
|
};
|
|
10225
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10226
|
-
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;
|
|
10227
10232
|
var _1 = requireDist();
|
|
10228
10233
|
var Deferred_1 = requireDeferred();
|
|
10229
10234
|
var Errors_1 = requireErrors();
|
|
@@ -10246,7 +10251,7 @@ function requireClientServerMultiplexerDemultiplexer () {
|
|
|
10246
10251
|
};
|
|
10247
10252
|
return StreamIdGeneratorImpl;
|
|
10248
10253
|
}());
|
|
10249
|
-
})(exports.StreamIdGenerator || (exports.StreamIdGenerator = {}));
|
|
10254
|
+
})(exports$1.StreamIdGenerator || (exports$1.StreamIdGenerator = {}));
|
|
10250
10255
|
var ClientServerInputMultiplexerDemultiplexer = /** @class */ (function (_super) {
|
|
10251
10256
|
__extends(ClientServerInputMultiplexerDemultiplexer, _super);
|
|
10252
10257
|
function ClientServerInputMultiplexerDemultiplexer(streamIdSupplier, outbound, closeable) {
|
|
@@ -10335,7 +10340,7 @@ function requireClientServerMultiplexerDemultiplexer () {
|
|
|
10335
10340
|
};
|
|
10336
10341
|
return ClientServerInputMultiplexerDemultiplexer;
|
|
10337
10342
|
}(Deferred_1.Deferred));
|
|
10338
|
-
exports.ClientServerInputMultiplexerDemultiplexer = ClientServerInputMultiplexerDemultiplexer;
|
|
10343
|
+
exports$1.ClientServerInputMultiplexerDemultiplexer = ClientServerInputMultiplexerDemultiplexer;
|
|
10339
10344
|
var ResumableClientServerInputMultiplexerDemultiplexer = /** @class */ (function (_super) {
|
|
10340
10345
|
__extends(ResumableClientServerInputMultiplexerDemultiplexer, _super);
|
|
10341
10346
|
function ResumableClientServerInputMultiplexerDemultiplexer(streamIdSupplier, outbound, closeable, frameStore, token, sessionStoreOrReconnector, sessionTimeout) {
|
|
@@ -10492,7 +10497,7 @@ function requireClientServerMultiplexerDemultiplexer () {
|
|
|
10492
10497
|
};
|
|
10493
10498
|
return ResumableClientServerInputMultiplexerDemultiplexer;
|
|
10494
10499
|
}(ClientServerInputMultiplexerDemultiplexer));
|
|
10495
|
-
exports.ResumableClientServerInputMultiplexerDemultiplexer = ResumableClientServerInputMultiplexerDemultiplexer;
|
|
10500
|
+
exports$1.ResumableClientServerInputMultiplexerDemultiplexer = ResumableClientServerInputMultiplexerDemultiplexer;
|
|
10496
10501
|
var ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = /** @class */ (function () {
|
|
10497
10502
|
function ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer(outbound, closeable, delegate) {
|
|
10498
10503
|
this.outbound = outbound;
|
|
@@ -10549,7 +10554,7 @@ function requireClientServerMultiplexerDemultiplexer () {
|
|
|
10549
10554
|
};
|
|
10550
10555
|
return ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer;
|
|
10551
10556
|
}());
|
|
10552
|
-
exports.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer;
|
|
10557
|
+
exports$1.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer;
|
|
10553
10558
|
|
|
10554
10559
|
} (ClientServerMultiplexerDemultiplexer));
|
|
10555
10560
|
return ClientServerMultiplexerDemultiplexer;
|
|
@@ -13535,7 +13540,7 @@ var hasRequiredDist;
|
|
|
13535
13540
|
function requireDist () {
|
|
13536
13541
|
if (hasRequiredDist) return dist;
|
|
13537
13542
|
hasRequiredDist = 1;
|
|
13538
|
-
(function (exports) {
|
|
13543
|
+
(function (exports$1) {
|
|
13539
13544
|
/*
|
|
13540
13545
|
* Copyright 2021-2022 the original author or authors.
|
|
13541
13546
|
*
|
|
@@ -13558,19 +13563,19 @@ function requireDist () {
|
|
|
13558
13563
|
if (k2 === undefined) k2 = k;
|
|
13559
13564
|
o[k2] = m[k];
|
|
13560
13565
|
}));
|
|
13561
|
-
var __exportStar = (dist && dist.__exportStar) || function(m, exports) {
|
|
13562
|
-
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);
|
|
13563
13568
|
};
|
|
13564
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13565
|
-
__exportStar(requireCodecs(), exports);
|
|
13566
|
-
__exportStar(requireCommon(), exports);
|
|
13567
|
-
__exportStar(requireDeferred(), exports);
|
|
13568
|
-
__exportStar(requireErrors(), exports);
|
|
13569
|
-
__exportStar(requireFrames(), exports);
|
|
13570
|
-
__exportStar(requireRSocket(), exports);
|
|
13571
|
-
__exportStar(requireRSocketConnector(), exports);
|
|
13572
|
-
__exportStar(requireRSocketServer(), exports);
|
|
13573
|
-
__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);
|
|
13574
13579
|
|
|
13575
13580
|
} (dist));
|
|
13576
13581
|
return dist;
|
|
@@ -13578,7 +13583,7 @@ function requireDist () {
|
|
|
13578
13583
|
|
|
13579
13584
|
var distExports = requireDist();
|
|
13580
13585
|
|
|
13581
|
-
var version = "1.
|
|
13586
|
+
var version = "1.45.0";
|
|
13582
13587
|
var PACKAGE = {
|
|
13583
13588
|
version: version};
|
|
13584
13589
|
|
|
@@ -14505,6 +14510,7 @@ const DEFAULT_STREAMING_SYNC_OPTIONS = {
|
|
|
14505
14510
|
crudUploadThrottleMs: DEFAULT_CRUD_UPLOAD_THROTTLE_MS
|
|
14506
14511
|
};
|
|
14507
14512
|
const DEFAULT_STREAM_CONNECTION_OPTIONS = {
|
|
14513
|
+
appMetadata: {},
|
|
14508
14514
|
connectionMethod: SyncStreamConnectionMethod.WEB_SOCKET,
|
|
14509
14515
|
clientImplementation: DEFAULT_SYNC_CLIENT_IMPLEMENTATION,
|
|
14510
14516
|
fetchStrategy: FetchStrategy.Buffered,
|
|
@@ -14883,6 +14889,11 @@ The next upload iteration will be delayed.`);
|
|
|
14883
14889
|
...DEFAULT_STREAM_CONNECTION_OPTIONS,
|
|
14884
14890
|
...(options ?? {})
|
|
14885
14891
|
};
|
|
14892
|
+
// Validate app metadata
|
|
14893
|
+
const invalidMetadata = Object.entries(resolvedOptions.appMetadata).filter(([_, value]) => typeof value != 'string');
|
|
14894
|
+
if (invalidMetadata.length > 0) {
|
|
14895
|
+
throw new Error(`Invalid appMetadata provided. Only string values are allowed. Invalid values: ${invalidMetadata.map(([key, value]) => `${key}: ${value}`).join(', ')}`);
|
|
14896
|
+
}
|
|
14886
14897
|
const clientImplementation = resolvedOptions.clientImplementation;
|
|
14887
14898
|
this.updateSyncStatus({ clientImplementation });
|
|
14888
14899
|
if (clientImplementation == SyncClientImplementation.JAVASCRIPT) {
|
|
@@ -14918,6 +14929,7 @@ The next upload iteration will be delayed.`);
|
|
|
14918
14929
|
include_checksum: true,
|
|
14919
14930
|
raw_data: true,
|
|
14920
14931
|
parameters: resolvedOptions.params,
|
|
14932
|
+
app_metadata: resolvedOptions.appMetadata,
|
|
14921
14933
|
client_id: clientId
|
|
14922
14934
|
}
|
|
14923
14935
|
};
|
|
@@ -15277,6 +15289,7 @@ The next upload iteration will be delayed.`);
|
|
|
15277
15289
|
try {
|
|
15278
15290
|
const options = {
|
|
15279
15291
|
parameters: resolvedOptions.params,
|
|
15292
|
+
app_metadata: resolvedOptions.appMetadata,
|
|
15280
15293
|
active_streams: this.activeStreams,
|
|
15281
15294
|
include_defaults: resolvedOptions.includeDefaultStreams
|
|
15282
15295
|
};
|
|
@@ -15913,14 +15926,14 @@ class AbstractPowerSyncDatabase extends BaseObserver {
|
|
|
15913
15926
|
async initialize() {
|
|
15914
15927
|
await this._initialize();
|
|
15915
15928
|
await this.bucketStorageAdapter.init();
|
|
15916
|
-
await this.
|
|
15929
|
+
await this.loadVersion();
|
|
15917
15930
|
await this.updateSchema(this.options.schema);
|
|
15918
15931
|
await this.resolveOfflineSyncStatus();
|
|
15919
15932
|
await this.database.execute('PRAGMA RECURSIVE_TRIGGERS=TRUE');
|
|
15920
15933
|
this.ready = true;
|
|
15921
15934
|
this.iterateListeners((cb) => cb.initialized?.());
|
|
15922
15935
|
}
|
|
15923
|
-
async
|
|
15936
|
+
async loadVersion() {
|
|
15924
15937
|
try {
|
|
15925
15938
|
const { version } = await this.database.get('SELECT powersync_rs_version() as version');
|
|
15926
15939
|
this.sdkVersion = version;
|
|
@@ -17059,6 +17072,27 @@ class SyncDataBatch {
|
|
|
17059
17072
|
}
|
|
17060
17073
|
}
|
|
17061
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
|
+
|
|
17062
17096
|
// https://www.sqlite.org/lang_expr.html#castexpr
|
|
17063
17097
|
var ColumnType;
|
|
17064
17098
|
(function (ColumnType) {
|
|
@@ -17617,13 +17651,13 @@ const parseQuery = (query, parameters) => {
|
|
|
17617
17651
|
//# sourceMappingURL=bundle.mjs.map
|
|
17618
17652
|
|
|
17619
17653
|
|
|
17620
|
-
/***/ }
|
|
17654
|
+
/***/ },
|
|
17621
17655
|
|
|
17622
|
-
/***/ "./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js"
|
|
17656
|
+
/***/ "./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js"
|
|
17623
17657
|
/*!*************************************************************!*\
|
|
17624
17658
|
!*** ./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js ***!
|
|
17625
17659
|
\*************************************************************/
|
|
17626
|
-
|
|
17660
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
17627
17661
|
|
|
17628
17662
|
__webpack_require__.r(__webpack_exports__);
|
|
17629
17663
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -18041,13 +18075,13 @@ class WASqliteConnection extends _powersync_common__WEBPACK_IMPORTED_MODULE_1__.
|
|
|
18041
18075
|
}
|
|
18042
18076
|
|
|
18043
18077
|
|
|
18044
|
-
/***/ }
|
|
18078
|
+
/***/ },
|
|
18045
18079
|
|
|
18046
|
-
/***/ "./lib/src/shared/navigator.js"
|
|
18080
|
+
/***/ "./lib/src/shared/navigator.js"
|
|
18047
18081
|
/*!*************************************!*\
|
|
18048
18082
|
!*** ./lib/src/shared/navigator.js ***!
|
|
18049
18083
|
\*************************************/
|
|
18050
|
-
|
|
18084
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
18051
18085
|
|
|
18052
18086
|
__webpack_require__.r(__webpack_exports__);
|
|
18053
18087
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -18061,13 +18095,13 @@ const getNavigatorLocks = () => {
|
|
|
18061
18095
|
};
|
|
18062
18096
|
|
|
18063
18097
|
|
|
18064
|
-
/***/ }
|
|
18098
|
+
/***/ },
|
|
18065
18099
|
|
|
18066
|
-
/***/ "./lib/src/worker/db/SharedWASQLiteConnection.js"
|
|
18100
|
+
/***/ "./lib/src/worker/db/SharedWASQLiteConnection.js"
|
|
18067
18101
|
/*!*******************************************************!*\
|
|
18068
18102
|
!*** ./lib/src/worker/db/SharedWASQLiteConnection.js ***!
|
|
18069
18103
|
\*******************************************************/
|
|
18070
|
-
|
|
18104
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
18071
18105
|
|
|
18072
18106
|
__webpack_require__.r(__webpack_exports__);
|
|
18073
18107
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -18165,35 +18199,35 @@ class SharedWASQLiteConnection {
|
|
|
18165
18199
|
}
|
|
18166
18200
|
|
|
18167
18201
|
|
|
18168
|
-
/***/ }
|
|
18202
|
+
/***/ },
|
|
18169
18203
|
|
|
18170
|
-
/***/ "./lib/src/worker/db/WorkerWASQLiteConnection.js"
|
|
18204
|
+
/***/ "./lib/src/worker/db/WorkerWASQLiteConnection.js"
|
|
18171
18205
|
/*!*******************************************************!*\
|
|
18172
18206
|
!*** ./lib/src/worker/db/WorkerWASQLiteConnection.js ***!
|
|
18173
18207
|
\*******************************************************/
|
|
18174
|
-
|
|
18208
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
18175
18209
|
|
|
18176
18210
|
__webpack_require__.r(__webpack_exports__);
|
|
18177
18211
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
18178
18212
|
/* harmony export */ WorkerWASQLiteConnection: () => (/* binding */ WorkerWASQLiteConnection)
|
|
18179
18213
|
/* harmony export */ });
|
|
18180
|
-
/* harmony import */ var
|
|
18181
|
-
/* 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_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../db/adapters/wa-sqlite/WASQLiteConnection.js */ "./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js");
|
|
18182
18216
|
|
|
18183
18217
|
|
|
18184
18218
|
/**
|
|
18185
18219
|
* A Small proxy wrapper around the WASqliteConnection.
|
|
18186
18220
|
* This ensures that certain return types are properly proxied.
|
|
18187
18221
|
*/
|
|
18188
|
-
class WorkerWASQLiteConnection extends
|
|
18222
|
+
class WorkerWASQLiteConnection extends _db_adapters_wa_sqlite_WASQLiteConnection_js__WEBPACK_IMPORTED_MODULE_1__.WASqliteConnection {
|
|
18189
18223
|
async registerOnTableChange(callback) {
|
|
18190
18224
|
// Proxy the callback remove function
|
|
18191
|
-
return
|
|
18225
|
+
return comlink__WEBPACK_IMPORTED_MODULE_0__.proxy(await super.registerOnTableChange(callback));
|
|
18192
18226
|
}
|
|
18193
18227
|
}
|
|
18194
18228
|
|
|
18195
18229
|
|
|
18196
|
-
/***/ }
|
|
18230
|
+
/***/ }
|
|
18197
18231
|
|
|
18198
18232
|
/******/ });
|
|
18199
18233
|
/************************************************************************/
|
|
@@ -18207,6 +18241,12 @@ class WorkerWASQLiteConnection extends _db_adapters_wa_sqlite_WASQLiteConnection
|
|
|
18207
18241
|
/******/ if (cachedModule !== undefined) {
|
|
18208
18242
|
/******/ return cachedModule.exports;
|
|
18209
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
|
+
/******/ }
|
|
18210
18250
|
/******/ // Create a new module (and put it into the cache)
|
|
18211
18251
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
18212
18252
|
/******/ // no module.id needed
|
|
@@ -18361,10 +18401,10 @@ var __webpack_exports__ = {};
|
|
|
18361
18401
|
__webpack_require__.r(__webpack_exports__);
|
|
18362
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");
|
|
18363
18403
|
/* harmony import */ var _powersync_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @powersync/common */ "../common/dist/bundle.mjs");
|
|
18364
|
-
/* harmony import */ var
|
|
18365
|
-
/* harmony import */ var
|
|
18366
|
-
/* harmony import */ var
|
|
18367
|
-
/* 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_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/navigator.js */ "./lib/src/shared/navigator.js");
|
|
18406
|
+
/* harmony import */ var _SharedWASQLiteConnection_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SharedWASQLiteConnection.js */ "./lib/src/worker/db/SharedWASQLiteConnection.js");
|
|
18407
|
+
/* harmony import */ var _WorkerWASQLiteConnection_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./WorkerWASQLiteConnection.js */ "./lib/src/worker/db/WorkerWASQLiteConnection.js");
|
|
18368
18408
|
/**
|
|
18369
18409
|
* Supports both shared and dedicated workers, based on how the worker is constructed (new SharedWorker vs new Worker()).
|
|
18370
18410
|
*/
|
|
@@ -18382,14 +18422,14 @@ const OPEN_DB_LOCK = 'open-wasqlite-db';
|
|
|
18382
18422
|
let nextClientId = 1;
|
|
18383
18423
|
const openDBShared = async (options) => {
|
|
18384
18424
|
// Prevent multiple simultaneous opens from causing race conditions
|
|
18385
|
-
return (0,
|
|
18425
|
+
return (0,_shared_navigator_js__WEBPACK_IMPORTED_MODULE_3__.getNavigatorLocks)().request(OPEN_DB_LOCK, async () => {
|
|
18386
18426
|
const clientId = nextClientId++;
|
|
18387
18427
|
const { dbFilename, logLevel } = options;
|
|
18388
18428
|
logger.setLevel(logLevel);
|
|
18389
18429
|
if (!DBMap.has(dbFilename)) {
|
|
18390
18430
|
const clientIds = new Set();
|
|
18391
18431
|
// This format returns proxy objects for function callbacks
|
|
18392
|
-
const connection = new
|
|
18432
|
+
const connection = new _WorkerWASQLiteConnection_js__WEBPACK_IMPORTED_MODULE_5__.WorkerWASQLiteConnection(options);
|
|
18393
18433
|
await connection.init();
|
|
18394
18434
|
connection.registerListener({
|
|
18395
18435
|
holdOverwritten: async () => {
|
|
@@ -18407,13 +18447,13 @@ const openDBShared = async (options) => {
|
|
|
18407
18447
|
});
|
|
18408
18448
|
}
|
|
18409
18449
|
// Associates this clientId with the shared connection entry
|
|
18410
|
-
const sharedConnection = new
|
|
18450
|
+
const sharedConnection = new _SharedWASQLiteConnection_js__WEBPACK_IMPORTED_MODULE_4__.SharedWASQLiteConnection({
|
|
18411
18451
|
dbMap: DBMap,
|
|
18412
18452
|
dbFilename,
|
|
18413
18453
|
clientId,
|
|
18414
18454
|
logger
|
|
18415
18455
|
});
|
|
18416
|
-
return
|
|
18456
|
+
return comlink__WEBPACK_IMPORTED_MODULE_2__.proxy(sharedConnection);
|
|
18417
18457
|
});
|
|
18418
18458
|
};
|
|
18419
18459
|
// Check if we're in a SharedWorker context
|
|
@@ -18421,12 +18461,12 @@ if (typeof SharedWorkerGlobalScope !== 'undefined') {
|
|
|
18421
18461
|
const _self = self;
|
|
18422
18462
|
_self.onconnect = function (event) {
|
|
18423
18463
|
const port = event.ports[0];
|
|
18424
|
-
|
|
18464
|
+
comlink__WEBPACK_IMPORTED_MODULE_2__.expose(openDBShared, port);
|
|
18425
18465
|
};
|
|
18426
18466
|
}
|
|
18427
18467
|
else {
|
|
18428
18468
|
// A dedicated worker can be shared externally
|
|
18429
|
-
|
|
18469
|
+
comlink__WEBPACK_IMPORTED_MODULE_2__.expose(openDBShared);
|
|
18430
18470
|
}
|
|
18431
18471
|
addEventListener('unload', () => {
|
|
18432
18472
|
Array.from(DBMap.values()).forEach(async (dbConnection) => {
|