wao 0.29.1 → 0.29.3

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/devs.js CHANGED
@@ -5,125 +5,113 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _default = exports["default"] = {
8
- ans104: {
9
- name: "ans104@1.0",
10
- module: "dev_codec_ans104"
8
+ // fundamental
9
+ meta: {
10
+ name: "meta@1.0",
11
+ module: "dev_meta"
11
12
  },
12
- compute: {
13
- name: "compute@1.0",
14
- module: "dev_cu"
13
+ json: {
14
+ name: "json@1.0",
15
+ module: "dev_codec_json"
15
16
  },
16
- cache: {
17
- name: "cache@1.0",
18
- module: "dev_cache"
17
+ flat: {
18
+ name: "flat@1.0",
19
+ module: "dev_codec_flat"
19
20
  },
20
- cacheviz: {
21
- name: "cacheviz@1.0",
22
- module: "dev_cacheviz"
21
+ httpsig: {
22
+ name: "httpsig@1.0",
23
+ module: "dev_codec_httpsig"
23
24
  },
24
- cron: {
25
- name: "cron@1.0",
26
- module: "dev_cron"
25
+ structured: {
26
+ name: "structured@1.0",
27
+ module: "dev_codec_structured"
27
28
  },
28
- dedup: {
29
- name: "dedup@1.0",
30
- module: "dev_dedup"
29
+ wao: {
30
+ name: "wao@1.0",
31
+ module: "dev_wao"
31
32
  },
33
+ // process
34
+ process: {
35
+ name: "process@1.0",
36
+ module: "dev_process"
37
+ },
38
+ message: {
39
+ name: "message@1.0",
40
+ module: "dev_message"
41
+ },
42
+ scheduler: {
43
+ name: "scheduler@1.0",
44
+ module: "dev_scheduler"
45
+ },
46
+ // legacynet aos
32
47
  "delegated-compute": {
33
48
  name: "delegated-compute@1.0",
34
49
  module: "dev_delegated_compute"
35
50
  },
36
- faff: {
37
- name: "faff@1.0",
38
- module: "dev_faff"
39
- },
40
- flat: {
41
- name: "flat@1.0",
42
- module: "dev_codec_flat"
43
- },
44
51
  "genesis-wasm": {
45
52
  name: "genesis-wasm@1.0",
46
53
  module: "dev_genesis_wasm"
47
54
  },
48
- greenzone: {
49
- name: "greenzone@1.0",
50
- module: "dev_green_zone"
51
- },
52
- httpsig: {
53
- name: "httpsig@1.0",
54
- module: "dev_codec_httpsig"
55
+ // hyper aos
56
+ lua: {
57
+ name: "lua@5.3a",
58
+ module: "dev_lua"
55
59
  },
56
- hyperbuddy: {
57
- name: "hyperbuddy@1.0",
58
- module: "dev_hyperbuddy"
60
+ // mainnet aos
61
+ wasi: {
62
+ name: "wasi@1.0",
63
+ module: "dev_wasi"
59
64
  },
60
- json: {
61
- name: "json@1.0",
62
- module: "dev_codec_json"
65
+ "wasm-64": {
66
+ name: "wasm-64@1.0",
67
+ module: "dev_wasm"
63
68
  },
64
69
  "json-iface": {
65
70
  name: "json-iface@1.0",
66
71
  module: "dev_json_iface"
67
72
  },
68
- "local-name": {
69
- name: "local-name@1.0",
70
- module: "dev_local_name"
71
- },
72
- lookup: {
73
- name: "lookup@1.0",
74
- module: "dev_lookup"
75
- },
76
- lua: {
77
- name: "lua@5.3a",
78
- module: "dev_lua"
79
- },
80
- manifest: {
81
- name: "manifest@1.0",
82
- module: "dev_manifest"
73
+ // process utils
74
+ "test-device": {
75
+ name: "test-device@1.0",
76
+ module: "dev_test"
83
77
  },
84
- message: {
85
- name: "message@1.0",
86
- module: "dev_message"
78
+ patch: {
79
+ name: "patch@1.0",
80
+ module: "dev_patch"
87
81
  },
88
- meta: {
89
- name: "meta@1.0",
90
- module: "dev_meta"
82
+ push: {
83
+ name: "push@1.0",
84
+ module: "dev_push"
91
85
  },
92
- monitor: {
93
- name: "monitor@1.0",
94
- module: "dev_monitor"
86
+ stack: {
87
+ name: "stack@1.0",
88
+ module: "dev_stack"
95
89
  },
96
90
  multipass: {
97
91
  name: "multipass@1.0",
98
92
  module: "dev_multipass"
99
93
  },
100
- name: {
101
- name: "name@1.0",
102
- module: "dev_name"
103
- },
104
- "node-process": {
105
- name: "node-process@1.0",
106
- module: "dev_node_process"
94
+ // payment
95
+ faff: {
96
+ name: "faff@1.0",
97
+ module: "dev_faff"
107
98
  },
108
99
  p4: {
109
100
  name: "p4@1.0",
110
101
  module: "dev_p4"
111
102
  },
112
- patch: {
113
- name: "patch@1.0",
114
- module: "dev_patch"
115
- },
116
- poda: {
117
- name: "poda@1.0",
118
- module: "dev_poda"
103
+ "node-process": {
104
+ name: "node-process@1.0",
105
+ module: "dev_node_process"
119
106
  },
120
- process: {
121
- name: "process@1.0",
122
- module: "dev_process"
107
+ "simple-pay": {
108
+ name: "simple-pay@1.0",
109
+ module: "dev_simple_pay"
123
110
  },
124
- push: {
125
- name: "push@1.0",
126
- module: "dev_push"
111
+ // tested
112
+ cron: {
113
+ name: "cron@1.0",
114
+ module: "dev_cron"
127
115
  },
128
116
  relay: {
129
117
  name: "relay@1.0",
@@ -133,44 +121,68 @@ var _default = exports["default"] = {
133
121
  name: "router@1.0",
134
122
  module: "dev_router"
135
123
  },
136
- scheduler: {
137
- name: "scheduler@1.0",
138
- module: "dev_scheduler"
124
+ // storage
125
+ cache: {
126
+ name: "cache@1.0",
127
+ module: "dev_cache"
139
128
  },
140
- "simple-pay": {
141
- name: "simple-pay@1.0",
142
- module: "dev_simple_pay"
129
+ "local-name": {
130
+ name: "local-name@1.0",
131
+ module: "dev_local_name"
143
132
  },
144
- snp: {
145
- name: "snp@1.0",
146
- module: "dev_snp"
133
+ lookup: {
134
+ name: "lookup@1.0",
135
+ module: "dev_lookup"
147
136
  },
148
- stack: {
149
- name: "stack@1.0",
150
- module: "dev_stack"
137
+ name: {
138
+ name: "name@1.0",
139
+ module: "dev_name"
151
140
  },
152
- structured: {
153
- name: "structured@1.0",
154
- module: "dev_codec_structured"
141
+ // others
142
+ compute: {
143
+ name: "compute@1.0",
144
+ module: "dev_cu"
155
145
  },
156
- "test-device": {
157
- name: "test-device@1.0",
158
- module: "dev_test"
146
+ dedup: {
147
+ name: "dedup@1.0",
148
+ module: "dev_dedup"
149
+ },
150
+ manifest: {
151
+ name: "manifest@1.0",
152
+ module: "dev_manifest"
153
+ },
154
+ monitor: {
155
+ name: "monitor@1.0",
156
+ module: "dev_monitor"
157
+ },
158
+ // advanced
159
+ snp: {
160
+ name: "snp@1.0",
161
+ module: "dev_snp"
159
162
  },
160
163
  volume: {
161
164
  name: "volume@1.0",
162
165
  module: "dev_volume"
163
166
  },
164
- wasi: {
165
- name: "wasi@1.0",
166
- module: "dev_wasi"
167
+ poda: {
168
+ name: "poda@1.0",
169
+ module: "dev_poda"
167
170
  },
168
- "wasm-64": {
169
- name: "wasm-64@1.0",
170
- module: "dev_wasm"
171
+ greenzone: {
172
+ name: "greenzone@1.0",
173
+ module: "dev_green_zone"
171
174
  },
172
- wao: {
173
- name: "wao@1.0",
174
- module: "dev_wao"
175
+ // misc
176
+ hyperbuddy: {
177
+ name: "hyperbuddy@1.0",
178
+ module: "dev_hyperbuddy"
179
+ },
180
+ ans104: {
181
+ name: "ans104@1.0",
182
+ module: "dev_codec_ans104"
183
+ },
184
+ cacheviz: {
185
+ name: "cacheviz@1.0",
186
+ module: "dev_cacheviz"
175
187
  }
176
188
  };
package/cjs/encode.js CHANGED
@@ -1162,11 +1162,11 @@ function setFinalHeaders(headers, boundary, contentDigest, byteLength) {
1162
1162
  }
1163
1163
  headers["content-length"] = String(byteLength);
1164
1164
  }
1165
- function encode() {
1166
- return _encode.apply(this, arguments);
1165
+ function enc() {
1166
+ return _enc.apply(this, arguments);
1167
1167
  }
1168
- function _encode() {
1169
- _encode = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
1168
+ function _enc() {
1169
+ _enc = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
1170
1170
  var obj,
1171
1171
  processedObj,
1172
1172
  emptyResult,
@@ -1334,25 +1334,5 @@ function _encode() {
1334
1334
  }
1335
1335
  }, _callee8);
1336
1336
  }));
1337
- return _encode.apply(this, arguments);
1338
- }
1339
- function enc(_x11) {
1340
- return _enc.apply(this, arguments);
1341
- }
1342
- function _enc() {
1343
- _enc = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(fields) {
1344
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1345
- while (1) switch (_context9.prev = _context9.next) {
1346
- case 0:
1347
- _context9.next = 2;
1348
- return encode(fields);
1349
- case 2:
1350
- return _context9.abrupt("return", _context9.sent);
1351
- case 3:
1352
- case "end":
1353
- return _context9.stop();
1354
- }
1355
- }, _callee9);
1356
- }));
1357
1337
  return _enc.apply(this, arguments);
1358
1338
  }
package/cjs/hb.js CHANGED
@@ -1561,9 +1561,7 @@ var HB = /*#__PURE__*/function () {
1561
1561
  body: _context38.t1,
1562
1562
  status: _context38.t2
1563
1563
  };
1564
- return _context38.abrupt("return", _objectSpread({
1565
- out: (0, _httpsig.from)(http)
1566
- }, http));
1564
+ return _context38.abrupt("return", _objectSpread(_objectSpread({}, (0, _httpsig.from)(http)), http));
1567
1565
  case 19:
1568
1566
  case "end":
1569
1567
  return _context38.stop();
package/cjs/httpsig.js CHANGED
@@ -7,6 +7,7 @@ exports.verifyContentDigest = exports.toBuffer = exports.hasValidSignature = exp
7
7
  var _ramda = require("ramda");
8
8
  var _signerUtils = require("./signer-utils.js");
9
9
  var _base64url = _interopRequireDefault(require("base64url"));
10
+ var _utils = require("./utils.js");
10
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
12
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
12
13
  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."); }
@@ -389,7 +390,9 @@ var _toJSON = function toJSON(msg) {
389
390
  _value2 = _Object$entries7$_i[1];
390
391
  // Skip internal keys and headers we don't want in the final result
391
392
  if (_key5.startsWith("__")) continue;
392
- if (_key5.startsWith("@")) continue; // Skip all @ fields
393
+
394
+ // Skip @ fields EXCEPT @path which we want to include
395
+ if (_key5.startsWith("@") && _key5 !== "@path") continue;
393
396
  if (_key5 === "ao-types") continue;
394
397
  if (_key5 === "content-type") continue;
395
398
  if (_key5 === "content-digest") continue;
@@ -910,12 +913,6 @@ var stringToBuffer = function stringToBuffer(str) {
910
913
  }
911
914
  return buffer;
912
915
  };
913
-
914
- /**
915
- * Original from function - extracts and converts only signed components
916
- * @param {Object} http - HTTP message object with headers, body, and status
917
- * @returns {Object|null} Converted signed components or null if not signed
918
- */
919
916
  var from = exports.from = function from(http) {
920
917
  var input = http.headers["signature-input"] || http.headers["Signature-Input"];
921
918
  if (!input) {
@@ -924,34 +921,71 @@ var from = exports.from = function from(http) {
924
921
 
925
922
  // Decode signature inputs
926
923
  var inputs = (0, _signerUtils.decodeSigInput)(input);
927
-
928
924
  // Process the first signature (following the original logic)
929
925
  for (var k in inputs) {
926
+ var _sigData$params$tag, _sigData$params;
930
927
  var sigData = inputs[k];
931
-
932
928
  // Extract only the signed components
933
929
  var extractedComponents = extract(http, sigData.components);
930
+ var ret = {
931
+ hashpath: (_sigData$params$tag = sigData === null || sigData === void 0 || (_sigData$params = sigData.params) === null || _sigData$params === void 0 ? void 0 : _sigData$params.tag) !== null && _sigData$params$tag !== void 0 ? _sigData$params$tag : null
932
+ };
933
+ try {
934
+ ret.signer = (0, _utils.toAddr)(sigData.params.keyid);
935
+ } catch (e) {}
934
936
 
935
- // Check if ao-result header is present and points to body
937
+ // Check if @path was in the signed components
938
+ var hasPathComponent = sigData.components.some(function (c) {
939
+ return c.replace(/"/g, "") === "@path";
940
+ });
941
+
942
+ // If @path is signed, add the path header to extracted components
943
+ if (hasPathComponent) {
944
+ extractedComponents["path"] = http.headers.path;
945
+ }
946
+
947
+ // Check if ao-result header is present
936
948
  var aoResult = http.headers["ao-result"] || http.headers["Ao-Result"];
937
- if (aoResult === "body" && extractedComponents.body) {
949
+
950
+ // Handle ao-result pointing to body
951
+ if (aoResult === "body") {
952
+ // Handle empty body case
953
+ if (!extractedComponents.body) {
954
+ return _objectSpread({
955
+ out: ""
956
+ }, ret); // Return empty string for empty body
957
+ }
938
958
  // Check if body is binary data
939
959
  if (isBinaryString(extractedComponents.body)) {
940
- return stringToBuffer(extractedComponents.body);
960
+ return _objectSpread({
961
+ out: stringToBuffer(extractedComponents.body)
962
+ }, ret);
941
963
  }
964
+ // Return body as-is if it's not binary
965
+ return _objectSpread({
966
+ out: extractedComponents.body
967
+ }, ret);
942
968
  }
943
969
 
944
970
  // Convert the extracted components to JSON format
945
971
  var result = _toJSON(extractedComponents);
946
972
 
947
- // Handle ao-result if present
948
- if (aoResult && result[aoResult] !== undefined) {
973
+ // Handle ao-result if present and pointing to other fields
974
+ if (aoResult && aoResult !== "body") {
949
975
  // Return the value of the key specified by ao-result
950
- return result[aoResult];
976
+ // If the key doesn't exist, return undefined (or could return null/empty string)
977
+ return _objectSpread({
978
+ out: result[aoResult] !== undefined ? result[aoResult] : ""
979
+ }, ret);
951
980
  }
952
- return result;
981
+ return _objectSpread({
982
+ out: result
983
+ }, ret);
953
984
  }
954
- return null;
985
+ return {
986
+ out: null,
987
+ hashpath: null
988
+ };
955
989
  };
956
990
 
957
991
  /**
package/cjs/hyperbeam.js CHANGED
@@ -340,6 +340,7 @@ var HyperBEAM = exports["default"] = /*#__PURE__*/function () {
340
340
  })(this.faff).join(", "), " ]");
341
341
  var _on = this.p4_lua ? ", on => #{ <<\"request\">> => ".concat(processor, ", <<\"response\">> => ").concat(processor, " }") : this.simplePay ? ", on => #{ <<\"request\">> => #{ <<\"device\">> => <<\"p4@1.0\">>, <<\"pricing-device\">> => <<\"simple-pay@1.0\">>, <<\"ledger-device\">> => <<\"simple-pay@1.0\">> }, <<\"response\">> => #{ <<\"device\">> => <<\"p4@1.0\">>, <<\"pricing-device\">> => <<\"simple-pay@1.0\">>, <<\"ledger-device\">> => <<\"simple-pay@1.0\">> } }" : !(0, _ramda.isNil)(this.faff) ? ", on => #{ <<\"request\">> => #{ <<\"device\">> => <<\"p4@1.0\">>, <<\"pricing-device\">> => <<\"faff@1.0\">>, <<\"ledger-device\">> => <<\"faff@1.0\">> }, <<\"response\">> => #{ <<\"device\">> => <<\"p4@1.0\">>, <<\"pricing-device\">> => <<\"faff@1.0\">>, <<\"ledger-device\">> => <<\"faff@1.0\">> } }" : "";
342
342
  var start = "hb:start_mainnet(#{ ".concat(_port).concat(_gateway).concat(_wallet).concat(_faff).concat(_bundler).concat(_on).concat(_p4_non_chargable).concat(_operator).concat(_spp).concat(_devices).concat(_node_processes, "}).");
343
+ console.log(start);
343
344
  return start;
344
345
  }
345
346
  }, {
package/cjs/send.js CHANGED
@@ -48,8 +48,6 @@ function _send() {
48
48
  while (1) switch (_context2.prev = _context2.next) {
49
49
  case 0:
50
50
  fetchImpl = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : fetch;
51
- // IMPORTANT: Use the URL from signedMsg.url, NOT from any path header
52
- // This ensures we send to the correct URL even if path header is different
53
51
  fetchOptions = {
54
52
  method: signedMsg.method,
55
53
  headers: signedMsg.headers,
@@ -58,8 +56,6 @@ function _send() {
58
56
  if (signedMsg.body !== undefined && signedMsg.method !== "GET" && signedMsg.method !== "HEAD") {
59
57
  fetchOptions.body = signedMsg.body;
60
58
  }
61
-
62
- // Use the URL as provided, ignoring any path header
63
59
  _context2.next = 5;
64
60
  return fetchImpl(signedMsg.url, fetchOptions);
65
61
  case 5:
@@ -94,9 +90,7 @@ function _send() {
94
90
  body: _context2.t5,
95
91
  status: _context2.t6
96
92
  };
97
- return _context2.abrupt("return", _objectSpread({
98
- out: (0, _httpsig.from)(http)
99
- }, http));
93
+ return _context2.abrupt("return", _objectSpread(_objectSpread({}, (0, _httpsig.from)(http)), http));
100
94
  case 23:
101
95
  case "end":
102
96
  return _context2.stop();