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