From ddc9acf7065ec92e31364e11cca559dc5495702c Mon Sep 17 00:00:00 2001 From: Phyrex Tsai Date: Wed, 5 Dec 2018 17:32:33 +0800 Subject: [PATCH 1/2] Fix subdomain bug --- package-lock.json | 421 +++++++++--------- package.json | 2 +- .../SearchBar/Subdomain/Subdomain.js | 11 +- src/lib/ipfsService.js | 4 +- src/test/ipfsService.test.js | 2 +- src/test/upload.js | 4 +- 6 files changed, 210 insertions(+), 234 deletions(-) diff --git a/package-lock.json b/package-lock.json index e384fbc..9d8a639 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8947,72 +8947,226 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" }, - "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==", + "ipfs-http-client": { + "version": "27.0.0", + "resolved": "https://registry.npmjs.org/ipfs-http-client/-/ipfs-http-client-27.0.0.tgz", + "integrity": "sha512-nI12XVXeMm4LU48usmwEgOiw2+byFXppju/U3TFG8u51W5bBP3FslY08t7lKqexPbSFz1+rhYLswJkxV9aQixg==", "requires": { "async": "^2.6.1", - "big.js": "^5.1.2", - "bl": "^2.0.1", + "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.15.0", + "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", + "multiaddr": "^5.0.2", + "multibase": "~0.6.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", + "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": { "big.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.1.tgz", - "integrity": "sha512-k8S+ioyE06BcIcS29R3M7YbbmmcGh0DWfMY6JnZ3n4hhEv/lIRS2qRPCqUoHiGIXlrrRBKJtTbw8Fwp92bGOZA==", - "requires": { - "opencollective": "^1.0.3" - } + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==" }, "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", + "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", "requires": { "ms": "^2.1.1" } }, + "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==", + "requires": { + "cids": "~0.5.5", + "class-is": "^1.1.0" + } + }, + "ipfs-unixfs": { + "version": "0.1.16", + "resolved": "https://registry.npmjs.org/ipfs-unixfs/-/ipfs-unixfs-0.1.16.tgz", + "integrity": "sha512-TX9Dyu77MxpLzGh/LcQne95TofOyvOeW0oOi72aBMMcV1ItP3684e6NTG9KY1qzdrC+ZUR8kT7y18J058n8KXg==", + "requires": { + "protons": "^1.0.1" + } + }, + "ipld-dag-cbor": { + "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==", + "requires": { + "async": "^2.6.1", + "borc": "^2.0.3", + "bs58": "^4.0.1", + "cids": "~0.5.5", + "is-circular": "^1.0.2", + "multihashes": "~0.4.14", + "multihashing-async": "~0.5.1", + "traverse": "~0.6.6" + } + }, + "ipld-dag-pb": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.15.0.tgz", + "integrity": "sha512-rX8kHhiM7975LO6XgSze91TSAEVEpHLsFaLQoR1FLgKoDTwejudRdQJx6DnZmzTT+agpSvi79UYdWTI5ZP+B1w==", + "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" + } + }, + "js-sha3": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.7.0.tgz", + "integrity": "sha512-Wpks3yBDm0UcL5qlVhwW9Jr9n9i4FfeWBFOOXP5puDS/SiudJGhw7DPyBqn3487qD4F0lsC0q3zxink37f7zeA==" + }, + "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==", + "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==" }, + "multiaddr": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-5.0.2.tgz", + "integrity": "sha512-dXz1chaUHV6L6okujDLS7uRA6NmCbitpikOJA0vMMnrwVyai5kC3ot2CSLrSfj3B8XIgNzpe/j5auSYrnbGGzA==", + "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" + } + }, + "multibase": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.0.tgz", + "integrity": "sha512-R9bNLQhbD7MsitPm1NeY7w9sDgu6d7cuj25snAWH7k5PSNPSwIQQBpcpj8jx1W96dLbdigZqmUWOdQRMnAmgjA==", + "requires": { + "base-x": "3.0.4" + } + }, + "peer-id": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.12.0.tgz", + "integrity": "sha512-pPKk4IDBWGGzcjXe6zzngIwKmyadYNsIOUH1PKb7GYTVVTKHpHn78ljZNZdAXAWZ2V1TmlU2OS6d9MfW2E5DNA==", + "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==", + "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==", + "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" + } + } + } + }, + "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==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "stream-http": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.0.0.tgz", @@ -9022,71 +9176,14 @@ "inherits": "^2.0.1", "readable-stream": "^3.0.6", "xtend": "^4.0.0" - }, - "dependencies": { - "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==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } } + }, + "webcrypto-shim": { + "version": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8", + "from": "github:dignifiedquire/webcrypto-shim#master" } } }, - "ipfs-block": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ipfs-block/-/ipfs-block-0.7.1.tgz", - "integrity": "sha512-ABZS9J/+OaDwc10zu6pIVdxWnOD/rkPEravk7FRVuRep7/zKSjffNhO/WuHN7Ex+MOBMz7mty0e+i6xjGnRsRQ==", - "requires": { - "cids": "^0.5.3", - "class-is": "^1.1.0" - } - }, - "ipfs-unixfs": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ipfs-unixfs/-/ipfs-unixfs-0.1.15.tgz", - "integrity": "sha512-fjtwBDsIlNags4btHIdAJtE02K4KqEMOhV9GEFVv1M2JO2STS23v2LAtX5qb1EOU5VrjtKlm/JIBH3XDRdAyGQ==", - "requires": { - "protons": "^1.0.0" - } - }, - "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==", - "requires": { - "async": "^2.6.0", - "borc": "^2.0.2", - "bs58": "^4.0.1", - "cids": "~0.5.2", - "is-circular": "^1.0.1", - "multihashes": "~0.4.12", - "multihashing-async": "~0.5.1", - "traverse": "~0.6.6" - } - }, - "ipld-dag-pb": { - "version": "0.14.10", - "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.14.10.tgz", - "integrity": "sha512-wtdZzLN21fg8JPYzu2gM4bNUDX65G9exXqsMAwnkeJUIeeA8Ot2BxB0ZY0wo5N26IudXNJnb4rAJKmZlsOykuw==", - "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" - } - }, "is-absolute-url": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", @@ -10853,50 +10950,6 @@ "type-check": "~0.3.2" } }, - "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==", - "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": { - "js-sha3": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.7.0.tgz", - "integrity": "sha512-Wpks3yBDm0UcL5qlVhwW9Jr9n9i4FfeWBFOOXP5puDS/SiudJGhw7DPyBqn3487qD4F0lsC0q3zxink37f7zeA==" - }, - "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==", - "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" - } - }, - "webcrypto-shim": { - "version": "github:dignifiedquire/webcrypto-shim#190bc9ec341375df6025b17ae12ddb2428ea49c8", - "from": "github:dignifiedquire/webcrypto-shim#master" - } - } - }, "libp2p-crypto-secp256k1": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/libp2p-crypto-secp256k1/-/libp2p-crypto-secp256k1-0.2.2.tgz", @@ -12822,75 +12875,6 @@ "mimic-fn": "^1.0.0" } }, - "opencollective": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/opencollective/-/opencollective-1.0.3.tgz", - "integrity": "sha1-ruY3K8KBRFg2kMPKja7PwSDdDvE=", - "requires": { - "babel-polyfill": "6.23.0", - "chalk": "1.1.3", - "inquirer": "3.0.6", - "minimist": "1.2.0", - "node-fetch": "1.6.3", - "opn": "4.0.2" - }, - "dependencies": { - "ansi-escapes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=" - }, - "babel-polyfill": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz", - "integrity": "sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=", - "requires": { - "babel-runtime": "^6.22.0", - "core-js": "^2.4.0", - "regenerator-runtime": "^0.10.0" - } - }, - "inquirer": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.0.6.tgz", - "integrity": "sha1-4EqqnQW3o8ubD0B9BDdfBEcZA0c=", - "requires": { - "ansi-escapes": "^1.1.0", - "chalk": "^1.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^2.0.1", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rx": "^4.1.0", - "string-width": "^2.0.0", - "strip-ansi": "^3.0.0", - "through": "^2.3.6" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, - "regenerator-runtime": { - "version": "0.10.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" - } - } - }, - "opn": { - "version": "4.0.2", - "resolved": "http://registry.npmjs.org/opn/-/opn-4.0.2.tgz", - "integrity": "sha1-erwi5kTf9jsKltWrfyeQwPAavJU=", - "requires": { - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" - } - }, "optimist": { "version": "0.3.7", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", @@ -13283,17 +13267,6 @@ "sha.js": "^2.4.8" } }, - "peer-id": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.11.0.tgz", - "integrity": "sha512-C/lRJk4CWIgOdKvfO572NvHbPcUwe49I6G0toIhDB5tCohqv/qzy0uBcAK9Ww8TvYI6U4J3C8ACShV9fWjNU4w==", - "requires": { - "async": "^2.6.1", - "libp2p-crypto": "~0.13.0", - "lodash": "^4.17.10", - "multihashes": "~0.4.13" - } - }, "peer-info": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/peer-info/-/peer-info-0.14.1.tgz", @@ -19973,11 +19946,6 @@ "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" }, - "rx": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz", - "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=" - }, "rx-lite": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", @@ -22680,6 +22648,15 @@ "prepend-http": "^1.0.1" } }, + "ursa-optional": { + "version": "0.9.10", + "resolved": "https://registry.npmjs.org/ursa-optional/-/ursa-optional-0.9.10.tgz", + "integrity": "sha512-RvEbhnxlggX4MXon7KQulTFiJQtLJZpSb9ZSa7ZTkOW0AzqiVTaLjI4vxaSzJBDH9dwZ3ltZadFiBaZslp6haA==", + "requires": { + "bindings": "^1.3.0", + "nan": "^2.11.1" + } + }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", diff --git a/package.json b/package.json index 57e33f8..ea27302 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "file-loader": "1.1.5", "fs-extra": "3.0.1", "html-webpack-plugin": "2.29.0", - "ipfs-api": "^25.0.0", + "ipfs-http-client": "^27.0.0", "material-ui": "^1.0.0-beta.6", "material-ui-icons": "^1.0.0-beta.5", "moment": "^2.22.2", diff --git a/src/components/SearchBar/Subdomain/Subdomain.js b/src/components/SearchBar/Subdomain/Subdomain.js index c03896e..f47b3ad 100644 --- a/src/components/SearchBar/Subdomain/Subdomain.js +++ b/src/components/SearchBar/Subdomain/Subdomain.js @@ -125,19 +125,18 @@ class Subdomain extends Component { let labelsArr = labels == null ? [] : labels; let labelHash = []; let BidLength = labelsArr.length; - // let idx = 0; if(BidLength!=0){ labelsArr.forEach(async hash => { let dL = await decryptLabel([hash]); - // idx ++; - labelHash.push(dL.data[0]); - let result = [...(new Set(labelHash))]; - this.subdomainCombination(result); + if (dL && dL.data && dL.data.length > 0) { + labelHash.push(dL.data[0]); + let result = [...(new Set(labelHash))]; + this.subdomainCombination(result); + } }); }else{ this.setState({"isItemShow": true}); } - } subdomainCombination = (result) =>{ diff --git a/src/lib/ipfsService.js b/src/lib/ipfsService.js index c56fd5a..af72c3c 100644 --- a/src/lib/ipfsService.js +++ b/src/lib/ipfsService.js @@ -1,6 +1,6 @@ -import ipfsAPI from 'ipfs-api'; +import ipfsClient from 'ipfs-http-client'; -const ipfs = ipfsAPI({host: 'ipfs.infura.io', port: '5001', protocol: 'https'}); +const ipfs = ipfsClient({host: 'ipfs.infura.io', port: '5001', protocol: 'https'}); export const add = async (files) => { try { diff --git a/src/test/ipfsService.test.js b/src/test/ipfsService.test.js index 8e39297..db04868 100644 --- a/src/test/ipfsService.test.js +++ b/src/test/ipfsService.test.js @@ -1,4 +1,4 @@ -//const ipfsAPI = require('ipfs-api'); +//const ipfsAPI = require('ipfs-http-client'); it('ipfs', () => { //const ipfs = ipfsAPI({host: 'ipfs.infura.io', port: '5001', protocol: 'https'}); diff --git a/src/test/upload.js b/src/test/upload.js index 0a99080..8255310 100644 --- a/src/test/upload.js +++ b/src/test/upload.js @@ -1,7 +1,7 @@ -var ipfsAPI = require('ipfs-api'); +var ipfsClient = require('ipfs-http-client'); var fs = require('fs'); -const ipfs = ipfsAPI({host: 'ipfs.infura.io', port: '5001', protocol: 'https'}); +const ipfs = ipfsClient({host: 'ipfs.infura.io', port: '5001', protocol: 'https'}); const content = fs.readFileSync(__dirname + "/icon-iot.png"); console.log(content); From af2d905d49e26334c4feda5f28706075501db471 Mon Sep 17 00:00:00 2001 From: Phyrex Tsai Date: Wed, 5 Dec 2018 17:35:17 +0800 Subject: [PATCH 2/2] npm patch --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9d8a639..24bfe50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ens-manager", - "version": "0.1.6", + "version": "0.1.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ea27302..91cec35 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ens-manager", - "version": "0.1.6", + "version": "0.1.9", "author": "PhyrexTsai", "engines": { "node": "8.x.x",