wao 0.34.0 → 0.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/hb.js +25 -18
- package/cjs/workspace/package.json +2 -2
- package/esm/hb.js +5 -4
- package/esm/workspace/package.json +2 -2
- package/package.json +2 -2
package/cjs/hb.js
CHANGED
|
@@ -628,6 +628,8 @@ var HB = /*#__PURE__*/function () {
|
|
|
628
628
|
tags,
|
|
629
629
|
data,
|
|
630
630
|
_tags,
|
|
631
|
+
body,
|
|
632
|
+
signed,
|
|
631
633
|
res,
|
|
632
634
|
_args19 = arguments;
|
|
633
635
|
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
@@ -639,20 +641,21 @@ var HB = /*#__PURE__*/function () {
|
|
|
639
641
|
target: pid
|
|
640
642
|
});
|
|
641
643
|
if (data) _tags.data = data;
|
|
642
|
-
_context18.
|
|
643
|
-
_context18.t1 = "/".concat(pid, "/schedule");
|
|
644
|
-
_context18.next = 7;
|
|
644
|
+
_context18.next = 5;
|
|
645
645
|
return this.commit(_tags, {
|
|
646
646
|
path: false
|
|
647
647
|
});
|
|
648
|
-
case
|
|
649
|
-
|
|
650
|
-
_context18.
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
648
|
+
case 5:
|
|
649
|
+
body = _context18.sent;
|
|
650
|
+
_context18.next = 8;
|
|
651
|
+
return this.sign({
|
|
652
|
+
path: "/".concat(pid, "/schedule"),
|
|
653
|
+
body: body
|
|
654
|
+
});
|
|
655
|
+
case 8:
|
|
656
|
+
signed = _context18.sent;
|
|
654
657
|
_context18.next = 11;
|
|
655
|
-
return
|
|
658
|
+
return this.send(signed);
|
|
656
659
|
case 11:
|
|
657
660
|
res = _context18.sent;
|
|
658
661
|
return _context18.abrupt("return", {
|
|
@@ -871,8 +874,11 @@ var HB = /*#__PURE__*/function () {
|
|
|
871
874
|
while (1) switch (_context25.prev = _context25.next) {
|
|
872
875
|
case 0:
|
|
873
876
|
tags = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
|
|
877
|
+
_context25.next = 3;
|
|
878
|
+
return this.setInfo();
|
|
879
|
+
case 3:
|
|
874
880
|
_context25.t0 = this;
|
|
875
|
-
_context25.next =
|
|
881
|
+
_context25.next = 6;
|
|
876
882
|
return this.commit((0, _ramda.mergeLeft)(tags, {
|
|
877
883
|
"random-seed": (0, _utils.seed)(16),
|
|
878
884
|
type: "Process",
|
|
@@ -882,7 +888,7 @@ var HB = /*#__PURE__*/function () {
|
|
|
882
888
|
}), {
|
|
883
889
|
path: false
|
|
884
890
|
});
|
|
885
|
-
case
|
|
891
|
+
case 6:
|
|
886
892
|
_context25.t1 = _context25.sent;
|
|
887
893
|
_context25.t2 = this.operator;
|
|
888
894
|
_context25.t3 = {
|
|
@@ -890,15 +896,15 @@ var HB = /*#__PURE__*/function () {
|
|
|
890
896
|
body: _context25.t1,
|
|
891
897
|
scheduler: _context25.t2
|
|
892
898
|
};
|
|
893
|
-
_context25.next =
|
|
899
|
+
_context25.next = 11;
|
|
894
900
|
return _context25.t0.post.call(_context25.t0, _context25.t3);
|
|
895
|
-
case
|
|
901
|
+
case 11:
|
|
896
902
|
res = _context25.sent;
|
|
897
903
|
return _context25.abrupt("return", {
|
|
898
904
|
res: res,
|
|
899
905
|
pid: res.out.process
|
|
900
906
|
});
|
|
901
|
-
case
|
|
907
|
+
case 13:
|
|
902
908
|
case "end":
|
|
903
909
|
return _context25.stop();
|
|
904
910
|
}
|
|
@@ -1088,13 +1094,14 @@ var HB = /*#__PURE__*/function () {
|
|
|
1088
1094
|
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
1089
1095
|
while (1) switch (_context30.prev = _context30.next) {
|
|
1090
1096
|
case 0:
|
|
1091
|
-
|
|
1097
|
+
console.log("comitting................................");
|
|
1098
|
+
_context30.next = 3;
|
|
1092
1099
|
return (0, _hbsig.commit)(obj, _objectSpread(_objectSpread({}, opts), {}, {
|
|
1093
1100
|
signer: this.sign
|
|
1094
1101
|
}));
|
|
1095
|
-
case 2:
|
|
1096
|
-
return _context30.abrupt("return", _context30.sent);
|
|
1097
1102
|
case 3:
|
|
1103
|
+
return _context30.abrupt("return", _context30.sent);
|
|
1104
|
+
case 4:
|
|
1098
1105
|
case "end":
|
|
1099
1106
|
return _context30.stop();
|
|
1100
1107
|
}
|
package/esm/hb.js
CHANGED
|
@@ -138,10 +138,9 @@ class HB {
|
|
|
138
138
|
async schedule({ pid, tags = {}, data } = {}) {
|
|
139
139
|
let _tags = mergeLeft(tags, { type: "Message", target: pid })
|
|
140
140
|
if (data) _tags.data = data
|
|
141
|
-
let
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
})
|
|
141
|
+
let body = await this.commit(_tags, { path: false })
|
|
142
|
+
let signed = await this.sign({ path: `/${pid}/schedule`, body })
|
|
143
|
+
let res = await this.send(signed)
|
|
145
144
|
return { slot: res.out.slot, res, pid }
|
|
146
145
|
}
|
|
147
146
|
|
|
@@ -191,6 +190,7 @@ class HB {
|
|
|
191
190
|
return res
|
|
192
191
|
}
|
|
193
192
|
async spawn(tags = {}) {
|
|
193
|
+
await this.setInfo()
|
|
194
194
|
const res = await this.post({
|
|
195
195
|
path: "/~process@1.0/schedule",
|
|
196
196
|
body: await this.commit(
|
|
@@ -262,6 +262,7 @@ class HB {
|
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
async commit(obj, opts) {
|
|
265
|
+
console.log("comitting................................")
|
|
265
266
|
return await commit(obj, { ...opts, signer: this.sign })
|
|
266
267
|
}
|
|
267
268
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wao",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.2",
|
|
4
4
|
"bin": {
|
|
5
5
|
"wao": "./cjs/cli.js",
|
|
6
6
|
"wao-esm": "./esm/cli.js"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"express": "^5.1.0",
|
|
49
49
|
"fast-sha256": "^1.3.0",
|
|
50
50
|
"graphql": "^16.10.0",
|
|
51
|
-
"hbsig": "^0.1.
|
|
51
|
+
"hbsig": "^0.1.1",
|
|
52
52
|
"http-message-signatures": "^1.0.4",
|
|
53
53
|
"lmdb": "^3.2.2",
|
|
54
54
|
"localforage": "^1.10.0",
|