From fd4f5867716c4cce960a63279c7df67adc9eee85 Mon Sep 17 00:00:00 2001 From: tomicvladan Date: Thu, 27 Apr 2023 12:42:17 +0200 Subject: [PATCH 1/2] chore: update manifest version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 6385854..0d3c5b0 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "48": "icons/blossom48.png", "128": "icons/blossom128.png" }, - "version": "0.2.3", + "version": "0.3.0", "manifest_version": 3, "background": { "service_worker": "main.js" From c8589bc54e3987587d4db3cf017a94c8e5472bc4 Mon Sep 17 00:00:00 2001 From: tomicvladan Date: Fri, 28 Apr 2023 12:13:33 +0200 Subject: [PATCH 2/2] feat: add cache proxy --- library/package-lock.json | 346 +++++++++++++----- library/package.json | 2 +- .../src/proxy/fdp-storage.proxy.factory.ts | 12 + 3 files changed, 274 insertions(+), 86 deletions(-) diff --git a/library/package-lock.json b/library/package-lock.json index 9ce7672..b8454f4 100644 --- a/library/package-lock.json +++ b/library/package-lock.json @@ -9,7 +9,7 @@ "version": "0.3.0", "license": "MIT", "dependencies": { - "@fairdatasociety/fdp-storage": "^0.7.0" + "@fairdatasociety/fdp-storage": "^0.7.1" }, "devDependencies": { "@types/chrome": "^0.0.186", @@ -705,29 +705,30 @@ } }, "node_modules/@ethersphere/bee-js": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@ethersphere/bee-js/-/bee-js-3.3.4.tgz", - "integrity": "sha512-uxH0kR31tE8IKVON7jyQHANZ/5edlU8OUCz/qyRft1YeS+L4HzEHAD3bN58iE842nt6Iz/fekrJ7yk1ONIcDBg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@ethersphere/bee-js/-/bee-js-5.2.0.tgz", + "integrity": "sha512-BM9lBiKC/tMbYNTEs3uyDyAwpED+v6u46DEXyFh7BLCUPg12LBWv0O12XmQj5ybzXnUT4ptHU9UXu3oGHph8Vw==", "dependencies": { + "@ethersphere/swarm-cid": "^0.1.0", "@types/readable-stream": "^2.3.13", "bufferutil": "^4.0.6", "elliptic": "^6.5.4", "fetch-blob": "2.1.2", "isomorphic-ws": "^4.0.1", "js-sha3": "^0.8.0", - "ky": "^0.25.1", - "ky-universal": "^0.8.2", + "ky": "^0.33.2", + "ky-universal": "^0.11.0", "semver": "^7.3.5", "tar-js": "^0.3.0", "utf-8-validate": "^5.0.9", - "web-streams-polyfill": "^4.0.0-beta.1", - "ws": "^8.5.0" + "web-streams-polyfill": "^4.0.0-beta.3", + "ws": "^8.7.0" }, "engines": { - "bee": "1.5.1-d0a77598", - "beeApiVersion": "3.0.0", - "beeDebugApiVersion": "2.0.0", - "node": ">=12.0.0", + "bee": "1.12.0-88c1d236", + "beeApiVersion": "4.0.0", + "beeDebugApiVersion": "4.0.0", + "node": ">=14.0.0", "npm": ">=6.0.0" } }, @@ -739,6 +740,38 @@ "node": ">= 14" } }, + "node_modules/@ethersphere/bee-js/node_modules/ws": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/@ethersphere/swarm-cid": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@ethersphere/swarm-cid/-/swarm-cid-0.1.0.tgz", + "integrity": "sha512-n+n+w5RJBPm7CiPf8TIgNFIRMo4bLh5bYpZxHObgCaxFW8WNZ4UGfqg+qjS/jEr+A3Mmp0lugKDvd8GnfFy7JQ==", + "dependencies": { + "multiformats": "^9.5.4" + }, + "engines": { + "node": ">=12.0.0", + "npm": ">=6.0.0" + } + }, "node_modules/@ethersproject/abi": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", @@ -1441,20 +1474,20 @@ } }, "node_modules/@fairdatasociety/fdp-contracts-js": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-contracts-js/-/fdp-contracts-js-2.0.1.tgz", - "integrity": "sha512-C76Pns4aQ8m4Q0IGQ8LQKBWZ8gmI/hXqKK1iu9FHnUUobUtDH41wDdQLlRYLu6/Unq7+Nrfjgx1OJuKCXq5WkA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-contracts-js/-/fdp-contracts-js-2.2.0.tgz", + "integrity": "sha512-5nvyPP2vzzz9g/fJncz3oYUJKrpa0LLDNoD7CbPSJOjsBCfulVZqsabjdxZSEOLviErkvE6ICLBisEnQQ6sXjQ==", "peerDependencies": { "ethers": ">=5.6.4" } }, "node_modules/@fairdatasociety/fdp-storage": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.7.0.tgz", - "integrity": "sha512-+RhtmgrVO1sYGrlb2YHLLZYBLalqtaF15j7kNQ304hgtxWThLdFSRe/8P9vItdANUnglx7JJXglx6hkx4ArBpQ==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.7.1.tgz", + "integrity": "sha512-uhWHf8CSftgJrB5V5X2Jy3oa8iczLr/Yq7HWatHm90sQwuAeydTOtMbHF9QkJnTmTZJzn7JdNbjIhDKcQkt/cA==", "dependencies": { - "@ethersphere/bee-js": "^3.1.0", - "@fairdatasociety/fdp-contracts-js": "^2.0.1", + "@ethersphere/bee-js": "^5.1.0", + "@fairdatasociety/fdp-contracts-js": "^2.1.0", "crypto-js": "^4.1.1", "ethers": "^5.5.2", "js-sha3": "^0.8.0" @@ -2264,14 +2297,19 @@ "dev": true }, "node_modules/@types/readable-stream": { - "version": "2.3.14", - "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-2.3.14.tgz", - "integrity": "sha512-8jQ5Mp7bsDJEnW/69i6nAaQMoLwAVJVc7ZRAVTrdh/o6XueQsX38TEvKuYyoQj76/mg7WdlRfMrtl9pDLCJWsg==", + "version": "2.3.15", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-2.3.15.tgz", + "integrity": "sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==", "dependencies": { "@types/node": "*", - "safe-buffer": "*" + "safe-buffer": "~5.1.1" } }, + "node_modules/@types/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, "node_modules/@types/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", @@ -3728,11 +3766,11 @@ "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" }, "node_modules/data-uri-to-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz", - "integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==", + "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": ">= 6" + "node": ">= 12" } }, "node_modules/debug": { @@ -4822,6 +4860,39 @@ } } }, + "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/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -6304,33 +6375,33 @@ } }, "node_modules/ky": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/ky/-/ky-0.25.1.tgz", - "integrity": "sha512-PjpCEWlIU7VpiMVrTwssahkYXX1by6NCT0fhTUX34F3DTinARlgMpriuroolugFPcMgpPWrOW4mTb984Qm1RXA==", + "version": "0.33.3", + "resolved": "https://registry.npmjs.org/ky/-/ky-0.33.3.tgz", + "integrity": "sha512-CasD9OCEQSFIam2U8efFK81Yeg8vNMTBUqtMOHlrcWQHqUX3HeCl9Dr31u4toV7emlH8Mymk5+9p0lL6mKb/Xw==", "engines": { - "node": ">=10" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sindresorhus/ky?sponsor=1" } }, "node_modules/ky-universal": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/ky-universal/-/ky-universal-0.8.2.tgz", - "integrity": "sha512-xe0JaOH9QeYxdyGLnzUOVGK4Z6FGvDVzcXFTdrYA1f33MZdEa45sUDaMBy98xQMcsd2XIBrTXRrRYnegcSdgVQ==", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/ky-universal/-/ky-universal-0.11.0.tgz", + "integrity": "sha512-65KyweaWvk+uKKkCrfAf+xqN2/epw1IJDtlyCPxYffFCMR8u1sp2U65NtWpnozYfZxQ6IUzIlvUcw+hQ82U2Xw==", "dependencies": { "abort-controller": "^3.0.0", - "node-fetch": "3.0.0-beta.9" + "node-fetch": "^3.2.10" }, "engines": { - "node": ">=10.17" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sindresorhus/ky-universal?sponsor=1" }, "peerDependencies": { - "ky": ">=0.17.0", - "web-streams-polyfill": ">=2.0.0" + "ky": ">=0.31.4", + "web-streams-polyfill": ">=3.2.1" }, "peerDependenciesMeta": { "web-streams-polyfill": { @@ -6338,16 +6409,39 @@ } } }, + "node_modules/ky-universal/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/ky-universal/node_modules/node-fetch": { - "version": "3.0.0-beta.9", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0-beta.9.tgz", - "integrity": "sha512-RdbZCEynH2tH46+tj0ua9caUHVWrd/RHnRfvly2EVdqGmI3ndS1Vn/xjm5KuGejDt2RNDQsVRLPNd2QPwcewVg==", + "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": "^3.0.1", - "fetch-blob": "^2.1.1" + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" }, "engines": { - "node": "^10.17 || >=12.3" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -6648,6 +6742,11 @@ "multicast-dns": "cli.js" } }, + "node_modules/multiformats": { + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", + "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -6669,6 +6768,24 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "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": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", @@ -7497,6 +7614,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, "funding": [ { "type": "github", @@ -8562,8 +8680,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", - "optional": true, - "peer": true, "engines": { "node": ">= 8" } @@ -9597,32 +9713,47 @@ } }, "@ethersphere/bee-js": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@ethersphere/bee-js/-/bee-js-3.3.4.tgz", - "integrity": "sha512-uxH0kR31tE8IKVON7jyQHANZ/5edlU8OUCz/qyRft1YeS+L4HzEHAD3bN58iE842nt6Iz/fekrJ7yk1ONIcDBg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@ethersphere/bee-js/-/bee-js-5.2.0.tgz", + "integrity": "sha512-BM9lBiKC/tMbYNTEs3uyDyAwpED+v6u46DEXyFh7BLCUPg12LBWv0O12XmQj5ybzXnUT4ptHU9UXu3oGHph8Vw==", "requires": { + "@ethersphere/swarm-cid": "^0.1.0", "@types/readable-stream": "^2.3.13", "bufferutil": "^4.0.6", "elliptic": "^6.5.4", "fetch-blob": "2.1.2", "isomorphic-ws": "^4.0.1", "js-sha3": "^0.8.0", - "ky": "^0.25.1", - "ky-universal": "^0.8.2", + "ky": "^0.33.2", + "ky-universal": "^0.11.0", "semver": "^7.3.5", "tar-js": "^0.3.0", "utf-8-validate": "^5.0.9", - "web-streams-polyfill": "^4.0.0-beta.1", - "ws": "^8.5.0" + "web-streams-polyfill": "^4.0.0-beta.3", + "ws": "^8.7.0" }, "dependencies": { "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==" + }, + "ws": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "requires": {} } } }, + "@ethersphere/swarm-cid": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@ethersphere/swarm-cid/-/swarm-cid-0.1.0.tgz", + "integrity": "sha512-n+n+w5RJBPm7CiPf8TIgNFIRMo4bLh5bYpZxHObgCaxFW8WNZ4UGfqg+qjS/jEr+A3Mmp0lugKDvd8GnfFy7JQ==", + "requires": { + "multiformats": "^9.5.4" + } + }, "@ethersproject/abi": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", @@ -10017,18 +10148,18 @@ } }, "@fairdatasociety/fdp-contracts-js": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-contracts-js/-/fdp-contracts-js-2.0.1.tgz", - "integrity": "sha512-C76Pns4aQ8m4Q0IGQ8LQKBWZ8gmI/hXqKK1iu9FHnUUobUtDH41wDdQLlRYLu6/Unq7+Nrfjgx1OJuKCXq5WkA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-contracts-js/-/fdp-contracts-js-2.2.0.tgz", + "integrity": "sha512-5nvyPP2vzzz9g/fJncz3oYUJKrpa0LLDNoD7CbPSJOjsBCfulVZqsabjdxZSEOLviErkvE6ICLBisEnQQ6sXjQ==", "requires": {} }, "@fairdatasociety/fdp-storage": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.7.0.tgz", - "integrity": "sha512-+RhtmgrVO1sYGrlb2YHLLZYBLalqtaF15j7kNQ304hgtxWThLdFSRe/8P9vItdANUnglx7JJXglx6hkx4ArBpQ==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.7.1.tgz", + "integrity": "sha512-uhWHf8CSftgJrB5V5X2Jy3oa8iczLr/Yq7HWatHm90sQwuAeydTOtMbHF9QkJnTmTZJzn7JdNbjIhDKcQkt/cA==", "requires": { - "@ethersphere/bee-js": "^3.1.0", - "@fairdatasociety/fdp-contracts-js": "^2.0.1", + "@ethersphere/bee-js": "^5.1.0", + "@fairdatasociety/fdp-contracts-js": "^2.1.0", "crypto-js": "^4.1.1", "ethers": "^5.5.2", "js-sha3": "^0.8.0" @@ -10729,12 +10860,19 @@ "dev": true }, "@types/readable-stream": { - "version": "2.3.14", - "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-2.3.14.tgz", - "integrity": "sha512-8jQ5Mp7bsDJEnW/69i6nAaQMoLwAVJVc7ZRAVTrdh/o6XueQsX38TEvKuYyoQj76/mg7WdlRfMrtl9pDLCJWsg==", + "version": "2.3.15", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-2.3.15.tgz", + "integrity": "sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==", "requires": { "@types/node": "*", - "safe-buffer": "*" + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } } }, "@types/retry": { @@ -11862,9 +12000,9 @@ "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" }, "data-uri-to-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz", - "integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==" + "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", @@ -12686,6 +12824,25 @@ "integrity": "sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==", "dev": true }, + "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" + } + } + } + }, "forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -13811,26 +13968,36 @@ "dev": true }, "ky": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/ky/-/ky-0.25.1.tgz", - "integrity": "sha512-PjpCEWlIU7VpiMVrTwssahkYXX1by6NCT0fhTUX34F3DTinARlgMpriuroolugFPcMgpPWrOW4mTb984Qm1RXA==" + "version": "0.33.3", + "resolved": "https://registry.npmjs.org/ky/-/ky-0.33.3.tgz", + "integrity": "sha512-CasD9OCEQSFIam2U8efFK81Yeg8vNMTBUqtMOHlrcWQHqUX3HeCl9Dr31u4toV7emlH8Mymk5+9p0lL6mKb/Xw==" }, "ky-universal": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/ky-universal/-/ky-universal-0.8.2.tgz", - "integrity": "sha512-xe0JaOH9QeYxdyGLnzUOVGK4Z6FGvDVzcXFTdrYA1f33MZdEa45sUDaMBy98xQMcsd2XIBrTXRrRYnegcSdgVQ==", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/ky-universal/-/ky-universal-0.11.0.tgz", + "integrity": "sha512-65KyweaWvk+uKKkCrfAf+xqN2/epw1IJDtlyCPxYffFCMR8u1sp2U65NtWpnozYfZxQ6IUzIlvUcw+hQ82U2Xw==", "requires": { "abort-controller": "^3.0.0", - "node-fetch": "3.0.0-beta.9" + "node-fetch": "^3.2.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-fetch": { - "version": "3.0.0-beta.9", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0-beta.9.tgz", - "integrity": "sha512-RdbZCEynH2tH46+tj0ua9caUHVWrd/RHnRfvly2EVdqGmI3ndS1Vn/xjm5KuGejDt2RNDQsVRLPNd2QPwcewVg==", + "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": "^3.0.1", - "fetch-blob": "^2.1.1" + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" } } } @@ -14068,6 +14235,11 @@ "thunky": "^1.0.2" } }, + "multiformats": { + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", + "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -14086,6 +14258,11 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "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": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", @@ -14682,7 +14859,8 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -15477,9 +15655,7 @@ "web-streams-polyfill": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", - "optional": true, - "peer": true + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==" }, "webidl-conversions": { "version": "4.0.2", diff --git a/library/package.json b/library/package.json index 200fa19..4b54df0 100644 --- a/library/package.json +++ b/library/package.json @@ -46,6 +46,6 @@ "webpack-dev-server": "^4.9.0" }, "dependencies": { - "@fairdatasociety/fdp-storage": "^0.7.0" + "@fairdatasociety/fdp-storage": "^0.7.1" } } diff --git a/library/src/proxy/fdp-storage.proxy.factory.ts b/library/src/proxy/fdp-storage.proxy.factory.ts index 9b9cf17..d4c13eb 100644 --- a/library/src/proxy/fdp-storage.proxy.factory.ts +++ b/library/src/proxy/fdp-storage.proxy.factory.ts @@ -48,6 +48,17 @@ function createProxy(path: string, messages: BlossomMessages): ) } +function createObjectProxy(path: string): T { + return new Proxy({} as T, { + get() { + return {} + }, + set() { + return true + }, + }) +} + function createFdpStorageProxy(messages: BlossomMessages): FdpStorage { return { account: createProxy('account', messages), @@ -57,6 +68,7 @@ function createFdpStorageProxy(messages: BlossomMessages): FdpStorage { ens: createProxy>('ens', messages), file: createProxy>('file', messages), personalStorage: createProxy('personalStorage', messages), + cache: createObjectProxy<{ object: any }>('cache'), } as unknown as FdpStorage }