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