@nmshd/transport 1.1.8 → 1.2.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/ProgressReporter.d.ts +18 -0
- package/dist/core/ProgressReporter.js +45 -0
- package/dist/core/ProgressReporter.js.map +1 -0
- package/dist/core/backbone/Paginator.d.ts +7 -1
- package/dist/core/backbone/Paginator.js +25 -1
- package/dist/core/backbone/Paginator.js.map +1 -1
- package/dist/core/backbone/RESTClient.d.ts +2 -2
- package/dist/core/backbone/RESTClient.js +4 -4
- package/dist/core/backbone/RESTClient.js.map +1 -1
- package/dist/core/backbone/RESTClientAuthenticate.d.ts +2 -2
- package/dist/core/backbone/RESTClientAuthenticate.js +2 -2
- package/dist/core/backbone/RESTClientAuthenticate.js.map +1 -1
- package/dist/core/backbone/index.js +5 -1
- package/dist/core/backbone/index.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +6 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/types/index.js +5 -1
- package/dist/core/types/index.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/modules/accounts/AccountController.d.ts +3 -2
- package/dist/modules/accounts/AccountController.js +7 -4
- package/dist/modules/accounts/AccountController.js.map +1 -1
- package/dist/modules/challenges/ChallengeController.d.ts +5 -2
- package/dist/modules/challenges/ChallengeController.js +21 -27
- package/dist/modules/challenges/ChallengeController.js.map +1 -1
- package/dist/modules/files/FileController.js +3 -20
- package/dist/modules/files/FileController.js.map +1 -1
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +8 -1
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.js +3 -20
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.js.map +1 -1
- package/dist/modules/sync/DatawalletModificationsProcessor.d.ts +3 -1
- package/dist/modules/sync/DatawalletModificationsProcessor.js +14 -1
- package/dist/modules/sync/DatawalletModificationsProcessor.js.map +1 -1
- package/dist/modules/sync/ExternalEventsProcessor.d.ts +3 -1
- package/dist/modules/sync/ExternalEventsProcessor.js +6 -1
- package/dist/modules/sync/ExternalEventsProcessor.js.map +1 -1
- package/dist/modules/sync/SyncCallback.d.ts +17 -0
- package/dist/modules/sync/SyncCallback.js +25 -0
- package/dist/modules/sync/SyncCallback.js.map +1 -0
- package/dist/modules/sync/SyncController.d.ts +6 -4
- package/dist/modules/sync/SyncController.js +55 -31
- package/dist/modules/sync/SyncController.js.map +1 -1
- package/dist/modules/sync/backbone/SyncClient.d.ts +5 -5
- package/dist/modules/sync/backbone/SyncClient.js +4 -4
- package/dist/modules/sync/backbone/SyncClient.js.map +1 -1
- package/dist/modules/tokens/TokenController.js +3 -20
- package/dist/modules/tokens/TokenController.js.map +1 -1
- package/dist/util/index.js +5 -1
- package/dist/util/index.js.map +1 -1
- package/lib-web/nmshd.transport.js +359 -206
- 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 -24
|
@@ -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.
|
|
19
|
-
build: "
|
|
20
|
-
date: "2022-
|
|
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.1","@js-soft/ts-utils":"1.1.1","axios":"^0.
|
|
18
|
+
version: "1.2.0",
|
|
19
|
+
build: "23",
|
|
20
|
+
date: "2022-03-23T10:35:26+00:00",
|
|
21
|
+
commit: "102dd57cad9e2024fba66fb75b70a6360a350b0d",
|
|
22
|
+
dependencies: {"@js-soft/docdb-access-abstractions":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/simple-logger":"1.0.1","@js-soft/ts-utils":"1.1.1","axios":"^0.26.1","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.3.1","qs":"^6.10.3","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
|
|
@@ -585,6 +585,61 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
585
585
|
|
|
586
586
|
/***/ }),
|
|
587
587
|
|
|
588
|
+
/***/ "./dist/core/ProgressReporter.js":
|
|
589
|
+
/*!***************************************!*\
|
|
590
|
+
!*** ./dist/core/ProgressReporter.js ***!
|
|
591
|
+
\***************************************/
|
|
592
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
593
|
+
|
|
594
|
+
"use strict";
|
|
595
|
+
|
|
596
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
597
|
+
exports.ProgressReporterStep = exports.ProgressReporter = void 0;
|
|
598
|
+
class ProgressReporter {
|
|
599
|
+
constructor(callback) {
|
|
600
|
+
this.callback = callback;
|
|
601
|
+
}
|
|
602
|
+
createStep(stepName, totalNumberOfItemsInStep = -1) {
|
|
603
|
+
return new ProgressReporterStep(stepName, totalNumberOfItemsInStep, this.callback);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
exports.ProgressReporter = ProgressReporter;
|
|
607
|
+
class ProgressReporterStep {
|
|
608
|
+
constructor(name, totalNumberOfItems, callback) {
|
|
609
|
+
this.name = name;
|
|
610
|
+
this.totalNumberOfItems = totalNumberOfItems;
|
|
611
|
+
this.callback = callback;
|
|
612
|
+
if (totalNumberOfItems > 0)
|
|
613
|
+
this.progressTo(0);
|
|
614
|
+
}
|
|
615
|
+
progress() {
|
|
616
|
+
this.progressTo(this.currentItem + 1);
|
|
617
|
+
}
|
|
618
|
+
progressTo(itemIndex) {
|
|
619
|
+
var _a;
|
|
620
|
+
this.currentItem = itemIndex;
|
|
621
|
+
(_a = this.callback) === null || _a === void 0 ? void 0 : _a.call(this, Math.round((itemIndex / this.totalNumberOfItems) * 100), this.name);
|
|
622
|
+
}
|
|
623
|
+
incrementTotalNumberOfItems() {
|
|
624
|
+
this.updateTotalNumberOfItems(this.totalNumberOfItems + 1);
|
|
625
|
+
}
|
|
626
|
+
updateTotalNumberOfItems(newValue) {
|
|
627
|
+
this.totalNumberOfItems = newValue;
|
|
628
|
+
}
|
|
629
|
+
finish() {
|
|
630
|
+
if (this.currentItem < this.totalNumberOfItems)
|
|
631
|
+
this.progressTo(this.totalNumberOfItems);
|
|
632
|
+
}
|
|
633
|
+
manualReport(percentage) {
|
|
634
|
+
var _a;
|
|
635
|
+
(_a = this.callback) === null || _a === void 0 ? void 0 : _a.call(this, percentage, this.name);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
exports.ProgressReporterStep = ProgressReporterStep;
|
|
639
|
+
//# sourceMappingURL=ProgressReporter.js.map
|
|
640
|
+
|
|
641
|
+
/***/ }),
|
|
642
|
+
|
|
588
643
|
/***/ "./dist/core/Transport.js":
|
|
589
644
|
/*!********************************!*\
|
|
590
645
|
!*** ./dist/core/Transport.js ***!
|
|
@@ -1398,11 +1453,15 @@ exports.ClientResult = ClientResult;
|
|
|
1398
1453
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1399
1454
|
exports.Paginator = void 0;
|
|
1400
1455
|
class Paginator {
|
|
1401
|
-
constructor(currentPage, paginationProperties, dataSource) {
|
|
1456
|
+
constructor(currentPage, paginationProperties, dataSource, progessCallback) {
|
|
1402
1457
|
this.currentPage = currentPage;
|
|
1403
1458
|
this.paginationProperties = paginationProperties;
|
|
1404
1459
|
this.dataSource = dataSource;
|
|
1460
|
+
this.progessCallback = progessCallback;
|
|
1405
1461
|
this.currentItemIndex = 0;
|
|
1462
|
+
this.processedItemCount = 0;
|
|
1463
|
+
if (progessCallback)
|
|
1464
|
+
progessCallback(0);
|
|
1406
1465
|
}
|
|
1407
1466
|
hasNext() {
|
|
1408
1467
|
return this.hasNextPage() || this.currentItemIndex < this.currentPage.length;
|
|
@@ -1413,8 +1472,19 @@ class Paginator {
|
|
|
1413
1472
|
this.currentItemIndex = 0;
|
|
1414
1473
|
this.currentPage = await this.nextPage();
|
|
1415
1474
|
}
|
|
1475
|
+
this.processedItemCount++;
|
|
1476
|
+
this.sendProgess();
|
|
1416
1477
|
return this.currentPage[this.currentItemIndex++];
|
|
1417
1478
|
}
|
|
1479
|
+
sendProgess() {
|
|
1480
|
+
if (!this.progessCallback)
|
|
1481
|
+
return;
|
|
1482
|
+
if (this.processedItemCount === this.paginationProperties.totalRecords)
|
|
1483
|
+
return this.progessCallback(100);
|
|
1484
|
+
if (this.processedItemCount % 10 !== 0)
|
|
1485
|
+
return;
|
|
1486
|
+
this.progessCallback(Math.round((this.processedItemCount / this.paginationProperties.totalRecords) * 100));
|
|
1487
|
+
}
|
|
1418
1488
|
hasNextPage() {
|
|
1419
1489
|
return this.paginationProperties.pageNumber < this.paginationProperties.totalPages;
|
|
1420
1490
|
}
|
|
@@ -1424,9 +1494,12 @@ class Paginator {
|
|
|
1424
1494
|
return response;
|
|
1425
1495
|
}
|
|
1426
1496
|
async collect() {
|
|
1497
|
+
var _a, _b;
|
|
1427
1498
|
const collection = this.currentPage;
|
|
1499
|
+
(_a = this.progessCallback) === null || _a === void 0 ? void 0 : _a.call(this, this.pagePercentage);
|
|
1428
1500
|
while (this.hasNextPage()) {
|
|
1429
1501
|
collection.push(...(await this.nextPage()));
|
|
1502
|
+
(_b = this.progessCallback) === null || _b === void 0 ? void 0 : _b.call(this, this.pagePercentage);
|
|
1430
1503
|
}
|
|
1431
1504
|
return collection;
|
|
1432
1505
|
}
|
|
@@ -1435,6 +1508,12 @@ class Paginator {
|
|
|
1435
1508
|
next: async () => this.hasNext() ? { value: await this.next(), done: false } : { value: undefined, done: true }
|
|
1436
1509
|
};
|
|
1437
1510
|
}
|
|
1511
|
+
get pagePercentage() {
|
|
1512
|
+
return Math.round((this.paginationProperties.pageNumber / this.paginationProperties.totalPages) * 100);
|
|
1513
|
+
}
|
|
1514
|
+
get totalRecords() {
|
|
1515
|
+
return this.paginationProperties.totalRecords;
|
|
1516
|
+
}
|
|
1438
1517
|
}
|
|
1439
1518
|
exports.Paginator = Paginator;
|
|
1440
1519
|
//# sourceMappingURL=Paginator.js.map
|
|
@@ -1646,7 +1725,7 @@ class RESTClient {
|
|
|
1646
1725
|
}
|
|
1647
1726
|
return ClientResult_1.ClientResult.ok(response.data.result, platformParameters);
|
|
1648
1727
|
}
|
|
1649
|
-
getPaginator(path, response, requestId, args) {
|
|
1728
|
+
getPaginator(path, response, requestId, args, progessCallback) {
|
|
1650
1729
|
var _a, _b;
|
|
1651
1730
|
const platformParameters = {
|
|
1652
1731
|
requestTime: response.headers["x-request-time"],
|
|
@@ -1691,7 +1770,7 @@ class RESTClient {
|
|
|
1691
1770
|
};
|
|
1692
1771
|
}
|
|
1693
1772
|
const paginationDataSource = new RestPaginationDataSource(this, path, args);
|
|
1694
|
-
const paginator = new Paginator_1.Paginator(response.data.result, response.data.pagination, paginationDataSource);
|
|
1773
|
+
const paginator = new Paginator_1.Paginator(response.data.result, response.data.pagination, paginationDataSource, progessCallback);
|
|
1695
1774
|
return ClientResult_1.ClientResult.ok(paginator, platformParameters);
|
|
1696
1775
|
}
|
|
1697
1776
|
async get(path, params = {}, config) {
|
|
@@ -1716,12 +1795,12 @@ class RESTClient {
|
|
|
1716
1795
|
return ClientResult_1.ClientResult.fail(err);
|
|
1717
1796
|
}
|
|
1718
1797
|
}
|
|
1719
|
-
async getPaged(path, params = {}, config) {
|
|
1798
|
+
async getPaged(path, params = {}, config, progessCallback) {
|
|
1720
1799
|
const id = await this.generateRequestId();
|
|
1721
1800
|
const conf = lodash_1.default.defaultsDeep({ params: params }, config, this.requestConfig);
|
|
1722
1801
|
try {
|
|
1723
1802
|
const response = await this.createAxios().get(path, conf);
|
|
1724
|
-
return this.getPaginator(path, response, id, params);
|
|
1803
|
+
return this.getPaginator(path, response, id, params, progessCallback);
|
|
1725
1804
|
}
|
|
1726
1805
|
catch (e) {
|
|
1727
1806
|
const err = RequestError_1.RequestError.fromAxiosError("GET", path, e, id);
|
|
@@ -1917,9 +1996,9 @@ class RESTClientAuthenticate extends RESTClient_1.RESTClient {
|
|
|
1917
1996
|
return await super.get(path, params, this.buildAuthenticatedConfig(token, config));
|
|
1918
1997
|
});
|
|
1919
1998
|
}
|
|
1920
|
-
async getPaged(path, params = {}, config = {}) {
|
|
1999
|
+
async getPaged(path, params = {}, config = {}, progessCallback) {
|
|
1921
2000
|
return await this.runAuthenticated(async (token) => {
|
|
1922
|
-
return await super.getPaged(path, params, this.buildAuthenticatedConfig(token, config));
|
|
2001
|
+
return await super.getPaged(path, params, this.buildAuthenticatedConfig(token, config), progessCallback);
|
|
1923
2002
|
});
|
|
1924
2003
|
}
|
|
1925
2004
|
async post(path, data, params = {}, config = {}) {
|
|
@@ -2078,7 +2157,11 @@ exports.RequestError = RequestError;
|
|
|
2078
2157
|
|
|
2079
2158
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2080
2159
|
if (k2 === undefined) k2 = k;
|
|
2081
|
-
Object.
|
|
2160
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2161
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2162
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2163
|
+
}
|
|
2164
|
+
Object.defineProperty(o, k2, desc);
|
|
2082
2165
|
}) : (function(o, m, k, k2) {
|
|
2083
2166
|
if (k2 === undefined) k2 = k;
|
|
2084
2167
|
o[k2] = m[k];
|
|
@@ -2108,7 +2191,11 @@ __exportStar(__webpack_require__(/*! ./RESTClientAuthenticate */ "./dist/core/ba
|
|
|
2108
2191
|
|
|
2109
2192
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2110
2193
|
if (k2 === undefined) k2 = k;
|
|
2111
|
-
Object.
|
|
2194
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2195
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2196
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2197
|
+
}
|
|
2198
|
+
Object.defineProperty(o, k2, desc);
|
|
2112
2199
|
}) : (function(o, m, k, k2) {
|
|
2113
2200
|
if (k2 === undefined) k2 = k;
|
|
2114
2201
|
o[k2] = m[k];
|
|
@@ -2126,6 +2213,7 @@ __exportStar(__webpack_require__(/*! ./CoreSerializableAsync */ "./dist/core/Cor
|
|
|
2126
2213
|
__exportStar(__webpack_require__(/*! ./CoreSynchronizable */ "./dist/core/CoreSynchronizable.js"), exports);
|
|
2127
2214
|
__exportStar(__webpack_require__(/*! ./CoreUtil */ "./dist/core/CoreUtil.js"), exports);
|
|
2128
2215
|
__exportStar(__webpack_require__(/*! ./DependencyOverrides */ "./dist/core/DependencyOverrides.js"), exports);
|
|
2216
|
+
__exportStar(__webpack_require__(/*! ./ProgressReporter */ "./dist/core/ProgressReporter.js"), exports);
|
|
2129
2217
|
__exportStar(__webpack_require__(/*! ./Transport */ "./dist/core/Transport.js"), exports);
|
|
2130
2218
|
__exportStar(__webpack_require__(/*! ./TransportContext */ "./dist/core/TransportContext.js"), exports);
|
|
2131
2219
|
__exportStar(__webpack_require__(/*! ./TransportController */ "./dist/core/TransportController.js"), exports);
|
|
@@ -2550,7 +2638,11 @@ var TransportVersion;
|
|
|
2550
2638
|
|
|
2551
2639
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2552
2640
|
if (k2 === undefined) k2 = k;
|
|
2553
|
-
Object.
|
|
2641
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2642
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2643
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2644
|
+
}
|
|
2645
|
+
Object.defineProperty(o, k2, desc);
|
|
2554
2646
|
}) : (function(o, m, k, k2) {
|
|
2555
2647
|
if (k2 === undefined) k2 = k;
|
|
2556
2648
|
o[k2] = m[k];
|
|
@@ -2578,7 +2670,11 @@ __exportStar(__webpack_require__(/*! ./TransportVersion */ "./dist/core/types/Tr
|
|
|
2578
2670
|
|
|
2579
2671
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2580
2672
|
if (k2 === undefined) k2 = k;
|
|
2581
|
-
Object.
|
|
2673
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2674
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2675
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2676
|
+
}
|
|
2677
|
+
Object.defineProperty(o, k2, desc);
|
|
2582
2678
|
}) : (function(o, m, k, k2) {
|
|
2583
2679
|
if (k2 === undefined) k2 = k;
|
|
2584
2680
|
o[k2] = m[k];
|
|
@@ -2629,6 +2725,7 @@ const RelationshipsController_1 = __webpack_require__(/*! ../relationships/Relat
|
|
|
2629
2725
|
const RelationshipSecretController_1 = __webpack_require__(/*! ../relationships/RelationshipSecretController */ "./dist/modules/relationships/RelationshipSecretController.js");
|
|
2630
2726
|
const RelationshipTemplateController_1 = __webpack_require__(/*! ../relationshipTemplates/RelationshipTemplateController */ "./dist/modules/relationshipTemplates/RelationshipTemplateController.js");
|
|
2631
2727
|
const SecretController_1 = __webpack_require__(/*! ../secrets/SecretController */ "./dist/modules/secrets/SecretController.js");
|
|
2728
|
+
const SyncCallback_1 = __webpack_require__(/*! ../sync/SyncCallback */ "./dist/modules/sync/SyncCallback.js");
|
|
2632
2729
|
const SyncController_1 = __webpack_require__(/*! ../sync/SyncController */ "./dist/modules/sync/SyncController.js");
|
|
2633
2730
|
const SynchronizedCollection_1 = __webpack_require__(/*! ../sync/SynchronizedCollection */ "./dist/modules/sync/SynchronizedCollection.js");
|
|
2634
2731
|
const TokenController_1 = __webpack_require__(/*! ../tokens/TokenController */ "./dist/modules/tokens/TokenController.js");
|
|
@@ -2764,14 +2861,16 @@ class AccountController {
|
|
|
2764
2861
|
this.autoSync = true;
|
|
2765
2862
|
await this.syncDatawallet();
|
|
2766
2863
|
}
|
|
2767
|
-
async syncDatawallet(force = false) {
|
|
2864
|
+
async syncDatawallet(force = false, syncProgressCallback) {
|
|
2768
2865
|
if (!force && !this.autoSync) {
|
|
2769
2866
|
return;
|
|
2770
2867
|
}
|
|
2771
|
-
|
|
2868
|
+
const reporter = SyncCallback_1.SyncProgressReporter.fromCallback(syncProgressCallback);
|
|
2869
|
+
return await this.synchronization.sync("OnlyDatawallet", reporter);
|
|
2772
2870
|
}
|
|
2773
|
-
async syncEverything() {
|
|
2774
|
-
|
|
2871
|
+
async syncEverything(syncProgressCallback) {
|
|
2872
|
+
const reporter = SyncCallback_1.SyncProgressReporter.fromCallback(syncProgressCallback);
|
|
2873
|
+
return await this.synchronization.sync("Everything", reporter);
|
|
2775
2874
|
}
|
|
2776
2875
|
async getLastCompletedSyncTime() {
|
|
2777
2876
|
return await this.synchronization.getLastCompletedSyncTime();
|
|
@@ -4103,51 +4202,45 @@ class ChallengeController extends TransportController_1.TransportController {
|
|
|
4103
4202
|
this.authClient = new ChallengeAuthClient_1.ChallengeAuthClient(this.config, this.parent.authenticator);
|
|
4104
4203
|
return this;
|
|
4105
4204
|
}
|
|
4106
|
-
async
|
|
4107
|
-
if (!challenge.createdBy)
|
|
4108
|
-
return;
|
|
4109
|
-
}
|
|
4205
|
+
async validateChallengeLocally(challenge, signedChallenge) {
|
|
4206
|
+
if (!challenge.createdBy)
|
|
4207
|
+
return { isValid: false };
|
|
4110
4208
|
const relationship = await this.parent.relationships.getActiveRelationshipToIdentity(challenge.createdBy);
|
|
4111
4209
|
if (!relationship) {
|
|
4112
4210
|
throw core_1.TransportErrors.general.recordNotFound(Relationship_1.Relationship, challenge.createdBy.toString());
|
|
4113
4211
|
}
|
|
4114
4212
|
const challengeBuffer = crypto_1.CoreBuffer.fromUtf8(signedChallenge.challenge);
|
|
4115
|
-
let
|
|
4213
|
+
let isValid = false;
|
|
4116
4214
|
switch (challenge.type) {
|
|
4117
4215
|
case Challenge_1.ChallengeType.Identity:
|
|
4118
|
-
|
|
4216
|
+
isValid = await this.parent.relationships.verifyIdentity(relationship, challengeBuffer, signedChallenge.signature);
|
|
4119
4217
|
break;
|
|
4120
4218
|
case Challenge_1.ChallengeType.Device:
|
|
4121
4219
|
throw core_1.TransportErrors.general.notImplemented().logWith(this._log);
|
|
4122
4220
|
case Challenge_1.ChallengeType.Relationship:
|
|
4123
|
-
|
|
4221
|
+
isValid = await this.parent.relationships.verify(relationship, challengeBuffer, signedChallenge.signature);
|
|
4124
4222
|
break;
|
|
4125
4223
|
}
|
|
4126
|
-
if (!
|
|
4127
|
-
return;
|
|
4128
|
-
}
|
|
4129
|
-
return relationship;
|
|
4224
|
+
if (!isValid)
|
|
4225
|
+
return { isValid: false };
|
|
4226
|
+
return { isValid: true, correspondingRelationship: relationship };
|
|
4130
4227
|
}
|
|
4131
|
-
async
|
|
4228
|
+
async validateChallenge(signedChallenge, requiredType) {
|
|
4132
4229
|
const challenge = await Challenge_1.Challenge.deserialize(signedChallenge.challenge);
|
|
4133
|
-
if (requiredType && challenge.type !== requiredType)
|
|
4134
|
-
return;
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
this.authClient.getChallenge(challenge.id.toString())
|
|
4142
|
-
]);
|
|
4143
|
-
if (!relationship ||
|
|
4144
|
-
(challenge.createdBy && response.value.createdBy !== challenge.createdBy.toString()) ||
|
|
4230
|
+
if (requiredType && challenge.type !== requiredType)
|
|
4231
|
+
return { isValid: false };
|
|
4232
|
+
if (challenge.expiresAt.isExpired())
|
|
4233
|
+
return { isValid: false };
|
|
4234
|
+
const backboneChallengeResponse = await this.authClient.getChallenge(challenge.id.toString());
|
|
4235
|
+
if (backboneChallengeResponse.isError)
|
|
4236
|
+
return { isValid: false };
|
|
4237
|
+
if ((challenge.createdBy && backboneChallengeResponse.value.createdBy !== challenge.createdBy.toString()) ||
|
|
4145
4238
|
// TODO: JSSNMSHDD-2472 (Reenable check once the backbone returns with same timestamp)
|
|
4146
4239
|
// response.expiresAt !== challenge.expiresAt.toString() ||
|
|
4147
|
-
|
|
4148
|
-
return;
|
|
4240
|
+
backboneChallengeResponse.value.id !== challenge.id.toString()) {
|
|
4241
|
+
return { isValid: false };
|
|
4149
4242
|
}
|
|
4150
|
-
return
|
|
4243
|
+
return await this.validateChallengeLocally(challenge, signedChallenge);
|
|
4151
4244
|
}
|
|
4152
4245
|
async createAccountCreationChallenge(identity) {
|
|
4153
4246
|
const backboneResponse = (await this.client.createChallenge()).value;
|
|
@@ -5252,29 +5345,12 @@ class FileController extends TransportController_1.TransportController {
|
|
|
5252
5345
|
if (ids.length < 1) {
|
|
5253
5346
|
return [];
|
|
5254
5347
|
}
|
|
5348
|
+
// TODO: JSSNMSHDD-2820 (check for items that couldn't be fetched e.g. because it is expired)
|
|
5349
|
+
const resultItems = (await this.client.getFiles({ ids })).value;
|
|
5255
5350
|
const promises = [];
|
|
5256
|
-
for (const id of ids) {
|
|
5257
|
-
const result = await this.client.getFile(id);
|
|
5258
|
-
if (result.isError) {
|
|
5259
|
-
if (result.error.code === "error.transport.recordNotFound" ||
|
|
5260
|
-
result.error.code === "error.transport.request.notFound" ||
|
|
5261
|
-
result.error.code === "error.platform.recordNotFound") {
|
|
5262
|
-
this.log.warn(`Record id ${id} could not be found on backbone. It might be expired.`, result.error);
|
|
5263
|
-
continue;
|
|
5264
|
-
}
|
|
5265
|
-
throw result.error;
|
|
5266
|
-
}
|
|
5267
|
-
const resultItem = result.value;
|
|
5268
|
-
promises.push(this.updateCacheOfExistingFileInDb(resultItem.id, resultItem));
|
|
5269
|
-
}
|
|
5270
|
-
/*
|
|
5271
|
-
// TODO: Optimize once backbone handling is clarified
|
|
5272
|
-
const resultItems = (await this.client.getFiles({ ids })).value
|
|
5273
|
-
const promises = []
|
|
5274
5351
|
for await (const resultItem of resultItems) {
|
|
5275
|
-
promises.push(this.updateCacheOfExistingFileInDb(resultItem.id, resultItem))
|
|
5352
|
+
promises.push(this.updateCacheOfExistingFileInDb(resultItem.id, resultItem));
|
|
5276
5353
|
}
|
|
5277
|
-
*/
|
|
5278
5354
|
return await Promise.all(promises);
|
|
5279
5355
|
}
|
|
5280
5356
|
async updateCacheOfExistingFileInDb(id, response) {
|
|
@@ -5988,7 +6064,11 @@ exports.FileReference = FileReference;
|
|
|
5988
6064
|
|
|
5989
6065
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5990
6066
|
if (k2 === undefined) k2 = k;
|
|
5991
|
-
Object.
|
|
6067
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6068
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6069
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6070
|
+
}
|
|
6071
|
+
Object.defineProperty(o, k2, desc);
|
|
5992
6072
|
}) : (function(o, m, k, k2) {
|
|
5993
6073
|
if (k2 === undefined) k2 = k;
|
|
5994
6074
|
o[k2] = m[k];
|
|
@@ -5997,6 +6077,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
5997
6077
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
5998
6078
|
};
|
|
5999
6079
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6080
|
+
exports.SyncStep = void 0;
|
|
6000
6081
|
__exportStar(__webpack_require__(/*! ./accounts/AccountController */ "./dist/modules/accounts/AccountController.js"), exports);
|
|
6001
6082
|
__exportStar(__webpack_require__(/*! ./accounts/backbone/IdentityClient */ "./dist/modules/accounts/backbone/IdentityClient.js"), exports);
|
|
6002
6083
|
__exportStar(__webpack_require__(/*! ./accounts/data/Identity */ "./dist/modules/accounts/data/Identity.js"), exports);
|
|
@@ -6101,6 +6182,8 @@ __exportStar(__webpack_require__(/*! ./sync/ChangedItems */ "./dist/modules/sync
|
|
|
6101
6182
|
__exportStar(__webpack_require__(/*! ./sync/DatawalletModificationsProcessor */ "./dist/modules/sync/DatawalletModificationsProcessor.js"), exports);
|
|
6102
6183
|
__exportStar(__webpack_require__(/*! ./sync/ExternalEventsProcessor */ "./dist/modules/sync/ExternalEventsProcessor.js"), exports);
|
|
6103
6184
|
__exportStar(__webpack_require__(/*! ./sync/local/DatawalletModification */ "./dist/modules/sync/local/DatawalletModification.js"), exports);
|
|
6185
|
+
var SyncCallback_1 = __webpack_require__(/*! ./sync/SyncCallback */ "./dist/modules/sync/SyncCallback.js");
|
|
6186
|
+
Object.defineProperty(exports, "SyncStep", ({ enumerable: true, get: function () { return SyncCallback_1.SyncStep; } }));
|
|
6104
6187
|
__exportStar(__webpack_require__(/*! ./sync/SyncController */ "./dist/modules/sync/SyncController.js"), exports);
|
|
6105
6188
|
__exportStar(__webpack_require__(/*! ./sync/SynchronizedCollection */ "./dist/modules/sync/SynchronizedCollection.js"), exports);
|
|
6106
6189
|
__exportStar(__webpack_require__(/*! ./tokens/AnonymousTokenController */ "./dist/modules/tokens/AnonymousTokenController.js"), exports);
|
|
@@ -7160,29 +7243,12 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
|
|
|
7160
7243
|
if (ids.length < 1) {
|
|
7161
7244
|
return [];
|
|
7162
7245
|
}
|
|
7246
|
+
// TODO: JSSNMSHDD-2820 (check for items that couldn't be fetched e.g. because it is expired)
|
|
7247
|
+
const resultItems = (await this.client.getRelationshipTemplates({ ids })).value;
|
|
7163
7248
|
const promises = [];
|
|
7164
|
-
for (const id of ids) {
|
|
7165
|
-
const result = await this.client.getRelationshipTemplate(id);
|
|
7166
|
-
if (result.isError) {
|
|
7167
|
-
if (result.error.code === "error.transport.recordNotFound" ||
|
|
7168
|
-
result.error.code === "error.transport.request.notFound" ||
|
|
7169
|
-
result.error.code === "error.platform.recordNotFound") {
|
|
7170
|
-
this.log.warn(`Record id ${id} could not be found on backbone. It might be expired.`, result.error);
|
|
7171
|
-
continue;
|
|
7172
|
-
}
|
|
7173
|
-
throw result.error;
|
|
7174
|
-
}
|
|
7175
|
-
const resultItem = result.value;
|
|
7176
|
-
promises.push(this.updateCacheOfExistingTemplateInDb(resultItem.id, resultItem));
|
|
7177
|
-
}
|
|
7178
|
-
/*
|
|
7179
|
-
// TODO: Optimize once backbone handling is clarified
|
|
7180
|
-
const resultItems = (await this.client.getRelationshipTemplates({ ids })).value
|
|
7181
|
-
const promises = []
|
|
7182
7249
|
for await (const resultItem of resultItems) {
|
|
7183
|
-
promises.push(this.updateCacheOfExistingTemplateInDb(resultItem.id, resultItem))
|
|
7250
|
+
promises.push(this.updateCacheOfExistingTemplateInDb(resultItem.id, resultItem));
|
|
7184
7251
|
}
|
|
7185
|
-
*/
|
|
7186
7252
|
return await Promise.all(promises);
|
|
7187
7253
|
}
|
|
7188
7254
|
async fetchCaches(ids) {
|
|
@@ -9843,8 +9909,9 @@ const Relationship_1 = __webpack_require__(/*! ../relationships/local/Relationsh
|
|
|
9843
9909
|
const RelationshipTemplate_1 = __webpack_require__(/*! ../relationshipTemplates/local/RelationshipTemplate */ "./dist/modules/relationshipTemplates/local/RelationshipTemplate.js");
|
|
9844
9910
|
const Token_1 = __webpack_require__(/*! ../tokens/local/Token */ "./dist/modules/tokens/local/Token.js");
|
|
9845
9911
|
const DatawalletModification_1 = __webpack_require__(/*! ./local/DatawalletModification */ "./dist/modules/sync/local/DatawalletModification.js");
|
|
9912
|
+
const SyncCallback_1 = __webpack_require__(/*! ./SyncCallback */ "./dist/modules/sync/SyncCallback.js");
|
|
9846
9913
|
class DatawalletModificationsProcessor {
|
|
9847
|
-
constructor(modifications, cacheFetcher, collectionProvider, logger) {
|
|
9914
|
+
constructor(modifications, cacheFetcher, collectionProvider, logger, reporter) {
|
|
9848
9915
|
var _a, _b, _c, _d;
|
|
9849
9916
|
this.cacheFetcher = cacheFetcher;
|
|
9850
9917
|
this.collectionProvider = collectionProvider;
|
|
@@ -9861,12 +9928,17 @@ class DatawalletModificationsProcessor {
|
|
|
9861
9928
|
this.updates = (_b = modificationsGroupedByType[DatawalletModification_1.DatawalletModificationType.Update]) !== null && _b !== void 0 ? _b : [];
|
|
9862
9929
|
this.deletes = (_c = modificationsGroupedByType[DatawalletModification_1.DatawalletModificationType.Delete]) !== null && _c !== void 0 ? _c : [];
|
|
9863
9930
|
this.cacheChanges = (_d = modificationsGroupedByType[DatawalletModification_1.DatawalletModificationType.CacheChanged]) !== null && _d !== void 0 ? _d : [];
|
|
9931
|
+
const totalItems = this.creates.length + this.updates.length + this.deletes.length + this.cacheChanges.length;
|
|
9932
|
+
this.syncStep = reporter.createStep(SyncCallback_1.SyncStep.DatawalletSyncProcessing, totalItems);
|
|
9864
9933
|
}
|
|
9865
9934
|
async execute() {
|
|
9866
9935
|
await this.applyCreates();
|
|
9867
9936
|
await this.applyUpdates();
|
|
9868
9937
|
await this.applyCacheChanges();
|
|
9869
9938
|
await this.applyDeletes();
|
|
9939
|
+
// cache-fills are optimized by the backbone, so it is possible that the processedItemCount is
|
|
9940
|
+
// lower than the total number of items - in this case the 100% callback is triggered here
|
|
9941
|
+
this.syncStep.finish();
|
|
9870
9942
|
}
|
|
9871
9943
|
async applyCreates() {
|
|
9872
9944
|
if (this.creates.length === 0) {
|
|
@@ -9896,8 +9968,10 @@ class DatawalletModificationsProcessor {
|
|
|
9896
9968
|
objectIdentifier: core_1.CoreId.from(objectIdentifier)
|
|
9897
9969
|
});
|
|
9898
9970
|
this.cacheChanges.push(modification);
|
|
9971
|
+
this.syncStep.incrementTotalNumberOfItems();
|
|
9899
9972
|
}
|
|
9900
9973
|
await targetCollection.create(newObject);
|
|
9974
|
+
this.syncStep.progress();
|
|
9901
9975
|
}
|
|
9902
9976
|
}
|
|
9903
9977
|
async applyUpdates() {
|
|
@@ -9913,6 +9987,7 @@ class DatawalletModificationsProcessor {
|
|
|
9913
9987
|
const oldObject = await core_1.CoreSerializableAsync.fromUnknown(oldDoc);
|
|
9914
9988
|
const newObject = { ...oldObject.toJSON(), ...updateModification.payload };
|
|
9915
9989
|
await targetCollection.update(oldDoc, newObject);
|
|
9990
|
+
this.syncStep.progress();
|
|
9916
9991
|
}
|
|
9917
9992
|
}
|
|
9918
9993
|
async applyCacheChanges() {
|
|
@@ -9960,12 +10035,15 @@ class DatawalletModificationsProcessor {
|
|
|
9960
10035
|
return { fileIds, messageIds, relationshipTemplateIds: templateIds, tokenIds, relationshipIds };
|
|
9961
10036
|
}
|
|
9962
10037
|
async saveNewCaches(caches, collectionName, constructorOfT) {
|
|
10038
|
+
if (caches.length === 0)
|
|
10039
|
+
return;
|
|
9963
10040
|
const collection = await this.collectionProvider.getCollection(collectionName);
|
|
9964
10041
|
await Promise.all(caches.map(async (c) => {
|
|
9965
10042
|
const itemDoc = await collection.read(c.id.toString());
|
|
9966
10043
|
const item = await core_1.CoreSerializableAsync.fromT(itemDoc, constructorOfT);
|
|
9967
10044
|
item.setCache(c.cache);
|
|
9968
10045
|
await collection.update(itemDoc, item);
|
|
10046
|
+
this.syncStep.progress();
|
|
9969
10047
|
}));
|
|
9970
10048
|
}
|
|
9971
10049
|
async applyDeletes() {
|
|
@@ -9975,6 +10053,7 @@ class DatawalletModificationsProcessor {
|
|
|
9975
10053
|
for (const deleteModification of this.deletes) {
|
|
9976
10054
|
const targetCollection = await this.collectionProvider.getCollection(deleteModification.collection);
|
|
9977
10055
|
await targetCollection.delete({ id: deleteModification.objectIdentifier });
|
|
10056
|
+
this.syncStep.progress();
|
|
9978
10057
|
}
|
|
9979
10058
|
}
|
|
9980
10059
|
}
|
|
@@ -10028,14 +10107,16 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
10028
10107
|
exports.ExternalEventsProcessor = void 0;
|
|
10029
10108
|
const core_1 = __webpack_require__(/*! ../../core */ "./dist/core/index.js");
|
|
10030
10109
|
const ChangedItems_1 = __webpack_require__(/*! ./ChangedItems */ "./dist/modules/sync/ChangedItems.js");
|
|
10110
|
+
const SyncCallback_1 = __webpack_require__(/*! ./SyncCallback */ "./dist/modules/sync/SyncCallback.js");
|
|
10031
10111
|
class ExternalEventsProcessor {
|
|
10032
|
-
constructor(messagesController, relationshipsController, externalEvents) {
|
|
10112
|
+
constructor(messagesController, relationshipsController, externalEvents, reporter) {
|
|
10033
10113
|
this.messagesController = messagesController;
|
|
10034
10114
|
this.relationshipsController = relationshipsController;
|
|
10035
10115
|
this.externalEvents = externalEvents;
|
|
10036
10116
|
this.changedItems = new ChangedItems_1.ChangedItems();
|
|
10037
10117
|
this.results = [];
|
|
10038
10118
|
this.log = core_1.TransportLoggerFactory.getLogger(ExternalEventsProcessor);
|
|
10119
|
+
this.syncStep = reporter.createStep(SyncCallback_1.SyncStep.ExternalEventsProcessing, externalEvents.length);
|
|
10039
10120
|
}
|
|
10040
10121
|
async execute() {
|
|
10041
10122
|
for (const externalEvent of this.externalEvents) {
|
|
@@ -10077,6 +10158,9 @@ class ExternalEventsProcessor {
|
|
|
10077
10158
|
errorCode: errorCode
|
|
10078
10159
|
});
|
|
10079
10160
|
}
|
|
10161
|
+
finally {
|
|
10162
|
+
this.syncStep.progress();
|
|
10163
|
+
}
|
|
10080
10164
|
}
|
|
10081
10165
|
}
|
|
10082
10166
|
async applyRelationshipChangeCompletedEvent(externalEvent) {
|
|
@@ -10109,6 +10193,41 @@ exports.ExternalEventsProcessor = ExternalEventsProcessor;
|
|
|
10109
10193
|
|
|
10110
10194
|
/***/ }),
|
|
10111
10195
|
|
|
10196
|
+
/***/ "./dist/modules/sync/SyncCallback.js":
|
|
10197
|
+
/*!*******************************************!*\
|
|
10198
|
+
!*** ./dist/modules/sync/SyncCallback.js ***!
|
|
10199
|
+
\*******************************************/
|
|
10200
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10201
|
+
|
|
10202
|
+
"use strict";
|
|
10203
|
+
|
|
10204
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10205
|
+
exports.SyncStep = exports.SyncProgressReporterStep = exports.SyncProgressReporter = void 0;
|
|
10206
|
+
const core_1 = __webpack_require__(/*! ../../core */ "./dist/core/index.js");
|
|
10207
|
+
class SyncProgressReporter extends core_1.ProgressReporter {
|
|
10208
|
+
static fromCallback(callback) {
|
|
10209
|
+
return new SyncProgressReporter(callback);
|
|
10210
|
+
}
|
|
10211
|
+
}
|
|
10212
|
+
exports.SyncProgressReporter = SyncProgressReporter;
|
|
10213
|
+
class SyncProgressReporterStep extends core_1.ProgressReporterStep {
|
|
10214
|
+
}
|
|
10215
|
+
exports.SyncProgressReporterStep = SyncProgressReporterStep;
|
|
10216
|
+
var SyncStep;
|
|
10217
|
+
(function (SyncStep) {
|
|
10218
|
+
SyncStep["Sync"] = "sync";
|
|
10219
|
+
SyncStep["DatawalletSync"] = "sync:datawallet";
|
|
10220
|
+
SyncStep["DatawalletSyncDownloading"] = "sync:datawallet:downloading";
|
|
10221
|
+
SyncStep["DatawalletSyncDecryption"] = "sync:datawallet:decrypting";
|
|
10222
|
+
SyncStep["DatawalletSyncProcessing"] = "sync:datawallet:processing";
|
|
10223
|
+
SyncStep["ExternalEventsSync"] = "sync:externalEvents";
|
|
10224
|
+
SyncStep["ExternalEventsSyncDownloading"] = "sync:externalEvents:downloading";
|
|
10225
|
+
SyncStep["ExternalEventsProcessing"] = "sync:externalEvents:processing";
|
|
10226
|
+
})(SyncStep = exports.SyncStep || (exports.SyncStep = {}));
|
|
10227
|
+
//# sourceMappingURL=SyncCallback.js.map
|
|
10228
|
+
|
|
10229
|
+
/***/ }),
|
|
10230
|
+
|
|
10112
10231
|
/***/ "./dist/modules/sync/SyncController.js":
|
|
10113
10232
|
/*!*********************************************!*\
|
|
10114
10233
|
!*** ./dist/modules/sync/SyncController.js ***!
|
|
@@ -10129,6 +10248,7 @@ const ExternalEventsProcessor_1 = __webpack_require__(/*! ./ExternalEventsProces
|
|
|
10129
10248
|
const DatawalletModification_1 = __webpack_require__(/*! ./local/DatawalletModification */ "./dist/modules/sync/local/DatawalletModification.js");
|
|
10130
10249
|
const DeviceMigrations_1 = __webpack_require__(/*! ./migrations/DeviceMigrations */ "./dist/modules/sync/migrations/DeviceMigrations.js");
|
|
10131
10250
|
const IdentityMigrations_1 = __webpack_require__(/*! ./migrations/IdentityMigrations */ "./dist/modules/sync/migrations/IdentityMigrations.js");
|
|
10251
|
+
const SyncCallback_1 = __webpack_require__(/*! ./SyncCallback */ "./dist/modules/sync/SyncCallback.js");
|
|
10132
10252
|
class SyncController extends core_1.TransportController {
|
|
10133
10253
|
constructor(parent, dependencyOverrides, unpushedDatawalletModifications, datawalletEnabled) {
|
|
10134
10254
|
var _a;
|
|
@@ -10150,32 +10270,35 @@ class SyncController extends core_1.TransportController {
|
|
|
10150
10270
|
this.syncInfo = await this.db.getMap("SyncInfo");
|
|
10151
10271
|
return this;
|
|
10152
10272
|
}
|
|
10153
|
-
async sync(whatToSync = "Everything") {
|
|
10273
|
+
async sync(whatToSync = "Everything", reporter) {
|
|
10154
10274
|
var _a;
|
|
10155
10275
|
if ((_a = this.currentSync) === null || _a === void 0 ? void 0 : _a.includes(whatToSync)) {
|
|
10156
10276
|
return await this.currentSync.promise;
|
|
10157
10277
|
}
|
|
10158
10278
|
if (this.currentSync && !this.currentSync.includes(whatToSync)) {
|
|
10159
10279
|
await this.currentSync.promise;
|
|
10160
|
-
return await this.sync(whatToSync);
|
|
10280
|
+
return await this.sync(whatToSync, reporter);
|
|
10161
10281
|
}
|
|
10162
|
-
const syncPromise = this._sync(whatToSync);
|
|
10282
|
+
const syncPromise = this._sync(whatToSync, reporter);
|
|
10163
10283
|
this.currentSync = new LocalSyncRun(syncPromise, whatToSync);
|
|
10164
10284
|
try {
|
|
10165
10285
|
return await this.currentSync.promise;
|
|
10166
10286
|
}
|
|
10167
10287
|
finally {
|
|
10168
10288
|
if (this.datawalletEnabled && (await this.unpushedDatawalletModifications.exists())) {
|
|
10169
|
-
await this.syncDatawallet().catch((e) => this.log.error(e));
|
|
10289
|
+
await this.syncDatawallet(reporter).catch((e) => this.log.error(e));
|
|
10170
10290
|
}
|
|
10171
10291
|
this.currentSync = undefined;
|
|
10172
10292
|
}
|
|
10173
10293
|
}
|
|
10174
|
-
async _sync(whatToSync) {
|
|
10294
|
+
async _sync(whatToSync, reporter) {
|
|
10295
|
+
const syncStep = reporter.createStep(SyncCallback_1.SyncStep.Sync, 1);
|
|
10175
10296
|
if (whatToSync === "OnlyDatawallet") {
|
|
10176
|
-
|
|
10297
|
+
const value = await this.syncDatawallet(reporter);
|
|
10298
|
+
syncStep.finish();
|
|
10299
|
+
return value;
|
|
10177
10300
|
}
|
|
10178
|
-
const externalEventSyncResult = await this.syncExternalEvents();
|
|
10301
|
+
const externalEventSyncResult = await this.syncExternalEvents(reporter);
|
|
10179
10302
|
await this.setLastCompletedSyncTime();
|
|
10180
10303
|
if (externalEventSyncResult.externalEventResults.some((r) => r.errorCode !== undefined)) {
|
|
10181
10304
|
throw new core_1.CoreError("error.transport.errorWhileApplyingExternalEvents", externalEventSyncResult.externalEventResults
|
|
@@ -10183,23 +10306,24 @@ class SyncController extends core_1.TransportController {
|
|
|
10183
10306
|
.map((r) => r.errorCode)
|
|
10184
10307
|
.join(" | ")).logWith(this.log);
|
|
10185
10308
|
}
|
|
10309
|
+
syncStep.finish();
|
|
10186
10310
|
return externalEventSyncResult.changedItems;
|
|
10187
10311
|
}
|
|
10188
|
-
async syncExternalEvents() {
|
|
10312
|
+
async syncExternalEvents(reporter) {
|
|
10189
10313
|
const syncRunWasStarted = await this.startExternalEventsSyncRun();
|
|
10190
10314
|
if (!syncRunWasStarted) {
|
|
10191
|
-
await this.syncDatawallet();
|
|
10315
|
+
await this.syncDatawallet(reporter);
|
|
10192
10316
|
return {
|
|
10193
10317
|
changedItems: new ChangedItems_1.ChangedItems(),
|
|
10194
10318
|
externalEventResults: []
|
|
10195
10319
|
};
|
|
10196
10320
|
}
|
|
10197
|
-
await this.applyIncomingDatawalletModifications();
|
|
10198
|
-
const result = await this.applyIncomingExternalEvents();
|
|
10321
|
+
await this.applyIncomingDatawalletModifications(reporter);
|
|
10322
|
+
const result = await this.applyIncomingExternalEvents(reporter);
|
|
10199
10323
|
await this.finalizeExternalEventsSyncRun(result.externalEventResults);
|
|
10200
10324
|
return result;
|
|
10201
10325
|
}
|
|
10202
|
-
async syncDatawallet() {
|
|
10326
|
+
async syncDatawallet(reporter) {
|
|
10203
10327
|
if (!this.datawalletEnabled) {
|
|
10204
10328
|
return;
|
|
10205
10329
|
}
|
|
@@ -10213,7 +10337,7 @@ class SyncController extends core_1.TransportController {
|
|
|
10213
10337
|
}
|
|
10214
10338
|
this.log.trace("Synchronization of Datawallet events started...");
|
|
10215
10339
|
try {
|
|
10216
|
-
await this.applyIncomingDatawalletModifications();
|
|
10340
|
+
await this.applyIncomingDatawalletModifications(reporter);
|
|
10217
10341
|
await this.pushLocalDatawalletModifications();
|
|
10218
10342
|
await this.setLastCompletedDatawalletSyncTime();
|
|
10219
10343
|
}
|
|
@@ -10290,29 +10414,45 @@ class SyncController extends core_1.TransportController {
|
|
|
10290
10414
|
await this.parent.activeDevice.update({ datawalletVersion: deviceDatawalletVersion });
|
|
10291
10415
|
}
|
|
10292
10416
|
}
|
|
10293
|
-
async applyIncomingDatawalletModifications() {
|
|
10294
|
-
const
|
|
10295
|
-
|
|
10296
|
-
});
|
|
10417
|
+
async applyIncomingDatawalletModifications(reporter) {
|
|
10418
|
+
const datawalletSyncStep = reporter.createStep(SyncCallback_1.SyncStep.DatawalletSync, 1);
|
|
10419
|
+
const downloadingStep = reporter.createStep(SyncCallback_1.SyncStep.DatawalletSyncDownloading);
|
|
10420
|
+
const getDatawalletModificationsResult = await this.client.getDatawalletModifications({ localIndex: await this.getLocalDatawalletModificationIndex() }, (percentage) => downloadingStep.manualReport(percentage));
|
|
10297
10421
|
const encryptedIncomingModifications = await getDatawalletModificationsResult.value.collect();
|
|
10298
10422
|
if (encryptedIncomingModifications.length === 0) {
|
|
10423
|
+
datawalletSyncStep.finish();
|
|
10299
10424
|
return;
|
|
10300
10425
|
}
|
|
10301
|
-
const incomingModifications = await this.decryptDatawalletModifications(encryptedIncomingModifications);
|
|
10426
|
+
const incomingModifications = await this.decryptDatawalletModifications(encryptedIncomingModifications, reporter);
|
|
10302
10427
|
this.log.trace(`${incomingModifications.length} incoming modifications found`);
|
|
10303
|
-
const datawalletModificationsProcessor = new DatawalletModificationsProcessor_1.DatawalletModificationsProcessor(incomingModifications, this.cacheFetcher, this._db, core_1.TransportLoggerFactory.getLogger(DatawalletModificationsProcessor_1.DatawalletModificationsProcessor));
|
|
10428
|
+
const datawalletModificationsProcessor = new DatawalletModificationsProcessor_1.DatawalletModificationsProcessor(incomingModifications, this.cacheFetcher, this._db, core_1.TransportLoggerFactory.getLogger(DatawalletModificationsProcessor_1.DatawalletModificationsProcessor), reporter);
|
|
10304
10429
|
await datawalletModificationsProcessor.execute();
|
|
10305
10430
|
this.log.trace(`${incomingModifications.length} incoming modifications executed`, incomingModifications);
|
|
10306
10431
|
await this.updateLocalDatawalletModificationIndex(encryptedIncomingModifications.sort(descending)[0].index);
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10432
|
+
datawalletSyncStep.finish();
|
|
10433
|
+
}
|
|
10434
|
+
async promiseAllWithProgess(promises, callback) {
|
|
10435
|
+
callback(0);
|
|
10436
|
+
let processedItemCount = 0;
|
|
10437
|
+
for (const promise of promises) {
|
|
10438
|
+
// eslint-disable-next-line no-loop-func,no-void
|
|
10439
|
+
void promise.then(() => {
|
|
10440
|
+
processedItemCount++;
|
|
10441
|
+
const percentage = Math.round((processedItemCount / promises.length) * 100);
|
|
10442
|
+
callback(percentage);
|
|
10443
|
+
});
|
|
10314
10444
|
}
|
|
10315
|
-
return
|
|
10445
|
+
return await Promise.all(promises);
|
|
10446
|
+
}
|
|
10447
|
+
async decryptDatawalletModifications(encryptedModifications, reporter) {
|
|
10448
|
+
const promises = encryptedModifications.map((m) => this.decryptDatawalletModification(m));
|
|
10449
|
+
const step = reporter.createStep(SyncCallback_1.SyncStep.DatawalletSyncDecryption);
|
|
10450
|
+
return await this.promiseAllWithProgess(promises, (p) => step.manualReport(p));
|
|
10451
|
+
}
|
|
10452
|
+
async decryptDatawalletModification(encryptedModification) {
|
|
10453
|
+
const decryptedPayload = await this.parent.activeDevice.secrets.decryptDatawalletModificationPayload(encryptedModification.encryptedPayload, encryptedModification.index);
|
|
10454
|
+
const decryptedModification = await DatawalletModificationMapper_1.DatawalletModificationMapper.fromBackboneDatawalletModification(encryptedModification, decryptedPayload, this.config.supportedDatawalletVersion);
|
|
10455
|
+
return decryptedModification;
|
|
10316
10456
|
}
|
|
10317
10457
|
async pushLocalDatawalletModifications() {
|
|
10318
10458
|
const { backboneModifications, localModificationIds } = await this.prepareLocalDatawalletModificationsForPush();
|
|
@@ -10371,14 +10511,17 @@ class SyncController extends core_1.TransportController {
|
|
|
10371
10511
|
this.currentSyncRun = (_a = result.value.syncRun) !== null && _a !== void 0 ? _a : undefined;
|
|
10372
10512
|
return this.currentSyncRun !== undefined;
|
|
10373
10513
|
}
|
|
10374
|
-
async applyIncomingExternalEvents() {
|
|
10375
|
-
const
|
|
10514
|
+
async applyIncomingExternalEvents(reporter) {
|
|
10515
|
+
const externalEventStep = reporter.createStep(SyncCallback_1.SyncStep.ExternalEventsSync, 1);
|
|
10516
|
+
const downloadingStep = reporter.createStep(SyncCallback_1.SyncStep.ExternalEventsSyncDownloading);
|
|
10517
|
+
const getExternalEventsResult = await this.client.getExternalEventsOfSyncRun(this.currentSyncRun.id.toString(), (percentage) => downloadingStep.manualReport(percentage));
|
|
10376
10518
|
if (getExternalEventsResult.isError) {
|
|
10377
10519
|
throw getExternalEventsResult.error;
|
|
10378
10520
|
}
|
|
10379
10521
|
const externalEvents = await getExternalEventsResult.value.collect();
|
|
10380
|
-
const externalEventProcessor = new ExternalEventsProcessor_1.ExternalEventsProcessor(this.parent.messages, this.parent.relationships, externalEvents);
|
|
10522
|
+
const externalEventProcessor = new ExternalEventsProcessor_1.ExternalEventsProcessor(this.parent.messages, this.parent.relationships, externalEvents, reporter);
|
|
10381
10523
|
await externalEventProcessor.execute();
|
|
10524
|
+
externalEventStep.finish();
|
|
10382
10525
|
return {
|
|
10383
10526
|
externalEventResults: externalEventProcessor.results,
|
|
10384
10527
|
changedItems: externalEventProcessor.changedItems
|
|
@@ -10766,14 +10909,14 @@ class SyncClient extends core_1.RESTClientAuthenticate {
|
|
|
10766
10909
|
async finalizeDatawalletVersionUpgrade(id, request) {
|
|
10767
10910
|
return await this.put(`/api/v1/SyncRuns/${id}/FinalizeDatawalletVersionUpgrade`, request);
|
|
10768
10911
|
}
|
|
10769
|
-
async getExternalEventsOfSyncRun(syncRunId) {
|
|
10770
|
-
return await this.getPaged(`/api/v1/SyncRuns/${syncRunId}/ExternalEvents`, {});
|
|
10912
|
+
async getExternalEventsOfSyncRun(syncRunId, progessCallback) {
|
|
10913
|
+
return await this.getPaged(`/api/v1/SyncRuns/${syncRunId}/ExternalEvents`, {}, undefined, progessCallback);
|
|
10771
10914
|
}
|
|
10772
10915
|
async getDatawallet() {
|
|
10773
10916
|
return await this.get("/api/v1/Datawallet");
|
|
10774
10917
|
}
|
|
10775
|
-
async getDatawalletModifications(request) {
|
|
10776
|
-
return await this.getPaged("/api/v1/Datawallet/Modifications", request);
|
|
10918
|
+
async getDatawalletModifications(request, progessCallback) {
|
|
10919
|
+
return await this.getPaged("/api/v1/Datawallet/Modifications", request, undefined, progessCallback);
|
|
10777
10920
|
}
|
|
10778
10921
|
async createDatawalletModifications(request) {
|
|
10779
10922
|
return await this.post("/api/v1/Datawallet/Modifications", request);
|
|
@@ -11067,29 +11210,12 @@ class TokenController extends TransportController_1.TransportController {
|
|
|
11067
11210
|
if (ids.length < 1) {
|
|
11068
11211
|
return [];
|
|
11069
11212
|
}
|
|
11213
|
+
// TODO: JSSNMSHDD-2820 (check for items that couldn't be fetched e.g. because it is expired)
|
|
11214
|
+
const resultItems = (await this.client.getTokens({ ids })).value;
|
|
11070
11215
|
const promises = [];
|
|
11071
|
-
for (const id of ids) {
|
|
11072
|
-
const result = await this.client.getToken(id);
|
|
11073
|
-
if (result.isError) {
|
|
11074
|
-
if (result.error.code === "error.transport.recordNotFound" ||
|
|
11075
|
-
result.error.code === "error.transport.request.notFound" ||
|
|
11076
|
-
result.error.code === "error.platform.recordNotFound") {
|
|
11077
|
-
this.log.warn(`Record id ${id} could not be found on backbone. It might be expired.`, result.error);
|
|
11078
|
-
continue;
|
|
11079
|
-
}
|
|
11080
|
-
throw result.error;
|
|
11081
|
-
}
|
|
11082
|
-
const resultItem = result.value;
|
|
11083
|
-
promises.push(this.updateCacheOfExistingTokenInDb(resultItem.id, resultItem));
|
|
11084
|
-
}
|
|
11085
|
-
/*
|
|
11086
|
-
// TODO: Optimize once backbone handling is clarified
|
|
11087
|
-
const resultItems = (await this.client.getTokens({ ids })).value
|
|
11088
|
-
const promises = []
|
|
11089
11216
|
for await (const resultItem of resultItems) {
|
|
11090
|
-
promises.push(this.updateCacheOfExistingTokenInDb(resultItem.id, resultItem))
|
|
11217
|
+
promises.push(this.updateCacheOfExistingTokenInDb(resultItem.id, resultItem));
|
|
11091
11218
|
}
|
|
11092
|
-
*/
|
|
11093
11219
|
const isToken = (item) => !!item;
|
|
11094
11220
|
return (await Promise.all(promises)).filter(isToken);
|
|
11095
11221
|
}
|
|
@@ -12034,7 +12160,11 @@ exports.Random = Random;
|
|
|
12034
12160
|
|
|
12035
12161
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12036
12162
|
if (k2 === undefined) k2 = k;
|
|
12037
|
-
Object.
|
|
12163
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12164
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12165
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12166
|
+
}
|
|
12167
|
+
Object.defineProperty(o, k2, desc);
|
|
12038
12168
|
}) : (function(o, m, k, k2) {
|
|
12039
12169
|
if (k2 === undefined) k2 = k;
|
|
12040
12170
|
o[k2] = m[k];
|
|
@@ -12667,7 +12797,7 @@ var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_mod
|
|
|
12667
12797
|
var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
|
|
12668
12798
|
var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
|
|
12669
12799
|
var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js");
|
|
12670
|
-
var
|
|
12800
|
+
var transitionalDefaults = __webpack_require__(/*! ../defaults/transitional */ "./node_modules/axios/lib/defaults/transitional.js");
|
|
12671
12801
|
var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
|
|
12672
12802
|
|
|
12673
12803
|
module.exports = function xhrAdapter(config) {
|
|
@@ -12782,7 +12912,7 @@ module.exports = function xhrAdapter(config) {
|
|
|
12782
12912
|
// Handle timeout
|
|
12783
12913
|
request.ontimeout = function handleTimeout() {
|
|
12784
12914
|
var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
12785
|
-
var transitional = config.transitional ||
|
|
12915
|
+
var transitional = config.transitional || transitionalDefaults;
|
|
12786
12916
|
if (config.timeoutErrorMessage) {
|
|
12787
12917
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
12788
12918
|
}
|
|
@@ -12886,7 +13016,7 @@ var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.j
|
|
|
12886
13016
|
var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
|
|
12887
13017
|
var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js");
|
|
12888
13018
|
var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
|
|
12889
|
-
var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js");
|
|
13019
|
+
var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults/index.js");
|
|
12890
13020
|
|
|
12891
13021
|
/**
|
|
12892
13022
|
* Create an instance of Axios
|
|
@@ -13162,10 +13292,6 @@ Axios.prototype.request = function request(configOrUrl, config) {
|
|
|
13162
13292
|
config = configOrUrl || {};
|
|
13163
13293
|
}
|
|
13164
13294
|
|
|
13165
|
-
if (!config.url) {
|
|
13166
|
-
throw new Error('Provided config url is not valid');
|
|
13167
|
-
}
|
|
13168
|
-
|
|
13169
13295
|
config = mergeConfig(this.defaults, config);
|
|
13170
13296
|
|
|
13171
13297
|
// Set config.method
|
|
@@ -13248,9 +13374,6 @@ Axios.prototype.request = function request(configOrUrl, config) {
|
|
|
13248
13374
|
};
|
|
13249
13375
|
|
|
13250
13376
|
Axios.prototype.getUri = function getUri(config) {
|
|
13251
|
-
if (!config.url) {
|
|
13252
|
-
throw new Error('Provided config url is not valid');
|
|
13253
|
-
}
|
|
13254
13377
|
config = mergeConfig(this.defaults, config);
|
|
13255
13378
|
return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
|
|
13256
13379
|
};
|
|
@@ -13420,7 +13543,7 @@ module.exports = function createError(message, config, code, request, response)
|
|
|
13420
13543
|
var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
|
|
13421
13544
|
var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js");
|
|
13422
13545
|
var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
|
|
13423
|
-
var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");
|
|
13546
|
+
var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults/index.js");
|
|
13424
13547
|
var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
|
|
13425
13548
|
|
|
13426
13549
|
/**
|
|
@@ -13716,7 +13839,7 @@ module.exports = function settle(resolve, reject, response) {
|
|
|
13716
13839
|
|
|
13717
13840
|
|
|
13718
13841
|
var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
|
|
13719
|
-
var defaults = __webpack_require__(/*!
|
|
13842
|
+
var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults/index.js");
|
|
13720
13843
|
|
|
13721
13844
|
/**
|
|
13722
13845
|
* Transform the data for a request or a response
|
|
@@ -13739,18 +13862,19 @@ module.exports = function transformData(data, headers, fns) {
|
|
|
13739
13862
|
|
|
13740
13863
|
/***/ }),
|
|
13741
13864
|
|
|
13742
|
-
/***/ "./node_modules/axios/lib/defaults.js":
|
|
13743
|
-
|
|
13744
|
-
!*** ./node_modules/axios/lib/defaults.js ***!
|
|
13745
|
-
|
|
13865
|
+
/***/ "./node_modules/axios/lib/defaults/index.js":
|
|
13866
|
+
/*!**************************************************!*\
|
|
13867
|
+
!*** ./node_modules/axios/lib/defaults/index.js ***!
|
|
13868
|
+
\**************************************************/
|
|
13746
13869
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
13747
13870
|
|
|
13748
13871
|
"use strict";
|
|
13749
13872
|
|
|
13750
13873
|
|
|
13751
|
-
var utils = __webpack_require__(/*!
|
|
13752
|
-
var normalizeHeaderName = __webpack_require__(/*!
|
|
13753
|
-
var enhanceError = __webpack_require__(/*!
|
|
13874
|
+
var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
|
|
13875
|
+
var normalizeHeaderName = __webpack_require__(/*! ../helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js");
|
|
13876
|
+
var enhanceError = __webpack_require__(/*! ../core/enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
|
|
13877
|
+
var transitionalDefaults = __webpack_require__(/*! ./transitional */ "./node_modules/axios/lib/defaults/transitional.js");
|
|
13754
13878
|
|
|
13755
13879
|
var DEFAULT_CONTENT_TYPE = {
|
|
13756
13880
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
@@ -13766,10 +13890,10 @@ function getDefaultAdapter() {
|
|
|
13766
13890
|
var adapter;
|
|
13767
13891
|
if (typeof XMLHttpRequest !== 'undefined') {
|
|
13768
13892
|
// For browsers use XHR adapter
|
|
13769
|
-
adapter = __webpack_require__(/*!
|
|
13893
|
+
adapter = __webpack_require__(/*! ../adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js");
|
|
13770
13894
|
} else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
|
|
13771
13895
|
// For node use HTTP adapter
|
|
13772
|
-
adapter = __webpack_require__(/*!
|
|
13896
|
+
adapter = __webpack_require__(/*! ../adapters/http */ "./node_modules/axios/lib/adapters/xhr.js");
|
|
13773
13897
|
}
|
|
13774
13898
|
return adapter;
|
|
13775
13899
|
}
|
|
@@ -13791,11 +13915,7 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
13791
13915
|
|
|
13792
13916
|
var defaults = {
|
|
13793
13917
|
|
|
13794
|
-
transitional:
|
|
13795
|
-
silentJSONParsing: true,
|
|
13796
|
-
forcedJSONParsing: true,
|
|
13797
|
-
clarifyTimeoutError: false
|
|
13798
|
-
},
|
|
13918
|
+
transitional: transitionalDefaults,
|
|
13799
13919
|
|
|
13800
13920
|
adapter: getDefaultAdapter(),
|
|
13801
13921
|
|
|
@@ -13882,6 +14002,24 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
|
13882
14002
|
module.exports = defaults;
|
|
13883
14003
|
|
|
13884
14004
|
|
|
14005
|
+
/***/ }),
|
|
14006
|
+
|
|
14007
|
+
/***/ "./node_modules/axios/lib/defaults/transitional.js":
|
|
14008
|
+
/*!*********************************************************!*\
|
|
14009
|
+
!*** ./node_modules/axios/lib/defaults/transitional.js ***!
|
|
14010
|
+
\*********************************************************/
|
|
14011
|
+
/***/ ((module) => {
|
|
14012
|
+
|
|
14013
|
+
"use strict";
|
|
14014
|
+
|
|
14015
|
+
|
|
14016
|
+
module.exports = {
|
|
14017
|
+
silentJSONParsing: true,
|
|
14018
|
+
forcedJSONParsing: true,
|
|
14019
|
+
clarifyTimeoutError: false
|
|
14020
|
+
};
|
|
14021
|
+
|
|
14022
|
+
|
|
13885
14023
|
/***/ }),
|
|
13886
14024
|
|
|
13887
14025
|
/***/ "./node_modules/axios/lib/env/data.js":
|
|
@@ -13891,7 +14029,7 @@ module.exports = defaults;
|
|
|
13891
14029
|
/***/ ((module) => {
|
|
13892
14030
|
|
|
13893
14031
|
module.exports = {
|
|
13894
|
-
"version": "0.
|
|
14032
|
+
"version": "0.26.1"
|
|
13895
14033
|
};
|
|
13896
14034
|
|
|
13897
14035
|
/***/ }),
|
|
@@ -36074,7 +36212,7 @@ var SystemZone = /*#__PURE__*/function (_Zone) {
|
|
|
36074
36212
|
return SystemZone;
|
|
36075
36213
|
}(Zone);
|
|
36076
36214
|
|
|
36077
|
-
|
|
36215
|
+
RegExp("^" + ianaRegex.source + "$");
|
|
36078
36216
|
var dtfCache = {};
|
|
36079
36217
|
|
|
36080
36218
|
function makeDTF(zone) {
|
|
@@ -36167,14 +36305,14 @@ var IANAZone = /*#__PURE__*/function (_Zone) {
|
|
|
36167
36305
|
* Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.
|
|
36168
36306
|
* @param {string} s - The string to check validity on
|
|
36169
36307
|
* @example IANAZone.isValidSpecifier("America/New_York") //=> true
|
|
36170
|
-
* @example IANAZone.isValidSpecifier("Fantasia/Castle") //=> true
|
|
36171
36308
|
* @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false
|
|
36309
|
+
* @deprecated This method returns false some valid IANA names. Use isValidZone instead
|
|
36172
36310
|
* @return {boolean}
|
|
36173
36311
|
*/
|
|
36174
36312
|
;
|
|
36175
36313
|
|
|
36176
36314
|
IANAZone.isValidSpecifier = function isValidSpecifier(s) {
|
|
36177
|
-
return
|
|
36315
|
+
return this.isValidZone(s);
|
|
36178
36316
|
}
|
|
36179
36317
|
/**
|
|
36180
36318
|
* Returns whether the provided string identifies a real zone
|
|
@@ -36507,7 +36645,7 @@ function normalizeZone(input, defaultZone) {
|
|
|
36507
36645
|
return input;
|
|
36508
36646
|
} else if (isString(input)) {
|
|
36509
36647
|
var lowered = input.toLowerCase();
|
|
36510
|
-
if (lowered === "local" || lowered === "system") return defaultZone;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else
|
|
36648
|
+
if (lowered === "local" || lowered === "system") return defaultZone;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);
|
|
36511
36649
|
} else if (isNumber(input)) {
|
|
36512
36650
|
return FixedOffsetZone.instance(input);
|
|
36513
36651
|
} else if (typeof input === "object" && input.offset && typeof input.offset === "number") {
|
|
@@ -38383,7 +38521,7 @@ var Duration = /*#__PURE__*/function () {
|
|
|
38383
38521
|
|
|
38384
38522
|
for (var _i2 = 0, _Object$keys2 = Object.keys(this.values); _i2 < _Object$keys2.length; _i2++) {
|
|
38385
38523
|
var k = _Object$keys2[_i2];
|
|
38386
|
-
negated[k] = -this.values[k];
|
|
38524
|
+
negated[k] = this.values[k] === 0 ? 0 : -this.values[k];
|
|
38387
38525
|
}
|
|
38388
38526
|
|
|
38389
38527
|
return clone$1(this, {
|
|
@@ -39309,7 +39447,7 @@ var Info = /*#__PURE__*/function () {
|
|
|
39309
39447
|
;
|
|
39310
39448
|
|
|
39311
39449
|
Info.isValidIANAZone = function isValidIANAZone(zone) {
|
|
39312
|
-
return IANAZone.
|
|
39450
|
+
return IANAZone.isValidZone(zone);
|
|
39313
39451
|
}
|
|
39314
39452
|
/**
|
|
39315
39453
|
* Converts the input into a {@link Zone} instance.
|
|
@@ -41943,6 +42081,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
41943
42081
|
* @param {Object} opts - options
|
|
41944
42082
|
* @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.
|
|
41945
42083
|
* @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'
|
|
42084
|
+
* @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'
|
|
41946
42085
|
* @example DateTime.utc().toSQL() //=> '05:15:16.345'
|
|
41947
42086
|
* @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'
|
|
41948
42087
|
* @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'
|
|
@@ -41956,12 +42095,16 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
41956
42095
|
_ref7$includeOffset = _ref7.includeOffset,
|
|
41957
42096
|
includeOffset = _ref7$includeOffset === void 0 ? true : _ref7$includeOffset,
|
|
41958
42097
|
_ref7$includeZone = _ref7.includeZone,
|
|
41959
|
-
includeZone = _ref7$includeZone === void 0 ? false : _ref7$includeZone
|
|
42098
|
+
includeZone = _ref7$includeZone === void 0 ? false : _ref7$includeZone,
|
|
42099
|
+
_ref7$includeOffsetSp = _ref7.includeOffsetSpace,
|
|
42100
|
+
includeOffsetSpace = _ref7$includeOffsetSp === void 0 ? true : _ref7$includeOffsetSp;
|
|
41960
42101
|
|
|
41961
42102
|
var fmt = "HH:mm:ss.SSS";
|
|
41962
42103
|
|
|
41963
42104
|
if (includeZone || includeOffset) {
|
|
41964
|
-
|
|
42105
|
+
if (includeOffsetSpace) {
|
|
42106
|
+
fmt += " ";
|
|
42107
|
+
}
|
|
41965
42108
|
|
|
41966
42109
|
if (includeZone) {
|
|
41967
42110
|
fmt += "z";
|
|
@@ -41977,6 +42120,7 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
41977
42120
|
* @param {Object} opts - options
|
|
41978
42121
|
* @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.
|
|
41979
42122
|
* @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'
|
|
42123
|
+
* @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'
|
|
41980
42124
|
* @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'
|
|
41981
42125
|
* @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'
|
|
41982
42126
|
* @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'
|
|
@@ -42032,6 +42176,15 @@ var DateTime = /*#__PURE__*/function () {
|
|
|
42032
42176
|
_proto.toSeconds = function toSeconds() {
|
|
42033
42177
|
return this.isValid ? this.ts / 1000 : NaN;
|
|
42034
42178
|
}
|
|
42179
|
+
/**
|
|
42180
|
+
* Returns the epoch seconds (as a whole number) of this DateTime.
|
|
42181
|
+
* @return {number}
|
|
42182
|
+
*/
|
|
42183
|
+
;
|
|
42184
|
+
|
|
42185
|
+
_proto.toUnixInteger = function toUnixInteger() {
|
|
42186
|
+
return this.isValid ? Math.floor(this.ts / 1000) : NaN;
|
|
42187
|
+
}
|
|
42035
42188
|
/**
|
|
42036
42189
|
* Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.
|
|
42037
42190
|
* @return {string}
|
|
@@ -42976,7 +43129,7 @@ function friendlyDateTime(dateTimeish) {
|
|
|
42976
43129
|
}
|
|
42977
43130
|
}
|
|
42978
43131
|
|
|
42979
|
-
var VERSION = "2.3.
|
|
43132
|
+
var VERSION = "2.3.1";
|
|
42980
43133
|
|
|
42981
43134
|
exports.DateTime = DateTime;
|
|
42982
43135
|
exports.Duration = Duration;
|
|
@@ -53693,15 +53846,15 @@ exports.MessageFormatUtils = MessageFormatUtils;
|
|
|
53693
53846
|
"use strict";
|
|
53694
53847
|
__webpack_require__.r(__webpack_exports__);
|
|
53695
53848
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
53849
|
+
/* harmony export */ "NIL": () => (/* reexport safe */ _nil_js__WEBPACK_IMPORTED_MODULE_4__["default"]),
|
|
53850
|
+
/* harmony export */ "parse": () => (/* reexport safe */ _parse_js__WEBPACK_IMPORTED_MODULE_8__["default"]),
|
|
53851
|
+
/* harmony export */ "stringify": () => (/* reexport safe */ _stringify_js__WEBPACK_IMPORTED_MODULE_7__["default"]),
|
|
53696
53852
|
/* harmony export */ "v1": () => (/* reexport safe */ _v1_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
|
|
53697
53853
|
/* harmony export */ "v3": () => (/* reexport safe */ _v3_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
|
|
53698
53854
|
/* harmony export */ "v4": () => (/* reexport safe */ _v4_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
|
|
53699
53855
|
/* harmony export */ "v5": () => (/* reexport safe */ _v5_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
|
|
53700
|
-
/* harmony export */ "NIL": () => (/* reexport safe */ _nil_js__WEBPACK_IMPORTED_MODULE_4__["default"]),
|
|
53701
|
-
/* harmony export */ "version": () => (/* reexport safe */ _version_js__WEBPACK_IMPORTED_MODULE_5__["default"]),
|
|
53702
53856
|
/* harmony export */ "validate": () => (/* reexport safe */ _validate_js__WEBPACK_IMPORTED_MODULE_6__["default"]),
|
|
53703
|
-
/* harmony export */ "
|
|
53704
|
-
/* harmony export */ "parse": () => (/* reexport safe */ _parse_js__WEBPACK_IMPORTED_MODULE_8__["default"])
|
|
53857
|
+
/* harmony export */ "version": () => (/* reexport safe */ _version_js__WEBPACK_IMPORTED_MODULE_5__["default"])
|
|
53705
53858
|
/* harmony export */ });
|
|
53706
53859
|
/* harmony import */ var _v1_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./v1.js */ "./node_modules/uuid/dist/esm-browser/v1.js");
|
|
53707
53860
|
/* harmony import */ var _v3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v3.js */ "./node_modules/uuid/dist/esm-browser/v3.js");
|
|
@@ -54583,22 +54736,22 @@ module.exports = TSServal;
|
|
|
54583
54736
|
"use strict";
|
|
54584
54737
|
__webpack_require__.r(__webpack_exports__);
|
|
54585
54738
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
54739
|
+
/* harmony export */ "JsonPatchError": () => (/* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.PatchError),
|
|
54586
54740
|
/* harmony export */ "_areEquals": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__._areEquals),
|
|
54587
54741
|
/* harmony export */ "applyOperation": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.applyOperation),
|
|
54588
54742
|
/* harmony export */ "applyPatch": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.applyPatch),
|
|
54589
54743
|
/* harmony export */ "applyReducer": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.applyReducer),
|
|
54590
|
-
/* harmony export */ "getValueByPointer": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.getValueByPointer),
|
|
54591
|
-
/* harmony export */ "validate": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.validate),
|
|
54592
|
-
/* harmony export */ "validator": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.validator),
|
|
54593
54744
|
/* harmony export */ "compare": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.compare),
|
|
54594
|
-
/* harmony export */ "generate": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.generate),
|
|
54595
|
-
/* harmony export */ "observe": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.observe),
|
|
54596
|
-
/* harmony export */ "unobserve": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.unobserve),
|
|
54597
|
-
/* harmony export */ "JsonPatchError": () => (/* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.PatchError),
|
|
54598
54745
|
/* harmony export */ "deepClone": () => (/* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__._deepClone),
|
|
54746
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
54599
54747
|
/* harmony export */ "escapePathComponent": () => (/* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.escapePathComponent),
|
|
54748
|
+
/* harmony export */ "generate": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.generate),
|
|
54749
|
+
/* harmony export */ "getValueByPointer": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.getValueByPointer),
|
|
54750
|
+
/* harmony export */ "observe": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.observe),
|
|
54600
54751
|
/* harmony export */ "unescapePathComponent": () => (/* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.unescapePathComponent),
|
|
54601
|
-
/* harmony export */ "
|
|
54752
|
+
/* harmony export */ "unobserve": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.unobserve),
|
|
54753
|
+
/* harmony export */ "validate": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.validate),
|
|
54754
|
+
/* harmony export */ "validator": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.validator)
|
|
54602
54755
|
/* harmony export */ });
|
|
54603
54756
|
/* harmony import */ var _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./module/core.mjs */ "./node_modules/fast-json-patch/module/core.mjs");
|
|
54604
54757
|
/* harmony import */ var _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./module/duplex.mjs */ "./node_modules/fast-json-patch/module/duplex.mjs");
|
|
@@ -54635,14 +54788,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
54635
54788
|
__webpack_require__.r(__webpack_exports__);
|
|
54636
54789
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
54637
54790
|
/* harmony export */ "JsonPatchError": () => (/* binding */ JsonPatchError),
|
|
54638
|
-
/* harmony export */ "
|
|
54639
|
-
/* harmony export */ "getValueByPointer": () => (/* binding */ getValueByPointer),
|
|
54791
|
+
/* harmony export */ "_areEquals": () => (/* binding */ _areEquals),
|
|
54640
54792
|
/* harmony export */ "applyOperation": () => (/* binding */ applyOperation),
|
|
54641
54793
|
/* harmony export */ "applyPatch": () => (/* binding */ applyPatch),
|
|
54642
54794
|
/* harmony export */ "applyReducer": () => (/* binding */ applyReducer),
|
|
54643
|
-
/* harmony export */ "
|
|
54795
|
+
/* harmony export */ "deepClone": () => (/* binding */ deepClone),
|
|
54796
|
+
/* harmony export */ "getValueByPointer": () => (/* binding */ getValueByPointer),
|
|
54644
54797
|
/* harmony export */ "validate": () => (/* binding */ validate),
|
|
54645
|
-
/* harmony export */ "
|
|
54798
|
+
/* harmony export */ "validator": () => (/* binding */ validator)
|
|
54646
54799
|
/* harmony export */ });
|
|
54647
54800
|
/* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ "./node_modules/fast-json-patch/module/helpers.mjs");
|
|
54648
54801
|
|
|
@@ -55089,10 +55242,10 @@ function _areEquals(a, b) {
|
|
|
55089
55242
|
"use strict";
|
|
55090
55243
|
__webpack_require__.r(__webpack_exports__);
|
|
55091
55244
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
55092
|
-
/* harmony export */ "
|
|
55093
|
-
/* harmony export */ "observe": () => (/* binding */ observe),
|
|
55245
|
+
/* harmony export */ "compare": () => (/* binding */ compare),
|
|
55094
55246
|
/* harmony export */ "generate": () => (/* binding */ generate),
|
|
55095
|
-
/* harmony export */ "
|
|
55247
|
+
/* harmony export */ "observe": () => (/* binding */ observe),
|
|
55248
|
+
/* harmony export */ "unobserve": () => (/* binding */ unobserve)
|
|
55096
55249
|
/* harmony export */ });
|
|
55097
55250
|
/* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ "./node_modules/fast-json-patch/module/helpers.mjs");
|
|
55098
55251
|
/* harmony import */ var _core_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./core.mjs */ "./node_modules/fast-json-patch/module/core.mjs");
|
|
@@ -55285,16 +55438,16 @@ function compare(tree1, tree2, invertible) {
|
|
|
55285
55438
|
"use strict";
|
|
55286
55439
|
__webpack_require__.r(__webpack_exports__);
|
|
55287
55440
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
55288
|
-
/* harmony export */ "
|
|
55289
|
-
/* harmony export */ "_objectKeys": () => (/* binding */ _objectKeys),
|
|
55441
|
+
/* harmony export */ "PatchError": () => (/* binding */ PatchError),
|
|
55290
55442
|
/* harmony export */ "_deepClone": () => (/* binding */ _deepClone),
|
|
55291
|
-
/* harmony export */ "isInteger": () => (/* binding */ isInteger),
|
|
55292
|
-
/* harmony export */ "escapePathComponent": () => (/* binding */ escapePathComponent),
|
|
55293
|
-
/* harmony export */ "unescapePathComponent": () => (/* binding */ unescapePathComponent),
|
|
55294
55443
|
/* harmony export */ "_getPathRecursive": () => (/* binding */ _getPathRecursive),
|
|
55444
|
+
/* harmony export */ "_objectKeys": () => (/* binding */ _objectKeys),
|
|
55445
|
+
/* harmony export */ "escapePathComponent": () => (/* binding */ escapePathComponent),
|
|
55295
55446
|
/* harmony export */ "getPath": () => (/* binding */ getPath),
|
|
55447
|
+
/* harmony export */ "hasOwnProperty": () => (/* binding */ hasOwnProperty),
|
|
55296
55448
|
/* harmony export */ "hasUndefined": () => (/* binding */ hasUndefined),
|
|
55297
|
-
/* harmony export */ "
|
|
55449
|
+
/* harmony export */ "isInteger": () => (/* binding */ isInteger),
|
|
55450
|
+
/* harmony export */ "unescapePathComponent": () => (/* binding */ unescapePathComponent)
|
|
55298
55451
|
/* harmony export */ });
|
|
55299
55452
|
/*!
|
|
55300
55453
|
* https://github.com/Starcounter-Jack/JSON-Patch
|