diff --git a/package-lock.json b/package-lock.json index 6546d504..2aa54bd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.11.0", "license": "BSD-3-Clause", "dependencies": { - "@ethersphere/bee-js": "^6.2.0", + "@ethersphere/bee-js": "github:fairDataSociety/bee-js", "@fairdatasociety/fdp-contracts-js": "^3.7.1", "crypto-js": "^4.1.1", "ethers": "^5.5.2", @@ -2324,9 +2324,9 @@ } }, "node_modules/@ethersphere/bee-js": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@ethersphere/bee-js/-/bee-js-6.2.0.tgz", - "integrity": "sha512-QWuVvW+c9z+AFWuRL+YBZECDyV3G5qeD9L0J7Tx7HYMugoDjMAjeRyNHjkf0a5np57q3i9MAE2P678rjSJ1Yaw==", + "version": "5.0.0", + "resolved": "git+ssh://git@github.com/fairDataSociety/bee-js.git#047a1b90be6b87bc94b73bbd24fb8d3de179979b", + "license": "BSD-3-Clause", "dependencies": { "@ethersphere/swarm-cid": "^0.1.0", "@types/readable-stream": "^2.3.13", @@ -2336,15 +2336,18 @@ "fetch-blob": "2.1.2", "isomorphic-ws": "^4.0.1", "js-sha3": "^0.8.0", + "ky": "^0.31.3", + "ky-universal": "^0.10.1", "semver": "^7.3.5", "tar-js": "^0.3.0", - "web-streams-polyfill": "^4.0.0-beta.3", + "utf-8-validate": "^5.0.9", + "web-streams-polyfill": "^3.2.1", "ws": "^8.7.0" }, "engines": { - "bee": "1.13.0-f1067884", - "beeApiVersion": "4.0.0", - "beeDebugApiVersion": "4.0.0", + "bee": "1.7.0-bbf13011", + "beeApiVersion": "3.0.2", + "beeDebugApiVersion": "3.0.2", "node": ">=14.0.0", "npm": ">=6.0.0" } @@ -4945,6 +4948,17 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, "node_modules/acorn": { "version": "8.8.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", @@ -5641,9 +5655,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001466", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001466.tgz", - "integrity": "sha512-ewtFBSfWjEmxUgNBSZItFSmVtvk9zkwkl1OfRZlKA8slltRN+/C/tuGVrF9styXkN36Yu3+SeJ1qkXxDEyNZ5w==", + "version": "1.0.30001523", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001523.tgz", + "integrity": "sha512-I5q5cisATTPZ1mc588Z//pj/Ox80ERYDfR71YnvY7raS/NOk8xXlZcB0sF7JdqaV//kOaa6aus7lRfpdnt1eBA==", "dev": true, "funding": [ { @@ -5653,6 +5667,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ] }, @@ -5983,6 +6001,14 @@ "node": ">=8" } }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "engines": { + "node": ">= 12" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -6818,6 +6844,14 @@ "@ethersproject/wordlists": "5.7.0" } }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "engines": { + "node": ">=6" + } + }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -7267,6 +7301,39 @@ "node": ">= 6" } }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/formdata-polyfill/node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -10267,6 +10334,41 @@ "node": ">=6" } }, + "node_modules/ky": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/ky/-/ky-0.31.4.tgz", + "integrity": "sha512-OFuAD3riwhAfHK3J4FrhlujFRpm0ELBEfDHZfFpw89OTozQt3NLF39lNblUO5udj5vSkyaBKnLai/rFCzBfISQ==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/ky?sponsor=1" + } + }, + "node_modules/ky-universal": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/ky-universal/-/ky-universal-0.10.1.tgz", + "integrity": "sha512-r8909k+ELKZAxhVA5c440x22hqw5XcMRwLRbgpPQk4JHy3/ddJnvzcnSo5Ww3HdKdNeS3Y8dBgcIYyVahMa46g==", + "dependencies": { + "abort-controller": "^3.0.0", + "node-fetch": "^3.2.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sindresorhus/ky-universal?sponsor=1" + }, + "peerDependencies": { + "ky": ">=0.26.0", + "web-streams-polyfill": ">=3.0.1" + }, + "peerDependenciesMeta": { + "web-streams-polyfill": { + "optional": true + } + } + }, "node_modules/lazy-cache": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", @@ -10749,12 +10851,67 @@ "node": ">= 10.13" } }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", + "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/node-fetch/node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/node-gyp-build": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==", - "optional": true, - "peer": true, "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -12773,8 +12930,6 @@ "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", "hasInstallScript": true, - "optional": true, - "peer": true, "dependencies": { "node-gyp-build": "^4.3.0" }, @@ -12881,9 +13036,9 @@ } }, "node_modules/web-streams-polyfill": { - "version": "4.0.0-beta.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", - "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", "engines": { "node": ">= 14" } @@ -15006,9 +15161,8 @@ } }, "@ethersphere/bee-js": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@ethersphere/bee-js/-/bee-js-6.2.0.tgz", - "integrity": "sha512-QWuVvW+c9z+AFWuRL+YBZECDyV3G5qeD9L0J7Tx7HYMugoDjMAjeRyNHjkf0a5np57q3i9MAE2P678rjSJ1Yaw==", + "version": "git+ssh://git@github.com/fairDataSociety/bee-js.git#047a1b90be6b87bc94b73bbd24fb8d3de179979b", + "from": "@ethersphere/bee-js@github:fairDataSociety/bee-js", "requires": { "@ethersphere/swarm-cid": "^0.1.0", "@types/readable-stream": "^2.3.13", @@ -15018,9 +15172,12 @@ "fetch-blob": "2.1.2", "isomorphic-ws": "^4.0.1", "js-sha3": "^0.8.0", + "ky": "^0.31.3", + "ky-universal": "^0.10.1", "semver": "^7.3.5", "tar-js": "^0.3.0", - "web-streams-polyfill": "^4.0.0-beta.3", + "utf-8-validate": "^5.0.9", + "web-streams-polyfill": "^3.2.1", "ws": "^8.7.0" }, "dependencies": { @@ -16956,6 +17113,14 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, "acorn": { "version": "8.8.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", @@ -17448,9 +17613,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001466", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001466.tgz", - "integrity": "sha512-ewtFBSfWjEmxUgNBSZItFSmVtvk9zkwkl1OfRZlKA8slltRN+/C/tuGVrF9styXkN36Yu3+SeJ1qkXxDEyNZ5w==", + "version": "1.0.30001523", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001523.tgz", + "integrity": "sha512-I5q5cisATTPZ1mc588Z//pj/Ox80ERYDfR71YnvY7raS/NOk8xXlZcB0sF7JdqaV//kOaa6aus7lRfpdnt1eBA==", "dev": true }, "chalk": { @@ -17715,6 +17880,11 @@ "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", "dev": true }, + "data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==" + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -18307,6 +18477,11 @@ "@ethersproject/wordlists": "5.7.0" } }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, "events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -18639,6 +18814,25 @@ "mime-types": "^2.1.12" } }, + "formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "requires": { + "fetch-blob": "^3.1.2" + }, + "dependencies": { + "fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "requires": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + } + } + } + }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -20880,6 +21074,20 @@ "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true }, + "ky": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/ky/-/ky-0.31.4.tgz", + "integrity": "sha512-OFuAD3riwhAfHK3J4FrhlujFRpm0ELBEfDHZfFpw89OTozQt3NLF39lNblUO5udj5vSkyaBKnLai/rFCzBfISQ==" + }, + "ky-universal": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/ky-universal/-/ky-universal-0.10.1.tgz", + "integrity": "sha512-r8909k+ELKZAxhVA5c440x22hqw5XcMRwLRbgpPQk4JHy3/ddJnvzcnSo5Ww3HdKdNeS3Y8dBgcIYyVahMa46g==", + "requires": { + "abort-controller": "^3.0.0", + "node-fetch": "^3.2.2" + } + }, "lazy-cache": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", @@ -21253,12 +21461,36 @@ "propagate": "^2.0.0" } }, + "node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" + }, + "node-fetch": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", + "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", + "requires": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "dependencies": { + "fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "requires": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + } + } + } + }, "node-gyp-build": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", - "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==", - "optional": true, - "peer": true + "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==" }, "node-int64": { "version": "0.4.0", @@ -22716,8 +22948,6 @@ "version": "5.0.10", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "optional": true, - "peer": true, "requires": { "node-gyp-build": "^4.3.0" } @@ -22811,9 +23041,9 @@ } }, "web-streams-polyfill": { - "version": "4.0.0-beta.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", - "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==" + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==" }, "webidl-conversions": { "version": "3.0.1", diff --git a/package.json b/package.json index 06914d0b..b987ffc8 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ ], "types": "dist/index.d.ts", "scripts": { - "prepare": "rimraf dist && npm run compile:types && npm run compile:browser --env mode=production && npm run compile:node --env mode=production", + "prepare": "rimraf dist && npm run compile:types && npm run compile:browser --env mode=production", "compile:node": "webpack --progress --env target=node", "compile:types": "tsc --emitDeclarationOnly --declaration", "compile:browser": "webpack --progress --env target=web", @@ -53,7 +53,7 @@ "depcheck": "depcheck ." }, "dependencies": { - "@ethersphere/bee-js": "^6.2.0", + "@ethersphere/bee-js": "github:fairDataSociety/bee-js", "@fairdatasociety/fdp-contracts-js": "^3.7.1", "crypto-js": "^4.1.1", "ethers": "^5.5.2", diff --git a/src/content-items/handler.ts b/src/content-items/handler.ts index 62e0bffe..fdc8f647 100644 --- a/src/content-items/handler.ts +++ b/src/content-items/handler.ts @@ -1,6 +1,6 @@ import { Connection } from '../connection/connection' import { utils } from 'ethers' -import { Reference, BeeRequestOptions } from '@ethersphere/bee-js' +import { Reference, RequestOptions } from '@ethersphere/bee-js' import { getUnixTimestamp } from '../utils/time' import { writeFeedData } from '../feed/api' import { getRawDirectoryMetadataBytes } from '../directory/adapter' @@ -37,7 +37,7 @@ export async function addEntryToDirectory( parentPath: string, entryPath: string, isFile: boolean, - downloadOptions?: BeeRequestOptions, + downloadOptions?: RequestOptions, ): Promise { if (!parentPath) { throw new Error('Incorrect parent path') @@ -137,7 +137,7 @@ export async function removeEntryFromDirectory( parentPath: string, entryPath: string, isFile: boolean, - downloadOptions?: BeeRequestOptions, + downloadOptions?: RequestOptions, ): Promise { const metadataWithEpoch = await getRawMetadata( connection.bee, diff --git a/src/content-items/types.ts b/src/content-items/types.ts index 13960a01..1cac9bb2 100644 --- a/src/content-items/types.ts +++ b/src/content-items/types.ts @@ -1,6 +1,6 @@ import { Epoch } from '../feed/lookup/epoch' import { RawDirectoryMetadata, RawFileMetadata } from '../pod/types' -import { BeeRequestOptions } from '@ethersphere/bee-js' +import { RequestOptions } from '@ethersphere/bee-js' import { CacheInfo } from '../cache/types' import { LookupAnswer } from '../feed/types' @@ -18,7 +18,7 @@ export interface PathInformation { * Download data options */ export interface DownloadOptions { - requestOptions?: BeeRequestOptions + requestOptions?: RequestOptions cacheInfo?: CacheInfo } diff --git a/src/content-items/utils.ts b/src/content-items/utils.ts index 915a81f3..e7fec6ec 100644 --- a/src/content-items/utils.ts +++ b/src/content-items/utils.ts @@ -1,4 +1,4 @@ -import { Bee, Reference, BeeRequestOptions } from '@ethersphere/bee-js' +import { Bee, Reference, RequestOptions } from '@ethersphere/bee-js' import { EthAddress } from '@ethersphere/bee-js/dist/types/utils/eth' import { RawDirectoryMetadata, RawFileMetadata } from '../pod/types' import { DELETE_FEED_MAGIC_WORD, getFeedData, writeFeedData } from '../feed/api' @@ -26,7 +26,7 @@ export async function getRawMetadata( path: string, address: EthAddress, podPassword: PodPasswordBytes, - requestOptions?: BeeRequestOptions, + requestOptions?: RequestOptions, ): Promise { const feedData = await getFeedData(bee, path, address, requestOptions) const data = decryptJson(podPassword, feedData.data.chunkContent()) @@ -58,7 +58,7 @@ export async function isItemExists( bee: Bee, fullPath: string, address: EthAddress, - requestOptions: BeeRequestOptions | undefined, + requestOptions: RequestOptions | undefined, ): Promise { try { return (await getFeedData(bee, fullPath, address, requestOptions)).data.text() === DELETE_FEED_MAGIC_WORD @@ -81,7 +81,7 @@ export async function assertItemIsNotExists( bee: Bee, fullPath: string, address: EthAddress, - downloadOptions: BeeRequestOptions | undefined, + downloadOptions: RequestOptions | undefined, ): Promise { if (await isItemExists(bee, fullPath, address, downloadOptions)) { throw new Error(`${contentType} "${fullPath}" already uploaded to the network`) @@ -129,7 +129,7 @@ export async function getPathInfo( bee: Bee, path: string, address: EthAddress, - requestOptions?: BeeRequestOptions, + requestOptions?: RequestOptions, ): Promise { const lookupAnswer = await getFeedData(bee, path, address, requestOptions) @@ -160,7 +160,7 @@ export async function getCreationPathInfo( bee: Bee, fullPath: string, address: EthAddress, - requestOptions?: BeeRequestOptions, + requestOptions?: RequestOptions, ): Promise { // check that if directory uploaded - than it should be marked as deleted let pathInfo diff --git a/src/directory/handler.ts b/src/directory/handler.ts index dc9aa152..0a83d40c 100644 --- a/src/directory/handler.ts +++ b/src/directory/handler.ts @@ -1,6 +1,6 @@ import { writeFeedData } from '../feed/api' import { EthAddress } from '@ethersphere/bee-js/dist/types/utils/eth' -import { Bee, Reference, BeeRequestOptions } from '@ethersphere/bee-js' +import { Bee, Reference, RequestOptions } from '@ethersphere/bee-js' import { assertDirectoryName, assertPartsLength, @@ -69,7 +69,7 @@ export async function readDirectory( address: EthAddress, podPassword: PodPasswordBytes, isRecursive?: boolean, - downloadOptions?: BeeRequestOptions, + downloadOptions?: RequestOptions, ): Promise { const parentRawDirectoryMetadata = (await getRawMetadata(bee, path, address, podPassword, downloadOptions)).metadata assertRawDirectoryMetadata(parentRawDirectoryMetadata) @@ -160,7 +160,7 @@ export async function createDirectory( fullPath: string, podWallet: utils.HDNode, podPassword: PodPasswordBytes, - downloadOptions?: BeeRequestOptions, + downloadOptions?: RequestOptions, ): Promise { const parts = getPathParts(fullPath) assertPartsLength(parts) diff --git a/src/feed/api.ts b/src/feed/api.ts index c4b54e7d..ea113e86 100644 --- a/src/feed/api.ts +++ b/src/feed/api.ts @@ -1,4 +1,4 @@ -import { Bee, Data, Reference, BeeRequestOptions, Utils } from '@ethersphere/bee-js' +import { Bee, Data, Reference, RequestOptions, Utils } from '@ethersphere/bee-js' import { bmtHashString } from '../account/utils' import { getId } from './handler' import { lookup } from './lookup/linear' @@ -27,7 +27,7 @@ export async function getFeedData( bee: Bee, topic: string, address: Utils.EthAddress | Uint8Array, - requestOptions?: BeeRequestOptions, + requestOptions?: RequestOptions, ): Promise { const topicHash = bmtHashString(topic) diff --git a/src/file/handler.ts b/src/file/handler.ts index 415b68b6..36165f53 100644 --- a/src/file/handler.ts +++ b/src/file/handler.ts @@ -1,5 +1,5 @@ import { stringToBytes, wrapBytesWithHelpers } from '../utils/bytes' -import { Bee, Data, BeeRequestOptions } from '@ethersphere/bee-js' +import { Bee, Data, RequestOptions } from '@ethersphere/bee-js' import { EthAddress } from '@ethersphere/bee-js/dist/types/utils/eth' import { assertFullPathWithName, @@ -47,7 +47,7 @@ export async function getFileMetadata( path: string, address: EthAddress, podPassword: PodPasswordBytes, - downloadOptions?: BeeRequestOptions, + downloadOptions?: RequestOptions, ): Promise { const data = (await getRawMetadata(bee, path, address, podPassword, downloadOptions)).metadata assertRawFileMetadata(data) @@ -69,7 +69,7 @@ export async function downloadData( fullPath: string, address: EthAddress, podPassword: PodPasswordBytes, - downloadOptions?: BeeRequestOptions, + downloadOptions?: RequestOptions, ): Promise { const fileMetadata = await getFileMetadata(bee, fullPath, address, podPassword, downloadOptions) diff --git a/src/file/utils.ts b/src/file/utils.ts index 8d0c3a69..44cf9c9c 100644 --- a/src/file/utils.ts +++ b/src/file/utils.ts @@ -1,5 +1,5 @@ import { Connection } from '../connection/connection' -import { Bee, Reference, BeeRequestOptions, UploadResult } from '@ethersphere/bee-js' +import { Bee, Reference, RequestOptions, UploadResult } from '@ethersphere/bee-js' import { PathInfo } from '../pod/utils' import { Blocks, FileShareInfo, RawBlock, RawBlocks } from './types' import { rawBlocksToBlocks } from './adapter' @@ -109,7 +109,7 @@ export function getBaseName(path: string): string | undefined { export async function downloadBlocksManifest( bee: Bee, reference: Reference, - downloadOptions?: BeeRequestOptions, + downloadOptions?: RequestOptions, ): Promise { const data = (await bee.downloadData(reference, downloadOptions)).text() const rawBlocks = jsonParse(data, 'blocks manifest') diff --git a/src/types.ts b/src/types.ts index e84634e0..e9c32852 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import { BeeRequestOptions } from '@ethersphere/bee-js' +import { RequestOptions } from '@ethersphere/bee-js' import { EnsEnvironment } from '@fairdatasociety/fdp-contracts-js' import { CacheOptions } from './cache/types' @@ -11,7 +11,7 @@ export interface Options { /** * Request options */ - requestOptions?: BeeRequestOptions + requestOptions?: RequestOptions /** * FDP-contracts options */