@upcoming/bee-js 0.3.0 → 0.5.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.
Files changed (62) hide show
  1. package/dist/cjs/bee-dev.js +78 -0
  2. package/dist/cjs/bee.js +69 -113
  3. package/dist/cjs/feed/retrievable.js +4 -4
  4. package/dist/cjs/index.js +3 -1
  5. package/dist/cjs/modules/bytes.js +12 -4
  6. package/dist/cjs/modules/bzz.js +12 -27
  7. package/dist/cjs/modules/chunk.js +6 -3
  8. package/dist/cjs/modules/debug/connectivity.js +2 -1
  9. package/dist/cjs/modules/feed.js +1 -1
  10. package/dist/cjs/modules/grantee.js +9 -8
  11. package/dist/cjs/modules/pss.js +1 -1
  12. package/dist/cjs/modules/soc.js +4 -2
  13. package/dist/cjs/utils/collection.js +1 -1
  14. package/dist/cjs/utils/collection.node.js +0 -1
  15. package/dist/cjs/utils/expose.js +2 -1
  16. package/dist/cjs/utils/headers.js +61 -54
  17. package/dist/cjs/utils/http.js +9 -0
  18. package/dist/cjs/utils/tar-uploader.browser.js +2 -2
  19. package/dist/cjs/utils/tar-uploader.js +2 -2
  20. package/dist/cjs/utils/type.js +119 -191
  21. package/dist/index.browser.min.js +1 -1
  22. package/dist/index.browser.min.js.map +1 -1
  23. package/dist/mjs/bee-dev.js +98 -0
  24. package/dist/mjs/bee.js +75 -117
  25. package/dist/mjs/feed/retrievable.js +4 -4
  26. package/dist/mjs/index.js +2 -1
  27. package/dist/mjs/modules/bytes.js +13 -7
  28. package/dist/mjs/modules/bzz.js +9 -25
  29. package/dist/mjs/modules/chunk.js +7 -6
  30. package/dist/mjs/modules/debug/connectivity.js +1 -1
  31. package/dist/mjs/modules/feed.js +2 -2
  32. package/dist/mjs/modules/grantee.js +12 -11
  33. package/dist/mjs/modules/pss.js +2 -2
  34. package/dist/mjs/modules/soc.js +4 -4
  35. package/dist/mjs/utils/collection.js +1 -1
  36. package/dist/mjs/utils/collection.node.js +0 -1
  37. package/dist/mjs/utils/expose.js +1 -1
  38. package/dist/mjs/utils/headers.js +59 -50
  39. package/dist/mjs/utils/http.js +9 -0
  40. package/dist/mjs/utils/tar-uploader.browser.js +2 -2
  41. package/dist/mjs/utils/tar-uploader.js +2 -2
  42. package/dist/mjs/utils/type.js +202 -163
  43. package/dist/types/bee-dev.d.ts +5 -0
  44. package/dist/types/bee.d.ts +21 -21
  45. package/dist/types/feed/retrievable.d.ts +2 -2
  46. package/dist/types/index.d.ts +3 -1
  47. package/dist/types/modules/bytes.d.ts +4 -4
  48. package/dist/types/modules/bzz.d.ts +5 -10
  49. package/dist/types/modules/chunk.d.ts +2 -2
  50. package/dist/types/modules/debug/chequebook.d.ts +2 -2
  51. package/dist/types/modules/debug/connectivity.d.ts +2 -1
  52. package/dist/types/modules/grantee.d.ts +4 -4
  53. package/dist/types/types/debug.d.ts +0 -1
  54. package/dist/types/types/index.d.ts +12 -6
  55. package/dist/types/utils/collection.d.ts +1 -1
  56. package/dist/types/utils/collection.node.d.ts +0 -1
  57. package/dist/types/utils/expose.d.ts +1 -1
  58. package/dist/types/utils/headers.d.ts +2 -4
  59. package/dist/types/utils/tar-uploader.browser.d.ts +2 -2
  60. package/dist/types/utils/tar-uploader.d.ts +2 -2
  61. package/dist/types/utils/type.d.ts +12 -18
  62. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import type { BeeRequestOptions, DownloadRedundancyOptions, ReferenceInformation, UploadOptions, UploadRedundancyOptions } from '../types';
1
+ import type { BeeRequestOptions, DownloadOptions, RedundantUploadOptions, ReferenceInformation } from '../types';
2
2
  import { UploadResult } from '../types';
3
3
  import { Bytes } from '../utils/bytes';
4
4
  import { BatchId, Reference } from '../utils/typed-bytes';
@@ -10,7 +10,7 @@ import { BatchId, Reference } from '../utils/typed-bytes';
10
10
  * @param postageBatchId Postage BatchId that will be assigned to uploaded data
11
11
  * @param options Additional options like tag, encryption, pinning
12
12
  */
13
- export declare function upload(requestOptions: BeeRequestOptions, data: string | Uint8Array, postageBatchId: BatchId, options?: UploadOptions & UploadRedundancyOptions): Promise<UploadResult>;
13
+ export declare function upload(requestOptions: BeeRequestOptions, data: string | Uint8Array, postageBatchId: BatchId, options?: RedundantUploadOptions): Promise<UploadResult>;
14
14
  /**
15
15
  * Requests content length for a reference
16
16
  *
@@ -24,11 +24,11 @@ export declare function head(requestOptions: BeeRequestOptions, reference: Refer
24
24
  * @param requestOptions Options for making requests
25
25
  * @param hash Bee content reference
26
26
  */
27
- export declare function download(requestOptions: BeeRequestOptions, reference: Reference | Uint8Array | string, options?: DownloadRedundancyOptions): Promise<Bytes>;
27
+ export declare function download(requestOptions: BeeRequestOptions, reference: Reference | Uint8Array | string, options?: DownloadOptions): Promise<Bytes>;
28
28
  /**
29
29
  * Download data as a readable stream
30
30
  *
31
31
  * @param requestOptions Options for making requests
32
32
  * @param hash Bee content reference
33
33
  */
34
- export declare function downloadReadable(requestOptions: BeeRequestOptions, reference: Reference | Uint8Array | string, options?: DownloadRedundancyOptions): Promise<ReadableStream<Uint8Array>>;
34
+ export declare function downloadReadable(requestOptions: BeeRequestOptions, reference: Reference | Uint8Array | string, options?: DownloadOptions): Promise<ReadableStream<Uint8Array>>;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Readable } from 'stream';
3
- import { BeeRequestOptions, Collection, CollectionUploadOptions, DownloadRedundancyOptions, FileData, FileUploadOptions, UploadHeaders, UploadRedundancyOptions, UploadResult } from '../types';
3
+ import { BeeRequestOptions, Collection, CollectionUploadOptions, DownloadOptions, FileData, FileUploadOptions, UploadResult } from '../types';
4
4
  import { Bytes } from '../utils/bytes';
5
5
  import { BatchId, Reference } from '../utils/typed-bytes';
6
6
  /**
@@ -12,7 +12,7 @@ import { BatchId, Reference } from '../utils/typed-bytes';
12
12
  * @param name Name that will be attached to the uploaded file. Wraps the data into manifest with set index document.
13
13
  * @param options
14
14
  */
15
- export declare function uploadFile(requestOptions: BeeRequestOptions, data: string | Uint8Array | Readable | ArrayBuffer, postageBatchId: BatchId, name?: string, options?: FileUploadOptions & UploadRedundancyOptions): Promise<UploadResult>;
15
+ export declare function uploadFile(requestOptions: BeeRequestOptions, data: string | Uint8Array | Readable | ArrayBuffer, postageBatchId: BatchId, name?: string, options?: FileUploadOptions): Promise<UploadResult>;
16
16
  /**
17
17
  * Download single file as a buffer
18
18
  *
@@ -20,7 +20,7 @@ export declare function uploadFile(requestOptions: BeeRequestOptions, data: stri
20
20
  * @param hash Bee file or collection hash
21
21
  * @param path If hash is collection then this defines path to a single file in the collection
22
22
  */
23
- export declare function downloadFile(requestOptions: BeeRequestOptions, reference: Reference | string | Uint8Array, path?: string, options?: DownloadRedundancyOptions): Promise<FileData<Bytes>>;
23
+ export declare function downloadFile(requestOptions: BeeRequestOptions, reference: Reference | string | Uint8Array, path?: string, options?: DownloadOptions): Promise<FileData<Bytes>>;
24
24
  /**
25
25
  * Download single file as a readable stream
26
26
  *
@@ -28,13 +28,8 @@ export declare function downloadFile(requestOptions: BeeRequestOptions, referenc
28
28
  * @param hash Bee file or collection hash
29
29
  * @param path If hash is collection then this defines path to a single file in the collection
30
30
  */
31
- export declare function downloadFileReadable(requestOptions: BeeRequestOptions, reference: Reference, path?: string, options?: DownloadRedundancyOptions): Promise<FileData<ReadableStream<Uint8Array>>>;
31
+ export declare function downloadFileReadable(requestOptions: BeeRequestOptions, reference: Reference, path?: string, options?: DownloadOptions): Promise<FileData<ReadableStream<Uint8Array>>>;
32
32
  /*******************************************************************************************************************/
33
- export interface CollectionUploadHeaders extends UploadHeaders {
34
- 'swarm-index-document'?: string;
35
- 'swarm-error-document'?: string;
36
- }
37
- export declare function extractCollectionUploadHeaders(postageBatchId: BatchId, options?: CollectionUploadOptions & UploadRedundancyOptions): CollectionUploadHeaders & UploadRedundancyOptions;
38
33
  /**
39
34
  * Upload collection
40
35
  * @param requestOptions Options for making requests
@@ -42,4 +37,4 @@ export declare function extractCollectionUploadHeaders(postageBatchId: BatchId,
42
37
  * @param postageBatchId Postage BatchId that will be assigned to uploaded data
43
38
  * @param options
44
39
  */
45
- export declare function uploadCollection(requestOptions: BeeRequestOptions, collection: Collection, postageBatchId: BatchId, options?: CollectionUploadOptions & UploadRedundancyOptions): Promise<UploadResult>;
40
+ export declare function uploadCollection(requestOptions: BeeRequestOptions, collection: Collection, postageBatchId: BatchId, options?: CollectionUploadOptions): Promise<UploadResult>;
@@ -1,4 +1,4 @@
1
- import type { BeeRequestOptions, EnvelopeWithBatchId, UploadOptions, UploadResult } from '../types';
1
+ import type { BeeRequestOptions, DownloadOptions, EnvelopeWithBatchId, UploadOptions, UploadResult } from '../types';
2
2
  import { BatchId, Reference } from '../utils/typed-bytes';
3
3
  /**
4
4
  * Upload chunk to a Bee node
@@ -20,4 +20,4 @@ export declare function upload(requestOptions: BeeRequestOptions, data: Uint8Arr
20
20
  * @param hash Bee content reference
21
21
  *
22
22
  */
23
- export declare function download(requestOptions: BeeRequestOptions, reference: Reference | string | Uint8Array): Promise<Uint8Array>;
23
+ export declare function download(requestOptions: BeeRequestOptions, reference: Reference | string | Uint8Array, options?: DownloadOptions): Promise<Uint8Array>;
@@ -1,4 +1,4 @@
1
- import type { BeeRequestOptions, CashoutOptions, ChequebookAddressResponse, ChequebookBalanceResponse, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NumberString } from '../../types';
1
+ import type { BeeRequestOptions, ChequebookAddressResponse, ChequebookBalanceResponse, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NumberString, TransactionOptions } from '../../types';
2
2
  import { PeerAddress, TransactionId } from '../../utils/typed-bytes';
3
3
  /**
4
4
  * Get the address of the chequebook contract used
@@ -26,7 +26,7 @@ export declare function getLastCashoutAction(requestOptions: BeeRequestOptions,
26
26
  * @param peer Swarm address of peer
27
27
  * @param options
28
28
  */
29
- export declare function cashoutLastCheque(requestOptions: BeeRequestOptions, peer: PeerAddress, options?: CashoutOptions): Promise<TransactionId>;
29
+ export declare function cashoutLastCheque(requestOptions: BeeRequestOptions, peer: PeerAddress, options?: TransactionOptions): Promise<TransactionId>;
30
30
  /**
31
31
  * Get last cheques for the peer
32
32
  *
@@ -1,4 +1,4 @@
1
- import type { BeeRequestOptions, NodeAddresses, Peer, PingResponse, RemovePeerResponse, Topology } from '../../types';
1
+ import type { BeeRequestOptions, Bin, NodeAddresses, Peer, PingResponse, RemovePeerResponse, Topology } from '../../types';
2
2
  import { PeerAddress } from '../../utils/typed-bytes';
3
3
  export declare function getNodeAddresses(requestOptions: BeeRequestOptions): Promise<NodeAddresses>;
4
4
  export declare function getPeers(requestOptions: BeeRequestOptions): Promise<Peer[]>;
@@ -6,3 +6,4 @@ export declare function getBlocklist(requestOptions: BeeRequestOptions): Promise
6
6
  export declare function removePeer(requestOptions: BeeRequestOptions, peer: PeerAddress): Promise<RemovePeerResponse>;
7
7
  export declare function getTopology(requestOptions: BeeRequestOptions): Promise<Topology>;
8
8
  export declare function pingPeer(requestOptions: BeeRequestOptions, peer: PeerAddress): Promise<PingResponse>;
9
+ export declare function asBin(value: unknown, name: string): Bin;
@@ -1,8 +1,8 @@
1
1
  import { BeeRequestOptions, GetGranteesResult, GranteesResult } from '../types';
2
- import { BatchId, Reference } from '../utils/typed-bytes';
2
+ import { BatchId, PublicKey, Reference } from '../utils/typed-bytes';
3
3
  export declare function getGrantees(reference: Reference, requestOptions: BeeRequestOptions): Promise<GetGranteesResult>;
4
- export declare function createGrantees(requestOptions: BeeRequestOptions, postageBatchId: BatchId, grantees: string[]): Promise<GranteesResult>;
4
+ export declare function createGrantees(requestOptions: BeeRequestOptions, postageBatchId: BatchId, grantees: PublicKey[]): Promise<GranteesResult>;
5
5
  export declare function patchGrantees(postageBatchId: BatchId, reference: Reference, historyRef: Reference, grantees: {
6
- add?: string[];
7
- revoke?: string[];
6
+ add?: PublicKey[];
7
+ revoke?: PublicKey[];
8
8
  }, requestOptions: BeeRequestOptions): Promise<GranteesResult>;
@@ -39,7 +39,6 @@ export interface TransactionOptions {
39
39
  */
40
40
  gasLimit?: NumberString;
41
41
  }
42
- export type CashoutOptions = TransactionOptions;
43
42
  export interface CashoutResult {
44
43
  recipient: string;
45
44
  lastPayout: BZZ;
@@ -1,9 +1,10 @@
1
+ import { Optional } from 'cafe-utility';
1
2
  import type { SingleOwnerChunk } from '../chunk/soc';
2
3
  import type { FeedUploadOptions } from '../feed';
3
4
  import type { FeedUpdateOptions, FetchFeedUpdateResponse } from '../modules/feed';
4
5
  import { Bytes } from '../utils/bytes';
5
6
  import type { BeeError } from '../utils/error';
6
- import { BatchId, EthAddress, Identifier, PrivateKey, Reference, Topic, TransactionId } from '../utils/typed-bytes';
7
+ import { BatchId, EthAddress, Identifier, PrivateKey, PublicKey, Reference, Topic, TransactionId } from '../utils/typed-bytes';
7
8
  export * from './debug';
8
9
  export declare const SECTION_SIZE = 32;
9
10
  export declare const BRANCHES = 128;
@@ -22,7 +23,7 @@ export declare const TAGS_LIMIT_MAX = 1000;
22
23
  export declare const FEED_INDEX_HEX_LENGTH = 16;
23
24
  export type BeeRequestOptions = {
24
25
  baseURL?: string;
25
- timeout?: number | false;
26
+ timeout?: number;
26
27
  headers?: Record<string, string>;
27
28
  onRequest?: (request: BeeRequest) => void;
28
29
  httpAgent?: unknown;
@@ -44,7 +45,7 @@ export interface GranteesResult {
44
45
  export interface GetGranteesResult {
45
46
  status: number;
46
47
  statusText: string;
47
- data: string[];
48
+ grantees: PublicKey[];
48
49
  }
49
50
  /**
50
51
  * Result of upload calls.
@@ -61,7 +62,7 @@ export interface UploadResult {
61
62
  /**
62
63
  * History address of the uploaded data with ACT.
63
64
  */
64
- historyAddress: string;
65
+ historyAddress: Optional<Reference>;
65
66
  }
66
67
  export interface UploadOptions {
67
68
  /**
@@ -116,7 +117,7 @@ export declare enum RedundancyLevel {
116
117
  INSANE = 3,
117
118
  PARANOID = 4
118
119
  }
119
- export interface UploadRedundancyOptions {
120
+ export interface RedundantUploadOptions extends UploadOptions {
120
121
  redundancyLevel?: RedundancyLevel;
121
122
  }
122
123
  /**
@@ -135,7 +136,7 @@ export declare enum RedundancyStrategy {
135
136
  PROX = 2,
136
137
  RACE = 3
137
138
  }
138
- export interface DownloadRedundancyOptions {
139
+ export interface DownloadOptions {
139
140
  /**
140
141
  * Specify the retrieve strategy on redundant data.
141
142
  */
@@ -148,6 +149,9 @@ export interface DownloadRedundancyOptions {
148
149
  * Specify the timeout for chunk retrieval. The default is 30 seconds.
149
150
  */
150
151
  timeoutMs?: number;
152
+ actPublisher?: PublicKey | Uint8Array | string;
153
+ actHistoryAddress?: Reference | Uint8Array | string;
154
+ actTimestamp?: string | number;
151
155
  }
152
156
  export interface FileUploadOptions extends UploadOptions {
153
157
  /**
@@ -162,6 +166,7 @@ export interface FileUploadOptions extends UploadOptions {
162
166
  * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)
163
167
  */
164
168
  contentType?: string;
169
+ redundancyLevel?: RedundancyLevel;
165
170
  }
166
171
  export interface CollectionUploadOptions extends UploadOptions {
167
172
  /**
@@ -178,6 +183,7 @@ export interface CollectionUploadOptions extends UploadOptions {
178
183
  * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)
179
184
  */
180
185
  errorDocument?: string;
186
+ redundancyLevel?: RedundancyLevel;
181
187
  }
182
188
  export interface UploadHeaders {
183
189
  'swarm-act'?: string;
@@ -2,7 +2,7 @@ import { Collection } from '../types';
2
2
  export declare function isCollection(data: unknown): data is Collection;
3
3
  export declare function assertCollection(data: unknown): asserts data is Collection;
4
4
  export declare function makeFilePath(file: File): string;
5
- export declare function makeCollectionFromFileList(fileList: FileList | File[]): Promise<Collection>;
5
+ export declare function makeCollectionFromFileList(fileList: FileList | File[]): Collection;
6
6
  /**
7
7
  * Calculate cumulative size of files
8
8
  *
@@ -1,7 +1,6 @@
1
1
  import { Collection } from '../types';
2
2
  /**
3
3
  * Creates array in the format of Collection with data loaded from directory on filesystem.
4
- * The function loads all the data into memory!
5
4
  *
6
5
  * @param dir path to the directory
7
6
  */
@@ -1,4 +1,4 @@
1
- export { getCollectionSize } from './collection';
1
+ 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';
@@ -1,6 +1,4 @@
1
- import { DownloadRedundancyOptions, EnvelopeWithBatchId, FileHeaders, UploadOptions, UploadRedundancyOptions } from '../types';
1
+ import { EnvelopeWithBatchId, FileHeaders } from '../types';
2
2
  import { BatchId } from './typed-bytes';
3
3
  export declare function readFileHeaders(headers: Record<string, string>): FileHeaders;
4
- export declare function extractUploadHeaders(stamp: EnvelopeWithBatchId | BatchId | Uint8Array | string, options?: UploadOptions): Record<string, string>;
5
- export declare function extractRedundantUploadHeaders(postageBatchId: BatchId, options?: UploadOptions & UploadRedundancyOptions): Record<string, string>;
6
- export declare function extractDownloadHeaders(options?: DownloadRedundancyOptions): Record<string, string>;
4
+ export declare function prepareRequestHeaders(stamp: BatchId | Uint8Array | string | EnvelopeWithBatchId | null, nullableOptions?: unknown): Record<string, string>;
@@ -1,3 +1,3 @@
1
- import { BeeRequestOptions, Collection, CollectionUploadOptions, UploadRedundancyOptions } from '..';
1
+ import { BeeRequestOptions, Collection, CollectionUploadOptions } from '..';
2
2
  import { BatchId } from './typed-bytes';
3
- export declare function uploadTar(requestOptions: BeeRequestOptions, collection: Collection, postageBatchId: BatchId, options?: CollectionUploadOptions & UploadRedundancyOptions): Promise<import("axios").AxiosResponse<unknown, any>>;
3
+ export declare function uploadTar(requestOptions: BeeRequestOptions, collection: Collection, postageBatchId: BatchId, options?: CollectionUploadOptions): Promise<import("axios").AxiosResponse<unknown, any>>;
@@ -1,3 +1,3 @@
1
- import { BeeRequestOptions, Collection, CollectionUploadOptions, UploadRedundancyOptions } from '..';
1
+ import { BeeRequestOptions, Collection, CollectionUploadOptions } from '..';
2
2
  import { BatchId } from './typed-bytes';
3
- export declare function uploadTar(requestOptions: BeeRequestOptions, collection: Collection, postageBatchId: BatchId, options?: CollectionUploadOptions & UploadRedundancyOptions): Promise<import("axios").AxiosResponse<unknown, any>>;
3
+ export declare function uploadTar(requestOptions: BeeRequestOptions, collection: Collection, postageBatchId: BatchId, options?: CollectionUploadOptions): Promise<import("axios").AxiosResponse<unknown, any>>;
@@ -1,29 +1,23 @@
1
1
  /// <reference types="node" />
2
2
  import * as stream from 'stream';
3
- import { AllTagsOptions, BeeRequestOptions, CashoutOptions, CollectionUploadOptions, FileUploadOptions, GsocMessageHandler, NumberString, PostageBatchOptions, PssMessageHandler, Tag, TransactionOptions, UploadOptions } from '../types';
3
+ import { AllTagsOptions, BeeRequestOptions, CollectionUploadOptions, DownloadOptions, FileUploadOptions, GsocMessageHandler, NumberString, PostageBatchOptions, PssMessageHandler, RedundantUploadOptions, Tag, TransactionOptions, UploadOptions } from '../types';
4
4
  export declare function isReadable(obj: unknown): obj is stream.Readable;
5
5
  export declare function asNumberString(value: unknown, options?: {
6
6
  name?: string;
7
7
  min?: bigint;
8
8
  max?: bigint;
9
9
  }): NumberString;
10
- export declare function isInteger(value: unknown): value is number | NumberString;
11
- export declare function isObject(value: unknown): value is Record<string, unknown>;
12
- export declare function isStrictlyObject(value: unknown): value is Record<string, unknown>;
13
- export declare function assertStrictlyObject(value: unknown, name?: string): asserts value is object;
14
- export declare function assertBoolean(value: unknown, name?: string): asserts value is boolean;
15
- export declare function assertInteger(value: unknown, name?: string): asserts value is number | NumberString;
16
- export declare function assertNonNegativeInteger(value: unknown, name?: string): asserts value is number | NumberString;
17
- export declare function assertRequestOptions(value: unknown, name?: string): asserts value is BeeRequestOptions;
18
- export declare function assertUploadOptions(value: unknown, name?: string): asserts value is UploadOptions;
19
- export declare function assertFileUploadOptions(value: unknown): asserts value is FileUploadOptions;
20
- export declare function assertCollectionUploadOptions(value: unknown): asserts value is CollectionUploadOptions;
10
+ export declare function prepareBeeRequestOptions(value: unknown): BeeRequestOptions;
11
+ export declare function prepareDownloadOptions(value: unknown): DownloadOptions;
12
+ export declare function prepareUploadOptions(value: unknown, name?: string): UploadOptions;
13
+ export declare function prepareRedundantUploadOptions(value: unknown, name?: string): RedundantUploadOptions;
14
+ export declare function prepareFileUploadOptions(value: unknown): FileUploadOptions;
15
+ export declare function prepareCollectionUploadOptions(value: unknown): CollectionUploadOptions;
21
16
  export declare function isTag(value: unknown): value is Tag;
22
- export declare function assertPssMessageHandler(value: unknown): asserts value is PssMessageHandler;
23
- export declare function assertGsocMessageHandler(value: unknown): asserts value is GsocMessageHandler;
24
- export declare function assertPostageBatchOptions(value: unknown): asserts value is PostageBatchOptions;
25
- export declare function assertTransactionOptions(value: unknown, name?: string): asserts value is TransactionOptions;
26
- export declare function assertCashoutOptions(value: unknown): asserts value is CashoutOptions;
17
+ export declare function preparePssMessageHandler(value: unknown): PssMessageHandler;
18
+ export declare function prepareGsocMessageHandler(value: unknown): GsocMessageHandler;
19
+ export declare function preparePostageBatchOptions(value: unknown): PostageBatchOptions;
20
+ export declare function prepareTransactionOptions(value: unknown, name?: string): TransactionOptions;
27
21
  /**
28
22
  * Check whether the given parameter is valid data to upload
29
23
  * @param value
@@ -40,7 +34,7 @@ export declare function assertFileData(value: unknown): asserts value is string
40
34
  * Checks whether optional options for AllTags query are valid
41
35
  * @param options
42
36
  */
43
- export declare function assertAllTagsOptions(entry: unknown): asserts entry is AllTagsOptions;
37
+ export declare function prepareAllTagsOptions(value: unknown): AllTagsOptions;
44
38
  /**
45
39
  * Utility functions that return Tag UID
46
40
  * @param tagUid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upcoming/bee-js",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Javascript client for Bee",
5
5
  "keywords": [
6
6
  "bee",
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "axios": "^0.28.1",
66
- "cafe-utility": "^27.6.0",
66
+ "cafe-utility": "^27.9.1",
67
67
  "isomorphic-ws": "^4.0.1",
68
68
  "semver": "^7.3.5",
69
69
  "ws": "^8.7.0"