diff --git a/.babelrc b/.babelrc deleted file mode 100644 index b04a804..0000000 --- a/.babelrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "presets": [ - [ - "@babel/env", - { - "targets": { - "node": "10" - }, - "debug": false, - "useBuiltIns": "usage", - "corejs": 3, - "shippedProposals": true - } - ], - "@babel/preset-typescript" - ], - "plugins": [ - ] -} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..3063f07 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +lib +node_modules diff --git a/.eslintrc.js b/.eslintrc.js index 4904913..2b293a4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,7 +11,7 @@ module.exports = { 'plugin:@typescript-eslint/recommended', ], parserOptions: { - project: ['./tsconfig.json', './tsconfig.eslint.json'] + project: ['./tsconfig.eslint.json'] }, rules: { 'semi': 'off', diff --git a/.npmignore b/.npmignore index 950f48c..dbe5651 100644 --- a/.npmignore +++ b/.npmignore @@ -4,6 +4,7 @@ .nvmrc .github/ .eslintrc.js +.eslintignore tsconfig.* .idea diff --git a/.travis.yml b/.travis.yml index 31c56d4..8d17119 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,6 @@ before_script: - npm run test - npm run lint script: - - npm run build + - npm run compile after_success: - npm run semantic-release \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7f082b0..f2549d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,60 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@babel/cli": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.12.1.tgz", - "integrity": "sha512-eRJREyrfAJ2r42Iaxe8h3v6yyj1wu9OyosaUHW6UImjGf9ahGL9nsFNh7OCopvtcPL8WnEo7tp78wrZaZ6vG9g==", - "dev": true, - "requires": { - "@nicolo-ribaudo/chokidar-2": "^2.1.8", - "chokidar": "^3.4.0", - "commander": "^4.0.1", - "convert-source-map": "^1.1.0", - "fs-readdir-recursive": "^1.1.0", - "glob": "^7.0.0", - "lodash": "^4.17.19", - "make-dir": "^2.1.0", - "slash": "^2.0.0", - "source-map": "^0.5.0" - }, - "dependencies": { - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - } - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, "@babel/code-frame": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", @@ -67,12 +13,6 @@ "@babel/highlight": "^7.10.4" } }, - "@babel/compat-data": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.5.tgz", - "integrity": "sha512-DTsS7cxrsH3by8nqQSpFSyjSfSYl57D6Cf4q8dW3LK83tBKBDCkfcay1nYkXq1nIHXnpX8WMMb/O25HOy3h1zg==", - "dev": true - }, "@babel/core": { "version": "7.12.3", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz", @@ -139,89 +79,6 @@ } } }, - "@babel/helper-annotate-as-pure": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz", - "integrity": "sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA==", - "dev": true, - "requires": { - "@babel/types": "^7.10.4" - } - }, - "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz", - "integrity": "sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg==", - "dev": true, - "requires": { - "@babel/helper-explode-assignable-expression": "^7.10.4", - "@babel/types": "^7.10.4" - } - }, - "@babel/helper-compilation-targets": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz", - "integrity": "sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.12.5", - "@babel/helper-validator-option": "^7.12.1", - "browserslist": "^4.14.5", - "semver": "^5.5.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "@babel/helper-create-class-features-plugin": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz", - "integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-member-expression-to-functions": "^7.12.1", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.10.4" - } - }, - "@babel/helper-create-regexp-features-plugin": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.1.tgz", - "integrity": "sha512-rsZ4LGvFTZnzdNZR5HZdmJVuXK8834R5QkF3WvcnBhrlVtF0HSIUC6zbreL9MgjTywhKokn8RIYRiq99+DLAxA==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.10.4", - "@babel/helper-regex": "^7.10.4", - "regexpu-core": "^4.7.1" - } - }, - "@babel/helper-define-map": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz", - "integrity": "sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.10.4", - "@babel/types": "^7.10.5", - "lodash": "^4.17.19" - } - }, - "@babel/helper-explode-assignable-expression": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.12.1.tgz", - "integrity": "sha512-dmUwH8XmlrUpVqgtZ737tK88v07l840z9j3OEhCLwKTkjlvKpfqXVIZ0wpK3aeOxspwGrf/5AP5qLx4rO3w5rA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.1" - } - }, "@babel/helper-function-name": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", @@ -242,15 +99,6 @@ "@babel/types": "^7.10.4" } }, - "@babel/helper-hoist-variables": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz", - "integrity": "sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA==", - "dev": true, - "requires": { - "@babel/types": "^7.10.4" - } - }, "@babel/helper-member-expression-to-functions": { "version": "7.12.1", "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz", @@ -301,26 +149,6 @@ "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", "dev": true }, - "@babel/helper-regex": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.5.tgz", - "integrity": "sha512-68kdUAzDrljqBrio7DYAEgCoJHxppJOERHOgOrDN7WjOzP0ZQ1LsSDRXcemzVZaLvjaJsJEESb6qt+znNuENDg==", - "dev": true, - "requires": { - "lodash": "^4.17.19" - } - }, - "@babel/helper-remap-async-to-generator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.12.1.tgz", - "integrity": "sha512-9d0KQCRM8clMPcDwo8SevNs+/9a8yWVVmaE80FGJcEP8N1qToREmWEGnBn8BUlJhYRFz6fqxeRL1sl5Ogsed7A==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.10.4", - "@babel/helper-wrap-function": "^7.10.4", - "@babel/types": "^7.12.1" - } - }, "@babel/helper-replace-supers": { "version": "7.12.5", "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz", @@ -342,15 +170,6 @@ "@babel/types": "^7.12.1" } }, - "@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz", - "integrity": "sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.1" - } - }, "@babel/helper-split-export-declaration": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", @@ -366,24 +185,6 @@ "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", "dev": true }, - "@babel/helper-validator-option": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.1.tgz", - "integrity": "sha512-YpJabsXlJVWP0USHjnC/AQDTLlZERbON577YUVO/wLpqyj6HAtVYnWaQaN0iUN+1/tWn3c+uKKXjRut5115Y2A==", - "dev": true - }, - "@babel/helper-wrap-function": { - "version": "7.12.3", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.12.3.tgz", - "integrity": "sha512-Cvb8IuJDln3rs6tzjW3Y8UeelAOdnpB8xtQ4sme2MSZ9wOxrbThporC0y/EtE16VAtoyEfLM404Xr1e0OOp+ow==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" - } - }, "@babel/helpers": { "version": "7.12.5", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", @@ -425,139 +226,6 @@ "integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ==", "dev": true }, - "@babel/plugin-proposal-async-generator-functions": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.12.1.tgz", - "integrity": "sha512-d+/o30tJxFxrA1lhzJqiUcEJdI6jKlNregCv5bASeGf2Q4MXmnwH7viDo7nhx1/ohf09oaH8j1GVYG/e3Yqk6A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-remap-async-to-generator": "^7.12.1", - "@babel/plugin-syntax-async-generators": "^7.8.0" - } - }, - "@babel/plugin-proposal-class-properties": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.12.1.tgz", - "integrity": "sha512-cKp3dlQsFsEs5CWKnN7BnSHOd0EOW8EKpEjkoz1pO2E5KzIDNV9Ros1b0CnmbVgAGXJubOYVBOGCT1OmJwOI7w==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-proposal-dynamic-import": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.12.1.tgz", - "integrity": "sha512-a4rhUSZFuq5W8/OO8H7BL5zspjnc1FLd9hlOxIK/f7qG4a0qsqk8uvF/ywgBA8/OmjsapjpvaEOYItfGG1qIvQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-dynamic-import": "^7.8.0" - } - }, - "@babel/plugin-proposal-export-namespace-from": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.1.tgz", - "integrity": "sha512-6CThGf0irEkzujYS5LQcjBx8j/4aQGiVv7J9+2f7pGfxqyKh3WnmVJYW3hdrQjyksErMGBPQrCnHfOtna+WLbw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - } - }, - "@babel/plugin-proposal-json-strings": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.12.1.tgz", - "integrity": "sha512-GoLDUi6U9ZLzlSda2Df++VSqDJg3CG+dR0+iWsv6XRw1rEq+zwt4DirM9yrxW6XWaTpmai1cWJLMfM8qQJf+yw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-json-strings": "^7.8.0" - } - }, - "@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.12.1.tgz", - "integrity": "sha512-k8ZmVv0JU+4gcUGeCDZOGd0lCIamU/sMtIiX3UWnUc5yzgq6YUGyEolNYD+MLYKfSzgECPcqetVcJP9Afe/aCA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" - } - }, - "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.12.1.tgz", - "integrity": "sha512-nZY0ESiaQDI1y96+jk6VxMOaL4LPo/QDHBqL+SF3/vl6dHkTwHlOI8L4ZwuRBHgakRBw5zsVylel7QPbbGuYgg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" - } - }, - "@babel/plugin-proposal-numeric-separator": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.5.tgz", - "integrity": "sha512-UiAnkKuOrCyjZ3sYNHlRlfuZJbBHknMQ9VMwVeX97Ofwx7RpD6gS2HfqTCh8KNUQgcOm8IKt103oR4KIjh7Q8g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - } - }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz", - "integrity": "sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-transform-parameters": "^7.12.1" - } - }, - "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.12.1.tgz", - "integrity": "sha512-hFvIjgprh9mMw5v42sJWLI1lzU5L2sznP805zeT6rySVRA0Y18StRhDqhSxlap0oVgItRsB6WSROp4YnJTJz0g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" - } - }, - "@babel/plugin-proposal-optional-chaining": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.1.tgz", - "integrity": "sha512-c2uRpY6WzaVDzynVY9liyykS+kVU+WRZPMPYpkelXH8KBt1oXoI89kPbZKKG/jDT5UK92FTW2fZkZaJhdiBabw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1", - "@babel/plugin-syntax-optional-chaining": "^7.8.0" - } - }, - "@babel/plugin-proposal-private-methods": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.12.1.tgz", - "integrity": "sha512-mwZ1phvH7/NHK6Kf8LP7MYDogGV+DKB1mryFOEwx5EBNQrosvIczzZFTUmWaeujd5xT6G1ELYWUz3CutMhjE1w==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.1.tgz", - "integrity": "sha512-MYq+l+PvHuw/rKUz1at/vb6nCnQ2gmJBNaM62z0OgH7B2W1D9pvkpYtlti9bGtizNIU1K3zm4bZF9F91efVY0w==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4" - } - }, "@babel/plugin-syntax-async-generators": { "version": "7.8.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", @@ -585,24 +253,6 @@ "@babel/helper-plugin-utils": "^7.10.4" } }, - "@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, "@babel/plugin-syntax-import-meta": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", @@ -615,529 +265,73 @@ "@babel/plugin-syntax-json-strings": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-top-level-await": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz", - "integrity": "sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-typescript": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.1.tgz", - "integrity": "sha512-UZNEcCY+4Dp9yYRCAHrHDU+9ZXLYaY9MgBXSRLkB9WjYFRR6quJBumfVrEkUxrePPBwFcpWfNKXqVRQQtm7mMA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-arrow-functions": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.12.1.tgz", - "integrity": "sha512-5QB50qyN44fzzz4/qxDPQMBCTHgxg3n0xRBLJUmBlLoU/sFvxVWGZF/ZUfMVDQuJUKXaBhbupxIzIfZ6Fwk/0A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-async-to-generator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.12.1.tgz", - "integrity": "sha512-SDtqoEcarK1DFlRJ1hHRY5HvJUj5kX4qmtpMAm2QnhOlyuMC4TMdCRgW6WXpv93rZeYNeLP22y8Aq2dbcDRM1A==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-remap-async-to-generator": "^7.12.1" - } - }, - "@babel/plugin-transform-block-scoped-functions": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.1.tgz", - "integrity": "sha512-5OpxfuYnSgPalRpo8EWGPzIYf0lHBWORCkj5M0oLBwHdlux9Ri36QqGW3/LR13RSVOAoUUMzoPI/jpE4ABcHoA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-block-scoping": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.1.tgz", - "integrity": "sha512-zJyAC9sZdE60r1nVQHblcfCj29Dh2Y0DOvlMkcqSo0ckqjiCwNiUezUKw+RjOCwGfpLRwnAeQ2XlLpsnGkvv9w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-classes": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.12.1.tgz", - "integrity": "sha512-/74xkA7bVdzQTBeSUhLLJgYIcxw/dpEpCdRDiHgPJ3Mv6uC11UhjpOhl72CgqbBCmt1qtssCyB2xnJm1+PFjog==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.10.4", - "@babel/helper-define-map": "^7.10.4", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.10.4", - "globals": "^11.1.0" - }, - "dependencies": { - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - } - } - }, - "@babel/plugin-transform-computed-properties": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.12.1.tgz", - "integrity": "sha512-vVUOYpPWB7BkgUWPo4C44mUQHpTZXakEqFjbv8rQMg7TC6S6ZhGZ3otQcRH6u7+adSlE5i0sp63eMC/XGffrzg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-destructuring": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.12.1.tgz", - "integrity": "sha512-fRMYFKuzi/rSiYb2uRLiUENJOKq4Gnl+6qOv5f8z0TZXg3llUwUhsNNwrwaT/6dUhJTzNpBr+CUvEWBtfNY1cw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-dotall-regex": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.1.tgz", - "integrity": "sha512-B2pXeRKoLszfEW7J4Hg9LoFaWEbr/kzo3teWHmtFCszjRNa/b40f9mfeqZsIDLLt/FjwQ6pz/Gdlwy85xNckBA==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-duplicate-keys": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.1.tgz", - "integrity": "sha512-iRght0T0HztAb/CazveUpUQrZY+aGKKaWXMJ4uf9YJtqxSUe09j3wteztCUDRHs+SRAL7yMuFqUsLoAKKzgXjw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-exponentiation-operator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.1.tgz", - "integrity": "sha512-7tqwy2bv48q+c1EHbXK0Zx3KXd2RVQp6OC7PbwFNt/dPTAV3Lu5sWtWuAj8owr5wqtWnqHfl2/mJlUmqkChKug==", - "dev": true, - "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.10.4", - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-for-of": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.12.1.tgz", - "integrity": "sha512-Zaeq10naAsuHo7heQvyV0ptj4dlZJwZgNAtBYBnu5nNKJoW62m0zKcIEyVECrUKErkUkg6ajMy4ZfnVZciSBhg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-function-name": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.1.tgz", - "integrity": "sha512-JF3UgJUILoFrFMEnOJLJkRHSk6LUSXLmEFsA23aR2O5CSLUxbeUX1IZ1YQ7Sn0aXb601Ncwjx73a+FVqgcljVw==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-literals": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.1.tgz", - "integrity": "sha512-+PxVGA+2Ag6uGgL0A5f+9rklOnnMccwEBzwYFL3EUaKuiyVnUipyXncFcfjSkbimLrODoqki1U9XxZzTvfN7IQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-member-expression-literals": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.1.tgz", - "integrity": "sha512-1sxePl6z9ad0gFMB9KqmYofk34flq62aqMt9NqliS/7hPEpURUCMbyHXrMPlo282iY7nAvUB1aQd5mg79UD9Jg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-modules-amd": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.12.1.tgz", - "integrity": "sha512-tDW8hMkzad5oDtzsB70HIQQRBiTKrhfgwC/KkJeGsaNFTdWhKNt/BiE8c5yj19XiGyrxpbkOfH87qkNg1YGlOQ==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-commonjs": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.12.1.tgz", - "integrity": "sha512-dY789wq6l0uLY8py9c1B48V8mVL5gZh/+PQ5ZPrylPYsnAvnEMjqsUXkuoDVPeVK+0VyGar+D08107LzDQ6pag==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-simple-access": "^7.12.1", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-systemjs": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.12.1.tgz", - "integrity": "sha512-Hn7cVvOavVh8yvW6fLwveFqSnd7rbQN3zJvoPNyNaQSvgfKmDBO9U1YL9+PCXGRlZD9tNdWTy5ACKqMuzyn32Q==", - "dev": true, - "requires": { - "@babel/helper-hoist-variables": "^7.10.4", - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-validator-identifier": "^7.10.4", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-umd": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.12.1.tgz", - "integrity": "sha512-aEIubCS0KHKM0zUos5fIoQm+AZUMt1ZvMpqz0/H5qAQ7vWylr9+PLYurT+Ic7ID/bKLd4q8hDovaG3Zch2uz5Q==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.1.tgz", - "integrity": "sha512-tB43uQ62RHcoDp9v2Nsf+dSM8sbNodbEicbQNA53zHz8pWUhsgHSJCGpt7daXxRydjb0KnfmB+ChXOv3oADp1Q==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.12.1" - } - }, - "@babel/plugin-transform-new-target": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.1.tgz", - "integrity": "sha512-+eW/VLcUL5L9IvJH7rT1sT0CzkdUTvPrXC2PXTn/7z7tXLBuKvezYbGdxD5WMRoyvyaujOq2fWoKl869heKjhw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-object-super": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.1.tgz", - "integrity": "sha512-AvypiGJH9hsquNUn+RXVcBdeE3KHPZexWRdimhuV59cSoOt5kFBmqlByorAeUlGG2CJWd0U+4ZtNKga/TB0cAw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-replace-supers": "^7.12.1" - } - }, - "@babel/plugin-transform-parameters": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.12.1.tgz", - "integrity": "sha512-xq9C5EQhdPK23ZeCdMxl8bbRnAgHFrw5EOC3KJUsSylZqdkCaFEXxGSBuTSObOpiiHHNyb82es8M1QYgfQGfNg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-property-literals": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.1.tgz", - "integrity": "sha512-6MTCR/mZ1MQS+AwZLplX4cEySjCpnIF26ToWo942nqn8hXSm7McaHQNeGx/pt7suI1TWOWMfa/NgBhiqSnX0cQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-regenerator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.12.1.tgz", - "integrity": "sha512-gYrHqs5itw6i4PflFX3OdBPMQdPbF4bj2REIUxlMRUFk0/ZOAIpDFuViuxPjUL7YC8UPnf+XG7/utJvqXdPKng==", - "dev": true, - "requires": { - "regenerator-transform": "^0.14.2" - } - }, - "@babel/plugin-transform-reserved-words": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.1.tgz", - "integrity": "sha512-pOnUfhyPKvZpVyBHhSBoX8vfA09b7r00Pmm1sH+29ae2hMTKVmSp4Ztsr8KBKjLjx17H0eJqaRC3bR2iThM54A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-shorthand-properties": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.1.tgz", - "integrity": "sha512-GFZS3c/MhX1OusqB1MZ1ct2xRzX5ppQh2JU1h2Pnfk88HtFTM+TWQqJNfwkmxtPQtb/s1tk87oENfXJlx7rSDw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-transform-spread": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.12.1.tgz", - "integrity": "sha512-vuLp8CP0BE18zVYjsEBZ5xoCecMK6LBMMxYzJnh01rxQRvhNhH1csMMmBfNo5tGpGO+NhdSNW2mzIvBu3K1fng==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1" - } - }, - "@babel/plugin-transform-sticky-regex": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.1.tgz", - "integrity": "sha512-CiUgKQ3AGVk7kveIaPEET1jNDhZZEl1RPMWdTBE1799bdz++SwqDHStmxfCtDfBhQgCl38YRiSnrMuUMZIWSUQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-regex": "^7.10.4" - } - }, - "@babel/plugin-transform-template-literals": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.12.1.tgz", - "integrity": "sha512-b4Zx3KHi+taXB1dVRBhVJtEPi9h1THCeKmae2qP0YdUHIFhVjtpqqNfxeVAa1xeHVhAy4SbHxEwx5cltAu5apw==", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-plugin-utils": "^7.8.0" } }, - "@babel/plugin-transform-typeof-symbol": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.1.tgz", - "integrity": "sha512-EPGgpGy+O5Kg5pJFNDKuxt9RdmTgj5sgrus2XVeMp/ZIbOESadgILUbm50SNpghOh3/6yrbsH+NB5+WJTmsA7Q==", + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" } }, - "@babel/plugin-transform-typescript": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.12.1.tgz", - "integrity": "sha512-VrsBByqAIntM+EYMqSm59SiMEf7qkmI9dqMt6RbD/wlwueWmYcI0FFK5Fj47pP6DRZm+3teXjosKlwcZJ5lIMw==", + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-typescript": "^7.12.1" + "@babel/helper-plugin-utils": "^7.8.0" } }, - "@babel/plugin-transform-unicode-escapes": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.1.tgz", - "integrity": "sha512-I8gNHJLIc7GdApm7wkVnStWssPNbSRMPtgHdmH3sRM1zopz09UWPS4x5V4n1yz/MIWTVnJ9sp6IkuXdWM4w+2Q==", + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" } }, - "@babel/plugin-transform-unicode-regex": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.1.tgz", - "integrity": "sha512-SqH4ClNngh/zGwHZOOQMTD+e8FGWexILV+ePMyiDJttAWRh5dhDL8rcl5lSgU3Huiq6Zn6pWTMvdPAb21Dwdyg==", + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-plugin-utils": "^7.8.0" } }, - "@babel/preset-env": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.1.tgz", - "integrity": "sha512-H8kxXmtPaAGT7TyBvSSkoSTUK6RHh61So05SyEbpmr0MCZrsNYn7mGMzzeYoOUCdHzww61k8XBft2TaES+xPLg==", + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, "requires": { - "@babel/compat-data": "^7.12.1", - "@babel/helper-compilation-targets": "^7.12.1", - "@babel/helper-module-imports": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-validator-option": "^7.12.1", - "@babel/plugin-proposal-async-generator-functions": "^7.12.1", - "@babel/plugin-proposal-class-properties": "^7.12.1", - "@babel/plugin-proposal-dynamic-import": "^7.12.1", - "@babel/plugin-proposal-export-namespace-from": "^7.12.1", - "@babel/plugin-proposal-json-strings": "^7.12.1", - "@babel/plugin-proposal-logical-assignment-operators": "^7.12.1", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1", - "@babel/plugin-proposal-numeric-separator": "^7.12.1", - "@babel/plugin-proposal-object-rest-spread": "^7.12.1", - "@babel/plugin-proposal-optional-catch-binding": "^7.12.1", - "@babel/plugin-proposal-optional-chaining": "^7.12.1", - "@babel/plugin-proposal-private-methods": "^7.12.1", - "@babel/plugin-proposal-unicode-property-regex": "^7.12.1", - "@babel/plugin-syntax-async-generators": "^7.8.0", - "@babel/plugin-syntax-class-properties": "^7.12.1", - "@babel/plugin-syntax-dynamic-import": "^7.8.0", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.0", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.0", - "@babel/plugin-syntax-top-level-await": "^7.12.1", - "@babel/plugin-transform-arrow-functions": "^7.12.1", - "@babel/plugin-transform-async-to-generator": "^7.12.1", - "@babel/plugin-transform-block-scoped-functions": "^7.12.1", - "@babel/plugin-transform-block-scoping": "^7.12.1", - "@babel/plugin-transform-classes": "^7.12.1", - "@babel/plugin-transform-computed-properties": "^7.12.1", - "@babel/plugin-transform-destructuring": "^7.12.1", - "@babel/plugin-transform-dotall-regex": "^7.12.1", - "@babel/plugin-transform-duplicate-keys": "^7.12.1", - "@babel/plugin-transform-exponentiation-operator": "^7.12.1", - "@babel/plugin-transform-for-of": "^7.12.1", - "@babel/plugin-transform-function-name": "^7.12.1", - "@babel/plugin-transform-literals": "^7.12.1", - "@babel/plugin-transform-member-expression-literals": "^7.12.1", - "@babel/plugin-transform-modules-amd": "^7.12.1", - "@babel/plugin-transform-modules-commonjs": "^7.12.1", - "@babel/plugin-transform-modules-systemjs": "^7.12.1", - "@babel/plugin-transform-modules-umd": "^7.12.1", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.1", - "@babel/plugin-transform-new-target": "^7.12.1", - "@babel/plugin-transform-object-super": "^7.12.1", - "@babel/plugin-transform-parameters": "^7.12.1", - "@babel/plugin-transform-property-literals": "^7.12.1", - "@babel/plugin-transform-regenerator": "^7.12.1", - "@babel/plugin-transform-reserved-words": "^7.12.1", - "@babel/plugin-transform-shorthand-properties": "^7.12.1", - "@babel/plugin-transform-spread": "^7.12.1", - "@babel/plugin-transform-sticky-regex": "^7.12.1", - "@babel/plugin-transform-template-literals": "^7.12.1", - "@babel/plugin-transform-typeof-symbol": "^7.12.1", - "@babel/plugin-transform-unicode-escapes": "^7.12.1", - "@babel/plugin-transform-unicode-regex": "^7.12.1", - "@babel/preset-modules": "^0.1.3", - "@babel/types": "^7.12.1", - "core-js-compat": "^3.6.2", - "semver": "^5.5.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } + "@babel/helper-plugin-utils": "^7.8.0" } }, - "@babel/preset-modules": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz", - "integrity": "sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==", + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", - "@babel/types": "^7.4.4", - "esutils": "^2.0.2" + "@babel/helper-plugin-utils": "^7.8.0" } }, - "@babel/preset-typescript": { + "@babel/plugin-syntax-top-level-await": { "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.12.1.tgz", - "integrity": "sha512-hNK/DhmoJPsksdHuI/RVrcEws7GN5eamhi28JkO52MqIxU8Z0QpmiSOQxZHWOHV7I3P4UjHV97ay4TcamMA6Kw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-transform-typescript": "^7.12.1" - } - }, - "@babel/runtime": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", - "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz", + "integrity": "sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A==", "dev": true, "requires": { - "regenerator-runtime": "^0.13.4" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/template": { @@ -1193,6 +387,14 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@blockcerts/explorer-lookup": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@blockcerts/explorer-lookup/-/explorer-lookup-1.0.1.tgz", + "integrity": "sha512-XO/3axDu0KkieZYGydV248pIocy2bEJrWgjadFur4eR19604yONOZELJDNKcUIE2OunN6FSo+Qn0taJISDVsqw==", + "requires": { + "xmlhttprequest": "^1.8.0" + } + }, "@cnakazawa/watch": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", @@ -1508,207 +710,6 @@ "chalk": "^4.0.0" } }, - "@nicolo-ribaudo/chokidar-2": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8.tgz", - "integrity": "sha512-FohwULwAebCUKi/akMFyGi7jfc7JXTeMHzKxuP3umRd9mK/2Y7/SMBSI2jX+YLopPXi+PF9l307NmpfxTdCegA==", - "dev": true, - "optional": true, - "requires": { - "chokidar": "2.1.8" - }, - "dependencies": { - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "optional": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "optional": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "optional": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "optional": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "optional": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "optional": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "optional": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } - } - }, "@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", @@ -1866,95 +867,14 @@ "@octokit/plugin-rest-endpoint-methods": "4.3.1" } }, - "@octokit/types": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.1.0.tgz", - "integrity": "sha512-bMWBmg77MQTiRkOVyf50qK3QECWOEy43rLy/6fTWZ4HEwAhNfqzMcjiBDZAowkILwTrFvzE1CpP6gD0MuPHS+A==", - "dev": true, - "requires": { - "@octokit/openapi-types": "^2.0.0", - "@types/node": ">= 8" - } - }, - "@rollup/plugin-commonjs": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-16.0.0.tgz", - "integrity": "sha512-LuNyypCP3msCGVQJ7ki8PqYdpjfEkE/xtFa5DqlF+7IBD0JsfMZ87C58heSwIMint58sAUZbt3ITqOmdQv/dXw==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "commondir": "^1.0.1", - "estree-walker": "^2.0.1", - "glob": "^7.1.6", - "is-reference": "^1.2.1", - "magic-string": "^0.25.7", - "resolve": "^1.17.0" - }, - "dependencies": { - "estree-walker": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.1.tgz", - "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==", - "dev": true - } - } - }, - "@rollup/plugin-json": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", - "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.0.8" - } - }, - "@rollup/plugin-node-resolve": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-10.0.0.tgz", - "integrity": "sha512-sNijGta8fqzwA1VwUEtTvWCx2E7qC70NMsDh4ZG13byAXYigBNZMxALhKUSycBks5gupJdq0lFrKumFrRZ8H3A==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.17.0" - } - }, - "@rollup/plugin-typescript": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-6.1.0.tgz", - "integrity": "sha512-hJxaiE6WyNOsK+fZpbFh9CUijZYqPQuAOWO5khaGTUkM8DYNNyA2TDlgamecE+qLOG1G1+CwbWMAx3rbqpp6xQ==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "resolve": "^1.17.0" - } - }, - "@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "@octokit/types": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.1.0.tgz", + "integrity": "sha512-bMWBmg77MQTiRkOVyf50qK3QECWOEy43rLy/6fTWZ4HEwAhNfqzMcjiBDZAowkILwTrFvzE1CpP6gD0MuPHS+A==", "dev": true, "requires": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "dependencies": { - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, - "estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true - } + "@octokit/openapi-types": "^2.0.0", + "@types/node": ">= 8" } }, "@semantic-release/commit-analyzer": { @@ -2312,12 +1232,6 @@ "@babel/types": "^7.3.0" } }, - "@types/estree": { - "version": "0.0.45", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz", - "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==", - "dev": true - }, "@types/graceful-fs": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.4.tgz", @@ -2403,15 +1317,6 @@ "integrity": "sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ==", "dev": true }, - "@types/resolve": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", @@ -2565,23 +1470,6 @@ "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", "dev": true }, - "abstract-leveldown": { - "version": "0.12.4", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-0.12.4.tgz", - "integrity": "sha1-KeGOYy5g5OIh1YECR4UqY9ey5BA=", - "dev": true, - "requires": { - "xtend": "~3.0.0" - }, - "dependencies": { - "xtend": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", - "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=", - "dev": true - } - } - }, "acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -2780,26 +1668,6 @@ "safer-buffer": "~2.1.0" } }, - "asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -2817,13 +1685,6 @@ "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true, - "optional": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -2867,15 +1728,6 @@ "slash": "^3.0.0" } }, - "babel-plugin-dynamic-import-node": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "dev": true, - "requires": { - "object.assign": "^4.1.0" - } - }, "babel-plugin-istanbul": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz", @@ -3037,64 +1889,6 @@ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==" }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true, - "optional": true - }, - "bindings": { - "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, - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bl": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-0.8.2.tgz", - "integrity": "sha1-yba8oI0bwuoA/Ir7Txpf0eHGbk4=", - "dev": true, - "requires": { - "readable-stream": "~1.0.26" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, - "bn.js": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", - "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", - "dev": true - }, "bottleneck": { "version": "2.19.5", "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", @@ -3120,119 +1914,12 @@ "fill-range": "^7.0.1" } }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, "browser-process-hrtime": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, - "browserify-aes": { - "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", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "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", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "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", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-fs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browserify-fs/-/browserify-fs-1.0.0.tgz", - "integrity": "sha1-8HWqinKdTRcW0GZiDjhvzBMRqW8=", - "dev": true, - "requires": { - "level-filesystem": "^1.0.1", - "level-js": "^2.1.3", - "levelup": "^0.18.2" - } - }, - "browserify-rsa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", - "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", - "dev": true, - "requires": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", - "dev": true, - "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "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", - "util-deprecate": "^1.0.1" - } - } - } - }, - "browserslist": { - "version": "4.14.7", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.7.tgz", - "integrity": "sha512-BSVRLCeG3Xt/j/1cCGj1019Wbty0H+Yvu2AOuZSuoaUWn3RatbL33Cxk+Q4jRMRAbOm0p7SLravLjpnT6s0vzQ==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001157", - "colorette": "^1.2.1", - "electron-to-chromium": "^1.3.591", - "escalade": "^3.1.1", - "node-releases": "^1.1.66" - } - }, "bs-logger": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", @@ -3268,30 +1955,12 @@ "ieee754": "^1.1.13" } }, - "buffer-es6": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/buffer-es6/-/buffer-es6-4.9.3.tgz", - "integrity": "sha1-8mNHuC33b9N+GLy1KIxJcM/VxAQ=", - "dev": true - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-modules": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", - "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", - "dev": true - }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -3342,12 +2011,6 @@ "quick-lru": "^4.0.1" } }, - "caniuse-lite": { - "version": "1.0.30001158", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001158.tgz", - "integrity": "sha512-s5loVYY+yKpuVA3HyW8BarzrtJvwHReuzugQXlv1iR3LKSReoFXRm86mT6hT7PEF5RxW+XQZg+6nYjlywYzQ+g==", - "dev": true - }, "canonicalize": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/canonicalize/-/canonicalize-1.0.3.tgz", @@ -3448,68 +2111,12 @@ "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true }, - "chokidar": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", - "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" - }, - "dependencies": { - "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", - "dev": true, - "optional": true - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", - "dev": true, - "optional": true, - "requires": { - "picomatch": "^2.2.1" - } - } - } - }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, - "cipher-base": { - "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" - } - }, "cjs-module-lexer": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz", @@ -3590,12 +2197,6 @@ } } }, - "clone": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz", - "integrity": "sha1-YT+2hjmyaklKxTJT4Vsaa9iK2oU=", - "dev": true - }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -3633,12 +2234,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "colorette": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", - "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==", - "dev": true - }, "colors": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", @@ -3653,18 +2248,6 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, "compare-func": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", @@ -3693,18 +2276,6 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, "contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", @@ -3810,24 +2381,6 @@ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.7.0.tgz", "integrity": "sha512-NwS7fI5M5B85EwpWuIwJN4i/fbisQUwLwiSNUWeXlkAZ0sbBjLEvLvFLf1uzAUV66PcEPt4xCGCmOZSxVf3xzA==" }, - "core-js-compat": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.7.0.tgz", - "integrity": "sha512-V8yBI3+ZLDVomoWICO6kq/CD28Y4r1M7CWeO4AGpMdMfseu8bkSubBmUPySMGKRTS+su4XQ07zUkAsiu9FCWTg==", - "dev": true, - "requires": { - "browserslist": "^4.14.6", - "semver": "7.0.0" - }, - "dependencies": { - "semver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", - "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", - "dev": true - } - } - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -3860,51 +2413,6 @@ } } }, - "create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, - "create-hash": { - "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", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "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", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -3916,25 +2424,6 @@ "which": "^2.0.1" } }, - "crypto-browserify": { - "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", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, "crypto-ld": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/crypto-ld/-/crypto-ld-3.9.0.tgz", @@ -4071,15 +2560,6 @@ "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", "dev": true }, - "deferred-leveldown": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-0.2.0.tgz", - "integrity": "sha1-LO8fER4cV4cNi7uK8mUOWHzS9bQ=", - "dev": true, - "requires": { - "abstract-leveldown": "~0.12.1" - } - }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -4177,16 +2657,6 @@ "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", "dev": true }, - "des.js": { - "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" - } - }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -4205,25 +2675,6 @@ "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", "dev": true }, - "diffie-hellman": { - "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", - "randombytes": "^2.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -4278,41 +2729,12 @@ } }, "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "electron-to-chromium": { - "version": "1.3.597", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.597.tgz", - "integrity": "sha512-VJI21MucKaqyFw0oe3j9BIg+nDF4MHzUZAmUwZzrxho+s8zPCD13Fds07Rgu+MTtAadO4tYTKFdAUksKYUyIJw==", - "dev": true - }, - "elliptic": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", - "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", - "dev": true, + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "emittery": { @@ -4420,15 +2842,6 @@ } } }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "dev": true, - "requires": { - "prr": "~1.0.1" - } - }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -4468,12 +2881,6 @@ "is-symbol": "^1.0.2" } }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -4847,12 +3254,6 @@ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, - "estree-walker": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", - "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", - "dev": true - }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -4864,16 +3265,6 @@ "resolved": "https://registry.npmjs.org/event-lite/-/event-lite-0.1.2.tgz", "integrity": "sha512-HnSYx1BsJ87/p6swwzv+2v6B4X+uxUteoDfRxsAb1S1BePzQqOLevVmkdA15GHJVd9A9Ok6wygUR18Hu0YeV9g==" }, - "evp_bytestokey": { - "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" - } - }, "exec-sh": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.4.tgz", @@ -5204,13 +3595,6 @@ "flat-cache": "^2.0.1" } }, - "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, - "optional": true - }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -5261,12 +3645,6 @@ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -5313,12 +3691,6 @@ "universalify": "^1.0.0" } }, - "fs-readdir-recursive": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", - "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", - "dev": true - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -5344,41 +3716,6 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "fwd-stream": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/fwd-stream/-/fwd-stream-1.0.4.tgz", - "integrity": "sha1-7Sgcq+1G/uz5Ie4y3ExQs3KsfPo=", - "dev": true, - "requires": { - "readable-stream": "~1.0.26-4" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -5637,51 +3974,6 @@ } } }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "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", - "util-deprecate": "^1.0.1" - } - } - } - }, - "hash.js": { - "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" - } - }, - "hmac-drbg": { - "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", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "hook-std": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-2.0.0.tgz", @@ -5833,12 +4125,6 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "idb-wrapper": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/idb-wrapper/-/idb-wrapper-1.7.2.tgz", - "integrity": "sha512-zfNREywMuf0NzDo9mVsL0yegjsirJxHpKHvWcyRozIqQy89g0a3U+oBPOCN4cc0oCiOuYgZHimzaW/R46G1Mpg==", - "dev": true - }, "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -5959,12 +4245,6 @@ "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", - "dev": true - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -6007,12 +4287,6 @@ "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", "dev": true }, - "is": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/is/-/is-0.2.7.tgz", - "integrity": "sha1-OzSixI81mXLzUEKEkZOucmS2NWI=", - "dev": true - }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -6039,16 +4313,6 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", @@ -6164,12 +4428,6 @@ "is-extglob": "^2.1.1" } }, - "is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", - "dev": true - }, "is-negative-zero": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", @@ -6188,12 +4446,6 @@ "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", "dev": true }, - "is-object": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/is-object/-/is-object-0.1.2.tgz", - "integrity": "sha1-AO+8CIFsM8/ErIJR0TLhDcZQmNc=", - "dev": true - }, "is-path-cwd": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", @@ -6227,15 +4479,6 @@ "integrity": "sha1-DFLlS8yjkbssSUsh6GJtczbG45c=", "dev": true }, - "is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "requires": { - "@types/estree": "*" - } - }, "is-regex": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", @@ -6301,12 +4544,6 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, - "isbuffer": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/isbuffer/-/isbuffer-0.0.0.tgz", - "integrity": "sha1-OMFG2d9Si4v5sHAcPUPPEt8/w5s=", - "dev": true - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -7236,224 +5473,6 @@ "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true }, - "level-blobs": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/level-blobs/-/level-blobs-0.1.7.tgz", - "integrity": "sha1-mrm5e7mfHtv594o0M+Ie1WOGva8=", - "dev": true, - "requires": { - "level-peek": "1.0.6", - "once": "^1.3.0", - "readable-stream": "^1.0.26-4" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, - "level-filesystem": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/level-filesystem/-/level-filesystem-1.2.0.tgz", - "integrity": "sha1-oArKmRnEpN+v3KaoEI0iWq3/Y7M=", - "dev": true, - "requires": { - "concat-stream": "^1.4.4", - "errno": "^0.1.1", - "fwd-stream": "^1.0.4", - "level-blobs": "^0.1.7", - "level-peek": "^1.0.6", - "level-sublevel": "^5.2.0", - "octal": "^1.0.0", - "once": "^1.3.0", - "xtend": "^2.2.0" - } - }, - "level-fix-range": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/level-fix-range/-/level-fix-range-1.0.2.tgz", - "integrity": "sha1-vxW5Fa422EcMgh6IPd95zRZCCCg=", - "dev": true - }, - "level-hooks": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/level-hooks/-/level-hooks-4.5.0.tgz", - "integrity": "sha1-G5rmGSKTDzMF0aYfxNg8gQLA3ZM=", - "dev": true, - "requires": { - "string-range": "~1.2" - } - }, - "level-js": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/level-js/-/level-js-2.2.4.tgz", - "integrity": "sha1-vAVfQYBjXUSJtWHJSG+jcOjBFpc=", - "dev": true, - "requires": { - "abstract-leveldown": "~0.12.0", - "idb-wrapper": "^1.5.0", - "isbuffer": "~0.0.0", - "ltgt": "^2.1.2", - "typedarray-to-buffer": "~1.0.0", - "xtend": "~2.1.2" - }, - "dependencies": { - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", - "dev": true - }, - "typedarray-to-buffer": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-1.0.4.tgz", - "integrity": "sha1-m7i6DoQfs/TPH+fCRenz+opf6Zw=", - "dev": true - }, - "xtend": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", - "dev": true, - "requires": { - "object-keys": "~0.4.0" - } - } - } - }, - "level-peek": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/level-peek/-/level-peek-1.0.6.tgz", - "integrity": "sha1-vsUccqgu5GTTNkNMfIdsP8vM538=", - "dev": true, - "requires": { - "level-fix-range": "~1.0.2" - } - }, - "level-sublevel": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/level-sublevel/-/level-sublevel-5.2.3.tgz", - "integrity": "sha1-dEwSxy0ucr543eO5tc2E1iGRQTo=", - "dev": true, - "requires": { - "level-fix-range": "2.0", - "level-hooks": ">=4.4.0 <5", - "string-range": "~1.2.1", - "xtend": "~2.0.4" - }, - "dependencies": { - "level-fix-range": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/level-fix-range/-/level-fix-range-2.0.0.tgz", - "integrity": "sha1-xBfWIVlEIVGhnZojZ4aPFyTC1Ug=", - "dev": true, - "requires": { - "clone": "~0.1.9" - } - }, - "object-keys": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.2.0.tgz", - "integrity": "sha1-zd7AKZiwkb5CvxA1rjLknxy26mc=", - "dev": true, - "requires": { - "foreach": "~2.0.1", - "indexof": "~0.0.1", - "is": "~0.2.6" - } - }, - "xtend": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.0.6.tgz", - "integrity": "sha1-XqZXptukRwacLlnFihE4ywxebO4=", - "dev": true, - "requires": { - "is-object": "~0.1.2", - "object-keys": "~0.2.0" - } - } - } - }, - "levelup": { - "version": "0.18.6", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-0.18.6.tgz", - "integrity": "sha1-5qAcsIlhbI7MApHCqb0/DETj5es=", - "dev": true, - "requires": { - "bl": "~0.8.1", - "deferred-leveldown": "~0.2.0", - "errno": "~0.1.1", - "prr": "~0.0.0", - "readable-stream": "~1.0.26", - "semver": "~2.3.1", - "xtend": "~3.0.0" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "prr": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz", - "integrity": "sha1-GoS4WQgyVQFBGFPQCB7j+obikmo=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "semver": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-2.3.2.tgz", - "integrity": "sha1-uYSPJdbPNjMwc+ye+IVtQvEjPlI=", - "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "xtend": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", - "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=", - "dev": true - } - } - }, "leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -7571,21 +5590,6 @@ "yallist": "^3.0.2" } }, - "ltgt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", - "dev": true - }, - "magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "dev": true, - "requires": { - "sourcemap-codec": "^1.4.4" - } - }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -7659,17 +5663,6 @@ "supports-hyperlinks": "^2.1.0" } }, - "md5.js": { - "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", - "safe-buffer": "^5.1.2" - } - }, "meow": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/meow/-/meow-8.0.0.tgz", @@ -7885,24 +5878,6 @@ "picomatch": "^2.0.5" } }, - "miller-rabin": { - "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" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, "mime": { "version": "2.4.6", "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", @@ -7934,18 +5909,6 @@ "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true }, - "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 - }, - "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 - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -8034,13 +5997,6 @@ "buffer": "^5.5.0" } }, - "nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", - "dev": true, - "optional": true - }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -8159,12 +6115,6 @@ } } }, - "node-releases": { - "version": "1.1.67", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz", - "integrity": "sha512-V5QF9noGFl3EymEwUYzO+3NTDpGfQB4ve6Qfnzf3UNydMhjQRVPR1DZTuvWiLzaFJYw2fmDwAfnRNEVb64hSIg==", - "dev": true - }, "nofilter": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-1.0.4.tgz", @@ -11844,12 +9794,6 @@ "has": "^1.0.3" } }, - "octal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/octal/-/octal-1.0.0.tgz", - "integrity": "sha1-Y+cWKmjvvrniE1iNWOmJ0eXEUws=", - "dev": true - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -11970,19 +9914,6 @@ "callsites": "^3.0.0" } }, - "parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", - "dev": true, - "requires": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -12004,13 +9935,6 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true, - "optional": true - }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -12058,19 +9982,6 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, - "pbkdf2": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", - "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -12205,12 +10116,6 @@ } } }, - "process-es6": { - "version": "0.11.6", - "resolved": "https://registry.npmjs.org/process-es6/-/process-es6-0.11.6.tgz", - "integrity": "sha1-xrs4n5qVH4K9TrFpYAEFvS/5x3g=", - "dev": true - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -12233,39 +10138,11 @@ "sisteransi": "^1.0.5" } }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", - "dev": true - }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, - "public-encrypt": { - "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", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -12298,25 +10175,6 @@ "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", "dev": true }, - "randombytes": { - "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" - } - }, - "randomfill": { - "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" - } - }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -12414,131 +10272,6 @@ } } }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "dependencies": { - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "optional": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "optional": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "optional": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } - } - }, "redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", @@ -12558,36 +10291,6 @@ "esprima": "~4.0.0" } }, - "regenerate": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", - "dev": true - }, - "regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", - "dev": true, - "requires": { - "regenerate": "^1.4.0" - } - }, - "regenerator-runtime": { - "version": "0.13.7", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", - "dev": true - }, - "regenerator-transform": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", - "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", - "dev": true, - "requires": { - "@babel/runtime": "^7.8.4" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -12604,20 +10307,6 @@ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, - "regexpu-core": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", - "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==", - "dev": true, - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.2.0", - "regjsgen": "^0.5.1", - "regjsparser": "^0.6.4", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.2.0" - } - }, "registry-auth-token": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", @@ -12627,29 +10316,6 @@ "rc": "^1.2.8" } }, - "regjsgen": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", - "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", - "dev": true - }, - "regjsparser": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", - "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - } - } - }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -12793,85 +10459,6 @@ "glob": "^7.1.3" } }, - "ripemd160": { - "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" - } - }, - "rollup": { - "version": "2.33.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.33.1.tgz", - "integrity": "sha512-uY4O/IoL9oNW8MMcbA5hcOaz6tZTMIh7qJHx/tzIJm+n1wLoY38BLn6fuy7DhR57oNFLMbDQtDeJoFURt5933w==", - "dev": true, - "requires": { - "fsevents": "~2.1.2" - } - }, - "rollup-plugin-node-builtins": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-builtins/-/rollup-plugin-node-builtins-2.1.2.tgz", - "integrity": "sha1-JKH+1KQyV7a2Q3HYq8bOGrFFl+k=", - "dev": true, - "requires": { - "browserify-fs": "^1.0.0", - "buffer-es6": "^4.9.2", - "crypto-browserify": "^3.11.0", - "process-es6": "^0.11.2" - } - }, - "rollup-plugin-node-globals": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-globals/-/rollup-plugin-node-globals-1.4.0.tgz", - "integrity": "sha512-xRkB+W/m1KLIzPUmG0ofvR+CPNcvuCuNdjVBVS7ALKSxr3EDhnzNceGkGi1m8MToSli13AzKFYH4ie9w3I5L3g==", - "dev": true, - "requires": { - "acorn": "^5.7.3", - "buffer-es6": "^4.9.3", - "estree-walker": "^0.5.2", - "magic-string": "^0.22.5", - "process-es6": "^0.11.6", - "rollup-pluginutils": "^2.3.1" - }, - "dependencies": { - "acorn": { - "version": "5.7.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", - "dev": true - }, - "magic-string": { - "version": "0.22.5", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", - "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", - "dev": true, - "requires": { - "vlq": "^0.2.2" - } - } - } - }, - "rollup-pluginutils": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", - "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", - "dev": true, - "requires": { - "estree-walker": "^0.6.1" - }, - "dependencies": { - "estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", - "dev": true - } - } - }, "rsvp": { "version": "4.8.5", "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", @@ -13344,16 +10931,6 @@ } } }, - "sha.js": { - "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" - } - }, "sha256": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/sha256/-/sha256-0.2.0.tgz", @@ -13652,12 +11229,6 @@ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, - "sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true - }, "spawn-error-forwarder": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz", @@ -13827,12 +11398,6 @@ "strip-ansi": "^6.0.0" } }, - "string-range": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/string-range/-/string-range-1.2.2.tgz", - "integrity": "sha1-qJPtNH5yKZvIO++78qaSqNI51d0=", - "dev": true - }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -14337,12 +11902,6 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -14365,34 +11924,6 @@ "dev": true, "optional": true }, - "unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", - "dev": true - }, - "unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", - "dev": true, - "requires": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" - } - }, - "unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", - "dev": true - }, - "unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", - "dev": true - }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -14466,13 +11997,6 @@ } } }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true, - "optional": true - }, "uri-js": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", @@ -14560,12 +12084,6 @@ "extsprintf": "^1.2.0" } }, - "vlq": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", - "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", - "dev": true - }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -14773,12 +12291,6 @@ "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" }, - "xtend": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.2.0.tgz", - "integrity": "sha1-7vax8ZjByN6vrYsXZaBNrUoBxak=", - "dev": true - }, "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", diff --git a/package.json b/package.json index 4b39b24..c9d82c5 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,11 @@ "name": "jsonld-signatures-merkleproof2019", "version": "0.1.0", "description": "A jsonld signature implementation to support MerkleProof2019 verification in Verifiable Credential context", - "main": "dist/MerkleProof2019.js", - "module": "dist/MerkleProof2019-es.js", - "typings": "dist/index.d.ts", + "main": "lib/cjs/MerkleProof2019.js", + "module": "lib/esm/MerkleProof2019.js", + "typings": "lib/index.d.ts", "dependencies": { + "@blockcerts/explorer-lookup": "^1.0.1", "@vaultie/lds-merkle-proof-2019": "0.0.8", "core-js": "^3.7.0", "jsonld": "^1.8.1", @@ -14,13 +15,6 @@ "xmlhttprequest": "^1.8.0" }, "devDependencies": { - "@babel/cli": "^7.12.1", - "@babel/preset-env": "^7.12.1", - "@babel/preset-typescript": "^7.12.1", - "@rollup/plugin-commonjs": "^16.0.0", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^10.0.0", - "@rollup/plugin-typescript": "^6.1.0", "@types/jest": "^26.0.15", "@types/sinon": "^9.0.8", "@typescript-eslint/eslint-plugin": "^4.6.1", @@ -33,9 +27,6 @@ "eslint-plugin-standard": "^4.0.2", "husky": "^4.3.0", "jest": "^26.6.3", - "rollup": "^2.33.1", - "rollup-plugin-node-builtins": "^2.1.2", - "rollup-plugin-node-globals": "^1.4.0", "semantic-release": "^17.3.0", "sinon": "^9.2.1", "ts-jest": "^26.4.4", @@ -43,14 +34,11 @@ "typescript": "^4.0.5" }, "scripts": { - "copy:declaration": "cp src/index.d.ts dist/index.d.ts", - "build": "rollup -c && npm run transpile:node && npm run copy:declaration", + "copy:declaration": "cp src/index.d.ts lib/index.d.ts", + "compile": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && npm run copy:declaration", "lint": "eslint . --ext .ts", "test": "jest", "test:watch": "jest --watch", - "transpile:node": "npm run transpile:node:ts && npm run clean:lib:ts", - "transpile:node:ts": "npx babel src -d lib --copy-files --extensions '.ts'", - "clean:lib:ts": "rimraf lib/\"**\"/*.ts", "semantic-release": "semantic-release" }, "husky": { diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index 56fbf4c..0000000 --- a/rollup.config.js +++ /dev/null @@ -1,35 +0,0 @@ -import commonjs from '@rollup/plugin-commonjs'; -import json from '@rollup/plugin-json'; -import resolve from '@rollup/plugin-node-resolve'; -import typescript from '@rollup/plugin-typescript'; -import builtins from 'rollup-plugin-node-builtins'; - -export default { - input: 'src/MerkleProof2019.ts', - output: [ - { - file: 'dist/MerkleProof2019.js', - format: 'cjs', - name: 'MerkleProof2019', - exports: 'named', - sourcemap: true - }, - { - file: 'dist/MerkleProof2019-es.js', - format: 'es', - name: 'MerkleProof2019', - sourcemap: true - } - ], - plugins: [ - resolve({ - browser: true, - preferBuiltins: true, - extensions: ['.js', '.json'] - }), - typescript(), - commonjs({ extensions: ['.js', '.ts'] }), - json(), - builtins() - ] -}; diff --git a/src/MerkleProof2019.ts b/src/MerkleProof2019.ts index 27ab63b..1c1d5ae 100644 --- a/src/MerkleProof2019.ts +++ b/src/MerkleProof2019.ts @@ -1,9 +1,9 @@ import { Decoder } from '@vaultie/lds-merkle-proof-2019'; import jsigs from 'jsonld-signatures'; +import { lookForTx } from '@blockcerts/explorer-lookup'; import { DecodedProof, JSONLDProof } from './models/Proof'; import getTransactionId from './helpers/getTransactionId'; import isTransactionIdValid from './inspectors/isTransactionIdValid'; -import lookForTx from './helpers/lookForTx'; import { ExplorerAPI } from './models/Explorers'; import { IBlockchainObject } from './constants/blockchains'; import getChain from './helpers/getChain'; @@ -11,7 +11,6 @@ import { TransactionData } from './models/TransactionData'; import computeLocalHash from './inspectors/computeLocalHash'; import ensureHashesEqual from './inspectors/ensureHashesEqual'; import ensureMerkleRootEqual from './inspectors/ensureMerkleRootEqual'; -import { prepareExplorerAPIs } from './explorers'; const { LinkedDataProof } = jsigs.suites; export interface MerkleProof2019Options { @@ -35,7 +34,7 @@ export interface MerkleProof2019VerificationResult { error?: string; } -export class MerkleProof2019 extends LinkedDataProof { +export class MerkleProof2019 extends (LinkedDataProof as any) { /** * @param type {string} Provided by subclass. * @param [issuer] {string} A key id URL to the paired public key. @@ -130,7 +129,7 @@ export class MerkleProof2019 extends LinkedDataProof { } private setOptions (options: MerkleProof2019Options): void { - this.explorerAPIs = options.explorerAPIs || []; + this.explorerAPIs = options.explorerAPIs ?? []; } private validateTransactionId (): string { @@ -142,7 +141,7 @@ export class MerkleProof2019 extends LinkedDataProof { this.txData = await lookForTx({ transactionId: this.transactionId, chain: this.chain?.code, - explorerAPIs: prepareExplorerAPIs(this.explorerAPIs) + explorerAPIs: this.explorerAPIs }); } } diff --git a/src/constants/config.ts b/src/constants/config.ts deleted file mode 100644 index a4bbb58..0000000 --- a/src/constants/config.ts +++ /dev/null @@ -1,22 +0,0 @@ -const SecurityContextUrl = 'https://w3id.org/security/v1'; - -// Minimum number of confirmations to consider a transaction valid. Recommended setting = 10 -const MininumConfirmations = 1; - -// Minimum number of blockchain APIs to consult to compare transaction data consistency -const MinimumBlockchainExplorers = 1; - -// Try all blockchain explorers (even > MinimumBlockchainExplorers) to increase the chance of a successful query. -const Race = true; - -const PublicKey = 'ecdsa-koblitz-pubkey:1'; - -const CONFIG = { - SecurityContextUrl, - MininumConfirmations, - MinimumBlockchainExplorers, - Race, - PublicKey -}; - -export default CONFIG; diff --git a/src/constants/contexts.ts b/src/constants/contexts.ts index 7f1abbf..a519680 100644 --- a/src/constants/contexts.ts +++ b/src/constants/contexts.ts @@ -12,17 +12,33 @@ export const CONTEXTS = { MerkleProof2019: 'sec:MerkleProof2019', BlockcertsCredential: 'bc:BlockcertsCredential', - introductionUrl: { '@id': 'bc:introductionUrl', '@type': '@id' }, + introductionUrl: { + '@id': 'bc:introductionUrl', + '@type': '@id' + }, CryptographicKey: 'sec:Key', domain: 'sec:domain', nonce: 'sec:nonce', proofValue: 'sec:proofValue', - assertionMethod: { '@id': 'sec:assertionMethod', '@type': '@id', '@container': '@set' }, - proofPurpose: { '@id': 'sec:proofPurpose', '@type': '@vocab' }, - verificationMethod: { '@id': 'sec:verificationMethod', '@type': '@id' }, - created: { '@id': 'bc:created', '@type': 'xsd:dateTime' }, + assertionMethod: { + '@id': 'sec:assertionMethod', + '@type': '@id', + '@container': '@set' + }, + proofPurpose: { + '@id': 'sec:proofPurpose', + '@type': '@vocab' + }, + verificationMethod: { + '@id': 'sec:verificationMethod', + '@type': '@id' + }, + created: { + '@id': 'bc:created', + '@type': 'xsd:dateTime' + }, name: { '@id': 'schema:name' @@ -62,15 +78,43 @@ export const CONTEXTS = { JsonSchemaValidator2018: 'cred:JsonSchemaValidator2018' } }, - credentialStatus: { '@id': 'cred:credentialStatus', '@type': '@id' }, - credentialSubject: { '@id': 'cred:credentialSubject', '@type': '@id' }, - evidence: { '@id': 'cred:evidence', '@type': '@id' }, - expirationDate: { '@id': 'cred:expirationDate', '@type': 'xsd:dateTime' }, - holder: { '@id': 'cred:holder', '@type': '@id' }, - issued: { '@id': 'cred:issued', '@type': 'xsd:dateTime' }, - issuer: { '@id': 'cred:issuer', '@type': '@id' }, - issuanceDate: { '@id': 'cred:issuanceDate', '@type': 'xsd:dateTime' }, - proof: { '@id': 'sec:proof', '@type': '@id', '@container': '@graph' }, + credentialStatus: { + '@id': 'cred:credentialStatus', + '@type': '@id' + }, + credentialSubject: { + '@id': 'cred:credentialSubject', + '@type': '@id' + }, + evidence: { + '@id': 'cred:evidence', + '@type': '@id' + }, + expirationDate: { + '@id': 'cred:expirationDate', + '@type': 'xsd:dateTime' + }, + holder: { + '@id': 'cred:holder', + '@type': '@id' + }, + issued: { + '@id': 'cred:issued', + '@type': 'xsd:dateTime' + }, + issuer: { + '@id': 'cred:issuer', + '@type': '@id' + }, + issuanceDate: { + '@id': 'cred:issuanceDate', + '@type': 'xsd:dateTime' + }, + proof: { + '@id': 'sec:proof', + '@type': '@id', + '@container': '@graph' + }, refreshService: { '@id': 'cred:refreshService', '@type': '@id', @@ -85,9 +129,18 @@ export const CONTEXTS = { ManualRefreshService2018: 'cred:ManualRefreshService2018' } }, - termsOfUse: { '@id': 'cred:termsOfUse', '@type': '@id' }, - validFrom: { '@id': 'cred:validFrom', '@type': 'xsd:dateTime' }, - validUntil: { '@id': 'cred:validUntil', '@type': 'xsd:dateTime' } + termsOfUse: { + '@id': 'cred:termsOfUse', + '@type': '@id' + }, + validFrom: { + '@id': 'cred:validFrom', + '@type': 'xsd:dateTime' + }, + validUntil: { + '@id': 'cred:validUntil', + '@type': 'xsd:dateTime' + } } }, @@ -102,9 +155,20 @@ export const CONTEXTS = { cred: 'https://www.w3.org/2018/credentials#', sec: 'https://w3id.org/security#', - holder: { '@id': 'cred:holder', '@type': '@id' }, - proof: { '@id': 'sec:proof', '@type': '@id', '@container': '@graph' }, - verifiableCredential: { '@id': 'cred:verifiableCredential', '@type': '@id', '@container': '@graph' } + holder: { + '@id': 'cred:holder', + '@type': '@id' + }, + proof: { + '@id': 'sec:proof', + '@type': '@id', + '@container': '@graph' + }, + verifiableCredential: { + '@id': 'cred:verifiableCredential', + '@type': '@id', + '@container': '@graph' + } } }, @@ -120,9 +184,15 @@ export const CONTEXTS = { xsd: 'http://www.w3.org/2001/XMLSchema#', challenge: 'sec:challenge', - created: { '@id': 'http://purl.org/dc/terms/created', '@type': 'xsd:dateTime' }, + created: { + '@id': 'http://purl.org/dc/terms/created', + '@type': 'xsd:dateTime' + }, domain: 'sec:domain', - expires: { '@id': 'sec:expiration', '@type': 'xsd:dateTime' }, + expires: { + '@id': 'sec:expiration', + '@type': 'xsd:dateTime' + }, jws: 'sec:jws', nonce: 'sec:nonce', proofPurpose: { @@ -136,12 +206,23 @@ export const CONTEXTS = { sec: 'https://w3id.org/security#', - assertionMethod: { '@id': 'sec:assertionMethod', '@type': '@id', '@container': '@set' }, - authentication: { '@id': 'sec:authenticationMethod', '@type': '@id', '@container': '@set' } + assertionMethod: { + '@id': 'sec:assertionMethod', + '@type': '@id', + '@container': '@set' + }, + authentication: { + '@id': 'sec:authenticationMethod', + '@type': '@id', + '@container': '@set' + } } }, proofValue: 'sec:proofValue', - verificationMethod: { '@id': 'sec:verificationMethod', '@type': '@id' } + verificationMethod: { + '@id': 'sec:verificationMethod', + '@type': '@id' + } } }, @@ -157,9 +238,15 @@ export const CONTEXTS = { xsd: 'http://www.w3.org/2001/XMLSchema#', challenge: 'sec:challenge', - created: { '@id': 'http://purl.org/dc/terms/created', '@type': 'xsd:dateTime' }, + created: { + '@id': 'http://purl.org/dc/terms/created', + '@type': 'xsd:dateTime' + }, domain: 'sec:domain', - expires: { '@id': 'sec:expiration', '@type': 'xsd:dateTime' }, + expires: { + '@id': 'sec:expiration', + '@type': 'xsd:dateTime' + }, jws: 'sec:jws', nonce: 'sec:nonce', proofPurpose: { @@ -173,12 +260,23 @@ export const CONTEXTS = { sec: 'https://w3id.org/security#', - assertionMethod: { '@id': 'sec:assertionMethod', '@type': '@id', '@container': '@set' }, - authentication: { '@id': 'sec:authenticationMethod', '@type': '@id', '@container': '@set' } + assertionMethod: { + '@id': 'sec:assertionMethod', + '@type': '@id', + '@container': '@set' + }, + authentication: { + '@id': 'sec:authenticationMethod', + '@type': '@id', + '@container': '@set' + } } }, proofValue: 'sec:proofValue', - verificationMethod: { '@id': 'sec:verificationMethod', '@type': '@id' } + verificationMethod: { + '@id': 'sec:verificationMethod', + '@type': '@id' + } } }, @@ -194,9 +292,15 @@ export const CONTEXTS = { xsd: 'http://www.w3.org/2001/XMLSchema#', challenge: 'sec:challenge', - created: { '@id': 'http://purl.org/dc/terms/created', '@type': 'xsd:dateTime' }, + created: { + '@id': 'http://purl.org/dc/terms/created', + '@type': 'xsd:dateTime' + }, domain: 'sec:domain', - expires: { '@id': 'sec:expiration', '@type': 'xsd:dateTime' }, + expires: { + '@id': 'sec:expiration', + '@type': 'xsd:dateTime' + }, jws: 'sec:jws', nonce: 'sec:nonce', proofPurpose: { @@ -210,12 +314,23 @@ export const CONTEXTS = { sec: 'https://w3id.org/security#', - assertionMethod: { '@id': 'sec:assertionMethod', '@type': '@id', '@container': '@set' }, - authentication: { '@id': 'sec:authenticationMethod', '@type': '@id', '@container': '@set' } + assertionMethod: { + '@id': 'sec:assertionMethod', + '@type': '@id', + '@container': '@set' + }, + authentication: { + '@id': 'sec:authenticationMethod', + '@type': '@id', + '@container': '@set' + } } }, proofValue: 'sec:proofValue', - verificationMethod: { '@id': 'sec:verificationMethod', '@type': '@id' } + verificationMethod: { + '@id': 'sec:verificationMethod', + '@type': '@id' + } } }, @@ -225,9 +340,15 @@ export const CONTEXTS = { '@version': 1.1, challenge: 'sec:challenge', - created: { '@id': 'http://purl.org/dc/terms/created', '@type': 'xsd:dateTime' }, + created: { + '@id': 'http://purl.org/dc/terms/created', + '@type': 'xsd:dateTime' + }, domain: 'sec:domain', - expires: { '@id': 'sec:expiration', '@type': 'xsd:dateTime' }, + expires: { + '@id': 'sec:expiration', + '@type': 'xsd:dateTime' + }, jws: 'sec:jws', nonce: 'sec:nonce', proofPurpose: { @@ -241,16 +362,31 @@ export const CONTEXTS = { sec: 'https://w3id.org/security#', - assertionMethod: { '@id': 'sec:assertionMethod', '@type': '@id', '@container': '@set' }, - authentication: { '@id': 'sec:authenticationMethod', '@type': '@id', '@container': '@set' } + assertionMethod: { + '@id': 'sec:assertionMethod', + '@type': '@id', + '@container': '@set' + }, + authentication: { + '@id': 'sec:authenticationMethod', + '@type': '@id', + '@container': '@set' + } } }, proofValue: 'sec:proofValue', - verificationMethod: { '@id': 'sec:verificationMethod', '@type': '@id' } + verificationMethod: { + '@id': 'sec:verificationMethod', + '@type': '@id' + } } }, - proof: { '@id': 'https://w3id.org/security#proof', '@type': '@id', '@container': '@graph' } + proof: { + '@id': 'https://w3id.org/security#proof', + '@type': '@id', + '@container': '@graph' + } } }, verifiableCredentialExample: { @@ -282,22 +418,37 @@ export const CONTEXTS = { primaryProof: 'ex:primaryProof', nonRevocationProof: 'ex:nonRevocationProof', - alumniOf: { '@id': 'schema:alumniOf', '@type': 'rdf:HTML' }, - child: { '@id': 'ex:child', '@type': '@id' }, + alumniOf: { + '@id': 'schema:alumniOf', + '@type': 'rdf:HTML' + }, + child: { + '@id': 'ex:child', + '@type': '@id' + }, degree: 'ex:degree', degreeType: 'ex:degreeType', degreeSchool: 'ex:degreeSchool', college: 'ex:college', - name: { '@id': 'schema:name', '@type': 'rdf:HTML' }, + name: { + '@id': 'schema:name', + '@type': 'rdf:HTML' + }, givenName: 'schema:givenName', familyName: 'schema:familyName', - parent: { '@id': 'ex:parent', '@type': '@id' }, + parent: { + '@id': 'ex:parent', + '@type': '@id' + }, referenceId: 'ex:referenceId', documentPresence: 'ex:documentPresence', evidenceDocument: 'ex:evidenceDocument', spouse: 'schema:spouse', subjectPresence: 'ex:subjectPresence', - verifier: { '@id': 'ex:verifier', '@type': '@id' } + verifier: { + '@id': 'ex:verifier', + '@type': '@id' + } }] }, merkleProof2019: { @@ -305,9 +456,15 @@ export const CONTEXTS = { '@context': { '@version': 1.1, challenge: 'sec:challenge', - created: { '@id': 'http://purl.org/dc/terms/created', '@type': 'xsd:dateTime' }, + created: { + '@id': 'http://purl.org/dc/terms/created', + '@type': 'xsd:dateTime' + }, domain: 'sec:domain', - expires: { '@id': 'sec:expiration', '@type': 'xsd:dateTime' }, + expires: { + '@id': 'sec:expiration', + '@type': 'xsd:dateTime' + }, jws: 'sec:jws', nonce: 'sec:nonce', proofPurpose: { @@ -321,12 +478,327 @@ export const CONTEXTS = { sec: 'https://w3id.org/security#', - assertionMethod: { '@id': 'sec:assertionMethod', '@type': '@id', '@container': '@set' }, - authentication: { '@id': 'sec:authenticationMethod', '@type': '@id', '@container': '@set' } + assertionMethod: { + '@id': 'sec:assertionMethod', + '@type': '@id', + '@container': '@set' + }, + authentication: { + '@id': 'sec:authenticationMethod', + '@type': '@id', + '@container': '@set' + } } }, proofValue: 'sec:proofValue', - verificationMethod: { '@id': 'sec:verificationMethod', '@type': '@id' } + verificationMethod: { + '@id': 'sec:verificationMethod', + '@type': '@id' + } + } + }, + odrl: { + '@context': { + odrl: 'http://www.w3.org/ns/odrl/2/', + rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', + rdfs: 'http://www.w3.org/2000/01/rdf-schema#', + owl: 'http://www.w3.org/2002/07/owl#', + skos: 'http://www.w3.org/2004/02/skos/core#', + dct: 'http://purl.org/dc/terms/', + xsd: 'http://www.w3.org/2001/XMLSchema#', + vcard: 'http://www.w3.org/2006/vcard/ns#', + foaf: 'http://xmlns.com/foaf/0.1/', + schema: 'http://schema.org/', + cc: 'http://creativecommons.org/ns#', + uid: '@id', + type: '@type', + Policy: 'odrl:Policy', + Rule: 'odrl:Rule', + profile: { + '@type': '@id', + '@id': 'odrl:profile' + }, + inheritFrom: { + '@type': '@id', + '@id': 'odrl:inheritFrom' + }, + ConflictTerm: 'odrl:ConflictTerm', + conflict: { + '@type': '@vocab', + '@id': 'odrl:conflict' + }, + perm: 'odrl:perm', + prohibit: 'odrl:prohibit', + invalid: 'odrl:invalid', + Agreement: 'odrl:Agreement', + Assertion: 'odrl:Assertion', + Offer: 'odrl:Offer', + Privacy: 'odrl:Privacy', + Request: 'odrl:Request', + Set: 'odrl:Set', + Ticket: 'odrl:Ticket', + + Asset: 'odrl:Asset', + AssetCollection: 'odrl:AssetCollection', + relation: { + '@type': '@id', + '@id': 'odrl:relation' + }, + hasPolicy: { + '@type': '@id', + '@id': 'odrl:hasPolicy' + }, + target: { + '@type': '@id', + '@id': 'odrl:target' + }, + output: { + '@type': '@id', + '@id': 'odrl:output' + }, + partOf: { + '@type': '@id', + '@id': 'odrl:partOf' + }, + source: { + '@type': '@id', + '@id': 'odrl:source' + }, + Party: 'odrl:Party', + PartyCollection: 'odrl:PartyCollection', + function: { + '@type': '@vocab', + '@id': 'odrl:function' + }, + PartyScope: 'odrl:PartyScope', + assignee: { + '@type': '@id', + '@id': 'odrl:assignee' + }, + assigner: { + '@type': '@id', + '@id': 'odrl:assigner' + }, + assigneeOf: { + '@type': '@id', + '@id': 'odrl:assigneeOf' + }, + assignerOf: { + '@type': '@id', + '@id': 'odrl:assignerOf' + }, + attributedParty: { + '@type': '@id', + '@id': 'odrl:attributedParty' + }, + attributingParty: { + '@type': '@id', + '@id': 'odrl:attributingParty' + }, + compensatedParty: { + '@type': '@id', + '@id': 'odrl:compensatedParty' + }, + compensatingParty: { + '@type': '@id', + '@id': 'odrl:compensatingParty' + }, + consentingParty: { + '@type': '@id', + '@id': 'odrl:consentingParty' + }, + consentedParty: { + '@type': '@id', + '@id': 'odrl:consentedParty' + }, + informedParty: { + '@type': '@id', + '@id': 'odrl:informedParty' + }, + informingParty: { + '@type': '@id', + '@id': 'odrl:informingParty' + }, + trackingParty: { + '@type': '@id', + '@id': 'odrl:trackingParty' + }, + trackedParty: { + '@type': '@id', + '@id': 'odrl:trackedParty' + }, + contractingParty: { + '@type': '@id', + '@id': 'odrl:contractingParty' + }, + contractedParty: { + '@type': '@id', + '@id': 'odrl:contractedParty' + }, + Action: 'odrl:Action', + action: { + '@type': '@vocab', + '@id': 'odrl:action' + }, + includedIn: { + '@type': '@id', + '@id': 'odrl:includedIn' + }, + implies: { + '@type': '@id', + '@id': 'odrl:implies' + }, + Permission: 'odrl:Permission', + permission: { + '@type': '@id', + '@id': 'odrl:permission' + }, + Prohibition: 'odrl:Prohibition', + prohibition: { + '@type': '@id', + '@id': 'odrl:prohibition' + }, + obligation: { + '@type': '@id', + '@id': 'odrl:obligation' + }, + use: 'odrl:use', + grantUse: 'odrl:grantUse', + aggregate: 'odrl:aggregate', + annotate: 'odrl:annotate', + anonymize: 'odrl:anonymize', + archive: 'odrl:archive', + concurrentUse: 'odrl:concurrentUse', + derive: 'odrl:derive', + digitize: 'odrl:digitize', + display: 'odrl:display', + distribute: 'odrl:distribute', + execute: 'odrl:execute', + extract: 'odrl:extract', + give: 'odrl:give', + index: 'odrl:index', + install: 'odrl:install', + modify: 'odrl:modify', + move: 'odrl:move', + play: 'odrl:play', + present: 'odrl:present', + print: 'odrl:print', + read: 'odrl:read', + reproduce: 'odrl:reproduce', + sell: 'odrl:sell', + stream: 'odrl:stream', + textToSpeech: 'odrl:textToSpeech', + transfer: 'odrl:transfer', + transform: 'odrl:transform', + translate: 'odrl:translate', + + Duty: 'odrl:Duty', + duty: { + '@type': '@id', + '@id': 'odrl:duty' + }, + consequence: { + '@type': '@id', + '@id': 'odrl:consequence' + }, + remedy: { + '@type': '@id', + '@id': 'odrl:remedy' + }, + acceptTracking: 'odrl:acceptTracking', + attribute: 'odrl:attribute', + compensate: 'odrl:compensate', + delete: 'odrl:delete', + ensureExclusivity: 'odrl:ensureExclusivity', + include: 'odrl:include', + inform: 'odrl:inform', + nextPolicy: 'odrl:nextPolicy', + obtainConsent: 'odrl:obtainConsent', + reviewPolicy: 'odrl:reviewPolicy', + uninstall: 'odrl:uninstall', + watermark: 'odrl:watermark', + + Constraint: 'odrl:Constraint', + LogicalConstraint: 'odrl:LogicalConstraint', + constraint: { + '@type': '@id', + '@id': 'odrl:constraint' + }, + refinement: { + '@type': '@id', + '@id': 'odrl:refinement' + }, + Operator: 'odrl:Operator', + operator: { + '@type': '@vocab', + '@id': 'odrl:operator' + }, + RightOperand: 'odrl:RightOperand', + rightOperand: 'odrl:rightOperand', + rightOperandReference: { + '@type': 'xsd:anyURI', + '@id': 'odrl:rightOperandReference' + }, + LeftOperand: 'odrl:LeftOperand', + leftOperand: { + '@type': '@vocab', + '@id': 'odrl:leftOperand' + }, + unit: 'odrl:unit', + dataType: { + '@type': 'xsd:anyType', + '@id': 'odrl:datatype' + }, + status: 'odrl:status', + absolutePosition: 'odrl:absolutePosition', + absoluteSpatialPosition: 'odrl:absoluteSpatialPosition', + absoluteTemporalPosition: 'odrl:absoluteTemporalPosition', + absoluteSize: 'odrl:absoluteSize', + count: 'odrl:count', + dateTime: 'odrl:dateTime', + delayPeriod: 'odrl:delayPeriod', + deliveryChannel: 'odrl:deliveryChannel', + elapsedTime: 'odrl:elapsedTime', + event: 'odrl:event', + fileFormat: 'odrl:fileFormat', + industry: 'odrl:industry:', + language: 'odrl:language', + media: 'odrl:media', + meteredTime: 'odrl:meteredTime', + payAmount: 'odrl:payAmount', + percentage: 'odrl:percentage', + product: 'odrl:product', + purpose: 'odrl:purpose', + recipient: 'odrl:recipient', + relativePosition: 'odrl:relativePosition', + relativeSpatialPosition: 'odrl:relativeSpatialPosition', + relativeTemporalPosition: 'odrl:relativeTemporalPosition', + relativeSize: 'odrl:relativeSize', + resolution: 'odrl:resolution', + spatial: 'odrl:spatial', + spatialCoordinates: 'odrl:spatialCoordinates', + systemDevice: 'odrl:systemDevice', + timeInterval: 'odrl:timeInterval', + unitOfCount: 'odrl:unitOfCount', + version: 'odrl:version', + virtualLocation: 'odrl:virtualLocation', + eq: 'odrl:eq', + gt: 'odrl:gt', + gteq: 'odrl:gteq', + lt: 'odrl:lt', + lteq: 'odrl:lteq', + neq: 'odrl:neg', + isA: 'odrl:isA', + hasPart: 'odrl:hasPart', + isPartOf: 'odrl:isPartOf', + isAllOf: 'odrl:isAllOf', + isAnyOf: 'odrl:isAnyOf', + isNoneOf: 'odrl:isNoneOf', + or: 'odrl:or', + xone: 'odrl:xone', + and: 'odrl:and', + andSequence: 'odrl:andSequence', + policyUsage: 'odrl:policyUsage' } } }; diff --git a/src/explorers/bitcoin/bitpay.ts b/src/explorers/bitcoin/bitpay.ts deleted file mode 100644 index b414586..0000000 --- a/src/explorers/bitcoin/bitpay.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { stripHashPrefix } from '../../utils/stripHashPrefix'; -import { timestampToDateObject } from '../../utils/date'; -import { ExplorerAPI, ExplorerURLs, IParsingFunctionAPI } from '../../models/Explorers'; -import { TransactionData } from '../../models/TransactionData'; -import { TRANSACTION_APIS, TRANSACTION_ID_PLACEHOLDER } from '../../constants/api'; -import CONFIG from '../../constants/config'; -import { BLOCKCHAINS } from '../../constants/blockchains'; - -// TODO: use tests/explorers/mocks/mockBitpayResponse as type -function parsingFunction ({ jsonResponse }: IParsingFunctionAPI): TransactionData { - if (jsonResponse.confirmations < CONFIG.MininumConfirmations) { - throw new Error('Number of transaction confirmations were less than the minimum required, according to Bitpay API'); - } - const time: Date = timestampToDateObject(jsonResponse.blocktime); - const outputs = jsonResponse.vout; - const lastOutput = outputs[outputs.length - 1]; - const issuingAddress: string = jsonResponse.vout[0].scriptPubKey.addresses[0]; - const remoteHash: string = stripHashPrefix(lastOutput.scriptPubKey.hex, BLOCKCHAINS.bitcoin.prefixes); - const revokedAddresses: string[] = outputs - .filter(output => !!output.spentTxId) - .map(output => output.scriptPubKey.addresses[0]); - - return { - remoteHash, - issuingAddress, - time, - revokedAddresses - }; -} - -const serviceURL: ExplorerURLs = { - main: `https://insight.bitpay.com/api/tx/${TRANSACTION_ID_PLACEHOLDER}`, - test: `https://api.bitcore.io/api/BTC/testnet/tx/${TRANSACTION_ID_PLACEHOLDER}` -}; - -export const explorerApi: ExplorerAPI = { - serviceURL, - serviceName: TRANSACTION_APIS.bitpay, - parsingFunction, - priority: -1 -}; diff --git a/src/explorers/bitcoin/blockcypher.ts b/src/explorers/bitcoin/blockcypher.ts deleted file mode 100644 index df82b51..0000000 --- a/src/explorers/bitcoin/blockcypher.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { stripHashPrefix } from '../../utils/stripHashPrefix'; -import { dateToUnixTimestamp } from '../../utils/date'; -import { ExplorerAPI, ExplorerURLs, IParsingFunctionAPI } from '../../models/Explorers'; -import { TransactionData } from '../../models/TransactionData'; -import { TRANSACTION_APIS, TRANSACTION_ID_PLACEHOLDER } from '../../constants/api'; -import CONFIG from '../../constants/config'; -import { BLOCKCHAINS } from '../../constants/blockchains'; - -// TODO: use tests/explorers/mocks/mockBlockcypher as type -function parsingFunction ({ jsonResponse }: IParsingFunctionAPI): TransactionData { - if (jsonResponse.confirmations < CONFIG.MininumConfirmations) { - throw new Error('Number of transaction confirmations were less than the minimum required, according to Blockcypher API'); - } - const time: Date = dateToUnixTimestamp(jsonResponse.received); - const outputs = jsonResponse.outputs; - const lastOutput = outputs[outputs.length - 1]; - const issuingAddress: string = jsonResponse.inputs[0].addresses[0]; - const remoteHash: string = stripHashPrefix(lastOutput.script, BLOCKCHAINS.bitcoin.prefixes); - const revokedAddresses: string[] = outputs - .filter(output => !!output.spent_by) - .map(output => output.addresses[0]); - return { - remoteHash, - issuingAddress, - time, - revokedAddresses - }; -} - -const serviceURL: ExplorerURLs = { - main: `https://api.blockcypher.com/v1/btc/main/txs/${TRANSACTION_ID_PLACEHOLDER}?limit=500`, - test: `https://api.blockcypher.com/v1/btc/test3/txs/${TRANSACTION_ID_PLACEHOLDER}?limit=500` -}; - -export const explorerApi: ExplorerAPI = { - serviceURL, - serviceName: TRANSACTION_APIS.blockcypher, - parsingFunction, - priority: -1 -}; diff --git a/src/explorers/bitcoin/blockexplorer.ts b/src/explorers/bitcoin/blockexplorer.ts deleted file mode 100644 index 25facd7..0000000 --- a/src/explorers/bitcoin/blockexplorer.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { stripHashPrefix } from '../../utils/stripHashPrefix'; -import { timestampToDateObject } from '../../utils/date'; -import { ExplorerAPI, ExplorerURLs, IParsingFunctionAPI } from '../../models/Explorers'; -import { TransactionData } from '../../models/TransactionData'; -import { TRANSACTION_APIS, TRANSACTION_ID_PLACEHOLDER } from '../../constants/api'; -import { BLOCKCHAINS } from '../../constants/blockchains'; -import CONFIG from '../../constants/config'; - -// TODO: use tests/explorers/mocks/mockBlockexplorer as type -function parsingFunction ({ jsonResponse }: IParsingFunctionAPI): TransactionData { - if (jsonResponse.confirmations < CONFIG.MininumConfirmations) { - throw new Error('Number of transaction confirmations were less than the minimum required, according to Blockexplorer API'); - } - const time: Date = timestampToDateObject(jsonResponse.blocktime); - const outputs = jsonResponse.vout; - const lastOutput = outputs[outputs.length - 1]; - const issuingAddress: string = jsonResponse.vout[0].scriptPubKey.addresses[0]; - const remoteHash: string = stripHashPrefix(lastOutput.scriptPubKey.hex, BLOCKCHAINS.bitcoin.prefixes); - const revokedAddresses: string[] = outputs - .filter(output => !!output.spentTxId) - .map(output => output.scriptPubKey.addresses[0]); - return { - remoteHash, - issuingAddress, - time, - revokedAddresses - }; -} - -const serviceURL: ExplorerURLs = { - main: `https://blockexplorer.com/api/tx/${TRANSACTION_ID_PLACEHOLDER}`, - test: `https://testnet.blockexplorer.com/api/tx/${TRANSACTION_ID_PLACEHOLDER}` -}; - -export const explorerApi: ExplorerAPI = { - serviceURL, - serviceName: TRANSACTION_APIS.blockexplorer, - parsingFunction, - priority: -1 -}; diff --git a/src/explorers/bitcoin/blockstream.ts b/src/explorers/bitcoin/blockstream.ts deleted file mode 100644 index 74a00cf..0000000 --- a/src/explorers/bitcoin/blockstream.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { stripHashPrefix } from '../../utils/stripHashPrefix'; -import { timestampToDateObject } from '../../utils/date'; -import { ExplorerAPI, ExplorerURLs, IParsingFunctionAPI } from '../../models/Explorers'; -import { TransactionData } from '../../models/TransactionData'; -import { TRANSACTION_APIS, TRANSACTION_ID_PLACEHOLDER } from '../../constants/api'; -import { BLOCKCHAINS } from '../../constants/blockchains'; - -// TODO: use tests/explorers/mocks/mockBlockstreamResponse as type -function parsingFunction ({ jsonResponse }: IParsingFunctionAPI): TransactionData { - if (!jsonResponse.status.confirmed) { - throw new Error('Number of transaction confirmations were less than the minimum required, according to Blockstream API'); - } - const time: Date = timestampToDateObject(jsonResponse.status.block_time); - const outputs = jsonResponse.vout; - const lastOutput = outputs[outputs.length - 1]; - const issuingAddress: string = jsonResponse.vout[0].scriptpubkey_address; - const remoteHash: string = stripHashPrefix(lastOutput.scriptpubkey, BLOCKCHAINS.bitcoin.prefixes); - const revokedAddresses: string[] = outputs - .filter(output => !!output.scriptpubkey_address) - .map(output => output.scriptpubkey_address); - return { - remoteHash, - issuingAddress, - time, - revokedAddresses - }; -} - -const serviceURL: ExplorerURLs = { - main: `https://blockstream.info/api/tx/${TRANSACTION_ID_PLACEHOLDER}`, - test: `https://blockstream.info/testnet/api/tx/${TRANSACTION_ID_PLACEHOLDER}` -}; - -export const explorerApi: ExplorerAPI = { - serviceURL, - serviceName: TRANSACTION_APIS.blockstream, - parsingFunction, - priority: -1 -}; diff --git a/src/explorers/ethereum/blockcypher.ts b/src/explorers/ethereum/blockcypher.ts deleted file mode 100644 index 3798932..0000000 --- a/src/explorers/ethereum/blockcypher.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { stripHashPrefix } from '../../utils/stripHashPrefix'; -import { BLOCKCHAINS } from '../../constants/blockchains'; -import { TransactionData } from '../../models/TransactionData'; -import { TRANSACTION_APIS, TRANSACTION_ID_PLACEHOLDER } from '../../constants/api'; -import { ExplorerAPI, ExplorerURLs, IParsingFunctionAPI } from '../../models/Explorers'; -import CONFIG from '../../constants/config'; -import { dateToUnixTimestamp } from '../../utils/date'; -import { prependHashPrefix } from '../../utils/prependHashPrefix'; - -const serviceURL: ExplorerURLs = { - main: `https://api.blockcypher.com/v1/eth/main/txs/${TRANSACTION_ID_PLACEHOLDER}?limit=500`, - test: `https://api.blockcypher.com/v1/beth/test/txs/${TRANSACTION_ID_PLACEHOLDER}?limit=500` -}; - -// TODO: use tests/explorers/mocks/mockBlockcypherResponse as type -function parsingFunction ({ jsonResponse }: IParsingFunctionAPI): TransactionData { - if (jsonResponse.confirmations < CONFIG.MininumConfirmations) { - // TODO: not tested - throw new Error('Not enough'); - } - - const time = dateToUnixTimestamp(jsonResponse.received); - const outputs = jsonResponse.outputs; - const lastOutput = outputs[outputs.length - 1]; - let issuingAddress: string = jsonResponse.inputs[0].addresses[0]; - const remoteHash = stripHashPrefix(lastOutput.script, BLOCKCHAINS.ethmain.prefixes); - issuingAddress = prependHashPrefix(issuingAddress, BLOCKCHAINS.ethmain.prefixes); - const revokedAddresses = outputs - .filter(output => !!output.spent_by) - .map(output => output.addresses[0]); - return { - remoteHash, - issuingAddress, - time, - revokedAddresses - }; -} - -export const explorerApi: ExplorerAPI = { - serviceURL, - serviceName: TRANSACTION_APIS.blockcypher, - parsingFunction, - priority: -1 -}; diff --git a/src/explorers/ethereum/etherscan.ts b/src/explorers/ethereum/etherscan.ts deleted file mode 100644 index 546fedf..0000000 --- a/src/explorers/ethereum/etherscan.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { request } from '../../services/request'; -import { stripHashPrefix } from '../../utils/stripHashPrefix'; -import { buildTransactionServiceUrl } from '../../services/transaction-apis'; -import { BLOCKCHAINS, isTestChain, SupportedChains } from '../../constants/blockchains'; -import { TransactionData } from '../../models/TransactionData'; -import { TRANSACTION_APIS, TRANSACTION_ID_PLACEHOLDER } from '../../constants/api'; -import { ExplorerAPI, ExplorerURLs, IParsingFunctionAPI } from '../../models/Explorers'; -import CONFIG from '../../constants/config'; - -const MAIN_API_BASE_URL = 'https://api.etherscan.io/api?module=proxy'; -const TEST_API_BASE_URL = 'https://api-ropsten.etherscan.io/api?module=proxy'; -const serviceURL: ExplorerURLs = { - main: `${MAIN_API_BASE_URL}&action=eth_getTransactionByHash&txhash=${TRANSACTION_ID_PLACEHOLDER}`, - test: `${TEST_API_BASE_URL}&action=eth_getTransactionByHash&txhash=${TRANSACTION_ID_PLACEHOLDER}` -}; - -// TODO: use tests/explorers/mocks/mockEtherscanResponse as type -async function parsingFunction ({ jsonResponse, chain, key, keyPropertyName }: IParsingFunctionAPI): Promise { - const getBlockByNumberServiceUrls: Partial = { - serviceURL: { - main: `${MAIN_API_BASE_URL}&action=eth_getBlockByNumber&boolean=true&tag=${TRANSACTION_ID_PLACEHOLDER}`, - test: `${TEST_API_BASE_URL}&action=eth_getBlockByNumber&boolean=true&tag=${TRANSACTION_ID_PLACEHOLDER}` - } - }; - const getBlockNumberServiceUrls: Partial = { - serviceURL: { - main: `${MAIN_API_BASE_URL}&action=eth_blockNumber`, - test: `${TEST_API_BASE_URL}&action=eth_blockNumber` - } - }; - - function parseEtherScanResponse (jsonResponse, block): TransactionData { - const data = jsonResponse.result; - const time: Date = new Date(parseInt(block.timestamp, 16) * 1000); - const issuingAddress: string = data.from; - const remoteHash = stripHashPrefix(data.input, BLOCKCHAINS.ethmain.prefixes); // remove '0x' - - // The method of checking revocations by output spent do not work with Ethereum. - // There are no input/outputs, only balances. - return { - remoteHash, - issuingAddress, - time, - revokedAddresses: [] - }; - } - - async function getEtherScanBlock (jsonResponse, chain: SupportedChains): Promise { - const data = jsonResponse.result; - const blockNumber = data.blockNumber; - const requestUrl = buildTransactionServiceUrl({ - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - explorerAPI: { - ...getBlockByNumberServiceUrls, - key, - keyPropertyName - } as ExplorerAPI, - transactionId: blockNumber, - isTestApi: isTestChain(chain) - }); - - try { - const response = await request({ url: requestUrl }); - const responseData = JSON.parse(response); - const blockData = responseData.result; - - await checkEtherScanConfirmations(chain, blockNumber); - return blockData; - } catch (err) { - throw new Error('Unable to get remote hash'); - } - } - - async function checkEtherScanConfirmations (chain: SupportedChains, blockNumber: number): Promise { - const requestUrl: string = buildTransactionServiceUrl({ - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - explorerAPI: { - ...getBlockNumberServiceUrls, - key, - keyPropertyName - } as ExplorerAPI, - isTestApi: isTestChain(chain) - }); - - let response: string; - try { - response = await request({ url: requestUrl }); - } catch (err) { - // TODO: not tested? - throw new Error('Unable to get remote hash'); - } - - const responseData = JSON.parse(response); - const currentBlockCount: number = responseData.result; - - if (currentBlockCount - blockNumber < CONFIG.MininumConfirmations) { - // TODO: not tested - throw new Error('Not enough'); - } - return currentBlockCount; - } - - // Parse block to get timestamp first, then create TransactionData - const blockResponse = await getEtherScanBlock(jsonResponse, chain); - return parseEtherScanResponse(jsonResponse, blockResponse); -} - -export const explorerApi: ExplorerAPI = { - serviceURL, - serviceName: TRANSACTION_APIS.etherscan, - parsingFunction, - priority: -1 -}; diff --git a/src/explorers/explorer.ts b/src/explorers/explorer.ts deleted file mode 100644 index 85f4856..0000000 --- a/src/explorers/explorer.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { buildTransactionServiceUrl } from '../services/transaction-apis'; -import { request } from '../services/request'; -import { isTestChain, SupportedChains } from '../constants/blockchains'; -import { TransactionData } from '../models/TransactionData'; -import { ExplorerAPI, TExplorerFunctionsArray } from '../models/Explorers'; -import { explorerApi as EtherscanApi } from './ethereum/etherscan'; -import { explorerApi as BlockCypherETHApi } from './ethereum/blockcypher'; -import { explorerApi as BlockExplorerApi } from './bitcoin/blockexplorer'; -import { explorerApi as BlockstreamApi } from './bitcoin/blockstream'; -import { explorerApi as BlockCypherBTCApi } from './bitcoin/blockcypher'; -import { explorerApi as BitPayApi } from './bitcoin/bitpay'; - -export function explorerFactory (TransactionAPIArray: ExplorerAPI[]): TExplorerFunctionsArray { - return TransactionAPIArray - .map(explorerAPI => ( - { - getTxData: async (transactionId, chain) => await getTransactionFromApi(explorerAPI, transactionId, chain), - priority: explorerAPI.priority - } - )); -} - -export async function getTransactionFromApi ( - explorerAPI: ExplorerAPI, - transactionId: string, - chain: SupportedChains -): Promise { - const requestUrl = buildTransactionServiceUrl({ - explorerAPI, - transactionId, - isTestApi: isTestChain(chain) - }); - - try { - const response = await request({ url: requestUrl }); - return await explorerAPI.parsingFunction({ - jsonResponse: JSON.parse(response), - chain, - ...explorerAPI - }); - } catch (err) { - throw new Error('Unable to get remote hash'); - } -} - -const BitcoinTransactionAPIArray = [ - BlockCypherBTCApi, - BitPayApi, - BlockExplorerApi, - BlockstreamApi -]; - -const EthereumTransactionAPIArray = [ - EtherscanApi, - BlockCypherETHApi -]; - -const BlockchainExplorersWithSpentOutputInfo = [ - BlockCypherBTCApi -]; - -export { - BitcoinTransactionAPIArray, - EthereumTransactionAPIArray, - BlockchainExplorersWithSpentOutputInfo -}; diff --git a/src/explorers/index.ts b/src/explorers/index.ts deleted file mode 100644 index 0081cbe..0000000 --- a/src/explorers/index.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { - BitcoinTransactionAPIArray as BitcoinExplorers, - EthereumTransactionAPIArray as EthereumExplorers, - explorerFactory -} from './explorer'; -import { TRANSACTION_APIS } from '../constants/api'; -import { ExplorerAPI, TExplorerFunctionsArray } from '../models/Explorers'; -import { ethereumRPCParsingFunction } from './rpc/ethereum'; -import { bitcoinRPCParsingFunction } from './rpc/bitcoin'; - -export interface TDefaultExplorersPerBlockchain { - bitcoin: TExplorerFunctionsArray; - ethereum: TExplorerFunctionsArray; -} - -export type TExplorerAPIs = TDefaultExplorersPerBlockchain & { - custom?: TExplorerFunctionsArray; -}; - -function cleanupExplorerAPIs (explorerAPIs: ExplorerAPI[], indexes: number[]): void { - indexes.forEach(index => explorerAPIs.splice(index, 1)); // remove modified explorer to avoid setting them in the custom option later -} - -function validateOverwritingExplorer (explorerAPI: ExplorerAPI): boolean { - if (explorerAPI.key && !explorerAPI.keyPropertyName) { - throw new Error(`Property keyPropertyName is not set for ${explorerAPI.serviceName}. Cannot pass the key property to the service.`); - } - return true; -} - -const overwrittenIndexes: number[] = []; - -export function overwriteDefaultExplorers (explorerAPIs: ExplorerAPI[] = [], defaultExplorers: ExplorerAPI[] = [], lastSetOfExplorers = false): ExplorerAPI[] { - const userSetExplorerAPIsName = explorerAPIs - .map(explorerAPI => explorerAPI.serviceName) - .filter(name => !!name) - .filter(name => !!TRANSACTION_APIS[name]); - - if (userSetExplorerAPIsName.length) { - return defaultExplorers.reduce((overwrittenExplorers, defaultExplorerAPI) => { - if (userSetExplorerAPIsName.includes(defaultExplorerAPI.serviceName)) { - const immutableExplorerAPI = Object.assign({}, defaultExplorerAPI); - const customSetExplorerAPI = explorerAPIs.find(customExplorerAPI => customExplorerAPI.serviceName === defaultExplorerAPI.serviceName); - if (validateOverwritingExplorer(customSetExplorerAPI)) { - const overwrittenExplorerAPI = Object.assign(immutableExplorerAPI, customSetExplorerAPI); - overwrittenExplorers.push(overwrittenExplorerAPI); - const explorerAPIsIndex = explorerAPIs.findIndex(explorerAPI => explorerAPI.serviceName === overwrittenExplorerAPI.serviceName); - if (!overwrittenIndexes.includes(explorerAPIsIndex)) { - overwrittenIndexes.push(explorerAPIsIndex); - } - } - } else { - overwrittenExplorers.push(defaultExplorerAPI); - } - if (lastSetOfExplorers) { - cleanupExplorerAPIs(explorerAPIs, overwrittenIndexes); - } - return overwrittenExplorers; - }, []); - } - - return defaultExplorers; -} - -export function getDefaultExplorers (explorerAPIs?: ExplorerAPI[]): TDefaultExplorersPerBlockchain { - return { - bitcoin: explorerFactory(overwriteDefaultExplorers(explorerAPIs, BitcoinExplorers)), - ethereum: explorerFactory(overwriteDefaultExplorers(explorerAPIs, EthereumExplorers)) - }; -} - -function rpcFactory (explorerAPIs: ExplorerAPI[]): TExplorerFunctionsArray { - return explorerAPIs.map(explorerAPI => { - if (!explorerAPI.parsingFunction) { - explorerAPI.parsingFunction = explorerAPI.chainType === 'btc' ? bitcoinRPCParsingFunction : ethereumRPCParsingFunction; - } - return explorerAPI; - }).map(explorerAPI => ( - { - getTxData: async (transactionId) => await explorerAPI.parsingFunction({ - ...explorerAPI, - transactionId - }), - priority: explorerAPI.priority - } - )); -} - -export function getRPCExplorers (customExplorerAPIs?: ExplorerAPI[]): Partial { - return { - custom: rpcFactory(customExplorerAPIs) - }; -} - -export function prepareExplorerAPIs (customExplorerAPIs: ExplorerAPI[]): TExplorerAPIs { - const { bitcoin, ethereum } = getDefaultExplorers(customExplorerAPIs); - const { custom: rpcCustomExplorers } = getRPCExplorers(customExplorerAPIs.filter(e => e.apiType === 'rpc')); - const restCustomExplorers = explorerFactory(customExplorerAPIs.filter(e => e.apiType !== 'rpc')); - - return { - bitcoin, - ethereum, - custom: [ - ...rpcCustomExplorers, - ...restCustomExplorers - ] - }; -} diff --git a/src/explorers/rpc/bitcoin.ts b/src/explorers/rpc/bitcoin.ts deleted file mode 100644 index 0e448f9..0000000 --- a/src/explorers/rpc/bitcoin.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { TransactionData } from '../../models/TransactionData'; -import { stripHashPrefix } from '../../utils/stripHashPrefix'; -import { timestampToDateObject } from '../../utils/date'; -import { request } from '../../services/request'; -import { IParsingFunctionAPI } from '../../models/Explorers'; - -export async function bitcoinRPCParsingFunction ({ serviceUrl, transactionId }: IParsingFunctionAPI): Promise { - const getRawTransactionParams = { - method: 'getrawtransaction', - jsonrpc: '2.0', - id: 'rpctest', - params: [ - transactionId, - true - ] - }; - const resultRawTransaction = await request({ - url: serviceUrl, - body: getRawTransactionParams, - method: 'POST' - }); - - const transaction = JSON.parse(resultRawTransaction).result; - const issuingAddress = transaction.vout[0].scriptPubKey.addresses[0]; - const remoteHash = stripHashPrefix(transaction.vout[1].scriptPubKey.asm, ['6a20', 'OP_RETURN ']); - const time = timestampToDateObject(transaction.blocktime); - // after research, this only seems to be used in v1.2 of blockcerts. - const revokedAddresses = transaction.vout - .filter(output => !!output.scriptPubKey.addresses) - .map(output => output.scriptPubKey.addresses) - .flat(); - - return { - issuingAddress, - remoteHash, - time, - revokedAddresses - }; -} diff --git a/src/explorers/rpc/ethereum.ts b/src/explorers/rpc/ethereum.ts deleted file mode 100644 index d61366c..0000000 --- a/src/explorers/rpc/ethereum.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { TransactionData } from '../../models/TransactionData'; -import { stripHashPrefix } from '../../utils/stripHashPrefix'; -import { request } from '../../services/request'; -import { IParsingFunctionAPI } from '../../models/Explorers'; - -export async function ethereumRPCParsingFunction ({ serviceUrl, transactionId }: IParsingFunctionAPI): Promise { - const transactionByHashParams = { - method: 'eth_getTransactionByHash', - jsonrpc: '2.0', - id: 'getbyhash', - params: [ - '0x' + transactionId - ] - }; - const resultTransactionByHash = await request({ - url: serviceUrl, - body: transactionByHashParams, - method: 'POST' - }); - - const transactionByHash = JSON.parse(resultTransactionByHash); - - const blockByNumberParams = { - method: 'eth_getBlockByNumber', - jsonrpc: '2.0', - id: 'blockbynumber', - params: [ - transactionByHash.result.blockNumber, - true - ] - }; - const resultBlockByNumber = await request({ - url: serviceUrl, - body: blockByNumberParams, - method: 'POST' - }); - // check confirm validity see cvjs etherscan - - const block = JSON.parse(resultBlockByNumber); - - const txData = transactionByHash.result; - const blockData = block.result; - const time = new Date(parseInt(blockData.timestamp, 16) * 1000); - const issuingAddress = txData.from; - const remoteHash = stripHashPrefix(txData.input, ['0x']); // remove '0x' - - return { - remoteHash, - issuingAddress, - time, - revokedAddresses: [] - }; -} diff --git a/src/helpers/lookForTx.ts b/src/helpers/lookForTx.ts deleted file mode 100644 index 59ac547..0000000 --- a/src/helpers/lookForTx.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { SupportedChains, BLOCKCHAINS } from '../constants/blockchains'; -import CONFIG from '../constants/config'; -import PromiseProperRace from './promiseProperRace'; -import { TransactionData } from '../models/TransactionData'; -import { TExplorerAPIs } from '../explorers'; -import { TExplorerFunctionsArray } from '../models/Explorers'; - -export function getExplorersByChain (chain: SupportedChains, explorerAPIs: TExplorerAPIs): TExplorerFunctionsArray { - switch (chain) { - case BLOCKCHAINS[SupportedChains.Bitcoin].code: - case BLOCKCHAINS[SupportedChains.Regtest].code: - case BLOCKCHAINS[SupportedChains.Testnet].code: - case BLOCKCHAINS[SupportedChains.Mocknet].code: - return explorerAPIs.bitcoin; - case BLOCKCHAINS[SupportedChains.Ethmain].code: - case BLOCKCHAINS[SupportedChains.Ethropst].code: - case BLOCKCHAINS[SupportedChains.Ethrinkeby].code: - return explorerAPIs.ethereum; - default: - if (!explorerAPIs.custom?.length) { - throw new Error('Chain is not natively supported. Use custom explorers to retrieve tx data.'); - } - return explorerAPIs.custom; - } -} - -// eslint-disable-next-line @typescript-eslint/promise-function-async -async function runPromiseRace (promises): Promise { - let winners; - try { - winners = await PromiseProperRace(promises, CONFIG.MinimumBlockchainExplorers); - } catch (err) { - throw new Error(`Transaction lookup error: ${err.message as string}`); - } - - if (!winners || winners.length === 0) { - // eslint-disable-next-line @typescript-eslint/return-await - throw new Error('Could not confirm transaction data.'); - } - - const firstResponse = winners[0]; - for (let i = 1; i < winners.length; i++) { - const thisResponse = winners[i]; - if (firstResponse.issuingAddress !== thisResponse.issuingAddress) { - throw new Error('Issuing addresses do not match consistently'); - } - if (firstResponse.remoteHash !== thisResponse.remoteHash) { - throw new Error('Remote hashes do not match consistently'); - } - } - return firstResponse; -} - -type PromiseRaceQueue = TExplorerFunctionsArray[]; - -function buildQueuePromises (queue, transactionId, chain): any[] { - if (CONFIG.MinimumBlockchainExplorers < 0 || CONFIG.MinimumBlockchainExplorers > queue.length) { - throw new Error('Invalid application configuration; check the CONFIG.MinimumBlockchainExplorers configuration value'); - } - - const promises: any[] = []; - const limit: number = CONFIG.Race ? queue.length : CONFIG.MinimumBlockchainExplorers; - for (let i = 0; i < limit; i++) { - promises.push(queue[i].getTxData(transactionId, chain)); - } - - return promises; -} - -function buildPromiseRacesQueue ( - { defaultAPIs, customAPIs }: - { defaultAPIs: TExplorerFunctionsArray; customAPIs: TExplorerFunctionsArray } -): PromiseRaceQueue { - const promiseRaceQueue = [defaultAPIs]; - - if (customAPIs?.length) { - const priority: number = customAPIs[0].priority; - promiseRaceQueue.splice(priority, 0, customAPIs); - } - - const apisCount: number = defaultAPIs.concat(customAPIs).length; - if (CONFIG.MinimumBlockchainExplorers < 0 || CONFIG.MinimumBlockchainExplorers > apisCount) { - throw new Error('Invalid application configuration; check the CONFIG.MinimumBlockchainExplorers configuration value'); - } - - return promiseRaceQueue; -} - -async function runQueueByIndex (queues, index: number, transactionId, chain): Promise { - try { - const race = buildQueuePromises(queues[index], transactionId, chain); - return await runPromiseRace(race); - } catch (err) { - if (index < queues.length - 1) { - index++; - return await runQueueByIndex(queues, index, transactionId, chain); - } - throw err; - } -} - -export default async function lookForTx ( - { transactionId, chain, explorerAPIs }: - { transactionId: string; chain: SupportedChains; explorerAPIs: TExplorerAPIs } -): Promise { - // Build explorers queue ordered by priority - const lookupQueues = buildPromiseRacesQueue({ - defaultAPIs: getExplorersByChain(chain, explorerAPIs), - customAPIs: explorerAPIs.custom - }); - - // Run queue - const currentQueueProcessedIndex = 0; - return await runQueueByIndex(lookupQueues, currentQueueProcessedIndex, transactionId, chain); -} diff --git a/src/helpers/promiseProperRace.ts b/src/helpers/promiseProperRace.ts deleted file mode 100644 index c043719..0000000 --- a/src/helpers/promiseProperRace.ts +++ /dev/null @@ -1,28 +0,0 @@ -// TODO: not tested -/* eslint-disable */ // this file is just a pain in the ass to lint. Be brave. -export default async function PromiseProperRace (promises: Array>, count: number, results = []): Promise { - // Source: https://blog.jcore.com/2016/12/18/promise-me-you-wont-use-promise-race/ - promises = Array.from(promises); - - if (promises.length < count) { - throw new Error('Could not retrieve tx data'); - } - - const indexPromises = promises.map((p, index) => p.then(() => index).catch((err) => { - // console.error(err); - throw index; - })); - - return Promise.race(indexPromises).then((index: number) => { - const p = promises.splice(index, 1)[0]; - p.then(e => results.push(e)); - - if (count === 1) { - return results; - } - return PromiseProperRace(promises, count - 1, results); - }).catch(index => { - promises.splice(index, 1); - return PromiseProperRace(promises, count, results); - }); -} diff --git a/src/inspectors/computeLocalHash.ts b/src/inspectors/computeLocalHash.ts index 24de940..b1cda85 100644 --- a/src/inspectors/computeLocalHash.ts +++ b/src/inspectors/computeLocalHash.ts @@ -7,7 +7,8 @@ const { blockcertsV3: BLOCKCERTSV3_CONTEXT, verifiableCredential: VERIFIABLE_CREDENTIAL_CONTEXT, verifiableCredentialExample: VERIFIABLE_CREDENTIAL_EXAMPLE, - merkleProof2019: MERKLE_PROOF_2019 + merkleProof2019: MERKLE_PROOF_2019, + odrl: OPEN_DIGITALS_RIGHTS_LANGUAGE } = ContextsMap; const CONTEXTS = {}; @@ -17,6 +18,7 @@ CONTEXTS['https://www.w3.org/2018/credentials/v1'] = VERIFIABLE_CREDENTIAL_CONTE CONTEXTS['https://www.w3.org/2018/credentials/examples/v1'] = VERIFIABLE_CREDENTIAL_EXAMPLE; CONTEXTS['https://www.w3id.org/blockcerts/schema/3.0-alpha/merkleProof2019Context.json'] = MERKLE_PROOF_2019; CONTEXTS['https://www.blockcerts.org/schema/3.0-alpha/merkleProof2019Context.json'] = MERKLE_PROOF_2019; +CONTEXTS['https://www.w3.org/ns/odrl.jsonld'] = OPEN_DIGITALS_RIGHTS_LANGUAGE; function setJsonLdDocumentLoader (): any { // not typed by jsonld if (typeof window !== 'undefined' && typeof window.XMLHttpRequest !== 'undefined') { diff --git a/src/models/Explorers.ts b/src/models/Explorers.ts index 2545b7d..1240403 100644 --- a/src/models/Explorers.ts +++ b/src/models/Explorers.ts @@ -6,11 +6,6 @@ export interface ExplorerURLs { main: string; test: string; } - -export type TExplorerFunctionsArray = Array<{ - getTxData: (transactionId: string, chain?: SupportedChains) => Promise; - priority?: number; -}>; export interface IParsingFunctionAPI { jsonResponse?: any; // the response from the service when called as rest chain?: SupportedChains; // TODO: look at how to deprecate this. Only used in etherscan diff --git a/src/services/request.ts b/src/services/request.ts deleted file mode 100644 index 8f808a7..0000000 --- a/src/services/request.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { XMLHttpRequest as xhrPolyfill } from 'xmlhttprequest'; - -export interface RequestParameters { - url: string; - method?: 'GET' | 'POST'; - body?: any; -} - -// TODO: not tested -export async function request (obj: RequestParameters): Promise { - return await new Promise((resolve, reject) => { - const url = obj.url; - - if (!url) { - reject(new Error('URL is missing')); - } - - // server - const XHR = typeof XMLHttpRequest === 'undefined' ? xhrPolyfill : XMLHttpRequest; - const request: XMLHttpRequest = new XHR(); - - request.onload = () => { - if (request.status >= 200 && request.status < 300) { - resolve(request.responseText); - } else { - console.log(request.responseText); - const failureMessage: string = `Error fetching url:${url}; status code:${request.status}`; - reject(new Error(failureMessage)); - } - }; - - request.ontimeout = (e) => { - console.log('ontimeout', e); - }; - - request.onreadystatechange = () => { - if (request.status === 404) { - reject(new Error(`Error fetching url:${url}; status code:${request.status}`)); - } - }; - - request.onerror = () => { - console.error(`Request failed with error ${request.responseText}`); - reject(new Error(request.responseText)); - }; - - request.open(obj.method || 'GET', url); - - if (obj.body) { - request.send(JSON.stringify(obj.body)); - } else { - request.send(); - } - }); -} diff --git a/src/services/transaction-apis.ts b/src/services/transaction-apis.ts deleted file mode 100644 index a5ba95e..0000000 --- a/src/services/transaction-apis.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { ExplorerAPI } from '../models/Explorers'; -import { TRANSACTION_ID_PLACEHOLDER } from '../constants/api'; -import { safelyAppendUrlParameter } from '../utils/url'; - -function appendApiIdentifier (url: string, explorerAPI: ExplorerAPI): string { - if (!explorerAPI.key) { - return url; - } - - if (explorerAPI.key && !explorerAPI.keyPropertyName) { - throw new Error(`No keyPropertyName defined for explorerAPI ${explorerAPI.serviceName}`); - } - - return safelyAppendUrlParameter(url, explorerAPI.keyPropertyName, explorerAPI.key); -} - -export function buildTransactionServiceUrl ({ - explorerAPI, - transactionIdPlaceholder = TRANSACTION_ID_PLACEHOLDER, - transactionId = '', - isTestApi = false -}: { - explorerAPI: ExplorerAPI; - transactionIdPlaceholder?: string; - transactionId?: string; - isTestApi?: boolean; -}): string { - const { serviceURL } = explorerAPI; - let apiUrl = typeof serviceURL === 'string' ? serviceURL : (isTestApi ? serviceURL.test : serviceURL.main); - apiUrl = apiUrl.replace(transactionIdPlaceholder, transactionId); - apiUrl = appendApiIdentifier(apiUrl, explorerAPI); - return apiUrl; -} diff --git a/src/utils/date.ts b/src/utils/date.ts index 16312bf..914e75e 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -19,7 +19,7 @@ function dateFromRegex (s: string): Date { let day; let tz; const rx = /^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*)?)([zZ]|([+\-])(\d\d):?(\d\d))?$/; - const p = rx.exec(s) || []; + const p = rx.exec(s) ?? []; if (p[1]) { day = p[1].split(/\D/).map(function (itm) { return parseInt(itm, 10) || 0; diff --git a/tests/MerkleProof2019.test.ts b/tests/MerkleProof2019.test.ts index ced5f0e..2fc0722 100644 --- a/tests/MerkleProof2019.test.ts +++ b/tests/MerkleProof2019.test.ts @@ -1,9 +1,9 @@ import sinon from 'sinon'; +import * as explorerLookup from '@blockcerts/explorer-lookup'; import { MerkleProof2019, MerkleProof2019Options, MerkleProof2019VerificationResult } from '../src/MerkleProof2019'; import decodedProof, { assertionTransactionId } from './assertions/proof'; import { TransactionData } from '../src/models/TransactionData'; import { BLOCKCHAINS } from '../src/constants/blockchains'; -import * as lookForTxFunctions from '../src/helpers/lookForTx'; import blockcertsV3Fixture, { documentHash } from './fixtures/blockcerts-v3'; import fixtureTransactionData from './fixtures/transactionData'; @@ -78,7 +78,7 @@ describe('MerkleProof2019 test suite', function () { let result: MerkleProof2019VerificationResult; beforeEach(async function () { - sinon.stub(lookForTxFunctions, 'default').resolves(fixtureTransactionData); + sinon.stub(explorerLookup, 'lookForTx').resolves(fixtureTransactionData); result = await instance.verifyProof(); }); diff --git a/tests/explorers/bitcoin/bitpay.test.ts b/tests/explorers/bitcoin/bitpay.test.ts deleted file mode 100644 index c20f65b..0000000 --- a/tests/explorers/bitcoin/bitpay.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import * as mockBitpayResponse from '../mocks/mockBitpayResponse.json'; -import { explorerApi } from '../../../src/explorers/bitcoin/bitpay'; - -function getMockBitpayResponse (): typeof mockBitpayResponse { - return JSON.parse(JSON.stringify(mockBitpayResponse)); -} - -describe('Bitpay Explorer test suite', function () { - let mockResponse; - - beforeEach(function () { - mockResponse = getMockBitpayResponse(); - }); - - describe('given the transaction has enough confirmations', function () { - const assertionTransactionData = { - issuingAddress: '1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo', - remoteHash: 'b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8', - revokedAddresses: ['1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo'], - time: new Date(1518049414 * 1000) - }; - - it('should return the transaction data', function () { - expect(explorerApi.parsingFunction({ jsonResponse: mockResponse })).toEqual(assertionTransactionData); - }); - }); - - describe('given the transaction does not have enough confirmations yet', function () { - it('should throw the right error', async function () { - mockResponse.confirmations = 0; - await expect(async () => { - await explorerApi.parsingFunction({ jsonResponse: mockResponse }); - }).rejects.toThrowError('Number of transaction confirmations were less than the minimum required, according to Bitpay API'); - }); - }); -}); diff --git a/tests/explorers/bitcoin/blockcypher.test.ts b/tests/explorers/bitcoin/blockcypher.test.ts deleted file mode 100644 index a169eb0..0000000 --- a/tests/explorers/bitcoin/blockcypher.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import * as mockBlockcypherResponse from '../mocks/mockBlockcypherResponse.json'; -import { explorerApi } from '../../../src/explorers/bitcoin/blockcypher'; - -function getMockBlockcypherResponse (): typeof mockBlockcypherResponse { - return JSON.parse(JSON.stringify(mockBlockcypherResponse)); -} - -describe('Blockcypher Bitcoin Explorer test suite', function () { - let mockResponse; - - beforeEach(function () { - mockResponse = getMockBlockcypherResponse(); - }); - - describe('given the transaction has enough confirmations', function () { - const assertionTransactionData = { - issuingAddress: '1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo', - remoteHash: 'b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8', - revokedAddresses: ['1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo'], - time: new Date('2018-02-08T00:23:03.358Z') - }; - - it('should return the transaction data', function () { - expect(explorerApi.parsingFunction({ jsonResponse: mockResponse })).toEqual(assertionTransactionData); - }); - }); - - describe('given the transaction does not have enough confirmations yet', function () { - it('should throw the right error', async function () { - mockResponse.confirmations = 0; - await expect(async () => { - await explorerApi.parsingFunction({ jsonResponse: mockResponse }); - }).rejects.toThrowError('Number of transaction confirmations were less than the minimum required, according to Blockcypher API'); - }); - }); -}); diff --git a/tests/explorers/bitcoin/blockexplorer.test.ts b/tests/explorers/bitcoin/blockexplorer.test.ts deleted file mode 100644 index fb3efb8..0000000 --- a/tests/explorers/bitcoin/blockexplorer.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import * as mockBlockexplorerResponse from '../mocks/mockBlockexplorerResponse.json'; -import { explorerApi } from '../../../src/explorers/bitcoin/blockexplorer'; - -function getMockBlockexplorerResponse (): typeof mockBlockexplorerResponse { - return JSON.parse(JSON.stringify(mockBlockexplorerResponse)); -} - -describe('Blockexplorer Explorer test suite', function () { - let mockResponse; - - beforeEach(function () { - mockResponse = getMockBlockexplorerResponse(); - }); - - describe('given the transaction has enough confirmations', function () { - const assertionTransactionData = { - issuingAddress: '1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo', - remoteHash: 'b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8', - revokedAddresses: ['1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo'], - time: new Date(1518049414 * 1000) - }; - - it('should return the transaction data', function () { - expect(explorerApi.parsingFunction({ jsonResponse: mockResponse })).toEqual(assertionTransactionData); - }); - }); - - describe('given the transaction does not have enough confirmations yet', function () { - it('should throw the right error', async function () { - mockResponse.confirmations = 0; - await expect(async () => { - await explorerApi.parsingFunction({ jsonResponse: mockResponse }); - }).rejects.toThrowError('Number of transaction confirmations were less than the minimum required, according to Blockexplorer API'); - }); - }); -}); diff --git a/tests/explorers/bitcoin/blockstream.test.ts b/tests/explorers/bitcoin/blockstream.test.ts deleted file mode 100644 index 56dc8ba..0000000 --- a/tests/explorers/bitcoin/blockstream.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import * as mockBlockstreamResponse from '../mocks/mockBlockstreamResponse.json'; -import { explorerApi } from '../../../src/explorers/bitcoin/blockstream'; - -function getMockBlockstreamResponse (): typeof mockBlockstreamResponse { - return JSON.parse(JSON.stringify(mockBlockstreamResponse)); -} - -describe('Blockstream Explorer test suite', function () { - let mockResponse; - - beforeEach(function () { - mockResponse = getMockBlockstreamResponse(); - }); - - describe('given the transaction has enough confirmations', function () { - const assertionTransactionData = { - issuingAddress: '1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo', - remoteHash: 'b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8', - revokedAddresses: ['1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo'], - time: new Date(1518049414 * 1000) - }; - - it('should return the transaction data', function () { - expect(explorerApi.parsingFunction({ jsonResponse: mockResponse })).toEqual(assertionTransactionData); - }); - }); - - describe('given the transaction does not have enough confirmations yet', function () { - it('should throw the right error', async function () { - mockResponse.status.confirmed = false; - await expect(async () => { - await explorerApi.parsingFunction({ jsonResponse: mockResponse }); - }).rejects.toThrowError('Number of transaction confirmations were less than the minimum required, according to Blockstream API'); - }); - }); -}); diff --git a/tests/explorers/ethereum/blockcypher.test.ts b/tests/explorers/ethereum/blockcypher.test.ts deleted file mode 100644 index fabeec9..0000000 --- a/tests/explorers/ethereum/blockcypher.test.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { TransactionData } from '../../../src/models/TransactionData'; -import { explorerApi as BlockcyperETHApi } from '../../../src/explorers/ethereum/blockcypher'; - -const responseData = { - block_hash: '43bc69984a1ef0b160eeb5bc9cbda4d6ea7cdc01645300c50f398f234acfb3ae', - block_height: 5715803, - block_index: 14, - hash: 'a12c498c8fcf59ee2fe785c94c38be4797fb027e6450439a7ef30ad61d7616d3', - addresses: [ - '3d995ef85a8d1bcbed78182ab225b9f88dc8937c', - 'deaddeaddeaddeaddeaddeaddeaddeaddeaddead' - ], - total: 0, - fees: 463520000000000, - size: 134, - gas_limit: 25000, - gas_used: 23176, - gas_price: 20000000000, - confirmed: '2018-06-01T20:47:55Z', - received: '2018-06-01T20:47:55Z', - ver: 0, - double_spend: false, - vin_sz: 1, - vout_sz: 1, - confirmations: 4348656, - confidence: 1, - inputs: [ - { - sequence: 2, - addresses: [ - '3d995ef85a8d1bcbed78182ab225b9f88dc8937c' - ] - } - ], - outputs: [ - { - value: 0, - script: 'ec049a808a09f3e8e257401e0898aa3d32a733706fd7d16aacf0ba95f7b42c0c', - addresses: [ - 'deaddeaddeaddeaddeaddeaddeaddeaddeaddead' - ] - } - ] -}; - -describe('Blockcypher Ethereum explorer test suite', function () { - describe('given it is called with response data from the API', function () { - it('should return the correct TransactionData', async function () { - const expectedOutput: TransactionData = { - revokedAddresses: [], - remoteHash: 'ec049a808a09f3e8e257401e0898aa3d32a733706fd7d16aacf0ba95f7b42c0c', - issuingAddress: '0x3d995ef85a8d1bcbed78182ab225b9f88dc8937c', - time: new Date('2018-06-01T20:47:55.000Z') - }; - - const output: TransactionData = await BlockcyperETHApi.parsingFunction({ jsonResponse: responseData }); - - expect(output).toEqual(expectedOutput); - }); - }); -}); diff --git a/tests/explorers/ethereum/etherscan.test.ts b/tests/explorers/ethereum/etherscan.test.ts deleted file mode 100644 index f5eaa0b..0000000 --- a/tests/explorers/ethereum/etherscan.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import sinon from 'sinon'; -import * as mockEtherscanResponse from '../mocks/mockEtherscanResponse.json'; -import { explorerApi } from '../../../src/explorers/ethereum/etherscan'; -import * as RequestServices from '../../../src/services/request'; -import { TransactionData } from '../../../src/models/TransactionData'; - -function getMockEtherscanResponse (): typeof mockEtherscanResponse { - return JSON.parse(JSON.stringify(mockEtherscanResponse)); -} - -describe('Etherscan Explorer test suite', function () { - let mockResponse; - - beforeEach(function () { - mockResponse = getMockEtherscanResponse(); - }); - - describe('parsingFunction method', function () { - it('should return the transaction data', async function () { - const assertionTransactionData: TransactionData = { - issuingAddress: '0x3d995ef85a8d1bcbed78182ab225b9f88dc8937c', - remoteHash: 'ec049a808a09f3e8e257401e0898aa3d32a733706fd7d16aacf0ba95f7b42c0c', - revokedAddresses: [], - time: new Date('2019-06-02T08:38:26.000Z') - }; - - const res = await explorerApi.parsingFunction({ jsonResponse: mockResponse }); - expect(res).toEqual(assertionTransactionData); - }); - - describe('given the ether scan block cannot get retrieved', function () { - it('should throw the right error', async function () { - const stubRequest = sinon.stub(RequestServices, 'request').rejects(); - await expect(explorerApi.parsingFunction({ jsonResponse: mockResponse })) - .rejects.toThrow('Unable to get remote hash'); - stubRequest.restore(); - }); - }); - }); -}); diff --git a/tests/explorers/explorer.test.ts b/tests/explorers/explorer.test.ts deleted file mode 100644 index c8d2001..0000000 --- a/tests/explorers/explorer.test.ts +++ /dev/null @@ -1,294 +0,0 @@ -import sinon from 'sinon'; -import * as RequestService from '../../src/services/request'; -import { explorerApi as BitpayAPI } from '../../src/explorers/bitcoin/bitpay'; -import { explorerApi as BlockcypherAPI } from '../../src/explorers/bitcoin/blockcypher'; -import * as mockBitpayResponse from './mocks/mockBitpayResponse.json'; -import { explorerFactory, getTransactionFromApi } from '../../src/explorers/explorer'; -import { TRANSACTION_APIS } from '../../src/constants/api'; -import { BLOCKCHAINS } from '../../src/constants/blockchains'; -import { ExplorerAPI } from '../../src/models/Explorers'; -import { - getDefaultExplorers, - getRPCExplorers, - overwriteDefaultExplorers, - prepareExplorerAPIs, - TExplorerAPIs -} from '../../src/explorers'; -import * as ethRPCExplorer from '../../src/explorers/rpc/ethereum'; -import * as btcRPCExplorer from '../../src/explorers/rpc/bitcoin'; -import { TransactionData } from '../../src/models/TransactionData'; - -describe('Blockchain Explorers test suite', function () { - const fixtureTransactionId = '2378076e8e140012814e98a2b2cb1af07ec760b239c1d6d93ba54d658a010ecd'; - const assertionRequestUrl = `https://insight.bitpay.com/api/tx/${fixtureTransactionId}`; - let stubRequest; - const assertionResponse = { - issuingAddress: '1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo', - remoteHash: 'b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8', - revokedAddresses: ['1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo'], - time: new Date(1518049414 * 1000) - }; - - beforeEach(function () { - stubRequest = sinon.stub(RequestService, 'request').resolves(JSON.stringify(mockBitpayResponse)); - }); - - afterEach(function () { - stubRequest.restore(); - }); - - describe('getTransactionFromApi method', function () { - it('should call the right request API', async function () { - await getTransactionFromApi(BitpayAPI, fixtureTransactionId, BLOCKCHAINS.bitcoin.code); - expect(stubRequest.getCall(0).args).toEqual([{ url: assertionRequestUrl }]); - }); - - describe('given the API request failed', function () { - it('should throw the right error', async function () { - const fixtureError = new Error('Unable to get remote hash'); - stubRequest.rejects(fixtureError); - await expect(getTransactionFromApi(BitpayAPI, fixtureTransactionId, BLOCKCHAINS.bitcoin.code)) - .rejects.toThrow('Unable to get remote hash'); - }); - }); - - describe('given the request is successful', function () { - describe('and the transaction data is generated from the response', function () { - it('should return a correct transaction data', async function () { - const res = await getTransactionFromApi(BitpayAPI, fixtureTransactionId, BLOCKCHAINS.bitcoin.code); - expect(res).toEqual(assertionResponse); - }); - }); - }); - }); - - describe('overwriteDefaultExplorers method', function () { - describe('given it was passed a default explorer match', function () { - it('should overwrite the data of that default explorer', function () { - const fixtureExplorer: ExplorerAPI = { - serviceName: TRANSACTION_APIS.bitpay, - key: 'a-custom-key', - keyPropertyName: 'apiKey' - }; - - const mockDefaultExplorer: ExplorerAPI = Object.assign({}, BitpayAPI); - - const output = overwriteDefaultExplorers([fixtureExplorer], [mockDefaultExplorer, BlockcypherAPI]); - expect(output.find(explorerAPI => explorerAPI.serviceName === fixtureExplorer.serviceName).key) - .toBe(fixtureExplorer.key); - }); - - it('should return the list of default explorers with the one modified', function () { - const fixtureExplorer: ExplorerAPI = { - serviceName: TRANSACTION_APIS.bitpay, - key: 'a-custom-key', - keyPropertyName: 'apiKey' - }; - - const mockDefaultExplorer: ExplorerAPI = Object.assign({}, BitpayAPI); - - const output = overwriteDefaultExplorers([fixtureExplorer], [mockDefaultExplorer, BlockcypherAPI]); - const expectedOutput = [Object.assign(mockDefaultExplorer, fixtureExplorer), BlockcypherAPI]; - expect(output).toEqual(expectedOutput); - }); - - describe('and the explorer overwrite is malformed', function () { - describe('when a key is set but no keyPropertyName', function () { - it('should throw an error', function () { - const fixtureExplorer: ExplorerAPI = { - serviceName: TRANSACTION_APIS.bitpay, - key: 'a-custom-key' - }; - - expect(() => { - overwriteDefaultExplorers([fixtureExplorer], [BitpayAPI, BlockcypherAPI]); - }).toThrow('Property keyPropertyName is not set for bitpay. Cannot pass the key property to the service.'); - }); - }); - }); - }); - - describe('given it was passed no default explorer match', function () { - it('should return the list of default explorers as expected', function () { - const fixtureExplorer: ExplorerAPI = { - serviceURL: 'https//another-service.com/api', - key: 'a-custom-key', - keyPropertyName: 'apiKey' - }; - - const output = overwriteDefaultExplorers([fixtureExplorer], [BitpayAPI, BlockcypherAPI]); - const expectedOutput = [BitpayAPI, BlockcypherAPI]; - expect(output).toEqual(expectedOutput); - }); - }); - }); - - describe('getDefaultExplorers method', function () { - // This is hard to test from a data point of view since we are wrapping the explorers - it('should wrap the explorers and expose the getTxData method', function () { - const output = getDefaultExplorers(); - expect(output.bitcoin[0].getTxData).toBeDefined(); - }); - - it('should return the default explorers for bitcoin', function () { - const output = getDefaultExplorers(); - expect(output.bitcoin.length).toBe(4); - }); - - it('should return the default explorers for ethereum', function () { - const output = getDefaultExplorers(); - expect(output.ethereum.length).toBe(2); - }); - - describe('when it is called with custom explorers', function () { - describe('and one of the custom explorers matches one of the default explorers', function () { - it('should return the same expected amount of default explorers', function () { - const fixtureExplorer: ExplorerAPI = { - serviceName: TRANSACTION_APIS.bitpay, - key: 'a-custom-key', - keyPropertyName: 'apiKey' - }; - const output = getDefaultExplorers([fixtureExplorer]); - expect(output.bitcoin.length).toBe(4); - expect(output.ethereum.length).toBe(2); - }); - }); - - describe('and none of the custom explorers matches the default explorers', function () { - it('should return the same expected amount of default explorers', function () { - const fixtureExplorer: ExplorerAPI = { - serviceURL: 'https//another-service.com/api', - key: 'a-custom-key', - keyPropertyName: 'apiKey' - }; - const output = getDefaultExplorers([fixtureExplorer]); - expect(output.bitcoin.length).toBe(4); - expect(output.ethereum.length).toBe(2); - }); - }); - }); - }); - - describe('getRPCExplorers method', function () { - describe('given it is called with an eth custom explorer', function () { - it('should assign the ethereumRPCParsing function to retrieve the data', async function () { - const fixtureExplorer: ExplorerAPI = { - serviceURL: 'a-rpc-server.com', - chainType: 'eth', - priority: 0 - }; - - const rpcFunctionName = 'ethereumRPCParsingFunction'; - sinon.stub(ethRPCExplorer, rpcFunctionName).resolves(`${rpcFunctionName} was called` as any); - - const explorers = getRPCExplorers([fixtureExplorer]); - const testOutput = await explorers.custom[0].getTxData('test'); - expect(testOutput).toBe(`${rpcFunctionName} was called`); - sinon.restore(); - }); - }); - - describe('given it is called with an evm custom explorer', function () { - it('should assign the ethereumRPCParsing function to retrieve the data', async function () { - const fixtureExplorer: ExplorerAPI = { - serviceURL: 'a-rpc-server.com', - chainType: 'evm', - priority: 0 - }; - - const rpcFunctionName = 'ethereumRPCParsingFunction'; - sinon.stub(ethRPCExplorer, rpcFunctionName).resolves(`${rpcFunctionName} was called` as any); - - const explorers = getRPCExplorers([fixtureExplorer]); - const testOutput = await explorers.custom[0].getTxData('test'); - expect(testOutput).toBe(`${rpcFunctionName} was called`); - sinon.restore(); - }); - }); - - describe('given it is called with a btc custom explorer', function () { - it('should assign the bitcoinRPCParsingFunction to retrieve the data', async function () { - const fixtureExplorer: ExplorerAPI = { - serviceURL: 'a-rpc-server.com', - chainType: 'btc', - priority: 0 - }; - - const rpcFunctionName = 'bitcoinRPCParsingFunction'; - sinon.stub(btcRPCExplorer, rpcFunctionName).resolves(`${rpcFunctionName} was called` as any); - - const explorers = getRPCExplorers([fixtureExplorer]); - const testOutput = await explorers.custom[0].getTxData('test', '' as any); - expect(testOutput).toBe(`${rpcFunctionName} was called`); - sinon.restore(); - }); - }); - - describe('given the chain type is not provided', function () { - it('should assign the ethereumRPCParsingFunction to retrieve the data', async function () { - const fixtureExplorer: ExplorerAPI = { - serviceURL: 'a-rpc-server.com', - priority: 0 - }; - - const rpcFunctionName = 'ethereumRPCParsingFunction'; - sinon.stub(ethRPCExplorer, rpcFunctionName).resolves(`${rpcFunctionName} was called` as any); - - const explorers = getRPCExplorers([fixtureExplorer]); - const testOutput = await explorers.custom[0].getTxData('test'); - expect(testOutput).toBe(`${rpcFunctionName} was called`); - sinon.restore(); - }); - }); - - describe('given the parsing function is provided', function () { - it('should use the provided function to retrieve the data', async function () { - const fixtureExplorer: ExplorerAPI = { - serviceURL: 'a-rpc-server.com', - priority: 0, - parsingFunction: () => 'custom function was called' as any - }; - - const rpcFunctionName = 'ethereumRPCParsingFunction'; - sinon.stub(ethRPCExplorer, rpcFunctionName).resolves(`${rpcFunctionName} was called` as any); - - const explorers = getRPCExplorers([fixtureExplorer]); - const testOutput = await explorers.custom[0].getTxData('test'); - expect(testOutput).toBe('custom function was called'); - sinon.restore(); - }); - }); - }); - - describe('prepareExplorerAPIs function', function () { - describe('given custom explorers are provided', function () { - it('should return the explorers object with the custom explorers', function () { - const fixtureCustomExplorerAPI: ExplorerAPI[] = [{ - serviceURL: 'https://explorer-example.com', - priority: 0, - parsingFunction: (): TransactionData => { - return { - remoteHash: 'a', - issuingAddress: 'b', - time: 'c', - revokedAddresses: ['d'] - }; - } - }]; - const expectedExplorers: TExplorerAPIs = getDefaultExplorers(); - expectedExplorers.custom = explorerFactory(fixtureCustomExplorerAPI); - const output = prepareExplorerAPIs(fixtureCustomExplorerAPI); - expect(JSON.stringify(output)).toEqual(JSON.stringify(expectedExplorers)); - }); - }); - - describe('given no explorers are provided', function () { - it('should return only the default explorers', function () { - const expectedExplorers: TExplorerAPIs = getDefaultExplorers(); - expectedExplorers.custom = []; - const output = prepareExplorerAPIs([]); - expect(JSON.stringify(output)).toEqual(JSON.stringify(expectedExplorers)); - }); - }); - }); -}); diff --git a/tests/explorers/mocks/mockBitcoinchainResponse.json b/tests/explorers/mocks/mockBitcoinchainResponse.json deleted file mode 100644 index 464b876..0000000 --- a/tests/explorers/mocks/mockBitcoinchainResponse.json +++ /dev/null @@ -1,71 +0,0 @@ -[ - { - "block_time": 1518049414, - "blocks": [ - "000000000000000000360a1b3ac336db50f632f3d5f448f62a62f31da82fb59b" - ], - "fee": 0.0017017, - "inputs": [ - { - "in_script": { - "asm": "304402205a98a4b501a133ee140bc7b2683f249b6ca73d5ae22e215550cdc8c4d33c19c50220631d5e7400d9898b2c4d659791c6d619d3fc7211cf0c6c6d55d6c6e111f1e2c0[ALL] 0262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa", - "hex": "47304402205a98a4b501a133ee140bc7b2683f249b6ca73d5ae22e215550cdc8c4d33c19c50220631d5e7400d9898b2c4d659791c6d619d3fc7211cf0c6c6d55d6c6e111f1e2c001210262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa" - }, - "output_ref": { - "number": 0, - "tx": "4b4b5aa4b0a1df5a00cd119e8e147e6422eb4bea980670c23dcd150e2d36d400" - }, - "sender": "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "value": 0.00231716 - }, - { - "in_script": { - "asm": "304502210080048844663e9927eff586c843099f4e1197fcf317f9bcba723de9c293e06e2602204b512d9199b0a549f8908eb1c63fa125f96083be36df1e0a071b992061a6362a[ALL] 0262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa", - "hex": "48304502210080048844663e9927eff586c843099f4e1197fcf317f9bcba723de9c293e06e2602204b512d9199b0a549f8908eb1c63fa125f96083be36df1e0a071b992061a6362a01210262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa" - }, - "output_ref": { - "number": 0, - "tx": "54e58fd339f79e46886ac80b83fe321538d38b84c82d7f9c7aa9de1280a5d3c7" - }, - "sender": "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "value": 0.00231716 - } - ], - "ip": "255.255.255.255", - "lock_time": 0, - "outputs": [ - { - "out_script": { - "asm": "OP_DUP OP_HASH160 6d0e0a8a22d533927fb44e578ff60e5b7681888d OP_EQUALVERIFY OP_CHECKSIG", - "hex": "76a9146d0e0a8a22d533927fb44e578ff60e5b7681888d88ac", - "reqSigs": 1, - "type": "pubkeyhash" - }, - "receiver": "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "spending_input": { - "number": 1, - "tx": "6d7d5ce08ecaddfa8949dccbf6f0bf0e3d24dd81acd6f7e822e1aa01628723e5" - }, - "spent": true, - "value": 0.00293262 - }, - { - "out_script": { - "asm": "OP_RETURN b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8", - "hex": "6a20b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8", - "reqSigs": 0, - "type": "nulldata" - }, - "receiver": "Unknown", - "spent": false, - "value": 0 - } - ], - "rec_time": 1521716266, - "self_hash": "2378076e8e140012814e98a2b2cb1af07ec760b239c1d6d93ba54d658a010ecd", - "total_input": 0.00463432, - "total_output": 0.00293262, - "total_spend_output": 0.00293262, - "version": 1 - } -] diff --git a/tests/explorers/mocks/mockBitpayResponse.json b/tests/explorers/mocks/mockBitpayResponse.json deleted file mode 100644 index a44d380..0000000 --- a/tests/explorers/mocks/mockBitpayResponse.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "txid": "2378076e8e140012814e98a2b2cb1af07ec760b239c1d6d93ba54d658a010ecd", - "version": 1, - "locktime": 0, - "vin": [ - { - "txid": "4b4b5aa4b0a1df5a00cd119e8e147e6422eb4bea980670c23dcd150e2d36d400", - "vout": 0, - "sequence": 4294967295, - "n": 0, - "scriptSig": { - "hex": "47304402205a98a4b501a133ee140bc7b2683f249b6ca73d5ae22e215550cdc8c4d33c19c50220631d5e7400d9898b2c4d659791c6d619d3fc7211cf0c6c6d55d6c6e111f1e2c001210262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa", - "asm": "304402205a98a4b501a133ee140bc7b2683f249b6ca73d5ae22e215550cdc8c4d33c19c50220631d5e7400d9898b2c4d659791c6d619d3fc7211cf0c6c6d55d6c6e111f1e2c0[ALL] 0262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa" - }, - "addr": "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "valueSat": 231716, - "value": 0.00231716, - "doubleSpentTxID": null - }, - { - "txid": "54e58fd339f79e46886ac80b83fe321538d38b84c82d7f9c7aa9de1280a5d3c7", - "vout": 0, - "sequence": 4294967295, - "n": 1, - "scriptSig": { - "hex": "48304502210080048844663e9927eff586c843099f4e1197fcf317f9bcba723de9c293e06e2602204b512d9199b0a549f8908eb1c63fa125f96083be36df1e0a071b992061a6362a01210262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa", - "asm": "304502210080048844663e9927eff586c843099f4e1197fcf317f9bcba723de9c293e06e2602204b512d9199b0a549f8908eb1c63fa125f96083be36df1e0a071b992061a6362a[ALL] 0262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa" - }, - "addr": "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "valueSat": 231716, - "value": 0.00231716, - "doubleSpentTxID": null - } - ], - "vout": [ - { - "value": "0.00293262", - "n": 0, - "scriptPubKey": { - "hex": "76a9146d0e0a8a22d533927fb44e578ff60e5b7681888d88ac", - "asm": "OP_DUP OP_HASH160 6d0e0a8a22d533927fb44e578ff60e5b7681888d OP_EQUALVERIFY OP_CHECKSIG", - "addresses": [ - "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo" - ], - "type": "pubkeyhash" - }, - "spentTxId": "6d7d5ce08ecaddfa8949dccbf6f0bf0e3d24dd81acd6f7e822e1aa01628723e5", - "spentIndex": 1, - "spentHeight": 509032 - }, - { - "value": "0.00000000", - "n": 1, - "scriptPubKey": { - "hex": "6a20b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8", - "asm": "OP_RETURN b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8" - }, - "spentTxId": null, - "spentIndex": null, - "spentHeight": null - } - ], - "blockhash": "000000000000000000360a1b3ac336db50f632f3d5f448f62a62f31da82fb59b", - "blockheight": 508180, - "confirmations": 95442, - "time": 1518049414, - "blocktime": 1518049414, - "valueOut": 0.00293262, - "size": 382, - "valueIn": 0.00463432, - "fees": 0.0017017 -} diff --git a/tests/explorers/mocks/mockBlockchainInfoResponse.json b/tests/explorers/mocks/mockBlockchainInfoResponse.json deleted file mode 100644 index 117943f..0000000 --- a/tests/explorers/mocks/mockBlockchainInfoResponse.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "ver":1, - "inputs":[ - { - "sequence":4294967295, - "witness":"", - "prev_out":{ - "spent":true, - "spending_outpoints":[ - { - "tx_index":329840412, - "n":0 - } - ], - "tx_index":329837514, - "type":0, - "addr":"1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "value":231716, - "n":0, - "script":"76a9146d0e0a8a22d533927fb44e578ff60e5b7681888d88ac" - }, - "script":"47304402205a98a4b501a133ee140bc7b2683f249b6ca73d5ae22e215550cdc8c4d33c19c50220631d5e7400d9898b2c4d659791c6d619d3fc7211cf0c6c6d55d6c6e111f1e2c001210262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa" - }, - { - "sequence":4294967295, - "witness":"", - "prev_out":{ - "spent":true, - "spending_outpoints":[ - { - "tx_index":329840412, - "n":1 - } - ], - "tx_index":329837090, - "type":0, - "addr":"1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "value":231716, - "n":0, - "script":"76a9146d0e0a8a22d533927fb44e578ff60e5b7681888d88ac" - }, - "script":"48304502210080048844663e9927eff586c843099f4e1197fcf317f9bcba723de9c293e06e2602204b512d9199b0a549f8908eb1c63fa125f96083be36df1e0a071b992061a6362a01210262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa" - } - ], - "weight":1528, - "block_height":508180, - "relayed_by":"0.0.0.0", - "out":[ - { - "spent":true, - "spending_outpoints":[ - { - "tx_index":330875143, - "n":1 - } - ], - "tx_index":329840412, - "type":0, - "addr":"1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "value":293262, - "n":0, - "script":"76a9146d0e0a8a22d533927fb44e578ff60e5b7681888d88ac" - }, - { - "spent":false, - "tx_index":329840412, - "type":0, - "value":0, - "n":1, - "script":"6a20b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8" - } - ], - "lock_time":0, - "size":382, - "double_spend":false, - "block_index":1672269, - "time":1518049383, - "tx_index":329840412, - "vin_sz":2, - "hash":"2378076e8e140012814e98a2b2cb1af07ec760b239c1d6d93ba54d658a010ecd", - "vout_sz":2 -} diff --git a/tests/explorers/mocks/mockBlockcypherResponse.json b/tests/explorers/mocks/mockBlockcypherResponse.json deleted file mode 100644 index daabd1a..0000000 --- a/tests/explorers/mocks/mockBlockcypherResponse.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "block_hash": "000000000000000000360a1b3ac336db50f632f3d5f448f62a62f31da82fb59b", - "block_height": 508180, - "block_index": 4, - "hash": "2378076e8e140012814e98a2b2cb1af07ec760b239c1d6d93ba54d658a010ecd", - "addresses": [ - "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo" - ], - "total": 293262, - "fees": 170170, - "size": 382, - "preference": "high", - "relayed_by": "34.200.84.245:8333", - "confirmed": "2018-02-08T00:23:34Z", - "received": "2018-02-08T00:23:03.358Z", - "ver": 1, - "double_spend": false, - "vin_sz": 2, - "vout_sz": 2, - "data_protocol": "unknown", - "confirmations": 95579, - "confidence": 1, - "inputs": [ - { - "prev_hash": "4b4b5aa4b0a1df5a00cd119e8e147e6422eb4bea980670c23dcd150e2d36d400", - "output_index": 0, - "script": "47304402205a98a4b501a133ee140bc7b2683f249b6ca73d5ae22e215550cdc8c4d33c19c50220631d5e7400d9898b2c4d659791c6d619d3fc7211cf0c6c6d55d6c6e111f1e2c001210262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa", - "output_value": 231716, - "sequence": 4294967295, - "addresses": [ - "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo" - ], - "script_type": "pay-to-pubkey-hash", - "age": 508176 - }, - { - "prev_hash": "54e58fd339f79e46886ac80b83fe321538d38b84c82d7f9c7aa9de1280a5d3c7", - "output_index": 0, - "script": "48304502210080048844663e9927eff586c843099f4e1197fcf317f9bcba723de9c293e06e2602204b512d9199b0a549f8908eb1c63fa125f96083be36df1e0a071b992061a6362a01210262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa", - "output_value": 231716, - "sequence": 4294967295, - "addresses": [ - "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo" - ], - "script_type": "pay-to-pubkey-hash", - "age": 508177 - } - ], - "outputs": [ - { - "value": 293262, - "script": "76a9146d0e0a8a22d533927fb44e578ff60e5b7681888d88ac", - "spent_by": "6d7d5ce08ecaddfa8949dccbf6f0bf0e3d24dd81acd6f7e822e1aa01628723e5", - "addresses": [ - "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo" - ], - "script_type": "pay-to-pubkey-hash" - }, - { - "value": 0, - "script": "6a20b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8", - "addresses": null, - "script_type": "null-data", - "data_hex": "b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8" - } - ] -} diff --git a/tests/explorers/mocks/mockBlockexplorerResponse.json b/tests/explorers/mocks/mockBlockexplorerResponse.json deleted file mode 100644 index 710ac2b..0000000 --- a/tests/explorers/mocks/mockBlockexplorerResponse.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "txid": "2378076e8e140012814e98a2b2cb1af07ec760b239c1d6d93ba54d658a010ecd", - "version": 1, - "locktime": 0, - "vin": [ - { - "txid": "4b4b5aa4b0a1df5a00cd119e8e147e6422eb4bea980670c23dcd150e2d36d400", - "vout": 0, - "sequence": 4294967295, - "n": 0, - "scriptSig": { - "hex": "47304402205a98a4b501a133ee140bc7b2683f249b6ca73d5ae22e215550cdc8c4d33c19c50220631d5e7400d9898b2c4d659791c6d619d3fc7211cf0c6c6d55d6c6e111f1e2c001210262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa", - "asm": "304402205a98a4b501a133ee140bc7b2683f249b6ca73d5ae22e215550cdc8c4d33c19c50220631d5e7400d9898b2c4d659791c6d619d3fc7211cf0c6c6d55d6c6e111f1e2c0[ALL] 0262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa" - }, - "addr": "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "valueSat": 231716, - "value": 0.00231716, - "doubleSpentTxID": null - }, - { - "txid": "54e58fd339f79e46886ac80b83fe321538d38b84c82d7f9c7aa9de1280a5d3c7", - "vout": 0, - "sequence": 4294967295, - "n": 1, - "scriptSig": { - "hex": "48304502210080048844663e9927eff586c843099f4e1197fcf317f9bcba723de9c293e06e2602204b512d9199b0a549f8908eb1c63fa125f96083be36df1e0a071b992061a6362a01210262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa", - "asm": "304502210080048844663e9927eff586c843099f4e1197fcf317f9bcba723de9c293e06e2602204b512d9199b0a549f8908eb1c63fa125f96083be36df1e0a071b992061a6362a[ALL] 0262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa" - }, - "addr": "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "valueSat": 231716, - "value": 0.00231716, - "doubleSpentTxID": null - } - ], - "vout": [ - { - "value": "0.00293262", - "n": 0, - "scriptPubKey": { - "hex": "76a9146d0e0a8a22d533927fb44e578ff60e5b7681888d88ac", - "asm": "OP_DUP OP_HASH160 6d0e0a8a22d533927fb44e578ff60e5b7681888d OP_EQUALVERIFY OP_CHECKSIG", - "addresses": [ - "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo" - ], - "type": "pubkeyhash" - }, - "spentTxId": "6d7d5ce08ecaddfa8949dccbf6f0bf0e3d24dd81acd6f7e822e1aa01628723e5", - "spentIndex": 1, - "spentHeight": 509032 - }, - { - "value": "0.00000000", - "n": 1, - "scriptPubKey": { - "hex": "6a20b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8", - "asm": "OP_RETURN b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8" - }, - "spentTxId": null, - "spentIndex": null, - "spentHeight": null - } - ], - "blockhash": "000000000000000000360a1b3ac336db50f632f3d5f448f62a62f31da82fb59b", - "blockheight": 508180, - "confirmations": 95557, - "time": 1518049414, - "blocktime": 1518049414, - "valueOut": 0.00293262, - "size": 382, - "valueIn": 0.00463432, - "fees": 0.0017017 -} diff --git a/tests/explorers/mocks/mockBlockstreamResponse.json b/tests/explorers/mocks/mockBlockstreamResponse.json deleted file mode 100644 index 925158c..0000000 --- a/tests/explorers/mocks/mockBlockstreamResponse.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "txid": "2378076e8e140012814e98a2b2cb1af07ec760b239c1d6d93ba54d658a010ecd", - "version": 1, - "locktime": 0, - "vin": [ - { - "txid": "4b4b5aa4b0a1df5a00cd119e8e147e6422eb4bea980670c23dcd150e2d36d400", - "vout": 0, - "prevout": { - "scriptpubkey": "76a9146d0e0a8a22d533927fb44e578ff60e5b7681888d88ac", - "scriptpubkey_asm": "OP_DUP OP_HASH160 OP_PUSHBYTES_20 6d0e0a8a22d533927fb44e578ff60e5b7681888d OP_EQUALVERIFY OP_CHECKSIG", - "scriptpubkey_type": "p2pkh", - "scriptpubkey_address": "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "value": 231716 - }, - "scriptsig": "47304402205a98a4b501a133ee140bc7b2683f249b6ca73d5ae22e215550cdc8c4d33c19c50220631d5e7400d9898b2c4d659791c6d619d3fc7211cf0c6c6d55d6c6e111f1e2c001210262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa", - "scriptsig_asm": "OP_PUSHBYTES_71 304402205a98a4b501a133ee140bc7b2683f249b6ca73d5ae22e215550cdc8c4d33c19c50220631d5e7400d9898b2c4d659791c6d619d3fc7211cf0c6c6d55d6c6e111f1e2c001 OP_PUSHBYTES_33 0262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa", - "is_coinbase": false, - "sequence": 4294967295 - }, - { - "txid": "54e58fd339f79e46886ac80b83fe321538d38b84c82d7f9c7aa9de1280a5d3c7", - "vout": 0, - "prevout": { - "scriptpubkey": "76a9146d0e0a8a22d533927fb44e578ff60e5b7681888d88ac", - "scriptpubkey_asm": "OP_DUP OP_HASH160 OP_PUSHBYTES_20 6d0e0a8a22d533927fb44e578ff60e5b7681888d OP_EQUALVERIFY OP_CHECKSIG", - "scriptpubkey_type": "p2pkh", - "scriptpubkey_address": "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "value": 231716 - }, - "scriptsig": "48304502210080048844663e9927eff586c843099f4e1197fcf317f9bcba723de9c293e06e2602204b512d9199b0a549f8908eb1c63fa125f96083be36df1e0a071b992061a6362a01210262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa", - "scriptsig_asm": "OP_PUSHBYTES_72 304502210080048844663e9927eff586c843099f4e1197fcf317f9bcba723de9c293e06e2602204b512d9199b0a549f8908eb1c63fa125f96083be36df1e0a071b992061a6362a01 OP_PUSHBYTES_33 0262abbba41b0e53be21f52e844969946d5bbf93b2fc83a63f35b2bdcdae365bfa", - "is_coinbase": false, - "sequence": 4294967295 - } - ], - "vout": [ - { - "scriptpubkey": "76a9146d0e0a8a22d533927fb44e578ff60e5b7681888d88ac", - "scriptpubkey_asm": "OP_DUP OP_HASH160 OP_PUSHBYTES_20 6d0e0a8a22d533927fb44e578ff60e5b7681888d OP_EQUALVERIFY OP_CHECKSIG", - "scriptpubkey_type": "p2pkh", - "scriptpubkey_address": "1AwdUWQzJgfDDjeKtpPzMfYMHejFBrxZfo", - "value": 293262 - }, - { - "scriptpubkey": "6a20b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8", - "scriptpubkey_asm": "OP_RETURN OP_PUSHBYTES_32 b2ceea1d52627b6ed8d919ad1039eca32f6e099ef4a357cbb7f7361c471ea6c8", - "scriptpubkey_type": "op_return", - "value": 0 - } - ], - "size": 382, - "weight": 1528, - "fee": 170170, - "status": { - "confirmed": true, - "block_height": 508180, - "block_hash": "000000000000000000360a1b3ac336db50f632f3d5f448f62a62f31da82fb59b", - "block_time": 1518049414 - } -} diff --git a/tests/explorers/mocks/mockEtherscanResponse.json b/tests/explorers/mocks/mockEtherscanResponse.json deleted file mode 100644 index fbbb895..0000000 --- a/tests/explorers/mocks/mockEtherscanResponse.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "blockHash": "0x43bc69984a1ef0b160eeb5bc9cbda4d6ea7cdc01645300c50f398f234acfb3ae", - "blockNumber": "0x57375b", - "from": "0x3d995ef85a8d1bcbed78182ab225b9f88dc8937c", - "gas": "0x61a8", - "gasPrice": "0x4a817c800", - "hash": "0xa12c498c8fcf59ee2fe785c94c38be4797fb027e6450439a7ef30ad61d7616d3", - "input": "0xec049a808a09f3e8e257401e0898aa3d32a733706fd7d16aacf0ba95f7b42c0c", - "nonce": "0x2", - "to": "0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddead", - "transactionIndex": "0xb", - "value": "0x0", - "v": "0x26", - "r": "0xe970a5df815a001360596410b304cfef763cba594b9a14e9804e8fb64ee8295", - "s": "0x6e4f235ca308dee52160f0b90802dcde159e3b1ccca7d57330eff42d9783775b" - } -} diff --git a/tests/explorers/rpc/bitcoin.test.ts b/tests/explorers/rpc/bitcoin.test.ts deleted file mode 100644 index e680e52..0000000 --- a/tests/explorers/rpc/bitcoin.test.ts +++ /dev/null @@ -1,26 +0,0 @@ -import sinon from 'sinon'; -import * as request from '../../../src/services/request'; -import { bitcoinRPCParsingFunction } from '../../../src/explorers/rpc/bitcoin'; - -const getRawTransactionResponse = '{"result":{"txid":"d75b7a5bdb3d5244b753e6b84e987267cfa4ffa7a532a2ed49ad3848be1d82f8","hash":"d75b7a5bdb3d5244b753e6b84e987267cfa4ffa7a532a2ed49ad3848be1d82f8","version":1,"size":266,"vsize":266,"weight":1064,"locktime":0,"vin":[{"txid":"cbe1a820fd0512607d9cd41f3020770abc4ce015efb332a38b17598d981d26b9","vout":0,"scriptSig":{"asm":"304402207296a8a444e26cac6e0ab51e37fe96b59d406cab8ae61ca27332914052d9541202204b53a96e8d0bfca15dd5729d4ebee242cfd712138f7ccc1ae22451ff99750144[ALL] 04fddb3f9b745cb9dd54007164462597e607735cfe56baeef5a0b876c8bd16ee6115e3c77e2f74dc8129362e8c72e8dc4c27f4991f714754a57fd969f50e774e3d","hex":"47304402207296a8a444e26cac6e0ab51e37fe96b59d406cab8ae61ca27332914052d9541202204b53a96e8d0bfca15dd5729d4ebee242cfd712138f7ccc1ae22451ff99750144014104fddb3f9b745cb9dd54007164462597e607735cfe56baeef5a0b876c8bd16ee6115e3c77e2f74dc8129362e8c72e8dc4c27f4991f714754a57fd969f50e774e3d"},"sequence":4294967295}],"vout":[{"value":1.74630942,"n":0,"scriptPubKey":{"asm":"OP_DUP OP_HASH160 7fe4deec11117531349fc17d1217845fedf6e989 OP_EQUALVERIFY OP_CHECKSIG","hex":"76a9147fe4deec11117531349fc17d1217845fedf6e98988ac","reqSigs":1,"type":"pubkeyhash","addresses":["msBCHdwaQ7N2ypBYupkp6uNxtr9Pg76imj"]}},{"value":0.00000000,"n":1,"scriptPubKey":{"asm":"OP_RETURN f029b45bb1a7b1f0b970f6de35344b73cccd16177b4c037acbc2541c7fc27078","hex":"6a20f029b45bb1a7b1f0b970f6de35344b73cccd16177b4c037acbc2541c7fc27078","type":"nulldata"}}],"hex":"0100000001b9261d988d59178ba332b3ef15e04cbc0a7720301fd49c7d601205fd20a8e1cb000000008a47304402207296a8a444e26cac6e0ab51e37fe96b59d406cab8ae61ca27332914052d9541202204b53a96e8d0bfca15dd5729d4ebee242cfd712138f7ccc1ae22451ff99750144014104fddb3f9b745cb9dd54007164462597e607735cfe56baeef5a0b876c8bd16ee6115e3c77e2f74dc8129362e8c72e8dc4c27f4991f714754a57fd969f50e774e3dffffffff021ea8680a000000001976a9147fe4deec11117531349fc17d1217845fedf6e98988ac0000000000000000226a20f029b45bb1a7b1f0b970f6de35344b73cccd16177b4c037acbc2541c7fc2707800000000","blockhash":"0000000000000ce580a03ccdbd79b9a8c252eb6ab0741b196fcea81f1b47ca90","confirmations":746253,"time":1498774229,"blocktime":1498774229},"error":null,"id":"rpctest"}'; - -describe('Bitcoin RPC response parsing test suite', function () { - describe('given it is called with a transactionId and a server URL', function () { - it('should retrieve the transaction data', async function () { - const requestStub: sinon.SinonStub = sinon.stub(request, 'request'); - const transactionId = 'd75b7a5bdb3d5244b753e6b84e987267cfa4ffa7a532a2ed49ad3848be1d82f8'; - const serviceUrl = 'a-btc-rpc-url.com'; - - requestStub.onCall(0).resolves(getRawTransactionResponse); - - const output = await bitcoinRPCParsingFunction({ serviceUrl, transactionId }); - expect(output).toEqual({ - remoteHash: 'f029b45bb1a7b1f0b970f6de35344b73cccd16177b4c037acbc2541c7fc27078', - issuingAddress: 'msBCHdwaQ7N2ypBYupkp6uNxtr9Pg76imj', - time: new Date('2017-06-29T22:10:29.000Z'), - revokedAddresses: ['msBCHdwaQ7N2ypBYupkp6uNxtr9Pg76imj'] - }); - requestStub.restore(); - }); - }); -}); diff --git a/tests/explorers/rpc/ethereum.test.ts b/tests/explorers/rpc/ethereum.test.ts deleted file mode 100644 index af2ddf5..0000000 --- a/tests/explorers/rpc/ethereum.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -import sinon from 'sinon'; -import { ethereumRPCParsingFunction } from '../../../src/explorers/rpc/ethereum'; -import * as request from '../../../src/services/request'; - -const getByHashResponse = '{"jsonrpc":"2.0","id":"getbyhash","result":{"blockHash":"0xfb6e2f57468cdec12becc9b4dec4844e2efa7cc1ac87965a871c7d71133133dd","blockNumber":"0x46022a","from":"0x11f1089baceaa98dbe22c079c9df1e2338af22e1","gas":"0x5408","gasPrice":"0x3b9aca00","hash":"0xef59c07bed26d473925e688ec4da2211981820dc1167427ef34d2a2e6f45b8fa","input":"0x7122cbe07bafd8c243e8c2b684b38e32cc2493365d7ced1e7f1160cf99be835a","nonce":"0x7","to":"0x11f1089baceaa98dbe22c079c9df1e2338af22e1","transactionIndex":"0x0","value":"0x0","v":"0x27125","r":"0x92d2c281250f0241c26905b73a95c47b7757e05bd78bdc70b5265633929e9d3b","s":"0x2a22306868dca1c9c13b91d4dcedc9629071247085202e47de0fe525d963cd9"}}'; - -const blockByNumberResponse = '{"jsonrpc":"2.0","id":"blockbynumber","result":{"difficulty":"0x6","extraData":"0xd58301091083626f7286676f312e3133856c696e75780000000000000000000093a9198764b0db11a926e4edc7551ed22ce003321c138b50c9b91b4279f4afad38760444e5c0dc1fad9ed35d91486a45d05ba412c70ebbb3abfefc5a5151557b01","gasLimit":"0x1312d00","gasUsed":"0x5408","hash":"0xfb6e2f57468cdec12becc9b4dec4844e2efa7cc1ac87965a871c7d71133133dd","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000010000000000000000000000000000000000000000000000000800000000000800000000100000000004000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000080000000000000000000200000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000100040000000000000000000000000000000000000000000000000000010000000000000100000","miner":"0x0000000000000000000000000000000000000000","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","number":"0x46022a","parentHash":"0x621e7cbb6e890c895af6250bd625d1ad2236d6c70aa6a1d3fd5a776b3db8109f","receiptsRoot":"0xc0eadd0b3b85cac44db93f86dd8d542020804132b95dbfb66570aae70c07f27f","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x2ed","stateRoot":"0xfaff3d6e18f470fcee6d6fbf1322bfdec6d2604dba33305bbdc098582d491edd","timestamp":"0x5f6a082f","totalDifficulty":"0x173cc81","transactions":[{"blockHash":"0xfb6e2f57468cdec12becc9b4dec4844e2efa7cc1ac87965a871c7d71133133dd","blockNumber":"0x46022a","from":"0x11f1089baceaa98dbe22c079c9df1e2338af22e1","gas":"0x5408","gasPrice":"0x3b9aca00","hash":"0xef59c07bed26d473925e688ec4da2211981820dc1167427ef34d2a2e6f45b8fa","input":"0x7122cbe07bafd8c243e8c2b684b38e32cc2493365d7ced1e7f1160cf99be835a","nonce":"0x7","to":"0x11f1089baceaa98dbe22c079c9df1e2338af22e1","transactionIndex":"0x0","value":"0x0","v":"0x27125","r":"0x92d2c281250f0241c26905b73a95c47b7757e05bd78bdc70b5265633929e9d3b","s":"0x2a22306868dca1c9c13b91d4dcedc9629071247085202e47de0fe525d963cd9"}],"transactionsRoot":"0x91ed5bfce4b07bfae7174a05fed72e523ebe585bb970d2154d9c06af0a1ea22d","uncles":[]}}'; - -describe('Ethereum RPC response parsing test suite', function () { - describe('given it is called with a transactionId and a server URL', function () { - it('should retrieve the transaction data', async function () { - const requestStub: sinon.SinonStub = sinon.stub(request, 'request'); - const transactionId = 'ef59c07bed26d473925e688ec4da2211981820dc1167427ef34d2a2e6f45b8fa'; - const serviceUrl = 'https://an-evm-rpc-explorer.com/'; - - requestStub.onCall(0).resolves(getByHashResponse); - requestStub.onCall(1).resolves(blockByNumberResponse); - - const output = await ethereumRPCParsingFunction({ serviceUrl, transactionId }); - expect(output).toEqual({ - remoteHash: '7122cbe07bafd8c243e8c2b684b38e32cc2493365d7ced1e7f1160cf99be835a', - issuingAddress: '0x11f1089baceaa98dbe22c079c9df1e2338af22e1', - time: new Date('2020-09-22T14:20:31.000Z'), - revokedAddresses: [] - }); - - requestStub.restore(); - }); - }); -}); diff --git a/tests/helpers/lookForTx-with-custom-explorers-first.test.ts b/tests/helpers/lookForTx-with-custom-explorers-first.test.ts deleted file mode 100644 index 3dba136..0000000 --- a/tests/helpers/lookForTx-with-custom-explorers-first.test.ts +++ /dev/null @@ -1,98 +0,0 @@ -import sinon from 'sinon'; -import { TransactionData } from '../../src/models/TransactionData'; -import { TExplorerAPIs } from '../../src/explorers'; -import { SupportedChains } from '../../src/constants/blockchains'; -import lookForTx from '../../src/helpers/lookForTx'; - -describe('lookForTx test suite', function () { - const MOCK_TRANSACTION_ID = 'mock-transaction-id'; - const fixtureCustomTxData: TransactionData = { - revokedAddresses: [], - time: '2020-04-20T00:00:00Z', - remoteHash: 'a-remote-hash', - issuingAddress: 'from-custom-explorer' - }; - - const fixtureDefaultTxData: TransactionData = { - revokedAddresses: [], - time: '2020-04-20T00:00:00Z', - remoteHash: 'a-remote-hash', - issuingAddress: 'from-default-explorer' - }; - - describe('given it is invoked with custom explorers with priority 0', function () { - let stubbedCustomExplorer: sinon.SinonStub; - let stubbedDefaultExplorer: sinon.SinonStub; - let mockExplorers: TExplorerAPIs; - - beforeEach(function () { - stubbedCustomExplorer = sinon.stub().resolves(fixtureCustomTxData); - stubbedDefaultExplorer = sinon.stub().resolves(fixtureDefaultTxData); - mockExplorers = { - bitcoin: [{ - getTxData: stubbedDefaultExplorer, - priority: -1 - }], - ethereum: [], - custom: [{ - getTxData: stubbedCustomExplorer, - priority: 0 - }] - }; - }); - - afterEach(function () { - stubbedCustomExplorer.resetHistory(); - stubbedDefaultExplorer.resetHistory(); - }); - - describe('given the custom explorers return the transaction', function () { - let response: TransactionData; - - beforeEach(async function () { - response = await lookForTx({ - transactionId: MOCK_TRANSACTION_ID, - chain: SupportedChains.Bitcoin, - explorerAPIs: mockExplorers - }); - }); - - it('should retrieve the response from the custom explorers', function () { - expect(response).toBe(fixtureCustomTxData); - }); - - it('should have called the custom explorers', function () { - expect(stubbedCustomExplorer.calledOnce).toBe(true); - }); - - it('should not have called the default explorers', function () { - expect(stubbedDefaultExplorer.calledOnce).toBe(false); - }); - }); - - describe('given the custom explorers fail to return the transaction', function () { - let response: TransactionData; - - beforeEach(async function () { - stubbedCustomExplorer.rejects(); - response = await lookForTx({ - transactionId: MOCK_TRANSACTION_ID, - chain: SupportedChains.Bitcoin, - explorerAPIs: mockExplorers - }); - }); - - it('should retrieve the response from the default explorers', function () { - expect(response).toBe(fixtureDefaultTxData); - }); - - it('should have called the custom explorers', function () { - expect(stubbedCustomExplorer.calledOnce).toBe(true); - }); - - it('should have called the default explorers', function () { - expect(stubbedDefaultExplorer.calledOnce).toBe(true); - }); - }); - }); -}); diff --git a/tests/helpers/lookForTx-with-custom-explorers-last.test.ts b/tests/helpers/lookForTx-with-custom-explorers-last.test.ts deleted file mode 100644 index f9e60f8..0000000 --- a/tests/helpers/lookForTx-with-custom-explorers-last.test.ts +++ /dev/null @@ -1,98 +0,0 @@ -import sinon from 'sinon'; -import { TransactionData } from '../../src/models/TransactionData'; -import { TExplorerAPIs } from '../../src/explorers'; -import lookForTx from '../../src/helpers/lookForTx'; -import { SupportedChains } from '../../src/constants/blockchains'; - -describe('lookForTx test suite', function () { - const MOCK_TRANSACTION_ID = 'mock-transaction-id'; - const fixtureCustomTxData: TransactionData = { - revokedAddresses: [], - time: '2020-04-20T00:00:00Z', - remoteHash: 'a-remote-hash', - issuingAddress: 'from-custom-explorer' - }; - - const fixtureDefaultTxData: TransactionData = { - revokedAddresses: [], - time: '2020-04-20T00:00:00Z', - remoteHash: 'a-remote-hash', - issuingAddress: 'from-default-explorer' - }; - - describe('given it is invoked with custom explorers with priority 1', function () { - let stubbedCustomExplorer: sinon.SinonStub; - let stubbedDefaultExplorer: sinon.SinonStub; - let mockExplorers: TExplorerAPIs; - - beforeEach(function () { - stubbedCustomExplorer = sinon.stub().resolves(fixtureCustomTxData); - stubbedDefaultExplorer = sinon.stub().resolves(fixtureDefaultTxData); - mockExplorers = { - bitcoin: [{ - getTxData: stubbedDefaultExplorer, - priority: -1 - }], - ethereum: [], - custom: [{ - getTxData: stubbedCustomExplorer, - priority: 1 - }] - }; - }); - - afterEach(function () { - stubbedCustomExplorer.resetHistory(); - stubbedDefaultExplorer.resetHistory(); - }); - - describe('given the custom explorers return the transaction', function () { - let response: TransactionData; - - beforeEach(async function () { - response = await lookForTx({ - transactionId: MOCK_TRANSACTION_ID, - chain: SupportedChains.Bitcoin, - explorerAPIs: mockExplorers - }); - }); - - it('should retrieve the response from the default explorers', function () { - expect(response).toBe(fixtureDefaultTxData); - }); - - it('should have called the default explorers', function () { - expect(stubbedDefaultExplorer.calledOnce).toBe(true); - }); - - it('should not have called the custom explorers', function () { - expect(stubbedCustomExplorer.calledOnce).toBe(false); - }); - }); - - describe('given the default explorers fail to return the transaction', function () { - let response: TransactionData; - - beforeEach(async function () { - stubbedDefaultExplorer.rejects(); - response = await lookForTx({ - transactionId: MOCK_TRANSACTION_ID, - chain: SupportedChains.Bitcoin, - explorerAPIs: mockExplorers - }); - }); - - it('should retrieve the response from the custom explorers', function () { - expect(response).toBe(fixtureCustomTxData); - }); - - it('should have called the default explorers', function () { - expect(stubbedDefaultExplorer.calledOnce).toBe(true); - }); - - it('should have called the custom explorers', function () { - expect(stubbedCustomExplorer.calledOnce).toBe(true); - }); - }); - }); -}); diff --git a/tests/helpers/lookForTx.test.ts b/tests/helpers/lookForTx.test.ts deleted file mode 100644 index 2498214..0000000 --- a/tests/helpers/lookForTx.test.ts +++ /dev/null @@ -1,152 +0,0 @@ -import sinon from 'sinon'; -import lookForTx, { getExplorersByChain } from '../../src/helpers/lookForTx'; -import { SupportedChains } from '../../src/constants/blockchains'; -import { getDefaultExplorers, TExplorerAPIs } from '../../src/explorers'; -import { TransactionData } from '../../src/models/TransactionData'; -import CONFIG from '../../src/constants/config'; - -describe('lookForTx test suite', function () { - const MOCK_TRANSACTION_ID = 'mock-transaction-id'; - const defaultExplorerAPIs: TExplorerAPIs = getDefaultExplorers(); - - describe('given there are no custom explorers', function () { - it('should call and resolve from the explorers passed', async function () { - const mockTxData: TransactionData = { - revokedAddresses: [], - time: '2020-04-20T00:00:00Z', - remoteHash: 'a-remote-hash', - issuingAddress: 'an-issuing-address' - }; - const stubbedExplorer = sinon.stub().resolves(mockTxData); - const mockExplorers: TExplorerAPIs = { - bitcoin: [{ - getTxData: stubbedExplorer - }], - ethereum: [] - }; - const output = await lookForTx({ - transactionId: 'a-transaction-id', - chain: SupportedChains.Bitcoin, - explorerAPIs: mockExplorers - }); - expect(output).toEqual(mockTxData); - }); - }); - - describe('given it is called with a transactionId, a chain and a certificateVersion', function () { - describe('given the chain is invalid', function () { - it('should throw an error', async function () { - await expect(lookForTx({ - transactionId: MOCK_TRANSACTION_ID, - chain: 'invalid-chain' as SupportedChains, - explorerAPIs: defaultExplorerAPIs - })).rejects.toThrow('Chain is not natively supported. Use custom explorers to retrieve tx data.'); - }); - }); - - describe('given MinimumBlockchainExplorers is less than 0', function () { - it('should throw an error', async function () { - const originalValue = CONFIG.MinimumBlockchainExplorers; - CONFIG.MinimumBlockchainExplorers = -1; - await expect(lookForTx({ - transactionId: MOCK_TRANSACTION_ID, - chain: SupportedChains.Bitcoin, - explorerAPIs: defaultExplorerAPIs - })).rejects.toThrow('Invalid application configuration;' + - ' check the CONFIG.MinimumBlockchainExplorers configuration value'); - CONFIG.MinimumBlockchainExplorers = originalValue; - }); - }); - - describe('given MinimumBlockchainExplorers is higher than BlockchainExplorers length', function () { - it('should throw an error', async function () { - const originalValue = CONFIG.MinimumBlockchainExplorers; - CONFIG.MinimumBlockchainExplorers = defaultExplorerAPIs.bitcoin.length + 1; - await expect(lookForTx({ - transactionId: MOCK_TRANSACTION_ID, - chain: SupportedChains.Bitcoin, - explorerAPIs: defaultExplorerAPIs - })).rejects.toThrow('Invalid application configuration;' + - ' check the CONFIG.MinimumBlockchainExplorers configuration value'); - CONFIG.MinimumBlockchainExplorers = originalValue; - }); - }); - }); -}); - -describe('getExplorersByChain test suite', function () { - describe('selecting the explorers', function () { - describe('given the chain is Ethereum main', function () { - it('should use the ethereum specific explorers', function () { - const selectedSelectors = getExplorersByChain(SupportedChains.Ethmain, getDefaultExplorers()); - // because they are wrapped, we don't necessarily have the deep nature of the result, so we use a weak test to ensure - expect(selectedSelectors.length).toBe(2); - }); - }); - - describe('given the chain is Ethereum ropsten', function () { - it('should use the ethereum specific explorers', function () { - const selectedSelectors = getExplorersByChain(SupportedChains.Ethropst, getDefaultExplorers()); - // because they are wrapped, we don't necessarily have the deep nature of the result, so we use a weak test to ensure - expect(selectedSelectors.length).toBe(2); - }); - }); - - describe('given the chain is Ethereum rinkeby', function () { - it('should use the ethereum specific explorers', function () { - const selectedSelectors = getExplorersByChain(SupportedChains.Ethrinkeby, getDefaultExplorers()); - // because they are wrapped, we don't necessarily have the deep nature of the result, so we use a weak test to ensure - expect(selectedSelectors.length).toBe(2); - }); - }); - - describe('given the chain is Bitcoin mainnet', function () { - it('should use the bitcoin specific explorers', function () { - const selectedSelectors = getExplorersByChain(SupportedChains.Bitcoin, getDefaultExplorers()); - // because they are wrapped, we don't necessarily have the deep nature of the result, so we use a weak test to ensure - expect(selectedSelectors.length).toBe(4); - }); - }); - - describe('given the chain is Bitcoin mocknet', function () { - it('should use the bitcoin specific explorers', function () { - const selectedSelectors = getExplorersByChain(SupportedChains.Mocknet, getDefaultExplorers()); - // because they are wrapped, we don't necessarily have the deep nature of the result, so we use a weak test to ensure - expect(selectedSelectors.length).toBe(4); - }); - }); - - describe('given the chain is Bitcoin testnet', function () { - it('should use the bitcoin specific explorers', function () { - const selectedSelectors = getExplorersByChain(SupportedChains.Testnet, getDefaultExplorers()); - // because they are wrapped, we don't necessarily have the deep nature of the result, so we use a weak test to ensure - expect(selectedSelectors.length).toBe(4); - }); - }); - - describe('given the chain is Bitcoin regtest', function () { - it('should use the bitcoin specific explorers', function () { - const selectedSelectors = getExplorersByChain(SupportedChains.Regtest, getDefaultExplorers()); - // because they are wrapped, we don't necessarily have the deep nature of the result, so we use a weak test to ensure - expect(selectedSelectors.length).toBe(4); - }); - }); - - describe('in all other cases', function () { - it('should return the custom explorers', function () { - const explorers = { - ...getDefaultExplorers(), - custom: [ - { - getTxData: () => '' as any, - priority: 0 - } - ] - }; - const selectedSelectors = getExplorersByChain('Matic' as any, explorers); - // because they are wrapped, we don't necessarily have the deep nature of the result, so we use a weak test to ensure - expect(selectedSelectors.length).toBe(1); - }); - }); - }); -}); diff --git a/tests/services/request.test.ts b/tests/services/request.test.ts deleted file mode 100644 index 22e26a1..0000000 --- a/tests/services/request.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { request } from '../../src/services/request'; - -describe('Services Request test suite', function () { - describe('given it is called without a URL', function () { - it('should throw an error', async function () { - await request({} as any).catch(err => { - expect(err.message).toBe('URL is missing'); - }); - }); - }); -}); diff --git a/tests/services/transaction-apis.test.ts b/tests/services/transaction-apis.test.ts deleted file mode 100644 index 6ab2697..0000000 --- a/tests/services/transaction-apis.test.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { buildTransactionServiceUrl } from '../../src/services/transaction-apis'; -import { explorerApi as Blockcypher } from '../../src/explorers/bitcoin/blockcypher'; -import { explorerApi as Etherscan } from '../../src/explorers/ethereum/etherscan'; - -describe('Transaction APIs test suite', function () { - let fixtureApi; - const fixtureTransactionId = 'fixture-transaction-id'; - - describe('buildTransactionServiceUrl method', function () { - describe('handling test APIs', function () { - beforeEach(function () { - fixtureApi = Blockcypher; - }); - - describe('given isTestApi is set to false', function () { - it('should return the mainnet address with the transaction ID', function () { - expect(buildTransactionServiceUrl({ - explorerAPI: fixtureApi, - transactionId: fixtureTransactionId - })).toEqual(`https://api.blockcypher.com/v1/btc/main/txs/${fixtureTransactionId}?limit=500`); - }); - }); - - describe('given isTestApi is set to true', function () { - it('should return the testnet address with the transaction ID', function () { - expect(buildTransactionServiceUrl({ - explorerAPI: fixtureApi, - transactionId: fixtureTransactionId, - isTestApi: true - })).toEqual(`https://api.blockcypher.com/v1/btc/test3/txs/${fixtureTransactionId}?limit=500`); - }); - }); - }); - - describe('given it is called with an API token', function () { - const fixtureAPIToken = 'a-test-api-token'; - - beforeEach(function () { - fixtureApi = JSON.parse(JSON.stringify(Etherscan)); - fixtureApi.key = fixtureAPIToken; - fixtureApi.keyPropertyName = 'apikey'; - }); - - describe('and there are already some parameters in the URL', function () { - it('should construct the URL to add the token with &', function () { - const output = buildTransactionServiceUrl({ - explorerAPI: fixtureApi, - transactionId: fixtureTransactionId - }); - const expectedOutput = `https://api.etherscan.io/api?module=proxy&action=eth_getTransactionByHash&txhash=fixture-transaction-id&apikey=${fixtureAPIToken}`; - expect(output).toBe(expectedOutput); - }); - }); - - describe('and there are no parameters in the URL yet', function () { - it('should construct the URL to add the token with ?', function () { - fixtureApi.serviceURL = 'https://api.etherscan.io/api'; - const output = buildTransactionServiceUrl({ - explorerAPI: fixtureApi, - transactionId: fixtureTransactionId - }); - const expectedOutput = `https://api.etherscan.io/api?apikey=${fixtureAPIToken}`; - expect(output).toBe(expectedOutput); - }); - }); - - describe('and the keyPropertyName is not set', function () { - it('should throw', function () { - delete fixtureApi.keyPropertyName; - expect(() => { - buildTransactionServiceUrl({ - explorerAPI: fixtureApi, - transactionId: fixtureTransactionId - }); - }).toThrow('No keyPropertyName defined for explorerAPI etherscan'); - }); - }); - }); - }); -}); diff --git a/tests/verification/failing-altered-document.test.ts b/tests/verification/failing-altered-document.test.ts index 2c4efc2..cbad570 100644 --- a/tests/verification/failing-altered-document.test.ts +++ b/tests/verification/failing-altered-document.test.ts @@ -1,7 +1,7 @@ import sinon from 'sinon'; +import * as explorerLookup from '@blockcerts/explorer-lookup'; import alteredBlockcertsV3Fixture from '../fixtures/altered-blockcerts-v3'; import { MerkleProof2019, MerkleProof2019VerificationResult } from '../../src/MerkleProof2019'; -import * as lookForTxFunctions from '../../src/helpers/lookForTx'; import fixtureTransactionData from '../fixtures/transactionData'; describe('when the process fails', function () { @@ -9,7 +9,7 @@ describe('when the process fails', function () { beforeEach(function () { instance = new MerkleProof2019({ document: alteredBlockcertsV3Fixture }); - sinon.stub(lookForTxFunctions, 'default').resolves(fixtureTransactionData); + sinon.stub(explorerLookup, 'lookForTx').resolves(fixtureTransactionData); }); afterEach(function () { diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json new file mode 100644 index 0000000..18cbee4 --- /dev/null +++ b/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "lib/cjs" + } +} diff --git a/tsconfig.json b/tsconfig.json index c0afd1b..fe5c3e4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,15 +8,17 @@ "experimentalDecorators": true, "moduleResolution": "node", "baseUrl": "src", - "module": "commonjs", + "module": "ES2020", "resolveJsonModule": true, "esModuleInterop": true, - "sourceMap": true, - "skipLibCheck": true + "skipLibCheck": true, + "outDir": "lib/esm", + "declaration": true }, "compileOnSave": false, "exclude": [ "node_modules", - "tests" + "tests", + "lib" ] }