wao 0.23.6 → 0.24.0

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/hb.js CHANGED
@@ -8,6 +8,8 @@ var _aoconnect = require("@permaweb/aoconnect");
8
8
  var _ramda = require("ramda");
9
9
  var _utils = require("./utils.js");
10
10
  var _signer = require("./signer.js");
11
+ var _path2 = require("path");
12
+ var _fs = require("fs");
11
13
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
14
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
13
15
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
@@ -313,20 +315,17 @@ var HB = /*#__PURE__*/function () {
313
315
  value: function () {
314
316
  var _getImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
315
317
  var _this$image;
316
- var result, image;
318
+ var wasm, id;
317
319
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
318
320
  while (1) switch (_context10.prev = _context10.next) {
319
321
  case 0:
320
- _context10.next = 2;
321
- return this.send({
322
- path: "/~wao@1.0/cache_wasm_image",
323
- filename: "test/aos-2-pure-xs.wasm"
324
- });
325
- case 2:
326
- result = _context10.sent;
327
- image = result.headers.get("image");
328
- (_this$image = this.image) !== null && _this$image !== void 0 ? _this$image : this.image = image;
329
- return _context10.abrupt("return", image);
322
+ wasm = (0, _fs.readFileSync)((0, _path2.resolve)(import.meta.dirname, "./lua/aos2-wamr.wasm"));
323
+ _context10.next = 3;
324
+ return this.cacheModule(wasm, "application/wasm");
325
+ case 3:
326
+ id = _context10.sent;
327
+ (_this$image = this.image) !== null && _this$image !== void 0 ? _this$image : this.image = id;
328
+ return _context10.abrupt("return", id);
330
329
  case 6:
331
330
  case "end":
332
331
  return _context10.stop();
@@ -339,30 +338,54 @@ var HB = /*#__PURE__*/function () {
339
338
  return getImage;
340
339
  }()
341
340
  }, {
342
- key: "getLua",
341
+ key: "getLegacy",
343
342
  value: function () {
344
- var _getLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
345
- var _this$lua;
346
- var result, lua;
343
+ var _getLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
344
+ var _this$legacy;
345
+ var wasm, id;
347
346
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
348
347
  while (1) switch (_context11.prev = _context11.next) {
349
348
  case 0:
350
- _context11.next = 2;
351
- return this.send({
352
- path: "/~wao@1.0/cache_lua_module",
353
- filename: "test/hyper-aos.lua"
354
- });
355
- case 2:
356
- result = _context11.sent;
357
- lua = result.headers.get("id").split("/").pop();
358
- (_this$lua = this.lua) !== null && _this$lua !== void 0 ? _this$lua : this.lua = lua;
359
- return _context11.abrupt("return", lua);
349
+ wasm = (0, _fs.readFileSync)((0, _path2.resolve)(import.meta.dirname, "./lua/aos2_0_6.wasm"));
350
+ _context11.next = 3;
351
+ return this.cacheModule(wasm, "application/wasm");
352
+ case 3:
353
+ id = _context11.sent;
354
+ (_this$legacy = this.legacy) !== null && _this$legacy !== void 0 ? _this$legacy : this.legacy = id;
355
+ return _context11.abrupt("return", id);
360
356
  case 6:
361
357
  case "end":
362
358
  return _context11.stop();
363
359
  }
364
360
  }, _callee11, this);
365
361
  }));
362
+ function getLegacy() {
363
+ return _getLegacy.apply(this, arguments);
364
+ }
365
+ return getLegacy;
366
+ }()
367
+ }, {
368
+ key: "getLua",
369
+ value: function () {
370
+ var _getLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
371
+ var _this$lua;
372
+ var lua, id;
373
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
374
+ while (1) switch (_context12.prev = _context12.next) {
375
+ case 0:
376
+ lua = (0, _fs.readFileSync)((0, _path2.resolve)(import.meta.dirname, "./lua/hyper-aos.lua"));
377
+ _context12.next = 3;
378
+ return this.cacheModule(lua, "application/lua");
379
+ case 3:
380
+ id = _context12.sent;
381
+ (_this$lua = this.lua) !== null && _this$lua !== void 0 ? _this$lua : this.lua = id;
382
+ return _context12.abrupt("return", id);
383
+ case 6:
384
+ case "end":
385
+ return _context12.stop();
386
+ }
387
+ }, _callee12, this);
388
+ }));
366
389
  function getLua() {
367
390
  return _getLua.apply(this, arguments);
368
391
  }
@@ -371,11 +394,11 @@ var HB = /*#__PURE__*/function () {
371
394
  }, {
372
395
  key: "messageAOS",
373
396
  value: function () {
374
- var _messageAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(_ref2) {
397
+ var _messageAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(_ref2) {
375
398
  var _pid;
376
399
  var pid, _ref2$action, action, _ref2$tags, tags, data, _tags, res, slot;
377
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
378
- while (1) switch (_context12.prev = _context12.next) {
400
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
401
+ while (1) switch (_context13.prev = _context13.next) {
379
402
  case 0:
380
403
  pid = _ref2.pid, _ref2$action = _ref2.action, action = _ref2$action === void 0 ? "Eval" : _ref2$action, _ref2$tags = _ref2.tags, tags = _ref2$tags === void 0 ? {} : _ref2$tags, data = _ref2.data;
381
404
  (_pid = pid) !== null && _pid !== void 0 ? _pid : pid = this.pid;
@@ -389,28 +412,28 @@ var HB = /*#__PURE__*/function () {
389
412
  Target: pid
390
413
  });
391
414
  if (data) _tags.data = data;
392
- _context12.next = 6;
415
+ _context13.next = 6;
393
416
  return this.send(_tags);
394
417
  case 6:
395
- res = _context12.sent;
418
+ res = _context13.sent;
396
419
  slot = res.headers.get("slot");
397
- _context12.t0 = slot;
398
- _context12.next = 11;
420
+ _context13.t0 = slot;
421
+ _context13.next = 11;
399
422
  return this.computeAOS({
400
423
  pid: pid,
401
424
  slot: slot
402
425
  });
403
426
  case 11:
404
- _context12.t1 = _context12.sent;
405
- return _context12.abrupt("return", {
406
- slot: _context12.t0,
407
- outbox: _context12.t1
427
+ _context13.t1 = _context13.sent;
428
+ return _context13.abrupt("return", {
429
+ slot: _context13.t0,
430
+ outbox: _context13.t1
408
431
  });
409
432
  case 13:
410
433
  case "end":
411
- return _context12.stop();
434
+ return _context13.stop();
412
435
  }
413
- }, _callee12, this);
436
+ }, _callee13, this);
414
437
  }));
415
438
  function messageAOS(_x8) {
416
439
  return _messageAOS.apply(this, arguments);
@@ -440,30 +463,30 @@ var HB = /*#__PURE__*/function () {
440
463
  }, {
441
464
  key: "text",
442
465
  value: function () {
443
- var _text = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(dev, path) {
466
+ var _text = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(dev, path) {
444
467
  var params,
445
468
  tail,
446
469
  pid,
447
- _args13 = arguments;
448
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
449
- while (1) switch (_context13.prev = _context13.next) {
470
+ _args14 = arguments;
471
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
472
+ while (1) switch (_context14.prev = _context14.next) {
450
473
  case 0:
451
- params = _args13.length > 2 && _args13[2] !== undefined ? _args13[2] : {};
452
- tail = _args13.length > 3 ? _args13[3] : undefined;
474
+ params = _args14.length > 2 && _args14[2] !== undefined ? _args14[2] : {};
475
+ tail = _args14.length > 3 ? _args14[3] : undefined;
453
476
  pid = "";
454
477
  if (/^[a-zA-Z0-9_-]{43}$/.test(dev)) {
455
478
  pid = dev;
456
479
  dev = "process";
457
480
  }
458
- _context13.next = 6;
481
+ _context14.next = 6;
459
482
  return this.fetch(this.path(dev, path, false, params, pid, tail), false);
460
483
  case 6:
461
- return _context13.abrupt("return", _context13.sent);
484
+ return _context14.abrupt("return", _context14.sent);
462
485
  case 7:
463
486
  case "end":
464
- return _context13.stop();
487
+ return _context14.stop();
465
488
  }
466
- }, _callee13, this);
489
+ }, _callee14, this);
467
490
  }));
468
491
  function text(_x9, _x10) {
469
492
  return _text.apply(this, arguments);
@@ -473,30 +496,30 @@ var HB = /*#__PURE__*/function () {
473
496
  }, {
474
497
  key: "json",
475
498
  value: function () {
476
- var _json = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(dev, path) {
499
+ var _json = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(dev, path) {
477
500
  var params,
478
501
  tail,
479
502
  pid,
480
- _args14 = arguments;
481
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
482
- while (1) switch (_context14.prev = _context14.next) {
503
+ _args15 = arguments;
504
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
505
+ while (1) switch (_context15.prev = _context15.next) {
483
506
  case 0:
484
- params = _args14.length > 2 && _args14[2] !== undefined ? _args14[2] : {};
485
- tail = _args14.length > 3 ? _args14[3] : undefined;
507
+ params = _args15.length > 2 && _args15[2] !== undefined ? _args15[2] : {};
508
+ tail = _args15.length > 3 ? _args15[3] : undefined;
486
509
  pid = "";
487
510
  if (/^[a-zA-Z0-9_-]{43}$/.test(dev)) {
488
511
  pid = dev;
489
512
  dev = "process";
490
513
  }
491
- _context14.next = 6;
514
+ _context15.next = 6;
492
515
  return this.fetch(this.path(dev, path, true, params, pid, tail));
493
516
  case 6:
494
- return _context14.abrupt("return", _context14.sent);
517
+ return _context15.abrupt("return", _context15.sent);
495
518
  case 7:
496
519
  case "end":
497
- return _context14.stop();
520
+ return _context15.stop();
498
521
  }
499
- }, _callee14, this);
522
+ }, _callee15, this);
500
523
  }));
501
524
  function json(_x11, _x12) {
502
525
  return _json.apply(this, arguments);
@@ -514,24 +537,24 @@ var HB = /*#__PURE__*/function () {
514
537
  };
515
538
  return fetch;
516
539
  }(/*#__PURE__*/function () {
517
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(url) {
540
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(url) {
518
541
  var json,
519
- _args15 = arguments;
520
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
521
- while (1) switch (_context15.prev = _context15.next) {
542
+ _args16 = arguments;
543
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
544
+ while (1) switch (_context16.prev = _context16.next) {
522
545
  case 0:
523
- json = _args15.length > 1 && _args15[1] !== undefined ? _args15[1] : true;
524
- _context15.next = 3;
546
+ json = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : true;
547
+ _context16.next = 3;
525
548
  return fetch(url).then(function (r) {
526
549
  return json ? r.json() : r.text();
527
550
  });
528
551
  case 3:
529
- return _context15.abrupt("return", _context15.sent);
552
+ return _context16.abrupt("return", _context16.sent);
530
553
  case 4:
531
554
  case "end":
532
- return _context15.stop();
555
+ return _context16.stop();
533
556
  }
534
- }, _callee15);
557
+ }, _callee16);
535
558
  }));
536
559
  return function (_x13) {
537
560
  return _ref3.apply(this, arguments);
@@ -540,23 +563,23 @@ var HB = /*#__PURE__*/function () {
540
563
  }, {
541
564
  key: "computeAOS",
542
565
  value: function () {
543
- var _computeAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(_ref4) {
566
+ var _computeAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(_ref4) {
544
567
  var pid, slot;
545
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
546
- while (1) switch (_context16.prev = _context16.next) {
568
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
569
+ while (1) switch (_context17.prev = _context17.next) {
547
570
  case 0:
548
571
  pid = _ref4.pid, slot = _ref4.slot;
549
- _context16.next = 3;
572
+ _context17.next = 3;
550
573
  return fetch("".concat(this.url, "/").concat(pid, "/compute/results/outbox/~json@1.0/serialize?slot=").concat(slot)).then(function (r) {
551
574
  return r.json();
552
575
  });
553
576
  case 3:
554
- return _context16.abrupt("return", _context16.sent);
577
+ return _context17.abrupt("return", _context17.sent);
555
578
  case 4:
556
579
  case "end":
557
- return _context16.stop();
580
+ return _context17.stop();
558
581
  }
559
- }, _callee16, this);
582
+ }, _callee17, this);
560
583
  }));
561
584
  function computeAOS(_x14) {
562
585
  return _computeAOS.apply(this, arguments);
@@ -566,23 +589,23 @@ var HB = /*#__PURE__*/function () {
566
589
  }, {
567
590
  key: "computeLua",
568
591
  value: function () {
569
- var _computeLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(_ref5) {
592
+ var _computeLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(_ref5) {
570
593
  var pid, slot;
571
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
572
- while (1) switch (_context17.prev = _context17.next) {
594
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
595
+ while (1) switch (_context18.prev = _context18.next) {
573
596
  case 0:
574
597
  pid = _ref5.pid, slot = _ref5.slot;
575
- _context17.next = 3;
598
+ _context18.next = 3;
576
599
  return fetch("".concat(this.url, "/").concat(pid, "/compute/results/~json@1.0/serialize?slot=").concat(slot)).then(function (r) {
577
600
  return r.json();
578
601
  });
579
602
  case 3:
580
- return _context17.abrupt("return", _context17.sent);
603
+ return _context18.abrupt("return", _context18.sent);
581
604
  case 4:
582
605
  case "end":
583
- return _context17.stop();
606
+ return _context18.stop();
584
607
  }
585
- }, _callee17, this);
608
+ }, _callee18, this);
586
609
  }));
587
610
  function computeLua(_x15) {
588
611
  return _computeLua.apply(this, arguments);
@@ -592,23 +615,23 @@ var HB = /*#__PURE__*/function () {
592
615
  }, {
593
616
  key: "compute",
594
617
  value: function () {
595
- var _compute = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(_ref6) {
618
+ var _compute = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(_ref6) {
596
619
  var pid, slot;
597
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
598
- while (1) switch (_context18.prev = _context18.next) {
620
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
621
+ while (1) switch (_context19.prev = _context19.next) {
599
622
  case 0:
600
623
  pid = _ref6.pid, slot = _ref6.slot;
601
- _context18.next = 3;
624
+ _context19.next = 3;
602
625
  return fetch("".concat(this.url, "/").concat(pid, "/compute/~json@1.0/serialize?slot=").concat(slot)).then(function (r) {
603
626
  return r.json();
604
627
  });
605
628
  case 3:
606
- return _context18.abrupt("return", _context18.sent);
629
+ return _context19.abrupt("return", _context19.sent);
607
630
  case 4:
608
631
  case "end":
609
- return _context18.stop();
632
+ return _context19.stop();
610
633
  }
611
- }, _callee18, this);
634
+ }, _callee19, this);
612
635
  }));
613
636
  function compute(_x16) {
614
637
  return _compute.apply(this, arguments);
@@ -618,25 +641,25 @@ var HB = /*#__PURE__*/function () {
618
641
  }, {
619
642
  key: "computeLegacy",
620
643
  value: function () {
621
- var _computeLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(_ref7) {
644
+ var _computeLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(_ref7) {
622
645
  var pid, slot, json;
623
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
624
- while (1) switch (_context19.prev = _context19.next) {
646
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
647
+ while (1) switch (_context20.prev = _context20.next) {
625
648
  case 0:
626
649
  pid = _ref7.pid, slot = _ref7.slot;
627
- _context19.next = 3;
650
+ _context20.next = 3;
628
651
  return this.compute({
629
652
  pid: pid,
630
653
  slot: slot
631
654
  });
632
655
  case 3:
633
- json = _context19.sent;
634
- return _context19.abrupt("return", JSON.parse(json.results.json.body));
656
+ json = _context20.sent;
657
+ return _context20.abrupt("return", JSON.parse(json.results.json.body));
635
658
  case 5:
636
659
  case "end":
637
- return _context19.stop();
660
+ return _context20.stop();
638
661
  }
639
- }, _callee19, this);
662
+ }, _callee20, this);
640
663
  }));
641
664
  function computeLegacy(_x17) {
642
665
  return _computeLegacy.apply(this, arguments);
@@ -646,24 +669,24 @@ var HB = /*#__PURE__*/function () {
646
669
  }, {
647
670
  key: "spawn",
648
671
  value: function () {
649
- var _spawn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
672
+ var _spawn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
650
673
  var _this$scheduler;
651
674
  var tags,
652
675
  addr,
653
676
  res,
654
- _args20 = arguments;
655
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
656
- while (1) switch (_context20.prev = _context20.next) {
677
+ _args21 = arguments;
678
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
679
+ while (1) switch (_context21.prev = _context21.next) {
657
680
  case 0:
658
- tags = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : {};
659
- _context20.next = 3;
681
+ tags = _args21.length > 0 && _args21[0] !== undefined ? _args21[0] : {};
682
+ _context21.next = 3;
660
683
  return this.dev.meta.info({
661
684
  key: "address"
662
685
  });
663
686
  case 3:
664
- addr = _context20.sent;
687
+ addr = _context21.sent;
665
688
  (_this$scheduler = this.scheduler) !== null && _this$scheduler !== void 0 ? _this$scheduler : this.scheduler = addr;
666
- _context20.next = 7;
689
+ _context21.next = 7;
667
690
  return this.send((0, _ramda.mergeLeft)(tags, {
668
691
  device: "process@1.0",
669
692
  path: "/schedule",
@@ -674,55 +697,83 @@ var HB = /*#__PURE__*/function () {
674
697
  "execution-device": "test-device@1.0"
675
698
  }));
676
699
  case 7:
677
- res = _context20.sent;
678
- return _context20.abrupt("return", {
700
+ res = _context21.sent;
701
+ return _context21.abrupt("return", {
679
702
  res: res,
680
703
  pid: res.headers.get("process")
681
704
  });
682
705
  case 9:
683
706
  case "end":
684
- return _context20.stop();
707
+ return _context21.stop();
685
708
  }
686
- }, _callee20, this);
709
+ }, _callee21, this);
687
710
  }));
688
711
  function spawn() {
689
712
  return _spawn.apply(this, arguments);
690
713
  }
691
714
  return spawn;
692
715
  }()
716
+ }, {
717
+ key: "cacheModule",
718
+ value: function () {
719
+ var _cacheModule = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(data, type) {
720
+ var res;
721
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
722
+ while (1) switch (_context22.prev = _context22.next) {
723
+ case 0:
724
+ _context22.next = 2;
725
+ return this.send({
726
+ path: "/~wao@1.0/cache_module",
727
+ data: data,
728
+ type: type
729
+ });
730
+ case 2:
731
+ res = _context22.sent;
732
+ return _context22.abrupt("return", res.headers.get("id"));
733
+ case 4:
734
+ case "end":
735
+ return _context22.stop();
736
+ }
737
+ }, _callee22, this);
738
+ }));
739
+ function cacheModule(_x18, _x19) {
740
+ return _cacheModule.apply(this, arguments);
741
+ }
742
+ return cacheModule;
743
+ }()
693
744
  }, {
694
745
  key: "message",
695
746
  value: function () {
696
- var _message = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(args) {
747
+ var _message = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(args) {
697
748
  var pid, _yield$this$schedule, slot, res;
698
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
699
- while (1) switch (_context21.prev = _context21.next) {
749
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
750
+ while (1) switch (_context23.prev = _context23.next) {
700
751
  case 0:
701
752
  pid = args.pid;
702
- _context21.next = 3;
753
+ _context23.next = 3;
703
754
  return this.schedule(args);
704
755
  case 3:
705
- _yield$this$schedule = _context21.sent;
756
+ _yield$this$schedule = _context23.sent;
706
757
  slot = _yield$this$schedule.slot;
707
- _context21.next = 7;
758
+ _context23.next = 7;
708
759
  return this.compute({
709
760
  pid: pid,
710
761
  slot: slot
711
762
  });
712
763
  case 7:
713
- res = _context21.sent;
714
- return _context21.abrupt("return", {
764
+ res = _context23.sent;
765
+ return _context23.abrupt("return", {
715
766
  slot: slot,
716
767
  pid: pid,
717
768
  res: res
718
769
  });
719
770
  case 9:
720
771
  case "end":
721
- return _context21.stop();
772
+ return _context23.stop();
722
773
  }
723
- }, _callee21, this);
774
+ }, _callee23, this);
724
775
  }));
725
- function message(_x18) {
776
+ function message(_x20) {
726
777
  return _message.apply(this, arguments);
727
778
  }
728
779
  return message;
@@ -730,7 +781,7 @@ var HB = /*#__PURE__*/function () {
730
781
  }, {
731
782
  key: "scheduleLegacy",
732
783
  value: function () {
733
- var _scheduleLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
784
+ var _scheduleLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
734
785
  var _ref8,
735
786
  pid,
736
787
  _ref8$action,
@@ -739,13 +790,13 @@ var HB = /*#__PURE__*/function () {
739
790
  tags,
740
791
  data,
741
792
  scheduler,
742
- _args22 = arguments;
743
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
744
- while (1) switch (_context22.prev = _context22.next) {
793
+ _args24 = arguments;
794
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
795
+ while (1) switch (_context24.prev = _context24.next) {
745
796
  case 0:
746
- _ref8 = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {}, pid = _ref8.pid, _ref8$action = _ref8.action, action = _ref8$action === void 0 ? "Eval" : _ref8$action, _ref8$tags = _ref8.tags, tags = _ref8$tags === void 0 ? {} : _ref8$tags, data = _ref8.data, scheduler = _ref8.scheduler;
797
+ _ref8 = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {}, pid = _ref8.pid, _ref8$action = _ref8.action, action = _ref8$action === void 0 ? "Eval" : _ref8$action, _ref8$tags = _ref8.tags, tags = _ref8$tags === void 0 ? {} : _ref8$tags, data = _ref8.data, scheduler = _ref8.scheduler;
747
798
  if (action) tags.Action = action;
748
- _context22.next = 4;
799
+ _context24.next = 4;
749
800
  return this.schedule({
750
801
  pid: pid,
751
802
  tags: tags,
@@ -753,12 +804,12 @@ var HB = /*#__PURE__*/function () {
753
804
  scheduler: scheduler
754
805
  });
755
806
  case 4:
756
- return _context22.abrupt("return", _context22.sent);
807
+ return _context24.abrupt("return", _context24.sent);
757
808
  case 5:
758
809
  case "end":
759
- return _context22.stop();
810
+ return _context24.stop();
760
811
  }
761
- }, _callee22, this);
812
+ }, _callee24, this);
762
813
  }));
763
814
  function scheduleLegacy() {
764
815
  return _scheduleLegacy.apply(this, arguments);
@@ -768,20 +819,20 @@ var HB = /*#__PURE__*/function () {
768
819
  }, {
769
820
  key: "scheduleLua",
770
821
  value: function () {
771
- var _scheduleLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
772
- var _args23 = arguments;
773
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
774
- while (1) switch (_context23.prev = _context23.next) {
822
+ var _scheduleLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
823
+ var _args25 = arguments;
824
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
825
+ while (1) switch (_context25.prev = _context25.next) {
775
826
  case 0:
776
- _context23.next = 2;
777
- return this.scheduleLegacy.apply(this, _args23);
827
+ _context25.next = 2;
828
+ return this.scheduleLegacy.apply(this, _args25);
778
829
  case 2:
779
- return _context23.abrupt("return", _context23.sent);
830
+ return _context25.abrupt("return", _context25.sent);
780
831
  case 3:
781
832
  case "end":
782
- return _context23.stop();
833
+ return _context25.stop();
783
834
  }
784
- }, _callee23, this);
835
+ }, _callee25, this);
785
836
  }));
786
837
  function scheduleLua() {
787
838
  return _scheduleLua.apply(this, arguments);
@@ -791,7 +842,7 @@ var HB = /*#__PURE__*/function () {
791
842
  }, {
792
843
  key: "schedule",
793
844
  value: function () {
794
- var _schedule = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
845
+ var _schedule = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
795
846
  var _pid2, _scheduler;
796
847
  var _ref9,
797
848
  pid,
@@ -801,11 +852,11 @@ var HB = /*#__PURE__*/function () {
801
852
  scheduler,
802
853
  _tags,
803
854
  res,
804
- _args24 = arguments;
805
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
806
- while (1) switch (_context24.prev = _context24.next) {
855
+ _args26 = arguments;
856
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
857
+ while (1) switch (_context26.prev = _context26.next) {
807
858
  case 0:
808
- _ref9 = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {}, pid = _ref9.pid, _ref9$tags = _ref9.tags, tags = _ref9$tags === void 0 ? {} : _ref9$tags, data = _ref9.data, scheduler = _ref9.scheduler;
859
+ _ref9 = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {}, pid = _ref9.pid, _ref9$tags = _ref9.tags, tags = _ref9$tags === void 0 ? {} : _ref9$tags, data = _ref9.data, scheduler = _ref9.scheduler;
809
860
  (_pid2 = pid) !== null && _pid2 !== void 0 ? _pid2 : pid = this.pid;
810
861
  (_scheduler = scheduler) !== null && _scheduler !== void 0 ? _scheduler : scheduler = this.scheduler;
811
862
  _tags = (0, _ramda.mergeLeft)(tags, {
@@ -816,19 +867,19 @@ var HB = /*#__PURE__*/function () {
816
867
  Target: pid
817
868
  });
818
869
  if (data) _tags.data = data;
819
- _context24.next = 7;
870
+ _context26.next = 7;
820
871
  return this.send(_tags);
821
872
  case 7:
822
- res = _context24.sent;
823
- return _context24.abrupt("return", {
873
+ res = _context26.sent;
874
+ return _context26.abrupt("return", {
824
875
  slot: res.headers.get("slot"),
825
876
  res: res
826
877
  });
827
878
  case 9:
828
879
  case "end":
829
- return _context24.stop();
880
+ return _context26.stop();
830
881
  }
831
- }, _callee24, this);
882
+ }, _callee26, this);
832
883
  }));
833
884
  function schedule() {
834
885
  return _schedule.apply(this, arguments);
@@ -838,43 +889,43 @@ var HB = /*#__PURE__*/function () {
838
889
  }, {
839
890
  key: "spawnAOS",
840
891
  value: function () {
841
- var _spawnAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(image) {
892
+ var _spawnAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(image) {
842
893
  var _this$scheduler2, _image, _this$image2, _this$pid;
843
894
  var addr, res, pid;
844
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
845
- while (1) switch (_context25.prev = _context25.next) {
895
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
896
+ while (1) switch (_context27.prev = _context27.next) {
846
897
  case 0:
847
- _context25.next = 2;
898
+ _context27.next = 2;
848
899
  return this.dev.meta.info({
849
900
  key: "address"
850
901
  });
851
902
  case 2:
852
- addr = _context25.sent;
903
+ addr = _context27.sent;
853
904
  (_this$scheduler2 = this.scheduler) !== null && _this$scheduler2 !== void 0 ? _this$scheduler2 : this.scheduler = addr;
854
905
  if (!((_image = image) !== null && _image !== void 0)) {
855
- _context25.next = 8;
906
+ _context27.next = 8;
856
907
  break;
857
908
  }
858
909
  _image;
859
- _context25.next = 16;
910
+ _context27.next = 16;
860
911
  break;
861
912
  case 8:
862
913
  if (!((_this$image2 = this.image) !== null && _this$image2 !== void 0)) {
863
- _context25.next = 12;
914
+ _context27.next = 12;
864
915
  break;
865
916
  }
866
- _context25.t0 = _this$image2;
867
- _context25.next = 15;
917
+ _context27.t0 = _this$image2;
918
+ _context27.next = 15;
868
919
  break;
869
920
  case 12:
870
- _context25.next = 14;
921
+ _context27.next = 14;
871
922
  return this.getImage();
872
923
  case 14:
873
- _context25.t0 = _context25.sent;
924
+ _context27.t0 = _context27.sent;
874
925
  case 15:
875
- image = _context25.t0;
926
+ image = _context27.t0;
876
927
  case 16:
877
- _context25.next = 18;
928
+ _context27.next = 18;
878
929
  return this.send({
879
930
  device: "process@1.0",
880
931
  path: "/schedule",
@@ -895,20 +946,20 @@ var HB = /*#__PURE__*/function () {
895
946
  passes: 2
896
947
  });
897
948
  case 18:
898
- res = _context25.sent;
949
+ res = _context27.sent;
899
950
  pid = res.headers.get("process");
900
951
  (_this$pid = this.pid) !== null && _this$pid !== void 0 ? _this$pid : this.pid = pid;
901
- return _context25.abrupt("return", {
952
+ return _context27.abrupt("return", {
902
953
  pid: pid,
903
954
  res: res
904
955
  });
905
956
  case 22:
906
957
  case "end":
907
- return _context25.stop();
958
+ return _context27.stop();
908
959
  }
909
- }, _callee25, this);
960
+ }, _callee27, this);
910
961
  }));
911
- function spawnAOS(_x19) {
962
+ function spawnAOS(_x21) {
912
963
  return _spawnAOS.apply(this, arguments);
913
964
  }
914
965
  return spawnAOS;
@@ -916,48 +967,43 @@ var HB = /*#__PURE__*/function () {
916
967
  }, {
917
968
  key: "spawnLua",
918
969
  value: function () {
919
- var _spawnLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
970
+ var _spawnLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(lua) {
920
971
  var _this$scheduler3, _lua, _this$lua2, _this$pid2;
921
- var lua,
922
- addr,
923
- res,
924
- pid,
925
- _args26 = arguments;
926
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
927
- while (1) switch (_context26.prev = _context26.next) {
972
+ var addr, res, pid;
973
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
974
+ while (1) switch (_context28.prev = _context28.next) {
928
975
  case 0:
929
- lua = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : "8DvyaxF8xpHMgPdmpMnhcb1mjY-M8qr2kGxnCpGMb60";
930
- _context26.next = 3;
976
+ _context28.next = 2;
931
977
  return this.dev.meta.info({
932
978
  key: "address"
933
979
  });
934
- case 3:
935
- addr = _context26.sent;
980
+ case 2:
981
+ addr = _context28.sent;
936
982
  (_this$scheduler3 = this.scheduler) !== null && _this$scheduler3 !== void 0 ? _this$scheduler3 : this.scheduler = addr;
937
983
  if (!((_lua = lua) !== null && _lua !== void 0)) {
938
- _context26.next = 9;
984
+ _context28.next = 8;
939
985
  break;
940
986
  }
941
987
  _lua;
942
- _context26.next = 17;
988
+ _context28.next = 16;
943
989
  break;
944
- case 9:
990
+ case 8:
945
991
  if (!((_this$lua2 = this.lua) !== null && _this$lua2 !== void 0)) {
946
- _context26.next = 13;
992
+ _context28.next = 12;
947
993
  break;
948
994
  }
949
- _context26.t0 = _this$lua2;
950
- _context26.next = 16;
995
+ _context28.t0 = _this$lua2;
996
+ _context28.next = 15;
951
997
  break;
952
- case 13:
953
- _context26.next = 15;
998
+ case 12:
999
+ _context28.next = 14;
954
1000
  return this.getLua();
1001
+ case 14:
1002
+ _context28.t0 = _context28.sent;
955
1003
  case 15:
956
- _context26.t0 = _context26.sent;
1004
+ lua = _context28.t0;
957
1005
  case 16:
958
- lua = _context26.t0;
959
- case 17:
960
- _context26.next = 19;
1006
+ _context28.next = 18;
961
1007
  return this.send({
962
1008
  device: "process@1.0",
963
1009
  path: "/schedule",
@@ -973,21 +1019,21 @@ var HB = /*#__PURE__*/function () {
973
1019
  "execution-device": "lua@5.3a",
974
1020
  "patch-from": "/results/outbox"
975
1021
  });
976
- case 19:
977
- res = _context26.sent;
1022
+ case 18:
1023
+ res = _context28.sent;
978
1024
  pid = res.headers.get("process");
979
1025
  (_this$pid2 = this.pid) !== null && _this$pid2 !== void 0 ? _this$pid2 : this.pid = pid;
980
- return _context26.abrupt("return", {
1026
+ return _context28.abrupt("return", {
981
1027
  pid: pid,
982
1028
  res: res
983
1029
  });
984
- case 23:
1030
+ case 22:
985
1031
  case "end":
986
- return _context26.stop();
1032
+ return _context28.stop();
987
1033
  }
988
- }, _callee26, this);
1034
+ }, _callee28, this);
989
1035
  }));
990
- function spawnLua() {
1036
+ function spawnLua(_x22) {
991
1037
  return _spawnLua.apply(this, arguments);
992
1038
  }
993
1039
  return spawnLua;
@@ -1077,7 +1123,7 @@ var HB = /*#__PURE__*/function () {
1077
1123
  }, {
1078
1124
  key: "messages",
1079
1125
  value: function () {
1080
- var _messages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
1126
+ var _messages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
1081
1127
  var _this2 = this;
1082
1128
  var _ref10,
1083
1129
  pid,
@@ -1086,29 +1132,29 @@ var HB = /*#__PURE__*/function () {
1086
1132
  limit,
1087
1133
  params,
1088
1134
  res,
1089
- _args28 = arguments;
1090
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
1091
- while (1) switch (_context28.prev = _context28.next) {
1135
+ _args30 = arguments;
1136
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
1137
+ while (1) switch (_context30.prev = _context30.next) {
1092
1138
  case 0:
1093
- _ref10 = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : {}, pid = _ref10.pid, from = _ref10.from, to = _ref10.to, limit = _ref10.limit;
1139
+ _ref10 = _args30.length > 0 && _args30[0] !== undefined ? _args30[0] : {}, pid = _ref10.pid, from = _ref10.from, to = _ref10.to, limit = _ref10.limit;
1094
1140
  params = "target=".concat(pid);
1095
1141
  if ((0, _ramda.isNotNil)(from)) params += "&from=".concat(from);
1096
1142
  if ((0, _ramda.isNotNil)(to)) params += "&to=".concat(to);
1097
1143
  params += "&accept=application/aos-2";
1098
- _context28.next = 7;
1144
+ _context30.next = 7;
1099
1145
  return fetch("".concat(this.url, "/~scheduler@1.0/schedule?").concat(params)).then(function (r) {
1100
1146
  return r.json();
1101
1147
  });
1102
1148
  case 7:
1103
- res = _context28.sent;
1149
+ res = _context30.sent;
1104
1150
  if (res.page_info.has_next_page) {
1105
- res.next = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
1151
+ res.next = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
1106
1152
  var from2;
1107
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
1108
- while (1) switch (_context27.prev = _context27.next) {
1153
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
1154
+ while (1) switch (_context29.prev = _context29.next) {
1109
1155
  case 0:
1110
1156
  from2 = (0, _ramda.last)(res.edges).cursor + 1;
1111
- _context27.next = 3;
1157
+ _context29.next = 3;
1112
1158
  return _this2.message({
1113
1159
  pid: pid,
1114
1160
  from: from2,
@@ -1116,20 +1162,20 @@ var HB = /*#__PURE__*/function () {
1116
1162
  limit: limit
1117
1163
  });
1118
1164
  case 3:
1119
- return _context27.abrupt("return", _context27.sent);
1165
+ return _context29.abrupt("return", _context29.sent);
1120
1166
  case 4:
1121
1167
  case "end":
1122
- return _context27.stop();
1168
+ return _context29.stop();
1123
1169
  }
1124
- }, _callee27);
1170
+ }, _callee29);
1125
1171
  }));
1126
1172
  }
1127
- return _context28.abrupt("return", res);
1173
+ return _context30.abrupt("return", res);
1128
1174
  case 10:
1129
1175
  case "end":
1130
- return _context28.stop();
1176
+ return _context30.stop();
1131
1177
  }
1132
- }, _callee28, this);
1178
+ }, _callee30, this);
1133
1179
  }));
1134
1180
  function messages() {
1135
1181
  return _messages.apply(this, arguments);
@@ -1139,16 +1185,17 @@ var HB = /*#__PURE__*/function () {
1139
1185
  }, {
1140
1186
  key: "spawnLegacy",
1141
1187
  value: function () {
1142
- var _spawnLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
1188
+ var _spawnLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
1143
1189
  var _ref12,
1190
+ module,
1144
1191
  _ref12$tags,
1145
1192
  tags,
1146
1193
  data,
1147
- _args29 = arguments;
1148
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
1149
- while (1) switch (_context29.prev = _context29.next) {
1194
+ _args31 = arguments;
1195
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
1196
+ while (1) switch (_context31.prev = _context31.next) {
1150
1197
  case 0:
1151
- _ref12 = _args29.length > 0 && _args29[0] !== undefined ? _args29[0] : {}, _ref12$tags = _ref12.tags, tags = _ref12$tags === void 0 ? {} : _ref12$tags, data = _ref12.data;
1198
+ _ref12 = _args31.length > 0 && _args31[0] !== undefined ? _args31[0] : {}, module = _ref12.module, _ref12$tags = _ref12.tags, tags = _ref12$tags === void 0 ? {} : _ref12$tags, data = _ref12.data;
1152
1199
  tags = (0, _ramda.mergeLeft)(tags, {
1153
1200
  data: data,
1154
1201
  Type: "Process",
@@ -1158,43 +1205,30 @@ var HB = /*#__PURE__*/function () {
1158
1205
  Authority: this._info.address,
1159
1206
  "scheduler-location": this._info.address,
1160
1207
  "random-seed": seed(16),
1161
- module: "JArYBF-D8q2OmZ4Mok00sD2Y_6SYEQ7Hjx-6VZ_jl3g",
1208
+ module: "ISShJH1ij-hPPt9St5UFFr_8Ys3Kj5cyg7zrMGt7H9s",
1162
1209
  device: "process@1.0",
1163
1210
  "scheduler-device": "scheduler@1.0",
1164
1211
  "execution-device": "genesis-wasm@1.0"
1165
1212
  });
1166
- _context29.next = 4;
1213
+ _context31.next = 4;
1167
1214
  return this.spawn(tags);
1168
1215
  case 4:
1169
- return _context29.abrupt("return", _context29.sent);
1216
+ return _context31.abrupt("return", _context31.sent);
1170
1217
  case 5:
1171
1218
  case "end":
1172
- return _context29.stop();
1219
+ return _context31.stop();
1173
1220
  }
1174
- }, _callee29, this);
1221
+ }, _callee31, this);
1175
1222
  }));
1176
1223
  function spawnLegacy() {
1177
1224
  return _spawnLegacy.apply(this, arguments);
1178
1225
  }
1179
1226
  return spawnLegacy;
1180
1227
  }()
1181
- /*
1182
- async scheduleLegacy({ tags = {}, data, process, action = "Eval" } = {}) {
1183
- tags = mergeLeft(tags, {
1184
- path: `${process}/schedule`,
1185
- type: "Message",
1186
- action,
1187
- data,
1188
- "Data-Protocol": "ao",
1189
- Variant: "ao.N.1",
1190
- })
1191
- return (await this.post({ tags })).slot.text()
1192
- }
1193
- */
1194
1228
  }, {
1195
1229
  key: "dryrun",
1196
- value: (function () {
1197
- var _dryrun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
1230
+ value: function () {
1231
+ var _dryrun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
1198
1232
  var _ref13,
1199
1233
  _ref13$tags,
1200
1234
  tags,
@@ -1203,17 +1237,17 @@ var HB = /*#__PURE__*/function () {
1203
1237
  data,
1204
1238
  json,
1205
1239
  res,
1206
- _args30 = arguments;
1207
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
1208
- while (1) switch (_context30.prev = _context30.next) {
1240
+ _args32 = arguments;
1241
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
1242
+ while (1) switch (_context32.prev = _context32.next) {
1209
1243
  case 0:
1210
- _ref13 = _args30.length > 0 && _args30[0] !== undefined ? _args30[0] : {}, _ref13$tags = _ref13.tags, tags = _ref13$tags === void 0 ? {} : _ref13$tags, pid = _ref13.pid, action = _ref13.action, data = _ref13.data;
1244
+ _ref13 = _args32.length > 0 && _args32[0] !== undefined ? _args32[0] : {}, _ref13$tags = _ref13.tags, tags = _ref13$tags === void 0 ? {} : _ref13$tags, pid = _ref13.pid, action = _ref13.action, data = _ref13.data;
1211
1245
  if (typeof action === "string") tags.Action = action;
1212
1246
  json = {
1213
1247
  Tags: (0, _utils.buildTags)(tags)
1214
1248
  };
1215
1249
  if (data) json.Data = data;
1216
- _context30.next = 6;
1250
+ _context32.next = 6;
1217
1251
  return this.send({
1218
1252
  path: "/~relay@1.0/call",
1219
1253
  "relay-method": "POST",
@@ -1222,43 +1256,43 @@ var HB = /*#__PURE__*/function () {
1222
1256
  body: JSON.stringify(json)
1223
1257
  });
1224
1258
  case 6:
1225
- res = _context30.sent;
1226
- return _context30.abrupt("return", JSON.parse(res.body));
1259
+ res = _context32.sent;
1260
+ return _context32.abrupt("return", JSON.parse(res.body));
1227
1261
  case 8:
1228
1262
  case "end":
1229
- return _context30.stop();
1263
+ return _context32.stop();
1230
1264
  }
1231
- }, _callee30, this);
1265
+ }, _callee32, this);
1232
1266
  }));
1233
1267
  function dryrun() {
1234
1268
  return _dryrun.apply(this, arguments);
1235
1269
  }
1236
1270
  return dryrun;
1237
- }())
1271
+ }()
1238
1272
  }, {
1239
1273
  key: "get",
1240
1274
  value: function () {
1241
- var _get = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(_ref14) {
1275
+ var _get = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(_ref14) {
1242
1276
  var device, _ref14$path, path;
1243
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
1244
- while (1) switch (_context31.prev = _context31.next) {
1277
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
1278
+ while (1) switch (_context33.prev = _context33.next) {
1245
1279
  case 0:
1246
1280
  device = _ref14.device, _ref14$path = _ref14.path, path = _ref14$path === void 0 ? "~meta@1.0/info" : _ref14$path;
1247
- _context31.next = 3;
1281
+ _context33.next = 3;
1248
1282
  return this.request({
1249
1283
  device: device,
1250
1284
  path: path,
1251
1285
  method: "GET"
1252
1286
  });
1253
1287
  case 3:
1254
- return _context31.abrupt("return", _context31.sent.body);
1288
+ return _context33.abrupt("return", _context33.sent.body);
1255
1289
  case 4:
1256
1290
  case "end":
1257
- return _context31.stop();
1291
+ return _context33.stop();
1258
1292
  }
1259
- }, _callee31, this);
1293
+ }, _callee33, this);
1260
1294
  }));
1261
- function get(_x20) {
1295
+ function get(_x23) {
1262
1296
  return _get.apply(this, arguments);
1263
1297
  }
1264
1298
  return get;
@@ -1266,13 +1300,13 @@ var HB = /*#__PURE__*/function () {
1266
1300
  }, {
1267
1301
  key: "post",
1268
1302
  value: function () {
1269
- var _post = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(_ref15) {
1303
+ var _post = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(_ref15) {
1270
1304
  var device, tags, _ref15$path, path;
1271
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
1272
- while (1) switch (_context32.prev = _context32.next) {
1305
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
1306
+ while (1) switch (_context34.prev = _context34.next) {
1273
1307
  case 0:
1274
1308
  device = _ref15.device, tags = _ref15.tags, _ref15$path = _ref15.path, path = _ref15$path === void 0 ? "/schedule" : _ref15$path;
1275
- _context32.next = 3;
1309
+ _context34.next = 3;
1276
1310
  return this.request({
1277
1311
  tags: tags,
1278
1312
  device: device,
@@ -1280,14 +1314,14 @@ var HB = /*#__PURE__*/function () {
1280
1314
  method: "POST"
1281
1315
  });
1282
1316
  case 3:
1283
- return _context32.abrupt("return", _context32.sent);
1317
+ return _context34.abrupt("return", _context34.sent);
1284
1318
  case 4:
1285
1319
  case "end":
1286
- return _context32.stop();
1320
+ return _context34.stop();
1287
1321
  }
1288
- }, _callee32, this);
1322
+ }, _callee34, this);
1289
1323
  }));
1290
- function post(_x21) {
1324
+ function post(_x24) {
1291
1325
  return _post.apply(this, arguments);
1292
1326
  }
1293
1327
  return post;
@@ -1295,10 +1329,10 @@ var HB = /*#__PURE__*/function () {
1295
1329
  }, {
1296
1330
  key: "request",
1297
1331
  value: function () {
1298
- var _request = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(_ref16) {
1332
+ var _request = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(_ref16) {
1299
1333
  var device, tags, _ref16$method, method, _ref16$path, path, _tags;
1300
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
1301
- while (1) switch (_context33.prev = _context33.next) {
1334
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
1335
+ while (1) switch (_context35.prev = _context35.next) {
1302
1336
  case 0:
1303
1337
  device = _ref16.device, tags = _ref16.tags, _ref16$method = _ref16.method, method = _ref16$method === void 0 ? "POST" : _ref16$method, _ref16$path = _ref16.path, path = _ref16$path === void 0 ? "/schedule" : _ref16$path;
1304
1338
  _tags = (0, _ramda.mergeLeft)(tags, {
@@ -1306,17 +1340,17 @@ var HB = /*#__PURE__*/function () {
1306
1340
  method: method
1307
1341
  });
1308
1342
  if (device) _tags.device = device;
1309
- _context33.next = 5;
1343
+ _context35.next = 5;
1310
1344
  return this._request(_tags);
1311
1345
  case 5:
1312
- return _context33.abrupt("return", _context33.sent);
1346
+ return _context35.abrupt("return", _context35.sent);
1313
1347
  case 6:
1314
1348
  case "end":
1315
- return _context33.stop();
1349
+ return _context35.stop();
1316
1350
  }
1317
- }, _callee33, this);
1351
+ }, _callee35, this);
1318
1352
  }));
1319
- function request(_x22) {
1353
+ function request(_x25) {
1320
1354
  return _request.apply(this, arguments);
1321
1355
  }
1322
1356
  return request;