@ethersphere/bee-js 4.1.0 → 5.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.
Files changed (202) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/{src/bee-debug.js → bee-debug.js} +8 -4
  3. package/dist/cjs/{src/bee.js → bee.js} +9 -3
  4. package/dist/cjs/{src/chunk → chunk}/bmt.js +0 -0
  5. package/dist/cjs/{src/chunk → chunk}/cac.js +0 -0
  6. package/dist/cjs/{src/chunk → chunk}/serialize.js +0 -0
  7. package/dist/cjs/{src/chunk → chunk}/signer.js +0 -0
  8. package/dist/cjs/{src/chunk → chunk}/soc.js +5 -1
  9. package/dist/cjs/{src/chunk → chunk}/span.js +0 -0
  10. package/dist/cjs/{src/feed → feed}/identifier.js +0 -0
  11. package/dist/cjs/{src/feed → feed}/index.js +5 -1
  12. package/dist/cjs/{src/feed → feed}/json.js +0 -0
  13. package/dist/cjs/{src/feed → feed}/retrievable.js +0 -0
  14. package/dist/cjs/{src/feed → feed}/topic.js +0 -0
  15. package/dist/cjs/{src/feed → feed}/type.js +0 -0
  16. package/dist/cjs/{src/index.js → index.js} +5 -1
  17. package/dist/cjs/{src/modules → modules}/bytes.js +0 -0
  18. package/dist/cjs/{src/modules → modules}/bzz.js +0 -0
  19. package/dist/cjs/{src/modules → modules}/chunk.js +0 -0
  20. package/dist/cjs/{src/modules → modules}/debug/balance.js +0 -0
  21. package/dist/cjs/{src/modules → modules}/debug/chequebook.js +0 -0
  22. package/dist/cjs/{src/modules → modules}/debug/chunk.js +0 -0
  23. package/dist/cjs/{src/modules → modules}/debug/connectivity.js +2 -2
  24. package/dist/cjs/{src/modules → modules}/debug/settlements.js +0 -0
  25. package/dist/cjs/{src/modules → modules}/debug/stamps.js +1 -1
  26. package/dist/cjs/{src/modules → modules}/debug/states.js +0 -0
  27. package/dist/cjs/{src/modules → modules}/debug/status.js +3 -3
  28. package/dist/cjs/{src/modules → modules}/debug/tag.js +0 -0
  29. package/dist/cjs/{src/modules → modules}/debug/transactions.js +0 -0
  30. package/dist/cjs/{src/modules → modules}/feed.js +0 -0
  31. package/dist/cjs/{src/modules → modules}/pinning.js +1 -5
  32. package/dist/cjs/{src/modules → modules}/pss.js +0 -0
  33. package/dist/cjs/{src/modules → modules}/soc.js +0 -0
  34. package/dist/cjs/{src/modules → modules}/status.js +0 -0
  35. package/dist/cjs/{src/modules → modules}/stewardship.js +0 -0
  36. package/dist/cjs/{src/modules → modules}/tag.js +0 -0
  37. package/dist/cjs/{src/types → types}/debug.js +0 -0
  38. package/dist/cjs/{src/types → types}/index.js +5 -1
  39. package/dist/cjs/{src/types → types}/ky-options.js +0 -0
  40. package/dist/cjs/{src/types → types}/ky-universal/common.js +0 -0
  41. package/dist/cjs/{src/types → types}/ky-universal/hooks.js +0 -0
  42. package/dist/cjs/{src/types → types}/ky-universal/retry.js +0 -0
  43. package/dist/cjs/{src/utils → utils}/bytes.js +0 -0
  44. package/dist/cjs/{src/utils → utils}/collection.browser.js +0 -0
  45. package/dist/cjs/{src/utils → utils}/collection.js +0 -0
  46. package/dist/cjs/{src/utils → utils}/collection.node.js +0 -0
  47. package/dist/cjs/{src/utils → utils}/data.browser.js +0 -0
  48. package/dist/cjs/{src/utils → utils}/data.js +0 -0
  49. package/dist/cjs/{src/utils → utils}/error.js +0 -0
  50. package/dist/cjs/{src/utils → utils}/eth.js +0 -0
  51. package/dist/cjs/{src/utils → utils}/expose.js +0 -0
  52. package/dist/cjs/{src/utils → utils}/file.js +0 -0
  53. package/dist/cjs/{src/utils → utils}/hash.js +0 -0
  54. package/dist/cjs/{src/utils → utils}/headers.js +0 -0
  55. package/dist/cjs/{src/utils → utils}/hex.js +0 -0
  56. package/dist/cjs/{src/utils → utils}/http.js +0 -0
  57. package/dist/cjs/{src/utils → utils}/merge.js +0 -0
  58. package/dist/cjs/{src/utils → utils}/pss.js +0 -0
  59. package/dist/cjs/{src/utils → utils}/reference.js +0 -0
  60. package/dist/cjs/utils/sleep.js +23 -0
  61. package/dist/cjs/{src/utils → utils}/stamps.js +0 -0
  62. package/dist/cjs/{src/utils → utils}/stream.js +0 -0
  63. package/dist/cjs/{src/utils → utils}/tar.js +0 -0
  64. package/dist/cjs/{src/utils → utils}/type.js +1 -1
  65. package/dist/cjs/{src/utils → utils}/uint64.js +0 -0
  66. package/dist/cjs/{src/utils → utils}/url.js +0 -0
  67. package/dist/index.browser.min.js +1 -1
  68. package/dist/index.browser.min.js.map +1 -1
  69. package/dist/mjs/{src/bee-debug.js → bee-debug.js} +2 -2
  70. package/dist/mjs/{src/bee.js → bee.js} +4 -2
  71. package/dist/mjs/{src/chunk → chunk}/bmt.js +0 -0
  72. package/dist/mjs/{src/chunk → chunk}/cac.js +0 -0
  73. package/dist/mjs/{src/chunk → chunk}/serialize.js +0 -0
  74. package/dist/mjs/{src/chunk → chunk}/signer.js +0 -0
  75. package/dist/mjs/{src/chunk → chunk}/soc.js +0 -0
  76. package/dist/mjs/{src/chunk → chunk}/span.js +0 -0
  77. package/dist/mjs/{src/feed → feed}/identifier.js +0 -0
  78. package/dist/mjs/{src/feed → feed}/index.js +0 -0
  79. package/dist/mjs/{src/feed → feed}/json.js +0 -0
  80. package/dist/mjs/{src/feed → feed}/retrievable.js +0 -0
  81. package/dist/mjs/{src/feed → feed}/topic.js +0 -0
  82. package/dist/mjs/{src/feed → feed}/type.js +0 -0
  83. package/dist/mjs/{src/index.js → index.js} +0 -0
  84. package/dist/mjs/{src/modules → modules}/bytes.js +0 -0
  85. package/dist/mjs/{src/modules → modules}/bzz.js +0 -0
  86. package/dist/mjs/{src/modules → modules}/chunk.js +0 -0
  87. package/dist/mjs/{src/modules → modules}/debug/balance.js +0 -0
  88. package/dist/mjs/{src/modules → modules}/debug/chequebook.js +0 -0
  89. package/dist/mjs/{src/modules → modules}/debug/chunk.js +0 -0
  90. package/dist/mjs/{src/modules → modules}/debug/connectivity.js +2 -2
  91. package/dist/mjs/{src/modules → modules}/debug/settlements.js +0 -0
  92. package/dist/mjs/{src/modules → modules}/debug/stamps.js +1 -1
  93. package/dist/mjs/{src/modules → modules}/debug/states.js +0 -0
  94. package/dist/mjs/{src/modules → modules}/debug/status.js +3 -3
  95. package/dist/mjs/{src/modules → modules}/debug/tag.js +0 -0
  96. package/dist/mjs/{src/modules → modules}/debug/transactions.js +0 -0
  97. package/dist/mjs/{src/modules → modules}/feed.js +0 -0
  98. package/dist/mjs/{src/modules → modules}/pinning.js +1 -7
  99. package/dist/mjs/{src/modules → modules}/pss.js +0 -0
  100. package/dist/mjs/{src/modules → modules}/soc.js +0 -0
  101. package/dist/mjs/{src/modules → modules}/status.js +0 -0
  102. package/dist/mjs/{src/modules → modules}/stewardship.js +0 -0
  103. package/dist/mjs/{src/modules → modules}/tag.js +0 -0
  104. package/dist/mjs/{src/types → types}/debug.js +0 -0
  105. package/dist/mjs/{src/types → types}/index.js +0 -0
  106. package/dist/mjs/{src/types → types}/ky-options.js +0 -0
  107. package/dist/mjs/{src/types → types}/ky-universal/common.js +0 -0
  108. package/dist/mjs/{src/types → types}/ky-universal/hooks.js +0 -0
  109. package/dist/mjs/{src/types → types}/ky-universal/retry.js +0 -0
  110. package/dist/mjs/{src/utils → utils}/bytes.js +0 -0
  111. package/dist/mjs/{src/utils → utils}/collection.browser.js +0 -0
  112. package/dist/mjs/{src/utils → utils}/collection.js +0 -0
  113. package/dist/mjs/{src/utils → utils}/collection.node.js +0 -0
  114. package/dist/mjs/{src/utils → utils}/data.browser.js +0 -0
  115. package/dist/mjs/{src/utils → utils}/data.js +0 -0
  116. package/dist/mjs/{src/utils → utils}/error.js +0 -0
  117. package/dist/mjs/{src/utils → utils}/eth.js +0 -0
  118. package/dist/mjs/{src/utils → utils}/expose.js +0 -0
  119. package/dist/mjs/{src/utils → utils}/file.js +0 -0
  120. package/dist/mjs/{src/utils → utils}/hash.js +0 -0
  121. package/dist/mjs/{src/utils → utils}/headers.js +0 -0
  122. package/dist/mjs/{src/utils → utils}/hex.js +0 -0
  123. package/dist/mjs/{src/utils → utils}/http.js +0 -0
  124. package/dist/mjs/{src/utils → utils}/merge.js +0 -0
  125. package/dist/mjs/{src/utils → utils}/pss.js +0 -0
  126. package/dist/mjs/{src/utils → utils}/reference.js +0 -0
  127. package/dist/mjs/utils/sleep.js +43 -0
  128. package/dist/mjs/{src/utils → utils}/stamps.js +0 -0
  129. package/dist/mjs/{src/utils → utils}/stream.js +0 -0
  130. package/dist/mjs/{src/utils → utils}/tar.js +0 -0
  131. package/dist/mjs/{src/utils → utils}/type.js +1 -1
  132. package/dist/mjs/{src/utils → utils}/uint64.js +0 -0
  133. package/dist/mjs/{src/utils → utils}/url.js +0 -0
  134. package/dist/types/{src/bee-debug.d.ts → bee-debug.d.ts} +0 -0
  135. package/dist/types/{src/bee.d.ts → bee.d.ts} +2 -3
  136. package/dist/types/{src/chunk → chunk}/bmt.d.ts +0 -0
  137. package/dist/types/{src/chunk → chunk}/cac.d.ts +0 -0
  138. package/dist/types/{src/chunk → chunk}/serialize.d.ts +0 -0
  139. package/dist/types/{src/chunk → chunk}/signer.d.ts +0 -0
  140. package/dist/types/{src/chunk → chunk}/soc.d.ts +0 -0
  141. package/dist/types/{src/chunk → chunk}/span.d.ts +0 -0
  142. package/dist/types/{src/feed → feed}/identifier.d.ts +0 -0
  143. package/dist/types/{src/feed → feed}/index.d.ts +0 -0
  144. package/dist/types/{src/feed → feed}/json.d.ts +0 -0
  145. package/dist/types/{src/feed → feed}/retrievable.d.ts +0 -0
  146. package/dist/types/{src/feed → feed}/topic.d.ts +0 -0
  147. package/dist/types/{src/feed → feed}/type.d.ts +0 -0
  148. package/dist/types/{src/index.d.ts → index.d.ts} +0 -0
  149. package/dist/types/{src/modules → modules}/bytes.d.ts +0 -0
  150. package/dist/types/{src/modules → modules}/bzz.d.ts +0 -0
  151. package/dist/types/{src/modules → modules}/chunk.d.ts +0 -0
  152. package/dist/types/{src/modules → modules}/debug/balance.d.ts +0 -0
  153. package/dist/types/{src/modules → modules}/debug/chequebook.d.ts +0 -0
  154. package/dist/types/{src/modules → modules}/debug/chunk.d.ts +0 -0
  155. package/dist/types/{src/modules → modules}/debug/connectivity.d.ts +0 -0
  156. package/dist/types/{src/modules → modules}/debug/settlements.d.ts +0 -0
  157. package/dist/types/{src/modules → modules}/debug/stamps.d.ts +0 -0
  158. package/dist/types/{src/modules → modules}/debug/states.d.ts +0 -0
  159. package/dist/types/{src/modules → modules}/debug/status.d.ts +3 -3
  160. package/dist/types/{src/modules → modules}/debug/tag.d.ts +0 -0
  161. package/dist/types/{src/modules → modules}/debug/transactions.d.ts +0 -0
  162. package/dist/types/{src/modules → modules}/feed.d.ts +0 -0
  163. package/dist/types/{src/modules → modules}/pinning.d.ts +1 -1
  164. package/dist/types/{src/modules → modules}/pss.d.ts +0 -0
  165. package/dist/types/{src/modules → modules}/soc.d.ts +0 -0
  166. package/dist/types/{src/modules → modules}/status.d.ts +0 -0
  167. package/dist/types/{src/modules → modules}/stewardship.d.ts +0 -0
  168. package/dist/types/{src/modules → modules}/tag.d.ts +0 -0
  169. package/dist/types/{src/types → types}/debug.d.ts +2 -7
  170. package/dist/types/{src/types → types}/index.d.ts +25 -8
  171. package/dist/types/{src/types → types}/ky-options.d.ts +0 -0
  172. package/dist/types/{src/types → types}/ky-universal/common.d.ts +0 -0
  173. package/dist/types/{src/types → types}/ky-universal/hooks.d.ts +0 -0
  174. package/dist/types/{src/types → types}/ky-universal/retry.d.ts +0 -0
  175. package/dist/types/{src/utils → utils}/bytes.d.ts +0 -0
  176. package/dist/types/{src/utils → utils}/collection.browser.d.ts +0 -0
  177. package/dist/types/{src/utils → utils}/collection.d.ts +0 -0
  178. package/dist/types/{src/utils → utils}/collection.node.d.ts +0 -0
  179. package/dist/types/{src/utils → utils}/data.browser.d.ts +0 -0
  180. package/dist/types/{src/utils → utils}/data.d.ts +0 -0
  181. package/dist/types/{src/utils → utils}/error.d.ts +0 -0
  182. package/dist/types/{src/utils → utils}/eth.d.ts +0 -0
  183. package/dist/types/{src/utils → utils}/expose.d.ts +0 -0
  184. package/dist/types/{src/utils → utils}/file.d.ts +0 -0
  185. package/dist/types/{src/utils → utils}/hash.d.ts +0 -0
  186. package/dist/types/{src/utils → utils}/headers.d.ts +0 -0
  187. package/dist/types/{src/utils → utils}/hex.d.ts +0 -0
  188. package/dist/types/{src/utils → utils}/http.d.ts +0 -0
  189. package/dist/types/{src/utils → utils}/merge.d.ts +0 -0
  190. package/dist/types/{src/utils → utils}/pss.d.ts +0 -0
  191. package/dist/types/{src/utils → utils}/reference.d.ts +0 -0
  192. package/dist/types/utils/sleep.d.ts +6 -0
  193. package/dist/types/{src/utils → utils}/stamps.d.ts +0 -0
  194. package/dist/types/{src/utils → utils}/stream.d.ts +0 -0
  195. package/dist/types/{src/utils → utils}/tar.d.ts +0 -0
  196. package/dist/types/{src/utils → utils}/type.d.ts +6 -2
  197. package/dist/types/{src/utils → utils}/uint64.d.ts +0 -0
  198. package/dist/types/{src/utils → utils}/url.d.ts +0 -0
  199. package/package.json +10 -10
  200. package/dist/cjs/test/utils.js +0 -419
  201. package/dist/mjs/test/utils.js +0 -458
  202. package/dist/types/test/utils.d.ts +0 -119
@@ -44,7 +44,7 @@ import { STAMPS_DEPTH_MAX, STAMPS_DEPTH_MIN } from "./types/index.js";
44
44
  import * as tag from "./modules/debug/tag.js";
45
45
  import * as stamps from "./modules/debug/stamps.js";
46
46
  import { makeDefaultKy, wrapRequestClosure, wrapResponseClosure } from "./utils/http.js";
47
- import { sleep } from "../test/utils.js";
47
+ import { sleep } from "./utils/sleep.js";
48
48
  export class BeeDebug {
49
49
  constructor(url, options) {
50
50
  var _a;
@@ -550,7 +550,7 @@ export class BeeDebug {
550
550
 
551
551
  const stamp = yield stamps.createPostageBatch(this.getKy(options), amount, depth, options);
552
552
 
553
- if (options === null || options === void 0 ? void 0 : options.waitForUsable) {
553
+ if ((options === null || options === void 0 ? void 0 : options.waitForUsable) !== false) {
554
554
  yield this.waitForUsablePostageStamp(stamp, options === null || options === void 0 ? void 0 : options.waitForUsableTimeout);
555
555
  }
556
556
 
@@ -833,7 +833,6 @@ export class Bee {
833
833
  *
834
834
  * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/dapps-on-swarm/feeds)
835
835
  * @see [Bee API reference - `POST /feeds`](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post)
836
- * TODO: Once breaking add support for Feed CID
837
836
  */
838
837
 
839
838
 
@@ -844,9 +843,12 @@ export class Bee {
844
843
  assertBatchId(postageBatchId);
845
844
  const canonicalTopic = makeTopic(topic);
846
845
  const canonicalOwner = makeHexEthAddress(owner);
847
- return createFeedManifest(this.getKy(options), canonicalOwner, canonicalTopic, postageBatchId, {
846
+ const reference = yield createFeedManifest(this.getKy(options), canonicalOwner, canonicalTopic, postageBatchId, {
848
847
  type
849
848
  });
849
+ return addCidConversionFunction({
850
+ reference
851
+ }, ReferenceType.FEED);
850
852
  });
851
853
  }
852
854
  /**
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -46,7 +46,7 @@ export function getPeers(ky) {
46
46
  path: 'peers',
47
47
  responseType: 'json'
48
48
  });
49
- return response.data.peers || [];
49
+ return response.data.peers;
50
50
  });
51
51
  }
52
52
  export function getBlocklist(ky) {
@@ -55,7 +55,7 @@ export function getBlocklist(ky) {
55
55
  path: 'blocklist',
56
56
  responseType: 'json'
57
57
  });
58
- return response.data.peers || [];
58
+ return response.data.peers;
59
59
  });
60
60
  }
61
61
  export function removePeer(ky, peer) {
@@ -39,7 +39,7 @@ export function getAllPostageBatches(ky) {
39
39
  path: `${STAMPS_ENDPOINT}`,
40
40
  responseType: 'json'
41
41
  });
42
- return response.data.stamps || [];
42
+ return response.data.stamps;
43
43
  });
44
44
  }
45
45
  export function getPostageBatch(ky, postageBatchId) {
@@ -34,9 +34,9 @@ import { http } from "../../utils/http.js";
34
34
  import getMajorSemver from 'semver/functions/major.js'; // Following lines bellow are automatically updated with GitHub Action when Bee version is updated
35
35
  // so if you are changing anything about them change the `update_bee` action accordingly!
36
36
 
37
- export const SUPPORTED_BEE_VERSION_EXACT = '1.6.0-6ceadd35';
38
- export const SUPPORTED_API_VERSION = '3.0.1';
39
- export const SUPPORTED_DEBUG_API_VERSION = '2.0.1';
37
+ export const SUPPORTED_BEE_VERSION_EXACT = '1.7.0-bbf13011';
38
+ export const SUPPORTED_API_VERSION = '3.0.2';
39
+ export const SUPPORTED_DEBUG_API_VERSION = '3.0.2';
40
40
  export const SUPPORTED_BEE_VERSION = SUPPORTED_BEE_VERSION_EXACT.substring(0, SUPPORTED_BEE_VERSION_EXACT.indexOf('-'));
41
41
  const NODE_INFO_URL = 'node';
42
42
  const HEALTH_URL = 'health';
File without changes
File without changes
@@ -95,12 +95,6 @@ export function getAllPins(ky) {
95
95
  responseType: 'json',
96
96
  path: `${PINNING_ENDPOINT}`
97
97
  });
98
- const result = response.data.references;
99
-
100
- if (result === null) {
101
- return [];
102
- }
103
-
104
- return result;
98
+ return response.data.references;
105
99
  });
106
100
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,43 @@
1
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) {
3
+ return value instanceof P ? value : new P(function (resolve) {
4
+ resolve(value);
5
+ });
6
+ }
7
+
8
+ return new (P || (P = Promise))(function (resolve, reject) {
9
+ function fulfilled(value) {
10
+ try {
11
+ step(generator.next(value));
12
+ } catch (e) {
13
+ reject(e);
14
+ }
15
+ }
16
+
17
+ function rejected(value) {
18
+ try {
19
+ step(generator["throw"](value));
20
+ } catch (e) {
21
+ reject(e);
22
+ }
23
+ }
24
+
25
+ function step(result) {
26
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
27
+ }
28
+
29
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
30
+ });
31
+ };
32
+ /**
33
+ * Sleep for N miliseconds
34
+ *
35
+ * @param ms Number of miliseconds to sleep
36
+ */
37
+
38
+
39
+ export function sleep(ms) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ return new Promise(resolve => setTimeout(() => resolve(), ms));
42
+ });
43
+ }
File without changes
File without changes
File without changes
@@ -151,7 +151,7 @@ export function makeReferenceOrEns(value, expectedCidType) {
151
151
 
152
152
  export function addCidConversionFunction(result, cidType) {
153
153
  return Object.assign(Object.assign({}, result), {
154
- get cid() {
154
+ cid() {
155
155
  return encodeReference(result.reference, cidType).toString();
156
156
  }
157
157
 
File without changes
File without changes
@@ -2,7 +2,7 @@ import { Index, IndexBytes } from './feed';
2
2
  import { FeedType } from './feed/type';
3
3
  import { EthAddress } from './utils/eth';
4
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, Readable, ReferenceCidOrEns, ReferenceOrEns, RequestOptions, UploadResult } 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
  *
@@ -411,9 +411,8 @@ export declare class Bee {
411
411
  *
412
412
  * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/dapps-on-swarm/feeds)
413
413
  * @see [Bee API reference - `POST /feeds`](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post)
414
- * TODO: Once breaking add support for Feed CID
415
414
  */
416
- createFeedManifest(postageBatchId: string | BatchId, type: FeedType, topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, options?: RequestOptions): Promise<Reference>;
415
+ createFeedManifest(postageBatchId: string | BatchId, type: FeedType, topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, options?: RequestOptions): Promise<FeedManifestResult>;
417
416
  /**
418
417
  * Make a new feed reader for downloading feed updates.
419
418
  *
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,9 +1,9 @@
1
1
  import type { Health, NodeInfo } from '../../types/debug';
2
2
  import { Ky } from '../../types';
3
3
  import { BeeVersions } from '../../types/debug';
4
- export declare const SUPPORTED_BEE_VERSION_EXACT = "1.6.0-6ceadd35";
5
- export declare const SUPPORTED_API_VERSION = "3.0.1";
6
- export declare const SUPPORTED_DEBUG_API_VERSION = "2.0.1";
4
+ export declare const SUPPORTED_BEE_VERSION_EXACT = "1.7.0-bbf13011";
5
+ export declare const SUPPORTED_API_VERSION = "3.0.2";
6
+ export declare const SUPPORTED_DEBUG_API_VERSION = "3.0.2";
7
7
  export declare const SUPPORTED_BEE_VERSION: string;
8
8
  /**
9
9
  * Get health of node
File without changes
@@ -1,6 +1,6 @@
1
1
  import type { Ky, Pin, Reference } from '../types';
2
2
  export interface GetAllPinResponse {
3
- references: Reference[] | null;
3
+ references: Reference[];
4
4
  }
5
5
  /**
6
6
  * Pin data with given reference
File without changes
File without changes
File without changes
File without changes
@@ -161,11 +161,6 @@ export interface NodeInfo {
161
161
  */
162
162
  swapEnabled: boolean;
163
163
  }
164
- /**
165
- * Information about Bee node and its configuration
166
- * @deprecated Use NodeInfo instead
167
- */
168
- export declare type NodesInfo = NodeInfo;
169
164
  export interface RemovePeerResponse {
170
165
  message: string;
171
166
  code: 0;
@@ -173,8 +168,8 @@ export interface RemovePeerResponse {
173
168
  export interface Bin {
174
169
  population: number;
175
170
  connected: number;
176
- disconnectedPeers: Peer[] | null;
177
- connectedPeers: Peer[] | null;
171
+ disconnectedPeers: Peer[];
172
+ connectedPeers: Peer[];
178
173
  }
179
174
  export interface Topology {
180
175
  baseAddr: string;
@@ -124,7 +124,13 @@ export interface BeeOptions extends RequestOptions {
124
124
  onResponse?: HookCallback<BeeResponse>;
125
125
  }
126
126
  export interface UploadResultWithCid extends UploadResult {
127
- cid: string;
127
+ /**
128
+ * Function that converts the reference into Swarm CIDs
129
+ *
130
+ * @throws TypeError if the reference is encrypted reference (eq. 128 chars long) which is not supported in CID
131
+ * @see https://github.com/ethersphere/swarm-cid-js
132
+ */
133
+ cid: () => string;
128
134
  }
129
135
  /**
130
136
  * Result of upload calls.
@@ -332,6 +338,21 @@ export declare const TOPIC_HEX_LENGTH = 64;
332
338
  * Hex string of length 64 chars without prefix that specifies topics for feed.
333
339
  */
334
340
  export declare type Topic = HexString<typeof TOPIC_HEX_LENGTH>;
341
+ /**
342
+ * Result of upload calls.
343
+ */
344
+ export interface FeedManifestResult {
345
+ /**
346
+ * Reference of the uploaded data
347
+ */
348
+ reference: Reference;
349
+ /**
350
+ * Function that converts the reference into Swarm Feed CID.
351
+ *
352
+ * @see https://github.com/ethersphere/swarm-cid-js
353
+ */
354
+ cid: () => string;
355
+ }
335
356
  /**
336
357
  * FeedReader is an interface for downloading feed updates
337
358
  */
@@ -417,10 +438,6 @@ export interface PostageBatch {
417
438
  batchTTL: number;
418
439
  exists: boolean;
419
440
  }
420
- /**
421
- * @deprecated Use PostageBatch instead.
422
- */
423
- export declare type DebugPostageBatch = PostageBatch;
424
441
  export interface BatchBucket {
425
442
  bucketID: number;
426
443
  collisions: number;
@@ -459,12 +476,12 @@ export interface PostageBatchOptions extends RequestOptions {
459
476
  /**
460
477
  * The returned Promise will await until the purchased Postage Batch is usable.
461
478
  * In other word, it has to have enough block confirmations that Bee pronounce it usable.
462
- * If turned on, this significantly prolong the creation of postage batch!
479
+ * When turned on, this significantly prolongs the creation of postage batch!
480
+ *
463
481
  * If you plan to use the stamp right away for some action with Bee (like uploading using this stamp) it is
464
482
  * highly recommended to use this option, otherwise you might get errors "stamp not usable" from Bee.
465
483
  *
466
- * In next breaking release this option will be turned on by default.
467
- * @default false
484
+ * @default true
468
485
  */
469
486
  waitForUsable?: boolean;
470
487
  /**
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Sleep for N miliseconds
3
+ *
4
+ * @param ms Number of miliseconds to sleep
5
+ */
6
+ export declare function sleep(ms: number): Promise<void>;
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- import { Address, AddressPrefix, AllTagsOptions, BatchId, CollectionUploadOptions, FileUploadOptions, NumberString, PssMessageHandler, PublicKey, Readable, Reference, Tag, UploadOptions, TransactionHash, RequestOptions, PostageBatchOptions, CashoutOptions, ReferenceOrEns, UploadResult, UploadResultWithCid } from '../types';
1
+ import { Address, AddressPrefix, AllTagsOptions, BatchId, CollectionUploadOptions, FileUploadOptions, NumberString, PssMessageHandler, PublicKey, Readable, Reference, Tag, UploadOptions, TransactionHash, RequestOptions, PostageBatchOptions, CashoutOptions, ReferenceOrEns } from '../types';
2
2
  import { ReferenceType } from '@ethersphere/swarm-cid';
3
3
  export declare function isUint8Array(obj: unknown): obj is Uint8Array;
4
4
  export declare function isInteger(value: unknown): value is number | NumberString;
@@ -38,7 +38,11 @@ export declare function makeReferenceOrEns(value: unknown, expectedCidType: Refe
38
38
  * @param result
39
39
  * @param cidType Type as described in the @ethersphere/swarm-cids-js -> ReferenceType
40
40
  */
41
- export declare function addCidConversionFunction(result: UploadResult, cidType: ReferenceType): UploadResultWithCid;
41
+ export declare function addCidConversionFunction<T extends {
42
+ reference: string;
43
+ }>(result: T, cidType: ReferenceType): T & {
44
+ cid: () => string;
45
+ };
42
46
  export declare function assertAddress(value: unknown): asserts value is Address;
43
47
  export declare function assertBatchId(value: unknown): asserts value is BatchId;
44
48
  export declare function assertRequestOptions(value: unknown, name?: string): asserts value is RequestOptions;
File without changes
File without changes