@ethersphere/bee-js 6.0.0-pre.2 → 6.0.0-pre.4
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/README.md +1 -1
- package/dist/cjs/bee-debug.js +3 -0
- package/dist/cjs/bee.js +3 -0
- package/dist/cjs/modules/debug/status.js +1 -1
- package/dist/cjs/utils/http.js +11 -1
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/mjs/bee-debug.js +3 -0
- package/dist/mjs/bee.js +3 -0
- package/dist/mjs/modules/debug/status.js +1 -1
- package/dist/mjs/utils/http.js +15 -3
- package/dist/types/modules/debug/status.d.ts +1 -1
- package/dist/types/types/index.d.ts +3 -1
- package/dist/types/utils/http.d.ts +0 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
**Warning: This project is in beta state. There might (and most probably will) be changes in the future to its API and working. Also, no guarantees can be made about its stability, efficiency, and security at this stage.**
|
|
15
15
|
|
|
16
|
-
This project is intended to be used with **Bee version <!-- SUPPORTED_BEE_START -->1.
|
|
16
|
+
This project is intended to be used with **Bee version <!-- SUPPORTED_BEE_START -->1.13.0<!-- SUPPORTED_BEE_END -->**. Using it with older or newer Bee versions is not recommended and may not work. Stay up to date by joining the [official Discord](https://discord.gg/GU22h2utj6) and by keeping an eye on the [releases tab](https://github.com/ethersphere/bee-js/releases).
|
|
17
17
|
|
|
18
18
|
## Table of Contents
|
|
19
19
|
|
package/dist/cjs/bee-debug.js
CHANGED
|
@@ -53,6 +53,9 @@ class BeeDebug {
|
|
|
53
53
|
if (options?.headers) {
|
|
54
54
|
requestOptions.headers = options.headers;
|
|
55
55
|
}
|
|
56
|
+
if (options?.onRequest) {
|
|
57
|
+
requestOptions.onRequest = options.onRequest;
|
|
58
|
+
}
|
|
56
59
|
this.requestOptions = requestOptions;
|
|
57
60
|
}
|
|
58
61
|
async getNodeAddresses(options) {
|
package/dist/cjs/bee.js
CHANGED
|
@@ -8,7 +8,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
|
|
10
10
|
// so if you are changing anything about them change the `update_bee` action accordingly!
|
|
11
|
-
exports.SUPPORTED_BEE_VERSION_EXACT = '1.
|
|
11
|
+
exports.SUPPORTED_BEE_VERSION_EXACT = '1.13.0-f1067884';
|
|
12
12
|
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('-'));
|
package/dist/cjs/utils/http.js
CHANGED
|
@@ -9,7 +9,6 @@ const cafe_utility_1 = require("cafe-utility");
|
|
|
9
9
|
exports.DEFAULT_HTTP_CONFIG = {
|
|
10
10
|
headers: {
|
|
11
11
|
accept: 'application/json, text/plain, */*',
|
|
12
|
-
'user-agent': `bee-js`,
|
|
13
12
|
},
|
|
14
13
|
};
|
|
15
14
|
/**
|
|
@@ -20,6 +19,7 @@ exports.DEFAULT_HTTP_CONFIG = {
|
|
|
20
19
|
async function http(options, config) {
|
|
21
20
|
try {
|
|
22
21
|
const requestConfig = cafe_utility_1.Objects.deepMerge3(exports.DEFAULT_HTTP_CONFIG, config, options);
|
|
22
|
+
maybeRunOnRequestHook(options, requestConfig);
|
|
23
23
|
const response = await (0, axios_1.default)(requestConfig);
|
|
24
24
|
return response;
|
|
25
25
|
}
|
|
@@ -28,3 +28,13 @@ async function http(options, config) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
exports.http = http;
|
|
31
|
+
function maybeRunOnRequestHook(options, requestConfig) {
|
|
32
|
+
if (options.onRequest) {
|
|
33
|
+
options.onRequest({
|
|
34
|
+
method: requestConfig.method,
|
|
35
|
+
url: cafe_utility_1.Strings.joinUrl(requestConfig.baseURL, requestConfig.url),
|
|
36
|
+
headers: { ...requestConfig.headers },
|
|
37
|
+
params: requestConfig.params,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|