wao 0.25.1 → 0.25.4
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 +249 -116
- package/cjs/armem-base.js +6 -5
- package/cjs/hb.js +125 -66
- package/cjs/hyperbeam.js +140 -28
- package/cjs/lua/aos_wamr.js +1 -0
- package/cjs/lua/hyper-aos.js +1 -0
- package/cjs/signer.js +35 -6
- package/cjs/utils.js +2 -1
- package/esm/ao.js +106 -43
- package/esm/armem-base.js +5 -2
- package/esm/hb.js +36 -14
- package/esm/hyperbeam.js +59 -14
- package/esm/lua/aos_wamr.js +1 -0
- package/esm/lua/hyper-aos.js +1 -0
- package/esm/signer.js +21 -4
- package/esm/utils.js +3 -1
- package/package.json +1 -1
- package/cjs/lua/aos2-wamr.wasm +0 -0
- package/cjs/lua/hyper-aos.lua +0 -2563
- package/esm/lua/aos2-wamr.wasm +0 -0
- package/esm/lua/hyper-aos.lua +0 -2563
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 _hb2 = _interopRequireDefault(require("./hb.js"));
|
|
9
10
|
var _md = _interopRequireDefault(require("md5"));
|
|
10
11
|
var _aoconnect = require("@permaweb/aoconnect-69");
|
|
11
12
|
var _ramda = require("ramda");
|
|
@@ -104,6 +105,7 @@ var AO = /*#__PURE__*/function () {
|
|
|
104
105
|
opt = {};
|
|
105
106
|
}
|
|
106
107
|
var _opt = opt,
|
|
108
|
+
_hb = _opt.hb,
|
|
107
109
|
_opt$authority = _opt.authority,
|
|
108
110
|
authority = _opt$authority === void 0 ? _utils.srcs.authority : _opt$authority,
|
|
109
111
|
module = _opt.module,
|
|
@@ -116,6 +118,7 @@ var AO = /*#__PURE__*/function () {
|
|
|
116
118
|
_opt$in_memory = _opt.in_memory,
|
|
117
119
|
in_memory = _opt$in_memory === void 0 ? false : _opt$in_memory,
|
|
118
120
|
port = _opt.port;
|
|
121
|
+
if (_hb) this.hb = new _hb2["default"]();
|
|
119
122
|
if (!_port && port) _port = port;
|
|
120
123
|
if (!aoconnect && _port) aoconnect = (0, _utils.optAO)(_port);
|
|
121
124
|
if (!ar && _port) ar = {
|
|
@@ -123,6 +126,7 @@ var AO = /*#__PURE__*/function () {
|
|
|
123
126
|
};
|
|
124
127
|
this.wao = opt.wao;
|
|
125
128
|
this.variant = opt.variant;
|
|
129
|
+
this.module_type = module_type;
|
|
126
130
|
if ((0, _ramda.isNil)(this.wao)) this.wao = in_memory || !(0, _ramda.isNil)((_ar2 = ar) === null || _ar2 === void 0 ? void 0 : _ar2.port);
|
|
127
131
|
if (!module) {
|
|
128
132
|
switch (module_type) {
|
|
@@ -132,6 +136,9 @@ var AO = /*#__PURE__*/function () {
|
|
|
132
136
|
case "aos2":
|
|
133
137
|
module = _utils.srcs.module_aos2;
|
|
134
138
|
break;
|
|
139
|
+
case "mainnet":
|
|
140
|
+
module = _utils.srcs.module_mainnet;
|
|
141
|
+
break;
|
|
135
142
|
default:
|
|
136
143
|
module = _utils.srcs.module;
|
|
137
144
|
}
|
|
@@ -174,6 +181,9 @@ var AO = /*#__PURE__*/function () {
|
|
|
174
181
|
this.module = (_module = module) !== null && _module !== void 0 ? _module : _utils.srcs.module_wao;
|
|
175
182
|
this.scheduler = _utils.srcs.scheduler_wao;
|
|
176
183
|
this.authority = _utils.srcs.authority_wao;
|
|
184
|
+
} else if (this.module_type === "mainnet") {
|
|
185
|
+
var _module2;
|
|
186
|
+
this.module = (_module2 = module) !== null && _module2 !== void 0 ? _module2 : _utils.srcs.module_mainnet;
|
|
177
187
|
} else {
|
|
178
188
|
this.module = module;
|
|
179
189
|
this.scheduler = scheduler;
|
|
@@ -190,8 +200,15 @@ var AO = /*#__PURE__*/function () {
|
|
|
190
200
|
_context3.next = 2;
|
|
191
201
|
return this.ar.init(jwk);
|
|
192
202
|
case 2:
|
|
203
|
+
if (!this.hb) {
|
|
204
|
+
_context3.next = 5;
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
_context3.next = 5;
|
|
208
|
+
return this.hb.init(this.ar.jwk);
|
|
209
|
+
case 5:
|
|
193
210
|
return _context3.abrupt("return", this);
|
|
194
|
-
case
|
|
211
|
+
case 6:
|
|
195
212
|
case "end":
|
|
196
213
|
return _context3.stop();
|
|
197
214
|
}
|
|
@@ -439,7 +456,7 @@ var AO = /*#__PURE__*/function () {
|
|
|
439
456
|
data = _ref6.data, jwk = _ref6.jwk, _ref6$tags = _ref6.tags, tags = _ref6$tags === void 0 ? {} : _ref6$tags, _ref6$overwrite = _ref6.overwrite, overwrite = _ref6$overwrite === void 0 ? false : _ref6$overwrite;
|
|
440
457
|
_tags = (0, _ramda.mergeLeft)(tags, {
|
|
441
458
|
"Data-Protocol": (_this$protocol = this.protocol) !== null && _this$protocol !== void 0 ? _this$protocol : "ao",
|
|
442
|
-
Variant: (_this$variant = this.variant) !== null && _this$variant !== void 0 ? _this$variant : "ao.TN.1",
|
|
459
|
+
Variant: ((_this$variant = this.variant) !== null && _this$variant !== void 0 ? _this$variant : this.module_type === "mainnet") ? "ao.TN.1" : "ao.TN.1",
|
|
443
460
|
Type: "Module",
|
|
444
461
|
"Module-Format": "wasm64-unknown-emscripten-draft_2024_02_15",
|
|
445
462
|
"Input-Encoding": "JSON-V1",
|
|
@@ -491,7 +508,7 @@ var AO = /*#__PURE__*/function () {
|
|
|
491
508
|
jwk = _ref8.jwk, url = _ref8.url, _ref8$tags = _ref8.tags, tags = _ref8$tags === void 0 ? {} : _ref8$tags, _ref8$overwrite = _ref8.overwrite, overwrite = _ref8$overwrite === void 0 ? false : _ref8$overwrite;
|
|
492
509
|
_tags = (0, _ramda.mergeLeft)(tags, {
|
|
493
510
|
"Data-Protocol": (_this$protocol2 = this.protocol) !== null && _this$protocol2 !== void 0 ? _this$protocol2 : "ao",
|
|
494
|
-
Variant: (_this$variant2 = this.variant) !== null && _this$variant2 !== void 0 ? _this$variant2 : "ao.TN.1",
|
|
511
|
+
Variant: ((_this$variant2 = this.variant) !== null && _this$variant2 !== void 0 ? _this$variant2 : this.module_type === "mainnet") ? "ao.TN.1" : "ao.TN.1",
|
|
495
512
|
Type: "Scheduler-Location",
|
|
496
513
|
Url: url,
|
|
497
514
|
"Time-To-Live": "3600000"
|
|
@@ -549,7 +566,6 @@ var AO = /*#__PURE__*/function () {
|
|
|
549
566
|
var _spwn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
550
567
|
var _ref11,
|
|
551
568
|
boot,
|
|
552
|
-
_ref11$module,
|
|
553
569
|
module,
|
|
554
570
|
_ref11$scheduler,
|
|
555
571
|
scheduler,
|
|
@@ -562,13 +578,15 @@ var AO = /*#__PURE__*/function () {
|
|
|
562
578
|
err,
|
|
563
579
|
_yield$this$ar$checkW,
|
|
564
580
|
pid,
|
|
581
|
+
_yield$this$hb$spawnL,
|
|
582
|
+
_module3,
|
|
565
583
|
_tags,
|
|
566
584
|
p,
|
|
567
585
|
_args8 = arguments;
|
|
568
586
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
569
587
|
while (1) switch (_context8.prev = _context8.next) {
|
|
570
588
|
case 0:
|
|
571
|
-
_ref11 = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {}, boot = _ref11.boot,
|
|
589
|
+
_ref11 = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {}, boot = _ref11.boot, module = _ref11.module, _ref11$scheduler = _ref11.scheduler, scheduler = _ref11$scheduler === void 0 ? this.scheduler : _ref11$scheduler, memory = _ref11.memory, jwk = _ref11.jwk, _ref11$tags = _ref11.tags, tags = _ref11$tags === void 0 ? {} : _ref11$tags, data = _ref11.data, auth = _ref11.auth;
|
|
572
590
|
err = null;
|
|
573
591
|
_context8.next = 4;
|
|
574
592
|
return this.ar.checkWallet({
|
|
@@ -590,9 +608,33 @@ var AO = /*#__PURE__*/function () {
|
|
|
590
608
|
_context8.prev = 10;
|
|
591
609
|
if (boot) tags["On-Boot"] = boot;
|
|
592
610
|
if (auth) tags.Authority = auth;
|
|
611
|
+
if (!this.hb) {
|
|
612
|
+
_context8.next = 23;
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
;
|
|
616
|
+
_context8.next = 17;
|
|
617
|
+
return this.hb.spawnLegacy({
|
|
618
|
+
module: module,
|
|
619
|
+
tags: tags,
|
|
620
|
+
data: data
|
|
621
|
+
});
|
|
622
|
+
case 17:
|
|
623
|
+
_yield$this$hb$spawnL = _context8.sent;
|
|
624
|
+
pid = _yield$this$hb$spawnL.pid;
|
|
625
|
+
_context8.next = 21;
|
|
626
|
+
return this.hb.computeLegacy({
|
|
627
|
+
pid: pid,
|
|
628
|
+
slot: 0
|
|
629
|
+
});
|
|
630
|
+
case 21:
|
|
631
|
+
_context8.next = 29;
|
|
632
|
+
break;
|
|
633
|
+
case 23:
|
|
634
|
+
(_module3 = module) !== null && _module3 !== void 0 ? _module3 : module = this.module;
|
|
593
635
|
if (!tags.Authority && this.authority) tags.Authority = this.authority;
|
|
594
636
|
_tags = (0, _utils.buildTags)(null, tags);
|
|
595
|
-
_context8.next =
|
|
637
|
+
_context8.next = 28;
|
|
596
638
|
return this.spawn({
|
|
597
639
|
variant: this.variant,
|
|
598
640
|
memory: memory,
|
|
@@ -602,26 +644,27 @@ var AO = /*#__PURE__*/function () {
|
|
|
602
644
|
tags: _tags,
|
|
603
645
|
data: (0, _utils.jsonToStr)(data)
|
|
604
646
|
});
|
|
605
|
-
case
|
|
647
|
+
case 28:
|
|
606
648
|
pid = _context8.sent;
|
|
607
|
-
|
|
649
|
+
case 29:
|
|
650
|
+
_context8.next = 34;
|
|
608
651
|
break;
|
|
609
|
-
case
|
|
610
|
-
_context8.prev =
|
|
652
|
+
case 31:
|
|
653
|
+
_context8.prev = 31;
|
|
611
654
|
_context8.t0 = _context8["catch"](10);
|
|
612
655
|
err = _context8.t0;
|
|
613
|
-
case
|
|
656
|
+
case 34:
|
|
614
657
|
p = pid ? this.p(pid) : null;
|
|
615
658
|
return _context8.abrupt("return", {
|
|
616
659
|
err: err,
|
|
617
660
|
pid: pid,
|
|
618
661
|
p: p
|
|
619
662
|
});
|
|
620
|
-
case
|
|
663
|
+
case 36:
|
|
621
664
|
case "end":
|
|
622
665
|
return _context8.stop();
|
|
623
666
|
}
|
|
624
|
-
}, _callee8, this, [[10,
|
|
667
|
+
}, _callee8, this, [[10, 31]]);
|
|
625
668
|
}));
|
|
626
669
|
function spwn() {
|
|
627
670
|
return _spwn.apply(this, arguments);
|
|
@@ -810,13 +853,42 @@ var AO = /*#__PURE__*/function () {
|
|
|
810
853
|
from: _context11.t1
|
|
811
854
|
};
|
|
812
855
|
_txs = [_context11.t2];
|
|
813
|
-
|
|
856
|
+
if (!this.hb) {
|
|
857
|
+
_context11.next = 29;
|
|
858
|
+
break;
|
|
859
|
+
}
|
|
860
|
+
_context11.next = 18;
|
|
861
|
+
return this.hb.computeLegacy({
|
|
862
|
+
pid: pid,
|
|
863
|
+
slot: mid
|
|
864
|
+
});
|
|
865
|
+
case 18:
|
|
866
|
+
res = _context11.sent;
|
|
867
|
+
_context11.prev = 19;
|
|
868
|
+
_context11.next = 22;
|
|
869
|
+
return this.hb.get({
|
|
870
|
+
path: "/".concat(pid, "/push"),
|
|
871
|
+
slot: mid
|
|
872
|
+
});
|
|
873
|
+
case 22:
|
|
874
|
+
_context11.next = 27;
|
|
875
|
+
break;
|
|
876
|
+
case 24:
|
|
877
|
+
_context11.prev = 24;
|
|
878
|
+
_context11.t3 = _context11["catch"](19);
|
|
879
|
+
console.log(_context11.t3);
|
|
880
|
+
case 27:
|
|
881
|
+
_context11.next = 32;
|
|
882
|
+
break;
|
|
883
|
+
case 29:
|
|
884
|
+
_context11.next = 31;
|
|
814
885
|
return this.result({
|
|
815
886
|
process: pid,
|
|
816
887
|
message: mid
|
|
817
888
|
});
|
|
818
|
-
case
|
|
889
|
+
case 31:
|
|
819
890
|
res = _context11.sent;
|
|
891
|
+
case 32:
|
|
820
892
|
hash = getHash(res);
|
|
821
893
|
_txmap = _defineProperty({}, mid, {
|
|
822
894
|
checked: false,
|
|
@@ -827,131 +899,131 @@ var AO = /*#__PURE__*/function () {
|
|
|
827
899
|
res: res
|
|
828
900
|
});
|
|
829
901
|
checked = false;
|
|
830
|
-
case
|
|
902
|
+
case 36:
|
|
831
903
|
_iterator5 = _createForOfIteratorHelper(_txs);
|
|
832
|
-
_context11.prev =
|
|
904
|
+
_context11.prev = 37;
|
|
833
905
|
_iterator5.s();
|
|
834
|
-
case
|
|
906
|
+
case 39:
|
|
835
907
|
if ((_step5 = _iterator5.n()).done) {
|
|
836
|
-
_context11.next =
|
|
908
|
+
_context11.next = 53;
|
|
837
909
|
break;
|
|
838
910
|
}
|
|
839
911
|
v = _step5.value;
|
|
840
912
|
if (_txmap[v.id].checked) {
|
|
841
|
-
_context11.next =
|
|
913
|
+
_context11.next = 51;
|
|
842
914
|
break;
|
|
843
915
|
}
|
|
844
916
|
_txmap[v.id].checked = true;
|
|
845
917
|
if (!(0, _ramda.isNil)(_txmap[v.id].res)) {
|
|
846
|
-
_context11.next =
|
|
918
|
+
_context11.next = 48;
|
|
847
919
|
break;
|
|
848
920
|
}
|
|
849
|
-
_context11.next =
|
|
921
|
+
_context11.next = 46;
|
|
850
922
|
return this.result({
|
|
851
923
|
process: pid,
|
|
852
924
|
message: v.id
|
|
853
925
|
});
|
|
854
|
-
case
|
|
926
|
+
case 46:
|
|
855
927
|
_res = _context11.sent;
|
|
856
928
|
_txmap[v.id].res = _res;
|
|
857
|
-
case
|
|
929
|
+
case 48:
|
|
858
930
|
if (!(0, _ramda.isNil)(check) && check.length > 0) {
|
|
859
931
|
checked = (0, _utils.allChecked)(check, _txmap[v.id].res, v.from);
|
|
860
932
|
} else {
|
|
861
933
|
checked = true;
|
|
862
934
|
}
|
|
863
935
|
if (!checked) {
|
|
864
|
-
_context11.next =
|
|
936
|
+
_context11.next = 51;
|
|
865
937
|
break;
|
|
866
938
|
}
|
|
867
|
-
return _context11.abrupt("break",
|
|
868
|
-
case
|
|
869
|
-
_context11.next =
|
|
939
|
+
return _context11.abrupt("break", 53);
|
|
940
|
+
case 51:
|
|
941
|
+
_context11.next = 39;
|
|
870
942
|
break;
|
|
871
|
-
case
|
|
872
|
-
_context11.next =
|
|
943
|
+
case 53:
|
|
944
|
+
_context11.next = 58;
|
|
873
945
|
break;
|
|
874
|
-
case
|
|
875
|
-
_context11.prev =
|
|
876
|
-
_context11.
|
|
877
|
-
_iterator5.e(_context11.
|
|
878
|
-
case
|
|
879
|
-
_context11.prev =
|
|
946
|
+
case 55:
|
|
947
|
+
_context11.prev = 55;
|
|
948
|
+
_context11.t4 = _context11["catch"](37);
|
|
949
|
+
_iterator5.e(_context11.t4);
|
|
950
|
+
case 58:
|
|
951
|
+
_context11.prev = 58;
|
|
880
952
|
_iterator5.f();
|
|
881
|
-
return _context11.finish(
|
|
882
|
-
case
|
|
953
|
+
return _context11.finish(58);
|
|
954
|
+
case 61:
|
|
883
955
|
if (!checked) {
|
|
884
|
-
_context11.next =
|
|
956
|
+
_context11.next = 63;
|
|
885
957
|
break;
|
|
886
958
|
}
|
|
887
|
-
return _context11.abrupt("break",
|
|
888
|
-
case
|
|
889
|
-
_context11.next =
|
|
959
|
+
return _context11.abrupt("break", 68);
|
|
960
|
+
case 63:
|
|
961
|
+
_context11.next = 65;
|
|
890
962
|
return (0, _utils.wait)(1000);
|
|
891
|
-
case
|
|
892
|
-
_context11.next =
|
|
963
|
+
case 65:
|
|
964
|
+
_context11.next = 67;
|
|
893
965
|
return getNewTxs(pid, _txs, _txmap);
|
|
894
|
-
case
|
|
966
|
+
case 67:
|
|
895
967
|
if (Date.now() - start < timeout) {
|
|
896
|
-
_context11.next =
|
|
968
|
+
_context11.next = 36;
|
|
897
969
|
break;
|
|
898
970
|
}
|
|
899
|
-
case
|
|
971
|
+
case 68:
|
|
900
972
|
if (checked) {
|
|
901
|
-
_context11.next =
|
|
973
|
+
_context11.next = 72;
|
|
902
974
|
break;
|
|
903
975
|
}
|
|
904
976
|
err = "something went wrong!";
|
|
905
|
-
_context11.next =
|
|
977
|
+
_context11.next = 96;
|
|
906
978
|
break;
|
|
907
|
-
case
|
|
908
|
-
_context11.
|
|
909
|
-
_context11.
|
|
910
|
-
_context11.next =
|
|
979
|
+
case 72:
|
|
980
|
+
_context11.t5 = _utils.mergeOut;
|
|
981
|
+
_context11.t6 = out;
|
|
982
|
+
_context11.next = 76;
|
|
911
983
|
return checkOut(get, _txs, _txmap, out);
|
|
912
|
-
case
|
|
913
|
-
_context11.
|
|
914
|
-
_context11.
|
|
915
|
-
out = (0, _context11.
|
|
984
|
+
case 76:
|
|
985
|
+
_context11.t7 = _context11.sent;
|
|
986
|
+
_context11.t8 = get;
|
|
987
|
+
out = (0, _context11.t5)(_context11.t6, _context11.t7, _context11.t8);
|
|
916
988
|
if (!(!(0, _utils.isOutComplete)(out, get) && !(0, _ramda.isNil)(get))) {
|
|
917
|
-
_context11.next =
|
|
989
|
+
_context11.next = 96;
|
|
918
990
|
break;
|
|
919
991
|
}
|
|
920
|
-
case
|
|
992
|
+
case 80:
|
|
921
993
|
if (!(Date.now() - start < timeout)) {
|
|
922
|
-
_context11.next =
|
|
994
|
+
_context11.next = 96;
|
|
923
995
|
break;
|
|
924
996
|
}
|
|
925
|
-
_context11.next =
|
|
997
|
+
_context11.next = 83;
|
|
926
998
|
return getNewTxs(pid, _txs, _txmap);
|
|
927
|
-
case
|
|
928
|
-
_context11.
|
|
929
|
-
_context11.
|
|
930
|
-
_context11.next =
|
|
999
|
+
case 83:
|
|
1000
|
+
_context11.t9 = _utils.mergeOut;
|
|
1001
|
+
_context11.t10 = out;
|
|
1002
|
+
_context11.next = 87;
|
|
931
1003
|
return checkOut(get, _txs, _txmap, out);
|
|
932
|
-
case
|
|
933
|
-
_context11.
|
|
934
|
-
_context11.
|
|
935
|
-
out = (0, _context11.
|
|
1004
|
+
case 87:
|
|
1005
|
+
_context11.t11 = _context11.sent;
|
|
1006
|
+
_context11.t12 = get;
|
|
1007
|
+
out = (0, _context11.t9)(_context11.t10, _context11.t11, _context11.t12);
|
|
936
1008
|
if (!(0, _utils.isOutComplete)(out, get)) {
|
|
937
|
-
_context11.next =
|
|
1009
|
+
_context11.next = 92;
|
|
938
1010
|
break;
|
|
939
1011
|
}
|
|
940
|
-
return _context11.abrupt("break",
|
|
941
|
-
case
|
|
942
|
-
_context11.next =
|
|
1012
|
+
return _context11.abrupt("break", 96);
|
|
1013
|
+
case 92:
|
|
1014
|
+
_context11.next = 94;
|
|
943
1015
|
return (0, _utils.wait)(1000);
|
|
944
|
-
case
|
|
945
|
-
_context11.next =
|
|
1016
|
+
case 94:
|
|
1017
|
+
_context11.next = 80;
|
|
946
1018
|
break;
|
|
947
|
-
case
|
|
948
|
-
_context11.next =
|
|
1019
|
+
case 96:
|
|
1020
|
+
_context11.next = 101;
|
|
949
1021
|
break;
|
|
950
|
-
case
|
|
951
|
-
_context11.prev =
|
|
952
|
-
_context11.
|
|
953
|
-
err = _context11.
|
|
954
|
-
case
|
|
1022
|
+
case 98:
|
|
1023
|
+
_context11.prev = 98;
|
|
1024
|
+
_context11.t13 = _context11["catch"](7);
|
|
1025
|
+
err = _context11.t13;
|
|
1026
|
+
case 101:
|
|
955
1027
|
return _context11.abrupt("return", {
|
|
956
1028
|
mid: mid,
|
|
957
1029
|
res: res,
|
|
@@ -959,11 +1031,11 @@ var AO = /*#__PURE__*/function () {
|
|
|
959
1031
|
out: out,
|
|
960
1032
|
results: results
|
|
961
1033
|
});
|
|
962
|
-
case
|
|
1034
|
+
case 102:
|
|
963
1035
|
case "end":
|
|
964
1036
|
return _context11.stop();
|
|
965
1037
|
}
|
|
966
|
-
}, _callee11, this, [[7,
|
|
1038
|
+
}, _callee11, this, [[7, 98], [19, 24], [37, 55, 58, 61]]);
|
|
967
1039
|
}));
|
|
968
1040
|
function res(_x7) {
|
|
969
1041
|
return _res2.apply(this, arguments);
|
|
@@ -974,7 +1046,7 @@ var AO = /*#__PURE__*/function () {
|
|
|
974
1046
|
key: "msg",
|
|
975
1047
|
value: function () {
|
|
976
1048
|
var _msg = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(_ref15) {
|
|
977
|
-
var pid, jwk, data, _ref15$act, act, _ref15$tags, tags, _ref15$check, check, get, _ref15$timeout, timeout, _ref15$mode, mode, _ref15$limit, limit, err, _yield$this$ar$checkW2, _tags,
|
|
1049
|
+
var pid, jwk, data, _ref15$act, act, _ref15$tags, tags, _ref15$check, check, get, _ref15$timeout, timeout, _ref15$mode, mode, _ref15$limit, limit, err, _yield$this$ar$checkW2, _yield$this$hb$schedu, mid, _tags, _mid;
|
|
978
1050
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
979
1051
|
while (1) switch (_context12.prev = _context12.next) {
|
|
980
1052
|
case 0:
|
|
@@ -995,8 +1067,36 @@ var AO = /*#__PURE__*/function () {
|
|
|
995
1067
|
err: err
|
|
996
1068
|
});
|
|
997
1069
|
case 8:
|
|
998
|
-
|
|
1070
|
+
if (!this.hb) {
|
|
1071
|
+
_context12.next = 18;
|
|
1072
|
+
break;
|
|
1073
|
+
}
|
|
999
1074
|
_context12.next = 11;
|
|
1075
|
+
return this.hb.scheduleLegacy({
|
|
1076
|
+
pid: pid,
|
|
1077
|
+
tags: tags !== null && tags !== void 0 ? tags : {},
|
|
1078
|
+
action: act,
|
|
1079
|
+
data: data
|
|
1080
|
+
});
|
|
1081
|
+
case 11:
|
|
1082
|
+
_yield$this$hb$schedu = _context12.sent;
|
|
1083
|
+
mid = _yield$this$hb$schedu.slot;
|
|
1084
|
+
_context12.next = 15;
|
|
1085
|
+
return this.res({
|
|
1086
|
+
pid: pid,
|
|
1087
|
+
mid: mid,
|
|
1088
|
+
jwk: jwk,
|
|
1089
|
+
check: check,
|
|
1090
|
+
get: get,
|
|
1091
|
+
timeout: timeout,
|
|
1092
|
+
mode: mode,
|
|
1093
|
+
limit: limit
|
|
1094
|
+
});
|
|
1095
|
+
case 15:
|
|
1096
|
+
return _context12.abrupt("return", _context12.sent);
|
|
1097
|
+
case 18:
|
|
1098
|
+
_tags = (0, _utils.buildTags)(act, tags);
|
|
1099
|
+
_context12.next = 21;
|
|
1000
1100
|
return this.message({
|
|
1001
1101
|
variant: this.variant,
|
|
1002
1102
|
process: pid,
|
|
@@ -1004,12 +1104,12 @@ var AO = /*#__PURE__*/function () {
|
|
|
1004
1104
|
tags: _tags,
|
|
1005
1105
|
data: (0, _utils.jsonToStr)(data)
|
|
1006
1106
|
});
|
|
1007
|
-
case
|
|
1008
|
-
|
|
1009
|
-
_context12.next =
|
|
1107
|
+
case 21:
|
|
1108
|
+
_mid = _context12.sent;
|
|
1109
|
+
_context12.next = 24;
|
|
1010
1110
|
return this.res({
|
|
1011
1111
|
pid: pid,
|
|
1012
|
-
mid:
|
|
1112
|
+
mid: _mid,
|
|
1013
1113
|
jwk: jwk,
|
|
1014
1114
|
check: check,
|
|
1015
1115
|
get: get,
|
|
@@ -1017,9 +1117,9 @@ var AO = /*#__PURE__*/function () {
|
|
|
1017
1117
|
mode: mode,
|
|
1018
1118
|
limit: limit
|
|
1019
1119
|
});
|
|
1020
|
-
case
|
|
1120
|
+
case 24:
|
|
1021
1121
|
return _context12.abrupt("return", _context12.sent);
|
|
1022
|
-
case
|
|
1122
|
+
case 25:
|
|
1023
1123
|
case "end":
|
|
1024
1124
|
return _context12.stop();
|
|
1025
1125
|
}
|
|
@@ -1107,7 +1207,7 @@ var AO = /*#__PURE__*/function () {
|
|
|
1107
1207
|
key: "dry",
|
|
1108
1208
|
value: function () {
|
|
1109
1209
|
var _dry = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(_ref17) {
|
|
1110
|
-
var pid, jwk, data, _ref17$act, act, _ref17$tags, tags, _ref17$check, check, get, err, _yield$this$ar$checkW4, res, out, _tags,
|
|
1210
|
+
var pid, jwk, data, _ref17$act, act, _ref17$tags, tags, _ref17$check, check, get, err, _yield$this$ar$checkW4, res, out, _tags, checks;
|
|
1111
1211
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
1112
1212
|
while (1) switch (_context14.prev = _context14.next) {
|
|
1113
1213
|
case 0:
|
|
@@ -1132,37 +1232,53 @@ var AO = /*#__PURE__*/function () {
|
|
|
1132
1232
|
res = null, out = null;
|
|
1133
1233
|
_tags = (0, _utils.buildTags)(act, tags);
|
|
1134
1234
|
_context14.prev = 11;
|
|
1135
|
-
|
|
1235
|
+
if (!this.hb) {
|
|
1236
|
+
_context14.next = 18;
|
|
1237
|
+
break;
|
|
1238
|
+
}
|
|
1239
|
+
_context14.next = 15;
|
|
1240
|
+
return this.hb.dryrun({
|
|
1241
|
+
action: act,
|
|
1242
|
+
pid: pid,
|
|
1243
|
+
tags: tags,
|
|
1244
|
+
data: (0, _utils.jsonToStr)(data)
|
|
1245
|
+
});
|
|
1246
|
+
case 15:
|
|
1247
|
+
res = _context14.sent;
|
|
1248
|
+
_context14.next = 21;
|
|
1249
|
+
break;
|
|
1250
|
+
case 18:
|
|
1251
|
+
_context14.next = 20;
|
|
1136
1252
|
return this.dryrun({
|
|
1137
1253
|
process: pid,
|
|
1138
1254
|
signer: this.toSigner(jwk),
|
|
1139
1255
|
tags: _tags,
|
|
1140
1256
|
data: (0, _utils.jsonToStr)(data)
|
|
1141
1257
|
});
|
|
1142
|
-
case
|
|
1143
|
-
|
|
1144
|
-
|
|
1258
|
+
case 20:
|
|
1259
|
+
res = _context14.sent;
|
|
1260
|
+
case 21:
|
|
1145
1261
|
checks = [];
|
|
1146
1262
|
if (!(0, _ramda.is)(Array, check)) check = [check];
|
|
1147
1263
|
if (!(0, _utils.allChecked)(check, res)) err = "something went wrong";
|
|
1148
1264
|
if (!err && !(0, _ramda.isNil)(get)) out = (0, _utils.getTagVal)(get, res);
|
|
1149
|
-
_context14.next =
|
|
1265
|
+
_context14.next = 30;
|
|
1150
1266
|
break;
|
|
1151
|
-
case
|
|
1152
|
-
_context14.prev =
|
|
1267
|
+
case 27:
|
|
1268
|
+
_context14.prev = 27;
|
|
1153
1269
|
_context14.t0 = _context14["catch"](11);
|
|
1154
1270
|
err = _context14.t0;
|
|
1155
|
-
case
|
|
1271
|
+
case 30:
|
|
1156
1272
|
return _context14.abrupt("return", {
|
|
1157
1273
|
res: res,
|
|
1158
1274
|
err: err,
|
|
1159
1275
|
out: out
|
|
1160
1276
|
});
|
|
1161
|
-
case
|
|
1277
|
+
case 31:
|
|
1162
1278
|
case "end":
|
|
1163
1279
|
return _context14.stop();
|
|
1164
1280
|
}
|
|
1165
|
-
}, _callee14, this, [[11,
|
|
1281
|
+
}, _callee14, this, [[11, 27]]);
|
|
1166
1282
|
}));
|
|
1167
1283
|
function dry(_x17) {
|
|
1168
1284
|
return _dry.apply(this, arguments);
|
|
@@ -1185,21 +1301,38 @@ var AO = /*#__PURE__*/function () {
|
|
|
1185
1301
|
res = null;
|
|
1186
1302
|
_context16.prev = 5;
|
|
1187
1303
|
sort = asc ? "ASC" : "DESC";
|
|
1188
|
-
|
|
1304
|
+
if (!this.hb) {
|
|
1305
|
+
_context16.next = 13;
|
|
1306
|
+
break;
|
|
1307
|
+
}
|
|
1308
|
+
_context16.next = 10;
|
|
1309
|
+
return this.hb.results({
|
|
1310
|
+
process: pid,
|
|
1311
|
+
limit: limit,
|
|
1312
|
+
sort: sort,
|
|
1313
|
+
from: cursor
|
|
1314
|
+
});
|
|
1315
|
+
case 10:
|
|
1316
|
+
res = _context16.sent;
|
|
1317
|
+
_context16.next = 16;
|
|
1318
|
+
break;
|
|
1319
|
+
case 13:
|
|
1320
|
+
_context16.next = 15;
|
|
1189
1321
|
return this.results({
|
|
1190
1322
|
process: pid,
|
|
1191
1323
|
limit: limit,
|
|
1192
1324
|
sort: sort,
|
|
1193
|
-
|
|
1325
|
+
from: cursor
|
|
1194
1326
|
});
|
|
1195
|
-
case
|
|
1327
|
+
case 15:
|
|
1196
1328
|
res = _context16.sent;
|
|
1329
|
+
case 16:
|
|
1197
1330
|
if (res.edges) {
|
|
1198
|
-
_context16.next =
|
|
1331
|
+
_context16.next = 18;
|
|
1199
1332
|
break;
|
|
1200
1333
|
}
|
|
1201
1334
|
return _context16.abrupt("return", null);
|
|
1202
|
-
case
|
|
1335
|
+
case 18:
|
|
1203
1336
|
msgs = (0, _ramda.map)(function (v) {
|
|
1204
1337
|
return _objectSpread({
|
|
1205
1338
|
cursor: v.cursor
|
|
@@ -1216,7 +1349,7 @@ var AO = /*#__PURE__*/function () {
|
|
|
1216
1349
|
process: pid,
|
|
1217
1350
|
limit: limit,
|
|
1218
1351
|
sort: sort,
|
|
1219
|
-
|
|
1352
|
+
from: (0, _ramda.last)(res.edges).cursor
|
|
1220
1353
|
});
|
|
1221
1354
|
case 2:
|
|
1222
1355
|
return _context15.abrupt("return", _context15.sent);
|
|
@@ -1231,23 +1364,23 @@ var AO = /*#__PURE__*/function () {
|
|
|
1231
1364
|
};
|
|
1232
1365
|
}();
|
|
1233
1366
|
}
|
|
1234
|
-
_context16.next =
|
|
1367
|
+
_context16.next = 25;
|
|
1235
1368
|
break;
|
|
1236
|
-
case
|
|
1237
|
-
_context16.prev =
|
|
1369
|
+
case 22:
|
|
1370
|
+
_context16.prev = 22;
|
|
1238
1371
|
_context16.t0 = _context16["catch"](5);
|
|
1239
1372
|
err = _context16.t0;
|
|
1240
|
-
case
|
|
1373
|
+
case 25:
|
|
1241
1374
|
return _context16.abrupt("return", {
|
|
1242
1375
|
err: err,
|
|
1243
1376
|
out: msgs,
|
|
1244
1377
|
res: res
|
|
1245
1378
|
});
|
|
1246
|
-
case
|
|
1379
|
+
case 26:
|
|
1247
1380
|
case "end":
|
|
1248
1381
|
return _context16.stop();
|
|
1249
1382
|
}
|
|
1250
|
-
}, _callee16, this, [[5,
|
|
1383
|
+
}, _callee16, this, [[5, 22]]);
|
|
1251
1384
|
}));
|
|
1252
1385
|
function ress(_x18) {
|
|
1253
1386
|
return _ress.apply(this, arguments);
|
|
@@ -1751,7 +1884,7 @@ var getParams = function getParams(tags, opts) {
|
|
|
1751
1884
|
_tags = null;
|
|
1752
1885
|
}
|
|
1753
1886
|
if ((0, _ramda.isNil)(_opts)) _opts = {
|
|
1754
|
-
get:
|
|
1887
|
+
get: false
|
|
1755
1888
|
};else if ((0, _ramda.is)(Boolean, _opts) || (0, _ramda.is)(String, _opts)) _opts = {
|
|
1756
1889
|
get: _opts
|
|
1757
1890
|
};
|