wao 0.4.6 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/aoconnect.js CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.connect = void 0;
8
- var _warpArbundles = require("warp-arbundles");
8
+ var WarpArBundles = _interopRequireWildcard(require("warp-arbundles"));
9
9
  var _crypto = _interopRequireDefault(require("crypto"));
10
10
  var _base64url = _interopRequireDefault(require("base64url"));
11
11
  var _utils = require("./utils.js");
@@ -17,14 +17,17 @@ var _path = require("path");
17
17
  var _test = require("./test.js");
18
18
  var _ramda = require("ramda");
19
19
  var _tar = _interopRequireDefault(require("./tar.js"));
20
+ var _WarpArBundles$defaul;
20
21
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
22
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
21
24
  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; }
22
25
  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; }
26
+ 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; }
23
27
  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; }
24
28
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
25
29
  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); }
26
30
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
27
- 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; }
28
31
  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); }
29
32
  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); }); }; }
30
33
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
@@ -33,6 +36,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
33
36
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
34
37
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
35
38
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
39
+ var pkg = (_WarpArBundles$defaul = WarpArBundles["default"]) !== null && _WarpArBundles$defaul !== void 0 ? _WarpArBundles$defaul : WarpArBundles;
40
+ var DataItem = pkg.DataItem;
36
41
  var connect = exports.connect = function connect(mem) {
37
42
  var _mem;
38
43
  (_mem = mem) !== null && _mem !== void 0 ? _mem : mem = new _armem["default"]();
@@ -126,70 +131,9 @@ var connect = exports.connect = function connect(mem) {
126
131
  }
127
132
  };
128
133
  };
129
- var postModule = /*#__PURE__*/function () {
130
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref4) {
131
- var data, _ref4$tags, tags, signer, t, _tags, _yield$ar$dataitem, id, owner, handle;
132
- return _regeneratorRuntime().wrap(function _callee$(_context) {
133
- while (1) switch (_context.prev = _context.next) {
134
- case 0:
135
- data = _ref4.data, _ref4$tags = _ref4.tags, tags = _ref4$tags === void 0 ? {} : _ref4$tags, signer = _ref4.signer;
136
- t = (0, _ramda.mergeLeft)(tags, {
137
- "Data-Protocol": "ao",
138
- Variant: "ao.TN.1",
139
- Type: "Module",
140
- "Module-Format": "wasm64-unknown-emscripten-draft_2024_02_15",
141
- "Input-Encoding": "JSON-V1",
142
- "Output-Encoding": "JSON-V1",
143
- "Memory-Limit": "1-gb",
144
- "Compute-Limit": "9000000000000"
145
- });
146
- _tags = (0, _utils.buildTags)(null, t);
147
- _context.next = 5;
148
- return ar.dataitem({
149
- tags: _tags,
150
- data: data,
151
- signer: signer
152
- });
153
- case 5:
154
- _yield$ar$dataitem = _context.sent;
155
- id = _yield$ar$dataitem.id;
156
- owner = _yield$ar$dataitem.owner;
157
- _context.next = 10;
158
- return ar.post({
159
- data: data,
160
- signer: signer,
161
- tags: t
162
- });
163
- case 10:
164
- _context.next = 12;
165
- return (0, _aoLoader["default"])(data, {
166
- format: t["Module-Format"],
167
- mode: "test",
168
- WeaveDrive: WeaveDrive
169
- });
170
- case 12:
171
- handle = _context.sent;
172
- // test me
173
- mem.modmap[id] = {
174
- handle: handle,
175
- id: id,
176
- data: data,
177
- format: t["Module-Format"]
178
- };
179
- return _context.abrupt("return", id);
180
- case 15:
181
- case "end":
182
- return _context.stop();
183
- }
184
- }, _callee);
185
- }));
186
- return function postModule(_x) {
187
- return _ref5.apply(this, arguments);
188
- };
189
- }();
190
134
  var spawn = /*#__PURE__*/function () {
191
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
192
- var _opt$module, _opt$tags, _opt$tags2;
135
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
136
+ var _opt$module, _mem$wasms$mod$data, _opt$tags, _opt$tags2;
193
137
  var opt,
194
138
  mod,
195
139
  _module,
@@ -200,7 +144,7 @@ var connect = exports.connect = function connect(mem) {
200
144
  _iterator,
201
145
  _step,
202
146
  v,
203
- _yield$ar$dataitem2,
147
+ _yield$ar$dataitem,
204
148
  id,
205
149
  owner,
206
150
  item,
@@ -222,44 +166,44 @@ var connect = exports.connect = function connect(mem) {
222
166
  _int,
223
167
  cronTags,
224
168
  k,
225
- _args2 = arguments;
226
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
227
- while (1) switch (_context2.prev = _context2.next) {
169
+ _args = arguments;
170
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
171
+ while (1) switch (_context.prev = _context.next) {
228
172
  case 0:
229
- opt = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
173
+ opt = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
230
174
  if (opt.module) {
231
- _context2.next = 3;
175
+ _context.next = 3;
232
176
  break;
233
177
  }
234
178
  throw Error("module missing");
235
179
  case 3:
236
180
  if (opt.scheduler) {
237
- _context2.next = 5;
181
+ _context.next = 5;
238
182
  break;
239
183
  }
240
184
  throw Error("scheduler missing");
241
185
  case 5:
242
186
  mod = (_opt$module = opt.module) !== null && _opt$module !== void 0 ? _opt$module : mem.modules["aos2_0_1"];
243
187
  _module = null;
244
- _context2.next = 9;
188
+ _context.next = 9;
245
189
  return (0, _utils.dirname)();
246
190
  case 9:
247
- __dirname = _context2.sent;
248
- wasm = (0, _fs.readFileSync)((0, _path.resolve)(__dirname, "lua/".concat(mem.wasms[mod].file, ".wasm")));
249
- _context2.next = 13;
191
+ __dirname = _context.sent;
192
+ wasm = (_mem$wasms$mod$data = mem.wasms[mod].data) !== null && _mem$wasms$mod$data !== void 0 ? _mem$wasms$mod$data : (0, _fs.readFileSync)((0, _path.resolve)(__dirname, "lua/".concat(mem.wasms[mod].file, ".wasm")));
193
+ _context.next = 13;
250
194
  return (0, _aoLoader["default"])(wasm, {
251
195
  format: mem.wasms[mod].format,
252
196
  mode: "test",
253
197
  WeaveDrive: WeaveDrive
254
198
  });
255
199
  case 13:
256
- handle = _context2.sent;
200
+ handle = _context.sent;
257
201
  _module = {
258
202
  handle: handle,
259
203
  id: mod
260
204
  };
261
205
  if (mod) {
262
- _context2.next = 17;
206
+ _context.next = 17;
263
207
  break;
264
208
  }
265
209
  throw Error("module not found");
@@ -290,18 +234,18 @@ var connect = exports.connect = function connect(mem) {
290
234
  name: "Type",
291
235
  value: "Process"
292
236
  });
293
- _context2.next = 25;
237
+ _context.next = 25;
294
238
  return ar.dataitem({
295
239
  data: opt.data,
296
240
  signer: opt.signer,
297
241
  tags: (0, _utils.tags)(opt.tags)
298
242
  });
299
243
  case 25:
300
- _yield$ar$dataitem2 = _context2.sent;
301
- id = _yield$ar$dataitem2.id;
302
- owner = _yield$ar$dataitem2.owner;
303
- item = _yield$ar$dataitem2.item;
304
- _context2.next = 31;
244
+ _yield$ar$dataitem = _context.sent;
245
+ id = _yield$ar$dataitem.id;
246
+ owner = _yield$ar$dataitem.owner;
247
+ item = _yield$ar$dataitem.item;
248
+ _context.next = 31;
305
249
  return ar.postItem(item, _test.su.jwk);
306
250
  case 31:
307
251
  _tags = (0, _utils.tags)(opt.tags);
@@ -322,7 +266,7 @@ var connect = exports.connect = function connect(mem) {
322
266
  opt: opt
323
267
  };
324
268
  if (!_tags["On-Boot"]) {
325
- _context2.next = 49;
269
+ _context.next = 49;
326
270
  break;
327
271
  }
328
272
  data = "";
@@ -335,14 +279,14 @@ var connect = exports.connect = function connect(mem) {
335
279
  auth: _test.mu.addr
336
280
  });
337
281
  _t = (0, _utils.tags)(msg.Tags);
338
- _context2.next = 43;
282
+ _context.next = 43;
339
283
  return _module.handle(null, msg, _env);
340
284
  case 43:
341
- res = _context2.sent;
285
+ res = _context.sent;
342
286
  p.memory = res.Memory;
343
287
  delete res.Memory;
344
288
  p.res[id] = res;
345
- _context2.next = 50;
289
+ _context.next = 50;
346
290
  break;
347
291
  case 49:
348
292
  p.height += 1;
@@ -350,35 +294,35 @@ var connect = exports.connect = function connect(mem) {
350
294
  mem.msgs[id] = opt;
351
295
  mem.env[id] = p;
352
296
  if (!_tags["Cron-Interval"]) {
353
- _context2.next = 76;
297
+ _context.next = 76;
354
298
  break;
355
299
  }
356
300
  _tags$CronInterval$s = _tags["Cron-Interval"].split("-"), _tags$CronInterval$s2 = _slicedToArray(_tags$CronInterval$s, 2), num = _tags$CronInterval$s2[0], unit = _tags$CronInterval$s2[1];
357
301
  _int = 0;
358
- _context2.t0 = unit.replace(/s$/, "");
359
- _context2.next = _context2.t0 === "millisecond" ? 58 : _context2.t0 === "second" ? 60 : _context2.t0 === "minute" ? 62 : _context2.t0 === "hour" ? 64 : _context2.t0 === "day" ? 66 : _context2.t0 === "month" ? 68 : _context2.t0 === "year" ? 70 : 72;
302
+ _context.t0 = unit.replace(/s$/, "");
303
+ _context.next = _context.t0 === "millisecond" ? 58 : _context.t0 === "second" ? 60 : _context.t0 === "minute" ? 62 : _context.t0 === "hour" ? 64 : _context.t0 === "day" ? 66 : _context.t0 === "month" ? 68 : _context.t0 === "year" ? 70 : 72;
360
304
  break;
361
305
  case 58:
362
306
  _int = num;
363
- return _context2.abrupt("break", 72);
307
+ return _context.abrupt("break", 72);
364
308
  case 60:
365
309
  _int = num * 1000;
366
- return _context2.abrupt("break", 72);
310
+ return _context.abrupt("break", 72);
367
311
  case 62:
368
312
  _int = num * 1000 * 60;
369
- return _context2.abrupt("break", 72);
313
+ return _context.abrupt("break", 72);
370
314
  case 64:
371
315
  _int = num * 1000 * 60 * 60;
372
- return _context2.abrupt("break", 72);
316
+ return _context.abrupt("break", 72);
373
317
  case 66:
374
318
  _int = num * 1000 * 60 * 60 * 24;
375
- return _context2.abrupt("break", 72);
319
+ return _context.abrupt("break", 72);
376
320
  case 68:
377
321
  _int = num * 1000 * 60 * 60 * 24 * 30;
378
- return _context2.abrupt("break", 72);
322
+ return _context.abrupt("break", 72);
379
323
  case 70:
380
324
  _int = num * 1000 * 60 * 60 * 24 * 365;
381
- return _context2.abrupt("break", 72);
325
+ return _context.abrupt("break", 72);
382
326
  case 72:
383
327
  cronTags = [];
384
328
  for (k in _tags) {
@@ -392,15 +336,15 @@ var connect = exports.connect = function connect(mem) {
392
336
  mem.env[id].cronTags = cronTags;
393
337
  mem.env[id].span = _int;
394
338
  case 76:
395
- return _context2.abrupt("return", id);
339
+ return _context.abrupt("return", id);
396
340
  case 77:
397
341
  case "end":
398
- return _context2.stop();
342
+ return _context.stop();
399
343
  }
400
- }, _callee2);
344
+ }, _callee);
401
345
  }));
402
346
  return function spawn() {
403
- return _ref6.apply(this, arguments);
347
+ return _ref4.apply(this, arguments);
404
348
  };
405
349
  }();
406
350
  function genHashChain(previousHash) {
@@ -413,11 +357,11 @@ var connect = exports.connect = function connect(mem) {
413
357
  return (0, _base64url["default"])(hasher.digest());
414
358
  }
415
359
  var _assign = /*#__PURE__*/function () {
416
- var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(opt) {
360
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(opt) {
417
361
  var _opt$tags3;
418
- var p, _opt, hash, _yield$ar$dataitem3, id, owner, item, _opt$data2, _ref8, _opt$from, _res$Messages, _res$Spawns, _res$Assignments, msg, _env, res, _iterator2, _step2, v, _iterator3, _step3, _v, _tags, _iterator4, _step4, _v2, _iterator5, _step5, v2;
419
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
420
- while (1) switch (_context3.prev = _context3.next) {
362
+ var p, _opt, hash, _yield$ar$dataitem2, id, owner, item, _opt$data2, _ref6, _opt$from, _res$Messages, _res$Spawns, _res$Assignments, msg, _env, res, _iterator2, _step2, v, _iterator3, _step3, _v, _tags, _iterator4, _step4, _v2, _iterator5, _step5, v2;
363
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
364
+ while (1) switch (_context2.prev = _context2.next) {
421
365
  case 0:
422
366
  p = mem.env[opt.process];
423
367
  _opt = mem.msgs[opt.message];
@@ -437,7 +381,7 @@ var connect = exports.connect = function connect(mem) {
437
381
  "Hash-Chain": hash
438
382
  }));
439
383
  p.epochs.push([opt.message]);
440
- _context3.next = 8;
384
+ _context2.next = 8;
441
385
  return ar.dataitem({
442
386
  data: opt.data,
443
387
  signer: opt.signer,
@@ -445,25 +389,25 @@ var connect = exports.connect = function connect(mem) {
445
389
  target: opt.process
446
390
  });
447
391
  case 8:
448
- _yield$ar$dataitem3 = _context3.sent;
449
- id = _yield$ar$dataitem3.id;
450
- owner = _yield$ar$dataitem3.owner;
451
- item = _yield$ar$dataitem3.item;
452
- _context3.next = 14;
392
+ _yield$ar$dataitem2 = _context2.sent;
393
+ id = _yield$ar$dataitem2.id;
394
+ owner = _yield$ar$dataitem2.owner;
395
+ item = _yield$ar$dataitem2.item;
396
+ _context2.next = 14;
453
397
  return ar.postItem(item, _test.su.jwk);
454
398
  case 14:
455
- _context3.prev = 14;
456
- msg = genMsg(opt.message, p, (_opt$data2 = _opt.data) !== null && _opt$data2 !== void 0 ? _opt$data2 : "", _opt.tags, (_ref8 = (_opt$from = _opt.from) !== null && _opt$from !== void 0 ? _opt$from : opt.from) !== null && _ref8 !== void 0 ? _ref8 : owner, _test.mu.addr);
399
+ _context2.prev = 14;
400
+ msg = genMsg(opt.message, p, (_opt$data2 = _opt.data) !== null && _opt$data2 !== void 0 ? _opt$data2 : "", _opt.tags, (_ref6 = (_opt$from = _opt.from) !== null && _opt$from !== void 0 ? _opt$from : opt.from) !== null && _ref6 !== void 0 ? _ref6 : owner, _test.mu.addr);
457
401
  _env = genEnv({
458
402
  pid: p.id,
459
403
  owner: p.owner,
460
404
  module: p.module,
461
405
  auth: _test.mu.addr
462
406
  });
463
- _context3.next = 19;
407
+ _context2.next = 19;
464
408
  return p.handle(p.memory, msg, _env);
465
409
  case 19:
466
- res = _context3.sent;
410
+ res = _context2.sent;
467
411
  p.memory = res.Memory;
468
412
  delete res.Memory;
469
413
  p.res[opt.message] = res;
@@ -473,19 +417,19 @@ var connect = exports.connect = function connect(mem) {
473
417
  }, opt));
474
418
  mem.msgs[opt.message] = _opt;
475
419
  _iterator2 = _createForOfIteratorHelper((_res$Messages = res.Messages) !== null && _res$Messages !== void 0 ? _res$Messages : []);
476
- _context3.prev = 27;
420
+ _context2.prev = 27;
477
421
  _iterator2.s();
478
422
  case 29:
479
423
  if ((_step2 = _iterator2.n()).done) {
480
- _context3.next = 36;
424
+ _context2.next = 36;
481
425
  break;
482
426
  }
483
427
  v = _step2.value;
484
428
  if (!mem.env[v.Target]) {
485
- _context3.next = 34;
429
+ _context2.next = 34;
486
430
  break;
487
431
  }
488
- _context3.next = 34;
432
+ _context2.next = 34;
489
433
  return message({
490
434
  process: v.Target,
491
435
  tags: v.Tags,
@@ -494,31 +438,31 @@ var connect = exports.connect = function connect(mem) {
494
438
  from: opt.process
495
439
  });
496
440
  case 34:
497
- _context3.next = 29;
441
+ _context2.next = 29;
498
442
  break;
499
443
  case 36:
500
- _context3.next = 41;
444
+ _context2.next = 41;
501
445
  break;
502
446
  case 38:
503
- _context3.prev = 38;
504
- _context3.t0 = _context3["catch"](27);
505
- _iterator2.e(_context3.t0);
447
+ _context2.prev = 38;
448
+ _context2.t0 = _context2["catch"](27);
449
+ _iterator2.e(_context2.t0);
506
450
  case 41:
507
- _context3.prev = 41;
451
+ _context2.prev = 41;
508
452
  _iterator2.f();
509
- return _context3.finish(41);
453
+ return _context2.finish(41);
510
454
  case 44:
511
455
  _iterator3 = _createForOfIteratorHelper((_res$Spawns = res.Spawns) !== null && _res$Spawns !== void 0 ? _res$Spawns : []);
512
- _context3.prev = 45;
456
+ _context2.prev = 45;
513
457
  _iterator3.s();
514
458
  case 47:
515
459
  if ((_step3 = _iterator3.n()).done) {
516
- _context3.next = 54;
460
+ _context2.next = 54;
517
461
  break;
518
462
  }
519
463
  _v = _step3.value;
520
464
  _tags = (0, _utils.tags)(_v.Tags);
521
- _context3.next = 52;
465
+ _context2.next = 52;
522
466
  return spawn({
523
467
  module: _tags.Module,
524
468
  scheduler: _test.scheduler,
@@ -528,39 +472,39 @@ var connect = exports.connect = function connect(mem) {
528
472
  signer: _test.mu.signer
529
473
  });
530
474
  case 52:
531
- _context3.next = 47;
475
+ _context2.next = 47;
532
476
  break;
533
477
  case 54:
534
- _context3.next = 59;
478
+ _context2.next = 59;
535
479
  break;
536
480
  case 56:
537
- _context3.prev = 56;
538
- _context3.t1 = _context3["catch"](45);
539
- _iterator3.e(_context3.t1);
481
+ _context2.prev = 56;
482
+ _context2.t1 = _context2["catch"](45);
483
+ _iterator3.e(_context2.t1);
540
484
  case 59:
541
- _context3.prev = 59;
485
+ _context2.prev = 59;
542
486
  _iterator3.f();
543
- return _context3.finish(59);
487
+ return _context2.finish(59);
544
488
  case 62:
545
489
  _iterator4 = _createForOfIteratorHelper((_res$Assignments = res.Assignments) !== null && _res$Assignments !== void 0 ? _res$Assignments : []);
546
- _context3.prev = 63;
490
+ _context2.prev = 63;
547
491
  _iterator4.s();
548
492
  case 65:
549
493
  if ((_step4 = _iterator4.n()).done) {
550
- _context3.next = 86;
494
+ _context2.next = 86;
551
495
  break;
552
496
  }
553
497
  _v2 = _step4.value;
554
498
  _iterator5 = _createForOfIteratorHelper(_v2.Processes);
555
- _context3.prev = 68;
499
+ _context2.prev = 68;
556
500
  _iterator5.s();
557
501
  case 70:
558
502
  if ((_step5 = _iterator5.n()).done) {
559
- _context3.next = 76;
503
+ _context2.next = 76;
560
504
  break;
561
505
  }
562
506
  v2 = _step5.value;
563
- _context3.next = 74;
507
+ _context2.next = 74;
564
508
  return _assign({
565
509
  message: _v2.Message,
566
510
  process: v2,
@@ -568,57 +512,57 @@ var connect = exports.connect = function connect(mem) {
568
512
  signer: _test.mu.signer
569
513
  });
570
514
  case 74:
571
- _context3.next = 70;
515
+ _context2.next = 70;
572
516
  break;
573
517
  case 76:
574
- _context3.next = 81;
518
+ _context2.next = 81;
575
519
  break;
576
520
  case 78:
577
- _context3.prev = 78;
578
- _context3.t2 = _context3["catch"](68);
579
- _iterator5.e(_context3.t2);
521
+ _context2.prev = 78;
522
+ _context2.t2 = _context2["catch"](68);
523
+ _iterator5.e(_context2.t2);
580
524
  case 81:
581
- _context3.prev = 81;
525
+ _context2.prev = 81;
582
526
  _iterator5.f();
583
- return _context3.finish(81);
527
+ return _context2.finish(81);
584
528
  case 84:
585
- _context3.next = 65;
529
+ _context2.next = 65;
586
530
  break;
587
531
  case 86:
588
- _context3.next = 91;
532
+ _context2.next = 91;
589
533
  break;
590
534
  case 88:
591
- _context3.prev = 88;
592
- _context3.t3 = _context3["catch"](63);
593
- _iterator4.e(_context3.t3);
535
+ _context2.prev = 88;
536
+ _context2.t3 = _context2["catch"](63);
537
+ _iterator4.e(_context2.t3);
594
538
  case 91:
595
- _context3.prev = 91;
539
+ _context2.prev = 91;
596
540
  _iterator4.f();
597
- return _context3.finish(91);
541
+ return _context2.finish(91);
598
542
  case 94:
599
- return _context3.abrupt("return", id);
543
+ return _context2.abrupt("return", id);
600
544
  case 97:
601
- _context3.prev = 97;
602
- _context3.t4 = _context3["catch"](14);
603
- console.log(_context3.t4);
545
+ _context2.prev = 97;
546
+ _context2.t4 = _context2["catch"](14);
547
+ console.log(_context2.t4);
604
548
  case 100:
605
- return _context3.abrupt("return", null);
549
+ return _context2.abrupt("return", null);
606
550
  case 101:
607
551
  case "end":
608
- return _context3.stop();
552
+ return _context2.stop();
609
553
  }
610
- }, _callee3, null, [[14, 97], [27, 38, 41, 44], [45, 56, 59, 62], [63, 88, 91, 94], [68, 78, 81, 84]]);
554
+ }, _callee2, null, [[14, 97], [27, 38, 41, 44], [45, 56, 59, 62], [63, 88, 91, 94], [68, 78, 81, 84]]);
611
555
  }));
612
- return function assign(_x2) {
613
- return _ref7.apply(this, arguments);
556
+ return function assign(_x) {
557
+ return _ref5.apply(this, arguments);
614
558
  };
615
559
  }();
616
560
  var message = /*#__PURE__*/function () {
617
- var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(opt) {
561
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(opt) {
618
562
  var _opt$tags4;
619
- var p, ex, _iterator6, _step6, v, _yield$ar$dataitem4, item, id, owner;
620
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
621
- while (1) switch (_context4.prev = _context4.next) {
563
+ var p, ex, _iterator6, _step6, v, _yield$ar$dataitem3, item, id, owner;
564
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
565
+ while (1) switch (_context3.prev = _context3.next) {
622
566
  case 0:
623
567
  p = mem.env[opt.process];
624
568
  ex = false;
@@ -639,7 +583,7 @@ var connect = exports.connect = function connect(mem) {
639
583
  Type: "Message",
640
584
  SDK: "aoconnect"
641
585
  }));
642
- _context4.next = 7;
586
+ _context3.next = 7;
643
587
  return ar.dataitem({
644
588
  data: opt.data,
645
589
  signer: opt.signer,
@@ -647,15 +591,15 @@ var connect = exports.connect = function connect(mem) {
647
591
  target: opt.process
648
592
  });
649
593
  case 7:
650
- _yield$ar$dataitem4 = _context4.sent;
651
- item = _yield$ar$dataitem4.item;
652
- id = _yield$ar$dataitem4.id;
653
- owner = _yield$ar$dataitem4.owner;
654
- _context4.next = 13;
594
+ _yield$ar$dataitem3 = _context3.sent;
595
+ item = _yield$ar$dataitem3.item;
596
+ id = _yield$ar$dataitem3.id;
597
+ owner = _yield$ar$dataitem3.owner;
598
+ _context3.next = 13;
655
599
  return ar.postItem(item, _test.su.jwk);
656
600
  case 13:
657
601
  mem.msgs[id] = opt;
658
- _context4.next = 16;
602
+ _context3.next = 16;
659
603
  return _assign({
660
604
  message: id,
661
605
  process: opt.process,
@@ -663,24 +607,24 @@ var connect = exports.connect = function connect(mem) {
663
607
  signer: _test.mu.signer
664
608
  });
665
609
  case 16:
666
- return _context4.abrupt("return", id);
610
+ return _context3.abrupt("return", id);
667
611
  case 17:
668
612
  case "end":
669
- return _context4.stop();
613
+ return _context3.stop();
670
614
  }
671
- }, _callee4);
615
+ }, _callee3);
672
616
  }));
673
- return function message(_x3) {
674
- return _ref9.apply(this, arguments);
617
+ return function message(_x2) {
618
+ return _ref7.apply(this, arguments);
675
619
  };
676
620
  }();
677
621
  return {
678
622
  message: message,
679
623
  unmonitor: function () {
680
- var _unmonitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(opt) {
624
+ var _unmonitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(opt) {
681
625
  var p;
682
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
683
- while (1) switch (_context5.prev = _context5.next) {
626
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
627
+ while (1) switch (_context4.prev = _context4.next) {
684
628
  case 0:
685
629
  p = mem.env[opt.process];
686
630
  try {
@@ -689,28 +633,28 @@ var connect = exports.connect = function connect(mem) {
689
633
  } catch (e) {}
690
634
  case 2:
691
635
  case "end":
692
- return _context5.stop();
636
+ return _context4.stop();
693
637
  }
694
- }, _callee5);
638
+ }, _callee4);
695
639
  }));
696
- function unmonitor(_x4) {
640
+ function unmonitor(_x3) {
697
641
  return _unmonitor.apply(this, arguments);
698
642
  }
699
643
  return unmonitor;
700
644
  }(),
701
645
  monitor: function () {
702
- var _monitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(opt) {
646
+ var _monitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(opt) {
703
647
  var p;
704
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
705
- while (1) switch (_context7.prev = _context7.next) {
648
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
649
+ while (1) switch (_context6.prev = _context6.next) {
706
650
  case 0:
707
651
  p = mem.env[opt.process];
708
652
  if ((0, _ramda.isNil)(p.cron)) {
709
- p.cron = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
710
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
711
- while (1) switch (_context6.prev = _context6.next) {
653
+ p.cron = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
654
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
655
+ while (1) switch (_context5.prev = _context5.next) {
712
656
  case 0:
713
- _context6.next = 2;
657
+ _context5.next = 2;
714
658
  return message({
715
659
  tags: p.cronTags,
716
660
  process: opt.process,
@@ -719,18 +663,18 @@ var connect = exports.connect = function connect(mem) {
719
663
  });
720
664
  case 2:
721
665
  case "end":
722
- return _context6.stop();
666
+ return _context5.stop();
723
667
  }
724
- }, _callee6);
668
+ }, _callee5);
725
669
  })), p.span);
726
670
  }
727
671
  case 2:
728
672
  case "end":
729
- return _context7.stop();
673
+ return _context6.stop();
730
674
  }
731
- }, _callee7);
675
+ }, _callee6);
732
676
  }));
733
- function monitor(_x5) {
677
+ function monitor(_x4) {
734
678
  return _monitor.apply(this, arguments);
735
679
  }
736
680
  return monitor;
@@ -738,40 +682,40 @@ var connect = exports.connect = function connect(mem) {
738
682
  spawn: spawn,
739
683
  assign: _assign,
740
684
  result: function () {
741
- var _result = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(opt) {
742
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
743
- while (1) switch (_context8.prev = _context8.next) {
685
+ var _result = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(opt) {
686
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
687
+ while (1) switch (_context7.prev = _context7.next) {
744
688
  case 0:
745
- return _context8.abrupt("return", mem.env[opt.process].res[opt.message]);
689
+ return _context7.abrupt("return", mem.env[opt.process].res[opt.message]);
746
690
  case 1:
747
691
  case "end":
748
- return _context8.stop();
692
+ return _context7.stop();
749
693
  }
750
- }, _callee8);
694
+ }, _callee7);
751
695
  }));
752
- function result(_x6) {
696
+ function result(_x5) {
753
697
  return _result.apply(this, arguments);
754
698
  }
755
699
  return result;
756
700
  }(),
757
701
  results: function () {
758
- var _results = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(opt) {
702
+ var _results = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(opt) {
759
703
  var _opt$limit;
760
704
  var p, results, limit, i, _i;
761
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
762
- while (1) switch (_context9.prev = _context9.next) {
705
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
706
+ while (1) switch (_context8.prev = _context8.next) {
763
707
  case 0:
764
708
  p = mem.env[opt.process];
765
709
  results = [];
766
710
  limit = (_opt$limit = opt.limit) !== null && _opt$limit !== void 0 ? _opt$limit : 25;
767
711
  if (!(opt.sort === "DESC")) {
768
- _context9.next = 14;
712
+ _context8.next = 14;
769
713
  break;
770
714
  }
771
715
  i = p.results.length - 1;
772
716
  case 5:
773
717
  if (!(0 < i)) {
774
- _context9.next = 12;
718
+ _context8.next = 12;
775
719
  break;
776
720
  }
777
721
  results.push({
@@ -779,67 +723,67 @@ var connect = exports.connect = function connect(mem) {
779
723
  node: p.res[p.results[i]]
780
724
  });
781
725
  if (!(results.length >= limit)) {
782
- _context9.next = 9;
726
+ _context8.next = 9;
783
727
  break;
784
728
  }
785
- return _context9.abrupt("break", 12);
729
+ return _context8.abrupt("break", 12);
786
730
  case 9:
787
731
  i--;
788
- _context9.next = 5;
732
+ _context8.next = 5;
789
733
  break;
790
734
  case 12:
791
- _context9.next = 22;
735
+ _context8.next = 22;
792
736
  break;
793
737
  case 14:
794
738
  _i = 0;
795
739
  case 15:
796
740
  if (!(_i < p.results.length)) {
797
- _context9.next = 22;
741
+ _context8.next = 22;
798
742
  break;
799
743
  }
800
744
  results.push({
801
745
  node: p.res[p.results[_i]]
802
746
  });
803
747
  if (!(results.length >= limit)) {
804
- _context9.next = 19;
748
+ _context8.next = 19;
805
749
  break;
806
750
  }
807
- return _context9.abrupt("break", 22);
751
+ return _context8.abrupt("break", 22);
808
752
  case 19:
809
753
  _i++;
810
- _context9.next = 15;
754
+ _context8.next = 15;
811
755
  break;
812
756
  case 22:
813
- return _context9.abrupt("return", {
757
+ return _context8.abrupt("return", {
814
758
  edges: results
815
759
  });
816
760
  case 23:
817
761
  case "end":
818
- return _context9.stop();
762
+ return _context8.stop();
819
763
  }
820
- }, _callee9);
764
+ }, _callee8);
821
765
  }));
822
- function results(_x7) {
766
+ function results(_x6) {
823
767
  return _results.apply(this, arguments);
824
768
  }
825
769
  return results;
826
770
  }(),
827
771
  dryrun: function () {
828
- var _dryrun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(opt) {
829
- var p, _yield$ar$dataitem5, id, owner, _opt$data3, msg, _env, res;
830
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
831
- while (1) switch (_context10.prev = _context10.next) {
772
+ var _dryrun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(opt) {
773
+ var p, _yield$ar$dataitem4, id, owner, _opt$data3, msg, _env, res;
774
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
775
+ while (1) switch (_context9.prev = _context9.next) {
832
776
  case 0:
833
777
  p = mem.env[opt.process];
834
- _context10.next = 3;
778
+ _context9.next = 3;
835
779
  return ar.dataitem(_objectSpread(_objectSpread({}, opt), {}, {
836
780
  target: opt.process
837
781
  }));
838
782
  case 3:
839
- _yield$ar$dataitem5 = _context10.sent;
840
- id = _yield$ar$dataitem5.id;
841
- owner = _yield$ar$dataitem5.owner;
842
- _context10.prev = 6;
783
+ _yield$ar$dataitem4 = _context9.sent;
784
+ id = _yield$ar$dataitem4.id;
785
+ owner = _yield$ar$dataitem4.owner;
786
+ _context9.prev = 6;
843
787
  msg = genMsg(id, p, (_opt$data3 = opt.data) !== null && _opt$data3 !== void 0 ? _opt$data3 : "", opt.tags, owner, _test.mu.addr, true);
844
788
  _env = genEnv({
845
789
  pid: p.id,
@@ -847,24 +791,24 @@ var connect = exports.connect = function connect(mem) {
847
791
  module: p.module,
848
792
  auth: _test.mu.addr
849
793
  });
850
- _context10.next = 11;
794
+ _context9.next = 11;
851
795
  return p.handle(p.memory, msg, _env);
852
796
  case 11:
853
- res = _context10.sent;
854
- return _context10.abrupt("return", res);
797
+ res = _context9.sent;
798
+ return _context9.abrupt("return", res);
855
799
  case 15:
856
- _context10.prev = 15;
857
- _context10.t0 = _context10["catch"](6);
858
- console.log(_context10.t0);
800
+ _context9.prev = 15;
801
+ _context9.t0 = _context9["catch"](6);
802
+ console.log(_context9.t0);
859
803
  case 18:
860
- return _context10.abrupt("return", null);
804
+ return _context9.abrupt("return", null);
861
805
  case 19:
862
806
  case "end":
863
- return _context10.stop();
807
+ return _context9.stop();
864
808
  }
865
- }, _callee10, null, [[6, 15]]);
809
+ }, _callee9, null, [[6, 15]]);
866
810
  }));
867
- function dryrun(_x8) {
811
+ function dryrun(_x7) {
868
812
  return _dryrun.apply(this, arguments);
869
813
  }
870
814
  return dryrun;