@azrico/webobject 1.5.40 → 1.5.42

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.
@@ -589,8 +589,8 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
589
589
  while (1) switch (_context13.prev = _context13.next) {
590
590
  case 0:
591
591
  _parseObj = function _parseObj3() {
592
- _parseObj = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(obj) {
593
- var newobj_dlt;
592
+ _parseObj = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(key, obj) {
593
+ var _p, child_changableKeys, newobj_dlt;
594
594
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
595
595
  while (1) switch (_context12.prev = _context12.next) {
596
596
  case 0:
@@ -606,12 +606,12 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
606
606
  }
607
607
  _context12.next = 5;
608
608
  return Promise.all(obj.map( /*#__PURE__*/function () {
609
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(r) {
609
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(r, i) {
610
610
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
611
611
  while (1) switch (_context11.prev = _context11.next) {
612
612
  case 0:
613
613
  _context11.next = 2;
614
- return parseObj(r);
614
+ return parseObj(i, r);
615
615
  case 2:
616
616
  return _context11.abrupt("return", _context11.sent);
617
617
  case 3:
@@ -620,7 +620,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
620
620
  }
621
621
  }, _callee11);
622
622
  }));
623
- return function (_x7) {
623
+ return function (_x8, _x9) {
624
624
  return _ref.apply(this, arguments);
625
625
  };
626
626
  }()));
@@ -628,25 +628,30 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
628
628
  return _context12.abrupt("return", _context12.sent);
629
629
  case 6:
630
630
  if (!(obj instanceof WebObject && typeof obj.get_deltaObject === "function")) {
631
- _context12.next = 15;
631
+ _context12.next = 16;
632
632
  break;
633
633
  }
634
- _context12.next = 9;
634
+ //child elements have different kind of delta
635
+ child_changableKeys = (_p = p) === null || _p === void 0 || (_p = _p.changableKeys) === null || _p === void 0 ? void 0 : _p.filter(function (s) {
636
+ return s.startsWith("".concat(key, "."));
637
+ });
638
+ _context12.next = 10;
635
639
  return obj.get_deltaObject(_objectSpread(_objectSpread({}, p), {}, {
636
- isChild: true
640
+ isChild: true,
641
+ changableKeys: child_changableKeys
637
642
  }));
638
- case 9:
643
+ case 10:
639
644
  newobj_dlt = _context12.sent;
640
645
  if ((0, _object.object_isEmpty)(newobj_dlt)) {
641
- _context12.next = 14;
646
+ _context12.next = 15;
642
647
  break;
643
648
  }
644
649
  return _context12.abrupt("return", newobj_dlt);
645
- case 14:
646
- return _context12.abrupt("return", obj);
647
650
  case 15:
648
651
  return _context12.abrupt("return", obj);
649
652
  case 16:
653
+ return _context12.abrupt("return", obj);
654
+ case 17:
650
655
  case "end":
651
656
  return _context12.stop();
652
657
  }
@@ -654,7 +659,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
654
659
  }));
655
660
  return _parseObj.apply(this, arguments);
656
661
  };
657
- parseObj = function _parseObj2(_x6) {
662
+ parseObj = function _parseObj2(_x6, _x7) {
658
663
  return _parseObj.apply(this, arguments);
659
664
  };
660
665
  if (!p) p = {};
@@ -695,6 +700,9 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
695
700
  * intersection of keys in delta and keys that are defined as changeable
696
701
  */
697
702
  changableKeys = (0, _object.array_intersection)(Object.keys(changedFields), WebObject.getChangeableKeys(this, p));
703
+ if (p.changableKeys) {
704
+ changableKeys = (0, _object.array_intersection)(changableKeys, p.changableKeys);
705
+ }
698
706
  _convert["default"].format({
699
707
  original: this,
700
708
  inputobject: changedFields,
@@ -715,33 +723,33 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
715
723
  /* parse all changableKeys */
716
724
  /* -------------------------------------------------------------------------- */
717
725
  _iterator = _createForOfIteratorHelper(changableKeys);
718
- _context13.prev = 19;
726
+ _context13.prev = 20;
719
727
  _iterator.s();
720
- case 21:
728
+ case 22:
721
729
  if ((_step = _iterator.n()).done) {
722
- _context13.next = 28;
730
+ _context13.next = 29;
723
731
  break;
724
732
  }
725
733
  _key = _step.value;
726
- _context13.next = 25;
727
- return parseObj(changedFields[_key]);
728
- case 25:
729
- final_object[_key] = _context13.sent;
734
+ _context13.next = 26;
735
+ return parseObj(_key, changedFields[_key]);
730
736
  case 26:
731
- _context13.next = 21;
737
+ final_object[_key] = _context13.sent;
738
+ case 27:
739
+ _context13.next = 22;
732
740
  break;
733
- case 28:
734
- _context13.next = 33;
741
+ case 29:
742
+ _context13.next = 34;
735
743
  break;
736
- case 30:
737
- _context13.prev = 30;
738
- _context13.t2 = _context13["catch"](19);
744
+ case 31:
745
+ _context13.prev = 31;
746
+ _context13.t2 = _context13["catch"](20);
739
747
  _iterator.e(_context13.t2);
740
- case 33:
741
- _context13.prev = 33;
748
+ case 34:
749
+ _context13.prev = 34;
742
750
  _iterator.f();
743
- return _context13.finish(33);
744
- case 36:
751
+ return _context13.finish(34);
752
+ case 37:
745
753
  /* -------------------- add acrhived and date properties -------------------- */
746
754
  if (p.allProperties) {
747
755
  final_object["_created_date"] = this["_created_date"];
@@ -767,17 +775,17 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
767
775
  final_object["_users"] = (0, _object.wrap_array)(tempusers);
768
776
  }
769
777
  if (!p.clean) {
770
- _context13.next = 41;
778
+ _context13.next = 42;
771
779
  break;
772
780
  }
773
781
  return _context13.abrupt("return", (0, _object.object_clean)(final_object, false, true));
774
- case 41:
775
- return _context13.abrupt("return", final_object);
776
782
  case 42:
783
+ return _context13.abrupt("return", final_object);
784
+ case 43:
777
785
  case "end":
778
786
  return _context13.stop();
779
787
  }
780
- }, _callee13, this, [[19, 30, 33, 36]]);
788
+ }, _callee13, this, [[20, 31, 34, 37]]);
781
789
  }));
782
790
  function get_deltaObject(_x5) {
783
791
  return _get_deltaObject.apply(this, arguments);
@@ -1272,7 +1280,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
1272
1280
  }
1273
1281
  }, _callee23, this);
1274
1282
  }));
1275
- function saveList(_x8) {
1283
+ function saveList(_x10) {
1276
1284
  return _saveList.apply(this, arguments);
1277
1285
  }
1278
1286
  return saveList;
@@ -1500,7 +1508,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
1500
1508
  }
1501
1509
  }, _callee27, this);
1502
1510
  }));
1503
- function get_list_cache(_x9) {
1511
+ function get_list_cache(_x11) {
1504
1512
  return _get_list_cache.apply(this, arguments);
1505
1513
  }
1506
1514
  return get_list_cache;
@@ -1531,7 +1539,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
1531
1539
  }
1532
1540
  }, _callee28, this);
1533
1541
  }));
1534
- function get_single_cache(_x10) {
1542
+ function get_single_cache(_x12) {
1535
1543
  return _get_single_cache.apply(this, arguments);
1536
1544
  }
1537
1545
  return get_single_cache;
@@ -1571,7 +1579,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
1571
1579
  }
1572
1580
  }, _callee29);
1573
1581
  }));
1574
- return function (_x11) {
1582
+ return function (_x13) {
1575
1583
  return _ref3.apply(this, arguments);
1576
1584
  };
1577
1585
  }()));
@@ -11,6 +11,7 @@ export type deltaParams = {
11
11
  type?: string;
12
12
  useDelta?: boolean;
13
13
  isChild?: boolean;
14
+ changableKeys?: string[];
14
15
  allProperties?: boolean;
15
16
  extraProperties?: boolean;
16
17
  tempProperties?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.5.40",
3
+ "version": "1.5.42",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",