@ethersphere/bee-js 12.2.1 → 12.2.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/dist/mjs/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Bee } from "./bee.js";
2
- import { BeeDev } from "./bee-dev.js";
3
2
  import { Stamper } from "./stamper/stamper.js";
4
3
  export { MerkleTree } from 'cafe-utility';
5
4
  export { MantarayNode } from "./manifest/manifest.js";
@@ -13,4 +12,4 @@ export * as Utils from "./utils/expose.js";
13
12
  export { Size } from "./utils/size.js";
14
13
  export * from "./utils/tokens.js";
15
14
  export * from "./utils/typed-bytes.js";
16
- export { Bee, BeeDev, Stamper };
15
+ export { Bee, Stamper };
@@ -1,5 +1,4 @@
1
1
  import { Bee } from './bee';
2
- import { BeeDev } from './bee-dev';
3
2
  import { Stamper } from './stamper/stamper';
4
3
  export { MerkleTree } from 'cafe-utility';
5
4
  export type { Chunk } from './chunk/cac';
@@ -16,12 +15,11 @@ export { Size } from './utils/size';
16
15
  export * from './utils/tokens';
17
16
  export * from './utils/typed-bytes';
18
17
  export type { UploadProgress } from './utils/upload-progress';
19
- export { Bee, BeeDev, Stamper };
18
+ export { Bee, Stamper };
20
19
  declare global {
21
20
  interface Window {
22
21
  BeeJs: {
23
22
  Bee: typeof import('./bee').Bee;
24
- BeeDev: typeof import('./bee-dev').BeeDev;
25
23
  Stamper: typeof import('./stamper/stamper').Stamper;
26
24
  Utils: typeof import('./utils/expose');
27
25
  Duration: typeof import('./utils/duration').Duration;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethersphere/bee-js",
3
- "version": "12.2.1",
3
+ "version": "12.2.2",
4
4
  "description": "Javascript client for Bee",
5
5
  "keywords": [
6
6
  "bee",
@@ -69,11 +69,11 @@
69
69
  "debug": "^4.4.1",
70
70
  "isomorphic-ws": "^4.0.1",
71
71
  "semver": "^7.3.5",
72
- "ws": "^8.7.0"
72
+ "ws": "^8.20.1"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@babel/cli": "^7.19.3",
76
- "@babel/core": "^7.20.5",
76
+ "@babel/core": "^7.29.0",
77
77
  "@babel/plugin-proposal-class-properties": "^7.16.7",
78
78
  "@babel/plugin-transform-runtime": "^7.17.0",
79
79
  "@babel/preset-env": "^7.20.2",
@@ -93,7 +93,7 @@
93
93
  "eslint": "^8.13.0",
94
94
  "eslint-config-prettier": "^8.5.0",
95
95
  "eslint-plugin-prettier": "^4.0.0",
96
- "eslint-plugin-unused-imports": "^2.0.0",
96
+ "eslint-plugin-unused-imports": "^4.4.1",
97
97
  "husky": "^8.0.1",
98
98
  "jest": "^30.2.0",
99
99
  "jest-environment-jsdom": "^30.4.1",
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BeeDev = void 0;
4
- const cafe_utility_1 = require("cafe-utility");
5
- const _1 = require(".");
6
- const connectivity_1 = require("./modules/debug/connectivity");
7
- const http_1 = require("./utils/http");
8
- class BeeDev extends _1.Bee {
9
- async getNodeAddresses(options) {
10
- const requestOptions = super.getRequestOptionsForCall(options);
11
- const response = await (0, http_1.http)(requestOptions, {
12
- url: 'addresses',
13
- responseType: 'json',
14
- });
15
- const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
16
- return {
17
- overlay: new _1.PeerAddress(cafe_utility_1.Types.asString(body.overlay, { name: 'overlay' })),
18
- underlay: [],
19
- ethereum: new _1.EthAddress(cafe_utility_1.Types.asString(body.ethereum, { name: 'ethereum' })),
20
- publicKey: new _1.PublicKey(cafe_utility_1.Types.asString(body.publicKey, { name: 'publicKey' })),
21
- pssPublicKey: new _1.PublicKey(cafe_utility_1.Types.asString(body.pssPublicKey, { name: 'pssPublicKey' })),
22
- };
23
- }
24
- async getTopology(options) {
25
- const requestOptions = super.getRequestOptionsForCall(options);
26
- const response = await (0, http_1.http)(requestOptions, {
27
- url: `topology`,
28
- responseType: 'json',
29
- });
30
- const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
31
- const bins = cafe_utility_1.Types.asObject(body.bins, { name: 'bins' });
32
- return {
33
- baseAddr: '0bab5ca208a980950604f900f2791613fc980676c2dee7dd92a4fdda5a54bf26',
34
- population: cafe_utility_1.Types.asNumber(body.population, { name: 'population' }),
35
- connected: cafe_utility_1.Types.asNumber(body.connected, { name: 'connected' }),
36
- timestamp: cafe_utility_1.Types.asString(body.timestamp, { name: 'timestamp' }),
37
- nnLowWatermark: cafe_utility_1.Types.asNumber(body.nnLowWatermark, { name: 'nnLowWatermark' }),
38
- depth: cafe_utility_1.Types.asNumber(body.depth, { name: 'depth' }),
39
- reachability: 'Public',
40
- networkAvailability: 'Available',
41
- bins: {
42
- bin_0: (0, connectivity_1.asBin)(bins.bin_0, 'bin_0'),
43
- bin_1: (0, connectivity_1.asBin)(bins.bin_1, 'bin_1'),
44
- bin_2: (0, connectivity_1.asBin)(bins.bin_2, 'bin_2'),
45
- bin_3: (0, connectivity_1.asBin)(bins.bin_3, 'bin_3'),
46
- bin_4: (0, connectivity_1.asBin)(bins.bin_4, 'bin_4'),
47
- bin_5: (0, connectivity_1.asBin)(bins.bin_5, 'bin_5'),
48
- bin_6: (0, connectivity_1.asBin)(bins.bin_6, 'bin_6'),
49
- bin_7: (0, connectivity_1.asBin)(bins.bin_7, 'bin_7'),
50
- bin_8: (0, connectivity_1.asBin)(bins.bin_8, 'bin_8'),
51
- bin_9: (0, connectivity_1.asBin)(bins.bin_9, 'bin_9'),
52
- bin_10: (0, connectivity_1.asBin)(bins.bin_10, 'bin_10'),
53
- bin_11: (0, connectivity_1.asBin)(bins.bin_11, 'bin_11'),
54
- bin_12: (0, connectivity_1.asBin)(bins.bin_12, 'bin_12'),
55
- bin_13: (0, connectivity_1.asBin)(bins.bin_13, 'bin_13'),
56
- bin_14: (0, connectivity_1.asBin)(bins.bin_14, 'bin_14'),
57
- bin_15: (0, connectivity_1.asBin)(bins.bin_15, 'bin_15'),
58
- bin_16: (0, connectivity_1.asBin)(bins.bin_16, 'bin_16'),
59
- bin_17: (0, connectivity_1.asBin)(bins.bin_17, 'bin_17'),
60
- bin_18: (0, connectivity_1.asBin)(bins.bin_18, 'bin_18'),
61
- bin_19: (0, connectivity_1.asBin)(bins.bin_19, 'bin_19'),
62
- bin_20: (0, connectivity_1.asBin)(bins.bin_20, 'bin_20'),
63
- bin_21: (0, connectivity_1.asBin)(bins.bin_21, 'bin_21'),
64
- bin_22: (0, connectivity_1.asBin)(bins.bin_22, 'bin_22'),
65
- bin_23: (0, connectivity_1.asBin)(bins.bin_23, 'bin_23'),
66
- bin_24: (0, connectivity_1.asBin)(bins.bin_24, 'bin_24'),
67
- bin_25: (0, connectivity_1.asBin)(bins.bin_25, 'bin_25'),
68
- bin_26: (0, connectivity_1.asBin)(bins.bin_26, 'bin_26'),
69
- bin_27: (0, connectivity_1.asBin)(bins.bin_27, 'bin_27'),
70
- bin_28: (0, connectivity_1.asBin)(bins.bin_28, 'bin_28'),
71
- bin_29: (0, connectivity_1.asBin)(bins.bin_29, 'bin_29'),
72
- bin_30: (0, connectivity_1.asBin)(bins.bin_30, 'bin_30'),
73
- bin_31: (0, connectivity_1.asBin)(bins.bin_31, 'bin_31'),
74
- },
75
- };
76
- }
77
- }
78
- exports.BeeDev = BeeDev;
@@ -1,98 +0,0 @@
1
- import { Types } from 'cafe-utility';
2
- import { Bee, EthAddress, PeerAddress, PublicKey } from "./index.js";
3
- import { asBin } from "./modules/debug/connectivity.js";
4
- import { http } from "./utils/http.js";
5
- export class BeeDev extends Bee {
6
- async getNodeAddresses(options) {
7
- const requestOptions = super.getRequestOptionsForCall(options);
8
- const response = await http(requestOptions, {
9
- url: 'addresses',
10
- responseType: 'json'
11
- });
12
- const body = Types.asObject(response.data, {
13
- name: 'response.data'
14
- });
15
- return {
16
- overlay: new PeerAddress(Types.asString(body.overlay, {
17
- name: 'overlay'
18
- })),
19
- underlay: [],
20
- ethereum: new EthAddress(Types.asString(body.ethereum, {
21
- name: 'ethereum'
22
- })),
23
- publicKey: new PublicKey(Types.asString(body.publicKey, {
24
- name: 'publicKey'
25
- })),
26
- pssPublicKey: new PublicKey(Types.asString(body.pssPublicKey, {
27
- name: 'pssPublicKey'
28
- }))
29
- };
30
- }
31
- async getTopology(options) {
32
- const requestOptions = super.getRequestOptionsForCall(options);
33
- const response = await http(requestOptions, {
34
- url: `topology`,
35
- responseType: 'json'
36
- });
37
- const body = Types.asObject(response.data, {
38
- name: 'response.data'
39
- });
40
- const bins = Types.asObject(body.bins, {
41
- name: 'bins'
42
- });
43
- return {
44
- baseAddr: '0bab5ca208a980950604f900f2791613fc980676c2dee7dd92a4fdda5a54bf26',
45
- population: Types.asNumber(body.population, {
46
- name: 'population'
47
- }),
48
- connected: Types.asNumber(body.connected, {
49
- name: 'connected'
50
- }),
51
- timestamp: Types.asString(body.timestamp, {
52
- name: 'timestamp'
53
- }),
54
- nnLowWatermark: Types.asNumber(body.nnLowWatermark, {
55
- name: 'nnLowWatermark'
56
- }),
57
- depth: Types.asNumber(body.depth, {
58
- name: 'depth'
59
- }),
60
- reachability: 'Public',
61
- networkAvailability: 'Available',
62
- bins: {
63
- bin_0: asBin(bins.bin_0, 'bin_0'),
64
- bin_1: asBin(bins.bin_1, 'bin_1'),
65
- bin_2: asBin(bins.bin_2, 'bin_2'),
66
- bin_3: asBin(bins.bin_3, 'bin_3'),
67
- bin_4: asBin(bins.bin_4, 'bin_4'),
68
- bin_5: asBin(bins.bin_5, 'bin_5'),
69
- bin_6: asBin(bins.bin_6, 'bin_6'),
70
- bin_7: asBin(bins.bin_7, 'bin_7'),
71
- bin_8: asBin(bins.bin_8, 'bin_8'),
72
- bin_9: asBin(bins.bin_9, 'bin_9'),
73
- bin_10: asBin(bins.bin_10, 'bin_10'),
74
- bin_11: asBin(bins.bin_11, 'bin_11'),
75
- bin_12: asBin(bins.bin_12, 'bin_12'),
76
- bin_13: asBin(bins.bin_13, 'bin_13'),
77
- bin_14: asBin(bins.bin_14, 'bin_14'),
78
- bin_15: asBin(bins.bin_15, 'bin_15'),
79
- bin_16: asBin(bins.bin_16, 'bin_16'),
80
- bin_17: asBin(bins.bin_17, 'bin_17'),
81
- bin_18: asBin(bins.bin_18, 'bin_18'),
82
- bin_19: asBin(bins.bin_19, 'bin_19'),
83
- bin_20: asBin(bins.bin_20, 'bin_20'),
84
- bin_21: asBin(bins.bin_21, 'bin_21'),
85
- bin_22: asBin(bins.bin_22, 'bin_22'),
86
- bin_23: asBin(bins.bin_23, 'bin_23'),
87
- bin_24: asBin(bins.bin_24, 'bin_24'),
88
- bin_25: asBin(bins.bin_25, 'bin_25'),
89
- bin_26: asBin(bins.bin_26, 'bin_26'),
90
- bin_27: asBin(bins.bin_27, 'bin_27'),
91
- bin_28: asBin(bins.bin_28, 'bin_28'),
92
- bin_29: asBin(bins.bin_29, 'bin_29'),
93
- bin_30: asBin(bins.bin_30, 'bin_30'),
94
- bin_31: asBin(bins.bin_31, 'bin_31')
95
- }
96
- };
97
- }
98
- }
@@ -1,5 +0,0 @@
1
- import { Bee, BeeRequestOptions, NodeAddresses, Topology } from '.';
2
- export declare class BeeDev extends Bee {
3
- getNodeAddresses(options?: BeeRequestOptions): Promise<NodeAddresses>;
4
- getTopology(options?: BeeRequestOptions): Promise<Topology>;
5
- }