wao 0.35.7 → 0.36.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.
Files changed (3) hide show
  1. package/cjs/hb.js +635 -507
  2. package/esm/hb.js +70 -13
  3. package/package.json +3 -2
package/cjs/hb.js CHANGED
@@ -1,23 +1,25 @@
1
1
  "use strict";
2
2
 
3
+ 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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports["default"] = void 0;
7
8
  var _aoconnect = require("@permaweb/aoconnect");
9
+ var _hbsig = require("hbsig");
8
10
  var _ramda = require("ramda");
9
11
  var _utils = require("./utils.js");
10
- var _hbsig = require("hbsig");
11
12
  var _hyperAos = _interopRequireDefault(require("./hyper-aos.js"));
12
13
  var _aos_wamr = _interopRequireDefault(require("./aos_wamr.js"));
13
14
  var _httpsigUtils = require("./httpsig-utils.js");
15
+ var _sdk = require("@ar.io/sdk");
16
+ var _arbundles = require("@dha-team/arbundles");
14
17
  var _excluded = ["path"],
15
18
  _excluded2 = ["action", "tags"],
16
19
  _excluded3 = ["action", "tags"],
17
20
  _excluded4 = ["path"],
18
21
  _excluded5 = ["action", "tags"];
19
22
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
20
- 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); }
21
23
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
22
24
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
23
25
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -27,24 +29,55 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
27
29
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
28
30
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
29
31
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
30
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
31
32
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
32
33
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
33
- function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
34
- function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
35
34
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
36
35
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
37
36
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
38
37
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
39
38
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
39
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
40
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
41
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
42
+ var toMsg = /*#__PURE__*/function () {
43
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req) {
44
+ var _req$headers, _req$text;
45
+ var msg;
46
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
47
+ while (1) switch (_context.prev = _context.next) {
48
+ case 0:
49
+ msg = {};
50
+ req === null || req === void 0 || (_req$headers = req.headers) === null || _req$headers === void 0 || _req$headers.forEach(function (v, k) {
51
+ msg[k] = v;
52
+ });
53
+ if (!req.body) {
54
+ _context.next = 6;
55
+ break;
56
+ }
57
+ _context.next = 5;
58
+ return (_req$text = req.text) === null || _req$text === void 0 ? void 0 : _req$text.call(req);
59
+ case 5:
60
+ msg.body = _context.sent;
61
+ case 6:
62
+ return _context.abrupt("return", msg);
63
+ case 7:
64
+ case "end":
65
+ return _context.stop();
66
+ }
67
+ }, _callee);
68
+ }));
69
+ return function toMsg(_x) {
70
+ return _ref.apply(this, arguments);
71
+ };
72
+ }();
40
73
  var HB = /*#__PURE__*/function () {
41
74
  function HB() {
42
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
43
- _ref$url = _ref.url,
44
- url = _ref$url === void 0 ? "http://localhost:10001" : _ref$url,
45
- _ref$cu = _ref.cu,
46
- cu = _ref$cu === void 0 ? "http://localhost:6363" : _ref$cu,
47
- jwk = _ref.jwk;
75
+ var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
76
+ _ref2$url = _ref2.url,
77
+ url = _ref2$url === void 0 ? "http://localhost:10001" : _ref2$url,
78
+ _ref2$cu = _ref2.cu,
79
+ cu = _ref2$cu === void 0 ? "http://localhost:6363" : _ref2$cu,
80
+ jwk = _ref2.jwk;
48
81
  _classCallCheck(this, HB);
49
82
  this.cu = cu;
50
83
  this.url = url;
@@ -53,13 +86,13 @@ var HB = /*#__PURE__*/function () {
53
86
  return _createClass(HB, [{
54
87
  key: "signEncoded",
55
88
  value: function () {
56
- var _signEncoded = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(encoded) {
89
+ var _signEncoded = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(encoded) {
57
90
  var path, msg;
58
- return _regeneratorRuntime().wrap(function _callee$(_context) {
59
- while (1) switch (_context.prev = _context.next) {
91
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
92
+ while (1) switch (_context2.prev = _context2.next) {
60
93
  case 0:
61
94
  path = encoded.path, msg = _objectWithoutProperties(encoded, _excluded);
62
- _context.next = 3;
95
+ _context2.next = 3;
63
96
  return (0, _hbsig.sign)({
64
97
  jwk: this.jwk,
65
98
  msg: msg,
@@ -67,14 +100,14 @@ var HB = /*#__PURE__*/function () {
67
100
  url: this.url
68
101
  });
69
102
  case 3:
70
- return _context.abrupt("return", _context.sent);
103
+ return _context2.abrupt("return", _context2.sent);
71
104
  case 4:
72
105
  case "end":
73
- return _context.stop();
106
+ return _context2.stop();
74
107
  }
75
- }, _callee, this);
108
+ }, _callee2, this);
76
109
  }));
77
- function signEncoded(_x) {
110
+ function signEncoded(_x2) {
78
111
  return _signEncoded.apply(this, arguments);
79
112
  }
80
113
  return signEncoded;
@@ -99,30 +132,30 @@ var HB = /*#__PURE__*/function () {
99
132
  }, {
100
133
  key: "setInfo",
101
134
  value: function () {
102
- var _setInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
103
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
104
- while (1) switch (_context2.prev = _context2.next) {
135
+ var _setInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
136
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
137
+ while (1) switch (_context3.prev = _context3.next) {
105
138
  case 0:
106
139
  if (this.operator) {
107
- _context2.next = 10;
140
+ _context3.next = 10;
108
141
  break;
109
142
  }
110
- _context2.prev = 1;
111
- _context2.next = 4;
143
+ _context3.prev = 1;
144
+ _context3.next = 4;
112
145
  return this.g("/~meta@1.0/info/address");
113
146
  case 4:
114
- this.operator = _context2.sent;
115
- _context2.next = 10;
147
+ this.operator = _context3.sent;
148
+ _context3.next = 10;
116
149
  break;
117
150
  case 7:
118
- _context2.prev = 7;
119
- _context2.t0 = _context2["catch"](1);
120
- console.log(_context2.t0);
151
+ _context3.prev = 7;
152
+ _context3.t0 = _context3["catch"](1);
153
+ console.log(_context3.t0);
121
154
  case 10:
122
155
  case "end":
123
- return _context2.stop();
156
+ return _context3.stop();
124
157
  }
125
- }, _callee2, this, [[1, 7]]);
158
+ }, _callee3, this, [[1, 7]]);
126
159
  }));
127
160
  function setInfo() {
128
161
  return _setInfo.apply(this, arguments);
@@ -132,22 +165,22 @@ var HB = /*#__PURE__*/function () {
132
165
  }, {
133
166
  key: "init",
134
167
  value: function () {
135
- var _init2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(jwk) {
136
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
137
- while (1) switch (_context3.prev = _context3.next) {
168
+ var _init2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(jwk) {
169
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
170
+ while (1) switch (_context4.prev = _context4.next) {
138
171
  case 0:
139
172
  this._init(jwk);
140
- _context3.next = 3;
173
+ _context4.next = 3;
141
174
  return this.setInfo();
142
175
  case 3:
143
- return _context3.abrupt("return", this);
176
+ return _context4.abrupt("return", this);
144
177
  case 4:
145
178
  case "end":
146
- return _context3.stop();
179
+ return _context4.stop();
147
180
  }
148
- }, _callee3, this);
181
+ }, _callee4, this);
149
182
  }));
150
- function init(_x2) {
183
+ function init(_x3) {
151
184
  return _init2.apply(this, arguments);
152
185
  }
153
186
  return init;
@@ -155,21 +188,21 @@ var HB = /*#__PURE__*/function () {
155
188
  }, {
156
189
  key: "send",
157
190
  value: function () {
158
- var _send2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(msg) {
159
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
160
- while (1) switch (_context4.prev = _context4.next) {
191
+ var _send2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(msg) {
192
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
193
+ while (1) switch (_context5.prev = _context5.next) {
161
194
  case 0:
162
- _context4.next = 2;
195
+ _context5.next = 2;
163
196
  return (0, _hbsig.send)(msg);
164
197
  case 2:
165
- return _context4.abrupt("return", _context4.sent);
198
+ return _context5.abrupt("return", _context5.sent);
166
199
  case 3:
167
200
  case "end":
168
- return _context4.stop();
201
+ return _context5.stop();
169
202
  }
170
- }, _callee4);
203
+ }, _callee5);
171
204
  }));
172
- function send(_x3) {
205
+ function send(_x4) {
173
206
  return _send2.apply(this, arguments);
174
207
  }
175
208
  return send;
@@ -177,24 +210,24 @@ var HB = /*#__PURE__*/function () {
177
210
  }, {
178
211
  key: "getImage",
179
212
  value: function () {
180
- var _getImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
213
+ var _getImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
181
214
  var _this$image;
182
215
  var wasm, id;
183
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
184
- while (1) switch (_context5.prev = _context5.next) {
216
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
217
+ while (1) switch (_context6.prev = _context6.next) {
185
218
  case 0:
186
219
  wasm = Buffer.from(_aos_wamr["default"], "base64");
187
- _context5.next = 3;
220
+ _context6.next = 3;
188
221
  return this.cacheBinary(wasm, "application/wasm");
189
222
  case 3:
190
- id = _context5.sent;
223
+ id = _context6.sent;
191
224
  (_this$image = this.image) !== null && _this$image !== void 0 ? _this$image : this.image = id;
192
- return _context5.abrupt("return", id);
225
+ return _context6.abrupt("return", id);
193
226
  case 6:
194
227
  case "end":
195
- return _context5.stop();
228
+ return _context6.stop();
196
229
  }
197
- }, _callee5, this);
230
+ }, _callee6, this);
198
231
  }));
199
232
  function getImage() {
200
233
  return _getImage.apply(this, arguments);
@@ -204,24 +237,24 @@ var HB = /*#__PURE__*/function () {
204
237
  }, {
205
238
  key: "getLua",
206
239
  value: function () {
207
- var _getLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
240
+ var _getLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
208
241
  var _this$lua;
209
242
  var lua, id;
210
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
211
- while (1) switch (_context6.prev = _context6.next) {
243
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
244
+ while (1) switch (_context7.prev = _context7.next) {
212
245
  case 0:
213
246
  lua = Buffer.from(_hyperAos["default"], "base64");
214
- _context6.next = 3;
247
+ _context7.next = 3;
215
248
  return this.cacheScript(lua, "application/lua");
216
249
  case 3:
217
- id = _context6.sent;
250
+ id = _context7.sent;
218
251
  (_this$lua = this.lua) !== null && _this$lua !== void 0 ? _this$lua : this.lua = id;
219
- return _context6.abrupt("return", id);
252
+ return _context7.abrupt("return", id);
220
253
  case 6:
221
254
  case "end":
222
- return _context6.stop();
255
+ return _context7.stop();
223
256
  }
224
- }, _callee6, this);
257
+ }, _callee7, this);
225
258
  }));
226
259
  function getLua() {
227
260
  return _getLua.apply(this, arguments);
@@ -231,36 +264,36 @@ var HB = /*#__PURE__*/function () {
231
264
  }, {
232
265
  key: "messageAOS",
233
266
  value: function () {
234
- var _messageAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(args) {
267
+ var _messageAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(args) {
235
268
  var _yield$this$scheduleA, slot, pid;
236
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
237
- while (1) switch (_context7.prev = _context7.next) {
269
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
270
+ while (1) switch (_context8.prev = _context8.next) {
238
271
  case 0:
239
- _context7.next = 2;
272
+ _context8.next = 2;
240
273
  return this.scheduleAOS(args);
241
274
  case 2:
242
- _yield$this$scheduleA = _context7.sent;
275
+ _yield$this$scheduleA = _context8.sent;
243
276
  slot = _yield$this$scheduleA.slot;
244
277
  pid = _yield$this$scheduleA.pid;
245
- _context7.t0 = slot;
246
- _context7.next = 8;
278
+ _context8.t0 = slot;
279
+ _context8.next = 8;
247
280
  return this.computeAOS({
248
281
  pid: pid,
249
282
  slot: slot
250
283
  });
251
284
  case 8:
252
- _context7.t1 = _context7.sent;
253
- return _context7.abrupt("return", {
254
- slot: _context7.t0,
255
- outbox: _context7.t1
285
+ _context8.t1 = _context8.sent;
286
+ return _context8.abrupt("return", {
287
+ slot: _context8.t0,
288
+ outbox: _context8.t1
256
289
  });
257
290
  case 10:
258
291
  case "end":
259
- return _context7.stop();
292
+ return _context8.stop();
260
293
  }
261
- }, _callee7, this);
294
+ }, _callee8, this);
262
295
  }));
263
- function messageAOS(_x4) {
296
+ function messageAOS(_x5) {
264
297
  return _messageAOS.apply(this, arguments);
265
298
  }
266
299
  return messageAOS;
@@ -268,36 +301,36 @@ var HB = /*#__PURE__*/function () {
268
301
  }, {
269
302
  key: "messageLegacy",
270
303
  value: function () {
271
- var _messageLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(args) {
304
+ var _messageLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(args) {
272
305
  var _yield$this$scheduleL, slot, pid;
273
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
274
- while (1) switch (_context8.prev = _context8.next) {
306
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
307
+ while (1) switch (_context9.prev = _context9.next) {
275
308
  case 0:
276
- _context8.next = 2;
309
+ _context9.next = 2;
277
310
  return this.scheduleLegacy(args);
278
311
  case 2:
279
- _yield$this$scheduleL = _context8.sent;
312
+ _yield$this$scheduleL = _context9.sent;
280
313
  slot = _yield$this$scheduleL.slot;
281
314
  pid = _yield$this$scheduleL.pid;
282
- _context8.t0 = slot;
283
- _context8.next = 8;
315
+ _context9.t0 = slot;
316
+ _context9.next = 8;
284
317
  return this.computeLegacy({
285
318
  pid: pid,
286
319
  slot: slot
287
320
  });
288
321
  case 8:
289
- _context8.t1 = _context8.sent;
290
- return _context8.abrupt("return", {
291
- slot: _context8.t0,
292
- res: _context8.t1
322
+ _context9.t1 = _context9.sent;
323
+ return _context9.abrupt("return", {
324
+ slot: _context9.t0,
325
+ res: _context9.t1
293
326
  });
294
327
  case 10:
295
328
  case "end":
296
- return _context8.stop();
329
+ return _context9.stop();
297
330
  }
298
- }, _callee8, this);
331
+ }, _callee9, this);
299
332
  }));
300
- function messageLegacy(_x5) {
333
+ function messageLegacy(_x6) {
301
334
  return _messageLegacy.apply(this, arguments);
302
335
  }
303
336
  return messageLegacy;
@@ -305,26 +338,26 @@ var HB = /*#__PURE__*/function () {
305
338
  }, {
306
339
  key: "computeAOS",
307
340
  value: function () {
308
- var _computeAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_ref2) {
341
+ var _computeAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_ref3) {
309
342
  var pid, slot;
310
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
311
- while (1) switch (_context9.prev = _context9.next) {
343
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
344
+ while (1) switch (_context10.prev = _context10.next) {
312
345
  case 0:
313
- pid = _ref2.pid, slot = _ref2.slot;
314
- _context9.next = 3;
346
+ pid = _ref3.pid, slot = _ref3.slot;
347
+ _context10.next = 3;
315
348
  return this.getJSON({
316
349
  path: "/".concat(pid, "/compute/results/outbox"),
317
350
  slot: slot
318
351
  });
319
352
  case 3:
320
- return _context9.abrupt("return", _context9.sent);
353
+ return _context10.abrupt("return", _context10.sent);
321
354
  case 4:
322
355
  case "end":
323
- return _context9.stop();
356
+ return _context10.stop();
324
357
  }
325
- }, _callee9, this);
358
+ }, _callee10, this);
326
359
  }));
327
- function computeAOS(_x6) {
360
+ function computeAOS(_x7) {
328
361
  return _computeAOS.apply(this, arguments);
329
362
  }
330
363
  return computeAOS;
@@ -332,26 +365,26 @@ var HB = /*#__PURE__*/function () {
332
365
  }, {
333
366
  key: "computeLua",
334
367
  value: function () {
335
- var _computeLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_ref3) {
368
+ var _computeLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(_ref4) {
336
369
  var pid, slot;
337
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
338
- while (1) switch (_context10.prev = _context10.next) {
370
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
371
+ while (1) switch (_context11.prev = _context11.next) {
339
372
  case 0:
340
- pid = _ref3.pid, slot = _ref3.slot;
341
- _context10.next = 3;
373
+ pid = _ref4.pid, slot = _ref4.slot;
374
+ _context11.next = 3;
342
375
  return this.getJSON({
343
376
  path: "/".concat(pid, "/compute/results"),
344
377
  slot: slot
345
378
  });
346
379
  case 3:
347
- return _context10.abrupt("return", _context10.sent);
380
+ return _context11.abrupt("return", _context11.sent);
348
381
  case 4:
349
382
  case "end":
350
- return _context10.stop();
383
+ return _context11.stop();
351
384
  }
352
- }, _callee10, this);
385
+ }, _callee11, this);
353
386
  }));
354
- function computeLua(_x7) {
387
+ function computeLua(_x8) {
355
388
  return _computeLua.apply(this, arguments);
356
389
  }
357
390
  return computeLua;
@@ -359,27 +392,27 @@ var HB = /*#__PURE__*/function () {
359
392
  }, {
360
393
  key: "compute",
361
394
  value: function () {
362
- var _compute = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(_ref4) {
363
- var pid, slot, _ref4$path, path;
364
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
365
- while (1) switch (_context11.prev = _context11.next) {
395
+ var _compute = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(_ref5) {
396
+ var pid, slot, _ref5$path, path;
397
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
398
+ while (1) switch (_context12.prev = _context12.next) {
366
399
  case 0:
367
- pid = _ref4.pid, slot = _ref4.slot, _ref4$path = _ref4.path, path = _ref4$path === void 0 ? "" : _ref4$path;
400
+ pid = _ref5.pid, slot = _ref5.slot, _ref5$path = _ref5.path, path = _ref5$path === void 0 ? "" : _ref5$path;
368
401
  if (path && !/^\//.test(path)) path = "/" + path;
369
- _context11.next = 4;
402
+ _context12.next = 4;
370
403
  return this.getJSON({
371
404
  path: "/".concat(pid, "/compute").concat(path),
372
405
  slot: slot
373
406
  });
374
407
  case 4:
375
- return _context11.abrupt("return", _context11.sent);
408
+ return _context12.abrupt("return", _context12.sent);
376
409
  case 5:
377
410
  case "end":
378
- return _context11.stop();
411
+ return _context12.stop();
379
412
  }
380
- }, _callee11, this);
413
+ }, _callee12, this);
381
414
  }));
382
- function compute(_x8) {
415
+ function compute(_x9) {
383
416
  return _compute.apply(this, arguments);
384
417
  }
385
418
  return compute;
@@ -387,27 +420,27 @@ var HB = /*#__PURE__*/function () {
387
420
  }, {
388
421
  key: "computeLegacy",
389
422
  value: function () {
390
- var _computeLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(_ref5) {
423
+ var _computeLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(_ref6) {
391
424
  var pid, slot, json;
392
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
393
- while (1) switch (_context12.prev = _context12.next) {
425
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
426
+ while (1) switch (_context13.prev = _context13.next) {
394
427
  case 0:
395
- pid = _ref5.pid, slot = _ref5.slot;
396
- _context12.next = 3;
428
+ pid = _ref6.pid, slot = _ref6.slot;
429
+ _context13.next = 3;
397
430
  return this.compute({
398
431
  pid: pid,
399
432
  slot: slot
400
433
  });
401
434
  case 3:
402
- json = _context12.sent;
403
- return _context12.abrupt("return", JSON.parse(json.results.json.body));
435
+ json = _context13.sent;
436
+ return _context13.abrupt("return", JSON.parse(json.results.json.body));
404
437
  case 5:
405
438
  case "end":
406
- return _context12.stop();
439
+ return _context13.stop();
407
440
  }
408
- }, _callee12, this);
441
+ }, _callee13, this);
409
442
  }));
410
- function computeLegacy(_x9) {
443
+ function computeLegacy(_x10) {
411
444
  return _computeLegacy.apply(this, arguments);
412
445
  }
413
446
  return computeLegacy;
@@ -415,30 +448,30 @@ var HB = /*#__PURE__*/function () {
415
448
  }, {
416
449
  key: "cacheScript",
417
450
  value: function () {
418
- var _cacheScript = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(data) {
451
+ var _cacheScript = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(data) {
419
452
  var type,
420
453
  _yield$this$spawn,
421
454
  pid,
422
455
  _yield$this$scheduleF,
423
456
  slot,
424
457
  msgs,
425
- _args14 = arguments;
426
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
427
- while (1) switch (_context13.prev = _context13.next) {
458
+ _args15 = arguments;
459
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
460
+ while (1) switch (_context14.prev = _context14.next) {
428
461
  case 0:
429
- type = _args14.length > 1 && _args14[1] !== undefined ? _args14[1] : "application/lua";
462
+ type = _args15.length > 1 && _args15[1] !== undefined ? _args15[1] : "application/lua";
430
463
  if (this.cache) {
431
- _context13.next = 7;
464
+ _context14.next = 7;
432
465
  break;
433
466
  }
434
- _context13.next = 4;
467
+ _context14.next = 4;
435
468
  return this.spawn({});
436
469
  case 4:
437
- _yield$this$spawn = _context13.sent;
470
+ _yield$this$spawn = _context14.sent;
438
471
  pid = _yield$this$spawn.pid;
439
472
  this.cache = pid;
440
473
  case 7:
441
- _context13.next = 9;
474
+ _context14.next = 9;
442
475
  return this.scheduleFlat({
443
476
  data: data,
444
477
  pid: this.cache,
@@ -447,24 +480,24 @@ var HB = /*#__PURE__*/function () {
447
480
  }
448
481
  });
449
482
  case 9:
450
- _yield$this$scheduleF = _context13.sent;
483
+ _yield$this$scheduleF = _context14.sent;
451
484
  slot = _yield$this$scheduleF.slot;
452
- _context13.next = 13;
485
+ _context14.next = 13;
453
486
  return this.messages({
454
487
  pid: this.cache,
455
488
  from: slot,
456
489
  limit: 1
457
490
  });
458
491
  case 13:
459
- msgs = _context13.sent;
460
- return _context13.abrupt("return", msgs.edges[0].node.message.Id);
492
+ msgs = _context14.sent;
493
+ return _context14.abrupt("return", msgs.edges[0].node.message.Id);
461
494
  case 15:
462
495
  case "end":
463
- return _context13.stop();
496
+ return _context14.stop();
464
497
  }
465
- }, _callee13, this);
498
+ }, _callee14, this);
466
499
  }));
467
- function cacheScript(_x10) {
500
+ function cacheScript(_x11) {
468
501
  return _cacheScript.apply(this, arguments);
469
502
  }
470
503
  return cacheScript;
@@ -472,27 +505,27 @@ var HB = /*#__PURE__*/function () {
472
505
  }, {
473
506
  key: "cacheBinary",
474
507
  value: function () {
475
- var _cacheBinary = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(data, type) {
508
+ var _cacheBinary = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(data, type) {
476
509
  var res;
477
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
478
- while (1) switch (_context14.prev = _context14.next) {
510
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
511
+ while (1) switch (_context15.prev = _context15.next) {
479
512
  case 0:
480
- _context14.next = 2;
513
+ _context15.next = 2;
481
514
  return this.post({
482
515
  path: "/~wao@1.0/cache_module",
483
516
  data: data,
484
517
  type: type
485
518
  });
486
519
  case 2:
487
- res = _context14.sent;
488
- return _context14.abrupt("return", res.out.id);
520
+ res = _context15.sent;
521
+ return _context15.abrupt("return", res.out.id);
489
522
  case 4:
490
523
  case "end":
491
- return _context14.stop();
524
+ return _context15.stop();
492
525
  }
493
- }, _callee14, this);
526
+ }, _callee15, this);
494
527
  }));
495
- function cacheBinary(_x11, _x12) {
528
+ function cacheBinary(_x12, _x13) {
496
529
  return _cacheBinary.apply(this, arguments);
497
530
  }
498
531
  return cacheBinary;
@@ -500,36 +533,36 @@ var HB = /*#__PURE__*/function () {
500
533
  }, {
501
534
  key: "message",
502
535
  value: function () {
503
- var _message = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(args) {
536
+ var _message = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(args) {
504
537
  var pid, _yield$this$schedule, slot, res;
505
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
506
- while (1) switch (_context15.prev = _context15.next) {
538
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
539
+ while (1) switch (_context16.prev = _context16.next) {
507
540
  case 0:
508
541
  pid = args.pid;
509
- _context15.next = 3;
542
+ _context16.next = 3;
510
543
  return this.schedule(args);
511
544
  case 3:
512
- _yield$this$schedule = _context15.sent;
545
+ _yield$this$schedule = _context16.sent;
513
546
  slot = _yield$this$schedule.slot;
514
- _context15.next = 7;
547
+ _context16.next = 7;
515
548
  return this.compute({
516
549
  pid: pid,
517
550
  slot: slot
518
551
  });
519
552
  case 7:
520
- res = _context15.sent;
521
- return _context15.abrupt("return", {
553
+ res = _context16.sent;
554
+ return _context16.abrupt("return", {
522
555
  slot: slot,
523
556
  pid: pid,
524
557
  res: res
525
558
  });
526
559
  case 9:
527
560
  case "end":
528
- return _context15.stop();
561
+ return _context16.stop();
529
562
  }
530
- }, _callee15, this);
563
+ }, _callee16, this);
531
564
  }));
532
- function message(_x13) {
565
+ function message(_x14) {
533
566
  return _message.apply(this, arguments);
534
567
  }
535
568
  return message;
@@ -537,41 +570,41 @@ var HB = /*#__PURE__*/function () {
537
570
  }, {
538
571
  key: "scheduleFlat",
539
572
  value: function () {
540
- var _scheduleFlat = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
541
- var _ref6,
573
+ var _scheduleFlat = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
574
+ var _ref7,
542
575
  pid,
543
- _ref6$tags,
576
+ _ref7$tags,
544
577
  tags,
545
578
  data,
546
579
  _tags,
547
580
  res,
548
- _args17 = arguments;
549
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
550
- while (1) switch (_context16.prev = _context16.next) {
581
+ _args18 = arguments;
582
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
583
+ while (1) switch (_context17.prev = _context17.next) {
551
584
  case 0:
552
- _ref6 = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {}, pid = _ref6.pid, _ref6$tags = _ref6.tags, tags = _ref6$tags === void 0 ? {} : _ref6$tags, data = _ref6.data;
585
+ _ref7 = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {}, pid = _ref7.pid, _ref7$tags = _ref7.tags, tags = _ref7$tags === void 0 ? {} : _ref7$tags, data = _ref7.data;
553
586
  _tags = (0, _ramda.mergeLeft)(tags, {
554
587
  type: "Message",
555
588
  target: pid
556
589
  });
557
590
  if (data) _tags.data = data;
558
- _context16.next = 5;
591
+ _context17.next = 5;
559
592
  return this.post({
560
593
  path: "/~process@1.0/schedule",
561
594
  body: _tags
562
595
  });
563
596
  case 5:
564
- res = _context16.sent;
565
- return _context16.abrupt("return", {
597
+ res = _context17.sent;
598
+ return _context17.abrupt("return", {
566
599
  slot: res.out.slot,
567
600
  res: res,
568
601
  pid: pid
569
602
  });
570
603
  case 7:
571
604
  case "end":
572
- return _context16.stop();
605
+ return _context17.stop();
573
606
  }
574
- }, _callee16, this);
607
+ }, _callee17, this);
575
608
  }));
576
609
  function scheduleFlat() {
577
610
  return _scheduleFlat.apply(this, arguments);
@@ -581,99 +614,172 @@ var HB = /*#__PURE__*/function () {
581
614
  }, {
582
615
  key: "scheduleNP",
583
616
  value: function () {
584
- var _scheduleNP = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
585
- var _ref7,
617
+ var _scheduleNP = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
618
+ var _ref8,
586
619
  pid,
587
- _ref7$tags,
620
+ _ref8$tags,
588
621
  tags,
589
622
  data,
590
623
  res,
591
- _args18 = arguments;
592
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
593
- while (1) switch (_context17.prev = _context17.next) {
624
+ _args19 = arguments;
625
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
626
+ while (1) switch (_context18.prev = _context18.next) {
594
627
  case 0:
595
- _ref7 = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {}, pid = _ref7.pid, _ref7$tags = _ref7.tags, tags = _ref7$tags === void 0 ? {} : _ref7$tags, data = _ref7.data;
628
+ _ref8 = _args19.length > 0 && _args19[0] !== undefined ? _args19[0] : {}, pid = _ref8.pid, _ref8$tags = _ref8.tags, tags = _ref8$tags === void 0 ? {} : _ref8$tags, data = _ref8.data;
596
629
  if (data) tags.data = data;
597
- _context17.t0 = this;
598
- _context17.t1 = "/".concat(pid, "~node-process@1.0/schedule");
599
- _context17.next = 6;
630
+ _context18.t0 = this;
631
+ _context18.t1 = "/".concat(pid, "~node-process@1.0/schedule");
632
+ _context18.next = 6;
600
633
  return this.commit(tags);
601
634
  case 6:
602
- _context17.t2 = _context17.sent;
603
- _context17.t3 = {
604
- path: _context17.t1,
605
- body: _context17.t2
635
+ _context18.t2 = _context18.sent;
636
+ _context18.t3 = {
637
+ path: _context18.t1,
638
+ body: _context18.t2
606
639
  };
607
- _context17.next = 10;
608
- return _context17.t0.post.call(_context17.t0, _context17.t3);
640
+ _context18.next = 10;
641
+ return _context18.t0.post.call(_context18.t0, _context18.t3);
609
642
  case 10:
610
- res = _context17.sent;
611
- return _context17.abrupt("return", {
643
+ res = _context18.sent;
644
+ return _context18.abrupt("return", {
612
645
  slot: res.out.slot,
613
646
  res: res,
614
647
  pid: pid
615
648
  });
616
649
  case 12:
617
650
  case "end":
618
- return _context17.stop();
651
+ return _context18.stop();
619
652
  }
620
- }, _callee17, this);
653
+ }, _callee18, this);
621
654
  }));
622
655
  function scheduleNP() {
623
656
  return _scheduleNP.apply(this, arguments);
624
657
  }
625
658
  return scheduleNP;
626
659
  }()
660
+ }, {
661
+ key: "post104",
662
+ value: function () {
663
+ var _post = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(_ref9) {
664
+ var _ref9$path, path, _ref9$tags, tags, _ref9$data, data, _tags, signer, di, res, _headers;
665
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
666
+ while (1) switch (_context19.prev = _context19.next) {
667
+ case 0:
668
+ _ref9$path = _ref9.path, path = _ref9$path === void 0 ? "/~process@1.0/schedule" : _ref9$path, _ref9$tags = _ref9.tags, tags = _ref9$tags === void 0 ? {} : _ref9$tags, _ref9$data = _ref9.data, data = _ref9$data === void 0 ? "1984" : _ref9$data;
669
+ _tags = (0, _utils.buildTags)((0, _ramda.mergeLeft)(tags, {
670
+ signingFormat: "ANS-104"
671
+ }));
672
+ signer = new _sdk.ArweaveSigner(this.jwk);
673
+ console.log(_tags);
674
+ di = (0, _arbundles.createData)(data, signer, {
675
+ tags: _tags
676
+ });
677
+ _context19.next = 7;
678
+ return di.sign(signer);
679
+ case 7:
680
+ _context19.next = 9;
681
+ return fetch("".concat(this.url).concat(path), {
682
+ method: "POST",
683
+ headers: {
684
+ "codec-device": "ans104@1.0",
685
+ "Content-Type": "application/ans104"
686
+ },
687
+ body: di.binary
688
+ });
689
+ case 9:
690
+ res = _context19.sent;
691
+ _context19.t0 = _hbsig.structured_to;
692
+ _context19.t1 = _hbsig.httpsig_from;
693
+ _context19.next = 14;
694
+ return toMsg(res);
695
+ case 14:
696
+ _context19.t2 = _context19.sent;
697
+ _context19.t3 = (0, _context19.t1)(_context19.t2);
698
+ _headers = (0, _context19.t0)(_context19.t3);
699
+ res.out = _headers;
700
+ return _context19.abrupt("return", res);
701
+ case 19:
702
+ case "end":
703
+ return _context19.stop();
704
+ }
705
+ }, _callee19, this);
706
+ }));
707
+ function post104(_x15) {
708
+ return _post.apply(this, arguments);
709
+ }
710
+ return post104;
711
+ }()
627
712
  }, {
628
713
  key: "schedule",
629
714
  value: function () {
630
- var _schedule = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
631
- var _ref8,
715
+ var _schedule = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
716
+ var _ref10,
632
717
  pid,
633
- _ref8$tags,
718
+ _ref10$tags,
634
719
  tags,
635
720
  data,
721
+ res,
636
722
  _tags,
723
+ _tags2,
637
724
  body,
638
725
  signed,
639
- res,
640
- _args19 = arguments;
641
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
642
- while (1) switch (_context18.prev = _context18.next) {
726
+ _args21 = arguments;
727
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
728
+ while (1) switch (_context20.prev = _context20.next) {
643
729
  case 0:
644
- _ref8 = _args19.length > 0 && _args19[0] !== undefined ? _args19[0] : {}, pid = _ref8.pid, _ref8$tags = _ref8.tags, tags = _ref8$tags === void 0 ? {} : _ref8$tags, data = _ref8.data;
730
+ _ref10 = _args21.length > 0 && _args21[0] !== undefined ? _args21[0] : {}, pid = _ref10.pid, _ref10$tags = _ref10.tags, tags = _ref10$tags === void 0 ? {} : _ref10$tags, data = _ref10.data;
731
+ res = null;
732
+ if (!(this.format === "ans104")) {
733
+ _context20.next = 9;
734
+ break;
735
+ }
645
736
  _tags = (0, _ramda.mergeLeft)(tags, {
737
+ type: "Message"
738
+ });
739
+ _context20.next = 6;
740
+ return this.post104({
741
+ path: "/".concat(pid, "/schedule"),
742
+ tags: _tags,
743
+ data: data !== null && data !== void 0 ? data : "1984"
744
+ });
745
+ case 6:
746
+ res = _context20.sent;
747
+ _context20.next = 20;
748
+ break;
749
+ case 9:
750
+ _tags2 = (0, _ramda.mergeLeft)(tags, {
646
751
  type: "Message",
647
752
  target: pid
648
753
  });
649
- if (data) _tags.data = data;
650
- _context18.next = 5;
651
- return this.commit(_tags, {
754
+ if (data) _tags2.data = data;
755
+ _context20.next = 13;
756
+ return this.commit(_tags2, {
652
757
  path: false
653
758
  });
654
- case 5:
655
- body = _context18.sent;
656
- _context18.next = 8;
759
+ case 13:
760
+ body = _context20.sent;
761
+ _context20.next = 16;
657
762
  return this.sign({
658
763
  path: "/".concat(pid, "/schedule"),
659
764
  body: body
660
765
  });
661
- case 8:
662
- signed = _context18.sent;
663
- _context18.next = 11;
766
+ case 16:
767
+ signed = _context20.sent;
768
+ _context20.next = 19;
664
769
  return this.send(signed);
665
- case 11:
666
- res = _context18.sent;
667
- return _context18.abrupt("return", {
770
+ case 19:
771
+ res = _context20.sent;
772
+ case 20:
773
+ return _context20.abrupt("return", {
668
774
  slot: res.out.slot,
669
775
  res: res,
670
776
  pid: pid
671
777
  });
672
- case 13:
778
+ case 21:
673
779
  case "end":
674
- return _context18.stop();
780
+ return _context20.stop();
675
781
  }
676
- }, _callee18, this);
782
+ }, _callee20, this);
677
783
  }));
678
784
  function schedule() {
679
785
  return _schedule.apply(this, arguments);
@@ -683,26 +789,26 @@ var HB = /*#__PURE__*/function () {
683
789
  }, {
684
790
  key: "scheduleLua",
685
791
  value: function () {
686
- var _scheduleLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(_ref9) {
687
- var _ref9$action, action, _ref9$tags, tags, rest;
688
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
689
- while (1) switch (_context19.prev = _context19.next) {
792
+ var _scheduleLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(_ref11) {
793
+ var _ref11$action, action, _ref11$tags, tags, rest;
794
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
795
+ while (1) switch (_context21.prev = _context21.next) {
690
796
  case 0:
691
- _ref9$action = _ref9.action, action = _ref9$action === void 0 ? "Eval" : _ref9$action, _ref9$tags = _ref9.tags, tags = _ref9$tags === void 0 ? {} : _ref9$tags, rest = _objectWithoutProperties(_ref9, _excluded2);
797
+ _ref11$action = _ref11.action, action = _ref11$action === void 0 ? "Eval" : _ref11$action, _ref11$tags = _ref11.tags, tags = _ref11$tags === void 0 ? {} : _ref11$tags, rest = _objectWithoutProperties(_ref11, _excluded2);
692
798
  if (action) tags.Action = action;
693
- _context19.next = 4;
799
+ _context21.next = 4;
694
800
  return this.schedule(_objectSpread({
695
801
  tags: tags
696
802
  }, rest));
697
803
  case 4:
698
- return _context19.abrupt("return", _context19.sent);
804
+ return _context21.abrupt("return", _context21.sent);
699
805
  case 5:
700
806
  case "end":
701
- return _context19.stop();
807
+ return _context21.stop();
702
808
  }
703
- }, _callee19, this);
809
+ }, _callee21, this);
704
810
  }));
705
- function scheduleLua(_x14) {
811
+ function scheduleLua(_x16) {
706
812
  return _scheduleLua.apply(this, arguments);
707
813
  }
708
814
  return scheduleLua;
@@ -710,47 +816,47 @@ var HB = /*#__PURE__*/function () {
710
816
  }, {
711
817
  key: "spawnLua",
712
818
  value: function () {
713
- var _spawnLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(lua) {
819
+ var _spawnLua = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(lua) {
714
820
  var _this$lua2;
715
821
  var tags;
716
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
717
- while (1) switch (_context20.prev = _context20.next) {
822
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
823
+ while (1) switch (_context22.prev = _context22.next) {
718
824
  case 0:
719
- _context20.next = 2;
825
+ _context22.next = 2;
720
826
  return this.setInfo();
721
827
  case 2:
722
- _context20.t0 = this.operator;
828
+ _context22.t0 = this.operator;
723
829
  if (!((_this$lua2 = this.lua) !== null && _this$lua2 !== void 0)) {
724
- _context20.next = 7;
830
+ _context22.next = 7;
725
831
  break;
726
832
  }
727
- _context20.t1 = _this$lua2;
728
- _context20.next = 10;
833
+ _context22.t1 = _this$lua2;
834
+ _context22.next = 10;
729
835
  break;
730
836
  case 7:
731
- _context20.next = 9;
837
+ _context22.next = 9;
732
838
  return this.getLua();
733
839
  case 9:
734
- _context20.t1 = _context20.sent;
840
+ _context22.t1 = _context22.sent;
735
841
  case 10:
736
- _context20.t2 = _context20.t1;
842
+ _context22.t2 = _context22.t1;
737
843
  tags = {
738
844
  "data-protocol": "ao",
739
845
  variant: "ao.N.1",
740
- authority: _context20.t0,
741
- module: _context20.t2,
846
+ authority: _context22.t0,
847
+ module: _context22.t2,
742
848
  "execution-device": "lua@5.3a",
743
849
  "push-device": "push@1.0",
744
850
  "patch-from": "/results/outbox"
745
851
  };
746
- return _context20.abrupt("return", this.spawn(tags));
852
+ return _context22.abrupt("return", this.spawn(tags));
747
853
  case 13:
748
854
  case "end":
749
- return _context20.stop();
855
+ return _context22.stop();
750
856
  }
751
- }, _callee20, this);
857
+ }, _callee22, this);
752
858
  }));
753
- function spawnLua(_x15) {
859
+ function spawnLua(_x17) {
754
860
  return _spawnLua.apply(this, arguments);
755
861
  }
756
862
  return spawnLua;
@@ -758,26 +864,26 @@ var HB = /*#__PURE__*/function () {
758
864
  }, {
759
865
  key: "now",
760
866
  value: function () {
761
- var _now = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(_ref10) {
762
- var pid, _ref10$path, path;
763
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
764
- while (1) switch (_context21.prev = _context21.next) {
867
+ var _now = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(_ref12) {
868
+ var pid, _ref12$path, path;
869
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
870
+ while (1) switch (_context23.prev = _context23.next) {
765
871
  case 0:
766
- pid = _ref10.pid, _ref10$path = _ref10.path, path = _ref10$path === void 0 ? "" : _ref10$path;
872
+ pid = _ref12.pid, _ref12$path = _ref12.path, path = _ref12$path === void 0 ? "" : _ref12$path;
767
873
  if (path && !/^\//.test(path)) path = "/" + path;
768
- _context21.next = 4;
874
+ _context23.next = 4;
769
875
  return this.getJSON({
770
876
  path: "/".concat(pid, "/now").concat(path)
771
877
  });
772
878
  case 4:
773
- return _context21.abrupt("return", _context21.sent);
879
+ return _context23.abrupt("return", _context23.sent);
774
880
  case 5:
775
881
  case "end":
776
- return _context21.stop();
882
+ return _context23.stop();
777
883
  }
778
- }, _callee21, this);
884
+ }, _callee23, this);
779
885
  }));
780
- function now(_x16) {
886
+ function now(_x18) {
781
887
  return _now.apply(this, arguments);
782
888
  }
783
889
  return now;
@@ -785,26 +891,26 @@ var HB = /*#__PURE__*/function () {
785
891
  }, {
786
892
  key: "slot",
787
893
  value: function () {
788
- var _slot = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(_ref11) {
789
- var pid, _ref11$path, path;
790
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
791
- while (1) switch (_context22.prev = _context22.next) {
894
+ var _slot = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(_ref13) {
895
+ var pid, _ref13$path, path;
896
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
897
+ while (1) switch (_context24.prev = _context24.next) {
792
898
  case 0:
793
- pid = _ref11.pid, _ref11$path = _ref11.path, path = _ref11$path === void 0 ? "" : _ref11$path;
899
+ pid = _ref13.pid, _ref13$path = _ref13.path, path = _ref13$path === void 0 ? "" : _ref13$path;
794
900
  if (path && !/^\//.test(path)) path = "/" + path;
795
- _context22.next = 4;
901
+ _context24.next = 4;
796
902
  return this.getJSON({
797
903
  path: "/".concat(pid, "/slot").concat(path)
798
904
  });
799
905
  case 4:
800
- return _context22.abrupt("return", _context22.sent);
906
+ return _context24.abrupt("return", _context24.sent);
801
907
  case 5:
802
908
  case "end":
803
- return _context22.stop();
909
+ return _context24.stop();
804
910
  }
805
- }, _callee22, this);
911
+ }, _callee24, this);
806
912
  }));
807
- function slot(_x17) {
913
+ function slot(_x19) {
808
914
  return _slot.apply(this, arguments);
809
915
  }
810
916
  return slot;
@@ -812,57 +918,57 @@ var HB = /*#__PURE__*/function () {
812
918
  }, {
813
919
  key: "messages",
814
920
  value: function () {
815
- var _messages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
921
+ var _messages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
816
922
  var _this = this;
817
- var _ref12,
923
+ var _ref14,
818
924
  pid,
819
925
  from,
820
926
  to,
821
927
  params,
822
928
  res,
823
- _args25 = arguments;
824
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
825
- while (1) switch (_context24.prev = _context24.next) {
929
+ _args27 = arguments;
930
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
931
+ while (1) switch (_context26.prev = _context26.next) {
826
932
  case 0:
827
- _ref12 = _args25.length > 0 && _args25[0] !== undefined ? _args25[0] : {}, pid = _ref12.pid, from = _ref12.from, to = _ref12.to;
933
+ _ref14 = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {}, pid = _ref14.pid, from = _ref14.from, to = _ref14.to;
828
934
  params = "target=".concat(pid);
829
935
  if ((0, _ramda.isNotNil)(from)) params += "&from=".concat(from);
830
936
  if ((0, _ramda.isNotNil)(to)) params += "&to=".concat(to);
831
937
  params += "&accept=application/aos-2";
832
- _context24.next = 7;
938
+ _context26.next = 7;
833
939
  return fetch("".concat(this.url, "/~scheduler@1.0/schedule?").concat(params)).then(function (r) {
834
940
  return r.json();
835
941
  });
836
942
  case 7:
837
- res = _context24.sent;
943
+ res = _context26.sent;
838
944
  if (res.page_info.has_next_page) {
839
- res.next = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
945
+ res.next = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
840
946
  var from2;
841
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
842
- while (1) switch (_context23.prev = _context23.next) {
947
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
948
+ while (1) switch (_context25.prev = _context25.next) {
843
949
  case 0:
844
950
  from2 = (0, _ramda.last)(res.edges).cursor + 1;
845
- _context23.next = 3;
951
+ _context25.next = 3;
846
952
  return _this.messages({
847
953
  pid: pid,
848
954
  from: from2,
849
955
  to: to
850
956
  });
851
957
  case 3:
852
- return _context23.abrupt("return", _context23.sent);
958
+ return _context25.abrupt("return", _context25.sent);
853
959
  case 4:
854
960
  case "end":
855
- return _context23.stop();
961
+ return _context25.stop();
856
962
  }
857
- }, _callee23);
963
+ }, _callee25);
858
964
  }));
859
965
  }
860
- return _context24.abrupt("return", res);
966
+ return _context26.abrupt("return", res);
861
967
  case 10:
862
968
  case "end":
863
- return _context24.stop();
969
+ return _context26.stop();
864
970
  }
865
- }, _callee24, this);
971
+ }, _callee26, this);
866
972
  }));
867
973
  function messages() {
868
974
  return _messages.apply(this, arguments);
@@ -872,19 +978,40 @@ var HB = /*#__PURE__*/function () {
872
978
  }, {
873
979
  key: "spawn",
874
980
  value: function () {
875
- var _spawn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
981
+ var _spawn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
876
982
  var tags,
877
983
  res,
878
- _args26 = arguments;
879
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
880
- while (1) switch (_context25.prev = _context25.next) {
984
+ _args28 = arguments;
985
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
986
+ while (1) switch (_context27.prev = _context27.next) {
881
987
  case 0:
882
- tags = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
883
- _context25.next = 3;
988
+ tags = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : {};
989
+ _context27.next = 3;
884
990
  return this.setInfo();
885
991
  case 3:
886
- _context25.t0 = this;
887
- _context25.next = 6;
992
+ res = null;
993
+ if (!(this.format === "ans104")) {
994
+ _context27.next = 10;
995
+ break;
996
+ }
997
+ _context27.next = 7;
998
+ return this.post104({
999
+ tags: (0, _ramda.mergeLeft)(tags, {
1000
+ "codec-device": "ans104@1.0",
1001
+ "random-seed": (0, _utils.seed)(16),
1002
+ type: "Process",
1003
+ "execution-device": "test-device@1.0",
1004
+ device: "process@1.0",
1005
+ scheduler: this.operator
1006
+ })
1007
+ });
1008
+ case 7:
1009
+ res = _context27.sent;
1010
+ _context27.next = 19;
1011
+ break;
1012
+ case 10:
1013
+ _context27.t0 = this;
1014
+ _context27.next = 13;
888
1015
  return this.commit((0, _ramda.mergeLeft)(tags, {
889
1016
  "random-seed": (0, _utils.seed)(16),
890
1017
  type: "Process",
@@ -894,27 +1021,28 @@ var HB = /*#__PURE__*/function () {
894
1021
  }), {
895
1022
  path: false
896
1023
  });
897
- case 6:
898
- _context25.t1 = _context25.sent;
899
- _context25.t2 = this.operator;
900
- _context25.t3 = {
1024
+ case 13:
1025
+ _context27.t1 = _context27.sent;
1026
+ _context27.t2 = this.operator;
1027
+ _context27.t3 = {
901
1028
  path: "/~process@1.0/schedule",
902
- body: _context25.t1,
903
- scheduler: _context25.t2
1029
+ body: _context27.t1,
1030
+ scheduler: _context27.t2
904
1031
  };
905
- _context25.next = 11;
906
- return _context25.t0.post.call(_context25.t0, _context25.t3);
907
- case 11:
908
- res = _context25.sent;
909
- return _context25.abrupt("return", {
1032
+ _context27.next = 18;
1033
+ return _context27.t0.post.call(_context27.t0, _context27.t3);
1034
+ case 18:
1035
+ res = _context27.sent;
1036
+ case 19:
1037
+ return _context27.abrupt("return", {
910
1038
  res: res,
911
1039
  pid: res.out.process
912
1040
  });
913
- case 13:
1041
+ case 20:
914
1042
  case "end":
915
- return _context25.stop();
1043
+ return _context27.stop();
916
1044
  }
917
- }, _callee25, this);
1045
+ }, _callee27, this);
918
1046
  }));
919
1047
  function spawn() {
920
1048
  return _spawn.apply(this, arguments);
@@ -924,19 +1052,19 @@ var HB = /*#__PURE__*/function () {
924
1052
  }, {
925
1053
  key: "spawnLegacy",
926
1054
  value: function () {
927
- var _spawnLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
928
- var _ref14,
1055
+ var _spawnLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
1056
+ var _ref16,
929
1057
  module,
930
- _ref14$tags,
1058
+ _ref16$tags,
931
1059
  tags,
932
1060
  data,
933
1061
  t,
934
- _args27 = arguments;
935
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
936
- while (1) switch (_context26.prev = _context26.next) {
1062
+ _args29 = arguments;
1063
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
1064
+ while (1) switch (_context28.prev = _context28.next) {
937
1065
  case 0:
938
- _ref14 = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {}, module = _ref14.module, _ref14$tags = _ref14.tags, tags = _ref14$tags === void 0 ? {} : _ref14$tags, data = _ref14.data;
939
- _context26.next = 3;
1066
+ _ref16 = _args29.length > 0 && _args29[0] !== undefined ? _args29[0] : {}, module = _ref16.module, _ref16$tags = _ref16.tags, tags = _ref16$tags === void 0 ? {} : _ref16$tags, data = _ref16.data;
1067
+ _context28.next = 3;
940
1068
  return this.setInfo();
941
1069
  case 3:
942
1070
  t = (0, _ramda.mergeLeft)(tags, {
@@ -951,15 +1079,15 @@ var HB = /*#__PURE__*/function () {
951
1079
  "patch-from": "/results/outbox"
952
1080
  });
953
1081
  if (data) t.data = data;
954
- _context26.next = 7;
1082
+ _context28.next = 7;
955
1083
  return this.spawn(t);
956
1084
  case 7:
957
- return _context26.abrupt("return", _context26.sent);
1085
+ return _context28.abrupt("return", _context28.sent);
958
1086
  case 8:
959
1087
  case "end":
960
- return _context26.stop();
1088
+ return _context28.stop();
961
1089
  }
962
- }, _callee26, this);
1090
+ }, _callee28, this);
963
1091
  }));
964
1092
  function spawnLegacy() {
965
1093
  return _spawnLegacy.apply(this, arguments);
@@ -969,30 +1097,30 @@ var HB = /*#__PURE__*/function () {
969
1097
  }, {
970
1098
  key: "scheduleLegacy",
971
1099
  value: function () {
972
- var _scheduleLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
973
- var _ref15,
974
- _ref15$action,
1100
+ var _scheduleLegacy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
1101
+ var _ref17,
1102
+ _ref17$action,
975
1103
  action,
976
- _ref15$tags,
1104
+ _ref17$tags,
977
1105
  tags,
978
1106
  rest,
979
- _args28 = arguments;
980
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
981
- while (1) switch (_context27.prev = _context27.next) {
1107
+ _args30 = arguments;
1108
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
1109
+ while (1) switch (_context29.prev = _context29.next) {
982
1110
  case 0:
983
- _ref15 = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : {}, _ref15$action = _ref15.action, action = _ref15$action === void 0 ? "Eval" : _ref15$action, _ref15$tags = _ref15.tags, tags = _ref15$tags === void 0 ? {} : _ref15$tags, rest = _objectWithoutProperties(_ref15, _excluded3);
1111
+ _ref17 = _args30.length > 0 && _args30[0] !== undefined ? _args30[0] : {}, _ref17$action = _ref17.action, action = _ref17$action === void 0 ? "Eval" : _ref17$action, _ref17$tags = _ref17.tags, tags = _ref17$tags === void 0 ? {} : _ref17$tags, rest = _objectWithoutProperties(_ref17, _excluded3);
984
1112
  if (action) tags.Action = action;
985
- _context27.next = 4;
1113
+ _context29.next = 4;
986
1114
  return this.schedule(_objectSpread({
987
1115
  tags: tags
988
1116
  }, rest));
989
1117
  case 4:
990
- return _context27.abrupt("return", _context27.sent);
1118
+ return _context29.abrupt("return", _context29.sent);
991
1119
  case 5:
992
1120
  case "end":
993
- return _context27.stop();
1121
+ return _context29.stop();
994
1122
  }
995
- }, _callee27, this);
1123
+ }, _callee29, this);
996
1124
  }));
997
1125
  function scheduleLegacy() {
998
1126
  return _scheduleLegacy.apply(this, arguments);
@@ -1002,22 +1130,22 @@ var HB = /*#__PURE__*/function () {
1002
1130
  }, {
1003
1131
  key: "results",
1004
1132
  value: function () {
1005
- var _results = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
1006
- var _ref16,
1133
+ var _results = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
1134
+ var _ref18,
1007
1135
  process,
1008
1136
  limit,
1009
- _ref16$sort,
1137
+ _ref18$sort,
1010
1138
  sort,
1011
1139
  from,
1012
1140
  to,
1013
1141
  params,
1014
1142
  addParam,
1015
1143
  res,
1016
- _args29 = arguments;
1017
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
1018
- while (1) switch (_context28.prev = _context28.next) {
1144
+ _args31 = arguments;
1145
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
1146
+ while (1) switch (_context30.prev = _context30.next) {
1019
1147
  case 0:
1020
- _ref16 = _args29.length > 0 && _args29[0] !== undefined ? _args29[0] : {}, process = _ref16.process, limit = _ref16.limit, _ref16$sort = _ref16.sort, sort = _ref16$sort === void 0 ? "DESC" : _ref16$sort, from = _ref16.from, to = _ref16.to;
1148
+ _ref18 = _args31.length > 0 && _args31[0] !== undefined ? _args31[0] : {}, process = _ref18.process, limit = _ref18.limit, _ref18$sort = _ref18.sort, sort = _ref18$sort === void 0 ? "DESC" : _ref18$sort, from = _ref18.from, to = _ref18.to;
1021
1149
  params = "";
1022
1150
  addParam = function addParam(key, val) {
1023
1151
  params += params === "" ? "?" : "&";
@@ -1027,7 +1155,7 @@ var HB = /*#__PURE__*/function () {
1027
1155
  if (sort) addParam("sort", sort);
1028
1156
  if (from) addParam("from", from);
1029
1157
  if (to) addParam("to", to);
1030
- _context28.next = 9;
1158
+ _context30.next = 9;
1031
1159
  return this.post({
1032
1160
  path: "/~relay@1.0/call",
1033
1161
  method: "GET",
@@ -1035,13 +1163,13 @@ var HB = /*#__PURE__*/function () {
1035
1163
  "content-type": "application/json"
1036
1164
  });
1037
1165
  case 9:
1038
- res = _context28.sent;
1039
- return _context28.abrupt("return", JSON.parse(res.body));
1166
+ res = _context30.sent;
1167
+ return _context30.abrupt("return", JSON.parse(res.body));
1040
1168
  case 11:
1041
1169
  case "end":
1042
- return _context28.stop();
1170
+ return _context30.stop();
1043
1171
  }
1044
- }, _callee28, this);
1172
+ }, _callee30, this);
1045
1173
  }));
1046
1174
  function results() {
1047
1175
  return _results.apply(this, arguments);
@@ -1051,27 +1179,27 @@ var HB = /*#__PURE__*/function () {
1051
1179
  }, {
1052
1180
  key: "dryrun",
1053
1181
  value: function () {
1054
- var _dryrun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
1055
- var _ref17,
1056
- _ref17$tags,
1182
+ var _dryrun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
1183
+ var _ref19,
1184
+ _ref19$tags,
1057
1185
  tags,
1058
1186
  pid,
1059
1187
  action,
1060
1188
  data,
1061
1189
  json,
1062
1190
  res,
1063
- _args30 = arguments;
1064
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
1065
- while (1) switch (_context29.prev = _context29.next) {
1191
+ _args32 = arguments;
1192
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
1193
+ while (1) switch (_context31.prev = _context31.next) {
1066
1194
  case 0:
1067
- _ref17 = _args30.length > 0 && _args30[0] !== undefined ? _args30[0] : {}, _ref17$tags = _ref17.tags, tags = _ref17$tags === void 0 ? {} : _ref17$tags, pid = _ref17.pid, action = _ref17.action, data = _ref17.data;
1195
+ _ref19 = _args32.length > 0 && _args32[0] !== undefined ? _args32[0] : {}, _ref19$tags = _ref19.tags, tags = _ref19$tags === void 0 ? {} : _ref19$tags, pid = _ref19.pid, action = _ref19.action, data = _ref19.data;
1068
1196
  if (typeof action === "string") tags.Action = action;
1069
1197
  json = {
1070
1198
  Tags: (0, _utils.buildTags)(_objectSpread({}, tags)),
1071
1199
  Owner: this.addr
1072
1200
  };
1073
1201
  if (data) json.Data = data;
1074
- _context29.next = 6;
1202
+ _context31.next = 6;
1075
1203
  return this.post({
1076
1204
  path: "/~relay@1.0/call",
1077
1205
  method: "POST",
@@ -1080,13 +1208,13 @@ var HB = /*#__PURE__*/function () {
1080
1208
  "relay-body": JSON.stringify(json)
1081
1209
  });
1082
1210
  case 6:
1083
- res = _context29.sent;
1084
- return _context29.abrupt("return", JSON.parse(res.body));
1211
+ res = _context31.sent;
1212
+ return _context31.abrupt("return", JSON.parse(res.body));
1085
1213
  case 8:
1086
1214
  case "end":
1087
- return _context29.stop();
1215
+ return _context31.stop();
1088
1216
  }
1089
- }, _callee29, this);
1217
+ }, _callee31, this);
1090
1218
  }));
1091
1219
  function dryrun() {
1092
1220
  return _dryrun.apply(this, arguments);
@@ -1096,23 +1224,23 @@ var HB = /*#__PURE__*/function () {
1096
1224
  }, {
1097
1225
  key: "commit",
1098
1226
  value: function () {
1099
- var _commit2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(obj, opts) {
1100
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
1101
- while (1) switch (_context30.prev = _context30.next) {
1227
+ var _commit2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(obj, opts) {
1228
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
1229
+ while (1) switch (_context32.prev = _context32.next) {
1102
1230
  case 0:
1103
- _context30.next = 2;
1231
+ _context32.next = 2;
1104
1232
  return (0, _hbsig.commit)(obj, _objectSpread(_objectSpread({}, opts), {}, {
1105
1233
  signer: this.sign
1106
1234
  }));
1107
1235
  case 2:
1108
- return _context30.abrupt("return", _context30.sent);
1236
+ return _context32.abrupt("return", _context32.sent);
1109
1237
  case 3:
1110
1238
  case "end":
1111
- return _context30.stop();
1239
+ return _context32.stop();
1112
1240
  }
1113
- }, _callee30, this);
1241
+ }, _callee32, this);
1114
1242
  }));
1115
- function commit(_x18, _x19) {
1243
+ function commit(_x20, _x21) {
1116
1244
  return _commit2.apply(this, arguments);
1117
1245
  }
1118
1246
  return commit;
@@ -1120,69 +1248,69 @@ var HB = /*#__PURE__*/function () {
1120
1248
  }, {
1121
1249
  key: "p",
1122
1250
  value: function () {
1123
- var _p = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(path) {
1251
+ var _p = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(path) {
1124
1252
  var _, _args$_, _args$, _args$$path, _yield$this$post$out, _yield$this$post;
1125
1253
  var _len,
1126
1254
  args,
1127
1255
  _key,
1128
1256
  _args,
1129
- _args32 = arguments;
1130
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
1131
- while (1) switch (_context31.prev = _context31.next) {
1257
+ _args34 = arguments;
1258
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
1259
+ while (1) switch (_context33.prev = _context33.next) {
1132
1260
  case 0:
1133
- for (_len = _args32.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1134
- args[_key - 1] = _args32[_key];
1261
+ for (_len = _args34.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1262
+ args[_key - 1] = _args34[_key];
1135
1263
  }
1136
1264
  _args = (0, _ramda.clone)(args);
1137
1265
  (_args$_ = _args[_ = 0]) !== null && _args$_ !== void 0 ? _args$_ : _args[_] = {};
1138
1266
  (_args$$path = (_args$ = _args[0]).path) !== null && _args$$path !== void 0 ? _args$$path : _args$.path = path;
1139
- _context31.next = 6;
1267
+ _context33.next = 6;
1140
1268
  return this.post.apply(this, _toConsumableArray(_args));
1141
1269
  case 6:
1142
- _context31.t2 = _yield$this$post = _context31.sent;
1143
- _context31.t1 = _context31.t2 === null;
1144
- if (_context31.t1) {
1145
- _context31.next = 10;
1270
+ _context33.t2 = _yield$this$post = _context33.sent;
1271
+ _context33.t1 = _context33.t2 === null;
1272
+ if (_context33.t1) {
1273
+ _context33.next = 10;
1146
1274
  break;
1147
1275
  }
1148
- _context31.t1 = _yield$this$post === void 0;
1276
+ _context33.t1 = _yield$this$post === void 0;
1149
1277
  case 10:
1150
- if (!_context31.t1) {
1151
- _context31.next = 14;
1278
+ if (!_context33.t1) {
1279
+ _context33.next = 14;
1152
1280
  break;
1153
1281
  }
1154
- _context31.t3 = void 0;
1155
- _context31.next = 15;
1282
+ _context33.t3 = void 0;
1283
+ _context33.next = 15;
1156
1284
  break;
1157
1285
  case 14:
1158
- _context31.t3 = _yield$this$post.out;
1286
+ _context33.t3 = _yield$this$post.out;
1159
1287
  case 15:
1160
- _context31.t4 = _yield$this$post$out = _context31.t3;
1161
- _context31.t0 = _context31.t4 !== null;
1162
- if (!_context31.t0) {
1163
- _context31.next = 19;
1288
+ _context33.t4 = _yield$this$post$out = _context33.t3;
1289
+ _context33.t0 = _context33.t4 !== null;
1290
+ if (!_context33.t0) {
1291
+ _context33.next = 19;
1164
1292
  break;
1165
1293
  }
1166
- _context31.t0 = _yield$this$post$out !== void 0;
1294
+ _context33.t0 = _yield$this$post$out !== void 0;
1167
1295
  case 19:
1168
- if (!_context31.t0) {
1169
- _context31.next = 23;
1296
+ if (!_context33.t0) {
1297
+ _context33.next = 23;
1170
1298
  break;
1171
1299
  }
1172
- _context31.t5 = _yield$this$post$out;
1173
- _context31.next = 24;
1300
+ _context33.t5 = _yield$this$post$out;
1301
+ _context33.next = 24;
1174
1302
  break;
1175
1303
  case 23:
1176
- _context31.t5 = null;
1304
+ _context33.t5 = null;
1177
1305
  case 24:
1178
- return _context31.abrupt("return", _context31.t5);
1306
+ return _context33.abrupt("return", _context33.t5);
1179
1307
  case 25:
1180
1308
  case "end":
1181
- return _context31.stop();
1309
+ return _context33.stop();
1182
1310
  }
1183
- }, _callee31, this);
1311
+ }, _callee33, this);
1184
1312
  }));
1185
- function p(_x20) {
1313
+ function p(_x22) {
1186
1314
  return _p.apply(this, arguments);
1187
1315
  }
1188
1316
  return p;
@@ -1190,102 +1318,102 @@ var HB = /*#__PURE__*/function () {
1190
1318
  }, {
1191
1319
  key: "post",
1192
1320
  value: function () {
1193
- var _post = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(obj) {
1321
+ var _post2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(obj) {
1194
1322
  var opt,
1195
1323
  _json,
1196
1324
  signed,
1197
- _args33 = arguments;
1198
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
1199
- while (1) switch (_context32.prev = _context32.next) {
1325
+ _args35 = arguments;
1326
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
1327
+ while (1) switch (_context34.prev = _context34.next) {
1200
1328
  case 0:
1201
- opt = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : {};
1329
+ opt = _args35.length > 1 && _args35[1] !== undefined ? _args35[1] : {};
1202
1330
  _json = opt.json ? "/~json@1.0/serialize" : "";
1203
1331
  obj.path += _json;
1204
- _context32.next = 5;
1332
+ _context34.next = 5;
1205
1333
  return this.sign(obj, opt);
1206
1334
  case 5:
1207
- signed = _context32.sent;
1208
- _context32.next = 8;
1335
+ signed = _context34.sent;
1336
+ _context34.next = 8;
1209
1337
  return this.send(signed);
1210
1338
  case 8:
1211
- return _context32.abrupt("return", _context32.sent);
1339
+ return _context34.abrupt("return", _context34.sent);
1212
1340
  case 9:
1213
1341
  case "end":
1214
- return _context32.stop();
1342
+ return _context34.stop();
1215
1343
  }
1216
- }, _callee32, this);
1344
+ }, _callee34, this);
1217
1345
  }));
1218
- function post(_x21) {
1219
- return _post.apply(this, arguments);
1346
+ function post(_x23) {
1347
+ return _post2.apply(this, arguments);
1220
1348
  }
1221
1349
  return post;
1222
1350
  }()
1223
1351
  }, {
1224
1352
  key: "g",
1225
1353
  value: function () {
1226
- var _g = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(path) {
1354
+ var _g = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(path) {
1227
1355
  var _2, _args$_2, _args$2, _args$2$path, _yield$this$get$out, _yield$this$get;
1228
1356
  var _len2,
1229
1357
  args,
1230
1358
  _key2,
1231
1359
  _args,
1232
- _args34 = arguments;
1233
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
1234
- while (1) switch (_context33.prev = _context33.next) {
1360
+ _args36 = arguments;
1361
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
1362
+ while (1) switch (_context35.prev = _context35.next) {
1235
1363
  case 0:
1236
- for (_len2 = _args34.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1237
- args[_key2 - 1] = _args34[_key2];
1364
+ for (_len2 = _args36.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1365
+ args[_key2 - 1] = _args36[_key2];
1238
1366
  }
1239
1367
  _args = (0, _ramda.clone)(args);
1240
1368
  (_args$_2 = _args[_2 = 0]) !== null && _args$_2 !== void 0 ? _args$_2 : _args[_2] = {};
1241
1369
  (_args$2$path = (_args$2 = _args[0]).path) !== null && _args$2$path !== void 0 ? _args$2$path : _args$2.path = path;
1242
- _context33.next = 6;
1370
+ _context35.next = 6;
1243
1371
  return this.get.apply(this, _toConsumableArray(_args));
1244
1372
  case 6:
1245
- _context33.t2 = _yield$this$get = _context33.sent;
1246
- _context33.t1 = _context33.t2 === null;
1247
- if (_context33.t1) {
1248
- _context33.next = 10;
1373
+ _context35.t2 = _yield$this$get = _context35.sent;
1374
+ _context35.t1 = _context35.t2 === null;
1375
+ if (_context35.t1) {
1376
+ _context35.next = 10;
1249
1377
  break;
1250
1378
  }
1251
- _context33.t1 = _yield$this$get === void 0;
1379
+ _context35.t1 = _yield$this$get === void 0;
1252
1380
  case 10:
1253
- if (!_context33.t1) {
1254
- _context33.next = 14;
1381
+ if (!_context35.t1) {
1382
+ _context35.next = 14;
1255
1383
  break;
1256
1384
  }
1257
- _context33.t3 = void 0;
1258
- _context33.next = 15;
1385
+ _context35.t3 = void 0;
1386
+ _context35.next = 15;
1259
1387
  break;
1260
1388
  case 14:
1261
- _context33.t3 = _yield$this$get.out;
1389
+ _context35.t3 = _yield$this$get.out;
1262
1390
  case 15:
1263
- _context33.t4 = _yield$this$get$out = _context33.t3;
1264
- _context33.t0 = _context33.t4 !== null;
1265
- if (!_context33.t0) {
1266
- _context33.next = 19;
1391
+ _context35.t4 = _yield$this$get$out = _context35.t3;
1392
+ _context35.t0 = _context35.t4 !== null;
1393
+ if (!_context35.t0) {
1394
+ _context35.next = 19;
1267
1395
  break;
1268
1396
  }
1269
- _context33.t0 = _yield$this$get$out !== void 0;
1397
+ _context35.t0 = _yield$this$get$out !== void 0;
1270
1398
  case 19:
1271
- if (!_context33.t0) {
1272
- _context33.next = 23;
1399
+ if (!_context35.t0) {
1400
+ _context35.next = 23;
1273
1401
  break;
1274
1402
  }
1275
- _context33.t5 = _yield$this$get$out;
1276
- _context33.next = 24;
1403
+ _context35.t5 = _yield$this$get$out;
1404
+ _context35.next = 24;
1277
1405
  break;
1278
1406
  case 23:
1279
- _context33.t5 = null;
1407
+ _context35.t5 = null;
1280
1408
  case 24:
1281
- return _context33.abrupt("return", _context33.t5);
1409
+ return _context35.abrupt("return", _context35.t5);
1282
1410
  case 25:
1283
1411
  case "end":
1284
- return _context33.stop();
1412
+ return _context35.stop();
1285
1413
  }
1286
- }, _callee33, this);
1414
+ }, _callee35, this);
1287
1415
  }));
1288
- function g(_x22) {
1416
+ function g(_x24) {
1289
1417
  return _g.apply(this, arguments);
1290
1418
  }
1291
1419
  return g;
@@ -1293,7 +1421,7 @@ var HB = /*#__PURE__*/function () {
1293
1421
  }, {
1294
1422
  key: "get",
1295
1423
  value: function () {
1296
- var _get = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(_ref18) {
1424
+ var _get = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(_ref20) {
1297
1425
  var _path;
1298
1426
  var path,
1299
1427
  params,
@@ -1305,12 +1433,12 @@ var HB = /*#__PURE__*/function () {
1305
1433
  response,
1306
1434
  headers,
1307
1435
  http,
1308
- _args35 = arguments;
1309
- return _regeneratorRuntime().wrap(function _callee34$(_context34) {
1310
- while (1) switch (_context34.prev = _context34.next) {
1436
+ _args37 = arguments;
1437
+ return _regeneratorRuntime().wrap(function _callee36$(_context36) {
1438
+ while (1) switch (_context36.prev = _context36.next) {
1311
1439
  case 0:
1312
- path = _ref18.path, params = _objectWithoutProperties(_ref18, _excluded4);
1313
- opt = _args35.length > 1 && _args35[1] !== undefined ? _args35[1] : {};
1440
+ path = _ref20.path, params = _objectWithoutProperties(_ref20, _excluded4);
1441
+ opt = _args37.length > 1 && _args37[1] !== undefined ? _args37[1] : {};
1314
1442
  _json = opt.json ? "/~json@1.0/serialize" : "";
1315
1443
  (_path = path) !== null && _path !== void 0 ? _path : path = "/~message@1.0";
1316
1444
  if (!/^\//.test(path)) path = "/" + path;
@@ -1322,33 +1450,33 @@ var HB = /*#__PURE__*/function () {
1322
1450
  i++;
1323
1451
  }
1324
1452
  }
1325
- _context34.next = 9;
1453
+ _context36.next = 9;
1326
1454
  return fetch("".concat(this.url).concat(path).concat(_json).concat(_params));
1327
1455
  case 9:
1328
- response = _context34.sent;
1456
+ response = _context36.sent;
1329
1457
  headers = {};
1330
1458
  response.headers.forEach(function (v, k) {
1331
1459
  return headers[k] = v;
1332
1460
  });
1333
- _context34.t0 = headers;
1334
- _context34.next = 15;
1461
+ _context36.t0 = headers;
1462
+ _context36.next = 15;
1335
1463
  return response.text();
1336
1464
  case 15:
1337
- _context34.t1 = _context34.sent;
1338
- _context34.t2 = response.status;
1465
+ _context36.t1 = _context36.sent;
1466
+ _context36.t2 = response.status;
1339
1467
  http = {
1340
- headers: _context34.t0,
1341
- body: _context34.t1,
1342
- status: _context34.t2
1468
+ headers: _context36.t0,
1469
+ body: _context36.t1,
1470
+ status: _context36.t2
1343
1471
  };
1344
- return _context34.abrupt("return", _objectSpread(_objectSpread({}, (0, _httpsigUtils.from)(http)), http));
1472
+ return _context36.abrupt("return", _objectSpread(_objectSpread({}, (0, _httpsigUtils.from)(http)), http));
1345
1473
  case 19:
1346
1474
  case "end":
1347
- return _context34.stop();
1475
+ return _context36.stop();
1348
1476
  }
1349
- }, _callee34, this);
1477
+ }, _callee36, this);
1350
1478
  }));
1351
- function get(_x23) {
1479
+ function get(_x25) {
1352
1480
  return _get.apply(this, arguments);
1353
1481
  }
1354
1482
  return get;
@@ -1356,28 +1484,28 @@ var HB = /*#__PURE__*/function () {
1356
1484
  }, {
1357
1485
  key: "postJSON",
1358
1486
  value: function () {
1359
- var _postJSON = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(args) {
1487
+ var _postJSON = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(args) {
1360
1488
  var opt,
1361
1489
  res,
1362
- _args36 = arguments;
1363
- return _regeneratorRuntime().wrap(function _callee35$(_context35) {
1364
- while (1) switch (_context35.prev = _context35.next) {
1490
+ _args38 = arguments;
1491
+ return _regeneratorRuntime().wrap(function _callee37$(_context37) {
1492
+ while (1) switch (_context37.prev = _context37.next) {
1365
1493
  case 0:
1366
- opt = _args36.length > 1 && _args36[1] !== undefined ? _args36[1] : {};
1367
- _context35.next = 3;
1494
+ opt = _args38.length > 1 && _args38[1] !== undefined ? _args38[1] : {};
1495
+ _context37.next = 3;
1368
1496
  return this.post(args, _objectSpread(_objectSpread({}, opt), {}, {
1369
1497
  json: true
1370
1498
  }));
1371
1499
  case 3:
1372
- res = _context35.sent;
1373
- return _context35.abrupt("return", JSON.parse(res.body));
1500
+ res = _context37.sent;
1501
+ return _context37.abrupt("return", JSON.parse(res.body));
1374
1502
  case 5:
1375
1503
  case "end":
1376
- return _context35.stop();
1504
+ return _context37.stop();
1377
1505
  }
1378
- }, _callee35, this);
1506
+ }, _callee37, this);
1379
1507
  }));
1380
- function postJSON(_x24) {
1508
+ function postJSON(_x26) {
1381
1509
  return _postJSON.apply(this, arguments);
1382
1510
  }
1383
1511
  return postJSON;
@@ -1385,28 +1513,28 @@ var HB = /*#__PURE__*/function () {
1385
1513
  }, {
1386
1514
  key: "getJSON",
1387
1515
  value: function () {
1388
- var _getJSON = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(args) {
1516
+ var _getJSON = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(args) {
1389
1517
  var opt,
1390
1518
  res,
1391
- _args37 = arguments;
1392
- return _regeneratorRuntime().wrap(function _callee36$(_context36) {
1393
- while (1) switch (_context36.prev = _context36.next) {
1519
+ _args39 = arguments;
1520
+ return _regeneratorRuntime().wrap(function _callee38$(_context38) {
1521
+ while (1) switch (_context38.prev = _context38.next) {
1394
1522
  case 0:
1395
- opt = _args37.length > 1 && _args37[1] !== undefined ? _args37[1] : {};
1396
- _context36.next = 3;
1523
+ opt = _args39.length > 1 && _args39[1] !== undefined ? _args39[1] : {};
1524
+ _context38.next = 3;
1397
1525
  return this.get(args, _objectSpread(_objectSpread({}, opt), {}, {
1398
1526
  json: true
1399
1527
  }));
1400
1528
  case 3:
1401
- res = _context36.sent;
1402
- return _context36.abrupt("return", JSON.parse(res.body));
1529
+ res = _context38.sent;
1530
+ return _context38.abrupt("return", JSON.parse(res.body));
1403
1531
  case 5:
1404
1532
  case "end":
1405
- return _context36.stop();
1533
+ return _context38.stop();
1406
1534
  }
1407
- }, _callee36, this);
1535
+ }, _callee38, this);
1408
1536
  }));
1409
- function getJSON(_x25) {
1537
+ function getJSON(_x27) {
1410
1538
  return _getJSON.apply(this, arguments);
1411
1539
  }
1412
1540
  return getJSON;
@@ -1414,37 +1542,37 @@ var HB = /*#__PURE__*/function () {
1414
1542
  }, {
1415
1543
  key: "spawnAOS",
1416
1544
  value: function () {
1417
- var _spawnAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(image) {
1545
+ var _spawnAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(image) {
1418
1546
  var _image, _this$image2;
1419
1547
  var tags;
1420
- return _regeneratorRuntime().wrap(function _callee37$(_context37) {
1421
- while (1) switch (_context37.prev = _context37.next) {
1548
+ return _regeneratorRuntime().wrap(function _callee39$(_context39) {
1549
+ while (1) switch (_context39.prev = _context39.next) {
1422
1550
  case 0:
1423
- _context37.next = 2;
1551
+ _context39.next = 2;
1424
1552
  return this.setInfo();
1425
1553
  case 2:
1426
1554
  if (!((_image = image) !== null && _image !== void 0)) {
1427
- _context37.next = 6;
1555
+ _context39.next = 6;
1428
1556
  break;
1429
1557
  }
1430
1558
  _image;
1431
- _context37.next = 14;
1559
+ _context39.next = 14;
1432
1560
  break;
1433
1561
  case 6:
1434
1562
  if (!((_this$image2 = this.image) !== null && _this$image2 !== void 0)) {
1435
- _context37.next = 10;
1563
+ _context39.next = 10;
1436
1564
  break;
1437
1565
  }
1438
- _context37.t0 = _this$image2;
1439
- _context37.next = 13;
1566
+ _context39.t0 = _this$image2;
1567
+ _context39.next = 13;
1440
1568
  break;
1441
1569
  case 10:
1442
- _context37.next = 12;
1570
+ _context39.next = 12;
1443
1571
  return this.getImage();
1444
1572
  case 12:
1445
- _context37.t0 = _context37.sent;
1573
+ _context39.t0 = _context39.sent;
1446
1574
  case 13:
1447
- image = _context37.t0;
1575
+ image = _context39.t0;
1448
1576
  case 14:
1449
1577
  tags = {
1450
1578
  "data-protocol": "ao",
@@ -1459,17 +1587,17 @@ var HB = /*#__PURE__*/function () {
1459
1587
  "patch-mode": "patches",
1460
1588
  passes: 2
1461
1589
  };
1462
- _context37.next = 17;
1590
+ _context39.next = 17;
1463
1591
  return this.spawn(tags);
1464
1592
  case 17:
1465
- return _context37.abrupt("return", _context37.sent);
1593
+ return _context39.abrupt("return", _context39.sent);
1466
1594
  case 18:
1467
1595
  case "end":
1468
- return _context37.stop();
1596
+ return _context39.stop();
1469
1597
  }
1470
- }, _callee37, this);
1598
+ }, _callee39, this);
1471
1599
  }));
1472
- function spawnAOS(_x26) {
1600
+ function spawnAOS(_x28) {
1473
1601
  return _spawnAOS.apply(this, arguments);
1474
1602
  }
1475
1603
  return spawnAOS;
@@ -1477,26 +1605,26 @@ var HB = /*#__PURE__*/function () {
1477
1605
  }, {
1478
1606
  key: "scheduleAOS",
1479
1607
  value: function () {
1480
- var _scheduleAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(_ref19) {
1481
- var _ref19$action, action, _ref19$tags, tags, rest;
1482
- return _regeneratorRuntime().wrap(function _callee38$(_context38) {
1483
- while (1) switch (_context38.prev = _context38.next) {
1608
+ var _scheduleAOS = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(_ref21) {
1609
+ var _ref21$action, action, _ref21$tags, tags, rest;
1610
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
1611
+ while (1) switch (_context40.prev = _context40.next) {
1484
1612
  case 0:
1485
- _ref19$action = _ref19.action, action = _ref19$action === void 0 ? "Eval" : _ref19$action, _ref19$tags = _ref19.tags, tags = _ref19$tags === void 0 ? {} : _ref19$tags, rest = _objectWithoutProperties(_ref19, _excluded5);
1613
+ _ref21$action = _ref21.action, action = _ref21$action === void 0 ? "Eval" : _ref21$action, _ref21$tags = _ref21.tags, tags = _ref21$tags === void 0 ? {} : _ref21$tags, rest = _objectWithoutProperties(_ref21, _excluded5);
1486
1614
  if (action) tags.Action = action;
1487
- _context38.next = 4;
1615
+ _context40.next = 4;
1488
1616
  return this.schedule(_objectSpread({
1489
1617
  tags: tags
1490
1618
  }, rest));
1491
1619
  case 4:
1492
- return _context38.abrupt("return", _context38.sent);
1620
+ return _context40.abrupt("return", _context40.sent);
1493
1621
  case 5:
1494
1622
  case "end":
1495
- return _context38.stop();
1623
+ return _context40.stop();
1496
1624
  }
1497
- }, _callee38, this);
1625
+ }, _callee40, this);
1498
1626
  }));
1499
- function scheduleAOS(_x27) {
1627
+ function scheduleAOS(_x29) {
1500
1628
  return _scheduleAOS.apply(this, arguments);
1501
1629
  }
1502
1630
  return scheduleAOS;