@azrico/webobject 1.4.91 → 1.4.92

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.
@@ -81,6 +81,7 @@ export declare class WebObject extends SimpleObject {
81
81
  static get_webname(): string;
82
82
  onDelete(...p: any): Promise<any>;
83
83
  onArchive(...p: any): Promise<any>;
84
+ onUnArchive(...p: any): Promise<any>;
84
85
  onLoad(...p: any): Promise<any>;
85
86
  onSave(...p: any): Promise<any>;
86
87
  onAfterSave(...p: any): Promise<any>;
@@ -34,7 +34,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
34
34
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
35
35
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
36
36
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
37
- var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Delete, _Archive, _UnArchive, _get_deltaObject, _onDelete, _onArchive, _onLoad, _onSave, _onAfterSave, _onNew, _saveList, _get_single, _get_list) {
37
+ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Delete, _Archive, _UnArchive, _get_deltaObject, _onDelete, _onArchive, _onUnArchive, _onLoad, _onSave, _onAfterSave, _onNew, _saveList, _get_single, _get_list) {
38
38
  _inherits(WebObject, _SimpleObject);
39
39
  var _super = _createSuper(WebObject);
40
40
  function WebObject() {
@@ -536,7 +536,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
536
536
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
537
537
  while (1) switch (_context10.prev = _context10.next) {
538
538
  case 0:
539
- this.isArchived = true;
539
+ if (this.isSaved) this.isArchived = true;
540
540
  for (_len2 = _args10.length, p = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
541
541
  p[_key2] = _args10[_key2];
542
542
  }
@@ -552,9 +552,9 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
552
552
  }))).apply(this, arguments);
553
553
  }
554
554
  }, {
555
- key: "onLoad",
556
- value: function onLoad() {
557
- return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
555
+ key: "onUnArchive",
556
+ value: function onUnArchive() {
557
+ return (_onUnArchive = _onUnArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
558
558
  var _this$manager3;
559
559
  var _len3,
560
560
  p,
@@ -563,12 +563,12 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
563
563
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
564
564
  while (1) switch (_context11.prev = _context11.next) {
565
565
  case 0:
566
- this.isDeleted = false;
566
+ if (this.isSaved) this.isArchived = false;
567
567
  for (_len3 = _args11.length, p = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
568
568
  p[_key3] = _args11[_key3];
569
569
  }
570
570
  _context11.next = 4;
571
- return (_this$manager3 = this.manager) === null || _this$manager3 === void 0 ? void 0 : _this$manager3.onLoad.apply(_this$manager3, p);
571
+ return (_this$manager3 = this.manager) === null || _this$manager3 === void 0 ? void 0 : _this$manager3.onUnArchive.apply(_this$manager3, p);
572
572
  case 4:
573
573
  return _context11.abrupt("return", _context11.sent);
574
574
  case 5:
@@ -579,75 +579,102 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
579
579
  }))).apply(this, arguments);
580
580
  }
581
581
  }, {
582
- key: "onSave",
583
- value: function onSave() {
584
- return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
585
- var _this$manager5;
586
- var srObject,
587
- _this$manager4,
588
- _len4,
582
+ key: "onLoad",
583
+ value: function onLoad() {
584
+ return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
585
+ var _this$manager4;
586
+ var _len4,
589
587
  p,
590
588
  _key4,
591
589
  _args12 = arguments;
592
590
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
593
591
  while (1) switch (_context12.prev = _context12.next) {
592
+ case 0:
593
+ this.isDeleted = false;
594
+ for (_len4 = _args12.length, p = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
595
+ p[_key4] = _args12[_key4];
596
+ }
597
+ _context12.next = 4;
598
+ return (_this$manager4 = this.manager) === null || _this$manager4 === void 0 ? void 0 : _this$manager4.onLoad.apply(_this$manager4, p);
599
+ case 4:
600
+ return _context12.abrupt("return", _context12.sent);
601
+ case 5:
602
+ case "end":
603
+ return _context12.stop();
604
+ }
605
+ }, _callee12, this);
606
+ }))).apply(this, arguments);
607
+ }
608
+ }, {
609
+ key: "onSave",
610
+ value: function onSave() {
611
+ return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
612
+ var _this$manager6;
613
+ var srObject,
614
+ _this$manager5,
615
+ _len5,
616
+ p,
617
+ _key5,
618
+ _args13 = arguments;
619
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
620
+ while (1) switch (_context13.prev = _context13.next) {
594
621
  case 0:
595
622
  if (!this.isSaved) {
596
- _context12.next = 7;
623
+ _context13.next = 7;
597
624
  break;
598
625
  }
599
626
  this.apply_changes();
600
627
  srObject = this.getSaveResult(true);
601
628
  if (!this.saveResultHasID(srObject)) {
602
- _context12.next = 7;
629
+ _context13.next = 7;
603
630
  break;
604
631
  }
605
632
  /* -------------------------------------------------------------------------- */
606
633
  WebObject.LoadIdsFromSaveResult(this, srObject);
607
- _context12.next = 7;
608
- return (_this$manager4 = this.manager) === null || _this$manager4 === void 0 ? void 0 : _this$manager4.event_run("on_id_change");
634
+ _context13.next = 7;
635
+ return (_this$manager5 = this.manager) === null || _this$manager5 === void 0 ? void 0 : _this$manager5.event_run("on_id_change");
609
636
  case 7:
610
- for (_len4 = _args12.length, p = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
611
- p[_key4] = _args12[_key4];
637
+ for (_len5 = _args13.length, p = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
638
+ p[_key5] = _args13[_key5];
612
639
  }
613
- _context12.next = 10;
614
- return (_this$manager5 = this.manager) === null || _this$manager5 === void 0 ? void 0 : _this$manager5.onSave.apply(_this$manager5, p);
640
+ _context13.next = 10;
641
+ return (_this$manager6 = this.manager) === null || _this$manager6 === void 0 ? void 0 : _this$manager6.onSave.apply(_this$manager6, p);
615
642
  case 10:
616
- _context12.next = 12;
643
+ _context13.next = 12;
617
644
  return this.onAfterSave();
618
645
  case 12:
619
- return _context12.abrupt("return", true);
646
+ return _context13.abrupt("return", true);
620
647
  case 13:
621
648
  case "end":
622
- return _context12.stop();
649
+ return _context13.stop();
623
650
  }
624
- }, _callee12, this);
651
+ }, _callee13, this);
625
652
  }))).apply(this, arguments);
626
653
  }
627
654
  }, {
628
655
  key: "onAfterSave",
629
656
  value: function onAfterSave() {
630
- return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
631
- var _this$manager6;
632
- var _len5,
657
+ return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
658
+ var _this$manager7;
659
+ var _len6,
633
660
  p,
634
- _key5,
635
- _args13 = arguments;
636
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
637
- while (1) switch (_context13.prev = _context13.next) {
661
+ _key6,
662
+ _args14 = arguments;
663
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
664
+ while (1) switch (_context14.prev = _context14.next) {
638
665
  case 0:
639
- for (_len5 = _args13.length, p = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
640
- p[_key5] = _args13[_key5];
666
+ for (_len6 = _args14.length, p = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
667
+ p[_key6] = _args14[_key6];
641
668
  }
642
- _context13.next = 3;
643
- return (_this$manager6 = this.manager) === null || _this$manager6 === void 0 ? void 0 : _this$manager6.onAfterSave.apply(_this$manager6, p);
669
+ _context14.next = 3;
670
+ return (_this$manager7 = this.manager) === null || _this$manager7 === void 0 ? void 0 : _this$manager7.onAfterSave.apply(_this$manager7, p);
644
671
  case 3:
645
- return _context13.abrupt("return", true);
672
+ return _context14.abrupt("return", true);
646
673
  case 4:
647
674
  case "end":
648
- return _context13.stop();
675
+ return _context14.stop();
649
676
  }
650
- }, _callee13, this);
677
+ }, _callee14, this);
651
678
  }))).apply(this, arguments);
652
679
  }
653
680
  }, {
@@ -668,27 +695,27 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
668
695
  }, {
669
696
  key: "onNew",
670
697
  value: function onNew() {
671
- return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
672
- var _this$manager7;
673
- var _len6,
698
+ return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
699
+ var _this$manager8;
700
+ var _len7,
674
701
  p,
675
- _key6,
676
- _args14 = arguments;
677
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
678
- while (1) switch (_context14.prev = _context14.next) {
702
+ _key7,
703
+ _args15 = arguments;
704
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
705
+ while (1) switch (_context15.prev = _context15.next) {
679
706
  case 0:
680
- for (_len6 = _args14.length, p = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
681
- p[_key6] = _args14[_key6];
707
+ for (_len7 = _args15.length, p = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
708
+ p[_key7] = _args15[_key7];
682
709
  }
683
- _context14.next = 3;
684
- return (_this$manager7 = this.manager) === null || _this$manager7 === void 0 ? void 0 : _this$manager7.onNew.apply(_this$manager7, p);
710
+ _context15.next = 3;
711
+ return (_this$manager8 = this.manager) === null || _this$manager8 === void 0 ? void 0 : _this$manager8.onNew.apply(_this$manager8, p);
685
712
  case 3:
686
- return _context14.abrupt("return", _context14.sent);
713
+ return _context15.abrupt("return", _context15.sent);
687
714
  case 4:
688
715
  case "end":
689
- return _context14.stop();
716
+ return _context15.stop();
690
717
  }
691
- }, _callee14, this);
718
+ }, _callee15, this);
692
719
  }))).apply(this, arguments);
693
720
  } /* -------------------------------------------------------------------------- */
694
721
  }, {
@@ -735,7 +762,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
735
762
  }, {
736
763
  key: "saveList",
737
764
  value: function saveList(_x6) {
738
- return (_saveList = _saveList || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(itemList) {
765
+ return (_saveList = _saveList || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(itemList) {
739
766
  var _extraOptions$chunksi;
740
767
  var extraOptions,
741
768
  chunks,
@@ -752,11 +779,11 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
752
779
  _item,
753
780
  _index2,
754
781
  _item2,
755
- _args15 = arguments;
756
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
757
- while (1) switch (_context15.prev = _context15.next) {
782
+ _args16 = arguments;
783
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
784
+ while (1) switch (_context16.prev = _context16.next) {
758
785
  case 0:
759
- extraOptions = _args15.length > 1 && _args15[1] !== undefined ? _args15[1] : {};
786
+ extraOptions = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : {};
760
787
  if (!extraOptions) extraOptions = {};
761
788
  chunks = (0, _object.array_chunks)(itemList, (_extraOptions$chunksi = extraOptions.chunksize) !== null && _extraOptions$chunksi !== void 0 ? _extraOptions$chunksi : 50);
762
789
  delete extraOptions.chunksize;
@@ -764,7 +791,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
764
791
  index = 0;
765
792
  case 6:
766
793
  if (!(index < chunks.length)) {
767
- _context15.next = 36;
794
+ _context16.next = 36;
768
795
  break;
769
796
  }
770
797
  items_to_save = chunks[index];
@@ -772,81 +799,81 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
772
799
  k = 0;
773
800
  case 10:
774
801
  if (!(k < items_to_save.length)) {
775
- _context15.next = 19;
802
+ _context16.next = 19;
776
803
  break;
777
804
  }
778
805
  item = items_to_save[k];
779
- _context15.next = 14;
806
+ _context16.next = 14;
780
807
  return item.get_deltaObject();
781
808
  case 14:
782
- dlt = _context15.sent;
809
+ dlt = _context16.sent;
783
810
  save_array.push(item.isNew ? _objectSpread({}, dlt) : _objectSpread({
784
811
  _id: item.getID()
785
812
  }, dlt));
786
813
  case 16:
787
814
  k++;
788
- _context15.next = 10;
815
+ _context16.next = 10;
789
816
  break;
790
817
  case 19:
791
- _context15.next = 21;
818
+ _context16.next = 21;
792
819
  return _global.gfunc.run_action("post", putAddress, _objectSpread({
793
820
  __save_list: WebObject.zipSaveList(save_array)
794
821
  }, extraOptions));
795
822
  case 21:
796
- resultObject = _context15.sent;
823
+ resultObject = _context16.sent;
797
824
  if (!Array.isArray(resultObject)) {
798
- _context15.next = 33;
825
+ _context16.next = 33;
799
826
  break;
800
827
  }
801
828
  _index = 0;
802
829
  case 24:
803
830
  if (!(_index < Math.min(resultObject.length, items_to_save.length))) {
804
- _context15.next = 33;
831
+ _context16.next = 33;
805
832
  break;
806
833
  }
807
834
  res = resultObject[_index];
808
835
  _item = items_to_save[_index];
809
836
  _item.setSaveResult(res);
810
- _context15.next = 30;
837
+ _context16.next = 30;
811
838
  return _item.onSave();
812
839
  case 30:
813
840
  _index++;
814
- _context15.next = 24;
841
+ _context16.next = 24;
815
842
  break;
816
843
  case 33:
817
844
  index++;
818
- _context15.next = 6;
845
+ _context16.next = 6;
819
846
  break;
820
847
  case 36:
821
848
  _index2 = 0;
822
849
  case 37:
823
850
  if (!(_index2 < itemList.length)) {
824
- _context15.next = 46;
851
+ _context16.next = 46;
825
852
  break;
826
853
  }
827
854
  _item2 = itemList[_index2];
828
855
  if (_item2.isSaved) {
829
- _context15.next = 41;
856
+ _context16.next = 41;
830
857
  break;
831
858
  }
832
- return _context15.abrupt("return", false);
859
+ return _context16.abrupt("return", false);
833
860
  case 41:
834
861
  if (!(_item2.getSaveResultType() != "normal")) {
835
- _context15.next = 43;
862
+ _context16.next = 43;
836
863
  break;
837
864
  }
838
- return _context15.abrupt("return", false);
865
+ return _context16.abrupt("return", false);
839
866
  case 43:
840
867
  _index2++;
841
- _context15.next = 37;
868
+ _context16.next = 37;
842
869
  break;
843
870
  case 46:
844
- return _context15.abrupt("return", true);
871
+ return _context16.abrupt("return", true);
845
872
  case 47:
846
873
  case "end":
847
- return _context15.stop();
874
+ return _context16.stop();
848
875
  }
849
- }, _callee15, this);
876
+ }, _callee16, this);
850
877
  }))).apply(this, arguments);
851
878
  }
852
879
  }, {
@@ -892,64 +919,64 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
892
919
  }, {
893
920
  key: "get_single",
894
921
  value: function get_single() {
895
- return (_get_single = _get_single || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
896
- var _len7,
922
+ return (_get_single = _get_single || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
923
+ var _len8,
897
924
  p,
898
- _key7,
925
+ _key8,
899
926
  search,
900
927
  readonly,
901
928
  fetchID,
902
929
  res,
903
930
  params,
904
- _args16 = arguments;
905
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
906
- while (1) switch (_context16.prev = _context16.next) {
931
+ _args17 = arguments;
932
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
933
+ while (1) switch (_context17.prev = _context17.next) {
907
934
  case 0:
908
- for (_len7 = _args16.length, p = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
909
- p[_key7] = _args16[_key7];
935
+ for (_len8 = _args17.length, p = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
936
+ p[_key8] = _args17[_key8];
910
937
  }
911
938
  search = p.shift();
912
939
  readonly = p.shift();
913
940
  fetchID = p.shift();
914
941
  if (!(0, _object.object_isEmpty)(search)) {
915
- _context16.next = 6;
942
+ _context17.next = 6;
916
943
  break;
917
944
  }
918
- return _context16.abrupt("return", undefined);
945
+ return _context17.abrupt("return", undefined);
919
946
  case 6:
920
947
  params = {};
921
948
  params.context = readonly ? "view" : "edit";
922
- _context16.t0 = _typeof(search);
923
- _context16.next = _context16.t0 === "string" ? 11 : _context16.t0 === "number" ? 11 : _context16.t0 === "object" ? 19 : 19;
949
+ _context17.t0 = _typeof(search);
950
+ _context17.next = _context17.t0 === "string" ? 11 : _context17.t0 === "number" ? 11 : _context17.t0 === "object" ? 19 : 19;
924
951
  break;
925
952
  case 11:
926
953
  search = String(search);
927
- _context16.t1 = this;
928
- _context16.t2 = this;
929
- _context16.next = 16;
954
+ _context17.t1 = this;
955
+ _context17.t2 = this;
956
+ _context17.next = 16;
930
957
  return _global.gfunc.run_action("get", this.__web_path + "/" + search, params, {
931
958
  fetchID: fetchID
932
959
  });
933
960
  case 16:
934
- _context16.t3 = _context16.sent;
935
- res = _context16.t1.ensure.call(_context16.t1, _context16.t2, _context16.t3);
936
- return _context16.abrupt("break", 25);
961
+ _context17.t3 = _context17.sent;
962
+ res = _context17.t1.ensure.call(_context17.t1, _context17.t2, _context17.t3);
963
+ return _context17.abrupt("break", 25);
937
964
  case 19:
938
- _context16.t4 = _object.object_first;
939
- _context16.next = 22;
965
+ _context17.t4 = _object.object_first;
966
+ _context17.next = 22;
940
967
  return this.get_list(search, readonly, fetchID);
941
968
  case 22:
942
- _context16.t5 = _context16.sent;
943
- res = (0, _context16.t4)(_context16.t5);
944
- return _context16.abrupt("break", 25);
969
+ _context17.t5 = _context17.sent;
970
+ res = (0, _context17.t4)(_context17.t5);
971
+ return _context17.abrupt("break", 25);
945
972
  case 25:
946
973
  WebObject.setReadonly(res, readonly);
947
- return _context16.abrupt("return", res);
974
+ return _context17.abrupt("return", res);
948
975
  case 27:
949
976
  case "end":
950
- return _context16.stop();
977
+ return _context17.stop();
951
978
  }
952
- }, _callee16, this);
979
+ }, _callee17, this);
953
980
  }))).apply(this, arguments);
954
981
  }
955
982
  /**
@@ -959,42 +986,42 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
959
986
  }, {
960
987
  key: "get_list",
961
988
  value: function get_list() {
962
- return (_get_list = _get_list || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
963
- var _len8,
989
+ return (_get_list = _get_list || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
990
+ var _len9,
964
991
  p,
965
- _key8,
992
+ _key9,
966
993
  search,
967
994
  readonly,
968
995
  fetchID,
969
996
  result_items,
970
997
  selftype,
971
998
  res,
972
- _args17 = arguments;
973
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
974
- while (1) switch (_context17.prev = _context17.next) {
999
+ _args18 = arguments;
1000
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1001
+ while (1) switch (_context18.prev = _context18.next) {
975
1002
  case 0:
976
- for (_len8 = _args17.length, p = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
977
- p[_key8] = _args17[_key8];
1003
+ for (_len9 = _args18.length, p = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
1004
+ p[_key9] = _args18[_key9];
978
1005
  }
979
1006
  search = p.shift();
980
1007
  readonly = p.shift();
981
1008
  fetchID = p.shift();
982
1009
  if (!search) search = {};
983
- _context17.next = 7;
1010
+ _context18.next = 7;
984
1011
  return _global.gfunc.run_action("get", this.__web_path, search, {
985
1012
  fetchID: fetchID
986
1013
  });
987
1014
  case 7:
988
- result_items = _context17.sent;
1015
+ result_items = _context18.sent;
989
1016
  selftype = this.prototype;
990
1017
  res = WebObject.map_rowindex(WebObject.mapto(selftype, result_items, readonly));
991
1018
  WebObject.setReadonly(res, readonly);
992
- return _context17.abrupt("return", res);
1019
+ return _context18.abrupt("return", res);
993
1020
  case 12:
994
1021
  case "end":
995
- return _context17.stop();
1022
+ return _context18.stop();
996
1023
  }
997
- }, _callee17, this);
1024
+ }, _callee18, this);
998
1025
  }))).apply(this, arguments);
999
1026
  }
1000
1027
  }]);
@@ -355,7 +355,7 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
355
355
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
356
356
  while (1) switch (_context10.prev = _context10.next) {
357
357
  case 0:
358
- if (this.obj) {
358
+ if (this.obj && this.isSaved) {
359
359
  this.obj.isArchived = true;
360
360
  }
361
361
  _context10.next = 3;
@@ -379,7 +379,7 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
379
379
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
380
380
  while (1) switch (_context11.prev = _context11.next) {
381
381
  case 0:
382
- if (this.obj) {
382
+ if (this.obj && this.isSaved) {
383
383
  this.obj.isArchived = false;
384
384
  }
385
385
  _context11.next = 3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.4.91",
3
+ "version": "1.4.92",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",