wao 0.4.9 → 0.4.11
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/tao.js +10 -3
- package/cjs/test.js +14 -0
- package/esm/tao.js +8 -6
- package/esm/test.js +4 -0
- package/package.json +1 -1
package/cjs/tao.js
CHANGED
|
@@ -31,10 +31,14 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
31
31
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
32
32
|
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); }
|
|
33
33
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
34
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
35
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
36
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
37
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
34
38
|
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; } } }; }
|
|
35
39
|
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; } }
|
|
36
40
|
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; }
|
|
37
|
-
var log = "\nlocal json = require(\"json\")\nao = ao or {}\n\nfunction ao.log(
|
|
41
|
+
var log = "\nlocal json = require(\"json\")\nao = ao or {}\n\nfunction ao.log(...)\n local args = {...}\n local txt = json.encode(args)\n if type(ao.outbox.Output) == 'string' then\n ao.outbox.Output = {ao.outbox.Output}\n end\n table.insert(ao.outbox.Output, txt)\n ao.outbox.Logs = ao.outbox.Logs or {}\n table.insert(ao.outbox.Logs, txt)\nend\n\nfunction ao.result(result)\n if ao.outbox.Error or result.Error then\n return { Error = result.Error or ao.outbox.Error, Output = ao.outbox.Logs }\n end\n return {\n Output = ao.outbox.Logs or result.Output or ao.outbox.Output,\n Messages = ao.outbox.Messages,\n Spawns = ao.outbox.Spawns,\n Assignments = ao.outbox.Assignments,\n }\nend\n";
|
|
38
42
|
var renderLogs = function renderLogs(logs) {
|
|
39
43
|
if ((0, _ramda.is)(Array, logs) && logs.length > 0) {
|
|
40
44
|
var _iterator = _createForOfIteratorHelper(logs),
|
|
@@ -44,10 +48,13 @@ var renderLogs = function renderLogs(logs) {
|
|
|
44
48
|
var v = _step.value;
|
|
45
49
|
var l = v;
|
|
46
50
|
try {
|
|
51
|
+
var _console;
|
|
47
52
|
var p = JSON.parse(v);
|
|
48
53
|
if (JSON.stringify(p) === v) l = p;
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
(_console = console).log.apply(_console, _toConsumableArray(l));
|
|
55
|
+
} catch (e) {
|
|
56
|
+
console.log(l);
|
|
57
|
+
}
|
|
51
58
|
}
|
|
52
59
|
} catch (err) {
|
|
53
60
|
_iterator.e(err);
|
package/cjs/test.js
CHANGED
|
@@ -16,6 +16,18 @@ Object.defineProperty(exports, "AR", {
|
|
|
16
16
|
return _tar["default"];
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
+
Object.defineProperty(exports, "ArMem", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function get() {
|
|
22
|
+
return _armem["default"];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "GQL", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _tgql["default"];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
19
31
|
Object.defineProperty(exports, "Src", {
|
|
20
32
|
enumerable: true,
|
|
21
33
|
get: function get() {
|
|
@@ -78,6 +90,8 @@ var _accounts = require("./accounts.js");
|
|
|
78
90
|
var _aoconnect = require("./aoconnect.js");
|
|
79
91
|
var _tao = _interopRequireDefault(require("./tao.js"));
|
|
80
92
|
var _tar = _interopRequireDefault(require("./tar.js"));
|
|
93
|
+
var _tgql = _interopRequireDefault(require("./tgql.js"));
|
|
94
|
+
var _armem = _interopRequireDefault(require("./armem.js"));
|
|
81
95
|
var _utils = require("./utils.js");
|
|
82
96
|
var _helpers = require("./helpers.js");
|
|
83
97
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
package/esm/tao.js
CHANGED
|
@@ -10,10 +10,9 @@ let log = `
|
|
|
10
10
|
local json = require("json")
|
|
11
11
|
ao = ao or {}
|
|
12
12
|
|
|
13
|
-
function ao.log(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
end
|
|
13
|
+
function ao.log(...)
|
|
14
|
+
local args = {...}
|
|
15
|
+
local txt = json.encode(args)
|
|
17
16
|
if type(ao.outbox.Output) == 'string' then
|
|
18
17
|
ao.outbox.Output = {ao.outbox.Output}
|
|
19
18
|
end
|
|
@@ -42,11 +41,14 @@ const renderLogs = logs => {
|
|
|
42
41
|
try {
|
|
43
42
|
const p = JSON.parse(v)
|
|
44
43
|
if (JSON.stringify(p) === v) l = p
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
console.log(...l)
|
|
45
|
+
} catch (e) {
|
|
46
|
+
console.log(l)
|
|
47
|
+
}
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
}
|
|
51
|
+
|
|
50
52
|
class AO extends MAO {
|
|
51
53
|
constructor(opt = {}) {
|
|
52
54
|
super({ ...opt, in_memory: true })
|
package/esm/test.js
CHANGED
|
@@ -4,6 +4,8 @@ import { acc, mu, su, cu } from "./accounts.js"
|
|
|
4
4
|
import { connect } from "./aoconnect.js"
|
|
5
5
|
import AO from "./tao.js"
|
|
6
6
|
import AR from "./tar.js"
|
|
7
|
+
import GQL from "./tgql.js"
|
|
8
|
+
import ArMem from "./armem.js"
|
|
7
9
|
import { dirname } from "./utils.js"
|
|
8
10
|
import { Src, setup, ok, fail } from "./helpers.js"
|
|
9
11
|
const blueprint = async pkg => {
|
|
@@ -12,6 +14,8 @@ const blueprint = async pkg => {
|
|
|
12
14
|
const scheduler = "GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA"
|
|
13
15
|
|
|
14
16
|
export {
|
|
17
|
+
GQL,
|
|
18
|
+
ArMem,
|
|
15
19
|
AO,
|
|
16
20
|
AR,
|
|
17
21
|
connect,
|