@ethersphere/bee-js 6.3.0 → 6.4.1-pre.1

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.
@@ -253,6 +253,13 @@ class BeeDebug {
253
253
  (0, type_1.assertRequestOptions)(options);
254
254
  return settlements.getAllSettlements(this.getRequestOptionsForCall(options));
255
255
  }
256
+ /**
257
+ * Get status of node
258
+ */
259
+ async getStatus(options) {
260
+ (0, type_1.assertRequestOptions)(options);
261
+ return status.getDebugStatus(this.getRequestOptionsForCall(options));
262
+ }
256
263
  /**
257
264
  * Get health of node
258
265
  */
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getVersions = exports.isSupportedApiVersion = exports.isSupportedDebugApiVersion = exports.isSupportedMainApiVersion = exports.isSupportedExactVersion = exports.isSupportedVersion = exports.getNodeInfo = exports.getReadiness = exports.getHealth = exports.SUPPORTED_BEE_VERSION = exports.SUPPORTED_DEBUG_API_VERSION = exports.SUPPORTED_API_VERSION = exports.SUPPORTED_BEE_VERSION_EXACT = void 0;
6
+ exports.getVersions = exports.isSupportedApiVersion = exports.isSupportedDebugApiVersion = exports.isSupportedMainApiVersion = exports.isSupportedExactVersion = exports.isSupportedVersion = exports.getNodeInfo = exports.getReadiness = exports.getHealth = exports.getDebugStatus = exports.SUPPORTED_BEE_VERSION = exports.SUPPORTED_DEBUG_API_VERSION = exports.SUPPORTED_API_VERSION = exports.SUPPORTED_BEE_VERSION_EXACT = void 0;
7
7
  const major_js_1 = __importDefault(require("semver/functions/major.js"));
8
8
  const http_1 = require("../../utils/http");
9
9
  // Following lines bellow are automatically updated with GitHub Action when Bee version is updated
@@ -13,8 +13,18 @@ exports.SUPPORTED_API_VERSION = '4.0.0';
13
13
  exports.SUPPORTED_DEBUG_API_VERSION = '4.0.0';
14
14
  exports.SUPPORTED_BEE_VERSION = exports.SUPPORTED_BEE_VERSION_EXACT.substring(0, exports.SUPPORTED_BEE_VERSION_EXACT.indexOf('-'));
15
15
  const NODE_INFO_URL = 'node';
16
+ const STATUS_URL = 'status';
16
17
  const HEALTH_URL = 'health';
17
18
  const READINESS_URL = 'readiness';
19
+ async function getDebugStatus(requestOptions) {
20
+ const response = await (0, http_1.http)(requestOptions, {
21
+ method: 'get',
22
+ url: STATUS_URL,
23
+ responseType: 'json',
24
+ });
25
+ return response.data;
26
+ }
27
+ exports.getDebugStatus = getDebugStatus;
18
28
  /**
19
29
  * Get health of node
20
30
  *
@@ -53,9 +53,13 @@ exports.rebroadcastTransaction = rebroadcastTransaction;
53
53
  * @param gasPrice Optional gas price
54
54
  */
55
55
  async function cancelTransaction(requestOptions, transactionHash, gasPrice) {
56
+ const headers = {};
57
+ if (gasPrice) {
58
+ headers['gas-price'] = gasPrice;
59
+ }
56
60
  const response = await (0, http_1.http)(requestOptions, {
57
61
  method: 'delete',
58
- headers: { 'gas-price': gasPrice },
62
+ headers,
59
63
  url: `${transactionsEndpoint}/${transactionHash}`,
60
64
  responseType: 'json',
61
65
  });