wao 0.10.5 → 0.10.7
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.
- package/cjs/ao.js +379 -264
- package/cjs/aoconnect-base.js +121 -115
- package/cjs/server.js +1 -1
- package/cjs/utils.js +1 -3
- package/esm/ao.js +65 -30
- package/esm/aoconnect-base.js +29 -22
- package/esm/server.js +1 -1
- package/esm/utils.js +1 -4
- package/package.json +2 -1
package/cjs/ao.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var WarpArBundles = _interopRequireWildcard(require("warp-arbundles"));
|
|
8
8
|
var _ar4 = _interopRequireDefault(require("./ar.js"));
|
|
9
|
+
var _md = _interopRequireDefault(require("md5"));
|
|
9
10
|
var _aoconnect = require("@permaweb/aoconnect");
|
|
10
11
|
var _ramda = require("ramda");
|
|
11
12
|
var _utils = require("./utils.js");
|
|
@@ -613,11 +614,11 @@ var AO = /*#__PURE__*/function () {
|
|
|
613
614
|
value: function () {
|
|
614
615
|
var _msg = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(_ref12) {
|
|
615
616
|
var _this3 = this;
|
|
616
|
-
var pid, jwk, data, _ref12$act, act, _ref12$tags, tags, _ref12$check, check, get, _ref12$timeout, timeout, err, _yield$this$ar$checkW2, getNewTxs, checkOut, res, out,
|
|
617
|
+
var pid, jwk, data, _ref12$act, act, _ref12$tags, tags, _ref12$check, check, get, _ref12$timeout, timeout, _ref12$mode, mode, _ref12$limit, limit, err, _yield$this$ar$checkW2, anchors, hash, mid, getNewTxs, checkOut, res, out, results, _tags, start, _txs, _txmap, checked, _iterator5, _step5, v, _res;
|
|
617
618
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
618
619
|
while (1) switch (_context11.prev = _context11.next) {
|
|
619
620
|
case 0:
|
|
620
|
-
pid = _ref12.pid, jwk = _ref12.jwk, data = _ref12.data, _ref12$act = _ref12.act, act = _ref12$act === void 0 ? "Eval" : _ref12$act, _ref12$tags = _ref12.tags, tags = _ref12$tags === void 0 ? {} : _ref12$tags, _ref12$check = _ref12.check, check = _ref12$check === void 0 ? [] : _ref12$check, get = _ref12.get, _ref12$timeout = _ref12.timeout, timeout = _ref12$timeout === void 0 ? 0 : _ref12$timeout;
|
|
621
|
+
pid = _ref12.pid, jwk = _ref12.jwk, data = _ref12.data, _ref12$act = _ref12.act, act = _ref12$act === void 0 ? "Eval" : _ref12$act, _ref12$tags = _ref12.tags, tags = _ref12$tags === void 0 ? {} : _ref12$tags, _ref12$check = _ref12.check, check = _ref12$check === void 0 ? [] : _ref12$check, get = _ref12.get, _ref12$timeout = _ref12.timeout, timeout = _ref12$timeout === void 0 ? 0 : _ref12$timeout, _ref12$mode = _ref12.mode, mode = _ref12$mode === void 0 ? "aoconnect" : _ref12$mode, _ref12$limit = _ref12.limit, limit = _ref12$limit === void 0 ? 25 : _ref12$limit;
|
|
621
622
|
err = null;
|
|
622
623
|
_context11.next = 4;
|
|
623
624
|
return this.ar.checkWallet({
|
|
@@ -635,34 +636,45 @@ var AO = /*#__PURE__*/function () {
|
|
|
635
636
|
err: err
|
|
636
637
|
});
|
|
637
638
|
case 9:
|
|
639
|
+
anchors = {};
|
|
640
|
+
hash = null;
|
|
641
|
+
mid = null;
|
|
638
642
|
getNewTxs = /*#__PURE__*/function () {
|
|
639
643
|
var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(pid, _txs, _txmap) {
|
|
640
|
-
var txs, _iterator2, _step2, v, t, _t$fromProcess, _v$owner;
|
|
644
|
+
var exists, txs, _iterator2, _step2, v, t, _t$fromProcess, _v$owner, _iterator3, _step3, _v, hash2;
|
|
641
645
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
642
646
|
while (1) switch (_context9.prev = _context9.next) {
|
|
643
647
|
case 0:
|
|
644
|
-
|
|
648
|
+
exists = false;
|
|
649
|
+
if (!(mode === "gql")) {
|
|
650
|
+
_context9.next = 9;
|
|
651
|
+
break;
|
|
652
|
+
}
|
|
653
|
+
_context9.next = 4;
|
|
645
654
|
return _this3.ar.gql.txs({
|
|
646
655
|
recipient: pid,
|
|
656
|
+
limit: limit,
|
|
647
657
|
fields: ["id", "recipient", "tags", {
|
|
648
658
|
owner: ["address"]
|
|
649
659
|
}]
|
|
650
660
|
});
|
|
651
|
-
case
|
|
661
|
+
case 4:
|
|
652
662
|
txs = _context9.sent;
|
|
653
|
-
_iterator2 = _createForOfIteratorHelper(txs);
|
|
663
|
+
_iterator2 = _createForOfIteratorHelper((0, _ramda.reverse)(txs));
|
|
654
664
|
try {
|
|
655
665
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
656
666
|
v = _step2.value;
|
|
657
|
-
if (
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
667
|
+
if (v.id === mid) exists = true;else if (exists) {
|
|
668
|
+
if ((0, _ramda.isNil)(_txmap[v.id])) {
|
|
669
|
+
t = (0, _utils.ltags)(v.tags);
|
|
670
|
+
if (t.type === "Message") {
|
|
671
|
+
v.from = (_t$fromProcess = t["from-process"]) !== null && _t$fromProcess !== void 0 ? _t$fromProcess : (_v$owner = v.owner) === null || _v$owner === void 0 ? void 0 : _v$owner.address;
|
|
672
|
+
_txs.unshift(v);
|
|
673
|
+
_txmap[v.id] = {
|
|
674
|
+
checked: false,
|
|
675
|
+
ref: t["x-reference"]
|
|
676
|
+
};
|
|
677
|
+
}
|
|
666
678
|
}
|
|
667
679
|
}
|
|
668
680
|
}
|
|
@@ -671,7 +683,44 @@ var AO = /*#__PURE__*/function () {
|
|
|
671
683
|
} finally {
|
|
672
684
|
_iterator2.f();
|
|
673
685
|
}
|
|
674
|
-
|
|
686
|
+
_context9.next = 17;
|
|
687
|
+
break;
|
|
688
|
+
case 9:
|
|
689
|
+
_context9.t0 = _createForOfIteratorHelper;
|
|
690
|
+
_context9.t1 = _ramda.reverse;
|
|
691
|
+
_context9.next = 13;
|
|
692
|
+
return _this3.res({
|
|
693
|
+
pid: pid,
|
|
694
|
+
limit: limit
|
|
695
|
+
});
|
|
696
|
+
case 13:
|
|
697
|
+
_context9.t2 = _context9.sent;
|
|
698
|
+
_context9.t3 = (0, _context9.t1)(_context9.t2);
|
|
699
|
+
_iterator3 = (0, _context9.t0)(_context9.t3);
|
|
700
|
+
try {
|
|
701
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
702
|
+
_v = _step3.value;
|
|
703
|
+
hash2 = (0, _md["default"])(JSON.stringify((0, _ramda.dissoc)("cursor", _v)));
|
|
704
|
+
if (!exists) {
|
|
705
|
+
if (hash2 === hash) exists = true;
|
|
706
|
+
} else {
|
|
707
|
+
if ((0, _ramda.isNil)(_txmap[_v.cursor + pid])) {
|
|
708
|
+
_txmap[_v.cursor + pid] = {
|
|
709
|
+
checked: false,
|
|
710
|
+
res: _v
|
|
711
|
+
};
|
|
712
|
+
_txs.unshift({
|
|
713
|
+
id: _v.cursor + pid
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
} catch (err) {
|
|
719
|
+
_iterator3.e(err);
|
|
720
|
+
} finally {
|
|
721
|
+
_iterator3.f();
|
|
722
|
+
}
|
|
723
|
+
case 17:
|
|
675
724
|
case "end":
|
|
676
725
|
return _context9.stop();
|
|
677
726
|
}
|
|
@@ -683,225 +732,237 @@ var AO = /*#__PURE__*/function () {
|
|
|
683
732
|
}();
|
|
684
733
|
checkOut = /*#__PURE__*/function () {
|
|
685
734
|
var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(get, _txs, _txmap, out) {
|
|
686
|
-
var
|
|
735
|
+
var _iterator4, _step4, v, _res2, _out;
|
|
687
736
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
688
737
|
while (1) switch (_context10.prev = _context10.next) {
|
|
689
738
|
case 0:
|
|
690
|
-
|
|
739
|
+
_iterator4 = _createForOfIteratorHelper(_txs);
|
|
691
740
|
_context10.prev = 1;
|
|
692
|
-
|
|
741
|
+
_iterator4.s();
|
|
693
742
|
case 3:
|
|
694
|
-
if ((
|
|
695
|
-
_context10.next =
|
|
743
|
+
if ((_step4 = _iterator4.n()).done) {
|
|
744
|
+
_context10.next = 19;
|
|
696
745
|
break;
|
|
697
746
|
}
|
|
698
|
-
v =
|
|
747
|
+
v = _step4.value;
|
|
699
748
|
if (!(0, _ramda.isNil)(_txmap[v.id].res)) {
|
|
700
|
-
_context10.next =
|
|
749
|
+
_context10.next = 11;
|
|
701
750
|
break;
|
|
702
751
|
}
|
|
703
752
|
_context10.next = 8;
|
|
704
|
-
return _this3.
|
|
705
|
-
|
|
706
|
-
|
|
753
|
+
return _this3.res({
|
|
754
|
+
pid: pid,
|
|
755
|
+
mid: v.id
|
|
707
756
|
});
|
|
708
757
|
case 8:
|
|
709
758
|
_res2 = _context10.sent;
|
|
759
|
+
if (!hash) console.log(_res2);
|
|
710
760
|
_txmap[v.id].res = _res2;
|
|
711
|
-
case
|
|
761
|
+
case 11:
|
|
712
762
|
if (!(!(0, _ramda.isNil)(_txmap[v.id].res) && _txmap[v.id].out !== true)) {
|
|
713
|
-
_context10.next =
|
|
763
|
+
_context10.next = 17;
|
|
714
764
|
break;
|
|
715
765
|
}
|
|
716
766
|
_txmap[v.id].out = true;
|
|
717
767
|
_out = (0, _utils.getTagVal)(get, _txmap[v.id].res, v.from);
|
|
718
768
|
out = (0, _utils.mergeOut)(out, _out, get);
|
|
719
769
|
if (!(0, _utils.isOutComplete)(out, get)) {
|
|
720
|
-
_context10.next =
|
|
770
|
+
_context10.next = 17;
|
|
721
771
|
break;
|
|
722
772
|
}
|
|
723
|
-
return _context10.abrupt("break",
|
|
724
|
-
case
|
|
773
|
+
return _context10.abrupt("break", 19);
|
|
774
|
+
case 17:
|
|
725
775
|
_context10.next = 3;
|
|
726
776
|
break;
|
|
727
|
-
case
|
|
728
|
-
_context10.next =
|
|
777
|
+
case 19:
|
|
778
|
+
_context10.next = 24;
|
|
729
779
|
break;
|
|
730
|
-
case
|
|
731
|
-
_context10.prev =
|
|
780
|
+
case 21:
|
|
781
|
+
_context10.prev = 21;
|
|
732
782
|
_context10.t0 = _context10["catch"](1);
|
|
733
|
-
|
|
734
|
-
case
|
|
735
|
-
_context10.prev =
|
|
736
|
-
|
|
737
|
-
return _context10.finish(
|
|
738
|
-
case 26:
|
|
739
|
-
return _context10.abrupt("return", out);
|
|
783
|
+
_iterator4.e(_context10.t0);
|
|
784
|
+
case 24:
|
|
785
|
+
_context10.prev = 24;
|
|
786
|
+
_iterator4.f();
|
|
787
|
+
return _context10.finish(24);
|
|
740
788
|
case 27:
|
|
789
|
+
return _context10.abrupt("return", out);
|
|
790
|
+
case 28:
|
|
741
791
|
case "end":
|
|
742
792
|
return _context10.stop();
|
|
743
793
|
}
|
|
744
|
-
}, _callee10, null, [[1,
|
|
794
|
+
}, _callee10, null, [[1, 21, 24, 27]]);
|
|
745
795
|
}));
|
|
746
796
|
return function checkOut(_x11, _x12, _x13, _x14) {
|
|
747
797
|
return _ref14.apply(this, arguments);
|
|
748
798
|
};
|
|
749
799
|
}();
|
|
750
|
-
res = null, out = null,
|
|
800
|
+
res = null, out = null, results = [];
|
|
751
801
|
_tags = (0, _utils.buildTags)(act, tags);
|
|
752
802
|
start = Date.now();
|
|
753
|
-
_context11.prev =
|
|
754
|
-
_context11.next =
|
|
803
|
+
_context11.prev = 17;
|
|
804
|
+
_context11.next = 20;
|
|
755
805
|
return this.message({
|
|
756
806
|
process: pid,
|
|
757
807
|
signer: this.toSigner(jwk),
|
|
758
808
|
tags: _tags,
|
|
759
809
|
data: (0, _utils.jsonToStr)(data)
|
|
760
810
|
});
|
|
761
|
-
case
|
|
811
|
+
case 20:
|
|
762
812
|
mid = _context11.sent;
|
|
763
813
|
if (!(0, _ramda.is)(Array, check)) check = [check];
|
|
764
814
|
_context11.t0 = mid;
|
|
765
|
-
_context11.next =
|
|
815
|
+
_context11.next = 25;
|
|
766
816
|
return this.ar.toAddr(jwk);
|
|
767
|
-
case
|
|
817
|
+
case 25:
|
|
768
818
|
_context11.t1 = _context11.sent;
|
|
769
819
|
_context11.t2 = {
|
|
770
820
|
id: _context11.t0,
|
|
771
821
|
from: _context11.t1
|
|
772
822
|
};
|
|
773
823
|
_txs = [_context11.t2];
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
824
|
+
_context11.next = 30;
|
|
825
|
+
return this.res({
|
|
826
|
+
pid: pid,
|
|
827
|
+
mid: mid
|
|
828
|
+
});
|
|
829
|
+
case 30:
|
|
830
|
+
res = _context11.sent;
|
|
831
|
+
hash = (0, _md["default"])(JSON.stringify(res));
|
|
832
|
+
_txmap = _defineProperty({}, mid, {
|
|
778
833
|
checked: false,
|
|
779
|
-
|
|
780
|
-
};
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
834
|
+
res: res
|
|
835
|
+
});
|
|
836
|
+
results.push({
|
|
837
|
+
mid: mid,
|
|
838
|
+
res: res
|
|
839
|
+
});
|
|
840
|
+
checked = false;
|
|
841
|
+
case 35:
|
|
842
|
+
_iterator5 = _createForOfIteratorHelper(_txs);
|
|
843
|
+
_context11.prev = 36;
|
|
844
|
+
_iterator5.s();
|
|
845
|
+
case 38:
|
|
846
|
+
if ((_step5 = _iterator5.n()).done) {
|
|
847
|
+
_context11.next = 52;
|
|
788
848
|
break;
|
|
789
849
|
}
|
|
790
|
-
v =
|
|
850
|
+
v = _step5.value;
|
|
791
851
|
if (_txmap[v.id].checked) {
|
|
792
|
-
_context11.next =
|
|
852
|
+
_context11.next = 50;
|
|
793
853
|
break;
|
|
794
854
|
}
|
|
795
855
|
_txmap[v.id].checked = true;
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
856
|
+
if (!(0, _ramda.isNil)(_txmap[v.id].res)) {
|
|
857
|
+
_context11.next = 47;
|
|
858
|
+
break;
|
|
859
|
+
}
|
|
860
|
+
_context11.next = 45;
|
|
861
|
+
return this.res({
|
|
862
|
+
pid: pid,
|
|
863
|
+
mid: v.id
|
|
800
864
|
});
|
|
801
|
-
case
|
|
865
|
+
case 45:
|
|
802
866
|
_res = _context11.sent;
|
|
803
|
-
if ((0, _ramda.isNil)(res)) {
|
|
804
|
-
res = _res;
|
|
805
|
-
mid = v.id;
|
|
806
|
-
results.push({
|
|
807
|
-
mid: mid,
|
|
808
|
-
res: res
|
|
809
|
-
});
|
|
810
|
-
}
|
|
811
867
|
_txmap[v.id].res = _res;
|
|
812
|
-
|
|
868
|
+
case 47:
|
|
869
|
+
if (!(0, _ramda.isNil)(check) && check.length > 0) {
|
|
870
|
+
checked = (0, _utils.allChecked)(check, _txmap[v.id].res, v.from);
|
|
871
|
+
} else {
|
|
872
|
+
checked = true;
|
|
873
|
+
}
|
|
813
874
|
if (!checked) {
|
|
814
|
-
_context11.next =
|
|
875
|
+
_context11.next = 50;
|
|
815
876
|
break;
|
|
816
877
|
}
|
|
817
|
-
return _context11.abrupt("break",
|
|
818
|
-
case
|
|
819
|
-
_context11.next =
|
|
878
|
+
return _context11.abrupt("break", 52);
|
|
879
|
+
case 50:
|
|
880
|
+
_context11.next = 38;
|
|
820
881
|
break;
|
|
821
|
-
case
|
|
822
|
-
_context11.next =
|
|
882
|
+
case 52:
|
|
883
|
+
_context11.next = 57;
|
|
823
884
|
break;
|
|
824
|
-
case 48:
|
|
825
|
-
_context11.prev = 48;
|
|
826
|
-
_context11.t3 = _context11["catch"](30);
|
|
827
|
-
_iterator4.e(_context11.t3);
|
|
828
|
-
case 51:
|
|
829
|
-
_context11.prev = 51;
|
|
830
|
-
_iterator4.f();
|
|
831
|
-
return _context11.finish(51);
|
|
832
885
|
case 54:
|
|
886
|
+
_context11.prev = 54;
|
|
887
|
+
_context11.t3 = _context11["catch"](36);
|
|
888
|
+
_iterator5.e(_context11.t3);
|
|
889
|
+
case 57:
|
|
890
|
+
_context11.prev = 57;
|
|
891
|
+
_iterator5.f();
|
|
892
|
+
return _context11.finish(57);
|
|
893
|
+
case 60:
|
|
833
894
|
if (!checked) {
|
|
834
|
-
_context11.next =
|
|
895
|
+
_context11.next = 62;
|
|
835
896
|
break;
|
|
836
897
|
}
|
|
837
|
-
return _context11.abrupt("break",
|
|
838
|
-
case
|
|
839
|
-
_context11.next =
|
|
898
|
+
return _context11.abrupt("break", 67);
|
|
899
|
+
case 62:
|
|
900
|
+
_context11.next = 64;
|
|
840
901
|
return (0, _utils.wait)(1000);
|
|
841
|
-
case
|
|
842
|
-
_context11.next =
|
|
902
|
+
case 64:
|
|
903
|
+
_context11.next = 66;
|
|
843
904
|
return getNewTxs(pid, _txs, _txmap);
|
|
844
|
-
case
|
|
905
|
+
case 66:
|
|
845
906
|
if (Date.now() - start < timeout) {
|
|
846
|
-
_context11.next =
|
|
907
|
+
_context11.next = 35;
|
|
847
908
|
break;
|
|
848
909
|
}
|
|
849
|
-
case
|
|
910
|
+
case 67:
|
|
850
911
|
if (checked) {
|
|
851
|
-
_context11.next =
|
|
912
|
+
_context11.next = 71;
|
|
852
913
|
break;
|
|
853
914
|
}
|
|
854
915
|
err = "something went wrong!";
|
|
855
|
-
_context11.next =
|
|
916
|
+
_context11.next = 95;
|
|
856
917
|
break;
|
|
857
|
-
case
|
|
918
|
+
case 71:
|
|
858
919
|
_context11.t4 = _utils.mergeOut;
|
|
859
920
|
_context11.t5 = out;
|
|
860
|
-
_context11.next =
|
|
921
|
+
_context11.next = 75;
|
|
861
922
|
return checkOut(get, _txs, _txmap, out);
|
|
862
|
-
case
|
|
923
|
+
case 75:
|
|
863
924
|
_context11.t6 = _context11.sent;
|
|
864
925
|
_context11.t7 = get;
|
|
865
926
|
out = (0, _context11.t4)(_context11.t5, _context11.t6, _context11.t7);
|
|
866
927
|
if (!(!(0, _utils.isOutComplete)(out, get) && !(0, _ramda.isNil)(get))) {
|
|
867
|
-
_context11.next =
|
|
928
|
+
_context11.next = 95;
|
|
868
929
|
break;
|
|
869
930
|
}
|
|
870
|
-
case
|
|
931
|
+
case 79:
|
|
871
932
|
if (!(Date.now() - start < timeout)) {
|
|
872
|
-
_context11.next =
|
|
933
|
+
_context11.next = 95;
|
|
873
934
|
break;
|
|
874
935
|
}
|
|
875
|
-
_context11.next =
|
|
936
|
+
_context11.next = 82;
|
|
876
937
|
return getNewTxs(pid, _txs, _txmap);
|
|
877
|
-
case
|
|
938
|
+
case 82:
|
|
878
939
|
_context11.t8 = _utils.mergeOut;
|
|
879
940
|
_context11.t9 = out;
|
|
880
|
-
_context11.next =
|
|
941
|
+
_context11.next = 86;
|
|
881
942
|
return checkOut(get, _txs, _txmap, out);
|
|
882
|
-
case
|
|
943
|
+
case 86:
|
|
883
944
|
_context11.t10 = _context11.sent;
|
|
884
945
|
_context11.t11 = get;
|
|
885
946
|
out = (0, _context11.t8)(_context11.t9, _context11.t10, _context11.t11);
|
|
886
947
|
if (!(0, _utils.isOutComplete)(out, get)) {
|
|
887
|
-
_context11.next =
|
|
948
|
+
_context11.next = 91;
|
|
888
949
|
break;
|
|
889
950
|
}
|
|
890
|
-
return _context11.abrupt("break",
|
|
891
|
-
case
|
|
892
|
-
_context11.next =
|
|
951
|
+
return _context11.abrupt("break", 95);
|
|
952
|
+
case 91:
|
|
953
|
+
_context11.next = 93;
|
|
893
954
|
return (0, _utils.wait)(1000);
|
|
894
|
-
case
|
|
895
|
-
_context11.next =
|
|
955
|
+
case 93:
|
|
956
|
+
_context11.next = 79;
|
|
896
957
|
break;
|
|
897
|
-
case
|
|
898
|
-
_context11.next =
|
|
958
|
+
case 95:
|
|
959
|
+
_context11.next = 100;
|
|
899
960
|
break;
|
|
900
|
-
case
|
|
901
|
-
_context11.prev =
|
|
902
|
-
_context11.t12 = _context11["catch"](
|
|
961
|
+
case 97:
|
|
962
|
+
_context11.prev = 97;
|
|
963
|
+
_context11.t12 = _context11["catch"](17);
|
|
903
964
|
err = _context11.t12;
|
|
904
|
-
case
|
|
965
|
+
case 100:
|
|
905
966
|
return _context11.abrupt("return", {
|
|
906
967
|
mid: mid,
|
|
907
968
|
res: res,
|
|
@@ -909,11 +970,11 @@ var AO = /*#__PURE__*/function () {
|
|
|
909
970
|
out: out,
|
|
910
971
|
results: results
|
|
911
972
|
});
|
|
912
|
-
case
|
|
973
|
+
case 101:
|
|
913
974
|
case "end":
|
|
914
975
|
return _context11.stop();
|
|
915
976
|
}
|
|
916
|
-
}, _callee11, this, [[
|
|
977
|
+
}, _callee11, this, [[17, 97], [36, 54, 57, 60]]);
|
|
917
978
|
}));
|
|
918
979
|
function msg(_x7) {
|
|
919
980
|
return _msg.apply(this, arguments);
|
|
@@ -957,9 +1018,9 @@ var AO = /*#__PURE__*/function () {
|
|
|
957
1018
|
case 13:
|
|
958
1019
|
mid = _context12.sent;
|
|
959
1020
|
_context12.next = 16;
|
|
960
|
-
return this.
|
|
961
|
-
|
|
962
|
-
|
|
1021
|
+
return this.res({
|
|
1022
|
+
pid: pid,
|
|
1023
|
+
mid: mid
|
|
963
1024
|
});
|
|
964
1025
|
case 16:
|
|
965
1026
|
res = _context12.sent;
|
|
@@ -1060,40 +1121,94 @@ var AO = /*#__PURE__*/function () {
|
|
|
1060
1121
|
return dry;
|
|
1061
1122
|
}()
|
|
1062
1123
|
}, {
|
|
1063
|
-
key: "
|
|
1124
|
+
key: "res",
|
|
1064
1125
|
value: function () {
|
|
1065
|
-
var
|
|
1066
|
-
var pid,
|
|
1126
|
+
var _res3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(_ref17) {
|
|
1127
|
+
var pid, mid, limit, asc, from, to, sort, _res4;
|
|
1067
1128
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
1068
1129
|
while (1) switch (_context14.prev = _context14.next) {
|
|
1069
1130
|
case 0:
|
|
1070
|
-
pid = _ref17.pid,
|
|
1131
|
+
pid = _ref17.pid, mid = _ref17.mid, limit = _ref17.limit, asc = _ref17.asc, from = _ref17.from, to = _ref17.to;
|
|
1132
|
+
if (mid) {
|
|
1133
|
+
_context14.next = 11;
|
|
1134
|
+
break;
|
|
1135
|
+
}
|
|
1136
|
+
sort = asc ? "ASC" : "DESC";
|
|
1137
|
+
_context14.next = 5;
|
|
1138
|
+
return this.results({
|
|
1139
|
+
process: pid,
|
|
1140
|
+
limit: limit,
|
|
1141
|
+
sort: sort,
|
|
1142
|
+
from: from,
|
|
1143
|
+
to: to
|
|
1144
|
+
});
|
|
1145
|
+
case 5:
|
|
1146
|
+
_res4 = _context14.sent;
|
|
1147
|
+
if (_res4.edges) {
|
|
1148
|
+
_context14.next = 8;
|
|
1149
|
+
break;
|
|
1150
|
+
}
|
|
1151
|
+
return _context14.abrupt("return", null);
|
|
1152
|
+
case 8:
|
|
1153
|
+
return _context14.abrupt("return", (0, _ramda.map)(function (v) {
|
|
1154
|
+
return _objectSpread({
|
|
1155
|
+
cursor: v.cursor
|
|
1156
|
+
}, v.node);
|
|
1157
|
+
})(_res4.edges));
|
|
1158
|
+
case 11:
|
|
1159
|
+
_context14.next = 13;
|
|
1160
|
+
return this.result({
|
|
1161
|
+
process: pid,
|
|
1162
|
+
message: mid
|
|
1163
|
+
});
|
|
1164
|
+
case 13:
|
|
1165
|
+
return _context14.abrupt("return", _context14.sent);
|
|
1166
|
+
case 14:
|
|
1167
|
+
case "end":
|
|
1168
|
+
return _context14.stop();
|
|
1169
|
+
}
|
|
1170
|
+
}, _callee14, this);
|
|
1171
|
+
}));
|
|
1172
|
+
function res(_x17) {
|
|
1173
|
+
return _res3.apply(this, arguments);
|
|
1174
|
+
}
|
|
1175
|
+
return res;
|
|
1176
|
+
}()
|
|
1177
|
+
}, {
|
|
1178
|
+
key: "eval",
|
|
1179
|
+
value: function () {
|
|
1180
|
+
var _eval2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(_ref18) {
|
|
1181
|
+
var pid, jwk, data, fns;
|
|
1182
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1183
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1184
|
+
case 0:
|
|
1185
|
+
pid = _ref18.pid, jwk = _ref18.jwk, data = _ref18.data;
|
|
1071
1186
|
fns = [{
|
|
1072
1187
|
args: {
|
|
1073
1188
|
pid: pid,
|
|
1074
1189
|
data: data,
|
|
1075
1190
|
act: "Eval"
|
|
1076
1191
|
},
|
|
1077
|
-
err: function err(
|
|
1192
|
+
err: function err(_ref19) {
|
|
1078
1193
|
var _res$Output, _res$Output2, _res$Output3;
|
|
1079
|
-
var res =
|
|
1194
|
+
var res = _ref19.res;
|
|
1080
1195
|
return _typeof(res === null || res === void 0 || (_res$Output = res.Output) === null || _res$Output === void 0 ? void 0 : _res$Output.data) !== "object" && !(typeof (res === null || res === void 0 || (_res$Output2 = res.Output) === null || _res$Output2 === void 0 ? void 0 : _res$Output2.prompt) === "string" && /aos\-/.test(res === null || res === void 0 || (_res$Output3 = res.Output) === null || _res$Output3 === void 0 ? void 0 : _res$Output3.prompt));
|
|
1081
1196
|
}
|
|
1082
1197
|
}];
|
|
1083
|
-
|
|
1198
|
+
_context15.next = 4;
|
|
1084
1199
|
return this.pipe({
|
|
1085
1200
|
jwk: jwk,
|
|
1086
1201
|
fns: fns
|
|
1087
1202
|
});
|
|
1088
1203
|
case 4:
|
|
1089
|
-
return
|
|
1204
|
+
return _context15.abrupt("return", _context15.sent);
|
|
1090
1205
|
case 5:
|
|
1091
1206
|
case "end":
|
|
1092
|
-
return
|
|
1207
|
+
return _context15.stop();
|
|
1093
1208
|
}
|
|
1094
|
-
},
|
|
1209
|
+
}, _callee15, this);
|
|
1095
1210
|
}));
|
|
1096
|
-
function _eval(
|
|
1211
|
+
function _eval(_x18) {
|
|
1097
1212
|
return _eval2.apply(this, arguments);
|
|
1098
1213
|
}
|
|
1099
1214
|
return _eval;
|
|
@@ -1101,27 +1216,27 @@ var AO = /*#__PURE__*/function () {
|
|
|
1101
1216
|
}, {
|
|
1102
1217
|
key: "transform",
|
|
1103
1218
|
value: function () {
|
|
1104
|
-
var _transform = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1219
|
+
var _transform = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(_ref20) {
|
|
1105
1220
|
var src, data, fills, err, out, _data, k, text;
|
|
1106
|
-
return _regeneratorRuntime().wrap(function
|
|
1107
|
-
while (1) switch (
|
|
1221
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1222
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1108
1223
|
case 0:
|
|
1109
|
-
src =
|
|
1224
|
+
src = _ref20.src, data = _ref20.data, fills = _ref20.fills;
|
|
1110
1225
|
err = null, out = null;
|
|
1111
1226
|
if (!(data !== null && data !== void 0)) {
|
|
1112
|
-
|
|
1227
|
+
_context16.next = 6;
|
|
1113
1228
|
break;
|
|
1114
1229
|
}
|
|
1115
|
-
|
|
1116
|
-
|
|
1230
|
+
_context16.t0 = data;
|
|
1231
|
+
_context16.next = 9;
|
|
1117
1232
|
break;
|
|
1118
1233
|
case 6:
|
|
1119
|
-
|
|
1234
|
+
_context16.next = 8;
|
|
1120
1235
|
return this.ar.data(src, true);
|
|
1121
1236
|
case 8:
|
|
1122
|
-
|
|
1237
|
+
_context16.t0 = _context16.sent;
|
|
1123
1238
|
case 9:
|
|
1124
|
-
_data =
|
|
1239
|
+
_data = _context16.t0;
|
|
1125
1240
|
if (!_data) err = "data doesn't exist";else {
|
|
1126
1241
|
for (k in fills !== null && fills !== void 0 ? fills : {}) {
|
|
1127
1242
|
text = fills[k];
|
|
@@ -1130,17 +1245,17 @@ var AO = /*#__PURE__*/function () {
|
|
|
1130
1245
|
}
|
|
1131
1246
|
out = _data;
|
|
1132
1247
|
}
|
|
1133
|
-
return
|
|
1248
|
+
return _context16.abrupt("return", {
|
|
1134
1249
|
err: err,
|
|
1135
1250
|
out: out
|
|
1136
1251
|
});
|
|
1137
1252
|
case 12:
|
|
1138
1253
|
case "end":
|
|
1139
|
-
return
|
|
1254
|
+
return _context16.stop();
|
|
1140
1255
|
}
|
|
1141
|
-
},
|
|
1256
|
+
}, _callee16, this);
|
|
1142
1257
|
}));
|
|
1143
|
-
function transform(
|
|
1258
|
+
function transform(_x19) {
|
|
1144
1259
|
return _transform.apply(this, arguments);
|
|
1145
1260
|
}
|
|
1146
1261
|
return transform;
|
|
@@ -1148,12 +1263,12 @@ var AO = /*#__PURE__*/function () {
|
|
|
1148
1263
|
}, {
|
|
1149
1264
|
key: "load",
|
|
1150
1265
|
value: function () {
|
|
1151
|
-
var _load = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1266
|
+
var _load = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(_ref21) {
|
|
1152
1267
|
var src, data, fills, pid, jwk, fns;
|
|
1153
|
-
return _regeneratorRuntime().wrap(function
|
|
1154
|
-
while (1) switch (
|
|
1268
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1269
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1155
1270
|
case 0:
|
|
1156
|
-
src =
|
|
1271
|
+
src = _ref21.src, data = _ref21.data, fills = _ref21.fills, pid = _ref21.pid, jwk = _ref21.jwk;
|
|
1157
1272
|
fns = [{
|
|
1158
1273
|
fn: this.transform,
|
|
1159
1274
|
args: {
|
|
@@ -1170,20 +1285,20 @@ var AO = /*#__PURE__*/function () {
|
|
|
1170
1285
|
pid: pid
|
|
1171
1286
|
}
|
|
1172
1287
|
}];
|
|
1173
|
-
|
|
1288
|
+
_context17.next = 4;
|
|
1174
1289
|
return this.pipe({
|
|
1175
1290
|
jwk: jwk,
|
|
1176
1291
|
fns: fns
|
|
1177
1292
|
});
|
|
1178
1293
|
case 4:
|
|
1179
|
-
return
|
|
1294
|
+
return _context17.abrupt("return", _context17.sent);
|
|
1180
1295
|
case 5:
|
|
1181
1296
|
case "end":
|
|
1182
|
-
return
|
|
1297
|
+
return _context17.stop();
|
|
1183
1298
|
}
|
|
1184
|
-
},
|
|
1299
|
+
}, _callee17, this);
|
|
1185
1300
|
}));
|
|
1186
|
-
function load(
|
|
1301
|
+
function load(_x20) {
|
|
1187
1302
|
return _load.apply(this, arguments);
|
|
1188
1303
|
}
|
|
1189
1304
|
return load;
|
|
@@ -1191,66 +1306,66 @@ var AO = /*#__PURE__*/function () {
|
|
|
1191
1306
|
}, {
|
|
1192
1307
|
key: "wait",
|
|
1193
1308
|
value: function () {
|
|
1194
|
-
var _wait2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1195
|
-
var pid,
|
|
1196
|
-
return _regeneratorRuntime().wrap(function
|
|
1197
|
-
while (1) switch (
|
|
1309
|
+
var _wait2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(_ref22) {
|
|
1310
|
+
var pid, _ref22$attempts, attempts, exist, err, _yield$this$dry, res, _err;
|
|
1311
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1312
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1198
1313
|
case 0:
|
|
1199
|
-
pid =
|
|
1314
|
+
pid = _ref22.pid, _ref22$attempts = _ref22.attempts, attempts = _ref22$attempts === void 0 ? 10 : _ref22$attempts;
|
|
1200
1315
|
exist = false;
|
|
1201
1316
|
err = null;
|
|
1202
1317
|
case 3:
|
|
1203
1318
|
if (!(attempts > 0)) {
|
|
1204
|
-
|
|
1319
|
+
_context18.next = 20;
|
|
1205
1320
|
break;
|
|
1206
1321
|
}
|
|
1207
1322
|
if (this.in_memory) {
|
|
1208
|
-
|
|
1323
|
+
_context18.next = 7;
|
|
1209
1324
|
break;
|
|
1210
1325
|
}
|
|
1211
|
-
|
|
1326
|
+
_context18.next = 7;
|
|
1212
1327
|
return (0, _utils.wait)(1000);
|
|
1213
1328
|
case 7:
|
|
1214
|
-
|
|
1329
|
+
_context18.next = 9;
|
|
1215
1330
|
return this.dry({
|
|
1216
1331
|
pid: pid,
|
|
1217
1332
|
data: "#Inbox"
|
|
1218
1333
|
});
|
|
1219
1334
|
case 9:
|
|
1220
|
-
_yield$this$dry =
|
|
1335
|
+
_yield$this$dry = _context18.sent;
|
|
1221
1336
|
res = _yield$this$dry.res;
|
|
1222
1337
|
_err = _yield$this$dry.err;
|
|
1223
1338
|
if (!(res !== null && res !== void 0 && res.error)) {
|
|
1224
|
-
|
|
1339
|
+
_context18.next = 14;
|
|
1225
1340
|
break;
|
|
1226
1341
|
}
|
|
1227
|
-
return
|
|
1342
|
+
return _context18.abrupt("return", {
|
|
1228
1343
|
err: res.error,
|
|
1229
1344
|
pid: pid
|
|
1230
1345
|
});
|
|
1231
1346
|
case 14:
|
|
1232
1347
|
if (!(_typeof(res === null || res === void 0 ? void 0 : res.Output) === "object")) {
|
|
1233
|
-
|
|
1348
|
+
_context18.next = 16;
|
|
1234
1349
|
break;
|
|
1235
1350
|
}
|
|
1236
|
-
return
|
|
1351
|
+
return _context18.abrupt("break", 20);
|
|
1237
1352
|
case 16:
|
|
1238
1353
|
attempts -= 1;
|
|
1239
1354
|
if (attempts === 0) err = "timeout";
|
|
1240
|
-
|
|
1355
|
+
_context18.next = 3;
|
|
1241
1356
|
break;
|
|
1242
1357
|
case 20:
|
|
1243
|
-
return
|
|
1358
|
+
return _context18.abrupt("return", {
|
|
1244
1359
|
err: err,
|
|
1245
1360
|
pid: pid
|
|
1246
1361
|
});
|
|
1247
1362
|
case 21:
|
|
1248
1363
|
case "end":
|
|
1249
|
-
return
|
|
1364
|
+
return _context18.stop();
|
|
1250
1365
|
}
|
|
1251
|
-
},
|
|
1366
|
+
}, _callee18, this);
|
|
1252
1367
|
}));
|
|
1253
|
-
function wait(
|
|
1368
|
+
function wait(_x21) {
|
|
1254
1369
|
return _wait2.apply(this, arguments);
|
|
1255
1370
|
}
|
|
1256
1371
|
return wait;
|
|
@@ -1258,13 +1373,13 @@ var AO = /*#__PURE__*/function () {
|
|
|
1258
1373
|
}, {
|
|
1259
1374
|
key: "attest",
|
|
1260
1375
|
value: function () {
|
|
1261
|
-
var _attest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1376
|
+
var _attest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(_ref23) {
|
|
1262
1377
|
var id, jwk, tags;
|
|
1263
|
-
return _regeneratorRuntime().wrap(function
|
|
1264
|
-
while (1) switch (
|
|
1378
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1379
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1265
1380
|
case 0:
|
|
1266
|
-
id =
|
|
1267
|
-
|
|
1381
|
+
id = _ref23.id, jwk = _ref23.jwk, tags = _ref23.tags;
|
|
1382
|
+
_context19.next = 3;
|
|
1268
1383
|
return this.ar.post({
|
|
1269
1384
|
tags: (0, _ramda.mergeLeft)(tags, {
|
|
1270
1385
|
"Data-Protocol": "ao",
|
|
@@ -1274,14 +1389,14 @@ var AO = /*#__PURE__*/function () {
|
|
|
1274
1389
|
jwk: jwk
|
|
1275
1390
|
});
|
|
1276
1391
|
case 3:
|
|
1277
|
-
return
|
|
1392
|
+
return _context19.abrupt("return", _context19.sent);
|
|
1278
1393
|
case 4:
|
|
1279
1394
|
case "end":
|
|
1280
|
-
return
|
|
1395
|
+
return _context19.stop();
|
|
1281
1396
|
}
|
|
1282
|
-
},
|
|
1397
|
+
}, _callee19, this);
|
|
1283
1398
|
}));
|
|
1284
|
-
function attest(
|
|
1399
|
+
function attest(_x22) {
|
|
1285
1400
|
return _attest.apply(this, arguments);
|
|
1286
1401
|
}
|
|
1287
1402
|
return attest;
|
|
@@ -1289,13 +1404,13 @@ var AO = /*#__PURE__*/function () {
|
|
|
1289
1404
|
}, {
|
|
1290
1405
|
key: "avail",
|
|
1291
1406
|
value: function () {
|
|
1292
|
-
var _avail = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1407
|
+
var _avail = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(_ref24) {
|
|
1293
1408
|
var ids, jwk, tags;
|
|
1294
|
-
return _regeneratorRuntime().wrap(function
|
|
1295
|
-
while (1) switch (
|
|
1409
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
1410
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1296
1411
|
case 0:
|
|
1297
|
-
ids =
|
|
1298
|
-
|
|
1412
|
+
ids = _ref24.ids, jwk = _ref24.jwk, tags = _ref24.tags;
|
|
1413
|
+
_context20.next = 3;
|
|
1299
1414
|
return this.ar.post({
|
|
1300
1415
|
tags: (0, _ramda.mergeLeft)(tags, {
|
|
1301
1416
|
"Data-Protocol": "WeaveDrive",
|
|
@@ -1306,14 +1421,14 @@ var AO = /*#__PURE__*/function () {
|
|
|
1306
1421
|
jwk: jwk
|
|
1307
1422
|
});
|
|
1308
1423
|
case 3:
|
|
1309
|
-
return
|
|
1424
|
+
return _context20.abrupt("return", _context20.sent);
|
|
1310
1425
|
case 4:
|
|
1311
1426
|
case "end":
|
|
1312
|
-
return
|
|
1427
|
+
return _context20.stop();
|
|
1313
1428
|
}
|
|
1314
|
-
},
|
|
1429
|
+
}, _callee20, this);
|
|
1315
1430
|
}));
|
|
1316
|
-
function avail(
|
|
1431
|
+
function avail(_x23) {
|
|
1317
1432
|
return _avail.apply(this, arguments);
|
|
1318
1433
|
}
|
|
1319
1434
|
return avail;
|
|
@@ -1321,12 +1436,12 @@ var AO = /*#__PURE__*/function () {
|
|
|
1321
1436
|
}, {
|
|
1322
1437
|
key: "deploy",
|
|
1323
1438
|
value: function () {
|
|
1324
|
-
var _deploy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1325
|
-
var boot, loads, src, src_data,
|
|
1326
|
-
return _regeneratorRuntime().wrap(function
|
|
1327
|
-
while (1) switch (
|
|
1439
|
+
var _deploy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(_ref25) {
|
|
1440
|
+
var boot, loads, src, src_data, _ref25$fills, fills, _ref25$module, module, _ref25$scheduler, scheduler, jwk, _ref25$tags, tags, data, fns, isBoot, i, _iterator6, _step6, v, args, result;
|
|
1441
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
1442
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1328
1443
|
case 0:
|
|
1329
|
-
boot =
|
|
1444
|
+
boot = _ref25.boot, loads = _ref25.loads, src = _ref25.src, src_data = _ref25.src_data, _ref25$fills = _ref25.fills, fills = _ref25$fills === void 0 ? {} : _ref25$fills, _ref25$module = _ref25.module, module = _ref25$module === void 0 ? this.module : _ref25$module, _ref25$scheduler = _ref25.scheduler, scheduler = _ref25$scheduler === void 0 ? this.scheduler : _ref25$scheduler, jwk = _ref25.jwk, _ref25$tags = _ref25.tags, tags = _ref25$tags === void 0 ? {} : _ref25$tags, data = _ref25.data;
|
|
1330
1445
|
fns = [], isBoot = false;
|
|
1331
1446
|
if (boot === true && !data) {
|
|
1332
1447
|
isBoot = true;
|
|
@@ -1374,14 +1489,14 @@ var AO = /*#__PURE__*/function () {
|
|
|
1374
1489
|
}
|
|
1375
1490
|
});
|
|
1376
1491
|
i = 0;
|
|
1377
|
-
|
|
1492
|
+
_iterator6 = _createForOfIteratorHelper(!loads ? src_data ? [{
|
|
1378
1493
|
data: src_data,
|
|
1379
1494
|
src: src,
|
|
1380
1495
|
fills: fills
|
|
1381
1496
|
}] : [] : loads);
|
|
1382
1497
|
try {
|
|
1383
|
-
for (
|
|
1384
|
-
v =
|
|
1498
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
1499
|
+
v = _step6.value;
|
|
1385
1500
|
if (!isBoot || i !== 0) {
|
|
1386
1501
|
args = v;
|
|
1387
1502
|
if (typeof args === "string") args = {
|
|
@@ -1398,26 +1513,26 @@ var AO = /*#__PURE__*/function () {
|
|
|
1398
1513
|
i++;
|
|
1399
1514
|
}
|
|
1400
1515
|
} catch (err) {
|
|
1401
|
-
|
|
1516
|
+
_iterator6.e(err);
|
|
1402
1517
|
} finally {
|
|
1403
|
-
|
|
1518
|
+
_iterator6.f();
|
|
1404
1519
|
}
|
|
1405
|
-
|
|
1520
|
+
_context21.next = 9;
|
|
1406
1521
|
return this.pipe({
|
|
1407
1522
|
jwk: jwk,
|
|
1408
1523
|
fns: fns
|
|
1409
1524
|
});
|
|
1410
1525
|
case 9:
|
|
1411
|
-
result =
|
|
1526
|
+
result = _context21.sent;
|
|
1412
1527
|
if (result.pid) result.p = this.p(result.pid);
|
|
1413
|
-
return
|
|
1528
|
+
return _context21.abrupt("return", result);
|
|
1414
1529
|
case 12:
|
|
1415
1530
|
case "end":
|
|
1416
|
-
return
|
|
1531
|
+
return _context21.stop();
|
|
1417
1532
|
}
|
|
1418
|
-
},
|
|
1533
|
+
}, _callee21, this);
|
|
1419
1534
|
}));
|
|
1420
|
-
function deploy(
|
|
1535
|
+
function deploy(_x24) {
|
|
1421
1536
|
return _deploy.apply(this, arguments);
|
|
1422
1537
|
}
|
|
1423
1538
|
return deploy;
|
|
@@ -1455,24 +1570,24 @@ var Process = /*#__PURE__*/function () {
|
|
|
1455
1570
|
return _createClass(Process, [{
|
|
1456
1571
|
key: "load",
|
|
1457
1572
|
value: function () {
|
|
1458
|
-
var _load2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1573
|
+
var _load2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
1459
1574
|
var opt,
|
|
1460
|
-
|
|
1461
|
-
return _regeneratorRuntime().wrap(function
|
|
1462
|
-
while (1) switch (
|
|
1575
|
+
_args22 = arguments;
|
|
1576
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
1577
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1463
1578
|
case 0:
|
|
1464
|
-
opt =
|
|
1465
|
-
|
|
1579
|
+
opt = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {};
|
|
1580
|
+
_context22.next = 3;
|
|
1466
1581
|
return this.ao.load(_objectSpread({
|
|
1467
1582
|
pid: this.pid
|
|
1468
1583
|
}, opt));
|
|
1469
1584
|
case 3:
|
|
1470
|
-
return
|
|
1585
|
+
return _context22.abrupt("return", _context22.sent);
|
|
1471
1586
|
case 4:
|
|
1472
1587
|
case "end":
|
|
1473
|
-
return
|
|
1588
|
+
return _context22.stop();
|
|
1474
1589
|
}
|
|
1475
|
-
},
|
|
1590
|
+
}, _callee22, this);
|
|
1476
1591
|
}));
|
|
1477
1592
|
function load() {
|
|
1478
1593
|
return _load2.apply(this, arguments);
|
|
@@ -1482,27 +1597,27 @@ var Process = /*#__PURE__*/function () {
|
|
|
1482
1597
|
}, {
|
|
1483
1598
|
key: "msg",
|
|
1484
1599
|
value: function () {
|
|
1485
|
-
var _msg2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1600
|
+
var _msg2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(act, tags, opts) {
|
|
1486
1601
|
var _getParams, _tags, _opts;
|
|
1487
|
-
return _regeneratorRuntime().wrap(function
|
|
1488
|
-
while (1) switch (
|
|
1602
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
1603
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1489
1604
|
case 0:
|
|
1490
1605
|
_getParams = getParams(tags, opts), _tags = _getParams._tags, _opts = _getParams._opts;
|
|
1491
|
-
|
|
1606
|
+
_context23.next = 3;
|
|
1492
1607
|
return this.ao.msg(_objectSpread({
|
|
1493
1608
|
pid: this.pid,
|
|
1494
1609
|
act: act,
|
|
1495
1610
|
tags: _tags
|
|
1496
1611
|
}, _opts));
|
|
1497
1612
|
case 3:
|
|
1498
|
-
return
|
|
1613
|
+
return _context23.abrupt("return", _context23.sent);
|
|
1499
1614
|
case 4:
|
|
1500
1615
|
case "end":
|
|
1501
|
-
return
|
|
1616
|
+
return _context23.stop();
|
|
1502
1617
|
}
|
|
1503
|
-
},
|
|
1618
|
+
}, _callee23, this);
|
|
1504
1619
|
}));
|
|
1505
|
-
function msg(
|
|
1620
|
+
function msg(_x25, _x26, _x27) {
|
|
1506
1621
|
return _msg2.apply(this, arguments);
|
|
1507
1622
|
}
|
|
1508
1623
|
return msg;
|
|
@@ -1510,27 +1625,27 @@ var Process = /*#__PURE__*/function () {
|
|
|
1510
1625
|
}, {
|
|
1511
1626
|
key: "dry",
|
|
1512
1627
|
value: function () {
|
|
1513
|
-
var _dry2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1628
|
+
var _dry2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(act, tags, opts) {
|
|
1514
1629
|
var _getParams2, _tags, _opts;
|
|
1515
|
-
return _regeneratorRuntime().wrap(function
|
|
1516
|
-
while (1) switch (
|
|
1630
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
1631
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1517
1632
|
case 0:
|
|
1518
1633
|
_getParams2 = getParams(tags, opts), _tags = _getParams2._tags, _opts = _getParams2._opts;
|
|
1519
|
-
|
|
1634
|
+
_context24.next = 3;
|
|
1520
1635
|
return this.ao.dry(_objectSpread({
|
|
1521
1636
|
pid: this.pid,
|
|
1522
1637
|
act: act,
|
|
1523
1638
|
tags: _tags
|
|
1524
1639
|
}, _opts));
|
|
1525
1640
|
case 3:
|
|
1526
|
-
return
|
|
1641
|
+
return _context24.abrupt("return", _context24.sent);
|
|
1527
1642
|
case 4:
|
|
1528
1643
|
case "end":
|
|
1529
|
-
return
|
|
1644
|
+
return _context24.stop();
|
|
1530
1645
|
}
|
|
1531
|
-
},
|
|
1646
|
+
}, _callee24, this);
|
|
1532
1647
|
}));
|
|
1533
|
-
function dry(
|
|
1648
|
+
function dry(_x28, _x29, _x30) {
|
|
1534
1649
|
return _dry2.apply(this, arguments);
|
|
1535
1650
|
}
|
|
1536
1651
|
return dry;
|
|
@@ -1538,28 +1653,28 @@ var Process = /*#__PURE__*/function () {
|
|
|
1538
1653
|
}, {
|
|
1539
1654
|
key: "m",
|
|
1540
1655
|
value: function () {
|
|
1541
|
-
var _m = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1656
|
+
var _m = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
1542
1657
|
var res,
|
|
1543
|
-
|
|
1544
|
-
return _regeneratorRuntime().wrap(function
|
|
1545
|
-
while (1) switch (
|
|
1658
|
+
_args25 = arguments;
|
|
1659
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
1660
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1546
1661
|
case 0:
|
|
1547
|
-
|
|
1548
|
-
return this.msg.apply(this,
|
|
1662
|
+
_context25.next = 2;
|
|
1663
|
+
return this.msg.apply(this, _args25);
|
|
1549
1664
|
case 2:
|
|
1550
|
-
res =
|
|
1665
|
+
res = _context25.sent;
|
|
1551
1666
|
if (!res.err) {
|
|
1552
|
-
|
|
1667
|
+
_context25.next = 5;
|
|
1553
1668
|
break;
|
|
1554
1669
|
}
|
|
1555
1670
|
throw Error(res.err);
|
|
1556
1671
|
case 5:
|
|
1557
|
-
return
|
|
1672
|
+
return _context25.abrupt("return", res.out);
|
|
1558
1673
|
case 6:
|
|
1559
1674
|
case "end":
|
|
1560
|
-
return
|
|
1675
|
+
return _context25.stop();
|
|
1561
1676
|
}
|
|
1562
|
-
},
|
|
1677
|
+
}, _callee25, this);
|
|
1563
1678
|
}));
|
|
1564
1679
|
function m() {
|
|
1565
1680
|
return _m.apply(this, arguments);
|
|
@@ -1569,28 +1684,28 @@ var Process = /*#__PURE__*/function () {
|
|
|
1569
1684
|
}, {
|
|
1570
1685
|
key: "d",
|
|
1571
1686
|
value: function () {
|
|
1572
|
-
var _d = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1687
|
+
var _d = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
|
|
1573
1688
|
var res,
|
|
1574
|
-
|
|
1575
|
-
return _regeneratorRuntime().wrap(function
|
|
1576
|
-
while (1) switch (
|
|
1689
|
+
_args26 = arguments;
|
|
1690
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
1691
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1577
1692
|
case 0:
|
|
1578
|
-
|
|
1579
|
-
return this.dry.apply(this,
|
|
1693
|
+
_context26.next = 2;
|
|
1694
|
+
return this.dry.apply(this, _args26);
|
|
1580
1695
|
case 2:
|
|
1581
|
-
res =
|
|
1696
|
+
res = _context26.sent;
|
|
1582
1697
|
if (!res.err) {
|
|
1583
|
-
|
|
1698
|
+
_context26.next = 5;
|
|
1584
1699
|
break;
|
|
1585
1700
|
}
|
|
1586
1701
|
throw Error(res.err);
|
|
1587
1702
|
case 5:
|
|
1588
|
-
return
|
|
1703
|
+
return _context26.abrupt("return", res.out);
|
|
1589
1704
|
case 6:
|
|
1590
1705
|
case "end":
|
|
1591
|
-
return
|
|
1706
|
+
return _context26.stop();
|
|
1592
1707
|
}
|
|
1593
|
-
},
|
|
1708
|
+
}, _callee26, this);
|
|
1594
1709
|
}));
|
|
1595
1710
|
function d() {
|
|
1596
1711
|
return _d.apply(this, arguments);
|