@nmshd/transport 1.1.9 → 1.2.1

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.
Files changed (59) hide show
  1. package/dist/buildInformation.js +5 -5
  2. package/dist/core/ProgressReporter.d.ts +18 -0
  3. package/dist/core/ProgressReporter.js +45 -0
  4. package/dist/core/ProgressReporter.js.map +1 -0
  5. package/dist/core/backbone/Paginator.d.ts +7 -1
  6. package/dist/core/backbone/Paginator.js +25 -1
  7. package/dist/core/backbone/Paginator.js.map +1 -1
  8. package/dist/core/backbone/RESTClient.d.ts +2 -2
  9. package/dist/core/backbone/RESTClient.js +4 -4
  10. package/dist/core/backbone/RESTClient.js.map +1 -1
  11. package/dist/core/backbone/RESTClientAuthenticate.d.ts +2 -2
  12. package/dist/core/backbone/RESTClientAuthenticate.js +2 -2
  13. package/dist/core/backbone/RESTClientAuthenticate.js.map +1 -1
  14. package/dist/core/backbone/index.js +5 -1
  15. package/dist/core/backbone/index.js.map +1 -1
  16. package/dist/core/index.d.ts +1 -0
  17. package/dist/core/index.js +6 -1
  18. package/dist/core/index.js.map +1 -1
  19. package/dist/core/types/index.js +5 -1
  20. package/dist/core/types/index.js.map +1 -1
  21. package/dist/index.js +5 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/modules/accounts/AccountController.d.ts +3 -2
  24. package/dist/modules/accounts/AccountController.js +7 -4
  25. package/dist/modules/accounts/AccountController.js.map +1 -1
  26. package/dist/modules/challenges/ChallengeController.d.ts +5 -2
  27. package/dist/modules/challenges/ChallengeController.js +21 -27
  28. package/dist/modules/challenges/ChallengeController.js.map +1 -1
  29. package/dist/modules/index.d.ts +1 -0
  30. package/dist/modules/index.js +8 -1
  31. package/dist/modules/index.js.map +1 -1
  32. package/dist/modules/relationships/transmission/changes/RelationshipChange.js +8 -4
  33. package/dist/modules/relationships/transmission/changes/RelationshipChange.js.map +1 -1
  34. package/dist/modules/relationships/transmission/changes/RelationshipChangeRequest.js +8 -4
  35. package/dist/modules/relationships/transmission/changes/RelationshipChangeRequest.js.map +1 -1
  36. package/dist/modules/relationships/transmission/changes/RelationshipChangeResponse.js +8 -4
  37. package/dist/modules/relationships/transmission/changes/RelationshipChangeResponse.js.map +1 -1
  38. package/dist/modules/sync/DatawalletModificationsProcessor.d.ts +3 -1
  39. package/dist/modules/sync/DatawalletModificationsProcessor.js +14 -1
  40. package/dist/modules/sync/DatawalletModificationsProcessor.js.map +1 -1
  41. package/dist/modules/sync/ExternalEventsProcessor.d.ts +3 -1
  42. package/dist/modules/sync/ExternalEventsProcessor.js +6 -1
  43. package/dist/modules/sync/ExternalEventsProcessor.js.map +1 -1
  44. package/dist/modules/sync/SyncCallback.d.ts +17 -0
  45. package/dist/modules/sync/SyncCallback.js +25 -0
  46. package/dist/modules/sync/SyncCallback.js.map +1 -0
  47. package/dist/modules/sync/SyncController.d.ts +6 -4
  48. package/dist/modules/sync/SyncController.js +55 -31
  49. package/dist/modules/sync/SyncController.js.map +1 -1
  50. package/dist/modules/sync/backbone/SyncClient.d.ts +5 -5
  51. package/dist/modules/sync/backbone/SyncClient.js +5 -5
  52. package/dist/modules/sync/backbone/SyncClient.js.map +1 -1
  53. package/dist/util/index.js +5 -1
  54. package/dist/util/index.js.map +1 -1
  55. package/lib-web/nmshd.transport.js +432 -197
  56. package/lib-web/nmshd.transport.js.map +1 -1
  57. package/lib-web/nmshd.transport.min.js +1 -1
  58. package/lib-web/nmshd.transport.min.js.map +1 -1
  59. package/package.json +30 -28
@@ -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.1.9",
19
- build: "21",
20
- date: "2022-02-04T12:41:52+00:00",
21
- commit: "a3d954a1746fd2cf627ecc834de1bafe59b7db8d",
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.25.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.3.0","qs":"^6.10.3","reflect-metadata":"^0.1.13","ts-simple-nameof":"^1.3.1","uuid":"^8.3.2"},
18
+ version: "1.2.1",
19
+ build: "24",
20
+ date: "2022-04-20T11:01:27+00:00",
21
+ commit: "8df53820b25346ce32c4aec931ac0781837832eb",
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.1","form-data":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^2.3.2","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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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
- return await this.synchronization.sync("OnlyDatawallet");
2868
+ const reporter = SyncCallback_1.SyncProgressReporter.fromCallback(syncProgressCallback);
2869
+ return await this.synchronization.sync("OnlyDatawallet", reporter);
2772
2870
  }
2773
- async syncEverything() {
2774
- return await this.synchronization.sync("Everything");
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 verifyChallengeLocally(challenge, signedChallenge) {
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 verified = false;
4213
+ let isValid = false;
4116
4214
  switch (challenge.type) {
4117
4215
  case Challenge_1.ChallengeType.Identity:
4118
- verified = await this.parent.relationships.verifyIdentity(relationship, challengeBuffer, signedChallenge.signature);
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
- verified = await this.parent.relationships.verify(relationship, challengeBuffer, signedChallenge.signature);
4221
+ isValid = await this.parent.relationships.verify(relationship, challengeBuffer, signedChallenge.signature);
4124
4222
  break;
4125
4223
  }
4126
- if (!verified) {
4127
- return;
4128
- }
4129
- return relationship;
4224
+ if (!isValid)
4225
+ return { isValid: false };
4226
+ return { isValid: true, correspondingRelationship: relationship };
4130
4227
  }
4131
- async checkChallenge(signedChallenge, requiredType) {
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
- if (challenge.expiresAt.isExpired()) {
4137
- return;
4138
- }
4139
- const [relationship, response] = await Promise.all([
4140
- this.verifyChallengeLocally(challenge, signedChallenge),
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
- response.value.id !== challenge.id.toString()) {
4148
- return;
4240
+ backboneChallengeResponse.value.id !== challenge.id.toString()) {
4241
+ return { isValid: false };
4149
4242
  }
4150
- return relationship;
4243
+ return await this.validateChallengeLocally(challenge, signedChallenge);
4151
4244
  }
4152
4245
  async createAccountCreationChallenge(identity) {
4153
4246
  const backboneResponse = (await this.client.createChallenge()).value;
@@ -5971,7 +6064,11 @@ exports.FileReference = FileReference;
5971
6064
 
5972
6065
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5973
6066
  if (k2 === undefined) k2 = k;
5974
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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);
5975
6072
  }) : (function(o, m, k, k2) {
5976
6073
  if (k2 === undefined) k2 = k;
5977
6074
  o[k2] = m[k];
@@ -5980,6 +6077,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
5980
6077
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
5981
6078
  };
5982
6079
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6080
+ exports.SyncStep = void 0;
5983
6081
  __exportStar(__webpack_require__(/*! ./accounts/AccountController */ "./dist/modules/accounts/AccountController.js"), exports);
5984
6082
  __exportStar(__webpack_require__(/*! ./accounts/backbone/IdentityClient */ "./dist/modules/accounts/backbone/IdentityClient.js"), exports);
5985
6083
  __exportStar(__webpack_require__(/*! ./accounts/data/Identity */ "./dist/modules/accounts/data/Identity.js"), exports);
@@ -6084,6 +6182,8 @@ __exportStar(__webpack_require__(/*! ./sync/ChangedItems */ "./dist/modules/sync
6084
6182
  __exportStar(__webpack_require__(/*! ./sync/DatawalletModificationsProcessor */ "./dist/modules/sync/DatawalletModificationsProcessor.js"), exports);
6085
6183
  __exportStar(__webpack_require__(/*! ./sync/ExternalEventsProcessor */ "./dist/modules/sync/ExternalEventsProcessor.js"), exports);
6086
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; } }));
6087
6187
  __exportStar(__webpack_require__(/*! ./sync/SyncController */ "./dist/modules/sync/SyncController.js"), exports);
6088
6188
  __exportStar(__webpack_require__(/*! ./sync/SynchronizedCollection */ "./dist/modules/sync/SynchronizedCollection.js"), exports);
6089
6189
  __exportStar(__webpack_require__(/*! ./tokens/AnonymousTokenController */ "./dist/modules/tokens/AnonymousTokenController.js"), exports);
@@ -8778,6 +8878,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8778
8878
  var __metadata = (this && this.__metadata) || function (k, v) {
8779
8879
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
8780
8880
  };
8881
+ var RelationshipChange_1;
8781
8882
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8782
8883
  exports.RelationshipChange = void 0;
8783
8884
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
@@ -8787,7 +8888,7 @@ const RelationshipChangeRequest_1 = __webpack_require__(/*! ./RelationshipChange
8787
8888
  const RelationshipChangeResponse_1 = __webpack_require__(/*! ./RelationshipChangeResponse */ "./dist/modules/relationships/transmission/changes/RelationshipChangeResponse.js");
8788
8889
  const RelationshipChangeStatus_1 = __webpack_require__(/*! ./RelationshipChangeStatus */ "./dist/modules/relationships/transmission/changes/RelationshipChangeStatus.js");
8789
8890
  const RelationshipChangeType_1 = __webpack_require__(/*! ./RelationshipChangeType */ "./dist/modules/relationships/transmission/changes/RelationshipChangeType.js");
8790
- class RelationshipChange extends core_1.CoreSerializableAsync {
8891
+ let RelationshipChange = RelationshipChange_1 = class RelationshipChange extends core_1.CoreSerializableAsync {
8791
8892
  static async fromBackbone(backboneChange, requestContent, responseContent) {
8792
8893
  const relationshipChange = await this.from({
8793
8894
  id: CoreId_1.CoreId.from(backboneChange.id),
@@ -8802,12 +8903,12 @@ class RelationshipChange extends core_1.CoreSerializableAsync {
8802
8903
  return relationshipChange;
8803
8904
  }
8804
8905
  static async from(value) {
8805
- return await super.fromT(value, RelationshipChange);
8906
+ return await super.fromT(value, RelationshipChange_1);
8806
8907
  }
8807
8908
  static async deserialize(value) {
8808
- return await super.deserializeT(value, RelationshipChange);
8909
+ return await super.deserializeT(value, RelationshipChange_1);
8809
8910
  }
8810
- }
8911
+ };
8811
8912
  __decorate([
8812
8913
  (0, ts_serval_1.validate)(),
8813
8914
  (0, ts_serval_1.serialize)(),
@@ -8838,6 +8939,9 @@ __decorate([
8838
8939
  (0, ts_serval_1.serialize)(),
8839
8940
  __metadata("design:type", String)
8840
8941
  ], RelationshipChange.prototype, "type", void 0);
8942
+ RelationshipChange = RelationshipChange_1 = __decorate([
8943
+ (0, ts_serval_1.type)("RelationshipChange")
8944
+ ], RelationshipChange);
8841
8945
  exports.RelationshipChange = RelationshipChange;
8842
8946
  //# sourceMappingURL=RelationshipChange.js.map
8843
8947
 
@@ -8860,12 +8964,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8860
8964
  var __metadata = (this && this.__metadata) || function (k, v) {
8861
8965
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
8862
8966
  };
8967
+ var RelationshipChangeRequest_1;
8863
8968
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8864
8969
  exports.RelationshipChangeRequest = void 0;
8865
8970
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
8866
8971
  const core_1 = __webpack_require__(/*! ../../../../core */ "./dist/core/index.js");
8867
8972
  const CoreId_1 = __webpack_require__(/*! ../../../../core/types/CoreId */ "./dist/core/types/CoreId.js");
8868
- class RelationshipChangeRequest extends core_1.CoreSerializableAsync {
8973
+ let RelationshipChangeRequest = RelationshipChangeRequest_1 = class RelationshipChangeRequest extends core_1.CoreSerializableAsync {
8869
8974
  static async fromBackbone(backboneChange, content) {
8870
8975
  return await this.from({
8871
8976
  createdBy: core_1.CoreAddress.from(backboneChange.createdBy),
@@ -8875,12 +8980,12 @@ class RelationshipChangeRequest extends core_1.CoreSerializableAsync {
8875
8980
  });
8876
8981
  }
8877
8982
  static async from(value) {
8878
- return await super.fromT(value, RelationshipChangeRequest);
8983
+ return await super.fromT(value, RelationshipChangeRequest_1);
8879
8984
  }
8880
8985
  static async deserialize(value) {
8881
- return await super.deserializeT(value, RelationshipChangeRequest);
8986
+ return await super.deserializeT(value, RelationshipChangeRequest_1);
8882
8987
  }
8883
- }
8988
+ };
8884
8989
  __decorate([
8885
8990
  (0, ts_serval_1.validate)(),
8886
8991
  (0, ts_serval_1.serialize)(),
@@ -8901,6 +9006,9 @@ __decorate([
8901
9006
  (0, ts_serval_1.serialize)(),
8902
9007
  __metadata("design:type", ts_serval_1.SerializableAsync)
8903
9008
  ], RelationshipChangeRequest.prototype, "content", void 0);
9009
+ RelationshipChangeRequest = RelationshipChangeRequest_1 = __decorate([
9010
+ (0, ts_serval_1.type)("RelationshipChangeRequest")
9011
+ ], RelationshipChangeRequest);
8904
9012
  exports.RelationshipChangeRequest = RelationshipChangeRequest;
8905
9013
  //# sourceMappingURL=RelationshipChangeRequest.js.map
8906
9014
 
@@ -8923,12 +9031,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8923
9031
  var __metadata = (this && this.__metadata) || function (k, v) {
8924
9032
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
8925
9033
  };
9034
+ var RelationshipChangeResponse_1;
8926
9035
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8927
9036
  exports.RelationshipChangeResponse = void 0;
8928
9037
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
8929
9038
  const core_1 = __webpack_require__(/*! ../../../../core */ "./dist/core/index.js");
8930
9039
  const CoreId_1 = __webpack_require__(/*! ../../../../core/types/CoreId */ "./dist/core/types/CoreId.js");
8931
- class RelationshipChangeResponse extends core_1.CoreSerializableAsync {
9040
+ let RelationshipChangeResponse = RelationshipChangeResponse_1 = class RelationshipChangeResponse extends core_1.CoreSerializableAsync {
8932
9041
  static async fromBackbone(backboneChange, content) {
8933
9042
  return await this.from({
8934
9043
  createdBy: core_1.CoreAddress.from(backboneChange.createdBy),
@@ -8938,12 +9047,12 @@ class RelationshipChangeResponse extends core_1.CoreSerializableAsync {
8938
9047
  });
8939
9048
  }
8940
9049
  static async from(value) {
8941
- return await super.fromT(value, RelationshipChangeResponse);
9050
+ return await super.fromT(value, RelationshipChangeResponse_1);
8942
9051
  }
8943
9052
  static async deserialize(value) {
8944
- return await super.deserializeT(value, RelationshipChangeResponse);
9053
+ return await super.deserializeT(value, RelationshipChangeResponse_1);
8945
9054
  }
8946
- }
9055
+ };
8947
9056
  __decorate([
8948
9057
  (0, ts_serval_1.validate)(),
8949
9058
  (0, ts_serval_1.serialize)(),
@@ -8964,6 +9073,9 @@ __decorate([
8964
9073
  (0, ts_serval_1.serialize)(),
8965
9074
  __metadata("design:type", ts_serval_1.SerializableAsync)
8966
9075
  ], RelationshipChangeResponse.prototype, "content", void 0);
9076
+ RelationshipChangeResponse = RelationshipChangeResponse_1 = __decorate([
9077
+ (0, ts_serval_1.type)("RelationshipChangeResponse")
9078
+ ], RelationshipChangeResponse);
8967
9079
  exports.RelationshipChangeResponse = RelationshipChangeResponse;
8968
9080
  //# sourceMappingURL=RelationshipChangeResponse.js.map
8969
9081
 
@@ -9809,8 +9921,9 @@ const Relationship_1 = __webpack_require__(/*! ../relationships/local/Relationsh
9809
9921
  const RelationshipTemplate_1 = __webpack_require__(/*! ../relationshipTemplates/local/RelationshipTemplate */ "./dist/modules/relationshipTemplates/local/RelationshipTemplate.js");
9810
9922
  const Token_1 = __webpack_require__(/*! ../tokens/local/Token */ "./dist/modules/tokens/local/Token.js");
9811
9923
  const DatawalletModification_1 = __webpack_require__(/*! ./local/DatawalletModification */ "./dist/modules/sync/local/DatawalletModification.js");
9924
+ const SyncCallback_1 = __webpack_require__(/*! ./SyncCallback */ "./dist/modules/sync/SyncCallback.js");
9812
9925
  class DatawalletModificationsProcessor {
9813
- constructor(modifications, cacheFetcher, collectionProvider, logger) {
9926
+ constructor(modifications, cacheFetcher, collectionProvider, logger, reporter) {
9814
9927
  var _a, _b, _c, _d;
9815
9928
  this.cacheFetcher = cacheFetcher;
9816
9929
  this.collectionProvider = collectionProvider;
@@ -9827,12 +9940,17 @@ class DatawalletModificationsProcessor {
9827
9940
  this.updates = (_b = modificationsGroupedByType[DatawalletModification_1.DatawalletModificationType.Update]) !== null && _b !== void 0 ? _b : [];
9828
9941
  this.deletes = (_c = modificationsGroupedByType[DatawalletModification_1.DatawalletModificationType.Delete]) !== null && _c !== void 0 ? _c : [];
9829
9942
  this.cacheChanges = (_d = modificationsGroupedByType[DatawalletModification_1.DatawalletModificationType.CacheChanged]) !== null && _d !== void 0 ? _d : [];
9943
+ const totalItems = this.creates.length + this.updates.length + this.deletes.length + this.cacheChanges.length;
9944
+ this.syncStep = reporter.createStep(SyncCallback_1.SyncStep.DatawalletSyncProcessing, totalItems);
9830
9945
  }
9831
9946
  async execute() {
9832
9947
  await this.applyCreates();
9833
9948
  await this.applyUpdates();
9834
9949
  await this.applyCacheChanges();
9835
9950
  await this.applyDeletes();
9951
+ // cache-fills are optimized by the backbone, so it is possible that the processedItemCount is
9952
+ // lower than the total number of items - in this case the 100% callback is triggered here
9953
+ this.syncStep.finish();
9836
9954
  }
9837
9955
  async applyCreates() {
9838
9956
  if (this.creates.length === 0) {
@@ -9862,8 +9980,10 @@ class DatawalletModificationsProcessor {
9862
9980
  objectIdentifier: core_1.CoreId.from(objectIdentifier)
9863
9981
  });
9864
9982
  this.cacheChanges.push(modification);
9983
+ this.syncStep.incrementTotalNumberOfItems();
9865
9984
  }
9866
9985
  await targetCollection.create(newObject);
9986
+ this.syncStep.progress();
9867
9987
  }
9868
9988
  }
9869
9989
  async applyUpdates() {
@@ -9879,6 +9999,7 @@ class DatawalletModificationsProcessor {
9879
9999
  const oldObject = await core_1.CoreSerializableAsync.fromUnknown(oldDoc);
9880
10000
  const newObject = { ...oldObject.toJSON(), ...updateModification.payload };
9881
10001
  await targetCollection.update(oldDoc, newObject);
10002
+ this.syncStep.progress();
9882
10003
  }
9883
10004
  }
9884
10005
  async applyCacheChanges() {
@@ -9926,12 +10047,15 @@ class DatawalletModificationsProcessor {
9926
10047
  return { fileIds, messageIds, relationshipTemplateIds: templateIds, tokenIds, relationshipIds };
9927
10048
  }
9928
10049
  async saveNewCaches(caches, collectionName, constructorOfT) {
10050
+ if (caches.length === 0)
10051
+ return;
9929
10052
  const collection = await this.collectionProvider.getCollection(collectionName);
9930
10053
  await Promise.all(caches.map(async (c) => {
9931
10054
  const itemDoc = await collection.read(c.id.toString());
9932
10055
  const item = await core_1.CoreSerializableAsync.fromT(itemDoc, constructorOfT);
9933
10056
  item.setCache(c.cache);
9934
10057
  await collection.update(itemDoc, item);
10058
+ this.syncStep.progress();
9935
10059
  }));
9936
10060
  }
9937
10061
  async applyDeletes() {
@@ -9941,6 +10065,7 @@ class DatawalletModificationsProcessor {
9941
10065
  for (const deleteModification of this.deletes) {
9942
10066
  const targetCollection = await this.collectionProvider.getCollection(deleteModification.collection);
9943
10067
  await targetCollection.delete({ id: deleteModification.objectIdentifier });
10068
+ this.syncStep.progress();
9944
10069
  }
9945
10070
  }
9946
10071
  }
@@ -9994,14 +10119,16 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
9994
10119
  exports.ExternalEventsProcessor = void 0;
9995
10120
  const core_1 = __webpack_require__(/*! ../../core */ "./dist/core/index.js");
9996
10121
  const ChangedItems_1 = __webpack_require__(/*! ./ChangedItems */ "./dist/modules/sync/ChangedItems.js");
10122
+ const SyncCallback_1 = __webpack_require__(/*! ./SyncCallback */ "./dist/modules/sync/SyncCallback.js");
9997
10123
  class ExternalEventsProcessor {
9998
- constructor(messagesController, relationshipsController, externalEvents) {
10124
+ constructor(messagesController, relationshipsController, externalEvents, reporter) {
9999
10125
  this.messagesController = messagesController;
10000
10126
  this.relationshipsController = relationshipsController;
10001
10127
  this.externalEvents = externalEvents;
10002
10128
  this.changedItems = new ChangedItems_1.ChangedItems();
10003
10129
  this.results = [];
10004
10130
  this.log = core_1.TransportLoggerFactory.getLogger(ExternalEventsProcessor);
10131
+ this.syncStep = reporter.createStep(SyncCallback_1.SyncStep.ExternalEventsProcessing, externalEvents.length);
10005
10132
  }
10006
10133
  async execute() {
10007
10134
  for (const externalEvent of this.externalEvents) {
@@ -10043,6 +10170,9 @@ class ExternalEventsProcessor {
10043
10170
  errorCode: errorCode
10044
10171
  });
10045
10172
  }
10173
+ finally {
10174
+ this.syncStep.progress();
10175
+ }
10046
10176
  }
10047
10177
  }
10048
10178
  async applyRelationshipChangeCompletedEvent(externalEvent) {
@@ -10075,6 +10205,41 @@ exports.ExternalEventsProcessor = ExternalEventsProcessor;
10075
10205
 
10076
10206
  /***/ }),
10077
10207
 
10208
+ /***/ "./dist/modules/sync/SyncCallback.js":
10209
+ /*!*******************************************!*\
10210
+ !*** ./dist/modules/sync/SyncCallback.js ***!
10211
+ \*******************************************/
10212
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
10213
+
10214
+ "use strict";
10215
+
10216
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
10217
+ exports.SyncStep = exports.SyncProgressReporterStep = exports.SyncProgressReporter = void 0;
10218
+ const core_1 = __webpack_require__(/*! ../../core */ "./dist/core/index.js");
10219
+ class SyncProgressReporter extends core_1.ProgressReporter {
10220
+ static fromCallback(callback) {
10221
+ return new SyncProgressReporter(callback);
10222
+ }
10223
+ }
10224
+ exports.SyncProgressReporter = SyncProgressReporter;
10225
+ class SyncProgressReporterStep extends core_1.ProgressReporterStep {
10226
+ }
10227
+ exports.SyncProgressReporterStep = SyncProgressReporterStep;
10228
+ var SyncStep;
10229
+ (function (SyncStep) {
10230
+ SyncStep["Sync"] = "sync";
10231
+ SyncStep["DatawalletSync"] = "sync:datawallet";
10232
+ SyncStep["DatawalletSyncDownloading"] = "sync:datawallet:downloading";
10233
+ SyncStep["DatawalletSyncDecryption"] = "sync:datawallet:decrypting";
10234
+ SyncStep["DatawalletSyncProcessing"] = "sync:datawallet:processing";
10235
+ SyncStep["ExternalEventsSync"] = "sync:externalEvents";
10236
+ SyncStep["ExternalEventsSyncDownloading"] = "sync:externalEvents:downloading";
10237
+ SyncStep["ExternalEventsProcessing"] = "sync:externalEvents:processing";
10238
+ })(SyncStep = exports.SyncStep || (exports.SyncStep = {}));
10239
+ //# sourceMappingURL=SyncCallback.js.map
10240
+
10241
+ /***/ }),
10242
+
10078
10243
  /***/ "./dist/modules/sync/SyncController.js":
10079
10244
  /*!*********************************************!*\
10080
10245
  !*** ./dist/modules/sync/SyncController.js ***!
@@ -10095,6 +10260,7 @@ const ExternalEventsProcessor_1 = __webpack_require__(/*! ./ExternalEventsProces
10095
10260
  const DatawalletModification_1 = __webpack_require__(/*! ./local/DatawalletModification */ "./dist/modules/sync/local/DatawalletModification.js");
10096
10261
  const DeviceMigrations_1 = __webpack_require__(/*! ./migrations/DeviceMigrations */ "./dist/modules/sync/migrations/DeviceMigrations.js");
10097
10262
  const IdentityMigrations_1 = __webpack_require__(/*! ./migrations/IdentityMigrations */ "./dist/modules/sync/migrations/IdentityMigrations.js");
10263
+ const SyncCallback_1 = __webpack_require__(/*! ./SyncCallback */ "./dist/modules/sync/SyncCallback.js");
10098
10264
  class SyncController extends core_1.TransportController {
10099
10265
  constructor(parent, dependencyOverrides, unpushedDatawalletModifications, datawalletEnabled) {
10100
10266
  var _a;
@@ -10116,32 +10282,35 @@ class SyncController extends core_1.TransportController {
10116
10282
  this.syncInfo = await this.db.getMap("SyncInfo");
10117
10283
  return this;
10118
10284
  }
10119
- async sync(whatToSync = "Everything") {
10285
+ async sync(whatToSync = "Everything", reporter) {
10120
10286
  var _a;
10121
10287
  if ((_a = this.currentSync) === null || _a === void 0 ? void 0 : _a.includes(whatToSync)) {
10122
10288
  return await this.currentSync.promise;
10123
10289
  }
10124
10290
  if (this.currentSync && !this.currentSync.includes(whatToSync)) {
10125
10291
  await this.currentSync.promise;
10126
- return await this.sync(whatToSync);
10292
+ return await this.sync(whatToSync, reporter);
10127
10293
  }
10128
- const syncPromise = this._sync(whatToSync);
10294
+ const syncPromise = this._sync(whatToSync, reporter);
10129
10295
  this.currentSync = new LocalSyncRun(syncPromise, whatToSync);
10130
10296
  try {
10131
10297
  return await this.currentSync.promise;
10132
10298
  }
10133
10299
  finally {
10134
10300
  if (this.datawalletEnabled && (await this.unpushedDatawalletModifications.exists())) {
10135
- await this.syncDatawallet().catch((e) => this.log.error(e));
10301
+ await this.syncDatawallet(reporter).catch((e) => this.log.error(e));
10136
10302
  }
10137
10303
  this.currentSync = undefined;
10138
10304
  }
10139
10305
  }
10140
- async _sync(whatToSync) {
10306
+ async _sync(whatToSync, reporter) {
10307
+ const syncStep = reporter.createStep(SyncCallback_1.SyncStep.Sync, 1);
10141
10308
  if (whatToSync === "OnlyDatawallet") {
10142
- return await this.syncDatawallet();
10309
+ const value = await this.syncDatawallet(reporter);
10310
+ syncStep.finish();
10311
+ return value;
10143
10312
  }
10144
- const externalEventSyncResult = await this.syncExternalEvents();
10313
+ const externalEventSyncResult = await this.syncExternalEvents(reporter);
10145
10314
  await this.setLastCompletedSyncTime();
10146
10315
  if (externalEventSyncResult.externalEventResults.some((r) => r.errorCode !== undefined)) {
10147
10316
  throw new core_1.CoreError("error.transport.errorWhileApplyingExternalEvents", externalEventSyncResult.externalEventResults
@@ -10149,23 +10318,24 @@ class SyncController extends core_1.TransportController {
10149
10318
  .map((r) => r.errorCode)
10150
10319
  .join(" | ")).logWith(this.log);
10151
10320
  }
10321
+ syncStep.finish();
10152
10322
  return externalEventSyncResult.changedItems;
10153
10323
  }
10154
- async syncExternalEvents() {
10324
+ async syncExternalEvents(reporter) {
10155
10325
  const syncRunWasStarted = await this.startExternalEventsSyncRun();
10156
10326
  if (!syncRunWasStarted) {
10157
- await this.syncDatawallet();
10327
+ await this.syncDatawallet(reporter);
10158
10328
  return {
10159
10329
  changedItems: new ChangedItems_1.ChangedItems(),
10160
10330
  externalEventResults: []
10161
10331
  };
10162
10332
  }
10163
- await this.applyIncomingDatawalletModifications();
10164
- const result = await this.applyIncomingExternalEvents();
10333
+ await this.applyIncomingDatawalletModifications(reporter);
10334
+ const result = await this.applyIncomingExternalEvents(reporter);
10165
10335
  await this.finalizeExternalEventsSyncRun(result.externalEventResults);
10166
10336
  return result;
10167
10337
  }
10168
- async syncDatawallet() {
10338
+ async syncDatawallet(reporter) {
10169
10339
  if (!this.datawalletEnabled) {
10170
10340
  return;
10171
10341
  }
@@ -10179,7 +10349,7 @@ class SyncController extends core_1.TransportController {
10179
10349
  }
10180
10350
  this.log.trace("Synchronization of Datawallet events started...");
10181
10351
  try {
10182
- await this.applyIncomingDatawalletModifications();
10352
+ await this.applyIncomingDatawalletModifications(reporter);
10183
10353
  await this.pushLocalDatawalletModifications();
10184
10354
  await this.setLastCompletedDatawalletSyncTime();
10185
10355
  }
@@ -10256,29 +10426,45 @@ class SyncController extends core_1.TransportController {
10256
10426
  await this.parent.activeDevice.update({ datawalletVersion: deviceDatawalletVersion });
10257
10427
  }
10258
10428
  }
10259
- async applyIncomingDatawalletModifications() {
10260
- const getDatawalletModificationsResult = await this.client.getDatawalletModifications({
10261
- localIndex: await this.getLocalDatawalletModificationIndex()
10262
- });
10429
+ async applyIncomingDatawalletModifications(reporter) {
10430
+ const datawalletSyncStep = reporter.createStep(SyncCallback_1.SyncStep.DatawalletSync, 1);
10431
+ const downloadingStep = reporter.createStep(SyncCallback_1.SyncStep.DatawalletSyncDownloading);
10432
+ const getDatawalletModificationsResult = await this.client.getDatawalletModifications({ localIndex: await this.getLocalDatawalletModificationIndex() }, (percentage) => downloadingStep.manualReport(percentage));
10263
10433
  const encryptedIncomingModifications = await getDatawalletModificationsResult.value.collect();
10264
10434
  if (encryptedIncomingModifications.length === 0) {
10435
+ datawalletSyncStep.finish();
10265
10436
  return;
10266
10437
  }
10267
- const incomingModifications = await this.decryptDatawalletModifications(encryptedIncomingModifications);
10438
+ const incomingModifications = await this.decryptDatawalletModifications(encryptedIncomingModifications, reporter);
10268
10439
  this.log.trace(`${incomingModifications.length} incoming modifications found`);
10269
- const datawalletModificationsProcessor = new DatawalletModificationsProcessor_1.DatawalletModificationsProcessor(incomingModifications, this.cacheFetcher, this._db, core_1.TransportLoggerFactory.getLogger(DatawalletModificationsProcessor_1.DatawalletModificationsProcessor));
10440
+ const datawalletModificationsProcessor = new DatawalletModificationsProcessor_1.DatawalletModificationsProcessor(incomingModifications, this.cacheFetcher, this._db, core_1.TransportLoggerFactory.getLogger(DatawalletModificationsProcessor_1.DatawalletModificationsProcessor), reporter);
10270
10441
  await datawalletModificationsProcessor.execute();
10271
10442
  this.log.trace(`${incomingModifications.length} incoming modifications executed`, incomingModifications);
10272
10443
  await this.updateLocalDatawalletModificationIndex(encryptedIncomingModifications.sort(descending)[0].index);
10273
- }
10274
- async decryptDatawalletModifications(encryptedModifications) {
10275
- const decryptedModifications = [];
10276
- for (const encryptedModification of encryptedModifications) {
10277
- const decryptedPayload = await this.parent.activeDevice.secrets.decryptDatawalletModificationPayload(encryptedModification.encryptedPayload, encryptedModification.index);
10278
- const decryptedModification = await DatawalletModificationMapper_1.DatawalletModificationMapper.fromBackboneDatawalletModification(encryptedModification, decryptedPayload, this.config.supportedDatawalletVersion);
10279
- decryptedModifications.push(decryptedModification);
10444
+ datawalletSyncStep.finish();
10445
+ }
10446
+ async promiseAllWithProgess(promises, callback) {
10447
+ callback(0);
10448
+ let processedItemCount = 0;
10449
+ for (const promise of promises) {
10450
+ // eslint-disable-next-line no-loop-func,no-void
10451
+ void promise.then(() => {
10452
+ processedItemCount++;
10453
+ const percentage = Math.round((processedItemCount / promises.length) * 100);
10454
+ callback(percentage);
10455
+ });
10280
10456
  }
10281
- return decryptedModifications;
10457
+ return await Promise.all(promises);
10458
+ }
10459
+ async decryptDatawalletModifications(encryptedModifications, reporter) {
10460
+ const promises = encryptedModifications.map((m) => this.decryptDatawalletModification(m));
10461
+ const step = reporter.createStep(SyncCallback_1.SyncStep.DatawalletSyncDecryption);
10462
+ return await this.promiseAllWithProgess(promises, (p) => step.manualReport(p));
10463
+ }
10464
+ async decryptDatawalletModification(encryptedModification) {
10465
+ const decryptedPayload = await this.parent.activeDevice.secrets.decryptDatawalletModificationPayload(encryptedModification.encryptedPayload, encryptedModification.index);
10466
+ const decryptedModification = await DatawalletModificationMapper_1.DatawalletModificationMapper.fromBackboneDatawalletModification(encryptedModification, decryptedPayload, this.config.supportedDatawalletVersion);
10467
+ return decryptedModification;
10282
10468
  }
10283
10469
  async pushLocalDatawalletModifications() {
10284
10470
  const { backboneModifications, localModificationIds } = await this.prepareLocalDatawalletModificationsForPush();
@@ -10337,14 +10523,17 @@ class SyncController extends core_1.TransportController {
10337
10523
  this.currentSyncRun = (_a = result.value.syncRun) !== null && _a !== void 0 ? _a : undefined;
10338
10524
  return this.currentSyncRun !== undefined;
10339
10525
  }
10340
- async applyIncomingExternalEvents() {
10341
- const getExternalEventsResult = await this.client.getExternalEventsOfSyncRun(this.currentSyncRun.id.toString());
10526
+ async applyIncomingExternalEvents(reporter) {
10527
+ const externalEventStep = reporter.createStep(SyncCallback_1.SyncStep.ExternalEventsSync, 1);
10528
+ const downloadingStep = reporter.createStep(SyncCallback_1.SyncStep.ExternalEventsSyncDownloading);
10529
+ const getExternalEventsResult = await this.client.getExternalEventsOfSyncRun(this.currentSyncRun.id.toString(), (percentage) => downloadingStep.manualReport(percentage));
10342
10530
  if (getExternalEventsResult.isError) {
10343
10531
  throw getExternalEventsResult.error;
10344
10532
  }
10345
10533
  const externalEvents = await getExternalEventsResult.value.collect();
10346
- const externalEventProcessor = new ExternalEventsProcessor_1.ExternalEventsProcessor(this.parent.messages, this.parent.relationships, externalEvents);
10534
+ const externalEventProcessor = new ExternalEventsProcessor_1.ExternalEventsProcessor(this.parent.messages, this.parent.relationships, externalEvents, reporter);
10347
10535
  await externalEventProcessor.execute();
10536
+ externalEventStep.finish();
10348
10537
  return {
10349
10538
  externalEventResults: externalEventProcessor.results,
10350
10539
  changedItems: externalEventProcessor.changedItems
@@ -10719,7 +10908,7 @@ class SyncClient extends core_1.RESTClientAuthenticate {
10719
10908
  constructor(config, authenticator) {
10720
10909
  super(config, authenticator, {
10721
10910
  headers: {
10722
- "x-supported-datawallet-version": config.supportedDatawalletVersion.toString()
10911
+ "x-supported-datawallet-version": config.supportedDatawalletVersion.toString() // eslint-disable-line @typescript-eslint/naming-convention
10723
10912
  }
10724
10913
  });
10725
10914
  }
@@ -10732,14 +10921,14 @@ class SyncClient extends core_1.RESTClientAuthenticate {
10732
10921
  async finalizeDatawalletVersionUpgrade(id, request) {
10733
10922
  return await this.put(`/api/v1/SyncRuns/${id}/FinalizeDatawalletVersionUpgrade`, request);
10734
10923
  }
10735
- async getExternalEventsOfSyncRun(syncRunId) {
10736
- return await this.getPaged(`/api/v1/SyncRuns/${syncRunId}/ExternalEvents`, {});
10924
+ async getExternalEventsOfSyncRun(syncRunId, progessCallback) {
10925
+ return await this.getPaged(`/api/v1/SyncRuns/${syncRunId}/ExternalEvents`, {}, undefined, progessCallback);
10737
10926
  }
10738
10927
  async getDatawallet() {
10739
10928
  return await this.get("/api/v1/Datawallet");
10740
10929
  }
10741
- async getDatawalletModifications(request) {
10742
- return await this.getPaged("/api/v1/Datawallet/Modifications", request);
10930
+ async getDatawalletModifications(request, progessCallback) {
10931
+ return await this.getPaged("/api/v1/Datawallet/Modifications", request, undefined, progessCallback);
10743
10932
  }
10744
10933
  async createDatawalletModifications(request) {
10745
10934
  return await this.post("/api/v1/Datawallet/Modifications", request);
@@ -11983,7 +12172,11 @@ exports.Random = Random;
11983
12172
 
11984
12173
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11985
12174
  if (k2 === undefined) k2 = k;
11986
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12175
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12176
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12177
+ desc = { enumerable: true, get: function() { return m[k]; } };
12178
+ }
12179
+ Object.defineProperty(o, k2, desc);
11987
12180
  }) : (function(o, m, k, k2) {
11988
12181
  if (k2 === undefined) k2 = k;
11989
12182
  o[k2] = m[k];
@@ -12616,7 +12809,7 @@ var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_mod
12616
12809
  var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
12617
12810
  var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
12618
12811
  var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js");
12619
- var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");
12812
+ var transitionalDefaults = __webpack_require__(/*! ../defaults/transitional */ "./node_modules/axios/lib/defaults/transitional.js");
12620
12813
  var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
12621
12814
 
12622
12815
  module.exports = function xhrAdapter(config) {
@@ -12731,7 +12924,7 @@ module.exports = function xhrAdapter(config) {
12731
12924
  // Handle timeout
12732
12925
  request.ontimeout = function handleTimeout() {
12733
12926
  var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
12734
- var transitional = config.transitional || defaults.transitional;
12927
+ var transitional = config.transitional || transitionalDefaults;
12735
12928
  if (config.timeoutErrorMessage) {
12736
12929
  timeoutErrorMessage = config.timeoutErrorMessage;
12737
12930
  }
@@ -12835,7 +13028,7 @@ var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.j
12835
13028
  var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
12836
13029
  var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js");
12837
13030
  var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
12838
- var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js");
13031
+ var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults/index.js");
12839
13032
 
12840
13033
  /**
12841
13034
  * Create an instance of Axios
@@ -13111,10 +13304,6 @@ Axios.prototype.request = function request(configOrUrl, config) {
13111
13304
  config = configOrUrl || {};
13112
13305
  }
13113
13306
 
13114
- if (!config.url) {
13115
- throw new Error('Provided config url is not valid');
13116
- }
13117
-
13118
13307
  config = mergeConfig(this.defaults, config);
13119
13308
 
13120
13309
  // Set config.method
@@ -13197,9 +13386,6 @@ Axios.prototype.request = function request(configOrUrl, config) {
13197
13386
  };
13198
13387
 
13199
13388
  Axios.prototype.getUri = function getUri(config) {
13200
- if (!config.url) {
13201
- throw new Error('Provided config url is not valid');
13202
- }
13203
13389
  config = mergeConfig(this.defaults, config);
13204
13390
  return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
13205
13391
  };
@@ -13369,7 +13555,7 @@ module.exports = function createError(message, config, code, request, response)
13369
13555
  var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
13370
13556
  var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js");
13371
13557
  var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
13372
- var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");
13558
+ var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults/index.js");
13373
13559
  var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
13374
13560
 
13375
13561
  /**
@@ -13665,7 +13851,7 @@ module.exports = function settle(resolve, reject, response) {
13665
13851
 
13666
13852
 
13667
13853
  var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
13668
- var defaults = __webpack_require__(/*! ./../defaults */ "./node_modules/axios/lib/defaults.js");
13854
+ var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults/index.js");
13669
13855
 
13670
13856
  /**
13671
13857
  * Transform the data for a request or a response
@@ -13688,18 +13874,19 @@ module.exports = function transformData(data, headers, fns) {
13688
13874
 
13689
13875
  /***/ }),
13690
13876
 
13691
- /***/ "./node_modules/axios/lib/defaults.js":
13692
- /*!********************************************!*\
13693
- !*** ./node_modules/axios/lib/defaults.js ***!
13694
- \********************************************/
13877
+ /***/ "./node_modules/axios/lib/defaults/index.js":
13878
+ /*!**************************************************!*\
13879
+ !*** ./node_modules/axios/lib/defaults/index.js ***!
13880
+ \**************************************************/
13695
13881
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
13696
13882
 
13697
13883
  "use strict";
13698
13884
 
13699
13885
 
13700
- var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
13701
- var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js");
13702
- var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
13886
+ var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
13887
+ var normalizeHeaderName = __webpack_require__(/*! ../helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js");
13888
+ var enhanceError = __webpack_require__(/*! ../core/enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
13889
+ var transitionalDefaults = __webpack_require__(/*! ./transitional */ "./node_modules/axios/lib/defaults/transitional.js");
13703
13890
 
13704
13891
  var DEFAULT_CONTENT_TYPE = {
13705
13892
  'Content-Type': 'application/x-www-form-urlencoded'
@@ -13715,10 +13902,10 @@ function getDefaultAdapter() {
13715
13902
  var adapter;
13716
13903
  if (typeof XMLHttpRequest !== 'undefined') {
13717
13904
  // For browsers use XHR adapter
13718
- adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js");
13905
+ adapter = __webpack_require__(/*! ../adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js");
13719
13906
  } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
13720
13907
  // For node use HTTP adapter
13721
- adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js");
13908
+ adapter = __webpack_require__(/*! ../adapters/http */ "./node_modules/axios/lib/adapters/xhr.js");
13722
13909
  }
13723
13910
  return adapter;
13724
13911
  }
@@ -13740,11 +13927,7 @@ function stringifySafely(rawValue, parser, encoder) {
13740
13927
 
13741
13928
  var defaults = {
13742
13929
 
13743
- transitional: {
13744
- silentJSONParsing: true,
13745
- forcedJSONParsing: true,
13746
- clarifyTimeoutError: false
13747
- },
13930
+ transitional: transitionalDefaults,
13748
13931
 
13749
13932
  adapter: getDefaultAdapter(),
13750
13933
 
@@ -13831,6 +14014,24 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
13831
14014
  module.exports = defaults;
13832
14015
 
13833
14016
 
14017
+ /***/ }),
14018
+
14019
+ /***/ "./node_modules/axios/lib/defaults/transitional.js":
14020
+ /*!*********************************************************!*\
14021
+ !*** ./node_modules/axios/lib/defaults/transitional.js ***!
14022
+ \*********************************************************/
14023
+ /***/ ((module) => {
14024
+
14025
+ "use strict";
14026
+
14027
+
14028
+ module.exports = {
14029
+ silentJSONParsing: true,
14030
+ forcedJSONParsing: true,
14031
+ clarifyTimeoutError: false
14032
+ };
14033
+
14034
+
13834
14035
  /***/ }),
13835
14036
 
13836
14037
  /***/ "./node_modules/axios/lib/env/data.js":
@@ -13840,7 +14041,7 @@ module.exports = defaults;
13840
14041
  /***/ ((module) => {
13841
14042
 
13842
14043
  module.exports = {
13843
- "version": "0.25.0"
14044
+ "version": "0.26.1"
13844
14045
  };
13845
14046
 
13846
14047
  /***/ }),
@@ -35774,6 +35975,9 @@ var Formatter = /*#__PURE__*/function () {
35774
35975
  case "d":
35775
35976
  return "day";
35776
35977
 
35978
+ case "w":
35979
+ return "week";
35980
+
35777
35981
  case "M":
35778
35982
  return "month";
35779
35983
 
@@ -36023,7 +36227,6 @@ var SystemZone = /*#__PURE__*/function (_Zone) {
36023
36227
  return SystemZone;
36024
36228
  }(Zone);
36025
36229
 
36026
- var matchingRegex = RegExp("^" + ianaRegex.source + "$");
36027
36230
  var dtfCache = {};
36028
36231
 
36029
36232
  function makeDTF(zone) {
@@ -36036,7 +36239,8 @@ function makeDTF(zone) {
36036
36239
  day: "2-digit",
36037
36240
  hour: "2-digit",
36038
36241
  minute: "2-digit",
36039
- second: "2-digit"
36242
+ second: "2-digit",
36243
+ era: "short"
36040
36244
  });
36041
36245
  }
36042
36246
 
@@ -36047,34 +36251,38 @@ var typeToPos = {
36047
36251
  year: 0,
36048
36252
  month: 1,
36049
36253
  day: 2,
36050
- hour: 3,
36051
- minute: 4,
36052
- second: 5
36254
+ era: 3,
36255
+ hour: 4,
36256
+ minute: 5,
36257
+ second: 6
36053
36258
  };
36054
36259
 
36055
36260
  function hackyOffset(dtf, date) {
36056
36261
  var formatted = dtf.format(date).replace(/\u200E/g, ""),
36057
- parsed = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(formatted),
36262
+ parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted),
36058
36263
  fMonth = parsed[1],
36059
36264
  fDay = parsed[2],
36060
36265
  fYear = parsed[3],
36061
- fHour = parsed[4],
36062
- fMinute = parsed[5],
36063
- fSecond = parsed[6];
36064
- return [fYear, fMonth, fDay, fHour, fMinute, fSecond];
36266
+ fadOrBc = parsed[4],
36267
+ fHour = parsed[5],
36268
+ fMinute = parsed[6],
36269
+ fSecond = parsed[7];
36270
+ return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];
36065
36271
  }
36066
36272
 
36067
36273
  function partsOffset(dtf, date) {
36068
- var formatted = dtf.formatToParts(date),
36069
- filled = [];
36274
+ var formatted = dtf.formatToParts(date);
36275
+ var filled = [];
36070
36276
 
36071
36277
  for (var i = 0; i < formatted.length; i++) {
36072
36278
  var _formatted$i = formatted[i],
36073
36279
  type = _formatted$i.type,
36074
- value = _formatted$i.value,
36075
- pos = typeToPos[type];
36280
+ value = _formatted$i.value;
36281
+ var pos = typeToPos[type];
36076
36282
 
36077
- if (!isUndefined(pos)) {
36283
+ if (type === "era") {
36284
+ filled[pos] = value;
36285
+ } else if (!isUndefined(pos)) {
36078
36286
  filled[pos] = parseInt(value, 10);
36079
36287
  }
36080
36288
  }
@@ -36116,14 +36324,14 @@ var IANAZone = /*#__PURE__*/function (_Zone) {
36116
36324
  * 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.
36117
36325
  * @param {string} s - The string to check validity on
36118
36326
  * @example IANAZone.isValidSpecifier("America/New_York") //=> true
36119
- * @example IANAZone.isValidSpecifier("Fantasia/Castle") //=> true
36120
36327
  * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false
36328
+ * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.
36121
36329
  * @return {boolean}
36122
36330
  */
36123
36331
  ;
36124
36332
 
36125
36333
  IANAZone.isValidSpecifier = function isValidSpecifier(s) {
36126
- return !!(s && s.match(matchingRegex));
36334
+ return this.isValidZone(s);
36127
36335
  }
36128
36336
  /**
36129
36337
  * Returns whether the provided string identifies a real zone
@@ -36185,15 +36393,20 @@ var IANAZone = /*#__PURE__*/function (_Zone) {
36185
36393
  _proto.offset = function offset(ts) {
36186
36394
  var date = new Date(ts);
36187
36395
  if (isNaN(date)) return NaN;
36396
+ var dtf = makeDTF(this.name);
36188
36397
 
36189
- var dtf = makeDTF(this.name),
36190
- _ref2 = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date),
36398
+ var _ref2 = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date),
36191
36399
  year = _ref2[0],
36192
36400
  month = _ref2[1],
36193
36401
  day = _ref2[2],
36194
- hour = _ref2[3],
36195
- minute = _ref2[4],
36196
- 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
36402
+ adOrBc = _ref2[3],
36403
+ hour = _ref2[4],
36404
+ minute = _ref2[5],
36405
+ second = _ref2[6];
36406
+
36407
+ if (adOrBc === "BC") {
36408
+ year = -Math.abs(year) + 1;
36409
+ } // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat
36197
36410
 
36198
36411
 
36199
36412
  var adjustedHour = hour === 24 ? 0 : hour;
@@ -36456,7 +36669,7 @@ function normalizeZone(input, defaultZone) {
36456
36669
  return input;
36457
36670
  } else if (isString(input)) {
36458
36671
  var lowered = input.toLowerCase();
36459
- 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);
36672
+ if (lowered === "local" || lowered === "system") return defaultZone;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);
36460
36673
  } else if (isNumber(input)) {
36461
36674
  return FixedOffsetZone.instance(input);
36462
36675
  } else if (typeof input === "object" && input.offset && typeof input.offset === "number") {
@@ -37910,6 +38123,7 @@ var Duration = /*#__PURE__*/function () {
37910
38123
  * * `m` for minutes
37911
38124
  * * `h` for hours
37912
38125
  * * `d` for days
38126
+ * * `w` for weeks
37913
38127
  * * `M` for months
37914
38128
  * * `y` for years
37915
38129
  * Notes:
@@ -37936,8 +38150,9 @@ var Duration = /*#__PURE__*/function () {
37936
38150
  return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2;
37937
38151
  }
37938
38152
  /**
37939
- * Returns a string representation of a Duration with all units included
37940
- * To modify its behavior use the `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. See {@link Intl.NumberFormat}.
38153
+ * Returns a string representation of a Duration with all units included.
38154
+ * To modify its behavior use the `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.
38155
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
37941
38156
  * @param opts - On option object to override the formatting. Accepts the same keys as the options parameter of the native `Int.NumberFormat` constructor, as well as `listStyle`.
37942
38157
  * @example
37943
38158
  * ```js
@@ -38332,7 +38547,7 @@ var Duration = /*#__PURE__*/function () {
38332
38547
 
38333
38548
  for (var _i2 = 0, _Object$keys2 = Object.keys(this.values); _i2 < _Object$keys2.length; _i2++) {
38334
38549
  var k = _Object$keys2[_i2];
38335
- negated[k] = -this.values[k];
38550
+ negated[k] = this.values[k] === 0 ? 0 : -this.values[k];
38336
38551
  }
38337
38552
 
38338
38553
  return clone$1(this, {
@@ -39258,7 +39473,7 @@ var Info = /*#__PURE__*/function () {
39258
39473
  ;
39259
39474
 
39260
39475
  Info.isValidIANAZone = function isValidIANAZone(zone) {
39261
- return IANAZone.isValidSpecifier(zone) && IANAZone.isValidZone(zone);
39476
+ return IANAZone.isValidZone(zone);
39262
39477
  }
39263
39478
  /**
39264
39479
  * Converts the input into a {@link Zone} instance.
@@ -40210,7 +40425,13 @@ function unitOutOfRange(unit, value) {
40210
40425
  }
40211
40426
 
40212
40427
  function dayOfWeek(year, month, day) {
40213
- var js = new Date(Date.UTC(year, month - 1, day)).getUTCDay();
40428
+ var d = new Date(Date.UTC(year, month - 1, day));
40429
+
40430
+ if (year < 100 && year >= 0) {
40431
+ d.setUTCFullYear(d.getUTCFullYear() - 1900);
40432
+ }
40433
+
40434
+ var js = d.getUTCDay();
40214
40435
  return js === 0 ? 7 : js;
40215
40436
  }
40216
40437
 
@@ -40638,9 +40859,6 @@ function normalizeUnit(unit) {
40638
40859
  } // this is a dumbed down version of fromObject() that runs about 60% faster
40639
40860
  // but doesn't do any validation, makes a bunch of assumptions about what units
40640
40861
  // are present, and so on.
40641
- // this is a dumbed down version of fromObject() that runs about 60% faster
40642
- // but doesn't do any validation, makes a bunch of assumptions about what units
40643
- // are present, and so on.
40644
40862
 
40645
40863
 
40646
40864
  function quickDT(obj, opts) {
@@ -41342,7 +41560,7 @@ var DateTime = /*#__PURE__*/function () {
41342
41560
  }
41343
41561
  }
41344
41562
  /**
41345
- * Check if an object is a DateTime. Works across context boundaries
41563
+ * Check if an object is an instance of DateTime. Works across context boundaries
41346
41564
  * @param {object} o
41347
41565
  * @return {boolean}
41348
41566
  */
@@ -41892,6 +42110,7 @@ var DateTime = /*#__PURE__*/function () {
41892
42110
  * @param {Object} opts - options
41893
42111
  * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.
41894
42112
  * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'
42113
+ * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'
41895
42114
  * @example DateTime.utc().toSQL() //=> '05:15:16.345'
41896
42115
  * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'
41897
42116
  * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'
@@ -41905,12 +42124,16 @@ var DateTime = /*#__PURE__*/function () {
41905
42124
  _ref7$includeOffset = _ref7.includeOffset,
41906
42125
  includeOffset = _ref7$includeOffset === void 0 ? true : _ref7$includeOffset,
41907
42126
  _ref7$includeZone = _ref7.includeZone,
41908
- includeZone = _ref7$includeZone === void 0 ? false : _ref7$includeZone;
42127
+ includeZone = _ref7$includeZone === void 0 ? false : _ref7$includeZone,
42128
+ _ref7$includeOffsetSp = _ref7.includeOffsetSpace,
42129
+ includeOffsetSpace = _ref7$includeOffsetSp === void 0 ? true : _ref7$includeOffsetSp;
41909
42130
 
41910
42131
  var fmt = "HH:mm:ss.SSS";
41911
42132
 
41912
42133
  if (includeZone || includeOffset) {
41913
- fmt += " ";
42134
+ if (includeOffsetSpace) {
42135
+ fmt += " ";
42136
+ }
41914
42137
 
41915
42138
  if (includeZone) {
41916
42139
  fmt += "z";
@@ -41926,6 +42149,7 @@ var DateTime = /*#__PURE__*/function () {
41926
42149
  * @param {Object} opts - options
41927
42150
  * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.
41928
42151
  * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'
42152
+ * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'
41929
42153
  * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'
41930
42154
  * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'
41931
42155
  * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'
@@ -41981,6 +42205,15 @@ var DateTime = /*#__PURE__*/function () {
41981
42205
  _proto.toSeconds = function toSeconds() {
41982
42206
  return this.isValid ? this.ts / 1000 : NaN;
41983
42207
  }
42208
+ /**
42209
+ * Returns the epoch seconds (as a whole number) of this DateTime.
42210
+ * @return {number}
42211
+ */
42212
+ ;
42213
+
42214
+ _proto.toUnixInteger = function toUnixInteger() {
42215
+ return this.isValid ? Math.floor(this.ts / 1000) : NaN;
42216
+ }
41984
42217
  /**
41985
42218
  * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.
41986
42219
  * @return {string}
@@ -42925,7 +43158,7 @@ function friendlyDateTime(dateTimeish) {
42925
43158
  }
42926
43159
  }
42927
43160
 
42928
- var VERSION = "2.3.0";
43161
+ var VERSION = "2.3.2";
42929
43162
 
42930
43163
  exports.DateTime = DateTime;
42931
43164
  exports.Duration = Duration;
@@ -53642,15 +53875,15 @@ exports.MessageFormatUtils = MessageFormatUtils;
53642
53875
  "use strict";
53643
53876
  __webpack_require__.r(__webpack_exports__);
53644
53877
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
53878
+ /* harmony export */ "NIL": () => (/* reexport safe */ _nil_js__WEBPACK_IMPORTED_MODULE_4__["default"]),
53879
+ /* harmony export */ "parse": () => (/* reexport safe */ _parse_js__WEBPACK_IMPORTED_MODULE_8__["default"]),
53880
+ /* harmony export */ "stringify": () => (/* reexport safe */ _stringify_js__WEBPACK_IMPORTED_MODULE_7__["default"]),
53645
53881
  /* harmony export */ "v1": () => (/* reexport safe */ _v1_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
53646
53882
  /* harmony export */ "v3": () => (/* reexport safe */ _v3_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
53647
53883
  /* harmony export */ "v4": () => (/* reexport safe */ _v4_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
53648
53884
  /* harmony export */ "v5": () => (/* reexport safe */ _v5_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
53649
- /* harmony export */ "NIL": () => (/* reexport safe */ _nil_js__WEBPACK_IMPORTED_MODULE_4__["default"]),
53650
- /* harmony export */ "version": () => (/* reexport safe */ _version_js__WEBPACK_IMPORTED_MODULE_5__["default"]),
53651
53885
  /* harmony export */ "validate": () => (/* reexport safe */ _validate_js__WEBPACK_IMPORTED_MODULE_6__["default"]),
53652
- /* harmony export */ "stringify": () => (/* reexport safe */ _stringify_js__WEBPACK_IMPORTED_MODULE_7__["default"]),
53653
- /* harmony export */ "parse": () => (/* reexport safe */ _parse_js__WEBPACK_IMPORTED_MODULE_8__["default"])
53886
+ /* harmony export */ "version": () => (/* reexport safe */ _version_js__WEBPACK_IMPORTED_MODULE_5__["default"])
53654
53887
  /* harmony export */ });
53655
53888
  /* harmony import */ var _v1_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./v1.js */ "./node_modules/uuid/dist/esm-browser/v1.js");
53656
53889
  /* harmony import */ var _v3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v3.js */ "./node_modules/uuid/dist/esm-browser/v3.js");
@@ -54532,22 +54765,22 @@ module.exports = TSServal;
54532
54765
  "use strict";
54533
54766
  __webpack_require__.r(__webpack_exports__);
54534
54767
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
54768
+ /* harmony export */ "JsonPatchError": () => (/* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.PatchError),
54535
54769
  /* harmony export */ "_areEquals": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__._areEquals),
54536
54770
  /* harmony export */ "applyOperation": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.applyOperation),
54537
54771
  /* harmony export */ "applyPatch": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.applyPatch),
54538
54772
  /* harmony export */ "applyReducer": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.applyReducer),
54539
- /* harmony export */ "getValueByPointer": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.getValueByPointer),
54540
- /* harmony export */ "validate": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.validate),
54541
- /* harmony export */ "validator": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.validator),
54542
54773
  /* harmony export */ "compare": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.compare),
54543
- /* harmony export */ "generate": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.generate),
54544
- /* harmony export */ "observe": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.observe),
54545
- /* harmony export */ "unobserve": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.unobserve),
54546
- /* harmony export */ "JsonPatchError": () => (/* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.PatchError),
54547
54774
  /* harmony export */ "deepClone": () => (/* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__._deepClone),
54775
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
54548
54776
  /* harmony export */ "escapePathComponent": () => (/* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.escapePathComponent),
54777
+ /* harmony export */ "generate": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.generate),
54778
+ /* harmony export */ "getValueByPointer": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.getValueByPointer),
54779
+ /* harmony export */ "observe": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.observe),
54549
54780
  /* harmony export */ "unescapePathComponent": () => (/* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.unescapePathComponent),
54550
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
54781
+ /* harmony export */ "unobserve": () => (/* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.unobserve),
54782
+ /* harmony export */ "validate": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.validate),
54783
+ /* harmony export */ "validator": () => (/* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.validator)
54551
54784
  /* harmony export */ });
54552
54785
  /* harmony import */ var _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./module/core.mjs */ "./node_modules/fast-json-patch/module/core.mjs");
54553
54786
  /* harmony import */ var _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./module/duplex.mjs */ "./node_modules/fast-json-patch/module/duplex.mjs");
@@ -54584,14 +54817,14 @@ __webpack_require__.r(__webpack_exports__);
54584
54817
  __webpack_require__.r(__webpack_exports__);
54585
54818
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
54586
54819
  /* harmony export */ "JsonPatchError": () => (/* binding */ JsonPatchError),
54587
- /* harmony export */ "deepClone": () => (/* binding */ deepClone),
54588
- /* harmony export */ "getValueByPointer": () => (/* binding */ getValueByPointer),
54820
+ /* harmony export */ "_areEquals": () => (/* binding */ _areEquals),
54589
54821
  /* harmony export */ "applyOperation": () => (/* binding */ applyOperation),
54590
54822
  /* harmony export */ "applyPatch": () => (/* binding */ applyPatch),
54591
54823
  /* harmony export */ "applyReducer": () => (/* binding */ applyReducer),
54592
- /* harmony export */ "validator": () => (/* binding */ validator),
54824
+ /* harmony export */ "deepClone": () => (/* binding */ deepClone),
54825
+ /* harmony export */ "getValueByPointer": () => (/* binding */ getValueByPointer),
54593
54826
  /* harmony export */ "validate": () => (/* binding */ validate),
54594
- /* harmony export */ "_areEquals": () => (/* binding */ _areEquals)
54827
+ /* harmony export */ "validator": () => (/* binding */ validator)
54595
54828
  /* harmony export */ });
54596
54829
  /* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ "./node_modules/fast-json-patch/module/helpers.mjs");
54597
54830
 
@@ -54782,8 +55015,10 @@ function applyOperation(document, operation, validateOperation, mutateDocument,
54782
55015
  if (key && key.indexOf('~') != -1) {
54783
55016
  key = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.unescapePathComponent)(key);
54784
55017
  }
54785
- if (banPrototypeModifications && key == '__proto__') {
54786
- throw new TypeError('JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');
55018
+ if (banPrototypeModifications &&
55019
+ (key == '__proto__' ||
55020
+ (key == 'prototype' && t > 0 && keys[t - 1] == 'constructor'))) {
55021
+ throw new TypeError('JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');
54787
55022
  }
54788
55023
  if (validateOperation) {
54789
55024
  if (existingPathFragment === undefined) {
@@ -55038,16 +55273,16 @@ function _areEquals(a, b) {
55038
55273
  "use strict";
55039
55274
  __webpack_require__.r(__webpack_exports__);
55040
55275
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
55041
- /* harmony export */ "unobserve": () => (/* binding */ unobserve),
55042
- /* harmony export */ "observe": () => (/* binding */ observe),
55276
+ /* harmony export */ "compare": () => (/* binding */ compare),
55043
55277
  /* harmony export */ "generate": () => (/* binding */ generate),
55044
- /* harmony export */ "compare": () => (/* binding */ compare)
55278
+ /* harmony export */ "observe": () => (/* binding */ observe),
55279
+ /* harmony export */ "unobserve": () => (/* binding */ unobserve)
55045
55280
  /* harmony export */ });
55046
55281
  /* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ "./node_modules/fast-json-patch/module/helpers.mjs");
55047
55282
  /* harmony import */ var _core_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./core.mjs */ "./node_modules/fast-json-patch/module/core.mjs");
55048
55283
  /*!
55049
55284
  * https://github.com/Starcounter-Jack/JSON-Patch
55050
- * (c) 2017 Joachim Wester
55285
+ * (c) 2017-2021 Joachim Wester
55051
55286
  * MIT license
55052
55287
  */
55053
55288
 
@@ -55234,21 +55469,21 @@ function compare(tree1, tree2, invertible) {
55234
55469
  "use strict";
55235
55470
  __webpack_require__.r(__webpack_exports__);
55236
55471
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
55237
- /* harmony export */ "hasOwnProperty": () => (/* binding */ hasOwnProperty),
55238
- /* harmony export */ "_objectKeys": () => (/* binding */ _objectKeys),
55472
+ /* harmony export */ "PatchError": () => (/* binding */ PatchError),
55239
55473
  /* harmony export */ "_deepClone": () => (/* binding */ _deepClone),
55240
- /* harmony export */ "isInteger": () => (/* binding */ isInteger),
55241
- /* harmony export */ "escapePathComponent": () => (/* binding */ escapePathComponent),
55242
- /* harmony export */ "unescapePathComponent": () => (/* binding */ unescapePathComponent),
55243
55474
  /* harmony export */ "_getPathRecursive": () => (/* binding */ _getPathRecursive),
55475
+ /* harmony export */ "_objectKeys": () => (/* binding */ _objectKeys),
55476
+ /* harmony export */ "escapePathComponent": () => (/* binding */ escapePathComponent),
55244
55477
  /* harmony export */ "getPath": () => (/* binding */ getPath),
55478
+ /* harmony export */ "hasOwnProperty": () => (/* binding */ hasOwnProperty),
55245
55479
  /* harmony export */ "hasUndefined": () => (/* binding */ hasUndefined),
55246
- /* harmony export */ "PatchError": () => (/* binding */ PatchError)
55480
+ /* harmony export */ "isInteger": () => (/* binding */ isInteger),
55481
+ /* harmony export */ "unescapePathComponent": () => (/* binding */ unescapePathComponent)
55247
55482
  /* harmony export */ });
55248
55483
  /*!
55249
55484
  * https://github.com/Starcounter-Jack/JSON-Patch
55250
- * (c) 2017 Joachim Wester
55251
- * MIT license
55485
+ * (c) 2017-2022 Joachim Wester
55486
+ * MIT licensed
55252
55487
  */
55253
55488
  var __extends = (undefined && undefined.__extends) || (function () {
55254
55489
  var extendStatics = function (d, b) {
@@ -55269,11 +55504,11 @@ function hasOwnProperty(obj, key) {
55269
55504
  }
55270
55505
  function _objectKeys(obj) {
55271
55506
  if (Array.isArray(obj)) {
55272
- var keys = new Array(obj.length);
55273
- for (var k = 0; k < keys.length; k++) {
55274
- keys[k] = "" + k;
55507
+ var keys_1 = new Array(obj.length);
55508
+ for (var k = 0; k < keys_1.length; k++) {
55509
+ keys_1[k] = "" + k;
55275
55510
  }
55276
- return keys;
55511
+ return keys_1;
55277
55512
  }
55278
55513
  if (Object.keys) {
55279
55514
  return Object.keys(obj);
@@ -55361,7 +55596,7 @@ function getPath(root, obj) {
55361
55596
  if (path === '') {
55362
55597
  throw new Error("Object not found in root");
55363
55598
  }
55364
- return '/' + path;
55599
+ return "/" + path;
55365
55600
  }
55366
55601
  /**
55367
55602
  * Recursively checks whether an object has any undefined values inside.
@@ -55372,8 +55607,8 @@ function hasUndefined(obj) {
55372
55607
  }
55373
55608
  if (obj) {
55374
55609
  if (Array.isArray(obj)) {
55375
- for (var i = 0, len = obj.length; i < len; i++) {
55376
- if (hasUndefined(obj[i])) {
55610
+ for (var i_1 = 0, len = obj.length; i_1 < len; i_1++) {
55611
+ if (hasUndefined(obj[i_1])) {
55377
55612
  return true;
55378
55613
  }
55379
55614
  }