@ethersphere/bee-js 6.0.0-pre.0 → 6.0.0-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.
- package/README.md +18 -17
- package/dist/cjs/bee-debug.js +569 -0
- package/dist/cjs/bee.js +873 -0
- package/dist/cjs/chunk/bmt.js +55 -0
- package/dist/cjs/chunk/cac.js +56 -0
- package/dist/cjs/chunk/serialize.js +19 -0
- package/dist/cjs/chunk/signer.js +126 -0
- package/dist/cjs/chunk/soc.js +159 -0
- package/dist/cjs/chunk/span.js +29 -0
- package/dist/cjs/feed/identifier.js +35 -0
- package/dist/cjs/feed/index.js +116 -0
- package/dist/cjs/feed/json.js +28 -0
- package/dist/cjs/feed/retrievable.js +58 -0
- package/dist/cjs/feed/topic.js +25 -0
- package/dist/cjs/feed/type.js +15 -0
- package/dist/cjs/index.js +39 -0
- package/dist/cjs/modules/bytes.js +62 -0
- package/dist/cjs/modules/bzz.js +125 -0
- package/dist/cjs/modules/chunk.js +48 -0
- package/dist/cjs/modules/debug/balance.js +60 -0
- package/dist/cjs/modules/debug/chequebook.js +142 -0
- package/dist/cjs/modules/debug/chunk.js +38 -0
- package/dist/cjs/modules/debug/connectivity.js +54 -0
- package/dist/cjs/modules/debug/settlements.js +32 -0
- package/dist/cjs/modules/debug/stake.js +57 -0
- package/dist/cjs/modules/debug/stamps.js +68 -0
- package/dist/cjs/modules/debug/states.js +64 -0
- package/dist/cjs/modules/debug/status.js +148 -0
- package/dist/cjs/modules/debug/tag.js +19 -0
- package/dist/cjs/modules/debug/transactions.js +64 -0
- package/dist/cjs/modules/feed.js +66 -0
- package/dist/cjs/modules/pinning.js +63 -0
- package/dist/cjs/modules/pss.js +44 -0
- package/dist/cjs/modules/soc.js +32 -0
- package/dist/cjs/modules/status.js +15 -0
- package/dist/cjs/modules/stewardship.js +28 -0
- package/dist/cjs/modules/tag.js +77 -0
- package/dist/cjs/package.json +8 -0
- package/dist/cjs/types/debug.js +10 -0
- package/dist/cjs/types/index.js +51 -0
- package/dist/cjs/utils/bytes.js +121 -0
- package/dist/cjs/utils/collection.browser.js +23 -0
- package/dist/cjs/utils/collection.js +59 -0
- package/dist/cjs/utils/collection.node.js +71 -0
- package/dist/cjs/utils/data.browser.js +61 -0
- package/dist/cjs/utils/data.js +45 -0
- package/dist/cjs/utils/error.js +16 -0
- package/dist/cjs/utils/eth.js +199 -0
- package/dist/cjs/utils/expose.js +44 -0
- package/dist/cjs/utils/file.js +38 -0
- package/dist/cjs/utils/hash.js +21 -0
- package/dist/cjs/utils/headers.js +59 -0
- package/dist/cjs/utils/hex.js +150 -0
- package/dist/cjs/utils/http.js +30 -0
- package/dist/cjs/utils/pss.js +18 -0
- package/dist/cjs/utils/reference.js +36 -0
- package/dist/cjs/utils/stamps.js +17 -0
- package/dist/cjs/utils/stream.js +146 -0
- package/dist/cjs/utils/tar.js +25 -0
- package/dist/cjs/utils/type.js +434 -0
- package/dist/cjs/utils/uint64.js +29 -0
- package/dist/cjs/utils/url.js +56 -0
- package/dist/index.browser.min.js +3 -0
- package/dist/index.browser.min.js.LICENSE.txt +50 -0
- package/dist/index.browser.min.js.map +1 -0
- package/dist/{src → mjs}/bee-debug.js +101 -185
- package/dist/{src → mjs}/bee.js +81 -234
- package/dist/{src → mjs}/chunk/bmt.js +4 -10
- package/dist/{src → mjs}/chunk/cac.js +0 -3
- package/dist/{src → mjs}/chunk/signer.js +1 -18
- package/dist/{src → mjs}/chunk/soc.js +17 -29
- package/dist/{src → mjs}/chunk/span.js +2 -5
- package/dist/{src → mjs}/feed/identifier.js +0 -6
- package/dist/{src → mjs}/feed/index.js +24 -27
- package/dist/{src → mjs}/feed/json.js +2 -5
- package/dist/{src → mjs}/feed/retrievable.js +7 -21
- package/dist/{src → mjs}/feed/topic.js +0 -2
- package/dist/{src → mjs}/index.js +2 -2
- package/dist/{src → mjs}/modules/bytes.js +16 -19
- package/dist/{src → mjs}/modules/bzz.js +33 -40
- package/dist/{src → mjs}/modules/chunk.js +11 -13
- package/dist/mjs/modules/debug/balance.js +53 -0
- package/dist/mjs/modules/debug/chequebook.js +135 -0
- package/dist/{src → mjs}/modules/debug/chunk.js +10 -12
- package/dist/mjs/modules/debug/connectivity.js +45 -0
- package/dist/mjs/modules/debug/settlements.js +27 -0
- package/dist/mjs/modules/debug/stake.js +51 -0
- package/dist/mjs/modules/debug/stamps.js +61 -0
- package/dist/mjs/modules/debug/states.js +58 -0
- package/dist/{src → mjs}/modules/debug/status.js +46 -37
- package/dist/mjs/modules/debug/tag.js +15 -0
- package/dist/mjs/modules/debug/transactions.js +59 -0
- package/dist/{src → mjs}/modules/feed.js +15 -21
- package/dist/mjs/modules/pinning.js +56 -0
- package/dist/{src → mjs}/modules/pss.js +7 -9
- package/dist/{src → mjs}/modules/soc.js +6 -7
- package/dist/mjs/modules/status.js +11 -0
- package/dist/mjs/modules/stewardship.js +23 -0
- package/dist/mjs/modules/tag.js +72 -0
- package/dist/mjs/package.json +8 -0
- package/dist/{src → mjs}/types/debug.js +0 -1
- package/dist/{src → mjs}/types/index.js +0 -4
- package/dist/{src → mjs}/utils/bytes.js +8 -17
- package/dist/{src/utils/collection-browser.js → mjs/utils/collection.browser.js} +0 -1
- package/dist/{src → mjs}/utils/collection.js +0 -12
- package/dist/{src/utils/collection-node.js → mjs/utils/collection.node.js} +0 -13
- package/dist/{src → mjs}/utils/data.browser.js +2 -11
- package/dist/{src → mjs}/utils/data.js +0 -7
- package/dist/mjs/utils/error.js +11 -0
- package/dist/{src → mjs}/utils/eth.js +6 -28
- package/dist/{src → mjs}/utils/expose.js +1 -1
- package/dist/{src → mjs}/utils/file.js +4 -9
- package/dist/{src → mjs}/utils/hash.js +0 -1
- package/dist/{src → mjs}/utils/headers.js +5 -13
- package/dist/{src → mjs}/utils/hex.js +6 -25
- package/dist/mjs/utils/http.js +22 -0
- package/dist/{src → mjs}/utils/pss.js +0 -2
- package/dist/{src → mjs}/utils/reference.js +2 -5
- package/dist/{src → mjs}/utils/stream.js +3 -26
- package/dist/{src → mjs}/utils/tar.js +2 -5
- package/dist/{src → mjs}/utils/type.js +23 -80
- package/dist/{src → mjs}/utils/uint64.js +0 -1
- package/dist/{src → mjs}/utils/url.js +2 -10
- package/dist/types/bee-debug.d.ts +71 -46
- package/dist/types/bee.d.ts +34 -58
- package/dist/types/chunk/bmt.d.ts +1 -1
- package/dist/types/chunk/cac.d.ts +1 -1
- package/dist/types/chunk/soc.d.ts +9 -9
- package/dist/types/chunk/span.d.ts +1 -1
- package/dist/types/feed/index.d.ts +10 -10
- package/dist/types/feed/json.d.ts +2 -2
- package/dist/types/feed/retrievable.d.ts +2 -2
- package/dist/types/feed/type.d.ts +1 -1
- package/dist/types/index.d.ts +13 -2
- package/dist/types/modules/bytes.d.ts +5 -5
- package/dist/types/modules/bzz.d.ts +8 -8
- package/dist/types/modules/chunk.d.ts +4 -4
- package/dist/types/modules/debug/balance.d.ts +9 -9
- package/dist/types/modules/debug/chequebook.d.ts +17 -17
- package/dist/types/modules/debug/chunk.d.ts +5 -5
- package/dist/types/modules/debug/connectivity.d.ts +7 -7
- package/dist/types/modules/debug/settlements.d.ts +5 -5
- package/dist/types/modules/debug/stake.d.ts +21 -0
- package/dist/types/modules/debug/stamps.d.ts +7 -7
- package/dist/types/modules/debug/states.d.ts +7 -7
- package/dist/types/modules/debug/status.d.ts +21 -15
- package/dist/types/modules/debug/tag.d.ts +3 -3
- package/dist/types/modules/debug/transactions.d.ts +5 -5
- package/dist/types/modules/feed.d.ts +3 -3
- package/dist/types/modules/pinning.d.ts +7 -7
- package/dist/types/modules/pss.d.ts +3 -3
- package/dist/types/modules/soc.d.ts +2 -2
- package/dist/types/modules/status.d.ts +3 -3
- package/dist/types/modules/stewardship.d.ts +3 -3
- package/dist/types/modules/tag.d.ts +6 -6
- package/dist/types/types/debug.d.ts +35 -2
- package/dist/types/types/index.d.ts +45 -88
- package/dist/types/utils/error.d.ts +0 -26
- package/dist/types/utils/eth.d.ts +6 -6
- package/dist/types/utils/expose.d.ts +4 -7
- package/dist/types/utils/hash.d.ts +1 -1
- package/dist/types/utils/headers.d.ts +1 -1
- package/dist/types/utils/hex.d.ts +4 -4
- package/dist/types/utils/http.d.ts +12 -21
- package/dist/types/utils/stream.d.ts +1 -1
- package/dist/types/utils/type.d.ts +3 -2
- package/dist/types/utils/uint64.d.ts +1 -1
- package/package.json +59 -49
- package/dist/index.browser.js +0 -33
- package/dist/index.browser.js.map +0 -7
- package/dist/src/modules/debug/balance.js +0 -57
- package/dist/src/modules/debug/chequebook.js +0 -150
- package/dist/src/modules/debug/connectivity.js +0 -45
- package/dist/src/modules/debug/settlements.js +0 -29
- package/dist/src/modules/debug/stamps.js +0 -64
- package/dist/src/modules/debug/states.js +0 -46
- package/dist/src/modules/debug/tag.js +0 -16
- package/dist/src/modules/debug/transactions.js +0 -69
- package/dist/src/modules/pinning.js +0 -60
- package/dist/src/modules/status.js +0 -12
- package/dist/src/modules/stewardship.js +0 -24
- package/dist/src/modules/tag.js +0 -77
- package/dist/src/utils/error.js +0 -47
- package/dist/src/utils/http.js +0 -162
- package/dist/src/utils/merge.js +0 -36
- package/dist/src/utils/sleep.js +0 -8
- package/dist/types/utils/merge.d.ts +0 -8
- package/dist/types/utils/sleep.d.ts +0 -6
- /package/dist/{src → mjs}/chunk/serialize.js +0 -0
- /package/dist/{src → mjs}/feed/type.js +0 -0
- /package/dist/{src → mjs}/utils/stamps.js +0 -0
- /package/dist/types/utils/{collection-browser.d.ts → collection.browser.d.ts} +0 -0
- /package/dist/types/utils/{collection-node.d.ts → collection.node.d.ts} +0 -0
package/dist/types/bee.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Index, IndexBytes } from './feed';
|
|
2
2
|
import { FeedType } from './feed/type';
|
|
3
|
+
import type { AddressPrefix, AnyJson, BatchId, BeeOptions, BeeRequestOptions, CollectionUploadOptions, Data, FeedReader, FeedWriter, FileData, FileUploadOptions, JsonFeedOptions, Pin, PssMessageHandler, PssSubscription, PublicKey, Reference, Signer, SOCReader, SOCWriter, Tag, Topic, UploadOptions, UploadResultWithCid } from './types';
|
|
4
|
+
import { AllTagsOptions, Collection, FeedManifestResult, Readable, ReferenceCidOrEns, ReferenceOrEns, UploadResult } from './types';
|
|
3
5
|
import { EthAddress } from './utils/eth';
|
|
4
|
-
import type { AddressPrefix, AnyJson, BatchId, BeeOptions, CollectionUploadOptions, Data, FeedReader, FeedWriter, FileData, FileUploadOptions, JsonFeedOptions, Pin, PssMessageHandler, PssSubscription, PublicKey, Reference, Signer, SOCReader, SOCWriter, Tag, Topic, UploadOptions, UploadResultWithCid } from './types';
|
|
5
|
-
import { AllTagsOptions, Collection, FeedManifestResult, Readable, ReferenceCidOrEns, ReferenceOrEns, RequestOptions, UploadResult } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* The main component that abstracts operations available on the main Bee API.
|
|
8
8
|
*
|
|
@@ -22,7 +22,7 @@ export declare class Bee {
|
|
|
22
22
|
* Ky instance that defines connection to Bee node
|
|
23
23
|
* @private
|
|
24
24
|
*/
|
|
25
|
-
private readonly
|
|
25
|
+
private readonly requestOptions;
|
|
26
26
|
/**
|
|
27
27
|
* @param url URL on which is the main API of Bee node exposed
|
|
28
28
|
* @param options
|
|
@@ -39,7 +39,7 @@ export declare class Bee {
|
|
|
39
39
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
40
40
|
* @see [Bee API reference - `POST /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes/post)
|
|
41
41
|
*/
|
|
42
|
-
uploadData(postageBatchId: string | BatchId, data: string | Uint8Array, options?: UploadOptions): Promise<UploadResult>;
|
|
42
|
+
uploadData(postageBatchId: string | BatchId, data: string | Uint8Array, options?: UploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
|
|
43
43
|
/**
|
|
44
44
|
* Download data as a byte array
|
|
45
45
|
*
|
|
@@ -50,7 +50,7 @@ export declare class Bee {
|
|
|
50
50
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
51
51
|
* @see [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get)
|
|
52
52
|
*/
|
|
53
|
-
downloadData(reference: ReferenceOrEns | string, options?:
|
|
53
|
+
downloadData(reference: ReferenceOrEns | string, options?: BeeRequestOptions): Promise<Data>;
|
|
54
54
|
/**
|
|
55
55
|
* Download data as a Readable stream
|
|
56
56
|
*
|
|
@@ -61,7 +61,7 @@ export declare class Bee {
|
|
|
61
61
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
62
62
|
* @see [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get)
|
|
63
63
|
*/
|
|
64
|
-
downloadReadableData(reference: ReferenceOrEns | string, options?:
|
|
64
|
+
downloadReadableData(reference: ReferenceOrEns | string, options?: BeeRequestOptions): Promise<ReadableStream<Uint8Array>>;
|
|
65
65
|
/**
|
|
66
66
|
* Upload chunk to a Bee node
|
|
67
67
|
*
|
|
@@ -73,7 +73,7 @@ export declare class Bee {
|
|
|
73
73
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
74
74
|
* @see [Bee API reference - `POST /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post)
|
|
75
75
|
*/
|
|
76
|
-
uploadChunk(postageBatchId: string | BatchId, data: Uint8Array, options?: UploadOptions): Promise<Reference>;
|
|
76
|
+
uploadChunk(postageBatchId: string | BatchId, data: Uint8Array, options?: UploadOptions, requestOptions?: BeeRequestOptions): Promise<Reference>;
|
|
77
77
|
/**
|
|
78
78
|
* Download chunk as a byte array
|
|
79
79
|
*
|
|
@@ -84,7 +84,7 @@ export declare class Bee {
|
|
|
84
84
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
85
85
|
* @see [Bee API reference - `GET /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks~1{reference}/get)
|
|
86
86
|
*/
|
|
87
|
-
downloadChunk(reference: ReferenceOrEns | string, options?:
|
|
87
|
+
downloadChunk(reference: ReferenceOrEns | string, options?: BeeRequestOptions): Promise<Data>;
|
|
88
88
|
/**
|
|
89
89
|
* Upload single file to a Bee node.
|
|
90
90
|
*
|
|
@@ -101,7 +101,7 @@ export declare class Bee {
|
|
|
101
101
|
* @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/File/paths/~1bzz/post)
|
|
102
102
|
* @returns reference is a content hash of the file
|
|
103
103
|
*/
|
|
104
|
-
uploadFile(postageBatchId: string | BatchId, data: string | Uint8Array | Readable | File, name?: string, options?: FileUploadOptions): Promise<UploadResultWithCid>;
|
|
104
|
+
uploadFile(postageBatchId: string | BatchId, data: string | Uint8Array | Readable | File, name?: string, options?: FileUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResultWithCid>;
|
|
105
105
|
/**
|
|
106
106
|
* Download single file.
|
|
107
107
|
*
|
|
@@ -114,7 +114,7 @@ export declare class Bee {
|
|
|
114
114
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
115
115
|
* @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/Collection/paths/~1bzz~1{reference}~1{path}/get)
|
|
116
116
|
*/
|
|
117
|
-
downloadFile(reference: ReferenceCidOrEns | string, path?: string, options?:
|
|
117
|
+
downloadFile(reference: ReferenceCidOrEns | string, path?: string, options?: BeeRequestOptions): Promise<FileData<Data>>;
|
|
118
118
|
/**
|
|
119
119
|
* Download single file as a readable stream
|
|
120
120
|
*
|
|
@@ -127,7 +127,7 @@ export declare class Bee {
|
|
|
127
127
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
128
128
|
* @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/Collection/paths/~1bzz~1{reference}~1{path}/get)
|
|
129
129
|
*/
|
|
130
|
-
downloadReadableFile(reference: ReferenceCidOrEns | string, path?: string, options?:
|
|
130
|
+
downloadReadableFile(reference: ReferenceCidOrEns | string, path?: string, options?: BeeRequestOptions): Promise<FileData<ReadableStream<Uint8Array>>>;
|
|
131
131
|
/**
|
|
132
132
|
* Upload collection of files to a Bee node
|
|
133
133
|
*
|
|
@@ -144,7 +144,7 @@ export declare class Bee {
|
|
|
144
144
|
* @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/access-the-swarm/upload-a-directory/)
|
|
145
145
|
* @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/Collection/paths/~1bzz/post)
|
|
146
146
|
*/
|
|
147
|
-
uploadFiles(postageBatchId: string | BatchId, fileList: FileList | File[], options?: CollectionUploadOptions): Promise<UploadResultWithCid>;
|
|
147
|
+
uploadFiles(postageBatchId: string | BatchId, fileList: FileList | File[], options?: CollectionUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResultWithCid>;
|
|
148
148
|
/**
|
|
149
149
|
* Upload Collection that you can assembly yourself.
|
|
150
150
|
*
|
|
@@ -172,24 +172,20 @@ export declare class Bee {
|
|
|
172
172
|
* @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/access-the-swarm/upload-a-directory/)
|
|
173
173
|
* @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/Collection/paths/~1bzz/post)
|
|
174
174
|
*/
|
|
175
|
-
uploadFilesFromDirectory(postageBatchId: string | BatchId, dir: string, options?: CollectionUploadOptions): Promise<UploadResultWithCid>;
|
|
175
|
+
uploadFilesFromDirectory(postageBatchId: string | BatchId, dir: string, options?: CollectionUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResultWithCid>;
|
|
176
176
|
/**
|
|
177
177
|
* Create a new Tag which is meant for tracking progres of syncing data across network.
|
|
178
178
|
*
|
|
179
|
-
* **Warning! Not allowed when node is in Gateway mode!**
|
|
180
|
-
*
|
|
181
179
|
* @param options Options that affects the request behavior
|
|
182
180
|
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/access-the-swarm/syncing)
|
|
183
181
|
* @see [Bee API reference - `POST /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/post)
|
|
184
182
|
*/
|
|
185
|
-
createTag(options?:
|
|
183
|
+
createTag(options?: BeeRequestOptions): Promise<Tag>;
|
|
186
184
|
/**
|
|
187
185
|
* Fetches all tags.
|
|
188
186
|
*
|
|
189
187
|
* The listing is limited by options.limit. So you have to iterate using options.offset to get all tags.
|
|
190
188
|
*
|
|
191
|
-
* **Warning! Not allowed when node is in Gateway mode!**
|
|
192
|
-
*
|
|
193
189
|
* @param options Options that affects the request behavior
|
|
194
190
|
* @throws TypeError if limit or offset are not numbers or undefined
|
|
195
191
|
* @throws BeeArgumentError if limit or offset have invalid options
|
|
@@ -201,8 +197,6 @@ export declare class Bee {
|
|
|
201
197
|
/**
|
|
202
198
|
* Retrieve tag information from Bee node
|
|
203
199
|
*
|
|
204
|
-
* **Warning! Not allowed when node is in Gateway mode!**
|
|
205
|
-
*
|
|
206
200
|
* @param tagUid UID or tag object to be retrieved
|
|
207
201
|
* @param options Options that affects the request behavior
|
|
208
202
|
* @throws TypeError if tagUid is in not correct format
|
|
@@ -211,12 +205,10 @@ export declare class Bee {
|
|
|
211
205
|
* @see [Bee API reference - `GET /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/get)
|
|
212
206
|
*
|
|
213
207
|
*/
|
|
214
|
-
retrieveTag(tagUid: number | Tag, options?:
|
|
208
|
+
retrieveTag(tagUid: number | Tag, options?: BeeRequestOptions): Promise<Tag>;
|
|
215
209
|
/**
|
|
216
210
|
* Delete Tag
|
|
217
211
|
*
|
|
218
|
-
* **Warning! Not allowed when node is in Gateway mode!**
|
|
219
|
-
*
|
|
220
212
|
* @param tagUid UID or tag object to be retrieved
|
|
221
213
|
* @param options Options that affects the request behavior
|
|
222
214
|
* @throws TypeError if tagUid is in not correct format
|
|
@@ -225,15 +217,13 @@ export declare class Bee {
|
|
|
225
217
|
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/access-the-swarm/syncing)
|
|
226
218
|
* @see [Bee API reference - `DELETE /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/delete)
|
|
227
219
|
*/
|
|
228
|
-
deleteTag(tagUid: number | Tag, options?:
|
|
220
|
+
deleteTag(tagUid: number | Tag, options?: BeeRequestOptions): Promise<void>;
|
|
229
221
|
/**
|
|
230
222
|
* Update tag's total chunks count.
|
|
231
223
|
*
|
|
232
224
|
* This is important if you are uploading individual chunks with a tag. Then upon finishing the final root chunk,
|
|
233
225
|
* you can use this method to update the total chunks count for the tag.
|
|
234
226
|
*
|
|
235
|
-
* **Warning! Not allowed when node is in Gateway mode!**
|
|
236
|
-
*
|
|
237
227
|
* @param tagUid UID or tag object to be retrieved
|
|
238
228
|
* @param reference The root reference that contains all the chunks to be counted
|
|
239
229
|
* @param options Options that affects the request behavior
|
|
@@ -243,45 +233,37 @@ export declare class Bee {
|
|
|
243
233
|
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/access-the-swarm/syncing)
|
|
244
234
|
* @see [Bee API reference - `PATCH /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/patch)
|
|
245
235
|
*/
|
|
246
|
-
updateTag(tagUid: number | Tag, reference: Reference | string, options?:
|
|
236
|
+
updateTag(tagUid: number | Tag, reference: Reference | string, options?: BeeRequestOptions): Promise<void>;
|
|
247
237
|
/**
|
|
248
238
|
* Pin local data with given reference
|
|
249
239
|
*
|
|
250
|
-
* **Warning! Not allowed when node is in Gateway mode!**
|
|
251
|
-
*
|
|
252
240
|
* @param reference Data reference
|
|
253
241
|
* @param options Options that affects the request behavior
|
|
254
242
|
* @throws TypeError if reference is in not correct format
|
|
255
243
|
*
|
|
256
244
|
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/access-the-swarm/pinning)
|
|
257
245
|
*/
|
|
258
|
-
pin(reference: Reference | string, options?:
|
|
246
|
+
pin(reference: Reference | string, options?: BeeRequestOptions): Promise<void>;
|
|
259
247
|
/**
|
|
260
248
|
* Unpin local data with given reference
|
|
261
249
|
*
|
|
262
|
-
* **Warning! Not allowed when node is in Gateway mode!**
|
|
263
|
-
*
|
|
264
250
|
* @param reference Data reference
|
|
265
251
|
* @param options Options that affects the request behavior
|
|
266
252
|
* @throws TypeError if reference is in not correct format
|
|
267
253
|
*
|
|
268
254
|
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/access-the-swarm/pinning)
|
|
269
255
|
*/
|
|
270
|
-
unpin(reference: Reference | string, options?:
|
|
256
|
+
unpin(reference: Reference | string, options?: BeeRequestOptions): Promise<void>;
|
|
271
257
|
/**
|
|
272
258
|
* Get list of all locally pinned references
|
|
273
259
|
*
|
|
274
|
-
* **Warning! Not allowed when node is in Gateway mode!**
|
|
275
|
-
*
|
|
276
260
|
* @param options Options that affects the request behavior
|
|
277
261
|
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/access-the-swarm/pinning)
|
|
278
262
|
*/
|
|
279
|
-
getAllPins(options?:
|
|
263
|
+
getAllPins(options?: BeeRequestOptions): Promise<Reference[]>;
|
|
280
264
|
/**
|
|
281
265
|
* Get pinning status of chunk with given reference
|
|
282
266
|
*
|
|
283
|
-
* **Warning! Not allowed when node is in Gateway mode!**
|
|
284
|
-
*
|
|
285
267
|
* @param reference Bee data reference in hex string (either 64 or 128 chars long) or ENS domain.
|
|
286
268
|
* @param options Options that affects the request behavior
|
|
287
269
|
* @throws TypeError if some of the input parameters is not expected type
|
|
@@ -289,7 +271,7 @@ export declare class Bee {
|
|
|
289
271
|
*
|
|
290
272
|
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/access-the-swarm/pinning)
|
|
291
273
|
*/
|
|
292
|
-
getPin(reference: Reference | string, options?:
|
|
274
|
+
getPin(reference: Reference | string, options?: BeeRequestOptions): Promise<Pin>;
|
|
293
275
|
/**
|
|
294
276
|
* Instructs the Bee node to reupload a locally pinned data into the network.
|
|
295
277
|
*
|
|
@@ -301,7 +283,7 @@ export declare class Bee {
|
|
|
301
283
|
*
|
|
302
284
|
* @see [Bee API reference - `PUT /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/put)
|
|
303
285
|
*/
|
|
304
|
-
reuploadPinnedData(reference: ReferenceOrEns | string, options?:
|
|
286
|
+
reuploadPinnedData(reference: ReferenceOrEns | string, options?: BeeRequestOptions): Promise<void>;
|
|
305
287
|
/**
|
|
306
288
|
* Checks if content specified by reference is retrievable from the network.
|
|
307
289
|
*
|
|
@@ -312,7 +294,7 @@ export declare class Bee {
|
|
|
312
294
|
*
|
|
313
295
|
* @see [Bee API reference - `GET /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/get)
|
|
314
296
|
*/
|
|
315
|
-
isReferenceRetrievable(reference: ReferenceOrEns | string, options?:
|
|
297
|
+
isReferenceRetrievable(reference: ReferenceOrEns | string, options?: BeeRequestOptions): Promise<boolean>;
|
|
316
298
|
/**
|
|
317
299
|
* Functions that validates if feed is retrievable in the network.
|
|
318
300
|
*
|
|
@@ -328,7 +310,7 @@ export declare class Bee {
|
|
|
328
310
|
* @param index
|
|
329
311
|
* @param options
|
|
330
312
|
*/
|
|
331
|
-
isFeedRetrievable(type: FeedType, owner: EthAddress | Uint8Array | string, topic: Topic | Uint8Array | string, index?: Index | number | IndexBytes | string, options?:
|
|
313
|
+
isFeedRetrievable(type: FeedType, owner: EthAddress | Uint8Array | string, topic: Topic | Uint8Array | string, index?: Index | number | IndexBytes | string, options?: BeeRequestOptions): Promise<boolean>;
|
|
332
314
|
/**
|
|
333
315
|
* Send data to recipient or target with Postal Service for Swarm.
|
|
334
316
|
*
|
|
@@ -337,8 +319,6 @@ export declare class Bee {
|
|
|
337
319
|
* most likely for setting up an encrypted communication
|
|
338
320
|
* channel by sending an one-off message.
|
|
339
321
|
*
|
|
340
|
-
* **Warning! Not allowed when node is in Gateway mode!**
|
|
341
|
-
*
|
|
342
322
|
* **Warning! If the recipient Bee node is a light node, then he will never receive the message!**
|
|
343
323
|
* This is because light nodes does not fully participate in the data exchange in Swarm network and hence the message won't arrive to them.
|
|
344
324
|
*
|
|
@@ -353,12 +333,10 @@ export declare class Bee {
|
|
|
353
333
|
* @see [Bee docs - PSS](https://docs.ethswarm.org/docs/dapps-on-swarm/pss)
|
|
354
334
|
* @see [Bee API reference - `POST /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1send~1{topic}~1{targets}/post)
|
|
355
335
|
*/
|
|
356
|
-
pssSend(postageBatchId: string | BatchId, topic: string, target: AddressPrefix, data: string | Uint8Array, recipient?: string | PublicKey, options?:
|
|
336
|
+
pssSend(postageBatchId: string | BatchId, topic: string, target: AddressPrefix, data: string | Uint8Array, recipient?: string | PublicKey, options?: BeeRequestOptions): Promise<void>;
|
|
357
337
|
/**
|
|
358
338
|
* Subscribe to messages for given topic with Postal Service for Swarm
|
|
359
339
|
*
|
|
360
|
-
* **Warning! Not allowed when node is in Gateway mode!**
|
|
361
|
-
*
|
|
362
340
|
* **Warning! If connected Bee node is a light node, then he will never receive any message!**
|
|
363
341
|
* This is because light nodes does not fully participate in the data exchange in Swarm network and hence the message won't arrive to them.
|
|
364
342
|
*
|
|
@@ -384,8 +362,6 @@ export declare class Bee {
|
|
|
384
362
|
* timeout can be provided for the message to arrive or else
|
|
385
363
|
* an error will be thrown.
|
|
386
364
|
*
|
|
387
|
-
* **Warning! Not allowed when node is in Gateway mode!**
|
|
388
|
-
*
|
|
389
365
|
* **Warning! If connected Bee node is a light node, then he will never receive any message!**
|
|
390
366
|
* This is because light nodes does not fully participate in the data exchange in Swarm network and hence the message won't arrive to them.
|
|
391
367
|
*
|
|
@@ -412,7 +388,7 @@ export declare class Bee {
|
|
|
412
388
|
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/dapps-on-swarm/feeds)
|
|
413
389
|
* @see [Bee API reference - `POST /feeds`](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post)
|
|
414
390
|
*/
|
|
415
|
-
createFeedManifest(postageBatchId: string | BatchId, type: FeedType, topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, options?:
|
|
391
|
+
createFeedManifest(postageBatchId: string | BatchId, type: FeedType, topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, options?: BeeRequestOptions): Promise<FeedManifestResult>;
|
|
416
392
|
/**
|
|
417
393
|
* Make a new feed reader for downloading feed updates.
|
|
418
394
|
*
|
|
@@ -423,7 +399,7 @@ export declare class Bee {
|
|
|
423
399
|
*
|
|
424
400
|
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/dapps-on-swarm/feeds)
|
|
425
401
|
*/
|
|
426
|
-
makeFeedReader(type: FeedType, topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, options?:
|
|
402
|
+
makeFeedReader(type: FeedType, topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, options?: BeeRequestOptions): FeedReader;
|
|
427
403
|
/**
|
|
428
404
|
* Make a new feed writer for updating feeds
|
|
429
405
|
*
|
|
@@ -434,7 +410,7 @@ export declare class Bee {
|
|
|
434
410
|
*
|
|
435
411
|
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/dapps-on-swarm/feeds)
|
|
436
412
|
*/
|
|
437
|
-
makeFeedWriter(type: FeedType, topic: Topic | Uint8Array | string, signer?: Signer | Uint8Array | string, options?:
|
|
413
|
+
makeFeedWriter(type: FeedType, topic: Topic | Uint8Array | string, signer?: Signer | Uint8Array | string, options?: BeeRequestOptions): FeedWriter;
|
|
438
414
|
/**
|
|
439
415
|
* High-level function that allows you to easily set JSON data to feed.
|
|
440
416
|
* JSON-like data types are supported.
|
|
@@ -453,7 +429,7 @@ export declare class Bee {
|
|
|
453
429
|
*
|
|
454
430
|
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/dapps-on-swarm/feeds)
|
|
455
431
|
*/
|
|
456
|
-
setJsonFeed<T extends AnyJson>(postageBatchId: string | BatchId, topic: string, data: T, options?: JsonFeedOptions): Promise<Reference>;
|
|
432
|
+
setJsonFeed<T extends AnyJson>(postageBatchId: string | BatchId, topic: string, data: T, options?: JsonFeedOptions, requestOptions?: BeeRequestOptions): Promise<Reference>;
|
|
457
433
|
/**
|
|
458
434
|
* High-level function that allows you to easily get data from feed.
|
|
459
435
|
* Returned data are parsed using JSON.parse().
|
|
@@ -490,7 +466,7 @@ export declare class Bee {
|
|
|
490
466
|
* @param options Options that affects the request behavior
|
|
491
467
|
* @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/dapps-on-swarm/chunk-types#single-owner-chunks)
|
|
492
468
|
*/
|
|
493
|
-
makeSOCReader(ownerAddress: EthAddress | Uint8Array | string, options?:
|
|
469
|
+
makeSOCReader(ownerAddress: EthAddress | Uint8Array | string, options?: BeeRequestOptions): SOCReader;
|
|
494
470
|
/**
|
|
495
471
|
* Returns an object for reading and writing single owner chunks
|
|
496
472
|
*
|
|
@@ -498,26 +474,26 @@ export declare class Bee {
|
|
|
498
474
|
* @param options Options that affects the request behavior
|
|
499
475
|
* @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/dapps-on-swarm/chunk-types#single-owner-chunks)
|
|
500
476
|
*/
|
|
501
|
-
makeSOCWriter(signer?: Signer | Uint8Array | string, options?:
|
|
477
|
+
makeSOCWriter(signer?: Signer | Uint8Array | string, options?: BeeRequestOptions): SOCWriter;
|
|
502
478
|
/**
|
|
503
479
|
* Ping the Bee node to see if there is a live Bee node on the given URL.
|
|
504
480
|
*
|
|
505
481
|
* @param options Options that affects the request behavior
|
|
506
482
|
* @throws If connection was not successful throw error
|
|
507
483
|
*/
|
|
508
|
-
checkConnection(options?:
|
|
484
|
+
checkConnection(options?: BeeRequestOptions): Promise<void> | never;
|
|
509
485
|
/**
|
|
510
486
|
* Ping the Bee node to see if there is a live Bee node on the given URL.
|
|
511
487
|
*
|
|
512
488
|
* @param options Options that affects the request behavior
|
|
513
489
|
* @returns true if successful, false on error
|
|
514
490
|
*/
|
|
515
|
-
isConnected(options?:
|
|
491
|
+
isConnected(options?: BeeRequestOptions): Promise<boolean>;
|
|
516
492
|
/**
|
|
517
493
|
* @param signer
|
|
518
494
|
* @private
|
|
519
495
|
* @throws BeeError if either no Signer was passed or no default Signer was specified for the instance
|
|
520
496
|
*/
|
|
521
497
|
private resolveSigner;
|
|
522
|
-
private
|
|
498
|
+
private getRequestOptionsForCall;
|
|
523
499
|
}
|
|
@@ -17,7 +17,7 @@ export interface Chunk {
|
|
|
17
17
|
payload(): FlexBytes<1, 4096>;
|
|
18
18
|
address(): PlainBytesReference;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
type ValidChunkData = BrandedType<Uint8Array, 'ValidChunkData'>;
|
|
21
21
|
/**
|
|
22
22
|
* Creates a content addressed chunk and verifies the payload size.
|
|
23
23
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { BatchId, BeeRequestOptions, PlainBytesReference, Reference, Signature, Signer, UploadOptions } from '../types';
|
|
2
|
+
import { Bytes } from '../utils/bytes';
|
|
3
3
|
import { EthAddress } from '../utils/eth';
|
|
4
|
-
import
|
|
5
|
-
export
|
|
4
|
+
import { Chunk } from './cac';
|
|
5
|
+
export type Identifier = Bytes<32>;
|
|
6
6
|
/**
|
|
7
7
|
* With single owner chunks, a user can assign arbitrary data to an
|
|
8
8
|
* address and attest chunk integrity with their digital signature.
|
|
@@ -39,23 +39,23 @@ export declare function makeSingleOwnerChunk(chunk: Chunk, identifier: Identifie
|
|
|
39
39
|
*
|
|
40
40
|
* It uses the Chunk API and calculates the address before uploading.
|
|
41
41
|
*
|
|
42
|
-
* @param
|
|
42
|
+
* @param kyOptions Ky Options for making requests
|
|
43
43
|
* @param chunk A chunk object
|
|
44
44
|
* @param postageBatchId Postage BatchId that will be assigned to uploaded data
|
|
45
45
|
* @param options Upload options
|
|
46
46
|
*/
|
|
47
|
-
export declare function uploadSingleOwnerChunk(
|
|
47
|
+
export declare function uploadSingleOwnerChunk(requestOptions: BeeRequestOptions, chunk: SingleOwnerChunk, postageBatchId: BatchId, options?: UploadOptions): Promise<Reference>;
|
|
48
48
|
/**
|
|
49
49
|
* Helper function to create and upload SOC.
|
|
50
50
|
*
|
|
51
|
-
* @param
|
|
51
|
+
* @param kyOptions Ky Options for making requests
|
|
52
52
|
* @param signer The singer interface for signing the chunk
|
|
53
53
|
* @param postageBatchId
|
|
54
54
|
* @param identifier The identifier of the chunk
|
|
55
55
|
* @param data The chunk data
|
|
56
56
|
* @param options
|
|
57
57
|
*/
|
|
58
|
-
export declare function uploadSingleOwnerChunkData(
|
|
58
|
+
export declare function uploadSingleOwnerChunkData(requestOptions: BeeRequestOptions, signer: Signer, postageBatchId: BatchId | string, identifier: Identifier, data: Uint8Array, options?: UploadOptions): Promise<Reference>;
|
|
59
59
|
/**
|
|
60
60
|
* Helper function to download SOC.
|
|
61
61
|
*
|
|
@@ -63,4 +63,4 @@ export declare function uploadSingleOwnerChunkData(ky: Ky, signer: Signer, posta
|
|
|
63
63
|
* @param ownerAddress The singer interface for signing the chunk
|
|
64
64
|
* @param identifier The identifier of the chunk
|
|
65
65
|
*/
|
|
66
|
-
export declare function downloadSingleOwnerChunk(
|
|
66
|
+
export declare function downloadSingleOwnerChunk(requestOptions: BeeRequestOptions, ownerAddress: EthAddress, identifier: Identifier): Promise<SingleOwnerChunk>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FeedUpdateOptions } from '../modules/feed';
|
|
2
|
-
import { BatchId,
|
|
3
|
-
import {
|
|
2
|
+
import { BatchId, BeeRequestOptions, BytesReference, FeedReader, FeedWriter, FEED_INDEX_HEX_LENGTH, PlainBytesReference, Reference, Signer, Topic, UploadOptions } from '../types';
|
|
3
|
+
import { Bytes } from '../utils/bytes';
|
|
4
4
|
import { EthAddress, HexEthAddress } from '../utils/eth';
|
|
5
|
-
import
|
|
5
|
+
import { HexString } from '../utils/hex';
|
|
6
6
|
import type { FeedType } from './type';
|
|
7
7
|
export interface Epoch {
|
|
8
8
|
time: number;
|
|
@@ -12,17 +12,17 @@ export interface Epoch {
|
|
|
12
12
|
* Bytes of Feed's Index.
|
|
13
13
|
* For Sequential Feeds this is numeric value in big-endian.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
16
|
-
export
|
|
15
|
+
export type IndexBytes = Bytes<8>;
|
|
16
|
+
export type Index = number | Epoch | IndexBytes | string;
|
|
17
17
|
export interface FeedUploadOptions extends UploadOptions, FeedUpdateOptions {
|
|
18
18
|
}
|
|
19
19
|
export interface FeedUpdate {
|
|
20
20
|
timestamp: number;
|
|
21
21
|
reference: BytesReference;
|
|
22
22
|
}
|
|
23
|
-
export declare function findNextIndex(
|
|
24
|
-
export declare function updateFeed(
|
|
23
|
+
export declare function findNextIndex(requestOptions: BeeRequestOptions, owner: HexEthAddress, topic: Topic, options?: FeedUpdateOptions): Promise<HexString<typeof FEED_INDEX_HEX_LENGTH>>;
|
|
24
|
+
export declare function updateFeed(requestOptions: BeeRequestOptions, signer: Signer, topic: Topic, reference: BytesReference, postageBatchId: BatchId, options?: FeedUploadOptions, index?: Index): Promise<Reference>;
|
|
25
25
|
export declare function getFeedUpdateChunkReference(owner: EthAddress, topic: Topic, index: Index): PlainBytesReference;
|
|
26
|
-
export declare function downloadFeedUpdate(
|
|
27
|
-
export declare function makeFeedReader(
|
|
28
|
-
export declare function makeFeedWriter(
|
|
26
|
+
export declare function downloadFeedUpdate(requestOptions: BeeRequestOptions, owner: EthAddress, topic: Topic, index: Index): Promise<FeedUpdate>;
|
|
27
|
+
export declare function makeFeedReader(requestOptions: BeeRequestOptions, type: FeedType, topic: Topic, owner: HexEthAddress): FeedReader;
|
|
28
|
+
export declare function makeFeedWriter(requestOptions: BeeRequestOptions, type: FeedType, topic: Topic, signer: Signer): FeedWriter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FeedWriter, FeedReader, AnyJson, BatchId, Reference, RequestOptions } from '../types';
|
|
2
1
|
import { Bee } from '../bee';
|
|
2
|
+
import { AnyJson, BatchId, BeeRequestOptions, FeedReader, FeedWriter, JsonFeedOptions, Reference, UploadOptions } from '../types';
|
|
3
3
|
export declare function getJsonData<T extends AnyJson>(bee: Bee, reader: FeedReader): Promise<T>;
|
|
4
|
-
export declare function setJsonData(bee: Bee, writer: FeedWriter, postageBatchId: BatchId, data: AnyJson, options?:
|
|
4
|
+
export declare function setJsonData(bee: Bee, writer: FeedWriter, postageBatchId: BatchId, data: AnyJson, options?: JsonFeedOptions & UploadOptions, requestOptions?: BeeRequestOptions): Promise<Reference>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Bee } from '../bee';
|
|
2
|
+
import { BeeRequestOptions, Topic } from '../types';
|
|
2
3
|
import { EthAddress } from '../utils/eth';
|
|
3
|
-
import { RequestOptions, Topic } from '../types';
|
|
4
4
|
import { Index } from './index';
|
|
5
|
-
export declare function areAllSequentialFeedsUpdateRetrievable(bee: Bee, owner: EthAddress, topic: Topic, index: Index,
|
|
5
|
+
export declare function areAllSequentialFeedsUpdateRetrievable(bee: Bee, owner: EthAddress, topic: Topic, index: Index, requestOptions: BeeRequestOptions): Promise<boolean>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const feedTypes: readonly ["sequence", "epoch"];
|
|
2
|
-
export
|
|
2
|
+
export type FeedType = typeof feedTypes[number];
|
|
3
3
|
export declare const DEFAULT_FEED_TYPE: FeedType;
|
|
4
4
|
export declare function isFeedType(type: unknown): type is FeedType;
|
|
5
5
|
export declare function assertFeedType(type: unknown): asserts type is FeedType;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { Bee } from './bee';
|
|
2
2
|
import { BeeDebug } from './bee-debug';
|
|
3
|
-
export
|
|
3
|
+
export { SUPPORTED_BEE_VERSION, SUPPORTED_BEE_VERSION_EXACT } from './modules/debug/status';
|
|
4
4
|
export * from './types';
|
|
5
5
|
export * from './utils/error';
|
|
6
|
-
export
|
|
6
|
+
export * as Utils from './utils/expose';
|
|
7
7
|
export { Bee, BeeDebug };
|
|
8
|
+
declare global {
|
|
9
|
+
interface Window {
|
|
10
|
+
BeeJs: {
|
|
11
|
+
Bee: typeof import('./bee').Bee;
|
|
12
|
+
BeeDebug: typeof import('./bee-debug').BeeDebug;
|
|
13
|
+
Utils: typeof import('./utils/expose');
|
|
14
|
+
BeeError: typeof import('./utils/error').BeeError;
|
|
15
|
+
BeeArgumentError: typeof import('./utils/error').BeeArgumentError;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import type { BatchId,
|
|
1
|
+
import type { BatchId, BeeRequestOptions, Data, ReferenceOrEns, UploadOptions } from '../types';
|
|
2
2
|
import { UploadResult } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Upload data to a Bee node
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param kyOptions Ky Options for making requests
|
|
7
7
|
* @param data Data to be uploaded
|
|
8
8
|
* @param postageBatchId Postage BatchId that will be assigned to uploaded data
|
|
9
9
|
* @param options Additional options like tag, encryption, pinning
|
|
10
10
|
*/
|
|
11
|
-
export declare function upload(
|
|
11
|
+
export declare function upload(requestOptions: BeeRequestOptions, data: string | Uint8Array, postageBatchId: BatchId, options?: UploadOptions): Promise<UploadResult>;
|
|
12
12
|
/**
|
|
13
13
|
* Download data as a byte array
|
|
14
14
|
*
|
|
15
15
|
* @param ky
|
|
16
16
|
* @param hash Bee content reference
|
|
17
17
|
*/
|
|
18
|
-
export declare function download(
|
|
18
|
+
export declare function download(requestOptions: BeeRequestOptions, hash: ReferenceOrEns): Promise<Data>;
|
|
19
19
|
/**
|
|
20
20
|
* Download data as a readable stream
|
|
21
21
|
*
|
|
22
22
|
* @param ky
|
|
23
23
|
* @param hash Bee content reference
|
|
24
24
|
*/
|
|
25
|
-
export declare function downloadReadable(
|
|
25
|
+
export declare function downloadReadable(requestOptions: BeeRequestOptions, hash: ReferenceOrEns): Promise<ReadableStream<Uint8Array>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BatchId, BeeRequestOptions, Collection, CollectionUploadOptions, Data, FileData, FileUploadOptions, Readable, ReferenceOrEns, UploadResult } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Upload single file
|
|
4
4
|
*
|
|
@@ -8,28 +8,28 @@ import type { BatchId, Collection, CollectionUploadOptions, Data, FileData, File
|
|
|
8
8
|
* @param name Name that will be attached to the uploaded file. Wraps the data into manifest with set index document.
|
|
9
9
|
* @param options
|
|
10
10
|
*/
|
|
11
|
-
export declare function uploadFile(
|
|
11
|
+
export declare function uploadFile(requestOptions: BeeRequestOptions, data: string | Uint8Array | Readable | ArrayBuffer, postageBatchId: BatchId, name?: string, options?: FileUploadOptions): Promise<UploadResult>;
|
|
12
12
|
/**
|
|
13
13
|
* Download single file as a buffer
|
|
14
14
|
*
|
|
15
|
-
* @param
|
|
15
|
+
* @param kyOptions Ky Options for making requests
|
|
16
16
|
* @param hash Bee file or collection hash
|
|
17
17
|
* @param path If hash is collection then this defines path to a single file in the collection
|
|
18
18
|
*/
|
|
19
|
-
export declare function downloadFile(
|
|
19
|
+
export declare function downloadFile(requestOptions: BeeRequestOptions, hash: ReferenceOrEns, path?: string): Promise<FileData<Data>>;
|
|
20
20
|
/**
|
|
21
21
|
* Download single file as a readable stream
|
|
22
22
|
*
|
|
23
|
-
* @param
|
|
23
|
+
* @param kyOptions Ky Options for making requests
|
|
24
24
|
* @param hash Bee file or collection hash
|
|
25
25
|
* @param path If hash is collection then this defines path to a single file in the collection
|
|
26
26
|
*/
|
|
27
|
-
export declare function downloadFileReadable(
|
|
27
|
+
export declare function downloadFileReadable(requestOptions: BeeRequestOptions, hash: ReferenceOrEns, path?: string): Promise<FileData<ReadableStream<Uint8Array>>>;
|
|
28
28
|
/**
|
|
29
29
|
* Upload collection
|
|
30
|
-
* @param
|
|
30
|
+
* @param kyOptions Ky Options for making requests
|
|
31
31
|
* @param collection Collection of Uint8Array buffers to upload
|
|
32
32
|
* @param postageBatchId Postage BatchId that will be assigned to uploaded data
|
|
33
33
|
* @param options
|
|
34
34
|
*/
|
|
35
|
-
export declare function uploadCollection(
|
|
35
|
+
export declare function uploadCollection(requestOptions: BeeRequestOptions, collection: Collection<Uint8Array>, postageBatchId: BatchId, options?: CollectionUploadOptions): Promise<UploadResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BatchId,
|
|
1
|
+
import type { BatchId, BeeRequestOptions, Data, Reference, ReferenceOrEns, UploadOptions } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Upload chunk to a Bee node
|
|
4
4
|
*
|
|
@@ -11,12 +11,12 @@ import type { BatchId, Data, Ky, Reference, ReferenceOrEns, UploadOptions } from
|
|
|
11
11
|
* @param postageBatchId Postage BatchId that will be assigned to uploaded data
|
|
12
12
|
* @param options Additional options like tag, encryption, pinning
|
|
13
13
|
*/
|
|
14
|
-
export declare function upload(
|
|
14
|
+
export declare function upload(requestOptions: BeeRequestOptions, data: Uint8Array, postageBatchId: BatchId, options?: UploadOptions): Promise<Reference>;
|
|
15
15
|
/**
|
|
16
16
|
* Download chunk data as a byte array
|
|
17
17
|
*
|
|
18
|
-
* @param
|
|
18
|
+
* @param kyOptions Ky Options for making requests
|
|
19
19
|
* @param hash Bee content reference
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
|
-
export declare function download(
|
|
22
|
+
export declare function download(requestOptions: BeeRequestOptions, hash: ReferenceOrEns): Promise<Data>;
|