wao 0.13.7 → 0.13.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 +147 -149
- package/cjs/bar.js +22 -14
- package/cjs/server.js +1 -1
- package/esm/aoconnect-base.js +3 -2
- package/esm/bar.js +4 -3
- package/esm/server.js +2 -5
- package/package.json +1 -1
package/cjs/aoconnect-base.js
CHANGED
|
@@ -351,24 +351,23 @@ var _default = exports["default"] = function _default() {
|
|
|
351
351
|
format = _yield$mem$getWasm.format;
|
|
352
352
|
msg_owner = mu.addr;
|
|
353
353
|
if (!ar.isHttpMsg(opt.http_msg)) {
|
|
354
|
-
_context3.next =
|
|
354
|
+
_context3.next = 25;
|
|
355
355
|
break;
|
|
356
356
|
}
|
|
357
|
-
;
|
|
357
|
+
id = opt.http_msg.target;
|
|
358
358
|
_context3.next = 16;
|
|
359
|
-
return ar.httpmsg(opt.http_msg);
|
|
359
|
+
return ar.httpmsg(opt.http_msg, id);
|
|
360
360
|
case 16:
|
|
361
361
|
_yield$ar$httpmsg = _context3.sent;
|
|
362
362
|
owner = _yield$ar$httpmsg.owner;
|
|
363
363
|
item = _yield$ar$httpmsg.item;
|
|
364
364
|
__tags = _yield$ar$httpmsg.tags;
|
|
365
|
-
id = opt.http_msg.target;
|
|
366
365
|
opt.tags = (0, _utils.buildTags)(null, __tags);
|
|
367
366
|
opt.data = opt.http_msg.data;
|
|
368
367
|
msg_owner = owner;
|
|
369
|
-
_context3.next =
|
|
368
|
+
_context3.next = 42;
|
|
370
369
|
break;
|
|
371
|
-
case
|
|
370
|
+
case 25:
|
|
372
371
|
opt.tags = (0, _utils.buildTags)(null, (0, _ramda.mergeLeft)((0, _utils.tags)((_opt$tags = opt.tags) !== null && _opt$tags !== void 0 ? _opt$tags : []), {
|
|
373
372
|
"Data-Protocol": "ao",
|
|
374
373
|
Variant: "ao.TN.1",
|
|
@@ -399,14 +398,14 @@ var _default = exports["default"] = function _default() {
|
|
|
399
398
|
name: "Pushed-For",
|
|
400
399
|
value: opt["for"]
|
|
401
400
|
});
|
|
402
|
-
_context3.next =
|
|
401
|
+
_context3.next = 33;
|
|
403
402
|
return ar.dataitem({
|
|
404
403
|
item: opt.item,
|
|
405
404
|
data: opt.data,
|
|
406
405
|
signer: opt.signer,
|
|
407
406
|
tags: (0, _utils.tags)(opt.tags)
|
|
408
407
|
});
|
|
409
|
-
case
|
|
408
|
+
case 33:
|
|
410
409
|
_yield$ar$dataitem = _context3.sent;
|
|
411
410
|
id = _yield$ar$dataitem.id;
|
|
412
411
|
owner = _yield$ar$dataitem.owner;
|
|
@@ -414,23 +413,23 @@ var _default = exports["default"] = function _default() {
|
|
|
414
413
|
__tags = _yield$ar$dataitem.tags;
|
|
415
414
|
opt.tags = (0, _utils.buildTags)(null, __tags);
|
|
416
415
|
if (opt.item) opt.data = _base64url["default"].decode(item.data);
|
|
417
|
-
_context3.next =
|
|
416
|
+
_context3.next = 42;
|
|
418
417
|
return ar.postItems(item, su.jwk);
|
|
419
|
-
case
|
|
418
|
+
case 42:
|
|
420
419
|
now = Date.now;
|
|
421
420
|
t = (0, _utils.tags)(opt.tags);
|
|
422
421
|
ext = t.Extension || "WeaveDrive";
|
|
423
422
|
wdrive = extensions[ext];
|
|
424
423
|
handle = null;
|
|
425
|
-
_context3.prev =
|
|
424
|
+
_context3.prev = 47;
|
|
426
425
|
_context3.t0 = AoLoader;
|
|
427
426
|
_context3.t1 = wasm;
|
|
428
427
|
_context3.t2 = format;
|
|
429
428
|
_context3.t3 = wdrive;
|
|
430
429
|
_context3.t4 = item;
|
|
431
|
-
_context3.next =
|
|
430
|
+
_context3.next = 55;
|
|
432
431
|
return mem.getTx(mod);
|
|
433
|
-
case
|
|
432
|
+
case 55:
|
|
434
433
|
_context3.t5 = _context3.sent;
|
|
435
434
|
_context3.t6 = {
|
|
436
435
|
format: _context3.t2,
|
|
@@ -438,23 +437,23 @@ var _default = exports["default"] = function _default() {
|
|
|
438
437
|
spawn: _context3.t4,
|
|
439
438
|
module: _context3.t5
|
|
440
439
|
};
|
|
441
|
-
_context3.next =
|
|
440
|
+
_context3.next = 59;
|
|
442
441
|
return (0, _context3.t0)(_context3.t1, _context3.t6);
|
|
443
|
-
case
|
|
442
|
+
case 59:
|
|
444
443
|
handle = _context3.sent;
|
|
445
|
-
_context3.next =
|
|
444
|
+
_context3.next = 65;
|
|
446
445
|
break;
|
|
447
|
-
case
|
|
448
|
-
_context3.prev =
|
|
449
|
-
_context3.t7 = _context3["catch"](
|
|
446
|
+
case 62:
|
|
447
|
+
_context3.prev = 62;
|
|
448
|
+
_context3.t7 = _context3["catch"](47);
|
|
450
449
|
console.log(mod, _context3.t7);
|
|
451
|
-
case
|
|
450
|
+
case 65:
|
|
452
451
|
if (handle) {
|
|
453
|
-
_context3.next =
|
|
452
|
+
_context3.next = 67;
|
|
454
453
|
break;
|
|
455
454
|
}
|
|
456
455
|
return _context3.abrupt("return", null);
|
|
457
|
-
case
|
|
456
|
+
case 67:
|
|
458
457
|
_module = null;
|
|
459
458
|
_module = {
|
|
460
459
|
handle: handle,
|
|
@@ -478,126 +477,126 @@ var _default = exports["default"] = function _default() {
|
|
|
478
477
|
results: [id]
|
|
479
478
|
};
|
|
480
479
|
if (!memory) {
|
|
481
|
-
_context3.next =
|
|
480
|
+
_context3.next = 77;
|
|
482
481
|
break;
|
|
483
482
|
}
|
|
484
|
-
_context3.next =
|
|
483
|
+
_context3.next = 118;
|
|
485
484
|
break;
|
|
486
|
-
case
|
|
485
|
+
case 77:
|
|
487
486
|
if (!(_tags["On-Boot"] || true)) {
|
|
488
|
-
_context3.next =
|
|
487
|
+
_context3.next = 117;
|
|
489
488
|
break;
|
|
490
489
|
}
|
|
491
490
|
data = "";
|
|
492
491
|
if (!(_tags["On-Boot"] === "Data")) {
|
|
493
|
-
_context3.next =
|
|
492
|
+
_context3.next = 83;
|
|
494
493
|
break;
|
|
495
494
|
}
|
|
496
495
|
data = (_opt$data = opt.data) !== null && _opt$data !== void 0 ? _opt$data : "";
|
|
497
|
-
_context3.next =
|
|
496
|
+
_context3.next = 104;
|
|
498
497
|
break;
|
|
499
|
-
case
|
|
500
|
-
_context3.next =
|
|
498
|
+
case 83:
|
|
499
|
+
_context3.next = 85;
|
|
501
500
|
return mem.get("msgs", _tags["On-Boot"]);
|
|
502
|
-
case
|
|
501
|
+
case 85:
|
|
503
502
|
_context3.t10 = _yield$mem$get = _context3.sent;
|
|
504
503
|
_context3.t9 = _context3.t10 === null;
|
|
505
504
|
if (_context3.t9) {
|
|
506
|
-
_context3.next =
|
|
505
|
+
_context3.next = 89;
|
|
507
506
|
break;
|
|
508
507
|
}
|
|
509
508
|
_context3.t9 = _yield$mem$get === void 0;
|
|
510
|
-
case
|
|
509
|
+
case 89:
|
|
511
510
|
if (!_context3.t9) {
|
|
512
|
-
_context3.next =
|
|
511
|
+
_context3.next = 93;
|
|
513
512
|
break;
|
|
514
513
|
}
|
|
515
514
|
_context3.t11 = void 0;
|
|
516
|
-
_context3.next =
|
|
515
|
+
_context3.next = 94;
|
|
517
516
|
break;
|
|
518
|
-
case
|
|
517
|
+
case 93:
|
|
519
518
|
_context3.t11 = _yield$mem$get.data;
|
|
520
|
-
case
|
|
519
|
+
case 94:
|
|
521
520
|
_context3.t12 = _yield$mem$get$data = _context3.t11;
|
|
522
521
|
_context3.t8 = _context3.t12 !== null;
|
|
523
522
|
if (!_context3.t8) {
|
|
524
|
-
_context3.next =
|
|
523
|
+
_context3.next = 98;
|
|
525
524
|
break;
|
|
526
525
|
}
|
|
527
526
|
_context3.t8 = _yield$mem$get$data !== void 0;
|
|
528
|
-
case
|
|
527
|
+
case 98:
|
|
529
528
|
if (!_context3.t8) {
|
|
530
|
-
_context3.next =
|
|
529
|
+
_context3.next = 102;
|
|
531
530
|
break;
|
|
532
531
|
}
|
|
533
532
|
_context3.t13 = _yield$mem$get$data;
|
|
534
|
-
_context3.next =
|
|
533
|
+
_context3.next = 103;
|
|
535
534
|
break;
|
|
536
|
-
case
|
|
535
|
+
case 102:
|
|
537
536
|
_context3.t13 = "";
|
|
538
|
-
case
|
|
537
|
+
case 103:
|
|
539
538
|
data = _context3.t13;
|
|
540
|
-
case
|
|
541
|
-
_context3.next =
|
|
539
|
+
case 104:
|
|
540
|
+
_context3.next = 106;
|
|
542
541
|
return genMsg(id, p, data, opt.tags, owner, msg_owner, true);
|
|
543
|
-
case
|
|
542
|
+
case 106:
|
|
544
543
|
msg = _context3.sent;
|
|
545
|
-
_context3.next =
|
|
544
|
+
_context3.next = 109;
|
|
546
545
|
return genEnv({
|
|
547
546
|
pid: p.id,
|
|
548
547
|
owner: p.owner,
|
|
549
548
|
module: p.module
|
|
550
549
|
});
|
|
551
|
-
case
|
|
550
|
+
case 109:
|
|
552
551
|
_env = _context3.sent;
|
|
553
|
-
_context3.next =
|
|
552
|
+
_context3.next = 112;
|
|
554
553
|
return _module.handle(null, msg, _env);
|
|
555
|
-
case
|
|
554
|
+
case 112:
|
|
556
555
|
res = _context3.sent;
|
|
557
556
|
p.memory = res.Memory;
|
|
558
557
|
delete res.Memory;
|
|
559
|
-
_context3.next =
|
|
558
|
+
_context3.next = 118;
|
|
560
559
|
break;
|
|
561
|
-
case
|
|
560
|
+
case 117:
|
|
562
561
|
p.height += 1;
|
|
563
|
-
case
|
|
562
|
+
case 118:
|
|
564
563
|
_msg = _objectSpread(_objectSpread({}, (0, _ramda.o)((0, _ramda.dissoc)("signer"), (0, _ramda.dissoc)("memory"))(opt)), {}, {
|
|
565
564
|
res: res
|
|
566
565
|
});
|
|
567
|
-
_context3.next =
|
|
566
|
+
_context3.next = 121;
|
|
568
567
|
return mem.set(_msg, "msgs", id);
|
|
569
|
-
case
|
|
568
|
+
case 121:
|
|
570
569
|
if (!_tags["Cron-Interval"]) {
|
|
571
|
-
_context3.next =
|
|
570
|
+
_context3.next = 145;
|
|
572
571
|
break;
|
|
573
572
|
}
|
|
574
573
|
_tags$CronInterval$s = _tags["Cron-Interval"].split("-"), _tags$CronInterval$s2 = _slicedToArray(_tags$CronInterval$s, 2), num = _tags$CronInterval$s2[0], unit = _tags$CronInterval$s2[1];
|
|
575
574
|
_int = 0;
|
|
576
575
|
_context3.t14 = unit.replace(/s$/, "");
|
|
577
|
-
_context3.next = _context3.t14 === "millisecond" ?
|
|
576
|
+
_context3.next = _context3.t14 === "millisecond" ? 127 : _context3.t14 === "second" ? 129 : _context3.t14 === "minute" ? 131 : _context3.t14 === "hour" ? 133 : _context3.t14 === "day" ? 135 : _context3.t14 === "month" ? 137 : _context3.t14 === "year" ? 139 : 141;
|
|
578
577
|
break;
|
|
579
|
-
case
|
|
578
|
+
case 127:
|
|
580
579
|
_int = num;
|
|
581
|
-
return _context3.abrupt("break",
|
|
582
|
-
case
|
|
580
|
+
return _context3.abrupt("break", 141);
|
|
581
|
+
case 129:
|
|
583
582
|
_int = num * 1000;
|
|
584
|
-
return _context3.abrupt("break",
|
|
585
|
-
case
|
|
583
|
+
return _context3.abrupt("break", 141);
|
|
584
|
+
case 131:
|
|
586
585
|
_int = num * 1000 * 60;
|
|
587
|
-
return _context3.abrupt("break",
|
|
588
|
-
case
|
|
586
|
+
return _context3.abrupt("break", 141);
|
|
587
|
+
case 133:
|
|
589
588
|
_int = num * 1000 * 60 * 60;
|
|
590
|
-
return _context3.abrupt("break",
|
|
591
|
-
case
|
|
589
|
+
return _context3.abrupt("break", 141);
|
|
590
|
+
case 135:
|
|
592
591
|
_int = num * 1000 * 60 * 60 * 24;
|
|
593
|
-
return _context3.abrupt("break",
|
|
594
|
-
case
|
|
592
|
+
return _context3.abrupt("break", 141);
|
|
593
|
+
case 137:
|
|
595
594
|
_int = num * 1000 * 60 * 60 * 24 * 30;
|
|
596
|
-
return _context3.abrupt("break",
|
|
597
|
-
case
|
|
595
|
+
return _context3.abrupt("break", 141);
|
|
596
|
+
case 139:
|
|
598
597
|
_int = num * 1000 * 60 * 60 * 24 * 365;
|
|
599
|
-
return _context3.abrupt("break",
|
|
600
|
-
case
|
|
598
|
+
return _context3.abrupt("break", 141);
|
|
599
|
+
case 141:
|
|
601
600
|
cronTags = [];
|
|
602
601
|
for (_k in _tags) {
|
|
603
602
|
if (/^Cron-Tag-/.test(_k)) {
|
|
@@ -609,16 +608,16 @@ var _default = exports["default"] = function _default() {
|
|
|
609
608
|
}
|
|
610
609
|
p.cronTags = cronTags;
|
|
611
610
|
p.span = _int;
|
|
612
|
-
case
|
|
613
|
-
_context3.next =
|
|
611
|
+
case 145:
|
|
612
|
+
_context3.next = 147;
|
|
614
613
|
return mem.set(p, "env", id);
|
|
615
|
-
case
|
|
614
|
+
case 147:
|
|
616
615
|
return _context3.abrupt("return", id);
|
|
617
|
-
case
|
|
616
|
+
case 148:
|
|
618
617
|
case "end":
|
|
619
618
|
return _context3.stop();
|
|
620
619
|
}
|
|
621
|
-
}, _callee3, null, [[
|
|
620
|
+
}, _callee3, null, [[47, 62]]);
|
|
622
621
|
}));
|
|
623
622
|
return function spawn() {
|
|
624
623
|
return _ref8.apply(this, arguments);
|
|
@@ -960,56 +959,55 @@ var _default = exports["default"] = function _default() {
|
|
|
960
959
|
owner = "";
|
|
961
960
|
item = null;
|
|
962
961
|
if (!ar.isHttpMsg(opt.http_msg)) {
|
|
963
|
-
_context5.next =
|
|
962
|
+
_context5.next = 23;
|
|
964
963
|
break;
|
|
965
964
|
}
|
|
966
|
-
;
|
|
965
|
+
id = opt.http_msg.target;
|
|
967
966
|
_context5.next = 7;
|
|
968
|
-
return ar.httpmsg(opt.http_msg);
|
|
967
|
+
return ar.httpmsg(opt.http_msg, id);
|
|
969
968
|
case 7:
|
|
970
969
|
_yield$ar$httpmsg2 = _context5.sent;
|
|
971
|
-
id = _yield$ar$httpmsg2.id;
|
|
972
970
|
owner = _yield$ar$httpmsg2.owner;
|
|
973
971
|
item = _yield$ar$httpmsg2.item;
|
|
974
|
-
_context5.next =
|
|
972
|
+
_context5.next = 12;
|
|
975
973
|
return mem.get("env", opt.process);
|
|
976
|
-
case
|
|
974
|
+
case 12:
|
|
977
975
|
_p = _context5.sent;
|
|
978
976
|
new_slot = opt.slot * 1;
|
|
979
977
|
last_slot = !_p ? -1 : _p.results.length - 1;
|
|
980
978
|
if (!(last_slot + 1 !== new_slot)) {
|
|
981
|
-
_context5.next =
|
|
979
|
+
_context5.next = 21;
|
|
982
980
|
break;
|
|
983
981
|
}
|
|
984
982
|
console.log("need process recovery from HB:", opt.process);
|
|
985
983
|
if (!(!hb || opt.recovery)) {
|
|
986
|
-
_context5.next =
|
|
984
|
+
_context5.next = 19;
|
|
987
985
|
break;
|
|
988
986
|
}
|
|
989
987
|
return _context5.abrupt("return", null);
|
|
990
|
-
case
|
|
991
|
-
_context5.next =
|
|
988
|
+
case 19:
|
|
989
|
+
_context5.next = 21;
|
|
992
990
|
return _recover(opt.process);
|
|
993
|
-
case
|
|
994
|
-
_context5.next =
|
|
991
|
+
case 21:
|
|
992
|
+
_context5.next = 26;
|
|
995
993
|
break;
|
|
996
|
-
case
|
|
994
|
+
case 23:
|
|
997
995
|
_id = (_opt$item$id = opt === null || opt === void 0 || (_opt$item = opt.item) === null || _opt$item === void 0 ? void 0 : _opt$item.id) !== null && _opt$item$id !== void 0 ? _opt$item$id : "";
|
|
998
996
|
_owner = (_opt$owner = opt.owner) !== null && _opt$owner !== void 0 ? _opt$owner : "";
|
|
999
997
|
_item = opt.item;
|
|
1000
|
-
case
|
|
1001
|
-
_context5.next =
|
|
998
|
+
case 26:
|
|
999
|
+
_context5.next = 28;
|
|
1002
1000
|
return mem.get("env", opt.process);
|
|
1003
|
-
case
|
|
1001
|
+
case 28:
|
|
1004
1002
|
p = _context5.sent;
|
|
1005
1003
|
if (p) {
|
|
1006
|
-
_context5.next =
|
|
1004
|
+
_context5.next = 31;
|
|
1007
1005
|
break;
|
|
1008
1006
|
}
|
|
1009
1007
|
return _context5.abrupt("return", null);
|
|
1010
|
-
case
|
|
1008
|
+
case 31:
|
|
1011
1009
|
if (!(!opt.item && opt.signer)) {
|
|
1012
|
-
_context5.next =
|
|
1010
|
+
_context5.next = 66;
|
|
1013
1011
|
break;
|
|
1014
1012
|
}
|
|
1015
1013
|
opt.tags = (0, _utils.buildTags)(null, (0, _ramda.mergeLeft)((0, _utils.tags)((_opt$tags3 = opt.tags) !== null && _opt$tags3 !== void 0 ? _opt$tags3 : []), {
|
|
@@ -1019,7 +1017,7 @@ var _default = exports["default"] = function _default() {
|
|
|
1019
1017
|
SDK: "aoconnect"
|
|
1020
1018
|
}));
|
|
1021
1019
|
if (!opt["for"]) {
|
|
1022
|
-
_context5.next =
|
|
1020
|
+
_context5.next = 59;
|
|
1023
1021
|
break;
|
|
1024
1022
|
}
|
|
1025
1023
|
opt.tags.push({
|
|
@@ -1030,100 +1028,100 @@ var _default = exports["default"] = function _default() {
|
|
|
1030
1028
|
name: "From-Process",
|
|
1031
1029
|
value: opt.from
|
|
1032
1030
|
});
|
|
1033
|
-
_context5.next =
|
|
1031
|
+
_context5.next = 38;
|
|
1034
1032
|
return mem.getTx(opt.from);
|
|
1035
|
-
case
|
|
1033
|
+
case 38:
|
|
1036
1034
|
_context5.t2 = _yield$mem$getTx3 = _context5.sent;
|
|
1037
1035
|
_context5.t1 = _context5.t2 === null;
|
|
1038
1036
|
if (_context5.t1) {
|
|
1039
|
-
_context5.next =
|
|
1037
|
+
_context5.next = 42;
|
|
1040
1038
|
break;
|
|
1041
1039
|
}
|
|
1042
1040
|
_context5.t1 = _yield$mem$getTx3 === void 0;
|
|
1043
|
-
case
|
|
1041
|
+
case 42:
|
|
1044
1042
|
if (!_context5.t1) {
|
|
1045
|
-
_context5.next =
|
|
1043
|
+
_context5.next = 46;
|
|
1046
1044
|
break;
|
|
1047
1045
|
}
|
|
1048
1046
|
_context5.t3 = void 0;
|
|
1049
|
-
_context5.next =
|
|
1047
|
+
_context5.next = 47;
|
|
1050
1048
|
break;
|
|
1051
|
-
case
|
|
1049
|
+
case 46:
|
|
1052
1050
|
_context5.t3 = _yield$mem$getTx3.tags;
|
|
1053
|
-
case
|
|
1051
|
+
case 47:
|
|
1054
1052
|
_context5.t4 = _yield$mem$getTx$tags3 = _context5.t3;
|
|
1055
1053
|
_context5.t0 = _context5.t4 !== null;
|
|
1056
1054
|
if (!_context5.t0) {
|
|
1057
|
-
_context5.next =
|
|
1055
|
+
_context5.next = 51;
|
|
1058
1056
|
break;
|
|
1059
1057
|
}
|
|
1060
1058
|
_context5.t0 = _yield$mem$getTx$tags3 !== void 0;
|
|
1061
|
-
case
|
|
1059
|
+
case 51:
|
|
1062
1060
|
if (!_context5.t0) {
|
|
1063
|
-
_context5.next =
|
|
1061
|
+
_context5.next = 55;
|
|
1064
1062
|
break;
|
|
1065
1063
|
}
|
|
1066
1064
|
_context5.t5 = _yield$mem$getTx$tags3;
|
|
1067
|
-
_context5.next =
|
|
1065
|
+
_context5.next = 56;
|
|
1068
1066
|
break;
|
|
1069
|
-
case
|
|
1067
|
+
case 55:
|
|
1070
1068
|
_context5.t5 = [];
|
|
1071
|
-
case
|
|
1069
|
+
case 56:
|
|
1072
1070
|
pr = _context5.t5;
|
|
1073
1071
|
module = (0, _utils.tags)(pr).Module;
|
|
1074
1072
|
if (module) opt.tags.push({
|
|
1075
1073
|
name: "From-Module",
|
|
1076
1074
|
value: module
|
|
1077
1075
|
});
|
|
1078
|
-
case
|
|
1076
|
+
case 59:
|
|
1079
1077
|
;
|
|
1080
|
-
_context5.next =
|
|
1078
|
+
_context5.next = 62;
|
|
1081
1079
|
return ar.dataitem({
|
|
1082
1080
|
data: opt.data,
|
|
1083
1081
|
signer: opt.signer,
|
|
1084
1082
|
tags: (0, _utils.tags)(opt.tags),
|
|
1085
1083
|
target: opt.process
|
|
1086
1084
|
});
|
|
1087
|
-
case
|
|
1085
|
+
case 62:
|
|
1088
1086
|
_yield$ar$dataitem3 = _context5.sent;
|
|
1089
1087
|
item = _yield$ar$dataitem3.item;
|
|
1090
1088
|
id = _yield$ar$dataitem3.id;
|
|
1091
1089
|
owner = _yield$ar$dataitem3.owner;
|
|
1092
|
-
case
|
|
1090
|
+
case 66:
|
|
1093
1091
|
_msg = (0, _ramda.dissoc)("signer", opt);
|
|
1094
|
-
_context5.next =
|
|
1092
|
+
_context5.next = 69;
|
|
1095
1093
|
return mem.set(_msg, "msgs", id);
|
|
1096
|
-
case
|
|
1094
|
+
case 69:
|
|
1097
1095
|
if (!ar.isHttpMsg(opt.http_msg)) {
|
|
1098
|
-
_context5.next =
|
|
1096
|
+
_context5.next = 124;
|
|
1099
1097
|
break;
|
|
1100
1098
|
}
|
|
1101
1099
|
p.epochs.push([id]);
|
|
1102
1100
|
_opt = opt;
|
|
1103
|
-
_context5.prev =
|
|
1101
|
+
_context5.prev = 72;
|
|
1104
1102
|
// todo: not sure if this is correct
|
|
1105
1103
|
from = (_ref12 = (_opt$from2 = _opt.from) !== null && _opt$from2 !== void 0 ? _opt$from2 : opt.from) !== null && _ref12 !== void 0 ? _ref12 : owner;
|
|
1106
1104
|
data = (_opt$http_msg$data = opt.http_msg.data) !== null && _opt$http_msg$data !== void 0 ? _opt$http_msg$data : "";
|
|
1107
1105
|
_tags = _opt.http_msg.tags; // todo: check if owner=mu.addr right?
|
|
1108
|
-
_context5.next =
|
|
1106
|
+
_context5.next = 78;
|
|
1109
1107
|
return genMsg(opt.http_msg, p, data, _tags, from, owner);
|
|
1110
|
-
case
|
|
1108
|
+
case 78:
|
|
1111
1109
|
msg = _context5.sent;
|
|
1112
|
-
_context5.next =
|
|
1110
|
+
_context5.next = 81;
|
|
1113
1111
|
return genEnv({
|
|
1114
1112
|
pid: p.id,
|
|
1115
1113
|
owner: p.owner,
|
|
1116
1114
|
module: p.module
|
|
1117
1115
|
});
|
|
1118
|
-
case
|
|
1116
|
+
case 81:
|
|
1119
1117
|
_env = _context5.sent;
|
|
1120
1118
|
if (p.handle) {
|
|
1121
|
-
_context5.next =
|
|
1119
|
+
_context5.next = 105;
|
|
1122
1120
|
break;
|
|
1123
1121
|
}
|
|
1124
|
-
_context5.next =
|
|
1122
|
+
_context5.next = 85;
|
|
1125
1123
|
return mem.getWasm(p.modulea);
|
|
1126
|
-
case
|
|
1124
|
+
case 85:
|
|
1127
1125
|
_yield$mem$getWasm3 = _context5.sent;
|
|
1128
1126
|
format = _yield$mem$getWasm3.format;
|
|
1129
1127
|
mod = _yield$mem$getWasm3.mod;
|
|
@@ -1133,13 +1131,13 @@ var _default = exports["default"] = function _default() {
|
|
|
1133
1131
|
_context5.t7 = wasm;
|
|
1134
1132
|
_context5.t8 = format;
|
|
1135
1133
|
_context5.t9 = wdrive;
|
|
1136
|
-
_context5.next =
|
|
1134
|
+
_context5.next = 96;
|
|
1137
1135
|
return mem.getTx(p.id);
|
|
1138
|
-
case
|
|
1136
|
+
case 96:
|
|
1139
1137
|
_context5.t10 = _context5.sent.item;
|
|
1140
|
-
_context5.next =
|
|
1138
|
+
_context5.next = 99;
|
|
1141
1139
|
return mem.getTx(mod);
|
|
1142
|
-
case
|
|
1140
|
+
case 99:
|
|
1143
1141
|
_context5.t11 = _context5.sent;
|
|
1144
1142
|
_context5.t12 = {
|
|
1145
1143
|
format: _context5.t8,
|
|
@@ -1147,38 +1145,38 @@ var _default = exports["default"] = function _default() {
|
|
|
1147
1145
|
spawn: _context5.t10,
|
|
1148
1146
|
module: _context5.t11
|
|
1149
1147
|
};
|
|
1150
|
-
_context5.next =
|
|
1148
|
+
_context5.next = 103;
|
|
1151
1149
|
return (0, _context5.t6)(_context5.t7, _context5.t12);
|
|
1152
|
-
case
|
|
1150
|
+
case 103:
|
|
1153
1151
|
p.handle = _context5.sent;
|
|
1154
1152
|
mem.env[opt.process].handle = p.handle;
|
|
1155
|
-
case
|
|
1156
|
-
_context5.next =
|
|
1153
|
+
case 105:
|
|
1154
|
+
_context5.next = 107;
|
|
1157
1155
|
return p.handle(p.memory, msg, _env);
|
|
1158
|
-
case
|
|
1156
|
+
case 107:
|
|
1159
1157
|
res = _context5.sent;
|
|
1160
1158
|
p.memory = res.Memory;
|
|
1161
1159
|
delete res.Memory;
|
|
1162
1160
|
p.results.push(id);
|
|
1163
|
-
_context5.next =
|
|
1161
|
+
_context5.next = 113;
|
|
1164
1162
|
return mem.set(p, "env", opt.process);
|
|
1165
|
-
case
|
|
1163
|
+
case 113:
|
|
1166
1164
|
_msg2 = _objectSpread(_objectSpread({}, (0, _ramda.dissoc)("signer", _opt)), {}, {
|
|
1167
1165
|
res: res
|
|
1168
1166
|
});
|
|
1169
|
-
_context5.next =
|
|
1167
|
+
_context5.next = 116;
|
|
1170
1168
|
return mem.set(_msg2, "msgs", id);
|
|
1171
|
-
case
|
|
1169
|
+
case 116:
|
|
1172
1170
|
return _context5.abrupt("return", id);
|
|
1173
|
-
case
|
|
1174
|
-
_context5.prev =
|
|
1175
|
-
_context5.t13 = _context5["catch"](
|
|
1171
|
+
case 119:
|
|
1172
|
+
_context5.prev = 119;
|
|
1173
|
+
_context5.t13 = _context5["catch"](72);
|
|
1176
1174
|
console.log(_context5.t13);
|
|
1177
|
-
case
|
|
1178
|
-
_context5.next =
|
|
1175
|
+
case 122:
|
|
1176
|
+
_context5.next = 126;
|
|
1179
1177
|
break;
|
|
1180
|
-
case
|
|
1181
|
-
_context5.next =
|
|
1178
|
+
case 124:
|
|
1179
|
+
_context5.next = 126;
|
|
1182
1180
|
return _assign({
|
|
1183
1181
|
message_item: item,
|
|
1184
1182
|
message: id,
|
|
@@ -1186,13 +1184,13 @@ var _default = exports["default"] = function _default() {
|
|
|
1186
1184
|
from: owner,
|
|
1187
1185
|
signer: mu.signer
|
|
1188
1186
|
});
|
|
1189
|
-
case
|
|
1187
|
+
case 126:
|
|
1190
1188
|
return _context5.abrupt("return", id);
|
|
1191
|
-
case
|
|
1189
|
+
case 127:
|
|
1192
1190
|
case "end":
|
|
1193
1191
|
return _context5.stop();
|
|
1194
1192
|
}
|
|
1195
|
-
}, _callee5, null, [[
|
|
1193
|
+
}, _callee5, null, [[72, 119]]);
|
|
1196
1194
|
}));
|
|
1197
1195
|
return function message(_x9) {
|
|
1198
1196
|
return _ref11.apply(this, arguments);
|
package/cjs/bar.js
CHANGED
|
@@ -92,7 +92,7 @@ var AR = /*#__PURE__*/function (_MAR) {
|
|
|
92
92
|
}, {
|
|
93
93
|
key: "httpmsg",
|
|
94
94
|
value: function () {
|
|
95
|
-
var _httpmsg = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(msg) {
|
|
95
|
+
var _httpmsg = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(msg, id) {
|
|
96
96
|
var tags, owner, _parseSignatureInput, n, _tags$Owner;
|
|
97
97
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
98
98
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -114,22 +114,30 @@ var AR = /*#__PURE__*/function (_MAR) {
|
|
|
114
114
|
_context.t0 = _context["catch"](2);
|
|
115
115
|
owner = (_tags$Owner = tags.Owner) !== null && _tags$Owner !== void 0 ? _tags$Owner : null;
|
|
116
116
|
case 12:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
if (!id) {
|
|
118
|
+
_context.next = 17;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
_context.next = 15;
|
|
122
|
+
return this.mem.set(msg, "txs", id);
|
|
123
|
+
case 15:
|
|
124
|
+
_context.next = 18;
|
|
125
|
+
break;
|
|
126
|
+
case 17:
|
|
127
|
+
console.log("id missing");
|
|
128
|
+
case 18:
|
|
120
129
|
return _context.abrupt("return", {
|
|
121
130
|
item: msg,
|
|
122
|
-
id: tags.id,
|
|
123
131
|
tags: tags,
|
|
124
132
|
owner: owner
|
|
125
133
|
});
|
|
126
|
-
case
|
|
134
|
+
case 19:
|
|
127
135
|
case "end":
|
|
128
136
|
return _context.stop();
|
|
129
137
|
}
|
|
130
138
|
}, _callee, this, [[2, 9]]);
|
|
131
139
|
}));
|
|
132
|
-
function httpmsg(_x) {
|
|
140
|
+
function httpmsg(_x, _x2) {
|
|
133
141
|
return _httpmsg.apply(this, arguments);
|
|
134
142
|
}
|
|
135
143
|
return httpmsg;
|
|
@@ -155,7 +163,7 @@ var AR = /*#__PURE__*/function (_MAR) {
|
|
|
155
163
|
}
|
|
156
164
|
}, _callee2);
|
|
157
165
|
}));
|
|
158
|
-
function owner(
|
|
166
|
+
function owner(_x3) {
|
|
159
167
|
return _owner.apply(this, arguments);
|
|
160
168
|
}
|
|
161
169
|
return owner;
|
|
@@ -211,7 +219,7 @@ var AR = /*#__PURE__*/function (_MAR) {
|
|
|
211
219
|
}
|
|
212
220
|
}, _callee3, this);
|
|
213
221
|
}));
|
|
214
|
-
function dataitem(
|
|
222
|
+
function dataitem(_x4) {
|
|
215
223
|
return _dataitem.apply(this, arguments);
|
|
216
224
|
}
|
|
217
225
|
return dataitem;
|
|
@@ -269,7 +277,7 @@ var AR = /*#__PURE__*/function (_MAR) {
|
|
|
269
277
|
}
|
|
270
278
|
}, _callee4, this);
|
|
271
279
|
}));
|
|
272
|
-
function post(
|
|
280
|
+
function post(_x5) {
|
|
273
281
|
return _post.apply(this, arguments);
|
|
274
282
|
}
|
|
275
283
|
return post;
|
|
@@ -410,7 +418,7 @@ var AR = /*#__PURE__*/function (_MAR) {
|
|
|
410
418
|
}
|
|
411
419
|
}, _callee5, this, [[11, 51, 54, 57]]);
|
|
412
420
|
}));
|
|
413
|
-
function postItems(
|
|
421
|
+
function postItems(_x6, _x7) {
|
|
414
422
|
return _postItems.apply(this, arguments);
|
|
415
423
|
}
|
|
416
424
|
return postItems;
|
|
@@ -667,7 +675,7 @@ var AR = /*#__PURE__*/function (_MAR) {
|
|
|
667
675
|
}
|
|
668
676
|
}, _callee6, this, [[41, 62, 65, 68]]);
|
|
669
677
|
}));
|
|
670
|
-
function postTx(
|
|
678
|
+
function postTx(_x8, _x9) {
|
|
671
679
|
return _postTx.apply(this, arguments);
|
|
672
680
|
}
|
|
673
681
|
return postTx;
|
|
@@ -689,7 +697,7 @@ var AR = /*#__PURE__*/function (_MAR) {
|
|
|
689
697
|
}
|
|
690
698
|
}, _callee7, this);
|
|
691
699
|
}));
|
|
692
|
-
function tx(
|
|
700
|
+
function tx(_x10) {
|
|
693
701
|
return _tx.apply(this, arguments);
|
|
694
702
|
}
|
|
695
703
|
return tx;
|
|
@@ -752,7 +760,7 @@ var AR = /*#__PURE__*/function (_MAR) {
|
|
|
752
760
|
}
|
|
753
761
|
}, _callee8, this);
|
|
754
762
|
}));
|
|
755
|
-
function data(
|
|
763
|
+
function data(_x11, _x12, _x13) {
|
|
756
764
|
return _data2.apply(this, arguments);
|
|
757
765
|
}
|
|
758
766
|
return data;
|
package/cjs/server.js
CHANGED
|
@@ -288,7 +288,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
288
288
|
try {
|
|
289
289
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
290
290
|
_v = _step3.value;
|
|
291
|
-
if (_v.name === "id")
|
|
291
|
+
if (_v.name === "id") item.target = _v.value;
|
|
292
292
|
}
|
|
293
293
|
} catch (err) {
|
|
294
294
|
_iterator3.e(err);
|
package/esm/aoconnect-base.js
CHANGED
|
@@ -107,8 +107,8 @@ export default ({ AR, scheduler, mu, su, cu, acc, AoLoader, ArMem } = {}) => {
|
|
|
107
107
|
let id, owner, item, __tags
|
|
108
108
|
let msg_owner = mu.addr
|
|
109
109
|
if (ar.isHttpMsg(opt.http_msg)) {
|
|
110
|
-
;({ owner, item, tags: __tags } = await ar.httpmsg(opt.http_msg))
|
|
111
110
|
id = opt.http_msg.target
|
|
111
|
+
;({ owner, item, tags: __tags } = await ar.httpmsg(opt.http_msg, id))
|
|
112
112
|
opt.tags = buildTags(null, __tags)
|
|
113
113
|
opt.data = opt.http_msg.data
|
|
114
114
|
msg_owner = owner
|
|
@@ -373,7 +373,8 @@ export default ({ AR, scheduler, mu, su, cu, acc, AoLoader, ArMem } = {}) => {
|
|
|
373
373
|
let owner = ""
|
|
374
374
|
let item = null
|
|
375
375
|
if (ar.isHttpMsg(opt.http_msg)) {
|
|
376
|
-
|
|
376
|
+
id = opt.http_msg.target
|
|
377
|
+
;({ owner, item } = await ar.httpmsg(opt.http_msg, id))
|
|
377
378
|
// check if process exists, and recover if necessary
|
|
378
379
|
const p = await mem.get("env", opt.process)
|
|
379
380
|
const new_slot = opt.slot * 1
|
package/esm/bar.js
CHANGED
|
@@ -35,7 +35,7 @@ class AR extends MAR {
|
|
|
35
35
|
}
|
|
36
36
|
return false
|
|
37
37
|
}
|
|
38
|
-
async httpmsg(msg) {
|
|
38
|
+
async httpmsg(msg, id) {
|
|
39
39
|
const tags = t(msg.tags)
|
|
40
40
|
let owner = null
|
|
41
41
|
try {
|
|
@@ -44,8 +44,9 @@ class AR extends MAR {
|
|
|
44
44
|
} catch (e) {
|
|
45
45
|
owner = tags.Owner ?? null
|
|
46
46
|
}
|
|
47
|
-
await this.mem.set(msg, "txs",
|
|
48
|
-
|
|
47
|
+
if (id) await this.mem.set(msg, "txs", id)
|
|
48
|
+
else console.log("id missing")
|
|
49
|
+
return { item: msg, tags, owner }
|
|
49
50
|
}
|
|
50
51
|
async owner(di) {
|
|
51
52
|
return base64url.encode(
|
package/esm/server.js
CHANGED
|
@@ -174,17 +174,14 @@ class Server {
|
|
|
174
174
|
const item = toANS104Request(sigs).item
|
|
175
175
|
|
|
176
176
|
if (sigs.slot === "0" || sigs.type === "Process") {
|
|
177
|
-
for (let v of item.tags)
|
|
178
|
-
if (v.name === "Type") v.value = "Process"
|
|
179
|
-
}
|
|
180
|
-
|
|
177
|
+
for (let v of item.tags) if (v.name === "Type") v.value = "Process"
|
|
181
178
|
const res = await this.spawn({
|
|
182
179
|
http_msg: item,
|
|
183
180
|
module: sigs.module,
|
|
184
181
|
scheduler: sigs.scheduler,
|
|
185
182
|
})
|
|
186
183
|
} else if (sigs.type === "Message") {
|
|
187
|
-
for (let v of item.tags) if (v.name === "id")
|
|
184
|
+
for (let v of item.tags) if (v.name === "id") item.target = v.value
|
|
188
185
|
const res = await this.message({
|
|
189
186
|
slot: sigs.slot,
|
|
190
187
|
http_msg: item,
|