@apollo-annotation/jbrowse-plugin-apollo 0.3.10 → 0.3.11

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.
@@ -1634,14 +1634,15 @@
1634
1634
  _createClass(AssemblySpecificChange, [{
1635
1635
  key: "getIndexedIds",
1636
1636
  value: function getIndexedIds(feature, idsToIndex) {
1637
- var _a;
1638
1637
  var indexedIds = [];
1639
1638
  var _iterator = _createForOfIteratorHelper(idsToIndex !== null && idsToIndex !== void 0 ? idsToIndex : []),
1640
1639
  _step;
1641
1640
  try {
1642
1641
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
1643
1642
  var additionalId = _step.value;
1644
- var idValue = (_a = feature.attributes) === null || _a === void 0 ? void 0 : _a[additionalId];
1643
+ var attributes = feature.attributes;
1644
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
1645
+ var idValue = attributes instanceof Map ? attributes.get(additionalId) : attributes === null || attributes === void 0 ? void 0 : attributes[additionalId];
1645
1646
  if (idValue) {
1646
1647
  indexedIds.push(idValue[0]);
1647
1648
  }
@@ -1652,10 +1653,19 @@
1652
1653
  _iterator.f();
1653
1654
  }
1654
1655
  if (feature.children) {
1655
- for (var _i = 0, _Object$values = Object.values(feature.children); _i < _Object$values.length; _i++) {
1656
- var child = _Object$values[_i];
1657
- var childIndexedIds = this.getIndexedIds(child, idsToIndex);
1658
- indexedIds.push.apply(indexedIds, _toConsumableArray(childIndexedIds));
1656
+ var childrenIterable = feature.children instanceof Map ? feature.children.values() : Object.values(feature.children);
1657
+ var _iterator2 = _createForOfIteratorHelper(childrenIterable),
1658
+ _step2;
1659
+ try {
1660
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1661
+ var child = _step2.value;
1662
+ var childIndexedIds = this.getIndexedIds(child, idsToIndex);
1663
+ indexedIds.push.apply(indexedIds, _toConsumableArray(childIndexedIds));
1664
+ }
1665
+ } catch (err) {
1666
+ _iterator2.e(err);
1667
+ } finally {
1668
+ _iterator2.f();
1659
1669
  }
1660
1670
  }
1661
1671
  return indexedIds;
@@ -4754,14 +4764,15 @@
4754
4764
  _createClass(AssemblySpecificChange, [{
4755
4765
  key: "getIndexedIds",
4756
4766
  value: function getIndexedIds(feature, idsToIndex) {
4757
- var _a;
4758
4767
  var indexedIds = [];
4759
4768
  var _iterator = _createForOfIteratorHelper(idsToIndex !== null && idsToIndex !== void 0 ? idsToIndex : []),
4760
4769
  _step;
4761
4770
  try {
4762
4771
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
4763
4772
  var additionalId = _step.value;
4764
- var idValue = (_a = feature.attributes) === null || _a === void 0 ? void 0 : _a[additionalId];
4773
+ var attributes = feature.attributes;
4774
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
4775
+ var idValue = attributes instanceof Map ? attributes.get(additionalId) : attributes === null || attributes === void 0 ? void 0 : attributes[additionalId];
4765
4776
  if (idValue) {
4766
4777
  indexedIds.push(idValue[0]);
4767
4778
  }
@@ -4772,10 +4783,19 @@
4772
4783
  _iterator.f();
4773
4784
  }
4774
4785
  if (feature.children) {
4775
- for (var _i = 0, _Object$values = Object.values(feature.children); _i < _Object$values.length; _i++) {
4776
- var child = _Object$values[_i];
4777
- var childIndexedIds = this.getIndexedIds(child, idsToIndex);
4778
- indexedIds.push.apply(indexedIds, _toConsumableArray(childIndexedIds));
4786
+ var childrenIterable = feature.children instanceof Map ? feature.children.values() : Object.values(feature.children);
4787
+ var _iterator2 = _createForOfIteratorHelper(childrenIterable),
4788
+ _step2;
4789
+ try {
4790
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
4791
+ var child = _step2.value;
4792
+ var childIndexedIds = this.getIndexedIds(child, idsToIndex);
4793
+ indexedIds.push.apply(indexedIds, _toConsumableArray(childIndexedIds));
4794
+ }
4795
+ } catch (err) {
4796
+ _iterator2.e(err);
4797
+ } finally {
4798
+ _iterator2.f();
4779
4799
  }
4780
4800
  }
4781
4801
  return indexedIds;
@@ -17025,17 +17045,22 @@
17025
17045
  value: function () {
17026
17046
  var _executeOnServer = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(backend) {
17027
17047
  var _this2 = this;
17028
- var featureModel, session, changes, logger, _iterator, _step, _loop;
17048
+ var featureModel, session, changes, logger, INDEXED_IDS, idsToIndex, _iterator, _step, _loop;
17029
17049
  return _regeneratorRuntime().wrap(function _callee$(_context2) {
17030
17050
  while (1) switch (_context2.prev = _context2.next) {
17031
17051
  case 0:
17032
17052
  featureModel = backend.featureModel, session = backend.session;
17033
- changes = this.changes, logger = this.logger; // Loop the changes
17053
+ changes = this.changes, logger = this.logger;
17054
+ INDEXED_IDS = browser$1.env.INDEXED_IDS;
17055
+ if (INDEXED_IDS) {
17056
+ idsToIndex = INDEXED_IDS.split(',');
17057
+ }
17058
+ // Loop the changes
17034
17059
  _iterator = _createForOfIteratorHelper(changes);
17035
- _context2.prev = 3;
17060
+ _context2.prev = 5;
17036
17061
  _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
17037
17062
  var _logger$debug3;
17038
- var change, deletedFeature, parentFeatureId, featureDoc, errMsg, _logger$debug, deletedIds, _logger$debug2;
17063
+ var change, deletedFeature, parentFeatureId, featureDoc, errMsg, _logger$debug, deletedIds, indexedIds, _logger$debug2;
17039
17064
  return _regeneratorRuntime().wrap(function _loop$(_context) {
17040
17065
  while (1) switch (_context.prev = _context.next) {
17041
17066
  case 0:
@@ -17076,59 +17101,71 @@
17076
17101
  featureDoc.allIds = featureDoc.allIds.filter(function (id) {
17077
17102
  return !deletedIds.includes(id);
17078
17103
  });
17104
+ indexedIds = _this2.getIndexedIds(featureDoc, idsToIndex);
17105
+ if (featureDoc.indexedIds) {
17106
+ if (indexedIds.length > 0) {
17107
+ featureDoc.indexedIds = indexedIds;
17108
+ } else {
17109
+ delete featureDoc.indexedIds;
17110
+ }
17111
+ } else {
17112
+ if (indexedIds.length > 0) {
17113
+ featureDoc.indexedIds = indexedIds;
17114
+ }
17115
+ }
17079
17116
  // Save updated document in Mongo
17080
17117
  featureDoc.markModified('children'); // Mark as modified. Without this save() -method is not updating data in database
17081
- _context.prev = 20;
17082
- _context.next = 23;
17118
+ _context.prev = 22;
17119
+ _context.next = 25;
17083
17120
  return featureDoc.save();
17084
- case 23:
17085
- _context.next = 29;
17086
- break;
17087
17121
  case 25:
17088
- _context.prev = 25;
17089
- _context.t0 = _context["catch"](20);
17122
+ _context.next = 31;
17123
+ break;
17124
+ case 27:
17125
+ _context.prev = 27;
17126
+ _context.t0 = _context["catch"](22);
17090
17127
  (_logger$debug2 = logger.debug) === null || _logger$debug2 === void 0 || _logger$debug2.call(logger, "*** FAILED: ".concat(_context.t0));
17091
17128
  throw _context.t0;
17092
- case 29:
17129
+ case 31:
17093
17130
  (_logger$debug3 = logger.debug) === null || _logger$debug3 === void 0 || _logger$debug3.call(logger, "Feature \"".concat(deletedFeature._id, "\" deleted from document \"").concat(featureDoc._id, "\""));
17094
- case 30:
17131
+ case 32:
17095
17132
  case "end":
17096
17133
  return _context.stop();
17097
17134
  }
17098
- }, _loop, null, [[20, 25]]);
17135
+ }, _loop, null, [[22, 27]]);
17099
17136
  });
17100
17137
  _iterator.s();
17101
- case 6:
17138
+ case 8:
17102
17139
  if ((_step = _iterator.n()).done) {
17103
- _context2.next = 12;
17140
+ _context2.next = 14;
17104
17141
  break;
17105
17142
  }
17106
- return _context2.delegateYield(_loop(), "t0", 8);
17107
- case 8:
17143
+ return _context2.delegateYield(_loop(), "t0", 10);
17144
+ case 10:
17108
17145
  if (!_context2.t0) {
17109
- _context2.next = 10;
17146
+ _context2.next = 12;
17110
17147
  break;
17111
17148
  }
17112
- return _context2.abrupt("continue", 10);
17113
- case 10:
17114
- _context2.next = 6;
17115
- break;
17149
+ return _context2.abrupt("continue", 12);
17116
17150
  case 12:
17117
- _context2.next = 17;
17151
+ _context2.next = 8;
17118
17152
  break;
17119
17153
  case 14:
17120
- _context2.prev = 14;
17121
- _context2.t1 = _context2["catch"](3);
17154
+ _context2.next = 19;
17155
+ break;
17156
+ case 16:
17157
+ _context2.prev = 16;
17158
+ _context2.t1 = _context2["catch"](5);
17122
17159
  _iterator.e(_context2.t1);
17123
- case 17:
17124
- _context2.prev = 17;
17160
+ case 19:
17161
+ _context2.prev = 19;
17125
17162
  _iterator.f();
17126
- return _context2.finish(17);
17127
- case 20:
17163
+ return _context2.finish(19);
17164
+ case 22:
17128
17165
  case "end":
17129
17166
  return _context2.stop();
17130
17167
  }
17131
- }, _callee, this, [[3, 14, 17, 20]]);
17168
+ }, _callee, this, [[5, 16, 19, 22]]);
17132
17169
  }));
17133
17170
  function executeOnServer(_x) {
17134
17171
  return _executeOnServer.apply(this, arguments);
@@ -17361,7 +17398,7 @@
17361
17398
  value: function () {
17362
17399
  var _executeOnServer = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(backend) {
17363
17400
  var _logger$debug, _logger$debug2;
17364
- var assemblyModel, featureModel, refSeqModel, session, user, assembly, changes, logger, assemblyDoc, errMsg, featureCnt, INDEXED_IDS, idsToIndex, _iterator, _step, _logger$debug3, change, addedFeature, allIds, copyFeature, parentFeatureId, _id, refSeq, refSeqDoc, _logger$debug4, indexedIds, _yield$featureModel$c, _yield$featureModel$c2, newFeatureDoc, _topLevelFeature$allI, topLevelFeature, parentFeature, childIds, _logger$verbose, _childIds, allIdsV2, _indexedIds, _yield$featureModel$c3, _yield$featureModel$c4, _newFeatureDoc;
17401
+ var assemblyModel, featureModel, refSeqModel, session, user, assembly, changes, logger, assemblyDoc, errMsg, featureCnt, INDEXED_IDS, idsToIndex, _iterator, _step, _logger$debug3, change, addedFeature, allIds, copyFeature, parentFeatureId, _id, refSeq, refSeqDoc, _logger$debug4, indexedIds, _yield$featureModel$c, _yield$featureModel$c2, newFeatureDoc, _indexedIds, _topLevelFeature$allI, _topLevelFeature$inde, _topLevelFeature$inde2, topLevelFeature, parentFeature, childIds, _logger$verbose, _childIds, allIdsV2, _yield$featureModel$c3, _yield$featureModel$c4, _newFeatureDoc;
17365
17402
  return _regeneratorRuntime().wrap(function _callee$(_context) {
17366
17403
  while (1) switch (_context.prev = _context.next) {
17367
17404
  case 0:
@@ -17391,7 +17428,7 @@
17391
17428
  _iterator.s();
17392
17429
  case 16:
17393
17430
  if ((_step = _iterator.n()).done) {
17394
- _context.next = 65;
17431
+ _context.next = 67;
17395
17432
  break;
17396
17433
  }
17397
17434
  change = _step.value;
@@ -17428,45 +17465,49 @@
17428
17465
  newFeatureDoc = _yield$featureModel$c2[0];
17429
17466
  (_logger$debug4 = logger.debug) === null || _logger$debug4 === void 0 || _logger$debug4.call(logger, "Copied feature, docId \"".concat(newFeatureDoc._id, "\" to assembly \"").concat(assembly, "\""));
17430
17467
  featureCnt++;
17431
- _context.next = 62;
17468
+ _context.next = 64;
17432
17469
  break;
17433
17470
  case 37:
17471
+ _indexedIds = this.getIndexedIds(addedFeature, idsToIndex); // Adding new child feature
17434
17472
  if (!parentFeatureId) {
17435
- _context.next = 53;
17473
+ _context.next = 56;
17436
17474
  break;
17437
17475
  }
17438
- _context.next = 40;
17476
+ _context.next = 41;
17439
17477
  return featureModel.findOne({
17440
17478
  allIds: parentFeatureId
17441
17479
  }).session(session).exec();
17442
- case 40:
17480
+ case 41:
17443
17481
  topLevelFeature = _context.sent;
17444
17482
  if (topLevelFeature) {
17445
- _context.next = 43;
17483
+ _context.next = 44;
17446
17484
  break;
17447
17485
  }
17448
17486
  throw new Error("Could not find feature with ID \"".concat(parentFeatureId, "\""));
17449
- case 43:
17487
+ case 44:
17450
17488
  parentFeature = this.getFeatureFromId(topLevelFeature, parentFeatureId);
17451
17489
  if (parentFeature) {
17452
- _context.next = 46;
17490
+ _context.next = 47;
17453
17491
  break;
17454
17492
  }
17455
17493
  throw new Error("Could not find feature with ID \"".concat(parentFeatureId, "\" in feature \"").concat(topLevelFeature._id, "\""));
17456
- case 46:
17494
+ case 47:
17457
17495
  this.addChild(parentFeature, addedFeature);
17458
17496
  childIds = this.getChildFeatureIds(addedFeature);
17459
17497
  (_topLevelFeature$allI = topLevelFeature.allIds).push.apply(_topLevelFeature$allI, [_id].concat(_toConsumableArray(childIds)));
17460
- _context.next = 51;
17498
+ if (_indexedIds.length > 0 && !topLevelFeature.indexedIds) {
17499
+ topLevelFeature.indexedIds = [];
17500
+ }
17501
+ (_topLevelFeature$inde = topLevelFeature.indexedIds) === null || _topLevelFeature$inde === void 0 || (_topLevelFeature$inde2 = _topLevelFeature$inde).push.apply(_topLevelFeature$inde2, _toConsumableArray(_indexedIds));
17502
+ _context.next = 54;
17461
17503
  return topLevelFeature.save();
17462
- case 51:
17463
- _context.next = 62;
17504
+ case 54:
17505
+ _context.next = 64;
17464
17506
  break;
17465
- case 53:
17507
+ case 56:
17466
17508
  _childIds = this.getChildFeatureIds(addedFeature);
17467
17509
  allIdsV2 = [_id].concat(_toConsumableArray(_childIds));
17468
- _indexedIds = this.getIndexedIds(addedFeature, idsToIndex);
17469
- _context.next = 58;
17510
+ _context.next = 60;
17470
17511
  return featureModel.create([_objectSpread2({
17471
17512
  allIds: allIdsV2,
17472
17513
  indexedIds: _indexedIds,
@@ -17474,34 +17515,34 @@
17474
17515
  }, addedFeature)], {
17475
17516
  session: session
17476
17517
  });
17477
- case 58:
17518
+ case 60:
17478
17519
  _yield$featureModel$c3 = _context.sent;
17479
17520
  _yield$featureModel$c4 = _slicedToArray(_yield$featureModel$c3, 1);
17480
17521
  _newFeatureDoc = _yield$featureModel$c4[0];
17481
17522
  (_logger$verbose = logger.verbose) === null || _logger$verbose === void 0 || _logger$verbose.call(logger, "Added docId \"".concat(_newFeatureDoc._id, "\""));
17482
- case 62:
17523
+ case 64:
17483
17524
  featureCnt++;
17484
- case 63:
17485
- _context.next = 16;
17486
- break;
17487
17525
  case 65:
17488
- _context.next = 70;
17526
+ _context.next = 16;
17489
17527
  break;
17490
17528
  case 67:
17491
- _context.prev = 67;
17529
+ _context.next = 72;
17530
+ break;
17531
+ case 69:
17532
+ _context.prev = 69;
17492
17533
  _context.t0 = _context["catch"](14);
17493
17534
  _iterator.e(_context.t0);
17494
- case 70:
17495
- _context.prev = 70;
17535
+ case 72:
17536
+ _context.prev = 72;
17496
17537
  _iterator.f();
17497
- return _context.finish(70);
17498
- case 73:
17538
+ return _context.finish(72);
17539
+ case 75:
17499
17540
  (_logger$debug2 = logger.debug) === null || _logger$debug2 === void 0 || _logger$debug2.call(logger, "Added ".concat(featureCnt, " new feature(s) into database."));
17500
- case 74:
17541
+ case 76:
17501
17542
  case "end":
17502
17543
  return _context.stop();
17503
17544
  }
17504
- }, _callee, this, [[14, 67, 70, 73]]);
17545
+ }, _callee, this, [[14, 69, 72, 75]]);
17505
17546
  }));
17506
17547
  function executeOnServer(_x) {
17507
17548
  return _executeOnServer.apply(this, arguments);
@@ -18405,31 +18446,32 @@
18405
18446
  key: "executeOnServer",
18406
18447
  value: function () {
18407
18448
  var _executeOnServer = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(backend) {
18408
- var featureModel, session, changes, logger, featuresForChanges, _iterator, _step, _logger$debug, _logger$debug2, change, featureId, topLevelFeature, errMsg, foundFeature, _errMsg, _iterator2, _step2, _logger$debug4, _step2$value, idx, _change, newAttributes, _featuresForChanges$i, feature, _topLevelFeature, _logger$debug3;
18409
- return _regeneratorRuntime().wrap(function _callee$(_context) {
18410
- while (1) switch (_context.prev = _context.next) {
18449
+ var _this2 = this;
18450
+ var featureModel, session, changes, logger, featuresForChanges, _iterator, _step, _logger$debug, _logger$debug2, change, featureId, topLevelFeature, errMsg, foundFeature, _errMsg, INDEXED_IDS, idsToIndex, _iterator2, _step2, _loop;
18451
+ return _regeneratorRuntime().wrap(function _callee$(_context2) {
18452
+ while (1) switch (_context2.prev = _context2.next) {
18411
18453
  case 0:
18412
18454
  featureModel = backend.featureModel, session = backend.session;
18413
18455
  changes = this.changes, logger = this.logger;
18414
18456
  featuresForChanges = []; // Loop the changes and check that all features are found
18415
18457
  _iterator = _createForOfIteratorHelper(changes);
18416
- _context.prev = 4;
18458
+ _context2.prev = 4;
18417
18459
  _iterator.s();
18418
18460
  case 6:
18419
18461
  if ((_step = _iterator.n()).done) {
18420
- _context.next = 26;
18462
+ _context2.next = 26;
18421
18463
  break;
18422
18464
  }
18423
18465
  change = _step.value;
18424
18466
  featureId = change.featureId; // Search correct feature
18425
- _context.next = 11;
18467
+ _context2.next = 11;
18426
18468
  return featureModel.findOne({
18427
18469
  allIds: featureId
18428
18470
  }).session(session).exec();
18429
18471
  case 11:
18430
- topLevelFeature = _context.sent;
18472
+ topLevelFeature = _context2.sent;
18431
18473
  if (topLevelFeature) {
18432
- _context.next = 16;
18474
+ _context2.next = 16;
18433
18475
  break;
18434
18476
  }
18435
18477
  errMsg = "*** ERROR: The following featureId was not found in database ='".concat(featureId, "'");
@@ -18439,7 +18481,7 @@
18439
18481
  (_logger$debug = logger.debug) === null || _logger$debug === void 0 || _logger$debug.call(logger, "*** Feature found: ".concat(JSON.stringify(topLevelFeature)));
18440
18482
  foundFeature = this.getFeatureFromId(topLevelFeature, featureId);
18441
18483
  if (foundFeature) {
18442
- _context.next = 22;
18484
+ _context2.next = 22;
18443
18485
  break;
18444
18486
  }
18445
18487
  _errMsg = 'ERROR when searching feature by featureId';
@@ -18452,70 +18494,96 @@
18452
18494
  topLevelFeature: topLevelFeature
18453
18495
  });
18454
18496
  case 24:
18455
- _context.next = 6;
18497
+ _context2.next = 6;
18456
18498
  break;
18457
18499
  case 26:
18458
- _context.next = 31;
18500
+ _context2.next = 31;
18459
18501
  break;
18460
18502
  case 28:
18461
- _context.prev = 28;
18462
- _context.t0 = _context["catch"](4);
18463
- _iterator.e(_context.t0);
18503
+ _context2.prev = 28;
18504
+ _context2.t0 = _context2["catch"](4);
18505
+ _iterator.e(_context2.t0);
18464
18506
  case 31:
18465
- _context.prev = 31;
18507
+ _context2.prev = 31;
18466
18508
  _iterator.f();
18467
- return _context.finish(31);
18509
+ return _context2.finish(31);
18468
18510
  case 34:
18511
+ INDEXED_IDS = browser$1.env.INDEXED_IDS;
18512
+ if (INDEXED_IDS) {
18513
+ idsToIndex = INDEXED_IDS.split(',');
18514
+ }
18469
18515
  // Let's update objects
18470
18516
  _iterator2 = _createForOfIteratorHelper(changes.entries());
18471
- _context.prev = 35;
18517
+ _context2.prev = 37;
18518
+ _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
18519
+ var _idsToIndex, _logger$debug4;
18520
+ var _step2$value, idx, change, newAttributes, _featuresForChanges$i, feature, topLevelFeature, indexedIdsChanged, indexedIds, _logger$debug3;
18521
+ return _regeneratorRuntime().wrap(function _loop$(_context) {
18522
+ while (1) switch (_context.prev = _context.next) {
18523
+ case 0:
18524
+ _step2$value = _slicedToArray(_step2.value, 2), idx = _step2$value[0], change = _step2$value[1];
18525
+ newAttributes = change.newAttributes;
18526
+ _featuresForChanges$i = featuresForChanges[idx], feature = _featuresForChanges$i.feature, topLevelFeature = _featuresForChanges$i.topLevelFeature;
18527
+ indexedIdsChanged = (_idsToIndex = idsToIndex) === null || _idsToIndex === void 0 ? void 0 : _idsToIndex.some(function (id) {
18528
+ var _feature$attributes;
18529
+ return id in newAttributes || id in ((_feature$attributes = feature === null || feature === void 0 ? void 0 : feature.attributes) !== null && _feature$attributes !== void 0 ? _feature$attributes : {});
18530
+ });
18531
+ feature.attributes = newAttributes;
18532
+ if (indexedIdsChanged) {
18533
+ indexedIds = _this2.getIndexedIds(topLevelFeature, idsToIndex);
18534
+ topLevelFeature.indexedIds = indexedIds;
18535
+ topLevelFeature.markModified('indexedIds');
18536
+ }
18537
+ if (topLevelFeature._id.equals(feature._id)) {
18538
+ topLevelFeature.markModified('attributes'); // Mark as modified. Without this save() -method is not updating data in database
18539
+ } else {
18540
+ topLevelFeature.markModified('children'); // Mark as modified. Without this save() -method is not updating data in database
18541
+ }
18542
+ _context.prev = 7;
18543
+ _context.next = 10;
18544
+ return topLevelFeature.save();
18545
+ case 10:
18546
+ _context.next = 16;
18547
+ break;
18548
+ case 12:
18549
+ _context.prev = 12;
18550
+ _context.t0 = _context["catch"](7);
18551
+ (_logger$debug3 = logger.debug) === null || _logger$debug3 === void 0 || _logger$debug3.call(logger, "*** FAILED: ".concat(_context.t0));
18552
+ throw _context.t0;
18553
+ case 16:
18554
+ (_logger$debug4 = logger.debug) === null || _logger$debug4 === void 0 || _logger$debug4.call(logger, "*** Feature attributes modified (added, edited or deleted), docId: ".concat(JSON.stringify(topLevelFeature)));
18555
+ case 17:
18556
+ case "end":
18557
+ return _context.stop();
18558
+ }
18559
+ }, _loop, null, [[7, 12]]);
18560
+ });
18472
18561
  _iterator2.s();
18473
- case 37:
18562
+ case 40:
18474
18563
  if ((_step2 = _iterator2.n()).done) {
18475
- _context.next = 55;
18564
+ _context2.next = 44;
18476
18565
  break;
18477
18566
  }
18478
- _step2$value = _slicedToArray(_step2.value, 2), idx = _step2$value[0], _change = _step2$value[1];
18479
- newAttributes = _change.newAttributes;
18480
- _featuresForChanges$i = featuresForChanges[idx], feature = _featuresForChanges$i.feature, _topLevelFeature = _featuresForChanges$i.topLevelFeature;
18481
- feature.attributes = newAttributes;
18482
- if (_topLevelFeature._id.equals(feature._id)) {
18483
- _topLevelFeature.markModified('attributes'); // Mark as modified. Without this save() -method is not updating data in database
18484
- } else {
18485
- _topLevelFeature.markModified('children'); // Mark as modified. Without this save() -method is not updating data in database
18486
- }
18487
- _context.prev = 43;
18488
- _context.next = 46;
18489
- return _topLevelFeature.save();
18490
- case 46:
18491
- _context.next = 52;
18492
- break;
18493
- case 48:
18494
- _context.prev = 48;
18495
- _context.t1 = _context["catch"](43);
18496
- (_logger$debug3 = logger.debug) === null || _logger$debug3 === void 0 || _logger$debug3.call(logger, "*** FAILED: ".concat(_context.t1));
18497
- throw _context.t1;
18498
- case 52:
18499
- (_logger$debug4 = logger.debug) === null || _logger$debug4 === void 0 || _logger$debug4.call(logger, "*** Feature attributes modified (added, edited or deleted), docId: ".concat(JSON.stringify(_topLevelFeature)));
18500
- case 53:
18501
- _context.next = 37;
18567
+ return _context2.delegateYield(_loop(), "t1", 42);
18568
+ case 42:
18569
+ _context2.next = 40;
18502
18570
  break;
18503
- case 55:
18504
- _context.next = 60;
18571
+ case 44:
18572
+ _context2.next = 49;
18505
18573
  break;
18506
- case 57:
18507
- _context.prev = 57;
18508
- _context.t2 = _context["catch"](35);
18509
- _iterator2.e(_context.t2);
18510
- case 60:
18511
- _context.prev = 60;
18574
+ case 46:
18575
+ _context2.prev = 46;
18576
+ _context2.t2 = _context2["catch"](37);
18577
+ _iterator2.e(_context2.t2);
18578
+ case 49:
18579
+ _context2.prev = 49;
18512
18580
  _iterator2.f();
18513
- return _context.finish(60);
18514
- case 63:
18581
+ return _context2.finish(49);
18582
+ case 52:
18515
18583
  case "end":
18516
- return _context.stop();
18584
+ return _context2.stop();
18517
18585
  }
18518
- }, _callee, this, [[4, 28, 31, 34], [35, 57, 60, 63], [43, 48]]);
18586
+ }, _callee, this, [[4, 28, 31, 34], [37, 46, 49, 52]]);
18519
18587
  }));
18520
18588
  function executeOnServer(_x) {
18521
18589
  return _executeOnServer.apply(this, arguments);
@@ -18526,13 +18594,13 @@
18526
18594
  key: "executeOnLocalGFF3",
18527
18595
  value: function () {
18528
18596
  var _executeOnLocalGFF = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_backend) {
18529
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
18530
- while (1) switch (_context2.prev = _context2.next) {
18597
+ return _regeneratorRuntime().wrap(function _callee2$(_context3) {
18598
+ while (1) switch (_context3.prev = _context3.next) {
18531
18599
  case 0:
18532
18600
  throw new Error('applyToLocalGFF3 not implemented');
18533
18601
  case 1:
18534
18602
  case "end":
18535
- return _context2.stop();
18603
+ return _context3.stop();
18536
18604
  }
18537
18605
  }, _callee2);
18538
18606
  }));
@@ -18546,49 +18614,49 @@
18546
18614
  value: function () {
18547
18615
  var _executeOnClient = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(dataStore) {
18548
18616
  var _iterator3, _step3, _step3$value, idx, changedId, feature;
18549
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
18550
- while (1) switch (_context3.prev = _context3.next) {
18617
+ return _regeneratorRuntime().wrap(function _callee3$(_context4) {
18618
+ while (1) switch (_context4.prev = _context4.next) {
18551
18619
  case 0:
18552
18620
  if (dataStore) {
18553
- _context3.next = 2;
18621
+ _context4.next = 2;
18554
18622
  break;
18555
18623
  }
18556
18624
  throw new Error('No data store');
18557
18625
  case 2:
18558
18626
  _iterator3 = _createForOfIteratorHelper(this.changedIds.entries());
18559
- _context3.prev = 3;
18627
+ _context4.prev = 3;
18560
18628
  _iterator3.s();
18561
18629
  case 5:
18562
18630
  if ((_step3 = _iterator3.n()).done) {
18563
- _context3.next = 13;
18631
+ _context4.next = 13;
18564
18632
  break;
18565
18633
  }
18566
18634
  _step3$value = _slicedToArray(_step3.value, 2), idx = _step3$value[0], changedId = _step3$value[1];
18567
18635
  feature = dataStore.getFeature(changedId);
18568
18636
  if (feature) {
18569
- _context3.next = 10;
18637
+ _context4.next = 10;
18570
18638
  break;
18571
18639
  }
18572
18640
  throw new Error("Could not find feature with identifier \"".concat(changedId, "\""));
18573
18641
  case 10:
18574
18642
  feature.setAttributes(new Map(Object.entries(this.changes[idx].newAttributes)));
18575
18643
  case 11:
18576
- _context3.next = 5;
18644
+ _context4.next = 5;
18577
18645
  break;
18578
18646
  case 13:
18579
- _context3.next = 18;
18647
+ _context4.next = 18;
18580
18648
  break;
18581
18649
  case 15:
18582
- _context3.prev = 15;
18583
- _context3.t0 = _context3["catch"](3);
18584
- _iterator3.e(_context3.t0);
18650
+ _context4.prev = 15;
18651
+ _context4.t0 = _context4["catch"](3);
18652
+ _iterator3.e(_context4.t0);
18585
18653
  case 18:
18586
- _context3.prev = 18;
18654
+ _context4.prev = 18;
18587
18655
  _iterator3.f();
18588
- return _context3.finish(18);
18656
+ return _context4.finish(18);
18589
18657
  case 21:
18590
18658
  case "end":
18591
- return _context3.stop();
18659
+ return _context4.stop();
18592
18660
  }
18593
18661
  }, _callee3, this, [[3, 15, 18, 21]]);
18594
18662
  }));
@@ -23885,7 +23953,7 @@
23885
23953
  d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"
23886
23954
  }), 'Add');
23887
23955
 
23888
- var version = "0.3.10";
23956
+ var version = "0.3.11";
23889
23957
 
23890
23958
  const ApolloConfigSchema = configuration.ConfigurationSchema('ApolloInternetAccount', {
23891
23959
  baseURL: {