diff --git a/package-lock.json b/package-lock.json index 40a64090..011eaf16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -801,6 +801,35 @@ "integrity": "sha512-D1wSyvxSX6Ksw1j6FtO1/7x0XZ9NIkBIGzG8wCxkI/t2xS+eX9S8V9x3HKV764fETTCBOmccg8dZfz4fBKT5Fw==", "dev": true }, + "@sinonjs/commons": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.3.0.tgz", + "integrity": "sha512-j4ZwhaHmwsCb4DlDOIWnI5YyKDNMoNThsmwEpfHx6a1EpsGZ9qYLxP++LMlmBRjtGptGHFsGItJ768snllFWpA==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/formatio": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.1.0.tgz", + "integrity": "sha512-ZAR2bPHOl4Xg6eklUGpsdiIJ4+J1SNag1DHHrG/73Uz/nVwXqjgUtRPLoS+aVyieN9cSbc0E4LsU984tWcDyNg==", + "dev": true, + "requires": { + "@sinonjs/samsam": "^2 || ^3" + } + }, + "@sinonjs/samsam": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.0.2.tgz", + "integrity": "sha512-m08g4CS3J6lwRQk1pj1EO+KEVWbrbXsmi9Pw0ySmrIbcVxVaedoFgLvFsV8wHLwh01EpROVz3KvVcD1Jmks9FQ==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.0.2", + "array-from": "^2.1.1", + "lodash.get": "^4.4.2" + } + }, "@webassemblyjs/ast": { "version": "1.7.11", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.7.11.tgz", @@ -1270,14 +1299,6 @@ "chalk": "2.4.1", "leven": "2.1.0", "mri": "1.1.1" - }, - "dependencies": { - "camelcase": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", - "dev": true - } } }, "arr-diff": { @@ -1298,6 +1319,12 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, + "array-from": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", + "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", + "dev": true + }, "array-includes": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", @@ -1382,7 +1409,6 @@ "version": "2.6.1", "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "dev": true, "requires": { "lodash": "^4.17.10" } @@ -1556,11 +1582,16 @@ "version": "3.0.5", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.5.tgz", "integrity": "sha512-C3picSgzPSLE+jW3tcBzJoGwitOtazb5B+5YmAxZm2ybmTi9LNgAtDO/jjVEBZwHoXmDBZ9m/IELj3elJVRBcA==", - "dev": true, "requires": { "safe-buffer": "^5.0.1" } }, + "base32-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/base32-encode/-/base32-encode-1.1.0.tgz", + "integrity": "sha512-fQWhpkWtaOPr+wvXWYDu1AfRbtIIzWDt3yDDNXLENWPwFyyxDJfVaJoOc1ks1TQckogPiHmb+0iZLQFPkZw8kg==", + "dev": true + }, "base32.js": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/base32.js/-/base32.js-0.1.0.tgz", @@ -1720,8 +1751,7 @@ "blakejs": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", - "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=", - "dev": true + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=" }, "blob": { "version": "0.0.5", @@ -1791,6 +1821,12 @@ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -1955,7 +1991,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", - "dev": true, "requires": { "base-x": "^3.0.2" } @@ -2166,9 +2201,9 @@ "dev": true }, "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", "dev": true }, "caniuse-lite": { @@ -2320,11 +2355,23 @@ "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", "dev": true }, + "cid-tool": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/cid-tool/-/cid-tool-0.1.0.tgz", + "integrity": "sha512-lss0IzW2uiLm+W8St00N23+ySnCoFTD7qPZB1WqqOSvT5mzDG8Di9e5LmcaEkNfFXh7xAmlPZmJnvWxAjVPErg==", + "dev": true, + "requires": { + "cids": "~0.5.3", + "explain-error": "^1.0.4", + "multibase": "~0.5.0", + "multihashes": "~0.4.14", + "yargs": "^12.0.2" + } + }, "cids": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/cids/-/cids-0.5.7.tgz", "integrity": "sha512-SlAz4p8XMEW3mhwiYbzfjn+5+Y//+kIuHqzRUytK0a3uGBnsjJb76xHliehv0HcVMCjRKv2vZnPTwd4QX+IcMA==", - "dev": true, "requires": { "class-is": "^1.1.0", "multibase": "~0.6.0", @@ -2336,7 +2383,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.4.tgz", "integrity": "sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA==", - "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -2345,7 +2391,6 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.0.tgz", "integrity": "sha512-R9bNLQhbD7MsitPm1NeY7w9sDgu6d7cuj25snAWH7k5PSNPSwIQQBpcpj8jx1W96dLbdigZqmUWOdQRMnAmgjA==", - "dev": true, "requires": { "base-x": "3.0.4" } @@ -2371,8 +2416,7 @@ "class-is": { "version": "1.1.0", "resolved": "http://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", - "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==", - "dev": true + "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==" }, "class-utils": { "version": "0.3.6", @@ -2658,6 +2702,12 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, + "core-decorators": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/core-decorators/-/core-decorators-0.20.0.tgz", + "integrity": "sha1-YFiWYkBTr4wo775zXCWjAaYcZcU=", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -2711,12 +2761,14 @@ } }, "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "lru-cache": "^4.0.1", + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" } @@ -2807,46 +2859,19 @@ } }, "datastore-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/datastore-fs/-/datastore-fs-0.5.0.tgz", - "integrity": "sha512-l2WF+/TFzzCY3L0b4GYYa196X25PqR2jZnLvqXtz2WODkTXZTcZJ+s4+KAnUAc6TMxWejN8NkEnkcPL05lKSSA==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/datastore-fs/-/datastore-fs-0.7.0.tgz", + "integrity": "sha512-U8amTi/aWW391JYeFbIzjKtEqECXuMvDafD0XphsiaRKp0If4SwxgmlMn+y7BHlCRrf4/AYAwemVZBMBrSwIxA==", "dev": true, "requires": { "async": "^2.6.1", - "datastore-core": "~0.4.0", - "glob": "^7.1.2", + "datastore-core": "~0.6.0", + "glob": "^7.1.3", "graceful-fs": "^4.1.11", - "interface-datastore": "^0.4.2", + "interface-datastore": "~0.6.0", "mkdirp": "~0.5.1", - "pull-stream": "^3.6.8", + "pull-stream": "^3.6.9", "write-file-atomic": "^2.3.0" - }, - "dependencies": { - "datastore-core": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-0.4.0.tgz", - "integrity": "sha512-BQC3f2jSUgVL1DUjt/ZJr9yWzNYyx3ApNh4NhMYFZBap0c+iTKJqyHRlO4bRT+CZG0mqqOUTNXU3qYvTJlN6OA==", - "dev": true, - "requires": { - "async": "^2.5.0", - "interface-datastore": "~0.4.0", - "left-pad": "^1.1.3", - "pull-many": "^1.0.8", - "pull-stream": "^3.6.1" - } - }, - "interface-datastore": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-0.4.2.tgz", - "integrity": "sha512-Vztsb1SXZANtwwGkpDoxOTMELhhuCklkQKbjma6PY4XLwIyrhQ1xEKaG1sOHavMXoghThw8IZEysiCDrofOQKQ==", - "dev": true, - "requires": { - "async": "^2.6.0", - "pull-defer": "^0.2.2", - "pull-stream": "^3.6.1", - "uuid": "^3.1.0" - } - } } }, "datastore-level": { @@ -3505,19 +3530,6 @@ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, "debug": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", @@ -3923,13 +3935,13 @@ } }, "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "dev": true, "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", "is-stream": "^1.1.0", "npm-run-path": "^2.0.0", "p-finally": "^1.0.0", @@ -3978,6 +3990,12 @@ "integrity": "sha512-cebqLtV8KOZfw0UI8TEFWxtczxxC1jvyUvx6H4fyp1K1FN7A4Q+uggVUlOsI1K8AGU0rwOGqP8nCapdrw8CYQg==", "dev": true }, + "explain-error": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/explain-error/-/explain-error-1.0.4.tgz", + "integrity": "sha1-p5PTrAytTGq1cemWj7urbLJTKSk=", + "dev": true + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -4180,9 +4198,9 @@ "dev": true }, "file-type": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-8.1.0.tgz", - "integrity": "sha512-qyQ0pzAy78gVoJsmYeNgl8uH8yKhr1lVhW7JbzJmnlRi0I4R2eEDEJZVKG8agpDnLpacwNbDhLNG/LMdxHD2YQ==", + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-10.7.0.tgz", + "integrity": "sha512-AbaGtdWYYRaVrv2MwL/65myuRJ9j3e79e7etJ79US18QHuVlzJBcQHUH+HxDUoLtbyWRTUfLzLkGXX3pP9kfZg==", "dev": true }, "filereader": { @@ -4439,24 +4457,28 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "aproba": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.4", - "bundled": true, + "resolved": false, + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", "dev": true, "optional": true, "requires": { @@ -4466,12 +4488,14 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "brace-expansion": { "version": "1.1.11", - "bundled": true, + "resolved": false, + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -4480,34 +4504,40 @@ }, "chownr": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, "concat-map": { "version": "0.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true }, "core-util-is": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "2.6.9", - "bundled": true, + "resolved": false, + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "optional": true, "requires": { @@ -4516,25 +4546,29 @@ }, "deep-extend": { "version": "0.5.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, "requires": { @@ -4543,13 +4577,15 @@ }, "fs.realpath": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "bundled": true, + "resolved": false, + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, "requires": { @@ -4565,7 +4601,8 @@ }, "glob": { "version": "7.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "optional": true, "requires": { @@ -4579,13 +4616,15 @@ }, "has-unicode": { "version": "2.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.21", - "bundled": true, + "resolved": false, + "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", "dev": true, "optional": true, "requires": { @@ -4594,7 +4633,8 @@ }, "ignore-walk": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, "requires": { @@ -4603,7 +4643,8 @@ }, "inflight": { "version": "1.0.6", - "bundled": true, + "resolved": false, + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, "requires": { @@ -4613,18 +4654,21 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "ini": { "version": "1.3.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -4632,13 +4676,15 @@ }, "isarray": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -4646,12 +4692,14 @@ }, "minimist": { "version": "0.0.8", - "bundled": true, + "resolved": false, + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "minipass": { "version": "2.2.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", "dev": true, "requires": { "safe-buffer": "^5.1.1", @@ -4660,7 +4708,8 @@ }, "minizlib": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", "dev": true, "optional": true, "requires": { @@ -4669,7 +4718,8 @@ }, "mkdirp": { "version": "0.5.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" @@ -4677,13 +4727,15 @@ }, "ms": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true, "optional": true }, "needle": { "version": "2.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==", "dev": true, "optional": true, "requires": { @@ -4694,7 +4746,8 @@ }, "node-pre-gyp": { "version": "0.10.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==", "dev": true, "optional": true, "requires": { @@ -4712,7 +4765,8 @@ }, "nopt": { "version": "4.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, "requires": { @@ -4722,13 +4776,15 @@ }, "npm-bundled": { "version": "1.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.1.10", - "bundled": true, + "resolved": false, + "integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==", "dev": true, "optional": true, "requires": { @@ -4738,7 +4794,8 @@ }, "npmlog": { "version": "4.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, "requires": { @@ -4750,18 +4807,21 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "object-assign": { "version": "4.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" @@ -4769,19 +4829,22 @@ }, "os-homedir": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, "requires": { @@ -4791,19 +4854,22 @@ }, "path-is-absolute": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { "version": "1.2.7", - "bundled": true, + "resolved": false, + "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", "dev": true, "optional": true, "requires": { @@ -4815,7 +4881,8 @@ "dependencies": { "minimist": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true } @@ -4823,7 +4890,8 @@ }, "readable-stream": { "version": "2.3.6", - "bundled": true, + "resolved": false, + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, "requires": { @@ -4838,7 +4906,8 @@ }, "rimraf": { "version": "2.6.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "optional": true, "requires": { @@ -4847,42 +4916,49 @@ }, "safe-buffer": { "version": "5.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", "dev": true }, "safer-buffer": { "version": "2.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.5.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -4892,7 +4968,8 @@ }, "string_decoder": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, "requires": { @@ -4901,7 +4978,8 @@ }, "strip-ansi": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -4909,13 +4987,15 @@ }, "strip-json-comments": { "version": "2.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==", "dev": true, "optional": true, "requires": { @@ -4930,13 +5010,15 @@ }, "util-deprecate": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", "dev": true, "optional": true, "requires": { @@ -4945,12 +5027,14 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "yallist": { "version": "3.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", "dev": true } } @@ -5020,24 +5104,28 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "aproba": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "optional": true, "requires": { @@ -5047,12 +5135,14 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "brace-expansion": { "version": "1.1.11", - "bundled": true, + "resolved": false, + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -5061,34 +5151,40 @@ }, "chownr": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, "concat-map": { "version": "0.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true }, "core-util-is": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "2.6.9", - "bundled": true, + "resolved": false, + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "optional": true, "requires": { @@ -5097,25 +5193,29 @@ }, "deep-extend": { "version": "0.6.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, "requires": { @@ -5124,13 +5224,15 @@ }, "fs.realpath": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "bundled": true, + "resolved": false, + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, "requires": { @@ -5146,7 +5248,8 @@ }, "glob": { "version": "7.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "optional": true, "requires": { @@ -5160,13 +5263,15 @@ }, "has-unicode": { "version": "2.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.24", - "bundled": true, + "resolved": false, + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "optional": true, "requires": { @@ -5175,7 +5280,8 @@ }, "ignore-walk": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, "requires": { @@ -5184,7 +5290,8 @@ }, "inflight": { "version": "1.0.6", - "bundled": true, + "resolved": false, + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, "requires": { @@ -5194,18 +5301,21 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "ini": { "version": "1.3.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -5213,13 +5323,15 @@ }, "isarray": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -5227,12 +5339,14 @@ }, "minimist": { "version": "0.0.8", - "bundled": true, + "resolved": false, + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "minipass": { "version": "2.3.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "dev": true, "requires": { "safe-buffer": "^5.1.2", @@ -5241,7 +5355,8 @@ }, "minizlib": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-TrfjCjk4jLhcJyGMYymBH6oTXcWjYbUAXTHDbtnWHjZC25h0cdajHuPE1zxb4DVmu8crfh+HwH/WMuyLG0nHBg==", "dev": true, "optional": true, "requires": { @@ -5250,7 +5365,8 @@ }, "mkdirp": { "version": "0.5.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" @@ -5258,13 +5374,15 @@ }, "ms": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true, "optional": true }, "needle": { "version": "2.2.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", "dev": true, "optional": true, "requires": { @@ -5275,7 +5393,8 @@ "dependencies": { "sax": { "version": "1.2.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true } @@ -5283,7 +5402,8 @@ }, "node-pre-gyp": { "version": "0.11.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==", "dev": true, "optional": true, "requires": { @@ -5301,7 +5421,8 @@ }, "nopt": { "version": "4.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, "requires": { @@ -5311,13 +5432,15 @@ }, "npm-bundled": { "version": "1.0.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.1.12", - "bundled": true, + "resolved": false, + "integrity": "sha512-WJKFOVMeAlsU/pjXuqVdzU0WfgtIBCupkEVwn+1Y0ERAbUfWw8R4GjgVbaKnUjRoD2FoQbHOCbOyT5Mbs9Lw4g==", "dev": true, "optional": true, "requires": { @@ -5327,7 +5450,8 @@ }, "npmlog": { "version": "4.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, "requires": { @@ -5339,18 +5463,21 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "object-assign": { "version": "4.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" @@ -5358,19 +5485,22 @@ }, "os-homedir": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, "requires": { @@ -5380,19 +5510,22 @@ }, "path-is-absolute": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { "version": "1.2.8", - "bundled": true, + "resolved": false, + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "optional": true, "requires": { @@ -5404,7 +5537,8 @@ "dependencies": { "minimist": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true } @@ -5412,7 +5546,8 @@ }, "readable-stream": { "version": "2.3.6", - "bundled": true, + "resolved": false, + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, "requires": { @@ -5427,7 +5562,8 @@ }, "rimraf": { "version": "2.6.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "optional": true, "requires": { @@ -5436,36 +5572,42 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "safer-buffer": { "version": "2.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "semver": { "version": "5.5.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -5475,7 +5617,8 @@ }, "string_decoder": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, "requires": { @@ -5484,7 +5627,8 @@ }, "strip-ansi": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -5492,13 +5636,15 @@ }, "strip-json-comments": { "version": "2.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.6", - "bundled": true, + "resolved": false, + "integrity": "sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg==", "dev": true, "optional": true, "requires": { @@ -5513,13 +5659,15 @@ }, "util-deprecate": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "optional": true, "requires": { @@ -5528,12 +5676,14 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "yallist": { "version": "3.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", "dev": true } } @@ -5567,10 +5717,25 @@ "dev": true }, "get-stream": { - "version": "3.0.0", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + }, + "dependencies": { + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } }, "get-value": { "version": "2.0.6", @@ -5685,6 +5850,14 @@ "timed-out": "^4.0.0", "unzip-response": "^2.0.1", "url-parse-lax": "^1.0.0" + }, + "dependencies": { + "get-stream": { + "version": "3.0.0", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + } } }, "graceful-fs": { @@ -6403,101 +6576,106 @@ } }, "ipfs": { - "version": "0.31.7", - "resolved": "https://registry.npmjs.org/ipfs/-/ipfs-0.31.7.tgz", - "integrity": "sha512-HuA0Y6K7Y6f2Yu+ehUlGhv5VF2PtdZuME1AWYu/8zkfZ+HRpIYANjoK9GqZh6CQjOTJnIrEdqkHpOivUrZnIIg==", + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/ipfs/-/ipfs-0.33.1.tgz", + "integrity": "sha512-He22aMi/qJYcao4zkh9fS1cZZWKPWIyO964j/Bt+DhEUVO79DBBGW+PuF3I8IfVE8ihDxImxNboal3pbZT9EdA==", "dev": true, "requires": { "@nodeutils/defaults-deep": "^1.1.0", "async": "^2.6.1", - "big.js": "^5.1.2", + "big.js": "^5.2.2", "binary-querystring": "~0.1.2", - "bl": "^2.0.1", + "bl": "^2.1.2", "boom": "^7.2.0", "bs58": "^4.0.1", "byteman": "^1.3.5", - "cids": "~0.5.3", - "debug": "^3.1.0", + "cid-tool": "~0.1.0", + "cids": "~0.5.5", + "debug": "^4.1.0", "err-code": "^1.1.2", - "file-type": "^8.1.0", - "filesize": "^3.6.1", + "file-type": "^10.2.0", "fnv1a": "^1.0.1", "fsm-event": "^2.1.0", "get-folder-size": "^2.0.0", - "glob": "^7.1.2", + "glob": "^7.1.3", "hapi": "^16.6.2", "hapi-set-header": "^1.0.2", - "hoek": "^5.0.3", + "hoek": "^5.0.4", "human-to-milliseconds": "^1.0.0", - "interface-datastore": "~0.4.2", - "ipfs-api": "^24.0.0", - "ipfs-bitswap": "~0.20.3", - "ipfs-block": "~0.7.1", - "ipfs-block-service": "~0.14.0", - "ipfs-http-response": "~0.1.2", - "ipfs-mfs": "~0.3.0", + "interface-datastore": "~0.6.0", + "ipfs-api": "^26.1.0", + "ipfs-bitswap": "~0.21.0", + "ipfs-block": "~0.8.0", + "ipfs-block-service": "~0.15.1", + "ipfs-http-response": "~0.2.0", + "ipfs-mfs": "~0.4.2", "ipfs-multipart": "~0.1.0", - "ipfs-repo": "~0.23.1", - "ipfs-unixfs": "~0.1.15", - "ipfs-unixfs-engine": "~0.32.1", - "ipld": "~0.17.3", - "ipld-dag-cbor": "~0.12.1", - "ipld-dag-pb": "~0.14.6", - "is-ipfs": "~0.4.2", + "ipfs-repo": "~0.25.0", + "ipfs-unixfs": "~0.1.16", + "ipfs-unixfs-engine": "~0.33.0", + "ipld": "~0.19.1", + "ipld-bitcoin": "~0.1.8", + "ipld-dag-pb": "~0.14.11", + "ipld-ethereum": "^2.0.1", + "ipld-git": "~0.2.2", + "ipld-raw": "^2.0.1", + "ipld-zcash": "~0.1.6", + "ipns": "~0.3.0", + "is-ipfs": "~0.4.7", "is-pull-stream": "~0.0.0", "is-stream": "^1.1.0", "joi": "^13.4.0", "joi-browser": "^13.4.0", "joi-multiaddr": "^2.0.0", - "libp2p": "~0.23.0", + "libp2p": "~0.23.1", "libp2p-bootstrap": "~0.9.3", - "libp2p-circuit": "~0.2.0", - "libp2p-floodsub": "~0.15.0", - "libp2p-kad-dht": "~0.10.1", - "libp2p-keychain": "~0.3.1", + "libp2p-crypto": "~0.14.0", + "libp2p-kad-dht": "~0.10.6", + "libp2p-keychain": "~0.3.3", "libp2p-mdns": "~0.12.0", - "libp2p-mplex": "~0.8.0", + "libp2p-mplex": "~0.8.2", + "libp2p-record": "~0.6.0", "libp2p-secio": "~0.10.0", - "libp2p-tcp": "~0.12.0", - "libp2p-webrtc-star": "~0.15.3", - "libp2p-websocket-star": "~0.8.1", + "libp2p-tcp": "~0.13.0", + "libp2p-webrtc-star": "~0.15.5", + "libp2p-websocket-star": "~0.9.0", "libp2p-websockets": "~0.12.0", - "lodash": "^4.17.10", - "mafmt": "^6.0.0", - "mime-types": "^2.1.19", + "lodash": "^4.17.11", + "mafmt": "^6.0.2", + "mime-types": "^2.1.21", "mkdirp": "~0.5.1", "multiaddr": "^5.0.0", "multiaddr-to-uri": "^4.0.0", - "multibase": "~0.4.0", - "multihashes": "~0.4.13", + "multibase": "~0.5.0", + "multihashes": "~0.4.14", "once": "^1.4.0", - "path-exists": "^3.0.0", "peer-book": "~0.8.0", - "peer-id": "~0.11.0", + "peer-id": "~0.12.0", "peer-info": "~0.14.1", - "progress": "^2.0.0", - "prom-client": "^11.1.1", - "prometheus-gc-stats": "~0.5.1", + "progress": "^2.0.1", + "prom-client": "^11.1.3", + "prometheus-gc-stats": "~0.6.0", "promisify-es6": "^1.0.3", "pull-abortable": "^4.1.1", - "pull-defer": "~0.2.2", + "pull-catch": "^1.0.0", + "pull-defer": "~0.2.3", "pull-file": "^1.1.0", "pull-ndjson": "~0.1.1", "pull-paramap": "^1.2.2", "pull-pushable": "^2.2.0", "pull-sort": "^1.0.1", - "pull-stream": "^3.6.8", + "pull-stream": "^3.6.9", "pull-stream-to-stream": "^1.3.4", "pull-zip": "^2.0.1", + "pump": "^3.0.0", "read-pkg-up": "^4.0.0", - "readable-stream": "2.3.6", + "readable-stream": "3.0.6", + "receptacle": "^1.3.2", "stream-to-pull-stream": "^1.7.2", - "tar-stream": "^1.6.1", + "tar-stream": "^1.6.2", "temp": "~0.8.3", - "through2": "^2.0.3", "update-notifier": "^2.5.0", - "yargs": "^12.0.1", - "yargs-parser": "^10.1.0", + "yargs": "^12.0.2", "yargs-promise": "^1.1.0" }, "dependencies": { @@ -6509,27 +6687,87 @@ "requires": { "readable-stream": "^2.3.5", "safe-buffer": "^5.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + } } }, "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { "ms": "^2.1.1" } }, - "interface-datastore": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-0.4.2.tgz", - "integrity": "sha512-Vztsb1SXZANtwwGkpDoxOTMELhhuCklkQKbjma6PY4XLwIyrhQ1xEKaG1sOHavMXoghThw8IZEysiCDrofOQKQ==", + "ipfs-repo": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/ipfs-repo/-/ipfs-repo-0.25.2.tgz", + "integrity": "sha512-TuhUdturwwG/hKdK2m1fv6Hz1hvHsdXQqAsDr0uEXK8WOfz7CZ9IHLU3feDTDhh8nr4fB0nOO5xaTz3cCZ+/9Q==", "dev": true, "requires": { - "async": "^2.6.0", - "pull-defer": "^0.2.2", - "pull-stream": "^3.6.1", - "uuid": "^3.1.0" + "async": "^2.6.1", + "base32.js": "~0.1.0", + "big.js": "^5.2.2", + "cids": "~0.5.5", + "datastore-core": "~0.6.0", + "datastore-fs": "~0.7.0", + "datastore-level": "~0.10.0", + "debug": "^4.1.0", + "interface-datastore": "~0.6.0", + "ipfs-block": "~0.7.1", + "lodash.get": "^4.4.2", + "lodash.has": "^4.5.2", + "lodash.set": "^4.3.2", + "multiaddr": "^5.0.0", + "proper-lockfile": "^3.2.0", + "pull-stream": "^3.6.9", + "sort-keys": "^2.0.0" + }, + "dependencies": { + "ipfs-block": { + "version": "0.7.1", + "resolved": "http://registry.npmjs.org/ipfs-block/-/ipfs-block-0.7.1.tgz", + "integrity": "sha512-ABZS9J/+OaDwc10zu6pIVdxWnOD/rkPEravk7FRVuRep7/zKSjffNhO/WuHN7Ex+MOBMz7mty0e+i6xjGnRsRQ==", + "dev": true, + "requires": { + "cids": "^0.5.3", + "class-is": "^1.1.0" + } + } + } + }, + "ipld-dag-pb": { + "version": "0.14.11", + "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.14.11.tgz", + "integrity": "sha512-ja4FH6elDprVuJBkNObFlq7+9h1Q3aoQx5SSG/v3I9e7j19nwyuMhLJYwBhdv29LiqpyD2cEqNrJLm8lWn0lJg==", + "dev": true, + "requires": { + "async": "^2.6.1", + "bs58": "^4.0.1", + "cids": "~0.5.4", + "class-is": "^1.1.0", + "is-ipfs": "~0.4.2", + "multihashing-async": "~0.5.1", + "protons": "^1.0.1", + "pull-stream": "^3.6.9", + "pull-traverse": "^1.0.3", + "stable": "~0.1.8" } }, "ms": { @@ -6537,63 +6775,133 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "readable-stream": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.0.6.tgz", + "integrity": "sha512-9E1oLoOWfhSXHGv6QlwXJim7uNzd9EVlWK+21tCU9Ju/kR0/p2AZYPz4qSchgO8PlLIH4FpZYfzwS+rEksZjIg==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } } } }, "ipfs-api": { - "version": "24.0.2", - "resolved": "https://registry.npmjs.org/ipfs-api/-/ipfs-api-24.0.2.tgz", - "integrity": "sha512-3uxSZ+KNlQql3HO//gfR2Q+MTrfcmkLPlGP9Ewv28Ri+IEUZ3oawo9JahWCEGvXrnJmpRpD9Ko8dYHQZTq+3bA==", + "version": "26.1.2", + "resolved": "https://registry.npmjs.org/ipfs-api/-/ipfs-api-26.1.2.tgz", + "integrity": "sha512-HkM6vQOHL9z9ZCXIrbDXvAOsIzfWPaAac9kY+SjUuVqMydWHzP8qTxfv5jaXResGbmLcbwcROhuqgJU+HrclSg==", "dev": true, "requires": { "async": "^2.6.1", - "big.js": "^5.1.2", + "big.js": "^5.2.2", + "bl": "^2.1.2", "bs58": "^4.0.1", - "cids": "~0.5.3", + "cids": "~0.5.5", "concat-stream": "^1.6.2", - "debug": "^3.1.0", - "detect-node": "^2.0.3", + "debug": "^4.1.0", + "detect-node": "^2.0.4", + "end-of-stream": "^1.4.1", "flatmap": "0.0.3", - "glob": "^7.1.2", - "ipfs-block": "~0.7.1", - "ipfs-unixfs": "~0.1.15", - "ipld-dag-cbor": "~0.12.1", - "ipld-dag-pb": "~0.14.6", - "is-ipfs": "~0.4.2", + "glob": "^7.1.3", + "ipfs-block": "~0.8.0", + "ipfs-unixfs": "~0.1.16", + "ipld-dag-cbor": "~0.13.0", + "ipld-dag-pb": "~0.14.11", + "is-ipfs": "~0.4.7", "is-pull-stream": "0.0.0", "is-stream": "^1.1.0", - "libp2p-crypto": "~0.13.0", + "libp2p-crypto": "~0.14.0", + "lodash": "^4.17.11", "lru-cache": "^4.1.3", "multiaddr": "^5.0.0", - "multibase": "~0.4.0", - "multihashes": "~0.4.13", + "multibase": "~0.5.0", + "multihashes": "~0.4.14", "ndjson": "^1.5.0", "once": "^1.4.0", - "peer-id": "~0.11.0", + "peer-id": "~0.12.0", "peer-info": "~0.14.1", "promisify-es6": "^1.0.3", - "pull-defer": "~0.2.2", + "pull-defer": "~0.2.3", "pull-pushable": "^2.2.0", "pull-stream-to-stream": "^1.3.4", "pump": "^3.0.0", "qs": "^6.5.2", - "readable-stream": "^2.3.6", - "stream-http": "^2.8.3", + "readable-stream": "^3.0.6", + "stream-http": "^3.0.0", "stream-to-pull-stream": "^1.7.2", "streamifier": "~0.1.1", - "tar-stream": "^1.6.1" + "tar-stream": "^1.6.2", + "through2": "^2.0.3" }, "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "bl": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-2.1.2.tgz", + "integrity": "sha512-DvC0x+PxmSJNx8wXoFV15pC2+GOJ3ohb4F1REq3X32a2Z3nEBpR1Guu740M7ouYAImFj4BXDNilLNZbygtG9lQ==", "dev": true, "requires": { - "ms": "^2.1.1" + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + } } }, - "ms": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ipld-dag-pb": { + "version": "0.14.11", + "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.14.11.tgz", + "integrity": "sha512-ja4FH6elDprVuJBkNObFlq7+9h1Q3aoQx5SSG/v3I9e7j19nwyuMhLJYwBhdv29LiqpyD2cEqNrJLm8lWn0lJg==", + "dev": true, + "requires": { + "async": "^2.6.1", + "bs58": "^4.0.1", + "cids": "~0.5.4", + "class-is": "^1.1.0", + "is-ipfs": "~0.4.2", + "multihashing-async": "~0.5.1", + "protons": "^1.0.1", + "pull-stream": "^3.6.9", + "pull-traverse": "^1.0.3", + "stable": "~0.1.8" + } + }, + "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", @@ -6608,20 +6916,31 @@ "end-of-stream": "^1.1.0", "once": "^1.3.1" } + }, + "readable-stream": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", + "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } } } }, "ipfs-bitswap": { - "version": "0.20.3", - "resolved": "https://registry.npmjs.org/ipfs-bitswap/-/ipfs-bitswap-0.20.3.tgz", - "integrity": "sha512-qXg/QhevKBU/tKdWgW6yhcSKQDQx+4Mvv9HEeoVjkqZ9Pagmojk6yGk8X4J9H2G2PagvHXkWsqwqyKho7RcPWA==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/ipfs-bitswap/-/ipfs-bitswap-0.21.1.tgz", + "integrity": "sha512-uuT0evC8Kv39NwHUf/wa21DplFEMCV9A2pdIRI7BJi0R4i2rDTEXoLXu5/ivWvVrNU22JDUyvROOpp6Dh0Gd4Q==", "dev": true, "requires": { "async": "^2.6.1", - "big.js": "^5.1.2", - "cids": "~0.5.3", - "debug": "^3.1.0", - "ipfs-block": "~0.7.1", + "big.js": "^5.2.2", + "cids": "~0.5.5", + "debug": "^4.1.0", + "ipfs-block": "~0.8.0", "lodash.debounce": "^4.0.8", "lodash.find": "^4.6.0", "lodash.groupby": "^4.6.0", @@ -6635,17 +6954,17 @@ "multicodec": "~0.2.7", "multihashing-async": "~0.5.1", "protons": "^1.0.1", - "pull-defer": "~0.2.2", - "pull-length-prefixed": "^1.3.0", + "pull-defer": "~0.2.3", + "pull-length-prefixed": "^1.3.1", "pull-pushable": "^2.2.0", - "pull-stream": "^3.6.8", + "pull-stream": "^3.6.9", "varint-decoder": "~0.1.1" }, "dependencies": { "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { "ms": "^2.1.1" @@ -6660,36 +6979,188 @@ } }, "ipfs-block": { - "version": "0.7.1", - "resolved": "http://registry.npmjs.org/ipfs-block/-/ipfs-block-0.7.1.tgz", - "integrity": "sha512-ABZS9J/+OaDwc10zu6pIVdxWnOD/rkPEravk7FRVuRep7/zKSjffNhO/WuHN7Ex+MOBMz7mty0e+i6xjGnRsRQ==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/ipfs-block/-/ipfs-block-0.8.0.tgz", + "integrity": "sha512-znNtFRxXlJYP1/Q4u0tGFJUceH9pNww8WA+zair6T3y7d28m+vtUDJGn96M7ZlFFSkByQyQsAiq2ssNhKtMzxw==", "dev": true, "requires": { - "cids": "^0.5.3", + "cids": "~0.5.5", "class-is": "^1.1.0" } }, "ipfs-block-service": { - "version": "0.14.0", - "resolved": "http://registry.npmjs.org/ipfs-block-service/-/ipfs-block-service-0.14.0.tgz", - "integrity": "sha512-qu5VdBSAh/44wtqVgyoyWebjIY6mLbiEZObwYZHEZ5VFuU4oOlfZ+s2oz2I5lTw1eeL7SGccQeshQ0OePxIPnw==", - "dev": true + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/ipfs-block-service/-/ipfs-block-service-0.15.2.tgz", + "integrity": "sha512-iudmJO7UJZHonWoXyakuzy+bpV/7QVDm/g8eCqKN2BvhSjnLepaxdTyaXxJ76F2EOav1hdBP+U3Z9Mg/aCFPgg==", + "dev": true, + "requires": { + "async": "^2.6.1" + } + }, + "ipfs-http-client": { + "version": "27.1.0", + "resolved": "https://registry.npmjs.org/ipfs-http-client/-/ipfs-http-client-27.1.0.tgz", + "integrity": "sha512-Id9C0V8Bxnr8xBjXdVf7qUBAnslkvgHSFJw+csx4t5dqqeaI/aOLnNZG/6RBgmvI0//3ixKgwzgSt2vBHxeikw==", + "dev": true, + "requires": { + "async": "^2.6.1", + "big.js": "^5.2.2", + "bl": "^2.1.2", + "bs58": "^4.0.1", + "cids": "~0.5.5", + "concat-stream": "^1.6.2", + "debug": "^4.1.0", + "detect-node": "^2.0.4", + "end-of-stream": "^1.4.1", + "flatmap": "0.0.3", + "glob": "^7.1.3", + "ipfs-block": "~0.8.0", + "ipfs-unixfs": "~0.1.16", + "ipld-dag-cbor": "~0.13.0", + "ipld-dag-pb": "~0.15.0", + "is-ipfs": "~0.4.7", + "is-pull-stream": "0.0.0", + "is-stream": "^1.1.0", + "libp2p-crypto": "~0.14.0", + "lodash": "^4.17.11", + "lru-cache": "^4.1.3", + "multiaddr": "^5.0.2", + "multibase": "~0.6.0", + "multihashes": "~0.4.14", + "ndjson": "^1.5.0", + "once": "^1.4.0", + "peer-id": "~0.12.0", + "peer-info": "~0.14.1", + "promisify-es6": "^1.0.3", + "pull-defer": "~0.2.3", + "pull-pushable": "^2.2.0", + "pull-stream-to-stream": "^1.3.4", + "pump": "^3.0.0", + "qs": "^6.5.2", + "readable-stream": "^3.0.6", + "stream-http": "^3.0.0", + "stream-to-pull-stream": "^1.7.2", + "streamifier": "~0.1.1", + "tar-stream": "^1.6.2", + "through2": "^2.0.3" + }, + "dependencies": { + "base-x": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.4.tgz", + "integrity": "sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA==", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "bl": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-2.1.2.tgz", + "integrity": "sha512-DvC0x+PxmSJNx8wXoFV15pC2+GOJ3ohb4F1REq3X32a2Z3nEBpR1Guu740M7ouYAImFj4BXDNilLNZbygtG9lQ==", + "dev": true, + "requires": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + } + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ipld-dag-pb": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.15.2.tgz", + "integrity": "sha512-9mzeYW4FneGROH+/PXMbXsfy3cUsMYHaI6vUu8nNpSTyQdGF+fa1ViA+jvqWzM8zXYwG4OOSCAAADssJeELAvw==", + "dev": true, + "requires": { + "async": "^2.6.1", + "bs58": "^4.0.1", + "cids": "~0.5.4", + "class-is": "^1.1.0", + "is-ipfs": "~0.4.2", + "multihashing-async": "~0.5.1", + "protons": "^1.0.1", + "pull-stream": "^3.6.9", + "pull-traverse": "^1.0.3", + "stable": "~0.1.8" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "multibase": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.0.tgz", + "integrity": "sha512-R9bNLQhbD7MsitPm1NeY7w9sDgu6d7cuj25snAWH7k5PSNPSwIQQBpcpj8jx1W96dLbdigZqmUWOdQRMnAmgjA==", + "dev": true, + "requires": { + "base-x": "3.0.4" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "readable-stream": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", + "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } }, "ipfs-http-response": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/ipfs-http-response/-/ipfs-http-response-0.1.4.tgz", - "integrity": "sha512-qVi0AK3evZBbHljePgmeFy6o8RBVTOmPXUgRNHrwFr99DmJHPhbgJ/Wse0vpQsKwo3dd1m7RP33GHE9Xd1vmPA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ipfs-http-response/-/ipfs-http-response-0.2.1.tgz", + "integrity": "sha512-A3FPRa/IqiGE0dNRDDYRdDnPsq5eBuJWpASWGuEzTeGAh7Ad5dvIaU9JyIcLlcLLF3tAhueUnaFxjgAhot7xog==", "dev": true, "requires": { "async": "^2.6.0", - "cids": "^0.5.3", + "cids": "~0.5.5", "debug": "^3.1.0", "file-type": "^8.0.0", "filesize": "^3.6.1", "get-stream": "^3.0.0", - "ipfs-unixfs": "^0.1.14", + "ipfs-unixfs": "~0.1.14", "mime-types": "^2.1.18", - "multihashes": "^0.4.13", + "multihashes": "~0.4.13", "promisify-es6": "^1.0.3", "stream-to-blob": "^1.0.1" }, @@ -6703,6 +7174,18 @@ "ms": "^2.1.1" } }, + "file-type": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-8.1.0.tgz", + "integrity": "sha512-qyQ0pzAy78gVoJsmYeNgl8uH8yKhr1lVhW7JbzJmnlRi0I4R2eEDEJZVKG8agpDnLpacwNbDhLNG/LMdxHD2YQ==", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", @@ -6712,18 +7195,18 @@ } }, "ipfs-mfs": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/ipfs-mfs/-/ipfs-mfs-0.3.3.tgz", - "integrity": "sha512-gi9kIlTqDjNzSN3hvz4/Npheg1xfPMrSZl8NAie+QgvQjr7bpHgBAvv/N7GSOOgP40d0HbJqN61AqrSj2BVHWg==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/ipfs-mfs/-/ipfs-mfs-0.4.2.tgz", + "integrity": "sha512-6xcexwgnyXXbi3PeXfmCtKa8nMijm8lvRPvfm27/Jwv/gLU1sJkpI6KF0m/EBeM7mwl1pQYu4E03qVoz8hDxtA==", "dev": true, "requires": { "async": "^2.6.1", "blob": "~0.0.4", - "cids": "~0.5.3", - "debug": "^3.1.0", + "cids": "~0.5.4", + "debug": "^4.0.1", "file-api": "~0.10.4", "filereader-stream": "^2.0.0", - "interface-datastore": "~0.4.2", + "interface-datastore": "~0.6.0", "ipfs-unixfs": "~0.1.15", "ipfs-unixfs-engine": "~0.32.1", "is-pull-stream": "~0.0.0", @@ -6737,31 +7220,68 @@ "pull-defer": "~0.2.2", "pull-paramap": "^1.2.2", "pull-pushable": "^2.2.0", - "pull-stream": "^3.6.8", + "pull-stream": "^3.6.9", "pull-stream-to-stream": "^1.3.4", "pull-traverse": "^1.0.3", "stream-to-pull-stream": "^1.7.2" }, "dependencies": { "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { "ms": "^2.1.1" } }, - "interface-datastore": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-0.4.2.tgz", - "integrity": "sha512-Vztsb1SXZANtwwGkpDoxOTMELhhuCklkQKbjma6PY4XLwIyrhQ1xEKaG1sOHavMXoghThw8IZEysiCDrofOQKQ==", + "ipfs-unixfs-engine": { + "version": "0.32.8", + "resolved": "https://registry.npmjs.org/ipfs-unixfs-engine/-/ipfs-unixfs-engine-0.32.8.tgz", + "integrity": "sha512-YqLppNmG5M0rFj7QOTdRjny8xNKxmqKJE5DCOtc2ZMaXd4Semq+rEH23N2Mr1jYpimboDnadcv6jszi5cWRexw==", "dev": true, "requires": { - "async": "^2.6.0", - "pull-defer": "^0.2.2", - "pull-stream": "^3.6.1", - "uuid": "^3.1.0" + "async": "^2.6.1", + "cids": "~0.5.5", + "deep-extend": "~0.6.0", + "ipfs-unixfs": "~0.1.15", + "ipld-dag-pb": "~0.14.6", + "left-pad": "^1.3.0", + "multihashing-async": "~0.5.1", + "pull-batch": "^1.0.0", + "pull-block": "^1.4.0", + "pull-cat": "^1.1.11", + "pull-pair": "^1.1.0", + "pull-paramap": "^1.2.2", + "pull-pause": "0.0.2", + "pull-pushable": "^2.2.0", + "pull-stream": "^3.6.9", + "pull-through": "^1.0.18", + "pull-traverse": "^1.0.3", + "pull-write": "^1.1.4", + "rabin": "^1.6.0", + "sparse-array": "^1.3.1", + "stream-to-pull-stream": "^1.7.2" + }, + "dependencies": { + "ipld-dag-pb": { + "version": "0.14.11", + "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.14.11.tgz", + "integrity": "sha512-ja4FH6elDprVuJBkNObFlq7+9h1Q3aoQx5SSG/v3I9e7j19nwyuMhLJYwBhdv29LiqpyD2cEqNrJLm8lWn0lJg==", + "dev": true, + "requires": { + "async": "^2.6.1", + "bs58": "^4.0.1", + "cids": "~0.5.4", + "class-is": "^1.1.0", + "is-ipfs": "~0.4.2", + "multihashing-async": "~0.5.1", + "protons": "^1.0.1", + "pull-stream": "^3.6.9", + "pull-traverse": "^1.0.3", + "stable": "~0.1.8" + } + } } }, "ms": { @@ -6783,20 +7303,20 @@ } }, "ipfs-repo": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/ipfs-repo/-/ipfs-repo-0.23.1.tgz", - "integrity": "sha512-QjcAGkZXQyV5CsxKFdMHVKZuUWCy7wMroYBuy2G2N2Yu/lnwAg9Zuxsqv/3ULF+005bC1gWsld7UmYtbpHLKrQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/ipfs-repo/-/ipfs-repo-0.24.0.tgz", + "integrity": "sha512-dbLuqHVK+RIsDHmbk7oxySMJNRz/PIROgIe5vjQKRqZyuNdh9gFTUsUEvEDsfMUgPhnS9cnf53YAR2B+EuMUrA==", "dev": true, "requires": { "async": "^2.6.0", "base32.js": "~0.1.0", "big.js": "^5.0.3", "cids": "~0.5.3", - "datastore-core": "~0.4.0", - "datastore-fs": "~0.5.0", - "datastore-level": "~0.8.0", + "datastore-core": "~0.5.0", + "datastore-fs": "~0.6.0", + "datastore-level": "~0.9.0", "debug": "^3.1.0", - "interface-datastore": "~0.4.2", + "interface-datastore": "~0.5.0", "ipfs-block": "~0.7.1", "lock-me": "^1.0.4", "lodash.get": "^4.4.2", @@ -6808,31 +7328,47 @@ }, "dependencies": { "datastore-core": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-0.4.0.tgz", - "integrity": "sha512-BQC3f2jSUgVL1DUjt/ZJr9yWzNYyx3ApNh4NhMYFZBap0c+iTKJqyHRlO4bRT+CZG0mqqOUTNXU3qYvTJlN6OA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-0.5.0.tgz", + "integrity": "sha512-H15EZOXLZXJRXTKQ2EQ6lms93fYXsFUgTWYjtJfsGyhs8MAEfjzoFM1HpP4l1/TiWSz2weslyl57M/q2U65sgw==", "dev": true, "requires": { - "async": "^2.5.0", - "interface-datastore": "~0.4.0", - "left-pad": "^1.1.3", + "async": "^2.6.1", + "interface-datastore": "~0.5.0", + "left-pad": "^1.3.0", "pull-many": "^1.0.8", - "pull-stream": "^3.6.1" + "pull-stream": "^3.6.9" + } + }, + "datastore-fs": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/datastore-fs/-/datastore-fs-0.6.0.tgz", + "integrity": "sha512-/e2R+jxyR1ACzy3nzW02A0spUrBC525eeq0lVC0VDqdIO2qva1wCN5XDWwpmL7vxngSFGhzpKh42q58fT2YIOw==", + "dev": true, + "requires": { + "async": "^2.6.1", + "datastore-core": "~0.5.0", + "glob": "^7.1.3", + "graceful-fs": "^4.1.11", + "interface-datastore": "~0.5.0", + "mkdirp": "~0.5.1", + "pull-stream": "^3.6.9", + "write-file-atomic": "^2.3.0" } }, "datastore-level": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/datastore-level/-/datastore-level-0.8.0.tgz", - "integrity": "sha512-RSklSUhf4CBNXm8akR+Q7LvDE4J6NA8XfZ3h5pGPempdXcExFui5CoyHJscOlu0culvZzuJLU4k5PxcLPGzuMw==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/datastore-level/-/datastore-level-0.9.0.tgz", + "integrity": "sha512-BL2KE1P5xgYWFRsOdwPEpTwW6Ebpxnp3Ir6aAC5Era+zMS3Vtf14vn2q8cUMvc4GCo68iqL3pknT4Ds9/xFKMw==", "dev": true, "requires": { - "datastore-core": "~0.4.0", - "encoding-down": "^5.0.2", - "interface-datastore": "~0.4.1", + "datastore-core": "~0.5.0", + "encoding-down": "^5.0.4", + "interface-datastore": "~0.5.0", "level-js": "github:timkuijsten/level.js#18e03adab34c49523be7d3d58fafb0c632f61303", "leveldown": "^3.0.2", "levelup": "^2.0.2", - "pull-stream": "^3.6.1" + "pull-stream": "^3.6.9" } }, "debug": { @@ -6845,15 +7381,26 @@ } }, "interface-datastore": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-0.4.2.tgz", - "integrity": "sha512-Vztsb1SXZANtwwGkpDoxOTMELhhuCklkQKbjma6PY4XLwIyrhQ1xEKaG1sOHavMXoghThw8IZEysiCDrofOQKQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-0.5.0.tgz", + "integrity": "sha512-JBQG5zCsh71DdDD01PzRrhlFBI0FCj6zAlJVBcnsZlfK74BK7Yx8f3SPxk240/JplrA919mjfrpe1W7BaovtRg==", "dev": true, "requires": { - "async": "^2.6.0", - "pull-defer": "^0.2.2", - "pull-stream": "^3.6.1", - "uuid": "^3.1.0" + "async": "^2.6.1", + "err-code": "^1.1.2", + "pull-defer": "~0.2.3", + "pull-stream": "^3.6.9", + "uuid": "^3.3.2" + } + }, + "ipfs-block": { + "version": "0.7.1", + "resolved": "http://registry.npmjs.org/ipfs-block/-/ipfs-block-0.7.1.tgz", + "integrity": "sha512-ABZS9J/+OaDwc10zu6pIVdxWnOD/rkPEravk7FRVuRep7/zKSjffNhO/WuHN7Ex+MOBMz7mty0e+i6xjGnRsRQ==", + "dev": true, + "requires": { + "cids": "^0.5.3", + "class-is": "^1.1.0" } }, "ms": { @@ -6890,16 +7437,16 @@ } }, "ipfs-unixfs-engine": { - "version": "0.32.8", - "resolved": "https://registry.npmjs.org/ipfs-unixfs-engine/-/ipfs-unixfs-engine-0.32.8.tgz", - "integrity": "sha512-YqLppNmG5M0rFj7QOTdRjny8xNKxmqKJE5DCOtc2ZMaXd4Semq+rEH23N2Mr1jYpimboDnadcv6jszi5cWRexw==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/ipfs-unixfs-engine/-/ipfs-unixfs-engine-0.33.0.tgz", + "integrity": "sha512-NF4e9PB4I22Ca1qaGeCG0pBQOaYTpBWwgC+EKlAomwj6FD6BeFD4OpoaEAs9kp8dOdjY8yKrHe+tRg9AGgOoIw==", "dev": true, "requires": { "async": "^2.6.1", "cids": "~0.5.5", "deep-extend": "~0.6.0", - "ipfs-unixfs": "~0.1.15", - "ipld-dag-pb": "~0.14.6", + "ipfs-unixfs": "~0.1.16", + "ipld-dag-pb": "~0.14.11", "left-pad": "^1.3.0", "multihashing-async": "~0.5.1", "pull-batch": "^1.0.0", @@ -6916,25 +7463,45 @@ "rabin": "^1.6.0", "sparse-array": "^1.3.1", "stream-to-pull-stream": "^1.7.2" + }, + "dependencies": { + "ipld-dag-pb": { + "version": "0.14.11", + "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.14.11.tgz", + "integrity": "sha512-ja4FH6elDprVuJBkNObFlq7+9h1Q3aoQx5SSG/v3I9e7j19nwyuMhLJYwBhdv29LiqpyD2cEqNrJLm8lWn0lJg==", + "dev": true, + "requires": { + "async": "^2.6.1", + "bs58": "^4.0.1", + "cids": "~0.5.4", + "class-is": "^1.1.0", + "is-ipfs": "~0.4.2", + "multihashing-async": "~0.5.1", + "protons": "^1.0.1", + "pull-stream": "^3.6.9", + "pull-traverse": "^1.0.3", + "stable": "~0.1.8" + } + } } }, "ipfsd-ctl": { - "version": "0.39.5", - "resolved": "https://registry.npmjs.org/ipfsd-ctl/-/ipfsd-ctl-0.39.5.tgz", - "integrity": "sha512-QFkhlensPol2VPWkURAB5neMsvZ3VVV6nYXa1muaSqrjeu+Hf1h8vpHoF19EuEvKm68BVFtshPtREeIb5wRfaw==", + "version": "0.40.2", + "resolved": "https://registry.npmjs.org/ipfsd-ctl/-/ipfsd-ctl-0.40.2.tgz", + "integrity": "sha512-HCU8DT59u/AWYd7IhDMM8WlN7VXlVbGxwypCnbPAW54H4xPM4w8mFyWPYLvj2YLEoYxR6pFyt7i+1iXrCnpuaA==", "dev": true, "requires": { "async": "^2.6.1", - "base-x": "^3.0.4", - "boom": "^7.2.0", + "base-x": "^3.0.5", + "boom": "^7.2.2", "debug": "^4.1.0", "detect-node": "^2.0.4", "dexie": "^2.0.4", "execa": "^1.0.0", "hapi": "^16.6.2", "hat": "~0.0.3", - "ipfs-api": "^25.0.0", - "joi": "^13.1.2", + "ipfs-http-client": "^27.0.0", + "joi": "^14.0.4", "libp2p-crypto": "~0.14.0", "lodash.clone": "^4.5.0", "lodash.defaults": "^4.2.0", @@ -6944,33 +7511,10 @@ "protons": "^1.0.1", "rimraf": "^2.6.2", "safe-json-parse": "^4.0.0", - "safe-json-stringify": "^1.1.0", - "superagent": "^3.8.2" + "safe-json-stringify": "^1.2.0", + "superagent": "^4.0.0-beta.5" }, "dependencies": { - "bl": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-2.1.2.tgz", - "integrity": "sha512-DvC0x+PxmSJNx8wXoFV15pC2+GOJ3ohb4F1REq3X32a2Z3nEBpR1Guu740M7ouYAImFj4BXDNilLNZbygtG9lQ==", - "dev": true, - "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -6980,351 +7524,139 @@ "ms": "^2.1.1" } }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "ipfs-api": { - "version": "25.0.0", - "resolved": "https://registry.npmjs.org/ipfs-api/-/ipfs-api-25.0.0.tgz", - "integrity": "sha512-s+UYe+ZOkxSxU/J0O731HhuzXlmrpGoe1apj97p0yM8oLo0w1EzgWYe+0gV6A0+15cLsgREBD130gJFDGDw6dg==", - "dev": true, - "requires": { - "async": "^2.6.1", - "big.js": "^5.1.2", - "bl": "^2.0.1", - "bs58": "^4.0.1", - "cids": "~0.5.3", - "concat-stream": "^1.6.2", - "debug": "^3.1.0", - "detect-node": "^2.0.3", - "flatmap": "0.0.3", - "glob": "^7.1.2", - "ipfs-block": "~0.7.1", - "ipfs-unixfs": "~0.1.15", - "ipld-dag-cbor": "~0.12.1", - "ipld-dag-pb": "~0.14.6", - "is-ipfs": "~0.4.2", - "is-pull-stream": "0.0.0", - "is-stream": "^1.1.0", - "libp2p-crypto": "~0.13.0", - "lodash": "^4.17.11", - "lru-cache": "^4.1.3", - "multiaddr": "^5.0.0", - "multibase": "~0.4.0", - "multihashes": "~0.4.13", - "ndjson": "^1.5.0", - "once": "^1.4.0", - "peer-id": "~0.11.0", - "peer-info": "~0.14.1", - "promisify-es6": "^1.0.3", - "pull-defer": "~0.2.2", - "pull-pushable": "^2.2.0", - "pull-stream-to-stream": "^1.3.4", - "pump": "^3.0.0", - "qs": "^6.5.2", - "readable-stream": "^2.3.6", - "stream-http": "^3.0.0", - "stream-to-pull-stream": "^1.7.2", - "streamifier": "~0.1.1", - "tar-stream": "^1.6.1" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "libp2p-crypto": { - "version": "0.13.0", - "resolved": "http://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.13.0.tgz", - "integrity": "sha512-i3r1TBec/xYmC5bcpPiIs3OyUAU3iy53OdRdxqawKoWTQPjYB+TyQ4w+otT66Y0sMcw70O0wH3GFAfPmQgFn+g==", - "dev": true, - "requires": { - "asn1.js": "^5.0.0", - "async": "^2.6.0", - "browserify-aes": "^1.2.0", - "bs58": "^4.0.1", - "keypair": "^1.0.1", - "libp2p-crypto-secp256k1": "~0.2.2", - "multihashing-async": "~0.4.8", - "node-forge": "^0.7.5", - "pem-jwk": "^1.5.1", - "protons": "^1.0.1", - "rsa-pem-to-jwk": "^1.1.3", - "tweetnacl": "^1.0.0", - "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" - } - } - } - }, - "libp2p-crypto": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.14.1.tgz", - "integrity": "sha512-JP3bfEzNik76fFIWOeU909+v76tjj5BMukbPCc61bgh1ixftcHkr4bH79duz+oSxRpGA+orCLxvkhgALV+pfwg==", - "dev": true, - "requires": { - "asn1.js": "^5.0.1", - "async": "^2.6.1", - "browserify-aes": "^1.2.0", - "bs58": "^4.0.1", - "keypair": "^1.0.1", - "libp2p-crypto-secp256k1": "~0.2.2", - "multihashing-async": "~0.5.1", - "node-forge": "~0.7.6", - "pem-jwk": "^1.5.1", - "protons": "^1.0.1", - "rsa-pem-to-jwk": "^1.1.3", - "tweetnacl": "^1.0.0", - "ursa-optional": "~0.9.9", - "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" - }, - "dependencies": { - "multihashing-async": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.5.1.tgz", - "integrity": "sha512-Ft5lQNcJCfsns1QN1TDXqPZrrNwBYqIokprYJR2h2Jj01x0GFcYmJYAqHvme6vJoyI3XptEcmZpdr9g5Oy7q3Q==", - "dev": true, - "requires": { - "async": "^2.6.1", - "blakejs": "^1.1.0", - "js-sha3": "^0.7.0", - "multihashes": "~0.4.13", - "murmurhash3js": "^3.0.1", - "nodeify": "^1.0.1" - } - } - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "multihashing-async": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.4.8.tgz", - "integrity": "sha512-LCc4lfxmTJOHKIjZjFNgvmfB6nXS/ErLInT9uwU8udFrRm2PH+aTPk3mfCREKmCiSHOlCWiv2O8rlnBx+OjlMw==", - "dev": true, - "requires": { - "async": "^2.6.0", - "blakejs": "^1.1.0", - "js-sha3": "^0.7.0", - "multihashes": "~0.4.13", - "murmurhash3js": "^3.0.1", - "nodeify": "^1.0.1" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "stream-http": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.0.0.tgz", - "integrity": "sha512-JELJfd+btL9GHtxU3+XXhg9NLYrKFnhybfvRuDghtyVkOFydz3PKNT1df07AMr88qW03WHF+FSV0PySpXignCA==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^3.0.6", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", - "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "tweetnacl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", - "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=", + "hoek": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.2.tgz", + "integrity": "sha512-6qhh/wahGYZHFSFw12tBbJw5fsAhhwrrG/y3Cs0YMTv2WzMnL0oLPnQJjv1QJvEfylRSOFuP+xCu+tdx0tD16Q==", "dev": true - } - } - }, - "ipld": { - "version": "0.17.4", - "resolved": "https://registry.npmjs.org/ipld/-/ipld-0.17.4.tgz", - "integrity": "sha512-V+qGqt3CWYb72GzjSUQiPnzv7wLKDazB3zEBuiJmbVAta8RaoCuqb8cbmYN1riIW0pERRHqinrkNPdP9pZgkNA==", - "dev": true, - "requires": { - "async": "^2.6.1", - "cids": "~0.5.4", - "interface-datastore": "~0.5.0", - "ipfs-block": "~0.7.1", - "ipfs-block-service": "~0.14.0", - "ipfs-repo": "~0.24.0", - "ipld-bitcoin": "~0.1.7", - "ipld-dag-cbor": "~0.12.1", - "ipld-dag-pb": "~0.14.10", - "ipld-ethereum": "^2.0.1", - "ipld-git": "~0.2.1", - "ipld-raw": "^2.0.1", - "ipld-zcash": "~0.1.6", - "is-ipfs": "~0.4.2", - "lodash.flatten": "^4.4.0", - "lodash.includes": "^4.3.0", - "memdown": "^3.0.0", - "multihashes": "~0.4.14", - "pull-defer": "~0.2.3", - "pull-sort": "^1.0.1", - "pull-stream": "^3.6.9", - "pull-traverse": "^1.0.3" - }, - "dependencies": { - "datastore-core": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-0.5.0.tgz", - "integrity": "sha512-H15EZOXLZXJRXTKQ2EQ6lms93fYXsFUgTWYjtJfsGyhs8MAEfjzoFM1HpP4l1/TiWSz2weslyl57M/q2U65sgw==", - "dev": true, - "requires": { - "async": "^2.6.1", - "interface-datastore": "~0.5.0", - "left-pad": "^1.3.0", - "pull-many": "^1.0.8", - "pull-stream": "^3.6.9" - } - }, - "datastore-fs": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/datastore-fs/-/datastore-fs-0.6.0.tgz", - "integrity": "sha512-/e2R+jxyR1ACzy3nzW02A0spUrBC525eeq0lVC0VDqdIO2qva1wCN5XDWwpmL7vxngSFGhzpKh42q58fT2YIOw==", - "dev": true, - "requires": { - "async": "^2.6.1", - "datastore-core": "~0.5.0", - "glob": "^7.1.3", - "graceful-fs": "^4.1.11", - "interface-datastore": "~0.5.0", - "mkdirp": "~0.5.1", - "pull-stream": "^3.6.9", - "write-file-atomic": "^2.3.0" - } }, - "datastore-level": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/datastore-level/-/datastore-level-0.9.0.tgz", - "integrity": "sha512-BL2KE1P5xgYWFRsOdwPEpTwW6Ebpxnp3Ir6aAC5Era+zMS3Vtf14vn2q8cUMvc4GCo68iqL3pknT4Ds9/xFKMw==", + "isemail": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz", + "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==", "dev": true, "requires": { - "datastore-core": "~0.5.0", - "encoding-down": "^5.0.4", - "interface-datastore": "~0.5.0", - "level-js": "github:timkuijsten/level.js#18e03adab34c49523be7d3d58fafb0c632f61303", - "leveldown": "^3.0.2", - "levelup": "^2.0.2", - "pull-stream": "^3.6.9" + "punycode": "2.x.x" } }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "joi": { + "version": "14.3.1", + "resolved": "https://registry.npmjs.org/joi/-/joi-14.3.1.tgz", + "integrity": "sha512-LQDdM+pkOrpAn4Lp+neNIFV3axv1Vna3j38bisbQhETPMANYRbFJFUyOZcOClYvM/hppMhGWuKSFEK9vjrB+bQ==", "dev": true, "requires": { - "ms": "^2.1.1" + "hoek": "6.x.x", + "isemail": "3.x.x", + "topo": "3.x.x" } }, - "interface-datastore": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-0.5.0.tgz", - "integrity": "sha512-JBQG5zCsh71DdDD01PzRrhlFBI0FCj6zAlJVBcnsZlfK74BK7Yx8f3SPxk240/JplrA919mjfrpe1W7BaovtRg==", + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "topo": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz", + "integrity": "sha512-IgpPtvD4kjrJ7CRA3ov2FhWQADwv+Tdqbsf1ZnPUSAtCJ9e1Z44MmoSGDXGk4IppoZA7jd/QRkNddlLJWlUZsQ==", "dev": true, "requires": { - "async": "^2.6.1", - "err-code": "^1.1.2", - "pull-defer": "~0.2.3", - "pull-stream": "^3.6.9", - "uuid": "^3.3.2" + "hoek": "6.x.x" + } + } + } + }, + "ipld": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/ipld/-/ipld-0.19.3.tgz", + "integrity": "sha512-MK7hKGT2bUFs82XjVgM+12RhrAALVAdS/2bXJX4zJR0hPSXe/jXIqv83DijLk98zEjMujoPxh/Er+VVXNSr4gw==", + "dev": true, + "requires": { + "async": "^2.6.1", + "cids": "~0.5.5", + "interface-datastore": "~0.6.0", + "ipfs-block": "~0.8.0", + "ipfs-block-service": "~0.15.0", + "ipfs-repo": "~0.25.0", + "ipld-dag-cbor": "~0.13.0", + "ipld-dag-pb": "~0.14.11", + "ipld-raw": "^2.0.1", + "merge-options": "^1.0.1", + "pull-defer": "~0.2.3", + "pull-stream": "^3.6.9", + "pull-traverse": "^1.0.3" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" } }, "ipfs-repo": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/ipfs-repo/-/ipfs-repo-0.24.0.tgz", - "integrity": "sha512-dbLuqHVK+RIsDHmbk7oxySMJNRz/PIROgIe5vjQKRqZyuNdh9gFTUsUEvEDsfMUgPhnS9cnf53YAR2B+EuMUrA==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/ipfs-repo/-/ipfs-repo-0.25.2.tgz", + "integrity": "sha512-TuhUdturwwG/hKdK2m1fv6Hz1hvHsdXQqAsDr0uEXK8WOfz7CZ9IHLU3feDTDhh8nr4fB0nOO5xaTz3cCZ+/9Q==", "dev": true, "requires": { - "async": "^2.6.0", + "async": "^2.6.1", "base32.js": "~0.1.0", - "big.js": "^5.0.3", - "cids": "~0.5.3", - "datastore-core": "~0.5.0", - "datastore-fs": "~0.6.0", - "datastore-level": "~0.9.0", - "debug": "^3.1.0", - "interface-datastore": "~0.5.0", + "big.js": "^5.2.2", + "cids": "~0.5.5", + "datastore-core": "~0.6.0", + "datastore-fs": "~0.7.0", + "datastore-level": "~0.10.0", + "debug": "^4.1.0", + "interface-datastore": "~0.6.0", "ipfs-block": "~0.7.1", - "lock-me": "^1.0.4", "lodash.get": "^4.4.2", "lodash.has": "^4.5.2", "lodash.set": "^4.3.2", - "multiaddr": "^4.0.0", - "pull-stream": "^3.6.7", + "multiaddr": "^5.0.0", + "proper-lockfile": "^3.2.0", + "pull-stream": "^3.6.9", "sort-keys": "^2.0.0" + }, + "dependencies": { + "ipfs-block": { + "version": "0.7.1", + "resolved": "http://registry.npmjs.org/ipfs-block/-/ipfs-block-0.7.1.tgz", + "integrity": "sha512-ABZS9J/+OaDwc10zu6pIVdxWnOD/rkPEravk7FRVuRep7/zKSjffNhO/WuHN7Ex+MOBMz7mty0e+i6xjGnRsRQ==", + "dev": true, + "requires": { + "cids": "^0.5.3", + "class-is": "^1.1.0" + } + } } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "multiaddr": { - "version": "4.0.0", - "resolved": "http://registry.npmjs.org/multiaddr/-/multiaddr-4.0.0.tgz", - "integrity": "sha512-zUatrOCfBd/tJNOSoJ10d2EI2FDXB9PyPZhqUMdXE9mOyR3C+HLuOjga2Ga/eChwvEHIpTYRMoIKF2Nv7af2qQ==", + "ipld-dag-pb": { + "version": "0.14.11", + "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.14.11.tgz", + "integrity": "sha512-ja4FH6elDprVuJBkNObFlq7+9h1Q3aoQx5SSG/v3I9e7j19nwyuMhLJYwBhdv29LiqpyD2cEqNrJLm8lWn0lJg==", "dev": true, "requires": { + "async": "^2.6.1", "bs58": "^4.0.1", + "cids": "~0.5.4", "class-is": "^1.1.0", - "ip": "^1.1.5", - "ip-address": "^5.8.9", - "lodash.filter": "^4.6.0", - "lodash.map": "^4.6.0", - "varint": "^5.0.0", - "xtend": "^4.0.1" + "is-ipfs": "~0.4.2", + "multihashing-async": "~0.5.1", + "protons": "^1.0.1", + "pull-stream": "^3.6.9", + "pull-traverse": "^1.0.3", + "stable": "~0.1.8" } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true } } }, @@ -7342,17 +7674,17 @@ } }, "ipld-dag-cbor": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/ipld-dag-cbor/-/ipld-dag-cbor-0.12.1.tgz", - "integrity": "sha512-m0BR/zR9sKIuY/PydppkpwO0S9w7+ob0as7RN3jQmMIpW9m8HW7hLznvtp1xpYZknH7efUhIaMHgaQP43E5IWQ==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/ipld-dag-cbor/-/ipld-dag-cbor-0.13.0.tgz", + "integrity": "sha512-74gtitUOWbLkGtqomhq7lDYwWzfFNwbwMXAj3jpti4ZtfM9VTJWVIQ+05u7NOCj8yaLwzFONHdcO0rJ+j/i0jA==", "dev": true, "requires": { - "async": "^2.6.0", - "borc": "^2.0.2", + "async": "^2.6.1", + "borc": "^2.0.3", "bs58": "^4.0.1", - "cids": "~0.5.2", - "is-circular": "^1.0.1", - "multihashes": "~0.4.12", + "cids": "~0.5.5", + "is-circular": "^1.0.2", + "multihashes": "~0.4.14", "multihashing-async": "~0.5.1", "traverse": "~0.6.6" }, @@ -7366,10 +7698,9 @@ } }, "ipld-dag-pb": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.14.11.tgz", - "integrity": "sha512-ja4FH6elDprVuJBkNObFlq7+9h1Q3aoQx5SSG/v3I9e7j19nwyuMhLJYwBhdv29LiqpyD2cEqNrJLm8lWn0lJg==", - "dev": true, + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.15.2.tgz", + "integrity": "sha512-9mzeYW4FneGROH+/PXMbXsfy3cUsMYHaI6vUu8nNpSTyQdGF+fa1ViA+jvqWzM8zXYwG4OOSCAAADssJeELAvw==", "requires": { "async": "^2.6.1", "bs58": "^4.0.1", @@ -7399,18 +7730,6 @@ "multihashes": "~0.4.12", "multihashing-async": "~0.5.1", "rlp": "^2.0.0" - }, - "dependencies": { - "ipfs-block": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/ipfs-block/-/ipfs-block-0.8.0.tgz", - "integrity": "sha512-znNtFRxXlJYP1/Q4u0tGFJUceH9pNww8WA+zair6T3y7d28m+vtUDJGn96M7ZlFFSkByQyQsAiq2ssNhKtMzxw==", - "dev": true, - "requires": { - "cids": "~0.5.5", - "class-is": "^1.1.0" - } - } } }, "ipld-git": { @@ -7459,6 +7778,94 @@ "zcash-bitcore-lib": "~0.13.20-rc3" } }, + "ipns": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/ipns/-/ipns-0.3.0.tgz", + "integrity": "sha512-3X8xS4AVgRbsqaTfpJ4OzqAJ2DOYXl9lh7AV/gq7qyF14A+YXk1zmCKc6xXS2GJSVkvsnoRsVGPRrQnDQoNksw==", + "dev": true, + "requires": { + "base32-encode": "^1.1.0", + "big.js": "^5.1.2", + "debug": "^3.1.0", + "interface-datastore": "~0.6.0", + "left-pad": "^1.3.0", + "libp2p-crypto": "~0.13.0", + "multihashes": "~0.4.14", + "nano-date": "^2.1.0", + "peer-id": "~0.11.0", + "protons": "^1.0.1" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "libp2p-crypto": { + "version": "0.13.0", + "resolved": "http://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.13.0.tgz", + "integrity": "sha512-i3r1TBec/xYmC5bcpPiIs3OyUAU3iy53OdRdxqawKoWTQPjYB+TyQ4w+otT66Y0sMcw70O0wH3GFAfPmQgFn+g==", + "dev": true, + "requires": { + "asn1.js": "^5.0.0", + "async": "^2.6.0", + "browserify-aes": "^1.2.0", + "bs58": "^4.0.1", + "keypair": "^1.0.1", + "libp2p-crypto-secp256k1": "~0.2.2", + "multihashing-async": "~0.4.8", + "node-forge": "^0.7.5", + "pem-jwk": "^1.5.1", + "protons": "^1.0.1", + "rsa-pem-to-jwk": "^1.1.3", + "tweetnacl": "^1.0.0", + "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "multihashing-async": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.4.8.tgz", + "integrity": "sha512-LCc4lfxmTJOHKIjZjFNgvmfB6nXS/ErLInT9uwU8udFrRm2PH+aTPk3mfCREKmCiSHOlCWiv2O8rlnBx+OjlMw==", + "dev": true, + "requires": { + "async": "^2.6.0", + "blakejs": "^1.1.0", + "js-sha3": "^0.7.0", + "multihashes": "~0.4.13", + "murmurhash3js": "^3.0.1", + "nodeify": "^1.0.1" + } + }, + "peer-id": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.11.0.tgz", + "integrity": "sha512-C/lRJk4CWIgOdKvfO572NvHbPcUwe49I6G0toIhDB5tCohqv/qzy0uBcAK9Ww8TvYI6U4J3C8ACShV9fWjNU4w==", + "dev": true, + "requires": { + "async": "^2.6.1", + "libp2p-crypto": "~0.13.0", + "lodash": "^4.17.10", + "multihashes": "~0.4.13" + } + }, + "tweetnacl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", + "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=", + "dev": true + } + } + }, "iron": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/iron/-/iron-4.0.5.tgz", @@ -7665,7 +8072,6 @@ "version": "0.4.8", "resolved": "https://registry.npmjs.org/is-ipfs/-/is-ipfs-0.4.8.tgz", "integrity": "sha512-xIKUeA24IFMfkmeAPEOZL448X7a08c/KzAGQp1e/QxC9bx/NNEdT/ohob3SW6eJO2UwJNjsbfMeNZ2B+Dk2Fdg==", - "dev": true, "requires": { "bs58": "4.0.1", "cids": "~0.5.6", @@ -7677,7 +8083,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.4.tgz", "integrity": "sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA==", - "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -7686,7 +8091,6 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.0.tgz", "integrity": "sha512-R9bNLQhbD7MsitPm1NeY7w9sDgu6d7cuj25snAWH7k5PSNPSwIQQBpcpj8jx1W96dLbdigZqmUWOdQRMnAmgjA==", - "dev": true, "requires": { "base-x": "3.0.4" } @@ -7758,8 +8162,7 @@ "is-promise": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-1.0.1.tgz", - "integrity": "sha1-MVc3YcBX4zwukaq56W2gjO++duU=", - "dev": true + "integrity": "sha1-MVc3YcBX4zwukaq56W2gjO++duU=" }, "is-pull-stream": { "version": "0.0.0", @@ -8009,8 +8412,7 @@ "js-sha3": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.7.0.tgz", - "integrity": "sha512-Wpks3yBDm0UcL5qlVhwW9Jr9n9i4FfeWBFOOXP5puDS/SiudJGhw7DPyBqn3487qD4F0lsC0q3zxink37f7zeA==", - "dev": true + "integrity": "sha512-Wpks3yBDm0UcL5qlVhwW9Jr9n9i4FfeWBFOOXP5puDS/SiudJGhw7DPyBqn3487qD4F0lsC0q3zxink37f7zeA==" }, "js-tokens": { "version": "4.0.0", @@ -8131,6 +8533,12 @@ "array-includes": "^3.0.3" } }, + "just-extend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", + "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", + "dev": true + }, "k-bucket": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/k-bucket/-/k-bucket-4.0.1.tgz", @@ -8403,6 +8811,61 @@ "peer-book": "~0.8.0", "peer-id": "~0.11.0", "peer-info": "~0.14.1" + }, + "dependencies": { + "libp2p-crypto": { + "version": "0.13.0", + "resolved": "http://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.13.0.tgz", + "integrity": "sha512-i3r1TBec/xYmC5bcpPiIs3OyUAU3iy53OdRdxqawKoWTQPjYB+TyQ4w+otT66Y0sMcw70O0wH3GFAfPmQgFn+g==", + "dev": true, + "requires": { + "asn1.js": "^5.0.0", + "async": "^2.6.0", + "browserify-aes": "^1.2.0", + "bs58": "^4.0.1", + "keypair": "^1.0.1", + "libp2p-crypto-secp256k1": "~0.2.2", + "multihashing-async": "~0.4.8", + "node-forge": "^0.7.5", + "pem-jwk": "^1.5.1", + "protons": "^1.0.1", + "rsa-pem-to-jwk": "^1.1.3", + "tweetnacl": "^1.0.0", + "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" + } + }, + "multihashing-async": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.4.8.tgz", + "integrity": "sha512-LCc4lfxmTJOHKIjZjFNgvmfB6nXS/ErLInT9uwU8udFrRm2PH+aTPk3mfCREKmCiSHOlCWiv2O8rlnBx+OjlMw==", + "dev": true, + "requires": { + "async": "^2.6.0", + "blakejs": "^1.1.0", + "js-sha3": "^0.7.0", + "multihashes": "~0.4.13", + "murmurhash3js": "^3.0.1", + "nodeify": "^1.0.1" + } + }, + "peer-id": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.11.0.tgz", + "integrity": "sha512-C/lRJk4CWIgOdKvfO572NvHbPcUwe49I6G0toIhDB5tCohqv/qzy0uBcAK9Ww8TvYI6U4J3C8ACShV9fWjNU4w==", + "dev": true, + "requires": { + "async": "^2.6.1", + "libp2p-crypto": "~0.13.0", + "lodash": "^4.17.10", + "multihashes": "~0.4.13" + } + }, + "tweetnacl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", + "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=", + "dev": true + } } }, "libp2p-bootstrap": { @@ -8430,22 +8893,9 @@ }, "ms": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "peer-id": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.12.0.tgz", - "integrity": "sha512-pPKk4IDBWGGzcjXe6zzngIwKmyadYNsIOUH1PKb7GYTVVTKHpHn78ljZNZdAXAWZ2V1TmlU2OS6d9MfW2E5DNA==", - "dev": true, - "requires": { - "async": "^2.6.1", - "class-is": "^1.1.0", - "libp2p-crypto": "~0.13.0", - "lodash": "^4.17.10", - "multihashes": "~0.4.13" - } + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true } } }, @@ -8479,11 +8929,64 @@ "ms": "^2.1.1" } }, + "libp2p-crypto": { + "version": "0.13.0", + "resolved": "http://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.13.0.tgz", + "integrity": "sha512-i3r1TBec/xYmC5bcpPiIs3OyUAU3iy53OdRdxqawKoWTQPjYB+TyQ4w+otT66Y0sMcw70O0wH3GFAfPmQgFn+g==", + "dev": true, + "requires": { + "asn1.js": "^5.0.0", + "async": "^2.6.0", + "browserify-aes": "^1.2.0", + "bs58": "^4.0.1", + "keypair": "^1.0.1", + "libp2p-crypto-secp256k1": "~0.2.2", + "multihashing-async": "~0.4.8", + "node-forge": "^0.7.5", + "pem-jwk": "^1.5.1", + "protons": "^1.0.1", + "rsa-pem-to-jwk": "^1.1.3", + "tweetnacl": "^1.0.0", + "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" + } + }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true + }, + "multihashing-async": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.4.8.tgz", + "integrity": "sha512-LCc4lfxmTJOHKIjZjFNgvmfB6nXS/ErLInT9uwU8udFrRm2PH+aTPk3mfCREKmCiSHOlCWiv2O8rlnBx+OjlMw==", + "dev": true, + "requires": { + "async": "^2.6.0", + "blakejs": "^1.1.0", + "js-sha3": "^0.7.0", + "multihashes": "~0.4.13", + "murmurhash3js": "^3.0.1", + "nodeify": "^1.0.1" + } + }, + "peer-id": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.11.0.tgz", + "integrity": "sha512-C/lRJk4CWIgOdKvfO572NvHbPcUwe49I6G0toIhDB5tCohqv/qzy0uBcAK9Ww8TvYI6U4J3C8ACShV9fWjNU4w==", + "dev": true, + "requires": { + "async": "^2.6.1", + "libp2p-crypto": "~0.13.0", + "lodash": "^4.17.10", + "multihashes": "~0.4.13" + } + }, + "tweetnacl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", + "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=", + "dev": true } } }, @@ -8515,40 +9018,27 @@ } }, "libp2p-crypto": { - "version": "0.13.0", - "resolved": "http://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.13.0.tgz", - "integrity": "sha512-i3r1TBec/xYmC5bcpPiIs3OyUAU3iy53OdRdxqawKoWTQPjYB+TyQ4w+otT66Y0sMcw70O0wH3GFAfPmQgFn+g==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.14.1.tgz", + "integrity": "sha512-JP3bfEzNik76fFIWOeU909+v76tjj5BMukbPCc61bgh1ixftcHkr4bH79duz+oSxRpGA+orCLxvkhgALV+pfwg==", "dev": true, "requires": { - "asn1.js": "^5.0.0", - "async": "^2.6.0", + "asn1.js": "^5.0.1", + "async": "^2.6.1", "browserify-aes": "^1.2.0", "bs58": "^4.0.1", "keypair": "^1.0.1", "libp2p-crypto-secp256k1": "~0.2.2", - "multihashing-async": "~0.4.8", - "node-forge": "^0.7.5", + "multihashing-async": "~0.5.1", + "node-forge": "~0.7.6", "pem-jwk": "^1.5.1", "protons": "^1.0.1", "rsa-pem-to-jwk": "^1.1.3", "tweetnacl": "^1.0.0", + "ursa-optional": "~0.9.9", "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" }, "dependencies": { - "multihashing-async": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.4.8.tgz", - "integrity": "sha512-LCc4lfxmTJOHKIjZjFNgvmfB6nXS/ErLInT9uwU8udFrRm2PH+aTPk3mfCREKmCiSHOlCWiv2O8rlnBx+OjlMw==", - "dev": true, - "requires": { - "async": "^2.6.0", - "blakejs": "^1.1.0", - "js-sha3": "^0.7.0", - "multihashes": "~0.4.13", - "murmurhash3js": "^3.0.1", - "nodeify": "^1.0.1" - } - }, "tweetnacl": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", @@ -8612,39 +9102,11 @@ "ms": "^2.1.1" } }, - "libp2p-crypto": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.14.1.tgz", - "integrity": "sha512-JP3bfEzNik76fFIWOeU909+v76tjj5BMukbPCc61bgh1ixftcHkr4bH79duz+oSxRpGA+orCLxvkhgALV+pfwg==", - "dev": true, - "requires": { - "asn1.js": "^5.0.1", - "async": "^2.6.1", - "browserify-aes": "^1.2.0", - "bs58": "^4.0.1", - "keypair": "^1.0.1", - "libp2p-crypto-secp256k1": "~0.2.2", - "multihashing-async": "~0.5.1", - "node-forge": "~0.7.6", - "pem-jwk": "^1.5.1", - "protons": "^1.0.1", - "rsa-pem-to-jwk": "^1.1.3", - "tweetnacl": "^1.0.0", - "ursa-optional": "~0.9.9", - "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" - } - }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true - }, - "tweetnacl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", - "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=", - "dev": true } } }, @@ -8660,21 +9122,6 @@ "protons": "^1.0.1", "pull-length-prefixed": "^1.3.0", "pull-stream": "^3.6.9" - }, - "dependencies": { - "peer-id": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.12.0.tgz", - "integrity": "sha512-pPKk4IDBWGGzcjXe6zzngIwKmyadYNsIOUH1PKb7GYTVVTKHpHn78ljZNZdAXAWZ2V1TmlU2OS6d9MfW2E5DNA==", - "dev": true, - "requires": { - "async": "^2.6.1", - "class-is": "^1.1.0", - "libp2p-crypto": "~0.13.0", - "lodash": "^4.17.10", - "multihashes": "~0.4.13" - } - } } }, "libp2p-kad-dht": { @@ -8714,11 +9161,66 @@ "ms": "^2.1.1" } }, + "libp2p-crypto": { + "version": "0.13.0", + "resolved": "http://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.13.0.tgz", + "integrity": "sha512-i3r1TBec/xYmC5bcpPiIs3OyUAU3iy53OdRdxqawKoWTQPjYB+TyQ4w+otT66Y0sMcw70O0wH3GFAfPmQgFn+g==", + "dev": true, + "requires": { + "asn1.js": "^5.0.0", + "async": "^2.6.0", + "browserify-aes": "^1.2.0", + "bs58": "^4.0.1", + "keypair": "^1.0.1", + "libp2p-crypto-secp256k1": "~0.2.2", + "multihashing-async": "~0.4.8", + "node-forge": "^0.7.5", + "pem-jwk": "^1.5.1", + "protons": "^1.0.1", + "rsa-pem-to-jwk": "^1.1.3", + "tweetnacl": "^1.0.0", + "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" + }, + "dependencies": { + "multihashing-async": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.4.8.tgz", + "integrity": "sha512-LCc4lfxmTJOHKIjZjFNgvmfB6nXS/ErLInT9uwU8udFrRm2PH+aTPk3mfCREKmCiSHOlCWiv2O8rlnBx+OjlMw==", + "dev": true, + "requires": { + "async": "^2.6.0", + "blakejs": "^1.1.0", + "js-sha3": "^0.7.0", + "multihashes": "~0.4.13", + "murmurhash3js": "^3.0.1", + "nodeify": "^1.0.1" + } + } + } + }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true + }, + "peer-id": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.11.0.tgz", + "integrity": "sha512-C/lRJk4CWIgOdKvfO572NvHbPcUwe49I6G0toIhDB5tCohqv/qzy0uBcAK9Ww8TvYI6U4J3C8ACShV9fWjNU4w==", + "dev": true, + "requires": { + "async": "^2.6.1", + "libp2p-crypto": "~0.13.0", + "lodash": "^4.17.10", + "multihashes": "~0.4.13" + } + }, + "tweetnacl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", + "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=", + "dev": true } } }, @@ -8734,6 +9236,49 @@ "lodash": "^4.6.1", "pull-stream": "^3.6.8", "sanitize-filename": "^1.6.1" + }, + "dependencies": { + "libp2p-crypto": { + "version": "0.13.0", + "resolved": "http://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.13.0.tgz", + "integrity": "sha512-i3r1TBec/xYmC5bcpPiIs3OyUAU3iy53OdRdxqawKoWTQPjYB+TyQ4w+otT66Y0sMcw70O0wH3GFAfPmQgFn+g==", + "dev": true, + "requires": { + "asn1.js": "^5.0.0", + "async": "^2.6.0", + "browserify-aes": "^1.2.0", + "bs58": "^4.0.1", + "keypair": "^1.0.1", + "libp2p-crypto-secp256k1": "~0.2.2", + "multihashing-async": "~0.4.8", + "node-forge": "^0.7.5", + "pem-jwk": "^1.5.1", + "protons": "^1.0.1", + "rsa-pem-to-jwk": "^1.1.3", + "tweetnacl": "^1.0.0", + "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" + } + }, + "multihashing-async": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.4.8.tgz", + "integrity": "sha512-LCc4lfxmTJOHKIjZjFNgvmfB6nXS/ErLInT9uwU8udFrRm2PH+aTPk3mfCREKmCiSHOlCWiv2O8rlnBx+OjlMw==", + "dev": true, + "requires": { + "async": "^2.6.0", + "blakejs": "^1.1.0", + "js-sha3": "^0.7.0", + "multihashes": "~0.4.13", + "murmurhash3js": "^3.0.1", + "nodeify": "^1.0.1" + } + }, + "tweetnacl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", + "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=", + "dev": true + } } }, "libp2p-mdns": { @@ -8747,54 +9292,6 @@ "multicast-dns": "^7.2.0", "peer-id": "~0.12.0", "peer-info": "~0.14.1" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "libp2p-tcp": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.13.0.tgz", - "integrity": "sha512-bsmfxi+uVegK61x9UxBEgWtvujPl+zwzuVEyaVRs2IxHu6OE5MGKnj7AflzlK4e3w2HZn8nm4qwMV5m+fhqK1g==", - "dev": true, - "requires": { - "class-is": "^1.1.0", - "debug": "^3.1.0", - "interface-connection": "~0.3.2", - "ip-address": "^5.8.9", - "lodash.includes": "^4.3.0", - "lodash.isfunction": "^3.0.9", - "mafmt": "^6.0.2", - "multiaddr": "^5.0.0", - "once": "^1.4.0", - "stream-to-pull-stream": "^1.7.2" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "peer-id": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.12.0.tgz", - "integrity": "sha512-pPKk4IDBWGGzcjXe6zzngIwKmyadYNsIOUH1PKb7GYTVVTKHpHn78ljZNZdAXAWZ2V1TmlU2OS6d9MfW2E5DNA==", - "dev": true, - "requires": { - "async": "^2.6.1", - "class-is": "^1.1.0", - "libp2p-crypto": "~0.13.0", - "lodash": "^4.17.10", - "multihashes": "~0.4.13" - } - } } }, "libp2p-mplex": { @@ -8860,41 +9357,11 @@ "version": "0.8.3", "resolved": "https://registry.npmjs.org/libp2p-ping/-/libp2p-ping-0.8.3.tgz", "integrity": "sha512-8AiUH1FxscWmfZY5EpbEBHp5C2VLmfB4kdBD7pjiMhiv+DkYJkMBAMOD88703wSbldiuEys9shw8BxeDljr7wQ==", - "dev": true, - "requires": { - "libp2p-crypto": "~0.14.1", - "pull-handshake": "^1.1.4", - "pull-stream": "^3.6.9" - }, - "dependencies": { - "libp2p-crypto": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.14.1.tgz", - "integrity": "sha512-JP3bfEzNik76fFIWOeU909+v76tjj5BMukbPCc61bgh1ixftcHkr4bH79duz+oSxRpGA+orCLxvkhgALV+pfwg==", - "dev": true, - "requires": { - "asn1.js": "^5.0.1", - "async": "^2.6.1", - "browserify-aes": "^1.2.0", - "bs58": "^4.0.1", - "keypair": "^1.0.1", - "libp2p-crypto-secp256k1": "~0.2.2", - "multihashing-async": "~0.5.1", - "node-forge": "~0.7.6", - "pem-jwk": "^1.5.1", - "protons": "^1.0.1", - "rsa-pem-to-jwk": "^1.1.3", - "tweetnacl": "^1.0.0", - "ursa-optional": "~0.9.9", - "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" - } - }, - "tweetnacl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", - "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=", - "dev": true - } + "dev": true, + "requires": { + "libp2p-crypto": "~0.14.1", + "pull-handshake": "^1.1.4", + "pull-stream": "^3.6.9" } }, "libp2p-record": { @@ -8957,89 +9424,11 @@ "ms": "^2.1.1" } }, - "libp2p-crypto": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.14.1.tgz", - "integrity": "sha512-JP3bfEzNik76fFIWOeU909+v76tjj5BMukbPCc61bgh1ixftcHkr4bH79duz+oSxRpGA+orCLxvkhgALV+pfwg==", - "dev": true, - "requires": { - "asn1.js": "^5.0.1", - "async": "^2.6.1", - "browserify-aes": "^1.2.0", - "bs58": "^4.0.1", - "keypair": "^1.0.1", - "libp2p-crypto-secp256k1": "~0.2.2", - "multihashing-async": "~0.5.1", - "node-forge": "~0.7.6", - "pem-jwk": "^1.5.1", - "protons": "^1.0.1", - "rsa-pem-to-jwk": "^1.1.3", - "tweetnacl": "^1.0.0", - "ursa-optional": "~0.9.9", - "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" - } - }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true - }, - "peer-id": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.12.0.tgz", - "integrity": "sha512-pPKk4IDBWGGzcjXe6zzngIwKmyadYNsIOUH1PKb7GYTVVTKHpHn78ljZNZdAXAWZ2V1TmlU2OS6d9MfW2E5DNA==", - "dev": true, - "requires": { - "async": "^2.6.1", - "class-is": "^1.1.0", - "libp2p-crypto": "~0.13.0", - "lodash": "^4.17.10", - "multihashes": "~0.4.13" - }, - "dependencies": { - "libp2p-crypto": { - "version": "0.13.0", - "resolved": "http://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.13.0.tgz", - "integrity": "sha512-i3r1TBec/xYmC5bcpPiIs3OyUAU3iy53OdRdxqawKoWTQPjYB+TyQ4w+otT66Y0sMcw70O0wH3GFAfPmQgFn+g==", - "dev": true, - "requires": { - "asn1.js": "^5.0.0", - "async": "^2.6.0", - "browserify-aes": "^1.2.0", - "bs58": "^4.0.1", - "keypair": "^1.0.1", - "libp2p-crypto-secp256k1": "~0.2.2", - "multihashing-async": "~0.4.8", - "node-forge": "^0.7.5", - "pem-jwk": "^1.5.1", - "protons": "^1.0.1", - "rsa-pem-to-jwk": "^1.1.3", - "tweetnacl": "^1.0.0", - "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" - } - }, - "multihashing-async": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.4.8.tgz", - "integrity": "sha512-LCc4lfxmTJOHKIjZjFNgvmfB6nXS/ErLInT9uwU8udFrRm2PH+aTPk3mfCREKmCiSHOlCWiv2O8rlnBx+OjlMw==", - "dev": true, - "requires": { - "async": "^2.6.0", - "blakejs": "^1.1.0", - "js-sha3": "^0.7.0", - "multihashes": "~0.4.13", - "murmurhash3js": "^3.0.1", - "nodeify": "^1.0.1" - } - } - } - }, - "tweetnacl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", - "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=", - "dev": true } } }, @@ -9076,18 +9465,71 @@ "ms": "^2.1.1" } }, + "libp2p-crypto": { + "version": "0.13.0", + "resolved": "http://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.13.0.tgz", + "integrity": "sha512-i3r1TBec/xYmC5bcpPiIs3OyUAU3iy53OdRdxqawKoWTQPjYB+TyQ4w+otT66Y0sMcw70O0wH3GFAfPmQgFn+g==", + "dev": true, + "requires": { + "asn1.js": "^5.0.0", + "async": "^2.6.0", + "browserify-aes": "^1.2.0", + "bs58": "^4.0.1", + "keypair": "^1.0.1", + "libp2p-crypto-secp256k1": "~0.2.2", + "multihashing-async": "~0.4.8", + "node-forge": "^0.7.5", + "pem-jwk": "^1.5.1", + "protons": "^1.0.1", + "rsa-pem-to-jwk": "^1.1.3", + "tweetnacl": "^1.0.0", + "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" + } + }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true + }, + "multihashing-async": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.4.8.tgz", + "integrity": "sha512-LCc4lfxmTJOHKIjZjFNgvmfB6nXS/ErLInT9uwU8udFrRm2PH+aTPk3mfCREKmCiSHOlCWiv2O8rlnBx+OjlMw==", + "dev": true, + "requires": { + "async": "^2.6.0", + "blakejs": "^1.1.0", + "js-sha3": "^0.7.0", + "multihashes": "~0.4.13", + "murmurhash3js": "^3.0.1", + "nodeify": "^1.0.1" + } + }, + "peer-id": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.11.0.tgz", + "integrity": "sha512-C/lRJk4CWIgOdKvfO572NvHbPcUwe49I6G0toIhDB5tCohqv/qzy0uBcAK9Ww8TvYI6U4J3C8ACShV9fWjNU4w==", + "dev": true, + "requires": { + "async": "^2.6.1", + "libp2p-crypto": "~0.13.0", + "lodash": "^4.17.10", + "multihashes": "~0.4.13" + } + }, + "tweetnacl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", + "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=", + "dev": true } } }, "libp2p-tcp": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.12.1.tgz", - "integrity": "sha512-Vt1gLoOKAPAsgQ9IDwrwL4F5zA3gINsstwKKGgZaN5Boj/EeGghdug6vOL0TP2UKWudCuC2rCQUCPVOKZ5gYow==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.13.0.tgz", + "integrity": "sha512-bsmfxi+uVegK61x9UxBEgWtvujPl+zwzuVEyaVRs2IxHu6OE5MGKnj7AflzlK4e3w2HZn8nm4qwMV5m+fhqK1g==", "dev": true, "requires": { "class-is": "^1.1.0", @@ -9096,8 +9538,8 @@ "ip-address": "^5.8.9", "lodash.includes": "^4.3.0", "lodash.isfunction": "^3.0.9", - "mafmt": "^6.0.0", - "multiaddr": "^4.0.0", + "mafmt": "^6.0.2", + "multiaddr": "^5.0.0", "once": "^1.4.0", "stream-to-pull-stream": "^1.7.2" }, @@ -9116,22 +9558,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true - }, - "multiaddr": { - "version": "4.0.0", - "resolved": "http://registry.npmjs.org/multiaddr/-/multiaddr-4.0.0.tgz", - "integrity": "sha512-zUatrOCfBd/tJNOSoJ10d2EI2FDXB9PyPZhqUMdXE9mOyR3C+HLuOjga2Ga/eChwvEHIpTYRMoIKF2Nv7af2qQ==", - "dev": true, - "requires": { - "bs58": "^4.0.1", - "class-is": "^1.1.0", - "ip": "^1.1.5", - "ip-address": "^5.8.9", - "lodash.filter": "^4.6.0", - "lodash.map": "^4.6.0", - "varint": "^5.0.0", - "xtend": "^4.0.1" - } } } }, @@ -9183,50 +9609,37 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true - }, - "peer-id": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.12.0.tgz", - "integrity": "sha512-pPKk4IDBWGGzcjXe6zzngIwKmyadYNsIOUH1PKb7GYTVVTKHpHn78ljZNZdAXAWZ2V1TmlU2OS6d9MfW2E5DNA==", - "dev": true, - "requires": { - "async": "^2.6.1", - "class-is": "^1.1.0", - "libp2p-crypto": "~0.13.0", - "lodash": "^4.17.10", - "multihashes": "~0.4.13" - } } } }, "libp2p-websocket-star": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/libp2p-websocket-star/-/libp2p-websocket-star-0.8.1.tgz", - "integrity": "sha512-lDzL9fGWXveu6HEc6xuIEi036Bg1IQ+PliJJHxgSS9ozTkUwMT5dfvyugSWsZ7Gh4q7BYzr5cDZCNkR42GcRZw==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/libp2p-websocket-star/-/libp2p-websocket-star-0.9.1.tgz", + "integrity": "sha512-OdQ31meWB5uisi69xNS+ePfrY+ebwNNnm2mgCynZhBvgUvglZscb5HpOQ4Syg4AwyUrZUlCPblW6jmIBPtUFBQ==", "dev": true, "requires": { "async": "^2.6.1", "class-is": "^1.1.0", "data-queue": "0.0.3", - "debug": "^3.1.0", + "debug": "^4.1.0", "interface-connection": "~0.3.2", - "libp2p-crypto": "~0.13.0", - "mafmt": "^6.0.0", + "libp2p-crypto": "~0.14.1", + "mafmt": "^6.0.2", "merge-recursive": "0.0.3", - "multiaddr": "^5.0.0", + "multiaddr": "^5.0.2", "once": "^1.4.0", - "peer-id": "~0.10.7", + "peer-id": "~0.12.0", "peer-info": "~0.14.1", - "pull-stream": "^3.6.8", + "pull-stream": "^3.6.9", "socket.io-client": "^2.1.1", "socket.io-pull-stream": "~0.1.5", - "uuid": "^3.2.1" + "uuid": "^3.3.2" }, "dependencies": { "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { "ms": "^2.1.1" @@ -9237,61 +9650,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true - }, - "multihashing-async": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.4.8.tgz", - "integrity": "sha512-LCc4lfxmTJOHKIjZjFNgvmfB6nXS/ErLInT9uwU8udFrRm2PH+aTPk3mfCREKmCiSHOlCWiv2O8rlnBx+OjlMw==", - "dev": true, - "requires": { - "async": "^2.6.0", - "blakejs": "^1.1.0", - "js-sha3": "^0.7.0", - "multihashes": "~0.4.13", - "murmurhash3js": "^3.0.1", - "nodeify": "^1.0.1" - } - }, - "peer-id": { - "version": "0.10.7", - "resolved": "http://registry.npmjs.org/peer-id/-/peer-id-0.10.7.tgz", - "integrity": "sha512-VEpMFcL9q0NQijmR0jsj38OGbY4yzaWMEareVkDahopmlNT+Cpsot8btPgsgBBApP9NiZj2Enwvh8rZN30ocQw==", - "dev": true, - "requires": { - "async": "^2.6.0", - "libp2p-crypto": "~0.12.1", - "lodash": "^4.17.5", - "multihashes": "~0.4.13" - }, - "dependencies": { - "libp2p-crypto": { - "version": "0.12.1", - "resolved": "http://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.12.1.tgz", - "integrity": "sha512-1/z8rxZ0DcQNreZhEsl7PnLr7DWOioSvYbKBLGkRwNRiNh1JJLgh0PdTySBb44wkrOGT+TxcGRd7iq3/X6Wxwg==", - "dev": true, - "requires": { - "asn1.js": "^5.0.0", - "async": "^2.6.0", - "browserify-aes": "^1.1.1", - "bs58": "^4.0.1", - "keypair": "^1.0.1", - "libp2p-crypto-secp256k1": "~0.2.2", - "multihashing-async": "~0.4.7", - "node-forge": "^0.7.1", - "pem-jwk": "^1.5.1", - "protons": "^1.0.1", - "rsa-pem-to-jwk": "^1.1.3", - "tweetnacl": "^1.0.0", - "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" - } - } - } - }, - "tweetnacl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", - "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=", - "dev": true } } }, @@ -9318,6 +9676,14 @@ "parse-json": "^4.0.0", "pify": "^3.0.0", "strip-bom": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } } }, "loader-runner": { @@ -9380,8 +9746,7 @@ "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, "lodash.clone": { "version": "4.5.0", @@ -9419,12 +9784,6 @@ "integrity": "sha1-ywcE1Hq3F4n/oN6Ll92Sb7iLE7E=", "dev": true }, - "lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", - "dev": true - }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", @@ -9545,6 +9904,12 @@ "integrity": "sha1-o6bCsOvsxcLLocF+bmIP6BtT00c=", "dev": true }, + "lolex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-3.0.0.tgz", + "integrity": "sha512-hcnW80h3j2lbUfFdMArd5UPA/vxZJ+G8vobd+wg3nVEQA0EigStbYcrG030FJxL6xiDDPEkoMatV9xIh5OecQQ==", + "dev": true + }, "looper": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/looper/-/looper-3.0.0.tgz", @@ -9625,6 +9990,14 @@ "dev": true, "requires": { "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } } }, "map-age-cleaner": { @@ -9642,6 +10015,12 @@ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, + "map-or-similar": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/map-or-similar/-/map-or-similar-1.5.0.tgz", + "integrity": "sha1-beJlMXSt+12e3DPGnT6Sobdvrwg=", + "dev": true + }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -9674,17 +10053,37 @@ } }, "memdown": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", - "integrity": "sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", "dev": true, "requires": { - "abstract-leveldown": "~5.0.0", - "functional-red-black-tree": "~1.0.1", - "immediate": "~3.2.3", + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", "inherits": "~2.0.1", "ltgt": "~2.2.0", "safe-buffer": "~5.1.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "dev": true, + "requires": { + "xtend": "~4.0.0" + } + } + } + }, + "memoizerific": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/memoizerific/-/memoizerific-1.11.3.tgz", + "integrity": "sha1-fIekZGREwy11Q4VwkF8tvRsagFo=", + "dev": true, + "requires": { + "map-or-similar": "^1.5.0" } }, "memory-fs": { @@ -9697,6 +10096,15 @@ "readable-stream": "^2.0.1" } }, + "merge-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-1.0.1.tgz", + "integrity": "sha512-iuPV41VWKWBIOpBsjoxjDZw8/GbSfZ2mk7N1453bwMrfzdrIk7EzBd+8UVR6rkw67th7xnk9Dytl3J+lHPdxvg==", + "dev": true, + "requires": { + "is-plain-obj": "^1.1" + } + }, "merge-recursive": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/merge-recursive/-/merge-recursive-0.0.3.tgz", @@ -9811,31 +10219,6 @@ "xtend": "~4.0.0" } }, - "memdown": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", - "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", - "dev": true, - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", - "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - } - } - }, "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", @@ -10165,9 +10548,9 @@ } }, "multibase": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.4.0.tgz", - "integrity": "sha512-fnYvZJWDn3eSJ7EeWvS8zbOpRwuyPHpDggSnqGXkQMvYED5NdO9nyqnZboGvAT+r/60J8KZ09tW8YJHkS22sFw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.5.0.tgz", + "integrity": "sha512-7epKiK8/UBzraYZvOuZa8FH/00hMfTnzTy1OQol1YBU2csAYA7rwWh+iue9plXRmVFBGvmVKMuo0oq5sD47kvw==", "dev": true, "requires": { "base-x": "3.0.4" @@ -10198,7 +10581,6 @@ "version": "0.2.7", "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.2.7.tgz", "integrity": "sha512-96xc9zs7bsclMW0Po9ERnRFqcsWHY8OZ8JW/I8DeHG58YYJZy3cBGI00Ze7hz9Ix56DNHMTSxEj9cgoZByruMg==", - "dev": true, "requires": { "varint": "^5.0.0" } @@ -10207,7 +10589,6 @@ "version": "0.4.14", "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.14.tgz", "integrity": "sha512-V/g/EIN6nALXfS/xHUAgtfPP3mn3sPIF/i9beuGKf25QXS2QZYCpeVJbDPEannkz32B2fihzCe2D/KMrbcmefg==", - "dev": true, "requires": { "bs58": "^4.0.1", "varint": "^5.0.0" @@ -10217,7 +10598,6 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.5.1.tgz", "integrity": "sha512-Ft5lQNcJCfsns1QN1TDXqPZrrNwBYqIokprYJR2h2Jj01x0GFcYmJYAqHvme6vJoyI3XptEcmZpdr9g5Oy7q3Q==", - "dev": true, "requires": { "async": "^2.6.1", "blakejs": "^1.1.0", @@ -10266,8 +10646,7 @@ "murmurhash3js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/murmurhash3js/-/murmurhash3js-3.0.1.tgz", - "integrity": "sha1-Ppg+W0fCoG9DpxMXTn5DXKBEuZg=", - "dev": true + "integrity": "sha1-Ppg+W0fCoG9DpxMXTn5DXKBEuZg=" }, "mute-stream": { "version": "0.0.7", @@ -10281,6 +10660,25 @@ "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==", "dev": true }, + "nano-date": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/nano-date/-/nano-date-2.1.0.tgz", + "integrity": "sha1-veghPYoPKtGjoW6PRV7uJHX/2/k=", + "dev": true, + "requires": { + "bignumber.js": "^4.0.4", + "core-decorators": "^0.20.0", + "memoizerific": "^1.11.2" + }, + "dependencies": { + "bignumber.js": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-4.1.0.tgz", + "integrity": "sha512-eJzYkFYy9L4JzXsbymsFn3p54D+llV27oTQ+ziJG7WFRheJcNZilgVXMG0LoZtlQSKBsJdWtLFqOD0u+U0jZKA==", + "dev": true + } + } + }, "nanoid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-2.0.0.tgz", @@ -10368,6 +10766,27 @@ } } }, + "nise": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.8.tgz", + "integrity": "sha512-kGASVhuL4tlAV0tvA34yJYZIVihrUt/5bDwpp4tTluigxUr2bBlJeDXmivb6NuEdFkqvdv/Ybb9dm16PSKUhtw==", + "dev": true, + "requires": { + "@sinonjs/formatio": "^3.1.0", + "just-extend": "^4.0.2", + "lolex": "^2.3.2", + "path-to-regexp": "^1.7.0", + "text-encoding": "^0.6.4" + }, + "dependencies": { + "lolex": { + "version": "2.7.5", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz", + "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==", + "dev": true + } + } + }, "node-abi": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.5.1.tgz", @@ -10434,6 +10853,19 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } } } }, @@ -10460,9 +10892,9 @@ } }, "node-releases": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.3.tgz", - "integrity": "sha512-6VrvH7z6jqqNFY200kdB6HdzkgM96Oaj9v3dqGfgp6mF+cHmU4wyQKZ2/WPDRVoR0Jz9KqbamaBN0ZhdUaysUQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.2.tgz", + "integrity": "sha512-j1gEV/zX821yxdWp/1vBMN0pSUjuH9oGUdLCb4PfUko6ZW7KdRs3Z+QGGwDUhYtSpQvdVVyLd2V0YvLsmdg5jQ==", "dev": true, "requires": { "semver": "^5.3.0" @@ -10472,7 +10904,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/nodeify/-/nodeify-1.0.1.tgz", "integrity": "sha1-ZKtpp7268DzhB7TwM1yHwLnpGx0=", - "dev": true, "requires": { "is-promise": "~1.0.0", "promise": "~1.3.0" @@ -10728,55 +11159,6 @@ "execa": "^1.0.0", "lcid": "^2.0.0", "mem": "^4.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } } }, "os-tmpdir": { @@ -10985,6 +11367,23 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "dev": true, + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, "path-type": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", @@ -10992,6 +11391,14 @@ "dev": true, "requires": { "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } } }, "pbkdf2": { @@ -11085,15 +11492,59 @@ } }, "peer-id": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.11.0.tgz", - "integrity": "sha512-C/lRJk4CWIgOdKvfO572NvHbPcUwe49I6G0toIhDB5tCohqv/qzy0uBcAK9Ww8TvYI6U4J3C8ACShV9fWjNU4w==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.12.0.tgz", + "integrity": "sha512-pPKk4IDBWGGzcjXe6zzngIwKmyadYNsIOUH1PKb7GYTVVTKHpHn78ljZNZdAXAWZ2V1TmlU2OS6d9MfW2E5DNA==", "dev": true, "requires": { "async": "^2.6.1", + "class-is": "^1.1.0", "libp2p-crypto": "~0.13.0", "lodash": "^4.17.10", "multihashes": "~0.4.13" + }, + "dependencies": { + "libp2p-crypto": { + "version": "0.13.0", + "resolved": "http://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.13.0.tgz", + "integrity": "sha512-i3r1TBec/xYmC5bcpPiIs3OyUAU3iy53OdRdxqawKoWTQPjYB+TyQ4w+otT66Y0sMcw70O0wH3GFAfPmQgFn+g==", + "dev": true, + "requires": { + "asn1.js": "^5.0.0", + "async": "^2.6.0", + "browserify-aes": "^1.2.0", + "bs58": "^4.0.1", + "keypair": "^1.0.1", + "libp2p-crypto-secp256k1": "~0.2.2", + "multihashing-async": "~0.4.8", + "node-forge": "^0.7.5", + "pem-jwk": "^1.5.1", + "protons": "^1.0.1", + "rsa-pem-to-jwk": "^1.1.3", + "tweetnacl": "^1.0.0", + "webcrypto-shim": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8" + } + }, + "multihashing-async": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.4.8.tgz", + "integrity": "sha512-LCc4lfxmTJOHKIjZjFNgvmfB6nXS/ErLInT9uwU8udFrRm2PH+aTPk3mfCREKmCiSHOlCWiv2O8rlnBx+OjlMw==", + "dev": true, + "requires": { + "async": "^2.6.0", + "blakejs": "^1.1.0", + "js-sha3": "^0.7.0", + "multihashes": "~0.4.13", + "murmurhash3js": "^3.0.1", + "nodeify": "^1.0.1" + } + }, + "tweetnacl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", + "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=", + "dev": true + } } }, "peer-info": { @@ -11251,10 +11702,9 @@ } }, "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" }, "pinkie": { "version": "2.0.4", @@ -11428,13 +11878,13 @@ } }, "prometheus-gc-stats": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/prometheus-gc-stats/-/prometheus-gc-stats-0.5.1.tgz", - "integrity": "sha1-RxO8Xp9znuCahslkAU37zk/VAAM=", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/prometheus-gc-stats/-/prometheus-gc-stats-0.6.1.tgz", + "integrity": "sha512-DUo/cDs+1XcVuqoFU6+DjmWjkjIRIVeswtZAIfslIPrYfli2NK0/g/BPoO/kqOgLvzbKRx4m9+MDeNsNIIJGkg==", "dev": true, "optional": true, "requires": { - "gc-stats": "^1.0.0", + "gc-stats": "^1.2.1", "optional": "^0.1.3" } }, @@ -11442,7 +11892,6 @@ "version": "1.3.0", "resolved": "http://registry.npmjs.org/promise/-/promise-1.3.0.tgz", "integrity": "sha1-5cyaTIJ45GZP/twBx9qEhCsEAXU=", - "dev": true, "requires": { "is-promise": "~1" } @@ -11475,17 +11924,26 @@ "object-assign": "^4.1.1" } }, + "proper-lockfile": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-3.2.0.tgz", + "integrity": "sha512-iMghHHXv2bsxl6NchhEaFck8tvX3F9cknEEh1SUpguUOBjN7PAAW9BLzmbc1g/mCD1gY3EE2EABBHPJfFdHFmA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "retry": "^0.12.0", + "signal-exit": "^3.0.2" + } + }, "protocol-buffers-schema": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.3.2.tgz", - "integrity": "sha512-Xdayp8sB/mU+sUV4G7ws8xtYMGdQnxbeIfLjyO9TZZRJdztBGhlmbI5x1qcY4TG5hBkIKGnc28i7nXxaugu88w==", - "dev": true + "integrity": "sha512-Xdayp8sB/mU+sUV4G7ws8xtYMGdQnxbeIfLjyO9TZZRJdztBGhlmbI5x1qcY4TG5hBkIKGnc28i7nXxaugu88w==" }, "protons": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/protons/-/protons-1.0.1.tgz", "integrity": "sha512-+0ZKnfVs+4c43tbAQ5j0Mck8wPcLnlxUYzKQoB4iDW4ocdXGnN4P+0dDbgX1FTpoY9+7P2Tn2scJyHHqj+S/lQ==", - "dev": true, "requires": { "protocol-buffers-schema": "^3.3.1", "safe-buffer": "^5.1.1", @@ -11689,8 +12147,7 @@ "pull-stream": { "version": "3.6.9", "resolved": "https://registry.npmjs.org/pull-stream/-/pull-stream-3.6.9.tgz", - "integrity": "sha512-hJn4POeBrkttshdNl0AoSCVjMVSuBwuHocMerUdoZ2+oIUzrWHFTwJMlbHND7OiKLVgvz6TFj8ZUVywUMXccbw==", - "dev": true + "integrity": "sha512-hJn4POeBrkttshdNl0AoSCVjMVSuBwuHocMerUdoZ2+oIUzrWHFTwJMlbHND7OiKLVgvz6TFj8ZUVywUMXccbw==" }, "pull-stream-to-stream": { "version": "1.3.4", @@ -11716,8 +12173,7 @@ "pull-traverse": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pull-traverse/-/pull-traverse-1.0.3.tgz", - "integrity": "sha1-dPtde+f6a9enjpeTPhmbeUWGaTg=", - "dev": true + "integrity": "sha1-dPtde+f6a9enjpeTPhmbeUWGaTg=" }, "pull-utf8-decoder": { "version": "1.0.2", @@ -12036,6 +12492,23 @@ "readable-stream": "^2.0.2" } }, + "receptacle": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/receptacle/-/receptacle-1.3.2.tgz", + "integrity": "sha512-HrsFvqZZheusncQRiEE7GatOAETrARKV/lnfYicIm8lbvp/JQOdADOfhjBd2DajvoszEyxSM6RlAAIZgEoeu/A==", + "dev": true, + "requires": { + "ms": "^2.1.1" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, "regenerate": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", @@ -12272,6 +12745,12 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "dev": true + }, "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", @@ -12380,8 +12859,7 @@ "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==", - "dev": true + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safe-json-parse": { "version": "4.0.0", @@ -12433,9 +12911,9 @@ } }, "secp256k1": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.6.1.tgz", - "integrity": "sha512-utLpWv4P4agEw7hakR73wlWX0NBmC5t/vkJ0TAfTyvETAUzo0tm6aFKPYetVYRaVubxMeWm5Ekv9ETwOgcDCqw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.6.0.tgz", + "integrity": "sha512-a+oKfu2XWhq6Zzj7TexlYpwdnCEtJUUdLaujUclplPkV+INdMaV9D+81wYldm/g4/2PTFoNYZf/+0rHhTPgzjQ==", "dev": true, "requires": { "bindings": "^1.2.1", @@ -12584,7 +13062,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/signed-varint/-/signed-varint-2.0.1.tgz", "integrity": "sha1-UKmYnafJjCxh2tEZvJdHDvhSgSk=", - "dev": true, "requires": { "varint": "~5.0.0" } @@ -12636,6 +13113,21 @@ } } }, + "sinon": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.2.2.tgz", + "integrity": "sha512-WLagdMHiEsrRmee3jr6IIDntOF4kbI6N2pfbi8wkv50qaUQcBglkzkjtoOEbeJ2vf1EsrHhLI+5Ny8//WHdMoA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.2.0", + "@sinonjs/formatio": "^3.1.0", + "@sinonjs/samsam": "^3.0.2", + "diff": "^3.5.0", + "lolex": "^3.0.0", + "nise": "^1.4.7", + "supports-color": "^5.5.0" + } + }, "slash": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", @@ -13080,8 +13572,7 @@ "stable": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", - "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", - "dev": true + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==" }, "standard": { "version": "12.0.1", @@ -13205,16 +13696,28 @@ } }, "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.0.0.tgz", + "integrity": "sha512-JELJfd+btL9GHtxU3+XXhg9NLYrKFnhybfvRuDghtyVkOFydz3PKNT1df07AMr88qW03WHF+FSV0PySpXignCA==", "dev": true, "requires": { "builtin-status-codes": "^3.0.0", "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", + "readable-stream": "^3.0.6", "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", + "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "stream-shift": { @@ -13341,43 +13844,53 @@ } }, "superagent": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", - "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-4.1.0.tgz", + "integrity": "sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==", "dev": true, "requires": { "component-emitter": "^1.2.0", - "cookiejar": "^2.1.0", - "debug": "^3.1.0", - "extend": "^3.0.0", - "form-data": "^2.3.1", + "cookiejar": "^2.1.2", + "debug": "^4.1.0", + "form-data": "^2.3.3", "formidable": "^1.2.0", "methods": "^1.1.1", - "mime": "^1.4.1", - "qs": "^6.5.1", - "readable-stream": "^2.3.5" + "mime": "^2.4.0", + "qs": "^6.6.0", + "readable-stream": "^3.0.6" }, "dependencies": { "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { "ms": "^2.1.1" } }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true - }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true + }, + "qs": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.6.0.tgz", + "integrity": "sha512-KIJqT9jQJDQx5h5uAVPimw6yVg2SekOKu959OCtktD3FjzbpvaPr8i4zzg07DOMz+igA4W/aNM7OV8H37pFYfA==", + "dev": true + }, + "readable-stream": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", + "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } } } }, @@ -13522,6 +14035,40 @@ "dev": true, "requires": { "execa": "^0.7.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + } } }, "terser": { @@ -13647,6 +14194,12 @@ } } }, + "text-encoding": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", + "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", + "dev": true + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -13885,6 +14438,12 @@ "prelude-ls": "~1.1.2" } }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -14229,8 +14788,7 @@ "varint": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.0.tgz", - "integrity": "sha1-2Ca4n3SQcy+rwMDtaT7Uddyynr8=", - "dev": true + "integrity": "sha1-2Ca4n3SQcy+rwMDtaT7Uddyynr8=" }, "varint-decoder": { "version": "0.1.1", @@ -14304,9 +14862,9 @@ "dev": true }, "webpack": { - "version": "4.28.3", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.28.3.tgz", - "integrity": "sha512-vLZN9k5I7Nr/XB1IDG9GbZB4yQd1sPuvufMFgJkx0b31fi2LD97KQIjwjxE7xytdruAYfu5S0FLBLjdxmwGJCg==", + "version": "4.28.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.28.2.tgz", + "integrity": "sha512-PK3uVg3/NuNVOjPfYleFI6JF7khO7c2kIlksH7mivQm+QDcwiqV1x6+q89dDeOioh5FNxJHr3LKbDu3oSAhl9g==", "dev": true, "requires": { "@webassemblyjs/ast": "1.7.11", @@ -14359,21 +14917,6 @@ "supports-color": "^5.5.0", "v8-compile-cache": "^2.0.2", "yargs": "^12.0.2" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - } } }, "webpack-sources": { @@ -14630,12 +15173,6 @@ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, - "camelcase": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", - "dev": true - }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -14703,26 +15240,17 @@ "requires": { "ansi-regex": "^3.0.0" } - }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } } } }, "yargs-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", - "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", "dev": true, "requires": { - "camelcase": "^4.1.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } }, "yargs-promise": { diff --git a/package.json b/package.json index 28134d7a..462b1290 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,12 @@ "node": ">=8.0.0" }, "dependencies": { + "cids": "^0.5.7", + "ipld-dag-pb": "^0.15.2", "orbit-db-identity-provider": "github:orbitdb/orbit-db-identity-provider", "p-map": "^1.1.1", - "p-whilst": "^1.0.0" + "p-whilst": "^1.0.0", + "pify": "^4.0.1" }, "devDependencies": { "@babel/cli": "~7.2.3", @@ -28,10 +31,10 @@ "@orbitdb/eslint-config-orbitdb": "0.0.2", "babel-loader": "~8.0.4", "datastore-level": "~0.10.0", - "go-ipfs-dep": "~0.4.17", - "ipfs": "~0.31.4", - "ipfs-repo": "~0.23.1", - "ipfsd-ctl": "~0.39.1", + "go-ipfs-dep": "~0.4.18", + "ipfs": "~0.33.1", + "ipfs-repo": "~0.24.0", + "ipfsd-ctl": "~0.40.2", "is-node": "~1.0.2", "istanbul": "~0.4.5", "json-loader": "~0.5.7", @@ -39,6 +42,7 @@ "mocha-headless-chrome": "~2.0.1", "orbit-db-keystore": "github:orbitdb/orbit-db-keystore", "rimraf": "~2.6.1", + "sinon": "~7.2.2", "standard": "~12.0.1", "webpack": "~4.28.0", "webpack-cli": "~3.1.2" diff --git a/src/entry-io.js b/src/entry-io.js index 077190f4..f999ed4d 100644 --- a/src/entry-io.js +++ b/src/entry-io.js @@ -5,36 +5,45 @@ const pMap = require('p-map') const Entry = require('./entry') class EntryIO { - // Fetch log graphs in parallel - static async fetchParallel (ipfs, hashes, length, exclude = [], concurrency, timeout, onProgressCallback) { - const fetchOne = (hash) => EntryIO.fetchAll(ipfs, hash, length, exclude, timeout, onProgressCallback) + /** + * Fetch log entries in parallel. + * @param {IPFS} ipfs An IPFS instance + * @param {string|Array} cids CIDs of the entries to fetch + * @param {number} [amount=-1] How many entries to fetch + * @param {Array} [exclude] Entries to not fetch + * @param {number} [concurrency=] Max concurrent fetch operations + * @param {number} [timeout] Maximum time to wait for each fetch operation, in ms + * @param {function(cid, entry, parent, depth)} onProgressCallback + * @returns {Promise>} + */ + static async fetchParallel (ipfs, cids, amount = -1, exclude = [], concurrency = null, timeout, onProgressCallback) { + const fetchOne = (cid) => EntryIO.fetchAll(ipfs, cid, amount, exclude, timeout, onProgressCallback) const concatArrays = (arr1, arr2) => arr1.concat(arr2) const flatten = (arr) => arr.reduce(concatArrays, []) - concurrency = Math.max(concurrency || hashes.length, 1) - const entries = await pMap(hashes, fetchOne, { concurrency: concurrency }) + concurrency = Math.max(concurrency || cids.length, 1) + const entries = await pMap(cids, fetchOne, { concurrency: concurrency }) return flatten(entries) // Flatten the results } /** - * Fetch log entries sequentially - * - * @param {IPFS} [ipfs] An IPFS instance - * @param {string} [hash] Multihash of the entry to fetch - * @param {string} [parent] Parent of the node to be fetched - * @param {Object} [all] Entries to skip - * @param {Number} [amount=-1] How many entries to fetch - * @param {Number} [depth=0] Current depth of the recursion - * @param {function(hash, entry, parent, depth)} onProgressCallback + * Fetch log entries sequentially. + * @param {IPFS} ipfs An IPFS instance + * @param {string|Array} cids CIDs of the entries to fetch + * @param {number} [amount=-1] How many entries to fetch + * @param {Array} [exclude] Entries to not fetch + * @param {number} [concurrency] Max concurrent fetch operations + * @param {number} [timeout] Maximum time to wait for each fetch operation, in ms + * @param {function(cid, entry, parent, depth)} onProgressCallback * @returns {Promise>} */ - static async fetchAll (ipfs, hashes, amount, exclude = [], timeout = null, onProgressCallback) { + static async fetchAll (ipfs, cids, amount = -1, exclude = [], timeout = null, onProgressCallback) { let result = [] let cache = {} - let loadingQueue = Array.isArray(hashes) - ? hashes.slice() - : [hashes] + let loadingQueue = Array.isArray(cids) + ? cids.slice() + : [cids] - // Add a multihash to the loading queue + // Add a CID to the loading queue const addToLoadingQueue = e => loadingQueue.push(e) // Add entries that we don't need to fetch to the "cache" @@ -42,7 +51,7 @@ class EntryIO { var addToExcludeCache = e => { if (Entry.isEntry(e)) { result.push(e) - cache[e.hash] = e + cache[e.cid] = e } } exclude.forEach(addToExcludeCache) @@ -53,9 +62,9 @@ class EntryIO { } const fetchEntry = () => { - const hash = loadingQueue.shift() + const cid = loadingQueue.shift() - if (cache[hash]) { + if (cache[cid]) { return Promise.resolve() } @@ -64,30 +73,31 @@ class EntryIO { // not get stuck loading a block that is unreachable const timer = timeout ? setTimeout(() => { - console.warn(`Warning: Couldn't fetch entry '${hash}', request timed out (${timeout}ms)`) + console.warn(`Warning: Couldn't fetch entry '${cid}', request timed out (${timeout}ms)`) resolve() }, timeout) : null const addToResults = (entry) => { - clearTimeout(timer) if (Entry.isEntry(entry)) { entry.next.forEach(addToLoadingQueue) result.push(entry) - cache[hash] = entry + cache[cid] = entry if (onProgressCallback) { - onProgressCallback(hash, entry, result.length) + onProgressCallback(cid, entry, result.length) } } } // Load the entry try { - const entry = await Entry.fromMultihash(ipfs, hash) + const entry = await Entry.fromCID(ipfs, cid) addToResults(entry) resolve() } catch (e) { reject(e) + } finally { + clearTimeout(timer) } }) } diff --git a/src/entry.js b/src/entry.js index 0e7a34aa..d00c5de9 100644 --- a/src/entry.js +++ b/src/entry.js @@ -1,20 +1,26 @@ 'use strict' const Clock = require('./lamport-clock') -const { isDefined } = require('./utils') +const { isDefined, dagNode } = require('./utils') +const IPLD_LINKS = ['next'] const IpfsNotDefinedError = () => new Error('Ipfs instance not defined') +const getCidProp = (entry) => entry.v === 0 ? 'hash' : 'cid' class Entry { /** * Create an Entry - * @param {string|Buffer|Object|Array} data - Data of the entry to be added. Can be any JSON.stringifyable data. - * @param {Array} [next=[]] Parents of the entry + * @param {IPFS} ipfs An IPFS instance + * @param {Identity} identity The identity instance + * @param {string} logId The unique identifier for this log + * @param {*} data Data of the entry to be added. Can be any JSON.stringifyable data + * @param {Array} [next=[]] Parent CIDs or entries + * @param {LamportClock} [clock] The lamport clock + * @returns {Promise} * @example * const entry = await Entry.create(ipfs, identity, 'hello') * console.log(entry) - * // { hash: null, payload: "hello", next: [] } - * @returns {Promise} + * // { cid: null, payload: "hello", next: [] } */ static async create (ipfs, identity, logId, data, next = [], clock) { if (!isDefined(ipfs)) throw IpfsNotDefinedError() @@ -23,32 +29,35 @@ class Entry { if (!isDefined(data)) throw new Error('Entry requires data') if (!isDefined(next) || !Array.isArray(next)) throw new Error("'next' argument is not an array") - // Clean the next objects and convert to hashes - const toEntry = (e) => e.hash ? e.hash : e + // Clean the next objects and convert to cids + const toEntry = (e) => e.cid ? e.cid : e const nexts = next.filter(isDefined).map(toEntry) const entry = { - hash: null, // "Qm...Foo", we'll set the hash after persisting the entry + cid: null, // "zd...Foo", we'll set the cid after persisting the entry id: logId, // For determining a unique chain payload: data, // Can be any JSON.stringifyable data - next: nexts, // Array of Multihashes - v: 0, // For future data structure updates, should currently always be 0 + next: nexts, // Array of CIDs + v: 1, // To tag the version of this data structure clock: clock || new Clock(identity.publicKey) } const signature = await identity.provider.sign(identity, Entry.toBuffer(entry)) + entry.key = identity.publicKey entry.identity = identity.toJSON() entry.sig = signature - entry.hash = await Entry.toMultihash(ipfs, entry) - return entry + entry.cid = await Entry.toCID(ipfs, entry) + + return Entry.ensureInterop(entry) } /** - * Verifies an entry signature for a given key and sig - * @param {Entry} entry Entry to verify - * @return {Promise} Returns a promise that resolves to a boolean value - * indicating if the entry signature is valid + * Verifies an entry signature. + * + * @param {IdentityProvider} identityProvider The identity provider to use + * @param {Entry} entry The entry being verified + * @return {Promise} A promise that resolves to a boolean value indicating if the signature is valid */ static async verify (identityProvider, entry) { if (!identityProvider) throw new Error('Identity-provider is required, cannot verify entry') @@ -56,38 +65,72 @@ class Entry { if (!entry.key) throw new Error("Entry doesn't have a key") if (!entry.sig) throw new Error("Entry doesn't have a signature") - const e = Object.assign({}, { - hash: null, + const e = { + [getCidProp(entry)]: null, id: entry.id, payload: entry.payload, next: entry.next, v: entry.v, - clock: new Clock(entry.clock.id, entry.clock.time) - }) + clock: entry.clock + } return identityProvider.verify(entry.sig, entry.key, Entry.toBuffer(e)) } + /** + * Transforms an entry into a Buffer. + * @param {Entry} entry The entry + * @return {Buffer} The buffer + */ static toBuffer (entry) { return Buffer.from(JSON.stringify(entry)) } /** - * Get the multihash of an Entry - * @param {IPFS} [ipfs] An IPFS instance - * @param {Entry} [entry] Entry to get a multihash for + * Get the CID of an Entry. + * @param {IPFS} ipfs An IPFS instance + * @param {Entry} entry Entry to get a CID for + * @returns {Promise} * @example - * const hash = await Entry.toMultihash(ipfs, entry) - * console.log(hash) - * // "Qm...Foo" + * const cid = await Entry.toCID(ipfs, entry) + * console.log(cid) + * // "zd...Foo" + */ + static toCID (ipfs, entry) { + if (!ipfs) throw IpfsNotDefinedError() + if (!Entry.isEntry(entry)) throw new Error('Invalid object format, cannot generate entry CID') + + // Ensure `entry` follows the correct format + const e = { + cid: null, + id: entry.id, + payload: entry.payload, + next: entry.next, + v: entry.v, + clock: entry.clock + } + + if (entry.key) Object.assign(e, { key: entry.key }) + if (entry.identity) Object.assign(e, { identity: entry.identity }) + if (entry.sig) Object.assign(e, { sig: entry.sig }) + + return dagNode.write(ipfs, 'dag-cbor', e, IPLD_LINKS) + } + + /** + * Get the multihash of an Entry. + * @param {IPFS} ipfs An IPFS instance + * @param {Entry} entry Entry to get a multihash for * @returns {Promise} + * @example + * const multihash = await Entry.toMultihash(ipfs, entry) + * console.log(multihash) + * // "Qm...Foo" + * @deprecated */ static async toMultihash (ipfs, entry) { if (!ipfs) throw IpfsNotDefinedError() - const isValidEntryObject = entry => entry.id && entry.clock && entry.next && entry.payload && entry.v >= 0 - if (!isValidEntryObject(entry)) { - throw new Error('Invalid object format, cannot generate entry multihash') - } + if (!Entry.isEntry(entry)) throw new Error('Invalid object format, cannot generate entry CID') // Ensure `entry` follows the correct format const e = { @@ -95,7 +138,7 @@ class Entry { id: entry.id, payload: entry.payload, next: entry.next, - v: entry.v, + v: 0, clock: entry.clock } @@ -103,58 +146,102 @@ class Entry { if (entry.identity) Object.assign(e, { identity: entry.identity }) if (entry.sig) Object.assign(e, { sig: entry.sig }) - const data = Entry.toBuffer(e) - const object = await ipfs.object.put(data) - return object.toJSON().multihash + return dagNode.write(ipfs, 'dag-pb', e, IPLD_LINKS) } /** - * Create an Entry from a multihash - * @param {IPFS} [ipfs] An IPFS instance - * @param {string} [hash] Multihash as Base58 encoded string to create an Entry from - * @example - * const hash = await Entry.fromMultihash(ipfs, "Qm...Foo") - * console.log(hash) - * // { hash: "Qm...Foo", payload: "hello", next: [] } + * Create an Entry from a CID. + * @param {IPFS} ipfs An IPFS instance + * @param {string} cid The CID to create an Entry from * @returns {Promise} + * @example + * const entry = await Entry.fromCID(ipfs, "zd...Foo") + * console.log(entry) + * // { cid: "Zd...Foo", payload: "hello", next: [] } */ - static async fromMultihash (ipfs, hash) { + static async fromCID (ipfs, cid) { if (!ipfs) throw IpfsNotDefinedError() - if (!hash) throw new Error(`Invalid hash: ${hash}`) + if (!cid) throw new Error(`Invalid CID: ${cid}`) - const obj = await ipfs.object.get(hash, { enc: 'base58' }) + const e = await dagNode.read(ipfs, cid, IPLD_LINKS) - const data = JSON.parse(obj.toJSON().data) let entry = { - hash: hash, - id: data.id, - payload: data.payload, - next: data.next, - v: data.v, - clock: new Clock(data.clock.id, data.clock.time) + [getCidProp(e)]: cid, + id: e.id, + payload: e.payload, + next: e.next, + v: e.v, + clock: new Clock(e.clock.id, e.clock.time) } - if (data.key) Object.assign(entry, { key: data.key }) - if (data.identity) Object.assign(entry, { identity: data.identity }) - if (data.sig) Object.assign(entry, { sig: data.sig }) + if (e.key) Object.assign(entry, { key: e.key }) + if (e.identity) Object.assign(entry, { identity: e.identity }) + if (e.sig) Object.assign(entry, { sig: e.sig }) - return entry + return Entry.ensureInterop(entry) + } + + /** + * Create an Entry from a multihash. + * @param {IPFS} ipfs An IPFS instance + * @param {string} multihash Multihash (as a Base58 encoded string) to create the Entry from + * @returns {Promise} + * @example + * const entry = await Entry.fromMultihash(ipfs, "Qm...Foo") + * console.log(entry) + * // { cid: "Qm...Foo", payload: "hello", next: [] } + * @deprecated + */ + static async fromMultihash (ipfs, multihash) { + return Entry.fromCID(ipfs, multihash) } /** - * Check if an object is an Entry + * Check if an object is an Entry. * @param {Entry} obj * @returns {boolean} */ static isEntry (obj) { return obj && obj.id !== undefined && obj.next !== undefined && - obj.hash !== undefined && obj.payload !== undefined && obj.v !== undefined && + obj[getCidProp(obj)] !== undefined && obj.clock !== undefined } + /** + * Ensures that this entry is interoperable between earlier versions + * and the most recent one (and vice-versa). + * @param {Entry} entry The entry to ensure interoperability + * @return {Entry} entry The same entry but with backwards and forward interoperability + */ + static ensureInterop (entry) { + if (entry.cid && entry.hash) { + return entry + } + + const prop = getCidProp(entry) + const accessorProp = prop === 'hash' ? 'cid' : 'hash' + + Object.defineProperty(entry, accessorProp, { + get () { + return this[prop] + }, + set (value) { + this[prop] = value + } + }) + + return entry + } + + /** + * Compares two entries. + * @param {Entry} a + * @param {Entry} b + * @returns {number} 1 if a is greater, -1 is b is greater + */ static compare (a, b) { var distance = Clock.compare(a.clock, b.clock) if (distance === 0) return a.clock.id < b.clock.id ? -1 : 1 @@ -162,33 +249,30 @@ class Entry { } /** - * Check if an entry equals another entry + * Check if an entry equals another entry. * @param {Entry} a * @param {Entry} b * @returns {boolean} */ static isEqual (a, b) { - return a.hash === b.hash + return a.cid === b.cid } /** * Check if an entry is a parent to another entry. - * @param {Entry} [entry1] Entry to check - * @param {Entry} [entry2] Parent + * @param {Entry} entry1 Entry to check + * @param {Entry} entry2 The parent Entry * @returns {boolean} */ static isParent (entry1, entry2) { - return entry2.next.indexOf(entry1.hash) > -1 + return entry2.next.indexOf(entry1.cid) > -1 } /** - * Find entry's children from an Array of entries - * - * @description + * Find entry's children from an Array of entries. * Returns entry's children as an Array up to the last know child. - * - * @param {Entry} [entry] Entry for which to find the parents - * @param {Array} [values] Entries to search parents from + * @param {Entry} entry Entry for which to find the parents + * @param {Array} values Entries to search parents from * @returns {Array} */ static findChildren (entry, values) { diff --git a/src/log-io.js b/src/log-io.js index 89170fad..79f1a5d3 100644 --- a/src/log-io.js +++ b/src/log-io.js @@ -4,33 +4,55 @@ const Entry = require('./entry') const EntryIO = require('./entry-io') const Clock = require('./lamport-clock') const LogError = require('./log-errors') -const { isDefined, findUniques, difference } = require('./utils') +const { isDefined, findUniques, difference, dagNode } = require('./utils') +const IPLD_LINKS = ['heads'] const last = (arr, n) => arr.slice(arr.length - n, arr.length) class LogIO { + /** + * Get the CID of a Log. + * @param {IPFS} ipfs An IPFS instance + * @param {Log} log Log to get a CID for + * @returns {Promise} + */ + static async toCID (ipfs, log) { + if (!isDefined(ipfs)) throw LogError.IPFSNotDefinedError() + if (!isDefined(log)) throw LogError.LogNotDefinedError() + if (log.values.length < 1) throw new Error(`Can't serialize an empty log`) + + return dagNode.write(ipfs, 'dag-cbor', log.toJSON(), IPLD_LINKS) + } + + /** + * Get the multihash of a Log. + * @param {IPFS} ipfs An IPFS instance + * @param {Log} log Log to get a multihash for + * @returns {Promise} + * @deprecated + */ static async toMultihash (ipfs, log) { if (!isDefined(ipfs)) throw LogError.IPFSNotDefinedError() if (!isDefined(log)) throw LogError.LogNotDefinedError() if (log.values.length < 1) throw new Error(`Can't serialize an empty log`) - const dagNode = await ipfs.object.put(log.toBuffer()) - return dagNode.toJSON().multihash + + return dagNode.write(ipfs, 'dag-pb', log.toJSON(), IPLD_LINKS) } /** - * Create a log from multihash - * @param {IPFS} ipfs - An IPFS instance - * @param {string} hash - Multihash (as a Base58 encoded string) to create the log from - * @param {Number} [length=-1] - How many items to include in the log - * @param {function(hash, entry, parent, depth)} onProgressCallback + * Create a log from a CID. + * @param {IPFS} ipfs An IPFS instance + * @param {string} cid The CID of the log + * @param {number} [length=-1] How many items to include in the log + * @param {Array} [exclude] Entries to not fetch (cached) + * @param {function(cid, entry, parent, depth)} onProgressCallback * @returns {Promise} */ - static async fromMultihash (ipfs, hash, length = -1, exclude, onProgressCallback) { + static async fromCID (ipfs, cid, length = -1, exclude, onProgressCallback) { if (!isDefined(ipfs)) throw LogError.IPFSNotDefinedError() - if (!isDefined(hash)) throw new Error(`Invalid hash: ${hash}`) + if (!isDefined(cid)) throw new Error(`Invalid CID: ${cid}`) - const dagNode = await ipfs.object.get(hash, { enc: 'base58' }) - const logData = JSON.parse(dagNode.toJSON().data) + const logData = await dagNode.read(ipfs, cid, IPLD_LINKS) if (!logData.heads || !logData.id) throw LogError.NotALogError() const entries = await EntryIO.fetchAll(ipfs, logData.heads, length, exclude, null, onProgressCallback) @@ -44,7 +66,7 @@ class LogIO { }, new Clock(logData.id)) const finalEntries = entries.slice().sort(Entry.compare) - const heads = finalEntries.filter(e => logData.heads.includes(e.hash)) + const heads = finalEntries.filter(e => logData.heads.includes(e.cid)) return { id: logData.id, values: finalEntries, @@ -53,19 +75,31 @@ class LogIO { } } - static async fromEntryHash (ipfs, entryHash, id, length = -1, exclude, onProgressCallback) { + /** + * Create a log from a multihash. + * @param {IPFS} ipfs An IPFS instance + * @param {string} multihash Multihash (as a Base58 encoded string) to create the Log from + * @param {number} [length=-1] How many items to include in the log + * @param {Array} [exclude] Entries to not fetch (cached) + * @param {function(cid, entry, parent, depth)} onProgressCallback + * @returns {Promise} + * @deprecated + */ + static async fromMultihash (ipfs, multihash, length = -1, exclude, onProgressCallback) { + return LogIO.fromCID(ipfs, multihash, length, exclude, onProgressCallback) + } + + static async fromEntryCid (ipfs, entryCid, length = -1, exclude, onProgressCallback) { if (!isDefined(ipfs)) throw LogError.IpfsNotDefinedError() - if (!isDefined(entryHash)) throw new Error("'entryHash' must be defined") + if (!isDefined(entryCid)) throw new Error("'entryCid' must be defined") - // Convert input hash(es) to an array - const entryHashes = Array.isArray(entryHash) ? entryHash : [entryHash] + // Convert input cid(s) to an array + const entryCids = Array.isArray(entryCid) ? entryCid : [entryCid] // Fetch given length, return size at least the given input entries length = length > -1 ? Math.max(length, 1) : length - // Make sure we pass hashes instead of objects to the fetcher function - const excludeHashes = exclude// ? exclude.map(e => e.hash ? e.hash : e) : exclude - const entries = await EntryIO.fetchParallel(ipfs, entryHashes, length, excludeHashes, null, null, onProgressCallback) + const entries = await EntryIO.fetchParallel(ipfs, entryCids, length, exclude, null, null, onProgressCallback) // Cap the result at the right size by taking the last n entries, // or if given length is -1, then take all const sliced = length > -1 ? last(entries, length) : entries @@ -76,8 +110,9 @@ class LogIO { static async fromJSON (ipfs, json, length = -1, timeout, onProgressCallback) { if (!isDefined(ipfs)) throw LogError.IPFSNotDefinedError() - const headHashes = json.heads.map(e => e.hash) - const entries = await EntryIO.fetchParallel(ipfs, headHashes, length, [], 16, timeout, onProgressCallback) + json.heads.forEach(Entry.ensureInterop) + const headCids = json.heads.map(e => e.cid) + const entries = await EntryIO.fetchParallel(ipfs, headCids, length, [], 16, timeout, onProgressCallback) const finalEntries = entries.slice().sort(Entry.compare) return { id: json.id, @@ -87,12 +122,12 @@ class LogIO { } /** - * Create a new log starting from an entry + * Create a new log starting from an entry. * @param {IPFS} ipfs An IPFS instance - * @param {Array} entries An entry or an array of entries to fetch a log from - * @param {Number} [length=-1] How many entries to include. Default: infinite. - * @param {Array} [exclude] Entries to not fetch (cached) - * @param {function(hash, entry, parent, depth)} [onProgressCallback] + * @param {Entry|Array} sourceEntries An entry or an array of entries to fetch a log from + * @param {number} [length=-1] How many entries to include + * @param {Array} [exclude] Entries to not fetch (cached) + * @param {function(cid, entry, parent, depth)} [onProgressCallback] * @returns {Promise} */ static async fromEntry (ipfs, sourceEntries, length = -1, exclude, onProgressCallback) { @@ -107,26 +142,27 @@ class LogIO { if (!Array.isArray(sourceEntries)) { sourceEntries = [sourceEntries] } + sourceEntries.forEach(Entry.ensureInterop) // Fetch given length, return size at least the given input entries length = length > -1 ? Math.max(length, sourceEntries.length) : length - // Make sure we pass hashes instead of objects to the fetcher function - const hashes = sourceEntries.map(e => e.hash) + // Make sure we pass cids instead of objects to the fetcher function + const hashes = sourceEntries.map(e => e.cid) // Fetch the entries const entries = await EntryIO.fetchParallel(ipfs, hashes, length, exclude, null, null, onProgressCallback) // Combine the fetches with the source entries and take only uniques const combined = sourceEntries.concat(entries) - const uniques = findUniques(combined, 'hash').sort(Entry.compare) + const uniques = findUniques(combined, 'cid').sort(Entry.compare) // Cap the result at the right size by taking the last n entries const sliced = uniques.slice(length > -1 ? -length : -uniques.length) // Make sure that the given input entries are present in the result // in order to not lose references - const missingSourceEntries = difference(sliced, sourceEntries, 'hash') + const missingSourceEntries = difference(sliced, sourceEntries, 'cid') const replaceInFront = (a, withEntries) => { var sliced = a.slice(withEntries.length, a.length) diff --git a/src/log-sorting.js b/src/log-sorting.js index 0227e3c7..6c0332e8 100644 --- a/src/log-sorting.js +++ b/src/log-sorting.js @@ -3,12 +3,14 @@ const Clock = require('./lamport-clock') /** - * Sort two entries as Last-Write-Wins (LWW) - * @description Last Write Wins is a conflict resolution strategy for sorting elements - * where the element with a greater clock (latest) is chosen as the winner - * @param {Entry} [a] First entry - * @param {Entry} [b] Second entry - * @returns {int} 1 if a is latest, -1 if b is latest + * Sort two entries as Last-Write-Wins (LWW). + * + * Last Write Wins is a conflict resolution strategy for sorting elements + * where the element with a greater clock (latest) is chosen as the winner. + * + * @param {Entry} a First entry + * @param {Entry} b Second entry + * @returns {number} 1 if a is latest, -1 if b is latest */ function LastWriteWins (a, b) { // Ultimate conflict resolution (take the first/left arg) @@ -23,11 +25,11 @@ function LastWriteWins (a, b) { } /** - * Sort two entries by their clock time - * @param {Entry} [a] First entry to compare - * @param {Entry} [b] Second entry to compare - * @param {function(a, b)} [resolveConflict] A function to call if entries are concurrent (happened at the same time). The function should take in two entries and return 1 if the first entry should be chosen and -1 if the second entry should be chosen. - * @returns {int} 1 if a is greater, -1 if b is greater + * Sort two entries by their clock time. + * @param {Entry} a First entry to compare + * @param {Entry} b Second entry to compare + * @param {function(a, b)} resolveConflict A function to call if entries are concurrent (happened at the same time). The function should take in two entries and return 1 if the first entry should be chosen and -1 if the second entry should be chosen. + * @returns {number} 1 if a is greater, -1 if b is greater */ function SortByClocks (a, b, resolveConflict) { // Compare the clocks @@ -38,11 +40,11 @@ function SortByClocks (a, b, resolveConflict) { } /** - * Sort two entries by their clock id - * @param {Entry} [a] First entry to compare - * @param {Entry} [b] Second entry to compare - * @param {function(a, b)} [resolveConflict] A function to call if the clocks ids are the same. The function should take in two entries and return 1 if the first entry should be chosen and -1 if the second entry should be chosen. - * @returns {int} 1 if a is greater, -1 if b is greater + * Sort two entries by their clock id. + * @param {Entry} a First entry to compare + * @param {Entry} b Second entry to compare + * @param {function(a, b)} resolveConflict A function to call if the clocks ids are the same. The function should take in two entries and return 1 if the first entry should be chosen and -1 if the second entry should be chosen. + * @returns {number} 1 if a is greater, -1 if b is greater */ function SortByClockId (a, b, resolveConflict) { // Sort by ID if clocks are concurrent, diff --git a/src/log.js b/src/log.js index 9e5b1f49..8538c6ac 100644 --- a/src/log.js +++ b/src/log.js @@ -11,20 +11,20 @@ const AccessController = require('./default-access-controller') const { isDefined, findUniques } = require('./utils') const randomId = () => new Date().getTime().toString() -const getHash = e => e.hash +const getCid = e => e.cid const flatMap = (res, acc) => res.concat(acc) const getNextPointers = entry => entry.next const maxClockTimeReducer = (res, acc) => Math.max(res, acc.clock.time) const uniqueEntriesReducer = (res, acc) => { - res[acc.hash] = acc + res[acc.cid] = acc return res } /** - * Log + * Log. * * @description - * Log implements a G-Set CRDT and adds ordering + * Log implements a G-Set CRDT and adds ordering. * * From: * "A comprehensive study of Convergent and Commutative Replicated Data Types" @@ -33,15 +33,15 @@ const uniqueEntriesReducer = (res, acc) => { class Log extends GSet { /** * Create a new Log instance - * @param {IPFS} [ipfs] An IPFS instance - * @param {Object} [access] AccessController (./default-access-controller) - * @param {Object} [identity] Identity (https://github.com/orbitdb/orbit-db-identity-provider/blob/master/src/identity.js) - * @param {String} [logId] ID of the log - * @param {Array} [entries] An Array of Entries from which to create the log - * @param {Array} [heads] Set the heads of the log - * @param {Clock} [clock] Set the clock of the log - * @param {Function} [sortFn] The sort function - by default LastWriteWins - * @return {Log} Log + * @param {IPFS} ipfs An IPFS instance + * @param {Object} access AccessController (./default-access-controller) + * @param {Object} identity Identity (https://github.com/orbitdb/orbit-db-identity-provider/blob/master/src/identity.js) + * @param {Array} [entries] An Array of Entries from which to create the log + * @param {string} [logId] ID of the log + * @param {Array} [heads] Set the heads of the log + * @param {Clock} [clock] Set the clock of the log + * @param {Function} [sortFn] The sort function - by default LastWriteWins + * @return {Log} The log instance */ constructor (ipfs, access, identity, logId, entries, heads, clock, sortFn) { if (!isDefined(ipfs)) { @@ -90,7 +90,7 @@ class Log extends GSet { // Index of all next pointers in this log this._nextsIndex = {} - const addToNextsIndex = e => e.next.forEach(a => (this._nextsIndex[a] = e.hash)) + const addToNextsIndex = e => e.next.forEach(a => (this._nextsIndex[a] = e.cid)) entries.forEach(addToNextsIndex) // Set the length, we calculate the length manually internally @@ -105,7 +105,7 @@ class Log extends GSet { } /** - * Returns the ID of the log + * Returns the ID of the log. * @returns {string} */ get id () { @@ -113,7 +113,7 @@ class Log extends GSet { } /** - * Returns the clock of the log + * Returns the clock of the log. * @returns {string} */ get clock () { @@ -121,15 +121,15 @@ class Log extends GSet { } /** - * Returns the length of the log - * @return {Number} Length + * Returns the length of the log. + * @return {number} Length */ get length () { return this._length } /** - * Returns the values in the log + * Returns the values in the log. * @returns {Array} */ get values () { @@ -137,7 +137,7 @@ class Log extends GSet { } /** - * Returns an array of heads as multihashes + * Returns an array of heads as cids. * @returns {Array} */ get heads () { @@ -146,7 +146,7 @@ class Log extends GSet { /** * Returns an array of Entry objects that reference entries which - * are not in the log currently + * are not in the log currently. * @returns {Array} */ get tails () { @@ -154,25 +154,30 @@ class Log extends GSet { } /** - * Returns an array of multihashes that are referenced by entries which - * are not in the log currently - * @returns {Array} Array of multihashes + * Returns an array of cids that are referenced by entries which + * are not in the log currently. + * @returns {Array} Array of CIDs */ - get tailHashes () { - return Log.findTailHashes(this.values) + get tailCids () { + return Log.findTailCids(this.values) } /** - * Find an entry - * @param {string} [hash] The Multihash of the entry as Base58 encoded string + * Find an entry. + * @param {string} [cid] The CID of the entry * @returns {Entry|undefined} */ - get (hash) { - return this._entryIndex[hash] + get (cid) { + return this._entryIndex[cid] } + /** + * Checks if a entry is part of the log + * @param {string} cid The CID of the entry + * @returns {boolean} + */ has (entry) { - return this._entryIndex[entry.hash || entry] !== undefined + return this._entryIndex[entry.cid || entry] !== undefined } traverse (rootEntries, amount = -1) { @@ -191,7 +196,7 @@ class Log extends GSet { // Add an entry to the stack and traversed nodes index const addToStack = entry => { // If we've already processed the entry, don't add it to the stack - if (!entry || traversed[entry.hash]) { + if (!entry || traversed[entry.cid]) { return } @@ -201,7 +206,7 @@ class Log extends GSet { .reverse() // Add to the cache of processed entries - traversed[entry.hash] = true + traversed[entry.cid] = true } // Start traversal @@ -214,7 +219,7 @@ class Log extends GSet { // Add to the result count++ - result[entry.hash] = entry + result[entry.cid] = entry // Add entry's next references to the stack entry.next.map(getEntry) @@ -226,16 +231,16 @@ class Log extends GSet { } /** - * Append an entry to the log - * @param {Entry} entry Entry to add - * @return {Log} New Log containing the appended value + * Append an entry to the log. + * @param {Entry} entry Entry to add + * @return {Log} New Log containing the appended value */ async append (data, pointerCount = 1) { // Update the clock (find the latest clock) const newTime = Math.max(this.clock.time, this.heads.reduce(maxClockTimeReducer, 0)) + 1 this._clock = new Clock(this.clock.id, newTime) - // Get the required amount of hashes to next entries (as per current state of the log) + // Get the required amount of cids to next entries (as per current state of the log) const references = this.traverse(this.heads, Math.max(pointerCount, this.heads.length)) const nexts = Object.keys(Object.assign({}, this._headsIndex, references)) @@ -255,29 +260,25 @@ class Log extends GSet { throw new Error(`Could not append entry, key "${this._identity.id}" is not allowed to write to the log`) } - this._entryIndex[entry.hash] = entry - nexts.forEach(e => (this._nextsIndex[e] = entry.hash)) + this._entryIndex[entry.cid] = entry + nexts.forEach(e => (this._nextsIndex[e] = entry.cid)) this._headsIndex = {} - this._headsIndex[entry.hash] = entry + this._headsIndex[entry.cid] = entry // Update the length this._length++ return entry } /** - * Join two logs + * Join two logs. * - * @description Joins two logs returning a new log. Doesn't mutate the original logs. - * - * @param {IPFS} [ipfs] An IPFS instance - * @param {Log} log Log to join with this Log - * @param {Number} [size] Max size of the joined log - * @param {string} [id] ID to use for the new log + * Joins another log into this one. * + * @param {Log} log Log to join with this Log + * @param {number} [size=-1] Max size of the joined log + * @returns {Promise} This Log instance * @example * await log1.join(log2) - * - * @returns {Promise} */ async join (log, size = -1) { if (!isDefined(log)) throw LogError.LogNotDefinedError() @@ -301,7 +302,7 @@ class Log extends GSet { const verify = async (entry) => { const isValid = await Entry.verify(identityProvider, entry) const publicKey = entry.identity ? entry.identity.publicKey : entry.key - if (!isValid) throw new Error(`Could not validate signature "${entry.sig}" for entry "${entry.hash}" and key "${publicKey}"`) + if (!isValid) throw new Error(`Could not validate signature "${entry.sig}" for entry "${entry.cid}" and key "${publicKey}"`) } const entriesToJoin = Object.values(newItems) @@ -310,9 +311,9 @@ class Log extends GSet { // Update the internal next pointers index const addToNextsIndex = e => { - const entry = this.get(e.hash) + const entry = this.get(e.cid) if (!entry) this._length++ /* istanbul ignore else */ - e.next.forEach(a => (this._nextsIndex[a] = e.hash)) + e.next.forEach(a => (this._nextsIndex[a] = e.cid)) } Object.values(newItems).forEach(addToNextsIndex) @@ -320,8 +321,8 @@ class Log extends GSet { this._entryIndex = Object.assign(this._entryIndex, newItems) // Merge the heads - const notReferencedByNewItems = e => !nextsFromNewItems.find(a => a === e.hash) - const notInCurrentNexts = e => !this._nextsIndex[e.hash] + const notReferencedByNewItems = e => !nextsFromNewItems.find(a => a === e.cid) + const notInCurrentNexts = e => !this._nextsIndex[e.cid] const nextsFromNewItems = Object.values(newItems).map(getNextPointers).reduce(flatMap, []) const mergedHeads = Log.findHeads(Object.values(Object.assign({}, this._headsIndex, log._headsIndex))) .filter(notReferencedByNewItems) @@ -346,8 +347,8 @@ class Log extends GSet { } /** - * Get the log in JSON format - * @returns {Object<{heads}>} + * Get the log in JSON format. + * @returns {Object} An object with the id and heads properties */ toJSON () { return { @@ -355,10 +356,14 @@ class Log extends GSet { heads: this.heads .sort(this._sortFn) // default sorting .reverse() // we want the latest as the first element - .map(getHash) // return only the head hashes + .map(getCid) // return only the head cids } } + /** + * Get the log in JSON format as a snapshot. + * @returns {Object} An object with the id, heads and value properties + */ toSnapshot () { return { id: this.id, @@ -366,8 +371,9 @@ class Log extends GSet { values: this.values } } + /** - * Get the log as a Buffer + * Get the log as a Buffer. * @returns {Buffer} */ toBuffer () { @@ -375,12 +381,12 @@ class Log extends GSet { } /** - * Returns the log entries as a formatted string + * Returns the log entries as a formatted string. + * @returns {string} * @example * two * └─one * └─three - * @returns {string} */ toString (payloadMapper) { return this.values @@ -399,9 +405,9 @@ class Log extends GSet { } /** - * Check whether an object is a Log instance + * Check whether an object is a Log instance. * @param {Object} log An object to check - * @returns {true|false} + * @returns {boolean} */ static isLog (log) { return log.id !== undefined && @@ -410,101 +416,139 @@ class Log extends GSet { } /** - * Get the log's multihash + * Get the log's CID. + * @returns {Promise} The Log CID + */ + toCID () { + return LogIO.toCID(this._storage, this) + } + + /** + * Get the log's multihash. * @returns {Promise} Multihash of the Log as Base58 encoded string + * @deprecated */ toMultihash () { return LogIO.toMultihash(this._storage, this) } /** - * Create a log from multihash - * @param {IPFS} ipfs An IPFS instance - * @param {string} hash Multihash (as a Base58 encoded string) to create the log from - * @param {Number} [length=-1] How many items to include in the log - * @param {Function(hash, entry, parent, depth)} onProgressCallback - * @return {Promise} New Log + * Create a log from a CID. + * @param {IPFS} ipfs An IPFS instance + * @param {AccessController} access The access controller instance + * @param {Identity} identity The identity instance + * @param {string} cid The log CID + * @param {number} [length=-1] How many items to include in the log + * @param {Array} [exclude] Entries to not fetch (cached) + * @param {function(cid, entry, parent, depth)} onProgressCallback + * @returns {Promise} + * @deprecated */ - static async fromMultihash (ipfs, access, identity, hash, length = -1, exclude, onProgressCallback) { - if (!isDefined(ipfs)) throw LogError.IPFSNotDefinedError() - if (!isDefined(hash)) throw new Error(`Invalid hash: ${hash}`) - + static async fromCID (ipfs, access, identity, cid, length = -1, exclude, onProgressCallback) { // TODO: need to verify the entries with 'key' - const data = await LogIO.fromMultihash(ipfs, hash, length, exclude, onProgressCallback) + const data = await LogIO.fromCID(ipfs, cid, length, exclude, onProgressCallback) return new Log(ipfs, access, identity, data.id, data.values, data.heads, data.clock) } /** - * Create a log from a single entry's multihash - * @param {IPFS} ipfs An IPFS instance - * @param {string} hash Multihash (as a Base58 encoded string) of the Entry from which to create the log from - * @param {Number} [length=-1] How many entries to include in the log - * @param {Function(hash, entry, parent, depth)} onProgressCallback - * @return {Promise} New Log - */ - static async fromEntryHash (ipfs, access, identity, hash, id, length = -1, exclude, onProgressCallback) { - if (!isDefined(ipfs)) throw LogError.IPFSNotDefinedError() - if (!isDefined(hash)) throw new Error("'hash' must be defined") + * Create a log from a multihash. + * @param {IPFS} ipfs An IPFS instance + * @param {AccessController} access The access controller instance + * @param {Identity} identity The identity instance + * @param {string} multihash Multihash (as a Base58 encoded string) to create the Log from + * @param {number} [length=-1] How many items to include in the log + * @param {Array} [exclude] Entries to not fetch (cached) + * @param {function(cid, entry, parent, depth)} onProgressCallback + * @returns {Promise} + * @deprecated + */ + static async fromMultihash (ipfs, access, identity, multihash, length = -1, exclude, onProgressCallback) { + return Log.fromCID(ipfs, access, identity, multihash, length, exclude, onProgressCallback) + } + /** + * Create a log from a single entry's CID. + * @param {IPFS} ipfs An IPFS instance + * @param {AccessController} access The access controller instance + * @param {Identity} identity The identity instance + * @param {string} cid The entry's CID + * @param {string} [logId] The ID of the log + * @param {number} [length=-1] How many entries to include in the log + * @param {function(cid, entry, parent, depth)} onProgressCallback + * @return {Promise} New Log + */ + static async fromEntryCid (ipfs, access, identity, cid, logId, length = -1, exclude, onProgressCallback) { // TODO: need to verify the entries with 'key' - const data = await LogIO.fromEntryHash(ipfs, hash, id, length, exclude, onProgressCallback) - return new Log(ipfs, access, identity, id, data.values) + const data = await LogIO.fromEntryCid(ipfs, cid, length, exclude, onProgressCallback) + return new Log(ipfs, access, identity, logId, data.values) } /** - * Create a log from a Log Snapshot JSON - * @param {IPFS} ipfs An IPFS instance - * @param {Object} json Log snapshot as JSON object - * @param {Number} [length=-1] How many entries to include in the log - * @param {Function(hash, entry, parent, depth)} [onProgressCallback] - * @return {Promise} New Log + * Create a log from a single entry's multihash. + * @param {IPFS} ipfs An IPFS instance + * @param {AccessController} access The access controller instance + * @param {Identity} identity The identity instance + * @param {string} multihash The entry's multihash + * @param {string} [logId] The ID of the log + * @param {number} [length=-1] How many entries to include in the log + * @param {function(cid, entry, parent, depth)} onProgressCallback + * @return {Promise} New Log + * @deprecated */ - static async fromJSON (ipfs, access, identity, json, length = -1, timeout, onProgressCallback) { - if (!isDefined(ipfs)) throw LogError.IPFSNotDefinedError() + static async fromEntryHash (ipfs, access, identity, multihash, logId, length = -1, exclude, onProgressCallback) { + return Log.fromEntryCid(ipfs, access, identity, multihash, logId, length, exclude, onProgressCallback) + } + /** + * Create a log from a Log Snapshot JSON. + * @param {IPFS} ipfs An IPFS instance + * @param {AccessController} access The access controller instance + * @param {Identity} identity The identity instance + * @param {Object} json Log snapshot as JSON object + * @param {number} [length=-1] How many entries to include in the log + * @param {function(cid, entry, parent, depth)} [onProgressCallback] + * @return {Promise} New Log + */ + static async fromJSON (ipfs, access, identity, json, length = -1, timeout, onProgressCallback) { // TODO: need to verify the entries with 'key' const data = await LogIO.fromJSON(ipfs, json, length, timeout, onProgressCallback) return new Log(ipfs, access, identity, data.id, data.values) } /** - * Create a new log from an Entry instance - * @param {IPFS} ipfs An IPFS instance - * @param {Entry|Array} sourceEntries An Entry or an array of entries to fetch a log from - * @param {Number} [length=-1] How many entries to include. Default: infinite. - * @param {Array} [exclude] Array of entries or hashes or entries to not fetch (foe eg. cached entries) - * @param {Function(hash, entry, parent, depth)} [onProgressCallback] - * @return {Promise} New Log + * Create a new log from an Entry instance. + * @param {IPFS} ipfs An IPFS instance + * @param {Entry|Array} sourceEntries An Entry or an array of entries to fetch a log from + * @param {number} [length=-1] How many entries to include. Default: infinite. + * @param {Array} [exclude] Entries to not fetch (cached) + * @param {function(cid, entry, parent, depth)} [onProgressCallback] + * @return {Promise} New Log */ static async fromEntry (ipfs, access, identity, sourceEntries, length = -1, exclude, onProgressCallback) { - if (!isDefined(ipfs)) throw LogError.IPFSNotDefinedError() - if (!isDefined(sourceEntries)) throw new Error("'sourceEntries' must be defined") - // TODO: need to verify the entries with 'key' const data = await LogIO.fromEntry(ipfs, sourceEntries, length, exclude, onProgressCallback) return new Log(ipfs, access, identity, data.id, data.values) } /** - * Find heads from a collection of entries + * Find heads from a collection of entries. * - * @description * Finds entries that are the heads of this collection, - * ie. entries that are not referenced by other entries + * ie. entries that are not referenced by other entries. * - * @param {Array} Entries to search heads from + * @param {Array} entries Entries to search heads from * @returns {Array} */ static findHeads (entries) { var indexReducer = (res, entry, idx, arr) => { - var addToResult = e => (res[e] = entry.hash) + var addToResult = e => (res[e] = entry.cid) entry.next.forEach(addToResult) return res } var items = entries.reduce(indexReducer, {}) - var exists = e => items[e.hash] === undefined + var exists = e => items[e.cid] === undefined var compareIds = (a, b) => a.clock.id > b.clock.id return entries.filter(exists).sort(compareIds) @@ -517,9 +561,9 @@ class Log extends GSet { var reverseIndex = {} // Null index containing entries that have no parents (nexts) var nullIndex = [] - // Hashes for all entries for quick lookups - var hashes = {} - // Hashes of all next entries + // CIDs for all entries for quick lookups + var cids = {} + // CIDs of all next entries var nexts = [] var addToIndex = (e) => { @@ -536,36 +580,36 @@ class Log extends GSet { e.next.forEach(addToReverseIndex) // Get all next references nexts = nexts.concat(e.next) - // Get the hashes of input entries - hashes[e.hash] = true + // Get the cids of input entries + cids[e.cid] = true } // Create our indices entries.forEach(addToIndex) - var addUniques = (res, entries, idx, arr) => res.concat(findUniques(entries, 'hash')) - var exists = e => hashes[e] === undefined + var addUniques = (res, entries, idx, arr) => res.concat(findUniques(entries, 'cid')) + var exists = e => cids[e] === undefined var findFromReverseIndex = e => reverseIndex[e] - // Drop hashes that are not in the input entries - const tails = nexts // For every multihash in nexts: + // Drop cids that are not in the input entries + const tails = nexts // For every cid in nexts: .filter(exists) // Remove undefineds and nulls .map(findFromReverseIndex) // Get the Entry from the reverse index .reduce(addUniques, []) // Flatten the result and take only uniques .concat(nullIndex) // Combine with tails the have no next refs (ie. first-in-their-chain) - return findUniques(tails, 'hash').sort(Entry.compare) + return findUniques(tails, 'cid').sort(Entry.compare) } - // Find the hashes to entries that are not in a collection + // Find the cids to entries that are not in a collection // but referenced by other entries - static findTailHashes (entries) { - var hashes = {} - var addToIndex = e => (hashes[e.hash] = true) - var reduceTailHashes = (res, entry, idx, arr) => { + static findTailCids (entries) { + var cids = {} + var addToIndex = e => (cids[e.cid] = true) + var reduceTailCids = (res, entry, idx, arr) => { var addToResult = (e) => { /* istanbul ignore else */ - if (hashes[e] === undefined) { + if (cids[e] === undefined) { res.splice(0, 0, e) } } @@ -574,7 +618,7 @@ class Log extends GSet { } entries.forEach(addToIndex) - return entries.reduce(reduceTailHashes, []) + return entries.reduce(reduceTailCids, []) } static difference (a, b) { @@ -582,19 +626,19 @@ class Log extends GSet { let traversed = {} let res = {} - const pushToStack = hash => { - if (!traversed[hash] && !b.get(hash)) { - stack.push(hash) - traversed[hash] = true + const pushToStack = cid => { + if (!traversed[cid] && !b.get(cid)) { + stack.push(cid) + traversed[cid] = true } } while (stack.length > 0) { - const hash = stack.shift() - const entry = a.get(hash) - if (entry && !b.get(hash) && entry.id === b.id) { - res[entry.hash] = entry - traversed[entry.hash] = true + const cid = stack.shift() + const entry = a.get(cid) + if (entry && !b.get(cid) && entry.id === b.id) { + res[entry.cid] = entry + traversed[entry.cid] = true entry.next.forEach(pushToStack) } } diff --git a/src/utils/dag-node.js b/src/utils/dag-node.js new file mode 100644 index 00000000..f94e94a8 --- /dev/null +++ b/src/utils/dag-node.js @@ -0,0 +1,98 @@ +const CID = require('cids') +const dagPB = require('ipld-dag-pb') +const pify = require('pify') + +const createPbDagNode = pify(dagPB.DAGNode.create) + +const cidToCborLink = (cid) => { + if (!cid) { + return cid + } + + if (Array.isArray(cid)) { + return cid.map(cidToCborLink) + } + + return { '/': cid } +} + +const stringifyCid = (cid) => { + if (!cid) { + return cid + } + + if (Array.isArray(cid)) { + return cid.map(stringifyCid) + } + + return cid.toBaseEncodedString() +} + +const writePb = async (ipfs, obj) => { + const buffer = Buffer.from(JSON.stringify(obj)) + const dagNode = await createPbDagNode(buffer) + + const cid = await ipfs.dag.put(dagNode, { + format: 'dag-pb', + hashAlg: 'sha2-256' + }) + + return cid.toV0().toBaseEncodedString() +} + +const readPb = async (ipfs, cid) => { + const result = await ipfs.dag.get(cid) + const dagNode = result.value + + return JSON.parse(dagNode.toJSON().data) +} + +const writeCbor = async (ipfs, obj, links) => { + const dagNode = Object.assign({}, obj) + + links.forEach((prop) => { + dagNode[prop] = cidToCborLink(dagNode[prop]) + }) + + const cid = await ipfs.dag.put(dagNode) + + return cid.toBaseEncodedString() +} + +const readCbor = async (ipfs, cid, links) => { + const result = await ipfs.dag.get(cid) + const obj = result.value + + links.forEach((prop) => { + obj[prop] = stringifyCid(obj[prop]) + }) + + return obj +} + +const formats = { + 'dag-pb': { read: readPb, write: writePb }, + 'dag-cbor': { write: writeCbor, read: readCbor } +} + +const write = (ipfs, codec, obj, links) => { + const format = formats[codec] + + if (!format) throw new Error('Unsupported codec') + + return format.write(ipfs, obj, links) +} + +const read = (ipfs, cid, links) => { + cid = new CID(cid) + const format = formats[cid.codec] + + if (!format) throw new Error('Unsupported codec') + + return format.read(ipfs, cid, links) +} + +module.exports = { + read, + write +} diff --git a/src/utils/index.js b/src/utils/index.js index 55d01ea5..26ae06f8 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -3,9 +3,11 @@ const difference = require('./difference') const findUniques = require('./find-uniques') const isDefined = require('./is-defined') +const dagNode = require('./dag-node') module.exports = { difference, findUniques, - isDefined + isDefined, + dagNode } diff --git a/test/entry-io.spec.js b/test/entry-io.spec.js index c1fcd7e5..48958c6b 100644 --- a/test/entry-io.spec.js +++ b/test/entry-io.spec.js @@ -46,8 +46,8 @@ Object.keys(testAPIs).forEach((IPFS) => { it('log with one entry', async () => { let log = new Log(ipfs, testACL, testIdentity, 'X') await log.append('one') - const hash = log.values[0].hash - const res = await EntryIO.fetchAll(ipfs, hash, 1) + const cid = log.values[0].cid + const res = await EntryIO.fetchAll(ipfs, cid, 1) assert.strictEqual(res.length, 1) }) @@ -55,17 +55,17 @@ Object.keys(testAPIs).forEach((IPFS) => { let log = new Log(ipfs, testACL, testIdentity, 'X') await log.append('one') await log.append('two') - const hash = last(log.values).hash - const res = await EntryIO.fetchAll(ipfs, hash, 2) + const cid = last(log.values).cid + const res = await EntryIO.fetchAll(ipfs, cid, 2) assert.strictEqual(res.length, 2) }) - it('loads max 1 entriy from a log of 2 entry', async () => { + it('loads max 1 entry from a log of 2 entry', async () => { let log = new Log(ipfs, testACL, testIdentity, 'X') await log.append('one') await log.append('two') - const hash = last(log.values).hash - const res = await EntryIO.fetchAll(ipfs, hash, 1) + const cid = last(log.values).cid + const res = await EntryIO.fetchAll(ipfs, cid, 1) assert.strictEqual(res.length, 1) }) @@ -76,8 +76,8 @@ Object.keys(testAPIs).forEach((IPFS) => { await log.append('hello' + i) } - const hash = await log.toMultihash() - const result = await Log.fromMultihash(ipfs, testACL, testIdentity, hash, -1) + const cid = await log.toCID() + const result = await Log.fromCID(ipfs, testACL, testIdentity, cid, -1) assert.strictEqual(result.length, count) }) @@ -93,8 +93,8 @@ Object.keys(testAPIs).forEach((IPFS) => { } } - const hash = await log.toMultihash() - const result = await Log.fromMultihash(ipfs, testACL, testIdentity, hash, 42) + const cid = await log.toCID() + const result = await Log.fromCID(ipfs, testACL, testIdentity, cid, 42) assert.strictEqual(result.length, 42) }) @@ -111,8 +111,8 @@ Object.keys(testAPIs).forEach((IPFS) => { } } - const hash = await log2.toMultihash() - const result = await Log.fromMultihash(ipfs, testACL, testIdentity, hash, 99) + const cid = await log2.toCID() + const result = await Log.fromCID(ipfs, testACL, testIdentity, cid, 99) assert.strictEqual(result.length, 99) }) @@ -135,8 +135,8 @@ Object.keys(testAPIs).forEach((IPFS) => { } await log3.join(log2) - const hash = await log3.toMultihash() - const result = await Log.fromMultihash(ipfs, testACL, testIdentity, hash, 10) + const cid = await log3.toCID() + const result = await Log.fromCID(ipfs, testACL, testIdentity, cid, 10) assert.strictEqual(result.length, 10) }) diff --git a/test/entry.spec.js b/test/entry.spec.js index 7193c42c..fce01407 100644 --- a/test/entry.spec.js +++ b/test/entry.spec.js @@ -1,11 +1,14 @@ 'use strict' const assert = require('assert') +const sinon = require('sinon') const rmrf = require('rimraf') const Entry = require('../src/entry') const Log = require('../src/log') +const { dagNode } = require('../src/utils') const AccessController = Log.AccessController const IdentityProvider = require('orbit-db-identity-provider') +const v0Entries = require('./fixtures/v0-entries.fixture') // Test utils const { @@ -40,32 +43,32 @@ Object.keys(testAPIs).forEach((IPFS) => { describe('create', () => { it('creates a an empty entry', async () => { - const expectedHash = 'QmV5NpvViHHouBfo7CSnfX2iB4t5PVWNJG8doKt5cwwnxY' + const expectedCid = 'zdpuAnVZkmiNbtgwCguuphDe2qojCGN4EztkSGNyiJxwizudY' const entry = await Entry.create(ipfs, testIdentity, 'A', 'hello') - assert.strictEqual(entry.hash, expectedHash) + assert.strictEqual(entry.cid, expectedCid) assert.strictEqual(entry.id, 'A') assert.strictEqual(entry.clock.id, testIdentity.publicKey) assert.strictEqual(entry.clock.time, 0) - assert.strictEqual(entry.v, 0) + assert.strictEqual(entry.v, 1) assert.strictEqual(entry.payload, 'hello') assert.strictEqual(entry.next.length, 0) }) it('creates a entry with payload', async () => { - const expectedHash = 'QmderYccue9XqB7V4EYf71ZygWELdzdbVqo1oxR4nMRrCh' + const expectedCid = 'zdpuAwxcFXg67SFPvm3rpDV7WKz7oBeZ6wGfisMycCUVxWnFk' const payload = 'hello world' const entry = await Entry.create(ipfs, testIdentity, 'A', payload, []) assert.strictEqual(entry.payload, payload) assert.strictEqual(entry.id, 'A') assert.strictEqual(entry.clock.id, testIdentity.publicKey) assert.strictEqual(entry.clock.time, 0) - assert.strictEqual(entry.v, 0) + assert.strictEqual(entry.v, 1) assert.strictEqual(entry.next.length, 0) - assert.strictEqual(entry.hash, expectedHash) + assert.strictEqual(entry.cid, expectedCid) }) it('creates a entry with payload and next', async () => { - const expectedHash = 'QmQDYaVgVpR7uMG1ao9D1sioYHvAHeuLgUxKBuX1tQtKTY' + const expectedCid = 'zdpuAmTCUPk1qDWH6zYiScRPUGt7wpaoq2jRXm1j7bd5sdUu6' const payload1 = 'hello world' const payload2 = 'hello again' const entry1 = await Entry.create(ipfs, testIdentity, 'A', payload1, []) @@ -73,14 +76,21 @@ Object.keys(testAPIs).forEach((IPFS) => { const entry2 = await Entry.create(ipfs, testIdentity, 'A', payload2, [entry1], entry1.clock) assert.strictEqual(entry2.payload, payload2) assert.strictEqual(entry2.next.length, 1) - assert.strictEqual(entry2.hash, expectedHash) + assert.strictEqual(entry2.cid, expectedCid) assert.strictEqual(entry2.clock.id, testIdentity.publicKey) assert.strictEqual(entry2.clock.time, 1) }) + it('should return an entry interopable with older versions', async () => { + const expectedCid = 'zdpuAnVZkmiNbtgwCguuphDe2qojCGN4EztkSGNyiJxwizudY' + const entry = await Entry.create(ipfs, testIdentity, 'A', 'hello') + assert.strictEqual(entry.cid, entry.hash) + assert.strictEqual(entry.cid, expectedCid) + }) + it('`next` parameter can be an array of strings', async () => { const entry1 = await Entry.create(ipfs, testIdentity, 'A', 'hello1', []) - const entry2 = await Entry.create(ipfs, testIdentity, 'A', 'hello2', [entry1.hash]) + const entry2 = await Entry.create(ipfs, testIdentity, 'A', 'hello2', [entry1.cid]) assert.strictEqual(typeof entry2.next[0] === 'string', true) }) @@ -147,13 +157,66 @@ Object.keys(testAPIs).forEach((IPFS) => { }) }) + describe('toCID', () => { + it('returns an ipfs CID', async () => { + const expectedCid = 'zdpuAnVZkmiNbtgwCguuphDe2qojCGN4EztkSGNyiJxwizudY' + const entry = await Entry.create(ipfs, testIdentity, 'A', 'hello', []) + const cid = await Entry.toCID(ipfs, entry) + assert.strictEqual(entry.cid, expectedCid) + assert.strictEqual(cid, expectedCid) + }) + + it('returns the correct ipfs CID (multihash) for a v0 entry', async () => { + const expectedMultihash = 'QmV5NpvViHHouBfo7CSnfX2iB4t5PVWNJG8doKt5cwwnxY' + const entry = v0Entries.hello + const multihash = await Entry.toMultihash(ipfs, entry) + assert.strictEqual(multihash, expectedMultihash) + }) + + it('throws an error if ipfs is not defined', async () => { + let err + try { + await Entry.toCID() + } catch (e) { + err = e + } + assert.strictEqual(err.message, 'Ipfs instance not defined') + }) + + it('throws an error if the object being passed is invalid', async () => { + let err1, err2 + try { + await Entry.toCID(ipfs, testACL, testIdentity, { cid: 'deadbeef' }) + } catch (e) { + err1 = e + } + + assert.strictEqual(err1.message, 'Invalid object format, cannot generate entry CID') + + try { + const entry = await Entry.create(ipfs, testIdentity, 'A', 'hello', []) + delete entry.clock + await Entry.toCID(ipfs, entry) + } catch (e) { + err2 = e + } + assert.strictEqual(err2.message, 'Invalid object format, cannot generate entry CID') + }) + }) + describe('toMultihash', () => { - it('returns an ipfs hash', async () => { - const expectedHash = 'QmV5NpvViHHouBfo7CSnfX2iB4t5PVWNJG8doKt5cwwnxY' + it('returns an ipfs multihash', async () => { + const expectedMultihash = 'QmW2b1VncVEHNNjNEanKEznqDmY5nDBkQangWj6B3FBj3U' const entry = await Entry.create(ipfs, testIdentity, 'A', 'hello', []) - const hash = await Entry.toMultihash(ipfs, entry) - assert.strictEqual(entry.hash, expectedHash) - assert.strictEqual(hash, expectedHash) + const multihash = await Entry.toMultihash(ipfs, entry) + assert.strictEqual(multihash, expectedMultihash) + }) + + it('returns the correct ipfs multihash for a v0 entry', async () => { + const expectedMultihash = 'QmV5NpvViHHouBfo7CSnfX2iB4t5PVWNJG8doKt5cwwnxY' + const entry = v0Entries.hello + const multihash = await Entry.toMultihash(ipfs, entry) + assert.strictEqual(multihash, expectedMultihash) }) it('throws an error if ipfs is not defined', async () => { @@ -169,12 +232,12 @@ Object.keys(testAPIs).forEach((IPFS) => { it('throws an error if the object being passed is invalid', async () => { let err1, err2 try { - await Entry.toMultihash(ipfs, testACL, testIdentity, { hash: 'deadbeef' }) + await Entry.toMultihash(ipfs, testACL, testIdentity, { cid: 'deadbeef' }) } catch (e) { err1 = e } - assert.strictEqual(err1.message, 'Invalid object format, cannot generate entry multihash') + assert.strictEqual(err1.message, 'Invalid object format, cannot generate entry CID') try { const entry = await Entry.create(ipfs, testIdentity, 'A', 'hello', []) @@ -183,45 +246,99 @@ Object.keys(testAPIs).forEach((IPFS) => { } catch (e) { err2 = e } - assert.strictEqual(err2.message, 'Invalid object format, cannot generate entry multihash') + assert.strictEqual(err2.message, 'Invalid object format, cannot generate entry CID') }) }) - describe('fromMultihash', () => { - it('creates a entry from ipfs hash', async () => { - const expectedHash = 'QmTLLKuNVXC95rGcnrL1M3xKf4dWYuu3MeAM3LUh3YNDJ7' + describe('fromCID', () => { + it('creates a entry from ipfs CID', async () => { + const expectedCid = 'zdpuAqFSTCgEMky7YfyHUFGxuwHjpM5AjKG9JFTyXiYQqRPmP' const payload1 = 'hello world' const payload2 = 'hello again' const entry1 = await Entry.create(ipfs, testIdentity, 'A', payload1, []) const entry2 = await Entry.create(ipfs, testIdentity, 'A', payload2, [entry1]) - const final = await Entry.fromMultihash(ipfs, entry2.hash) + const final = await Entry.fromCID(ipfs, entry2.cid) assert.deepStrictEqual(entry2, final) assert.strictEqual(final.id, 'A') assert.strictEqual(final.payload, payload2) assert.strictEqual(final.next.length, 1) - assert.strictEqual(final.next[0], entry1.hash) - assert.strictEqual(final.hash, expectedHash) + assert.strictEqual(final.next[0], entry1.cid) + assert.strictEqual(final.cid, expectedCid) + }) + + it('creates a entry from ipfs multihash of v0 entries', async () => { + const expectedCid = 'QmTLLKuNVXC95rGcnrL1M3xKf4dWYuu3MeAM3LUh3YNDJ7' + const entry1Cid = await dagNode.write(ipfs, 'dag-pb', v0Entries.helloWorld) + const entry2Cid = await dagNode.write(ipfs, 'dag-pb', v0Entries.helloAgain) + const final = await Entry.fromCID(ipfs, entry2Cid) + + assert.strictEqual(final.id, 'A') + assert.strictEqual(final.payload, v0Entries.helloAgain.payload) + assert.strictEqual(final.next.length, 1) + assert.strictEqual(final.next[0], v0Entries.helloAgain.next[0]) + assert.strictEqual(final.next[0], entry1Cid) + assert.strictEqual(final.v, 0) + assert.strictEqual(final.cid, entry2Cid) + assert.strictEqual(final.cid, expectedCid) + }) + + it('should return an entry interopable with older and newer versions', async () => { + const expectedCidV1 = 'zdpuAnVZkmiNbtgwCguuphDe2qojCGN4EztkSGNyiJxwizudY' + const entryV1 = await Entry.create(ipfs, testIdentity, 'A', 'hello', []) + const finalV1 = await Entry.fromCID(ipfs, entryV1.cid) + assert.strictEqual(finalV1.cid, finalV1.hash) + assert.strictEqual(finalV1.cid, expectedCidV1) + assert.strictEqual(Object.assign({}, finalV1).cid, expectedCidV1) + assert.strictEqual(Object.assign({}, finalV1).hash, undefined) + + const expectedCidV0 = 'QmderYccue9XqB7V4EYf71ZygWELdzdbVqo1oxR4nMRrCh' + const entryCidV0 = await dagNode.write(ipfs, 'dag-pb', v0Entries.helloWorld) + const finalV0 = await Entry.fromCID(ipfs, entryCidV0) + assert.strictEqual(finalV0.cid, finalV0.hash) + assert.strictEqual(finalV0.cid, expectedCidV0) + assert.strictEqual(Object.assign({}, finalV0).cid, undefined) + assert.strictEqual(Object.assign({}, finalV0).hash, expectedCidV0) }) it('throws an error if ipfs is not present', async () => { let err try { - await Entry.fromMultihash() + await Entry.fromCID() } catch (e) { err = e } assert.strictEqual(err.message, 'Ipfs instance not defined') }) - it('throws an error if hash is undefined', async () => { + it('throws an error if CID is undefined', async () => { let err try { - await Entry.fromMultihash(ipfs) + await Entry.fromCID(ipfs) } catch (e) { err = e } - assert.strictEqual(err.message, 'Invalid hash: undefined') + assert.strictEqual(err.message, 'Invalid CID: undefined') + }) + }) + + describe('fromMultihash', () => { + afterEach(() => { + if (Entry.fromCID.restore) { + Entry.fromCID.restore() + } + }) + + it('call fromCID', async () => { + const spy = sinon.spy(Entry, 'fromCID') + + const expectedCid = 'QmTLLKuNVXC95rGcnrL1M3xKf4dWYuu3MeAM3LUh3YNDJ7' + await dagNode.write(ipfs, 'dag-pb', v0Entries.helloWorld) + const entry2Cid = await dagNode.write(ipfs, 'dag-pb', v0Entries.helloAgain) + const final = await Entry.fromCID(ipfs, entry2Cid) + + assert(spy.calledOnceWith(ipfs, entry2Cid)) + assert.strictEqual(final.cid, expectedCid) }) }) @@ -269,28 +386,37 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.strictEqual(Entry.isEntry(entry), true) }) + it('is an Entry (v0)', async () => { + assert.strictEqual(Entry.isEntry(v0Entries.hello), true) + }) + it('is not an Entry - no id', async () => { - const fakeEntry = { next: [], hash: 'Foo', payload: 123, seq: 0 } + const fakeEntry = { next: [], v: 1, cid: 'Foo', payload: 123, seq: 0 } assert.strictEqual(Entry.isEntry(fakeEntry), false) }) it('is not an Entry - no seq', async () => { - const fakeEntry = { next: [], hash: 'Foo', payload: 123 } + const fakeEntry = { next: [], v: 1, cid: 'Foo', payload: 123 } assert.strictEqual(Entry.isEntry(fakeEntry), false) }) it('is not an Entry - no next', async () => { - const fakeEntry = { id: 'A', hash: 'Foo', payload: 123, seq: 0 } + const fakeEntry = { id: 'A', v: 1, cid: 'Foo', payload: 123, seq: 0 } assert.strictEqual(Entry.isEntry(fakeEntry), false) }) - it('is not an Entry - no hash', async () => { + it('is not an Entry - no version', async () => { const fakeEntry = { id: 'A', next: [], payload: 123, seq: 0 } assert.strictEqual(Entry.isEntry(fakeEntry), false) }) + it('is not an Entry - no cid', async () => { + const fakeEntry = { id: 'A', v: 1, next: [], payload: 123, seq: 0 } + assert.strictEqual(Entry.isEntry(fakeEntry), false) + }) + it('is not an Entry - no payload', async () => { - const fakeEntry = { id: 'A', next: [], hash: 'Foo', seq: 0 } + const fakeEntry = { id: 'A', v: 1, next: [], cid: 'Foo', seq: 0 } assert.strictEqual(Entry.isEntry(fakeEntry), false) }) }) diff --git a/test/fixtures/v0-entries.fixture.js b/test/fixtures/v0-entries.fixture.js new file mode 100644 index 00000000..26e58e17 --- /dev/null +++ b/test/fixtures/v0-entries.fixture.js @@ -0,0 +1,5 @@ +module.exports = { + hello: JSON.parse('{"hash":null,"id":"A","payload":"hello","next":[],"v":0,"clock":{"id":"0411a0d38181c9374eca3e480ecada96b1a4db9375c5e08c3991557759d22f6f2f902d0dc5364a948035002504d825308b0c257b7cbb35229c2076532531f8f4ef","time":0},"key":"0411a0d38181c9374eca3e480ecada96b1a4db9375c5e08c3991557759d22f6f2f902d0dc5364a948035002504d825308b0c257b7cbb35229c2076532531f8f4ef","identity":{"id":"04e9224ee3451772f3ad43068313dc5bdc6d3f2c9a8c3a6ba6f73a472d5f47a96ae6d776de13f2fc2076140fd68ca900df2ca4862b06192adbf8f8cb18a99d69aa","publicKey":"0411a0d38181c9374eca3e480ecada96b1a4db9375c5e08c3991557759d22f6f2f902d0dc5364a948035002504d825308b0c257b7cbb35229c2076532531f8f4ef","signatures":{"id":"3045022042fa401d9ffb0c32de2f02561dc1c5e605ccc5eb33eb56fb638bb8f17bd2adb7022100d8ae57f2d401c1fe0fb1614897f1c731a201230bc269e1a04d1f7d9faecc3ef7","publicKey":"304402206b9c218629d3cd692ad074586834aefe9da480429352870562bb0b601129363e02203717125e9cdb85bea1f84f74d48e6a04b73cda28660486530f4a4fccacdbfa84"},"type":"orbitdb"},"sig":"3044022062f4cfc8b8f3cc01283b25eab3eeb295614bb0faa8bd20f026c1487ae663121102207ce415bd7423b66d695338c17122e937259f77d1e86494d3146436f0959fccc6"}'), + helloWorld: JSON.parse('{"hash":null,"id":"A","payload":"hello world","next":[],"v":0,"clock":{"id":"0411a0d38181c9374eca3e480ecada96b1a4db9375c5e08c3991557759d22f6f2f902d0dc5364a948035002504d825308b0c257b7cbb35229c2076532531f8f4ef","time":0},"key":"0411a0d38181c9374eca3e480ecada96b1a4db9375c5e08c3991557759d22f6f2f902d0dc5364a948035002504d825308b0c257b7cbb35229c2076532531f8f4ef","identity":{"id":"04e9224ee3451772f3ad43068313dc5bdc6d3f2c9a8c3a6ba6f73a472d5f47a96ae6d776de13f2fc2076140fd68ca900df2ca4862b06192adbf8f8cb18a99d69aa","publicKey":"0411a0d38181c9374eca3e480ecada96b1a4db9375c5e08c3991557759d22f6f2f902d0dc5364a948035002504d825308b0c257b7cbb35229c2076532531f8f4ef","signatures":{"id":"3045022042fa401d9ffb0c32de2f02561dc1c5e605ccc5eb33eb56fb638bb8f17bd2adb7022100d8ae57f2d401c1fe0fb1614897f1c731a201230bc269e1a04d1f7d9faecc3ef7","publicKey":"304402206b9c218629d3cd692ad074586834aefe9da480429352870562bb0b601129363e02203717125e9cdb85bea1f84f74d48e6a04b73cda28660486530f4a4fccacdbfa84"},"type":"orbitdb"},"sig":"3044022062f4cfc8b8f3cc01283b25eab3eeb295614bb0faa8bd20f026c1487ae663121102207ce415bd7423b66d695338c17122e937259f77d1e86494d3146436f0959fccc6"}'), + helloAgain: JSON.parse('{"hash":null,"id":"A","payload":"hello again","next":["QmderYccue9XqB7V4EYf71ZygWELdzdbVqo1oxR4nMRrCh"],"v":0,"clock":{"id":"0411a0d38181c9374eca3e480ecada96b1a4db9375c5e08c3991557759d22f6f2f902d0dc5364a948035002504d825308b0c257b7cbb35229c2076532531f8f4ef","time":0},"key":"0411a0d38181c9374eca3e480ecada96b1a4db9375c5e08c3991557759d22f6f2f902d0dc5364a948035002504d825308b0c257b7cbb35229c2076532531f8f4ef","identity":{"id":"04e9224ee3451772f3ad43068313dc5bdc6d3f2c9a8c3a6ba6f73a472d5f47a96ae6d776de13f2fc2076140fd68ca900df2ca4862b06192adbf8f8cb18a99d69aa","publicKey":"0411a0d38181c9374eca3e480ecada96b1a4db9375c5e08c3991557759d22f6f2f902d0dc5364a948035002504d825308b0c257b7cbb35229c2076532531f8f4ef","signatures":{"id":"3045022042fa401d9ffb0c32de2f02561dc1c5e605ccc5eb33eb56fb638bb8f17bd2adb7022100d8ae57f2d401c1fe0fb1614897f1c731a201230bc269e1a04d1f7d9faecc3ef7","publicKey":"304402206b9c218629d3cd692ad074586834aefe9da480429352870562bb0b601129363e02203717125e9cdb85bea1f84f74d48e6a04b73cda28660486530f4a4fccacdbfa84"},"type":"orbitdb"},"sig":"3044022062f4cfc8b8f3cc01283b25eab3eeb295614bb0faa8bd20f026c1487ae663121102207ce415bd7423b66d695338c17122e937259f77d1e86494d3146436f0959fccc6"}') +} diff --git a/test/log-append.spec.js b/test/log-append.spec.js index 9794db63..ee701e41 100644 --- a/test/log-append.spec.js +++ b/test/log-append.spec.js @@ -64,7 +64,7 @@ Object.keys(testAPIs).forEach((IPFS) => { it('has the correct heads', async () => { log.heads.forEach((head) => { - assert.strictEqual(head.hash, log.values[0].hash) + assert.strictEqual(head.cid, log.values[0].cid) }) }) @@ -89,7 +89,7 @@ Object.keys(testAPIs).forEach((IPFS) => { // Make sure the log has the right heads after each append const values = log.values assert.strictEqual(log.heads.length, 1) - assert.strictEqual(log.heads[0].hash, values[values.length - 1].hash) + assert.strictEqual(log.heads[0].cid, values[values.length - 1].cid) } }) diff --git a/test/log-heads-tails.spec.js b/test/log-heads-tails.spec.js index 77620a37..968a3c14 100644 --- a/test/log-heads-tails.spec.js +++ b/test/log-heads-tails.spec.js @@ -63,7 +63,7 @@ Object.keys(testAPIs).forEach((IPFS) => { let log1 = new Log(ipfs, testACL, testIdentity, 'A') await log1.append('helloA1') await log1.append('helloA2') - assert.deepStrictEqual(log1.get(log1.heads[0].hash), log1.heads[0]) + assert.deepStrictEqual(log1.get(log1.heads[0].cid), log1.heads[0]) }) it('finds head after a join and append', async () => { @@ -79,7 +79,7 @@ Object.keys(testAPIs).forEach((IPFS) => { const expectedHead = last(log2.values) assert.strictEqual(log2.heads.length, 1) - assert.deepStrictEqual(log2.heads[0].hash, expectedHead.hash) + assert.deepStrictEqual(log2.heads[0].cid, expectedHead.cid) }) it('finds two heads after a join', async () => { @@ -98,8 +98,8 @@ Object.keys(testAPIs).forEach((IPFS) => { const heads = log1.heads assert.strictEqual(heads.length, 2) - assert.strictEqual(heads[0].hash, expectedHead2.hash) - assert.strictEqual(heads[1].hash, expectedHead1.hash) + assert.strictEqual(heads[0].cid, expectedHead2.cid) + assert.strictEqual(heads[1].cid, expectedHead1.cid) }) it('finds two heads after two joins', async () => { @@ -125,8 +125,8 @@ Object.keys(testAPIs).forEach((IPFS) => { const heads = log1.heads assert.strictEqual(heads.length, 2) - assert.strictEqual(heads[0].hash, expectedHead1.hash) - assert.strictEqual(heads[1].hash, expectedHead2.hash) + assert.strictEqual(heads[0].cid, expectedHead1.cid) + assert.strictEqual(heads[1].cid, expectedHead2.cid) }) it('finds two heads after three joins', async () => { @@ -151,8 +151,8 @@ Object.keys(testAPIs).forEach((IPFS) => { const heads = log1.heads assert.strictEqual(heads.length, 2) - assert.strictEqual(heads[0].hash, expectedHead1.hash) - assert.strictEqual(heads[1].hash, expectedHead2.hash) + assert.strictEqual(heads[0].cid, expectedHead1.cid) + assert.strictEqual(heads[1].cid, expectedHead2.cid) }) it('finds three heads after three joins', async () => { @@ -178,9 +178,9 @@ Object.keys(testAPIs).forEach((IPFS) => { const heads = log1.heads assert.strictEqual(heads.length, 3) - assert.deepStrictEqual(heads[0].hash, expectedHead1.hash) - assert.deepStrictEqual(heads[1].hash, expectedHead2.hash) - assert.deepStrictEqual(heads[2].hash, expectedHead3.hash) + assert.deepStrictEqual(heads[0].cid, expectedHead1.cid) + assert.deepStrictEqual(heads[1].cid, expectedHead2.cid) + assert.deepStrictEqual(heads[2].cid, expectedHead3.cid) }) }) @@ -208,7 +208,7 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.strictEqual(Entry.isEntry(log1.tails[1]), true) }) - it('returns tail hashes', async () => { + it('returns tail cids', async () => { let log1 = new Log(ipfs, testACL, testIdentity, 'A') let log2 = new Log(ipfs, testACL, testIdentity, 'A') await log1.append('helloA1') @@ -216,16 +216,16 @@ Object.keys(testAPIs).forEach((IPFS) => { await log2.append('helloB1') await log2.append('helloB2') await log1.join(log2, 2) - assert.strictEqual(log1.tailHashes.length, 2) + assert.strictEqual(log1.tailCids.length, 2) }) - it('returns no tail hashes if all entries point to empty nexts', async () => { + it('returns no tail cids if all entries point to empty nexts', async () => { let log1 = new Log(ipfs, testACL, testIdentity, 'A') let log2 = new Log(ipfs, testACL, testIdentity, 'A') await log1.append('helloA1') await log2.append('helloB1') await log1.join(log2) - assert.strictEqual(log1.tailHashes.length, 0) + assert.strictEqual(log1.tailCids.length, 0) }) it('returns tails after loading a partial log', async () => { @@ -239,8 +239,8 @@ Object.keys(testAPIs).forEach((IPFS) => { const log4 = await Log.fromEntry(ipfs, testACL, testIdentity, log1.heads, 2) assert.strictEqual(log4.length, 2) assert.strictEqual(log4.tails.length, 2) - assert.strictEqual(log4.tails[0].hash, log4.values[0].hash) - assert.strictEqual(log4.tails[1].hash, log4.values[1].hash) + assert.strictEqual(log4.tails[0].cid, log4.values[0].cid) + assert.strictEqual(log4.tails[1].cid, log4.values[1].cid) }) it('returns tails sorted by id', async () => { diff --git a/test/log-join.spec.js b/test/log-join.spec.js index 73340e3b..065ac8b0 100644 --- a/test/log-join.spec.js +++ b/test/log-join.spec.js @@ -143,7 +143,7 @@ Object.keys(testAPIs).forEach((IPFS) => { 'helloA1', 'helloB1', 'helloA2', 'helloB2' ] - assert.deepStrictEqual(log1.values.map((e) => e.hash), log2.values.map((e) => e.hash)) + assert.deepStrictEqual(log1.values.map((e) => e.cid), log2.values.map((e) => e.cid)) assert.deepStrictEqual(log1.values.map((e) => e.payload), expectedData) assert.deepStrictEqual(log2.values.map((e) => e.payload), expectedData) }) diff --git a/test/log-load.spec.js b/test/log-load.spec.js index c2782707..070429fa 100644 --- a/test/log-load.spec.js +++ b/test/log-load.spec.js @@ -114,10 +114,10 @@ Object.keys(testAPIs).forEach((IPFS) => { } let i = 0 - const callback = (hash, entry, depth) => { + const callback = (cid, entry, depth) => { assert.notStrictEqual(entry, null) - assert.strictEqual(hash, items1[items1.length - i - 1].hash) - assert.strictEqual(entry.hash, items1[items1.length - i - 1].hash) + assert.strictEqual(cid, items1[items1.length - i - 1].cid) + assert.strictEqual(entry.cid, items1[items1.length - i - 1].cid) assert.strictEqual(entry.payload, items1[items1.length - i - 1].payload) assert.strictEqual(depth - 1, i) @@ -127,7 +127,7 @@ Object.keys(testAPIs).forEach((IPFS) => { await Log.fromEntry(ipfs, testACL, testIdentity, last(items1), -1, [], callback) }) - it('retrieves partial log from an entry hash', async () => { + it('retrieves partial log from an entry CID', async () => { const log1 = new Log(ipfs, testACL, testIdentity, 'X') const log2 = new Log(ipfs, testACL, testIdentity2, 'X') const log3 = new Log(ipfs, testACL, testIdentity3, 'X') @@ -156,7 +156,7 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.strictEqual(b.length, 42) }) - it('throws an error if trying to create a log from a hash of an entry', async () => { + it('throws an error if trying to create a log from a CID of an entry', async () => { let items1 = [] const amount = 5 for (let i = 1; i <= amount; i++) { @@ -167,14 +167,14 @@ Object.keys(testAPIs).forEach((IPFS) => { let err try { - await Log.fromEntry(ipfs, testACL, testIdentity, last(items1).hash, 1) + await Log.fromEntry(ipfs, testACL, testIdentity, last(items1).cid, 1) } catch (e) { err = e } assert.strictEqual(err.message, `'sourceEntries' argument must be an array of Entry instances or a single Entry`) }) - it('retrieves full log from an entry hash', async () => { + it('retrieves full log from an entry CID', async () => { const log1 = new Log(ipfs, testACL, testIdentity, 'X') const log2 = new Log(ipfs, testACL, testIdentity2, 'X') const log3 = new Log(ipfs, testACL, testIdentity3, 'X') @@ -204,7 +204,7 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.strictEqual(c.length, amount * 3) }) - it('retrieves full log from an entry hash 2', async () => { + it('retrieves full log from an entry CID 2', async () => { const log1 = new Log(ipfs, testACL, testIdentity, 'X') const log2 = new Log(ipfs, testACL, testIdentity2, 'X') const log3 = new Log(ipfs, testACL, testIdentity3, 'X') @@ -234,7 +234,7 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.strictEqual(c.length, amount * 3) }) - it('retrieves full log from an entry hash 3', async () => { + it('retrieves full log from an entry CID 3', async () => { const log1 = new Log(ipfs, testACL, testIdentity, 'X') const log2 = new Log(ipfs, testACL, testIdentity3, 'X') const log3 = new Log(ipfs, testACL, testIdentity4, 'X') @@ -455,8 +455,8 @@ Object.keys(testAPIs).forEach((IPFS) => { let reverseOrder = log.values.slice().reverse().sort(Entry.compare) assert.deepStrictEqual(fetchOrder, reverseOrder) - let hashOrder = log.values.slice().sort((a, b) => a.hash > b.hash).sort(Entry.compare) - assert.deepStrictEqual(fetchOrder, hashOrder) + let cidOrder = log.values.slice().sort((a, b) => a.cid > b.cid).sort(Entry.compare) + assert.deepStrictEqual(fetchOrder, cidOrder) let randomOrder2 = log.values.slice().sort((a, b) => 0.5 - Math.random()).sort(Entry.compare) assert.deepStrictEqual(fetchOrder, randomOrder2) @@ -547,10 +547,10 @@ Object.keys(testAPIs).forEach((IPFS) => { await log.join(logA) - const mh = await log.toMultihash() + const cid = await log.toCID() // First 5 - let res = await Log.fromMultihash(ipfs, testACL, testIdentity2, mh, 5) + let res = await Log.fromCID(ipfs, testACL, testIdentity2, cid, 5) const first5 = [ 'entryA5', 'entryB5', 'entryC0', 'entryA9', 'entryA10' @@ -559,7 +559,7 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.deepStrictEqual(res.values.map(e => e.payload), first5) // First 11 - res = await Log.fromMultihash(ipfs, testACL, testIdentity2, mh, 11) + res = await Log.fromCID(ipfs, testACL, testIdentity2, cid, 11) const first11 = [ 'entryA3', 'entryB3', 'entryA4', 'entryB4', @@ -571,7 +571,7 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.deepStrictEqual(res.values.map(e => e.payload), first11) // All but one - res = await Log.fromMultihash(ipfs, testACL, testIdentity2, mh, 16 - 1) + res = await Log.fromCID(ipfs, testACL, testIdentity2, cid, 16 - 1) const all = [ 'entryA1', /* excl */ 'entryA2', 'entryB2', 'entryA3', 'entryB3', @@ -611,10 +611,10 @@ Object.keys(testAPIs).forEach((IPFS) => { await log.join(logA) - const mh = await log.toMultihash() + const cid = await log.toCID() // First 5 - let res = await Log.fromMultihash(ipfs, testACL, testIdentity2, mh, 5) + let res = await Log.fromCID(ipfs, testACL, testIdentity2, cid, 5) const first5 = [ 'entryC0', 'entryA7', 'entryA8', 'entryA9', 'entryA10' @@ -623,7 +623,7 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.deepStrictEqual(res.values.map(e => e.payload), first5) // First 11 - res = await Log.fromMultihash(ipfs, testACL, testIdentity2, mh, 11) + res = await Log.fromCID(ipfs, testACL, testIdentity2, cid, 11) const first11 = [ 'entryA1', 'entryA2', 'entryA3', 'entryA4', @@ -635,7 +635,7 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.deepStrictEqual(res.values.map(e => e.payload), first11) // All but one - res = await Log.fromMultihash(ipfs, testACL, testIdentity2, mh, 16 - 1) + res = await Log.fromCID(ipfs, testACL, testIdentity2, cid, 16 - 1) const all = [ 'entryA1', /* excl */ 'entryA2', 'entryB2', 'entryA3', 'entryB3', @@ -698,19 +698,19 @@ Object.keys(testAPIs).forEach((IPFS) => { it('returns all entries - no excluded entries', async () => { const a = await Log.fromEntry(ipfs, testACL, testIdentity, last(items1), -1) assert.strictEqual(a.length, amount) - assert.strictEqual(a.values[0].hash, items1[0].hash) + assert.strictEqual(a.values[0].cid, items1[0].cid) }) it('returns all entries - including excluded entries', async () => { // One entry const a = await Log.fromEntry(ipfs, testACL, testIdentity, last(items1), -1, [items1[0]]) assert.strictEqual(a.length, amount) - assert.strictEqual(a.values[0].hash, items1[0].hash) + assert.strictEqual(a.values[0].cid, items1[0].cid) // All entries const b = await Log.fromEntry(ipfs, testACL, testIdentity, last(items1), -1, items1) assert.strictEqual(b.length, amount) - assert.strictEqual(b.values[0].hash, items1[0].hash) + assert.strictEqual(b.values[0].cid, items1[0].cid) }) }) }) diff --git a/test/log.spec.js b/test/log.spec.js index 76c096ae..c5d58379 100644 --- a/test/log.spec.js +++ b/test/log.spec.js @@ -1,13 +1,18 @@ 'use strict' const assert = require('assert') +const sinon = require('sinon') const rmrf = require('rimraf') +const dagPB = require('ipld-dag-pb') +const pify = require('pify') const Clock = require('../src/lamport-clock') const Entry = require('../src/entry') const Log = require('../src/log') const AccessController = Log.AccessController const IdentityProvider = require('orbit-db-identity-provider') +const createPbDagNode = pify(dagPB.DAGNode.create) + // Test utils const { config, @@ -52,7 +57,7 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.notStrictEqual(log.values, null) assert.notStrictEqual(log.heads, null) assert.notStrictEqual(log.tails, null) - assert.notStrictEqual(log.tailHashes, null) + assert.notStrictEqual(log.tailCids, null) assert.deepStrictEqual(log.values, []) assert.deepStrictEqual(log.heads, []) assert.deepStrictEqual(log.tails, []) @@ -101,7 +106,7 @@ Object.keys(testAPIs).forEach((IPFS) => { const three = await Entry.create(ipfs, testIdentity, 'A', 'entryC', []) const log = new Log(ipfs, testACL, testIdentity, 'B', [one, two, three], [three]) assert.strictEqual(log.heads.length, 1) - assert.strictEqual(log.heads[0].hash, three.hash) + assert.strictEqual(log.heads[0].cid, three.cid) }) it('finds heads if heads not given as params', async () => { @@ -110,9 +115,9 @@ Object.keys(testAPIs).forEach((IPFS) => { const three = await Entry.create(ipfs, testIdentity, 'A', 'entryC', []) const log = new Log(ipfs, testACL, testIdentity, 'A', [one, two, three]) assert.strictEqual(log.heads.length, 3) - assert.strictEqual(log.heads[2].hash, one.hash) - assert.strictEqual(log.heads[1].hash, two.hash) - assert.strictEqual(log.heads[0].hash, three.hash) + assert.strictEqual(log.heads[2].cid, one.cid) + assert.strictEqual(log.heads[1].cid, two.cid) + assert.strictEqual(log.heads[0].cid, three.cid) }) it('throws an error if entries is not an array', () => { @@ -187,8 +192,8 @@ Object.keys(testAPIs).forEach((IPFS) => { }) it('returns an Entry', () => { - const entry = log.get(log.values[0].hash) - assert.deepStrictEqual(entry.hash, 'QmXmmR8f9zYbAQouvLJYhvoffb7c31FC7DV6nSfkv5iJKG') + const entry = log.get(log.values[0].cid) + assert.deepStrictEqual(entry.cid, 'zdpuB2kFv5s6UjDaCWkjE3mNnDVgYHLBrFamYonJZ5xtvtg4v') }) it('returns undefined when Entry is not in the log', () => { @@ -202,11 +207,11 @@ Object.keys(testAPIs).forEach((IPFS) => { before(async () => { expectedData = { - hash: 'QmXmmR8f9zYbAQouvLJYhvoffb7c31FC7DV6nSfkv5iJKG', + cid: 'zdpuB2kFv5s6UjDaCWkjE3mNnDVgYHLBrFamYonJZ5xtvtg4v', id: 'AAA', payload: 'one', next: [], - v: 0, + v: 1, clock: new Clock(testIdentity.publicKey, 1), key: testIdentity.toJSON() } @@ -223,12 +228,12 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.strictEqual(log.has(expectedData), true) }) - it('returns true if it has an Entry, hash lookup', () => { - assert.strictEqual(log.has(expectedData.hash), true) + it('returns true if it has an Entry, CID lookup', () => { + assert.strictEqual(log.has(expectedData.cid), true) }) it('returns false if it doesn\'t have the Entry', () => { - assert.strictEqual(log.has('QmFoo'), false) + assert.strictEqual(log.has('zdFoo'), false) }) }) @@ -236,7 +241,7 @@ Object.keys(testAPIs).forEach((IPFS) => { let log//, testIdentity2, testIdentity3, testIdentity4 const expectedData = { id: 'AAA', - heads: ['QmRk7Cborp5kyvAr6ty8Qhxs9PtvdBojG9uWUopqUN3c4z'] + heads: ['zdpuAw6yxK132nAvHtZiWSsEgDd55AgCpjc44jFizqSscwAKR'] } beforeEach(async () => { @@ -255,11 +260,11 @@ Object.keys(testAPIs).forEach((IPFS) => { describe('toSnapshot', () => { const expectedData = { id: 'AAA', - heads: ['QmRk7Cborp5kyvAr6ty8Qhxs9PtvdBojG9uWUopqUN3c4z'], + heads: ['zdpuAw6yxK132nAvHtZiWSsEgDd55AgCpjc44jFizqSscwAKR'], values: [ - 'QmXmmR8f9zYbAQouvLJYhvoffb7c31FC7DV6nSfkv5iJKG', - 'QmbxyqTACVkkGkkBryEsUP7ff2trezXy4eK67izyxjmu4X', - 'QmRk7Cborp5kyvAr6ty8Qhxs9PtvdBojG9uWUopqUN3c4z' + 'zdpuB2kFv5s6UjDaCWkjE3mNnDVgYHLBrFamYonJZ5xtvtg4v', + 'zdpuApQir9nBg7SAts4gx5naAh77qLzP3Xtmda3RHj9msPatg', + 'zdpuAw6yxK132nAvHtZiWSsEgDd55AgCpjc44jFizqSscwAKR' ] } @@ -267,11 +272,11 @@ Object.keys(testAPIs).forEach((IPFS) => { const snapshot = log.toSnapshot() assert.strictEqual(snapshot.id, expectedData.id) assert.strictEqual(snapshot.heads.length, expectedData.heads.length) - assert.strictEqual(snapshot.heads[0].hash, expectedData.heads[0]) + assert.strictEqual(snapshot.heads[0].cid, expectedData.heads[0]) assert.strictEqual(snapshot.values.length, expectedData.values.length) - assert.strictEqual(snapshot.values[0].hash, expectedData.values[0]) - assert.strictEqual(snapshot.values[1].hash, expectedData.values[1]) - assert.strictEqual(snapshot.values[2].hash, expectedData.values[2]) + assert.strictEqual(snapshot.values[0].cid, expectedData.values[0]) + assert.strictEqual(snapshot.values[1].cid, expectedData.values[1]) + assert.strictEqual(snapshot.values[2].cid, expectedData.values[2]) }) }) @@ -281,26 +286,63 @@ Object.keys(testAPIs).forEach((IPFS) => { }) }) + describe('toCID', async () => { + it('returns the log as ipfs CID', async () => { + const expectedCid = 'zdpuArva1LTmn5zFYyAfpbxmXRwge2gwiWdJogSHfaJiBWSU9' + let log = new Log(ipfs, testACL, testIdentity, 'A') + await log.append('one') + const cid = await log.toCID() + assert.strictEqual(cid, expectedCid) + }) + + it('log serialized to ipfs contains the correct data', async () => { + const expectedData = { + id: 'A', + heads: ['zdpuAojkSxbS84ai4FxpLzxohXiquwzNSXMozr7syKfC7sKi7'] + } + const expectedCid = 'zdpuArva1LTmn5zFYyAfpbxmXRwge2gwiWdJogSHfaJiBWSU9' + let log = new Log(ipfs, testACL, testIdentity, 'A') + await log.append('one') + const cid = await log.toCID() + assert.strictEqual(cid, expectedCid) + const result = await ipfs.dag.get(cid) + const heads = result.value.heads.map(head => head.toBaseEncodedString()) + assert.deepStrictEqual(heads, expectedData.heads) + }) + + it('throws an error if log items is empty', async () => { + const emptyLog = new Log(ipfs, testACL, testIdentity) + let err + try { + await emptyLog.toCID() + } catch (e) { + err = e + } + assert.notStrictEqual(err, null) + assert.strictEqual(err.message, 'Can\'t serialize an empty log') + }) + }) + describe('toMultihash', async () => { - it('returns the log as ipfs hash', async () => { - const expectedHash = 'QmbxZPQsFdj3qA3gvtHV7fJvb48ZoScNWb2zJpKyR3A5BF' + it('returns the log as ipfs multihash', async () => { + const expectedMultihash = 'Qmavo9Z6hJcVhDcsc2t7Stg2EpHyPeArCeNmucCjmUP55C' let log = new Log(ipfs, testACL, testIdentity, 'A') await log.append('one') - const hash = await log.toMultihash() - assert.strictEqual(hash, expectedHash) + const multihash = await log.toMultihash() + assert.strictEqual(multihash, expectedMultihash) }) it('log serialized to ipfs contains the correct data', async () => { const expectedData = { id: 'A', - heads: ['QmNPsBXD1ieznbsMEgPZdSgxB25vCC6vRge9XfynaFtgxs'] + heads: ['zdpuAojkSxbS84ai4FxpLzxohXiquwzNSXMozr7syKfC7sKi7'] } - const expectedHash = 'QmbxZPQsFdj3qA3gvtHV7fJvb48ZoScNWb2zJpKyR3A5BF' + const expectedMultihash = 'Qmavo9Z6hJcVhDcsc2t7Stg2EpHyPeArCeNmucCjmUP55C' let log = new Log(ipfs, testACL, testIdentity, 'A') await log.append('one') - const hash = await log.toMultihash() - assert.strictEqual(hash, expectedHash) - const result = await ipfs.object.get(hash) + const multihash = await log.toMultihash() + assert.strictEqual(multihash, expectedMultihash) + const result = await ipfs.object.get(multihash) const res = JSON.parse(result.toJSON().data.toString()) assert.deepStrictEqual(res.heads, expectedData.heads) }) @@ -318,16 +360,16 @@ Object.keys(testAPIs).forEach((IPFS) => { }) }) - describe('fromMultihash', async () => { - it('creates a log from ipfs hash - one entry', async () => { + describe('fromCID', async () => { + it('creates a log from ipfs CID - one entry', async () => { const expectedData = { id: 'X', - heads: ['QmRRGWJ8PzhHTp3zgdx2fS4adXF1q4HVGZ9MtbLgZ8QFfL'] + heads: ['zdpuB2NAQ7cSh9MAfY91QC6Va56pQMJBXBaLoS6uQ1qNxqija'] } let log = new Log(ipfs, testACL, testIdentity, 'X') await log.append('one') - const hash = await log.toMultihash() - const res = await Log.fromMultihash(ipfs, testACL, testIdentity, hash, -1) + const cid = await log.toCID() + const res = await Log.fromCID(ipfs, testACL, testIdentity, cid, -1) assert.strictEqual(JSON.stringify(res.toJSON()), JSON.stringify(expectedData)) assert.strictEqual(res.length, 1) assert.strictEqual(res.values[0].payload, 'one') @@ -335,9 +377,9 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.strictEqual(res.values[0].clock.time, 1) }) - it('creates a log from ipfs hash - three entries', async () => { - const hash = await log.toMultihash() - const res = await Log.fromMultihash(ipfs, testACL, testIdentity, hash, -1) + it('creates a log from ipfs CID - three entries', async () => { + const cid = await log.toCID() + const res = await Log.fromCID(ipfs, testACL, testIdentity, cid, -1) assert.strictEqual(res.length, 3) assert.strictEqual(res.values[0].payload, 'one') assert.strictEqual(res.values[0].clock.time, 1) @@ -347,9 +389,25 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.strictEqual(res.values[2].clock.time, 3) }) + it('creates a log from ipfs multihash (backwards compat)', async () => { + const expectedData = { + id: 'X', + heads: ['zdpuB2NAQ7cSh9MAfY91QC6Va56pQMJBXBaLoS6uQ1qNxqija'] + } + let log = new Log(ipfs, testACL, testIdentity, 'X') + await log.append('one') + const multihash = await log.toMultihash() + const res = await Log.fromCID(ipfs, testACL, testIdentity, multihash, -1) + assert.strictEqual(JSON.stringify(res.toJSON()), JSON.stringify(expectedData)) + assert.strictEqual(res.length, 1) + assert.strictEqual(res.values[0].payload, 'one') + assert.strictEqual(res.values[0].clock.id, testIdentity.publicKey) + assert.strictEqual(res.values[0].clock.time, 1) + }) + it('has the right sequence number after creation and appending', async () => { - const hash = await log.toMultihash() - let res = await Log.fromMultihash(ipfs, testACL, testIdentity, hash, -1) + const cid = await log.toCID() + let res = await Log.fromCID(ipfs, testACL, testIdentity, cid, -1) assert.strictEqual(res.length, 3) await res.append('four') assert.strictEqual(res.length, 4) @@ -357,7 +415,7 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.strictEqual(res.values[3].clock.time, 4) }) - it('creates a log from ipfs hash that has three heads', async () => { + it('creates a log from ipfs CID that has three heads', async () => { let log1 = new Log(ipfs, testACL, testIdentity, 'A') let log2 = new Log(ipfs, testACL, testIdentity2, 'A') let log3 = new Log(ipfs, testACL, testIdentity3, 'A') @@ -366,8 +424,8 @@ Object.keys(testAPIs).forEach((IPFS) => { await log2.append('three') await log1.join(log2) await log1.join(log3) - const hash = await log1.toMultihash() - const res = await Log.fromMultihash(ipfs, testACL, testIdentity, hash, -1) + const cid = await log1.toCID() + const res = await Log.fromCID(ipfs, testACL, testIdentity, cid, -1) assert.strictEqual(res.length, 3) assert.strictEqual(res.heads.length, 3) assert.strictEqual(res.heads[0].payload, 'three') @@ -375,33 +433,33 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.strictEqual(res.heads[2].payload, 'one') }) - it('creates a log from ipfs hash up to a size limit', async () => { + it('creates a log from ipfs CID up to a size limit', async () => { const amount = 100 const size = amount / 2 let log = new Log(ipfs, testACL, testIdentity, 'A') for (let i = 0; i < amount; i++) { await log.append(i.toString()) } - const hash = await log.toMultihash() - const res = await Log.fromMultihash(ipfs, testACL, testIdentity, hash, size) + const cid = await log.toCID() + const res = await Log.fromCID(ipfs, testACL, testIdentity, cid, size) assert.strictEqual(res.length, size) }) - it('creates a log from ipfs hash up without size limit', async () => { + it('creates a log from ipfs CID up without size limit', async () => { const amount = 100 let log = new Log(ipfs, testACL, testIdentity, 'A') for (let i = 0; i < amount; i++) { await log.append(i.toString()) } - const hash = await log.toMultihash() - const res = await Log.fromMultihash(ipfs, testACL, testIdentity, hash, -1) + const cid = await log.toCID() + const res = await Log.fromCID(ipfs, testACL, testIdentity, cid, -1) assert.strictEqual(res.length, amount) }) it('throws an error if ipfs is not defined', async () => { let err try { - await Log.fromMultihash() + await Log.fromCID() } catch (e) { err = e } @@ -409,37 +467,41 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.strictEqual(err.message, 'IPFS instance not defined') }) - it('throws an error if hash is not defined', async () => { + it('throws an error if CID is not defined', async () => { let err try { - await Log.fromMultihash(ipfs) + await Log.fromCID(ipfs) } catch (e) { err = e } assert.notStrictEqual(err, null) - assert.strictEqual(err.message, 'Invalid hash: undefined') + assert.strictEqual(err.message, 'Invalid CID: undefined') }) - it('throws an error when data from hash is not instance of Log', async () => { - const res = await ipfs.object.put(Buffer.from('{}')) + it('throws an error if data from CID is not valid JSON', async () => { + const dagNode = await createPbDagNode(Buffer.from('hello')) + let cid = await ipfs.dag.put(dagNode, { + hashAlg: 'sha2-256', + format: 'dag-pb' + }) let err try { - await Log.fromMultihash(ipfs, testACL, testIdentity, res.toJSON().multihash) + await Log.fromCID(ipfs, testACL, testIdentity, cid.toBaseEncodedString()) } catch (e) { err = e } - assert.strictEqual(err.message, 'Given argument is not an instance of Log') + assert.strictEqual(err.message, 'Unexpected token h in JSON at position 0') }) - it('throws an error if data from hash is not valid JSON', async () => { - const res = await ipfs.object.put(Buffer.from('hello')) + it('throws an error when data from CID is not instance of Log', async () => { + const cid = await ipfs.dag.put({}) let err try { - await Log.fromMultihash(ipfs, testACL, testIdentity, res.toJSON().multihash) + await Log.fromCID(ipfs, testACL, testIdentity, cid) } catch (e) { err = e } - assert.strictEqual(err.message, 'Unexpected token h in JSON at position 0') + assert.strictEqual(err.message, 'Given argument is not an instance of Log') }) it('onProgress callback is fired for each entry', async () => { @@ -451,17 +513,17 @@ Object.keys(testAPIs).forEach((IPFS) => { const items = log.values let i = 0 - const loadProgressCallback = (hash, entry, depth) => { + const loadProgressCallback = (cid, entry, depth) => { assert.notStrictEqual(entry, null) - assert.strictEqual(hash, items[items.length - i - 1].hash) - assert.strictEqual(entry.hash, items[items.length - i - 1].hash) + assert.strictEqual(cid, items[items.length - i - 1].cid) + assert.strictEqual(entry.cid, items[items.length - i - 1].cid) assert.strictEqual(entry.payload, items[items.length - i - 1].payload) assert.strictEqual(depth - 1, i) i++ } - const hash = await log.toMultihash() - const result = await Log.fromMultihash(ipfs, testACL, testIdentity, hash, -1, [], loadProgressCallback) + const cid = await log.toCID() + const result = await Log.fromCID(ipfs, testACL, testIdentity, cid, -1, [], loadProgressCallback) // Make sure the onProgress callback was called for each entry assert.strictEqual(i, amount) @@ -472,6 +534,28 @@ Object.keys(testAPIs).forEach((IPFS) => { assert.strictEqual(result.values[result.length - 1].payload, '99') }) }) + + describe('fromMultihash', async () => { + afterEach(() => { + if (Log.fromCID.restore) { + Log.fromCID.restore() + } + }) + + it('calls fromCID', async () => { + const spy = sinon.spy(Log, 'fromCID') + const expectedData = { + id: 'X', + heads: ['zdpuB2NAQ7cSh9MAfY91QC6Va56pQMJBXBaLoS6uQ1qNxqija'] + } + let log = new Log(ipfs, testACL, testIdentity, 'X') + await log.append('one') + const multihash = await log.toMultihash() + const res = await Log.fromMultihash(ipfs, testACL, testIdentity, multihash, -1) + assert(spy.calledOnceWith(ipfs, testACL, testIdentity, multihash, -1)) + assert.strictEqual(JSON.stringify(res.toJSON()), JSON.stringify(expectedData)) + }) + }) }) describe('values', () => { diff --git a/test/replicate.spec.js b/test/replicate.spec.js index b6131579..35a0147a 100644 --- a/test/replicate.spec.js +++ b/test/replicate.spec.js @@ -46,10 +46,10 @@ Object.keys(testAPIs).forEach((IPFS) => { // Use mem-store for faster testing (no disk IO) const memstore = new MemStore() - ipfs1.object.put = memstore.put.bind(memstore) - ipfs1.object.get = memstore.get.bind(memstore) - ipfs2.object.put = memstore.put.bind(memstore) - ipfs2.object.get = memstore.get.bind(memstore) + ipfs1.dag.put = memstore.put.bind(memstore) + ipfs1.dag.get = memstore.get.bind(memstore) + ipfs2.dag.put = memstore.put.bind(memstore) + ipfs2.dag.get = memstore.get.bind(memstore) // Create an identity for each peers testIdentity = await IdentityProvider.createIdentity({ id: 'userA', identityKeysPath, signingKeysPath }) @@ -81,7 +81,7 @@ Object.keys(testAPIs).forEach((IPFS) => { processing++ process.stdout.write('\r') process.stdout.write(`> Buffer1: ${buffer1.length} - Buffer2: ${buffer2.length}`) - const log = await Log.fromMultihash(ipfs1, testACL, testIdentity, message.data.toString(), -1) + const log = await Log.fromCID(ipfs1, testACL, testIdentity, message.data.toString(), -1) await log1.join(log) processing-- } @@ -94,7 +94,7 @@ Object.keys(testAPIs).forEach((IPFS) => { processing++ process.stdout.write('\r') process.stdout.write(`> Buffer1: ${buffer1.length} - Buffer2: ${buffer2.length}`) - const log = await Log.fromMultihash(ipfs2, testACL, testIdentity2, message.data.toString(), -1, null) + const log = await Log.fromCID(ipfs2, testACL, testIdentity2, message.data.toString(), -1, null) await log2.join(log) processing-- } @@ -114,10 +114,10 @@ Object.keys(testAPIs).forEach((IPFS) => { for (let i = 1; i <= amount; i++) { await input1.append('A' + i) await input2.append('B' + i) - const mh1 = await input1.toMultihash() - const mh2 = await input2.toMultihash() - await ipfs1.pubsub.publish(channel, Buffer.from(mh1)) - await ipfs2.pubsub.publish(channel, Buffer.from(mh2)) + const cid1 = await input1.toCID() + const cid2 = await input2.toCID() + await ipfs1.pubsub.publish(channel, Buffer.from(cid1)) + await ipfs2.pubsub.publish(channel, Buffer.from(cid2)) } console.log('\nAll messages sent') diff --git a/test/signed-log.spec.js b/test/signed-log.spec.js index bad9cd63..225cf113 100644 --- a/test/signed-log.spec.js +++ b/test/signed-log.spec.js @@ -158,7 +158,7 @@ Object.keys(testAPIs).forEach((IPFS) => { } const entry = log2.values[0] - assert.strictEqual(err, `Error: Could not validate signature "${entry.sig}" for entry "${entry.hash}" and key "${entry.key}"`) + assert.strictEqual(err, `Error: Could not validate signature "${entry.sig}" for entry "${entry.cid}" and key "${entry.key}"`) assert.strictEqual(log1.values.length, 1) assert.strictEqual(log1.values[0].payload, 'one') }) diff --git a/test/utils/mem-store.js b/test/utils/mem-store.js index 81488307..5e1567ed 100644 --- a/test/utils/mem-store.js +++ b/test/utils/mem-store.js @@ -1,60 +1,61 @@ 'use strict' const multihashing = require('multihashing-async') -const mh = require('multihashes') +const CID = require('cids') +const pify = require('pify') -const defaultHashAlg = 'sha2-256' +const createMultihash = pify(multihashing) -const createMultihash = (data, hashAlg) => { - return new Promise((resolve, reject) => { - multihashing(data, hashAlg || defaultHashAlg, (err, multihash) => { - if (err) { - return reject(err) - } +const transformCborLinksIntoCids = (data) => { + if (!data) { + return data + } - resolve(mh.toB58String(multihash)) - }) - }) -} + if (data['/']) { + return new CID(data['/']) + } + + if (Array.isArray(data)) { + return data.map(transformCborLinksIntoCids) + } + + if (typeof data === 'object') { + return Object.keys(data).reduce((obj, key) => { + obj[key] = transformCborLinksIntoCids(data[key]) + + return obj + }, {}) + } -// const LRU = require('lru') -// const ImmutableDB = require('./immutabledb-interface') -// const createMultihash = require('./create-multihash') + return data +} /* Memory store using an LRU cache */ class MemStore { constructor () { - this._store = {}// new LRU(1000) + this._store = new Map() } async put (value) { - const data = value// new Buffer(JSON.stringify(value)) - const hash = await createMultihash(data) - // console.log(this._store) - // this._store.set(hash, data) - if (!this._store) this._store = {} - // console.log(this._store) - // console.log(hash, data) - this._store[hash] = data - // return hash - return { - toJSON: () => { - return { - data: value, - multihash: hash - } - } - } + const buffer = Buffer.from(JSON.stringify(value)) + const multihash = await createMultihash(buffer, 'sha2-256') + const cid = new CID(1, 'dag-cbor', multihash) + const key = cid.toBaseEncodedString() + + this._store.set(key, value) + + return cid } - async get (key) { + async get (cid) { + if (CID.isCID(cid)) { + cid = cid.toBaseEncodedString() + } + + const data = this._store.get(cid) + return { - toJSON: () => { - return { - data: this._store[key], - multihash: key - } - } + value: transformCborLinksIntoCids(data) } } }