@nmshd/transport 1.0.5 → 1.1.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/buildInformation.js +5 -5
- package/dist/core/DependencyOverrides.d.ts +4 -0
- package/dist/core/DependencyOverrides.js +3 -0
- package/dist/core/DependencyOverrides.js.map +1 -0
- package/dist/core/Transport.d.ts +2 -3
- package/dist/core/Transport.js +26 -23
- package/dist/core/Transport.js.map +1 -1
- package/dist/core/TransportErrors.d.ts +4 -0
- package/dist/core/TransportErrors.js +12 -0
- package/dist/core/TransportErrors.js.map +1 -1
- package/dist/core/backbone/BackboneIds.d.ts +0 -1
- package/dist/core/backbone/BackboneIds.js +0 -1
- package/dist/core/backbone/BackboneIds.js.map +1 -1
- package/dist/core/backbone/RESTClient.js +1 -1
- package/dist/core/backbone/RESTClient.js.map +1 -1
- package/dist/core/backbone/index.d.ts +1 -0
- package/dist/core/backbone/index.js +1 -0
- package/dist/core/backbone/index.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/modules/accounts/AccountController.d.ts +3 -2
- package/dist/modules/accounts/AccountController.js +9 -7
- package/dist/modules/accounts/AccountController.js.map +1 -1
- package/dist/modules/devices/DeviceController.d.ts +5 -1
- package/dist/modules/devices/DeviceController.js +9 -4
- package/dist/modules/devices/DeviceController.js.map +1 -1
- package/dist/modules/devices/local/Device.d.ts +2 -0
- package/dist/modules/devices/local/Device.js +7 -1
- package/dist/modules/devices/local/Device.js.map +1 -1
- package/dist/modules/index.d.ts +8 -0
- package/dist/modules/index.js +8 -0
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.js +2 -2
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.js.map +1 -1
- package/dist/modules/relationships/local/Relationship.d.ts +2 -2
- package/dist/modules/relationships/local/Relationship.js.map +1 -1
- package/dist/modules/sync/DatawalletModificationMapper.d.ts +1 -1
- package/dist/modules/sync/DatawalletModificationMapper.js +6 -3
- package/dist/modules/sync/DatawalletModificationMapper.js.map +1 -1
- package/dist/modules/sync/DatawalletModificationsProcessor.d.ts +9 -4
- package/dist/modules/sync/DatawalletModificationsProcessor.js +66 -45
- package/dist/modules/sync/DatawalletModificationsProcessor.js.map +1 -1
- package/dist/modules/sync/SyncController.d.ts +17 -4
- package/dist/modules/sync/SyncController.js +154 -24
- package/dist/modules/sync/SyncController.js.map +1 -1
- package/dist/modules/sync/SynchronizedCollection.d.ts +2 -1
- package/dist/modules/sync/SynchronizedCollection.js +18 -18
- package/dist/modules/sync/SynchronizedCollection.js.map +1 -1
- package/dist/modules/sync/backbone/BackboneDatawalletModification.d.ts +1 -0
- package/dist/modules/sync/backbone/CreateDatawalletModifications.d.ts +1 -0
- package/dist/modules/sync/backbone/FinalizeSyncRun.d.ts +15 -9
- package/dist/modules/sync/backbone/GetDatawallet.d.ts +3 -0
- package/dist/modules/sync/backbone/GetDatawallet.js +3 -0
- package/dist/modules/sync/backbone/GetDatawallet.js.map +1 -0
- package/dist/modules/sync/backbone/StartSyncRun.d.ts +8 -0
- package/dist/modules/sync/backbone/StartSyncRun.js +6 -1
- package/dist/modules/sync/backbone/StartSyncRun.js.map +1 -1
- package/dist/modules/sync/backbone/SyncClient.d.ts +21 -6
- package/dist/modules/sync/backbone/SyncClient.js +19 -6
- package/dist/modules/sync/backbone/SyncClient.js.map +1 -1
- package/dist/modules/sync/local/DatawalletModification.d.ts +2 -0
- package/dist/modules/sync/local/DatawalletModification.js +5 -0
- package/dist/modules/sync/local/DatawalletModification.js.map +1 -1
- package/dist/modules/sync/migrations/DeviceMigrations.d.ts +6 -0
- package/dist/modules/sync/migrations/DeviceMigrations.js +24 -0
- package/dist/modules/sync/migrations/DeviceMigrations.js.map +1 -0
- package/dist/modules/sync/migrations/IdentityMigrations.d.ts +6 -0
- package/dist/modules/sync/migrations/IdentityMigrations.js +14 -0
- package/dist/modules/sync/migrations/IdentityMigrations.js.map +1 -0
- package/lib-web/nmshd.transport.js +826 -444
- package/lib-web/nmshd.transport.js.map +1 -1
- package/lib-web/nmshd.transport.min.js +1 -1
- package/lib-web/nmshd.transport.min.js.map +1 -1
- package/package.json +26 -26
|
@@ -15,11 +15,11 @@ exports.buildInformation = void 0;
|
|
|
15
15
|
const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
|
|
16
16
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
17
17
|
exports.buildInformation = {
|
|
18
|
-
version: "1.0
|
|
19
|
-
build: "
|
|
20
|
-
date: "2021-
|
|
21
|
-
commit: "
|
|
22
|
-
dependencies: {"@js-soft/docdb-access-abstractions":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/simple-logger":"1.0.0","@js-soft/ts-utils":"1.
|
|
18
|
+
version: "1.1.0",
|
|
19
|
+
build: "12",
|
|
20
|
+
date: "2021-11-24T08:13:17+00:00",
|
|
21
|
+
commit: "79449175787ac5c327066c6846fba4deb209606e",
|
|
22
|
+
dependencies: {"@js-soft/docdb-access-abstractions":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/simple-logger":"1.0.0","@js-soft/ts-utils":"1.1.1","axios":"^0.24.0","deep-equal":"^2.0.5","fast-json-patch":"^3.1.0","form-data":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^2.1.1","qs":"^6.10.1","reflect-metadata":"^0.1.13","ts-simple-nameof":"^1.3.1","uuid":"^8.3.2"},
|
|
23
23
|
libraries: {
|
|
24
24
|
crypto: crypto_1.buildInformation,
|
|
25
25
|
serval: ts_serval_1.buildInformation
|
|
@@ -572,31 +572,16 @@ var DbCollectionName;
|
|
|
572
572
|
|
|
573
573
|
/***/ }),
|
|
574
574
|
|
|
575
|
-
/***/ "./dist/core/
|
|
576
|
-
|
|
577
|
-
!*** ./dist/core/
|
|
578
|
-
|
|
579
|
-
/***/ ((__unused_webpack_module, exports
|
|
575
|
+
/***/ "./dist/core/DependencyOverrides.js":
|
|
576
|
+
/*!******************************************!*\
|
|
577
|
+
!*** ./dist/core/DependencyOverrides.js ***!
|
|
578
|
+
\******************************************/
|
|
579
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
580
580
|
|
|
581
581
|
"use strict";
|
|
582
582
|
|
|
583
583
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
584
|
-
|
|
585
|
-
const ts_simple_nameof_1 = __webpack_require__(/*! ts-simple-nameof */ "./node_modules/ts-simple-nameof/index.js");
|
|
586
|
-
const CoreSynchronizable_1 = __webpack_require__(/*! ./CoreSynchronizable */ "./dist/core/CoreSynchronizable.js");
|
|
587
|
-
function isCacheable(object) {
|
|
588
|
-
if (!(object instanceof CoreSynchronizable_1.CoreSynchronizable)) {
|
|
589
|
-
return false;
|
|
590
|
-
}
|
|
591
|
-
if (typeof object !== "object") {
|
|
592
|
-
return false;
|
|
593
|
-
}
|
|
594
|
-
const hasCacheProperty = object.toJSON().hasOwnProperty((0, ts_simple_nameof_1.nameof)((o) => o.cache));
|
|
595
|
-
const hasSetCacheMethod = typeof object.setCache === "function";
|
|
596
|
-
return hasCacheProperty && hasSetCacheMethod;
|
|
597
|
-
}
|
|
598
|
-
exports.isCacheable = isCacheable;
|
|
599
|
-
//# sourceMappingURL=ICacheable.js.map
|
|
584
|
+
//# sourceMappingURL=DependencyOverrides.js.map
|
|
600
585
|
|
|
601
586
|
/***/ }),
|
|
602
587
|
|
|
@@ -623,30 +608,8 @@ const TransportLoggerFactory_1 = __webpack_require__(/*! ./TransportLoggerFactor
|
|
|
623
608
|
let log;
|
|
624
609
|
class Transport {
|
|
625
610
|
constructor(databaseConnection, customConfig, loggerFactory = new simple_logger_1.SimpleLoggerFactory()) {
|
|
626
|
-
this.defaultConfig = {
|
|
627
|
-
debug: false,
|
|
628
|
-
platformClientId: "",
|
|
629
|
-
platformClientSecret: "",
|
|
630
|
-
platformTimeout: 60000,
|
|
631
|
-
platformMaxRedirects: 10,
|
|
632
|
-
platformMaxUnencryptedFileSize: 10 * 1024 * 1024,
|
|
633
|
-
baseUrl: "",
|
|
634
|
-
useGateway: true,
|
|
635
|
-
realm: Identity_1.Realm.Prod,
|
|
636
|
-
datawalletEnabled: false,
|
|
637
|
-
httpAgent: {
|
|
638
|
-
keepAlive: true,
|
|
639
|
-
maxSockets: 5,
|
|
640
|
-
maxFreeSockets: 2
|
|
641
|
-
},
|
|
642
|
-
httpsAgent: {
|
|
643
|
-
keepAlive: true,
|
|
644
|
-
maxSockets: 5,
|
|
645
|
-
maxFreeSockets: 2
|
|
646
|
-
}
|
|
647
|
-
};
|
|
648
611
|
this.databaseConnection = databaseConnection;
|
|
649
|
-
this._config = lodash_1.default.defaultsDeep({}, customConfig,
|
|
612
|
+
this._config = lodash_1.default.defaultsDeep({}, customConfig, Transport.defaultConfig);
|
|
650
613
|
TransportLoggerFactory_1.TransportLoggerFactory.init(loggerFactory);
|
|
651
614
|
log = TransportLoggerFactory_1.TransportLoggerFactory.getLogger(Transport);
|
|
652
615
|
if (!this._config.platformClientId) {
|
|
@@ -658,6 +621,9 @@ class Transport {
|
|
|
658
621
|
if (!this._config.baseUrl) {
|
|
659
622
|
throw TransportErrors_1.TransportErrors.general.baseUrlNotSet().logWith(log);
|
|
660
623
|
}
|
|
624
|
+
if (this._config.supportedDatawalletVersion < 1) {
|
|
625
|
+
throw TransportErrors_1.TransportErrors.general.invalidDatawalletVersion().logWith(log);
|
|
626
|
+
}
|
|
661
627
|
}
|
|
662
628
|
get config() {
|
|
663
629
|
return this._config;
|
|
@@ -677,6 +643,28 @@ class Transport {
|
|
|
677
643
|
}
|
|
678
644
|
}
|
|
679
645
|
exports.Transport = Transport;
|
|
646
|
+
Transport.defaultConfig = {
|
|
647
|
+
supportedDatawalletVersion: 1,
|
|
648
|
+
debug: false,
|
|
649
|
+
platformClientId: "",
|
|
650
|
+
platformClientSecret: "",
|
|
651
|
+
platformTimeout: 60000,
|
|
652
|
+
platformMaxRedirects: 10,
|
|
653
|
+
platformMaxUnencryptedFileSize: 10 * 1024 * 1024,
|
|
654
|
+
baseUrl: "",
|
|
655
|
+
realm: Identity_1.Realm.Prod,
|
|
656
|
+
datawalletEnabled: false,
|
|
657
|
+
httpAgent: {
|
|
658
|
+
keepAlive: true,
|
|
659
|
+
maxSockets: 5,
|
|
660
|
+
maxFreeSockets: 2
|
|
661
|
+
},
|
|
662
|
+
httpsAgent: {
|
|
663
|
+
keepAlive: true,
|
|
664
|
+
maxSockets: 5,
|
|
665
|
+
maxFreeSockets: 2
|
|
666
|
+
}
|
|
667
|
+
};
|
|
680
668
|
//# sourceMappingURL=Transport.js.map
|
|
681
669
|
|
|
682
670
|
/***/ }),
|
|
@@ -1018,6 +1006,15 @@ class Datawallet {
|
|
|
1018
1006
|
throw new Error(`Given type '${type}' is not supported.`);
|
|
1019
1007
|
}
|
|
1020
1008
|
}
|
|
1009
|
+
insufficientSupportedDatawalletVersion(supportedVersion, requiredVersion) {
|
|
1010
|
+
return new CoreError_1.CoreError("error.transport.datawallet.insufficientSupportedDatawalletVersion", `The SupportedDatawalletVersion '${supportedVersion}' is too low. A minimum version of '${requiredVersion}' is required.`);
|
|
1011
|
+
}
|
|
1012
|
+
currentBiggerThanTarget(current, target) {
|
|
1013
|
+
return new CoreError_1.CoreError("error.transport.datawallet.currentBiggerThanTarget", `The current datawallet version '${current}' is bigger than the target version '${target}'.`);
|
|
1014
|
+
}
|
|
1015
|
+
noMigrationAvailable(version) {
|
|
1016
|
+
return new CoreError_1.CoreError("error.core.datawallet.noMigrationAvailable", `There is no migration available for the datawallet version '${version}'.`);
|
|
1017
|
+
}
|
|
1021
1018
|
}
|
|
1022
1019
|
class Files {
|
|
1023
1020
|
plaintextHashMismatch() {
|
|
@@ -1048,6 +1045,9 @@ class Tokens {
|
|
|
1048
1045
|
}
|
|
1049
1046
|
}
|
|
1050
1047
|
class General {
|
|
1048
|
+
invalidDatawalletVersion() {
|
|
1049
|
+
return new CoreError_1.CoreError("error.transport.general.invalidDatawalletVersion", "The given identity version is invalid. The value must be 0 or higher.");
|
|
1050
|
+
}
|
|
1051
1051
|
baseUrlNotSet() {
|
|
1052
1052
|
return new CoreError_1.CoreError("error.transport.general.baseUrlNotSet", "The baseUrl was not set.");
|
|
1053
1053
|
}
|
|
@@ -1310,7 +1310,6 @@ class BackboneIds {
|
|
|
1310
1310
|
exports.BackboneIds = BackboneIds;
|
|
1311
1311
|
BackboneIds.file = new CoreIdHelper_1.CoreIdHelper("FIL", true);
|
|
1312
1312
|
BackboneIds.relationship = new CoreIdHelper_1.CoreIdHelper("REL", true);
|
|
1313
|
-
BackboneIds.relationshipRequest = new CoreIdHelper_1.CoreIdHelper("RRQ", true);
|
|
1314
1313
|
BackboneIds.message = new CoreIdHelper_1.CoreIdHelper("MSG", true);
|
|
1315
1314
|
BackboneIds.relationshipTemplate = new CoreIdHelper_1.CoreIdHelper("RLT", true);
|
|
1316
1315
|
BackboneIds.token = new CoreIdHelper_1.CoreIdHelper("TOK", true);
|
|
@@ -1507,7 +1506,7 @@ class RESTClient {
|
|
|
1507
1506
|
}
|
|
1508
1507
|
};
|
|
1509
1508
|
if (this.config.platformAdditionalHeaders) {
|
|
1510
|
-
defaults.headers = this.config.platformAdditionalHeaders;
|
|
1509
|
+
defaults.headers = lodash_1.default.defaultsDeep({}, defaults.headers, this.config.platformAdditionalHeaders);
|
|
1511
1510
|
}
|
|
1512
1511
|
if (typeof http_1.Agent !== "undefined" && typeof https_1.Agent !== "undefined") {
|
|
1513
1512
|
defaults.httpAgent = this.createHTTPAgent();
|
|
@@ -2088,6 +2087,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
2088
2087
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
2089
2088
|
};
|
|
2090
2089
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2090
|
+
__exportStar(__webpack_require__(/*! ./Authenticator */ "./dist/core/backbone/Authenticator.js"), exports);
|
|
2091
2091
|
__exportStar(__webpack_require__(/*! ./BackboneIds */ "./dist/core/backbone/BackboneIds.js"), exports);
|
|
2092
2092
|
__exportStar(__webpack_require__(/*! ./ClientResult */ "./dist/core/backbone/ClientResult.js"), exports);
|
|
2093
2093
|
__exportStar(__webpack_require__(/*! ./Paginator */ "./dist/core/backbone/Paginator.js"), exports);
|
|
@@ -2125,6 +2125,7 @@ __exportStar(__webpack_require__(/*! ./CoreSerializable */ "./dist/core/CoreSeri
|
|
|
2125
2125
|
__exportStar(__webpack_require__(/*! ./CoreSerializableAsync */ "./dist/core/CoreSerializableAsync.js"), exports);
|
|
2126
2126
|
__exportStar(__webpack_require__(/*! ./CoreSynchronizable */ "./dist/core/CoreSynchronizable.js"), exports);
|
|
2127
2127
|
__exportStar(__webpack_require__(/*! ./CoreUtil */ "./dist/core/CoreUtil.js"), exports);
|
|
2128
|
+
__exportStar(__webpack_require__(/*! ./DependencyOverrides */ "./dist/core/DependencyOverrides.js"), exports);
|
|
2128
2129
|
__exportStar(__webpack_require__(/*! ./Transport */ "./dist/core/Transport.js"), exports);
|
|
2129
2130
|
__exportStar(__webpack_require__(/*! ./TransportContext */ "./dist/core/TransportContext.js"), exports);
|
|
2130
2131
|
__exportStar(__webpack_require__(/*! ./TransportController */ "./dist/core/TransportController.js"), exports);
|
|
@@ -2636,11 +2637,11 @@ const Identity_1 = __webpack_require__(/*! ./data/Identity */ "./dist/modules/ac
|
|
|
2636
2637
|
const IdentityController_1 = __webpack_require__(/*! ./IdentityController */ "./dist/modules/accounts/IdentityController.js");
|
|
2637
2638
|
const IdentityUtil_1 = __webpack_require__(/*! ./IdentityUtil */ "./dist/modules/accounts/IdentityUtil.js");
|
|
2638
2639
|
class AccountController {
|
|
2639
|
-
constructor(_transport,
|
|
2640
|
+
constructor(_transport, _db, _config, dependencyOverrides = {}) {
|
|
2640
2641
|
this._transport = _transport;
|
|
2641
|
-
this._realm = _realm;
|
|
2642
2642
|
this._db = _db;
|
|
2643
2643
|
this._config = _config;
|
|
2644
|
+
this.dependencyOverrides = dependencyOverrides;
|
|
2644
2645
|
this._dbClosed = false;
|
|
2645
2646
|
this.autoSync = true;
|
|
2646
2647
|
this._authenticator = new Authenticator_1.Authenticator(this);
|
|
@@ -2691,7 +2692,7 @@ class AccountController {
|
|
|
2691
2692
|
if (!deviceSharedSecret) {
|
|
2692
2693
|
// Identity creation
|
|
2693
2694
|
this._log.trace("No account information found. Creating new account...");
|
|
2694
|
-
const result = await this.createIdentityAndDevice(this.
|
|
2695
|
+
const result = await this.createIdentityAndDevice(this.config.realm);
|
|
2695
2696
|
identityCreated = true;
|
|
2696
2697
|
device = result.device;
|
|
2697
2698
|
this.deviceAuthClient = new DeviceAuthClient_1.DeviceAuthClient(this.config, this.authenticator);
|
|
@@ -2725,6 +2726,7 @@ class AccountController {
|
|
|
2725
2726
|
await this.initControllers();
|
|
2726
2727
|
if (identityCreated) {
|
|
2727
2728
|
await this.devices.addExistingDevice(device);
|
|
2729
|
+
await this.synchronization.setInititalDatawalletVersion(this._config.supportedDatawalletVersion);
|
|
2728
2730
|
}
|
|
2729
2731
|
else if (deviceUpdated) {
|
|
2730
2732
|
await this.syncDatawallet();
|
|
@@ -2742,7 +2744,6 @@ class AccountController {
|
|
|
2742
2744
|
}
|
|
2743
2745
|
async initControllers() {
|
|
2744
2746
|
this._log.trace("Initializing controllers...");
|
|
2745
|
-
this.synchronization = await new SyncController_1.SyncController(this, this.unpushedDatawalletModifications, this.config.datawalletEnabled).init();
|
|
2746
2747
|
this.relationshipSecrets = await new RelationshipSecretController_1.RelationshipSecretController(this).init();
|
|
2747
2748
|
this.devices = await new DevicesController_1.DevicesController(this).init();
|
|
2748
2749
|
this.certificates = await new CertificateController_1.CertificateController(this).init();
|
|
@@ -2753,6 +2754,7 @@ class AccountController {
|
|
|
2753
2754
|
this.relationshipTemplates = await new RelationshipTemplateController_1.RelationshipTemplateController(this, this.relationshipSecrets).init();
|
|
2754
2755
|
this.messages = await new MessageController_1.MessageController(this).init();
|
|
2755
2756
|
this.tokens = await new TokenController_1.TokenController(this).init();
|
|
2757
|
+
this.synchronization = await new SyncController_1.SyncController(this, this.dependencyOverrides, this.unpushedDatawalletModifications, this.config.datawalletEnabled).init();
|
|
2756
2758
|
this._log.trace("Initialization of controllers finished.");
|
|
2757
2759
|
}
|
|
2758
2760
|
disableAutoSync() {
|
|
@@ -2845,7 +2847,8 @@ class AccountController {
|
|
|
2845
2847
|
publicKey: deviceKeypair.publicKey,
|
|
2846
2848
|
type: deviceInfo.type,
|
|
2847
2849
|
certificate: "",
|
|
2848
|
-
username: deviceResponse.device.username
|
|
2850
|
+
username: deviceResponse.device.username,
|
|
2851
|
+
datawalletVersion: this._config.supportedDatawalletVersion
|
|
2849
2852
|
});
|
|
2850
2853
|
// Initialize required controllers
|
|
2851
2854
|
await Promise.all([this.identity.init(identity), this.activeDevice.init(privBaseDevice, device)]);
|
|
@@ -2931,9 +2934,9 @@ class AccountController {
|
|
|
2931
2934
|
async getSynchronizedCollection(collectionName) {
|
|
2932
2935
|
const collection = await this.db.getCollection(collectionName);
|
|
2933
2936
|
if (!this.config.datawalletEnabled) {
|
|
2934
|
-
return new SynchronizedCollection_1.SynchronizedCollection(collection);
|
|
2937
|
+
return new SynchronizedCollection_1.SynchronizedCollection(collection, this.config.supportedDatawalletVersion);
|
|
2935
2938
|
}
|
|
2936
|
-
return new SynchronizedCollection_1.SynchronizedCollection(collection, this.unpushedDatawalletModifications);
|
|
2939
|
+
return new SynchronizedCollection_1.SynchronizedCollection(collection, this.config.supportedDatawalletVersion, this.unpushedDatawalletModifications);
|
|
2937
2940
|
}
|
|
2938
2941
|
}
|
|
2939
2942
|
exports.AccountController = AccountController;
|
|
@@ -4473,10 +4476,15 @@ class DeviceController extends core_1.TransportController {
|
|
|
4473
4476
|
throw e;
|
|
4474
4477
|
}
|
|
4475
4478
|
}
|
|
4476
|
-
async update(
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4479
|
+
async update(update) {
|
|
4480
|
+
if (update.name)
|
|
4481
|
+
this.device.name = update.name;
|
|
4482
|
+
if (update.description)
|
|
4483
|
+
this.device.description = update.description;
|
|
4484
|
+
if (update.datawalletVersion)
|
|
4485
|
+
this.device.datawalletVersion = update.datawalletVersion;
|
|
4486
|
+
await this.parent.devices.update(this.device);
|
|
4487
|
+
await this.parent.info.set("device", this.device.toJSON());
|
|
4480
4488
|
}
|
|
4481
4489
|
async sign(content) {
|
|
4482
4490
|
const privateKeyContainer = await this.secrets.loadSecret(DeviceSecretController_1.DeviceSecretType.DeviceSignature);
|
|
@@ -4914,7 +4922,8 @@ let Device = Device_1 = class Device extends core_1.CoreSynchronizable {
|
|
|
4914
4922
|
(0, ts_simple_nameof_1.nameof)((d) => d.createdByDevice),
|
|
4915
4923
|
(0, ts_simple_nameof_1.nameof)((d) => d.lastLoginAt),
|
|
4916
4924
|
(0, ts_simple_nameof_1.nameof)((d) => d.username),
|
|
4917
|
-
(0, ts_simple_nameof_1.nameof)((d) => d.initialPassword)
|
|
4925
|
+
(0, ts_simple_nameof_1.nameof)((d) => d.initialPassword),
|
|
4926
|
+
(0, ts_simple_nameof_1.nameof)((d) => d.datawalletVersion)
|
|
4918
4927
|
];
|
|
4919
4928
|
this.userdataProperties = [(0, ts_simple_nameof_1.nameof)((d) => d.name), (0, ts_simple_nameof_1.nameof)((d) => d.description)];
|
|
4920
4929
|
}
|
|
@@ -4982,6 +4991,11 @@ __decorate([
|
|
|
4982
4991
|
(0, ts_serval_1.serialize)(),
|
|
4983
4992
|
__metadata("design:type", Boolean)
|
|
4984
4993
|
], Device.prototype, "isAdmin", void 0);
|
|
4994
|
+
__decorate([
|
|
4995
|
+
(0, ts_serval_1.validate)({ nullable: true }),
|
|
4996
|
+
(0, ts_serval_1.serialize)(),
|
|
4997
|
+
__metadata("design:type", Number)
|
|
4998
|
+
], Device.prototype, "datawalletVersion", void 0);
|
|
4985
4999
|
Device = Device_1 = __decorate([
|
|
4986
5000
|
(0, ts_serval_1.type)("Device")
|
|
4987
5001
|
], Device);
|
|
@@ -6062,6 +6076,14 @@ __exportStar(__webpack_require__(/*! ./relationshipTemplates/transmission/Relati
|
|
|
6062
6076
|
__exportStar(__webpack_require__(/*! ./secrets/data/SecretContainerCipher */ "./dist/modules/secrets/data/SecretContainerCipher.js"), exports);
|
|
6063
6077
|
__exportStar(__webpack_require__(/*! ./secrets/data/SecretContainerPlain */ "./dist/modules/secrets/data/SecretContainerPlain.js"), exports);
|
|
6064
6078
|
__exportStar(__webpack_require__(/*! ./secrets/SecretController */ "./dist/modules/secrets/SecretController.js"), exports);
|
|
6079
|
+
__exportStar(__webpack_require__(/*! ./sync/backbone/BackboneDatawalletModification */ "./dist/modules/sync/backbone/BackboneDatawalletModification.js"), exports);
|
|
6080
|
+
__exportStar(__webpack_require__(/*! ./sync/backbone/BackboneExternalEvent */ "./dist/modules/sync/backbone/BackboneExternalEvent.js"), exports);
|
|
6081
|
+
__exportStar(__webpack_require__(/*! ./sync/backbone/CreateDatawalletModifications */ "./dist/modules/sync/backbone/CreateDatawalletModifications.js"), exports);
|
|
6082
|
+
__exportStar(__webpack_require__(/*! ./sync/backbone/FinalizeSyncRun */ "./dist/modules/sync/backbone/FinalizeSyncRun.js"), exports);
|
|
6083
|
+
__exportStar(__webpack_require__(/*! ./sync/backbone/GetDatawallet */ "./dist/modules/sync/backbone/GetDatawallet.js"), exports);
|
|
6084
|
+
__exportStar(__webpack_require__(/*! ./sync/backbone/GetDatawalletModifications */ "./dist/modules/sync/backbone/GetDatawalletModifications.js"), exports);
|
|
6085
|
+
__exportStar(__webpack_require__(/*! ./sync/backbone/StartSyncRun */ "./dist/modules/sync/backbone/StartSyncRun.js"), exports);
|
|
6086
|
+
__exportStar(__webpack_require__(/*! ./sync/backbone/SyncClient */ "./dist/modules/sync/backbone/SyncClient.js"), exports);
|
|
6065
6087
|
__exportStar(__webpack_require__(/*! ./sync/ChangedItems */ "./dist/modules/sync/ChangedItems.js"), exports);
|
|
6066
6088
|
__exportStar(__webpack_require__(/*! ./sync/DatawalletModificationsProcessor */ "./dist/modules/sync/DatawalletModificationsProcessor.js"), exports);
|
|
6067
6089
|
__exportStar(__webpack_require__(/*! ./sync/ExternalEventsProcessor */ "./dist/modules/sync/ExternalEventsProcessor.js"), exports);
|
|
@@ -7072,7 +7094,7 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
|
|
|
7072
7094
|
const templateKey = await this.secrets.createTemplateKey();
|
|
7073
7095
|
const templateContent = await RelationshipTemplateContent_1.RelationshipTemplateContent.from({
|
|
7074
7096
|
content: parameters.content,
|
|
7075
|
-
identity: this.parent.identity,
|
|
7097
|
+
identity: this.parent.identity.identity,
|
|
7076
7098
|
templateKey: templateKey
|
|
7077
7099
|
});
|
|
7078
7100
|
const secretKey = await core_1.CoreCrypto.generateSecretKey();
|
|
@@ -7096,7 +7118,7 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
|
|
|
7096
7118
|
createdBy: this.parent.identity.address,
|
|
7097
7119
|
createdByDevice: this.parent.activeDevice.id,
|
|
7098
7120
|
expiresAt: parameters.expiresAt,
|
|
7099
|
-
identity: this.parent.identity,
|
|
7121
|
+
identity: this.parent.identity.identity,
|
|
7100
7122
|
maxNumberOfRelationships: (_a = parameters.maxNumberOfRelationships) !== null && _a !== void 0 ? _a : undefined,
|
|
7101
7123
|
templateKey: templateKey
|
|
7102
7124
|
});
|
|
@@ -9697,7 +9719,7 @@ exports.DatawalletModificationMapper = void 0;
|
|
|
9697
9719
|
const core_1 = __webpack_require__(/*! ../../core */ "./dist/core/index.js");
|
|
9698
9720
|
const DatawalletModification_1 = __webpack_require__(/*! ./local/DatawalletModification */ "./dist/modules/sync/local/DatawalletModification.js");
|
|
9699
9721
|
class DatawalletModificationMapper {
|
|
9700
|
-
static async fromBackboneDatawalletModification(backboneDatawalletModification, decryptedPayload) {
|
|
9722
|
+
static async fromBackboneDatawalletModification(backboneDatawalletModification, decryptedPayload, datawalletVersion) {
|
|
9701
9723
|
let type;
|
|
9702
9724
|
switch (backboneDatawalletModification.type) {
|
|
9703
9725
|
case "Create":
|
|
@@ -9738,16 +9760,19 @@ class DatawalletModificationMapper {
|
|
|
9738
9760
|
payloadCategory: payloadCategory,
|
|
9739
9761
|
collection: backboneDatawalletModification.collection,
|
|
9740
9762
|
type: type,
|
|
9741
|
-
payload: decryptedPayload
|
|
9763
|
+
payload: decryptedPayload,
|
|
9764
|
+
datawalletVersion: datawalletVersion
|
|
9742
9765
|
});
|
|
9743
9766
|
}
|
|
9744
9767
|
static toCreateDatawalletModificationsRequestItem(datawalletModification, encryptedPayload) {
|
|
9768
|
+
var _a;
|
|
9745
9769
|
return {
|
|
9746
9770
|
objectIdentifier: datawalletModification.objectIdentifier.toString(),
|
|
9747
9771
|
payloadCategory: datawalletModification.payloadCategory,
|
|
9748
9772
|
collection: datawalletModification.collection,
|
|
9749
9773
|
type: datawalletModification.type,
|
|
9750
|
-
encryptedPayload: encryptedPayload
|
|
9774
|
+
encryptedPayload: encryptedPayload,
|
|
9775
|
+
datawalletVersion: (_a = datawalletModification.datawalletVersion) !== null && _a !== void 0 ? _a : 0
|
|
9751
9776
|
};
|
|
9752
9777
|
}
|
|
9753
9778
|
}
|
|
@@ -9779,46 +9804,67 @@ const RelationshipTemplate_1 = __webpack_require__(/*! ../relationshipTemplates/
|
|
|
9779
9804
|
const Token_1 = __webpack_require__(/*! ../tokens/local/Token */ "./dist/modules/tokens/local/Token.js");
|
|
9780
9805
|
const DatawalletModification_1 = __webpack_require__(/*! ./local/DatawalletModification */ "./dist/modules/sync/local/DatawalletModification.js");
|
|
9781
9806
|
class DatawalletModificationsProcessor {
|
|
9782
|
-
constructor(cacheFetcher, collectionProvider,
|
|
9807
|
+
constructor(modifications, cacheFetcher, collectionProvider, logger) {
|
|
9808
|
+
var _a, _b, _c, _d;
|
|
9783
9809
|
this.cacheFetcher = cacheFetcher;
|
|
9784
9810
|
this.collectionProvider = collectionProvider;
|
|
9785
|
-
this.modifications = modifications;
|
|
9786
9811
|
this.logger = logger;
|
|
9812
|
+
this.collectionsWithCacheableItems = [
|
|
9813
|
+
DbCollectionName_1.DbCollectionName.Files,
|
|
9814
|
+
DbCollectionName_1.DbCollectionName.Messages,
|
|
9815
|
+
DbCollectionName_1.DbCollectionName.Relationships,
|
|
9816
|
+
DbCollectionName_1.DbCollectionName.RelationshipTemplates,
|
|
9817
|
+
DbCollectionName_1.DbCollectionName.Tokens
|
|
9818
|
+
];
|
|
9819
|
+
const modificationsGroupedByType = lodash_1.default.groupBy(modifications, (m) => m.type);
|
|
9820
|
+
this.creates = (_a = modificationsGroupedByType[DatawalletModification_1.DatawalletModificationType.Create]) !== null && _a !== void 0 ? _a : [];
|
|
9821
|
+
this.updates = (_b = modificationsGroupedByType[DatawalletModification_1.DatawalletModificationType.Update]) !== null && _b !== void 0 ? _b : [];
|
|
9822
|
+
this.deletes = (_c = modificationsGroupedByType[DatawalletModification_1.DatawalletModificationType.Delete]) !== null && _c !== void 0 ? _c : [];
|
|
9823
|
+
this.cacheChanges = (_d = modificationsGroupedByType[DatawalletModification_1.DatawalletModificationType.CacheChanged]) !== null && _d !== void 0 ? _d : [];
|
|
9787
9824
|
}
|
|
9788
9825
|
async execute() {
|
|
9789
|
-
|
|
9790
|
-
await this.
|
|
9791
|
-
await this.
|
|
9792
|
-
await this.applyDeletes(
|
|
9793
|
-
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
if (!creations || creations.length === 0) {
|
|
9826
|
+
await this.applyCreates();
|
|
9827
|
+
await this.applyUpdates();
|
|
9828
|
+
await this.applyCacheChanges();
|
|
9829
|
+
await this.applyDeletes();
|
|
9830
|
+
}
|
|
9831
|
+
async applyCreates() {
|
|
9832
|
+
if (this.creates.length === 0) {
|
|
9797
9833
|
return;
|
|
9798
9834
|
}
|
|
9799
|
-
const
|
|
9800
|
-
for (const objectIdentifier in
|
|
9801
|
-
const
|
|
9802
|
-
const
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9835
|
+
const createsGroupedByObjectIdentifier = lodash_1.default.groupBy(this.creates, (c) => c.objectIdentifier);
|
|
9836
|
+
for (const objectIdentifier in createsGroupedByObjectIdentifier) {
|
|
9837
|
+
const currentCreates = createsGroupedByObjectIdentifier[objectIdentifier];
|
|
9838
|
+
const targetCollectionName = currentCreates[0].collection;
|
|
9839
|
+
const targetCollection = await this.collectionProvider.getCollection(targetCollectionName);
|
|
9840
|
+
let mergedPayload = { id: objectIdentifier };
|
|
9841
|
+
for (const create of currentCreates) {
|
|
9842
|
+
mergedPayload = { ...mergedPayload, ...create.payload };
|
|
9806
9843
|
}
|
|
9807
|
-
const newObject = await core_1.CoreSerializableAsync.fromUnknown(
|
|
9844
|
+
const newObject = await core_1.CoreSerializableAsync.fromUnknown(mergedPayload);
|
|
9808
9845
|
const oldDoc = await targetCollection.read(objectIdentifier);
|
|
9809
9846
|
if (oldDoc) {
|
|
9810
9847
|
const oldObject = await core_1.CoreSerializableAsync.fromUnknown(oldDoc);
|
|
9811
9848
|
const updatedObject = { ...oldObject.toJSON(), ...newObject.toJSON() };
|
|
9812
9849
|
await targetCollection.update(oldDoc, updatedObject);
|
|
9813
9850
|
}
|
|
9851
|
+
if (this.collectionsWithCacheableItems.includes(targetCollectionName)) {
|
|
9852
|
+
const modification = DatawalletModification_1.DatawalletModification.from({
|
|
9853
|
+
localId: await core_1.TransportIds.datawalletModification.generate(),
|
|
9854
|
+
type: DatawalletModification_1.DatawalletModificationType.CacheChanged,
|
|
9855
|
+
collection: targetCollectionName,
|
|
9856
|
+
objectIdentifier: core_1.CoreId.from(objectIdentifier)
|
|
9857
|
+
});
|
|
9858
|
+
this.cacheChanges.push(modification);
|
|
9859
|
+
}
|
|
9814
9860
|
await targetCollection.create(newObject);
|
|
9815
9861
|
}
|
|
9816
9862
|
}
|
|
9817
|
-
async applyUpdates(
|
|
9818
|
-
if (
|
|
9863
|
+
async applyUpdates() {
|
|
9864
|
+
if (this.updates.length === 0) {
|
|
9819
9865
|
return;
|
|
9820
9866
|
}
|
|
9821
|
-
for (const updateModification of
|
|
9867
|
+
for (const updateModification of this.updates) {
|
|
9822
9868
|
const targetCollection = await this.collectionProvider.getCollection(updateModification.collection);
|
|
9823
9869
|
const oldDoc = await targetCollection.read(updateModification.objectIdentifier.toString());
|
|
9824
9870
|
if (!oldDoc) {
|
|
@@ -9829,20 +9875,12 @@ class DatawalletModificationsProcessor {
|
|
|
9829
9875
|
await targetCollection.update(oldDoc, newObject);
|
|
9830
9876
|
}
|
|
9831
9877
|
}
|
|
9832
|
-
async
|
|
9833
|
-
if (
|
|
9834
|
-
return;
|
|
9835
|
-
}
|
|
9836
|
-
for (const deleteModification of deleteModifications) {
|
|
9837
|
-
const targetCollection = await this.collectionProvider.getCollection(deleteModification.collection);
|
|
9838
|
-
await targetCollection.delete({ id: deleteModification.objectIdentifier });
|
|
9839
|
-
}
|
|
9840
|
-
}
|
|
9841
|
-
async applyCacheChanges(cacheChanges) {
|
|
9842
|
-
if (!cacheChanges || cacheChanges.length === 0) {
|
|
9878
|
+
async applyCacheChanges() {
|
|
9879
|
+
if (this.cacheChanges.length === 0) {
|
|
9843
9880
|
return;
|
|
9844
9881
|
}
|
|
9845
|
-
|
|
9882
|
+
this.ensureAllItemsAreCacheable();
|
|
9883
|
+
const cacheChangesGroupedByCollection = this.groupCacheChangesByCollection(this.cacheChanges);
|
|
9846
9884
|
const caches = await this.cacheFetcher.fetchCacheFor({
|
|
9847
9885
|
files: cacheChangesGroupedByCollection.fileIds,
|
|
9848
9886
|
messages: cacheChangesGroupedByCollection.messageIds,
|
|
@@ -9861,26 +9899,25 @@ class DatawalletModificationsProcessor {
|
|
|
9861
9899
|
});
|
|
9862
9900
|
await this.saveNewCaches(relationshipCaches.relationships, DbCollectionName_1.DbCollectionName.Relationships, Relationship_1.Relationship);
|
|
9863
9901
|
}
|
|
9902
|
+
ensureAllItemsAreCacheable() {
|
|
9903
|
+
const collections = this.cacheChanges.map((c) => c.collection);
|
|
9904
|
+
const uniqueCollections = [...new Set(collections)];
|
|
9905
|
+
const collectionsWithUncacheableItems = uniqueCollections.filter((c) => !this.collectionsWithCacheableItems.includes(c));
|
|
9906
|
+
if (collectionsWithUncacheableItems.length > 0) {
|
|
9907
|
+
throw core_1.TransportErrors.datawallet
|
|
9908
|
+
.unsupportedModification("unsupportedCacheChangedModificationCollection", collectionsWithUncacheableItems)
|
|
9909
|
+
.logWith(this.logger);
|
|
9910
|
+
}
|
|
9911
|
+
}
|
|
9864
9912
|
groupCacheChangesByCollection(cacheChanges) {
|
|
9865
9913
|
var _a, _b, _c, _d, _e;
|
|
9866
9914
|
const groups = lodash_1.default.groupBy(cacheChanges, (c) => c.collection);
|
|
9867
9915
|
const fileIds = ((_a = groups[DbCollectionName_1.DbCollectionName.Files]) !== null && _a !== void 0 ? _a : []).map((m) => m.objectIdentifier);
|
|
9868
|
-
delete groups[DbCollectionName_1.DbCollectionName.Files];
|
|
9869
9916
|
const messageIds = ((_b = groups[DbCollectionName_1.DbCollectionName.Messages]) !== null && _b !== void 0 ? _b : []).map((m) => m.objectIdentifier);
|
|
9870
|
-
delete groups[DbCollectionName_1.DbCollectionName.Messages];
|
|
9871
9917
|
const relationshipIds = ((_c = groups[DbCollectionName_1.DbCollectionName.Relationships]) !== null && _c !== void 0 ? _c : []).map((m) => m.objectIdentifier);
|
|
9872
|
-
|
|
9873
|
-
const relationshipTemplateIds = ((_d = groups[DbCollectionName_1.DbCollectionName.RelationshipTemplates]) !== null && _d !== void 0 ? _d : []).map((m) => m.objectIdentifier);
|
|
9874
|
-
delete groups[DbCollectionName_1.DbCollectionName.RelationshipTemplates];
|
|
9918
|
+
const templateIds = ((_d = groups[DbCollectionName_1.DbCollectionName.RelationshipTemplates]) !== null && _d !== void 0 ? _d : []).map((m) => m.objectIdentifier);
|
|
9875
9919
|
const tokenIds = ((_e = groups[DbCollectionName_1.DbCollectionName.Tokens]) !== null && _e !== void 0 ? _e : []).map((m) => m.objectIdentifier);
|
|
9876
|
-
|
|
9877
|
-
const unsupportedCollections = Object.keys(groups); // all collections not deleted before are considered as unsupported
|
|
9878
|
-
if (unsupportedCollections.length > 0) {
|
|
9879
|
-
throw core_1.TransportErrors.datawallet
|
|
9880
|
-
.unsupportedModification("unsupportedCacheChangedModificationCollection", unsupportedCollections)
|
|
9881
|
-
.logWith(this.logger);
|
|
9882
|
-
}
|
|
9883
|
-
return { fileIds, messageIds, relationshipTemplateIds, tokenIds, relationshipIds };
|
|
9920
|
+
return { fileIds, messageIds, relationshipTemplateIds: templateIds, tokenIds, relationshipIds };
|
|
9884
9921
|
}
|
|
9885
9922
|
async saveNewCaches(caches, collectionName, constructorOfT) {
|
|
9886
9923
|
const collection = await this.collectionProvider.getCollection(collectionName);
|
|
@@ -9891,6 +9928,15 @@ class DatawalletModificationsProcessor {
|
|
|
9891
9928
|
await collection.update(itemDoc, item);
|
|
9892
9929
|
}));
|
|
9893
9930
|
}
|
|
9931
|
+
async applyDeletes() {
|
|
9932
|
+
if (this.deletes.length === 0) {
|
|
9933
|
+
return;
|
|
9934
|
+
}
|
|
9935
|
+
for (const deleteModification of this.deletes) {
|
|
9936
|
+
const targetCollection = await this.collectionProvider.getCollection(deleteModification.collection);
|
|
9937
|
+
await targetCollection.delete({ id: deleteModification.objectIdentifier });
|
|
9938
|
+
}
|
|
9939
|
+
}
|
|
9894
9940
|
}
|
|
9895
9941
|
exports.DatawalletModificationsProcessor = DatawalletModificationsProcessor;
|
|
9896
9942
|
class CacheFetcher {
|
|
@@ -10041,15 +10087,26 @@ const DatawalletModificationMapper_1 = __webpack_require__(/*! ./DatawalletModif
|
|
|
10041
10087
|
const DatawalletModificationsProcessor_1 = __webpack_require__(/*! ./DatawalletModificationsProcessor */ "./dist/modules/sync/DatawalletModificationsProcessor.js");
|
|
10042
10088
|
const ExternalEventsProcessor_1 = __webpack_require__(/*! ./ExternalEventsProcessor */ "./dist/modules/sync/ExternalEventsProcessor.js");
|
|
10043
10089
|
const DatawalletModification_1 = __webpack_require__(/*! ./local/DatawalletModification */ "./dist/modules/sync/local/DatawalletModification.js");
|
|
10090
|
+
const DeviceMigrations_1 = __webpack_require__(/*! ./migrations/DeviceMigrations */ "./dist/modules/sync/migrations/DeviceMigrations.js");
|
|
10091
|
+
const IdentityMigrations_1 = __webpack_require__(/*! ./migrations/IdentityMigrations */ "./dist/modules/sync/migrations/IdentityMigrations.js");
|
|
10044
10092
|
class SyncController extends core_1.TransportController {
|
|
10045
|
-
constructor(parent, unpushedDatawalletModifications, datawalletEnabled) {
|
|
10093
|
+
constructor(parent, dependencyOverrides, unpushedDatawalletModifications, datawalletEnabled) {
|
|
10094
|
+
var _a;
|
|
10046
10095
|
super(core_1.ControllerName.Sync, parent);
|
|
10047
10096
|
this.unpushedDatawalletModifications = unpushedDatawalletModifications;
|
|
10048
10097
|
this.datawalletEnabled = datawalletEnabled;
|
|
10098
|
+
this.client = (_a = dependencyOverrides.syncClient) !== null && _a !== void 0 ? _a : new SyncClient_1.SyncClient(this.config, this.parent.authenticator);
|
|
10099
|
+
this.identityMigrations = new IdentityMigrations_1.IdentityMigrations(this.parent);
|
|
10100
|
+
this.deviceMigrations = new DeviceMigrations_1.DeviceMigrations(this.parent);
|
|
10101
|
+
}
|
|
10102
|
+
get cacheFetcher() {
|
|
10103
|
+
if (!this._cacheFetcher) {
|
|
10104
|
+
this._cacheFetcher = new DatawalletModificationsProcessor_1.CacheFetcher(this.parent.files, this.parent.messages, this.parent.relationshipTemplates, this.parent.relationships, this.parent.tokens);
|
|
10105
|
+
}
|
|
10106
|
+
return this._cacheFetcher;
|
|
10049
10107
|
}
|
|
10050
10108
|
async init() {
|
|
10051
10109
|
await super.init();
|
|
10052
|
-
this.client = new SyncClient_1.SyncClient(this.config, this.parent.authenticator);
|
|
10053
10110
|
this.syncInfo = await this.db.getMap("SyncInfo");
|
|
10054
10111
|
return this;
|
|
10055
10112
|
}
|
|
@@ -10078,33 +10135,120 @@ class SyncController extends core_1.TransportController {
|
|
|
10078
10135
|
if (whatToSync === "OnlyDatawallet") {
|
|
10079
10136
|
return await this.syncDatawallet();
|
|
10080
10137
|
}
|
|
10081
|
-
const
|
|
10082
|
-
if (!syncRunWasStarted) {
|
|
10083
|
-
await this.syncDatawallet();
|
|
10084
|
-
await this.setLastCompletedSyncTime();
|
|
10085
|
-
return new ChangedItems_1.ChangedItems();
|
|
10086
|
-
}
|
|
10087
|
-
await this.applyIncomingDatawalletModifications();
|
|
10088
|
-
const result = await this.applyIncomingExternalEvents();
|
|
10089
|
-
await this.finalizeSyncRun(result.results);
|
|
10138
|
+
const externalEventSyncResult = await this.syncExternalEvents();
|
|
10090
10139
|
await this.setLastCompletedSyncTime();
|
|
10091
|
-
if (
|
|
10092
|
-
throw new core_1.CoreError("error.transport.errorWhileApplyingExternalEvents",
|
|
10140
|
+
if (externalEventSyncResult.externalEventResults.some((r) => r.errorCode !== undefined)) {
|
|
10141
|
+
throw new core_1.CoreError("error.transport.errorWhileApplyingExternalEvents", externalEventSyncResult.externalEventResults
|
|
10093
10142
|
.filter((r) => r.errorCode !== undefined)
|
|
10094
10143
|
.map((r) => r.errorCode)
|
|
10095
10144
|
.join(" | ")).logWith(this.log);
|
|
10096
10145
|
}
|
|
10097
|
-
return
|
|
10146
|
+
return externalEventSyncResult.changedItems;
|
|
10147
|
+
}
|
|
10148
|
+
async syncExternalEvents() {
|
|
10149
|
+
const syncRunWasStarted = await this.startExternalEventsSyncRun();
|
|
10150
|
+
if (!syncRunWasStarted) {
|
|
10151
|
+
await this.syncDatawallet();
|
|
10152
|
+
return {
|
|
10153
|
+
changedItems: new ChangedItems_1.ChangedItems(),
|
|
10154
|
+
externalEventResults: []
|
|
10155
|
+
};
|
|
10156
|
+
}
|
|
10157
|
+
await this.applyIncomingDatawalletModifications();
|
|
10158
|
+
const result = await this.applyIncomingExternalEvents();
|
|
10159
|
+
await this.finalizeExternalEventsSyncRun(result.externalEventResults);
|
|
10160
|
+
return result;
|
|
10098
10161
|
}
|
|
10099
10162
|
async syncDatawallet() {
|
|
10100
10163
|
if (!this.datawalletEnabled) {
|
|
10101
10164
|
return;
|
|
10102
10165
|
}
|
|
10166
|
+
const identityDatawalletVersion = await this.getIdentityDatawalletVersion();
|
|
10167
|
+
if (this.config.supportedDatawalletVersion < identityDatawalletVersion) {
|
|
10168
|
+
// This means that the datawallet of the identity was upgraded by another device with a higher version.
|
|
10169
|
+
// It is necesssary to update the current device.
|
|
10170
|
+
throw core_1.TransportErrors.datawallet
|
|
10171
|
+
.insufficientSupportedDatawalletVersion(this.config.supportedDatawalletVersion, identityDatawalletVersion)
|
|
10172
|
+
.logWith(this.log);
|
|
10173
|
+
}
|
|
10103
10174
|
this.log.trace("Synchronization of Datawallet events started...");
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10175
|
+
try {
|
|
10176
|
+
await this.applyIncomingDatawalletModifications();
|
|
10177
|
+
await this.pushLocalDatawalletModifications();
|
|
10178
|
+
await this.setLastCompletedDatawalletSyncTime();
|
|
10179
|
+
}
|
|
10180
|
+
catch (e) {
|
|
10181
|
+
const outdatedErrorCode = "error.platform.validation.datawallet.insufficientSupportedDatawalletVersion";
|
|
10182
|
+
if (!(e instanceof core_1.RequestError) || e.code !== outdatedErrorCode)
|
|
10183
|
+
throw e;
|
|
10184
|
+
throw core_1.TransportErrors.datawallet
|
|
10185
|
+
.insufficientSupportedDatawalletVersion(this.config.supportedDatawalletVersion, identityDatawalletVersion)
|
|
10186
|
+
.logWith(this.log);
|
|
10187
|
+
}
|
|
10107
10188
|
this.log.trace("Synchronization of Datawallet events ended...");
|
|
10189
|
+
await this.checkDatawalletVersion(identityDatawalletVersion);
|
|
10190
|
+
}
|
|
10191
|
+
async checkDatawalletVersion(identityDatawalletVersion) {
|
|
10192
|
+
var _a;
|
|
10193
|
+
if (this.config.supportedDatawalletVersion < identityDatawalletVersion) {
|
|
10194
|
+
throw core_1.TransportErrors.datawallet
|
|
10195
|
+
.insufficientSupportedDatawalletVersion(this.config.supportedDatawalletVersion, identityDatawalletVersion)
|
|
10196
|
+
.logWith(this.log);
|
|
10197
|
+
}
|
|
10198
|
+
if (this.config.supportedDatawalletVersion > identityDatawalletVersion) {
|
|
10199
|
+
await this.upgradeIdentityDatawalletVersion(identityDatawalletVersion, this.config.supportedDatawalletVersion);
|
|
10200
|
+
}
|
|
10201
|
+
const deviceDatawalletVersion = (_a = this.parent.activeDevice.device.datawalletVersion) !== null && _a !== void 0 ? _a : 0;
|
|
10202
|
+
if (deviceDatawalletVersion < identityDatawalletVersion) {
|
|
10203
|
+
await this.upgradeDeviceDatawalletVersion(deviceDatawalletVersion, this.config.supportedDatawalletVersion);
|
|
10204
|
+
}
|
|
10205
|
+
}
|
|
10206
|
+
async upgradeIdentityDatawalletVersion(identityDatawalletVersion, targetDatawalletVersion) {
|
|
10207
|
+
if (identityDatawalletVersion === targetDatawalletVersion)
|
|
10208
|
+
return;
|
|
10209
|
+
if (this.config.supportedDatawalletVersion < targetDatawalletVersion) {
|
|
10210
|
+
throw core_1.TransportErrors.datawallet
|
|
10211
|
+
.insufficientSupportedDatawalletVersion(targetDatawalletVersion, identityDatawalletVersion)
|
|
10212
|
+
.logWith(this.log);
|
|
10213
|
+
}
|
|
10214
|
+
if (identityDatawalletVersion > targetDatawalletVersion) {
|
|
10215
|
+
throw core_1.TransportErrors.datawallet
|
|
10216
|
+
.currentBiggerThanTarget(identityDatawalletVersion, targetDatawalletVersion)
|
|
10217
|
+
.logWith(this.log);
|
|
10218
|
+
}
|
|
10219
|
+
while (identityDatawalletVersion < targetDatawalletVersion) {
|
|
10220
|
+
identityDatawalletVersion++;
|
|
10221
|
+
await this.startDatawalletVersionUpgradeSyncRun();
|
|
10222
|
+
const migrationFunction = this.identityMigrations[`v${identityDatawalletVersion}`];
|
|
10223
|
+
if (!migrationFunction) {
|
|
10224
|
+
throw core_1.TransportErrors.datawallet.noMigrationAvailable(identityDatawalletVersion).logWith(this.log);
|
|
10225
|
+
}
|
|
10226
|
+
await migrationFunction.call(this.identityMigrations);
|
|
10227
|
+
await this.finalizeDatawalletVersionUpgradeSyncRun(identityDatawalletVersion);
|
|
10228
|
+
}
|
|
10229
|
+
}
|
|
10230
|
+
async upgradeDeviceDatawalletVersion(deviceDatawalletVersion, targetDatawalletVersion) {
|
|
10231
|
+
if (deviceDatawalletVersion === targetDatawalletVersion)
|
|
10232
|
+
return;
|
|
10233
|
+
if (this.config.supportedDatawalletVersion < targetDatawalletVersion) {
|
|
10234
|
+
throw core_1.TransportErrors.datawallet
|
|
10235
|
+
.insufficientSupportedDatawalletVersion(targetDatawalletVersion, deviceDatawalletVersion)
|
|
10236
|
+
.logWith(this.log);
|
|
10237
|
+
}
|
|
10238
|
+
if (deviceDatawalletVersion > targetDatawalletVersion) {
|
|
10239
|
+
throw core_1.TransportErrors.datawallet
|
|
10240
|
+
.currentBiggerThanTarget(deviceDatawalletVersion, targetDatawalletVersion)
|
|
10241
|
+
.logWith(this.log);
|
|
10242
|
+
}
|
|
10243
|
+
while (deviceDatawalletVersion < targetDatawalletVersion) {
|
|
10244
|
+
deviceDatawalletVersion++;
|
|
10245
|
+
const migrationFunction = this.deviceMigrations[`v${deviceDatawalletVersion}`];
|
|
10246
|
+
if (!migrationFunction) {
|
|
10247
|
+
throw core_1.TransportErrors.datawallet.noMigrationAvailable(deviceDatawalletVersion).logWith(this.log);
|
|
10248
|
+
}
|
|
10249
|
+
await migrationFunction.call(this.deviceMigrations);
|
|
10250
|
+
await this.parent.activeDevice.update({ datawalletVersion: deviceDatawalletVersion });
|
|
10251
|
+
}
|
|
10108
10252
|
}
|
|
10109
10253
|
async applyIncomingDatawalletModifications() {
|
|
10110
10254
|
const getDatawalletModificationsResult = await this.client.getDatawalletModifications({
|
|
@@ -10116,7 +10260,7 @@ class SyncController extends core_1.TransportController {
|
|
|
10116
10260
|
}
|
|
10117
10261
|
const incomingModifications = await this.decryptDatawalletModifications(encryptedIncomingModifications);
|
|
10118
10262
|
this.log.trace(`${incomingModifications.length} incoming modifications found`);
|
|
10119
|
-
const datawalletModificationsProcessor = new DatawalletModificationsProcessor_1.DatawalletModificationsProcessor(
|
|
10263
|
+
const datawalletModificationsProcessor = new DatawalletModificationsProcessor_1.DatawalletModificationsProcessor(incomingModifications, this.cacheFetcher, this._db, core_1.TransportLoggerFactory.getLogger(DatawalletModificationsProcessor_1.DatawalletModificationsProcessor));
|
|
10120
10264
|
await datawalletModificationsProcessor.execute();
|
|
10121
10265
|
this.log.trace(`${incomingModifications.length} incoming modifications executed`, incomingModifications);
|
|
10122
10266
|
await this.updateLocalDatawalletModificationIndex(encryptedIncomingModifications.sort(descending)[0].index);
|
|
@@ -10125,7 +10269,7 @@ class SyncController extends core_1.TransportController {
|
|
|
10125
10269
|
const decryptedModifications = [];
|
|
10126
10270
|
for (const encryptedModification of encryptedModifications) {
|
|
10127
10271
|
const decryptedPayload = await this.parent.activeDevice.secrets.decryptDatawalletModificationPayload(encryptedModification.encryptedPayload, encryptedModification.index);
|
|
10128
|
-
const decryptedModification = await DatawalletModificationMapper_1.DatawalletModificationMapper.fromBackboneDatawalletModification(encryptedModification, decryptedPayload);
|
|
10272
|
+
const decryptedModification = await DatawalletModificationMapper_1.DatawalletModificationMapper.fromBackboneDatawalletModification(encryptedModification, decryptedPayload, this.config.supportedDatawalletVersion);
|
|
10129
10273
|
decryptedModifications.push(decryptedModification);
|
|
10130
10274
|
}
|
|
10131
10275
|
return decryptedModifications;
|
|
@@ -10164,15 +10308,29 @@ class SyncController extends core_1.TransportController {
|
|
|
10164
10308
|
await this.unpushedDatawalletModifications.delete({ localId: localModificationId.toString() });
|
|
10165
10309
|
}
|
|
10166
10310
|
}
|
|
10167
|
-
async
|
|
10311
|
+
async setInititalDatawalletVersion(version) {
|
|
10312
|
+
await this.startDatawalletVersionUpgradeSyncRun();
|
|
10313
|
+
await this.finalizeDatawalletVersionUpgradeSyncRun(version);
|
|
10314
|
+
}
|
|
10315
|
+
async getIdentityDatawalletVersion() {
|
|
10316
|
+
const datawalletInfo = (await this.client.getDatawallet()).value;
|
|
10317
|
+
return datawalletInfo.version;
|
|
10318
|
+
}
|
|
10319
|
+
async startExternalEventsSyncRun() {
|
|
10168
10320
|
var _a;
|
|
10169
|
-
const result = await this.client.startSyncRun();
|
|
10321
|
+
const result = await this.client.startSyncRun({ type: StartSyncRun_1.SyncRunType.ExternalEventSync });
|
|
10170
10322
|
if (result.value.status === StartSyncRun_1.StartSyncRunStatus.NoNewEvents) {
|
|
10171
10323
|
return false;
|
|
10172
10324
|
}
|
|
10173
10325
|
this.currentSyncRun = (_a = result.value.syncRun) !== null && _a !== void 0 ? _a : undefined;
|
|
10174
10326
|
return this.currentSyncRun !== undefined;
|
|
10175
10327
|
}
|
|
10328
|
+
async startDatawalletVersionUpgradeSyncRun() {
|
|
10329
|
+
var _a;
|
|
10330
|
+
const result = await this.client.startSyncRun({ type: StartSyncRun_1.SyncRunType.DatawalletVersionUpgrade });
|
|
10331
|
+
this.currentSyncRun = (_a = result.value.syncRun) !== null && _a !== void 0 ? _a : undefined;
|
|
10332
|
+
return this.currentSyncRun !== undefined;
|
|
10333
|
+
}
|
|
10176
10334
|
async applyIncomingExternalEvents() {
|
|
10177
10335
|
const getExternalEventsResult = await this.client.getExternalEventsOfSyncRun(this.currentSyncRun.id.toString());
|
|
10178
10336
|
if (getExternalEventsResult.isError) {
|
|
@@ -10181,14 +10339,17 @@ class SyncController extends core_1.TransportController {
|
|
|
10181
10339
|
const externalEvents = await getExternalEventsResult.value.collect();
|
|
10182
10340
|
const externalEventProcessor = new ExternalEventsProcessor_1.ExternalEventsProcessor(this.parent.messages, this.parent.relationships, externalEvents);
|
|
10183
10341
|
await externalEventProcessor.execute();
|
|
10184
|
-
return {
|
|
10342
|
+
return {
|
|
10343
|
+
externalEventResults: externalEventProcessor.results,
|
|
10344
|
+
changedItems: externalEventProcessor.changedItems
|
|
10345
|
+
};
|
|
10185
10346
|
}
|
|
10186
|
-
async
|
|
10347
|
+
async finalizeExternalEventsSyncRun(externalEventResults) {
|
|
10187
10348
|
if (!this.currentSyncRun) {
|
|
10188
10349
|
throw new Error("There is no active sync run to finalize");
|
|
10189
10350
|
}
|
|
10190
10351
|
const { backboneModifications, localModificationIds } = await this.prepareLocalDatawalletModificationsForPush();
|
|
10191
|
-
await this.client.
|
|
10352
|
+
await this.client.finalizeExternalEventSync(this.currentSyncRun.id.toString(), {
|
|
10192
10353
|
datawalletModifications: backboneModifications,
|
|
10193
10354
|
externalEventResults: externalEventResults
|
|
10194
10355
|
});
|
|
@@ -10198,6 +10359,21 @@ class SyncController extends core_1.TransportController {
|
|
|
10198
10359
|
await this.updateLocalDatawalletModificationIndex(newDatawalletModificationIndex);
|
|
10199
10360
|
this.currentSyncRun = undefined;
|
|
10200
10361
|
}
|
|
10362
|
+
async finalizeDatawalletVersionUpgradeSyncRun(newDatawalletVersion) {
|
|
10363
|
+
if (!this.currentSyncRun) {
|
|
10364
|
+
throw new Error("There is no active sync run to finalize");
|
|
10365
|
+
}
|
|
10366
|
+
const { backboneModifications, localModificationIds } = await this.prepareLocalDatawalletModificationsForPush();
|
|
10367
|
+
await this.client.finalizeDatawalletVersionUpgrade(this.currentSyncRun.id.toString(), {
|
|
10368
|
+
newDatawalletVersion,
|
|
10369
|
+
datawalletModifications: backboneModifications
|
|
10370
|
+
});
|
|
10371
|
+
await this.deleteUnpushedDatawalletModifications(localModificationIds);
|
|
10372
|
+
const oldDatawalletModificationIndex = await this.getLocalDatawalletModificationIndex();
|
|
10373
|
+
const newDatawalletModificationIndex = (oldDatawalletModificationIndex || -1) + backboneModifications.length;
|
|
10374
|
+
await this.updateLocalDatawalletModificationIndex(newDatawalletModificationIndex);
|
|
10375
|
+
this.currentSyncRun = undefined;
|
|
10376
|
+
}
|
|
10201
10377
|
async getLocalDatawalletModificationIndex() {
|
|
10202
10378
|
const index = await this.syncInfo.get("localDatawalletModificationIndex");
|
|
10203
10379
|
return index;
|
|
@@ -10264,12 +10440,12 @@ const fast_json_patch_1 = __importDefault(__webpack_require__(/*! fast-json-patc
|
|
|
10264
10440
|
const lodash_1 = __importDefault(__webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"));
|
|
10265
10441
|
const ts_simple_nameof_1 = __webpack_require__(/*! ts-simple-nameof */ "./node_modules/ts-simple-nameof/index.js");
|
|
10266
10442
|
const CoreSerializableAsync_1 = __webpack_require__(/*! ../../core/CoreSerializableAsync */ "./dist/core/CoreSerializableAsync.js");
|
|
10267
|
-
const ICacheable_1 = __webpack_require__(/*! ../../core/ICacheable */ "./dist/core/ICacheable.js");
|
|
10268
10443
|
const TransportIds_1 = __webpack_require__(/*! ../../core/TransportIds */ "./dist/core/TransportIds.js");
|
|
10269
10444
|
const DatawalletModification_1 = __webpack_require__(/*! ../sync/local/DatawalletModification */ "./dist/modules/sync/local/DatawalletModification.js");
|
|
10270
10445
|
class SynchronizedCollection {
|
|
10271
|
-
constructor(parent, datawalletModifications) {
|
|
10446
|
+
constructor(parent, datawalletVersion, datawalletModifications) {
|
|
10272
10447
|
this.parent = parent;
|
|
10448
|
+
this.datawalletVersion = datawalletVersion;
|
|
10273
10449
|
this.datawalletModifications = datawalletModifications;
|
|
10274
10450
|
this.name = parent.name;
|
|
10275
10451
|
this.databaseType = parent.databaseType;
|
|
@@ -10290,7 +10466,8 @@ class SynchronizedCollection {
|
|
|
10290
10466
|
collection: this.name,
|
|
10291
10467
|
objectIdentifier: objectIdentifier,
|
|
10292
10468
|
payloadCategory: DatawalletModification_1.DatawalletModificationCategory.TechnicalData,
|
|
10293
|
-
payload: technicalModificationPayload
|
|
10469
|
+
payload: technicalModificationPayload,
|
|
10470
|
+
datawalletVersion: this.datawalletVersion
|
|
10294
10471
|
}));
|
|
10295
10472
|
}
|
|
10296
10473
|
if (Object.getOwnPropertyNames(metadataModificationPayload).length !== 0) {
|
|
@@ -10300,7 +10477,8 @@ class SynchronizedCollection {
|
|
|
10300
10477
|
collection: this.name,
|
|
10301
10478
|
objectIdentifier: objectIdentifier,
|
|
10302
10479
|
payloadCategory: DatawalletModification_1.DatawalletModificationCategory.Metadata,
|
|
10303
|
-
payload: metadataModificationPayload
|
|
10480
|
+
payload: metadataModificationPayload,
|
|
10481
|
+
datawalletVersion: this.datawalletVersion
|
|
10304
10482
|
}));
|
|
10305
10483
|
}
|
|
10306
10484
|
if (Object.getOwnPropertyNames(userdataModificationPayload).length !== 0) {
|
|
@@ -10310,15 +10488,8 @@ class SynchronizedCollection {
|
|
|
10310
10488
|
collection: this.name,
|
|
10311
10489
|
objectIdentifier: objectIdentifier,
|
|
10312
10490
|
payloadCategory: DatawalletModification_1.DatawalletModificationCategory.Userdata,
|
|
10313
|
-
payload: userdataModificationPayload
|
|
10314
|
-
|
|
10315
|
-
}
|
|
10316
|
-
if ((0, ICacheable_1.isCacheable)(newObject)) {
|
|
10317
|
-
await this.datawalletModifications.create(DatawalletModification_1.DatawalletModification.from({
|
|
10318
|
-
localId: await TransportIds_1.TransportIds.datawalletModification.generate(),
|
|
10319
|
-
type: DatawalletModification_1.DatawalletModificationType.CacheChanged,
|
|
10320
|
-
collection: this.name,
|
|
10321
|
-
objectIdentifier: objectIdentifier
|
|
10491
|
+
payload: userdataModificationPayload,
|
|
10492
|
+
datawalletVersion: this.datawalletVersion
|
|
10322
10493
|
}));
|
|
10323
10494
|
}
|
|
10324
10495
|
await this.parent.create(newObject);
|
|
@@ -10352,7 +10523,8 @@ class SynchronizedCollection {
|
|
|
10352
10523
|
collection: this.name,
|
|
10353
10524
|
objectIdentifier: objectIdentifier,
|
|
10354
10525
|
payloadCategory: DatawalletModification_1.DatawalletModificationCategory.TechnicalData,
|
|
10355
|
-
payload: payload
|
|
10526
|
+
payload: payload,
|
|
10527
|
+
datawalletVersion: this.datawalletVersion
|
|
10356
10528
|
}));
|
|
10357
10529
|
}
|
|
10358
10530
|
if (haveMetadataPropertiesChanged) {
|
|
@@ -10363,7 +10535,8 @@ class SynchronizedCollection {
|
|
|
10363
10535
|
collection: this.name,
|
|
10364
10536
|
objectIdentifier: objectIdentifier,
|
|
10365
10537
|
payloadCategory: DatawalletModification_1.DatawalletModificationCategory.Metadata,
|
|
10366
|
-
payload: payload
|
|
10538
|
+
payload: payload,
|
|
10539
|
+
datawalletVersion: this.datawalletVersion
|
|
10367
10540
|
}));
|
|
10368
10541
|
}
|
|
10369
10542
|
if (haveUserdataPropertiesChanged) {
|
|
@@ -10374,7 +10547,8 @@ class SynchronizedCollection {
|
|
|
10374
10547
|
collection: this.name,
|
|
10375
10548
|
objectIdentifier: objectIdentifier,
|
|
10376
10549
|
payloadCategory: DatawalletModification_1.DatawalletModificationCategory.Userdata,
|
|
10377
|
-
payload: payload
|
|
10550
|
+
payload: payload,
|
|
10551
|
+
datawalletVersion: this.datawalletVersion
|
|
10378
10552
|
}));
|
|
10379
10553
|
}
|
|
10380
10554
|
if (hasCacheChanged) {
|
|
@@ -10382,7 +10556,8 @@ class SynchronizedCollection {
|
|
|
10382
10556
|
localId: await TransportIds_1.TransportIds.datawalletModification.generate(),
|
|
10383
10557
|
type: DatawalletModification_1.DatawalletModificationType.CacheChanged,
|
|
10384
10558
|
collection: this.name,
|
|
10385
|
-
objectIdentifier: objectIdentifier
|
|
10559
|
+
objectIdentifier: objectIdentifier,
|
|
10560
|
+
datawalletVersion: this.datawalletVersion
|
|
10386
10561
|
}));
|
|
10387
10562
|
}
|
|
10388
10563
|
return await this.parent.update(oldDoc, newObject);
|
|
@@ -10395,7 +10570,8 @@ class SynchronizedCollection {
|
|
|
10395
10570
|
localId: await TransportIds_1.TransportIds.datawalletModification.generate(),
|
|
10396
10571
|
type: DatawalletModification_1.DatawalletModificationType.Delete,
|
|
10397
10572
|
collection: this.name,
|
|
10398
|
-
objectIdentifier: object.id
|
|
10573
|
+
objectIdentifier: object.id,
|
|
10574
|
+
datawalletVersion: this.datawalletVersion
|
|
10399
10575
|
}));
|
|
10400
10576
|
return await this.parent.delete({ id: object.id.toString() });
|
|
10401
10577
|
}
|
|
@@ -10420,6 +10596,84 @@ exports.SynchronizedCollection = SynchronizedCollection;
|
|
|
10420
10596
|
|
|
10421
10597
|
/***/ }),
|
|
10422
10598
|
|
|
10599
|
+
/***/ "./dist/modules/sync/backbone/BackboneDatawalletModification.js":
|
|
10600
|
+
/*!**********************************************************************!*\
|
|
10601
|
+
!*** ./dist/modules/sync/backbone/BackboneDatawalletModification.js ***!
|
|
10602
|
+
\**********************************************************************/
|
|
10603
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
10604
|
+
|
|
10605
|
+
"use strict";
|
|
10606
|
+
|
|
10607
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10608
|
+
//# sourceMappingURL=BackboneDatawalletModification.js.map
|
|
10609
|
+
|
|
10610
|
+
/***/ }),
|
|
10611
|
+
|
|
10612
|
+
/***/ "./dist/modules/sync/backbone/BackboneExternalEvent.js":
|
|
10613
|
+
/*!*************************************************************!*\
|
|
10614
|
+
!*** ./dist/modules/sync/backbone/BackboneExternalEvent.js ***!
|
|
10615
|
+
\*************************************************************/
|
|
10616
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
10617
|
+
|
|
10618
|
+
"use strict";
|
|
10619
|
+
|
|
10620
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10621
|
+
//# sourceMappingURL=BackboneExternalEvent.js.map
|
|
10622
|
+
|
|
10623
|
+
/***/ }),
|
|
10624
|
+
|
|
10625
|
+
/***/ "./dist/modules/sync/backbone/CreateDatawalletModifications.js":
|
|
10626
|
+
/*!*********************************************************************!*\
|
|
10627
|
+
!*** ./dist/modules/sync/backbone/CreateDatawalletModifications.js ***!
|
|
10628
|
+
\*********************************************************************/
|
|
10629
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
10630
|
+
|
|
10631
|
+
"use strict";
|
|
10632
|
+
|
|
10633
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10634
|
+
//# sourceMappingURL=CreateDatawalletModifications.js.map
|
|
10635
|
+
|
|
10636
|
+
/***/ }),
|
|
10637
|
+
|
|
10638
|
+
/***/ "./dist/modules/sync/backbone/FinalizeSyncRun.js":
|
|
10639
|
+
/*!*******************************************************!*\
|
|
10640
|
+
!*** ./dist/modules/sync/backbone/FinalizeSyncRun.js ***!
|
|
10641
|
+
\*******************************************************/
|
|
10642
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
10643
|
+
|
|
10644
|
+
"use strict";
|
|
10645
|
+
|
|
10646
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10647
|
+
//# sourceMappingURL=FinalizeSyncRun.js.map
|
|
10648
|
+
|
|
10649
|
+
/***/ }),
|
|
10650
|
+
|
|
10651
|
+
/***/ "./dist/modules/sync/backbone/GetDatawallet.js":
|
|
10652
|
+
/*!*****************************************************!*\
|
|
10653
|
+
!*** ./dist/modules/sync/backbone/GetDatawallet.js ***!
|
|
10654
|
+
\*****************************************************/
|
|
10655
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
10656
|
+
|
|
10657
|
+
"use strict";
|
|
10658
|
+
|
|
10659
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10660
|
+
//# sourceMappingURL=GetDatawallet.js.map
|
|
10661
|
+
|
|
10662
|
+
/***/ }),
|
|
10663
|
+
|
|
10664
|
+
/***/ "./dist/modules/sync/backbone/GetDatawalletModifications.js":
|
|
10665
|
+
/*!******************************************************************!*\
|
|
10666
|
+
!*** ./dist/modules/sync/backbone/GetDatawalletModifications.js ***!
|
|
10667
|
+
\******************************************************************/
|
|
10668
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
10669
|
+
|
|
10670
|
+
"use strict";
|
|
10671
|
+
|
|
10672
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10673
|
+
//# sourceMappingURL=GetDatawalletModifications.js.map
|
|
10674
|
+
|
|
10675
|
+
/***/ }),
|
|
10676
|
+
|
|
10423
10677
|
/***/ "./dist/modules/sync/backbone/StartSyncRun.js":
|
|
10424
10678
|
/*!****************************************************!*\
|
|
10425
10679
|
!*** ./dist/modules/sync/backbone/StartSyncRun.js ***!
|
|
@@ -10429,7 +10683,12 @@ exports.SynchronizedCollection = SynchronizedCollection;
|
|
|
10429
10683
|
"use strict";
|
|
10430
10684
|
|
|
10431
10685
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10432
|
-
exports.StartSyncRunStatus = void 0;
|
|
10686
|
+
exports.StartSyncRunStatus = exports.SyncRunType = void 0;
|
|
10687
|
+
var SyncRunType;
|
|
10688
|
+
(function (SyncRunType) {
|
|
10689
|
+
SyncRunType["ExternalEventSync"] = "ExternalEventSync";
|
|
10690
|
+
SyncRunType["DatawalletVersionUpgrade"] = "DatawalletVersionUpgrade";
|
|
10691
|
+
})(SyncRunType = exports.SyncRunType || (exports.SyncRunType = {}));
|
|
10433
10692
|
var StartSyncRunStatus;
|
|
10434
10693
|
(function (StartSyncRunStatus) {
|
|
10435
10694
|
StartSyncRunStatus["Created"] = "Created";
|
|
@@ -10451,20 +10710,33 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
10451
10710
|
exports.SyncClient = void 0;
|
|
10452
10711
|
const core_1 = __webpack_require__(/*! ../../../core */ "./dist/core/index.js");
|
|
10453
10712
|
class SyncClient extends core_1.RESTClientAuthenticate {
|
|
10454
|
-
|
|
10455
|
-
|
|
10713
|
+
constructor(config, authenticator) {
|
|
10714
|
+
super(config, authenticator, {
|
|
10715
|
+
headers: {
|
|
10716
|
+
"x-supported-datawallet-version": config.supportedDatawalletVersion.toString()
|
|
10717
|
+
}
|
|
10718
|
+
});
|
|
10719
|
+
}
|
|
10720
|
+
async startSyncRun(request) {
|
|
10721
|
+
return await this.post("/api/v1/SyncRuns", request);
|
|
10456
10722
|
}
|
|
10457
|
-
async
|
|
10458
|
-
return await this.put(`/api/v1/SyncRuns/${id}/
|
|
10723
|
+
async finalizeExternalEventSync(id, request) {
|
|
10724
|
+
return await this.put(`/api/v1/SyncRuns/${id}/FinalizeExternalEventSync`, request);
|
|
10725
|
+
}
|
|
10726
|
+
async finalizeDatawalletVersionUpgrade(id, request) {
|
|
10727
|
+
return await this.put(`/api/v1/SyncRuns/${id}/FinalizeDatawalletVersionUpgrade`, request);
|
|
10459
10728
|
}
|
|
10460
10729
|
async getExternalEventsOfSyncRun(syncRunId) {
|
|
10461
10730
|
return await this.getPaged(`/api/v1/SyncRuns/${syncRunId}/ExternalEvents`, {});
|
|
10462
10731
|
}
|
|
10732
|
+
async getDatawallet() {
|
|
10733
|
+
return await this.get("/api/v1/Datawallet");
|
|
10734
|
+
}
|
|
10463
10735
|
async getDatawalletModifications(request) {
|
|
10464
|
-
return await this.getPaged("/api/v1/
|
|
10736
|
+
return await this.getPaged("/api/v1/Datawallet/Modifications", request);
|
|
10465
10737
|
}
|
|
10466
10738
|
async createDatawalletModifications(request) {
|
|
10467
|
-
return await this.post("/api/v1/
|
|
10739
|
+
return await this.post("/api/v1/Datawallet/Modifications", request);
|
|
10468
10740
|
}
|
|
10469
10741
|
}
|
|
10470
10742
|
exports.SyncClient = SyncClient;
|
|
@@ -10545,6 +10817,11 @@ __decorate([
|
|
|
10545
10817
|
(0, ts_serval_1.serialize)(),
|
|
10546
10818
|
__metadata("design:type", Object)
|
|
10547
10819
|
], DatawalletModification.prototype, "payload", void 0);
|
|
10820
|
+
__decorate([
|
|
10821
|
+
(0, ts_serval_1.validate)({ nullable: true }),
|
|
10822
|
+
(0, ts_serval_1.serialize)(),
|
|
10823
|
+
__metadata("design:type", Number)
|
|
10824
|
+
], DatawalletModification.prototype, "datawalletVersion", void 0);
|
|
10548
10825
|
DatawalletModification = DatawalletModification_1 = __decorate([
|
|
10549
10826
|
(0, ts_serval_1.type)("DatawalletModification")
|
|
10550
10827
|
], DatawalletModification);
|
|
@@ -10553,6 +10830,64 @@ exports.DatawalletModification = DatawalletModification;
|
|
|
10553
10830
|
|
|
10554
10831
|
/***/ }),
|
|
10555
10832
|
|
|
10833
|
+
/***/ "./dist/modules/sync/migrations/DeviceMigrations.js":
|
|
10834
|
+
/*!**********************************************************!*\
|
|
10835
|
+
!*** ./dist/modules/sync/migrations/DeviceMigrations.js ***!
|
|
10836
|
+
\**********************************************************/
|
|
10837
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
10838
|
+
|
|
10839
|
+
"use strict";
|
|
10840
|
+
|
|
10841
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10842
|
+
exports.DeviceMigrations = void 0;
|
|
10843
|
+
class DeviceMigrations {
|
|
10844
|
+
constructor(accountController) {
|
|
10845
|
+
this.accountController = accountController;
|
|
10846
|
+
}
|
|
10847
|
+
async v1() {
|
|
10848
|
+
const query = { cache: { $exists: false } };
|
|
10849
|
+
const synchronizableToId = (c) => c.id.toString();
|
|
10850
|
+
const files = await this.accountController.files.getFiles(query);
|
|
10851
|
+
await this.accountController.files.updateCache(files.map(synchronizableToId));
|
|
10852
|
+
const messages = await this.accountController.messages.getMessages(query);
|
|
10853
|
+
await this.accountController.messages.updateCache(messages.map(synchronizableToId));
|
|
10854
|
+
const relationships = await this.accountController.relationships.getRelationships(query);
|
|
10855
|
+
await this.accountController.relationships.updateCache(relationships.map(synchronizableToId));
|
|
10856
|
+
const templates = await this.accountController.relationshipTemplates.getRelationshipTemplates(query);
|
|
10857
|
+
await this.accountController.relationshipTemplates.updateCache(templates.map(synchronizableToId));
|
|
10858
|
+
const tokens = await this.accountController.tokens.getTokens(query);
|
|
10859
|
+
await this.accountController.tokens.updateCache(tokens.map(synchronizableToId));
|
|
10860
|
+
}
|
|
10861
|
+
}
|
|
10862
|
+
exports.DeviceMigrations = DeviceMigrations;
|
|
10863
|
+
//# sourceMappingURL=DeviceMigrations.js.map
|
|
10864
|
+
|
|
10865
|
+
/***/ }),
|
|
10866
|
+
|
|
10867
|
+
/***/ "./dist/modules/sync/migrations/IdentityMigrations.js":
|
|
10868
|
+
/*!************************************************************!*\
|
|
10869
|
+
!*** ./dist/modules/sync/migrations/IdentityMigrations.js ***!
|
|
10870
|
+
\************************************************************/
|
|
10871
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
10872
|
+
|
|
10873
|
+
"use strict";
|
|
10874
|
+
|
|
10875
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10876
|
+
exports.IdentityMigrations = void 0;
|
|
10877
|
+
class IdentityMigrations {
|
|
10878
|
+
constructor(accountController) {
|
|
10879
|
+
this.accountController = accountController;
|
|
10880
|
+
}
|
|
10881
|
+
v1() {
|
|
10882
|
+
// no upgrade steps necessary for v1
|
|
10883
|
+
return Promise.resolve();
|
|
10884
|
+
}
|
|
10885
|
+
}
|
|
10886
|
+
exports.IdentityMigrations = IdentityMigrations;
|
|
10887
|
+
//# sourceMappingURL=IdentityMigrations.js.map
|
|
10888
|
+
|
|
10889
|
+
/***/ }),
|
|
10890
|
+
|
|
10556
10891
|
/***/ "./dist/modules/tokens/AnonymousTokenController.js":
|
|
10557
10892
|
/*!*********************************************************!*\
|
|
10558
10893
|
!*** ./dist/modules/tokens/AnonymousTokenController.js ***!
|
|
@@ -11764,95 +12099,33 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
11764
12099
|
/*!******************************************************************!*\
|
|
11765
12100
|
!*** ./node_modules/@js-soft/ts-utils/dist/eventBus/EventBus.js ***!
|
|
11766
12101
|
\******************************************************************/
|
|
11767
|
-
/***/ ((__unused_webpack_module, exports
|
|
12102
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
11768
12103
|
|
|
11769
12104
|
"use strict";
|
|
11770
12105
|
|
|
11771
12106
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11772
|
-
exports.EventBus = void 0;
|
|
11773
|
-
__webpack_require__(/*! reflect-metadata */ "./node_modules/reflect-metadata/Reflect.js");
|
|
11774
|
-
const eventemitter2_1 = __webpack_require__(/*! eventemitter2 */ "./node_modules/eventemitter2/lib/eventemitter2.js");
|
|
11775
|
-
const Reflection_1 = __webpack_require__(/*! ./reflection/Reflection */ "./node_modules/@js-soft/ts-utils/dist/eventBus/reflection/Reflection.js");
|
|
11776
|
-
const SubscriptionTargetInfo_1 = __webpack_require__(/*! ./SubscriptionTargetInfo */ "./node_modules/@js-soft/ts-utils/dist/eventBus/SubscriptionTargetInfo.js");
|
|
12107
|
+
exports.getEventNamespaceFromObject = exports.EventBus = void 0;
|
|
11777
12108
|
class EventBus {
|
|
11778
|
-
emitter;
|
|
11779
|
-
constructor() {
|
|
11780
|
-
this.emitter = new eventemitter2_1.EventEmitter2({ wildcard: true, maxListeners: 50, verboseMemoryLeak: true });
|
|
11781
|
-
}
|
|
11782
|
-
subscribe(subscriptionTarget, handler) {
|
|
11783
|
-
this.registerHandler(subscriptionTarget, handler);
|
|
11784
|
-
}
|
|
11785
|
-
subscribeOnce(subscriptionTarget, handler) {
|
|
11786
|
-
this.registerHandler(subscriptionTarget, handler, true);
|
|
11787
|
-
}
|
|
11788
|
-
registerHandler(subscriptionTarget, handler, isOneTimeHandler = false) {
|
|
11789
|
-
const subscriptionTargetInfo = SubscriptionTargetInfo_1.SubscriptionTargetInfo.from(subscriptionTarget);
|
|
11790
|
-
const handlerWrapper = (event) => {
|
|
11791
|
-
if (!subscriptionTargetInfo.isCompatibleWith(event)) {
|
|
11792
|
-
return;
|
|
11793
|
-
}
|
|
11794
|
-
handler(event);
|
|
11795
|
-
if (isOneTimeHandler) {
|
|
11796
|
-
this.emitter.off(subscriptionTargetInfo.namespace, handlerWrapper);
|
|
11797
|
-
}
|
|
11798
|
-
};
|
|
11799
|
-
this.emitter.on(subscriptionTargetInfo.namespace, handlerWrapper);
|
|
11800
|
-
}
|
|
11801
|
-
async publish(event) {
|
|
11802
|
-
let namespace = getEventNamespaceFromObject(event);
|
|
11803
|
-
if (!namespace) {
|
|
11804
|
-
throw Error("The event needs a namespace. Use the EventNamespaceDecorator in order to define a namespace for a event.");
|
|
11805
|
-
}
|
|
11806
|
-
this.emitter.emit(namespace, event);
|
|
11807
|
-
}
|
|
11808
12109
|
}
|
|
11809
12110
|
exports.EventBus = EventBus;
|
|
11810
12111
|
function getEventNamespaceFromObject(targetObject) {
|
|
11811
|
-
|
|
11812
|
-
if (!namespaceDecorator) {
|
|
11813
|
-
throw new Error("Event Type is not defined");
|
|
11814
|
-
}
|
|
11815
|
-
return namespaceDecorator;
|
|
12112
|
+
return targetObject.namespace;
|
|
11816
12113
|
}
|
|
12114
|
+
exports.getEventNamespaceFromObject = getEventNamespaceFromObject;
|
|
11817
12115
|
//# sourceMappingURL=EventBus.js.map
|
|
11818
12116
|
|
|
11819
12117
|
/***/ }),
|
|
11820
12118
|
|
|
11821
|
-
/***/ "./node_modules/@js-soft/ts-utils/dist/eventBus/EventNamespaceDecorator.js":
|
|
11822
|
-
/*!*********************************************************************************!*\
|
|
11823
|
-
!*** ./node_modules/@js-soft/ts-utils/dist/eventBus/EventNamespaceDecorator.js ***!
|
|
11824
|
-
\*********************************************************************************/
|
|
11825
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11826
|
-
|
|
11827
|
-
"use strict";
|
|
11828
|
-
|
|
11829
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11830
|
-
exports.EventNamespace = void 0;
|
|
11831
|
-
const Constants_1 = __webpack_require__(/*! ./reflection/Constants */ "./node_modules/@js-soft/ts-utils/dist/eventBus/reflection/Constants.js");
|
|
11832
|
-
function EventNamespace(name) {
|
|
11833
|
-
return (target) => {
|
|
11834
|
-
if (!name) {
|
|
11835
|
-
name = target.name;
|
|
11836
|
-
}
|
|
11837
|
-
Reflect.defineMetadata(`${Constants_1.CUSTOM_METADATA_NAMESPACE}:namespace`, name, target);
|
|
11838
|
-
};
|
|
11839
|
-
}
|
|
11840
|
-
exports.EventNamespace = EventNamespace;
|
|
11841
|
-
//# sourceMappingURL=EventNamespaceDecorator.js.map
|
|
11842
|
-
|
|
11843
|
-
/***/ }),
|
|
11844
|
-
|
|
11845
12119
|
/***/ "./node_modules/@js-soft/ts-utils/dist/eventBus/SubscriptionTargetInfo.js":
|
|
11846
12120
|
/*!********************************************************************************!*\
|
|
11847
12121
|
!*** ./node_modules/@js-soft/ts-utils/dist/eventBus/SubscriptionTargetInfo.js ***!
|
|
11848
12122
|
\********************************************************************************/
|
|
11849
|
-
/***/ ((__unused_webpack_module, exports
|
|
12123
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
11850
12124
|
|
|
11851
12125
|
"use strict";
|
|
11852
12126
|
|
|
11853
12127
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11854
12128
|
exports.SubscriptionTargetInfo = void 0;
|
|
11855
|
-
const Reflection_1 = __webpack_require__(/*! ./reflection/Reflection */ "./node_modules/@js-soft/ts-utils/dist/eventBus/reflection/Reflection.js");
|
|
11856
12129
|
class SubscriptionTargetInfo {
|
|
11857
12130
|
namespace;
|
|
11858
12131
|
constructor(namespace) {
|
|
@@ -11862,9 +12135,7 @@ class SubscriptionTargetInfo {
|
|
|
11862
12135
|
if (target instanceof Function) {
|
|
11863
12136
|
return new ConstructorSubscriptionTargetInfo(target);
|
|
11864
12137
|
}
|
|
11865
|
-
|
|
11866
|
-
return new NamespaceSubscriptionTargetInfo(target);
|
|
11867
|
-
}
|
|
12138
|
+
return new NamespaceSubscriptionTargetInfo(target);
|
|
11868
12139
|
}
|
|
11869
12140
|
}
|
|
11870
12141
|
exports.SubscriptionTargetInfo = SubscriptionTargetInfo;
|
|
@@ -11882,21 +12153,86 @@ class NamespaceSubscriptionTargetInfo extends SubscriptionTargetInfo {
|
|
|
11882
12153
|
constructor(namespace) {
|
|
11883
12154
|
super(namespace);
|
|
11884
12155
|
}
|
|
11885
|
-
isCompatibleWith(
|
|
12156
|
+
isCompatibleWith(_event) {
|
|
11886
12157
|
return true;
|
|
11887
12158
|
}
|
|
11888
12159
|
}
|
|
11889
12160
|
function getEventNamespaceFromClass(targetClass) {
|
|
11890
|
-
|
|
11891
|
-
if (!namespaceDecorator) {
|
|
11892
|
-
throw new Error("Event Type is not defined");
|
|
11893
|
-
}
|
|
11894
|
-
return namespaceDecorator;
|
|
12161
|
+
return targetClass.namespace;
|
|
11895
12162
|
}
|
|
11896
12163
|
//# sourceMappingURL=SubscriptionTargetInfo.js.map
|
|
11897
12164
|
|
|
11898
12165
|
/***/ }),
|
|
11899
12166
|
|
|
12167
|
+
/***/ "./node_modules/@js-soft/ts-utils/dist/eventBus/eventEmitter2/EventEmitter2EventBus.js":
|
|
12168
|
+
/*!*********************************************************************************************!*\
|
|
12169
|
+
!*** ./node_modules/@js-soft/ts-utils/dist/eventBus/eventEmitter2/EventEmitter2EventBus.js ***!
|
|
12170
|
+
\*********************************************************************************************/
|
|
12171
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12172
|
+
|
|
12173
|
+
"use strict";
|
|
12174
|
+
|
|
12175
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12176
|
+
exports.EventEmitter2EventBus = void 0;
|
|
12177
|
+
const eventemitter2_1 = __webpack_require__(/*! eventemitter2 */ "./node_modules/eventemitter2/lib/eventemitter2.js");
|
|
12178
|
+
__webpack_require__(/*! reflect-metadata */ "./node_modules/reflect-metadata/Reflect.js");
|
|
12179
|
+
const EventBus_1 = __webpack_require__(/*! ../EventBus */ "./node_modules/@js-soft/ts-utils/dist/eventBus/EventBus.js");
|
|
12180
|
+
const SubscriptionTargetInfo_1 = __webpack_require__(/*! ../SubscriptionTargetInfo */ "./node_modules/@js-soft/ts-utils/dist/eventBus/SubscriptionTargetInfo.js");
|
|
12181
|
+
class EventEmitter2EventBus {
|
|
12182
|
+
emitter;
|
|
12183
|
+
wrappers = new Map();
|
|
12184
|
+
nextId = 0;
|
|
12185
|
+
constructor() {
|
|
12186
|
+
this.emitter = new eventemitter2_1.EventEmitter2({ wildcard: true, maxListeners: 50, verboseMemoryLeak: true });
|
|
12187
|
+
}
|
|
12188
|
+
subscribe(subscriptionTarget, handler) {
|
|
12189
|
+
return this.registerHandler(subscriptionTarget, handler);
|
|
12190
|
+
}
|
|
12191
|
+
subscribeOnce(subscriptionTarget, handler) {
|
|
12192
|
+
return this.registerHandler(subscriptionTarget, handler, true);
|
|
12193
|
+
}
|
|
12194
|
+
unsubscribe(subscriptionTarget, subscriptionId) {
|
|
12195
|
+
return this.unregisterHandler(subscriptionTarget, subscriptionId);
|
|
12196
|
+
}
|
|
12197
|
+
registerHandler(subscriptionTarget, handler, isOneTimeHandler = false) {
|
|
12198
|
+
const subscriptionTargetInfo = SubscriptionTargetInfo_1.SubscriptionTargetInfo.from(subscriptionTarget);
|
|
12199
|
+
const handlerId = this.nextId++;
|
|
12200
|
+
const handlerWrapper = (event) => {
|
|
12201
|
+
if (!subscriptionTargetInfo.isCompatibleWith(event)) {
|
|
12202
|
+
return;
|
|
12203
|
+
}
|
|
12204
|
+
handler(event);
|
|
12205
|
+
if (isOneTimeHandler) {
|
|
12206
|
+
this.unsubscribe(subscriptionTarget, handlerId);
|
|
12207
|
+
}
|
|
12208
|
+
};
|
|
12209
|
+
this.wrappers.set(handlerId, handlerWrapper);
|
|
12210
|
+
this.emitter.on(subscriptionTargetInfo.namespace, handlerWrapper);
|
|
12211
|
+
return handlerId;
|
|
12212
|
+
}
|
|
12213
|
+
unregisterHandler(subscriptionTarget, handlerId) {
|
|
12214
|
+
const subscriptionTargetInfo = SubscriptionTargetInfo_1.SubscriptionTargetInfo.from(subscriptionTarget);
|
|
12215
|
+
const handlerWrapper = this.wrappers.get(handlerId);
|
|
12216
|
+
if (!handlerWrapper) {
|
|
12217
|
+
return false;
|
|
12218
|
+
}
|
|
12219
|
+
this.emitter.off(subscriptionTargetInfo.namespace, handlerWrapper);
|
|
12220
|
+
this.wrappers.delete(handlerId);
|
|
12221
|
+
return true;
|
|
12222
|
+
}
|
|
12223
|
+
publish(event) {
|
|
12224
|
+
const namespace = (0, EventBus_1.getEventNamespaceFromObject)(event);
|
|
12225
|
+
if (!namespace) {
|
|
12226
|
+
throw Error("The event needs a namespace. Use the EventNamespace-decorator in order to define a namespace for a event.");
|
|
12227
|
+
}
|
|
12228
|
+
this.emitter.emit(namespace, event);
|
|
12229
|
+
}
|
|
12230
|
+
}
|
|
12231
|
+
exports.EventEmitter2EventBus = EventEmitter2EventBus;
|
|
12232
|
+
//# sourceMappingURL=EventEmitter2EventBus.js.map
|
|
12233
|
+
|
|
12234
|
+
/***/ }),
|
|
12235
|
+
|
|
11900
12236
|
/***/ "./node_modules/@js-soft/ts-utils/dist/eventBus/index.js":
|
|
11901
12237
|
/*!***************************************************************!*\
|
|
11902
12238
|
!*** ./node_modules/@js-soft/ts-utils/dist/eventBus/index.js ***!
|
|
@@ -11917,52 +12253,77 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11917
12253
|
};
|
|
11918
12254
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11919
12255
|
__exportStar(__webpack_require__(/*! ./EventBus */ "./node_modules/@js-soft/ts-utils/dist/eventBus/EventBus.js"), exports);
|
|
11920
|
-
__exportStar(__webpack_require__(/*! ./
|
|
12256
|
+
__exportStar(__webpack_require__(/*! ./eventEmitter2/EventEmitter2EventBus */ "./node_modules/@js-soft/ts-utils/dist/eventBus/eventEmitter2/EventEmitter2EventBus.js"), exports);
|
|
11921
12257
|
//# sourceMappingURL=index.js.map
|
|
11922
12258
|
|
|
11923
12259
|
/***/ }),
|
|
11924
12260
|
|
|
11925
|
-
/***/ "./node_modules/@js-soft/ts-utils/dist/
|
|
11926
|
-
|
|
11927
|
-
!*** ./node_modules/@js-soft/ts-utils/dist/
|
|
11928
|
-
|
|
11929
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
12261
|
+
/***/ "./node_modules/@js-soft/ts-utils/dist/events/DataEvent.js":
|
|
12262
|
+
/*!*****************************************************************!*\
|
|
12263
|
+
!*** ./node_modules/@js-soft/ts-utils/dist/events/DataEvent.js ***!
|
|
12264
|
+
\*****************************************************************/
|
|
12265
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11930
12266
|
|
|
11931
12267
|
"use strict";
|
|
11932
12268
|
|
|
11933
12269
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11934
|
-
exports.
|
|
11935
|
-
|
|
11936
|
-
|
|
12270
|
+
exports.DataEvent = void 0;
|
|
12271
|
+
const Event_1 = __webpack_require__(/*! ./Event */ "./node_modules/@js-soft/ts-utils/dist/events/Event.js");
|
|
12272
|
+
class DataEvent extends Event_1.Event {
|
|
12273
|
+
data;
|
|
12274
|
+
constructor(namespace, data) {
|
|
12275
|
+
super(namespace);
|
|
12276
|
+
this.data = data;
|
|
12277
|
+
}
|
|
12278
|
+
}
|
|
12279
|
+
exports.DataEvent = DataEvent;
|
|
12280
|
+
//# sourceMappingURL=DataEvent.js.map
|
|
11937
12281
|
|
|
11938
12282
|
/***/ }),
|
|
11939
12283
|
|
|
11940
|
-
/***/ "./node_modules/@js-soft/ts-utils/dist/
|
|
11941
|
-
|
|
11942
|
-
!*** ./node_modules/@js-soft/ts-utils/dist/
|
|
11943
|
-
|
|
11944
|
-
/***/ ((__unused_webpack_module, exports
|
|
12284
|
+
/***/ "./node_modules/@js-soft/ts-utils/dist/events/Event.js":
|
|
12285
|
+
/*!*************************************************************!*\
|
|
12286
|
+
!*** ./node_modules/@js-soft/ts-utils/dist/events/Event.js ***!
|
|
12287
|
+
\*************************************************************/
|
|
12288
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
11945
12289
|
|
|
11946
12290
|
"use strict";
|
|
11947
12291
|
|
|
11948
12292
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11949
|
-
exports.
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
}
|
|
11956
|
-
exports.getCustomClassDecoratorValue = getCustomClassDecoratorValue;
|
|
11957
|
-
function getCustomClassDecorators(targetClass) {
|
|
11958
|
-
const keys = Reflect.getMetadataKeys(targetClass);
|
|
11959
|
-
let decorators = keys
|
|
11960
|
-
.filter(key => key.toString().startsWith(Constants_1.CUSTOM_METADATA_NAMESPACE))
|
|
11961
|
-
.map(key => { return { key: key, value: Reflect.getMetadata(key, targetClass) }; });
|
|
11962
|
-
return decorators;
|
|
12293
|
+
exports.Event = void 0;
|
|
12294
|
+
class Event {
|
|
12295
|
+
namespace;
|
|
12296
|
+
constructor(namespace) {
|
|
12297
|
+
this.namespace = namespace;
|
|
12298
|
+
}
|
|
11963
12299
|
}
|
|
11964
|
-
exports.
|
|
11965
|
-
//# sourceMappingURL=
|
|
12300
|
+
exports.Event = Event;
|
|
12301
|
+
//# sourceMappingURL=Event.js.map
|
|
12302
|
+
|
|
12303
|
+
/***/ }),
|
|
12304
|
+
|
|
12305
|
+
/***/ "./node_modules/@js-soft/ts-utils/dist/events/index.js":
|
|
12306
|
+
/*!*************************************************************!*\
|
|
12307
|
+
!*** ./node_modules/@js-soft/ts-utils/dist/events/index.js ***!
|
|
12308
|
+
\*************************************************************/
|
|
12309
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
12310
|
+
|
|
12311
|
+
"use strict";
|
|
12312
|
+
|
|
12313
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12314
|
+
if (k2 === undefined) k2 = k;
|
|
12315
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12316
|
+
}) : (function(o, m, k, k2) {
|
|
12317
|
+
if (k2 === undefined) k2 = k;
|
|
12318
|
+
o[k2] = m[k];
|
|
12319
|
+
}));
|
|
12320
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
12321
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
12322
|
+
};
|
|
12323
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12324
|
+
__exportStar(__webpack_require__(/*! ./DataEvent */ "./node_modules/@js-soft/ts-utils/dist/events/DataEvent.js"), exports);
|
|
12325
|
+
__exportStar(__webpack_require__(/*! ./Event */ "./node_modules/@js-soft/ts-utils/dist/events/Event.js"), exports);
|
|
12326
|
+
//# sourceMappingURL=index.js.map
|
|
11966
12327
|
|
|
11967
12328
|
/***/ }),
|
|
11968
12329
|
|
|
@@ -11986,11 +12347,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11986
12347
|
};
|
|
11987
12348
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11988
12349
|
__exportStar(__webpack_require__(/*! ./eventBus */ "./node_modules/@js-soft/ts-utils/dist/eventBus/index.js"), exports);
|
|
11989
|
-
__exportStar(__webpack_require__(/*! ./
|
|
12350
|
+
__exportStar(__webpack_require__(/*! ./events */ "./node_modules/@js-soft/ts-utils/dist/events/index.js"), exports);
|
|
11990
12351
|
__exportStar(__webpack_require__(/*! ./logDecorator */ "./node_modules/@js-soft/ts-utils/dist/logDecorator.js"), exports);
|
|
11991
12352
|
__exportStar(__webpack_require__(/*! ./measureExcecutionTime */ "./node_modules/@js-soft/ts-utils/dist/measureExcecutionTime.js"), exports);
|
|
11992
12353
|
__exportStar(__webpack_require__(/*! ./randomString */ "./node_modules/@js-soft/ts-utils/dist/randomString.js"), exports);
|
|
11993
12354
|
__exportStar(__webpack_require__(/*! ./Range */ "./node_modules/@js-soft/ts-utils/dist/Range.js"), exports);
|
|
12355
|
+
__exportStar(__webpack_require__(/*! ./result */ "./node_modules/@js-soft/ts-utils/dist/result/index.js"), exports);
|
|
11994
12356
|
__exportStar(__webpack_require__(/*! ./sleep */ "./node_modules/@js-soft/ts-utils/dist/sleep.js"), exports);
|
|
11995
12357
|
//# sourceMappingURL=index.js.map
|
|
11996
12358
|
|
|
@@ -12006,10 +12368,11 @@ __exportStar(__webpack_require__(/*! ./sleep */ "./node_modules/@js-soft/ts-util
|
|
|
12006
12368
|
|
|
12007
12369
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12008
12370
|
exports.log = void 0;
|
|
12009
|
-
|
|
12371
|
+
/* eslint-disable no-console */
|
|
12372
|
+
function log(_target, propertyName, propertyDesciptor) {
|
|
12010
12373
|
const method = propertyDesciptor.value;
|
|
12011
12374
|
propertyDesciptor.value = function (...args) {
|
|
12012
|
-
const params = args.map(a => JSON.stringify(a)).join();
|
|
12375
|
+
const params = args.map((a) => JSON.stringify(a)).join();
|
|
12013
12376
|
try {
|
|
12014
12377
|
const result = method.apply(this, args);
|
|
12015
12378
|
const r = JSON.stringify(result);
|
|
@@ -12024,7 +12387,6 @@ function log(target, propertyName, propertyDesciptor) {
|
|
|
12024
12387
|
return propertyDesciptor;
|
|
12025
12388
|
}
|
|
12026
12389
|
exports.log = log;
|
|
12027
|
-
;
|
|
12028
12390
|
//# sourceMappingURL=logDecorator.js.map
|
|
12029
12391
|
|
|
12030
12392
|
/***/ }),
|
|
@@ -12039,7 +12401,8 @@ exports.log = log;
|
|
|
12039
12401
|
|
|
12040
12402
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12041
12403
|
exports.measureExcecutionTime = void 0;
|
|
12042
|
-
|
|
12404
|
+
/* eslint-disable no-console */
|
|
12405
|
+
function measureExcecutionTime(_target, _propertyName, propertyDesciptor) {
|
|
12043
12406
|
const method = propertyDesciptor.value;
|
|
12044
12407
|
propertyDesciptor.value = async function (...args) {
|
|
12045
12408
|
const t0 = Date.now();
|
|
@@ -12051,7 +12414,6 @@ function measureExcecutionTime(target, propertyName, propertyDesciptor) {
|
|
|
12051
12414
|
return propertyDesciptor;
|
|
12052
12415
|
}
|
|
12053
12416
|
exports.measureExcecutionTime = measureExcecutionTime;
|
|
12054
|
-
;
|
|
12055
12417
|
//# sourceMappingURL=measureExcecutionTime.js.map
|
|
12056
12418
|
|
|
12057
12419
|
/***/ }),
|
|
@@ -12069,13 +12431,12 @@ exports.randomString = void 0;
|
|
|
12069
12431
|
function randomString(length, characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") {
|
|
12070
12432
|
let result = "";
|
|
12071
12433
|
const charactersLength = characters.length;
|
|
12072
|
-
for (
|
|
12434
|
+
for (let i = 0; i < length; i++) {
|
|
12073
12435
|
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
12074
12436
|
}
|
|
12075
12437
|
return result;
|
|
12076
12438
|
}
|
|
12077
12439
|
exports.randomString = randomString;
|
|
12078
|
-
;
|
|
12079
12440
|
//# sourceMappingURL=randomString.js.map
|
|
12080
12441
|
|
|
12081
12442
|
/***/ }),
|
|
@@ -12348,7 +12709,7 @@ module.exports = function xhrAdapter(config) {
|
|
|
12348
12709
|
|
|
12349
12710
|
// Handle timeout
|
|
12350
12711
|
request.ontimeout = function handleTimeout() {
|
|
12351
|
-
var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
|
|
12712
|
+
var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
12352
12713
|
var transitional = config.transitional || defaults.transitional;
|
|
12353
12714
|
if (config.timeoutErrorMessage) {
|
|
12354
12715
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
@@ -12489,7 +12850,7 @@ axios.Axios = Axios;
|
|
|
12489
12850
|
axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
|
|
12490
12851
|
axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js");
|
|
12491
12852
|
axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
|
|
12492
|
-
axios.VERSION = __webpack_require__(/*! ./env/data */ "./node_modules/axios/lib/env/data.js").version;
|
|
12853
|
+
axios.VERSION = (__webpack_require__(/*! ./env/data */ "./node_modules/axios/lib/env/data.js").version);
|
|
12493
12854
|
|
|
12494
12855
|
// Expose all/spread
|
|
12495
12856
|
axios.all = function all(promises) {
|
|
@@ -13451,7 +13812,7 @@ module.exports = defaults;
|
|
|
13451
13812
|
/***/ ((module) => {
|
|
13452
13813
|
|
|
13453
13814
|
module.exports = {
|
|
13454
|
-
"version": "0.
|
|
13815
|
+
"version": "0.24.0"
|
|
13455
13816
|
};
|
|
13456
13817
|
|
|
13457
13818
|
/***/ }),
|
|
@@ -13908,7 +14269,7 @@ module.exports = function spread(callback) {
|
|
|
13908
14269
|
"use strict";
|
|
13909
14270
|
|
|
13910
14271
|
|
|
13911
|
-
var VERSION = __webpack_require__(/*! ../env/data */ "./node_modules/axios/lib/env/data.js").version;
|
|
14272
|
+
var VERSION = (__webpack_require__(/*! ../env/data */ "./node_modules/axios/lib/env/data.js").version);
|
|
13912
14273
|
|
|
13913
14274
|
var validators = {};
|
|
13914
14275
|
|
|
@@ -15143,83 +15504,87 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
|
|
15143
15504
|
var listeners= null, branch, xTree, xxTree, isolatedBranch, endReached, currentType = type[i],
|
|
15144
15505
|
nextType = type[i + 1], branches, _listeners;
|
|
15145
15506
|
|
|
15146
|
-
if (i === typeLength
|
|
15507
|
+
if (i === typeLength) {
|
|
15147
15508
|
//
|
|
15148
15509
|
// If at the end of the event(s) list and the tree has listeners
|
|
15149
15510
|
// invoke those listeners.
|
|
15150
15511
|
//
|
|
15151
|
-
|
|
15152
|
-
|
|
15153
|
-
|
|
15154
|
-
|
|
15155
|
-
|
|
15156
|
-
|
|
15512
|
+
|
|
15513
|
+
if(tree._listeners) {
|
|
15514
|
+
if (typeof tree._listeners === 'function') {
|
|
15515
|
+
handlers && handlers.push(tree._listeners);
|
|
15516
|
+
listeners = [tree];
|
|
15517
|
+
} else {
|
|
15518
|
+
handlers && handlers.push.apply(handlers, tree._listeners);
|
|
15519
|
+
listeners = [tree];
|
|
15520
|
+
}
|
|
15157
15521
|
}
|
|
15158
|
-
}
|
|
15522
|
+
} else {
|
|
15159
15523
|
|
|
15160
|
-
|
|
15161
|
-
|
|
15162
|
-
|
|
15163
|
-
|
|
15164
|
-
|
|
15165
|
-
|
|
15166
|
-
|
|
15167
|
-
|
|
15168
|
-
|
|
15169
|
-
|
|
15170
|
-
|
|
15171
|
-
|
|
15172
|
-
|
|
15173
|
-
|
|
15174
|
-
|
|
15175
|
-
|
|
15524
|
+
if (currentType === '*') {
|
|
15525
|
+
//
|
|
15526
|
+
// If the event emitted is '*' at this part
|
|
15527
|
+
// or there is a concrete match at this patch
|
|
15528
|
+
//
|
|
15529
|
+
branches = ownKeys(tree);
|
|
15530
|
+
n = branches.length;
|
|
15531
|
+
while (n-- > 0) {
|
|
15532
|
+
branch = branches[n];
|
|
15533
|
+
if (branch !== '_listeners') {
|
|
15534
|
+
_listeners = searchListenerTree(handlers, type, tree[branch], i + 1, typeLength);
|
|
15535
|
+
if (_listeners) {
|
|
15536
|
+
if (listeners) {
|
|
15537
|
+
listeners.push.apply(listeners, _listeners);
|
|
15538
|
+
} else {
|
|
15539
|
+
listeners = _listeners;
|
|
15540
|
+
}
|
|
15176
15541
|
}
|
|
15177
15542
|
}
|
|
15178
15543
|
}
|
|
15179
|
-
|
|
15180
|
-
|
|
15181
|
-
|
|
15182
|
-
|
|
15183
|
-
|
|
15184
|
-
|
|
15185
|
-
|
|
15186
|
-
|
|
15187
|
-
|
|
15188
|
-
|
|
15189
|
-
|
|
15190
|
-
|
|
15191
|
-
|
|
15192
|
-
|
|
15193
|
-
|
|
15194
|
-
|
|
15195
|
-
|
|
15196
|
-
|
|
15197
|
-
|
|
15198
|
-
|
|
15199
|
-
|
|
15200
|
-
|
|
15544
|
+
return listeners;
|
|
15545
|
+
} else if (currentType === '**') {
|
|
15546
|
+
endReached = (i + 1 === typeLength || (i + 2 === typeLength && nextType === '*'));
|
|
15547
|
+
if (endReached && tree._listeners) {
|
|
15548
|
+
// The next element has a _listeners, add it to the handlers.
|
|
15549
|
+
listeners = searchListenerTree(handlers, type, tree, typeLength, typeLength);
|
|
15550
|
+
}
|
|
15551
|
+
|
|
15552
|
+
branches = ownKeys(tree);
|
|
15553
|
+
n = branches.length;
|
|
15554
|
+
while (n-- > 0) {
|
|
15555
|
+
branch = branches[n];
|
|
15556
|
+
if (branch !== '_listeners') {
|
|
15557
|
+
if (branch === '*' || branch === '**') {
|
|
15558
|
+
if (tree[branch]._listeners && !endReached) {
|
|
15559
|
+
_listeners = searchListenerTree(handlers, type, tree[branch], typeLength, typeLength);
|
|
15560
|
+
if (_listeners) {
|
|
15561
|
+
if (listeners) {
|
|
15562
|
+
listeners.push.apply(listeners, _listeners);
|
|
15563
|
+
} else {
|
|
15564
|
+
listeners = _listeners;
|
|
15565
|
+
}
|
|
15201
15566
|
}
|
|
15202
15567
|
}
|
|
15568
|
+
_listeners = searchListenerTree(handlers, type, tree[branch], i, typeLength);
|
|
15569
|
+
} else if (branch === nextType) {
|
|
15570
|
+
_listeners = searchListenerTree(handlers, type, tree[branch], i + 2, typeLength);
|
|
15571
|
+
} else {
|
|
15572
|
+
// No match on this one, shift into the tree but not in the type array.
|
|
15573
|
+
_listeners = searchListenerTree(handlers, type, tree[branch], i, typeLength);
|
|
15203
15574
|
}
|
|
15204
|
-
|
|
15205
|
-
|
|
15206
|
-
|
|
15207
|
-
|
|
15208
|
-
|
|
15209
|
-
|
|
15210
|
-
}
|
|
15211
|
-
if(_listeners){
|
|
15212
|
-
if(listeners){
|
|
15213
|
-
listeners.push.apply(listeners, _listeners);
|
|
15214
|
-
}else{
|
|
15215
|
-
listeners = _listeners;
|
|
15575
|
+
if (_listeners) {
|
|
15576
|
+
if (listeners) {
|
|
15577
|
+
listeners.push.apply(listeners, _listeners);
|
|
15578
|
+
} else {
|
|
15579
|
+
listeners = _listeners;
|
|
15580
|
+
}
|
|
15216
15581
|
}
|
|
15217
15582
|
}
|
|
15218
15583
|
}
|
|
15584
|
+
return listeners;
|
|
15585
|
+
} else if (tree[currentType]) {
|
|
15586
|
+
listeners = searchListenerTree(handlers, type, tree[currentType], i + 1, typeLength);
|
|
15219
15587
|
}
|
|
15220
|
-
return listeners;
|
|
15221
|
-
}else if (tree[currentType]) {
|
|
15222
|
-
listeners= searchListenerTree(handlers, type, tree[currentType], i + 1, typeLength);
|
|
15223
15588
|
}
|
|
15224
15589
|
|
|
15225
15590
|
xTree = tree['*'];
|
|
@@ -34604,6 +34969,13 @@ function parseInteger(string) {
|
|
|
34604
34969
|
return parseInt(string, 10);
|
|
34605
34970
|
}
|
|
34606
34971
|
}
|
|
34972
|
+
function parseFloating(string) {
|
|
34973
|
+
if (isUndefined(string) || string === null || string === "") {
|
|
34974
|
+
return undefined;
|
|
34975
|
+
} else {
|
|
34976
|
+
return parseFloat(string);
|
|
34977
|
+
}
|
|
34978
|
+
}
|
|
34607
34979
|
function parseMillis(fraction) {
|
|
34608
34980
|
// Return undefined (instead of 0) in these cases, where fraction is not set
|
|
34609
34981
|
if (isUndefined(fraction) || fraction === null || fraction === "") {
|
|
@@ -34743,7 +35115,7 @@ function formatOffset(offset, format) {
|
|
|
34743
35115
|
function timeObject(obj) {
|
|
34744
35116
|
return pick(obj, ["hour", "minute", "second", "millisecond"]);
|
|
34745
35117
|
}
|
|
34746
|
-
var ianaRegex = /[A-Za-z_+-]{1,256}(:?\/[A-Za-
|
|
35118
|
+
var ianaRegex = /[A-Za-z_+-]{1,256}(:?\/[A-Za-z0-9_+-]{1,256}(\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
34747
35119
|
|
|
34748
35120
|
/**
|
|
34749
35121
|
* @private
|
|
@@ -35106,6 +35478,13 @@ var Formatter = /*#__PURE__*/function () {
|
|
|
35106
35478
|
|
|
35107
35479
|
case "ss":
|
|
35108
35480
|
return _this.num(dt.second, 2);
|
|
35481
|
+
// fractional seconds
|
|
35482
|
+
|
|
35483
|
+
case "uu":
|
|
35484
|
+
return _this.num(Math.floor(dt.millisecond / 10), 2);
|
|
35485
|
+
|
|
35486
|
+
case "uuu":
|
|
35487
|
+
return _this.num(Math.floor(dt.millisecond / 100));
|
|
35109
35488
|
// minutes
|
|
35110
35489
|
|
|
35111
35490
|
case "m":
|
|
@@ -35621,7 +36000,7 @@ var dtfCache = {};
|
|
|
35621
36000
|
function makeDTF(zone) {
|
|
35622
36001
|
if (!dtfCache[zone]) {
|
|
35623
36002
|
dtfCache[zone] = new Intl.DateTimeFormat("en-US", {
|
|
35624
|
-
|
|
36003
|
+
hour12: false,
|
|
35625
36004
|
timeZone: zone,
|
|
35626
36005
|
year: "numeric",
|
|
35627
36006
|
month: "2-digit",
|
|
@@ -35728,6 +36107,10 @@ var IANAZone = /*#__PURE__*/function (_Zone) {
|
|
|
35728
36107
|
;
|
|
35729
36108
|
|
|
35730
36109
|
IANAZone.isValidZone = function isValidZone(zone) {
|
|
36110
|
+
if (!zone) {
|
|
36111
|
+
return false;
|
|
36112
|
+
}
|
|
36113
|
+
|
|
35731
36114
|
try {
|
|
35732
36115
|
new Intl.DateTimeFormat("en-US", {
|
|
35733
36116
|
timeZone: zone
|
|
@@ -35736,21 +36119,6 @@ var IANAZone = /*#__PURE__*/function (_Zone) {
|
|
|
35736
36119
|
} catch (e) {
|
|
35737
36120
|
return false;
|
|
35738
36121
|
}
|
|
35739
|
-
} // Etc/GMT+8 -> -480
|
|
35740
|
-
|
|
35741
|
-
/** @ignore */
|
|
35742
|
-
;
|
|
35743
|
-
|
|
35744
|
-
IANAZone.parseGMTOffset = function parseGMTOffset(specifier) {
|
|
35745
|
-
if (specifier) {
|
|
35746
|
-
var match = specifier.match(/^Etc\/GMT(0|[+-]\d{1,2})$/i);
|
|
35747
|
-
|
|
35748
|
-
if (match) {
|
|
35749
|
-
return -60 * parseInt(match[1]);
|
|
35750
|
-
}
|
|
35751
|
-
}
|
|
35752
|
-
|
|
35753
|
-
return null;
|
|
35754
36122
|
};
|
|
35755
36123
|
|
|
35756
36124
|
function IANAZone(name) {
|
|
@@ -35796,13 +36164,15 @@ var IANAZone = /*#__PURE__*/function (_Zone) {
|
|
|
35796
36164
|
day = _ref2[2],
|
|
35797
36165
|
hour = _ref2[3],
|
|
35798
36166
|
minute = _ref2[4],
|
|
35799
|
-
second = _ref2[5];
|
|
36167
|
+
second = _ref2[5]; // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat
|
|
36168
|
+
|
|
35800
36169
|
|
|
36170
|
+
var adjustedHour = hour === 24 ? 0 : hour;
|
|
35801
36171
|
var asUTC = objToLocalTS({
|
|
35802
36172
|
year: year,
|
|
35803
36173
|
month: month,
|
|
35804
36174
|
day: day,
|
|
35805
|
-
hour:
|
|
36175
|
+
hour: adjustedHour,
|
|
35806
36176
|
minute: minute,
|
|
35807
36177
|
second: second,
|
|
35808
36178
|
millisecond: 0
|
|
@@ -36050,7 +36420,6 @@ var InvalidZone = /*#__PURE__*/function (_Zone) {
|
|
|
36050
36420
|
* @private
|
|
36051
36421
|
*/
|
|
36052
36422
|
function normalizeZone(input, defaultZone) {
|
|
36053
|
-
var offset;
|
|
36054
36423
|
|
|
36055
36424
|
if (isUndefined(input) || input === null) {
|
|
36056
36425
|
return defaultZone;
|
|
@@ -36058,10 +36427,7 @@ function normalizeZone(input, defaultZone) {
|
|
|
36058
36427
|
return input;
|
|
36059
36428
|
} else if (isString(input)) {
|
|
36060
36429
|
var lowered = input.toLowerCase();
|
|
36061
|
-
if (lowered === "local" || lowered === "system") return defaultZone;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else if ((
|
|
36062
|
-
// handle Etc/GMT-4, which V8 chokes on
|
|
36063
|
-
return FixedOffsetZone.instance(offset);
|
|
36064
|
-
} else if (IANAZone.isValidSpecifier(lowered)) return IANAZone.create(input);else return FixedOffsetZone.parseSpecifier(lowered) || new InvalidZone(input);
|
|
36430
|
+
if (lowered === "local" || lowered === "system") return defaultZone;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else if (IANAZone.isValidSpecifier(lowered)) return IANAZone.create(input);else return FixedOffsetZone.parseSpecifier(lowered) || new InvalidZone(input);
|
|
36065
36431
|
} else if (isNumber(input)) {
|
|
36066
36432
|
return FixedOffsetZone.instance(input);
|
|
36067
36433
|
} else if (typeof input === "object" && input.offset && typeof input.offset === "number") {
|
|
@@ -36429,9 +36795,8 @@ var PolyDateFormatter = /*#__PURE__*/function () {
|
|
|
36429
36795
|
// - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata
|
|
36430
36796
|
var gmtOffset = -1 * (dt.offset / 60);
|
|
36431
36797
|
var offsetZ = gmtOffset >= 0 ? "Etc/GMT+" + gmtOffset : "Etc/GMT" + gmtOffset;
|
|
36432
|
-
var isOffsetZoneSupported = IANAZone.isValidZone(offsetZ);
|
|
36433
36798
|
|
|
36434
|
-
if (dt.offset !== 0 &&
|
|
36799
|
+
if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {
|
|
36435
36800
|
z = offsetZ;
|
|
36436
36801
|
this.dt = dt;
|
|
36437
36802
|
} else {
|
|
@@ -36922,7 +37287,7 @@ function extractIANAZone(match, cursor) {
|
|
|
36922
37287
|
|
|
36923
37288
|
var isoTimeOnly = RegExp("^T?" + isoTimeBaseRegex.source + "$"); // ISO duration parsing
|
|
36924
37289
|
|
|
36925
|
-
var isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;
|
|
37290
|
+
var isoDuration = /^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;
|
|
36926
37291
|
|
|
36927
37292
|
function extractISODuration(match) {
|
|
36928
37293
|
var s = match[0],
|
|
@@ -36946,13 +37311,13 @@ function extractISODuration(match) {
|
|
|
36946
37311
|
};
|
|
36947
37312
|
|
|
36948
37313
|
return [{
|
|
36949
|
-
years: maybeNegate(
|
|
36950
|
-
months: maybeNegate(
|
|
36951
|
-
weeks: maybeNegate(
|
|
36952
|
-
days: maybeNegate(
|
|
36953
|
-
hours: maybeNegate(
|
|
36954
|
-
minutes: maybeNegate(
|
|
36955
|
-
seconds: maybeNegate(
|
|
37314
|
+
years: maybeNegate(parseFloating(yearStr)),
|
|
37315
|
+
months: maybeNegate(parseFloating(monthStr)),
|
|
37316
|
+
weeks: maybeNegate(parseFloating(weekStr)),
|
|
37317
|
+
days: maybeNegate(parseFloating(dayStr)),
|
|
37318
|
+
hours: maybeNegate(parseFloating(hourStr)),
|
|
37319
|
+
minutes: maybeNegate(parseFloating(minuteStr)),
|
|
37320
|
+
seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"),
|
|
36956
37321
|
milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds)
|
|
36957
37322
|
}];
|
|
36958
37323
|
} // These are a little braindead. EDT *should* tell us that we're in, say, America/New_York
|
|
@@ -37178,7 +37543,6 @@ var lowOrderMatrix = {
|
|
|
37178
37543
|
}
|
|
37179
37544
|
}, lowOrderMatrix); // units ordered by size
|
|
37180
37545
|
|
|
37181
|
-
|
|
37182
37546
|
var orderedUnits$1 = ["years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"];
|
|
37183
37547
|
var reverseUnits = orderedUnits$1.slice(0).reverse(); // clone really means "create another instance just like this one, but with these changes"
|
|
37184
37548
|
|
|
@@ -37226,11 +37590,11 @@ function normalizeValues(matrix, vals) {
|
|
|
37226
37590
|
}, null);
|
|
37227
37591
|
}
|
|
37228
37592
|
/**
|
|
37229
|
-
* A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime
|
|
37593
|
+
* A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.
|
|
37230
37594
|
*
|
|
37231
37595
|
* Here is a brief overview of commonly used methods and getters in Duration:
|
|
37232
37596
|
*
|
|
37233
|
-
* * **Creation** To create a Duration, use {@link Duration
|
|
37597
|
+
* * **Creation** To create a Duration, use {@link Duration#fromMillis}, {@link Duration#fromObject}, or {@link Duration#fromISO}.
|
|
37234
37598
|
* * **Unit values** See the {@link Duration#years}, {@link Duration.months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.
|
|
37235
37599
|
* * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.
|
|
37236
37600
|
* * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.
|
|
@@ -37329,6 +37693,29 @@ var Duration = /*#__PURE__*/function () {
|
|
|
37329
37693
|
conversionAccuracy: opts.conversionAccuracy
|
|
37330
37694
|
});
|
|
37331
37695
|
}
|
|
37696
|
+
/**
|
|
37697
|
+
* Create a Duration from DurationLike.
|
|
37698
|
+
*
|
|
37699
|
+
* @param {Object | number | Duration} durationLike
|
|
37700
|
+
* One of:
|
|
37701
|
+
* - object with keys like 'years' and 'hours'.
|
|
37702
|
+
* - number representing milliseconds
|
|
37703
|
+
* - Duration instance
|
|
37704
|
+
* @return {Duration}
|
|
37705
|
+
*/
|
|
37706
|
+
;
|
|
37707
|
+
|
|
37708
|
+
Duration.fromDurationLike = function fromDurationLike(durationLike) {
|
|
37709
|
+
if (isNumber(durationLike)) {
|
|
37710
|
+
return Duration.fromMillis(durationLike);
|
|
37711
|
+
} else if (Duration.isDuration(durationLike)) {
|
|
37712
|
+
return durationLike;
|
|
37713
|
+
} else if (typeof durationLike === "object") {
|
|
37714
|
+
return Duration.fromObject(durationLike);
|
|
37715
|
+
} else {
|
|
37716
|
+
throw new InvalidArgumentError("Unknown duration argument " + durationLike + " of type " + typeof durationLike);
|
|
37717
|
+
}
|
|
37718
|
+
}
|
|
37332
37719
|
/**
|
|
37333
37720
|
* Create a Duration from an ISO 8601 duration string.
|
|
37334
37721
|
* @param {string} text - text to parse
|
|
@@ -37466,7 +37853,7 @@ var Duration = /*#__PURE__*/function () {
|
|
|
37466
37853
|
* * `y` for years
|
|
37467
37854
|
* Notes:
|
|
37468
37855
|
* * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits
|
|
37469
|
-
* * The duration will be converted to the set of units in the format string using {@link Duration
|
|
37856
|
+
* * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.
|
|
37470
37857
|
* @param {string} fmt - the format string
|
|
37471
37858
|
* @param {Object} opts - options
|
|
37472
37859
|
* @param {boolean} [opts.floor=true] - floor numerical values
|
|
@@ -37623,7 +38010,7 @@ var Duration = /*#__PURE__*/function () {
|
|
|
37623
38010
|
|
|
37624
38011
|
_proto.plus = function plus(duration) {
|
|
37625
38012
|
if (!this.isValid) return this;
|
|
37626
|
-
var dur =
|
|
38013
|
+
var dur = Duration.fromDurationLike(duration),
|
|
37627
38014
|
result = {};
|
|
37628
38015
|
|
|
37629
38016
|
for (var _iterator = _createForOfIteratorHelperLoose(orderedUnits$1), _step; !(_step = _iterator()).done;) {
|
|
@@ -37647,7 +38034,7 @@ var Duration = /*#__PURE__*/function () {
|
|
|
37647
38034
|
|
|
37648
38035
|
_proto.minus = function minus(duration) {
|
|
37649
38036
|
if (!this.isValid) return this;
|
|
37650
|
-
var dur =
|
|
38037
|
+
var dur = Duration.fromDurationLike(duration);
|
|
37651
38038
|
return this.plus(dur.negate());
|
|
37652
38039
|
}
|
|
37653
38040
|
/**
|
|
@@ -38024,17 +38411,6 @@ var Duration = /*#__PURE__*/function () {
|
|
|
38024
38411
|
|
|
38025
38412
|
return Duration;
|
|
38026
38413
|
}();
|
|
38027
|
-
function friendlyDuration(durationish) {
|
|
38028
|
-
if (isNumber(durationish)) {
|
|
38029
|
-
return Duration.fromMillis(durationish);
|
|
38030
|
-
} else if (Duration.isDuration(durationish)) {
|
|
38031
|
-
return durationish;
|
|
38032
|
-
} else if (typeof durationish === "object") {
|
|
38033
|
-
return Duration.fromObject(durationish);
|
|
38034
|
-
} else {
|
|
38035
|
-
throw new InvalidArgumentError("Unknown duration argument " + durationish + " of type " + typeof durationish);
|
|
38036
|
-
}
|
|
38037
|
-
}
|
|
38038
38414
|
|
|
38039
38415
|
var INVALID$1 = "Invalid Interval"; // checks if the start is equal to or before the end
|
|
38040
38416
|
|
|
@@ -38054,7 +38430,7 @@ function validateStartEnd(start, end) {
|
|
|
38054
38430
|
*
|
|
38055
38431
|
* Here is a brief overview of the most commonly used methods and getters in Interval:
|
|
38056
38432
|
*
|
|
38057
|
-
* * **Creation** To create an Interval, use {@link Interval
|
|
38433
|
+
* * **Creation** To create an Interval, use {@link Interval#fromDateTimes}, {@link Interval#after}, {@link Interval#before}, or {@link Interval#fromISO}.
|
|
38058
38434
|
* * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.
|
|
38059
38435
|
* * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.
|
|
38060
38436
|
* * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval#merge}, {@link Interval#xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.
|
|
@@ -38146,7 +38522,7 @@ var Interval = /*#__PURE__*/function () {
|
|
|
38146
38522
|
;
|
|
38147
38523
|
|
|
38148
38524
|
Interval.after = function after(start, duration) {
|
|
38149
|
-
var dur =
|
|
38525
|
+
var dur = Duration.fromDurationLike(duration),
|
|
38150
38526
|
dt = friendlyDateTime(start);
|
|
38151
38527
|
return Interval.fromDateTimes(dt, dt.plus(dur));
|
|
38152
38528
|
}
|
|
@@ -38159,7 +38535,7 @@ var Interval = /*#__PURE__*/function () {
|
|
|
38159
38535
|
;
|
|
38160
38536
|
|
|
38161
38537
|
Interval.before = function before(end, duration) {
|
|
38162
|
-
var dur =
|
|
38538
|
+
var dur = Duration.fromDurationLike(duration),
|
|
38163
38539
|
dt = friendlyDateTime(end);
|
|
38164
38540
|
return Interval.fromDateTimes(dt.minus(dur), dt);
|
|
38165
38541
|
}
|
|
@@ -38167,7 +38543,7 @@ var Interval = /*#__PURE__*/function () {
|
|
|
38167
38543
|
* Create an Interval from an ISO 8601 string.
|
|
38168
38544
|
* Accepts `<start>/<end>`, `<start>/<duration>`, and `<duration>/<end>` formats.
|
|
38169
38545
|
* @param {string} text - the ISO string to parse
|
|
38170
|
-
* @param {Object} [opts] - options to pass {@link DateTime
|
|
38546
|
+
* @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}
|
|
38171
38547
|
* @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
|
|
38172
38548
|
* @return {Interval}
|
|
38173
38549
|
*/
|
|
@@ -38378,7 +38754,7 @@ var Interval = /*#__PURE__*/function () {
|
|
|
38378
38754
|
;
|
|
38379
38755
|
|
|
38380
38756
|
_proto.splitBy = function splitBy(duration) {
|
|
38381
|
-
var dur =
|
|
38757
|
+
var dur = Duration.fromDurationLike(duration);
|
|
38382
38758
|
|
|
38383
38759
|
if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) {
|
|
38384
38760
|
return [];
|
|
@@ -38638,7 +39014,7 @@ var Interval = /*#__PURE__*/function () {
|
|
|
38638
39014
|
* Returns an ISO 8601-compliant string representation of time of this Interval.
|
|
38639
39015
|
* The date components are ignored.
|
|
38640
39016
|
* @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
|
|
38641
|
-
* @param {Object} opts - The same options as {@link DateTime
|
|
39017
|
+
* @param {Object} opts - The same options as {@link DateTime#toISO}
|
|
38642
39018
|
* @return {string}
|
|
38643
39019
|
*/
|
|
38644
39020
|
;
|
|
@@ -38649,7 +39025,7 @@ var Interval = /*#__PURE__*/function () {
|
|
|
38649
39025
|
}
|
|
38650
39026
|
/**
|
|
38651
39027
|
* Returns a string representation of this Interval formatted according to the specified format string.
|
|
38652
|
-
* @param {string} dateFormat - the format string. This string formats the start and end time. See {@link DateTime
|
|
39028
|
+
* @param {string} dateFormat - the format string. This string formats the start and end time. See {@link DateTime#toFormat} for details.
|
|
38653
39029
|
* @param {Object} opts - options
|
|
38654
39030
|
* @param {string} [opts.separator = ' – '] - a separator to place between the start and end representations
|
|
38655
39031
|
* @return {string}
|
|
@@ -38789,7 +39165,7 @@ var Info = /*#__PURE__*/function () {
|
|
|
38789
39165
|
* * If `input` is a string containing a valid time zone name, a Zone instance
|
|
38790
39166
|
* with that name is returned.
|
|
38791
39167
|
* * If `input` is a string that doesn't refer to a known time zone, a Zone
|
|
38792
|
-
* instance with {@link Zone
|
|
39168
|
+
* instance with {@link Zone#isValid} == false is returned.
|
|
38793
39169
|
* * If `input is a number, a Zone instance with the specified fixed offset
|
|
38794
39170
|
* in minutes is returned.
|
|
38795
39171
|
* * If `input` is `null` or `undefined`, the default zone is returned.
|
|
@@ -38971,10 +39347,10 @@ var Info = /*#__PURE__*/function () {
|
|
|
38971
39347
|
}
|
|
38972
39348
|
/**
|
|
38973
39349
|
* Return the set of available features in this environment.
|
|
38974
|
-
* Some features of Luxon are not available in all environments. For example, on older browsers,
|
|
39350
|
+
* Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.
|
|
38975
39351
|
* Keys:
|
|
38976
39352
|
* * `relative`: whether this environment supports relative time formatting
|
|
38977
|
-
* @example Info.features() //=> {
|
|
39353
|
+
* @example Info.features() //=> { relative: false }
|
|
38978
39354
|
* @return {Object}
|
|
38979
39355
|
*/
|
|
38980
39356
|
;
|
|
@@ -39365,6 +39741,12 @@ function unitForToken(token, loc) {
|
|
|
39365
39741
|
|
|
39366
39742
|
case "u":
|
|
39367
39743
|
return simple(oneToNine);
|
|
39744
|
+
|
|
39745
|
+
case "uu":
|
|
39746
|
+
return simple(oneOrTwo);
|
|
39747
|
+
|
|
39748
|
+
case "uuu":
|
|
39749
|
+
return intUnit(one);
|
|
39368
39750
|
// meridiem
|
|
39369
39751
|
|
|
39370
39752
|
case "a":
|
|
@@ -40229,7 +40611,7 @@ function lastOpts(argList) {
|
|
|
40229
40611
|
*
|
|
40230
40612
|
* Here is a brief overview of the most commonly used functionality it provides:
|
|
40231
40613
|
*
|
|
40232
|
-
* * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime
|
|
40614
|
+
* * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime#local}, {@link DateTime#utc}, and (most flexibly) {@link DateTime#fromObject}. To create one from a standard string format, use {@link DateTime#fromISO}, {@link DateTime#fromHTTP}, and {@link DateTime#fromRFC2822}. To create one from a custom string format, use {@link DateTime#fromFormat}. To create one from a native JS date, use {@link DateTime#fromJSDate}.
|
|
40233
40615
|
* * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},
|
|
40234
40616
|
* {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.
|
|
40235
40617
|
* * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.
|
|
@@ -40890,7 +41272,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
40890
41272
|
/**
|
|
40891
41273
|
* "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime.
|
|
40892
41274
|
*
|
|
40893
|
-
* Equivalent to {@link DateTime
|
|
41275
|
+
* Equivalent to {@link DateTime#setZone}('utc')
|
|
40894
41276
|
* @param {number} [offset=0] - optionally, an offset from UTC in minutes
|
|
40895
41277
|
* @param {Object} [opts={}] - options to pass to `setZone()`
|
|
40896
41278
|
* @return {DateTime}
|
|
@@ -40922,8 +41304,8 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
40922
41304
|
/**
|
|
40923
41305
|
* "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.
|
|
40924
41306
|
*
|
|
40925
|
-
* By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime
|
|
40926
|
-
* @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime
|
|
41307
|
+
* By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.
|
|
41308
|
+
* @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.
|
|
40927
41309
|
* @param {Object} opts - options
|
|
40928
41310
|
* @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.
|
|
40929
41311
|
* @return {DateTime}
|
|
@@ -40999,7 +41381,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
40999
41381
|
}
|
|
41000
41382
|
/**
|
|
41001
41383
|
* "Set" the values of specified units. Returns a newly-constructed DateTime.
|
|
41002
|
-
* You can only set units with this method; for "setting" metadata, see {@link DateTime
|
|
41384
|
+
* You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.
|
|
41003
41385
|
* @param {Object} values - a mapping of units to numbers
|
|
41004
41386
|
* @example dt.set({ year: 2017 })
|
|
41005
41387
|
* @example dt.set({ hour: 8, minute: 30 })
|
|
@@ -41068,12 +41450,12 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
41068
41450
|
|
|
41069
41451
|
_proto.plus = function plus(duration) {
|
|
41070
41452
|
if (!this.isValid) return this;
|
|
41071
|
-
var dur =
|
|
41453
|
+
var dur = Duration.fromDurationLike(duration);
|
|
41072
41454
|
return clone(this, adjustTime(this, dur));
|
|
41073
41455
|
}
|
|
41074
41456
|
/**
|
|
41075
41457
|
* Subtract a period of time to this DateTime and return the resulting DateTime
|
|
41076
|
-
* See {@link DateTime
|
|
41458
|
+
* See {@link DateTime#plus}
|
|
41077
41459
|
* @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()
|
|
41078
41460
|
@return {DateTime}
|
|
41079
41461
|
*/
|
|
@@ -41081,7 +41463,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
41081
41463
|
|
|
41082
41464
|
_proto.minus = function minus(duration) {
|
|
41083
41465
|
if (!this.isValid) return this;
|
|
41084
|
-
var dur =
|
|
41466
|
+
var dur = Duration.fromDurationLike(duration).negate();
|
|
41085
41467
|
return clone(this, adjustTime(this, dur));
|
|
41086
41468
|
}
|
|
41087
41469
|
/**
|
|
@@ -41161,7 +41543,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
41161
41543
|
|
|
41162
41544
|
/**
|
|
41163
41545
|
* Returns a string representation of this DateTime formatted according to the specified format string.
|
|
41164
|
-
* **You may not want this.** See {@link DateTime
|
|
41546
|
+
* **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).
|
|
41165
41547
|
* Defaults to en-US if no locale has been specified, regardless of the system's locale.
|
|
41166
41548
|
* @param {string} fmt - the format string
|
|
41167
41549
|
* @param {Object} opts - opts to override the configuration options on this DateTime
|
|
@@ -41424,7 +41806,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
41424
41806
|
return this.isValid ? this.toISO() : INVALID;
|
|
41425
41807
|
}
|
|
41426
41808
|
/**
|
|
41427
|
-
* Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime
|
|
41809
|
+
* Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}
|
|
41428
41810
|
* @return {number}
|
|
41429
41811
|
*/
|
|
41430
41812
|
;
|
|
@@ -41549,7 +41931,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
41549
41931
|
}
|
|
41550
41932
|
/**
|
|
41551
41933
|
* Return the difference between this DateTime and right now.
|
|
41552
|
-
* See {@link DateTime
|
|
41934
|
+
* See {@link DateTime#diff}
|
|
41553
41935
|
* @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration
|
|
41554
41936
|
* @param {Object} opts - options that affect the creation of the Duration
|
|
41555
41937
|
* @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use
|
|
@@ -41581,7 +41963,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
41581
41963
|
/**
|
|
41582
41964
|
* Return whether this DateTime is in the same unit of time as another DateTime.
|
|
41583
41965
|
* Higher-order units must also be identical for this function to return `true`.
|
|
41584
|
-
* Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime
|
|
41966
|
+
* Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.
|
|
41585
41967
|
* @param {DateTime} otherDateTime - the other DateTime
|
|
41586
41968
|
* @param {string} unit - the unit of time to check sameness on
|
|
41587
41969
|
* @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day
|
|
@@ -41763,7 +42145,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
41763
42145
|
} // FORMAT PRESETS
|
|
41764
42146
|
|
|
41765
42147
|
/**
|
|
41766
|
-
* {@link DateTime
|
|
42148
|
+
* {@link DateTime#toLocaleString} format like 10/14/1983
|
|
41767
42149
|
* @type {Object}
|
|
41768
42150
|
*/
|
|
41769
42151
|
;
|
|
@@ -42169,7 +42551,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42169
42551
|
return DATE_SHORT;
|
|
42170
42552
|
}
|
|
42171
42553
|
/**
|
|
42172
|
-
* {@link DateTime
|
|
42554
|
+
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983'
|
|
42173
42555
|
* @type {Object}
|
|
42174
42556
|
*/
|
|
42175
42557
|
|
|
@@ -42179,7 +42561,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42179
42561
|
return DATE_MED;
|
|
42180
42562
|
}
|
|
42181
42563
|
/**
|
|
42182
|
-
* {@link DateTime
|
|
42564
|
+
* {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'
|
|
42183
42565
|
* @type {Object}
|
|
42184
42566
|
*/
|
|
42185
42567
|
|
|
@@ -42189,7 +42571,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42189
42571
|
return DATE_MED_WITH_WEEKDAY;
|
|
42190
42572
|
}
|
|
42191
42573
|
/**
|
|
42192
|
-
* {@link DateTime
|
|
42574
|
+
* {@link DateTime#toLocaleString} format like 'October 14, 1983'
|
|
42193
42575
|
* @type {Object}
|
|
42194
42576
|
*/
|
|
42195
42577
|
|
|
@@ -42199,7 +42581,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42199
42581
|
return DATE_FULL;
|
|
42200
42582
|
}
|
|
42201
42583
|
/**
|
|
42202
|
-
* {@link DateTime
|
|
42584
|
+
* {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'
|
|
42203
42585
|
* @type {Object}
|
|
42204
42586
|
*/
|
|
42205
42587
|
|
|
@@ -42209,7 +42591,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42209
42591
|
return DATE_HUGE;
|
|
42210
42592
|
}
|
|
42211
42593
|
/**
|
|
42212
|
-
* {@link DateTime
|
|
42594
|
+
* {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.
|
|
42213
42595
|
* @type {Object}
|
|
42214
42596
|
*/
|
|
42215
42597
|
|
|
@@ -42219,7 +42601,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42219
42601
|
return TIME_SIMPLE;
|
|
42220
42602
|
}
|
|
42221
42603
|
/**
|
|
42222
|
-
* {@link DateTime
|
|
42604
|
+
* {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.
|
|
42223
42605
|
* @type {Object}
|
|
42224
42606
|
*/
|
|
42225
42607
|
|
|
@@ -42229,7 +42611,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42229
42611
|
return TIME_WITH_SECONDS;
|
|
42230
42612
|
}
|
|
42231
42613
|
/**
|
|
42232
|
-
* {@link DateTime
|
|
42614
|
+
* {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.
|
|
42233
42615
|
* @type {Object}
|
|
42234
42616
|
*/
|
|
42235
42617
|
|
|
@@ -42239,7 +42621,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42239
42621
|
return TIME_WITH_SHORT_OFFSET;
|
|
42240
42622
|
}
|
|
42241
42623
|
/**
|
|
42242
|
-
* {@link DateTime
|
|
42624
|
+
* {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
42243
42625
|
* @type {Object}
|
|
42244
42626
|
*/
|
|
42245
42627
|
|
|
@@ -42249,7 +42631,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42249
42631
|
return TIME_WITH_LONG_OFFSET;
|
|
42250
42632
|
}
|
|
42251
42633
|
/**
|
|
42252
|
-
* {@link DateTime
|
|
42634
|
+
* {@link DateTime#toLocaleString} format like '09:30', always 24-hour.
|
|
42253
42635
|
* @type {Object}
|
|
42254
42636
|
*/
|
|
42255
42637
|
|
|
@@ -42259,7 +42641,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42259
42641
|
return TIME_24_SIMPLE;
|
|
42260
42642
|
}
|
|
42261
42643
|
/**
|
|
42262
|
-
* {@link DateTime
|
|
42644
|
+
* {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.
|
|
42263
42645
|
* @type {Object}
|
|
42264
42646
|
*/
|
|
42265
42647
|
|
|
@@ -42269,7 +42651,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42269
42651
|
return TIME_24_WITH_SECONDS;
|
|
42270
42652
|
}
|
|
42271
42653
|
/**
|
|
42272
|
-
* {@link DateTime
|
|
42654
|
+
* {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.
|
|
42273
42655
|
* @type {Object}
|
|
42274
42656
|
*/
|
|
42275
42657
|
|
|
@@ -42279,7 +42661,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42279
42661
|
return TIME_24_WITH_SHORT_OFFSET;
|
|
42280
42662
|
}
|
|
42281
42663
|
/**
|
|
42282
|
-
* {@link DateTime
|
|
42664
|
+
* {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.
|
|
42283
42665
|
* @type {Object}
|
|
42284
42666
|
*/
|
|
42285
42667
|
|
|
@@ -42289,7 +42671,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42289
42671
|
return TIME_24_WITH_LONG_OFFSET;
|
|
42290
42672
|
}
|
|
42291
42673
|
/**
|
|
42292
|
-
* {@link DateTime
|
|
42674
|
+
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
42293
42675
|
* @type {Object}
|
|
42294
42676
|
*/
|
|
42295
42677
|
|
|
@@ -42299,7 +42681,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42299
42681
|
return DATETIME_SHORT;
|
|
42300
42682
|
}
|
|
42301
42683
|
/**
|
|
42302
|
-
* {@link DateTime
|
|
42684
|
+
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
42303
42685
|
* @type {Object}
|
|
42304
42686
|
*/
|
|
42305
42687
|
|
|
@@ -42309,7 +42691,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42309
42691
|
return DATETIME_SHORT_WITH_SECONDS;
|
|
42310
42692
|
}
|
|
42311
42693
|
/**
|
|
42312
|
-
* {@link DateTime
|
|
42694
|
+
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
42313
42695
|
* @type {Object}
|
|
42314
42696
|
*/
|
|
42315
42697
|
|
|
@@ -42319,7 +42701,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42319
42701
|
return DATETIME_MED;
|
|
42320
42702
|
}
|
|
42321
42703
|
/**
|
|
42322
|
-
* {@link DateTime
|
|
42704
|
+
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
42323
42705
|
* @type {Object}
|
|
42324
42706
|
*/
|
|
42325
42707
|
|
|
@@ -42329,7 +42711,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42329
42711
|
return DATETIME_MED_WITH_SECONDS;
|
|
42330
42712
|
}
|
|
42331
42713
|
/**
|
|
42332
|
-
* {@link DateTime
|
|
42714
|
+
* {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
42333
42715
|
* @type {Object}
|
|
42334
42716
|
*/
|
|
42335
42717
|
|
|
@@ -42339,7 +42721,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42339
42721
|
return DATETIME_MED_WITH_WEEKDAY;
|
|
42340
42722
|
}
|
|
42341
42723
|
/**
|
|
42342
|
-
* {@link DateTime
|
|
42724
|
+
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.
|
|
42343
42725
|
* @type {Object}
|
|
42344
42726
|
*/
|
|
42345
42727
|
|
|
@@ -42349,7 +42731,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42349
42731
|
return DATETIME_FULL;
|
|
42350
42732
|
}
|
|
42351
42733
|
/**
|
|
42352
|
-
* {@link DateTime
|
|
42734
|
+
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.
|
|
42353
42735
|
* @type {Object}
|
|
42354
42736
|
*/
|
|
42355
42737
|
|
|
@@ -42359,7 +42741,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42359
42741
|
return DATETIME_FULL_WITH_SECONDS;
|
|
42360
42742
|
}
|
|
42361
42743
|
/**
|
|
42362
|
-
* {@link DateTime
|
|
42744
|
+
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
42363
42745
|
* @type {Object}
|
|
42364
42746
|
*/
|
|
42365
42747
|
|
|
@@ -42369,7 +42751,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42369
42751
|
return DATETIME_HUGE;
|
|
42370
42752
|
}
|
|
42371
42753
|
/**
|
|
42372
|
-
* {@link DateTime
|
|
42754
|
+
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
42373
42755
|
* @type {Object}
|
|
42374
42756
|
*/
|
|
42375
42757
|
|
|
@@ -42394,7 +42776,7 @@ function friendlyDateTime(dateTimeish) {
|
|
|
42394
42776
|
}
|
|
42395
42777
|
}
|
|
42396
42778
|
|
|
42397
|
-
var VERSION = "2.
|
|
42779
|
+
var VERSION = "2.1.1";
|
|
42398
42780
|
|
|
42399
42781
|
exports.DateTime = DateTime;
|
|
42400
42782
|
exports.Duration = Duration;
|
|
@@ -42450,7 +42832,7 @@ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPr
|
|
|
42450
42832
|
: null
|
|
42451
42833
|
);
|
|
42452
42834
|
|
|
42453
|
-
var inspectCustom = __webpack_require__(/*! ./util.inspect */ "?4f7e").custom;
|
|
42835
|
+
var inspectCustom = (__webpack_require__(/*! ./util.inspect */ "?4f7e").custom);
|
|
42454
42836
|
var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
|
|
42455
42837
|
var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null;
|
|
42456
42838
|
|
|
@@ -46071,9 +46453,9 @@ exports.quickSort = function (ary, comparator) {
|
|
|
46071
46453
|
|
|
46072
46454
|
var util = __webpack_require__(/*! ./util */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/util.js");
|
|
46073
46455
|
var binarySearch = __webpack_require__(/*! ./binary-search */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/binary-search.js");
|
|
46074
|
-
var ArraySet = __webpack_require__(/*! ./array-set */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/array-set.js").ArraySet;
|
|
46456
|
+
var ArraySet = (__webpack_require__(/*! ./array-set */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/array-set.js").ArraySet);
|
|
46075
46457
|
var base64VLQ = __webpack_require__(/*! ./base64-vlq */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/base64-vlq.js");
|
|
46076
|
-
var quickSort = __webpack_require__(/*! ./quick-sort */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/quick-sort.js").quickSort;
|
|
46458
|
+
var quickSort = (__webpack_require__(/*! ./quick-sort */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/quick-sort.js").quickSort);
|
|
46077
46459
|
|
|
46078
46460
|
function SourceMapConsumer(aSourceMap) {
|
|
46079
46461
|
var sourceMap = aSourceMap;
|
|
@@ -47163,8 +47545,8 @@ exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
|
|
|
47163
47545
|
|
|
47164
47546
|
var base64VLQ = __webpack_require__(/*! ./base64-vlq */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/base64-vlq.js");
|
|
47165
47547
|
var util = __webpack_require__(/*! ./util */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/util.js");
|
|
47166
|
-
var ArraySet = __webpack_require__(/*! ./array-set */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/array-set.js").ArraySet;
|
|
47167
|
-
var MappingList = __webpack_require__(/*! ./mapping-list */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/mapping-list.js").MappingList;
|
|
47548
|
+
var ArraySet = (__webpack_require__(/*! ./array-set */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/array-set.js").ArraySet);
|
|
47549
|
+
var MappingList = (__webpack_require__(/*! ./mapping-list */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/mapping-list.js").MappingList);
|
|
47168
47550
|
|
|
47169
47551
|
/**
|
|
47170
47552
|
* An instance of the SourceMapGenerator represents a source map which is
|
|
@@ -47575,7 +47957,7 @@ exports.SourceMapGenerator = SourceMapGenerator;
|
|
|
47575
47957
|
* http://opensource.org/licenses/BSD-3-Clause
|
|
47576
47958
|
*/
|
|
47577
47959
|
|
|
47578
|
-
var SourceMapGenerator = __webpack_require__(/*! ./source-map-generator */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator;
|
|
47960
|
+
var SourceMapGenerator = (__webpack_require__(/*! ./source-map-generator */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator);
|
|
47579
47961
|
var util = __webpack_require__(/*! ./util */ "./node_modules/stacktrace-gps/node_modules/source-map/lib/util.js");
|
|
47580
47962
|
|
|
47581
47963
|
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
|