wao 0.18.6 → 0.18.8
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 +348 -232
- package/esm/aoconnect-base.js +39 -0
- package/package.json +1 -1
package/cjs/aoconnect-base.js
CHANGED
|
@@ -866,7 +866,7 @@ var _default = exports["default"] = function _default() {
|
|
|
866
866
|
_iterator3.s();
|
|
867
867
|
case 104:
|
|
868
868
|
if ((_step3 = _iterator3.n()).done) {
|
|
869
|
-
_context4.next =
|
|
869
|
+
_context4.next = 117;
|
|
870
870
|
break;
|
|
871
871
|
}
|
|
872
872
|
v = _step3.value;
|
|
@@ -874,7 +874,7 @@ var _default = exports["default"] = function _default() {
|
|
|
874
874
|
return mem.get("env", v.Target);
|
|
875
875
|
case 108:
|
|
876
876
|
if (!_context4.sent) {
|
|
877
|
-
_context4.next =
|
|
877
|
+
_context4.next = 113;
|
|
878
878
|
break;
|
|
879
879
|
}
|
|
880
880
|
_context4.next = 111;
|
|
@@ -884,34 +884,48 @@ var _default = exports["default"] = function _default() {
|
|
|
884
884
|
tags: v.Tags,
|
|
885
885
|
data: v.Data,
|
|
886
886
|
signer: mu.signer,
|
|
887
|
-
from: opt.process
|
|
887
|
+
from: opt.process,
|
|
888
|
+
target: v.Target
|
|
888
889
|
});
|
|
889
890
|
case 111:
|
|
890
|
-
_context4.next =
|
|
891
|
+
_context4.next = 115;
|
|
891
892
|
break;
|
|
892
893
|
case 113:
|
|
893
|
-
_context4.next =
|
|
894
|
-
|
|
894
|
+
_context4.next = 115;
|
|
895
|
+
return record({
|
|
896
|
+
"for": opt.message,
|
|
897
|
+
tags: v.Tags,
|
|
898
|
+
data: v.Data,
|
|
899
|
+
signer: mu.signer,
|
|
900
|
+
from: opt.process,
|
|
901
|
+
target: v.Target
|
|
902
|
+
});
|
|
895
903
|
case 115:
|
|
896
|
-
_context4.
|
|
904
|
+
_context4.next = 104;
|
|
905
|
+
break;
|
|
906
|
+
case 117:
|
|
907
|
+
_context4.next = 122;
|
|
908
|
+
break;
|
|
909
|
+
case 119:
|
|
910
|
+
_context4.prev = 119;
|
|
897
911
|
_context4.t22 = _context4["catch"](102);
|
|
898
912
|
_iterator3.e(_context4.t22);
|
|
899
|
-
case
|
|
900
|
-
_context4.prev =
|
|
913
|
+
case 122:
|
|
914
|
+
_context4.prev = 122;
|
|
901
915
|
_iterator3.f();
|
|
902
|
-
return _context4.finish(
|
|
903
|
-
case
|
|
916
|
+
return _context4.finish(122);
|
|
917
|
+
case 125:
|
|
904
918
|
_iterator4 = _createForOfIteratorHelper((_res$Spawns = res.Spawns) !== null && _res$Spawns !== void 0 ? _res$Spawns : []);
|
|
905
|
-
_context4.prev =
|
|
919
|
+
_context4.prev = 126;
|
|
906
920
|
_iterator4.s();
|
|
907
|
-
case
|
|
921
|
+
case 128:
|
|
908
922
|
if ((_step4 = _iterator4.n()).done) {
|
|
909
|
-
_context4.next =
|
|
923
|
+
_context4.next = 135;
|
|
910
924
|
break;
|
|
911
925
|
}
|
|
912
926
|
_v = _step4.value;
|
|
913
927
|
__tags = (0, _utils.tags)(_v.Tags);
|
|
914
|
-
_context4.next =
|
|
928
|
+
_context4.next = 133;
|
|
915
929
|
return spawn({
|
|
916
930
|
"for": opt.message,
|
|
917
931
|
module: __tags.Module,
|
|
@@ -921,87 +935,87 @@ var _default = exports["default"] = function _default() {
|
|
|
921
935
|
from: __tags["From-Process"],
|
|
922
936
|
signer: mu.signer
|
|
923
937
|
});
|
|
924
|
-
case
|
|
925
|
-
_context4.next =
|
|
938
|
+
case 133:
|
|
939
|
+
_context4.next = 128;
|
|
926
940
|
break;
|
|
927
|
-
case
|
|
928
|
-
_context4.next =
|
|
941
|
+
case 135:
|
|
942
|
+
_context4.next = 140;
|
|
929
943
|
break;
|
|
930
|
-
case
|
|
931
|
-
_context4.prev =
|
|
932
|
-
_context4.t23 = _context4["catch"](
|
|
944
|
+
case 137:
|
|
945
|
+
_context4.prev = 137;
|
|
946
|
+
_context4.t23 = _context4["catch"](126);
|
|
933
947
|
_iterator4.e(_context4.t23);
|
|
934
|
-
case
|
|
935
|
-
_context4.prev =
|
|
948
|
+
case 140:
|
|
949
|
+
_context4.prev = 140;
|
|
936
950
|
_iterator4.f();
|
|
937
|
-
return _context4.finish(
|
|
938
|
-
case
|
|
951
|
+
return _context4.finish(140);
|
|
952
|
+
case 143:
|
|
939
953
|
_iterator5 = _createForOfIteratorHelper((_res$Assignments = res.Assignments) !== null && _res$Assignments !== void 0 ? _res$Assignments : []);
|
|
940
|
-
_context4.prev =
|
|
954
|
+
_context4.prev = 144;
|
|
941
955
|
_iterator5.s();
|
|
942
|
-
case
|
|
956
|
+
case 146:
|
|
943
957
|
if ((_step5 = _iterator5.n()).done) {
|
|
944
|
-
_context4.next =
|
|
958
|
+
_context4.next = 167;
|
|
945
959
|
break;
|
|
946
960
|
}
|
|
947
961
|
_v2 = _step5.value;
|
|
948
962
|
_iterator6 = _createForOfIteratorHelper(_v2.Processes);
|
|
949
|
-
_context4.prev =
|
|
963
|
+
_context4.prev = 149;
|
|
950
964
|
_iterator6.s();
|
|
951
|
-
case
|
|
965
|
+
case 151:
|
|
952
966
|
if ((_step6 = _iterator6.n()).done) {
|
|
953
|
-
_context4.next =
|
|
967
|
+
_context4.next = 157;
|
|
954
968
|
break;
|
|
955
969
|
}
|
|
956
970
|
v2 = _step6.value;
|
|
957
|
-
_context4.next =
|
|
971
|
+
_context4.next = 155;
|
|
958
972
|
return _assign({
|
|
959
973
|
message: _v2.Message,
|
|
960
974
|
process: v2,
|
|
961
975
|
from: opt.process,
|
|
962
976
|
signer: mu.signer
|
|
963
977
|
});
|
|
964
|
-
case
|
|
965
|
-
_context4.next =
|
|
978
|
+
case 155:
|
|
979
|
+
_context4.next = 151;
|
|
966
980
|
break;
|
|
967
|
-
case
|
|
968
|
-
_context4.next =
|
|
981
|
+
case 157:
|
|
982
|
+
_context4.next = 162;
|
|
969
983
|
break;
|
|
970
|
-
case
|
|
971
|
-
_context4.prev =
|
|
972
|
-
_context4.t24 = _context4["catch"](
|
|
984
|
+
case 159:
|
|
985
|
+
_context4.prev = 159;
|
|
986
|
+
_context4.t24 = _context4["catch"](149);
|
|
973
987
|
_iterator6.e(_context4.t24);
|
|
974
|
-
case
|
|
975
|
-
_context4.prev =
|
|
988
|
+
case 162:
|
|
989
|
+
_context4.prev = 162;
|
|
976
990
|
_iterator6.f();
|
|
977
|
-
return _context4.finish(
|
|
978
|
-
case
|
|
979
|
-
_context4.next =
|
|
991
|
+
return _context4.finish(162);
|
|
992
|
+
case 165:
|
|
993
|
+
_context4.next = 146;
|
|
980
994
|
break;
|
|
981
|
-
case
|
|
982
|
-
_context4.next =
|
|
995
|
+
case 167:
|
|
996
|
+
_context4.next = 172;
|
|
983
997
|
break;
|
|
984
|
-
case
|
|
985
|
-
_context4.prev =
|
|
986
|
-
_context4.t25 = _context4["catch"](
|
|
998
|
+
case 169:
|
|
999
|
+
_context4.prev = 169;
|
|
1000
|
+
_context4.t25 = _context4["catch"](144);
|
|
987
1001
|
_iterator5.e(_context4.t25);
|
|
988
|
-
case
|
|
989
|
-
_context4.prev =
|
|
1002
|
+
case 172:
|
|
1003
|
+
_context4.prev = 172;
|
|
990
1004
|
_iterator5.f();
|
|
991
|
-
return _context4.finish(
|
|
992
|
-
case
|
|
1005
|
+
return _context4.finish(172);
|
|
1006
|
+
case 175:
|
|
993
1007
|
return _context4.abrupt("return", id);
|
|
994
|
-
case
|
|
995
|
-
_context4.prev =
|
|
1008
|
+
case 178:
|
|
1009
|
+
_context4.prev = 178;
|
|
996
1010
|
_context4.t26 = _context4["catch"](40);
|
|
997
1011
|
console.log(_context4.t26);
|
|
998
|
-
case
|
|
1012
|
+
case 181:
|
|
999
1013
|
return _context4.abrupt("return", null);
|
|
1000
|
-
case
|
|
1014
|
+
case 182:
|
|
1001
1015
|
case "end":
|
|
1002
1016
|
return _context4.stop();
|
|
1003
1017
|
}
|
|
1004
|
-
}, _callee4, null, [[40,
|
|
1018
|
+
}, _callee4, null, [[40, 178], [102, 119, 122, 125], [126, 137, 140, 143], [144, 169, 172, 175], [149, 159, 162, 165]]);
|
|
1005
1019
|
}));
|
|
1006
1020
|
return function assign(_x8) {
|
|
1007
1021
|
return _ref9.apply(this, arguments);
|
|
@@ -1300,86 +1314,188 @@ var _default = exports["default"] = function _default() {
|
|
|
1300
1314
|
return _ref11.apply(this, arguments);
|
|
1301
1315
|
};
|
|
1302
1316
|
}();
|
|
1303
|
-
var
|
|
1304
|
-
var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(
|
|
1305
|
-
var
|
|
1317
|
+
var record = /*#__PURE__*/function () {
|
|
1318
|
+
var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(opt) {
|
|
1319
|
+
var _opt$item$id2, _opt$item2, _opt$owner2, _opt$tags4;
|
|
1320
|
+
var id, owner, item, _yield$mem$getTx$tags4, _yield$mem$getTx6, pr, module, _yield$ar$dataitem4, _msg;
|
|
1306
1321
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
1307
1322
|
while (1) switch (_context6.prev = _context6.next) {
|
|
1323
|
+
case 0:
|
|
1324
|
+
id = (_opt$item$id2 = opt === null || opt === void 0 || (_opt$item2 = opt.item) === null || _opt$item2 === void 0 ? void 0 : _opt$item2.id) !== null && _opt$item$id2 !== void 0 ? _opt$item$id2 : "";
|
|
1325
|
+
owner = (_opt$owner2 = opt.owner) !== null && _opt$owner2 !== void 0 ? _opt$owner2 : "";
|
|
1326
|
+
item = opt.item;
|
|
1327
|
+
opt.tags = (0, _utils.buildTags)(null, (0, _ramda.mergeLeft)((0, _utils.tags)((_opt$tags4 = opt.tags) !== null && _opt$tags4 !== void 0 ? _opt$tags4 : []), {
|
|
1328
|
+
"Data-Protocol": "ao",
|
|
1329
|
+
Variant: variant !== null && variant !== void 0 ? variant : "ao.TN.1",
|
|
1330
|
+
Type: "Message"
|
|
1331
|
+
}));
|
|
1332
|
+
if (!opt["for"]) {
|
|
1333
|
+
_context6.next = 30;
|
|
1334
|
+
break;
|
|
1335
|
+
}
|
|
1336
|
+
opt.tags.push({
|
|
1337
|
+
name: "Pushed-For",
|
|
1338
|
+
value: opt["for"]
|
|
1339
|
+
});
|
|
1340
|
+
opt.tags.push({
|
|
1341
|
+
name: "From-Process",
|
|
1342
|
+
value: opt.from
|
|
1343
|
+
});
|
|
1344
|
+
_context6.next = 9;
|
|
1345
|
+
return mem.getTx(opt.from);
|
|
1346
|
+
case 9:
|
|
1347
|
+
_context6.t2 = _yield$mem$getTx6 = _context6.sent;
|
|
1348
|
+
_context6.t1 = _context6.t2 === null;
|
|
1349
|
+
if (_context6.t1) {
|
|
1350
|
+
_context6.next = 13;
|
|
1351
|
+
break;
|
|
1352
|
+
}
|
|
1353
|
+
_context6.t1 = _yield$mem$getTx6 === void 0;
|
|
1354
|
+
case 13:
|
|
1355
|
+
if (!_context6.t1) {
|
|
1356
|
+
_context6.next = 17;
|
|
1357
|
+
break;
|
|
1358
|
+
}
|
|
1359
|
+
_context6.t3 = void 0;
|
|
1360
|
+
_context6.next = 18;
|
|
1361
|
+
break;
|
|
1362
|
+
case 17:
|
|
1363
|
+
_context6.t3 = _yield$mem$getTx6.tags;
|
|
1364
|
+
case 18:
|
|
1365
|
+
_context6.t4 = _yield$mem$getTx$tags4 = _context6.t3;
|
|
1366
|
+
_context6.t0 = _context6.t4 !== null;
|
|
1367
|
+
if (!_context6.t0) {
|
|
1368
|
+
_context6.next = 22;
|
|
1369
|
+
break;
|
|
1370
|
+
}
|
|
1371
|
+
_context6.t0 = _yield$mem$getTx$tags4 !== void 0;
|
|
1372
|
+
case 22:
|
|
1373
|
+
if (!_context6.t0) {
|
|
1374
|
+
_context6.next = 26;
|
|
1375
|
+
break;
|
|
1376
|
+
}
|
|
1377
|
+
_context6.t5 = _yield$mem$getTx$tags4;
|
|
1378
|
+
_context6.next = 27;
|
|
1379
|
+
break;
|
|
1380
|
+
case 26:
|
|
1381
|
+
_context6.t5 = [];
|
|
1382
|
+
case 27:
|
|
1383
|
+
pr = _context6.t5;
|
|
1384
|
+
module = (0, _utils.tags)(pr).Module;
|
|
1385
|
+
if (module) opt.tags.push({
|
|
1386
|
+
name: "From-Module",
|
|
1387
|
+
value: module
|
|
1388
|
+
});
|
|
1389
|
+
case 30:
|
|
1390
|
+
;
|
|
1391
|
+
_context6.next = 33;
|
|
1392
|
+
return ar.dataitem({
|
|
1393
|
+
data: opt.data,
|
|
1394
|
+
signer: opt.signer,
|
|
1395
|
+
tags: (0, _utils.tags)(opt.tags),
|
|
1396
|
+
target: opt.process
|
|
1397
|
+
});
|
|
1398
|
+
case 33:
|
|
1399
|
+
_yield$ar$dataitem4 = _context6.sent;
|
|
1400
|
+
item = _yield$ar$dataitem4.item;
|
|
1401
|
+
id = _yield$ar$dataitem4.id;
|
|
1402
|
+
owner = _yield$ar$dataitem4.owner;
|
|
1403
|
+
_msg = (0, _ramda.dissoc)("signer", opt);
|
|
1404
|
+
_context6.next = 40;
|
|
1405
|
+
return mem.set(_msg, "msgs", id);
|
|
1406
|
+
case 40:
|
|
1407
|
+
_context6.next = 42;
|
|
1408
|
+
return ar.postItems(item, su.jwk);
|
|
1409
|
+
case 42:
|
|
1410
|
+
case "end":
|
|
1411
|
+
return _context6.stop();
|
|
1412
|
+
}
|
|
1413
|
+
}, _callee6);
|
|
1414
|
+
}));
|
|
1415
|
+
return function record(_x10) {
|
|
1416
|
+
return _ref13.apply(this, arguments);
|
|
1417
|
+
};
|
|
1418
|
+
}();
|
|
1419
|
+
var _recover = /*#__PURE__*/function () {
|
|
1420
|
+
var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(pid, next) {
|
|
1421
|
+
var count, success, _success, i, p, from, msgs, _iterator7, _step7, v, item, _k2, _tags;
|
|
1422
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
1423
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
1308
1424
|
case 0:
|
|
1309
1425
|
count = 0;
|
|
1310
1426
|
success = false;
|
|
1311
1427
|
if (!hb) {
|
|
1312
|
-
|
|
1428
|
+
_context7.next = 77;
|
|
1313
1429
|
break;
|
|
1314
1430
|
}
|
|
1315
1431
|
if (!onRecovery[pid]) {
|
|
1316
|
-
|
|
1432
|
+
_context7.next = 20;
|
|
1317
1433
|
break;
|
|
1318
1434
|
}
|
|
1319
1435
|
_success = false;
|
|
1320
1436
|
i = 0;
|
|
1321
1437
|
case 6:
|
|
1322
1438
|
if (!true) {
|
|
1323
|
-
|
|
1439
|
+
_context7.next = 17;
|
|
1324
1440
|
break;
|
|
1325
1441
|
}
|
|
1326
|
-
|
|
1442
|
+
_context7.next = 9;
|
|
1327
1443
|
return (0, _utils.wait)(1000);
|
|
1328
1444
|
case 9:
|
|
1329
1445
|
if (onRecovery[pid]) {
|
|
1330
|
-
|
|
1446
|
+
_context7.next = 12;
|
|
1331
1447
|
break;
|
|
1332
1448
|
}
|
|
1333
1449
|
_success = true;
|
|
1334
|
-
return
|
|
1450
|
+
return _context7.abrupt("break", 17);
|
|
1335
1451
|
case 12:
|
|
1336
1452
|
if (!(i > 10)) {
|
|
1337
|
-
|
|
1453
|
+
_context7.next = 14;
|
|
1338
1454
|
break;
|
|
1339
1455
|
}
|
|
1340
|
-
return
|
|
1456
|
+
return _context7.abrupt("break", 17);
|
|
1341
1457
|
case 14:
|
|
1342
1458
|
i++;
|
|
1343
|
-
|
|
1459
|
+
_context7.next = 6;
|
|
1344
1460
|
break;
|
|
1345
1461
|
case 17:
|
|
1346
|
-
return
|
|
1462
|
+
return _context7.abrupt("return", {
|
|
1347
1463
|
success: _success
|
|
1348
1464
|
});
|
|
1349
1465
|
case 20:
|
|
1350
1466
|
onRecovery[pid] = true;
|
|
1351
|
-
|
|
1352
|
-
|
|
1467
|
+
_context7.prev = 21;
|
|
1468
|
+
_context7.next = 24;
|
|
1353
1469
|
return mem.get("env", pid);
|
|
1354
1470
|
case 24:
|
|
1355
|
-
p =
|
|
1471
|
+
p = _context7.sent;
|
|
1356
1472
|
from = p ? p.results.length : 0;
|
|
1357
1473
|
if (!next) {
|
|
1358
|
-
|
|
1474
|
+
_context7.next = 32;
|
|
1359
1475
|
break;
|
|
1360
1476
|
}
|
|
1361
|
-
|
|
1477
|
+
_context7.next = 29;
|
|
1362
1478
|
return next();
|
|
1363
1479
|
case 29:
|
|
1364
|
-
|
|
1365
|
-
|
|
1480
|
+
_context7.t0 = _context7.sent;
|
|
1481
|
+
_context7.next = 35;
|
|
1366
1482
|
break;
|
|
1367
1483
|
case 32:
|
|
1368
|
-
|
|
1484
|
+
_context7.next = 34;
|
|
1369
1485
|
return hb.messages({
|
|
1370
1486
|
target: pid,
|
|
1371
1487
|
from: from
|
|
1372
1488
|
});
|
|
1373
1489
|
case 34:
|
|
1374
|
-
|
|
1490
|
+
_context7.t0 = _context7.sent;
|
|
1375
1491
|
case 35:
|
|
1376
|
-
msgs =
|
|
1492
|
+
msgs = _context7.t0;
|
|
1377
1493
|
_iterator7 = _createForOfIteratorHelper(msgs.edges);
|
|
1378
|
-
|
|
1494
|
+
_context7.prev = 37;
|
|
1379
1495
|
_iterator7.s();
|
|
1380
1496
|
case 39:
|
|
1381
1497
|
if ((_step7 = _iterator7.n()).done) {
|
|
1382
|
-
|
|
1498
|
+
_context7.next = 59;
|
|
1383
1499
|
break;
|
|
1384
1500
|
}
|
|
1385
1501
|
v = _step7.value;
|
|
@@ -1407,10 +1523,10 @@ var _default = exports["default"] = function _default() {
|
|
|
1407
1523
|
item.target = pid;
|
|
1408
1524
|
_tags = (0, _utils.tags)(item.tags);
|
|
1409
1525
|
if (!(_tags.Type === "Process")) {
|
|
1410
|
-
|
|
1526
|
+
_context7.next = 54;
|
|
1411
1527
|
break;
|
|
1412
1528
|
}
|
|
1413
|
-
|
|
1529
|
+
_context7.next = 52;
|
|
1414
1530
|
return spawn({
|
|
1415
1531
|
id: v.node.message.Id,
|
|
1416
1532
|
http_msg: item,
|
|
@@ -1420,10 +1536,10 @@ var _default = exports["default"] = function _default() {
|
|
|
1420
1536
|
recovery: true
|
|
1421
1537
|
});
|
|
1422
1538
|
case 52:
|
|
1423
|
-
|
|
1539
|
+
_context7.next = 56;
|
|
1424
1540
|
break;
|
|
1425
1541
|
case 54:
|
|
1426
|
-
|
|
1542
|
+
_context7.next = 56;
|
|
1427
1543
|
return message({
|
|
1428
1544
|
id: v.node.message.Id,
|
|
1429
1545
|
process: pid,
|
|
@@ -1434,134 +1550,134 @@ var _default = exports["default"] = function _default() {
|
|
|
1434
1550
|
case 56:
|
|
1435
1551
|
count++;
|
|
1436
1552
|
case 57:
|
|
1437
|
-
|
|
1553
|
+
_context7.next = 39;
|
|
1438
1554
|
break;
|
|
1439
1555
|
case 59:
|
|
1440
|
-
|
|
1556
|
+
_context7.next = 64;
|
|
1441
1557
|
break;
|
|
1442
1558
|
case 61:
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
_iterator7.e(
|
|
1559
|
+
_context7.prev = 61;
|
|
1560
|
+
_context7.t1 = _context7["catch"](37);
|
|
1561
|
+
_iterator7.e(_context7.t1);
|
|
1446
1562
|
case 64:
|
|
1447
|
-
|
|
1563
|
+
_context7.prev = 64;
|
|
1448
1564
|
_iterator7.f();
|
|
1449
|
-
return
|
|
1565
|
+
return _context7.finish(64);
|
|
1450
1566
|
case 67:
|
|
1451
1567
|
if (!msgs.next) {
|
|
1452
|
-
|
|
1568
|
+
_context7.next = 70;
|
|
1453
1569
|
break;
|
|
1454
1570
|
}
|
|
1455
|
-
|
|
1571
|
+
_context7.next = 70;
|
|
1456
1572
|
return _recover(pid, msgs.next);
|
|
1457
1573
|
case 70:
|
|
1458
|
-
|
|
1574
|
+
_context7.next = 75;
|
|
1459
1575
|
break;
|
|
1460
1576
|
case 72:
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
console.log(
|
|
1577
|
+
_context7.prev = 72;
|
|
1578
|
+
_context7.t2 = _context7["catch"](21);
|
|
1579
|
+
console.log(_context7.t2);
|
|
1464
1580
|
case 75:
|
|
1465
1581
|
delete onRecovery[pid];
|
|
1466
1582
|
case 76:
|
|
1467
1583
|
success = true;
|
|
1468
1584
|
case 77:
|
|
1469
|
-
return
|
|
1585
|
+
return _context7.abrupt("return", {
|
|
1470
1586
|
recovered: count,
|
|
1471
1587
|
pid: pid,
|
|
1472
1588
|
success: success
|
|
1473
1589
|
});
|
|
1474
1590
|
case 78:
|
|
1475
1591
|
case "end":
|
|
1476
|
-
return
|
|
1592
|
+
return _context7.stop();
|
|
1477
1593
|
}
|
|
1478
|
-
},
|
|
1594
|
+
}, _callee7, null, [[21, 72], [37, 61, 64, 67]]);
|
|
1479
1595
|
}));
|
|
1480
|
-
return function recover(
|
|
1481
|
-
return
|
|
1596
|
+
return function recover(_x11, _x12) {
|
|
1597
|
+
return _ref14.apply(this, arguments);
|
|
1482
1598
|
};
|
|
1483
1599
|
}();
|
|
1484
1600
|
var result = /*#__PURE__*/function () {
|
|
1485
|
-
var
|
|
1601
|
+
var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(opt) {
|
|
1486
1602
|
var _yield$mem$get2;
|
|
1487
|
-
return _regeneratorRuntime().wrap(function
|
|
1488
|
-
while (1) switch (
|
|
1603
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
1604
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
1489
1605
|
case 0:
|
|
1490
|
-
|
|
1606
|
+
_context8.next = 2;
|
|
1491
1607
|
return mem.get("msgs", opt.message);
|
|
1492
1608
|
case 2:
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
if (
|
|
1496
|
-
|
|
1609
|
+
_context8.t1 = _yield$mem$get2 = _context8.sent;
|
|
1610
|
+
_context8.t0 = _context8.t1 === null;
|
|
1611
|
+
if (_context8.t0) {
|
|
1612
|
+
_context8.next = 6;
|
|
1497
1613
|
break;
|
|
1498
1614
|
}
|
|
1499
|
-
|
|
1615
|
+
_context8.t0 = _yield$mem$get2 === void 0;
|
|
1500
1616
|
case 6:
|
|
1501
|
-
if (!
|
|
1502
|
-
|
|
1617
|
+
if (!_context8.t0) {
|
|
1618
|
+
_context8.next = 10;
|
|
1503
1619
|
break;
|
|
1504
1620
|
}
|
|
1505
|
-
|
|
1506
|
-
|
|
1621
|
+
_context8.t2 = void 0;
|
|
1622
|
+
_context8.next = 11;
|
|
1507
1623
|
break;
|
|
1508
1624
|
case 10:
|
|
1509
|
-
|
|
1625
|
+
_context8.t2 = _yield$mem$get2.res;
|
|
1510
1626
|
case 11:
|
|
1511
|
-
return
|
|
1627
|
+
return _context8.abrupt("return", _context8.t2);
|
|
1512
1628
|
case 12:
|
|
1513
1629
|
case "end":
|
|
1514
|
-
return
|
|
1630
|
+
return _context8.stop();
|
|
1515
1631
|
}
|
|
1516
|
-
},
|
|
1632
|
+
}, _callee8);
|
|
1517
1633
|
}));
|
|
1518
|
-
return function result(
|
|
1519
|
-
return
|
|
1634
|
+
return function result(_x13) {
|
|
1635
|
+
return _ref15.apply(this, arguments);
|
|
1520
1636
|
};
|
|
1521
1637
|
}();
|
|
1522
1638
|
return {
|
|
1523
1639
|
message: message,
|
|
1524
1640
|
unmonitor: function () {
|
|
1525
|
-
var _unmonitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1641
|
+
var _unmonitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(opt) {
|
|
1526
1642
|
var p;
|
|
1527
|
-
return _regeneratorRuntime().wrap(function
|
|
1528
|
-
while (1) switch (
|
|
1643
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
1644
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
1529
1645
|
case 0:
|
|
1530
|
-
|
|
1646
|
+
_context9.next = 2;
|
|
1531
1647
|
return mem.get("env", opt.process);
|
|
1532
1648
|
case 2:
|
|
1533
|
-
p =
|
|
1649
|
+
p = _context9.sent;
|
|
1534
1650
|
try {
|
|
1535
1651
|
clearInterval(p.cron);
|
|
1536
1652
|
p.cron = null;
|
|
1537
1653
|
} catch (e) {}
|
|
1538
1654
|
case 4:
|
|
1539
1655
|
case "end":
|
|
1540
|
-
return
|
|
1656
|
+
return _context9.stop();
|
|
1541
1657
|
}
|
|
1542
|
-
},
|
|
1658
|
+
}, _callee9);
|
|
1543
1659
|
}));
|
|
1544
|
-
function unmonitor(
|
|
1660
|
+
function unmonitor(_x14) {
|
|
1545
1661
|
return _unmonitor.apply(this, arguments);
|
|
1546
1662
|
}
|
|
1547
1663
|
return unmonitor;
|
|
1548
1664
|
}(),
|
|
1549
1665
|
monitor: function () {
|
|
1550
|
-
var _monitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1666
|
+
var _monitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(opt) {
|
|
1551
1667
|
var p;
|
|
1552
|
-
return _regeneratorRuntime().wrap(function
|
|
1553
|
-
while (1) switch (
|
|
1668
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
1669
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1554
1670
|
case 0:
|
|
1555
|
-
|
|
1671
|
+
_context11.next = 2;
|
|
1556
1672
|
return mem.get("env", opt.process);
|
|
1557
1673
|
case 2:
|
|
1558
|
-
p =
|
|
1674
|
+
p = _context11.sent;
|
|
1559
1675
|
if ((0, _ramda.isNil)(p.cron)) {
|
|
1560
|
-
p.cron = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1561
|
-
return _regeneratorRuntime().wrap(function
|
|
1562
|
-
while (1) switch (
|
|
1676
|
+
p.cron = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
1677
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
1678
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1563
1679
|
case 0:
|
|
1564
|
-
|
|
1680
|
+
_context10.next = 2;
|
|
1565
1681
|
return message({
|
|
1566
1682
|
tags: p.cronTags,
|
|
1567
1683
|
process: opt.process,
|
|
@@ -1570,18 +1686,18 @@ var _default = exports["default"] = function _default() {
|
|
|
1570
1686
|
});
|
|
1571
1687
|
case 2:
|
|
1572
1688
|
case "end":
|
|
1573
|
-
return
|
|
1689
|
+
return _context10.stop();
|
|
1574
1690
|
}
|
|
1575
|
-
},
|
|
1691
|
+
}, _callee10);
|
|
1576
1692
|
})), p.span);
|
|
1577
1693
|
}
|
|
1578
1694
|
case 4:
|
|
1579
1695
|
case "end":
|
|
1580
|
-
return
|
|
1696
|
+
return _context11.stop();
|
|
1581
1697
|
}
|
|
1582
|
-
},
|
|
1698
|
+
}, _callee11);
|
|
1583
1699
|
}));
|
|
1584
|
-
function monitor(
|
|
1700
|
+
function monitor(_x15) {
|
|
1585
1701
|
return _monitor.apply(this, arguments);
|
|
1586
1702
|
}
|
|
1587
1703
|
return monitor;
|
|
@@ -1591,135 +1707,135 @@ var _default = exports["default"] = function _default() {
|
|
|
1591
1707
|
ar: ar,
|
|
1592
1708
|
result: result,
|
|
1593
1709
|
results: function () {
|
|
1594
|
-
var _results = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1595
|
-
var p, results,
|
|
1596
|
-
return _regeneratorRuntime().wrap(function
|
|
1597
|
-
while (1) switch (
|
|
1710
|
+
var _results = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(opt) {
|
|
1711
|
+
var p, results, _ref17, _ref17$from, from, _ref17$to, to, _ref17$sort, sort, _ref17$limit, limit, _res, count, started, _iterator8, _step8, v;
|
|
1712
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1713
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1598
1714
|
case 0:
|
|
1599
|
-
|
|
1715
|
+
_context12.next = 2;
|
|
1600
1716
|
return mem.get("env", opt.process);
|
|
1601
1717
|
case 2:
|
|
1602
|
-
p =
|
|
1718
|
+
p = _context12.sent;
|
|
1603
1719
|
if (p) {
|
|
1604
|
-
|
|
1720
|
+
_context12.next = 5;
|
|
1605
1721
|
break;
|
|
1606
1722
|
}
|
|
1607
|
-
return
|
|
1723
|
+
return _context12.abrupt("return", {
|
|
1608
1724
|
edges: []
|
|
1609
1725
|
});
|
|
1610
1726
|
case 5:
|
|
1611
1727
|
results = (p === null || p === void 0 ? void 0 : p.results) || [];
|
|
1612
|
-
|
|
1728
|
+
_ref17 = opt || {}, _ref17$from = _ref17.from, from = _ref17$from === void 0 ? null : _ref17$from, _ref17$to = _ref17.to, to = _ref17$to === void 0 ? null : _ref17$to, _ref17$sort = _ref17.sort, sort = _ref17$sort === void 0 ? "ASC" : _ref17$sort, _ref17$limit = _ref17.limit, limit = _ref17$limit === void 0 ? 25 : _ref17$limit;
|
|
1613
1729
|
if (sort === "DESC") results = (0, _ramda.reverse)(results);
|
|
1614
1730
|
_res = [];
|
|
1615
1731
|
count = 0;
|
|
1616
1732
|
started = (0, _ramda.isNil)(from);
|
|
1617
1733
|
_iterator8 = _createForOfIteratorHelper(results);
|
|
1618
|
-
|
|
1734
|
+
_context12.prev = 12;
|
|
1619
1735
|
_iterator8.s();
|
|
1620
1736
|
case 14:
|
|
1621
1737
|
if ((_step8 = _iterator8.n()).done) {
|
|
1622
|
-
|
|
1738
|
+
_context12.next = 34;
|
|
1623
1739
|
break;
|
|
1624
1740
|
}
|
|
1625
1741
|
v = _step8.value;
|
|
1626
1742
|
if (!started) {
|
|
1627
|
-
|
|
1743
|
+
_context12.next = 31;
|
|
1628
1744
|
break;
|
|
1629
1745
|
}
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1746
|
+
_context12.t0 = _res;
|
|
1747
|
+
_context12.t1 = v;
|
|
1748
|
+
_context12.next = 21;
|
|
1633
1749
|
return result({
|
|
1634
1750
|
message: v
|
|
1635
1751
|
});
|
|
1636
1752
|
case 21:
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
cursor:
|
|
1640
|
-
node:
|
|
1753
|
+
_context12.t2 = _context12.sent;
|
|
1754
|
+
_context12.t3 = {
|
|
1755
|
+
cursor: _context12.t1,
|
|
1756
|
+
node: _context12.t2
|
|
1641
1757
|
};
|
|
1642
|
-
|
|
1758
|
+
_context12.t0.push.call(_context12.t0, _context12.t3);
|
|
1643
1759
|
count++;
|
|
1644
1760
|
if (!(!(0, _ramda.isNil)(to) && v === to)) {
|
|
1645
|
-
|
|
1761
|
+
_context12.next = 27;
|
|
1646
1762
|
break;
|
|
1647
1763
|
}
|
|
1648
|
-
return
|
|
1764
|
+
return _context12.abrupt("break", 34);
|
|
1649
1765
|
case 27:
|
|
1650
1766
|
if (!(limit <= count)) {
|
|
1651
|
-
|
|
1767
|
+
_context12.next = 29;
|
|
1652
1768
|
break;
|
|
1653
1769
|
}
|
|
1654
|
-
return
|
|
1770
|
+
return _context12.abrupt("break", 34);
|
|
1655
1771
|
case 29:
|
|
1656
|
-
|
|
1772
|
+
_context12.next = 32;
|
|
1657
1773
|
break;
|
|
1658
1774
|
case 31:
|
|
1659
1775
|
if (from === v) started = true;
|
|
1660
1776
|
case 32:
|
|
1661
|
-
|
|
1777
|
+
_context12.next = 14;
|
|
1662
1778
|
break;
|
|
1663
1779
|
case 34:
|
|
1664
|
-
|
|
1780
|
+
_context12.next = 39;
|
|
1665
1781
|
break;
|
|
1666
1782
|
case 36:
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
_iterator8.e(
|
|
1783
|
+
_context12.prev = 36;
|
|
1784
|
+
_context12.t4 = _context12["catch"](12);
|
|
1785
|
+
_iterator8.e(_context12.t4);
|
|
1670
1786
|
case 39:
|
|
1671
|
-
|
|
1787
|
+
_context12.prev = 39;
|
|
1672
1788
|
_iterator8.f();
|
|
1673
|
-
return
|
|
1789
|
+
return _context12.finish(39);
|
|
1674
1790
|
case 42:
|
|
1675
|
-
return
|
|
1791
|
+
return _context12.abrupt("return", {
|
|
1676
1792
|
edges: _res
|
|
1677
1793
|
});
|
|
1678
1794
|
case 43:
|
|
1679
1795
|
case "end":
|
|
1680
|
-
return
|
|
1796
|
+
return _context12.stop();
|
|
1681
1797
|
}
|
|
1682
|
-
},
|
|
1798
|
+
}, _callee12, null, [[12, 36, 39, 42]]);
|
|
1683
1799
|
}));
|
|
1684
|
-
function results(
|
|
1800
|
+
function results(_x16) {
|
|
1685
1801
|
return _results.apply(this, arguments);
|
|
1686
1802
|
}
|
|
1687
1803
|
return results;
|
|
1688
1804
|
}(),
|
|
1689
1805
|
dryrun: function () {
|
|
1690
|
-
var _dryrun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1691
|
-
var _opt$id3, _opt$
|
|
1692
|
-
var p, id, owner, _yield$ar$
|
|
1693
|
-
return _regeneratorRuntime().wrap(function
|
|
1694
|
-
while (1) switch (
|
|
1806
|
+
var _dryrun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(opt) {
|
|
1807
|
+
var _opt$id3, _opt$owner3;
|
|
1808
|
+
var p, id, owner, _yield$ar$dataitem5, _opt$data3, cloneMemory, msg, _env, _yield$mem$getWasm4, format, mod, wasm, wdrive, start, res;
|
|
1809
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
1810
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1695
1811
|
case 0:
|
|
1696
|
-
|
|
1812
|
+
_context13.next = 2;
|
|
1697
1813
|
return mem.get("env", opt.process);
|
|
1698
1814
|
case 2:
|
|
1699
|
-
p =
|
|
1815
|
+
p = _context13.sent;
|
|
1700
1816
|
if (p) {
|
|
1701
|
-
|
|
1817
|
+
_context13.next = 5;
|
|
1702
1818
|
break;
|
|
1703
1819
|
}
|
|
1704
|
-
return
|
|
1820
|
+
return _context13.abrupt("return", null);
|
|
1705
1821
|
case 5:
|
|
1706
1822
|
id = (_opt$id3 = opt.id) !== null && _opt$id3 !== void 0 ? _opt$id3 : "";
|
|
1707
|
-
owner = (_opt$
|
|
1823
|
+
owner = (_opt$owner3 = opt.owner) !== null && _opt$owner3 !== void 0 ? _opt$owner3 : mu.addr;
|
|
1708
1824
|
if (!(!opt.id && opt.signer)) {
|
|
1709
|
-
|
|
1825
|
+
_context13.next = 14;
|
|
1710
1826
|
break;
|
|
1711
1827
|
}
|
|
1712
1828
|
;
|
|
1713
|
-
|
|
1829
|
+
_context13.next = 11;
|
|
1714
1830
|
return ar.dataitem(_objectSpread(_objectSpread({}, opt), {}, {
|
|
1715
1831
|
target: opt.process
|
|
1716
1832
|
}));
|
|
1717
1833
|
case 11:
|
|
1718
|
-
_yield$ar$
|
|
1719
|
-
id = _yield$ar$
|
|
1720
|
-
owner = _yield$ar$
|
|
1834
|
+
_yield$ar$dataitem5 = _context13.sent;
|
|
1835
|
+
id = _yield$ar$dataitem5.id;
|
|
1836
|
+
owner = _yield$ar$dataitem5.owner;
|
|
1721
1837
|
case 14:
|
|
1722
|
-
|
|
1838
|
+
_context13.prev = 14;
|
|
1723
1839
|
cloneMemory = function cloneMemory(memory) {
|
|
1724
1840
|
var buffer = memory.buffer.slice(0);
|
|
1725
1841
|
return new WebAssembly.Memory({
|
|
@@ -1728,52 +1844,52 @@ var _default = exports["default"] = function _default() {
|
|
|
1728
1844
|
shared: memory.shared || false
|
|
1729
1845
|
});
|
|
1730
1846
|
};
|
|
1731
|
-
|
|
1847
|
+
_context13.next = 18;
|
|
1732
1848
|
return genMsg(id, p, (_opt$data3 = opt.data) !== null && _opt$data3 !== void 0 ? _opt$data3 : "", opt.tags, owner, owner, true);
|
|
1733
1849
|
case 18:
|
|
1734
|
-
msg =
|
|
1735
|
-
|
|
1850
|
+
msg = _context13.sent;
|
|
1851
|
+
_context13.next = 21;
|
|
1736
1852
|
return genEnv({
|
|
1737
1853
|
pid: p.id,
|
|
1738
1854
|
owner: p.owner,
|
|
1739
1855
|
module: p.module
|
|
1740
1856
|
});
|
|
1741
1857
|
case 21:
|
|
1742
|
-
_env =
|
|
1858
|
+
_env = _context13.sent;
|
|
1743
1859
|
if (p.handle) {
|
|
1744
|
-
|
|
1860
|
+
_context13.next = 45;
|
|
1745
1861
|
break;
|
|
1746
1862
|
}
|
|
1747
|
-
|
|
1863
|
+
_context13.next = 25;
|
|
1748
1864
|
return mem.getWasm(p.module);
|
|
1749
1865
|
case 25:
|
|
1750
|
-
_yield$mem$getWasm4 =
|
|
1866
|
+
_yield$mem$getWasm4 = _context13.sent;
|
|
1751
1867
|
format = _yield$mem$getWasm4.format;
|
|
1752
1868
|
mod = _yield$mem$getWasm4.mod;
|
|
1753
1869
|
wasm = _yield$mem$getWasm4.wasm;
|
|
1754
1870
|
wdrive = extensions[p.extention];
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1871
|
+
_context13.t0 = AoLoader;
|
|
1872
|
+
_context13.t1 = wasm;
|
|
1873
|
+
_context13.t2 = format;
|
|
1874
|
+
_context13.t3 = wdrive;
|
|
1875
|
+
_context13.next = 36;
|
|
1760
1876
|
return mem.getTx(p.id);
|
|
1761
1877
|
case 36:
|
|
1762
|
-
|
|
1763
|
-
|
|
1878
|
+
_context13.t4 = _context13.sent.item;
|
|
1879
|
+
_context13.next = 39;
|
|
1764
1880
|
return mem.getTx(mod);
|
|
1765
1881
|
case 39:
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
format:
|
|
1769
|
-
WeaveDrive:
|
|
1770
|
-
spawn:
|
|
1771
|
-
module:
|
|
1882
|
+
_context13.t5 = _context13.sent;
|
|
1883
|
+
_context13.t6 = {
|
|
1884
|
+
format: _context13.t2,
|
|
1885
|
+
WeaveDrive: _context13.t3,
|
|
1886
|
+
spawn: _context13.t4,
|
|
1887
|
+
module: _context13.t5
|
|
1772
1888
|
};
|
|
1773
|
-
|
|
1774
|
-
return (0,
|
|
1889
|
+
_context13.next = 43;
|
|
1890
|
+
return (0, _context13.t0)(_context13.t1, _context13.t6);
|
|
1775
1891
|
case 43:
|
|
1776
|
-
p.handle =
|
|
1892
|
+
p.handle = _context13.sent;
|
|
1777
1893
|
mem.env[opt.process].handle = p.handle;
|
|
1778
1894
|
case 45:
|
|
1779
1895
|
if (p.compressed) {
|
|
@@ -1781,25 +1897,25 @@ var _default = exports["default"] = function _default() {
|
|
|
1781
1897
|
p.memory = mem.decompress(p.memory, p.original_size);
|
|
1782
1898
|
p.compressed = false;
|
|
1783
1899
|
}
|
|
1784
|
-
|
|
1900
|
+
_context13.next = 48;
|
|
1785
1901
|
return p.handle(p.memory, msg, _env);
|
|
1786
1902
|
case 48:
|
|
1787
|
-
res =
|
|
1903
|
+
res = _context13.sent;
|
|
1788
1904
|
delete res.Memory;
|
|
1789
|
-
return
|
|
1905
|
+
return _context13.abrupt("return", res);
|
|
1790
1906
|
case 53:
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
console.log(
|
|
1907
|
+
_context13.prev = 53;
|
|
1908
|
+
_context13.t7 = _context13["catch"](14);
|
|
1909
|
+
console.log(_context13.t7);
|
|
1794
1910
|
case 56:
|
|
1795
|
-
return
|
|
1911
|
+
return _context13.abrupt("return", null);
|
|
1796
1912
|
case 57:
|
|
1797
1913
|
case "end":
|
|
1798
|
-
return
|
|
1914
|
+
return _context13.stop();
|
|
1799
1915
|
}
|
|
1800
|
-
},
|
|
1916
|
+
}, _callee13, null, [[14, 53]]);
|
|
1801
1917
|
}));
|
|
1802
|
-
function dryrun(
|
|
1918
|
+
function dryrun(_x17) {
|
|
1803
1919
|
return _dryrun.apply(this, arguments);
|
|
1804
1920
|
}
|
|
1805
1921
|
return dryrun;
|
package/esm/aoconnect-base.js
CHANGED
|
@@ -366,6 +366,16 @@ export default ({ AR, scheduler, mu, su, cu, acc, AoLoader, ArMem } = {}) => {
|
|
|
366
366
|
data: v.Data,
|
|
367
367
|
signer: mu.signer,
|
|
368
368
|
from: opt.process,
|
|
369
|
+
target: v.Target,
|
|
370
|
+
})
|
|
371
|
+
} else {
|
|
372
|
+
await record({
|
|
373
|
+
for: opt.message,
|
|
374
|
+
tags: v.Tags,
|
|
375
|
+
data: v.Data,
|
|
376
|
+
signer: mu.signer,
|
|
377
|
+
from: opt.process,
|
|
378
|
+
target: v.Target,
|
|
369
379
|
})
|
|
370
380
|
}
|
|
371
381
|
}
|
|
@@ -510,6 +520,35 @@ export default ({ AR, scheduler, mu, su, cu, acc, AoLoader, ArMem } = {}) => {
|
|
|
510
520
|
delete ongoing[key]
|
|
511
521
|
return id
|
|
512
522
|
}
|
|
523
|
+
const record = async opt => {
|
|
524
|
+
let id = opt?.item?.id ?? ""
|
|
525
|
+
let owner = opt.owner ?? ""
|
|
526
|
+
let item = opt.item
|
|
527
|
+
opt.tags = buildTags(
|
|
528
|
+
null,
|
|
529
|
+
mergeLeft(tags(opt.tags ?? []), {
|
|
530
|
+
"Data-Protocol": "ao",
|
|
531
|
+
Variant: variant ?? "ao.TN.1",
|
|
532
|
+
Type: "Message",
|
|
533
|
+
})
|
|
534
|
+
)
|
|
535
|
+
if (opt.for) {
|
|
536
|
+
opt.tags.push({ name: "Pushed-For", value: opt.for })
|
|
537
|
+
opt.tags.push({ name: "From-Process", value: opt.from })
|
|
538
|
+
const pr = (await mem.getTx(opt.from))?.tags ?? []
|
|
539
|
+
const module = tags(pr).Module
|
|
540
|
+
if (module) opt.tags.push({ name: "From-Module", value: module })
|
|
541
|
+
}
|
|
542
|
+
;({ item, id, owner } = await ar.dataitem({
|
|
543
|
+
data: opt.data,
|
|
544
|
+
signer: opt.signer,
|
|
545
|
+
tags: tags(opt.tags),
|
|
546
|
+
target: opt.process,
|
|
547
|
+
}))
|
|
548
|
+
const _msg = dissoc("signer", opt)
|
|
549
|
+
await mem.set(_msg, "msgs", id)
|
|
550
|
+
await ar.postItems(item, su.jwk)
|
|
551
|
+
}
|
|
513
552
|
const recover = async (pid, next) => {
|
|
514
553
|
let count = 0
|
|
515
554
|
let success = false
|