From 64ffbf30fa0f13d6cfbe4c9c4225126c4717e7be Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 12 May 2020 10:50:49 -0700 Subject: [PATCH 1/2] chore(deps): adds external context dep Signed-off-by: andrew --- package-lock.json | 425 ++++++++++++++++---------------------------- package.json | 12 +- src/buckets.spec.ts | 4 +- src/buckets.ts | 2 +- src/context.ts | 156 ---------------- src/index.ts | 1 - src/users.spec.ts | 28 +-- src/users.ts | 2 +- src/utils.ts | 2 +- 9 files changed, 173 insertions(+), 459 deletions(-) delete mode 100644 src/context.ts diff --git a/package-lock.json b/package-lock.json index c2ab99f0d..dabcac357 100644 --- a/package-lock.json +++ b/package-lock.json @@ -879,9 +879,9 @@ } }, "@consento/sync-randombytes": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@consento/sync-randombytes/-/sync-randombytes-1.0.4.tgz", - "integrity": "sha512-4t4DPCvpkAHhtWGieQWf8B0GqK4XgoQ77S9yCAGMuJ1VG++OCKl/4GzHimJdCI43h9ZZnUAAIaKfEx3K7n6OQw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@consento/sync-randombytes/-/sync-randombytes-1.0.5.tgz", + "integrity": "sha512-mPJ2XvrTLQGEdhleDuSIkWtVWnvmhREOC1FjorV1nlK49t/52Z9X1d618gTj6nlQghRLiYvcd8oL4vZ2YZuDIQ==", "requires": { "buffer": "^5.4.3", "seedrandom": "^3.0.5" @@ -899,7 +899,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/@ipld/block/-/block-4.0.2.tgz", "integrity": "sha512-O041EI8D3hOws5PqRsiQpeOSAwtkm4z/EfBHPszwR/qd353h6GQ0uiAV/Qru1dWYN+eR5z37/KpnrM3iLCKPjA==", - "dev": true, "requires": { "@ipld/get-codec": "^4.0.0", "buffer": "^5.6.0", @@ -913,7 +912,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/@ipld/codec-interface/-/codec-interface-1.0.8.tgz", "integrity": "sha512-qidYsyxc2miM4auojdwQhAdqYucjiz0IsoklCRXv0lnl625YvkVBSCeKrrpivQX4R0jZEM34V5qnvzRMksO+Fg==", - "dev": true, "requires": { "cids": "~0.7.2" }, @@ -922,13 +920,23 @@ "version": "0.7.5", "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", - "dev": true, "requires": { "buffer": "^5.5.0", "class-is": "^1.1.0", "multibase": "~0.6.0", "multicodec": "^1.0.0", "multihashes": "~0.4.15" + }, + "dependencies": { + "multibase": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", + "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + } } } } @@ -937,7 +945,6 @@ "version": "2.0.9", "resolved": "https://registry.npmjs.org/@ipld/dag-json/-/dag-json-2.0.9.tgz", "integrity": "sha512-0SjSYa7ZloILvi7hoJvSxmbpamofsWMePmIn9cCw+EYYm+WSFxbpn1rfYOSlvkdbAutAXO7BBtUnhr3MYD/KPA==", - "dev": true, "requires": { "@ipld/codec-interface": "^1.0.8", "cids": "~0.7.3", @@ -950,13 +957,23 @@ "version": "0.7.5", "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", - "dev": true, "requires": { "buffer": "^5.5.0", "class-is": "^1.1.0", "multibase": "~0.6.0", "multicodec": "^1.0.0", "multihashes": "~0.4.15" + }, + "dependencies": { + "multibase": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", + "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + } } } } @@ -965,7 +982,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/@ipld/get-codec/-/get-codec-4.0.0.tgz", "integrity": "sha512-HXxM2BUP0ZVUvYlAINGUIZcrpynSmlVU335ENLXPLOrAZBk3gueIcGyCHqCCrJ1Lu8EhCVo14gAjCEZM6DFYVg==", - "dev": true, "requires": { "@ipld/codec-interface": "^1.0.5", "@ipld/dag-json": "^2.0.4", @@ -1073,6 +1089,16 @@ "google-protobuf": "^3.11.2" } }, + "@textile/context": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@textile/context/-/context-0.1.0.tgz", + "integrity": "sha512-ZfrAmp90V/lPpzDsl8Y0pbzkHrQJQGQAZwTTJe5sPiKDAHLlWKS4kKMtcRRjnbiMGc8PSqSZjrNg2yon3sJNOg==", + "requires": { + "@types/multibase": "^0.6.0", + "fast-sha256": "^1.3.0", + "multibase": "^0.7.0" + } + }, "@textile/hub-grpc": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@textile/hub-grpc/-/hub-grpc-1.0.2.tgz", @@ -1084,77 +1110,60 @@ } }, "@textile/multiaddr": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@textile/multiaddr/-/multiaddr-0.0.2.tgz", - "integrity": "sha512-sqv7EZqR3BUVwJY+/nnLnplfijdGIGP3WUNRrxVWGGFUipOyBPId5q5p1b5aeykWsol1K3R5Tm00IHmASgFe6g==", + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@textile/multiaddr/-/multiaddr-0.0.4.tgz", + "integrity": "sha512-44fwt8Y3hprD4HvcjQkCr4wmfUGJGx3oRnA+jrLOcgBqGoAuMWBBn2kdDTWEbpykJwlBSk8/KLrpl/pT0ZYc8Q==", "requires": { - "@textile/threads-id": "^0.0.2", + "@textile/threads-id": "^0.0.4", "@types/multibase": "^0.6.0", "bs58": "^4.0.1", + "cids": "^0.8.0", "multiaddr": "^7.4.2", "varint": "^5.0.0" - }, - "dependencies": { - "@textile/threads-id": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@textile/threads-id/-/threads-id-0.0.2.tgz", - "integrity": "sha512-FiV2bVzn9azJAy5Rztnhqbdq7862xbR3Tqbkzd0KUJ3oMOwq5g8vKR3NoX+G4Yuq2PztPMy6zD1W2mjX2BHSLg==", - "requires": { - "@consento/sync-randombytes": "^1.0.4", - "@types/node": "^13.9.2", - "multibase": "^0.6.0", - "varint": "^5.0.0" - } - } } }, "@textile/threads-client": { - "version": "0.3.0-rc.0", - "resolved": "https://registry.npmjs.org/@textile/threads-client/-/threads-client-0.3.0-rc.0.tgz", - "integrity": "sha512-NC8KHqdAUl5AwFSwoVtfAMpfpDakeIMGW6VYkDp9p67V1Pv1zOCOtMUJuO6wL6pAohBJ7KJGPBizLT0ydgkYYw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@textile/threads-client/-/threads-client-0.3.0.tgz", + "integrity": "sha512-fURlZzHtOsiyiYt+/BBd0PCxHUCSxJJam4FfkD5c8bSBLXrOnszmLpNItCLWpHL6XrJY7Bort5XV5sH8FR72/A==", "requires": { "@improbable-eng/grpc-web": "^0.12.0", - "@textile/multiaddr": "0.0.2", - "@textile/threads-client-grpc": "^0.1.14", - "@textile/threads-id": "0.0.1", + "@textile/context": "^0.1.0", + "@textile/multiaddr": "^0.0.4", + "@textile/threads-client-grpc": "^0.1.16", + "@textile/threads-core": "^0.1.6", + "@textile/threads-id": "^0.0.4", "@types/google-protobuf": "^3.7.2", "bs58": "^4.0.1", - "cids": "^0.7.3", + "cids": "^0.8.0", "google-protobuf": "^3.10.0", - "isomorphic-ws": "^4.0.1", - "next-tick": "^1.1.0", - "ws": "^7.2.3" + "next-tick": "^1.1.0" }, "dependencies": { - "@textile/threads-id": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@textile/threads-id/-/threads-id-0.0.1.tgz", - "integrity": "sha512-s3JpGNxJPz41+GCF7PlRmiD3WaSnDYxw806XFJqfZ/HYdjUfTki9AJYJ4p7zTzDjR7GjjNpueBJYfZ+k0LI3OA==", + "@textile/threads-core": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@textile/threads-core/-/threads-core-0.1.6.tgz", + "integrity": "sha512-a5tI8VKdGbZ4QYPb0zMYiDQ6Mfoj9IW0T5jsD2MweJRCdv+u+iaGRP5A3zTx13/m8lbbnHZgCRduAqMl5HZgNw==", "requires": { - "@consento/sync-randombytes": "^1.0.3", + "@ipld/block": "^4.0.0", + "@textile/multiaddr": "^0.0.4", + "@textile/threads-id": "^0.0.4", + "@types/multibase": "^0.6.0", "@types/node": "^13.9.2", - "multibase": "^0.6.0", + "bs58": "^4.0.1", + "libp2p-crypto": "^0.17.2", + "multiaddr": "^7.4.2", + "multibase": "^0.7.0", + "peer-id": "^0.13.11", "varint": "^5.0.0" } - }, - "cids": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", - "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", - "requires": { - "buffer": "^5.5.0", - "class-is": "^1.1.0", - "multibase": "~0.6.0", - "multicodec": "^1.0.0", - "multihashes": "~0.4.15" - } } } }, "@textile/threads-client-grpc": { - "version": "0.1.14", - "resolved": "https://registry.npmjs.org/@textile/threads-client-grpc/-/threads-client-grpc-0.1.14.tgz", - "integrity": "sha512-yvcn64B4jMf6YlLqIXrBn2Y1wO+EIo9ApElZG16FzhOk2jVKEj7W0PPrXpfG7q5oL/7yc40z5qCjDPIqb0GRLQ==", + "version": "0.1.17", + "resolved": "https://registry.npmjs.org/@textile/threads-client-grpc/-/threads-client-grpc-0.1.17.tgz", + "integrity": "sha512-3lbzIcW1wQeAAc8f6Babs5xbZCbiC/CBUv1YK01J0WXap3s2tw63vbxQn82bXjwUnZoctsc+5/d03Z+BT4vemQ==", "requires": { "@improbable-eng/grpc-web": "^0.12.0", "@types/google-protobuf": "^3.7.2", @@ -1162,14 +1171,14 @@ } }, "@textile/threads-core": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@textile/threads-core/-/threads-core-0.1.5.tgz", - "integrity": "sha512-zwq+R7ULHm5MO5gpmnsrL8LelU1tLBeBEV0sRYHNT0Fz5+kFMGuHCHrU99gXdwOUTKbaOvH9hhkh0PglCsXQBQ==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@textile/threads-core/-/threads-core-0.1.6.tgz", + "integrity": "sha512-a5tI8VKdGbZ4QYPb0zMYiDQ6Mfoj9IW0T5jsD2MweJRCdv+u+iaGRP5A3zTx13/m8lbbnHZgCRduAqMl5HZgNw==", "dev": true, "requires": { "@ipld/block": "^4.0.0", - "@textile/multiaddr": "^0.0.3", - "@textile/threads-id": "^0.0.3", + "@textile/multiaddr": "^0.0.4", + "@textile/threads-id": "^0.0.4", "@types/multibase": "^0.6.0", "@types/node": "^13.9.2", "bs58": "^4.0.1", @@ -1178,66 +1187,17 @@ "multibase": "^0.7.0", "peer-id": "^0.13.11", "varint": "^5.0.0" - }, - "dependencies": { - "@textile/multiaddr": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@textile/multiaddr/-/multiaddr-0.0.3.tgz", - "integrity": "sha512-naeaz74IbjtmmZpj5VImr+HQUQrU3YwJ0mH0c4kPbZuADPgxVzVFhQPVt6esc3TZwovPbNVUjJuwLbBCg7L5jw==", - "dev": true, - "requires": { - "@textile/threads-id": "^0.0.3", - "@types/multibase": "^0.6.0", - "bs58": "^4.0.1", - "cids": "^0.8.0", - "multiaddr": "^7.4.2", - "varint": "^5.0.0" - } - }, - "@textile/threads-id": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@textile/threads-id/-/threads-id-0.0.3.tgz", - "integrity": "sha512-TLi9ecmRd9t44HIWV/GTOVkmc4wXyxElWdSgzEai89PJFSp4XAeb29QWknepTiyv0+h+4YNXvoKQAWeWMgO0+g==", - "dev": true, - "requires": { - "@consento/sync-randombytes": "^1.0.4", - "@types/node": "^13.9.2", - "multibase": "^0.7.0", - "varint": "^5.0.0" - } - }, - "multibase": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", - "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", - "dev": true, - "requires": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - } } }, "@textile/threads-id": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@textile/threads-id/-/threads-id-0.0.3.tgz", - "integrity": "sha512-TLi9ecmRd9t44HIWV/GTOVkmc4wXyxElWdSgzEai89PJFSp4XAeb29QWknepTiyv0+h+4YNXvoKQAWeWMgO0+g==", + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@textile/threads-id/-/threads-id-0.0.4.tgz", + "integrity": "sha512-A0tpowxvJbE5vxwpEiD2aXUC/jLkq9c6BBsnm62jkx1kBhx8FVBo5PVbquHkw17ph2jIMl2zNv6yhhPZtKozyg==", "requires": { "@consento/sync-randombytes": "^1.0.4", "@types/node": "^13.9.2", "multibase": "^0.7.0", "varint": "^5.0.0" - }, - "dependencies": { - "multibase": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", - "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", - "requires": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - } } }, "@textile/users-grpc": { @@ -2173,7 +2133,6 @@ "version": "4.10.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, "requires": { "bn.js": "^4.0.0", "inherits": "^2.0.1", @@ -2419,8 +2378,7 @@ "bech32": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", - "dev": true + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" }, "big.js": { "version": "5.2.2", @@ -2431,8 +2389,7 @@ "bignumber.js": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", - "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==", - "dev": true + "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==" }, "binary-extensions": { "version": "1.13.1", @@ -2444,7 +2401,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, "requires": { "file-uri-to-path": "1.0.0" } @@ -2452,14 +2408,12 @@ "bip174": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/bip174/-/bip174-1.0.1.tgz", - "integrity": "sha512-Mq2aFs1TdMfxBpYPg7uzjhsiXbAtoVq44TNjEWtvuZBiBgc3m7+n55orYMtTAxdg7jWbL4DtH0MKocJER4xERQ==", - "dev": true + "integrity": "sha512-Mq2aFs1TdMfxBpYPg7uzjhsiXbAtoVq44TNjEWtvuZBiBgc3m7+n55orYMtTAxdg7jWbL4DtH0MKocJER4xERQ==" }, "bip32": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/bip32/-/bip32-2.0.5.tgz", "integrity": "sha512-zVY4VvJV+b2fS0/dcap/5XLlpqtgwyN8oRkuGgAS1uLOeEp0Yo6Tw2yUTozTtlrMJO3G8n4g/KX/XGFHW6Pq3g==", - "dev": true, "requires": { "@types/node": "10.12.18", "bs58check": "^2.1.1", @@ -2473,8 +2427,7 @@ "@types/node": { "version": "10.12.18", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", - "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", - "dev": true + "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==" } } }, @@ -2482,7 +2435,6 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", - "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -2490,14 +2442,12 @@ "bitcoin-ops": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/bitcoin-ops/-/bitcoin-ops-1.4.1.tgz", - "integrity": "sha512-pef6gxZFztEhaE9RY9HmWVmiIHqCb2OyS4HPKkpc6CIiiOa3Qmuoylxc5P2EkU3w+5eTSifI9SEZC88idAIGow==", - "dev": true + "integrity": "sha512-pef6gxZFztEhaE9RY9HmWVmiIHqCb2OyS4HPKkpc6CIiiOa3Qmuoylxc5P2EkU3w+5eTSifI9SEZC88idAIGow==" }, "bitcoinjs-lib": { "version": "5.1.7", "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-5.1.7.tgz", "integrity": "sha512-sNlTQuvhaoIjOdIdyENsX74Dlikv7l6AzO0/uZQscuvfBID6aMANoCz1rooCTH5upTV5rKCj4z3BXBmXJxq23g==", - "dev": true, "requires": { "bech32": "^1.1.2", "bip174": "^1.0.1", @@ -2543,8 +2493,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=" }, "bluebird": { "version": "3.7.2", @@ -2555,8 +2504,7 @@ "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", - "dev": true + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, "body-parser": { "version": "1.19.0", @@ -2611,7 +2559,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/borc/-/borc-2.1.2.tgz", "integrity": "sha512-Sy9eoUi4OiKzq7VovMn246iTo17kzuyHJKomCfpWMlI6RpfN1gk95w7d7gH264nApVLg0HZfcpz62/g4VH1Y4w==", - "dev": true, "requires": { "bignumber.js": "^9.0.0", "buffer": "^5.5.0", @@ -2626,7 +2573,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -2656,8 +2602,7 @@ "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, "browser-headers": { "version": "0.4.1", @@ -2680,7 +2625,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, "requires": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", @@ -2694,7 +2638,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, "requires": { "browserify-aes": "^1.0.4", "browserify-des": "^1.0.0", @@ -2705,7 +2648,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, "requires": { "cipher-base": "^1.0.1", "des.js": "^1.0.0", @@ -2717,7 +2659,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, "requires": { "bn.js": "^4.1.0", "randombytes": "^2.0.1" @@ -2727,7 +2668,6 @@ "version": "4.0.4", "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, "requires": { "bn.js": "^4.1.1", "browserify-rsa": "^4.0.0", @@ -2770,7 +2710,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", - "dev": true, "requires": { "bs58": "^4.0.0", "create-hash": "^1.1.0", @@ -2807,8 +2746,7 @@ "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, "builtin-status-codes": { "version": "3.0.0", @@ -3155,7 +3093,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -3290,8 +3227,7 @@ "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, "common-tags": { "version": "1.8.0", @@ -3496,7 +3432,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "dev": true, "requires": { "bn.js": "^4.1.0", "elliptic": "^6.0.0" @@ -3506,7 +3441,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, "requires": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -3519,7 +3453,6 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, "requires": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -3546,7 +3479,6 @@ "version": "3.12.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, "requires": { "browserify-cipher": "^1.0.0", "browserify-sign": "^4.0.0", @@ -3737,8 +3669,7 @@ "delimit-stream": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/delimit-stream/-/delimit-stream-0.1.0.tgz", - "integrity": "sha1-m4MZR3wOX4rrPONXrjBfwl6hzSs=", - "dev": true + "integrity": "sha1-m4MZR3wOX4rrPONXrjBfwl6hzSs=" }, "depd": { "version": "1.1.2", @@ -3750,7 +3681,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, "requires": { "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" @@ -3771,8 +3701,7 @@ "detect-node": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", - "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==", - "dev": true + "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==" }, "diff": { "version": "3.5.0", @@ -3784,7 +3713,6 @@ "version": "5.0.3", "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, "requires": { "bn.js": "^4.1.0", "miller-rabin": "^4.0.0", @@ -3864,7 +3792,6 @@ "version": "6.5.2", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", - "dev": true, "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -3928,8 +3855,7 @@ "err-code": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.0.tgz", - "integrity": "sha512-MsMOijQ4v0xlmrz1fc7lyPEy7jFhoNF7EVaRSP7mPzs20LaFOwG6qNjGRy3Ie85n9DARlcUnB1zbsBv5sJrIvw==", - "dev": true + "integrity": "sha512-MsMOijQ4v0xlmrz1fc7lyPEy7jFhoNF7EVaRSP7mPzs20LaFOwG6qNjGRy3Ie85n9DARlcUnB1zbsBv5sJrIvw==" }, "errno": { "version": "0.1.7", @@ -4718,7 +4644,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, "requires": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" @@ -5001,8 +4926,7 @@ "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "fast-levenshtein": { "version": "2.0.6", @@ -5071,8 +4995,7 @@ "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "fill-range": { "version": "7.0.1", @@ -6297,7 +6220,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -6307,7 +6229,6 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -6339,7 +6260,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -6716,8 +6636,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { "version": "1.3.5", @@ -6858,7 +6777,6 @@ "version": "0.3.1", "resolved": "https://registry.npmjs.org/ipld-bitcoin/-/ipld-bitcoin-0.3.1.tgz", "integrity": "sha512-0ysHoWyT+xXNyDafZrlH6YHGXWKkZ392eOardFTl2c9EUXDOt2W8VNaWol8ZyYSlD1nELwNLjC4e7p8aBY/OEg==", - "dev": true, "requires": { "bitcoinjs-lib": "^5.0.0", "cids": "~0.7.0", @@ -6871,13 +6789,23 @@ "version": "0.7.5", "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", - "dev": true, "requires": { "buffer": "^5.5.0", "class-is": "^1.1.0", "multibase": "~0.6.0", "multicodec": "^1.0.0", "multihashes": "~0.4.15" + }, + "dependencies": { + "multibase": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", + "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + } } } } @@ -6886,7 +6814,6 @@ "version": "0.15.2", "resolved": "https://registry.npmjs.org/ipld-dag-cbor/-/ipld-dag-cbor-0.15.2.tgz", "integrity": "sha512-Ioni4s959P/CtkWQOt1TXrj4zqc3MoPxvHrEmybCn5JFdG3dpBNJR1oBVvP6uUrmF5bBtUGKNbX1pSI5SEOaHg==", - "dev": true, "requires": { "borc": "^2.1.2", "buffer": "^5.5.0", @@ -6900,7 +6827,6 @@ "version": "0.18.5", "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.18.5.tgz", "integrity": "sha512-8IAPZrkRjgTpkxV9JOwXSBe0GXNxd4B2lubPgbifTGL92rZOEKWutpijsWsWvjXOltDFHKMQIIIhkgLC5RPqbA==", - "dev": true, "requires": { "buffer": "^5.6.0", "cids": "~0.8.0", @@ -6915,7 +6841,6 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/ipld-git/-/ipld-git-0.5.1.tgz", "integrity": "sha512-041Hq9hEjgzGue46lkPoBD6rEO+YCj04JFXVRGxd7AdacGrx3rV62uz/zUXfkncNZ/mjpovycZ+MC4skbO/43w==", - "dev": true, "requires": { "cids": "~0.7.0", "multicodec": "^1.0.0", @@ -6929,13 +6854,23 @@ "version": "0.7.5", "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", - "dev": true, "requires": { "buffer": "^5.5.0", "class-is": "^1.1.0", "multibase": "~0.6.0", "multicodec": "^1.0.0", "multihashes": "~0.4.15" + }, + "dependencies": { + "multibase": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", + "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + } } } } @@ -6944,7 +6879,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/ipld-zcash/-/ipld-zcash-0.4.1.tgz", "integrity": "sha512-1JNnY0HuLeJDzlRJSKxs8laZ+TKPr8zui7GNiJMHgMIjH7KOiVjAQfO7Rt7KzDucMLYPokarfIPaK3qeffwI2A==", - "dev": true, "requires": { "cids": "~0.7.1", "multicodec": "^1.0.0", @@ -6957,13 +6891,23 @@ "version": "0.7.5", "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", - "dev": true, "requires": { "buffer": "^5.5.0", "class-is": "^1.1.0", "multibase": "~0.6.0", "multicodec": "^1.0.0", "multihashes": "~0.4.15" + }, + "dependencies": { + "multibase": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", + "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + } } } } @@ -7036,8 +6980,7 @@ "is-circular": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-circular/-/is-circular-1.0.2.tgz", - "integrity": "sha512-YttjnrswnUYRVJvxCvu8z+PGMUSzC2JttP0OEXezlAEdp3EXzhf7IZ3j0gRAybJBQupedIZFhY61Tga6E0qASA==", - "dev": true + "integrity": "sha512-YttjnrswnUYRVJvxCvu8z+PGMUSzC2JttP0OEXezlAEdp3EXzhf7IZ3j0gRAybJBQupedIZFhY61Tga6E0qASA==" }, "is-data-descriptor": { "version": "0.1.4", @@ -7202,8 +7145,7 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, "is-windows": { "version": "1.0.2", @@ -7233,7 +7175,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/iso-random-stream/-/iso-random-stream-1.1.1.tgz", "integrity": "sha512-YEt/7xOwTdu4KXIgtdgGFkiLUsBaddbnkmHyaFdjJYIcD7V4gpQHPvYC5tyh3kA0PQ01y9lWm1ruVdf8Mqzovg==", - "dev": true, "requires": { "buffer": "^5.4.3", "readable-stream": "^3.4.0" @@ -7243,7 +7184,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -7255,8 +7195,7 @@ "iso-url": { "version": "0.4.7", "resolved": "https://registry.npmjs.org/iso-url/-/iso-url-0.4.7.tgz", - "integrity": "sha512-27fFRDnPAMnHGLq36bWTpKET+eiXct3ENlCcdcMdk+mjXrb2kw3mhBUg1B7ewAC0kVzlOPhADzQgz1SE6Tglog==", - "dev": true + "integrity": "sha512-27fFRDnPAMnHGLq36bWTpKET+eiXct3ENlCcdcMdk+mjXrb2kw3mhBUg1B7ewAC0kVzlOPhADzQgz1SE6Tglog==" }, "isobject": { "version": "3.0.1", @@ -7267,7 +7206,8 @@ "isomorphic-ws": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==" + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "dev": true }, "istanbul-lib-coverage": { "version": "3.0.0", @@ -7449,8 +7389,7 @@ "js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", - "dev": true + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" }, "js-tokens": { "version": "4.0.0", @@ -7494,7 +7433,6 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/json-text-sequence/-/json-text-sequence-0.1.1.tgz", "integrity": "sha1-py8hfcSvxGKf/1/rME3BvVGi89I=", - "dev": true, "requires": { "delimit-stream": "0.1.0" } @@ -7525,8 +7463,7 @@ "keypair": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/keypair/-/keypair-1.0.1.tgz", - "integrity": "sha1-dgNxknCvtlZO04oiCHoG/Jqk6hs=", - "dev": true + "integrity": "sha1-dgNxknCvtlZO04oiCHoG/Jqk6hs=" }, "killable": { "version": "1.0.1", @@ -7576,7 +7513,6 @@ "version": "0.17.6", "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.17.6.tgz", "integrity": "sha512-ixTSlXXObarf2x+8voGBywr2SyiZh4nw21ZRe1FVz4sxg47crXLqBXhb7gGy2U6Kf0ANbTVaOgLs45WAtM/HpQ==", - "dev": true, "requires": { "buffer": "^5.5.0", "err-code": "^2.0.0", @@ -7596,7 +7532,6 @@ "version": "0.7.0", "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", - "dev": true, "requires": { "base-x": "^3.0.8", "buffer": "^5.5.0" @@ -7605,8 +7540,7 @@ "node-forge": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.1.tgz", - "integrity": "sha512-G6RlQt5Sb4GMBzXvhfkeFmbqR6MzhtnT7VTHuLadjkii3rdYHNdw0m8zA4BTxVIh68FicCQ2NSUANpsqkr9jvQ==", - "dev": true + "integrity": "sha512-G6RlQt5Sb4GMBzXvhfkeFmbqR6MzhtnT7VTHuLadjkii3rdYHNdw0m8zA4BTxVIh68FicCQ2NSUANpsqkr9jvQ==" } } }, @@ -7686,8 +7620,7 @@ "lodash.transform": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.transform/-/lodash.transform-4.6.0.tgz", - "integrity": "sha1-EjBkIvYzJK7YSD0/ODMrX2cFR6A=", - "dev": true + "integrity": "sha1-EjBkIvYzJK7YSD0/ODMrX2cFR6A=" }, "lodash.unescape": { "version": "4.0.1", @@ -7869,7 +7802,6 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1", @@ -7920,8 +7852,7 @@ "merkle-lib": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/merkle-lib/-/merkle-lib-2.0.10.tgz", - "integrity": "sha1-grjbrnXieneFOItz+ddyXQ9vMyY=", - "dev": true + "integrity": "sha1-grjbrnXieneFOItz+ddyXQ9vMyY=" }, "methods": { "version": "1.1.2", @@ -7942,7 +7873,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, "requires": { "bn.js": "^4.0.0", "brorand": "^1.0.1" @@ -7978,14 +7908,12 @@ "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" }, "minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, "minimatch": { "version": "3.0.4", @@ -8208,23 +8136,12 @@ "is-ip": "^3.1.0", "multibase": "^0.7.0", "varint": "^5.0.0" - }, - "dependencies": { - "multibase": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", - "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", - "requires": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - } } }, "multibase": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", - "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", + "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", "requires": { "base-x": "^3.0.8", "buffer": "^5.5.0" @@ -8280,7 +8197,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/multihashing/-/multihashing-0.3.3.tgz", "integrity": "sha512-jXVWf5uqnZUhc1mLFPWOssuOpkj/A/vVLKrtEscD1PzSLobXYocBy9Gqa/Aw4229/heGnl0RBHU3cD53MbHUig==", - "dev": true, "requires": { "blakejs": "^1.1.0", "js-sha3": "~0.8.0", @@ -8292,7 +8208,6 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.8.1.tgz", "integrity": "sha512-qu3eIXHebc9a4OU4n/60BdZLFpX+/dGBs3DbzXCxX1aU0rFF19KQAiGl+sRL9wvKIJdeF2+w16RRJrpyTHpkkA==", - "dev": true, "requires": { "blakejs": "^1.1.0", "buffer": "^5.4.3", @@ -8305,8 +8220,7 @@ "murmurhash3js-revisited": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz", - "integrity": "sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g==", - "dev": true + "integrity": "sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g==" }, "mute-stream": { "version": "0.0.8", @@ -8317,8 +8231,7 @@ "nan": { "version": "2.14.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", - "dev": true + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" }, "nanomatch": { "version": "1.2.13", @@ -8371,8 +8284,7 @@ "node-addon-api": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.0.tgz", - "integrity": "sha512-ASCL5U13as7HhOExbT6OlWJJUV/lLzL2voOSP1UVehpRD8FbSrSDjfScK/KwAvVTI5AS6r4VwbOMlIqtvRidnA==", - "dev": true + "integrity": "sha512-ASCL5U13as7HhOExbT6OlWJJUV/lLzL2voOSP1UVehpRD8FbSrSDjfScK/KwAvVTI5AS6r4VwbOMlIqtvRidnA==" }, "node-environment-flags": { "version": "1.0.5", @@ -8393,8 +8305,7 @@ "node-gyp-build": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.2.tgz", - "integrity": "sha512-Lqh7mrByWCM8Cf9UPqpeoVBBo5Ugx+RKu885GAzmLBVYjeywScxHXPGLa4JfYNZmcNGwzR0Glu5/9GaQZMFqyA==", - "dev": true + "integrity": "sha512-Lqh7mrByWCM8Cf9UPqpeoVBBo5Ugx+RKu885GAzmLBVYjeywScxHXPGLa4JfYNZmcNGwzR0Glu5/9GaQZMFqyA==" }, "node-libs-browser": { "version": "2.2.1", @@ -8991,7 +8902,6 @@ "version": "5.1.5", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", - "dev": true, "requires": { "asn1.js": "^4.0.0", "browserify-aes": "^1.0.0", @@ -9093,7 +9003,6 @@ "version": "3.0.17", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "dev": true, "requires": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -9106,7 +9015,6 @@ "version": "0.13.12", "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.13.12.tgz", "integrity": "sha512-kiXu62BdJNeOzqpasMiauTFlDsQmevGWftHrMlUA68FMKWeMAtHFJTDGzaMXwPyH3l1MJM+SYb3APxNLGeZP6A==", - "dev": true, "requires": { "buffer": "^5.5.0", "cids": "^0.8.0", @@ -9121,7 +9029,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/pem-jwk/-/pem-jwk-2.0.0.tgz", "integrity": "sha512-rFxu7rVoHgQ5H9YsP50dDWf0rHjreVA2z0yPiWr5WdH/UHb29hKtF7h6l8vNd1cbYR1t0QL+JKhW55a2ZV4KtA==", - "dev": true, "requires": { "asn1.js": "^5.0.1" }, @@ -9130,7 +9037,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.3.0.tgz", "integrity": "sha512-WHnQJFcOrIWT1RLOkFFBQkFVvyt9BPOOrH+Dp152Zk4R993rSzXUGPmkybIcUFhHE2d/iHH+nCaOWVCDbO8fgA==", - "dev": true, "requires": { "bn.js": "^4.0.0", "inherits": "^2.0.1", @@ -9796,14 +9702,12 @@ "protocol-buffers-schema": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.4.0.tgz", - "integrity": "sha512-G/2kcamPF2S49W5yaMGdIpkG6+5wZF0fzBteLKgEHjbNzqjZQ85aAs1iJGto31EJaSTkNvHs5IXuHSaTLWBAiA==", - "dev": true + "integrity": "sha512-G/2kcamPF2S49W5yaMGdIpkG6+5wZF0fzBteLKgEHjbNzqjZQ85aAs1iJGto31EJaSTkNvHs5IXuHSaTLWBAiA==" }, "protons": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/protons/-/protons-1.2.0.tgz", "integrity": "sha512-V6wwlbbgZ6qtqd1zRSk7HqvwkoadmeNntUlqd1On9vHyC1tPI6H8GJotfup+9hG2FsDQK+MctaLrSouyunfxNg==", - "dev": true, "requires": { "buffer": "^5.5.0", "protocol-buffers-schema": "^3.3.1", @@ -9843,7 +9747,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, "requires": { "bn.js": "^4.1.0", "browserify-rsa": "^4.0.0", @@ -9940,7 +9843,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/pushdata-bitcoin/-/pushdata-bitcoin-1.0.1.tgz", "integrity": "sha1-FZMdPNlnreUiBvUjqnMxrvfUOvc=", - "dev": true, "requires": { "bitcoin-ops": "^1.3.0" } @@ -9982,7 +9884,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, "requires": { "safe-buffer": "^5.1.0" } @@ -9991,7 +9892,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, "requires": { "randombytes": "^2.0.5", "safe-buffer": "^5.1.0" @@ -10458,7 +10358,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -10520,8 +10419,7 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "schema-utils": { "version": "2.6.6", @@ -10545,7 +10443,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.1.tgz", "integrity": "sha512-iGRjbGAKfXMqhtdkkuNxsgJQfJO8Oo78Rm7DAvsG3XKngq+nJIOGqrCSXcQqIVsmCj0wFanE5uTKFxV3T9j2wg==", - "dev": true, "requires": { "elliptic": "^6.5.2", "node-addon-api": "^2.0.0", @@ -10742,7 +10639,6 @@ "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -10784,7 +10680,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" } @@ -10816,8 +10711,7 @@ "smart-buffer": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", - "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==", - "dev": true + "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==" }, "snapdragon": { "version": "0.8.2", @@ -11223,8 +11117,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==" }, "static-extend": { "version": "0.1.2", @@ -11295,8 +11188,7 @@ "strftime": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/strftime/-/strftime-0.10.0.tgz", - "integrity": "sha1-s/D6QZKVICpaKJ9ta+n0kJphcZM=", - "dev": true + "integrity": "sha1-s/D6QZKVICpaKJ9ta+n0kJphcZM=" }, "string-width": { "version": "4.2.0", @@ -11366,7 +11258,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, "requires": { "safe-buffer": "~5.1.0" }, @@ -11374,8 +11265,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==" } } }, @@ -11657,7 +11547,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.1.4.tgz", "integrity": "sha512-O7NfGzBdBy/jamehZ1ptutZsh2c+9pq2Pu+KPv75+yzk5/Q/6lppQGMUJucHdRGdkeBcAUeLAOdJInEAZgZ53A==", - "dev": true, "requires": { "bindings": "^1.3.0", "bn.js": "^4.11.8", @@ -11982,8 +11871,7 @@ "typeforce": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", - "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==", - "dev": true + "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, "typescript": { "version": "3.8.3", @@ -12165,7 +12053,6 @@ "version": "0.10.1", "resolved": "https://registry.npmjs.org/ursa-optional/-/ursa-optional-0.10.1.tgz", "integrity": "sha512-/pgpBXVJut57dHNrdGF+1/qXi+5B7JrlmZDWPSyoivEcbwFWRZJBJGkWb6ivknMBA3bnFA7lqsb6iHiFfp79QQ==", - "dev": true, "requires": { "bindings": "^1.5.0", "nan": "^2.14.0" @@ -12197,8 +12084,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "utils-merge": { "version": "1.0.1", @@ -12237,7 +12123,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz", "integrity": "sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==", - "dev": true, "requires": { "safe-buffer": "^5.1.1" } @@ -12337,7 +12222,6 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/webcrypto/-/webcrypto-0.1.1.tgz", "integrity": "sha512-BAvoatS38TbHdyt42ECLroi27NmDh5iea5l5rHC6nZTZjlbJlndrT0FoIiEq7fmPHpmNtP0lMFKVMEKZQFIrGA==", - "dev": true, "requires": { "crypto-browserify": "^3.10.0", "detect-node": "^2.0.3" @@ -13138,7 +13022,6 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/wif/-/wif-2.0.6.tgz", "integrity": "sha1-CNP1IFbGZnkplyb63g1DKudLRwQ=", - "dev": true, "requires": { "bs58check": "<3.0.0" } @@ -13228,9 +13111,10 @@ } }, "ws": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.5.tgz", - "integrity": "sha512-C34cIU4+DB2vMyAbmEKossWq2ZQDr6QEyuuCzWrM9zfw1sGc0mYiJ0UnG9zzNykt49C2Fi34hvr2vssFQRS6EA==" + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz", + "integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w==", + "dev": true }, "xtend": { "version": "4.0.2", @@ -13377,7 +13261,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/zcash-block/-/zcash-block-2.0.0.tgz", "integrity": "sha512-I6pv5b+eGE8CJFmltR+ILHnGcnBO8olV78VicQIaWulMhkomlwDmaMeMshJRLPcnd0FBs58QQVcVNBOT9ojH6Q==", - "dev": true, "requires": { "multihashing": "~0.3.3" } diff --git a/package.json b/package.json index e08444653..fa68c8cfc 100644 --- a/package.json +++ b/package.json @@ -58,9 +58,10 @@ "dependencies": { "@improbable-eng/grpc-web": "^0.12.0", "@textile/buckets-grpc": "1.0.2", + "@textile/context": "^0.1.0", "@textile/hub-grpc": "1.0.2", - "@textile/threads-client": "^0.3.0-rc.0", - "@textile/threads-id": "0.0.3", + "@textile/threads-client": "v0.3.0", + "@textile/threads-id": "0.0.4", "@textile/users-grpc": "1.0.2", "@types/google-protobuf": "^3.7.2", "axios": "^0.19.2", @@ -68,12 +69,11 @@ "delay": "^4.3.0", "fast-sha256": "^1.3.0", "google-protobuf": "^3.10.0", - "isomorphic-ws": "^4.0.1", "loglevel": "^1.6.8", "queueable": "^4.1.4" }, "devDependencies": { - "@textile/threads-core": "^0.1.5-rc.0", + "@textile/threads-core": "^0.1.6", "@types/browser-or-node": "^1.2.0", "@types/chai": "^4.2.5", "@types/mocha": "^7.0.1", @@ -87,6 +87,7 @@ "eslint-plugin-import": "^2.18.2", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.1.1", + "isomorphic-ws": "^4.0.1", "mocha": "^6.2.2", "nyc": "^15.0.0", "polendina": "^1.0.0", @@ -102,6 +103,7 @@ "typescript": "^3.7.2", "webpack": "^4.41.2", "webpack-cli": "^3.3.10", - "webpack-dev-server": "^3.9.0" + "webpack-dev-server": "^3.9.0", + "ws": "^7.3.0" } } diff --git a/src/buckets.spec.ts b/src/buckets.spec.ts index 092de1701..ea7fbb25c 100644 --- a/src/buckets.spec.ts +++ b/src/buckets.spec.ts @@ -8,7 +8,7 @@ import { ThreadID } from '@textile/threads-id' import { expect } from 'chai' import { Client } from '@textile/threads-client' import { InitReply } from '@textile/buckets-grpc/buckets_pb' -import { Context } from './context' +import { Context } from '@textile/context' import { Buckets } from './buckets' import { signUp } from './utils' @@ -28,7 +28,7 @@ describe('Buckets...', () => { ctx = ctx.withSession(user.user?.session).withThreadName('buckets') const id = ThreadID.fromRandom() const db = new Client(ctx) - await db.newDB(id.toBytes()) + await db.newDB(id) ctx = ctx.withThread(id) }) diff --git a/src/buckets.ts b/src/buckets.ts index a68901aa6..d61e2963a 100644 --- a/src/buckets.ts +++ b/src/buckets.ts @@ -4,7 +4,7 @@ import { API, APIPushPath } from '@textile/buckets-grpc/buckets_pb_service' import CID from 'cids' import { Channel } from 'queueable' import { grpc } from '@improbable-eng/grpc-web' -import { Context } from './context' +import { Context } from '@textile/context' import { normaliseInput, File } from './normalize' const logger = log.getLogger('buckets') diff --git a/src/context.ts b/src/context.ts deleted file mode 100644 index 26998304d..000000000 --- a/src/context.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { grpc } from '@improbable-eng/grpc-web' -import { ThreadID } from '@textile/threads-id' -import { Config } from '@textile/threads-client' - -type HostString = - | 'https://api.textile.io:3447' - | 'https://api.staging.textile.io:3447' - | 'http://127.0.0.1:3007' - | string -export const defaultHost: HostString = 'https://api.textile.io:3447' - -export interface ContextKeys { - /** - * Thread name. Specifies a mapping between human-readable name and a Thread ID. - */ - ['x-textile-thread-name']?: string - /** - * Thread ID as a string. Should be generated with `ThreadID.toString()` method. - */ - ['x-textile-thread']?: string - /** - * Session key. Used for various session contexts. - */ - ['x-textile-session']?: string - - /** - * Org slug/name. Used for various org session operations. - */ - ['x-textile-org']?: string - - /** - * API key. Used for user authentication. - */ - ['x-textile-api-key']?: string - - /** - * Authorization token for interacting with remote APIs, - */ - authorization?: string - - // @todo: Add docs here - ['x-textile-api-sig']?: string - ['x-textile-api-sig-msg']?: string - - /** - * The service host address/url. Defaults to https://hub.textile.io. - */ - host?: HostString - /** - * The transport to use for gRPC calls. Defaults to web-sockets. - */ - transport?: grpc.TransportFactory - - /** - * Whether to enable debugging output during gRPC calls. - */ - debug?: boolean -} - -/** - * Context provides immutable context management for gRPC credentials and config settings. - */ -export class Context implements Config { - // Internal context variables - private _context: Partial> = {} - - constructor( - // To comply with Config interface - host: HostString = defaultHost, - // To comply with Config interface - transport: grpc.TransportFactory = grpc.WebsocketTransport(), - // For testing and debugging purposes. - debug = false, - ) { - this._context['host'] = host - this._context['transport'] = transport - this._context['debug'] = debug - } - - get host() { - return this._context['host'] - } - - get transport() { - return this._context['transport'] - } - - get debug() { - return this._context['debug'] - } - - withSession(value?: string) { - if (value === undefined) return this - return Context.fromJSON({ ...this._context, ['x-textile-session']: value }) - } - - withThread(value?: ThreadID) { - if (value === undefined) return this - return Context.fromJSON({ ...this._context, ['x-textile-thread']: value.toString() }) - } - - withThreadName(value?: string) { - if (value === undefined) return this - return Context.fromJSON({ ...this._context, ['x-textile-thread-name']: value }) - } - - withOrg(value?: string) { - if (value === undefined) return this - return Context.fromJSON({ ...this._context, ['x-textile-org']: value }) - } - - withToken(value?: string) { - if (value === undefined) return this - return Context.fromJSON({ ...this._context, ['authorization']: `bearer ${value}` }) - } - - withAPIKey(value?: string) { - if (value === undefined) return this - return Context.fromJSON({ ...this._context, ['x-textile-api-key']: value }) - } - - withAPISig(value?: { sig: string; msg: string }) { - if (value === undefined) return this - const { sig, msg } = value - return Context.fromJSON({ ...this._context, ['x-textile-api-sig-msg']: msg, ['x-textile-api-sig']: sig }) - } - - withContext(value?: Context) { - if (value === undefined) return this - return Context.fromJSON({ ...this._context, ...value._context }) - } - - toJSON() { - return this._context - } - - toMetadata() { - return new grpc.Metadata(this.toJSON()) - } - - static fromJSON(json: ContextKeys) { - const ctx = new Context() - ctx._context = json - return ctx - } - - // @todo: Drop these in favor of toJSON() once other clients make the switch - _wrapMetadata(values?: Record) { - return { ...values, ...this.toJSON() } - } - - // @todo: Drop these in favor of toJSON() once other clients make the switch - _wrapBrowserHeaders(values: grpc.Metadata): grpc.Metadata { - return values - } -} diff --git a/src/index.ts b/src/index.ts index 7dadf5068..a371b7df0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,3 @@ export * from './buckets' -export * from './context' export * from './users' export { createAPISig } from './utils' diff --git a/src/users.spec.ts b/src/users.spec.ts index bc1ae4d47..841bcd22e 100644 --- a/src/users.spec.ts +++ b/src/users.spec.ts @@ -9,8 +9,8 @@ import { SignupReply } from '@textile/hub-grpc/hub_pb' import { expect } from 'chai' import { Client } from '@textile/threads-client' import { Libp2pCryptoIdentity } from '@textile/threads-core' +import { Context } from '@textile/context' import { isBrowser } from 'browser-or-node' -import { Context } from './context' import { Users } from './users' import { signUp, createKey, createAPISig } from './utils' import { Buckets } from './buckets' @@ -74,10 +74,9 @@ describe('Users...', () => { expect(err.code).to.equal(grpc.Code.NotFound) } // All good - ctx = ctx.withThreadName('foo') const id = ThreadID.fromRandom() const db = new Client(ctx) - await db.newDB(id.toBytes()) + await db.newDB(id, ctx.withThreadName('foo')) const res = await client.getThread('foo', ctx) expect(res.name).to.equal('foo') }) @@ -107,12 +106,8 @@ describe('Users...', () => { expect(err.code).to.equal(grpc.Code.NotFound) } // All good - ctx = ctx.withThreadName('foo') const id = ThreadID.fromRandom() - // Update existing db config directly as it doesn't yet directly support Context API on method calls - db.config = ctx - // @todo: In the near future, this should be `await db.newDB(id, ctx)` - await db.newDB(id.toBytes()) + await db.newDB(id, ctx.withThreadName('foo')) const res = await client.getThread('foo', ctx) expect(res.name).to.equal('foo') }) @@ -167,7 +162,7 @@ describe('Users...', () => { // Got one const id = ThreadID.fromRandom() const db = new Client(ctx) - await db.newDB(id.toBytes()) + await db.newDB(id) res = await client.listThreads(ctx) expect(res.listList).to.have.length(1) }) @@ -192,12 +187,8 @@ describe('Users...', () => { let res = await client.listThreads(ctx) expect(res.listList).to.have.length(0) // Got one - ctx = ctx.withThreadName('foo') const id = ThreadID.fromRandom() - // Update existing db config directly as it doesn't yet directly support Context API on method calls - db.config = ctx - // @todo: In the near future, this should be `await db.newDB(id, ctx)` - await db.newDB(id.toBytes()) + await db.newDB(id, ctx.withThreadName('foo')) res = await client.listThreads(ctx) expect(res.listList).to.have.length(1) expect(res.listList[0].name).to.equal('foo') @@ -221,11 +212,8 @@ describe('Users...', () => { }).timeout(3000) it('should then create a db for the bucket', async () => { const db = new Client(ctx) - ctx = ctx.withThreadName('my-buckets') const id = ThreadID.fromRandom() - db.config = ctx - await db.newDB(id.toBytes()) - ctx = ctx.withThread(id) + await db.newDB(id, ctx.withThreadName('my-buckets')) expect(ctx.toJSON()).to.have.ownProperty('x-textile-thread-name') }) it('should then initialize a new bucket in the db and push to it', async function () { @@ -270,11 +258,9 @@ describe('Users...', () => { ctx = ctx.withToken(tok) }) it('should then create a db for the bucket', async () => { - ctx = ctx.withThreadName('my-buckets') const id = ThreadID.fromRandom() const db = new Client(ctx) - await db.newDB(id.toBytes()) - ctx = ctx.withThread(id) + await db.newDB(id, ctx.withThreadName('my-buckets')) expect(ctx.toJSON()).to.have.ownProperty('x-textile-thread-name') }) it('should then initialize a new bucket in the db and push to it', async function () { diff --git a/src/users.ts b/src/users.ts index c7cedb6ed..a3d0e2f0e 100644 --- a/src/users.ts +++ b/src/users.ts @@ -2,7 +2,7 @@ import log from 'loglevel' import * as pb from '@textile/users-grpc/users_pb' import { APIClient } from '@textile/users-grpc/users_pb_service' import { ServiceError } from '@textile/hub-grpc/hub_pb_service' -import { Context } from './context' +import { Context } from '@textile/context' import { ThreadID } from '@textile/threads-id' const logger = log.getLogger('users') diff --git a/src/utils.ts b/src/utils.ts index 1db48af7c..55cb4e4d7 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -4,7 +4,7 @@ import { HMAC } from 'fast-sha256' import multibase from 'multibase' import * as pb from '@textile/hub-grpc/hub_pb' import { APIClient, ServiceError } from '@textile/hub-grpc/hub_pb_service' -import { Context } from './context' +import { Context } from '@textile/context' export const createUsername = (size = 12) => { return Array(size) From 2e84f05a31efdd24413710116a7be69929c973fa Mon Sep 17 00:00:00 2001 From: Carson Farmer Date: Tue, 12 May 2020 11:44:10 -0700 Subject: [PATCH 2/2] chore: cleanup context usage and fix unwanted mutations Signed-off-by: Carson Farmer --- src/buckets.spec.ts | 52 +++++++++++----------- src/users.spec.ts | 103 +++++++++++++++++++++----------------------- 2 files changed, 75 insertions(+), 80 deletions(-) diff --git a/src/buckets.spec.ts b/src/buckets.spec.ts index ea7fbb25c..c95b85196 100644 --- a/src/buckets.spec.ts +++ b/src/buckets.spec.ts @@ -19,25 +19,23 @@ const wrongError = new Error('wrong error!') const sessionSecret = 'textilesession' describe('Buckets...', () => { - let ctx: Context = new Context(addrApiurl, undefined) + const ctx: Context = new Context(addrApiurl, undefined) const client = new Buckets(ctx) let buck: InitReply.AsObject let fileSize: number before(async () => { const user = await signUp(ctx, addrGatewayUrl, sessionSecret) - ctx = ctx.withSession(user.user?.session).withThreadName('buckets') const id = ThreadID.fromRandom() - const db = new Client(ctx) - await db.newDB(id) - ctx = ctx.withThread(id) + const db = new Client(ctx.withSession(user.user?.session).withThreadName('buckets')) + await db.newDB(id, ctx.withThread(id)) }) it('should init a new bucket', async () => { // Check that we're empty - const list = await client.list(ctx) + const list = await client.list() expect(list).to.have.length(0) // Now initialize a bucket - buck = await client.init('mybuck', ctx) + buck = await client.init('mybuck') expect(buck).to.have.ownProperty('root') expect(buck.root).to.have.ownProperty('key') expect(buck.root).to.have.ownProperty('path') @@ -46,7 +44,7 @@ describe('Buckets...', () => { }) it('should list buckets', async () => { - const roots = await client.list(ctx) + const roots = await client.list() expect(roots).to.have.length(1) const root = roots[0] expect(root).to.have.ownProperty('key', buck.root?.key) @@ -57,7 +55,7 @@ describe('Buckets...', () => { it('should list empty bucket content at path', async () => { // Mostly empty - const res = await client.listPath(buck.root?.key || '', '', ctx) + const res = await client.listPath(buck.root?.key || '', '') expect(res).to.have.ownProperty('root') expect(res.root).to.not.be.undefined expect(res.item?.isdir).to.be.true @@ -74,7 +72,7 @@ describe('Buckets...', () => { let length = 0 // Bucket path - const res = await client.pushPath(rootKey, 'dir1/file1.jpg', stream, ctx, { + const res = await client.pushPath(rootKey, 'dir1/file1.jpg', stream, undefined, { progress: (num) => (length = num || 0), }) expect(length).to.equal(fileSize) @@ -83,11 +81,11 @@ describe('Buckets...', () => { // Nested bucket path stream = fs.createReadStream(path.join(pth, 'file2.jpg')) - const { root } = await client.pushPath(rootKey, 'path/to/file2.jpg', stream, ctx) + const { root } = await client.pushPath(rootKey, 'path/to/file2.jpg', stream) expect(root).to.not.be.undefined // Root dir - const rep = await client.listPath(rootKey, '', ctx) + const rep = await client.listPath(rootKey, '') expect(rep.item?.isdir).to.be.true expect(rep.item?.itemsList).to.have.length(2) }) @@ -105,7 +103,7 @@ describe('Buckets...', () => { let length = 0 // Bucket path - const res = await client.pushPath(rootKey, 'dir1/file1.jpg', file, ctx, { + const res = await client.pushPath(rootKey, 'dir1/file1.jpg', file, undefined, { progress: (num) => (length = num || 0), }) expect(length).to.equal(54) @@ -114,11 +112,11 @@ describe('Buckets...', () => { // Nested bucket path // @note: We're reusing file here... - const { root } = await client.pushPath(rootKey, 'path/to/file2.jpg', file, ctx) + const { root } = await client.pushPath(rootKey, 'path/to/file2.jpg', file) expect(root).to.not.be.undefined // Root dir - const rep = await client.listPath(rootKey, '', ctx) + const rep = await client.listPath(rootKey, '') expect(rep.item?.isdir).to.be.true expect(rep.item?.itemsList).to.have.length(2) }) @@ -127,12 +125,12 @@ describe('Buckets...', () => { const rootKey = buck.root?.key || '' // Nested dir - let rep = await client.listPath(rootKey, 'dir1', ctx) + let rep = await client.listPath(rootKey, 'dir1') expect(rep.item?.isdir).to.be.true expect(rep.item?.itemsList).to.have.length(1) // File - rep = await client.listPath(rootKey, 'dir1/file1.jpg', ctx) + rep = await client.listPath(rootKey, 'dir1/file1.jpg') expect(rep.item?.path.endsWith('file1.jpg')).to.be.true expect(rep.item?.isdir).to.be.false }) @@ -144,7 +142,7 @@ describe('Buckets...', () => { let length = 0 // Bucket path - const chunks = client.pullPath(rootKey, 'dir1/file1.jpg', ctx, { + const chunks = client.pullPath(rootKey, 'dir1/file1.jpg', undefined, { progress: (num) => (length = num || 0), }) const pth = path.join(__dirname, '..', 'testdata') @@ -162,33 +160,33 @@ describe('Buckets...', () => { it('should remove files by path', async () => { const rootKey = buck.root?.key || '' - await client.removePath(rootKey, 'path/to/file2.jpg', ctx) + await client.removePath(rootKey, 'path/to/file2.jpg') try { - await client.listPath(rootKey, 'path/to/file2.jpg', ctx) + await client.listPath(rootKey, 'path/to/file2.jpg') throw wrongError } catch (err) { expect(err).to.not.equal(wrongError) } - let list = await client.listPath(rootKey, '', ctx) + let list = await client.listPath(rootKey, '') expect(list.item?.itemsList).to.have.length(2) - await client.removePath(rootKey, 'path', ctx) + await client.removePath(rootKey, 'path') try { - await client.listPath(rootKey, 'path', ctx) + await client.listPath(rootKey, 'path') throw wrongError } catch (err) { expect(err).to.not.equal(wrongError) } - list = await client.listPath(rootKey, '', ctx) + list = await client.listPath(rootKey, '') expect(list.item?.itemsList).to.have.length(1) }) it('should remove an entire bucket', async () => { const rootKey = buck.root?.key || '' - const rep = await client.listPath(rootKey, 'dir1/file1.jpg', ctx) + const rep = await client.listPath(rootKey, 'dir1/file1.jpg') expect(rep).to.not.be.undefined - await client.remove(rootKey, ctx) + await client.remove(rootKey) try { - await client.listPath(rootKey, 'dir1/file1.jpg', ctx) + await client.listPath(rootKey, 'dir1/file1.jpg') throw wrongError } catch (err) { expect(err).to.not.equal(wrongError) diff --git a/src/users.spec.ts b/src/users.spec.ts index 841bcd22e..72cb54a95 100644 --- a/src/users.spec.ts +++ b/src/users.spec.ts @@ -23,7 +23,7 @@ const sessionSecret = 'textilesession' describe('Users...', () => { describe('getThread', () => { - let ctx: Context = new Context(addrApiurl, undefined) + const ctx: Context = new Context(addrApiurl, undefined) const client = new Users(ctx) let dev: SignupReply.AsObject before(async function () { @@ -41,10 +41,10 @@ describe('Users...', () => { expect(err.code).to.equal(grpc.Code.Unauthenticated) } // No key signature - const key = await createKey(ctx.withSession(dev.session), 'ACCOUNT') - ctx = ctx.withAPIKey(key.key) + const tmp = new Context(addrApiurl).withSession(dev.session) + const key = await createKey(tmp, 'ACCOUNT') try { - await client.getThread('foo', ctx) + await client.getThread('foo', ctx.withAPIKey(key.key)) throw wrongError } catch (err) { expect(err).to.not.equal(wrongError) @@ -52,9 +52,8 @@ describe('Users...', () => { } // Old key signature const sig = await createAPISig(key.secret, new Date(Date.now() - 1000 * 60)) - ctx = ctx.withAPISig(sig) try { - await client.getThread('foo', ctx) + await client.getThread('foo', ctx.withAPISig(sig)) throw wrongError } catch (err) { expect(err).to.not.equal(wrongError) @@ -63,11 +62,10 @@ describe('Users...', () => { }) it('should handle account keys', async () => { const key = await createKey(ctx.withSession(dev.session), 'ACCOUNT') - const sig = await createAPISig(key.secret) // Defaults to 1 minute from now - ctx = ctx.withAPIKey(key.key).withAPISig(sig) + await ctx.withAPIKey(key.key).withUserKey(key) // Not found try { - await client.getThread('foo', ctx) + await client.getThread('foo') throw wrongError } catch (err) { expect(err).to.not.equal(wrongError) @@ -77,17 +75,20 @@ describe('Users...', () => { const id = ThreadID.fromRandom() const db = new Client(ctx) await db.newDB(id, ctx.withThreadName('foo')) - const res = await client.getThread('foo', ctx) + const res = await client.getThread('foo') expect(res.name).to.equal('foo') }) it('should handle users keys', async () => { - const key = await createKey(ctx.withSession(dev.session), 'USER') - const sig = await createAPISig(key.secret) // Defaults to 1 minute from now - ctx = ctx.withAPIKey(key.key).withAPISig(sig) + // Reset client context (just for the tests) + const ctx = new Context(addrApiurl) + client.context = ctx + const tmp = new Context(addrApiurl).withSession(dev.session) + const key = await createKey(tmp, 'USER') + await ctx.withAPIKey(key.key).withUserKey(key) // No token try { - await client.getThread('foo', ctx) + await client.getThread('foo') throw wrongError } catch (err) { expect(err).to.not.equal(wrongError) @@ -96,10 +97,9 @@ describe('Users...', () => { // Not found const db = new Client(ctx) const identity = await Libp2pCryptoIdentity.fromRandom() - const tok = await db.getToken(identity) - ctx = ctx.withToken(tok) + await db.getToken(identity) try { - await client.getThread('foo', ctx) + await client.getThread('foo') throw wrongError } catch (err) { expect(err).to.not.equal(wrongError) @@ -108,13 +108,13 @@ describe('Users...', () => { // All good const id = ThreadID.fromRandom() await db.newDB(id, ctx.withThreadName('foo')) - const res = await client.getThread('foo', ctx) + const res = await client.getThread('foo') expect(res.name).to.equal('foo') }) }) describe('listThreads', () => { - let ctx: Context = new Context(addrApiurl, undefined) + const ctx: Context = new Context(addrApiurl, undefined) const client = new Users(ctx) let dev: SignupReply.AsObject before(async function () { @@ -125,17 +125,17 @@ describe('Users...', () => { it('should handle bad keys', async () => { // No key try { - await client.listThreads(ctx) + await client.listThreads() throw wrongError } catch (err) { expect(err).to.not.equal(wrongError) expect(err.code).to.equal(grpc.Code.Unauthenticated) } // No key signature - const key = await createKey(ctx.withSession(dev.session), 'ACCOUNT') - ctx = ctx.withAPIKey(key.key) + const tmp = new Context(addrApiurl).withSession(dev.session) + const key = await createKey(tmp, 'ACCOUNT') try { - await client.listThreads(ctx) + await client.listThreads(ctx.withAPIKey(key.key)) throw wrongError } catch (err) { expect(err).to.not.equal(wrongError) @@ -143,9 +143,8 @@ describe('Users...', () => { } // Old key signature const sig = await createAPISig(key.secret, new Date(Date.now() - 1000 * 60)) - ctx = ctx.withAPISig(sig) try { - await client.listThreads(ctx) + await client.listThreads(ctx.withAPISig(sig)) throw wrongError } catch (err) { expect(err).to.not.equal(wrongError) @@ -154,26 +153,28 @@ describe('Users...', () => { }) it('should handle account keys', async () => { const key = await createKey(ctx.withSession(dev.session), 'ACCOUNT') - const sig = await createAPISig(key.secret) // Defaults to 1 minute from now - ctx = ctx.withAPIKey(key.key).withAPISig(sig) + await ctx.withAPIKey(key.key).withUserKey(key) // Empty - let res = await client.listThreads(ctx) + let res = await client.listThreads() expect(res.listList).to.have.length(0) // Got one const id = ThreadID.fromRandom() const db = new Client(ctx) await db.newDB(id) - res = await client.listThreads(ctx) + res = await client.listThreads() expect(res.listList).to.have.length(1) }) it('should handle users keys', async () => { - const key = await createKey(ctx.withSession(dev.session), 'USER') - const sig = await createAPISig(key.secret) // Defaults to 1 minute from now - ctx = ctx.withAPIKey(key.key).withAPISig(sig) + // Reset client context (just for the tests) + const ctx = new Context(addrApiurl) + client.context = ctx + const tmp = new Context(addrApiurl).withSession(dev.session) + const key = await createKey(tmp, 'USER') + await ctx.withAPIKey(key.key).withUserKey(key) // No token try { - await client.listThreads(ctx) + await client.listThreads() throw wrongError } catch (err) { expect(err).to.not.equal(wrongError) @@ -182,14 +183,13 @@ describe('Users...', () => { // Empty const db = new Client(ctx) const identity = await Libp2pCryptoIdentity.fromRandom() - const tok = await db.getToken(identity) - ctx = ctx.withToken(tok) - let res = await client.listThreads(ctx) + await db.getToken(identity) + let res = await client.listThreads() expect(res.listList).to.have.length(0) // Got one const id = ThreadID.fromRandom() await db.newDB(id, ctx.withThreadName('foo')) - res = await client.listThreads(ctx) + res = await client.listThreads() expect(res.listList).to.have.length(1) expect(res.listList[0].name).to.equal('foo') }) @@ -197,17 +197,16 @@ describe('Users...', () => { describe('Buckets and accounts', () => { context('a developer', () => { - let ctx: Context = new Context(addrApiurl, undefined) + const ctx: Context = new Context(addrApiurl, undefined) let dev: SignupReply.AsObject it('should sign-up, create an API key, and sign it for the requests', async () => { // @note This should be done using the cli const { user } = await signUp(ctx, addrGatewayUrl, sessionSecret) if (user) dev = user - ctx = ctx.withSession(dev.session) // @note This should be done using the cli + ctx.withSession(dev.session) const key = await createKey(ctx, 'ACCOUNT') - const sig = await createAPISig(key.secret) // Defaults to 1 minute from now - ctx = ctx.withAPIKey(key.key).withAPISig(sig) + await ctx.withAPIKey(key.key).withUserKey(key) expect(ctx.toJSON()).to.have.ownProperty('x-textile-api-sig') }).timeout(3000) it('should then create a db for the bucket', async () => { @@ -220,42 +219,40 @@ describe('Users...', () => { if (isBrowser) return this.skip() // Initialize a new bucket in the db const buckets = new Buckets(ctx) - const buck = await buckets.init('mybuck', ctx) + const buck = await buckets.init('mybuck') expect(buck.root?.name).to.equal('mybuck') // Finally, push a file to the bucket. const pth = path.join(__dirname, '..', 'testdata') const stream = fs.createReadStream(path.join(pth, 'file1.jpg')) const rootKey = buck.root?.key || '' - const { root } = await buckets.pushPath(rootKey, 'dir1/file1.jpg', stream, ctx) + const { root } = await buckets.pushPath(rootKey, 'dir1/file1.jpg', stream) expect(root).to.not.be.undefined // We should have a thread named "my-buckets" const users = new Users(ctx) - const res = await users.getThread('my-buckets', ctx) + const res = await users.getThread('my-buckets') expect(res.id).to.deep.equal(ctx.toJSON()['x-textile-thread']) }) }) context('a developer with a user', () => { - let ctx: Context = new Context(addrApiurl, undefined) + const ctx: Context = new Context(addrApiurl, undefined) let dev: SignupReply.AsObject it('should sign-up, create an API key, and sign it for the requests', async () => { // @note This should be done using the cli const { user } = await signUp(ctx, addrGatewayUrl, sessionSecret) if (user) dev = user - ctx = ctx.withSession(dev.session) + ctx.withSession(dev.session) // @note This should be done using the cli // This time they create a user key const key = await createKey(ctx, 'USER') - const sig = await createAPISig(key.secret) // Defaults to 1 minute from now - ctx = ctx.withAPIKey(key.key).withAPISig(sig) + await ctx.withAPIKey(key.key).withUserKey(key) expect(ctx.toJSON()).to.have.ownProperty('x-textile-api-sig') }).timeout(3000) it('should then generate a user identity and get a token for it', async () => { const identity = await Libp2pCryptoIdentity.fromRandom() const db = new Client(ctx) - const tok = await db.getToken(identity) - ctx = ctx.withToken(tok) + await db.getToken(identity) }) it('should then create a db for the bucket', async () => { const id = ThreadID.fromRandom() @@ -267,19 +264,19 @@ describe('Users...', () => { if (isBrowser) return this.skip() // Initialize a new bucket in the db const buckets = new Buckets(ctx) - const buck = await buckets.init('mybuck', ctx) + const buck = await buckets.init('mybuck') expect(buck.root?.name).to.equal('mybuck') // Finally, push a file to the bucket. const pth = path.join(__dirname, '..', 'testdata') const stream = fs.createReadStream(path.join(pth, 'file1.jpg')) const rootKey = buck.root?.key || '' - const { root } = await buckets.pushPath(rootKey, 'dir1/file1.jpg', stream, ctx) + const { root } = await buckets.pushPath(rootKey, 'dir1/file1.jpg', stream) expect(root).to.not.be.undefined // We should have a thread named "my-buckets" const users = new Users(ctx) - const res = await users.getThread('my-buckets', ctx) + const res = await users.getThread('my-buckets') expect(res.id).to.deep.equal(ctx.toJSON()['x-textile-thread']) // The dev should see that the key was used to create one thread