@ethersphere/bee-js 10.4.0 → 11.0.0
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/cjs/bee.js +17 -10
- package/dist/cjs/chunk/bmt.js +1 -2
- package/dist/cjs/chunk/cac.js +3 -3
- package/dist/cjs/chunk/soc.js +24 -15
- package/dist/cjs/feed/identifier.js +1 -2
- package/dist/cjs/feed/index.js +25 -16
- package/dist/cjs/feed/retrievable.js +1 -2
- package/dist/cjs/index.js +17 -7
- package/dist/cjs/modules/bytes.js +4 -5
- package/dist/cjs/modules/bzz.js +4 -5
- package/dist/cjs/modules/chunk.js +2 -3
- package/dist/cjs/modules/debug/balance.js +4 -5
- package/dist/cjs/modules/debug/chequebook.js +8 -9
- package/dist/cjs/modules/debug/connectivity.js +7 -8
- package/dist/cjs/modules/debug/settlements.js +2 -3
- package/dist/cjs/modules/debug/stake.js +6 -7
- package/dist/cjs/modules/debug/stamps.js +7 -8
- package/dist/cjs/modules/debug/states.js +6 -6
- package/dist/cjs/modules/debug/status.js +9 -9
- package/dist/cjs/modules/debug/transactions.js +4 -5
- package/dist/cjs/modules/envelope.js +1 -2
- package/dist/cjs/modules/feed.js +3 -4
- package/dist/cjs/modules/grantee.js +3 -4
- package/dist/cjs/modules/gsoc.js +2 -3
- package/dist/cjs/modules/pinning.js +4 -5
- package/dist/cjs/modules/pss.js +2 -3
- package/dist/cjs/modules/rchash.js +1 -2
- package/dist/cjs/modules/soc.js +1 -2
- package/dist/cjs/modules/status.js +2 -3
- package/dist/cjs/modules/stewardship.js +2 -3
- package/dist/cjs/modules/tag.js +5 -6
- package/dist/cjs/types/debug.js +3 -3
- package/dist/cjs/types/index.js +2 -2
- package/dist/cjs/utils/bytes.js +2 -2
- package/dist/cjs/utils/chunk-size.js +1 -2
- package/dist/cjs/utils/chunk-stream.browser.js +3 -4
- package/dist/cjs/utils/chunk-stream.js +3 -4
- package/dist/cjs/utils/cid.js +3 -3
- package/dist/cjs/utils/collection.browser.js +2 -3
- package/dist/cjs/utils/collection.js +5 -6
- package/dist/cjs/utils/collection.node.js +2 -3
- package/dist/cjs/utils/data.browser.js +1 -2
- package/dist/cjs/utils/data.js +1 -2
- package/dist/cjs/utils/expose.js +2 -1
- package/dist/cjs/utils/file.js +2 -3
- package/dist/cjs/utils/headers.js +2 -3
- package/dist/cjs/utils/http.js +2 -2
- package/dist/cjs/utils/pss.js +1 -2
- package/dist/cjs/utils/redundancy.js +3 -4
- package/dist/cjs/utils/stamps.js +12 -13
- package/dist/cjs/utils/tar-uploader.browser.js +1 -2
- package/dist/cjs/utils/tar-uploader.js +1 -2
- package/dist/cjs/utils/tar-writer.browser.js +1 -2
- package/dist/cjs/utils/tar-writer.js +1 -2
- package/dist/cjs/utils/type.js +34 -25
- package/dist/cjs/utils/url.js +3 -4
- package/dist/cjs/utils/workaround.js +2 -3
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/mjs/bee.js +0 -3
- package/dist/mjs/modules/debug/states.js +3 -0
- package/dist/mjs/modules/debug/status.js +1 -1
- package/dist/mjs/utils/expose.js +1 -1
- package/dist/types/bee.d.ts +0 -4
- package/dist/types/index.d.ts +1 -0
- package/dist/types/modules/bzz.d.ts +0 -1
- package/dist/types/modules/debug/status.d.ts +1 -1
- package/dist/types/modules/gsoc.d.ts +0 -1
- package/dist/types/modules/pss.d.ts +0 -1
- package/dist/types/types/debug.d.ts +1 -0
- package/dist/types/utils/constants.d.ts +3 -3
- package/dist/types/utils/error.d.ts +2 -2
- package/dist/types/utils/expose.d.ts +1 -1
- package/dist/types/utils/tar.browser.d.ts +1 -1
- package/dist/types/utils/tar.d.ts +0 -1
- package/dist/types/utils/type.d.ts +0 -1
- package/package.json +9 -12
package/dist/mjs/bee.js
CHANGED
|
@@ -953,9 +953,6 @@ export class Bee {
|
|
|
953
953
|
*
|
|
954
954
|
* @param rawPayload Data to be stored in the chunk. If the data is a string, it will be converted to UTF-8 bytes.
|
|
955
955
|
* @param span Optional span for the chunk. If not provided, it will be set to the length of the payload.
|
|
956
|
-
*
|
|
957
|
-
* @example
|
|
958
|
-
*
|
|
959
956
|
*/
|
|
960
957
|
makeContentAddressedChunk(rawPayload, span) {
|
|
961
958
|
return makeContentAddressedChunk(rawPayload, span);
|
|
@@ -30,6 +30,9 @@ export async function getReserveState(requestOptions) {
|
|
|
30
30
|
}),
|
|
31
31
|
storageRadius: Types.asNumber(body.storageRadius, {
|
|
32
32
|
name: 'storageRadius'
|
|
33
|
+
}),
|
|
34
|
+
reserveCapacityDoubling: Types.asNumber(body.reserveCapacityDoubling, {
|
|
35
|
+
name: 'reserveCapacityDoubling'
|
|
33
36
|
})
|
|
34
37
|
};
|
|
35
38
|
}
|
|
@@ -2,7 +2,7 @@ import { Types } from 'cafe-utility';
|
|
|
2
2
|
import getMajorSemver from 'semver/functions/major.js';
|
|
3
3
|
import { toBeeMode } from "../../types/debug.js";
|
|
4
4
|
import { http } from "../../utils/http.js";
|
|
5
|
-
export const SUPPORTED_BEE_VERSION_EXACT = '2.
|
|
5
|
+
export const SUPPORTED_BEE_VERSION_EXACT = '2.7.0-6ddf9b45';
|
|
6
6
|
export const SUPPORTED_BEE_VERSION = SUPPORTED_BEE_VERSION_EXACT.split('-')[0];
|
|
7
7
|
export const SUPPORTED_API_VERSION = '7.3.0';
|
|
8
8
|
const NODE_INFO_URL = 'node';
|
package/dist/mjs/utils/expose.js
CHANGED
|
@@ -2,4 +2,4 @@ export { getCollectionSize, makeCollectionFromFileList } from "./collection.js";
|
|
|
2
2
|
export { getFolderSize } from "./collection.node.js";
|
|
3
3
|
export { makeMaxTarget } from "./pss.js";
|
|
4
4
|
export { approximateOverheadForRedundancyLevel, getRedundancyStat, getRedundancyStats } from "./redundancy.js";
|
|
5
|
-
export { getAmountForDuration, getDepthForSize, getStampCost, getStampDuration, getStampEffectiveBytes, getStampEffectiveBytesBreakpoints, getStampTheoreticalBytes, getStampUsage, mapPostageBatch, unmapPostageBatch } from "./stamps.js";
|
|
5
|
+
export { convertEnvelopeToMarshaledStamp, getAmountForDuration, getDepthForSize, getStampCost, getStampDuration, getStampEffectiveBytes, getStampEffectiveBytesBreakpoints, getStampTheoreticalBytes, getStampUsage, mapPostageBatch, unmapPostageBatch } from "./stamps.js";
|
package/dist/types/bee.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Readable } from 'stream';
|
|
3
2
|
import { Chunk } from './chunk/cac';
|
|
4
3
|
import { SingleOwnerChunk } from './chunk/soc';
|
|
@@ -618,9 +617,6 @@ export declare class Bee {
|
|
|
618
617
|
*
|
|
619
618
|
* @param rawPayload Data to be stored in the chunk. If the data is a string, it will be converted to UTF-8 bytes.
|
|
620
619
|
* @param span Optional span for the chunk. If not provided, it will be set to the length of the payload.
|
|
621
|
-
*
|
|
622
|
-
* @example
|
|
623
|
-
*
|
|
624
620
|
*/
|
|
625
621
|
makeContentAddressedChunk(rawPayload: Bytes | Uint8Array | string, span?: Span | bigint): Chunk;
|
|
626
622
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * as Utils from './utils/expose';
|
|
|
15
15
|
export { Size } from './utils/size';
|
|
16
16
|
export * from './utils/tokens';
|
|
17
17
|
export * from './utils/typed-bytes';
|
|
18
|
+
export type { UploadProgress } from './utils/upload-progress';
|
|
18
19
|
export { Bee, BeeDev, Stamper };
|
|
19
20
|
declare global {
|
|
20
21
|
interface Window {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BeeRequestOptions } from '../../index';
|
|
2
2
|
import type { DebugStatus, Health, NodeInfo, Readiness } from '../../types/debug';
|
|
3
3
|
import { BeeVersions } from '../../types/debug';
|
|
4
|
-
export declare const SUPPORTED_BEE_VERSION_EXACT = "2.
|
|
4
|
+
export declare const SUPPORTED_BEE_VERSION_EXACT = "2.7.0-6ddf9b45";
|
|
5
5
|
export declare const SUPPORTED_BEE_VERSION: string;
|
|
6
6
|
export declare const SUPPORTED_API_VERSION = "7.3.0";
|
|
7
7
|
export declare function getDebugStatus(requestOptions: BeeRequestOptions): Promise<DebugStatus>;
|
|
@@ -2,6 +2,6 @@ import { BatchId, Topic } from './typed-bytes';
|
|
|
2
2
|
export declare const SWARM_GATEWAY_URL = "https://api.gateway.ethswarm.org";
|
|
3
3
|
export declare const NULL_STAMP: BatchId;
|
|
4
4
|
export declare const NULL_TOPIC: Topic;
|
|
5
|
-
export declare const NULL_ADDRESS: Uint8Array
|
|
6
|
-
export declare const NULL_IDENTIFIER: Uint8Array
|
|
7
|
-
export declare const NULL_OWNER: Uint8Array
|
|
5
|
+
export declare const NULL_ADDRESS: Uint8Array<ArrayBuffer>;
|
|
6
|
+
export declare const NULL_IDENTIFIER: Uint8Array<ArrayBuffer>;
|
|
7
|
+
export declare const NULL_OWNER: Uint8Array<ArrayBuffer>;
|
|
@@ -8,8 +8,8 @@ export declare class BeeArgumentError extends BeeError {
|
|
|
8
8
|
export declare class BeeResponseError extends BeeError {
|
|
9
9
|
method: string;
|
|
10
10
|
url: string;
|
|
11
|
-
responseBody?: unknown;
|
|
11
|
+
responseBody?: unknown | undefined;
|
|
12
12
|
status?: number | undefined;
|
|
13
13
|
statusText?: string | undefined;
|
|
14
|
-
constructor(method: string, url: string, message: string, responseBody?: unknown, status?: number | undefined, statusText?: string | undefined);
|
|
14
|
+
constructor(method: string, url: string, message: string, responseBody?: unknown | undefined, status?: number | undefined, statusText?: string | undefined);
|
|
15
15
|
}
|
|
@@ -2,4 +2,4 @@ export { getCollectionSize, makeCollectionFromFileList } from './collection';
|
|
|
2
2
|
export { getFolderSize } from './collection.node';
|
|
3
3
|
export { makeMaxTarget } from './pss';
|
|
4
4
|
export { approximateOverheadForRedundancyLevel, getRedundancyStat, getRedundancyStats } from './redundancy';
|
|
5
|
-
export { getAmountForDuration, getDepthForSize, getStampCost, getStampDuration, getStampEffectiveBytes, getStampEffectiveBytesBreakpoints, getStampTheoreticalBytes, getStampUsage, mapPostageBatch, unmapPostageBatch, } from './stamps';
|
|
5
|
+
export { convertEnvelopeToMarshaledStamp, getAmountForDuration, getDepthForSize, getStampCost, getStampDuration, getStampEffectiveBytes, getStampEffectiveBytesBreakpoints, getStampTheoreticalBytes, getStampUsage, mapPostageBatch, unmapPostageBatch, } from './stamps';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare class TarStream {
|
|
2
2
|
pieces: Uint8Array[];
|
|
3
3
|
currentFileSize: number;
|
|
4
|
-
get output(): Uint8Array
|
|
4
|
+
get output(): Uint8Array<ArrayBufferLike>;
|
|
5
5
|
beginFile(path: string, size: number): void;
|
|
6
6
|
appendFile(data: Uint8Array): Promise<void>;
|
|
7
7
|
endFile(): Promise<void>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as stream from 'stream';
|
|
3
2
|
import { AllTagsOptions, BeeRequestOptions, CollectionUploadOptions, DownloadOptions, FileUploadOptions, GsocMessageHandler, NumberString, PostageBatchOptions, PssMessageHandler, RedundantUploadOptions, Tag, TransactionOptions, UploadOptions } from '../types';
|
|
4
3
|
export declare function isReadable(value: unknown): value is stream.Readable;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethersphere/bee-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "Javascript client for Bee",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bee",
|
|
@@ -50,18 +50,18 @@
|
|
|
50
50
|
"dist"
|
|
51
51
|
],
|
|
52
52
|
"scripts": {
|
|
53
|
-
"prepublishOnly": "
|
|
53
|
+
"prepublishOnly": "NODE_ENV=production npm run build",
|
|
54
54
|
"build": "rimraf dist && npm run build:node && npm run build:types && npm run build:browser",
|
|
55
55
|
"build:node": "tsc -p tsconfig.json && tsc -p tsconfig-mjs.json && ./build-fixup && babel --plugins \"babel-plugin-add-import-extension\" --out-dir dist/mjs/ dist/mjs/",
|
|
56
56
|
"build:types": "tsc --emitDeclarationOnly --declaration --outDir dist/types",
|
|
57
57
|
"build:browser": "webpack --progress",
|
|
58
|
-
"test": "
|
|
58
|
+
"test": "TS_NODE_PROJECT=tsconfig.test.json jest --runInBand --verbose --forceExit",
|
|
59
59
|
"check": "tsc --project tsconfig.test.json",
|
|
60
60
|
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" && prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
61
61
|
"depcheck": "depcheck ."
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"axios": "^0.30.
|
|
64
|
+
"axios": "^0.30.2",
|
|
65
65
|
"cafe-utility": "^33.3.4",
|
|
66
66
|
"debug": "^4.4.1",
|
|
67
67
|
"isomorphic-ws": "^4.0.1",
|
|
@@ -77,10 +77,8 @@
|
|
|
77
77
|
"@babel/preset-typescript": "^7.18.6",
|
|
78
78
|
"@commitlint/cli": "^17.0.2",
|
|
79
79
|
"@commitlint/config-conventional": "^17.4.2",
|
|
80
|
-
"@jest/types": "^29.6.3",
|
|
81
|
-
"@naholyr/cross-env": "^1.0.0",
|
|
82
80
|
"@types/debug": "^4.1.12",
|
|
83
|
-
"@types/jest": "^
|
|
81
|
+
"@types/jest": "^30.0.0",
|
|
84
82
|
"@types/node": "^18.11.11",
|
|
85
83
|
"@types/semver": "^7.3.9",
|
|
86
84
|
"@types/ws": "^8.5.3",
|
|
@@ -88,20 +86,19 @@
|
|
|
88
86
|
"@typescript-eslint/parser": "^5.46.0",
|
|
89
87
|
"babel-loader": "^9.1.0",
|
|
90
88
|
"babel-plugin-add-import-extension": "^1.6.0",
|
|
91
|
-
"cross-env": "^7.0.3",
|
|
92
89
|
"depcheck": "^1.4.7",
|
|
93
90
|
"eslint": "^8.13.0",
|
|
94
91
|
"eslint-config-prettier": "^8.5.0",
|
|
95
92
|
"eslint-plugin-prettier": "^4.0.0",
|
|
96
93
|
"eslint-plugin-unused-imports": "^2.0.0",
|
|
97
94
|
"husky": "^8.0.1",
|
|
98
|
-
"jest": "^
|
|
95
|
+
"jest": "^30.2.0",
|
|
99
96
|
"prettier": "^2.6.2",
|
|
100
97
|
"rimraf": "^3.0.2",
|
|
101
98
|
"terser-webpack-plugin": "^5.3.1",
|
|
102
|
-
"ts-jest": "^29.
|
|
103
|
-
"ts-node": "^10.9.
|
|
104
|
-
"typescript": "^
|
|
99
|
+
"ts-jest": "^29.4.6",
|
|
100
|
+
"ts-node": "^10.9.2",
|
|
101
|
+
"typescript": "^5.9.3",
|
|
105
102
|
"webpack": "^5.75.0",
|
|
106
103
|
"webpack-cli": "^5.0.1"
|
|
107
104
|
}
|