wao 0.21.2 → 0.21.3
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/aoconnect-base.js +65 -68
- package/esm/aoconnect-base.js +7 -7
- package/package.json +1 -1
package/cjs/aoconnect-base.js
CHANGED
|
@@ -868,7 +868,7 @@ var _default = exports["default"] = function _default() {
|
|
|
868
868
|
_iterator3 = _createForOfIteratorHelper((_res$Messages = res.Messages) !== null && _res$Messages !== void 0 ? _res$Messages : []);
|
|
869
869
|
_context6.prev = 104;
|
|
870
870
|
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
|
871
|
-
var v, _t, _result, slot, fetchHB, info, _connect, request, _tags2, _yield$request,
|
|
871
|
+
var v, _t, _result, slot, fetchHB, info, _connect, request, _tags2, _yield$request, _res2, _data, _yield$fetch$then$Pro, _yield$fetch$then, sch, tar, procs, ao, _yield$mem$getTx$tags3, _yield$mem$getTx4, _tags3$Action, _v$Data, _tags3, pr, module, _yield$ao$msg, mid;
|
|
872
872
|
return _regeneratorRuntime().wrap(function _loop$(_context5) {
|
|
873
873
|
while (1) switch (_context5.prev = _context5.next) {
|
|
874
874
|
case 0:
|
|
@@ -891,12 +891,12 @@ var _default = exports["default"] = function _default() {
|
|
|
891
891
|
target: v.Target
|
|
892
892
|
});
|
|
893
893
|
case 6:
|
|
894
|
-
_context5.next =
|
|
894
|
+
_context5.next = 101;
|
|
895
895
|
break;
|
|
896
896
|
case 8:
|
|
897
897
|
_t = (0, _utils.tags)(v.Tags); // this behaviour is different from AOS (temporary hack for remote tests)
|
|
898
898
|
if (!_t.__HyperBEAM__) {
|
|
899
|
-
_context5.next =
|
|
899
|
+
_context5.next = 36;
|
|
900
900
|
break;
|
|
901
901
|
}
|
|
902
902
|
_result = null;
|
|
@@ -957,9 +957,9 @@ var _default = exports["default"] = function _default() {
|
|
|
957
957
|
params: "slot=".concat(slot)
|
|
958
958
|
});
|
|
959
959
|
case 25:
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
_result =
|
|
960
|
+
_res2 = _context5.sent;
|
|
961
|
+
_data = _res2.results.data;
|
|
962
|
+
_result = _data;
|
|
963
963
|
_context5.next = 33;
|
|
964
964
|
break;
|
|
965
965
|
case 30:
|
|
@@ -967,148 +967,145 @@ var _default = exports["default"] = function _default() {
|
|
|
967
967
|
_context5.t0 = _context5["catch"](12);
|
|
968
968
|
console.log(_context5.t0);
|
|
969
969
|
case 33:
|
|
970
|
-
if (
|
|
971
|
-
|
|
972
|
-
|
|
970
|
+
if (_result) {
|
|
971
|
+
/*
|
|
972
|
+
await message({
|
|
973
|
+
for: slot,
|
|
974
|
+
process: opt.process,
|
|
975
|
+
tags: buildTags({
|
|
976
|
+
"X-Reference": t.Reference,
|
|
977
|
+
}),
|
|
978
|
+
data: JSON.stringify(result),
|
|
979
|
+
signer: mu.signer,
|
|
980
|
+
from: v.Target,
|
|
981
|
+
target: opt.process,
|
|
982
|
+
})*/
|
|
973
983
|
}
|
|
974
|
-
_context5.next =
|
|
975
|
-
return message({
|
|
976
|
-
"for": slot,
|
|
977
|
-
process: opt.process,
|
|
978
|
-
tags: (0, _utils.buildTags)({
|
|
979
|
-
"X-Reference": _t.Reference
|
|
980
|
-
}),
|
|
981
|
-
data: JSON.stringify(_result),
|
|
982
|
-
signer: mu.signer,
|
|
983
|
-
from: v.Target,
|
|
984
|
-
target: opt.process
|
|
985
|
-
});
|
|
986
|
-
case 36:
|
|
987
|
-
_context5.next = 103;
|
|
984
|
+
_context5.next = 101;
|
|
988
985
|
break;
|
|
989
|
-
case
|
|
986
|
+
case 36:
|
|
990
987
|
if (!_t.__Scheduler__) {
|
|
991
|
-
_context5.next =
|
|
988
|
+
_context5.next = 99;
|
|
992
989
|
break;
|
|
993
990
|
}
|
|
994
991
|
sch = _t.__Scheduler__;
|
|
995
992
|
tar = v.Target;
|
|
996
|
-
_context5.next =
|
|
993
|
+
_context5.next = 41;
|
|
997
994
|
return fetch(sch).then(function (r) {
|
|
998
995
|
return r.json();
|
|
999
996
|
});
|
|
1000
|
-
case
|
|
997
|
+
case 41:
|
|
1001
998
|
_context5.t3 = _yield$fetch$then = _context5.sent;
|
|
1002
999
|
_context5.t2 = _context5.t3 === null;
|
|
1003
1000
|
if (_context5.t2) {
|
|
1004
|
-
_context5.next =
|
|
1001
|
+
_context5.next = 45;
|
|
1005
1002
|
break;
|
|
1006
1003
|
}
|
|
1007
1004
|
_context5.t2 = _yield$fetch$then === void 0;
|
|
1008
|
-
case
|
|
1005
|
+
case 45:
|
|
1009
1006
|
if (!_context5.t2) {
|
|
1010
|
-
_context5.next =
|
|
1007
|
+
_context5.next = 49;
|
|
1011
1008
|
break;
|
|
1012
1009
|
}
|
|
1013
1010
|
_context5.t4 = void 0;
|
|
1014
|
-
_context5.next =
|
|
1011
|
+
_context5.next = 50;
|
|
1015
1012
|
break;
|
|
1016
|
-
case
|
|
1013
|
+
case 49:
|
|
1017
1014
|
_context5.t4 = _yield$fetch$then.Processes;
|
|
1018
|
-
case
|
|
1015
|
+
case 50:
|
|
1019
1016
|
_context5.t5 = _yield$fetch$then$Pro = _context5.t4;
|
|
1020
1017
|
_context5.t1 = _context5.t5 !== null;
|
|
1021
1018
|
if (!_context5.t1) {
|
|
1022
|
-
_context5.next =
|
|
1019
|
+
_context5.next = 54;
|
|
1023
1020
|
break;
|
|
1024
1021
|
}
|
|
1025
1022
|
_context5.t1 = _yield$fetch$then$Pro !== void 0;
|
|
1026
|
-
case
|
|
1023
|
+
case 54:
|
|
1027
1024
|
if (!_context5.t1) {
|
|
1028
|
-
_context5.next =
|
|
1025
|
+
_context5.next = 58;
|
|
1029
1026
|
break;
|
|
1030
1027
|
}
|
|
1031
1028
|
_context5.t6 = _yield$fetch$then$Pro;
|
|
1032
|
-
_context5.next =
|
|
1029
|
+
_context5.next = 59;
|
|
1033
1030
|
break;
|
|
1034
|
-
case
|
|
1031
|
+
case 58:
|
|
1035
1032
|
_context5.t6 = [];
|
|
1036
|
-
case
|
|
1033
|
+
case 59:
|
|
1037
1034
|
procs = _context5.t6;
|
|
1038
|
-
_context5.next =
|
|
1035
|
+
_context5.next = 62;
|
|
1039
1036
|
return new _ao["default"]({
|
|
1040
1037
|
port: sch.split(":").pop() - 3
|
|
1041
1038
|
}).init(mu.jwk);
|
|
1042
|
-
case
|
|
1039
|
+
case 62:
|
|
1043
1040
|
ao = _context5.sent;
|
|
1044
|
-
_context5.prev =
|
|
1041
|
+
_context5.prev = 63;
|
|
1045
1042
|
_tags3 = _objectSpread(_objectSpread({}, _t), {}, {
|
|
1046
1043
|
"From-Process": opt.process,
|
|
1047
1044
|
"Pushed-For": id
|
|
1048
1045
|
});
|
|
1049
|
-
_context5.next =
|
|
1046
|
+
_context5.next = 67;
|
|
1050
1047
|
return mem.getTx(opt.process);
|
|
1051
|
-
case
|
|
1048
|
+
case 67:
|
|
1052
1049
|
_context5.t9 = _yield$mem$getTx4 = _context5.sent;
|
|
1053
1050
|
_context5.t8 = _context5.t9 === null;
|
|
1054
1051
|
if (_context5.t8) {
|
|
1055
|
-
_context5.next =
|
|
1052
|
+
_context5.next = 71;
|
|
1056
1053
|
break;
|
|
1057
1054
|
}
|
|
1058
1055
|
_context5.t8 = _yield$mem$getTx4 === void 0;
|
|
1059
|
-
case
|
|
1056
|
+
case 71:
|
|
1060
1057
|
if (!_context5.t8) {
|
|
1061
|
-
_context5.next =
|
|
1058
|
+
_context5.next = 75;
|
|
1062
1059
|
break;
|
|
1063
1060
|
}
|
|
1064
1061
|
_context5.t10 = void 0;
|
|
1065
|
-
_context5.next =
|
|
1062
|
+
_context5.next = 76;
|
|
1066
1063
|
break;
|
|
1067
|
-
case
|
|
1064
|
+
case 75:
|
|
1068
1065
|
_context5.t10 = _yield$mem$getTx4.tags;
|
|
1069
|
-
case
|
|
1066
|
+
case 76:
|
|
1070
1067
|
_context5.t11 = _yield$mem$getTx$tags3 = _context5.t10;
|
|
1071
1068
|
_context5.t7 = _context5.t11 !== null;
|
|
1072
1069
|
if (!_context5.t7) {
|
|
1073
|
-
_context5.next =
|
|
1070
|
+
_context5.next = 80;
|
|
1074
1071
|
break;
|
|
1075
1072
|
}
|
|
1076
1073
|
_context5.t7 = _yield$mem$getTx$tags3 !== void 0;
|
|
1077
|
-
case
|
|
1074
|
+
case 80:
|
|
1078
1075
|
if (!_context5.t7) {
|
|
1079
|
-
_context5.next =
|
|
1076
|
+
_context5.next = 84;
|
|
1080
1077
|
break;
|
|
1081
1078
|
}
|
|
1082
1079
|
_context5.t12 = _yield$mem$getTx$tags3;
|
|
1083
|
-
_context5.next =
|
|
1080
|
+
_context5.next = 85;
|
|
1084
1081
|
break;
|
|
1085
|
-
case
|
|
1082
|
+
case 84:
|
|
1086
1083
|
_context5.t12 = [];
|
|
1087
|
-
case
|
|
1084
|
+
case 85:
|
|
1088
1085
|
pr = _context5.t12;
|
|
1089
1086
|
module = (0, _utils.tags)(pr).Module;
|
|
1090
1087
|
if (module) _tags3["From-Module"] = module;
|
|
1091
|
-
_context5.next =
|
|
1088
|
+
_context5.next = 90;
|
|
1092
1089
|
return ao.msg({
|
|
1093
1090
|
act: (_tags3$Action = _tags3["Action"]) !== null && _tags3$Action !== void 0 ? _tags3$Action : null,
|
|
1094
1091
|
pid: tar,
|
|
1095
1092
|
tags: _tags3,
|
|
1096
1093
|
data: (_v$Data = v.Data) !== null && _v$Data !== void 0 ? _v$Data : ""
|
|
1097
1094
|
});
|
|
1098
|
-
case
|
|
1095
|
+
case 90:
|
|
1099
1096
|
_yield$ao$msg = _context5.sent;
|
|
1100
1097
|
mid = _yield$ao$msg.mid;
|
|
1101
|
-
_context5.next =
|
|
1098
|
+
_context5.next = 97;
|
|
1102
1099
|
break;
|
|
1103
|
-
case
|
|
1104
|
-
_context5.prev =
|
|
1105
|
-
_context5.t13 = _context5["catch"](
|
|
1100
|
+
case 94:
|
|
1101
|
+
_context5.prev = 94;
|
|
1102
|
+
_context5.t13 = _context5["catch"](63);
|
|
1106
1103
|
console.log(_context5.t13);
|
|
1107
|
-
case
|
|
1108
|
-
_context5.next =
|
|
1104
|
+
case 97:
|
|
1105
|
+
_context5.next = 101;
|
|
1109
1106
|
break;
|
|
1110
|
-
case
|
|
1111
|
-
_context5.next =
|
|
1107
|
+
case 99:
|
|
1108
|
+
_context5.next = 101;
|
|
1112
1109
|
return record({
|
|
1113
1110
|
"for": opt.message,
|
|
1114
1111
|
tags: v.Tags,
|
|
@@ -1117,11 +1114,11 @@ var _default = exports["default"] = function _default() {
|
|
|
1117
1114
|
from: opt.process,
|
|
1118
1115
|
target: v.Target
|
|
1119
1116
|
});
|
|
1120
|
-
case
|
|
1117
|
+
case 101:
|
|
1121
1118
|
case "end":
|
|
1122
1119
|
return _context5.stop();
|
|
1123
1120
|
}
|
|
1124
|
-
}, _loop, null, [[12, 30], [
|
|
1121
|
+
}, _loop, null, [[12, 30], [63, 94]]);
|
|
1125
1122
|
});
|
|
1126
1123
|
_iterator3.s();
|
|
1127
1124
|
case 107:
|
package/esm/aoconnect-base.js
CHANGED
|
@@ -405,18 +405,18 @@ export default ({ AR, scheduler, mu, su, cu, acc, AoLoader, ArMem } = {}) => {
|
|
|
405
405
|
scheduler: info.address,
|
|
406
406
|
}
|
|
407
407
|
;({ slot } = await request(_tags))
|
|
408
|
-
const {
|
|
409
|
-
results: {
|
|
410
|
-
json: { body },
|
|
411
|
-
},
|
|
412
|
-
} = await fetchHB(`/${v.Target}~process@1.0/compute`, {
|
|
408
|
+
const res = await fetchHB(`/${v.Target}~process@1.0/compute`, {
|
|
413
409
|
params: `slot=${slot}`,
|
|
414
410
|
})
|
|
415
|
-
|
|
411
|
+
const {
|
|
412
|
+
results: { data },
|
|
413
|
+
} = res
|
|
414
|
+
result = data
|
|
416
415
|
} catch (e) {
|
|
417
416
|
console.log(e)
|
|
418
417
|
}
|
|
419
418
|
if (result) {
|
|
419
|
+
/*
|
|
420
420
|
await message({
|
|
421
421
|
for: slot,
|
|
422
422
|
process: opt.process,
|
|
@@ -427,7 +427,7 @@ export default ({ AR, scheduler, mu, su, cu, acc, AoLoader, ArMem } = {}) => {
|
|
|
427
427
|
signer: mu.signer,
|
|
428
428
|
from: v.Target,
|
|
429
429
|
target: opt.process,
|
|
430
|
-
})
|
|
430
|
+
})*/
|
|
431
431
|
}
|
|
432
432
|
} else if (t.__Scheduler__) {
|
|
433
433
|
const sch = t.__Scheduler__
|