wao 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/accounts.js +12 -12
- package/cjs/aoconnect.js +410 -1475
- package/cjs/ar.js +1 -1
- package/cjs/armem.js +52 -0
- package/cjs/gql.js +393 -0
- package/cjs/index.js +7 -0
- package/cjs/tao.js +9 -9
- package/cjs/tar.js +279 -0
- package/cjs/test.js +57 -3
- package/cjs/utils.js +41 -1
- package/cjs/weavedrive.js +979 -0
- package/esm/accounts.js +36 -30
- package/esm/aoconnect.js +65 -808
- package/esm/ar.js +1 -1
- package/esm/armem.js +38 -0
- package/esm/gql.js +218 -0
- package/esm/index.js +2 -1
- package/esm/tao.js +7 -9
- package/esm/tar.js +98 -0
- package/esm/test.js +13 -2
- package/esm/utils.js +10 -0
- package/esm/weavedrive.js +709 -0
- package/package.json +1 -1
package/cjs/tar.js
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use strict";
|
|
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _ar = _interopRequireDefault(require("./ar.js"));
|
|
9
|
+
var _utils = require("./utils.js");
|
|
10
|
+
var _warpArbundles = require("warp-arbundles");
|
|
11
|
+
var _base64url = _interopRequireDefault(require("base64url"));
|
|
12
|
+
var _armem = _interopRequireDefault(require("./armem.js"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
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; }
|
|
15
|
+
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; } } }; }
|
|
16
|
+
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; } }
|
|
17
|
+
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; }
|
|
18
|
+
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); }
|
|
19
|
+
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); }); }; }
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
24
|
+
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); } }
|
|
25
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
26
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
27
|
+
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); }
|
|
28
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
29
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
30
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
31
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
32
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
33
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
34
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
35
|
+
var AR = /*#__PURE__*/function (_MAR) {
|
|
36
|
+
function AR() {
|
|
37
|
+
var _opt$mem;
|
|
38
|
+
var _this;
|
|
39
|
+
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
40
|
+
_classCallCheck(this, AR);
|
|
41
|
+
_this = _callSuper(this, AR, [_objectSpread(_objectSpread({}, opt), {}, {
|
|
42
|
+
in_memory: true
|
|
43
|
+
})]);
|
|
44
|
+
_this.in_memory = true;
|
|
45
|
+
_this.mem = (_opt$mem = opt.mem) !== null && _opt$mem !== void 0 ? _opt$mem : new _armem["default"]();
|
|
46
|
+
return _this;
|
|
47
|
+
}
|
|
48
|
+
_inherits(AR, _MAR);
|
|
49
|
+
return _createClass(AR, [{
|
|
50
|
+
key: "txs",
|
|
51
|
+
value: function () {
|
|
52
|
+
var _txs2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(pid) {
|
|
53
|
+
var _txs, _iterator, _step, v;
|
|
54
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
55
|
+
while (1) switch (_context.prev = _context.next) {
|
|
56
|
+
case 0:
|
|
57
|
+
_txs = [];
|
|
58
|
+
_iterator = _createForOfIteratorHelper(this.mem.env[pid].txs);
|
|
59
|
+
try {
|
|
60
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
61
|
+
v = _step.value;
|
|
62
|
+
_txs.push({
|
|
63
|
+
tags: v.tags,
|
|
64
|
+
id: v.id
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
} catch (err) {
|
|
68
|
+
_iterator.e(err);
|
|
69
|
+
} finally {
|
|
70
|
+
_iterator.f();
|
|
71
|
+
}
|
|
72
|
+
return _context.abrupt("return", _txs);
|
|
73
|
+
case 4:
|
|
74
|
+
case "end":
|
|
75
|
+
return _context.stop();
|
|
76
|
+
}
|
|
77
|
+
}, _callee, this);
|
|
78
|
+
}));
|
|
79
|
+
function txs(_x) {
|
|
80
|
+
return _txs2.apply(this, arguments);
|
|
81
|
+
}
|
|
82
|
+
return txs;
|
|
83
|
+
}()
|
|
84
|
+
}, {
|
|
85
|
+
key: "dataitem",
|
|
86
|
+
value: function () {
|
|
87
|
+
var _dataitem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref) {
|
|
88
|
+
var _ref$data, data, _ref$tags, tags, signer, _tags, item, di, raw_owner, hashBuffer, owner;
|
|
89
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
90
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
91
|
+
case 0:
|
|
92
|
+
_ref$data = _ref.data, data = _ref$data === void 0 ? "1984" : _ref$data, _ref$tags = _ref.tags, tags = _ref$tags === void 0 ? {} : _ref$tags, signer = _ref.signer;
|
|
93
|
+
_tags = (0, _utils.buildTags)(tags);
|
|
94
|
+
_context2.next = 4;
|
|
95
|
+
return signer({
|
|
96
|
+
data: data,
|
|
97
|
+
tags: _tags
|
|
98
|
+
});
|
|
99
|
+
case 4:
|
|
100
|
+
item = _context2.sent;
|
|
101
|
+
di = new _warpArbundles.DataItem(item.raw);
|
|
102
|
+
raw_owner = di.rawOwner;
|
|
103
|
+
_context2.t0 = Buffer;
|
|
104
|
+
_context2.next = 10;
|
|
105
|
+
return crypto.subtle.digest("SHA-256", raw_owner);
|
|
106
|
+
case 10:
|
|
107
|
+
_context2.t1 = _context2.sent;
|
|
108
|
+
hashBuffer = _context2.t0.from.call(_context2.t0, _context2.t1);
|
|
109
|
+
owner = _base64url["default"].encode(hashBuffer);
|
|
110
|
+
return _context2.abrupt("return", {
|
|
111
|
+
id: item.id,
|
|
112
|
+
owner: owner,
|
|
113
|
+
item: item
|
|
114
|
+
});
|
|
115
|
+
case 14:
|
|
116
|
+
case "end":
|
|
117
|
+
return _context2.stop();
|
|
118
|
+
}
|
|
119
|
+
}, _callee2);
|
|
120
|
+
}));
|
|
121
|
+
function dataitem(_x2) {
|
|
122
|
+
return _dataitem.apply(this, arguments);
|
|
123
|
+
}
|
|
124
|
+
return dataitem;
|
|
125
|
+
}()
|
|
126
|
+
}, {
|
|
127
|
+
key: "post",
|
|
128
|
+
value: function () {
|
|
129
|
+
var _post = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref2) {
|
|
130
|
+
var _ref2$data, data, _ref2$tags, tags, jwk, tx, _tags, _iterator2, _step2, v;
|
|
131
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
132
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
133
|
+
case 0:
|
|
134
|
+
_ref2$data = _ref2.data, data = _ref2$data === void 0 ? "1984" : _ref2$data, _ref2$tags = _ref2.tags, tags = _ref2$tags === void 0 ? {} : _ref2$tags, jwk = _ref2.jwk;
|
|
135
|
+
_context3.next = 3;
|
|
136
|
+
return this.arweave.createTransaction({
|
|
137
|
+
data: data
|
|
138
|
+
});
|
|
139
|
+
case 3:
|
|
140
|
+
tx = _context3.sent;
|
|
141
|
+
_tags = (0, _utils.buildTags)(null, tags);
|
|
142
|
+
_iterator2 = _createForOfIteratorHelper(_tags);
|
|
143
|
+
try {
|
|
144
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
145
|
+
v = _step2.value;
|
|
146
|
+
tx.addTag(v.name, v.value);
|
|
147
|
+
}
|
|
148
|
+
} catch (err) {
|
|
149
|
+
_iterator2.e(err);
|
|
150
|
+
} finally {
|
|
151
|
+
_iterator2.f();
|
|
152
|
+
}
|
|
153
|
+
this.mem.height += 1;
|
|
154
|
+
_context3.next = 10;
|
|
155
|
+
return this.postTx(tx, jwk, {
|
|
156
|
+
height: this.mem.height,
|
|
157
|
+
tags: _tags,
|
|
158
|
+
data: data
|
|
159
|
+
});
|
|
160
|
+
case 10:
|
|
161
|
+
return _context3.abrupt("return", _context3.sent);
|
|
162
|
+
case 11:
|
|
163
|
+
case "end":
|
|
164
|
+
return _context3.stop();
|
|
165
|
+
}
|
|
166
|
+
}, _callee3, this);
|
|
167
|
+
}));
|
|
168
|
+
function post(_x3) {
|
|
169
|
+
return _post.apply(this, arguments);
|
|
170
|
+
}
|
|
171
|
+
return post;
|
|
172
|
+
}()
|
|
173
|
+
}, {
|
|
174
|
+
key: "postItem",
|
|
175
|
+
value: function () {
|
|
176
|
+
var _postItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(item, jwk) {
|
|
177
|
+
var tx, di, rowner, hashBuffer, owner, data;
|
|
178
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
179
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
180
|
+
case 0:
|
|
181
|
+
_context4.next = 2;
|
|
182
|
+
return this.mem.arweave.createTransaction({
|
|
183
|
+
data: item.raw
|
|
184
|
+
});
|
|
185
|
+
case 2:
|
|
186
|
+
tx = _context4.sent;
|
|
187
|
+
tx.addTag("Bundle-Format", "binary");
|
|
188
|
+
tx.addTag("Bundle-Version", "2.0.0");
|
|
189
|
+
di = new _warpArbundles.DataItem(item.raw);
|
|
190
|
+
rowner = di.rawOwner;
|
|
191
|
+
_context4.t0 = Buffer;
|
|
192
|
+
_context4.next = 10;
|
|
193
|
+
return crypto.subtle.digest("SHA-256", rowner);
|
|
194
|
+
case 10:
|
|
195
|
+
_context4.t1 = _context4.sent;
|
|
196
|
+
hashBuffer = _context4.t0.from.call(_context4.t0, _context4.t1);
|
|
197
|
+
owner = _base64url["default"].encode(hashBuffer);
|
|
198
|
+
this.mem.height += 1;
|
|
199
|
+
data = di.data;
|
|
200
|
+
try {
|
|
201
|
+
data = _base64url["default"].decode(di.data);
|
|
202
|
+
} catch (e) {}
|
|
203
|
+
this.mem.txs[item.id] = {
|
|
204
|
+
id: item.id,
|
|
205
|
+
item: di,
|
|
206
|
+
owner: owner,
|
|
207
|
+
height: this.mem.height,
|
|
208
|
+
tags: di.tags,
|
|
209
|
+
data: data
|
|
210
|
+
};
|
|
211
|
+
this.mem.blocks.push(item.id);
|
|
212
|
+
_context4.next = 20;
|
|
213
|
+
return this.postTx(tx, jwk);
|
|
214
|
+
case 20:
|
|
215
|
+
return _context4.abrupt("return", _context4.sent);
|
|
216
|
+
case 21:
|
|
217
|
+
case "end":
|
|
218
|
+
return _context4.stop();
|
|
219
|
+
}
|
|
220
|
+
}, _callee4, this);
|
|
221
|
+
}));
|
|
222
|
+
function postItem(_x4, _x5) {
|
|
223
|
+
return _postItem.apply(this, arguments);
|
|
224
|
+
}
|
|
225
|
+
return postItem;
|
|
226
|
+
}()
|
|
227
|
+
}, {
|
|
228
|
+
key: "postTx",
|
|
229
|
+
value: function () {
|
|
230
|
+
var _postTx = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(tx, jwk, item) {
|
|
231
|
+
var res, err;
|
|
232
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
233
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
234
|
+
case 0:
|
|
235
|
+
res = null, err = null;
|
|
236
|
+
_context5.next = 3;
|
|
237
|
+
return this.mem.arweave.transactions.sign(tx, jwk);
|
|
238
|
+
case 3:
|
|
239
|
+
if (item) {
|
|
240
|
+
if (!item.id) item.id = tx.id;
|
|
241
|
+
this.mem.txs[item.id] = item;
|
|
242
|
+
this.mem.blocks.push(item.id);
|
|
243
|
+
}
|
|
244
|
+
res = {
|
|
245
|
+
id: tx.id,
|
|
246
|
+
status: 200,
|
|
247
|
+
statusText: "200"
|
|
248
|
+
};
|
|
249
|
+
//res = await this.arweave.transactions.post(tx)
|
|
250
|
+
//if (res.status !== 200) err = res.statusText
|
|
251
|
+
return _context5.abrupt("return", {
|
|
252
|
+
res: res,
|
|
253
|
+
err: err,
|
|
254
|
+
id: tx.id
|
|
255
|
+
});
|
|
256
|
+
case 6:
|
|
257
|
+
case "end":
|
|
258
|
+
return _context5.stop();
|
|
259
|
+
}
|
|
260
|
+
}, _callee5, this);
|
|
261
|
+
}));
|
|
262
|
+
function postTx(_x6, _x7, _x8) {
|
|
263
|
+
return _postTx.apply(this, arguments);
|
|
264
|
+
}
|
|
265
|
+
return postTx;
|
|
266
|
+
}()
|
|
267
|
+
}, {
|
|
268
|
+
key: "tx",
|
|
269
|
+
value: function tx(id) {
|
|
270
|
+
return this.mem.txs[id];
|
|
271
|
+
}
|
|
272
|
+
}, {
|
|
273
|
+
key: "data",
|
|
274
|
+
value: function data(id) {
|
|
275
|
+
return this.mem.txs[id].data;
|
|
276
|
+
}
|
|
277
|
+
}]);
|
|
278
|
+
}(_ar["default"]);
|
|
279
|
+
var _default = exports["default"] = AR;
|
package/cjs/test.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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
|
});
|
|
@@ -9,24 +10,77 @@ Object.defineProperty(exports, "AO", {
|
|
|
9
10
|
return _tao["default"];
|
|
10
11
|
}
|
|
11
12
|
});
|
|
13
|
+
Object.defineProperty(exports, "AR", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _tar["default"];
|
|
17
|
+
}
|
|
18
|
+
});
|
|
12
19
|
Object.defineProperty(exports, "acc", {
|
|
13
20
|
enumerable: true,
|
|
14
21
|
get: function get() {
|
|
15
|
-
return
|
|
22
|
+
return _accounts.acc;
|
|
16
23
|
}
|
|
17
24
|
});
|
|
25
|
+
exports.blueprint = void 0;
|
|
18
26
|
Object.defineProperty(exports, "connect", {
|
|
19
27
|
enumerable: true,
|
|
20
28
|
get: function get() {
|
|
21
29
|
return _aoconnect.connect;
|
|
22
30
|
}
|
|
23
31
|
});
|
|
32
|
+
Object.defineProperty(exports, "cu", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _accounts.cu;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
24
38
|
Object.defineProperty(exports, "mu", {
|
|
25
39
|
enumerable: true,
|
|
26
40
|
get: function get() {
|
|
27
|
-
return
|
|
41
|
+
return _accounts.mu;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
exports.scheduler = void 0;
|
|
45
|
+
Object.defineProperty(exports, "su", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function get() {
|
|
48
|
+
return _accounts.su;
|
|
28
49
|
}
|
|
29
50
|
});
|
|
51
|
+
var _fs = require("fs");
|
|
52
|
+
var _path = require("path");
|
|
53
|
+
var _accounts = require("./accounts.js");
|
|
30
54
|
var _aoconnect = require("./aoconnect.js");
|
|
31
55
|
var _tao = _interopRequireDefault(require("./tao.js"));
|
|
32
|
-
|
|
56
|
+
var _tar = _interopRequireDefault(require("./tar.js"));
|
|
57
|
+
var _utils = require("./utils.js");
|
|
58
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
59
|
+
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; }
|
|
60
|
+
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); }
|
|
61
|
+
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); }); }; }
|
|
62
|
+
var blueprint = exports.blueprint = /*#__PURE__*/function () {
|
|
63
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(pkg) {
|
|
64
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
65
|
+
while (1) switch (_context.prev = _context.next) {
|
|
66
|
+
case 0:
|
|
67
|
+
_context.t0 = _fs.readFileSync;
|
|
68
|
+
_context.t1 = _path.resolve;
|
|
69
|
+
_context.next = 4;
|
|
70
|
+
return (0, _utils.dirname)();
|
|
71
|
+
case 4:
|
|
72
|
+
_context.t2 = _context.sent;
|
|
73
|
+
_context.t3 = "lua/".concat(pkg, ".lua");
|
|
74
|
+
_context.t4 = (0, _context.t1)(_context.t2, _context.t3);
|
|
75
|
+
return _context.abrupt("return", (0, _context.t0)(_context.t4, "utf8"));
|
|
76
|
+
case 8:
|
|
77
|
+
case "end":
|
|
78
|
+
return _context.stop();
|
|
79
|
+
}
|
|
80
|
+
}, _callee);
|
|
81
|
+
}));
|
|
82
|
+
return function blueprint(_x) {
|
|
83
|
+
return _ref.apply(this, arguments);
|
|
84
|
+
};
|
|
85
|
+
}();
|
|
86
|
+
var scheduler = exports.scheduler = "GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";
|
package/cjs/utils.js
CHANGED
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isData = exports.isCheckComplete = exports.getTagVal = exports.getTag = exports.checkTag = exports.buildTags = exports.action = void 0;
|
|
6
|
+
exports.isData = exports.isCheckComplete = exports.getTagVal = exports.getTag = exports.dirname = exports.checkTag = exports.buildTags = exports.action = void 0;
|
|
7
7
|
exports.isJSON = isJSON;
|
|
8
8
|
exports.wait = exports.validAddress = exports.udl = exports.tags = exports.tagEq = exports.tag = exports.srcs = exports.searchTag = exports.query = exports.queries = exports.mergeOut = exports.mergeChecks = exports.ltags = exports.jsonToStr = exports.isRegExp = exports.isOutComplete = exports.isLocalhost = void 0;
|
|
9
9
|
var _ramda = require("ramda");
|
|
10
|
+
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; }
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
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); }
|
|
14
|
+
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); }); }; }
|
|
10
15
|
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); }
|
|
11
16
|
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; } } }; }
|
|
12
17
|
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; } }
|
|
@@ -330,6 +335,10 @@ var srcs = exports.srcs = {
|
|
|
330
335
|
};
|
|
331
336
|
var buildTags = exports.buildTags = function buildTags(act, tags) {
|
|
332
337
|
var _tags = [];
|
|
338
|
+
if ((0, _ramda.isNil)(tags) && typeof act !== "string") {
|
|
339
|
+
tags = act;
|
|
340
|
+
act = null;
|
|
341
|
+
}
|
|
333
342
|
if (act) _tags.push(action(act));
|
|
334
343
|
for (var k in tags) {
|
|
335
344
|
if ((0, _ramda.is)(Array)(tags[k])) {
|
|
@@ -404,6 +413,37 @@ var isCheckComplete = exports.isCheckComplete = function isCheckComplete(checks,
|
|
|
404
413
|
}
|
|
405
414
|
return true;
|
|
406
415
|
};
|
|
416
|
+
var dirname = exports.dirname = /*#__PURE__*/function () {
|
|
417
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
418
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
419
|
+
while (1) switch (_context.prev = _context.next) {
|
|
420
|
+
case 0:
|
|
421
|
+
if (!(typeof __dirname != "undefined")) {
|
|
422
|
+
_context.next = 4;
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
_context.t0 = __dirname;
|
|
426
|
+
_context.next = 7;
|
|
427
|
+
break;
|
|
428
|
+
case 4:
|
|
429
|
+
_context.next = 6;
|
|
430
|
+
return Promise.resolve().then(function () {
|
|
431
|
+
return _interopRequireWildcard(require("./dirname.js"));
|
|
432
|
+
});
|
|
433
|
+
case 6:
|
|
434
|
+
_context.t0 = _context.sent["default"];
|
|
435
|
+
case 7:
|
|
436
|
+
return _context.abrupt("return", _context.t0);
|
|
437
|
+
case 8:
|
|
438
|
+
case "end":
|
|
439
|
+
return _context.stop();
|
|
440
|
+
}
|
|
441
|
+
}, _callee);
|
|
442
|
+
}));
|
|
443
|
+
return function dirname() {
|
|
444
|
+
return _ref8.apply(this, arguments);
|
|
445
|
+
};
|
|
446
|
+
}();
|
|
407
447
|
function isJSON(obj) {
|
|
408
448
|
if (obj === null || obj === undefined) return false;
|
|
409
449
|
if (_typeof(obj) !== "object" || obj instanceof Buffer || obj instanceof ArrayBuffer || Array.isArray(obj)) {
|