@azrico/webobject 1.4.91 → 1.4.93
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() {
|
|
@@ -509,7 +509,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
509
509
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
510
510
|
while (1) switch (_context9.prev = _context9.next) {
|
|
511
511
|
case 0:
|
|
512
|
-
this.isDeleted = true;
|
|
512
|
+
if (this.isSaved) this.isDeleted = true;
|
|
513
513
|
for (_len = _args9.length, p = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
514
514
|
p[_key] = _args9[_key];
|
|
515
515
|
}
|
|
@@ -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: "
|
|
556
|
-
value: function
|
|
557
|
-
return (
|
|
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.
|
|
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.
|
|
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: "
|
|
583
|
-
value: function
|
|
584
|
-
return (
|
|
585
|
-
var _this$
|
|
586
|
-
var
|
|
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
|
-
|
|
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
|
-
|
|
629
|
+
_context13.next = 7;
|
|
603
630
|
break;
|
|
604
631
|
}
|
|
605
632
|
/* -------------------------------------------------------------------------- */
|
|
606
633
|
WebObject.LoadIdsFromSaveResult(this, srObject);
|
|
607
|
-
|
|
608
|
-
return (_this$
|
|
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 (
|
|
611
|
-
p[
|
|
637
|
+
for (_len5 = _args13.length, p = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
638
|
+
p[_key5] = _args13[_key5];
|
|
612
639
|
}
|
|
613
|
-
|
|
614
|
-
return (_this$
|
|
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
|
-
|
|
643
|
+
_context13.next = 12;
|
|
617
644
|
return this.onAfterSave();
|
|
618
645
|
case 12:
|
|
619
|
-
return
|
|
646
|
+
return _context13.abrupt("return", true);
|
|
620
647
|
case 13:
|
|
621
648
|
case "end":
|
|
622
|
-
return
|
|
649
|
+
return _context13.stop();
|
|
623
650
|
}
|
|
624
|
-
},
|
|
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
|
|
631
|
-
var _this$
|
|
632
|
-
var
|
|
657
|
+
return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
658
|
+
var _this$manager7;
|
|
659
|
+
var _len6,
|
|
633
660
|
p,
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
return _regeneratorRuntime().wrap(function
|
|
637
|
-
while (1) switch (
|
|
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 (
|
|
640
|
-
p[
|
|
666
|
+
for (_len6 = _args14.length, p = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
667
|
+
p[_key6] = _args14[_key6];
|
|
641
668
|
}
|
|
642
|
-
|
|
643
|
-
return (_this$
|
|
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
|
|
672
|
+
return _context14.abrupt("return", true);
|
|
646
673
|
case 4:
|
|
647
674
|
case "end":
|
|
648
|
-
return
|
|
675
|
+
return _context14.stop();
|
|
649
676
|
}
|
|
650
|
-
},
|
|
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
|
|
672
|
-
var _this$
|
|
673
|
-
var
|
|
698
|
+
return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
699
|
+
var _this$manager8;
|
|
700
|
+
var _len7,
|
|
674
701
|
p,
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
return _regeneratorRuntime().wrap(function
|
|
678
|
-
while (1) switch (
|
|
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 (
|
|
681
|
-
p[
|
|
707
|
+
for (_len7 = _args15.length, p = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
708
|
+
p[_key7] = _args15[_key7];
|
|
682
709
|
}
|
|
683
|
-
|
|
684
|
-
return (_this$
|
|
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
|
|
713
|
+
return _context15.abrupt("return", _context15.sent);
|
|
687
714
|
case 4:
|
|
688
715
|
case "end":
|
|
689
|
-
return
|
|
716
|
+
return _context15.stop();
|
|
690
717
|
}
|
|
691
|
-
},
|
|
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
|
|
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
|
-
|
|
756
|
-
return _regeneratorRuntime().wrap(function
|
|
757
|
-
while (1) switch (
|
|
782
|
+
_args16 = arguments;
|
|
783
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
784
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
758
785
|
case 0:
|
|
759
|
-
extraOptions =
|
|
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
|
-
|
|
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
|
-
|
|
802
|
+
_context16.next = 19;
|
|
776
803
|
break;
|
|
777
804
|
}
|
|
778
805
|
item = items_to_save[k];
|
|
779
|
-
|
|
806
|
+
_context16.next = 14;
|
|
780
807
|
return item.get_deltaObject();
|
|
781
808
|
case 14:
|
|
782
|
-
dlt =
|
|
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
|
-
|
|
815
|
+
_context16.next = 10;
|
|
789
816
|
break;
|
|
790
817
|
case 19:
|
|
791
|
-
|
|
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 =
|
|
823
|
+
resultObject = _context16.sent;
|
|
797
824
|
if (!Array.isArray(resultObject)) {
|
|
798
|
-
|
|
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
|
-
|
|
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
|
-
|
|
837
|
+
_context16.next = 30;
|
|
811
838
|
return _item.onSave();
|
|
812
839
|
case 30:
|
|
813
840
|
_index++;
|
|
814
|
-
|
|
841
|
+
_context16.next = 24;
|
|
815
842
|
break;
|
|
816
843
|
case 33:
|
|
817
844
|
index++;
|
|
818
|
-
|
|
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
|
-
|
|
851
|
+
_context16.next = 46;
|
|
825
852
|
break;
|
|
826
853
|
}
|
|
827
854
|
_item2 = itemList[_index2];
|
|
828
855
|
if (_item2.isSaved) {
|
|
829
|
-
|
|
856
|
+
_context16.next = 41;
|
|
830
857
|
break;
|
|
831
858
|
}
|
|
832
|
-
return
|
|
859
|
+
return _context16.abrupt("return", false);
|
|
833
860
|
case 41:
|
|
834
861
|
if (!(_item2.getSaveResultType() != "normal")) {
|
|
835
|
-
|
|
862
|
+
_context16.next = 43;
|
|
836
863
|
break;
|
|
837
864
|
}
|
|
838
|
-
return
|
|
865
|
+
return _context16.abrupt("return", false);
|
|
839
866
|
case 43:
|
|
840
867
|
_index2++;
|
|
841
|
-
|
|
868
|
+
_context16.next = 37;
|
|
842
869
|
break;
|
|
843
870
|
case 46:
|
|
844
|
-
return
|
|
871
|
+
return _context16.abrupt("return", true);
|
|
845
872
|
case 47:
|
|
846
873
|
case "end":
|
|
847
|
-
return
|
|
874
|
+
return _context16.stop();
|
|
848
875
|
}
|
|
849
|
-
},
|
|
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
|
|
896
|
-
var
|
|
922
|
+
return (_get_single = _get_single || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
923
|
+
var _len8,
|
|
897
924
|
p,
|
|
898
|
-
|
|
925
|
+
_key8,
|
|
899
926
|
search,
|
|
900
927
|
readonly,
|
|
901
928
|
fetchID,
|
|
902
929
|
res,
|
|
903
930
|
params,
|
|
904
|
-
|
|
905
|
-
return _regeneratorRuntime().wrap(function
|
|
906
|
-
while (1) switch (
|
|
931
|
+
_args17 = arguments;
|
|
932
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
933
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
907
934
|
case 0:
|
|
908
|
-
for (
|
|
909
|
-
p[
|
|
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
|
-
|
|
942
|
+
_context17.next = 6;
|
|
916
943
|
break;
|
|
917
944
|
}
|
|
918
|
-
return
|
|
945
|
+
return _context17.abrupt("return", undefined);
|
|
919
946
|
case 6:
|
|
920
947
|
params = {};
|
|
921
948
|
params.context = readonly ? "view" : "edit";
|
|
922
|
-
|
|
923
|
-
|
|
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
|
-
|
|
928
|
-
|
|
929
|
-
|
|
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
|
-
|
|
935
|
-
res =
|
|
936
|
-
return
|
|
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
|
-
|
|
939
|
-
|
|
965
|
+
_context17.t4 = _object.object_first;
|
|
966
|
+
_context17.next = 22;
|
|
940
967
|
return this.get_list(search, readonly, fetchID);
|
|
941
968
|
case 22:
|
|
942
|
-
|
|
943
|
-
res = (0,
|
|
944
|
-
return
|
|
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
|
|
974
|
+
return _context17.abrupt("return", res);
|
|
948
975
|
case 27:
|
|
949
976
|
case "end":
|
|
950
|
-
return
|
|
977
|
+
return _context17.stop();
|
|
951
978
|
}
|
|
952
|
-
},
|
|
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
|
|
963
|
-
var
|
|
989
|
+
return (_get_list = _get_list || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
990
|
+
var _len9,
|
|
964
991
|
p,
|
|
965
|
-
|
|
992
|
+
_key9,
|
|
966
993
|
search,
|
|
967
994
|
readonly,
|
|
968
995
|
fetchID,
|
|
969
996
|
result_items,
|
|
970
997
|
selftype,
|
|
971
998
|
res,
|
|
972
|
-
|
|
973
|
-
return _regeneratorRuntime().wrap(function
|
|
974
|
-
while (1) switch (
|
|
999
|
+
_args18 = arguments;
|
|
1000
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1001
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
975
1002
|
case 0:
|
|
976
|
-
for (
|
|
977
|
-
p[
|
|
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
|
-
|
|
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 =
|
|
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
|
|
1019
|
+
return _context18.abrupt("return", res);
|
|
993
1020
|
case 12:
|
|
994
1021
|
case "end":
|
|
995
|
-
return
|
|
1022
|
+
return _context18.stop();
|
|
996
1023
|
}
|
|
997
|
-
},
|
|
1024
|
+
}, _callee18, this);
|
|
998
1025
|
}))).apply(this, arguments);
|
|
999
1026
|
}
|
|
1000
1027
|
}]);
|
|
@@ -331,17 +331,14 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
331
331
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
332
332
|
while (1) switch (_context9.prev = _context9.next) {
|
|
333
333
|
case 0:
|
|
334
|
-
|
|
335
|
-
this.obj.isDeleted = true;
|
|
336
|
-
}
|
|
337
|
-
_context9.next = 3;
|
|
334
|
+
_context9.next = 2;
|
|
338
335
|
return this.event_run("on_delete");
|
|
339
|
-
case
|
|
340
|
-
_context9.next =
|
|
336
|
+
case 2:
|
|
337
|
+
_context9.next = 4;
|
|
341
338
|
return this.event_run("on_after_delete");
|
|
342
|
-
case
|
|
339
|
+
case 4:
|
|
343
340
|
return _context9.abrupt("return", true);
|
|
344
|
-
case
|
|
341
|
+
case 5:
|
|
345
342
|
case "end":
|
|
346
343
|
return _context9.stop();
|
|
347
344
|
}
|
|
@@ -355,17 +352,14 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
355
352
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
356
353
|
while (1) switch (_context10.prev = _context10.next) {
|
|
357
354
|
case 0:
|
|
358
|
-
|
|
359
|
-
this.obj.isArchived = true;
|
|
360
|
-
}
|
|
361
|
-
_context10.next = 3;
|
|
355
|
+
_context10.next = 2;
|
|
362
356
|
return this.event_run("on_archive");
|
|
363
|
-
case
|
|
364
|
-
_context10.next =
|
|
357
|
+
case 2:
|
|
358
|
+
_context10.next = 4;
|
|
365
359
|
return this.event_run("on_after_archive");
|
|
366
|
-
case
|
|
360
|
+
case 4:
|
|
367
361
|
return _context10.abrupt("return", true);
|
|
368
|
-
case
|
|
362
|
+
case 5:
|
|
369
363
|
case "end":
|
|
370
364
|
return _context10.stop();
|
|
371
365
|
}
|
|
@@ -379,17 +373,14 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
379
373
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
380
374
|
while (1) switch (_context11.prev = _context11.next) {
|
|
381
375
|
case 0:
|
|
382
|
-
|
|
383
|
-
this.obj.isArchived = false;
|
|
384
|
-
}
|
|
385
|
-
_context11.next = 3;
|
|
376
|
+
_context11.next = 2;
|
|
386
377
|
return this.event_run("on_unarchive");
|
|
387
|
-
case
|
|
388
|
-
_context11.next =
|
|
378
|
+
case 2:
|
|
379
|
+
_context11.next = 4;
|
|
389
380
|
return this.event_run("on_after_unarchive");
|
|
390
|
-
case
|
|
381
|
+
case 4:
|
|
391
382
|
return _context11.abrupt("return", true);
|
|
392
|
-
case
|
|
383
|
+
case 5:
|
|
393
384
|
case "end":
|
|
394
385
|
return _context11.stop();
|
|
395
386
|
}
|