From 3e3777d8083fdbeccc9e7fae81fc75f7064a3830 Mon Sep 17 00:00:00 2001 From: Bryan Irace Date: Fri, 3 May 2019 10:56:37 -0700 Subject: [PATCH 01/10] Use prettier via eslint --- .eslintrc.js | 293 +---- .prettierrc | 6 + package.json | 12 +- yarn.lock | 3144 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 3162 insertions(+), 293 deletions(-) create mode 100644 .prettierrc create mode 100644 yarn.lock diff --git a/.eslintrc.js b/.eslintrc.js index f9e49b1e55..32375e1577 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,292 +1,5 @@ module.exports = { - "env": { - "node": true, - "es6": true - }, - "extends": "eslint:recommended", - "rules": { - "accessor-pairs": "error", - "array-bracket-spacing": [ - "error", - "never" - ], - "array-callback-return": "off", - "arrow-body-style": "error", - "arrow-parens": "error", - "arrow-spacing": "error", - "block-scoped-var": "off", - "block-spacing": "off", - "brace-style": [ - "error", - "1tbs", - { - "allowSingleLine": true - } - ], - "camelcase": [ - "error", - { - "properties": "never" - } - ], - "capitalized-comments": "off", - "class-methods-use-this": "error", - "comma-dangle": "off", - "comma-spacing": "off", - "comma-style": [ - "error", - "last" - ], - "complexity": "error", - "computed-property-spacing": [ - "error", - "never" - ], - "consistent-return": "off", - "consistent-this": "off", - "curly": "error", - "default-case": "off", - "dot-location": [ - "error", - "property" - ], - "dot-notation": "error", - "eol-last": "error", - "eqeqeq": "off", - "func-call-spacing": "error", - "func-name-matching": "error", - "func-names": "off", - "func-style": [ - "error", - "declaration" - ], - "generator-star-spacing": "error", - "global-require": "off", - "guard-for-in": "off", - "handle-callback-err": "off", - "id-blacklist": "error", - "id-length": "off", - "id-match": "error", - "indent": ["error", 2], - "init-declarations": "off", - "jsx-quotes": "error", - "key-spacing": "error", - "keyword-spacing": [ - "error", - { - "after": true, - "before": true - } - ], - "line-comment-position": "off", - "linebreak-style": [ - "error", - "unix" - ], - "lines-around-comment": "error", - "lines-around-directive": "error", - "max-depth": "error", - "max-len": "off", - "max-lines": "off", - "max-nested-callbacks": "error", - "max-params": "off", - "max-statements": "off", - "max-statements-per-line": "off", - "multiline-ternary": "off", - "new-cap": "error", - "new-parens": "error", - "newline-after-var": "off", - "newline-before-return": "off", - "newline-per-chained-call": "off", - "no-alert": "error", - "no-array-constructor": "error", - "no-await-in-loop": "error", - "no-bitwise": "off", - "no-caller": "error", - "no-catch-shadow": "off", - "no-compare-neg-zero": "error", - "no-confusing-arrow": "error", - "no-continue": "off", - "no-div-regex": "error", - "no-duplicate-imports": "error", - "no-else-return": "off", - "no-empty-function": "off", - "no-eq-null": "off", - "no-eval": "error", - "no-extend-native": "error", - "no-extra-bind": "error", - "no-extra-label": "error", - "no-extra-parens": "off", - "no-floating-decimal": "error", - "no-implicit-globals": "error", - "no-implied-eval": "error", - "no-inline-comments": "off", - "no-inner-declarations": [ - "error", - "functions" - ], - "no-invalid-this": "off", - "no-iterator": "error", - "no-label-var": "error", - "no-labels": "error", - "no-lone-blocks": "error", - "no-lonely-if": "error", - "no-loop-func": "error", - "no-magic-numbers": "off", - "no-mixed-operators": "error", - "no-mixed-requires": "error", - "no-multi-assign": "off", - "no-multi-spaces": "error", - "no-multi-str": "error", - "no-multiple-empty-lines": "error", - "no-native-reassign": "error", - "no-negated-condition": "off", - "no-negated-in-lhs": "error", - "no-nested-ternary": "error", - "no-new": "error", - "no-new-func": "error", - "no-new-object": "error", - "no-new-require": "error", - "no-new-wrappers": "error", - "no-octal-escape": "error", - "no-param-reassign": "off", - "no-path-concat": "error", - "no-plusplus": [ - "error", - { - "allowForLoopAfterthoughts": true - } - ], - "no-process-env": "off", - "no-process-exit": "error", - "no-proto": "error", - "no-prototype-builtins": "off", - "no-restricted-globals": "error", - "no-restricted-imports": "error", - "no-restricted-modules": "error", - "no-restricted-properties": "error", - "no-restricted-syntax": "error", - "no-return-assign": "error", - "no-return-await": "error", - "no-script-url": "error", - "no-self-compare": "error", - "no-sequences": "error", - "no-shadow": "off", - "no-shadow-restricted-names": "error", - "no-spaced-func": "error", - "no-sync": "error", - "no-tabs": "error", - "no-template-curly-in-string": "error", - "no-ternary": "off", - "no-throw-literal": "error", - "no-trailing-spaces": "error", - "no-undef-init": "error", - "no-undefined": "off", - "no-underscore-dangle": "off", - "no-unmodified-loop-condition": "error", - "no-unneeded-ternary": "error", - "no-unused-expressions": "error", - "no-unused-vars": [ - "error", - { - "args": "none" - } - ], - "no-use-before-define": "off", - "no-useless-call": "error", - "no-useless-computed-key": "error", - "no-useless-concat": "error", - "no-useless-constructor": "error", - "no-useless-escape": "off", - "no-useless-rename": "error", - "no-useless-return": "error", - "no-var": "off", - "no-void": "error", - "no-warning-comments": "error", - "no-whitespace-before-property": "error", - "no-with": "error", - "nonblock-statement-body-position": "error", - "object-curly-newline": "off", - "object-curly-spacing": [ - "error", - "never" - ], - "object-property-newline": "off", - "object-shorthand": "off", - "one-var": "off", - "one-var-declaration-per-line": "error", - "operator-assignment": [ - "error", - "always" - ], - "operator-linebreak": "off", - "padded-blocks": "off", - "prefer-arrow-callback": "off", - "prefer-const": "error", - "prefer-destructuring": [ - "error", - { - "array": false, - "object": false - } - ], - "prefer-numeric-literals": "error", - "prefer-promise-reject-errors": "error", - "prefer-reflect": "off", - "prefer-rest-params": "off", - "prefer-spread": "off", - "prefer-template": "off", - "quote-props": "off", - "quotes": [ - "error", - "single", - { - "avoidEscape": true - } - ], - "radix": "error", - "require-await": "error", - "require-jsdoc": "off", - "rest-spread-spacing": "error", - "semi": "off", - "semi-spacing": [ - "error", - { - "after": true, - "before": false - } - ], - "sort-imports": "error", - "sort-keys": "off", - "sort-vars": "error", - "space-before-blocks": "error", - "space-before-function-paren": "off", - "space-in-parens": [ - "error", - "never" - ], - "space-infix-ops": "error", - "space-unary-ops": "error", - "spaced-comment": [ - "error", - "always" - ], - "strict": "off", - "symbol-description": "error", - "template-curly-spacing": "error", - "template-tag-spacing": "error", - "unicode-bom": [ - "error", - "never" - ], - "valid-jsdoc": "off", - "vars-on-top": "off", - "wrap-iife": "error", - "wrap-regex": "off", - "yield-star-spacing": "error", - "yoda": [ - "error", - "never" - ] - } + parser: 'babel-eslint', + plugins: ['prettier'], + extends: ['plugin:prettier/recommended'], }; diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..18a383f970 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "arrowParens": "always", + "trailingComma": "all", + "bracketSpacing": false, + "singleQuote": true +} \ No newline at end of file diff --git a/package.json b/package.json index 6977fbab59..b4c99f14e0 100644 --- a/package.json +++ b/package.json @@ -26,14 +26,19 @@ }, "main": "lib/stripe.js", "devDependencies": { + "babel-eslint": "^10.0.1", "chai": "~4.1.2", "chai-as-promised": "~7.1.1", "coveralls": "^3.0.0", - "eslint": "^4.19.1", + "eslint": "^5.16.0", + "eslint-config-prettier": "^4.1.0", + "eslint-plugin-flowtype": "^3.4.2", + "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-chai-friendly": "^0.4.0", "mocha": "~5.0.5", "nock": "^9.0.0", - "nyc": "^11.3.0" + "nyc": "^11.3.0", + "prettier": "^1.16.4" }, "dependencies": { "lodash.isplainobject": "^4.0.6", @@ -46,7 +51,8 @@ "clean": "rm -rf ./.nyc_output ./node_modules/.cache ./coverage", "mocha": "nyc mocha", "test": "npm run lint && npm run mocha", - "lint": "eslint .", + "lint": "eslint --ext .js,.jsx .", + "fix": "yarn lint --fix", "report": "nyc -r text -r lcov report", "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" } diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000000..a4902128f6 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,3144 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/generator@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041" + integrity sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ== + dependencies: + "@babel/types" "^7.4.4" + jsesc "^2.5.1" + lodash "^4.17.11" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== + dependencies: + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-split-export-declaration@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" + integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== + dependencies: + "@babel/types" "^7.4.4" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.0.0", "@babel/parser@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.4.tgz#5977129431b8fe33471730d255ce8654ae1250b6" + integrity sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w== + +"@babel/template@^7.1.0": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" + integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/traverse@^7.0.0": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.4.tgz#0776f038f6d78361860b6823887d4f3937133fe8" + integrity sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.4" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.11" + +"@babel/types@^7.0.0", "@babel/types@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" + integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ== + dependencies: + esutils "^2.0.2" + lodash "^4.17.11" + to-fast-properties "^2.0.0" + +acorn-jsx@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== + +acorn@^6.0.7: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== + +ajv@^6.5.5, ajv@^6.9.1: + version "6.10.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + integrity sha1-126/jKlNJ24keja61EpLdKthGZE= + dependencies: + default-require-extensions "^1.0.0" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= + dependencies: + arr-flatten "^1.0.1" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +assertion-error@^1.0.1, assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-eslint@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.1.tgz#919681dc099614cd7d31d45c8908695092a1faed" + integrity sha512-z7OT1iNV+TjOwHNLLyJk+HN+YVWX+CLE6fPD2SymJZOZQBs+QIexFjhm4keGTm8MW9xr4EC9Q0PbaLB24V5GoQ== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.0.0" + "@babel/traverse" "^7.0.0" + "@babel/types" "^7.0.0" + eslint-scope "3.7.1" + eslint-visitor-keys "^1.0.0" + +babel-generator@^6.18.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= + dependencies: + babel-runtime "^6.22.0" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.16.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.18.0, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.18.0, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + 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" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +caching-transform@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-1.0.1.tgz#6dbdb2f20f8d8fbce79f3e94e9d1742dcdf5c0a1" + integrity sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE= + dependencies: + md5-hex "^1.2.0" + mkdirp "^0.5.1" + write-file-atomic "^1.1.4" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +chai-as-promised@~7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.1.tgz#08645d825deb8696ee61725dbf590c012eb00ca0" + integrity sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA== + dependencies: + check-error "^1.0.2" + +chai@^4.1.2: + version "4.2.0" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" + integrity sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^3.0.1" + get-func-name "^2.0.0" + pathval "^1.1.0" + type-detect "^4.0.5" + +chai@~4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c" + integrity sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw= + dependencies: + assertion-error "^1.0.1" + check-error "^1.0.1" + deep-eql "^3.0.0" + get-func-name "^2.0.0" + pathval "^1.0.0" + type-detect "^4.0.0" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +check-error@^1.0.1, check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== + dependencies: + delayed-stream "~1.0.0" + +commander@2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ== + +commander@~2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +convert-source-map@^1.5.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== + dependencies: + safe-buffer "~5.1.1" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js@^2.4.0: + version "2.6.5" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" + integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A== + +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +coveralls@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.3.tgz#83b1c64aea1c6afa69beaf50b55ac1bc4d13e2b8" + integrity sha512-viNfeGlda2zJr8Gj1zqXpDMRjw9uM54p7wzZdvLRyOgnAfCe974Dq4veZkjJdxQXbmdppu6flEajFYseHYaUhg== + dependencies: + growl "~> 1.10.0" + js-yaml "^3.11.0" + lcov-parse "^0.0.10" + log-driver "^1.2.7" + minimist "^1.2.0" + request "^2.86.0" + +cross-spawn@^4: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + integrity sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE= + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +debug-log@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" + integrity sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8= + +debug@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +debug@^4.0.1, debug@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +deep-eql@^3.0.0, deep-eql@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== + dependencies: + type-detect "^4.0.0" + +deep-equal@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + integrity sha1-836hXT4T/9m0N9M+GnW1+5eHTLg= + dependencies: + strip-bom "^2.0.0" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= + dependencies: + repeating "^2.0.0" + +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +error-ex@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +eslint-config-prettier@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-4.2.0.tgz#70b946b629cd0e3e98233fd9ecde4cb9778de96c" + integrity sha512-y0uWc/FRfrHhpPZCYflWC8aE0KRJRY04rdZVfl8cL3sEZmOYyaBdhdlQPjKZBnuRMyLVK+JUZr7HaZFClQiH4w== + dependencies: + get-stdin "^6.0.0" + +eslint-plugin-chai-friendly@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.4.1.tgz#9eeb17f92277ba80bb64f0e946c6936a3ae707b4" + integrity sha512-hkpLN7VVoGGsofZjUhcQ+sufC3FgqMJwD0DvAcRfxY1tVRyQyVsqpaKnToPHJQOrRo0FQ0fSEDwW2gr4rsNdGA== + +eslint-plugin-flowtype@^3.4.2: + version "3.7.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.7.0.tgz#6662392f2daf6056138448b46ebc17c7a83ad337" + integrity sha512-6PAYrfSAd23C6ZTc9OhEpSn4uz5HnaXSOYzBLPiKNAE+WmNnWkgkfrswOK2Rlvn91ofZoba7SR04gitnmW9sqg== + dependencies: + lodash "^4.17.11" + +eslint-plugin-prettier@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.1.tgz#19d521e3981f69dd6d14f64aec8c6a6ac6eb0b0d" + integrity sha512-/PMttrarPAY78PLvV3xfWibMOdMDl57hmlQ2XqFeA37wd+CJ7WSxV7txqjVPHi/AAFKd2lX0ZqfsOc/i5yFCSQ== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-scope@3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug= + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + +eslint@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" + integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.9.1" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.3" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.1" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.2.2" + js-yaml "^3.13.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.11" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.2.3" + text-table "^0.2.0" + +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== + dependencies: + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + dependencies: + estraverse "^4.1.0" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= + dependencies: + is-posix-bracket "^0.1.0" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= + dependencies: + fill-range "^2.1.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +external-editor@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= + dependencies: + is-extglob "^1.0.0" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== + dependencies: + flat-cache "^2.0.1" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +find-cache-dir@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" + integrity sha1-yN765XyKUqinhPnjHFfHQumToLk= + dependencies: + commondir "^1.0.1" + mkdirp "^0.5.1" + pkg-dir "^1.0.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + +for-in@^1.0.1, for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= + dependencies: + for-in "^1.0.1" + +foreground-child@^1.5.3, foreground-child@^1.5.6: + version "1.5.6" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" + integrity sha1-T9ca0t/elnibmApcCilZN8svXOk= + dependencies: + cross-spawn "^4" + signal-exit "^3.0.0" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= + +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= + dependencies: + is-glob "^2.0.0" + +glob@7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.0.6, glob@^7.1.2, glob@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0, globals@^11.7.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== + +graceful-fs@^4.1.11, graceful-fs@^4.1.2: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +growl@1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" + integrity sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q== + +"growl@~> 1.10.0": + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +handlebars@^4.0.3: + version "4.1.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== + dependencies: + neo-async "^2.6.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= + +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= + +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +inquirer@^6.2.2: + version "6.3.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.3.1.tgz#7a413b5e7950811013a3db491c61d1f3b776e8e7" + integrity sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.11" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + +invariant@^2.2.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= + dependencies: + is-extglob "^1.0.0" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isarray@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +istanbul-lib-coverage@^1.1.2, istanbul-lib-coverage@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" + integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== + +istanbul-lib-hook@^1.1.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz#bc6bf07f12a641fbf1c85391d0daa8f0aea6bf86" + integrity sha512-/Jmq7Y1VeHnZEQ3TL10VHyb564mn6VrQXHchON9Jf/AEcmQ3ZIiyD1BVzNOKTZf/G3gE+kiGK6SmpF9y3qGPLw== + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.10.0: + version "1.10.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz#1f55ed10ac3c47f2bdddd5307935126754d0a9ca" + integrity sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A== + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.2.1" + semver "^5.3.0" + +istanbul-lib-report@^1.1.3: + version "1.1.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz#f2a657fc6282f96170aaf281eb30a458f7f4170c" + integrity sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw== + dependencies: + istanbul-lib-coverage "^1.2.1" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.2.3: + version "1.2.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.6.tgz#37b9ff661580f8fca11232752ee42e08c6675d8f" + integrity sha512-TtbsY5GIHgbMsMiRw35YBHGpZ1DVFEO19vxxeiDMYaeOFOCzfnYVxvl6pOUIZR4dtPhAGpSMup8OyF8ubsaqEg== + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.2.1" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.4.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.5.1.tgz#97e4dbf3b515e8c484caea15d6524eebd3ff4e1a" + integrity sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw== + dependencies: + handlebars "^4.0.3" + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + +js-yaml@^3.11.0, js-yaml@^3.13.0: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +lcov-parse@^0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" + integrity sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM= + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash.isplainobject@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= + +lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +log-driver@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" + integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lru-cache@^4.0.1: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +math-random@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" + integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== + +md5-hex@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" + integrity sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ= + dependencies: + md5-o-matic "^0.1.1" + +md5-o-matic@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" + integrity sha1-givM1l4RfFFPqxdrJZRdVBAKA8M= + +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= + dependencies: + mimic-fn "^1.0.0" + +merge-source-map@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646" + integrity sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw== + dependencies: + source-map "^0.6.1" + +micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +micromatch@^3.1.10: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + 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" + +mime-db@1.40.0: + version "1.40.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" + integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.24" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" + integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== + dependencies: + mime-db "1.40.0" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +mocha@~5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.0.5.tgz#e228e3386b9387a4710007a641f127b00be44b52" + integrity sha512-3MM3UjZ5p8EJrYpG7s+29HAI9G7sTzKEe4+w37Dg0QP7qL4XGsV+Q2xet2cE37AqdgN1OtYQB6Vl98YiPV3PgA== + dependencies: + browser-stdout "1.3.1" + commander "2.11.0" + debug "3.1.0" + diff "3.5.0" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.3" + he "1.1.1" + mkdirp "0.5.1" + supports-color "4.4.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +neo-async@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835" + integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +nock@^9.0.0: + version "9.6.1" + resolved "https://registry.yarnpkg.com/nock/-/nock-9.6.1.tgz#d96e099be9bc1d0189a77f4490bbbb265c381b49" + integrity sha512-EDgl/WgNQ0C1BZZlASOQkQdE6tAWXJi8QQlugqzN64JJkvZ7ILijZuG24r4vCC7yOfnm6HKpne5AGExLGCeBWg== + dependencies: + chai "^4.1.2" + debug "^3.1.0" + deep-equal "^1.0.0" + json-stringify-safe "^5.0.1" + lodash "^4.17.5" + mkdirp "^0.5.0" + propagate "^1.0.0" + qs "^6.5.1" + semver "^5.5.0" + +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +nyc@^11.3.0: + version "11.9.0" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-11.9.0.tgz#4106e89e8fbe73623a1fc8b6ecb7abaa271ae1e4" + integrity sha512-w8OdJAhXL5izerzZMdqzYKMj/pgHJyY3qEPYBjLLxrhcVoHEY9pU5ENIiZyCgG9OR7x3VcUMoD40o6PtVpfR4g== + dependencies: + archy "^1.0.0" + arrify "^1.0.1" + caching-transform "^1.0.0" + convert-source-map "^1.5.1" + debug-log "^1.0.1" + default-require-extensions "^1.0.0" + find-cache-dir "^0.1.1" + find-up "^2.1.0" + foreground-child "^1.5.3" + glob "^7.0.6" + istanbul-lib-coverage "^1.1.2" + istanbul-lib-hook "^1.1.0" + istanbul-lib-instrument "^1.10.0" + istanbul-lib-report "^1.1.3" + istanbul-lib-source-maps "^1.2.3" + istanbul-reports "^1.4.0" + md5-hex "^1.2.0" + merge-source-map "^1.1.0" + micromatch "^3.1.10" + mkdirp "^0.5.0" + resolve-from "^2.0.0" + rimraf "^2.6.2" + signal-exit "^3.0.1" + spawn-wrap "^1.4.2" + test-exclude "^4.2.0" + yargs "11.1.0" + yargs-parser "^8.0.0" + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-homedir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= + dependencies: + error-ex "^1.2.0" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-parse@^1.0.5, path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pathval@^1.0.0, pathval@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" + integrity sha1-uULm1L3mUwBe9rcTYd74cn0GReA= + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= + dependencies: + find-up "^1.0.0" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@^1.16.4: + version "1.17.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.0.tgz#53b303676eed22cc14a9f0cec09b477b3026c008" + integrity sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw== + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +propagate@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/propagate/-/propagate-1.0.0.tgz#00c2daeedda20e87e3782b344adba1cddd6ad709" + integrity sha1-AMLa7t2iDofjeCs0Stuhzd1q1wk= + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + +psl@^1.1.24: + version "1.1.31" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@^6.5.1, qs@^6.6.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +randomatic@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" + integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== + dependencies: + is-equal-shallow "^0.1.3" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.5.2, repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= + dependencies: + is-finite "^1.0.0" + +request@^2.86.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +resolve-from@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" + integrity sha1-lICrIOlP+h2egKgEx+oUdhGWa1c= + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@^1.10.0: + version "1.10.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.1.tgz#664842ac960795bbe758221cdccda61fb64b5f18" + integrity sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA== + dependencies: + path-parse "^1.0.6" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rimraf@2.6.3, rimraf@^2.6.1, rimraf@^2.6.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= + dependencies: + is-promise "^2.1.0" + +rxjs@^6.4.0: + version "6.5.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.1.tgz#f7a005a9386361921b8524f38f54cbf80e5d08f4" + integrity sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg== + dependencies: + tslib "^1.9.0" + +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.5.1: + version "5.7.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +signal-exit@^3.0.0, signal-exit@^3.0.1, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + +slide@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +spawn-wrap@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.4.2.tgz#cff58e73a8224617b6561abdc32586ea0c82248c" + integrity sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg== + dependencies: + foreground-child "^1.5.6" + mkdirp "^0.5.0" + os-homedir "^1.0.1" + rimraf "^2.6.2" + signal-exit "^3.0.2" + which "^1.3.0" + +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" + integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= + dependencies: + is-utf8 "^0.2.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +strip-json-comments@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +supports-color@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" + integrity sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ== + dependencies: + has-flag "^2.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +supports-color@^3.1.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= + dependencies: + has-flag "^1.0.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +table@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2" + integrity sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ== + dependencies: + ajv "^6.9.1" + lodash "^4.17.11" + slice-ansi "^2.1.0" + string-width "^3.0.0" + +test-exclude@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.3.tgz#a9a5e64474e4398339245a0a769ad7c2f4a97c20" + integrity sha512-SYbXgY64PT+4GAL2ocI3HwPa4Q4TBKm0cwAVeKOt/Aoc0gSpNRjJX8w0pA1LMKZ3LBmd8pYBqApFNQLII9kavA== + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + +tslib@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +uglify-js@^3.1.4: + version "3.5.10" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.10.tgz#652bef39f86d9dbfd6674407ee05a5e2d372cf2d" + integrity sha512-/GTF0nosyPLbdJBd+AwYiZ+Hu5z8KXWnO0WCGt1BQ/u9Iamhejykqmz5o1OHJ53+VAk6xVxychonnApDjuqGsw== + dependencies: + commander "~2.20.0" + source-map "~0.6.1" + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@^1.2.9, which@^1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@^1.1.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" + integrity sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8= + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + slide "^1.1.5" + +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + +yargs-parser@^8.0.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950" + integrity sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ== + dependencies: + camelcase "^4.1.0" + +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= + dependencies: + camelcase "^4.1.0" + +yargs@11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2" From e4feb6d7ecba715694dec06aba3de7f37ef93ab8 Mon Sep 17 00:00:00 2001 From: Bryan Irace Date: Fri, 3 May 2019 10:56:49 -0700 Subject: [PATCH 02/10] Run yarn fix --- examples/webhook-signing/express.js | 34 +- lib/Error.js | 52 +- lib/MultipartDataGenerator.js | 15 +- lib/ResourceNamespace.js | 2 +- lib/StripeMethod.basic.js | 109 ++- lib/StripeMethod.js | 15 +- lib/StripeResource.js | 103 ++- lib/Webhooks.js | 59 +- lib/autoPagination.js | 66 +- lib/makeRequest.js | 60 +- lib/resources/AccountLinks.js | 1 - lib/resources/Accounts.js | 4 +- lib/resources/ApplicationFees.js | 5 +- lib/resources/Balance.js | 2 - lib/resources/BitcoinReceivers.js | 5 +- lib/resources/Charges.js | 13 +- lib/resources/Checkout/Sessions.js | 2 +- lib/resources/CountrySpecs.js | 5 +- lib/resources/Coupons.js | 1 - lib/resources/CreditNotes.js | 1 - lib/resources/Customers.js | 10 +- lib/resources/Disputes.js | 7 +- lib/resources/EphemeralKeys.js | 4 +- lib/resources/Events.js | 1 - lib/resources/ExchangeRates.js | 5 +- lib/resources/FileLinks.js | 8 +- lib/resources/Files.js | 37 +- lib/resources/InvoiceItems.js | 10 +- lib/resources/Invoices.js | 43 +- lib/resources/Issuing/Cardholders.js | 9 +- lib/resources/Issuing/Cards.js | 9 +- lib/resources/Issuing/Disputes.js | 9 +- lib/resources/OAuth.js | 9 +- lib/resources/OrderReturns.js | 5 +- lib/resources/Orders.js | 6 +- lib/resources/PaymentIntents.js | 1 - lib/resources/PaymentMethods.js | 1 - lib/resources/Payouts.js | 10 +- lib/resources/Persons.js | 1 - lib/resources/Plans.js | 1 - lib/resources/Products.js | 6 +- lib/resources/Recipients.js | 12 +- lib/resources/Refunds.js | 6 +- lib/resources/Reviews.js | 2 - lib/resources/SKUs.js | 6 +- lib/resources/Sources.js | 6 +- lib/resources/SubscriptionItems.js | 3 +- .../SubscriptionScheduleRevisions.js | 2 +- lib/resources/SubscriptionSchedules.js | 9 +- lib/resources/Subscriptions.js | 3 +- lib/resources/TaxRates.js | 1 - lib/resources/Terminal/ConnectionTokens.js | 2 +- lib/resources/Terminal/Locations.js | 2 +- lib/resources/Terminal/Readers.js | 2 +- lib/resources/ThreeDSecure.js | 6 +- lib/resources/Topups.js | 9 +- lib/resources/TransferReversals.js | 1 - lib/resources/Transfers.js | 10 +- lib/resources/WebhookEndpoints.js | 1 - lib/stripe.js | 16 +- lib/utils.js | 113 ++- test/Error.spec.js | 26 +- test/StripeResource.spec.js | 156 ++-- test/Webhook.spec.js | 166 +++-- test/autoPagination.spec.js | 701 ++++++++++-------- test/flows.spec.js | 459 +++++++----- test/resources/Account.spec.js | 84 ++- test/resources/ApplicationFeeRefunds.spec.js | 19 +- test/resources/ApplicationFees.spec.js | 23 +- test/resources/Balance.spec.js | 5 +- test/resources/BitcoinReceivers.spec.js | 2 +- test/resources/ChargeRefunds.spec.js | 7 +- test/resources/Charges.spec.js | 27 +- test/resources/Checkout/Sessions.spec.js | 8 +- test/resources/CreditNotes.spec.js | 2 +- test/resources/CustomerCards.spec.js | 10 +- test/resources/CustomerSubscriptions.spec.js | 33 +- test/resources/Customers.spec.js | 145 ++-- test/resources/EphemeralKeys.spec.js | 6 +- test/resources/FileUploads.spec.js | 86 ++- test/resources/Files.spec.js | 86 ++- test/resources/Invoices.spec.js | 42 +- test/resources/Issuing/Authorization.spec.js | 6 +- test/resources/Issuing/Cardholders.spec.js | 24 +- test/resources/Issuing/Cards.spec.js | 30 +- test/resources/Issuing/Disputes.spec.js | 24 +- test/resources/Issuing/Transactions.spec.js | 20 +- test/resources/LoginLinks.spec.js | 5 +- test/resources/OAuth.spec.js | 12 +- test/resources/Orders.spec.js | 6 +- test/resources/PaymentMethods.spec.js | 4 +- test/resources/Payouts.spec.js | 3 +- test/resources/Persons.spec.js | 6 +- test/resources/Plans.spec.js | 30 +- test/resources/Products.spec.js | 2 +- test/resources/Radar/ValueListItems.spec.js | 16 +- test/resources/Radar/ValueLists.spec.js | 16 +- test/resources/RecipientCards.spec.js | 10 +- test/resources/Recipients.spec.js | 29 +- test/resources/Refunds.spec.js | 2 +- test/resources/Reporting/ReportRuns.spec.js | 16 +- test/resources/Reporting/ReportTypes.spec.js | 12 +- test/resources/SKUs.spec.js | 2 +- .../Sigma/ScheduledQueryRuns.spec.js | 2 +- test/resources/SubscriptionSchedule.spec.js | 15 +- .../SubscriptionScheduleRevision.spec.js | 14 +- test/resources/Subscriptions.spec.js | 8 +- test/resources/TaxIds.spec.js | 5 +- .../Terminal/ConnectionTokens.spec.js | 4 +- test/resources/Terminal/Locations.spec.js | 22 +- test/resources/Terminal/Readers.spec.js | 22 +- test/resources/Topups.spec.js | 4 +- test/resources/TransferReversals.spec.js | 20 +- test/resources/Transfers.spec.js | 4 +- test/resources/UsageRecordSummaries.spec.js | 32 +- test/resources/UsageRecords.spec.js | 68 +- test/stripe.spec.js | 154 ++-- test/telemetry.spec.js | 237 +++--- test/utils.spec.js | 323 ++++---- testUtils/index.js | 55 +- 120 files changed, 2557 insertions(+), 1758 deletions(-) diff --git a/examples/webhook-signing/express.js b/examples/webhook-signing/express.js index 2c64e12012..29be911f56 100644 --- a/examples/webhook-signing/express.js +++ b/examples/webhook-signing/express.js @@ -14,25 +14,29 @@ const webhookSecret = process.env.WEBHOOK_SECRET; const app = express(); // Stripe requires the raw body to construct the event -app.post('/webhooks', bodyParser.raw({type: 'application/json'}), (req, res) => { - const sig = req.headers['stripe-signature']; +app.post( + '/webhooks', + bodyParser.raw({type: 'application/json'}), + (req, res) => { + const sig = req.headers['stripe-signature']; - let event; + let event; - try { - event = stripe.webhooks.constructEvent(req.body, sig, webhookSecret); - } catch (err) { - // On error, return the error message - return res.status(400).send(`Webhook Error: ${err.message}`); - } + try { + event = stripe.webhooks.constructEvent(req.body, sig, webhookSecret); + } catch (err) { + // On error, return the error message + return res.status(400).send(`Webhook Error: ${err.message}`); + } - // Do something with event - console.log('Success:', event.id); + // Do something with event + console.log('Success:', event.id); - // Return a response to acknowledge receipt of the event - res.json({received: true}); -}); + // Return a response to acknowledge receipt of the event + res.json({received: true}); + }, +); app.listen(3000, function() { - console.log('Example app listening on port 3000!') + console.log('Example app listening on port 3000!'); }); diff --git a/lib/Error.js b/lib/Error.js index 3be4c3c734..748cf2b752 100644 --- a/lib/Error.js +++ b/lib/Error.js @@ -9,7 +9,7 @@ module.exports = _Error; */ function _Error(raw) { this.populate.apply(this, arguments); - this.stack = (new Error(this.message)).stack; + this.stack = new Error(this.message).stack; } // Extend Native Error @@ -27,13 +27,13 @@ _Error.extend = utils.protoExtend; * Create subclass of internal Error klass * (Specifically for errors returned from Stripe's REST API) */ -var StripeError = _Error.StripeError = _Error.extend({ +var StripeError = (_Error.StripeError = _Error.extend({ type: 'StripeError', populate: function(raw) { // Move from prototype def (so it appears in stringified obj) this.type = this.type; - this.stack = (new Error(raw.message)).stack; + this.stack = new Error(raw.message).stack; this.rawType = raw.type; this.code = raw.code; this.param = raw.param; @@ -44,32 +44,46 @@ var StripeError = _Error.StripeError = _Error.extend({ this.requestId = raw.requestId; this.statusCode = raw.statusCode; }, -}); +})); /** * Helper factory which takes raw stripe errors and outputs wrapping instances */ StripeError.generate = function(rawStripeError) { switch (rawStripeError.type) { - case 'card_error': - return new _Error.StripeCardError(rawStripeError); - case 'invalid_request_error': - return new _Error.StripeInvalidRequestError(rawStripeError); - case 'api_error': - return new _Error.StripeAPIError(rawStripeError); - case 'idempotency_error': - return new _Error.StripeIdempotencyError(rawStripeError); + case 'card_error': + return new _Error.StripeCardError(rawStripeError); + case 'invalid_request_error': + return new _Error.StripeInvalidRequestError(rawStripeError); + case 'api_error': + return new _Error.StripeAPIError(rawStripeError); + case 'idempotency_error': + return new _Error.StripeIdempotencyError(rawStripeError); } return new _Error('Generic', 'Unknown Error'); }; // Specific Stripe Error types: _Error.StripeCardError = StripeError.extend({type: 'StripeCardError'}); -_Error.StripeInvalidRequestError = StripeError.extend({type: 'StripeInvalidRequestError'}); +_Error.StripeInvalidRequestError = StripeError.extend({ + type: 'StripeInvalidRequestError', +}); _Error.StripeAPIError = StripeError.extend({type: 'StripeAPIError'}); -_Error.StripeAuthenticationError = StripeError.extend({type: 'StripeAuthenticationError'}); -_Error.StripePermissionError = StripeError.extend({type: 'StripePermissionError'}); -_Error.StripeRateLimitError = StripeError.extend({type: 'StripeRateLimitError'}); -_Error.StripeConnectionError = StripeError.extend({type: 'StripeConnectionError'}); -_Error.StripeSignatureVerificationError = StripeError.extend({type: 'StripeSignatureVerificationError'}); -_Error.StripeIdempotencyError = StripeError.extend({type: 'StripeIdempotencyError'}); +_Error.StripeAuthenticationError = StripeError.extend({ + type: 'StripeAuthenticationError', +}); +_Error.StripePermissionError = StripeError.extend({ + type: 'StripePermissionError', +}); +_Error.StripeRateLimitError = StripeError.extend({ + type: 'StripeRateLimitError', +}); +_Error.StripeConnectionError = StripeError.extend({ + type: 'StripeConnectionError', +}); +_Error.StripeSignatureVerificationError = StripeError.extend({ + type: 'StripeSignatureVerificationError', +}); +_Error.StripeIdempotencyError = StripeError.extend({ + type: 'StripeIdempotencyError', +}); diff --git a/lib/MultipartDataGenerator.js b/lib/MultipartDataGenerator.js index 4225375c40..ca32203a33 100644 --- a/lib/MultipartDataGenerator.js +++ b/lib/MultipartDataGenerator.js @@ -7,13 +7,15 @@ var utils = require('./utils'); // Mostly taken from Fermata.js // https://github.com/natevw/fermata/blob/5d9732a33d776ce925013a265935facd1626cc88/fermata.js#L315-L343 function multipartDataGenerator(method, data, headers) { - var segno = (Math.round(Math.random() * 1e16) + Math.round(Math.random() * 1e16)).toString(); - headers['Content-Type'] = ('multipart/form-data; boundary=' + segno); + var segno = ( + Math.round(Math.random() * 1e16) + Math.round(Math.random() * 1e16) + ).toString(); + headers['Content-Type'] = 'multipart/form-data; boundary=' + segno; var buffer = Buffer.alloc(0); function push(l) { var prevBuffer = buffer; - var newBuffer = (l instanceof Buffer) ? l : Buffer.from(l); + var newBuffer = l instanceof Buffer ? l : Buffer.from(l); buffer = Buffer.alloc(prevBuffer.length + newBuffer.length + 2); prevBuffer.copy(buffer); newBuffer.copy(buffer, prevBuffer.length); @@ -28,7 +30,12 @@ function multipartDataGenerator(method, data, headers) { var v = data[k]; push('--' + segno); if (v.hasOwnProperty('data')) { - push('Content-Disposition: form-data; name=' + q(k) + '; filename=' + q(v.name || 'blob')); + push( + 'Content-Disposition: form-data; name=' + + q(k) + + '; filename=' + + q(v.name || 'blob'), + ); push('Content-Type: ' + (v.type || 'application/octet-stream')); push(''); push(v.data); diff --git a/lib/ResourceNamespace.js b/lib/ResourceNamespace.js index 872b9c4664..2f0c053669 100644 --- a/lib/ResourceNamespace.js +++ b/lib/ResourceNamespace.js @@ -14,7 +14,7 @@ function ResourceNamespace(stripe, resources) { } module.exports = function(namespace, resources) { - return function (stripe) { + return function(stripe) { return new ResourceNamespace(stripe, resources); }; }; diff --git a/lib/StripeMethod.basic.js b/lib/StripeMethod.basic.js index cef6d8d597..6cda377c41 100644 --- a/lib/StripeMethod.basic.js +++ b/lib/StripeMethod.basic.js @@ -5,7 +5,6 @@ var stripeMethod = require('./StripeMethod'); var utils = require('./utils'); module.exports = { - create: stripeMethod({ method: 'POST', }), @@ -54,39 +53,60 @@ module.exports = { var urlData = this.createUrlData(); var path = this.createFullPath('/' + id, urlData); - return utils.callbackifyPromiseWithTimeout(new Promise((function(resolve, reject) { - if (isNull) { - // Reset metadata: - sendMetadata(null, auth); - } else if (!isObject) { - // Set individual metadata property: - var metadata = {}; - metadata[key] = value; - sendMetadata(metadata, auth); - } else { - // Set entire metadata object after resetting it: - this._request('POST', null, path, { - metadata: null, - }, auth, {}, function(err, response) { - if (err) { - return reject(err); + return utils.callbackifyPromiseWithTimeout( + new Promise( + function(resolve, reject) { + if (isNull) { + // Reset metadata: + sendMetadata(null, auth); + } else if (!isObject) { + // Set individual metadata property: + var metadata = {}; + metadata[key] = value; + sendMetadata(metadata, auth); + } else { + // Set entire metadata object after resetting it: + this._request( + 'POST', + null, + path, + { + metadata: null, + }, + auth, + {}, + function(err, response) { + if (err) { + return reject(err); + } + sendMetadata(data, auth); + }, + ); } - sendMetadata(data, auth); - }); - } - function sendMetadata(metadata, auth) { - self._request('POST', null, path, { - metadata: metadata, - }, auth, {}, function(err, response) { - if (err) { - reject(err); - } else { - resolve(response.metadata); + function sendMetadata(metadata, auth) { + self._request( + 'POST', + null, + path, + { + metadata: metadata, + }, + auth, + {}, + function(err, response) { + if (err) { + reject(err); + } else { + resolve(response.metadata); + } + }, + ); } - }); - } - }).bind(this)), cb); + }.bind(this), + ), + cb, + ); }, getMetadata: function(id, auth, cb) { @@ -98,15 +118,22 @@ module.exports = { var urlData = this.createUrlData(); var path = this.createFullPath('/' + id, urlData); - return utils.callbackifyPromiseWithTimeout(new Promise((function(resolve, reject) { - this._request('GET', null, path, {}, auth, {}, function(err, response) { - if (err) { - reject(err); - } else { - resolve(response.metadata); - } - }); - }).bind(this)), cb); + return utils.callbackifyPromiseWithTimeout( + new Promise( + function(resolve, reject) { + this._request('GET', null, path, {}, auth, {}, function( + err, + response, + ) { + if (err) { + reject(err); + } else { + resolve(response.metadata); + } + }); + }.bind(this), + ), + cb, + ); }, - }; diff --git a/lib/StripeMethod.js b/lib/StripeMethod.js index 74bdfae7d5..a79033a918 100644 --- a/lib/StripeMethod.js +++ b/lib/StripeMethod.js @@ -2,7 +2,8 @@ var utils = require('./utils'); var makeRequest = require('./makeRequest'); -var makeAutoPaginationMethods = require('./autoPagination').makeAutoPaginationMethods; +var makeAutoPaginationMethods = require('./autoPagination') + .makeAutoPaginationMethods; /** * Create an API method from the declared spec. @@ -25,10 +26,18 @@ function stripeMethod(spec) { var callback = typeof args[args.length - 1] == 'function' && args.pop(); - var requestPromise = utils.callbackifyPromiseWithTimeout(makeRequest(self, args, spec, {}), callback) + var requestPromise = utils.callbackifyPromiseWithTimeout( + makeRequest(self, args, spec, {}), + callback, + ); if (spec.methodType === 'list') { - var autoPaginationMethods = makeAutoPaginationMethods(self, args, spec, requestPromise); + var autoPaginationMethods = makeAutoPaginationMethods( + self, + args, + spec, + requestPromise, + ); Object.assign(requestPromise, autoPaginationMethods); } diff --git a/lib/StripeResource.js b/lib/StripeResource.js index f374539841..5f88de9ce2 100644 --- a/lib/StripeResource.js +++ b/lib/StripeResource.js @@ -29,7 +29,9 @@ function StripeResource(stripe, urlData) { this._stripe = stripe; this._urlData = urlData || {}; - this.basePath = utils.makeURLInterpolator(this.basePath || stripe.getApiField('basePath')); + this.basePath = utils.makeURLInterpolator( + this.basePath || stripe.getApiField('basePath'), + ); this.resourcePath = this.path; this.path = utils.makeURLInterpolator(this.path); @@ -43,7 +45,6 @@ function StripeResource(stripe, urlData) { } StripeResource.prototype = { - path: '', // Methods that don't use the API's default '/v1' path can override it with this setting. @@ -62,22 +63,23 @@ StripeResource.prototype = { validateRequest: null, createFullPath: function(commandPath, urlData) { - return path.join( - this.basePath(urlData), - this.path(urlData), - typeof commandPath == 'function' ? - commandPath(urlData) : commandPath - ).replace(/\\/g, '/'); // ugly workaround for Windows + return path + .join( + this.basePath(urlData), + this.path(urlData), + typeof commandPath == 'function' ? commandPath(urlData) : commandPath, + ) + .replace(/\\/g, '/'); // ugly workaround for Windows }, // Creates a relative resource path with symbols left in (unlike // createFullPath which takes some data to replace them with). For example it // might produce: /invoices/{id} createResourcePathWithSymbols: function(pathWithSymbols) { - return '/' + path.join( - this.resourcePath, - pathWithSymbols || '' - ).replace(/\\/g, '/'); // ugly workaround for Windows + return ( + '/' + + path.join(this.resourcePath, pathWithSymbols || '').replace(/\\/g, '/') + ); // ugly workaround for Windows }, createUrlData: function() { @@ -106,12 +108,13 @@ StripeResource.prototype = { callback.call( self, new Error.StripeConnectionError({ - message: 'Request aborted due to timeout being reached (' + timeout + 'ms)', + message: + 'Request aborted due to timeout being reached (' + timeout + 'ms)', detail: timeoutErr, }), - null + null, ); - } + }; }, _responseHandler: function(req, callback) { @@ -176,7 +179,7 @@ StripeResource.prototype = { exception: e, requestId: headers['request-id'], }), - null + null, ); } @@ -194,7 +197,12 @@ StripeResource.prototype = { }, _generateConnectionErrorMessage: function(requestRetries) { - return 'An error occurred with our connection to Stripe.' + (requestRetries > 0 ? ' Request was retried ' + requestRetries + ' times.' : ''); + return ( + 'An error occurred with our connection to Stripe.' + + (requestRetries > 0 + ? ' Request was retried ' + requestRetries + ' times.' + : '') + ); }, _errorHandler: function(req, requestRetries, callback) { @@ -210,9 +218,9 @@ StripeResource.prototype = { message: self._generateConnectionErrorMessage(requestRetries), detail: error, }), - null + null, ); - } + }; }, _shouldRetry: function(res, numRetries) { @@ -249,7 +257,7 @@ StripeResource.prototype = { // maxNetworkRetryDelay. var sleepSeconds = Math.min( initialNetworkRetryDelay * Math.pow(numRetries - 1, 2), - maxNetworkRetryDelay + maxNetworkRetryDelay, ); // Apply some jitter by randomizing the value in the range of @@ -263,7 +271,8 @@ StripeResource.prototype = { }, _defaultHeaders: function(auth, contentLength, apiVersion) { - var userAgentString = 'Stripe/v1 NodeBindings/' + this._stripe.getConstant('PACKAGE_VERSION'); + var userAgentString = + 'Stripe/v1 NodeBindings/' + this._stripe.getConstant('PACKAGE_VERSION'); if (this._stripe._appInfo) { userAgentString += ' ' + this._stripe.getAppInfoAsString(); @@ -271,10 +280,8 @@ StripeResource.prototype = { var headers = { // Use specified auth token or use default from this stripe instance: - 'Authorization': auth ? - 'Bearer ' + auth : - this._stripe.getApiField('auth'), - 'Accept': 'application/json', + Authorization: auth ? 'Bearer ' + auth : this._stripe.getApiField('auth'), + Accept: 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': contentLength, 'User-Agent': userAgentString, @@ -288,22 +295,30 @@ StripeResource.prototype = { }, _addTelemetryHeader: function(headers) { - if (this._stripe.getTelemetryEnabled() && this._stripe._prevRequestMetrics.length > 0) { + if ( + this._stripe.getTelemetryEnabled() && + this._stripe._prevRequestMetrics.length > 0 + ) { var metrics = this._stripe._prevRequestMetrics.shift(); headers['X-Stripe-Client-Telemetry'] = JSON.stringify({ - 'last_request_metrics': metrics + last_request_metrics: metrics, }); } }, _recordRequestMetrics: function(requestId, requestDurationMs) { if (this._stripe.getTelemetryEnabled() && requestId) { - if (this._stripe._prevRequestMetrics.length > StripeResource.MAX_BUFFERED_REQUEST_METRICS) { - utils.emitWarning('Request metrics buffer is full, dropping telemetry message.'); + if ( + this._stripe._prevRequestMetrics.length > + StripeResource.MAX_BUFFERED_REQUEST_METRICS + ) { + utils.emitWarning( + 'Request metrics buffer is full, dropping telemetry message.', + ); } else { this._stripe._prevRequestMetrics.push({ - 'request_id': requestId, - 'request_duration_ms': requestDurationMs, + request_id: requestId, + request_duration_ms: requestDurationMs, }); } } @@ -339,7 +354,12 @@ StripeResource.prototype = { } if (self.requestDataProcessor) { - self.requestDataProcessor(method, data, options.headers, makeRequestWithData); + self.requestDataProcessor( + method, + data, + options.headers, + makeRequestWithData, + ); } else { makeRequestWithData(null, utils.stringifyRequestData(data || {})); } @@ -352,7 +372,7 @@ StripeResource.prototype = { self._getSleepTimeInMS(requestRetries), apiVersion, headers, - requestRetries + requestRetries, ); } @@ -364,9 +384,7 @@ StripeResource.prototype = { agent = isInsecureConnection ? defaultHttpAgent : defaultHttpsAgent; } - var req = ( - isInsecureConnection ? http : https - ).request({ + var req = (isInsecureConnection ? http : https).request({ host: host || self._stripe.getApiField('host'), port: self._stripe.getApiField('port'), path: path, @@ -420,11 +438,14 @@ StripeResource.prototype = { req.on('socket', function(socket) { if (socket.connecting) { - socket.on((isInsecureConnection ? 'connect' : 'secureConnect'), function() { - // Send payload; we're safe: - req.write(requestData); - req.end(); - }); + socket.on( + isInsecureConnection ? 'connect' : 'secureConnect', + function() { + // Send payload; we're safe: + req.write(requestData); + req.end(); + }, + ); } else { // we're already connected req.write(requestData); diff --git a/lib/Webhooks.js b/lib/Webhooks.js index ecbe09e603..9bec6550c2 100644 --- a/lib/Webhooks.js +++ b/lib/Webhooks.js @@ -10,7 +10,12 @@ var Webhook = { DEFAULT_TOLERANCE: 300, // 5 minutes constructEvent: function(payload, header, secret, tolerance) { - this.signature.verifyHeader(payload, header, secret, tolerance || Webhook.DEFAULT_TOLERANCE); + this.signature.verifyHeader( + payload, + header, + secret, + tolerance || Webhook.DEFAULT_TOLERANCE, + ); var jsonPayload = JSON.parse(payload); return jsonPayload; @@ -21,7 +26,8 @@ var signature = { EXPECTED_SCHEME: 'v1', _computeSignature: function(payload, secret) { - return crypto.createHmac('sha256', secret) + return crypto + .createHmac('sha256', secret) .update(payload, 'utf8') .digest('hex'); }, @@ -52,15 +58,19 @@ var signature = { }); } - var expectedSignature = this._computeSignature(details.timestamp + '.' + payload, secret); + var expectedSignature = this._computeSignature( + details.timestamp + '.' + payload, + secret, + ); - var signatureFound = !!details.signatures - .filter(utils.secureCompare.bind(utils, expectedSignature)) - .length; + var signatureFound = !!details.signatures.filter( + utils.secureCompare.bind(utils, expectedSignature), + ).length; if (!signatureFound) { throw new Error.StripeSignatureVerificationError({ - message: 'No signatures found matching the expected signature for payload.' + + message: + 'No signatures found matching the expected signature for payload.' + ' Are you passing the raw request body you received from Stripe?' + ' https://github.com/stripe/stripe-node#webhook-signing', detail: { @@ -91,22 +101,25 @@ function parseHeader(header, scheme) { return null; } - return header.split(',').reduce(function(accum, item) { - var kv = item.split('='); - - if (kv[0] === 't') { - accum.timestamp = kv[1]; - } - - if (kv[0] === scheme) { - accum.signatures.push(kv[1]); - } - - return accum; - }, { - timestamp: -1, - signatures: [], - }); + return header.split(',').reduce( + function(accum, item) { + var kv = item.split('='); + + if (kv[0] === 't') { + accum.timestamp = kv[1]; + } + + if (kv[0] === scheme) { + accum.signatures.push(kv[1]); + } + + return accum; + }, + { + timestamp: -1, + signatures: [], + }, + ); } Webhook.signature = signature; diff --git a/lib/autoPagination.js b/lib/autoPagination.js index 2a21c416c2..e060afdf96 100644 --- a/lib/autoPagination.js +++ b/lib/autoPagination.js @@ -9,8 +9,16 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { var i = 0; function iterate(listResult) { - if (!(listResult && listResult.data && typeof listResult.data.length === 'number')) { - throw Error('Unexpected: Stripe API response does not have a well-formed `data` array.'); + if ( + !( + listResult && + listResult.data && + typeof listResult.data.length === 'number' + ) + ) { + throw Error( + 'Unexpected: Stripe API response does not have a well-formed `data` array.', + ); } if (i < listResult.data.length) { @@ -21,7 +29,9 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { // Reset counter, request next page, and recurse. i = 0; var lastId = getLastId(listResult); - listPromise = makeRequest(self, requestArgs, spec, {starting_after: lastId}); + listPromise = makeRequest(self, requestArgs, spec, { + starting_after: lastId, + }); return listPromise.then(iterate); } return {value: undefined, done: true}; @@ -51,7 +61,7 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { }, [getAsyncIteratorSymbol()]: function() { return autoPaginationMethods; - } + }, }; return autoPaginationMethods; } @@ -78,7 +88,10 @@ function getDoneCallback(args) { } var onDone = args[1]; if (typeof onDone !== 'function') { - throw Error('The second argument to autoPagingEach, if present, must be a callback function; receieved ' + typeof onDone); + throw Error( + 'The second argument to autoPagingEach, if present, must be a callback function; receieved ' + + typeof onDone, + ); } return onDone; } @@ -100,7 +113,10 @@ function getItemCallback(args) { } var onItem = args[0]; if (typeof onItem !== 'function') { - throw Error('The first argument to autoPagingEach, if present, must be a callback function; receieved ' + typeof onItem); + throw Error( + 'The first argument to autoPagingEach, if present, must be a callback function; receieved ' + + typeof onItem, + ); } // 4. `.autoPagingEach((item, next) => { doSomething(item); next(false); });` @@ -109,7 +125,10 @@ function getItemCallback(args) { } if (onItem.length > 2) { - throw Error('The `onItem` callback function passed to autoPagingEach must accept at most two arguments; got ' + onItem); + throw Error( + 'The `onItem` callback function passed to autoPagingEach must accept at most two arguments; got ' + + onItem, + ); } // This magically handles all three of these usecases (the latter two being functionally identical): @@ -127,7 +146,9 @@ function getLastId(listResult) { var lastItem = listResult.data[lastIdx]; var lastId = lastItem && lastItem.id; if (!lastId) { - throw Error('Unexpected: No `id` found on the last item while auto-paging a list.'); + throw Error( + 'Unexpected: No `id` found on the last item while auto-paging a list.', + ); } return lastId; } @@ -157,19 +178,26 @@ function makeAutoPagingEach(asyncIteratorNext) { throw Error('autoPagingEach takes up to two arguments; received:', args); } - var autoPagePromise = wrapAsyncIteratorWithCallback(asyncIteratorNext, onItem); + var autoPagePromise = wrapAsyncIteratorWithCallback( + asyncIteratorNext, + onItem, + ); return utils.callbackifyPromiseWithTimeout(autoPagePromise, onDone); - } + }; } function makeAutoPagingToArray(autoPagingEach) { return function autoPagingToArray(opts, onDone) { var limit = opts && opts.limit; if (!limit) { - throw Error('You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.'); + throw Error( + 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.', + ); } if (limit > 10000) { - throw Error('You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.'); + throw Error( + 'You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.', + ); } var promise = new Promise(function(resolve, reject) { var items = []; @@ -178,12 +206,14 @@ function makeAutoPagingToArray(autoPagingEach) { if (items.length >= limit) { return false; } - }).then(function() { - resolve(items); - }).catch(reject); + }) + .then(function() { + resolve(items); + }) + .catch(reject); }); return utils.callbackifyPromiseWithTimeout(promise, onDone); - } + }; } function wrapAsyncIteratorWithCallback(asyncIteratorNext, onItem) { @@ -209,6 +239,8 @@ function wrapAsyncIteratorWithCallback(asyncIteratorNext, onItem) { }); } - asyncIteratorNext().then(handleIteration).catch(reject); + asyncIteratorNext() + .then(handleIteration) + .catch(reject); }); } diff --git a/lib/makeRequest.js b/lib/makeRequest.js index c55ac3aaa3..9d55d90970 100644 --- a/lib/makeRequest.js +++ b/lib/makeRequest.js @@ -5,11 +5,17 @@ var OPTIONAL_REGEX = /^optional!/; function getRequestOpts(self, requestArgs, spec, overrideData) { // Extract spec values with defaults. - var commandPath = typeof spec.path == 'function' ? spec.path - : utils.makeURLInterpolator(spec.path || ''); + var commandPath = + typeof spec.path == 'function' + ? spec.path + : utils.makeURLInterpolator(spec.path || ''); var requestMethod = (spec.method || 'GET').toUpperCase(); var urlParams = spec.urlParams || []; - var encode = spec.encode || function(data) {return data;}; + var encode = + spec.encode || + function(data) { + return data; + }; var host = spec.host; // Don't mutate args externally. @@ -32,8 +38,13 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { if (param == 'id' && typeof arg !== 'string') { path = self.createResourcePathWithSymbols(spec.path); throw new Error( - 'Stripe: "id" must be a string, but got: ' + typeof arg + - ' (on API request to `' + requestMethod + ' ' + path + '`)' + 'Stripe: "id" must be a string, but got: ' + + typeof arg + + ' (on API request to `' + + requestMethod + + ' ' + + path + + '`)', ); } @@ -45,8 +56,15 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { path = self.createResourcePathWithSymbols(spec.path); throw new Error( - 'Stripe: Argument "' + urlParams[i] + '" required, but got: ' + arg + - ' (on API request to `' + requestMethod + ' ' + path + '`)' + 'Stripe: Argument "' + + urlParams[i] + + '" required, but got: ' + + arg + + ' (on API request to `' + + requestMethod + + ' ' + + path + + '`)', ); } @@ -62,9 +80,15 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { if (args.length) { path = self.createResourcePathWithSymbols(spec.path); throw new Error( - 'Stripe: Unknown arguments (' + args + '). Did you mean to pass an options ' + - 'object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.' + - ' (on API request to ' + requestMethod + ' `' + path + '`)' + 'Stripe: Unknown arguments (' + + args + + '). Did you mean to pass an options ' + + 'object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.' + + ' (on API request to ' + + requestMethod + + ' `' + + path + + '`)', ); } @@ -99,14 +123,22 @@ function makeRequest(self, requestArgs, spec, overrideData) { reject(err); } else { resolve( - spec.transformResponseData ? - spec.transformResponseData(response) : - response + spec.transformResponseData + ? spec.transformResponseData(response) + : response, ); } } - self._request(opts.requestMethod, opts.host, opts.requestPath, opts.data, opts.auth, {headers: opts.headers}, requestCallback); + self._request( + opts.requestMethod, + opts.host, + opts.requestPath, + opts.data, + opts.auth, + {headers: opts.headers}, + requestCallback, + ); }); } diff --git a/lib/resources/AccountLinks.js b/lib/resources/AccountLinks.js index 33bd4a2940..d3ce047afd 100644 --- a/lib/resources/AccountLinks.js +++ b/lib/resources/AccountLinks.js @@ -4,4 +4,3 @@ module.exports = require('../StripeResource').extend({ path: 'account_links', includeBasic: ['create'], }); - diff --git a/lib/resources/Accounts.js b/lib/resources/Accounts.js index 2dfd46d571..7e8b4b8781 100644 --- a/lib/resources/Accounts.js +++ b/lib/resources/Accounts.js @@ -93,8 +93,8 @@ module.exports = StripeResource.extend({ }), /** - * Accounts: LoginLink methods - */ + * Accounts: LoginLink methods + */ createLoginLink: stripeMethod({ method: 'POST', diff --git a/lib/resources/ApplicationFees.js b/lib/resources/ApplicationFees.js index 0e96e4ed65..ec41ed3171 100644 --- a/lib/resources/ApplicationFees.js +++ b/lib/resources/ApplicationFees.js @@ -4,12 +4,9 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'application_fees', - includeBasic: [ - 'list', 'retrieve', - ], + includeBasic: ['list', 'retrieve'], refund: stripeMethod({ method: 'POST', diff --git a/lib/resources/Balance.js b/lib/resources/Balance.js index a6c5f1655c..7e8adb9116 100644 --- a/lib/resources/Balance.js +++ b/lib/resources/Balance.js @@ -4,7 +4,6 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'balance', retrieve: stripeMethod({ @@ -22,5 +21,4 @@ module.exports = StripeResource.extend({ path: 'history/{transactionId}', urlParams: ['transactionId'], }), - }); diff --git a/lib/resources/BitcoinReceivers.js b/lib/resources/BitcoinReceivers.js index 430db040ed..600e7ed7b4 100644 --- a/lib/resources/BitcoinReceivers.js +++ b/lib/resources/BitcoinReceivers.js @@ -4,12 +4,9 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'bitcoin/receivers', - includeBasic: [ - 'list', 'retrieve', 'getMetadata', - ], + includeBasic: ['list', 'retrieve', 'getMetadata'], listTransactions: stripeMethod({ method: 'GET', diff --git a/lib/resources/Charges.js b/lib/resources/Charges.js index 28a0798aeb..ebcfeb1fb0 100644 --- a/lib/resources/Charges.js +++ b/lib/resources/Charges.js @@ -4,12 +4,15 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'charges', includeBasic: [ - 'create', 'list', 'retrieve', 'update', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', ], capture: stripeMethod({ @@ -66,10 +69,10 @@ module.exports = StripeResource.extend({ }), markAsSafe: function(chargeId) { - return this.update(chargeId, {'fraud_details': {'user_report': 'safe'}}) + return this.update(chargeId, {fraud_details: {user_report: 'safe'}}); }, markAsFraudulent: function(chargeId) { - return this.update(chargeId, {'fraud_details': {'user_report': 'fraudulent'}}) + return this.update(chargeId, {fraud_details: {user_report: 'fraudulent'}}); }, }); diff --git a/lib/resources/Checkout/Sessions.js b/lib/resources/Checkout/Sessions.js index 3accef7cc0..936377c45a 100644 --- a/lib/resources/Checkout/Sessions.js +++ b/lib/resources/Checkout/Sessions.js @@ -5,4 +5,4 @@ var StripeResource = require('../../StripeResource'); module.exports = StripeResource.extend({ path: 'checkout/sessions', includeBasic: ['create', 'retrieve'], -}) +}); diff --git a/lib/resources/CountrySpecs.js b/lib/resources/CountrySpecs.js index 25210ac31a..690b77cd12 100644 --- a/lib/resources/CountrySpecs.js +++ b/lib/resources/CountrySpecs.js @@ -3,10 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'country_specs', - includeBasic: [ - 'list', 'retrieve', - ], + includeBasic: ['list', 'retrieve'], }); diff --git a/lib/resources/Coupons.js b/lib/resources/Coupons.js index a9f519afa3..89c9191a91 100644 --- a/lib/resources/Coupons.js +++ b/lib/resources/Coupons.js @@ -4,4 +4,3 @@ module.exports = require('../StripeResource').extend({ path: 'coupons', includeBasic: ['create', 'list', 'update', 'retrieve', 'del'], }); - diff --git a/lib/resources/CreditNotes.js b/lib/resources/CreditNotes.js index 24df5aca90..6043c04b41 100644 --- a/lib/resources/CreditNotes.js +++ b/lib/resources/CreditNotes.js @@ -4,7 +4,6 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'credit_notes', includeBasic: ['create', 'list', 'retrieve', 'update'], diff --git a/lib/resources/Customers.js b/lib/resources/Customers.js index 6a182612ad..cdfa6e9e04 100644 --- a/lib/resources/Customers.js +++ b/lib/resources/Customers.js @@ -5,11 +5,15 @@ var utils = require('../utils'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'customers', includeBasic: [ - 'create', 'list', 'retrieve', 'update', 'del', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'del', + 'setMetadata', + 'getMetadata', ], /** diff --git a/lib/resources/Disputes.js b/lib/resources/Disputes.js index eff2aba687..4a60c73eab 100644 --- a/lib/resources/Disputes.js +++ b/lib/resources/Disputes.js @@ -4,18 +4,13 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'disputes', - includeBasic: [ - 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata', - ], + includeBasic: ['list', 'retrieve', 'update', 'setMetadata', 'getMetadata'], close: stripeMethod({ method: 'POST', path: '/{id}/close', urlParams: ['id'], }), - }); - diff --git a/lib/resources/EphemeralKeys.js b/lib/resources/EphemeralKeys.js index 2be6f9c9d5..002cce7ec4 100644 --- a/lib/resources/EphemeralKeys.js +++ b/lib/resources/EphemeralKeys.js @@ -8,7 +8,9 @@ module.exports = StripeResource.extend({ method: 'POST', validator: function(data, options) { if (!options.headers || !options.headers['Stripe-Version']) { - throw new Error('stripe_version must be specified to create an ephemeral key'); + throw new Error( + 'stripe_version must be specified to create an ephemeral key', + ); } }, }), diff --git a/lib/resources/Events.js b/lib/resources/Events.js index ae4f092432..8de01785c6 100644 --- a/lib/resources/Events.js +++ b/lib/resources/Events.js @@ -4,4 +4,3 @@ module.exports = require('../StripeResource').extend({ path: 'events', includeBasic: ['list', 'retrieve'], }); - diff --git a/lib/resources/ExchangeRates.js b/lib/resources/ExchangeRates.js index a7d3b10853..b97e82eae8 100644 --- a/lib/resources/ExchangeRates.js +++ b/lib/resources/ExchangeRates.js @@ -3,10 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'exchange_rates', - includeBasic: [ - 'list', 'retrieve', - ], + includeBasic: ['list', 'retrieve'], }); diff --git a/lib/resources/FileLinks.js b/lib/resources/FileLinks.js index 8052fc7f02..a07235a5a5 100644 --- a/lib/resources/FileLinks.js +++ b/lib/resources/FileLinks.js @@ -3,9 +3,13 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'file_links', includeBasic: [ - 'create', 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', ], }); diff --git a/lib/resources/Files.js b/lib/resources/Files.js index 0315d3092d..8e8f850b37 100644 --- a/lib/resources/Files.js +++ b/lib/resources/Files.js @@ -8,7 +8,6 @@ var multipartDataGenerator = require('../MultipartDataGenerator'); var Error = require('../Error'); module.exports = StripeResource.extend({ - requestDataProcessor: function(method, data, headers, callback) { data = data || {}; @@ -28,19 +27,22 @@ module.exports = StripeResource.extend({ } } - function streamProcessor (fn) { + function streamProcessor(fn) { var bufferArray = []; - data.file.data.on('data', function(line) { - bufferArray.push(line); - }).on('end', function() { - var bufferData = Object.assign({}, data); - bufferData.file.data = Buffer.concat(bufferArray); - var buffer = fn(method, bufferData, headers); - callback(null, buffer); - }).on('error', function(err) { - var errorHandler = streamError(callback); - errorHandler(err); - }); + data.file.data + .on('data', function(line) { + bufferArray.push(line); + }) + .on('end', function() { + var bufferData = Object.assign({}, data); + bufferData.file.data = Buffer.concat(bufferArray); + var buffer = fn(method, bufferData, headers); + callback(null, buffer); + }) + .on('error', function(err) { + var errorHandler = streamError(callback); + errorHandler(err); + }); } function streamError(callback) { @@ -50,17 +52,18 @@ module.exports = StripeResource.extend({ this.type = this.type; this.message = raw.message; this.detail = raw.detail; - } + }, }); return function(error) { callback( new StreamProcessingError({ - message: 'An error occurred while attempting to process the file for upload.', + message: + 'An error occurred while attempting to process the file for upload.', detail: error, }), - null + null, ); - } + }; } }, diff --git a/lib/resources/InvoiceItems.js b/lib/resources/InvoiceItems.js index 00af738ed5..38739d2b7e 100644 --- a/lib/resources/InvoiceItems.js +++ b/lib/resources/InvoiceItems.js @@ -3,8 +3,12 @@ module.exports = require('../StripeResource').extend({ path: 'invoiceitems', includeBasic: [ - 'create', 'list', 'retrieve', 'update', 'del', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'del', + 'setMetadata', + 'getMetadata', ], }); - diff --git a/lib/resources/Invoices.js b/lib/resources/Invoices.js index cac74797ce..a6e21c7f8b 100644 --- a/lib/resources/Invoices.js +++ b/lib/resources/Invoices.js @@ -5,7 +5,6 @@ var stripeMethod = StripeResource.method; var utils = require('../utils'); module.exports = StripeResource.extend({ - path: 'invoices', includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], @@ -40,25 +39,51 @@ module.exports = StripeResource.extend({ var hasParam = false; // If you pass just a hash with the relevant parameters, including customer id inside. - if (urlData.invoiceOptionsOrCustomerId && typeof urlData.invoiceOptionsOrCustomerId === 'object') { - return url + utils.stringifyRequestData(urlData.invoiceOptionsOrCustomerId); + if ( + urlData.invoiceOptionsOrCustomerId && + typeof urlData.invoiceOptionsOrCustomerId === 'object' + ) { + return ( + url + utils.stringifyRequestData(urlData.invoiceOptionsOrCustomerId) + ); } // Legacy implementation where the first parameter is a customer id as a string - if (urlData.invoiceOptionsOrCustomerId && typeof urlData.invoiceOptionsOrCustomerId === 'string') { + if ( + urlData.invoiceOptionsOrCustomerId && + typeof urlData.invoiceOptionsOrCustomerId === 'string' + ) { url = url + 'customer=' + urlData.invoiceOptionsOrCustomerId; hasParam = true; } // Legacy support where second argument is the subscription id - if (urlData.invoiceOptionsOrSubscriptionId && typeof urlData.invoiceOptionsOrSubscriptionId === 'string') { - return url + (hasParam ? '&' : '') + 'subscription=' + urlData.invoiceOptionsOrSubscriptionId; - } else if (urlData.invoiceOptionsOrSubscriptionId && typeof urlData.invoiceOptionsOrSubscriptionId === 'object') { - return url + (hasParam ? '&' : '') + utils.stringifyRequestData(urlData.invoiceOptionsOrSubscriptionId); + if ( + urlData.invoiceOptionsOrSubscriptionId && + typeof urlData.invoiceOptionsOrSubscriptionId === 'string' + ) { + return ( + url + + (hasParam ? '&' : '') + + 'subscription=' + + urlData.invoiceOptionsOrSubscriptionId + ); + } else if ( + urlData.invoiceOptionsOrSubscriptionId && + typeof urlData.invoiceOptionsOrSubscriptionId === 'object' + ) { + return ( + url + + (hasParam ? '&' : '') + + utils.stringifyRequestData(urlData.invoiceOptionsOrSubscriptionId) + ); } return url; }, - urlParams: ['optional!invoiceOptionsOrCustomerId', 'optional!invoiceOptionsOrSubscriptionId'], + urlParams: [ + 'optional!invoiceOptionsOrCustomerId', + 'optional!invoiceOptionsOrSubscriptionId', + ], }), sendInvoice: stripeMethod({ diff --git a/lib/resources/Issuing/Cardholders.js b/lib/resources/Issuing/Cardholders.js index e8a175e918..0e6e5a8bfe 100644 --- a/lib/resources/Issuing/Cardholders.js +++ b/lib/resources/Issuing/Cardholders.js @@ -4,5 +4,12 @@ var StripeResource = require('../../StripeResource'); module.exports = StripeResource.extend({ path: 'issuing/cardholders', - includeBasic: ['create', 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata'], + includeBasic: [ + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', + ], }); diff --git a/lib/resources/Issuing/Cards.js b/lib/resources/Issuing/Cards.js index 99199642e8..5f5664b88f 100644 --- a/lib/resources/Issuing/Cards.js +++ b/lib/resources/Issuing/Cards.js @@ -6,7 +6,14 @@ var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ path: 'issuing/cards', - includeBasic: ['create', 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata'], + includeBasic: [ + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', + ], retrieveDetails: stripeMethod({ method: 'GET', diff --git a/lib/resources/Issuing/Disputes.js b/lib/resources/Issuing/Disputes.js index 296fa779f7..096ba8eb43 100644 --- a/lib/resources/Issuing/Disputes.js +++ b/lib/resources/Issuing/Disputes.js @@ -4,5 +4,12 @@ var StripeResource = require('../../StripeResource'); module.exports = StripeResource.extend({ path: 'issuing/disputes', - includeBasic: ['create', 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata'], + includeBasic: [ + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', + ], }); diff --git a/lib/resources/OAuth.js b/lib/resources/OAuth.js index 1649599119..7258b8c371 100644 --- a/lib/resources/OAuth.js +++ b/lib/resources/OAuth.js @@ -32,7 +32,14 @@ module.exports = StripeResource.extend({ params.scope = 'read_write'; } - return 'https://' + oAuthHost + '/' + path + '?' + utils.stringifyRequestData(params); + return ( + 'https://' + + oAuthHost + + '/' + + path + + '?' + + utils.stringifyRequestData(params) + ); }, token: stripeMethod({ diff --git a/lib/resources/OrderReturns.js b/lib/resources/OrderReturns.js index 777821a682..b0e1be62e3 100644 --- a/lib/resources/OrderReturns.js +++ b/lib/resources/OrderReturns.js @@ -3,10 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'order_returns', - includeBasic: [ - 'list', 'retrieve', - ], + includeBasic: ['list', 'retrieve'], }); diff --git a/lib/resources/Orders.js b/lib/resources/Orders.js index 0e32b3fdca..58e420ec3e 100644 --- a/lib/resources/Orders.js +++ b/lib/resources/Orders.js @@ -4,12 +4,9 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'orders', - includeBasic: [ - 'create', 'list', 'retrieve', 'update', - ], + includeBasic: ['create', 'list', 'retrieve', 'update'], pay: stripeMethod({ method: 'POST', @@ -22,5 +19,4 @@ module.exports = StripeResource.extend({ path: '/{orderId}/returns', urlParams: ['orderId'], }), - }); diff --git a/lib/resources/PaymentIntents.js b/lib/resources/PaymentIntents.js index fae0950b27..70a90ab5d0 100644 --- a/lib/resources/PaymentIntents.js +++ b/lib/resources/PaymentIntents.js @@ -25,4 +25,3 @@ module.exports = StripeResource.extend({ urlParams: ['paymentIntentId'], }), }); - diff --git a/lib/resources/PaymentMethods.js b/lib/resources/PaymentMethods.js index 54f3c829c5..4b8601aa25 100644 --- a/lib/resources/PaymentMethods.js +++ b/lib/resources/PaymentMethods.js @@ -4,7 +4,6 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_methods', includeBasic: ['create', 'list', 'retrieve', 'update'], diff --git a/lib/resources/Payouts.js b/lib/resources/Payouts.js index 433b5b04ae..ec1d8afd35 100644 --- a/lib/resources/Payouts.js +++ b/lib/resources/Payouts.js @@ -4,12 +4,15 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payouts', includeBasic: [ - 'create', 'list', 'retrieve', 'update', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', ], cancel: stripeMethod({ @@ -25,4 +28,3 @@ module.exports = StripeResource.extend({ methodType: 'list', }), }); - diff --git a/lib/resources/Persons.js b/lib/resources/Persons.js index 605bd24b48..6429dd0d26 100644 --- a/lib/resources/Persons.js +++ b/lib/resources/Persons.js @@ -18,4 +18,3 @@ module.exports = StripeResource.extend({ path: 'accounts/{accountId}/persons', includeBasic: ['create', 'del', 'list', 'retrieve', 'update'], }); - diff --git a/lib/resources/Plans.js b/lib/resources/Plans.js index a7d01bae8a..0373839c82 100644 --- a/lib/resources/Plans.js +++ b/lib/resources/Plans.js @@ -4,4 +4,3 @@ module.exports = require('../StripeResource').extend({ path: 'plans', includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], }); - diff --git a/lib/resources/Products.js b/lib/resources/Products.js index d8bcedef5c..6188963d58 100644 --- a/lib/resources/Products.js +++ b/lib/resources/Products.js @@ -3,11 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'products', - includeBasic: [ - 'create', 'list', 'retrieve', 'update', 'del', - ], - + includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], }); diff --git a/lib/resources/Recipients.js b/lib/resources/Recipients.js index 536e98f730..9fce05a6b2 100644 --- a/lib/resources/Recipients.js +++ b/lib/resources/Recipients.js @@ -4,11 +4,15 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'recipients', includeBasic: [ - 'create', 'list', 'retrieve', 'update', 'del', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'del', + 'setMetadata', + 'getMetadata', ], createCard: stripeMethod({ @@ -41,6 +45,4 @@ module.exports = StripeResource.extend({ path: '/{recipientId}/cards/{cardId}', urlParams: ['recipientId', 'cardId'], }), - }); - diff --git a/lib/resources/Refunds.js b/lib/resources/Refunds.js index e4e70c1eb4..a1351a27d2 100644 --- a/lib/resources/Refunds.js +++ b/lib/resources/Refunds.js @@ -3,11 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'refunds', - includeBasic: [ - 'create', 'list', 'retrieve', 'update', - ], + includeBasic: ['create', 'list', 'retrieve', 'update'], }); - diff --git a/lib/resources/Reviews.js b/lib/resources/Reviews.js index 9eeb7f413e..6d3fb2c4f1 100644 --- a/lib/resources/Reviews.js +++ b/lib/resources/Reviews.js @@ -4,7 +4,6 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reviews', includeBasic: ['list', 'retrieve'], @@ -15,4 +14,3 @@ module.exports = StripeResource.extend({ urlParams: ['id'], }), }); - diff --git a/lib/resources/SKUs.js b/lib/resources/SKUs.js index 0364ed4ed2..18aefab236 100644 --- a/lib/resources/SKUs.js +++ b/lib/resources/SKUs.js @@ -3,11 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'skus', - includeBasic: [ - 'create', 'list', 'retrieve', 'update', 'del', - ], - + includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], }); diff --git a/lib/resources/Sources.js b/lib/resources/Sources.js index 255896dd38..d0e103509e 100644 --- a/lib/resources/Sources.js +++ b/lib/resources/Sources.js @@ -4,12 +4,9 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'sources', - includeBasic: [ - 'create', 'retrieve', 'update', 'setMetadata', 'getMetadata', - ], + includeBasic: ['create', 'retrieve', 'update', 'setMetadata', 'getMetadata'], listSourceTransactions: stripeMethod({ method: 'GET', @@ -23,5 +20,4 @@ module.exports = StripeResource.extend({ path: '/{id}/verify', urlParams: ['id'], }), - }); diff --git a/lib/resources/SubscriptionItems.js b/lib/resources/SubscriptionItems.js index ea6e8e006e..c6f325ecae 100644 --- a/lib/resources/SubscriptionItems.js +++ b/lib/resources/SubscriptionItems.js @@ -4,6 +4,5 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ path: 'subscription_items', - includeBasic: ['create', 'list', 'retrieve', 'update', 'del',], + includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], }); - diff --git a/lib/resources/SubscriptionScheduleRevisions.js b/lib/resources/SubscriptionScheduleRevisions.js index c230e37379..591f64fc62 100644 --- a/lib/resources/SubscriptionScheduleRevisions.js +++ b/lib/resources/SubscriptionScheduleRevisions.js @@ -16,5 +16,5 @@ var StripeResource = require('../StripeResource'); */ module.exports = StripeResource.extend({ path: 'subscription_schedules/{scheduleId}/revisions', - includeBasic: ['list', 'retrieve',], + includeBasic: ['list', 'retrieve'], }); diff --git a/lib/resources/SubscriptionSchedules.js b/lib/resources/SubscriptionSchedules.js index 0f838bdbb1..6045fd093f 100644 --- a/lib/resources/SubscriptionSchedules.js +++ b/lib/resources/SubscriptionSchedules.js @@ -4,12 +4,15 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscription_schedules', includeBasic: [ - 'create', 'list', 'retrieve', 'update', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', ], release: stripeMethod({ diff --git a/lib/resources/Subscriptions.js b/lib/resources/Subscriptions.js index a014c5d85a..6006a4ad62 100644 --- a/lib/resources/Subscriptions.js +++ b/lib/resources/Subscriptions.js @@ -4,9 +4,8 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscriptions', - includeBasic: ['create', 'list', 'retrieve', 'update', 'del',], + includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], /** * Subscription: Discount methods diff --git a/lib/resources/TaxRates.js b/lib/resources/TaxRates.js index 7bea8e7f33..a6adcb8672 100644 --- a/lib/resources/TaxRates.js +++ b/lib/resources/TaxRates.js @@ -4,4 +4,3 @@ module.exports = require('../StripeResource').extend({ path: 'tax_rates', includeBasic: ['create', 'list', 'update', 'retrieve'], }); - diff --git a/lib/resources/Terminal/ConnectionTokens.js b/lib/resources/Terminal/ConnectionTokens.js index a7c4d68f3b..3b52fc93d1 100644 --- a/lib/resources/Terminal/ConnectionTokens.js +++ b/lib/resources/Terminal/ConnectionTokens.js @@ -5,4 +5,4 @@ var StripeResource = require('../../StripeResource'); module.exports = StripeResource.extend({ path: 'terminal/connection_tokens', includeBasic: ['create'], -}) +}); diff --git a/lib/resources/Terminal/Locations.js b/lib/resources/Terminal/Locations.js index 0f2dccaf03..9cb9eca0e0 100644 --- a/lib/resources/Terminal/Locations.js +++ b/lib/resources/Terminal/Locations.js @@ -5,4 +5,4 @@ var StripeResource = require('../../StripeResource'); module.exports = StripeResource.extend({ path: 'terminal/locations', includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], -}) +}); diff --git a/lib/resources/Terminal/Readers.js b/lib/resources/Terminal/Readers.js index a4b2322a4e..661722af0b 100644 --- a/lib/resources/Terminal/Readers.js +++ b/lib/resources/Terminal/Readers.js @@ -5,4 +5,4 @@ var StripeResource = require('../../StripeResource'); module.exports = StripeResource.extend({ path: 'terminal/readers', includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], -}) +}); diff --git a/lib/resources/ThreeDSecure.js b/lib/resources/ThreeDSecure.js index 52a49e579b..5756019b49 100644 --- a/lib/resources/ThreeDSecure.js +++ b/lib/resources/ThreeDSecure.js @@ -3,11 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: '3d_secure', - includeBasic: [ - 'create', - 'retrieve', - ], + includeBasic: ['create', 'retrieve'], }); diff --git a/lib/resources/Topups.js b/lib/resources/Topups.js index 72875168ba..bdbf04a9e1 100644 --- a/lib/resources/Topups.js +++ b/lib/resources/Topups.js @@ -5,7 +5,14 @@ var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ path: 'topups', - includeBasic: ['create', 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata'], + includeBasic: [ + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', + ], cancel: stripeMethod({ method: 'POST', diff --git a/lib/resources/TransferReversals.js b/lib/resources/TransferReversals.js index a73081f12d..6794fde77f 100644 --- a/lib/resources/TransferReversals.js +++ b/lib/resources/TransferReversals.js @@ -18,4 +18,3 @@ module.exports = StripeResource.extend({ path: 'transfers/{transferId}/reversals', includeBasic: ['create', 'list', 'retrieve', 'update'], }); - diff --git a/lib/resources/Transfers.js b/lib/resources/Transfers.js index f93a20f684..36a210b9c8 100644 --- a/lib/resources/Transfers.js +++ b/lib/resources/Transfers.js @@ -4,12 +4,15 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'transfers', includeBasic: [ - 'create', 'list', 'retrieve', 'update', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', ], reverse: stripeMethod({ @@ -59,4 +62,3 @@ module.exports = StripeResource.extend({ urlParams: ['transferId', 'reversalId'], }), }); - diff --git a/lib/resources/WebhookEndpoints.js b/lib/resources/WebhookEndpoints.js index 149d4cd888..be8656069e 100644 --- a/lib/resources/WebhookEndpoints.js +++ b/lib/resources/WebhookEndpoints.js @@ -4,4 +4,3 @@ module.exports = require('../StripeResource').extend({ path: 'webhook_endpoints', includeBasic: ['create', 'list', 'update', 'retrieve', 'del'], }); - diff --git a/lib/stripe.js b/lib/stripe.js index 70a741a431..4b98b5cb1d 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -194,17 +194,14 @@ Stripe.prototype = { setApiKey: function(key) { if (key) { - this._setApiField( - 'auth', - 'Bearer ' + key - ); + this._setApiField('auth', 'Bearer ' + key); } }, setTimeout: function(timeout) { this._setApiField( 'timeout', - timeout == null ? Stripe.DEFAULT_TIMEOUT : timeout + timeout == null ? Stripe.DEFAULT_TIMEOUT : timeout, ); }, @@ -264,7 +261,10 @@ Stripe.prototype = { }, setMaxNetworkRetries: function(maxNetworkRetries) { - if ((maxNetworkRetries && typeof maxNetworkRetries !== 'number') || arguments.length < 1) { + if ( + (maxNetworkRetries && typeof maxNetworkRetries !== 'number') || + arguments.length < 1 + ) { throw new Error('maxNetworkRetries must be a number.'); } @@ -288,7 +288,7 @@ Stripe.prototype = { this.getClientUserAgentSeeded(Stripe.USER_AGENT, function(cua) { Stripe.USER_AGENT_SERIALIZED = cua; cb(Stripe.USER_AGENT_SERIALIZED); - }) + }); }, // Gets a JSON version of a User-Agent by encoding a seeded object and @@ -309,7 +309,7 @@ Stripe.prototype = { userAgent.application = self._appInfo; } - cb(JSON.stringify(userAgent)) + cb(JSON.stringify(userAgent)); }); }, diff --git a/lib/utils.js b/lib/utils.js index d74ea0f432..a439678b84 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -9,18 +9,25 @@ var crypto = require('crypto'); var hasOwn = {}.hasOwnProperty; var isPlainObject = require('lodash.isplainobject'); -var OPTIONS_KEYS = ['api_key', 'idempotency_key', 'stripe_account', 'stripe_version']; - -var utils = module.exports = { - +var OPTIONS_KEYS = [ + 'api_key', + 'idempotency_key', + 'stripe_account', + 'stripe_version', +]; + +var utils = (module.exports = { isAuthKey: function(key) { return typeof key == 'string' && /^(?:[a-z]{2}_)?[A-z0-9]{32}$/.test(key); }, isOptionsHash: function(o) { - return isPlainObject(o) && OPTIONS_KEYS.some(function(key) { - return hasOwn.call(o, key); - }); + return ( + isPlainObject(o) && + OPTIONS_KEYS.some(function(key) { + return hasOwn.call(o, key); + }) + ); }, /** @@ -28,11 +35,19 @@ var utils = module.exports = { * (forming the conventional key 'parent[child]=value') */ stringifyRequestData: function(data) { - return qs.stringify(data, {serializeDate: function (d) { return Math.floor(d.getTime() / 1000); }}) - // Don't use strict form encoding by changing the square bracket control - // characters back to their literals. This is fine by the server, and - // makes these parameter strings easier to read. - .replace(/%5B/g, '[').replace(/%5D/g, ']'); + return ( + qs + .stringify(data, { + serializeDate: function(d) { + return Math.floor(d.getTime() / 1000); + }, + }) + // Don't use strict form encoding by changing the square bracket control + // characters back to their literals. This is fine by the server, and + // makes these parameter strings easier to read. + .replace(/%5B/g, '[') + .replace(/%5D/g, ']') + ); }, /** @@ -43,8 +58,10 @@ var utils = module.exports = { */ makeURLInterpolator: (function() { var rc = { - '\n': '\\n', '\"': '\\\"', - '\u2028': '\\u2028', '\u2029': '\\u2029', + '\n': '\\n', + '"': '\\"', + '\u2028': '\\u2028', + '\u2029': '\\u2029', }; return function makeURLInterpolator(str) { var cleanString = str.replace(/["\n\r\u2028\u2029]/g, function($0) { @@ -56,7 +73,7 @@ var utils = module.exports = { }); }; }; - }()), + })(), /** * Return the data argument from a list of arguments @@ -80,10 +97,15 @@ var utils = module.exports = { // Here we're detecting a case where there are two distinct arguments // (the first being args and the second options) and with known // option keys in the first so that we can warn the user about it. - if (optionKeysInArgs.length > 0 && optionKeysInArgs.length !== argKeys.length) { + if ( + optionKeysInArgs.length > 0 && + optionKeysInArgs.length !== argKeys.length + ) { emitWarning( - 'Options found in arguments (' + optionKeysInArgs.join(', ') + '). Did you mean to pass an options ' + - 'object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.' + 'Options found in arguments (' + + optionKeysInArgs.join(', ') + + '). Did you mean to pass an options ' + + 'object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.', ); } @@ -110,7 +132,9 @@ var utils = module.exports = { }); if (extraKeys.length) { - emitWarning('Invalid options found (' + extraKeys.join(', ') + '); ignoring.'); + emitWarning( + 'Invalid options found (' + extraKeys.join(', ') + '); ignoring.', + ); } if (params.api_key) { @@ -135,9 +159,11 @@ var utils = module.exports = { */ protoExtend: function(sub) { var Super = this; - var Constructor = hasOwn.call(sub, 'constructor') ? sub.constructor : function() { - Super.apply(this, arguments); - }; + var Constructor = hasOwn.call(sub, 'constructor') + ? sub.constructor + : function() { + Super.apply(this, arguments); + }; // This initialization logic is somewhat sensitive to be compatible with // divergent JS implementations like the one found in Qt. See here for more @@ -152,8 +178,8 @@ var utils = module.exports = { }, /** - * Secure compare, from https://github.com/freewil/scmp - */ + * Secure compare, from https://github.com/freewil/scmp + */ secureCompare: function(a, b) { a = Buffer.from(a); b = Buffer.from(b); @@ -180,8 +206,8 @@ var utils = module.exports = { }, /** - * Remove empty values from an object - */ + * Remove empty values from an object + */ removeEmpty: function(obj) { if (typeof obj !== 'object') { throw new Error('Argument must be an object'); @@ -197,10 +223,10 @@ var utils = module.exports = { }, /** - * Determine if file data is a derivative of EventEmitter class. - * https://nodejs.org/api/events.html#events_events - */ - checkForStream: function (obj) { + * Determine if file data is a derivative of EventEmitter class. + * https://nodejs.org/api/events.html#events_events + */ + checkForStream: function(obj) { if (obj.file && obj.file.data) { return obj.file.data instanceof EventEmitter; } @@ -210,11 +236,18 @@ var utils = module.exports = { callbackifyPromiseWithTimeout: function(promise, callback) { if (callback) { // Ensure callback is called outside of promise stack. - return promise.then(function(res) { - setTimeout(function() { callback(null, res) }, 0); - }, function(err) { - setTimeout(function() { callback(err, null); }, 0); - }); + return promise.then( + function(res) { + setTimeout(function() { + callback(null, res); + }, 0); + }, + function(err) { + setTimeout(function() { + callback(err, null); + }, 0); + }, + ); } return promise; @@ -261,7 +294,7 @@ var utils = module.exports = { var result = {}; function step(obj, prevKey) { - Object.keys(obj).forEach(function (key) { + Object.keys(obj).forEach(function(key) { var value = obj[key]; var newKey = prevKey ? `${prevKey}[${key}]` : key; @@ -278,18 +311,20 @@ var utils = module.exports = { // Primitives are converted to strings result[newKey] = String(value); } - }) + }); } step(data); return result; }, -}; +}); function emitWarning(warning) { if (typeof process.emitWarning !== 'function') { - return console.warn('Stripe: ' + warning); /* eslint-disable-line no-console */ + return console.warn( + 'Stripe: ' + warning, + ); /* eslint-disable-line no-console */ } return process.emitWarning(warning, 'Stripe'); diff --git a/test/Error.spec.js b/test/Error.spec.js index ff8f649eff..872d2deef3 100644 --- a/test/Error.spec.js +++ b/test/Error.spec.js @@ -15,22 +15,34 @@ describe('Error', function() { describe('StripeError', function() { it('Generates specific instance depending on error-type', function() { - expect(Error.StripeError.generate({type: 'card_error'})).to.be.instanceOf(Error.StripeCardError); - expect(Error.StripeError.generate({type: 'invalid_request_error'})).to.be.instanceOf( - Error.StripeInvalidRequestError + expect(Error.StripeError.generate({type: 'card_error'})).to.be.instanceOf( + Error.StripeCardError, ); - expect(Error.StripeError.generate({type: 'api_error'})).to.be.instanceOf(Error.StripeAPIError); - expect(Error.StripeError.generate({type: 'idempotency_error'})).to.be.instanceOf(Error.StripeIdempotencyError); + expect( + Error.StripeError.generate({type: 'invalid_request_error'}), + ).to.be.instanceOf(Error.StripeInvalidRequestError); + expect(Error.StripeError.generate({type: 'api_error'})).to.be.instanceOf( + Error.StripeAPIError, + ); + expect( + Error.StripeError.generate({type: 'idempotency_error'}), + ).to.be.instanceOf(Error.StripeIdempotencyError); }); it('Pulls in headers', function() { var headers = {'Request-Id': '123'}; - var e = Error.StripeError.generate({type: 'card_error', headers: headers}); + var e = Error.StripeError.generate({ + type: 'card_error', + headers: headers, + }); expect(e).to.have.property('headers', headers); }); it('Pulls in request IDs', function() { - var e = Error.StripeError.generate({type: 'card_error', requestId: 'foo'}); + var e = Error.StripeError.generate({ + type: 'card_error', + requestId: 'foo', + }); expect(e).to.have.property('requestId', 'foo'); }); diff --git a/test/StripeResource.spec.js b/test/StripeResource.spec.js index ccfca3becf..8e5185bef3 100644 --- a/test/StripeResource.spec.js +++ b/test/StripeResource.spec.js @@ -23,7 +23,11 @@ describe('StripeResource', function() { expect(headers.Authorization).to.equal('Bearer fakeAuthToken'); }); it('sets the Authorization header with Bearer auth using the specified API key', function() { - var headers = stripe.invoices._defaultHeaders('anotherFakeAuthToken', 0, null); + var headers = stripe.invoices._defaultHeaders( + 'anotherFakeAuthToken', + 0, + null, + ); expect(headers.Authorization).to.equal('Bearer anotherFakeAuthToken'); }); it('sets the Stripe-Version header if an API version is provided', function() { @@ -42,7 +46,7 @@ describe('StripeResource', function() { after(function() { nock.cleanAll(); - }) + }); describe('_request', function() { it('encodes the query string in GET requests', function(done) { @@ -62,7 +66,10 @@ describe('StripeResource', function() { .query(Object.assign({customer: 'cus_123'}, options.data)) .reply(200, '{}'); - realStripe.invoices.retrieveUpcoming('cus_123', options.data, function(err, response) { + realStripe.invoices.retrieveUpcoming('cus_123', options.data, function( + err, + response, + ) { done(); scope.done(); }); @@ -74,19 +81,20 @@ describe('StripeResource', function() { path: '/v1/subscriptions/sub_123', data: { customer: 'cus_123', - items: [ - {plan: 'foo', quantity: 2}, - {id: 'si_123', deleted: true}, - ], + items: [{plan: 'foo', quantity: 2}, {id: 'si_123', deleted: true}], }, - body: 'customer=cus_123&items[0][plan]=foo&items[0][quantity]=2&items[1][id]=si_123&items[1][deleted]=true', + body: + 'customer=cus_123&items[0][plan]=foo&items[0][quantity]=2&items[1][id]=si_123&items[1][deleted]=true', }; const scope = nock('https://' + options.host) .post(options.path, options.body) .reply(200, '{}'); - realStripe.subscriptions.update('sub_123', options.data, function(err, response) { + realStripe.subscriptions.update('sub_123', options.data, function( + err, + response, + ) { done(); scope.done(); }); @@ -110,9 +118,9 @@ describe('StripeResource', function() { amount: 1000, currency: 'usd', source: 'tok_visa', - description: 'test' + description: 'test', }, - params: 'amount=1000¤cy=usd&source=tok_visa&description=test' + params: 'amount=1000¤cy=usd&source=tok_visa&description=test', }; afterEach(function() { @@ -122,7 +130,7 @@ describe('StripeResource', function() { after(function() { nock.cleanAll(); - }) + }); describe('_request', function() { it('throws an error on connection failure', function(done) { @@ -147,7 +155,9 @@ describe('StripeResource', function() { realStripe.setMaxNetworkRetries(1); realStripe.charges.create(options.data, function(err) { - var errorMessage = realStripe.invoices._generateConnectionErrorMessage(1); + var errorMessage = realStripe.invoices._generateConnectionErrorMessage( + 1, + ); expect(err.message).to.equal(errorMessage); expect(err.detail.message).to.deep.equal('worse stuff'); done(); @@ -178,8 +188,8 @@ describe('StripeResource', function() { .post(options.path, options.params) .reply(409, { error: { - message: 'Conflict' - } + message: 'Conflict', + }, }) .post(options.path, options.params) .reply(200, { @@ -201,8 +211,8 @@ describe('StripeResource', function() { .post(options.path, options.params) .reply(400, { error: { - type: 'card_error' - } + type: 'card_error', + }, }); realStripe.setMaxNetworkRetries(1); @@ -218,8 +228,8 @@ describe('StripeResource', function() { .post(options.path, options.params) .reply(500, { error: { - type: 'api_error' - } + type: 'api_error', + }, }); realStripe.setMaxNetworkRetries(1); @@ -235,8 +245,8 @@ describe('StripeResource', function() { .post(options.path, options.params) .reply(503, { error: { - message: 'Service unavailable' - } + message: 'Service unavailable', + }, }) .post(options.path, options.params) .reply(200, { @@ -258,8 +268,8 @@ describe('StripeResource', function() { .get(options.path + '/ch_123') .reply(500, { error: { - type: 'api_error' - } + type: 'api_error', + }, }) .get(options.path + '/ch_123') .reply(200, { @@ -287,11 +297,14 @@ describe('StripeResource', function() { .reply(function(uri, requestBody, cb) { headers = this.req.headers; - return cb(null, [200, { - id: 'ch_123"', - object: 'charge', - amount: 1000, - }]); + return cb(null, [ + 200, + { + id: 'ch_123"', + object: 'charge', + amount: 1000, + }, + ]); }); realStripe.setMaxNetworkRetries(1); @@ -312,11 +325,14 @@ describe('StripeResource', function() { .reply(function(uri, requestBody, cb) { headers = this.req.headers; - return cb(null, [200, { - id: 'ch_123"', - object: 'charge', - amount: 1000, - }]); + return cb(null, [ + 200, + { + id: 'ch_123"', + object: 'charge', + amount: 1000, + }, + ]); }); realStripe.setMaxNetworkRetries(1); @@ -338,52 +354,71 @@ describe('StripeResource', function() { .reply(function(uri, requestBody, cb) { headers = this.req.headers; - return cb(null, [200, { - id: 'ch_123"', - object: 'charge', - amount: 1000, - }]); + return cb(null, [ + 200, + { + id: 'ch_123"', + object: 'charge', + amount: 1000, + }, + ]); }); realStripe.setMaxNetworkRetries(1); - realStripe.charges.create(options.data, {idempotency_key: key}, function() { - expect(headers['idempotency-key']).to.equal(key); - done(); - }); + realStripe.charges.create( + options.data, + {idempotency_key: key}, + function() { + expect(headers['idempotency-key']).to.equal(key); + done(); + }, + ); }); }); describe('_shouldRetry', function() { - it('should return false if we\'ve reached maximum retries', function() { + it("should return false if we've reached maximum retries", function() { stripe.setMaxNetworkRetries(1); - var res = stripe.invoices._shouldRetry({ - statusCode: 409 - }, 1); + var res = stripe.invoices._shouldRetry( + { + statusCode: 409, + }, + 1, + ); expect(res).to.equal(false); }); it('should return true if we have more retries available', function() { stripe.setMaxNetworkRetries(1); - var res = stripe.invoices._shouldRetry({ - statusCode: 409 - }, 0); + var res = stripe.invoices._shouldRetry( + { + statusCode: 409, + }, + 0, + ); expect(res).to.equal(true); }); it('should return true if the error code is either 409 or 503', function() { stripe.setMaxNetworkRetries(1); - var res = stripe.invoices._shouldRetry({ - statusCode: 409 - }, 0); + var res = stripe.invoices._shouldRetry( + { + statusCode: 409, + }, + 0, + ); expect(res).to.equal(true); - res = stripe.invoices._shouldRetry({ - statusCode: 503 - }, 0); + res = stripe.invoices._shouldRetry( + { + statusCode: 503, + }, + 0, + ); expect(res).to.equal(true); }); @@ -392,10 +427,13 @@ describe('StripeResource', function() { stripe.setMaxNetworkRetries(2); // mocking that we're on our 2nd request - var res = stripe.invoices._shouldRetry({ - statusCode: 200, - req: {_requestEvent: {method: 'POST'}} - }, 1); + var res = stripe.invoices._shouldRetry( + { + statusCode: 200, + req: {_requestEvent: {method: 'POST'}}, + }, + 1, + ); expect(res).to.equal(false); }); diff --git a/test/Webhook.spec.js b/test/Webhook.spec.js index 9576888d59..cd58d41d98 100644 --- a/test/Webhook.spec.js +++ b/test/Webhook.spec.js @@ -19,29 +19,35 @@ describe('Webhooks', function() { payload: EVENT_PAYLOAD_STRING, }); - var event = stripe.webhooks.constructEvent(EVENT_PAYLOAD_STRING, header, SECRET); + var event = stripe.webhooks.constructEvent( + EVENT_PAYLOAD_STRING, + header, + SECRET, + ); expect(event.id).to.equal(EVENT_PAYLOAD.id); }); - it('should raise a JSON error from invalid JSON payload', - function() { - var header = generateHeaderString({ - payload: '} I am not valid JSON; 123][', - }); - expect(function() { - stripe.webhooks.constructEvent('} I am not valid JSON; 123][', header, SECRET); - }).to.throw(/Unexpected token/); + it('should raise a JSON error from invalid JSON payload', function() { + var header = generateHeaderString({ + payload: '} I am not valid JSON; 123][', }); + expect(function() { + stripe.webhooks.constructEvent( + '} I am not valid JSON; 123][', + header, + SECRET, + ); + }).to.throw(/Unexpected token/); + }); - it('should raise a SignatureVerificationError from a valid JSON payload and an invalid signature header', - function() { - var header = 'bad_header'; + it('should raise a SignatureVerificationError from a valid JSON payload and an invalid signature header', function() { + var header = 'bad_header'; - expect(function() { - stripe.webhooks.constructEvent(EVENT_PAYLOAD_STRING, header, SECRET); - }).to.throw(/Unable to extract timestamp and signatures from header/); - }); + expect(function() { + stripe.webhooks.constructEvent(EVENT_PAYLOAD_STRING, header, SECRET); + }).to.throw(/Unable to extract timestamp and signatures from header/); + }); }); describe('.verifySignatureHeader', function() { @@ -51,19 +57,35 @@ describe('Webhooks', function() { var expectedMessage = /Unable to extract timestamp and signatures from header/; expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + ); }).to.throw(expectedMessage); expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, null, SECRET); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + null, + SECRET, + ); }).to.throw(expectedMessage); expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, undefined, SECRET); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + undefined, + SECRET, + ); }).to.throw(expectedMessage); expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, '', SECRET); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + '', + SECRET, + ); }).to.throw(expectedMessage); }); @@ -73,7 +95,11 @@ describe('Webhooks', function() { }); expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + ); }).to.throw(/No signatures found with expected scheme/); }); @@ -83,56 +109,98 @@ describe('Webhooks', function() { }); expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET); - }).to.throw(/No signatures found matching the expected signature for payload/); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + ); + }).to.throw( + /No signatures found matching the expected signature for payload/, + ); }); it('should raise a SignatureVerificationError when the timestamp is not within the tolerance', function() { var header = generateHeaderString({ - timestamp: (Date.now() / 1000) - 15, + timestamp: Date.now() / 1000 - 15, }); expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET, 10); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + 10, + ); }).to.throw(/Timestamp outside the tolerance zone/); }); - it('should return true when the header contains a valid signature and ' + - 'the timestamp is within the tolerance', - function() { - var header = generateHeaderString({ - timestamp: (Date.now() / 1000), - }); + it( + 'should return true when the header contains a valid signature and ' + + 'the timestamp is within the tolerance', + function() { + var header = generateHeaderString({ + timestamp: Date.now() / 1000, + }); - expect(stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET, 10)).to.equal(true); - }); + expect( + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + 10, + ), + ).to.equal(true); + }, + ); it('should return true when the header contains at least one valid signature', function() { var header = generateHeaderString({ - timestamp: (Date.now() / 1000), + timestamp: Date.now() / 1000, }); header += ',v1=potato'; - expect(stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET, 10)).to.equal(true); + expect( + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + 10, + ), + ).to.equal(true); }); - it('should return true when the header contains a valid signature ' + - 'and the timestamp is off but no tolerance is provided', - function() { - var header = generateHeaderString({ - timestamp: 12345, - }); + it( + 'should return true when the header contains a valid signature ' + + 'and the timestamp is off but no tolerance is provided', + function() { + var header = generateHeaderString({ + timestamp: 12345, + }); - expect(stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET)).to.equal(true); - }); + expect( + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + ), + ).to.equal(true); + }, + ); it('should accept Buffer instances for the payload and header', function() { var header = generateHeaderString({ - timestamp: (Date.now() / 1000), + timestamp: Date.now() / 1000, }); - expect(stripe.webhooks.signature.verifyHeader(Buffer.from(EVENT_PAYLOAD_STRING), Buffer.from(header), SECRET, 10)).to.equal(true); + expect( + stripe.webhooks.signature.verifyHeader( + Buffer.from(EVENT_PAYLOAD_STRING), + Buffer.from(header), + SECRET, + 10, + ), + ).to.equal(true); }); }); }); @@ -145,8 +213,12 @@ function generateHeaderString(opts) { opts.secret = opts.secret || SECRET; opts.scheme = opts.scheme || stripe.webhooks.signature.EXPECTED_SCHEME; - opts.signature = opts.signature || - stripe.webhooks.signature._computeSignature(opts.timestamp + '.' + opts.payload, opts.secret); + opts.signature = + opts.signature || + stripe.webhooks.signature._computeSignature( + opts.timestamp + '.' + opts.payload, + opts.secret, + ); var generatedHeader = [ 't=' + opts.timestamp, diff --git a/test/autoPagination.spec.js b/test/autoPagination.spec.js index 6674462d78..4960a3bb43 100644 --- a/test/autoPagination.spec.js +++ b/test/autoPagination.spec.js @@ -3,10 +3,7 @@ /* eslint-disable callback-return */ var testUtils = require('../testUtils'); -var stripe = require('../lib/stripe')( - testUtils.getUserStripeKey(), - 'latest' -); +var stripe = require('../lib/stripe')(testUtils.getUserStripeKey(), 'latest'); var expect = require('chai').expect; @@ -24,217 +21,275 @@ describe('auto pagination', function() { for (var i = 0; i < TOTAL_OBJECTS; i++) { createReqs.push(stripe.customers.create({email: email})); } - return Promise.all(createReqs).then(function() { - // re-fetch to ensure correct order - return stripe.customers.list({email: email}).then(function(customers) { - realCustomerIds = customers.data.map(function(customer) {return customer.id}); + return Promise.all(createReqs) + .then(function() { + // re-fetch to ensure correct order + return stripe.customers + .list({email: email}) + .then(function(customers) { + realCustomerIds = customers.data.map(function(customer) { + return customer.id; + }); + }); }) - }).then(resolve); + .then(resolve); }); }); after(function() { return new Promise(function(resolve) { - Promise.all(realCustomerIds.map(function(customerId) { - return stripe.customers.del(customerId); - })).then(resolve); + Promise.all( + realCustomerIds.map(function(customerId) { + return stripe.customers.del(customerId); + }), + ).then(resolve); }); }); describe('callbacks', function() { it('lets you call `next()` to iterate and `next(false)` to break', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - function onCustomer(customer, next) { - customerIds.push(customer.id); - if (customerIds.length === LIMIT) { - next(false); - } else { - expect(customerIds.length).to.be.lessThan(LIMIT); - next(); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + function onCustomer(customer, next) { + customerIds.push(customer.id); + if (customerIds.length === LIMIT) { + next(false); + } else { + expect(customerIds.length).to.be.lessThan(LIMIT); + next(); + } } - } - function onDone(err) { - if (err) { - reject(err); - } else { - resolve(customerIds); + function onDone(err) { + if (err) { + reject(err); + } else { + resolve(customerIds); + } } - } - stripe.customers.list({limit: 3, email: email}) - .autoPagingEach(onCustomer, onDone); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + stripe.customers + .list({limit: 3, email: email}) + .autoPagingEach(onCustomer, onDone); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('lets you ignore the second arg and `return false` to break', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - function onCustomer(customer) { - customerIds.push(customer.id); - if (customerIds.length === LIMIT) { - return false; - } else { - expect(customerIds.length).to.be.lessThan(LIMIT); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + function onCustomer(customer) { + customerIds.push(customer.id); + if (customerIds.length === LIMIT) { + return false; + } else { + expect(customerIds.length).to.be.lessThan(LIMIT); + } } - } - function onDone(err) { - if (err) { - reject(err); - } else { - resolve(customerIds); + function onDone(err) { + if (err) { + reject(err); + } else { + resolve(customerIds); + } } - } - stripe.customers.list({limit: 3, email: email}) - .autoPagingEach(onCustomer, onDone); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + stripe.customers + .list({limit: 3, email: email}) + .autoPagingEach(onCustomer, onDone); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('lets you ignore the second arg and return a Promise which returns `false` to break', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - function onCustomer(customer) { - customerIds.push(customer.id); - if (customerIds.length === LIMIT) { - return Promise.resolve(false); - } else { - expect(customerIds.length).to.be.lessThan(LIMIT); - return Promise.resolve(); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + function onCustomer(customer) { + customerIds.push(customer.id); + if (customerIds.length === LIMIT) { + return Promise.resolve(false); + } else { + expect(customerIds.length).to.be.lessThan(LIMIT); + return Promise.resolve(); + } } - } - function onDone(err) { - if (err) { - reject(err); - } else { - resolve(customerIds); + function onDone(err) { + if (err) { + reject(err); + } else { + resolve(customerIds); + } } - } - stripe.customers.list({limit: 3, email: email}) - .autoPagingEach(onCustomer, onDone); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + stripe.customers + .list({limit: 3, email: email}) + .autoPagingEach(onCustomer, onDone); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('can use a promise instead of a callback for onDone', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - function onCustomer(customer) { - customerIds.push(customer.id); - } - function onDone() { - resolve(customerIds); - } - - stripe.customers.list({limit: 3, email: email}) - .autoPagingEach(onCustomer) - .then(onDone) - .catch(reject); - })).to.eventually.deep.equal(realCustomerIds); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + function onCustomer(customer) { + customerIds.push(customer.id); + } + function onDone() { + resolve(customerIds); + } + + stripe.customers + .list({limit: 3, email: email}) + .autoPagingEach(onCustomer) + .then(onDone) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds); }); it('handles the end of a list properly when the last page is full', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - return stripe.customers.list({email: email, limit: TOTAL_OBJECTS / 2}) - .autoPagingEach(function(customer) { customerIds.push(customer.id); }) - .catch(reject) - .then(function() { - resolve(customerIds); - }); - })).to.eventually.deep.equal(realCustomerIds); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + return stripe.customers + .list({email: email, limit: TOTAL_OBJECTS / 2}) + .autoPagingEach(function(customer) { + customerIds.push(customer.id); + }) + .catch(reject) + .then(function() { + resolve(customerIds); + }); + }), + ).to.eventually.deep.equal(realCustomerIds); }); it('handles the end of a list properly when the last page is not full', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - return stripe.customers.list({email: email, limit: TOTAL_OBJECTS - 2}) - .autoPagingEach(function(customer) { customerIds.push(customer.id); }) - .catch(reject) - .then(function() { - resolve(customerIds); - }); - })).to.eventually.deep.equal(realCustomerIds); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + return stripe.customers + .list({email: email, limit: TOTAL_OBJECTS - 2}) + .autoPagingEach(function(customer) { + customerIds.push(customer.id); + }) + .catch(reject) + .then(function() { + resolve(customerIds); + }); + }), + ).to.eventually.deep.equal(realCustomerIds); }); it('handles a list which is shorter than the page size properly', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - return stripe.customers.list({email: email, limit: TOTAL_OBJECTS + 2}) - .autoPagingEach(function(customer) { customerIds.push(customer.id); }) - .catch(reject) - .then(function() { - resolve(customerIds); - }); - })).to.eventually.deep.equal(realCustomerIds); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + return stripe.customers + .list({email: email, limit: TOTAL_OBJECTS + 2}) + .autoPagingEach(function(customer) { + customerIds.push(customer.id); + }) + .catch(reject) + .then(function() { + resolve(customerIds); + }); + }), + ).to.eventually.deep.equal(realCustomerIds); }); it('handles errors after the first page correctly (callback)', function() { - return expect(new Promise(function(resolve, reject) { - var i = 0; - function onCustomer() { - i += 1; - if (i > 4) { - throw Error('Simulated error'); - } - } - return stripe.customers.list({email: email, limit: 3}) - .autoPagingEach(onCustomer, function(err) { - if (err) { - resolve(err.message); - } else { - reject(Error('Expected an error, did not get one.')); + return expect( + new Promise(function(resolve, reject) { + var i = 0; + function onCustomer() { + i += 1; + if (i > 4) { + throw Error('Simulated error'); } - }); - })).to.eventually.deep.equal('Simulated error'); + } + return stripe.customers + .list({email: email, limit: 3}) + .autoPagingEach(onCustomer, function(err) { + if (err) { + resolve(err.message); + } else { + reject(Error('Expected an error, did not get one.')); + } + }); + }), + ).to.eventually.deep.equal('Simulated error'); }); it('handles errors after the first page correctly (promise)', function() { - return expect(new Promise(function(resolve, reject) { - var i = 0; - function onCustomer() { - i += 1; - if (i > 4) { - throw Error('Simulated error'); + return expect( + new Promise(function(resolve, reject) { + var i = 0; + function onCustomer() { + i += 1; + if (i > 4) { + throw Error('Simulated error'); + } } - } - return stripe.customers.list({email: email, limit: 3}) - .autoPagingEach(onCustomer) - .then(function() { - reject(Error('Expected an error, did not get one.')); - }) - .catch(function(err) { - resolve(err.message); - }); - })).to.eventually.deep.equal('Simulated error'); + return stripe.customers + .list({email: email, limit: 3}) + .autoPagingEach(onCustomer) + .then(function() { + reject(Error('Expected an error, did not get one.')); + }) + .catch(function(err) { + resolve(err.message); + }); + }), + ).to.eventually.deep.equal('Simulated error'); }); }); describe('async iterators', function() { - if (testUtils.envSupportsForAwait()) { // `for await` throws a syntax error everywhere but node 10, // so we must conditionally require it. var forAwaitUntil = require('../testUtils/forAwait.node10').forAwaitUntil; it('works with `for await` when that feature exists (user break)', function() { - return expect(new Promise(function(resolve, reject) { - forAwaitUntil(stripe.customers.list({limit: 3, email: email}), LIMIT) - .then(function(customers) { - resolve(customers.map(function(customer) { return customer.id; })); - }) - .catch(reject) - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + return expect( + new Promise(function(resolve, reject) { + forAwaitUntil( + stripe.customers.list({limit: 3, email: email}), + LIMIT, + ) + .then(function(customers) { + resolve( + customers.map(function(customer) { + return customer.id; + }), + ); + }) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('works with `for await` when that feature exists (end of list)', function() { - return expect(new Promise(function(resolve, reject) { - forAwaitUntil(stripe.customers.list({limit: 3, email: email}), TOTAL_OBJECTS + 1) - .then(function(customers) { - resolve(customers.map(function(customer) { return customer.id; })); - }) - .catch(reject); - })).to.eventually.deep.equal(realCustomerIds); + return expect( + new Promise(function(resolve, reject) { + forAwaitUntil( + stripe.customers.list({limit: 3, email: email}), + TOTAL_OBJECTS + 1, + ) + .then(function(customers) { + resolve( + customers.map(function(customer) { + return customer.id; + }), + ); + }) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds); }); } @@ -243,177 +298,239 @@ describe('auto pagination', function() { var awaitUntil = require('../testUtils/await.node7').awaitUntil; it('works with `await` and a while loop when await exists', function() { - return expect(new Promise(function(resolve, reject) { - awaitUntil(stripe.customers.list({limit: 3, email: email}), LIMIT) - .then(function(customers) { - resolve(customers.map(function(customer) { return customer.id; })); - }) - .catch(reject); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + return expect( + new Promise(function(resolve, reject) { + awaitUntil(stripe.customers.list({limit: 3, email: email}), LIMIT) + .then(function(customers) { + resolve( + customers.map(function(customer) { + return customer.id; + }), + ); + }) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); } it('returns an empty object from .return() so that `break;` works in for-await', function() { - return expect(new Promise(function(resolve, reject) { - var iter = stripe.customers.list({limit: 3, email: email}); - - var customerIds = []; - function handleIter(result) { - customerIds.push(result.value.id); - expect(iter.return()).to.deep.equal({}); - } - - iter.next().then(handleIter).then(function() { - resolve(customerIds); - }).catch(reject); - })).to.eventually.deep.equal(realCustomerIds.slice(0, 1)); + return expect( + new Promise(function(resolve, reject) { + var iter = stripe.customers.list({limit: 3, email: email}); + + var customerIds = []; + function handleIter(result) { + customerIds.push(result.value.id); + expect(iter.return()).to.deep.equal({}); + } + + iter + .next() + .then(handleIter) + .then(function() { + resolve(customerIds); + }) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, 1)); }); it('works when you call it sequentially', function() { - return expect(new Promise(function(resolve, reject) { - var iter = stripe.customers.list({limit: 3, email: email}); - - var customerIds = []; - function handleIter(result) { - customerIds.push(result.value.id); - if (customerIds.length < 7) { - return iter.next().then(handleIter); + return expect( + new Promise(function(resolve, reject) { + var iter = stripe.customers.list({limit: 3, email: email}); + + var customerIds = []; + function handleIter(result) { + customerIds.push(result.value.id); + if (customerIds.length < 7) { + return iter.next().then(handleIter); + } } - } - iter.next().then(handleIter).then(function() { - resolve(customerIds); - }).catch(reject); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + iter + .next() + .then(handleIter) + .then(function() { + resolve(customerIds); + }) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('gives you the same result each time when you call it multiple times in parallel', function() { - return expect(new Promise(function(resolve, reject) { - var iter = stripe.customers.list({limit: 3, email: email}); - - var customerIds = [] - function handleIter(result) { - customerIds.push(result.value.id); - } - - Promise.all([ - iter.next().then(handleIter), - iter.next().then(handleIter).then(function() { - return Promise.all([ - iter.next().then(handleIter), - iter.next().then(handleIter), - ]) - }).then(function() { - return Promise.all([ - iter.next().then(handleIter), - iter.next().then(handleIter), - ]) - }).then(function() { - return Promise.all([ - iter.next().then(handleIter), - iter.next().then(handleIter), - ]) - }) - ]).then(function() { - resolve(customerIds); - }).catch(reject); - })).to.eventually.deep.equal(realCustomerIds.slice(0, 4).reduce(function(acc, x) { - acc.push(x); - acc.push(x); - return acc; - }, [])); + return expect( + new Promise(function(resolve, reject) { + var iter = stripe.customers.list({limit: 3, email: email}); + + var customerIds = []; + function handleIter(result) { + customerIds.push(result.value.id); + } + + Promise.all([ + iter.next().then(handleIter), + iter + .next() + .then(handleIter) + .then(function() { + return Promise.all([ + iter.next().then(handleIter), + iter.next().then(handleIter), + ]); + }) + .then(function() { + return Promise.all([ + iter.next().then(handleIter), + iter.next().then(handleIter), + ]); + }) + .then(function() { + return Promise.all([ + iter.next().then(handleIter), + iter.next().then(handleIter), + ]); + }), + ]) + .then(function() { + resolve(customerIds); + }) + .catch(reject); + }), + ).to.eventually.deep.equal( + realCustomerIds.slice(0, 4).reduce(function(acc, x) { + acc.push(x); + acc.push(x); + return acc; + }, []), + ); }); }); describe('autoPagingToArray', function() { it('can go to the end', function() { - return expect(new Promise(function(resolve, reject) { - stripe.customers.list({limit: 3, email: email}) - .autoPagingToArray({limit: TOTAL_OBJECTS + 1}) - .then(function(customers) { - return customers.map(function(customer) { return customer.id; }); - }) - .then(resolve) - .catch(reject); - })).to.eventually.deep.equal(realCustomerIds); + return expect( + new Promise(function(resolve, reject) { + stripe.customers + .list({limit: 3, email: email}) + .autoPagingToArray({limit: TOTAL_OBJECTS + 1}) + .then(function(customers) { + return customers.map(function(customer) { + return customer.id; + }); + }) + .then(resolve) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds); }); it('returns a promise of an array', function() { - return expect(new Promise(function(resolve, reject) { - stripe.customers.list({limit: 3, email: email}) - .autoPagingToArray({limit: LIMIT}) - .then(function(customers) { - return customers.map(function(customer) { return customer.id; }); - }) - .then(resolve) - .catch(reject); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + return expect( + new Promise(function(resolve, reject) { + stripe.customers + .list({limit: 3, email: email}) + .autoPagingToArray({limit: LIMIT}) + .then(function(customers) { + return customers.map(function(customer) { + return customer.id; + }); + }) + .then(resolve) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('accepts an onDone callback, passing an array', function() { - return expect(new Promise(function(resolve, reject) { - function onDone(err, customers) { - if (err) { - reject(err); - } else { - resolve(customers.map(function(customer) { return customer.id; })); + return expect( + new Promise(function(resolve, reject) { + function onDone(err, customers) { + if (err) { + reject(err); + } else { + resolve( + customers.map(function(customer) { + return customer.id; + }), + ); + } } - } - stripe.customers.list({limit: 3, email: email}) - .autoPagingToArray({limit: LIMIT}, onDone); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + stripe.customers + .list({limit: 3, email: email}) + .autoPagingToArray({limit: LIMIT}, onDone); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('enforces a `limit` arg', function() { - return expect(new Promise(function(resolve, reject) { - try { - stripe.customers.list({limit: 3, email: email}) - .autoPagingToArray(); - reject(Error('Should have thrown.')); - } catch (err) { - resolve(err.message); - } - })).to.eventually.equal('You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.'); + return expect( + new Promise(function(resolve, reject) { + try { + stripe.customers.list({limit: 3, email: email}).autoPagingToArray(); + reject(Error('Should have thrown.')); + } catch (err) { + resolve(err.message); + } + }), + ).to.eventually.equal( + 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.', + ); }); it('caps the `limit` arg to a reasonable ceiling', function() { - return expect(new Promise(function(resolve, reject) { - try { - stripe.customers.list({limit: 3, email: email}) - .autoPagingToArray({limit: 1000000}); - reject(Error('Should have thrown.')); - } catch (err) { - resolve(err.message); - } - })).to.eventually.equal('You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.'); + return expect( + new Promise(function(resolve, reject) { + try { + stripe.customers + .list({limit: 3, email: email}) + .autoPagingToArray({limit: 1000000}); + reject(Error('Should have thrown.')); + } catch (err) { + resolve(err.message); + } + }), + ).to.eventually.equal( + 'You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.', + ); }); }); describe('api compat edge cases', function() { it('lets you listen to the first request as its own promise, and separately each item, but only sends one request for the first page.', function() { - return expect(new Promise(function(resolve, reject) { - // Count requests: we want one for the first page (not two), and then one for the second page. - var reqCount = 0; - function onRequest() { - reqCount += 1; - } - stripe.on('request', onRequest); - - var customerIds = []; - var p = stripe.customers.list({email: email, limit: 4}) - Promise.all([ - p, - p.autoPagingEach(function(customer) { customerIds.push(customer.id); }), - ]).then(function(results) { - stripe.off('request', onRequest); - expect(reqCount).to.equal(2); // not 3. - - resolve({ - firstReq: results[0].data.map(function(customer) { return customer.id; }), - paginated: customerIds, - }); - }).catch(reject); - })).to.eventually.deep.equal({ + return expect( + new Promise(function(resolve, reject) { + // Count requests: we want one for the first page (not two), and then one for the second page. + var reqCount = 0; + function onRequest() { + reqCount += 1; + } + stripe.on('request', onRequest); + + var customerIds = []; + var p = stripe.customers.list({email: email, limit: 4}); + Promise.all([ + p, + p.autoPagingEach(function(customer) { + customerIds.push(customer.id); + }), + ]) + .then(function(results) { + stripe.off('request', onRequest); + expect(reqCount).to.equal(2); // not 3. + + resolve({ + firstReq: results[0].data.map(function(customer) { + return customer.id; + }), + paginated: customerIds, + }); + }) + .catch(reject); + }), + ).to.eventually.deep.equal({ firstReq: realCustomerIds.slice(0, 4), paginated: realCustomerIds, }); diff --git a/test/flows.spec.js b/test/flows.spec.js index 879918c07a..f58f34c0ef 100644 --- a/test/flows.spec.js +++ b/test/flows.spec.js @@ -2,10 +2,7 @@ var testUtils = require('../testUtils'); var chai = require('chai'); -var stripe = require('../lib/stripe')( - testUtils.getUserStripeKey(), - 'latest' -); +var stripe = require('../lib/stripe')(testUtils.getUserStripeKey(), 'latest'); var fs = require('fs'); var path = require('path'); var stream = require('stream'); @@ -27,11 +24,10 @@ describe('Flows', function() { it('Allows me to retrieve default_currency', function() { return expect( - stripe.account.retrieve() - .then(function(acct) { - CURRENCY = acct.default_currency; - return acct; - }) + stripe.account.retrieve().then(function(acct) { + CURRENCY = acct.default_currency; + return acct; + }), ).to.eventually.have.property('default_currency'); }); @@ -49,7 +45,7 @@ describe('Flows', function() { name: 'product' + testUtils.getRandomString(), }, }), - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers.create(CUSTOMER_DETAILS), ]).then(function(j) { var plan = j[0]; var customer = j[1]; @@ -60,28 +56,27 @@ describe('Flows', function() { return stripe.customers.updateSubscription(customer.id, { plan: plan.id, }); - }) + }), ).to.eventually.have.property('status', 'active'); }); - it( - 'Allows me to: Create a plan and subscribe a customer to it, and update subscription (multi-subs API)', - function() { - var plan; - return expect( - Promise.all([ - stripe.plans.create({ - id: 'plan' + testUtils.getRandomString(), - amount: 1700, - currency: CURRENCY, - interval: 'month', - nickname: 'Gold Super Amazing Tier', - product: { - name: 'product' + testUtils.getRandomString(), - }, - }), - stripe.customers.create(CUSTOMER_DETAILS) - ]).then(function(j) { + it('Allows me to: Create a plan and subscribe a customer to it, and update subscription (multi-subs API)', function() { + var plan; + return expect( + Promise.all([ + stripe.plans.create({ + id: 'plan' + testUtils.getRandomString(), + amount: 1700, + currency: CURRENCY, + interval: 'month', + nickname: 'Gold Super Amazing Tier', + product: { + name: 'product' + testUtils.getRandomString(), + }, + }), + stripe.customers.create(CUSTOMER_DETAILS), + ]) + .then(function(j) { plan = j[0]; var customer = j[1]; @@ -91,33 +86,42 @@ describe('Flows', function() { return stripe.customers.createSubscription(customer.id, { plan: plan.id, }); - }).then(function(subscription) { - return stripe.customers.updateSubscription(subscription.customer, subscription.id, { - plan: plan.id, quantity: '3', - }); - }).then(function(subscription) { - return [subscription.status, subscription.quantity]; }) - ).to.eventually.deep.equal(['active', 3]); - } - ); + .then(function(subscription) { + return stripe.customers.updateSubscription( + subscription.customer, + subscription.id, + { + plan: plan.id, + quantity: '3', + }, + ); + }) + .then(function(subscription) { + return [subscription.status, subscription.quantity]; + }), + ).to.eventually.deep.equal(['active', 3]); + }); it('Errors when I attempt to subscribe a customer to a non-existent plan', function() { return expect( - stripe.customers.create(CUSTOMER_DETAILS) - .then(function(customer) { - cleanup.deleteCustomer(customer.id); + stripe.customers.create(CUSTOMER_DETAILS).then(function(customer) { + cleanup.deleteCustomer(customer.id); - return stripe.customers.updateSubscription(customer.id, { + return stripe.customers + .updateSubscription(customer.id, { plan: 'someNonExistentPlan' + testUtils.getRandomString(), - }).then(null, function(err) { + }) + .then(null, function(err) { // Resolve with the error so we can inspect it below return err; }); - }) + }), ).to.eventually.satisfy(function(err) { - return err.type === 'StripeInvalidRequestError' && - err.rawType === 'invalid_request_error'; + return ( + err.type === 'StripeInvalidRequestError' && + err.rawType === 'invalid_request_error' + ); }); }); @@ -134,7 +138,7 @@ describe('Flows', function() { name: 'product' + testUtils.getRandomString(), }, }), - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers.create(CUSTOMER_DETAILS), ]).then(function(j) { var plan = j[0]; var customer = j[1]; @@ -146,7 +150,7 @@ describe('Flows', function() { plan: plan.id, cancel_at_period_end: true, }); - }) + }), ).to.eventually.have.property('cancel_at_period_end', true); }); @@ -157,23 +161,28 @@ describe('Flows', function() { 'TEST_a-i' + testUtils.getRandomString(), 'foobarbazteston___etwothree' + testUtils.getRandomString(), ].forEach(function(planID) { - it('Allows me to create and retrieve plan with ID: ' + planID, function() { - return expect( - stripe.plans.create({ - id: planID, - amount: 1700, - currency: CURRENCY, - interval: 'month', - nickname: 'generic', - product: { - name: 'product' + testUtils.getRandomString(), - }, - }).then(function() { - cleanup.deletePlan(planID); - return stripe.plans.retrieve(planID); - }) - ).to.eventually.have.property('id', planID); - }); + it( + 'Allows me to create and retrieve plan with ID: ' + planID, + function() { + return expect( + stripe.plans + .create({ + id: planID, + amount: 1700, + currency: CURRENCY, + interval: 'month', + nickname: 'generic', + product: { + name: 'product' + testUtils.getRandomString(), + }, + }) + .then(function() { + cleanup.deletePlan(planID); + return stripe.plans.retrieve(planID); + }), + ).to.eventually.have.property('id', planID); + }, + ); }); }); }); @@ -190,11 +199,11 @@ describe('Flows', function() { percent_off: 20, duration: 'once', }), - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers.create(CUSTOMER_DETAILS), ]).then(function(joined) { coupon = joined[0]; customer = joined[1]; - }) + }), ).to.not.be.eventually.rejected; }); describe('And I apply the coupon to the customer', function() { @@ -202,24 +211,24 @@ describe('Flows', function() { return expect( stripe.customers.update(customer.id, { coupon: coupon.id, - }) + }), ).to.not.be.eventually.rejected; }); it('Can be retrieved from that customer', function() { return expect( - stripe.customers.retrieve(customer.id) + stripe.customers.retrieve(customer.id), ).to.eventually.have.nested.property('discount.coupon.id', coupon.id); }); describe('The resulting discount', function() { it('Can be removed', function() { return expect( - stripe.customers.deleteDiscount(customer.id) + stripe.customers.deleteDiscount(customer.id), ).to.eventually.have.property('deleted', true); }); describe('Re-querying it', function() { it('Does indeed indicate that it is deleted', function() { return expect( - stripe.customers.retrieve(customer.id) + stripe.customers.retrieve(customer.id), ).to.eventually.have.property('discount', null); }); }); @@ -232,7 +241,8 @@ describe('Flows', function() { it('Can save and retrieve metadata', function() { var customer; return expect( - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers + .create(CUSTOMER_DETAILS) .then(function(cust) { customer = cust; cleanup.deleteCustomer(cust.id); @@ -240,13 +250,14 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.getMetadata(customer.id); - }) + }), ).to.eventually.deep.equal({foo: '123'}); }); it('Can reset metadata', function() { var customer; return expect( - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers + .create(CUSTOMER_DETAILS) .then(function(cust) { customer = cust; cleanup.deleteCustomer(cust.id); @@ -257,13 +268,14 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.getMetadata(customer.id); - }) + }), ).to.eventually.deep.equal({}); }); it('Resets metadata when setting new metadata', function() { var customer; return expect( - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers + .create(CUSTOMER_DETAILS) .then(function(cust) { customer = cust; cleanup.deleteCustomer(cust.id); @@ -271,13 +283,14 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.setMetadata(customer.id, {baz: '456'}); - }) + }), ).to.eventually.deep.equal({baz: '456'}); }); it('Can set individual key/value pairs', function() { var customer; return expect( - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers + .create(CUSTOMER_DETAILS) .then(function(cust) { customer = cust; cleanup.deleteCustomer(cust.id); @@ -301,38 +314,63 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.getMetadata(customer.id); - }) + }), ).to.eventually.deep.equal({_other_: '999', foo: '222'}); }); it('Can set individual key/value pairs [with per request token]', function() { var customer; var authToken = testUtils.getUserStripeKey(); return expect( - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers + .create(CUSTOMER_DETAILS) .then(function(cust) { customer = cust; cleanup.deleteCustomer(cust.id); }) .then(function() { - return stripe.customers.setMetadata(customer.id, {'baz': 456}, authToken); + return stripe.customers.setMetadata( + customer.id, + {baz: 456}, + authToken, + ); }) .then(function() { - return stripe.customers.setMetadata(customer.id, '_other_', 999, authToken); + return stripe.customers.setMetadata( + customer.id, + '_other_', + 999, + authToken, + ); }) .then(function() { - return stripe.customers.setMetadata(customer.id, 'foo', 123, authToken); + return stripe.customers.setMetadata( + customer.id, + 'foo', + 123, + authToken, + ); }) .then(function() { // Change foo - return stripe.customers.setMetadata(customer.id, 'foo', 222, authToken); + return stripe.customers.setMetadata( + customer.id, + 'foo', + 222, + authToken, + ); }) .then(function() { // Delete baz - return stripe.customers.setMetadata(customer.id, 'baz', null, authToken); + return stripe.customers.setMetadata( + customer.id, + 'baz', + null, + authToken, + ); }) .then(function() { return stripe.customers.getMetadata(customer.id, authToken); - }) + }), ).to.eventually.deep.equal({_other_: '999', foo: '222'}); }); }); @@ -341,31 +379,31 @@ describe('Flows', function() { describe('A customer within a charge', function() { it('Allows you to expand a customer object', function() { return expect( - stripe.customers.create(CUSTOMER_DETAILS) - .then(function(cust) { - cleanup.deleteCustomer(cust.id); - return stripe.charges.create({ - customer: cust.id, - amount: 1700, - currency: CURRENCY, - expand: ['customer'], - }); - }) + stripe.customers.create(CUSTOMER_DETAILS).then(function(cust) { + cleanup.deleteCustomer(cust.id); + return stripe.charges.create({ + customer: cust.id, + amount: 1700, + currency: CURRENCY, + expand: ['customer'], + }); + }), ).to.eventually.have.nested.property('customer.created'); }); }); - describe('A customer\'s default source', function() { + describe("A customer's default source", function() { it('Allows you to expand a default_source', function() { return expect( - stripe.customers.create({ - description: 'Some customer', - source: 'tok_visa', - expand: ['default_source'], - }) + stripe.customers + .create({ + description: 'Some customer', + source: 'tok_visa', + expand: ['default_source'], + }) .then(function(cust) { cleanup.deleteCustomer(cust.id); return cust; - }) + }), // Confirm it's expanded by checking that some prop (e.g. exp_year) exists: ).to.eventually.have.nested.property('default_source.exp_year'); }); @@ -375,32 +413,35 @@ describe('Flows', function() { describe('Charge', function() { it('Allows you to create a charge', function() { return expect( - stripe.charges.create({ - amount: 1234, - currency: CURRENCY, - card: 'tok_chargeDeclined', - shipping: { - name: 'Bobby Tables', - address: { - line1: '1 Foo St.', + stripe.charges + .create({ + amount: 1234, + currency: CURRENCY, + card: 'tok_chargeDeclined', + shipping: { + name: 'Bobby Tables', + address: { + line1: '1 Foo St.', + }, }, - }, - }).then(null, function(error) { - return error; - }) + }) + .then(null, function(error) { + return error; + }), ).to.eventually.have.nested.property('raw.charge'); }); }); describe('Getting balance', function() { it('Allows me to do so', function() { - return expect( - stripe.balance.retrieve() - ).to.eventually.have.property('object', 'balance'); + return expect(stripe.balance.retrieve()).to.eventually.have.property( + 'object', + 'balance', + ); }); it('Allows me to do so with specified auth key', function() { return expect( - stripe.balance.retrieve(testUtils.getUserStripeKey()) + stripe.balance.retrieve(testUtils.getUserStripeKey()), ).to.eventually.have.property('object', 'balance'); }); }); @@ -410,24 +451,30 @@ describe('Flows', function() { before(function(done) { // Pick a random connected account to use in the `Stripe-Account` header - stripe.accounts.list({ - limit: 1, - }).then(function(accounts) { - if (accounts.data.length < 1) { - return done( - new Error('Test requires at least one Connected Account in the Test Account') - ); - } - - connectedAccountId = accounts.data[0].id; - - done(); - }); + stripe.accounts + .list({ + limit: 1, + }) + .then(function(accounts) { + if (accounts.data.length < 1) { + return done( + new Error( + 'Test requires at least one Connected Account in the Test Account', + ), + ); + } + + connectedAccountId = accounts.data[0].id; + + done(); + }); }); it('should emit a `request` event to listeners on request', function(done) { var apiVersion = '2017-06-05'; - var idempotencyKey = Math.random().toString(36).slice(2); + var idempotencyKey = Math.random() + .toString(36) + .slice(2); function onRequest(request) { stripe.off('request', onRequest); @@ -445,22 +492,29 @@ describe('Flows', function() { stripe.on('request', onRequest); - stripe.charges.create({ - amount: 1234, - currency: 'usd', - card: 'tok_chargeDeclined', - }, { - stripe_version: apiVersion, - idempotency_key: idempotencyKey, - stripe_account: connectedAccountId, - }).then(null, function() { - // I expect there to be an error here. - }); + stripe.charges + .create( + { + amount: 1234, + currency: 'usd', + card: 'tok_chargeDeclined', + }, + { + stripe_version: apiVersion, + idempotency_key: idempotencyKey, + stripe_account: connectedAccountId, + }, + ) + .then(null, function() { + // I expect there to be an error here. + }); }); it('should emit a `response` event to listeners on response', function(done) { var apiVersion = '2017-06-05'; - var idempotencyKey = Math.random().toString(36).slice(2); + var idempotencyKey = Math.random() + .toString(36) + .slice(2); function onResponse(response) { // On the off chance we're picking up a response from a differentrequest @@ -485,17 +539,22 @@ describe('Flows', function() { stripe.on('response', onResponse); - stripe.charges.create({ - amount: 1234, - currency: 'usd', - card: 'tok_chargeDeclined', - }, { - stripe_version: apiVersion, - idempotency_key: idempotencyKey, - stripe_account: connectedAccountId, - }).then(null, function() { - // I expect there to be an error here. - }); + stripe.charges + .create( + { + amount: 1234, + currency: 'usd', + card: 'tok_chargeDeclined', + }, + { + stripe_version: apiVersion, + idempotency_key: idempotencyKey, + stripe_account: connectedAccountId, + }, + ) + .then(null, function() { + // I expect there to be an error here. + }); }); it('should not emit a `response` event to removed listeners on response', function(done) { @@ -506,13 +565,15 @@ describe('Flows', function() { stripe.on('response', onResponse); stripe.off('response', onResponse); - stripe.charges.create({ - amount: 1234, - currency: 'usd', - card: 'tok_visa', - }).then(function() { - done(); - }); + stripe.charges + .create({ + amount: 1234, + currency: 'usd', + card: 'tok_visa', + }) + .then(function() { + done(); + }); }); }); @@ -522,16 +583,18 @@ describe('Flows', function() { var f = fs.createReadStream(testFilename); return expect( - stripe.fileUploads.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - }).then(null, function(error) { - return error; - }) + stripe.fileUploads + .create({ + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + }) + .then(null, function(error) { + return error; + }), ).to.eventually.have.nested.property('size', 739); }); @@ -540,16 +603,18 @@ describe('Flows', function() { var f = fs.readFileSync(testFilename); return expect( - stripe.fileUploads.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - }).then(null, function(error) { - return error; - }) + stripe.fileUploads + .create({ + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + }) + .then(null, function(error) { + return error; + }), ).to.eventually.have.nested.property('size', 739); }); @@ -563,19 +628,23 @@ describe('Flows', function() { mockedStream.emit('error', fakeError); }); - stripe.fileUploads.create({ - purpose: 'dispute_evidence', - file: { - data: mockedStream, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - }).catch(function(error) { - expect(error.message).to.equal('An error occurred while attempting to process the file for upload.'); - expect(error.detail).to.equal(fakeError); + stripe.fileUploads + .create({ + purpose: 'dispute_evidence', + file: { + data: mockedStream, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + }) + .catch(function(error) { + expect(error.message).to.equal( + 'An error occurred while attempting to process the file for upload.', + ); + expect(error.detail).to.equal(fakeError); - done(); - }); + done(); + }); }); }); }); diff --git a/test/resources/Account.spec.js b/test/resources/Account.spec.js index 378aa433b3..ed7955ecc1 100644 --- a/test/resources/Account.spec.js +++ b/test/resources/Account.spec.js @@ -109,20 +109,29 @@ describe('Account Resource', function() { describe('External account methods', function() { describe('retrieveExternalAccount', function() { it('Sends the correct request', function() { - stripe.account.retrieveExternalAccount('accountIdFoo321', 'externalAccountIdFoo456'); + stripe.account.retrieveExternalAccount( + 'accountIdFoo321', + 'externalAccountIdFoo456', + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', + url: + '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', headers: {}, data: {}, }); }); it('Sends the correct request [with specified auth]', function() { - stripe.account.retrieveExternalAccount('accountIdFoo321', 'externalAccountIdFoo456', TEST_AUTH_KEY); + stripe.account.retrieveExternalAccount( + 'accountIdFoo321', + 'externalAccountIdFoo456', + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', + url: + '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', headers: {}, data: {}, auth: TEST_AUTH_KEY, @@ -133,7 +142,9 @@ describe('Account Resource', function() { describe('createExternalAccount', function() { it('Sends the correct request', function() { stripe.account.createExternalAccount('accountIdFoo321', { - number: '123456', currency: 'usd', country: 'US', + number: '123456', + currency: 'usd', + country: 'US', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -144,9 +155,15 @@ describe('Account Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.account.createExternalAccount('accountIdFoo321', { - number: '123456', currency: 'usd', country: 'US', - }, TEST_AUTH_KEY); + stripe.account.createExternalAccount( + 'accountIdFoo321', + { + number: '123456', + currency: 'usd', + country: 'US', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/accounts/accountIdFoo321/external_accounts', @@ -159,12 +176,17 @@ describe('Account Resource', function() { describe('updateExternalAccount', function() { it('Sends the correct request', function() { - stripe.account.updateExternalAccount('accountIdFoo321', 'externalAccountIdFoo456', { - default_for_currency: true, - }); + stripe.account.updateExternalAccount( + 'accountIdFoo321', + 'externalAccountIdFoo456', + { + default_for_currency: true, + }, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', - url: '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', + url: + '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', headers: {}, data: {default_for_currency: true}, }); @@ -173,20 +195,29 @@ describe('Account Resource', function() { describe('deleteExternalAccount', function() { it('Sends the correct request', function() { - stripe.account.deleteExternalAccount('accountIdFoo321', 'externalAccountIdFoo456'); + stripe.account.deleteExternalAccount( + 'accountIdFoo321', + 'externalAccountIdFoo456', + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', - url: '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', + url: + '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', headers: {}, data: {}, }); }); it('Sends the correct request [with specified auth]', function() { - stripe.account.deleteExternalAccount('accountIdFoo321', 'externalAccountIdFoo456', TEST_AUTH_KEY); + stripe.account.deleteExternalAccount( + 'accountIdFoo321', + 'externalAccountIdFoo456', + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', - url: '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', + url: + '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', headers: {}, data: {}, auth: TEST_AUTH_KEY, @@ -270,9 +301,13 @@ describe('Account Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.account.createPerson('acct_123', { - first_name: 'John', - }, TEST_AUTH_KEY); + stripe.account.createPerson( + 'acct_123', + { + first_name: 'John', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/accounts/acct_123/persons', @@ -297,9 +332,14 @@ describe('Account Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.account.updatePerson('acct_123', 'person_123', { - first_name: 'John', - }, TEST_AUTH_KEY); + stripe.account.updatePerson( + 'acct_123', + 'person_123', + { + first_name: 'John', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/accounts/acct_123/persons/person_123', diff --git a/test/resources/ApplicationFeeRefunds.spec.js b/test/resources/ApplicationFeeRefunds.spec.js index f4f2a72a80..8f97d8db0e 100644 --- a/test/resources/ApplicationFeeRefunds.spec.js +++ b/test/resources/ApplicationFeeRefunds.spec.js @@ -8,10 +8,9 @@ var APPFEE_TEST_ID = 'appFeeIdTest999'; var REFUND_TEST_ID = 'refundIdTest999'; // Create new CustomerCard instance with pre-filled customerId: -var appFeeRefund = new resources.ApplicationFeeRefunds( - stripe, - {feeId: APPFEE_TEST_ID} -); +var appFeeRefund = new resources.ApplicationFeeRefunds(stripe, { + feeId: APPFEE_TEST_ID, +}); // Use spy from existing resource: appFeeRefund._request = stripe.customers._request; @@ -22,7 +21,11 @@ describe('ApplicationFeeRefund Resource', function() { appFeeRefund.retrieve(REFUND_TEST_ID); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/application_fees/' + APPFEE_TEST_ID + '/refunds/' + REFUND_TEST_ID, + url: + '/v1/application_fees/' + + APPFEE_TEST_ID + + '/refunds/' + + REFUND_TEST_ID, data: {}, headers: {}, }); @@ -36,7 +39,11 @@ describe('ApplicationFeeRefund Resource', function() { }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', - url: '/v1/application_fees/' + APPFEE_TEST_ID + '/refunds/' + REFUND_TEST_ID, + url: + '/v1/application_fees/' + + APPFEE_TEST_ID + + '/refunds/' + + REFUND_TEST_ID, data: {metadata: {key: 'value'}}, headers: {}, }); diff --git a/test/resources/ApplicationFees.spec.js b/test/resources/ApplicationFees.spec.js index 2cec4f95ff..3fa4d13426 100644 --- a/test/resources/ApplicationFees.spec.js +++ b/test/resources/ApplicationFees.spec.js @@ -18,7 +18,9 @@ describe('ApplicationFee Resource', function() { describe('refund', function() { it('Sends the correct request', function() { - stripe.applicationFees.refund('applicationFeeIdExample3242', {amount: 23}); + stripe.applicationFees.refund('applicationFeeIdExample3242', { + amount: 23, + }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/application_fees/applicationFeeIdExample3242/refund', @@ -33,21 +35,19 @@ describe('ApplicationFee Resource', function() { stripe.applicationFees.updateRefund( 'appFeeIdExample3242', 'refundIdExample2312', - {metadata: {key: 'value'}} + {metadata: {key: 'value'}}, ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', - url: '/v1/application_fees/appFeeIdExample3242/refunds/refundIdExample2312', + url: + '/v1/application_fees/appFeeIdExample3242/refunds/refundIdExample2312', data: {metadata: {key: 'value'}}, headers: {}, }); }); it('Sends the correct create request', function() { - stripe.applicationFees.createRefund( - 'appFeeIdExample3242', - {amount: 100} - ); + stripe.applicationFees.createRefund('appFeeIdExample3242', {amount: 100}); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/application_fees/appFeeIdExample3242/refunds', @@ -57,9 +57,7 @@ describe('ApplicationFee Resource', function() { }); it('Sends the correct list request', function() { - stripe.applicationFees.listRefunds( - 'appFeeIdExample3242' - ); + stripe.applicationFees.listRefunds('appFeeIdExample3242'); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', url: '/v1/application_fees/appFeeIdExample3242/refunds', @@ -71,11 +69,12 @@ describe('ApplicationFee Resource', function() { it('Sends the correct retrieve request', function() { stripe.applicationFees.retrieveRefund( 'appFeeIdExample3242', - 'refundIdExample2312' + 'refundIdExample2312', ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/application_fees/appFeeIdExample3242/refunds/refundIdExample2312', + url: + '/v1/application_fees/appFeeIdExample3242/refunds/refundIdExample2312', data: {}, headers: {}, }); diff --git a/test/resources/Balance.spec.js b/test/resources/Balance.spec.js index 0845e36106..50fbe0a5a1 100644 --- a/test/resources/Balance.spec.js +++ b/test/resources/Balance.spec.js @@ -62,7 +62,10 @@ describe('Balance Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.balance.retrieveTransaction('transactionIdFoo', 'aGN0bIwXnHdw5645VABjPdSn8nWY7G11'); + stripe.balance.retrieveTransaction( + 'transactionIdFoo', + 'aGN0bIwXnHdw5645VABjPdSn8nWY7G11', + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', url: '/v1/balance/history/transactionIdFoo', diff --git a/test/resources/BitcoinReceivers.spec.js b/test/resources/BitcoinReceivers.spec.js index 2ca675e6bc..ada4e055db 100644 --- a/test/resources/BitcoinReceivers.spec.js +++ b/test/resources/BitcoinReceivers.spec.js @@ -40,7 +40,7 @@ describe('BitcoinReceivers Resource', function() { data: { limit: 1, }, - }) + }); }); }); }); diff --git a/test/resources/ChargeRefunds.spec.js b/test/resources/ChargeRefunds.spec.js index adc1790f49..843930073f 100644 --- a/test/resources/ChargeRefunds.spec.js +++ b/test/resources/ChargeRefunds.spec.js @@ -8,10 +8,9 @@ var CHARGE_TEST_ID = 'chargeIdTest999'; var REFUND_TEST_ID = 'refundIdTest999'; // Create new CustomerCard instance with pre-filled customerId: -var chargeRefund = new resources.ChargeRefunds( - stripe, - {chargeId: CHARGE_TEST_ID} -); +var chargeRefund = new resources.ChargeRefunds(stripe, { + chargeId: CHARGE_TEST_ID, +}); // Use spy from existing resource: chargeRefund._request = stripe.customers._request; diff --git a/test/resources/Charges.spec.js b/test/resources/Charges.spec.js index 6308e82cd0..dcfc13eb3f 100644 --- a/test/resources/Charges.spec.js +++ b/test/resources/Charges.spec.js @@ -93,16 +93,16 @@ describe('Charge Resource', function() { it('Incorrect arguments result in an error', function() { expect( - stripe.charges.refund('chargeIdExample123', 39392) + stripe.charges.refund('chargeIdExample123', 39392), ).to.be.eventually.rejectedWith(/unknown arguments/i); expect( - stripe.charges.refund({potato: 'chargeIdExample123'}) + stripe.charges.refund({potato: 'chargeIdExample123'}), ).to.be.eventually.rejectedWith(/must be a string, but got: object/i); - expect( - stripe.charges.refund(442) - ).to.be.eventually.rejectedWith(/must be a string, but got: number/i); + expect(stripe.charges.refund(442)).to.be.eventually.rejectedWith( + /must be a string, but got: number/i, + ); }); }); @@ -111,7 +111,7 @@ describe('Charge Resource', function() { stripe.charges.updateRefund( 'chargeIdExample3242', 'refundIdExample2312', - {metadata: {key: 'value'}} + {metadata: {key: 'value'}}, ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -122,10 +122,7 @@ describe('Charge Resource', function() { }); it('Sends the correct create request', function() { - stripe.charges.createRefund( - 'chargeIdExample3242', - {amount: 100} - ); + stripe.charges.createRefund('chargeIdExample3242', {amount: 100}); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/charges/chargeIdExample3242/refunds', @@ -135,9 +132,7 @@ describe('Charge Resource', function() { }); it('Sends the correct list request', function() { - stripe.charges.listRefunds( - 'chargeIdExample3242' - ); + stripe.charges.listRefunds('chargeIdExample3242'); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', url: '/v1/charges/chargeIdExample3242/refunds', @@ -149,7 +144,7 @@ describe('Charge Resource', function() { it('Sends the correct retrieve request', function() { stripe.charges.retrieveRefund( 'chargeIdExample3242', - 'refundIdExample2312' + 'refundIdExample2312', ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -190,7 +185,7 @@ describe('Charge Resource', function() { expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/charges/chargeIdExample3242', - data: {'fraud_details': {'user_report': 'fraudulent'}}, + data: {fraud_details: {user_report: 'fraudulent'}}, headers: {}, }); }); @@ -202,7 +197,7 @@ describe('Charge Resource', function() { expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/charges/chargeIdExample3242', - data: {'fraud_details': {'user_report': 'safe'}}, + data: {fraud_details: {user_report: 'safe'}}, headers: {}, }); }); diff --git a/test/resources/Checkout/Sessions.spec.js b/test/resources/Checkout/Sessions.spec.js index b0268ab786..1b071806f0 100644 --- a/test/resources/Checkout/Sessions.spec.js +++ b/test/resources/Checkout/Sessions.spec.js @@ -4,8 +4,8 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Checkout', function () { - describe('Sessions Resource', function () { +describe('Checkout', function() { + describe('Sessions Resource', function() { describe('create', function() { it('Sends the correct request', function() { var params = { @@ -16,9 +16,7 @@ describe('Checkout', function () { amount: 123, currency: 'usd', description: 'item 1', - images: [ - 'https://stripe.com/img1', - ], + images: ['https://stripe.com/img1'], name: 'name', quantity: 2, }, diff --git a/test/resources/CreditNotes.spec.js b/test/resources/CreditNotes.spec.js index eb76a7aa16..b0343e1eca 100644 --- a/test/resources/CreditNotes.spec.js +++ b/test/resources/CreditNotes.spec.js @@ -64,7 +64,7 @@ describe('CreditNotes Resource', function() { method: 'POST', url: '/v1/credit_notes/cn_123/void', headers: {}, - data: {} + data: {}, }); }); }); diff --git a/test/resources/CustomerCards.spec.js b/test/resources/CustomerCards.spec.js index 4c9708c472..0354d9fb7e 100644 --- a/test/resources/CustomerCards.spec.js +++ b/test/resources/CustomerCards.spec.js @@ -7,10 +7,9 @@ var expect = require('chai').expect; var CUSTOMER_TEST_ID = 'customerIdTest999'; // Create new CustomerCard instance with pre-filled customerId: -var customerCard = new resources.CustomerCards( - stripe, - {customerId: CUSTOMER_TEST_ID} -); +var customerCard = new resources.CustomerCards(stripe, { + customerId: CUSTOMER_TEST_ID, +}); // Use spy from existing resource: customerCard._request = stripe.customers._request; @@ -31,7 +30,8 @@ describe('CustomerCard Resource', function() { describe('create', function() { it('Sends the correct request', function() { customerCard.create({ - number: '123456', exp_month: '12', + number: '123456', + exp_month: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/CustomerSubscriptions.spec.js b/test/resources/CustomerSubscriptions.spec.js index 461e19e137..9920dbc743 100644 --- a/test/resources/CustomerSubscriptions.spec.js +++ b/test/resources/CustomerSubscriptions.spec.js @@ -7,10 +7,9 @@ var expect = require('chai').expect; var CUSTOMER_TEST_ID = 'customerIdTest999'; // Create new CustomerSubscription instance with pre-filled customerId: -var customerSubscription = new resources.CustomerSubscriptions( - stripe, - {customerId: CUSTOMER_TEST_ID} -); +var customerSubscription = new resources.CustomerSubscriptions(stripe, { + customerId: CUSTOMER_TEST_ID, +}); // Use spy from existing resource: customerSubscription._request = stripe.customers._request; @@ -21,7 +20,10 @@ describe('CustomerSubscription Resource', function() { customerSubscription.retrieve('subscriptionIdFoo456'); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/customers/' + CUSTOMER_TEST_ID + '/subscriptions/subscriptionIdFoo456', + url: + '/v1/customers/' + + CUSTOMER_TEST_ID + + '/subscriptions/subscriptionIdFoo456', headers: {}, data: {}, }); @@ -31,7 +33,8 @@ describe('CustomerSubscription Resource', function() { describe('create', function() { it('Sends the correct request', function() { customerSubscription.create({ - plan: 'gold', quantity: '12', + plan: 'gold', + quantity: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -49,7 +52,10 @@ describe('CustomerSubscription Resource', function() { }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', - url: '/v1/customers/' + CUSTOMER_TEST_ID + '/subscriptions/subscriptionIdFoo456', + url: + '/v1/customers/' + + CUSTOMER_TEST_ID + + '/subscriptions/subscriptionIdFoo456', headers: {}, data: {name: 'Bob M. Baz'}, }); @@ -61,7 +67,10 @@ describe('CustomerSubscription Resource', function() { customerSubscription.del('subscriptionIdFoo456'); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', - url: '/v1/customers/' + CUSTOMER_TEST_ID + '/subscriptions/subscriptionIdFoo456', + url: + '/v1/customers/' + + CUSTOMER_TEST_ID + + '/subscriptions/subscriptionIdFoo456', headers: {}, data: {}, }); @@ -83,10 +92,14 @@ describe('CustomerSubscription Resource', function() { describe('Discount methods', function() { describe('deleteDiscount', function() { it('Sends the correct request', function() { - customerSubscription.deleteDiscount('customerIdFoo321', 'subscriptionIdBar654'); + customerSubscription.deleteDiscount( + 'customerIdFoo321', + 'subscriptionIdBar654', + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', - url: '/v1/customers/customerIdFoo321/subscriptions/subscriptionIdBar654/discount', + url: + '/v1/customers/customerIdFoo321/subscriptions/subscriptionIdBar654/discount', headers: {}, data: {}, }); diff --git a/test/resources/Customers.spec.js b/test/resources/Customers.spec.js index c895f740a1..365e0e60e0 100644 --- a/test/resources/Customers.spec.js +++ b/test/resources/Customers.spec.js @@ -63,7 +63,10 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified idempotency_key in options]', function() { - stripe.customers.create({description: 'Some customer'}, {idempotency_key: 'foo'}); + stripe.customers.create( + {description: 'Some customer'}, + {idempotency_key: 'foo'}, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers', @@ -73,7 +76,10 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth in options]', function() { - stripe.customers.create({description: 'Some customer'}, {api_key: TEST_AUTH_KEY}); + stripe.customers.create( + {description: 'Some customer'}, + {api_key: TEST_AUTH_KEY}, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers', @@ -84,7 +90,10 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth and idempotent key in options]', function() { - stripe.customers.create({description: 'Some customer'}, {api_key: TEST_AUTH_KEY, idempotency_key: 'foo'}); + stripe.customers.create( + {description: 'Some customer'}, + {api_key: TEST_AUTH_KEY, idempotency_key: 'foo'}, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers', @@ -170,9 +179,13 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.updateSubscription('cus_123', { - plan: 'fooPlan', - }, TEST_AUTH_KEY); + stripe.customers.updateSubscription( + 'cus_123', + { + plan: 'fooPlan', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers/cus_123/subscription', @@ -219,7 +232,11 @@ describe('Customers Resource', function() { describe('With at_period_end defined [with specified auth]', function() { it('Sends the correct request', function() { - stripe.customers.cancelSubscription('cus_123', {at_period_end: true}, TEST_AUTH_KEY); + stripe.customers.cancelSubscription( + 'cus_123', + {at_period_end: true}, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', url: '/v1/customers/cus_123/subscription', @@ -276,19 +293,23 @@ describe('Customers Resource', function() { describe('When setting new metadata', function() { it('Sends one request to get current, and another to set new data', function() { - return expect(new Promise(function(resolve, reject) { - stripe.customers.setMetadata('cus_123', { - foo: 123, - baz: 456, - }).then(function() { - var reqs = stripe.REQUESTS; - resolve([ - // Last two requests - reqs[reqs.length - 2], - reqs[reqs.length - 1], - ]); - }); - })).to.eventually.deep.equal([ + return expect( + new Promise(function(resolve, reject) { + stripe.customers + .setMetadata('cus_123', { + foo: 123, + baz: 456, + }) + .then(function() { + var reqs = stripe.REQUESTS; + resolve([ + // Last two requests + reqs[reqs.length - 2], + reqs[reqs.length - 1], + ]); + }); + }), + ).to.eventually.deep.equal([ { // First reset metadata: method: 'POST', @@ -373,7 +394,8 @@ describe('Customers Resource', function() { describe('createCard', function() { it('Sends the correct request', function() { stripe.customers.createCard('cus_123', { - number: '123456', exp_month: '12', + number: '123456', + exp_month: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -384,9 +406,14 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.createCard('cus_123', { - number: '123456', exp_month: '12', - }, TEST_AUTH_KEY); + stripe.customers.createCard( + 'cus_123', + { + number: '123456', + exp_month: '12', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers/cus_123/cards', @@ -485,7 +512,9 @@ describe('Customers Resource', function() { describe('createSource', function() { it('Sends the correct request', function() { stripe.customers.createSource('cus_123', { - object: 'card', number: '123456', exp_month: '12', + object: 'card', + number: '123456', + exp_month: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -496,9 +525,15 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.createSource('cus_123', { - object: 'card', number: '123456', exp_month: '12', - }, TEST_AUTH_KEY); + stripe.customers.createSource( + 'cus_123', + { + object: 'card', + number: '123456', + exp_month: '12', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers/cus_123/sources', @@ -571,16 +606,21 @@ describe('Customers Resource', function() { describe('verifySource', function() { it('Sends the correct request', function() { - var data = {amounts: [32,45]} + var data = {amounts: [32, 45]}; - stripe.customers.verifySource('cus_123', 'card_123', data, TEST_AUTH_KEY); + stripe.customers.verifySource( + 'cus_123', + 'card_123', + data, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers/cus_123/sources/card_123/verify', headers: {}, data: data, auth: TEST_AUTH_KEY, - }) + }); }); }); }); @@ -598,7 +638,11 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.retrieveSubscription('cus_123', 'sub_123', TEST_AUTH_KEY); + stripe.customers.retrieveSubscription( + 'cus_123', + 'sub_123', + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', url: '/v1/customers/cus_123/subscriptions/sub_123', @@ -612,7 +656,8 @@ describe('Customers Resource', function() { describe('createSubscription', function() { it('Sends the correct request', function() { stripe.customers.createSubscription('cus_123', { - plan: 'gold', quantity: '12', + plan: 'gold', + quantity: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -623,9 +668,14 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.createSubscription('cus_123', { - plan: 'gold', quantity: '12', - }, TEST_AUTH_KEY); + stripe.customers.createSubscription( + 'cus_123', + { + plan: 'gold', + quantity: '12', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers/cus_123/subscriptions', @@ -650,9 +700,14 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.updateSubscription('cus_123', 'sub_123', { - quantity: '2', - }, TEST_AUTH_KEY); + stripe.customers.updateSubscription( + 'cus_123', + 'sub_123', + { + quantity: '2', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers/cus_123/subscriptions/sub_123', @@ -675,7 +730,11 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.cancelSubscription('cus_123', 'sub_123', TEST_AUTH_KEY); + stripe.customers.cancelSubscription( + 'cus_123', + 'sub_123', + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', url: '/v1/customers/cus_123/subscriptions/sub_123', @@ -687,7 +746,9 @@ describe('Customers Resource', function() { describe('With at_period_end defined', function() { it('Sends the correct request', function() { - stripe.customers.cancelSubscription('cus_123', 'sub_123', {at_period_end: true}); + stripe.customers.cancelSubscription('cus_123', 'sub_123', { + at_period_end: true, + }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', url: '/v1/customers/cus_123/subscriptions/sub_123', @@ -703,7 +764,7 @@ describe('Customers Resource', function() { 'cus_123', 'sub_123', {at_period_end: true}, - TEST_AUTH_KEY + TEST_AUTH_KEY, ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', diff --git a/test/resources/EphemeralKeys.spec.js b/test/resources/EphemeralKeys.spec.js index 565a066186..2fe31643a1 100644 --- a/test/resources/EphemeralKeys.spec.js +++ b/test/resources/EphemeralKeys.spec.js @@ -5,14 +5,14 @@ var expect = require('chai').expect; function errorsOnNoStripeVersion() { return expect( - stripe.ephemeralKeys.create({customer: 'cus_123'}) + stripe.ephemeralKeys.create({customer: 'cus_123'}), ).to.be.eventually.rejectedWith(/stripe_version must be specified/i); } function sendsCorrectStripeVersion() { stripe.ephemeralKeys.create( {customer: 'cus_123'}, - {stripe_version: '2017-06-05'} + {stripe_version: '2017-06-05'}, ); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -32,7 +32,7 @@ describe('EphemeralKey Resource', function() { it('Sends the correct request', function() { stripe.ephemeralKeys.create( {customer: 'cus_123'}, - {stripe_version: '2017-05-25'} + {stripe_version: '2017-05-25'}, ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/FileUploads.spec.js b/test/resources/FileUploads.spec.js index c8ea6bb6dd..e39343b3ca 100644 --- a/test/resources/FileUploads.spec.js +++ b/test/resources/FileUploads.spec.js @@ -67,15 +67,18 @@ describe('File Uploads Resource', function() { var testFilename = path.join(__dirname, 'data/minimal.pdf'); var f = fs.readFileSync(testFilename); - stripe.fileUploads.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', + stripe.fileUploads.create( + { + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + file_link_data: {create: true}, }, - file_link_data: {create: true}, - }, TEST_AUTH_KEY); + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); @@ -87,39 +90,52 @@ describe('File Uploads Resource', function() { var testFilename = path.join(__dirname, 'data/minimal.pdf'); var f = fs.createReadStream(testFilename); - return stripe.fileUploads.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - file_link_data: {create: true}, - }).then(function() { - expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); - expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); - expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); - }); + return stripe.fileUploads + .create({ + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + file_link_data: {create: true}, + }) + .then(function() { + expect(stripe.LAST_REQUEST).to.deep.property( + 'host', + 'files.stripe.com', + ); + expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); + expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); + }); }); it('Streams a file and sends the correct file upload request [with specified auth]', function() { var testFilename = path.join(__dirname, 'data/minimal.pdf'); var f = fs.createReadStream(testFilename); - return stripe.fileUploads.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - file_link_data: {create: true}, - }, TEST_AUTH_KEY).then(function() { - expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); - expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); - expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); - expect(stripe.LAST_REQUEST).to.deep.property('auth', TEST_AUTH_KEY); - }); + return stripe.fileUploads + .create( + { + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + file_link_data: {create: true}, + }, + TEST_AUTH_KEY, + ) + .then(function() { + expect(stripe.LAST_REQUEST).to.deep.property( + 'host', + 'files.stripe.com', + ); + expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); + expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); + expect(stripe.LAST_REQUEST).to.deep.property('auth', TEST_AUTH_KEY); + }); }); }); }); diff --git a/test/resources/Files.spec.js b/test/resources/Files.spec.js index 215652cec1..c174e4a68b 100644 --- a/test/resources/Files.spec.js +++ b/test/resources/Files.spec.js @@ -67,15 +67,18 @@ describe('Files Resource', function() { var testFilename = path.join(__dirname, 'data/minimal.pdf'); var f = fs.readFileSync(testFilename); - stripe.files.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', + stripe.files.create( + { + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + file_link_data: {create: true}, }, - file_link_data: {create: true}, - }, TEST_AUTH_KEY); + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); @@ -87,39 +90,52 @@ describe('Files Resource', function() { var testFilename = path.join(__dirname, 'data/minimal.pdf'); var f = fs.createReadStream(testFilename); - return stripe.files.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - file_link_data: {create: true}, - }).then(function() { - expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); - expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); - expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); - }); + return stripe.files + .create({ + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + file_link_data: {create: true}, + }) + .then(function() { + expect(stripe.LAST_REQUEST).to.deep.property( + 'host', + 'files.stripe.com', + ); + expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); + expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); + }); }); it('Streams a file and sends the correct file upload request [with specified auth]', function() { var testFilename = path.join(__dirname, 'data/minimal.pdf'); var f = fs.createReadStream(testFilename); - return stripe.files.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - file_link_data: {create: true}, - }, TEST_AUTH_KEY).then(function() { - expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); - expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); - expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); - expect(stripe.LAST_REQUEST).to.deep.property('auth', TEST_AUTH_KEY); - }); + return stripe.files + .create( + { + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + file_link_data: {create: true}, + }, + TEST_AUTH_KEY, + ) + .then(function() { + expect(stripe.LAST_REQUEST).to.deep.property( + 'host', + 'files.stripe.com', + ); + expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); + expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); + expect(stripe.LAST_REQUEST).to.deep.property('auth', TEST_AUTH_KEY); + }); }); }); }); diff --git a/test/resources/Invoices.spec.js b/test/resources/Invoices.spec.js index 980e24bcd8..cfd8657b2d 100644 --- a/test/resources/Invoices.spec.js +++ b/test/resources/Invoices.spec.js @@ -104,15 +104,13 @@ describe('Invoices Resource', function() { describe('With an options object that includes `subscription_items`', function() { it('Sends the correct request', function() { stripe.invoices.retrieveUpcoming('cus_123', { - subscription_items: [ - {plan: 'potato'}, - {plan: 'rutabaga'}, - ], + subscription_items: [{plan: 'potato'}, {plan: 'rutabaga'}], }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/invoices/upcoming?customer=cus_123&' + + url: + '/v1/invoices/upcoming?customer=cus_123&' + 'subscription_items[0][plan]=potato&subscription_items[1][plan]=rutabaga', headers: {}, data: {}, @@ -124,15 +122,13 @@ describe('Invoices Resource', function() { it('Sends the correct request', function() { stripe.invoices.retrieveUpcoming({ customer: 'cus_abc', - subscription_items: [ - {plan: 'potato'}, - {plan: 'rutabaga'}, - ], + subscription_items: [{plan: 'potato'}, {plan: 'rutabaga'}], }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/invoices/upcoming?customer=cus_abc&' + + url: + '/v1/invoices/upcoming?customer=cus_abc&' + 'subscription_items[0][plan]=potato&subscription_items[1][plan]=rutabaga', headers: {}, data: {}, @@ -142,15 +138,14 @@ describe('Invoices Resource', function() { describe('With an options object that includes `subscription_items` in addition to a subscription ID', function() { it('Sends the correct request', function() { - stripe.invoices.retrieveUpcoming('cus_123', 'sub_123', - { - subscription_items: [ - {plan: 'potato'}, - {plan: 'rutabaga'}, - {id: 'SOME_ID', deleted: true}, - ], - subscription_prorate: true, - }); + stripe.invoices.retrieveUpcoming('cus_123', 'sub_123', { + subscription_items: [ + {plan: 'potato'}, + {plan: 'rutabaga'}, + {id: 'SOME_ID', deleted: true}, + ], + subscription_prorate: true, + }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -188,7 +183,7 @@ describe('Invoices Resource', function() { method: 'POST', url: '/v1/invoices/in_123/finalize', headers: {}, - data: {} + data: {}, }); }); }); @@ -200,12 +195,11 @@ describe('Invoices Resource', function() { method: 'POST', url: '/v1/invoices/in_123/mark_uncollectible', headers: {}, - data: {} + data: {}, }); }); }); - describe('pay', function() { it('Sends the correct request', function() { stripe.invoices.pay('in_123', { @@ -227,7 +221,7 @@ describe('Invoices Resource', function() { method: 'POST', url: '/v1/invoices/in_123/send', headers: {}, - data: {} + data: {}, }); }); }); @@ -239,7 +233,7 @@ describe('Invoices Resource', function() { method: 'POST', url: '/v1/invoices/in_123/void', headers: {}, - data: {} + data: {}, }); }); }); diff --git a/test/resources/Issuing/Authorization.spec.js b/test/resources/Issuing/Authorization.spec.js index b4eb56de4c..bb3e3d5d01 100644 --- a/test/resources/Issuing/Authorization.spec.js +++ b/test/resources/Issuing/Authorization.spec.js @@ -3,7 +3,7 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Issuing', function () { +describe('Issuing', function() { describe('Authorization Resource', function() { describe('retrieve', function() { it('Sends the correct request', function() { @@ -34,7 +34,7 @@ describe('Issuing', function () { stripe.issuing.authorizations.update('iauth_123', { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -44,7 +44,7 @@ describe('Issuing', function () { data: { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }, }); diff --git a/test/resources/Issuing/Cardholders.spec.js b/test/resources/Issuing/Cardholders.spec.js index b854cd592c..646e735c40 100644 --- a/test/resources/Issuing/Cardholders.spec.js +++ b/test/resources/Issuing/Cardholders.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Issuing', function () { - describe('Cardholders Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Issuing', function() { + describe('Cardholders Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.issuing.cardholders.retrieve('ich_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Issuing', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.issuing.cardholders.create({ billing: {}, name: 'Tim Testperson', @@ -39,12 +39,12 @@ describe('Issuing', function () { }); }); - describe('update', function () { - it('Sends the correct request', function () { + describe('update', function() { + it('Sends the correct request', function() { stripe.issuing.cardholders.update('ich_123', { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -54,15 +54,15 @@ describe('Issuing', function () { data: { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }, }); }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.issuing.cardholders.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Issuing/Cards.spec.js b/test/resources/Issuing/Cards.spec.js index 8cf312a16c..90e8111ff3 100644 --- a/test/resources/Issuing/Cards.spec.js +++ b/test/resources/Issuing/Cards.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Issuing', function () { - describe('Cards Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Issuing', function() { + describe('Cards Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.issuing.cards.retrieve('ic_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Issuing', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.issuing.cards.create({ currency: 'usd', type: 'physical', @@ -37,12 +37,12 @@ describe('Issuing', function () { }); }); - describe('update', function () { - it('Sends the correct request', function () { + describe('update', function() { + it('Sends the correct request', function() { stripe.issuing.cards.update('ic_123', { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -52,15 +52,15 @@ describe('Issuing', function () { data: { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }, }); }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.issuing.cards.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -72,9 +72,9 @@ describe('Issuing', function () { }); }); - describe('Virtual Cards Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { + describe('Virtual Cards Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.issuing.cards.retrieveDetails('ic_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ diff --git a/test/resources/Issuing/Disputes.spec.js b/test/resources/Issuing/Disputes.spec.js index dcb5ac6eb2..2af1f0cd43 100644 --- a/test/resources/Issuing/Disputes.spec.js +++ b/test/resources/Issuing/Disputes.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Issuing', function () { - describe('Disputes Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Issuing', function() { + describe('Disputes Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.issuing.disputes.retrieve('idp_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Issuing', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.issuing.disputes.create({ transaction: 'ipi_123', }); @@ -35,12 +35,12 @@ describe('Issuing', function () { }); }); - describe('update', function () { - it('Sends the correct request', function () { + describe('update', function() { + it('Sends the correct request', function() { stripe.issuing.disputes.update('idp_123', { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -50,15 +50,15 @@ describe('Issuing', function () { data: { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }, }); }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.issuing.disputes.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Issuing/Transactions.spec.js b/test/resources/Issuing/Transactions.spec.js index ca44877232..89e6ffac5f 100644 --- a/test/resources/Issuing/Transactions.spec.js +++ b/test/resources/Issuing/Transactions.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Issuing', function () { - describe('Transactions Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Issuing', function() { + describe('Transactions Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.issuing.transactions.retrieve('ipi_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,12 +19,12 @@ describe('Issuing', function () { }); }); - describe('update', function () { - it('Sends the correct request', function () { + describe('update', function() { + it('Sends the correct request', function() { stripe.issuing.transactions.update('ipi_123', { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -34,15 +34,15 @@ describe('Issuing', function () { data: { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }, }); }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.issuing.transactions.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/LoginLinks.spec.js b/test/resources/LoginLinks.spec.js index b796a4356e..f46361259a 100644 --- a/test/resources/LoginLinks.spec.js +++ b/test/resources/LoginLinks.spec.js @@ -7,10 +7,7 @@ var expect = require('chai').expect; var ACCOUNT_ID = 'acct_EXPRESS'; // Create new LoginLink instance with pre-filled accountId: -var loginLink = new resources.LoginLinks( - stripe, - {accountId: ACCOUNT_ID} -); +var loginLink = new resources.LoginLinks(stripe, {accountId: ACCOUNT_ID}); // Use spy from existing resource: loginLink._request = stripe.customers._request; diff --git a/test/resources/OAuth.spec.js b/test/resources/OAuth.spec.js index 5f21e48eea..7db3345309 100644 --- a/test/resources/OAuth.spec.js +++ b/test/resources/OAuth.spec.js @@ -32,7 +32,7 @@ describe('OAuth', function() { it('Uses the correct query', function() { var url = stripe.oauth.authorizeUrl({state: 'some_state'}); - var query = qs.parse(URL.parse(url).query) + var query = qs.parse(URL.parse(url).query); expect(query.client_id).to.equal('default_client_id'); expect(query.response_type).to.equal('code'); @@ -43,7 +43,7 @@ describe('OAuth', function() { it('Uses a provided client_id instead of the default', function() { var url = stripe.oauth.authorizeUrl({client_id: '123abc'}); - var query = qs.parse(URL.parse(url).query) + var query = qs.parse(URL.parse(url).query); expect(query.client_id).to.equal('123abc'); }); @@ -64,7 +64,7 @@ describe('OAuth', function() { it('Sends the correct request', function() { stripe.oauth.token({ code: '123abc', - grant_type: 'authorization_code' + grant_type: 'authorization_code', }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -74,7 +74,7 @@ describe('OAuth', function() { headers: {}, data: { code: '123abc', - grant_type: 'authorization_code' + grant_type: 'authorization_code', }, }); }); @@ -97,7 +97,7 @@ describe('OAuth', function() { headers: {}, data: { client_id: stripe.getClientId(), - stripe_user_id: 'some_user_id' + stripe_user_id: 'some_user_id', }, }); }); @@ -115,7 +115,7 @@ describe('OAuth', function() { headers: {}, data: { client_id: '123abc', - stripe_user_id: 'some_user_id' + stripe_user_id: 'some_user_id', }, }); }); diff --git a/test/resources/Orders.spec.js b/test/resources/Orders.spec.js index 092d6de8d2..d0d05de51c 100644 --- a/test/resources/Orders.spec.js +++ b/test/resources/Orders.spec.js @@ -56,7 +56,7 @@ describe('Order Resource', function() { headers: {}, }); }); - }) + }); describe('list', function() { it('Sends the correct request', function() { @@ -105,9 +105,7 @@ describe('Order Resource', function() { describe('returnOrder', function() { it('Sends the correct request', function() { stripe.orders.returnOrder('orderIdFoo3242', { - items: [ - {parent: 'sku_123'}, - ], + items: [{parent: 'sku_123'}], }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/PaymentMethods.spec.js b/test/resources/PaymentMethods.spec.js index 8106dce73b..bc395521db 100644 --- a/test/resources/PaymentMethods.spec.js +++ b/test/resources/PaymentMethods.spec.js @@ -69,7 +69,7 @@ describe('PaymentMethods Resource', function() { method: 'POST', url: '/v1/payment_methods/pm_123/attach', headers: {}, - data: {customer: 'cus_123'} + data: {customer: 'cus_123'}, }); }); }); @@ -81,7 +81,7 @@ describe('PaymentMethods Resource', function() { method: 'POST', url: '/v1/payment_methods/pm_123/detach', headers: {}, - data: {} + data: {}, }); }); }); diff --git a/test/resources/Payouts.spec.js b/test/resources/Payouts.spec.js index 9d4f92b648..8b19252a64 100644 --- a/test/resources/Payouts.spec.js +++ b/test/resources/Payouts.spec.js @@ -21,7 +21,8 @@ describe('Payouts Resource', function() { describe('create', function() { it('Sends the correct request', function() { stripe.payouts.create({ - amount: 200, currency: 'usd', + amount: 200, + currency: 'usd', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/Persons.spec.js b/test/resources/Persons.spec.js index 0a355d0ad8..8d7112dbce 100644 --- a/test/resources/Persons.spec.js +++ b/test/resources/Persons.spec.js @@ -8,10 +8,7 @@ var ACCOUNT_TEST_ID = 'acct_123'; var PERSON_TEST_ID = 'person_123'; // Create new Person instance with pre-filled accountId: -var person = new resources.Persons( - stripe, - {accountId: ACCOUNT_TEST_ID} -); +var person = new resources.Persons(stripe, {accountId: ACCOUNT_TEST_ID}); // Use spy from existing resource: person._request = stripe.customers._request; @@ -81,4 +78,3 @@ describe('Person Resource', function() { }); }); }); - diff --git a/test/resources/Plans.spec.js b/test/resources/Plans.spec.js index d231ddb6b6..6468c95f46 100644 --- a/test/resources/Plans.spec.js +++ b/test/resources/Plans.spec.js @@ -11,7 +11,7 @@ describe('Plans Resource', function() { method: 'GET', url: '/v1/plans/planId1', headers: {}, - data: {} + data: {}, }); }); }); @@ -20,13 +20,13 @@ describe('Plans Resource', function() { it('Sends the correct request', function() { stripe.plans.create({ amount: 200, - currency: 'usd' + currency: 'usd', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/plans', headers: {}, - data: {amount: 200, currency: 'usd'} + data: {amount: 200, currency: 'usd'}, }); }); @@ -34,13 +34,13 @@ describe('Plans Resource', function() { stripe.plans.create({ amount: 200, currency: 'usd', - usage_type: 'metered' + usage_type: 'metered', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/plans', headers: {}, - data: {amount: 200, currency: 'usd', usage_type: 'metered'} + data: {amount: 200, currency: 'usd', usage_type: 'metered'}, }); }); @@ -49,7 +49,7 @@ describe('Plans Resource', function() { currency: 'usd', billing_scheme: 'tiered', tiers: [{up_to: 123, amount: 100}, {up_to: 'inf', amount: 200}], - tiers_mode: 'volume' + tiers_mode: 'volume', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -59,8 +59,8 @@ describe('Plans Resource', function() { currency: 'usd', billing_scheme: 'tiered', tiers: [{up_to: 123, amount: 100}, {up_to: 'inf', amount: 200}], - tiers_mode: 'volume' - } + tiers_mode: 'volume', + }, }); }); @@ -68,7 +68,7 @@ describe('Plans Resource', function() { stripe.plans.create({ amount: 200, currency: 'usd', - transform_usage: {divide_by: 123, round: 'up'} + transform_usage: {divide_by: 123, round: 'up'}, }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -77,8 +77,8 @@ describe('Plans Resource', function() { data: { amount: 200, currency: 'usd', - transform_usage: {divide_by: 123, round: 'up'} - } + transform_usage: {divide_by: 123, round: 'up'}, + }, }); }); }); @@ -87,13 +87,13 @@ describe('Plans Resource', function() { it('Sends the correct request', function() { stripe.plans.update('planId3', { amount: 1900, - currency: 'usd' + currency: 'usd', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/plans/planId3', headers: {}, - data: {amount: 1900, currency: 'usd'} + data: {amount: 1900, currency: 'usd'}, }); }); }); @@ -105,7 +105,7 @@ describe('Plans Resource', function() { method: 'DELETE', url: '/v1/plans/planId4', headers: {}, - data: {} + data: {}, }); }); }); @@ -117,7 +117,7 @@ describe('Plans Resource', function() { method: 'GET', url: '/v1/plans', headers: {}, - data: {} + data: {}, }); }); }); diff --git a/test/resources/Products.spec.js b/test/resources/Products.spec.js index 274f82ecac..9efb4ec49e 100644 --- a/test/resources/Products.spec.js +++ b/test/resources/Products.spec.js @@ -34,7 +34,7 @@ describe('Product Resource', function() { headers: {}, }); }); - }) + }); describe('list', function() { it('Sends the correct request', function() { diff --git a/test/resources/Radar/ValueListItems.spec.js b/test/resources/Radar/ValueListItems.spec.js index 3ce40f3e17..ee414a1e77 100644 --- a/test/resources/Radar/ValueListItems.spec.js +++ b/test/resources/Radar/ValueListItems.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Radar', function () { - describe('ValueLists Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Radar', function() { + describe('ValueLists Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.radar.valueListItems.retrieve('rsli_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Radar', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.radar.valueListItems.create({ value_list: 'rsl_123', value: 'value', @@ -37,8 +37,8 @@ describe('Radar', function () { }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.radar.valueListItems.list({ value_list: 'rsl_123', }); diff --git a/test/resources/Radar/ValueLists.spec.js b/test/resources/Radar/ValueLists.spec.js index 8c3743af5e..1acaf6dc53 100644 --- a/test/resources/Radar/ValueLists.spec.js +++ b/test/resources/Radar/ValueLists.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Radar', function () { - describe('ValueLists Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Radar', function() { + describe('ValueLists Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.radar.valueLists.retrieve('rsl_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Radar', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.radar.valueLists.create({ alias: 'alias', name: 'name', @@ -37,8 +37,8 @@ describe('Radar', function () { }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.radar.valueLists.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/RecipientCards.spec.js b/test/resources/RecipientCards.spec.js index 85475fd93a..abd4007442 100644 --- a/test/resources/RecipientCards.spec.js +++ b/test/resources/RecipientCards.spec.js @@ -7,10 +7,9 @@ var expect = require('chai').expect; var RECIPIENT_TEST_ID = 'recipientIdTest999'; // Create new recipientCard instance with pre-filled recipientId: -var recipientCard = new resources.RecipientCards( - stripe, - {recipientId: RECIPIENT_TEST_ID} -); +var recipientCard = new resources.RecipientCards(stripe, { + recipientId: RECIPIENT_TEST_ID, +}); // Use spy from existing resource: recipientCard._request = stripe.recipients._request; @@ -31,7 +30,8 @@ describe('RecipientCard Resource', function() { describe('create', function() { it('Sends the correct request', function() { recipientCard.create({ - number: '123456', exp_month: '12', + number: '123456', + exp_month: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/Recipients.spec.js b/test/resources/Recipients.spec.js index 51350d079b..1e3ea46a16 100644 --- a/test/resources/Recipients.spec.js +++ b/test/resources/Recipients.spec.js @@ -21,7 +21,8 @@ describe('Recipients Resource', function() { describe('create', function() { it('Sends the correct request', function() { stripe.recipients.create({ - name: 'Bob', type: 'individual', + name: 'Bob', + type: 'individual', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -83,7 +84,11 @@ describe('Recipients Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.recipients.retrieveCard('recipientIdFoo321', 'cardIdFoo456', TEST_AUTH_KEY); + stripe.recipients.retrieveCard( + 'recipientIdFoo321', + 'cardIdFoo456', + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', url: '/v1/recipients/recipientIdFoo321/cards/cardIdFoo456', @@ -97,7 +102,8 @@ describe('Recipients Resource', function() { describe('createCard', function() { it('Sends the correct request', function() { stripe.recipients.createCard('recipientIdFoo321', { - number: '123456', exp_month: '12', + number: '123456', + exp_month: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -108,9 +114,14 @@ describe('Recipients Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.recipients.createCard('recipientIdFoo321', { - number: '123456', exp_month: '12', - }, TEST_AUTH_KEY); + stripe.recipients.createCard( + 'recipientIdFoo321', + { + number: '123456', + exp_month: '12', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/recipients/recipientIdFoo321/cards', @@ -147,7 +158,11 @@ describe('Recipients Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.recipients.deleteCard('recipientIdFoo321', 'cardIdFoo456', TEST_AUTH_KEY); + stripe.recipients.deleteCard( + 'recipientIdFoo321', + 'cardIdFoo456', + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', url: '/v1/recipients/recipientIdFoo321/cards/cardIdFoo456', diff --git a/test/resources/Refunds.spec.js b/test/resources/Refunds.spec.js index f47550f01b..fd8a32b104 100644 --- a/test/resources/Refunds.spec.js +++ b/test/resources/Refunds.spec.js @@ -9,7 +9,7 @@ describe('Refund Resource', function() { stripe.refunds.create({ amount: '300', charge: 'ch_123', - }) + }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/Reporting/ReportRuns.spec.js b/test/resources/Reporting/ReportRuns.spec.js index fa6cb522cc..a9f04c6692 100644 --- a/test/resources/Reporting/ReportRuns.spec.js +++ b/test/resources/Reporting/ReportRuns.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Reporting', function () { - describe('ReportRuns Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Reporting', function() { + describe('ReportRuns Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.reporting.reportRuns.retrieve('frr_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Reporting', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.reporting.reportRuns.create({ parameters: { connected_account: 'acct_123', @@ -41,8 +41,8 @@ describe('Reporting', function () { }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.reporting.reportRuns.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Reporting/ReportTypes.spec.js b/test/resources/Reporting/ReportTypes.spec.js index 75b99d4d60..a13c2db4b3 100644 --- a/test/resources/Reporting/ReportTypes.spec.js +++ b/test/resources/Reporting/ReportTypes.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Reporting', function () { - describe('ReportTypes Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Reporting', function() { + describe('ReportTypes Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.reporting.reportTypes.retrieve('activity.summary.1'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Reporting', function () { }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.reporting.reportTypes.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/SKUs.spec.js b/test/resources/SKUs.spec.js index 24ce99437d..fc9d1f27e7 100644 --- a/test/resources/SKUs.spec.js +++ b/test/resources/SKUs.spec.js @@ -38,7 +38,7 @@ describe('SKU Resource', function() { headers: {}, }); }); - }) + }); describe('list', function() { it('Sends the correct request', function() { diff --git a/test/resources/Sigma/ScheduledQueryRuns.spec.js b/test/resources/Sigma/ScheduledQueryRuns.spec.js index 88e81ce2b1..857fee694e 100644 --- a/test/resources/Sigma/ScheduledQueryRuns.spec.js +++ b/test/resources/Sigma/ScheduledQueryRuns.spec.js @@ -3,7 +3,7 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Sigma', function () { +describe('Sigma', function() { describe('ScheduledQueryRun Resource', function() { describe('retrieve', function() { it('Sends the correct request', function() { diff --git a/test/resources/SubscriptionSchedule.spec.js b/test/resources/SubscriptionSchedule.spec.js index b38246c129..87cc9d723a 100644 --- a/test/resources/SubscriptionSchedule.spec.js +++ b/test/resources/SubscriptionSchedule.spec.js @@ -11,7 +11,7 @@ describe('Subscription Schedule Resource', function() { it('Sends the correct request', function() { var data = { invoice_now: true, - } + }; stripe.subscriptionSchedules.cancel(SCHEDULE_TEST_ID, data); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -53,7 +53,7 @@ describe('Subscription Schedule Resource', function() { it('Sends the correct request', function() { var data = { preserve_cancel_date: true, - } + }; stripe.subscriptionSchedules.release(SCHEDULE_TEST_ID, data); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -92,10 +92,17 @@ describe('Subscription Schedule Resource', function() { describe('Revision methods', function() { describe('retrieveRevision', function() { it('Sends the correct request', function() { - stripe.subscriptionSchedules.retrieveRevision(SCHEDULE_TEST_ID, REVISION_TEST_ID); + stripe.subscriptionSchedules.retrieveRevision( + SCHEDULE_TEST_ID, + REVISION_TEST_ID, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/subscription_schedules/' + SCHEDULE_TEST_ID + '/revisions/' + REVISION_TEST_ID, + url: + '/v1/subscription_schedules/' + + SCHEDULE_TEST_ID + + '/revisions/' + + REVISION_TEST_ID, headers: {}, data: {}, }); diff --git a/test/resources/SubscriptionScheduleRevision.spec.js b/test/resources/SubscriptionScheduleRevision.spec.js index bbc76a5e1b..58adf867cf 100644 --- a/test/resources/SubscriptionScheduleRevision.spec.js +++ b/test/resources/SubscriptionScheduleRevision.spec.js @@ -8,10 +8,9 @@ var SCHEDULE_TEST_ID = 'sub_sched_123'; var REVISION_TEST_ID = 'sub_sched_rev_123'; // Create new SubscriptionScheduleRevision instance with pre-filled scheduleId: -var revision = new resources.SubscriptionScheduleRevisions( - stripe, - {scheduleId: SCHEDULE_TEST_ID} -); +var revision = new resources.SubscriptionScheduleRevisions(stripe, { + scheduleId: SCHEDULE_TEST_ID, +}); // Use spy from existing resource: revision._request = stripe.customers._request; @@ -34,11 +33,14 @@ describe('SubscriptionScheduleRevision Resource', function() { revision.retrieve(REVISION_TEST_ID); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/subscription_schedules/' + SCHEDULE_TEST_ID + '/revisions/' + REVISION_TEST_ID, + url: + '/v1/subscription_schedules/' + + SCHEDULE_TEST_ID + + '/revisions/' + + REVISION_TEST_ID, data: {}, headers: {}, }); }); }); }); - diff --git a/test/resources/Subscriptions.spec.js b/test/resources/Subscriptions.spec.js index 8e732dab61..31b1e876f5 100644 --- a/test/resources/Subscriptions.spec.js +++ b/test/resources/Subscriptions.spec.js @@ -133,8 +133,8 @@ describe('subscriptions Resource', function() { data: { items: { '0': { - 'plan': 'foo', - 'quantity': 2, + plan: 'foo', + quantity: 2, }, }, }, @@ -160,8 +160,8 @@ describe('subscriptions Resource', function() { data: { items: { '0': { - 'plan': 'foo', - 'quantity': 2, + plan: 'foo', + quantity: 2, }, }, }, diff --git a/test/resources/TaxIds.spec.js b/test/resources/TaxIds.spec.js index 4de4cf2804..773400e030 100644 --- a/test/resources/TaxIds.spec.js +++ b/test/resources/TaxIds.spec.js @@ -7,10 +7,7 @@ var expect = require('chai').expect; var CUSTOMER_TEST_ID = 'cus_123'; var TAX_ID_TEST_ID = 'txi_123'; -var taxId = new resources.TaxIds( - stripe, - {customerId: CUSTOMER_TEST_ID} -); +var taxId = new resources.TaxIds(stripe, {customerId: CUSTOMER_TEST_ID}); // Use spy from existing resource: taxId._request = stripe.customers._request; diff --git a/test/resources/Terminal/ConnectionTokens.spec.js b/test/resources/Terminal/ConnectionTokens.spec.js index b0a58510ba..75dd800361 100644 --- a/test/resources/Terminal/ConnectionTokens.spec.js +++ b/test/resources/Terminal/ConnectionTokens.spec.js @@ -5,9 +5,9 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; describe('Terminal', function() { - describe('ConnectionToken Resource', function () { + describe('ConnectionToken Resource', function() { describe('create', function() { - it('Sends the correct request', function () { + it('Sends the correct request', function() { stripe.terminal.connectionTokens.create({}); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/Terminal/Locations.spec.js b/test/resources/Terminal/Locations.spec.js index bc6f7b41ae..335beb55b9 100644 --- a/test/resources/Terminal/Locations.spec.js +++ b/test/resources/Terminal/Locations.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Terminal', function () { - describe('Locations Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Terminal', function() { + describe('Locations Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.terminal.locations.retrieve('loc_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Terminal', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.terminal.locations.create({ display_name: 'name', address: { @@ -61,10 +61,10 @@ describe('Terminal', function () { }); }); - describe('update', function () { - it('Sends the correct request', function () { + describe('update', function() { + it('Sends the correct request', function() { stripe.terminal.locations.update('loc_123', { - display_name: 'name' + display_name: 'name', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -77,8 +77,8 @@ describe('Terminal', function () { }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.terminal.locations.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Terminal/Readers.spec.js b/test/resources/Terminal/Readers.spec.js index c3739c2b39..ab6f60451f 100644 --- a/test/resources/Terminal/Readers.spec.js +++ b/test/resources/Terminal/Readers.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Terminal', function () { - describe('Readers Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Terminal', function() { + describe('Readers Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.terminal.readers.retrieve('rdr_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Terminal', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.terminal.readers.create({ registration_code: 'a-b-c', label: 'name', @@ -49,10 +49,10 @@ describe('Terminal', function () { }); }); - describe('update', function () { - it('Sends the correct request', function () { + describe('update', function() { + it('Sends the correct request', function() { stripe.terminal.readers.update('rdr_123', { - label: 'name' + label: 'name', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -65,8 +65,8 @@ describe('Terminal', function () { }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.terminal.readers.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Topups.spec.js b/test/resources/Topups.spec.js index 88db95651a..7c1d1c2b94 100644 --- a/test/resources/Topups.spec.js +++ b/test/resources/Topups.spec.js @@ -66,12 +66,12 @@ describe('Topup Resource', function() { describe('update', function() { it('Sends the correct request', function() { - stripe.topups.update('tu_123', {metadata: {'key': 'value'}}); + stripe.topups.update('tu_123', {metadata: {key: 'value'}}); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/topups/tu_123', headers: {}, - data: {metadata: {'key': 'value'}}, + data: {metadata: {key: 'value'}}, }); }); }); diff --git a/test/resources/TransferReversals.spec.js b/test/resources/TransferReversals.spec.js index 19cb36f8a1..5f06d8c0e9 100644 --- a/test/resources/TransferReversals.spec.js +++ b/test/resources/TransferReversals.spec.js @@ -8,10 +8,9 @@ var TRANSFER_TEST_ID = 'transferIdTest999'; var REVERSAL_TEST_ID = 'reversalIdTest999'; // Create new CustomerCard instance with pre-filled customerId: -var transferReversal = new resources.TransferReversals( - stripe, - {transferId: TRANSFER_TEST_ID} -); +var transferReversal = new resources.TransferReversals(stripe, { + transferId: TRANSFER_TEST_ID, +}); // Use spy from existing resource: transferReversal._request = stripe.customers._request; @@ -22,7 +21,11 @@ describe('TransferReversal Resource', function() { transferReversal.retrieve(REVERSAL_TEST_ID); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/transfers/' + TRANSFER_TEST_ID + '/reversals/' + REVERSAL_TEST_ID, + url: + '/v1/transfers/' + + TRANSFER_TEST_ID + + '/reversals/' + + REVERSAL_TEST_ID, data: {}, headers: {}, }); @@ -50,7 +53,11 @@ describe('TransferReversal Resource', function() { }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', - url: '/v1/transfers/' + TRANSFER_TEST_ID + '/reversals/' + REVERSAL_TEST_ID, + url: + '/v1/transfers/' + + TRANSFER_TEST_ID + + '/reversals/' + + REVERSAL_TEST_ID, data: {metadata: {key: 'value'}}, headers: {}, }); @@ -69,4 +76,3 @@ describe('TransferReversal Resource', function() { }); }); }); - diff --git a/test/resources/Transfers.spec.js b/test/resources/Transfers.spec.js index 8fc6cdce71..f00ba9defb 100644 --- a/test/resources/Transfers.spec.js +++ b/test/resources/Transfers.spec.js @@ -19,7 +19,9 @@ describe('Transfers Resource', function() { describe('create', function() { it('Sends the correct request', function() { stripe.transfers.create({ - amount: 200, currency: 'usd', recipient: {}, + amount: 200, + currency: 'usd', + recipient: {}, }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/UsageRecordSummaries.spec.js b/test/resources/UsageRecordSummaries.spec.js index 7f9a1285a3..07b3f1cbb3 100644 --- a/test/resources/UsageRecordSummaries.spec.js +++ b/test/resources/UsageRecordSummaries.spec.js @@ -12,25 +12,31 @@ describe('UsageRecordSummaries Resource', function() { method: 'GET', url: '/v1/subscription_items/si_123/usage_record_summaries', headers: {}, - data: {} + data: {}, }); }); it('Includes any options that were provided', function(done) { - stripe.usageRecordSummaries.list('si_123', {}, { - stripe_account: 'acct_456', - }).then(function(record) { - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/subscription_items/si_123/usage_record_summaries', - headers: { - 'Stripe-Account': 'acct_456' + stripe.usageRecordSummaries + .list( + 'si_123', + {}, + { + stripe_account: 'acct_456', }, - data: {} - }); + ) + .then(function(record) { + expect(stripe.LAST_REQUEST).to.deep.equal({ + method: 'GET', + url: '/v1/subscription_items/si_123/usage_record_summaries', + headers: { + 'Stripe-Account': 'acct_456', + }, + data: {}, + }); - done(); - }); + done(); + }); }); it('Calls a given callback', function(done) { diff --git a/test/resources/UsageRecords.spec.js b/test/resources/UsageRecords.spec.js index 3dc29e4f71..39cf242358 100644 --- a/test/resources/UsageRecords.spec.js +++ b/test/resources/UsageRecords.spec.js @@ -9,7 +9,7 @@ describe('UsageRecords Resource', function() { stripe.usageRecords.create('si_123', { quantity: 123, timestamp: 123321, - action: 'increment' + action: 'increment', }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,44 +19,54 @@ describe('UsageRecords Resource', function() { data: { quantity: 123, timestamp: 123321, - action: 'increment' - } + action: 'increment', + }, }); }); it('Includes any options that were provided', function(done) { - stripe.usageRecords.create('si_123', { - quantity: 123, - timestamp: 123321, - action: 'increment' - }, { - stripe_account: 'acct_456', - }).then(function(record) { - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/subscription_items/si_123/usage_records', - headers: { - 'Stripe-Account': 'acct_456' - }, - data: { + stripe.usageRecords + .create( + 'si_123', + { quantity: 123, timestamp: 123321, - action: 'increment' - } - }); + action: 'increment', + }, + { + stripe_account: 'acct_456', + }, + ) + .then(function(record) { + expect(stripe.LAST_REQUEST).to.deep.equal({ + method: 'POST', + url: '/v1/subscription_items/si_123/usage_records', + headers: { + 'Stripe-Account': 'acct_456', + }, + data: { + quantity: 123, + timestamp: 123321, + action: 'increment', + }, + }); - done(); - }); + done(); + }); }); it('Calls a given callback', function(done) { - stripe.usageRecords.create('si_123', { - quantity: 123, - timestamp: 123321, - action: 'increment' - }, function(error, record) { - done(error); - }); + stripe.usageRecords.create( + 'si_123', + { + quantity: 123, + timestamp: 123321, + action: 'increment', + }, + function(error, record) { + done(error); + }, + ); }); }); }); diff --git a/test/stripe.spec.js b/test/stripe.spec.js index 566cc93ba0..1a06eeb952 100644 --- a/test/stripe.spec.js +++ b/test/stripe.spec.js @@ -2,10 +2,7 @@ var testUtils = require('../testUtils'); var utils = require('../lib/utils'); -var stripe = require('../lib/stripe')( - testUtils.getUserStripeKey(), - 'latest' -); +var stripe = require('../lib/stripe')(testUtils.getUserStripeKey(), 'latest'); var http = require('http'); @@ -22,37 +19,45 @@ describe('Stripe Module', function() { describe('setApiKey', function() { it('uses Bearer auth', function() { - expect(stripe.getApiField('auth')).to.equal('Bearer ' + testUtils.getUserStripeKey()); + expect(stripe.getApiField('auth')).to.equal( + 'Bearer ' + testUtils.getUserStripeKey(), + ); }); }); describe('GetClientUserAgent', function() { it('Should return a user-agent serialized JSON object', function() { - return expect(new Promise(function(resolve, reject) { - stripe.getClientUserAgent(function(c) { - resolve(JSON.parse(c)); - }); - })).to.eventually.have.property('lang', 'node'); + return expect( + new Promise(function(resolve, reject) { + stripe.getClientUserAgent(function(c) { + resolve(JSON.parse(c)); + }); + }), + ).to.eventually.have.property('lang', 'node'); }); }); describe('GetClientUserAgentSeeded', function() { it('Should return a user-agent serialized JSON object', function() { var userAgent = {lang: 'node'}; - return expect(new Promise(function(resolve, reject) { - stripe.getClientUserAgentSeeded(userAgent, function(c) { - resolve(JSON.parse(c)); - }); - })).to.eventually.have.property('lang', 'node'); + return expect( + new Promise(function(resolve, reject) { + stripe.getClientUserAgentSeeded(userAgent, function(c) { + resolve(JSON.parse(c)); + }); + }), + ).to.eventually.have.property('lang', 'node'); }); it('Should URI-encode user-agent fields', function() { var userAgent = {lang: 'ï'}; - return expect(new Promise(function(resolve, reject) { - stripe.getClientUserAgentSeeded(userAgent, function(c) { - resolve(JSON.parse(c)); - }); - })).to.eventually.have.property('lang', '%C3%AF'); + return expect( + new Promise(function(resolve, reject) { + stripe.getClientUserAgentSeeded(userAgent, function(c) { + resolve(JSON.parse(c)); + }); + }), + ).to.eventually.have.property('lang', '%C3%AF'); }); describe('uname', function() { @@ -66,31 +71,37 @@ describe('Stripe Module', function() { it('gets added to the user-agent', function() { utils.safeExec = function(cmd, cb) { - cb(null, 'foøname') + cb(null, 'foøname'); }; - return expect(new Promise(function(resolve, reject) { - stripe.getClientUserAgentSeeded({lang: 'node'}, function(c) { - resolve(JSON.parse(c)); - }); - })).to.eventually.have.property('uname', 'fo%C3%B8name'); + return expect( + new Promise(function(resolve, reject) { + stripe.getClientUserAgentSeeded({lang: 'node'}, function(c) { + resolve(JSON.parse(c)); + }); + }), + ).to.eventually.have.property('uname', 'fo%C3%B8name'); }); it('sets uname to UNKOWN in case of an error', function() { utils.safeExec = function(cmd, cb) { - cb(new Error('security'), null) + cb(new Error('security'), null); }; - return expect(new Promise(function(resolve, reject) { - stripe.getClientUserAgentSeeded({lang: 'node'}, function(c) { - resolve(JSON.parse(c)); - }); - })).to.eventually.have.property('uname', 'UNKNOWN'); + return expect( + new Promise(function(resolve, reject) { + stripe.getClientUserAgentSeeded({lang: 'node'}, function(c) { + resolve(JSON.parse(c)); + }); + }), + ).to.eventually.have.property('uname', 'UNKNOWN'); }); }); }); describe('setTimeout', function() { it('Should define a default equal to the node default', function() { - expect(stripe.getApiField('timeout')).to.equal(http.createServer().timeout); + expect(stripe.getApiField('timeout')).to.equal( + http.createServer().timeout, + ); }); it('Should allow me to set a custom timeout', function() { stripe.setTimeout(900); @@ -98,7 +109,9 @@ describe('Stripe Module', function() { }); it('Should allow me to set null, to reset to the default', function() { stripe.setTimeout(null); - expect(stripe.getApiField('timeout')).to.equal(http.createServer().timeout); + expect(stripe.getApiField('timeout')).to.equal( + http.createServer().timeout, + ); }); }); @@ -165,7 +178,6 @@ describe('Stripe Module', function() { name: 'MyAwesomeApp', partner_id: 'partner_1234', }); - }); it('should ignore any invalid properties', function() { @@ -197,7 +209,9 @@ describe('Stripe Module', function() { stripe.getClientUserAgent(function(uaString) { expect(JSON.parse(uaString).application).to.eql(appInfo); - expect(stripe.getAppInfoAsString()).to.eql(appInfo.name + '/' + appInfo.version + ' (' + appInfo.url + ')'); + expect(stripe.getAppInfoAsString()).to.eql( + appInfo.name + '/' + appInfo.version + ' (' + appInfo.url + ')', + ); done(); }); @@ -207,40 +221,50 @@ describe('Stripe Module', function() { describe('Callback support', function() { describe('Any given endpoint', function() { it('Will call a callback if successful', function() { - return expect(new Promise(function(resolve, reject) { - stripe.customers.create(CUSTOMER_DETAILS, function(err, customer) { - cleanup.deleteCustomer(customer.id); - resolve('Called!'); - }); - })).to.eventually.equal('Called!'); + return expect( + new Promise(function(resolve, reject) { + stripe.customers.create(CUSTOMER_DETAILS, function(err, customer) { + cleanup.deleteCustomer(customer.id); + resolve('Called!'); + }); + }), + ).to.eventually.equal('Called!'); }); it('Will expose HTTP response object', function() { - return expect(new Promise(function(resolve, reject) { - stripe.customers.create(CUSTOMER_DETAILS, function(err, customer) { - cleanup.deleteCustomer(customer.id); + return expect( + new Promise(function(resolve, reject) { + stripe.customers.create(CUSTOMER_DETAILS, function(err, customer) { + cleanup.deleteCustomer(customer.id); - var headers = customer.lastResponse.headers; - expect(headers).to.contain.keys('request-id'); + var headers = customer.lastResponse.headers; + expect(headers).to.contain.keys('request-id'); - expect(customer.lastResponse.requestId).to.match(/^req_/); - expect(customer.lastResponse.statusCode).to.equal(200); + expect(customer.lastResponse.requestId).to.match(/^req_/); + expect(customer.lastResponse.statusCode).to.equal(200); - resolve('Called!'); - }); - })).to.eventually.equal('Called!'); + resolve('Called!'); + }); + }), + ).to.eventually.equal('Called!'); }); it('Given an error the callback will receive it', function() { - return expect(new Promise(function(resolve, reject) { - stripe.customers.createCard('nonExistentCustId', {card: {}}, function(err, customer) { - if (err) { - resolve('ErrorWasPassed'); - } else { - reject(new Error('NoErrorPassed')); - } - }); - })).to.eventually.become('ErrorWasPassed'); + return expect( + new Promise(function(resolve, reject) { + stripe.customers.createCard( + 'nonExistentCustId', + {card: {}}, + function(err, customer) { + if (err) { + resolve('ErrorWasPassed'); + } else { + reject(new Error('NoErrorPassed')); + } + }, + ); + }), + ).to.eventually.become('ErrorWasPassed'); }); }); }); @@ -248,9 +272,11 @@ describe('Stripe Module', function() { describe('errors', function() { it('Exports errors as types', function() { var Stripe = require('../lib/stripe'); - expect(new Stripe.errors.StripeInvalidRequestError({ - message: 'error' - }).type).to.equal('StripeInvalidRequestError'); + expect( + new Stripe.errors.StripeInvalidRequestError({ + message: 'error', + }).type, + ).to.equal('StripeInvalidRequestError'); }); }); diff --git a/test/telemetry.spec.js b/test/telemetry.spec.js index 845d51770a..9e7d02b66b 100644 --- a/test/telemetry.spec.js +++ b/test/telemetry.spec.js @@ -13,9 +13,11 @@ function createTestServer(handlerFunc, cb) { handlerFunc(req, res); } catch (e) { res.writeHead(400, {'Content-Type': 'application/json'}); - res.end(JSON.stringify({ - error: {type: 'invalid_request_error', message: e.message} - })); + res.end( + JSON.stringify({ + error: {type: 'invalid_request_error', message: e.message}, + }), + ); } }); testServer.listen(0, host, function() { @@ -35,117 +37,142 @@ describe('Client Telemetry', function() { it('Does not send telemetry when disabled', function(done) { var numRequests = 0; - createTestServer(function (req, res) { - numRequests += 1; - - var telemetry = req.headers['x-stripe-client-telemetry']; - - switch (numRequests) { - case 1: - case 2: - expect(telemetry).to.not.exist; - break; - default: - expect.fail(`Should not have reached request ${numRequests}`); - } - - res.setHeader('Request-Id', `req_${numRequests}`); - res.writeHead(200, {'Content-Type': 'application/json'}); - res.end('{}'); - }, function(host, port) { - const stripe = require('../lib/stripe')('sk_test_FEiILxKZwnmmocJDUjUNO6pa') - stripe.setHost(host, port, 'http'); - - stripe.balance.retrieve().then(function (res) { - return stripe.balance.retrieve(); - }).then(function (res) { - expect(numRequests).to.equal(2); - done(); - }).catch(done); - }); + createTestServer( + function(req, res) { + numRequests += 1; + + var telemetry = req.headers['x-stripe-client-telemetry']; + + switch (numRequests) { + case 1: + case 2: + expect(telemetry).to.not.exist; + break; + default: + expect.fail(`Should not have reached request ${numRequests}`); + } + + res.setHeader('Request-Id', `req_${numRequests}`); + res.writeHead(200, {'Content-Type': 'application/json'}); + res.end('{}'); + }, + function(host, port) { + const stripe = require('../lib/stripe')( + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + ); + stripe.setHost(host, port, 'http'); + + stripe.balance + .retrieve() + .then(function(res) { + return stripe.balance.retrieve(); + }) + .then(function(res) { + expect(numRequests).to.equal(2); + done(); + }) + .catch(done); + }, + ); }); it('Sends client telemetry on the second request when enabled', function(done) { var numRequests = 0; - createTestServer(function (req, res) { - numRequests += 1; - - var telemetry = req.headers['x-stripe-client-telemetry']; - - switch (numRequests) { - case 1: - expect(telemetry).to.not.exist; - break; - case 2: - expect(telemetry).to.exist; - expect(JSON.parse(telemetry).last_request_metrics.request_id) - .to.equal('req_1'); - break; - default: - expect.fail(`Should not have reached request ${numRequests}`); - } - - res.setHeader('Request-Id', `req_${numRequests}`); - res.writeHead(200, {'Content-Type': 'application/json'}); - res.end('{}'); - }, function(host, port) { - const stripe = require('../lib/stripe')('sk_test_FEiILxKZwnmmocJDUjUNO6pa') - stripe.setTelemetryEnabled(true); - stripe.setHost(host, port, 'http'); - - stripe.balance.retrieve().then(function (res) { - return stripe.balance.retrieve(); - }).then(function (res) { - expect(numRequests).to.equal(2); - done(); - }).catch(done); - }); + createTestServer( + function(req, res) { + numRequests += 1; + + var telemetry = req.headers['x-stripe-client-telemetry']; + + switch (numRequests) { + case 1: + expect(telemetry).to.not.exist; + break; + case 2: + expect(telemetry).to.exist; + expect( + JSON.parse(telemetry).last_request_metrics.request_id, + ).to.equal('req_1'); + break; + default: + expect.fail(`Should not have reached request ${numRequests}`); + } + + res.setHeader('Request-Id', `req_${numRequests}`); + res.writeHead(200, {'Content-Type': 'application/json'}); + res.end('{}'); + }, + function(host, port) { + const stripe = require('../lib/stripe')( + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + ); + stripe.setTelemetryEnabled(true); + stripe.setHost(host, port, 'http'); + + stripe.balance + .retrieve() + .then(function(res) { + return stripe.balance.retrieve(); + }) + .then(function(res) { + expect(numRequests).to.equal(2); + done(); + }) + .catch(done); + }, + ); }); it('Buffers metrics on concurrent requests', function(done) { var numRequests = 0; - createTestServer(function (req, res) { - numRequests += 1; - - var telemetry = req.headers['x-stripe-client-telemetry']; - - switch (numRequests) { - case 1: - case 2: - expect(telemetry).to.not.exist; - break; - case 3: - case 4: - expect(telemetry).to.exist; - expect(JSON.parse(telemetry).last_request_metrics.request_id) - .to.be.oneOf(['req_1', 'req_2']); - break; - default: - expect.fail(`Should not have reached request ${numRequests}`); - } - - res.setHeader('Request-Id', `req_${numRequests}`); - res.writeHead(200, {'Content-Type': 'application/json'}); - res.end('{}'); - }, function(host, port) { - const stripe = require('../lib/stripe')('sk_test_FEiILxKZwnmmocJDUjUNO6pa') - stripe.setTelemetryEnabled(true); - stripe.setHost(host, port, 'http'); - - Promise.all([ - stripe.balance.retrieve(), - stripe.balance.retrieve() - ]).then(function() { - return Promise.all([ - stripe.balance.retrieve(), - stripe.balance.retrieve() - ]); - }).then(function() { - expect(numRequests).to.equal(4); - done(); - }).catch(done); - }); + createTestServer( + function(req, res) { + numRequests += 1; + + var telemetry = req.headers['x-stripe-client-telemetry']; + + switch (numRequests) { + case 1: + case 2: + expect(telemetry).to.not.exist; + break; + case 3: + case 4: + expect(telemetry).to.exist; + expect( + JSON.parse(telemetry).last_request_metrics.request_id, + ).to.be.oneOf(['req_1', 'req_2']); + break; + default: + expect.fail(`Should not have reached request ${numRequests}`); + } + + res.setHeader('Request-Id', `req_${numRequests}`); + res.writeHead(200, {'Content-Type': 'application/json'}); + res.end('{}'); + }, + function(host, port) { + const stripe = require('../lib/stripe')( + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + ); + stripe.setTelemetryEnabled(true); + stripe.setHost(host, port, 'http'); + + Promise.all([stripe.balance.retrieve(), stripe.balance.retrieve()]) + .then(function() { + return Promise.all([ + stripe.balance.retrieve(), + stripe.balance.retrieve(), + ]); + }) + .then(function() { + expect(numRequests).to.equal(4); + done(); + }) + .catch(done); + }, + ); }); }); diff --git a/test/utils.spec.js b/test/utils.spec.js index f406535825..1186d4887d 100644 --- a/test/utils.spec.js +++ b/test/utils.spec.js @@ -11,89 +11,98 @@ describe('utils', function() { it('Interpolates values into a prepared template', function() { var template = utils.makeURLInterpolator('/some/url/{foo}/{baz}?ok=1'); - expect( - template({foo: 1, baz: 2}) - ).to.equal('/some/url/1/2?ok=1'); + expect(template({foo: 1, baz: 2})).to.equal('/some/url/1/2?ok=1'); - expect( - template({foo: '', baz: ''}) - ).to.equal('/some/url//?ok=1'); + expect(template({foo: '', baz: ''})).to.equal('/some/url//?ok=1'); expect( // Test encoding: - template({foo: 'FOO', baz: '__::baz::__'}) + template({foo: 'FOO', baz: '__::baz::__'}), ).to.equal('/some/url/FOO/__%3A%3Abaz%3A%3A__?ok=1'); }); }); describe('stringifyRequestData', function() { it('Handles basic types', function() { - expect(utils.stringifyRequestData({ - a: 1, - b: 'foo', - })).to.equal('a=1&b=foo'); + expect( + utils.stringifyRequestData({ + a: 1, + b: 'foo', + }), + ).to.equal('a=1&b=foo'); }); it('Handles Dates', function() { - expect(utils.stringifyRequestData({ - date: new Date('2009-02-13T23:31:30Z'), - created: { - gte: new Date('2009-02-13T23:31:30Z'), - lt: new Date('2044-05-01T01:28:21Z'), - }, - })).to.equal([ - 'date=1234567890', - 'created[gte]=1234567890', - 'created[lt]=2345678901' - ].join('&')); + expect( + utils.stringifyRequestData({ + date: new Date('2009-02-13T23:31:30Z'), + created: { + gte: new Date('2009-02-13T23:31:30Z'), + lt: new Date('2044-05-01T01:28:21Z'), + }, + }), + ).to.equal( + [ + 'date=1234567890', + 'created[gte]=1234567890', + 'created[lt]=2345678901', + ].join('&'), + ); }); it('Handles deeply nested object', function() { - expect(utils.stringifyRequestData({ - a: { - b: { - c: { - d: 2, + expect( + utils.stringifyRequestData({ + a: { + b: { + c: { + d: 2, + }, }, }, - }, - })).to.equal('a[b][c][d]=2'); + }), + ).to.equal('a[b][c][d]=2'); }); it('Handles arrays of objects', function() { - expect(utils.stringifyRequestData({ - a: [ - {b: 'c'}, - {b: 'd'}, - ], - })).to.equal('a[0][b]=c&a[1][b]=d'); - }) + expect( + utils.stringifyRequestData({ + a: [{b: 'c'}, {b: 'd'}], + }), + ).to.equal('a[0][b]=c&a[1][b]=d'); + }); it('Handles indexed arrays', function() { - expect(utils.stringifyRequestData({ - a: { - 0: {b: 'c'}, - 1: {b: 'd'}, - }, - })).to.equal('a[0][b]=c&a[1][b]=d'); - }) + expect( + utils.stringifyRequestData({ + a: { + 0: {b: 'c'}, + 1: {b: 'd'}, + }, + }), + ).to.equal('a[0][b]=c&a[1][b]=d'); + }); it('Creates a string from an object, handling shallow nested objects', function() { - expect(utils.stringifyRequestData({ - test: 1, - foo: 'baz', - somethingElse: '::""%&', - nested: { - 1: 2, - 'a n o t h e r': null, - }, - })).to.equal([ - 'test=1', - 'foo=baz', - 'somethingElse=%3A%3A%22%22%25%26', - 'nested[1]=2', - 'nested[a%20n%20o%20t%20h%20e%20r]=', - ].join('&')); + expect( + utils.stringifyRequestData({ + test: 1, + foo: 'baz', + somethingElse: '::""%&', + nested: { + 1: 2, + 'a n o t h e r': null, + }, + }), + ).to.equal( + [ + 'test=1', + 'foo=baz', + 'somethingElse=%3A%3A%22%22%25%26', + 'nested[1]=2', + 'nested[a%20n%20o%20t%20h%20e%20r]=', + ].join('&'), + ); }); }); @@ -125,28 +134,34 @@ describe('utils', function() { it('ignores a hash with only options', function(done) { var args = [{api_key: 'foo'}]; - handleWarnings(function() { - expect(utils.getDataFromArgs(args)).to.deep.equal({}); - expect(args.length).to.equal(1); + handleWarnings( + function() { + expect(utils.getDataFromArgs(args)).to.deep.equal({}); + expect(args.length).to.equal(1); - done(); - }, function(message) { - throw new Error('Should not have warned, but did: ' + message); - }); + done(); + }, + function(message) { + throw new Error('Should not have warned, but did: ' + message); + }, + ); }); it('warns if the hash contains both data and options', function(done) { var args = [{foo: 'bar', api_key: 'foo', idempotency_key: 'baz'}]; - handleWarnings(function() { - utils.getDataFromArgs(args); - }, function(message) { - expect(message).to.equal( - 'Stripe: Options found in arguments (api_key, idempotency_key).' + - ' Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.' - ); + handleWarnings( + function() { + utils.getDataFromArgs(args); + }, + function(message) { + expect(message).to.equal( + 'Stripe: Options found in arguments (api_key, idempotency_key).' + + ' Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.', + ); - done(); - }); + done(); + }, + ); }); it('finds the data', function() { var args = [{foo: 'bar'}, {api_key: 'foo'}]; @@ -203,11 +218,14 @@ describe('utils', function() { expect(args.length).to.equal(1); }); it('parses an idempotency key and api key and api version (with data)', function() { - var args = [{foo: 'bar'}, { - api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - idempotency_key: 'foo', - stripe_version: '2010-01-10', - },]; + var args = [ + {foo: 'bar'}, + { + api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', + idempotency_key: 'foo', + stripe_version: '2010-01-10', + }, + ]; expect(utils.getOptionsFromArgs(args)).to.deep.equal({ auth: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', headers: { @@ -218,11 +236,13 @@ describe('utils', function() { expect(args.length).to.equal(1); }); it('parses an idempotency key and api key and api version', function() { - var args = [{ - api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - idempotency_key: 'foo', - stripe_version: 'hunter2', - },]; + var args = [ + { + api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', + idempotency_key: 'foo', + stripe_version: 'hunter2', + }, + ]; expect(utils.getOptionsFromArgs(args)).to.deep.equal({ auth: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', headers: { @@ -233,23 +253,29 @@ describe('utils', function() { expect(args.length).to.equal(0); }); it('warns if the hash contains something that does not belong', function(done) { - var args = [{foo: 'bar'}, { - api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - idempotency_key: 'foo', - stripe_version: '2010-01-10', - fishsticks: true, - custard: true, - },]; - - handleWarnings(function() { - utils.getOptionsFromArgs(args); - }, function(message) { - expect(message).to.equal( - 'Stripe: Invalid options found (fishsticks, custard); ignoring.' - ); - - done(); - }); + var args = [ + {foo: 'bar'}, + { + api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', + idempotency_key: 'foo', + stripe_version: '2010-01-10', + fishsticks: true, + custard: true, + }, + ]; + + handleWarnings( + function() { + utils.getOptionsFromArgs(args); + }, + function(message) { + expect(message).to.equal( + 'Stripe: Invalid options found (fishsticks, custard); ignoring.', + ); + + done(); + }, + ); }); }); @@ -263,25 +289,31 @@ describe('utils', function() { }); it('throws an error if not given two things to compare', function() { - expect(function() { utils.secureCompare('potato'); }).to.throw(); + expect(function() { + utils.secureCompare('potato'); + }).to.throw(); }); }); describe('removeEmpty', function() { it('removes empty properties and leaves non-empty ones', function() { - expect(utils.removeEmpty({ - cat: 3, - dog: false, - rabbit: undefined, - pointer: null, - })).to.eql({ + expect( + utils.removeEmpty({ + cat: 3, + dog: false, + rabbit: undefined, + pointer: null, + }), + ).to.eql({ cat: 3, dog: false, }); }); it('throws an error if not given two things to compare', function() { - expect(function() { utils.removeEmpty('potato'); }).to.throw(); + expect(function() { + utils.removeEmpty('potato'); + }).to.throw(); }); }); @@ -298,76 +330,76 @@ describe('utils', function() { var calls = []; utils._exec = function(cmd, cb) { calls.push([cmd, cb]); - } + }; function myCb() {} utils.safeExec('hello', myCb); - expect(calls).to.deep.equal([ - ['hello', myCb], - ]); + expect(calls).to.deep.equal([['hello', myCb]]); }); it('passes along normal errors', function() { var myErr = Error('hi'); utils._exec = function(cmd, cb) { - cb(myErr, null) - } + cb(myErr, null); + }; var calls = []; function myCb(err, x) { calls.push([err, x]); } utils.safeExec('hello', myCb); - expect(calls).to.deep.equal([ - [myErr, null], - ]); + expect(calls).to.deep.equal([[myErr, null]]); }); it('passes along thrown errors as normal callback errors', function() { var myErr = Error('hi'); utils._exec = function(cmd, cb) { throw myErr; - } + }; var calls = []; function myCb(err, x) { calls.push([err, x]); } utils.safeExec('hello', myCb); - expect(calls).to.deep.equal([ - [myErr, null], - ]); + expect(calls).to.deep.equal([[myErr, null]]); }); - }) + }); describe('flattenAndStringify', function() { it('Stringifies primitive types', function() { - expect(utils.flattenAndStringify({ - a: 1, - b: 'foo', - c: true, - d: null, - })).to.eql({'a': '1', 'b': 'foo', 'c': 'true', 'd': 'null'}); + expect( + utils.flattenAndStringify({ + a: 1, + b: 'foo', + c: true, + d: null, + }), + ).to.eql({a: '1', b: 'foo', c: 'true', d: 'null'}); }); it('Flattens nested values', function() { - expect(utils.flattenAndStringify({ - x: { - a: 1, - b: 'foo', - }, - })).to.eql({'x[a]': '1', 'x[b]': 'foo'}); + expect( + utils.flattenAndStringify({ + x: { + a: 1, + b: 'foo', + }, + }), + ).to.eql({'x[a]': '1', 'x[b]': 'foo'}); }); it('Does not flatten File objects', function() { - expect(utils.flattenAndStringify({ - file: { - data: 'foo' - }, - x: { - a: 1, - }, - })).to.eql({'file': {data: 'foo'}, 'x[a]': '1'}); + expect( + utils.flattenAndStringify({ + file: { + data: 'foo', + }, + x: { + a: 1, + }, + }), + ).to.eql({file: {data: 'foo'}, 'x[a]': '1'}); }); it('Does not flatten Buffer objects', function() { @@ -401,7 +433,8 @@ function handleWarnings(doWithShimmedConsoleWarn, onWarn) { /* eslint-enable no-console */ } else { - function onProcessWarn(warning) { /* eslint-disable-line no-inner-declarations */ + function onProcessWarn(warning) { + /* eslint-disable-line no-inner-declarations */ onWarn(warning.name + ': ' + warning.message); } @@ -411,6 +444,6 @@ function handleWarnings(doWithShimmedConsoleWarn, onWarn) { process.nextTick(function() { process.removeListener('warning', onProcessWarn); - }) + }); } } diff --git a/testUtils/index.js b/testUtils/index.js index 9d885ff456..2bf3d00c2d 100644 --- a/testUtils/index.js +++ b/testUtils/index.js @@ -8,10 +8,10 @@ require('chai').use(require('chai-as-promised')); var ResourceNamespace = require('../lib/ResourceNamespace').ResourceNamespace; -var utils = module.exports = { - +var utils = (module.exports = { getUserStripeKey: function() { - var key = process.env.STRIPE_TEST_API_KEY || 'tGN0bIwXnHdwOa85VABjPdSn8nWY7G7I'; + var key = + process.env.STRIPE_TEST_API_KEY || 'tGN0bIwXnHdwOa85VABjPdSn8nWY7G7I'; return key; }, @@ -43,12 +43,12 @@ var utils = module.exports = { function patchRequest(stripeInstance, instance) { instance._request = function(method, host, url, data, auth, options, cb) { - var req = stripeInstance.LAST_REQUEST = { + var req = (stripeInstance.LAST_REQUEST = { method: method, url: url, data: data, headers: options.headers || {}, - }; + }); if (auth) { req.auth = auth; } @@ -76,7 +76,7 @@ var utils = module.exports = { this._cleanupFns = []; this._stripe = require('../lib/stripe')( utils.getUserStripeKey(), - 'latest' + 'latest', ); afterEach(function(done) { this.timeout(timeout || CleanupUtility.DEFAULT_TIMEOUT); @@ -85,26 +85,30 @@ var utils = module.exports = { } CleanupUtility.prototype = { - doCleanup: function(done) { var cleanups = this._cleanupFns; var total = cleanups.length; var completed = 0; - for (var fn; (fn = cleanups.shift());) { + for (var fn; (fn = cleanups.shift()); ) { var promise = fn.call(this); if (!promise || !promise.then) { - throw new Error('CleanupUtility expects cleanup functions to return promises!'); + throw new Error( + 'CleanupUtility expects cleanup functions to return promises!', + ); } - promise.then(function() { - // cleanup successful - completed += 1; - if (completed === total) { - done(); - } - }, function(err) { - // not successful - throw err; - }); + promise.then( + function() { + // cleanup successful + completed += 1; + if (completed === total) { + done(); + } + }, + function(err) { + // not successful + throw err; + }, + ); } if (total === 0) { done(); @@ -136,13 +140,15 @@ var utils = module.exports = { }; return CleanupUtility; - }()), + })(), /** - * Get a random string for test Object creation - */ + * Get a random string for test Object creation + */ getRandomString: function() { - return Math.random().toString(36).slice(2); + return Math.random() + .toString(36) + .slice(2); }, envSupportsForAwait: function() { @@ -157,5 +163,4 @@ var utils = module.exports = { return false; } }, - -}; +}); From eeb1a85d1ac16d31ed930524a9b1e9c569274113 Mon Sep 17 00:00:00 2001 From: Bryan Irace Date: Fri, 3 May 2019 11:12:56 -0700 Subject: [PATCH 03/10] ES5 commas as per rattrayalex --- .prettierrc | 4 +- examples/webhook-signing/express.js | 2 +- lib/MultipartDataGenerator.js | 2 +- lib/StripeMethod.basic.js | 14 ++-- lib/StripeMethod.js | 4 +- lib/StripeResource.js | 20 +++--- lib/Webhooks.js | 8 +-- lib/autoPagination.js | 16 ++--- lib/makeRequest.js | 10 +-- lib/resources/EphemeralKeys.js | 2 +- lib/resources/Files.js | 2 +- lib/stripe.js | 2 +- lib/utils.js | 8 +-- test/Error.spec.js | 8 +-- test/StripeResource.spec.js | 20 +++--- test/Webhook.spec.js | 42 ++++++------ test/autoPagination.spec.js | 62 ++++++++--------- test/flows.spec.js | 70 ++++++++++---------- test/resources/Account.spec.js | 16 ++--- test/resources/ApplicationFees.spec.js | 4 +- test/resources/Balance.spec.js | 2 +- test/resources/Charges.spec.js | 10 +-- test/resources/CustomerSubscriptions.spec.js | 2 +- test/resources/Customers.spec.js | 28 ++++---- test/resources/EphemeralKeys.spec.js | 6 +- test/resources/FileUploads.spec.js | 8 +-- test/resources/Files.spec.js | 8 +-- test/resources/Recipients.spec.js | 6 +- test/resources/SubscriptionSchedule.spec.js | 2 +- test/resources/UsageRecordSummaries.spec.js | 2 +- test/resources/UsageRecords.spec.js | 4 +- test/stripe.spec.js | 28 ++++---- test/telemetry.spec.js | 18 ++--- test/utils.spec.js | 36 +++++----- testUtils/index.js | 6 +- 35 files changed, 241 insertions(+), 241 deletions(-) diff --git a/.prettierrc b/.prettierrc index 18a383f970..c1d1f967c6 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,6 @@ { "arrowParens": "always", - "trailingComma": "all", + "trailingComma": "es5", "bracketSpacing": false, "singleQuote": true -} \ No newline at end of file +} diff --git a/examples/webhook-signing/express.js b/examples/webhook-signing/express.js index 29be911f56..f011e631ca 100644 --- a/examples/webhook-signing/express.js +++ b/examples/webhook-signing/express.js @@ -34,7 +34,7 @@ app.post( // Return a response to acknowledge receipt of the event res.json({received: true}); - }, + } ); app.listen(3000, function() { diff --git a/lib/MultipartDataGenerator.js b/lib/MultipartDataGenerator.js index ca32203a33..dbdc0e22ba 100644 --- a/lib/MultipartDataGenerator.js +++ b/lib/MultipartDataGenerator.js @@ -34,7 +34,7 @@ function multipartDataGenerator(method, data, headers) { 'Content-Disposition: form-data; name=' + q(k) + '; filename=' + - q(v.name || 'blob'), + q(v.name || 'blob') ); push('Content-Type: ' + (v.type || 'application/octet-stream')); push(''); diff --git a/lib/StripeMethod.basic.js b/lib/StripeMethod.basic.js index 6cda377c41..cad47caaa5 100644 --- a/lib/StripeMethod.basic.js +++ b/lib/StripeMethod.basic.js @@ -80,7 +80,7 @@ module.exports = { return reject(err); } sendMetadata(data, auth); - }, + } ); } @@ -100,12 +100,12 @@ module.exports = { } else { resolve(response.metadata); } - }, + } ); } - }.bind(this), + }.bind(this) ), - cb, + cb ); }, @@ -123,7 +123,7 @@ module.exports = { function(resolve, reject) { this._request('GET', null, path, {}, auth, {}, function( err, - response, + response ) { if (err) { reject(err); @@ -131,9 +131,9 @@ module.exports = { resolve(response.metadata); } }); - }.bind(this), + }.bind(this) ), - cb, + cb ); }, }; diff --git a/lib/StripeMethod.js b/lib/StripeMethod.js index a79033a918..461cee3756 100644 --- a/lib/StripeMethod.js +++ b/lib/StripeMethod.js @@ -28,7 +28,7 @@ function stripeMethod(spec) { var requestPromise = utils.callbackifyPromiseWithTimeout( makeRequest(self, args, spec, {}), - callback, + callback ); if (spec.methodType === 'list') { @@ -36,7 +36,7 @@ function stripeMethod(spec) { self, args, spec, - requestPromise, + requestPromise ); Object.assign(requestPromise, autoPaginationMethods); } diff --git a/lib/StripeResource.js b/lib/StripeResource.js index 5f88de9ce2..03ffe7deb6 100644 --- a/lib/StripeResource.js +++ b/lib/StripeResource.js @@ -30,7 +30,7 @@ function StripeResource(stripe, urlData) { this._urlData = urlData || {}; this.basePath = utils.makeURLInterpolator( - this.basePath || stripe.getApiField('basePath'), + this.basePath || stripe.getApiField('basePath') ); this.resourcePath = this.path; this.path = utils.makeURLInterpolator(this.path); @@ -67,7 +67,7 @@ StripeResource.prototype = { .join( this.basePath(urlData), this.path(urlData), - typeof commandPath == 'function' ? commandPath(urlData) : commandPath, + typeof commandPath == 'function' ? commandPath(urlData) : commandPath ) .replace(/\\/g, '/'); // ugly workaround for Windows }, @@ -112,7 +112,7 @@ StripeResource.prototype = { 'Request aborted due to timeout being reached (' + timeout + 'ms)', detail: timeoutErr, }), - null, + null ); }; }, @@ -179,7 +179,7 @@ StripeResource.prototype = { exception: e, requestId: headers['request-id'], }), - null, + null ); } @@ -218,7 +218,7 @@ StripeResource.prototype = { message: self._generateConnectionErrorMessage(requestRetries), detail: error, }), - null, + null ); }; }, @@ -257,7 +257,7 @@ StripeResource.prototype = { // maxNetworkRetryDelay. var sleepSeconds = Math.min( initialNetworkRetryDelay * Math.pow(numRetries - 1, 2), - maxNetworkRetryDelay, + maxNetworkRetryDelay ); // Apply some jitter by randomizing the value in the range of @@ -313,7 +313,7 @@ StripeResource.prototype = { StripeResource.MAX_BUFFERED_REQUEST_METRICS ) { utils.emitWarning( - 'Request metrics buffer is full, dropping telemetry message.', + 'Request metrics buffer is full, dropping telemetry message.' ); } else { this._stripe._prevRequestMetrics.push({ @@ -358,7 +358,7 @@ StripeResource.prototype = { method, data, options.headers, - makeRequestWithData, + makeRequestWithData ); } else { makeRequestWithData(null, utils.stringifyRequestData(data || {})); @@ -372,7 +372,7 @@ StripeResource.prototype = { self._getSleepTimeInMS(requestRetries), apiVersion, headers, - requestRetries, + requestRetries ); } @@ -444,7 +444,7 @@ StripeResource.prototype = { // Send payload; we're safe: req.write(requestData); req.end(); - }, + } ); } else { // we're already connected diff --git a/lib/Webhooks.js b/lib/Webhooks.js index 9bec6550c2..2543761b87 100644 --- a/lib/Webhooks.js +++ b/lib/Webhooks.js @@ -14,7 +14,7 @@ var Webhook = { payload, header, secret, - tolerance || Webhook.DEFAULT_TOLERANCE, + tolerance || Webhook.DEFAULT_TOLERANCE ); var jsonPayload = JSON.parse(payload); @@ -60,11 +60,11 @@ var signature = { var expectedSignature = this._computeSignature( details.timestamp + '.' + payload, - secret, + secret ); var signatureFound = !!details.signatures.filter( - utils.secureCompare.bind(utils, expectedSignature), + utils.secureCompare.bind(utils, expectedSignature) ).length; if (!signatureFound) { @@ -118,7 +118,7 @@ function parseHeader(header, scheme) { { timestamp: -1, signatures: [], - }, + } ); } diff --git a/lib/autoPagination.js b/lib/autoPagination.js index e060afdf96..f54d5504dd 100644 --- a/lib/autoPagination.js +++ b/lib/autoPagination.js @@ -17,7 +17,7 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { ) ) { throw Error( - 'Unexpected: Stripe API response does not have a well-formed `data` array.', + 'Unexpected: Stripe API response does not have a well-formed `data` array.' ); } @@ -90,7 +90,7 @@ function getDoneCallback(args) { if (typeof onDone !== 'function') { throw Error( 'The second argument to autoPagingEach, if present, must be a callback function; receieved ' + - typeof onDone, + typeof onDone ); } return onDone; @@ -115,7 +115,7 @@ function getItemCallback(args) { if (typeof onItem !== 'function') { throw Error( 'The first argument to autoPagingEach, if present, must be a callback function; receieved ' + - typeof onItem, + typeof onItem ); } @@ -127,7 +127,7 @@ function getItemCallback(args) { if (onItem.length > 2) { throw Error( 'The `onItem` callback function passed to autoPagingEach must accept at most two arguments; got ' + - onItem, + onItem ); } @@ -147,7 +147,7 @@ function getLastId(listResult) { var lastId = lastItem && lastItem.id; if (!lastId) { throw Error( - 'Unexpected: No `id` found on the last item while auto-paging a list.', + 'Unexpected: No `id` found on the last item while auto-paging a list.' ); } return lastId; @@ -180,7 +180,7 @@ function makeAutoPagingEach(asyncIteratorNext) { var autoPagePromise = wrapAsyncIteratorWithCallback( asyncIteratorNext, - onItem, + onItem ); return utils.callbackifyPromiseWithTimeout(autoPagePromise, onDone); }; @@ -191,12 +191,12 @@ function makeAutoPagingToArray(autoPagingEach) { var limit = opts && opts.limit; if (!limit) { throw Error( - 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.', + 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.' ); } if (limit > 10000) { throw Error( - 'You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.', + 'You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.' ); } var promise = new Promise(function(resolve, reject) { diff --git a/lib/makeRequest.js b/lib/makeRequest.js index 9d55d90970..1f5ea60664 100644 --- a/lib/makeRequest.js +++ b/lib/makeRequest.js @@ -44,7 +44,7 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { requestMethod + ' ' + path + - '`)', + '`)' ); } @@ -64,7 +64,7 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { requestMethod + ' ' + path + - '`)', + '`)' ); } @@ -88,7 +88,7 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { requestMethod + ' `' + path + - '`)', + '`)' ); } @@ -125,7 +125,7 @@ function makeRequest(self, requestArgs, spec, overrideData) { resolve( spec.transformResponseData ? spec.transformResponseData(response) - : response, + : response ); } } @@ -137,7 +137,7 @@ function makeRequest(self, requestArgs, spec, overrideData) { opts.data, opts.auth, {headers: opts.headers}, - requestCallback, + requestCallback ); }); } diff --git a/lib/resources/EphemeralKeys.js b/lib/resources/EphemeralKeys.js index 002cce7ec4..7280a69fda 100644 --- a/lib/resources/EphemeralKeys.js +++ b/lib/resources/EphemeralKeys.js @@ -9,7 +9,7 @@ module.exports = StripeResource.extend({ validator: function(data, options) { if (!options.headers || !options.headers['Stripe-Version']) { throw new Error( - 'stripe_version must be specified to create an ephemeral key', + 'stripe_version must be specified to create an ephemeral key' ); } }, diff --git a/lib/resources/Files.js b/lib/resources/Files.js index 8e8f850b37..4fd258fea4 100644 --- a/lib/resources/Files.js +++ b/lib/resources/Files.js @@ -61,7 +61,7 @@ module.exports = StripeResource.extend({ 'An error occurred while attempting to process the file for upload.', detail: error, }), - null, + null ); }; } diff --git a/lib/stripe.js b/lib/stripe.js index 4b98b5cb1d..46ed677b63 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -201,7 +201,7 @@ Stripe.prototype = { setTimeout: function(timeout) { this._setApiField( 'timeout', - timeout == null ? Stripe.DEFAULT_TIMEOUT : timeout, + timeout == null ? Stripe.DEFAULT_TIMEOUT : timeout ); }, diff --git a/lib/utils.js b/lib/utils.js index a439678b84..9cbfe9b918 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -105,7 +105,7 @@ var utils = (module.exports = { 'Options found in arguments (' + optionKeysInArgs.join(', ') + '). Did you mean to pass an options ' + - 'object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.', + 'object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.' ); } @@ -133,7 +133,7 @@ var utils = (module.exports = { if (extraKeys.length) { emitWarning( - 'Invalid options found (' + extraKeys.join(', ') + '); ignoring.', + 'Invalid options found (' + extraKeys.join(', ') + '); ignoring.' ); } @@ -246,7 +246,7 @@ var utils = (module.exports = { setTimeout(function() { callback(err, null); }, 0); - }, + } ); } @@ -323,7 +323,7 @@ var utils = (module.exports = { function emitWarning(warning) { if (typeof process.emitWarning !== 'function') { return console.warn( - 'Stripe: ' + warning, + 'Stripe: ' + warning ); /* eslint-disable-line no-console */ } diff --git a/test/Error.spec.js b/test/Error.spec.js index 872d2deef3..100618c7b0 100644 --- a/test/Error.spec.js +++ b/test/Error.spec.js @@ -16,16 +16,16 @@ describe('Error', function() { describe('StripeError', function() { it('Generates specific instance depending on error-type', function() { expect(Error.StripeError.generate({type: 'card_error'})).to.be.instanceOf( - Error.StripeCardError, + Error.StripeCardError ); expect( - Error.StripeError.generate({type: 'invalid_request_error'}), + Error.StripeError.generate({type: 'invalid_request_error'}) ).to.be.instanceOf(Error.StripeInvalidRequestError); expect(Error.StripeError.generate({type: 'api_error'})).to.be.instanceOf( - Error.StripeAPIError, + Error.StripeAPIError ); expect( - Error.StripeError.generate({type: 'idempotency_error'}), + Error.StripeError.generate({type: 'idempotency_error'}) ).to.be.instanceOf(Error.StripeIdempotencyError); }); diff --git a/test/StripeResource.spec.js b/test/StripeResource.spec.js index 8e5185bef3..a9b676e1a3 100644 --- a/test/StripeResource.spec.js +++ b/test/StripeResource.spec.js @@ -26,7 +26,7 @@ describe('StripeResource', function() { var headers = stripe.invoices._defaultHeaders( 'anotherFakeAuthToken', 0, - null, + null ); expect(headers.Authorization).to.equal('Bearer anotherFakeAuthToken'); }); @@ -68,7 +68,7 @@ describe('StripeResource', function() { realStripe.invoices.retrieveUpcoming('cus_123', options.data, function( err, - response, + response ) { done(); scope.done(); @@ -93,7 +93,7 @@ describe('StripeResource', function() { realStripe.subscriptions.update('sub_123', options.data, function( err, - response, + response ) { done(); scope.done(); @@ -156,7 +156,7 @@ describe('StripeResource', function() { realStripe.charges.create(options.data, function(err) { var errorMessage = realStripe.invoices._generateConnectionErrorMessage( - 1, + 1 ); expect(err.message).to.equal(errorMessage); expect(err.detail.message).to.deep.equal('worse stuff'); @@ -372,7 +372,7 @@ describe('StripeResource', function() { function() { expect(headers['idempotency-key']).to.equal(key); done(); - }, + } ); }); }); @@ -384,7 +384,7 @@ describe('StripeResource', function() { { statusCode: 409, }, - 1, + 1 ); expect(res).to.equal(false); @@ -396,7 +396,7 @@ describe('StripeResource', function() { { statusCode: 409, }, - 0, + 0 ); expect(res).to.equal(true); @@ -408,7 +408,7 @@ describe('StripeResource', function() { { statusCode: 409, }, - 0, + 0 ); expect(res).to.equal(true); @@ -417,7 +417,7 @@ describe('StripeResource', function() { { statusCode: 503, }, - 0, + 0 ); expect(res).to.equal(true); @@ -432,7 +432,7 @@ describe('StripeResource', function() { statusCode: 200, req: {_requestEvent: {method: 'POST'}}, }, - 1, + 1 ); expect(res).to.equal(false); diff --git a/test/Webhook.spec.js b/test/Webhook.spec.js index cd58d41d98..2ba87061a9 100644 --- a/test/Webhook.spec.js +++ b/test/Webhook.spec.js @@ -22,7 +22,7 @@ describe('Webhooks', function() { var event = stripe.webhooks.constructEvent( EVENT_PAYLOAD_STRING, header, - SECRET, + SECRET ); expect(event.id).to.equal(EVENT_PAYLOAD.id); @@ -36,7 +36,7 @@ describe('Webhooks', function() { stripe.webhooks.constructEvent( '} I am not valid JSON; 123][', header, - SECRET, + SECRET ); }).to.throw(/Unexpected token/); }); @@ -60,7 +60,7 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, header, - SECRET, + SECRET ); }).to.throw(expectedMessage); @@ -68,7 +68,7 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, null, - SECRET, + SECRET ); }).to.throw(expectedMessage); @@ -76,7 +76,7 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, undefined, - SECRET, + SECRET ); }).to.throw(expectedMessage); @@ -84,7 +84,7 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, '', - SECRET, + SECRET ); }).to.throw(expectedMessage); }); @@ -98,7 +98,7 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, header, - SECRET, + SECRET ); }).to.throw(/No signatures found with expected scheme/); }); @@ -112,10 +112,10 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, header, - SECRET, + SECRET ); }).to.throw( - /No signatures found matching the expected signature for payload/, + /No signatures found matching the expected signature for payload/ ); }); @@ -129,7 +129,7 @@ describe('Webhooks', function() { EVENT_PAYLOAD_STRING, header, SECRET, - 10, + 10 ); }).to.throw(/Timestamp outside the tolerance zone/); }); @@ -147,10 +147,10 @@ describe('Webhooks', function() { EVENT_PAYLOAD_STRING, header, SECRET, - 10, - ), + 10 + ) ).to.equal(true); - }, + } ); it('should return true when the header contains at least one valid signature', function() { @@ -165,8 +165,8 @@ describe('Webhooks', function() { EVENT_PAYLOAD_STRING, header, SECRET, - 10, - ), + 10 + ) ).to.equal(true); }); @@ -182,10 +182,10 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, header, - SECRET, - ), + SECRET + ) ).to.equal(true); - }, + } ); it('should accept Buffer instances for the payload and header', function() { @@ -198,8 +198,8 @@ describe('Webhooks', function() { Buffer.from(EVENT_PAYLOAD_STRING), Buffer.from(header), SECRET, - 10, - ), + 10 + ) ).to.equal(true); }); }); @@ -217,7 +217,7 @@ function generateHeaderString(opts) { opts.signature || stripe.webhooks.signature._computeSignature( opts.timestamp + '.' + opts.payload, - opts.secret, + opts.secret ); var generatedHeader = [ diff --git a/test/autoPagination.spec.js b/test/autoPagination.spec.js index 4960a3bb43..8aa204b129 100644 --- a/test/autoPagination.spec.js +++ b/test/autoPagination.spec.js @@ -41,7 +41,7 @@ describe('auto pagination', function() { Promise.all( realCustomerIds.map(function(customerId) { return stripe.customers.del(customerId); - }), + }) ).then(resolve); }); }); @@ -71,7 +71,7 @@ describe('auto pagination', function() { stripe.customers .list({limit: 3, email: email}) .autoPagingEach(onCustomer, onDone); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -98,7 +98,7 @@ describe('auto pagination', function() { stripe.customers .list({limit: 3, email: email}) .autoPagingEach(onCustomer, onDone); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -126,7 +126,7 @@ describe('auto pagination', function() { stripe.customers .list({limit: 3, email: email}) .autoPagingEach(onCustomer, onDone); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -146,7 +146,7 @@ describe('auto pagination', function() { .autoPagingEach(onCustomer) .then(onDone) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds); }); @@ -163,7 +163,7 @@ describe('auto pagination', function() { .then(function() { resolve(customerIds); }); - }), + }) ).to.eventually.deep.equal(realCustomerIds); }); @@ -180,7 +180,7 @@ describe('auto pagination', function() { .then(function() { resolve(customerIds); }); - }), + }) ).to.eventually.deep.equal(realCustomerIds); }); @@ -197,7 +197,7 @@ describe('auto pagination', function() { .then(function() { resolve(customerIds); }); - }), + }) ).to.eventually.deep.equal(realCustomerIds); }); @@ -220,7 +220,7 @@ describe('auto pagination', function() { reject(Error('Expected an error, did not get one.')); } }); - }), + }) ).to.eventually.deep.equal('Simulated error'); }); @@ -243,7 +243,7 @@ describe('auto pagination', function() { .catch(function(err) { resolve(err.message); }); - }), + }) ).to.eventually.deep.equal('Simulated error'); }); }); @@ -259,17 +259,17 @@ describe('auto pagination', function() { new Promise(function(resolve, reject) { forAwaitUntil( stripe.customers.list({limit: 3, email: email}), - LIMIT, + LIMIT ) .then(function(customers) { resolve( customers.map(function(customer) { return customer.id; - }), + }) ); }) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -278,17 +278,17 @@ describe('auto pagination', function() { new Promise(function(resolve, reject) { forAwaitUntil( stripe.customers.list({limit: 3, email: email}), - TOTAL_OBJECTS + 1, + TOTAL_OBJECTS + 1 ) .then(function(customers) { resolve( customers.map(function(customer) { return customer.id; - }), + }) ); }) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds); }); } @@ -305,11 +305,11 @@ describe('auto pagination', function() { resolve( customers.map(function(customer) { return customer.id; - }), + }) ); }) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); } @@ -332,7 +332,7 @@ describe('auto pagination', function() { resolve(customerIds); }) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, 1)); }); @@ -355,7 +355,7 @@ describe('auto pagination', function() { resolve(customerIds); }) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -397,13 +397,13 @@ describe('auto pagination', function() { resolve(customerIds); }) .catch(reject); - }), + }) ).to.eventually.deep.equal( realCustomerIds.slice(0, 4).reduce(function(acc, x) { acc.push(x); acc.push(x); return acc; - }, []), + }, []) ); }); }); @@ -422,7 +422,7 @@ describe('auto pagination', function() { }) .then(resolve) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds); }); @@ -439,7 +439,7 @@ describe('auto pagination', function() { }) .then(resolve) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -453,7 +453,7 @@ describe('auto pagination', function() { resolve( customers.map(function(customer) { return customer.id; - }), + }) ); } } @@ -461,7 +461,7 @@ describe('auto pagination', function() { stripe.customers .list({limit: 3, email: email}) .autoPagingToArray({limit: LIMIT}, onDone); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -474,9 +474,9 @@ describe('auto pagination', function() { } catch (err) { resolve(err.message); } - }), + }) ).to.eventually.equal( - 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.', + 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.' ); }); @@ -491,9 +491,9 @@ describe('auto pagination', function() { } catch (err) { resolve(err.message); } - }), + }) ).to.eventually.equal( - 'You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.', + 'You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.' ); }); }); @@ -529,7 +529,7 @@ describe('auto pagination', function() { }); }) .catch(reject); - }), + }) ).to.eventually.deep.equal({ firstReq: realCustomerIds.slice(0, 4), paginated: realCustomerIds, diff --git a/test/flows.spec.js b/test/flows.spec.js index f58f34c0ef..e577bcc90c 100644 --- a/test/flows.spec.js +++ b/test/flows.spec.js @@ -27,7 +27,7 @@ describe('Flows', function() { stripe.account.retrieve().then(function(acct) { CURRENCY = acct.default_currency; return acct; - }), + }) ).to.eventually.have.property('default_currency'); }); @@ -56,7 +56,7 @@ describe('Flows', function() { return stripe.customers.updateSubscription(customer.id, { plan: plan.id, }); - }), + }) ).to.eventually.have.property('status', 'active'); }); @@ -94,12 +94,12 @@ describe('Flows', function() { { plan: plan.id, quantity: '3', - }, + } ); }) .then(function(subscription) { return [subscription.status, subscription.quantity]; - }), + }) ).to.eventually.deep.equal(['active', 3]); }); @@ -116,7 +116,7 @@ describe('Flows', function() { // Resolve with the error so we can inspect it below return err; }); - }), + }) ).to.eventually.satisfy(function(err) { return ( err.type === 'StripeInvalidRequestError' && @@ -150,7 +150,7 @@ describe('Flows', function() { plan: plan.id, cancel_at_period_end: true, }); - }), + }) ).to.eventually.have.property('cancel_at_period_end', true); }); @@ -179,9 +179,9 @@ describe('Flows', function() { .then(function() { cleanup.deletePlan(planID); return stripe.plans.retrieve(planID); - }), + }) ).to.eventually.have.property('id', planID); - }, + } ); }); }); @@ -203,7 +203,7 @@ describe('Flows', function() { ]).then(function(joined) { coupon = joined[0]; customer = joined[1]; - }), + }) ).to.not.be.eventually.rejected; }); describe('And I apply the coupon to the customer', function() { @@ -211,24 +211,24 @@ describe('Flows', function() { return expect( stripe.customers.update(customer.id, { coupon: coupon.id, - }), + }) ).to.not.be.eventually.rejected; }); it('Can be retrieved from that customer', function() { return expect( - stripe.customers.retrieve(customer.id), + stripe.customers.retrieve(customer.id) ).to.eventually.have.nested.property('discount.coupon.id', coupon.id); }); describe('The resulting discount', function() { it('Can be removed', function() { return expect( - stripe.customers.deleteDiscount(customer.id), + stripe.customers.deleteDiscount(customer.id) ).to.eventually.have.property('deleted', true); }); describe('Re-querying it', function() { it('Does indeed indicate that it is deleted', function() { return expect( - stripe.customers.retrieve(customer.id), + stripe.customers.retrieve(customer.id) ).to.eventually.have.property('discount', null); }); }); @@ -250,7 +250,7 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.getMetadata(customer.id); - }), + }) ).to.eventually.deep.equal({foo: '123'}); }); it('Can reset metadata', function() { @@ -268,7 +268,7 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.getMetadata(customer.id); - }), + }) ).to.eventually.deep.equal({}); }); it('Resets metadata when setting new metadata', function() { @@ -283,7 +283,7 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.setMetadata(customer.id, {baz: '456'}); - }), + }) ).to.eventually.deep.equal({baz: '456'}); }); it('Can set individual key/value pairs', function() { @@ -314,7 +314,7 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.getMetadata(customer.id); - }), + }) ).to.eventually.deep.equal({_other_: '999', foo: '222'}); }); it('Can set individual key/value pairs [with per request token]', function() { @@ -331,7 +331,7 @@ describe('Flows', function() { return stripe.customers.setMetadata( customer.id, {baz: 456}, - authToken, + authToken ); }) .then(function() { @@ -339,7 +339,7 @@ describe('Flows', function() { customer.id, '_other_', 999, - authToken, + authToken ); }) .then(function() { @@ -347,7 +347,7 @@ describe('Flows', function() { customer.id, 'foo', 123, - authToken, + authToken ); }) .then(function() { @@ -356,7 +356,7 @@ describe('Flows', function() { customer.id, 'foo', 222, - authToken, + authToken ); }) .then(function() { @@ -365,12 +365,12 @@ describe('Flows', function() { customer.id, 'baz', null, - authToken, + authToken ); }) .then(function() { return stripe.customers.getMetadata(customer.id, authToken); - }), + }) ).to.eventually.deep.equal({_other_: '999', foo: '222'}); }); }); @@ -387,7 +387,7 @@ describe('Flows', function() { currency: CURRENCY, expand: ['customer'], }); - }), + }) ).to.eventually.have.nested.property('customer.created'); }); }); @@ -403,7 +403,7 @@ describe('Flows', function() { .then(function(cust) { cleanup.deleteCustomer(cust.id); return cust; - }), + }) // Confirm it's expanded by checking that some prop (e.g. exp_year) exists: ).to.eventually.have.nested.property('default_source.exp_year'); }); @@ -427,7 +427,7 @@ describe('Flows', function() { }) .then(null, function(error) { return error; - }), + }) ).to.eventually.have.nested.property('raw.charge'); }); }); @@ -436,12 +436,12 @@ describe('Flows', function() { it('Allows me to do so', function() { return expect(stripe.balance.retrieve()).to.eventually.have.property( 'object', - 'balance', + 'balance' ); }); it('Allows me to do so with specified auth key', function() { return expect( - stripe.balance.retrieve(testUtils.getUserStripeKey()), + stripe.balance.retrieve(testUtils.getUserStripeKey()) ).to.eventually.have.property('object', 'balance'); }); }); @@ -459,8 +459,8 @@ describe('Flows', function() { if (accounts.data.length < 1) { return done( new Error( - 'Test requires at least one Connected Account in the Test Account', - ), + 'Test requires at least one Connected Account in the Test Account' + ) ); } @@ -503,7 +503,7 @@ describe('Flows', function() { stripe_version: apiVersion, idempotency_key: idempotencyKey, stripe_account: connectedAccountId, - }, + } ) .then(null, function() { // I expect there to be an error here. @@ -550,7 +550,7 @@ describe('Flows', function() { stripe_version: apiVersion, idempotency_key: idempotencyKey, stripe_account: connectedAccountId, - }, + } ) .then(null, function() { // I expect there to be an error here. @@ -594,7 +594,7 @@ describe('Flows', function() { }) .then(null, function(error) { return error; - }), + }) ).to.eventually.have.nested.property('size', 739); }); @@ -614,7 +614,7 @@ describe('Flows', function() { }) .then(null, function(error) { return error; - }), + }) ).to.eventually.have.nested.property('size', 739); }); @@ -639,7 +639,7 @@ describe('Flows', function() { }) .catch(function(error) { expect(error.message).to.equal( - 'An error occurred while attempting to process the file for upload.', + 'An error occurred while attempting to process the file for upload.' ); expect(error.detail).to.equal(fakeError); diff --git a/test/resources/Account.spec.js b/test/resources/Account.spec.js index ed7955ecc1..5eaef72394 100644 --- a/test/resources/Account.spec.js +++ b/test/resources/Account.spec.js @@ -111,7 +111,7 @@ describe('Account Resource', function() { it('Sends the correct request', function() { stripe.account.retrieveExternalAccount( 'accountIdFoo321', - 'externalAccountIdFoo456', + 'externalAccountIdFoo456' ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -126,7 +126,7 @@ describe('Account Resource', function() { stripe.account.retrieveExternalAccount( 'accountIdFoo321', 'externalAccountIdFoo456', - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -162,7 +162,7 @@ describe('Account Resource', function() { currency: 'usd', country: 'US', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -181,7 +181,7 @@ describe('Account Resource', function() { 'externalAccountIdFoo456', { default_for_currency: true, - }, + } ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -197,7 +197,7 @@ describe('Account Resource', function() { it('Sends the correct request', function() { stripe.account.deleteExternalAccount( 'accountIdFoo321', - 'externalAccountIdFoo456', + 'externalAccountIdFoo456' ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', @@ -212,7 +212,7 @@ describe('Account Resource', function() { stripe.account.deleteExternalAccount( 'accountIdFoo321', 'externalAccountIdFoo456', - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', @@ -306,7 +306,7 @@ describe('Account Resource', function() { { first_name: 'John', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -338,7 +338,7 @@ describe('Account Resource', function() { { first_name: 'John', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/ApplicationFees.spec.js b/test/resources/ApplicationFees.spec.js index 3fa4d13426..34dbac595e 100644 --- a/test/resources/ApplicationFees.spec.js +++ b/test/resources/ApplicationFees.spec.js @@ -35,7 +35,7 @@ describe('ApplicationFee Resource', function() { stripe.applicationFees.updateRefund( 'appFeeIdExample3242', 'refundIdExample2312', - {metadata: {key: 'value'}}, + {metadata: {key: 'value'}} ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -69,7 +69,7 @@ describe('ApplicationFee Resource', function() { it('Sends the correct retrieve request', function() { stripe.applicationFees.retrieveRefund( 'appFeeIdExample3242', - 'refundIdExample2312', + 'refundIdExample2312' ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Balance.spec.js b/test/resources/Balance.spec.js index 50fbe0a5a1..4951f9e151 100644 --- a/test/resources/Balance.spec.js +++ b/test/resources/Balance.spec.js @@ -64,7 +64,7 @@ describe('Balance Resource', function() { it('Sends the correct request [with specified auth]', function() { stripe.balance.retrieveTransaction( 'transactionIdFoo', - 'aGN0bIwXnHdw5645VABjPdSn8nWY7G11', + 'aGN0bIwXnHdw5645VABjPdSn8nWY7G11' ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Charges.spec.js b/test/resources/Charges.spec.js index dcfc13eb3f..dc68e835bf 100644 --- a/test/resources/Charges.spec.js +++ b/test/resources/Charges.spec.js @@ -93,15 +93,15 @@ describe('Charge Resource', function() { it('Incorrect arguments result in an error', function() { expect( - stripe.charges.refund('chargeIdExample123', 39392), + stripe.charges.refund('chargeIdExample123', 39392) ).to.be.eventually.rejectedWith(/unknown arguments/i); expect( - stripe.charges.refund({potato: 'chargeIdExample123'}), + stripe.charges.refund({potato: 'chargeIdExample123'}) ).to.be.eventually.rejectedWith(/must be a string, but got: object/i); expect(stripe.charges.refund(442)).to.be.eventually.rejectedWith( - /must be a string, but got: number/i, + /must be a string, but got: number/i ); }); }); @@ -111,7 +111,7 @@ describe('Charge Resource', function() { stripe.charges.updateRefund( 'chargeIdExample3242', 'refundIdExample2312', - {metadata: {key: 'value'}}, + {metadata: {key: 'value'}} ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -144,7 +144,7 @@ describe('Charge Resource', function() { it('Sends the correct retrieve request', function() { stripe.charges.retrieveRefund( 'chargeIdExample3242', - 'refundIdExample2312', + 'refundIdExample2312' ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/CustomerSubscriptions.spec.js b/test/resources/CustomerSubscriptions.spec.js index 9920dbc743..6d9b71933e 100644 --- a/test/resources/CustomerSubscriptions.spec.js +++ b/test/resources/CustomerSubscriptions.spec.js @@ -94,7 +94,7 @@ describe('CustomerSubscription Resource', function() { it('Sends the correct request', function() { customerSubscription.deleteDiscount( 'customerIdFoo321', - 'subscriptionIdBar654', + 'subscriptionIdBar654' ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', diff --git a/test/resources/Customers.spec.js b/test/resources/Customers.spec.js index 365e0e60e0..3193585e12 100644 --- a/test/resources/Customers.spec.js +++ b/test/resources/Customers.spec.js @@ -65,7 +65,7 @@ describe('Customers Resource', function() { it('Sends the correct request [with specified idempotency_key in options]', function() { stripe.customers.create( {description: 'Some customer'}, - {idempotency_key: 'foo'}, + {idempotency_key: 'foo'} ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -78,7 +78,7 @@ describe('Customers Resource', function() { it('Sends the correct request [with specified auth in options]', function() { stripe.customers.create( {description: 'Some customer'}, - {api_key: TEST_AUTH_KEY}, + {api_key: TEST_AUTH_KEY} ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -92,7 +92,7 @@ describe('Customers Resource', function() { it('Sends the correct request [with specified auth and idempotent key in options]', function() { stripe.customers.create( {description: 'Some customer'}, - {api_key: TEST_AUTH_KEY, idempotency_key: 'foo'}, + {api_key: TEST_AUTH_KEY, idempotency_key: 'foo'} ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -184,7 +184,7 @@ describe('Customers Resource', function() { { plan: 'fooPlan', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -235,7 +235,7 @@ describe('Customers Resource', function() { stripe.customers.cancelSubscription( 'cus_123', {at_period_end: true}, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', @@ -308,7 +308,7 @@ describe('Customers Resource', function() { reqs[reqs.length - 1], ]); }); - }), + }) ).to.eventually.deep.equal([ { // First reset metadata: @@ -412,7 +412,7 @@ describe('Customers Resource', function() { number: '123456', exp_month: '12', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -532,7 +532,7 @@ describe('Customers Resource', function() { number: '123456', exp_month: '12', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -612,7 +612,7 @@ describe('Customers Resource', function() { 'cus_123', 'card_123', data, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -641,7 +641,7 @@ describe('Customers Resource', function() { stripe.customers.retrieveSubscription( 'cus_123', 'sub_123', - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -674,7 +674,7 @@ describe('Customers Resource', function() { plan: 'gold', quantity: '12', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -706,7 +706,7 @@ describe('Customers Resource', function() { { quantity: '2', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -733,7 +733,7 @@ describe('Customers Resource', function() { stripe.customers.cancelSubscription( 'cus_123', 'sub_123', - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', @@ -764,7 +764,7 @@ describe('Customers Resource', function() { 'cus_123', 'sub_123', {at_period_end: true}, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', diff --git a/test/resources/EphemeralKeys.spec.js b/test/resources/EphemeralKeys.spec.js index 2fe31643a1..565a066186 100644 --- a/test/resources/EphemeralKeys.spec.js +++ b/test/resources/EphemeralKeys.spec.js @@ -5,14 +5,14 @@ var expect = require('chai').expect; function errorsOnNoStripeVersion() { return expect( - stripe.ephemeralKeys.create({customer: 'cus_123'}), + stripe.ephemeralKeys.create({customer: 'cus_123'}) ).to.be.eventually.rejectedWith(/stripe_version must be specified/i); } function sendsCorrectStripeVersion() { stripe.ephemeralKeys.create( {customer: 'cus_123'}, - {stripe_version: '2017-06-05'}, + {stripe_version: '2017-06-05'} ); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -32,7 +32,7 @@ describe('EphemeralKey Resource', function() { it('Sends the correct request', function() { stripe.ephemeralKeys.create( {customer: 'cus_123'}, - {stripe_version: '2017-05-25'}, + {stripe_version: '2017-05-25'} ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/FileUploads.spec.js b/test/resources/FileUploads.spec.js index e39343b3ca..7cc106e0f5 100644 --- a/test/resources/FileUploads.spec.js +++ b/test/resources/FileUploads.spec.js @@ -77,7 +77,7 @@ describe('File Uploads Resource', function() { }, file_link_data: {create: true}, }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); @@ -103,7 +103,7 @@ describe('File Uploads Resource', function() { .then(function() { expect(stripe.LAST_REQUEST).to.deep.property( 'host', - 'files.stripe.com', + 'files.stripe.com' ); expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); @@ -125,12 +125,12 @@ describe('File Uploads Resource', function() { }, file_link_data: {create: true}, }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ) .then(function() { expect(stripe.LAST_REQUEST).to.deep.property( 'host', - 'files.stripe.com', + 'files.stripe.com' ); expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); diff --git a/test/resources/Files.spec.js b/test/resources/Files.spec.js index c174e4a68b..280eec92c1 100644 --- a/test/resources/Files.spec.js +++ b/test/resources/Files.spec.js @@ -77,7 +77,7 @@ describe('Files Resource', function() { }, file_link_data: {create: true}, }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); @@ -103,7 +103,7 @@ describe('Files Resource', function() { .then(function() { expect(stripe.LAST_REQUEST).to.deep.property( 'host', - 'files.stripe.com', + 'files.stripe.com' ); expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); @@ -125,12 +125,12 @@ describe('Files Resource', function() { }, file_link_data: {create: true}, }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ) .then(function() { expect(stripe.LAST_REQUEST).to.deep.property( 'host', - 'files.stripe.com', + 'files.stripe.com' ); expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); diff --git a/test/resources/Recipients.spec.js b/test/resources/Recipients.spec.js index 1e3ea46a16..3c428b1ff5 100644 --- a/test/resources/Recipients.spec.js +++ b/test/resources/Recipients.spec.js @@ -87,7 +87,7 @@ describe('Recipients Resource', function() { stripe.recipients.retrieveCard( 'recipientIdFoo321', 'cardIdFoo456', - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -120,7 +120,7 @@ describe('Recipients Resource', function() { number: '123456', exp_month: '12', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -161,7 +161,7 @@ describe('Recipients Resource', function() { stripe.recipients.deleteCard( 'recipientIdFoo321', 'cardIdFoo456', - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', diff --git a/test/resources/SubscriptionSchedule.spec.js b/test/resources/SubscriptionSchedule.spec.js index 87cc9d723a..9e07b182a2 100644 --- a/test/resources/SubscriptionSchedule.spec.js +++ b/test/resources/SubscriptionSchedule.spec.js @@ -94,7 +94,7 @@ describe('Subscription Schedule Resource', function() { it('Sends the correct request', function() { stripe.subscriptionSchedules.retrieveRevision( SCHEDULE_TEST_ID, - REVISION_TEST_ID, + REVISION_TEST_ID ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/UsageRecordSummaries.spec.js b/test/resources/UsageRecordSummaries.spec.js index 07b3f1cbb3..436dd580d7 100644 --- a/test/resources/UsageRecordSummaries.spec.js +++ b/test/resources/UsageRecordSummaries.spec.js @@ -23,7 +23,7 @@ describe('UsageRecordSummaries Resource', function() { {}, { stripe_account: 'acct_456', - }, + } ) .then(function(record) { expect(stripe.LAST_REQUEST).to.deep.equal({ diff --git a/test/resources/UsageRecords.spec.js b/test/resources/UsageRecords.spec.js index 39cf242358..0bd5f0b04f 100644 --- a/test/resources/UsageRecords.spec.js +++ b/test/resources/UsageRecords.spec.js @@ -35,7 +35,7 @@ describe('UsageRecords Resource', function() { }, { stripe_account: 'acct_456', - }, + } ) .then(function(record) { expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -65,7 +65,7 @@ describe('UsageRecords Resource', function() { }, function(error, record) { done(error); - }, + } ); }); }); diff --git a/test/stripe.spec.js b/test/stripe.spec.js index 1a06eeb952..5b1328ffde 100644 --- a/test/stripe.spec.js +++ b/test/stripe.spec.js @@ -20,7 +20,7 @@ describe('Stripe Module', function() { describe('setApiKey', function() { it('uses Bearer auth', function() { expect(stripe.getApiField('auth')).to.equal( - 'Bearer ' + testUtils.getUserStripeKey(), + 'Bearer ' + testUtils.getUserStripeKey() ); }); }); @@ -32,7 +32,7 @@ describe('Stripe Module', function() { stripe.getClientUserAgent(function(c) { resolve(JSON.parse(c)); }); - }), + }) ).to.eventually.have.property('lang', 'node'); }); }); @@ -45,7 +45,7 @@ describe('Stripe Module', function() { stripe.getClientUserAgentSeeded(userAgent, function(c) { resolve(JSON.parse(c)); }); - }), + }) ).to.eventually.have.property('lang', 'node'); }); @@ -56,7 +56,7 @@ describe('Stripe Module', function() { stripe.getClientUserAgentSeeded(userAgent, function(c) { resolve(JSON.parse(c)); }); - }), + }) ).to.eventually.have.property('lang', '%C3%AF'); }); @@ -78,7 +78,7 @@ describe('Stripe Module', function() { stripe.getClientUserAgentSeeded({lang: 'node'}, function(c) { resolve(JSON.parse(c)); }); - }), + }) ).to.eventually.have.property('uname', 'fo%C3%B8name'); }); @@ -91,7 +91,7 @@ describe('Stripe Module', function() { stripe.getClientUserAgentSeeded({lang: 'node'}, function(c) { resolve(JSON.parse(c)); }); - }), + }) ).to.eventually.have.property('uname', 'UNKNOWN'); }); }); @@ -100,7 +100,7 @@ describe('Stripe Module', function() { describe('setTimeout', function() { it('Should define a default equal to the node default', function() { expect(stripe.getApiField('timeout')).to.equal( - http.createServer().timeout, + http.createServer().timeout ); }); it('Should allow me to set a custom timeout', function() { @@ -110,7 +110,7 @@ describe('Stripe Module', function() { it('Should allow me to set null, to reset to the default', function() { stripe.setTimeout(null); expect(stripe.getApiField('timeout')).to.equal( - http.createServer().timeout, + http.createServer().timeout ); }); }); @@ -210,7 +210,7 @@ describe('Stripe Module', function() { expect(JSON.parse(uaString).application).to.eql(appInfo); expect(stripe.getAppInfoAsString()).to.eql( - appInfo.name + '/' + appInfo.version + ' (' + appInfo.url + ')', + appInfo.name + '/' + appInfo.version + ' (' + appInfo.url + ')' ); done(); @@ -227,7 +227,7 @@ describe('Stripe Module', function() { cleanup.deleteCustomer(customer.id); resolve('Called!'); }); - }), + }) ).to.eventually.equal('Called!'); }); @@ -245,7 +245,7 @@ describe('Stripe Module', function() { resolve('Called!'); }); - }), + }) ).to.eventually.equal('Called!'); }); @@ -261,9 +261,9 @@ describe('Stripe Module', function() { } else { reject(new Error('NoErrorPassed')); } - }, + } ); - }), + }) ).to.eventually.become('ErrorWasPassed'); }); }); @@ -275,7 +275,7 @@ describe('Stripe Module', function() { expect( new Stripe.errors.StripeInvalidRequestError({ message: 'error', - }).type, + }).type ).to.equal('StripeInvalidRequestError'); }); }); diff --git a/test/telemetry.spec.js b/test/telemetry.spec.js index 9e7d02b66b..cc62a61a86 100644 --- a/test/telemetry.spec.js +++ b/test/telemetry.spec.js @@ -16,7 +16,7 @@ function createTestServer(handlerFunc, cb) { res.end( JSON.stringify({ error: {type: 'invalid_request_error', message: e.message}, - }), + }) ); } }); @@ -58,7 +58,7 @@ describe('Client Telemetry', function() { }, function(host, port) { const stripe = require('../lib/stripe')( - 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa' ); stripe.setHost(host, port, 'http'); @@ -72,7 +72,7 @@ describe('Client Telemetry', function() { done(); }) .catch(done); - }, + } ); }); @@ -92,7 +92,7 @@ describe('Client Telemetry', function() { case 2: expect(telemetry).to.exist; expect( - JSON.parse(telemetry).last_request_metrics.request_id, + JSON.parse(telemetry).last_request_metrics.request_id ).to.equal('req_1'); break; default: @@ -105,7 +105,7 @@ describe('Client Telemetry', function() { }, function(host, port) { const stripe = require('../lib/stripe')( - 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa' ); stripe.setTelemetryEnabled(true); stripe.setHost(host, port, 'http'); @@ -120,7 +120,7 @@ describe('Client Telemetry', function() { done(); }) .catch(done); - }, + } ); }); @@ -142,7 +142,7 @@ describe('Client Telemetry', function() { case 4: expect(telemetry).to.exist; expect( - JSON.parse(telemetry).last_request_metrics.request_id, + JSON.parse(telemetry).last_request_metrics.request_id ).to.be.oneOf(['req_1', 'req_2']); break; default: @@ -155,7 +155,7 @@ describe('Client Telemetry', function() { }, function(host, port) { const stripe = require('../lib/stripe')( - 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa' ); stripe.setTelemetryEnabled(true); stripe.setHost(host, port, 'http'); @@ -172,7 +172,7 @@ describe('Client Telemetry', function() { done(); }) .catch(done); - }, + } ); }); }); diff --git a/test/utils.spec.js b/test/utils.spec.js index 1186d4887d..8569a7ef0f 100644 --- a/test/utils.spec.js +++ b/test/utils.spec.js @@ -17,7 +17,7 @@ describe('utils', function() { expect( // Test encoding: - template({foo: 'FOO', baz: '__::baz::__'}), + template({foo: 'FOO', baz: '__::baz::__'}) ).to.equal('/some/url/FOO/__%3A%3Abaz%3A%3A__?ok=1'); }); }); @@ -28,7 +28,7 @@ describe('utils', function() { utils.stringifyRequestData({ a: 1, b: 'foo', - }), + }) ).to.equal('a=1&b=foo'); }); @@ -40,13 +40,13 @@ describe('utils', function() { gte: new Date('2009-02-13T23:31:30Z'), lt: new Date('2044-05-01T01:28:21Z'), }, - }), + }) ).to.equal( [ 'date=1234567890', 'created[gte]=1234567890', 'created[lt]=2345678901', - ].join('&'), + ].join('&') ); }); @@ -60,7 +60,7 @@ describe('utils', function() { }, }, }, - }), + }) ).to.equal('a[b][c][d]=2'); }); @@ -68,7 +68,7 @@ describe('utils', function() { expect( utils.stringifyRequestData({ a: [{b: 'c'}, {b: 'd'}], - }), + }) ).to.equal('a[0][b]=c&a[1][b]=d'); }); @@ -79,7 +79,7 @@ describe('utils', function() { 0: {b: 'c'}, 1: {b: 'd'}, }, - }), + }) ).to.equal('a[0][b]=c&a[1][b]=d'); }); @@ -93,7 +93,7 @@ describe('utils', function() { 1: 2, 'a n o t h e r': null, }, - }), + }) ).to.equal( [ 'test=1', @@ -101,7 +101,7 @@ describe('utils', function() { 'somethingElse=%3A%3A%22%22%25%26', 'nested[1]=2', 'nested[a%20n%20o%20t%20h%20e%20r]=', - ].join('&'), + ].join('&') ); }); }); @@ -143,7 +143,7 @@ describe('utils', function() { }, function(message) { throw new Error('Should not have warned, but did: ' + message); - }, + } ); }); it('warns if the hash contains both data and options', function(done) { @@ -156,11 +156,11 @@ describe('utils', function() { function(message) { expect(message).to.equal( 'Stripe: Options found in arguments (api_key, idempotency_key).' + - ' Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.', + ' Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.' ); done(); - }, + } ); }); it('finds the data', function() { @@ -270,11 +270,11 @@ describe('utils', function() { }, function(message) { expect(message).to.equal( - 'Stripe: Invalid options found (fishsticks, custard); ignoring.', + 'Stripe: Invalid options found (fishsticks, custard); ignoring.' ); done(); - }, + } ); }); }); @@ -303,7 +303,7 @@ describe('utils', function() { dog: false, rabbit: undefined, pointer: null, - }), + }) ).to.eql({ cat: 3, dog: false, @@ -374,7 +374,7 @@ describe('utils', function() { b: 'foo', c: true, d: null, - }), + }) ).to.eql({a: '1', b: 'foo', c: 'true', d: 'null'}); }); @@ -385,7 +385,7 @@ describe('utils', function() { a: 1, b: 'foo', }, - }), + }) ).to.eql({'x[a]': '1', 'x[b]': 'foo'}); }); @@ -398,7 +398,7 @@ describe('utils', function() { x: { a: 1, }, - }), + }) ).to.eql({file: {data: 'foo'}, 'x[a]': '1'}); }); diff --git a/testUtils/index.js b/testUtils/index.js index 2bf3d00c2d..93cba2b9ac 100644 --- a/testUtils/index.js +++ b/testUtils/index.js @@ -76,7 +76,7 @@ var utils = (module.exports = { this._cleanupFns = []; this._stripe = require('../lib/stripe')( utils.getUserStripeKey(), - 'latest', + 'latest' ); afterEach(function(done) { this.timeout(timeout || CleanupUtility.DEFAULT_TIMEOUT); @@ -93,7 +93,7 @@ var utils = (module.exports = { var promise = fn.call(this); if (!promise || !promise.then) { throw new Error( - 'CleanupUtility expects cleanup functions to return promises!', + 'CleanupUtility expects cleanup functions to return promises!' ); } promise.then( @@ -107,7 +107,7 @@ var utils = (module.exports = { function(err) { // not successful throw err; - }, + } ); } if (total === 0) { From 5f03237ee9c31ea74210d6cd4aa557284c436bac Mon Sep 17 00:00:00 2001 From: Bryan Irace Date: Fri, 3 May 2019 11:52:45 -0700 Subject: [PATCH 04/10] Fix conflicting eslint rules and update README with information about yarn and prettier --- .eslintrc.js | 247 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 179 +++++++++++++++++++------------- test/utils.spec.js | 2 +- testUtils/index.js | 3 +- 4 files changed, 357 insertions(+), 74 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 32375e1577..2b21ed9160 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,251 @@ module.exports = { + env: { + node: true, + es6: true, + }, + rules: { + 'accessor-pairs': 'error', + 'array-bracket-spacing': ['error', 'never'], + 'array-callback-return': 'off', + 'arrow-body-style': 'error', + 'arrow-parens': 'error', + 'arrow-spacing': 'error', + 'block-scoped-var': 'off', + 'block-spacing': 'off', + 'brace-style': [ + 'error', + '1tbs', + { + allowSingleLine: true, + }, + ], + camelcase: [ + 'error', + { + properties: 'never', + }, + ], + 'capitalized-comments': 'off', + 'class-methods-use-this': 'error', + 'comma-dangle': 'off', + 'comma-spacing': 'off', + 'comma-style': ['error', 'last'], + complexity: 'error', + 'computed-property-spacing': ['error', 'never'], + 'consistent-return': 'off', + 'consistent-this': 'off', + curly: 'error', + 'default-case': 'off', + 'dot-location': ['error', 'property'], + 'dot-notation': 'error', + 'eol-last': 'error', + eqeqeq: 'off', + 'func-call-spacing': 'error', + 'func-name-matching': 'error', + 'func-names': 'off', + 'func-style': ['error', 'declaration'], + 'generator-star-spacing': 'error', + 'global-require': 'off', + 'guard-for-in': 'off', + 'handle-callback-err': 'off', + 'id-blacklist': 'error', + 'id-length': 'off', + 'id-match': 'error', + 'init-declarations': 'off', + 'jsx-quotes': 'error', + 'key-spacing': 'error', + 'keyword-spacing': [ + 'error', + { + after: true, + before: true, + }, + ], + 'line-comment-position': 'off', + 'linebreak-style': ['error', 'unix'], + 'lines-around-comment': 'error', + 'lines-around-directive': 'error', + 'max-depth': 'error', + 'max-len': 'off', + 'max-lines': 'off', + 'max-nested-callbacks': 'error', + 'max-params': 'off', + 'max-statements': 'off', + 'max-statements-per-line': 'off', + 'multiline-ternary': 'off', + 'new-cap': 'error', + 'new-parens': 'error', + 'newline-after-var': 'off', + 'newline-before-return': 'off', + 'newline-per-chained-call': 'off', + 'no-alert': 'error', + 'no-array-constructor': 'error', + 'no-await-in-loop': 'error', + 'no-bitwise': 'off', + 'no-caller': 'error', + 'no-catch-shadow': 'off', + 'no-compare-neg-zero': 'error', + 'no-confusing-arrow': 'error', + 'no-continue': 'off', + 'no-div-regex': 'error', + 'no-duplicate-imports': 'error', + 'no-else-return': 'off', + 'no-empty-function': 'off', + 'no-eq-null': 'off', + 'no-eval': 'error', + 'no-extend-native': 'error', + 'no-extra-bind': 'error', + 'no-extra-label': 'error', + 'no-extra-parens': 'off', + 'no-floating-decimal': 'error', + 'no-implicit-globals': 'error', + 'no-implied-eval': 'error', + 'no-inline-comments': 'off', + 'no-inner-declarations': ['error', 'functions'], + 'no-invalid-this': 'off', + 'no-iterator': 'error', + 'no-label-var': 'error', + 'no-labels': 'error', + 'no-lone-blocks': 'error', + 'no-lonely-if': 'error', + 'no-loop-func': 'error', + 'no-magic-numbers': 'off', + 'no-mixed-requires': 'error', + 'no-multi-assign': 'off', + 'no-multi-spaces': 'error', + 'no-multi-str': 'error', + 'no-multiple-empty-lines': 'error', + 'no-native-reassign': 'error', + 'no-negated-condition': 'off', + 'no-negated-in-lhs': 'error', + 'no-nested-ternary': 'error', + 'no-new': 'error', + 'no-new-func': 'error', + 'no-new-object': 'error', + 'no-new-require': 'error', + 'no-new-wrappers': 'error', + 'no-octal-escape': 'error', + 'no-param-reassign': 'off', + 'no-path-concat': 'error', + 'no-plusplus': [ + 'error', + { + allowForLoopAfterthoughts: true, + }, + ], + 'no-process-env': 'off', + 'no-process-exit': 'error', + 'no-proto': 'error', + 'no-prototype-builtins': 'off', + 'no-restricted-globals': 'error', + 'no-restricted-imports': 'error', + 'no-restricted-modules': 'error', + 'no-restricted-properties': 'error', + 'no-restricted-syntax': 'error', + 'no-return-assign': 'error', + 'no-return-await': 'error', + 'no-script-url': 'error', + 'no-self-compare': 'error', + 'no-sequences': 'error', + 'no-shadow': 'off', + 'no-shadow-restricted-names': 'error', + 'no-spaced-func': 'error', + 'no-sync': 'error', + 'no-tabs': 'error', + 'no-template-curly-in-string': 'error', + 'no-ternary': 'off', + 'no-throw-literal': 'error', + 'no-trailing-spaces': 'error', + 'no-undef-init': 'error', + 'no-undefined': 'off', + 'no-underscore-dangle': 'off', + 'no-unmodified-loop-condition': 'error', + 'no-unneeded-ternary': 'error', + 'no-unused-expressions': 'error', + 'no-unused-vars': [ + 'error', + { + args: 'none', + }, + ], + 'no-use-before-define': 'off', + 'no-useless-call': 'error', + 'no-useless-computed-key': 'error', + 'no-useless-concat': 'error', + 'no-useless-constructor': 'error', + 'no-useless-escape': 'off', + 'no-useless-rename': 'error', + 'no-useless-return': 'error', + 'no-var': 'off', + 'no-void': 'error', + 'no-warning-comments': 'error', + 'no-whitespace-before-property': 'error', + 'no-with': 'error', + 'nonblock-statement-body-position': 'error', + 'object-curly-newline': 'off', + 'object-curly-spacing': ['error', 'never'], + 'object-property-newline': 'off', + 'object-shorthand': 'off', + 'one-var': 'off', + 'one-var-declaration-per-line': 'error', + 'operator-assignment': ['error', 'always'], + 'operator-linebreak': 'off', + 'padded-blocks': 'off', + 'prefer-arrow-callback': 'off', + 'prefer-const': 'error', + 'prefer-destructuring': [ + 'error', + { + array: false, + object: false, + }, + ], + 'prefer-numeric-literals': 'error', + 'prefer-promise-reject-errors': 'error', + 'prefer-reflect': 'off', + 'prefer-rest-params': 'off', + 'prefer-spread': 'off', + 'prefer-template': 'off', + 'quote-props': 'off', + quotes: [ + 'error', + 'single', + { + avoidEscape: true, + }, + ], + radix: 'error', + 'require-await': 'error', + 'require-jsdoc': 'off', + 'rest-spread-spacing': 'error', + semi: 'off', + 'semi-spacing': [ + 'error', + { + after: true, + before: false, + }, + ], + 'sort-imports': 'error', + 'sort-keys': 'off', + 'sort-vars': 'error', + 'space-before-blocks': 'error', + 'space-before-function-paren': 'off', + 'space-in-parens': ['error', 'never'], + 'space-infix-ops': 'error', + 'space-unary-ops': 'error', + 'spaced-comment': ['error', 'always'], + strict: 'off', + 'symbol-description': 'error', + 'template-curly-spacing': 'error', + 'template-tag-spacing': 'error', + 'unicode-bom': ['error', 'never'], + 'valid-jsdoc': 'off', + 'vars-on-top': 'off', + 'wrap-regex': 'off', + 'yield-star-spacing': 'error', + yoda: ['error', 'never'], + }, parser: 'babel-eslint', plugins: ['prettier'], extends: ['plugin:prettier/recommended'], diff --git a/README.md b/README.md index af66e56c8f..8ad39b5beb 100644 --- a/README.md +++ b/README.md @@ -30,28 +30,14 @@ The package needs to be configured with your account's secret key which is available in your [Stripe Dashboard][api-keys]. Require it with the key's value: -``` js +```js const stripe = require('stripe')('sk_test_...'); const customer = await stripe.customers.create({ - email: 'customer@example.com' + email: 'customer@example.com', }); ``` -Or with versions of Node.js prior to v7.9: - -``` js -var stripe = require('stripe')('sk_test_...'); - -stripe.customers.create( - { email: 'customer@example.com' }, - function(err, customer) { - err; // null if no error occurred - customer; // the created customer object - } -); -``` - Or using ES modules, this looks more like: ```js @@ -60,6 +46,9 @@ const stripe = Stripe('sk_test_...'); //… ``` +On older versions of Node, you can use [promises](#using-promises) +or [callbacks](#using-callbacks) instead of `async`/`await`. + ### Usage with TypeScript Stripe does not currently maintain typings for this package, but there are @@ -78,7 +67,9 @@ To use: import * as Stripe from 'stripe'; const stripe = new Stripe('sk_test_...'); -const customer: Promise = stripe.customers.create(/* ... */); +const customer: Promise< + Stripe.customers.ICustomer +> = stripe.customers.create(/* ... */); ``` ### Using Promises @@ -88,30 +79,53 @@ callback: ```js // Create a new customer and then a new charge for that customer: -stripe.customers.create({ - email: 'foo-customer@example.com' -}).then((customer) => { - return stripe.customers.createSource(customer.id, { - source: 'tok_visa' - }); -}).then((source) => { - return stripe.charges.create({ - amount: 1600, - currency: 'usd', - customer: source.customer +stripe.customers + .create({ + email: 'foo-customer@example.com', + }) + .then((customer) => { + return stripe.customers.createSource(customer.id, { + source: 'tok_visa', + }); + }) + .then((source) => { + return stripe.charges.create({ + amount: 1600, + currency: 'usd', + customer: source.customer, + }); + }) + .then((charge) => { + // New charge created on a new customer + }) + .catch((err) => { + // Deal with an error }); -}).then((charge) => { - // New charge created on a new customer -}).catch((err) => { - // Deal with an error -}); +``` + +### Using callbacks + +On versions of Node.js prior to v7.9: + +```js +var stripe = require('stripe')('sk_test_...'); + +stripe.customers.create( + { + email: 'customer@example.com', + }, + function(err, customer) { + err; // null if no error occurred + customer; // the created customer object + } +); ``` ### Configuring Timeout Request timeout is configurable (the default is Node's default of 120 seconds): -``` js +```js stripe.setTimeout(20000); // in ms (this is 20 seconds) ``` @@ -120,15 +134,18 @@ stripe.setTimeout(20000); // in ms (this is 20 seconds) A per-request `Stripe-Account` header for use with [Stripe Connect][connect] can be added to any method: -``` js +```js // Retrieve the balance for a connected account: -stripe.balance.retrieve({ - stripe_account: 'acct_foo' -}).then((balance) => { - // The balance object for the connected account -}).catch((err) => { - // Error -}); +stripe.balance + .retrieve({ + stripe_account: 'acct_foo', + }) + .then((balance) => { + // The balance object for the connected account + }) + .catch((err) => { + // Error + }); ``` ### Configuring a Proxy @@ -136,7 +153,7 @@ stripe.balance.retrieve({ An [https-proxy-agent][https-proxy-agent] can be configured with `setHttpAgent`. -To use stripe behind a proxy you can pass to sdk: +To use stripe behind a proxy you can pass to sdk: ```js if (process.env.http_proxy) { @@ -147,7 +164,9 @@ if (process.env.http_proxy) { ### Network retries -Automatic network retries can be enabled with `setMaxNetworkRetries`. This will retry requests `n` times with exponential backoff if they fail due to an intermittent network problem. [Idempotency keys](https://stripe.com/docs/api/idempotent_requests) are added where appropriate to prevent duplication. +Automatic network retries can be enabled with `setMaxNetworkRetries`. +This will retry requests `n` times with exponential backoff if they fail due to an intermittent network problem. +[Idempotency keys](https://stripe.com/docs/api/idempotent_requests) are added where appropriate to prevent duplication. ```js // Retry a request once before giving up @@ -160,20 +179,20 @@ Some information about the response which generated a resource is available with the `lastResponse` property: ```js -charge.lastResponse.requestId // see: https://stripe.com/docs/api/node#request_ids -charge.lastResponse.statusCode +charge.lastResponse.requestId; // see: https://stripe.com/docs/api/node#request_ids +charge.lastResponse.statusCode; ``` ### `request` and `response` events -The Stripe object emits `request` and `response` events. You can use them like this: +The Stripe object emits `request` and `response` events. You can use them like this: ```js const stripe = require('stripe')('sk_test_...'); const onRequest = (request) => { // Do something. -} +}; // Add the event handler function: stripe.on('request', onRequest); @@ -183,6 +202,7 @@ stripe.off('request', onRequest); ``` #### `request` object + ```js { api_version: 'latest', @@ -194,6 +214,7 @@ stripe.off('request', onRequest); ``` #### `response` object + ```js { api_version: 'latest', @@ -209,7 +230,7 @@ stripe.off('request', onRequest); ### Webhook signing -Stripe can optionally sign the webhook events it sends to your endpoint, allowing you to validate that they were not sent by a third-party. You can read more about it [here](https://stripe.com/docs/webhooks#signatures). +Stripe can optionally sign the webhook events it sends to your endpoint, allowing you to validate that they were not sent by a third-party. You can read more about it [here](https://stripe.com/docs/webhooks#signatures). Please note that you must pass the _raw_ request body, exactly as received from Stripe, to the `constructEvent()` function; this will not work with a parsed (i.e., JSON) request body. @@ -242,7 +263,6 @@ This information is passed along when the library makes calls to the Stripe API. As of stripe-node 6.11.0, you may auto-paginate list methods. We provide a few different APIs for this to aid with a variety of node versions and styles. - #### Async iterators (`for-await-of`) If you are in a Node environment that has support for [async iteration](https://github.com/tc39/proposal-async-iteration#the-async-iteration-statement-for-await-of), @@ -269,22 +289,26 @@ await stripe.customers.list().autoPagingEach(async (customer) => { if (shouldBreak()) { return false; } -}) +}); console.log('Done iterating.'); ``` Equivalently, without `await`, you may return a Promise, which can resolve to `false` to break: ```js -stripe.customers.list().autoPagingEach((customer) => { - return doSomething(customer).then(() => { - if (shouldBreak()) { - return false; - } - }); -}).then(() => { - console.log('Done iterating.'); -}).catch(handleError); +stripe.customers + .list() + .autoPagingEach((customer) => { + return doSomething(customer).then(() => { + if (shouldBreak()) { + return false; + } + }); + }) + .then(() => { + console.log('Done iterating.'); + }) + .catch(handleError); ``` If you prefer callbacks to promises, you may also use a `next` callback and a second `onDone` callback: @@ -307,7 +331,7 @@ stripe.customers.list().autoPagingEach( console.log('Done iterating.'); } } -) +); ``` If your `onItem` function does not accept a `next` callback parameter _or_ return a Promise, @@ -322,44 +346,55 @@ to prevent runaway list growth from consuming too much memory. Returns a promise of an array of all items across pages for a list request. ```js -const allNewCustomers = await stripe.customers.list({created: {gt: lastMonth}}) +const allNewCustomers = await stripe.customers + .list({created: {gt: lastMonth}}) .autoPagingToArray({limit: 10000}); ``` ## More Information - * [REST API Version](https://github.com/stripe/stripe-node/wiki/REST-API-Version) - * [Error Handling](https://github.com/stripe/stripe-node/wiki/Error-Handling) - * [Passing Options](https://github.com/stripe/stripe-node/wiki/Passing-Options) - * [Using Stripe Connect](https://github.com/stripe/stripe-node/wiki/Using-Stripe-Connect-with-node.js) +- [REST API Version](https://github.com/stripe/stripe-node/wiki/REST-API-Version) +- [Error Handling](https://github.com/stripe/stripe-node/wiki/Error-Handling) +- [Passing Options](https://github.com/stripe/stripe-node/wiki/Passing-Options) +- [Using Stripe Connect](https://github.com/stripe/stripe-node/wiki/Using-Stripe-Connect-with-node.js) ## Development Run all tests: ```bash -$ npm install -$ npm test +$ yarn install +$ yarn test ``` +If you do not have `yarn` installed, you can get it with `npm install --global yarn`. + Run a single test suite: ```bash -$ npm run mocha -- test/Error.spec.js +$ yarn mocha test/Error.spec.js ``` Run a single test (case sensitive): ```bash -$ npm run mocha -- test/Error.spec.js --grep 'Populates with type' +$ yarn mocha test/Error.spec.js --grep 'Populates with type' ``` -If you wish, you may run tests using your Stripe *Test* API key by setting the +If you wish, you may run tests using your Stripe _Test_ API key by setting the environment variable `STRIPE_TEST_API_KEY` before running the tests: ```bash $ export STRIPE_TEST_API_KEY='sk_test....' -$ npm test +$ yarn test +``` + +Run prettier: + +Add an [editor integration](https://prettier.io/docs/en/editors.html) or: + +```bash +$ yarn fix ``` [api-keys]: https://dashboard.stripe.com/account/apikeys diff --git a/test/utils.spec.js b/test/utils.spec.js index 8569a7ef0f..d9ae8a6d54 100644 --- a/test/utils.spec.js +++ b/test/utils.spec.js @@ -433,8 +433,8 @@ function handleWarnings(doWithShimmedConsoleWarn, onWarn) { /* eslint-enable no-console */ } else { + /* eslint-disable-next-line no-inner-declarations */ function onProcessWarn(warning) { - /* eslint-disable-line no-inner-declarations */ onWarn(warning.name + ': ' + warning.message); } diff --git a/testUtils/index.js b/testUtils/index.js index 93cba2b9ac..443b2c4655 100644 --- a/testUtils/index.js +++ b/testUtils/index.js @@ -89,7 +89,8 @@ var utils = (module.exports = { var cleanups = this._cleanupFns; var total = cleanups.length; var completed = 0; - for (var fn; (fn = cleanups.shift()); ) { + var fn; + while ((fn = cleanups.shift())) { var promise = fn.call(this); if (!promise || !promise.then) { throw new Error( From 9279698601c84e4a0eb135f754adc3928e22cc27 Mon Sep 17 00:00:00 2001 From: Bryan Irace Date: Fri, 3 May 2019 10:56:37 -0700 Subject: [PATCH 05/10] Use prettier via eslint --- .eslintrc.js | 293 +---- .prettierrc | 6 + package.json | 12 +- yarn.lock | 3144 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 3162 insertions(+), 293 deletions(-) create mode 100644 .prettierrc create mode 100644 yarn.lock diff --git a/.eslintrc.js b/.eslintrc.js index f9e49b1e55..32375e1577 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,292 +1,5 @@ module.exports = { - "env": { - "node": true, - "es6": true - }, - "extends": "eslint:recommended", - "rules": { - "accessor-pairs": "error", - "array-bracket-spacing": [ - "error", - "never" - ], - "array-callback-return": "off", - "arrow-body-style": "error", - "arrow-parens": "error", - "arrow-spacing": "error", - "block-scoped-var": "off", - "block-spacing": "off", - "brace-style": [ - "error", - "1tbs", - { - "allowSingleLine": true - } - ], - "camelcase": [ - "error", - { - "properties": "never" - } - ], - "capitalized-comments": "off", - "class-methods-use-this": "error", - "comma-dangle": "off", - "comma-spacing": "off", - "comma-style": [ - "error", - "last" - ], - "complexity": "error", - "computed-property-spacing": [ - "error", - "never" - ], - "consistent-return": "off", - "consistent-this": "off", - "curly": "error", - "default-case": "off", - "dot-location": [ - "error", - "property" - ], - "dot-notation": "error", - "eol-last": "error", - "eqeqeq": "off", - "func-call-spacing": "error", - "func-name-matching": "error", - "func-names": "off", - "func-style": [ - "error", - "declaration" - ], - "generator-star-spacing": "error", - "global-require": "off", - "guard-for-in": "off", - "handle-callback-err": "off", - "id-blacklist": "error", - "id-length": "off", - "id-match": "error", - "indent": ["error", 2], - "init-declarations": "off", - "jsx-quotes": "error", - "key-spacing": "error", - "keyword-spacing": [ - "error", - { - "after": true, - "before": true - } - ], - "line-comment-position": "off", - "linebreak-style": [ - "error", - "unix" - ], - "lines-around-comment": "error", - "lines-around-directive": "error", - "max-depth": "error", - "max-len": "off", - "max-lines": "off", - "max-nested-callbacks": "error", - "max-params": "off", - "max-statements": "off", - "max-statements-per-line": "off", - "multiline-ternary": "off", - "new-cap": "error", - "new-parens": "error", - "newline-after-var": "off", - "newline-before-return": "off", - "newline-per-chained-call": "off", - "no-alert": "error", - "no-array-constructor": "error", - "no-await-in-loop": "error", - "no-bitwise": "off", - "no-caller": "error", - "no-catch-shadow": "off", - "no-compare-neg-zero": "error", - "no-confusing-arrow": "error", - "no-continue": "off", - "no-div-regex": "error", - "no-duplicate-imports": "error", - "no-else-return": "off", - "no-empty-function": "off", - "no-eq-null": "off", - "no-eval": "error", - "no-extend-native": "error", - "no-extra-bind": "error", - "no-extra-label": "error", - "no-extra-parens": "off", - "no-floating-decimal": "error", - "no-implicit-globals": "error", - "no-implied-eval": "error", - "no-inline-comments": "off", - "no-inner-declarations": [ - "error", - "functions" - ], - "no-invalid-this": "off", - "no-iterator": "error", - "no-label-var": "error", - "no-labels": "error", - "no-lone-blocks": "error", - "no-lonely-if": "error", - "no-loop-func": "error", - "no-magic-numbers": "off", - "no-mixed-operators": "error", - "no-mixed-requires": "error", - "no-multi-assign": "off", - "no-multi-spaces": "error", - "no-multi-str": "error", - "no-multiple-empty-lines": "error", - "no-native-reassign": "error", - "no-negated-condition": "off", - "no-negated-in-lhs": "error", - "no-nested-ternary": "error", - "no-new": "error", - "no-new-func": "error", - "no-new-object": "error", - "no-new-require": "error", - "no-new-wrappers": "error", - "no-octal-escape": "error", - "no-param-reassign": "off", - "no-path-concat": "error", - "no-plusplus": [ - "error", - { - "allowForLoopAfterthoughts": true - } - ], - "no-process-env": "off", - "no-process-exit": "error", - "no-proto": "error", - "no-prototype-builtins": "off", - "no-restricted-globals": "error", - "no-restricted-imports": "error", - "no-restricted-modules": "error", - "no-restricted-properties": "error", - "no-restricted-syntax": "error", - "no-return-assign": "error", - "no-return-await": "error", - "no-script-url": "error", - "no-self-compare": "error", - "no-sequences": "error", - "no-shadow": "off", - "no-shadow-restricted-names": "error", - "no-spaced-func": "error", - "no-sync": "error", - "no-tabs": "error", - "no-template-curly-in-string": "error", - "no-ternary": "off", - "no-throw-literal": "error", - "no-trailing-spaces": "error", - "no-undef-init": "error", - "no-undefined": "off", - "no-underscore-dangle": "off", - "no-unmodified-loop-condition": "error", - "no-unneeded-ternary": "error", - "no-unused-expressions": "error", - "no-unused-vars": [ - "error", - { - "args": "none" - } - ], - "no-use-before-define": "off", - "no-useless-call": "error", - "no-useless-computed-key": "error", - "no-useless-concat": "error", - "no-useless-constructor": "error", - "no-useless-escape": "off", - "no-useless-rename": "error", - "no-useless-return": "error", - "no-var": "off", - "no-void": "error", - "no-warning-comments": "error", - "no-whitespace-before-property": "error", - "no-with": "error", - "nonblock-statement-body-position": "error", - "object-curly-newline": "off", - "object-curly-spacing": [ - "error", - "never" - ], - "object-property-newline": "off", - "object-shorthand": "off", - "one-var": "off", - "one-var-declaration-per-line": "error", - "operator-assignment": [ - "error", - "always" - ], - "operator-linebreak": "off", - "padded-blocks": "off", - "prefer-arrow-callback": "off", - "prefer-const": "error", - "prefer-destructuring": [ - "error", - { - "array": false, - "object": false - } - ], - "prefer-numeric-literals": "error", - "prefer-promise-reject-errors": "error", - "prefer-reflect": "off", - "prefer-rest-params": "off", - "prefer-spread": "off", - "prefer-template": "off", - "quote-props": "off", - "quotes": [ - "error", - "single", - { - "avoidEscape": true - } - ], - "radix": "error", - "require-await": "error", - "require-jsdoc": "off", - "rest-spread-spacing": "error", - "semi": "off", - "semi-spacing": [ - "error", - { - "after": true, - "before": false - } - ], - "sort-imports": "error", - "sort-keys": "off", - "sort-vars": "error", - "space-before-blocks": "error", - "space-before-function-paren": "off", - "space-in-parens": [ - "error", - "never" - ], - "space-infix-ops": "error", - "space-unary-ops": "error", - "spaced-comment": [ - "error", - "always" - ], - "strict": "off", - "symbol-description": "error", - "template-curly-spacing": "error", - "template-tag-spacing": "error", - "unicode-bom": [ - "error", - "never" - ], - "valid-jsdoc": "off", - "vars-on-top": "off", - "wrap-iife": "error", - "wrap-regex": "off", - "yield-star-spacing": "error", - "yoda": [ - "error", - "never" - ] - } + parser: 'babel-eslint', + plugins: ['prettier'], + extends: ['plugin:prettier/recommended'], }; diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..18a383f970 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "arrowParens": "always", + "trailingComma": "all", + "bracketSpacing": false, + "singleQuote": true +} \ No newline at end of file diff --git a/package.json b/package.json index c0ed1f6ba1..b13849700c 100644 --- a/package.json +++ b/package.json @@ -26,14 +26,19 @@ }, "main": "lib/stripe.js", "devDependencies": { + "babel-eslint": "^10.0.1", "chai": "~4.1.2", "chai-as-promised": "~7.1.1", "coveralls": "^3.0.0", - "eslint": "^4.19.1", + "eslint": "^5.16.0", + "eslint-config-prettier": "^4.1.0", + "eslint-plugin-flowtype": "^3.4.2", + "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-chai-friendly": "^0.4.0", "mocha": "~5.0.5", "nock": "^9.0.0", - "nyc": "^11.3.0" + "nyc": "^11.3.0", + "prettier": "^1.16.4" }, "dependencies": { "lodash.isplainobject": "^4.0.6", @@ -46,7 +51,8 @@ "clean": "rm -rf ./.nyc_output ./node_modules/.cache ./coverage", "mocha": "nyc mocha", "test": "npm run lint && npm run mocha", - "lint": "eslint .", + "lint": "eslint --ext .js,.jsx .", + "fix": "yarn lint --fix", "report": "nyc -r text -r lcov report", "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" } diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000000..a4902128f6 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,3144 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/generator@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041" + integrity sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ== + dependencies: + "@babel/types" "^7.4.4" + jsesc "^2.5.1" + lodash "^4.17.11" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== + dependencies: + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-split-export-declaration@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" + integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== + dependencies: + "@babel/types" "^7.4.4" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.0.0", "@babel/parser@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.4.tgz#5977129431b8fe33471730d255ce8654ae1250b6" + integrity sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w== + +"@babel/template@^7.1.0": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" + integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/traverse@^7.0.0": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.4.tgz#0776f038f6d78361860b6823887d4f3937133fe8" + integrity sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.4" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.11" + +"@babel/types@^7.0.0", "@babel/types@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" + integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ== + dependencies: + esutils "^2.0.2" + lodash "^4.17.11" + to-fast-properties "^2.0.0" + +acorn-jsx@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== + +acorn@^6.0.7: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== + +ajv@^6.5.5, ajv@^6.9.1: + version "6.10.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + integrity sha1-126/jKlNJ24keja61EpLdKthGZE= + dependencies: + default-require-extensions "^1.0.0" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= + dependencies: + arr-flatten "^1.0.1" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +assertion-error@^1.0.1, assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-eslint@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.1.tgz#919681dc099614cd7d31d45c8908695092a1faed" + integrity sha512-z7OT1iNV+TjOwHNLLyJk+HN+YVWX+CLE6fPD2SymJZOZQBs+QIexFjhm4keGTm8MW9xr4EC9Q0PbaLB24V5GoQ== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.0.0" + "@babel/traverse" "^7.0.0" + "@babel/types" "^7.0.0" + eslint-scope "3.7.1" + eslint-visitor-keys "^1.0.0" + +babel-generator@^6.18.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= + dependencies: + babel-runtime "^6.22.0" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.16.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.18.0, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.18.0, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + 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" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +caching-transform@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-1.0.1.tgz#6dbdb2f20f8d8fbce79f3e94e9d1742dcdf5c0a1" + integrity sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE= + dependencies: + md5-hex "^1.2.0" + mkdirp "^0.5.1" + write-file-atomic "^1.1.4" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +chai-as-promised@~7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.1.tgz#08645d825deb8696ee61725dbf590c012eb00ca0" + integrity sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA== + dependencies: + check-error "^1.0.2" + +chai@^4.1.2: + version "4.2.0" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" + integrity sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^3.0.1" + get-func-name "^2.0.0" + pathval "^1.1.0" + type-detect "^4.0.5" + +chai@~4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c" + integrity sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw= + dependencies: + assertion-error "^1.0.1" + check-error "^1.0.1" + deep-eql "^3.0.0" + get-func-name "^2.0.0" + pathval "^1.0.0" + type-detect "^4.0.0" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +check-error@^1.0.1, check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== + dependencies: + delayed-stream "~1.0.0" + +commander@2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ== + +commander@~2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +convert-source-map@^1.5.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== + dependencies: + safe-buffer "~5.1.1" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js@^2.4.0: + version "2.6.5" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" + integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A== + +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +coveralls@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.3.tgz#83b1c64aea1c6afa69beaf50b55ac1bc4d13e2b8" + integrity sha512-viNfeGlda2zJr8Gj1zqXpDMRjw9uM54p7wzZdvLRyOgnAfCe974Dq4veZkjJdxQXbmdppu6flEajFYseHYaUhg== + dependencies: + growl "~> 1.10.0" + js-yaml "^3.11.0" + lcov-parse "^0.0.10" + log-driver "^1.2.7" + minimist "^1.2.0" + request "^2.86.0" + +cross-spawn@^4: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + integrity sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE= + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +debug-log@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" + integrity sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8= + +debug@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +debug@^4.0.1, debug@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +deep-eql@^3.0.0, deep-eql@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== + dependencies: + type-detect "^4.0.0" + +deep-equal@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + integrity sha1-836hXT4T/9m0N9M+GnW1+5eHTLg= + dependencies: + strip-bom "^2.0.0" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= + dependencies: + repeating "^2.0.0" + +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +error-ex@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +eslint-config-prettier@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-4.2.0.tgz#70b946b629cd0e3e98233fd9ecde4cb9778de96c" + integrity sha512-y0uWc/FRfrHhpPZCYflWC8aE0KRJRY04rdZVfl8cL3sEZmOYyaBdhdlQPjKZBnuRMyLVK+JUZr7HaZFClQiH4w== + dependencies: + get-stdin "^6.0.0" + +eslint-plugin-chai-friendly@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.4.1.tgz#9eeb17f92277ba80bb64f0e946c6936a3ae707b4" + integrity sha512-hkpLN7VVoGGsofZjUhcQ+sufC3FgqMJwD0DvAcRfxY1tVRyQyVsqpaKnToPHJQOrRo0FQ0fSEDwW2gr4rsNdGA== + +eslint-plugin-flowtype@^3.4.2: + version "3.7.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.7.0.tgz#6662392f2daf6056138448b46ebc17c7a83ad337" + integrity sha512-6PAYrfSAd23C6ZTc9OhEpSn4uz5HnaXSOYzBLPiKNAE+WmNnWkgkfrswOK2Rlvn91ofZoba7SR04gitnmW9sqg== + dependencies: + lodash "^4.17.11" + +eslint-plugin-prettier@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.1.tgz#19d521e3981f69dd6d14f64aec8c6a6ac6eb0b0d" + integrity sha512-/PMttrarPAY78PLvV3xfWibMOdMDl57hmlQ2XqFeA37wd+CJ7WSxV7txqjVPHi/AAFKd2lX0ZqfsOc/i5yFCSQ== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-scope@3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug= + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + +eslint@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" + integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.9.1" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.3" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.1" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.2.2" + js-yaml "^3.13.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.11" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.2.3" + text-table "^0.2.0" + +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== + dependencies: + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + dependencies: + estraverse "^4.1.0" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= + dependencies: + is-posix-bracket "^0.1.0" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= + dependencies: + fill-range "^2.1.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +external-editor@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= + dependencies: + is-extglob "^1.0.0" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== + dependencies: + flat-cache "^2.0.1" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +find-cache-dir@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" + integrity sha1-yN765XyKUqinhPnjHFfHQumToLk= + dependencies: + commondir "^1.0.1" + mkdirp "^0.5.1" + pkg-dir "^1.0.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + +for-in@^1.0.1, for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= + dependencies: + for-in "^1.0.1" + +foreground-child@^1.5.3, foreground-child@^1.5.6: + version "1.5.6" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" + integrity sha1-T9ca0t/elnibmApcCilZN8svXOk= + dependencies: + cross-spawn "^4" + signal-exit "^3.0.0" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= + +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= + dependencies: + is-glob "^2.0.0" + +glob@7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.0.6, glob@^7.1.2, glob@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0, globals@^11.7.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== + +graceful-fs@^4.1.11, graceful-fs@^4.1.2: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +growl@1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" + integrity sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q== + +"growl@~> 1.10.0": + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +handlebars@^4.0.3: + version "4.1.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== + dependencies: + neo-async "^2.6.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= + +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= + +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +inquirer@^6.2.2: + version "6.3.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.3.1.tgz#7a413b5e7950811013a3db491c61d1f3b776e8e7" + integrity sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.11" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + +invariant@^2.2.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= + dependencies: + is-extglob "^1.0.0" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isarray@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +istanbul-lib-coverage@^1.1.2, istanbul-lib-coverage@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" + integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== + +istanbul-lib-hook@^1.1.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz#bc6bf07f12a641fbf1c85391d0daa8f0aea6bf86" + integrity sha512-/Jmq7Y1VeHnZEQ3TL10VHyb564mn6VrQXHchON9Jf/AEcmQ3ZIiyD1BVzNOKTZf/G3gE+kiGK6SmpF9y3qGPLw== + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.10.0: + version "1.10.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz#1f55ed10ac3c47f2bdddd5307935126754d0a9ca" + integrity sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A== + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.2.1" + semver "^5.3.0" + +istanbul-lib-report@^1.1.3: + version "1.1.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz#f2a657fc6282f96170aaf281eb30a458f7f4170c" + integrity sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw== + dependencies: + istanbul-lib-coverage "^1.2.1" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.2.3: + version "1.2.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.6.tgz#37b9ff661580f8fca11232752ee42e08c6675d8f" + integrity sha512-TtbsY5GIHgbMsMiRw35YBHGpZ1DVFEO19vxxeiDMYaeOFOCzfnYVxvl6pOUIZR4dtPhAGpSMup8OyF8ubsaqEg== + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.2.1" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.4.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.5.1.tgz#97e4dbf3b515e8c484caea15d6524eebd3ff4e1a" + integrity sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw== + dependencies: + handlebars "^4.0.3" + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + +js-yaml@^3.11.0, js-yaml@^3.13.0: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +lcov-parse@^0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" + integrity sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM= + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash.isplainobject@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= + +lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +log-driver@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" + integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lru-cache@^4.0.1: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +math-random@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" + integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== + +md5-hex@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" + integrity sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ= + dependencies: + md5-o-matic "^0.1.1" + +md5-o-matic@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" + integrity sha1-givM1l4RfFFPqxdrJZRdVBAKA8M= + +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= + dependencies: + mimic-fn "^1.0.0" + +merge-source-map@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646" + integrity sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw== + dependencies: + source-map "^0.6.1" + +micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +micromatch@^3.1.10: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + 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" + +mime-db@1.40.0: + version "1.40.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" + integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.24" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" + integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== + dependencies: + mime-db "1.40.0" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +mocha@~5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.0.5.tgz#e228e3386b9387a4710007a641f127b00be44b52" + integrity sha512-3MM3UjZ5p8EJrYpG7s+29HAI9G7sTzKEe4+w37Dg0QP7qL4XGsV+Q2xet2cE37AqdgN1OtYQB6Vl98YiPV3PgA== + dependencies: + browser-stdout "1.3.1" + commander "2.11.0" + debug "3.1.0" + diff "3.5.0" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.3" + he "1.1.1" + mkdirp "0.5.1" + supports-color "4.4.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +neo-async@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835" + integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +nock@^9.0.0: + version "9.6.1" + resolved "https://registry.yarnpkg.com/nock/-/nock-9.6.1.tgz#d96e099be9bc1d0189a77f4490bbbb265c381b49" + integrity sha512-EDgl/WgNQ0C1BZZlASOQkQdE6tAWXJi8QQlugqzN64JJkvZ7ILijZuG24r4vCC7yOfnm6HKpne5AGExLGCeBWg== + dependencies: + chai "^4.1.2" + debug "^3.1.0" + deep-equal "^1.0.0" + json-stringify-safe "^5.0.1" + lodash "^4.17.5" + mkdirp "^0.5.0" + propagate "^1.0.0" + qs "^6.5.1" + semver "^5.5.0" + +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +nyc@^11.3.0: + version "11.9.0" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-11.9.0.tgz#4106e89e8fbe73623a1fc8b6ecb7abaa271ae1e4" + integrity sha512-w8OdJAhXL5izerzZMdqzYKMj/pgHJyY3qEPYBjLLxrhcVoHEY9pU5ENIiZyCgG9OR7x3VcUMoD40o6PtVpfR4g== + dependencies: + archy "^1.0.0" + arrify "^1.0.1" + caching-transform "^1.0.0" + convert-source-map "^1.5.1" + debug-log "^1.0.1" + default-require-extensions "^1.0.0" + find-cache-dir "^0.1.1" + find-up "^2.1.0" + foreground-child "^1.5.3" + glob "^7.0.6" + istanbul-lib-coverage "^1.1.2" + istanbul-lib-hook "^1.1.0" + istanbul-lib-instrument "^1.10.0" + istanbul-lib-report "^1.1.3" + istanbul-lib-source-maps "^1.2.3" + istanbul-reports "^1.4.0" + md5-hex "^1.2.0" + merge-source-map "^1.1.0" + micromatch "^3.1.10" + mkdirp "^0.5.0" + resolve-from "^2.0.0" + rimraf "^2.6.2" + signal-exit "^3.0.1" + spawn-wrap "^1.4.2" + test-exclude "^4.2.0" + yargs "11.1.0" + yargs-parser "^8.0.0" + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-homedir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= + dependencies: + error-ex "^1.2.0" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-parse@^1.0.5, path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pathval@^1.0.0, pathval@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" + integrity sha1-uULm1L3mUwBe9rcTYd74cn0GReA= + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= + dependencies: + find-up "^1.0.0" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@^1.16.4: + version "1.17.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.0.tgz#53b303676eed22cc14a9f0cec09b477b3026c008" + integrity sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw== + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +propagate@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/propagate/-/propagate-1.0.0.tgz#00c2daeedda20e87e3782b344adba1cddd6ad709" + integrity sha1-AMLa7t2iDofjeCs0Stuhzd1q1wk= + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + +psl@^1.1.24: + version "1.1.31" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@^6.5.1, qs@^6.6.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +randomatic@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" + integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== + dependencies: + is-equal-shallow "^0.1.3" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.5.2, repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= + dependencies: + is-finite "^1.0.0" + +request@^2.86.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +resolve-from@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" + integrity sha1-lICrIOlP+h2egKgEx+oUdhGWa1c= + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@^1.10.0: + version "1.10.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.1.tgz#664842ac960795bbe758221cdccda61fb64b5f18" + integrity sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA== + dependencies: + path-parse "^1.0.6" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rimraf@2.6.3, rimraf@^2.6.1, rimraf@^2.6.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= + dependencies: + is-promise "^2.1.0" + +rxjs@^6.4.0: + version "6.5.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.1.tgz#f7a005a9386361921b8524f38f54cbf80e5d08f4" + integrity sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg== + dependencies: + tslib "^1.9.0" + +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.5.1: + version "5.7.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +signal-exit@^3.0.0, signal-exit@^3.0.1, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + +slide@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +spawn-wrap@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.4.2.tgz#cff58e73a8224617b6561abdc32586ea0c82248c" + integrity sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg== + dependencies: + foreground-child "^1.5.6" + mkdirp "^0.5.0" + os-homedir "^1.0.1" + rimraf "^2.6.2" + signal-exit "^3.0.2" + which "^1.3.0" + +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" + integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= + dependencies: + is-utf8 "^0.2.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +strip-json-comments@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +supports-color@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" + integrity sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ== + dependencies: + has-flag "^2.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +supports-color@^3.1.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= + dependencies: + has-flag "^1.0.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +table@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2" + integrity sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ== + dependencies: + ajv "^6.9.1" + lodash "^4.17.11" + slice-ansi "^2.1.0" + string-width "^3.0.0" + +test-exclude@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.3.tgz#a9a5e64474e4398339245a0a769ad7c2f4a97c20" + integrity sha512-SYbXgY64PT+4GAL2ocI3HwPa4Q4TBKm0cwAVeKOt/Aoc0gSpNRjJX8w0pA1LMKZ3LBmd8pYBqApFNQLII9kavA== + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + +tslib@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +uglify-js@^3.1.4: + version "3.5.10" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.10.tgz#652bef39f86d9dbfd6674407ee05a5e2d372cf2d" + integrity sha512-/GTF0nosyPLbdJBd+AwYiZ+Hu5z8KXWnO0WCGt1BQ/u9Iamhejykqmz5o1OHJ53+VAk6xVxychonnApDjuqGsw== + dependencies: + commander "~2.20.0" + source-map "~0.6.1" + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@^1.2.9, which@^1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@^1.1.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" + integrity sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8= + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + slide "^1.1.5" + +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + +yargs-parser@^8.0.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950" + integrity sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ== + dependencies: + camelcase "^4.1.0" + +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= + dependencies: + camelcase "^4.1.0" + +yargs@11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2" From f40cc7ec076ee12db0c28e1c081d180f60254a35 Mon Sep 17 00:00:00 2001 From: Bryan Irace Date: Fri, 3 May 2019 10:56:49 -0700 Subject: [PATCH 06/10] Run yarn fix --- examples/webhook-signing/express.js | 34 +- lib/Error.js | 60 +- lib/MultipartDataGenerator.js | 15 +- lib/ResourceNamespace.js | 2 +- lib/StripeMethod.basic.js | 109 ++- lib/StripeMethod.js | 15 +- lib/StripeResource.js | 107 +-- lib/Webhooks.js | 59 +- lib/autoPagination.js | 66 +- lib/makeRequest.js | 60 +- lib/resources/AccountLinks.js | 1 - lib/resources/Accounts.js | 4 +- lib/resources/ApplicationFees.js | 5 +- lib/resources/Balance.js | 2 - lib/resources/BitcoinReceivers.js | 5 +- lib/resources/Charges.js | 13 +- lib/resources/Checkout/Sessions.js | 2 +- lib/resources/CountrySpecs.js | 5 +- lib/resources/Coupons.js | 1 - lib/resources/CreditNotes.js | 1 - lib/resources/Customers.js | 10 +- lib/resources/Disputes.js | 7 +- lib/resources/EphemeralKeys.js | 4 +- lib/resources/Events.js | 1 - lib/resources/ExchangeRates.js | 5 +- lib/resources/FileLinks.js | 8 +- lib/resources/Files.js | 37 +- lib/resources/InvoiceItems.js | 10 +- lib/resources/Invoices.js | 43 +- lib/resources/Issuing/Cardholders.js | 9 +- lib/resources/Issuing/Cards.js | 9 +- lib/resources/Issuing/Disputes.js | 9 +- lib/resources/OAuth.js | 9 +- lib/resources/OrderReturns.js | 5 +- lib/resources/Orders.js | 6 +- lib/resources/PaymentIntents.js | 1 - lib/resources/PaymentMethods.js | 1 - lib/resources/Payouts.js | 10 +- lib/resources/Persons.js | 1 - lib/resources/Plans.js | 1 - lib/resources/Products.js | 6 +- lib/resources/Recipients.js | 12 +- lib/resources/Refunds.js | 6 +- lib/resources/Reviews.js | 2 - lib/resources/SKUs.js | 6 +- lib/resources/Sources.js | 6 +- lib/resources/SubscriptionItems.js | 3 +- .../SubscriptionScheduleRevisions.js | 2 +- lib/resources/SubscriptionSchedules.js | 9 +- lib/resources/Subscriptions.js | 3 +- lib/resources/TaxRates.js | 1 - lib/resources/Terminal/ConnectionTokens.js | 2 +- lib/resources/Terminal/Locations.js | 2 +- lib/resources/Terminal/Readers.js | 2 +- lib/resources/ThreeDSecure.js | 6 +- lib/resources/Topups.js | 9 +- lib/resources/TransferReversals.js | 1 - lib/resources/Transfers.js | 10 +- lib/resources/WebhookEndpoints.js | 1 - lib/stripe.js | 16 +- lib/utils.js | 113 ++- test/Error.spec.js | 26 +- test/StripeResource.spec.js | 163 ++-- test/Webhook.spec.js | 166 +++-- test/autoPagination.spec.js | 701 ++++++++++-------- test/flows.spec.js | 459 +++++++----- test/resources/Account.spec.js | 84 ++- test/resources/ApplicationFeeRefunds.spec.js | 19 +- test/resources/ApplicationFees.spec.js | 23 +- test/resources/Balance.spec.js | 5 +- test/resources/BitcoinReceivers.spec.js | 2 +- test/resources/ChargeRefunds.spec.js | 7 +- test/resources/Charges.spec.js | 27 +- test/resources/Checkout/Sessions.spec.js | 8 +- test/resources/CreditNotes.spec.js | 2 +- test/resources/CustomerCards.spec.js | 10 +- test/resources/CustomerSubscriptions.spec.js | 33 +- test/resources/Customers.spec.js | 145 ++-- test/resources/EphemeralKeys.spec.js | 6 +- test/resources/FileUploads.spec.js | 86 ++- test/resources/Files.spec.js | 86 ++- test/resources/Invoices.spec.js | 42 +- test/resources/Issuing/Authorization.spec.js | 6 +- test/resources/Issuing/Cardholders.spec.js | 24 +- test/resources/Issuing/Cards.spec.js | 30 +- test/resources/Issuing/Disputes.spec.js | 24 +- test/resources/Issuing/Transactions.spec.js | 20 +- test/resources/LoginLinks.spec.js | 5 +- test/resources/OAuth.spec.js | 12 +- test/resources/Orders.spec.js | 6 +- test/resources/PaymentMethods.spec.js | 4 +- test/resources/Payouts.spec.js | 3 +- test/resources/Persons.spec.js | 6 +- test/resources/Plans.spec.js | 30 +- test/resources/Products.spec.js | 2 +- test/resources/Radar/ValueListItems.spec.js | 16 +- test/resources/Radar/ValueLists.spec.js | 16 +- test/resources/RecipientCards.spec.js | 10 +- test/resources/Recipients.spec.js | 29 +- test/resources/Refunds.spec.js | 2 +- test/resources/Reporting/ReportRuns.spec.js | 16 +- test/resources/Reporting/ReportTypes.spec.js | 12 +- test/resources/SKUs.spec.js | 2 +- .../Sigma/ScheduledQueryRuns.spec.js | 2 +- test/resources/SubscriptionSchedule.spec.js | 15 +- .../SubscriptionScheduleRevision.spec.js | 14 +- test/resources/Subscriptions.spec.js | 8 +- test/resources/TaxIds.spec.js | 5 +- .../Terminal/ConnectionTokens.spec.js | 4 +- test/resources/Terminal/Locations.spec.js | 22 +- test/resources/Terminal/Readers.spec.js | 22 +- test/resources/Topups.spec.js | 4 +- test/resources/TransferReversals.spec.js | 20 +- test/resources/Transfers.spec.js | 4 +- test/resources/UsageRecordSummaries.spec.js | 32 +- test/resources/UsageRecords.spec.js | 68 +- test/stripe.spec.js | 154 ++-- test/telemetry.spec.js | 237 +++--- test/utils.spec.js | 323 ++++---- testUtils/index.js | 55 +- 120 files changed, 2568 insertions(+), 1766 deletions(-) diff --git a/examples/webhook-signing/express.js b/examples/webhook-signing/express.js index 2c64e12012..29be911f56 100644 --- a/examples/webhook-signing/express.js +++ b/examples/webhook-signing/express.js @@ -14,25 +14,29 @@ const webhookSecret = process.env.WEBHOOK_SECRET; const app = express(); // Stripe requires the raw body to construct the event -app.post('/webhooks', bodyParser.raw({type: 'application/json'}), (req, res) => { - const sig = req.headers['stripe-signature']; +app.post( + '/webhooks', + bodyParser.raw({type: 'application/json'}), + (req, res) => { + const sig = req.headers['stripe-signature']; - let event; + let event; - try { - event = stripe.webhooks.constructEvent(req.body, sig, webhookSecret); - } catch (err) { - // On error, return the error message - return res.status(400).send(`Webhook Error: ${err.message}`); - } + try { + event = stripe.webhooks.constructEvent(req.body, sig, webhookSecret); + } catch (err) { + // On error, return the error message + return res.status(400).send(`Webhook Error: ${err.message}`); + } - // Do something with event - console.log('Success:', event.id); + // Do something with event + console.log('Success:', event.id); - // Return a response to acknowledge receipt of the event - res.json({received: true}); -}); + // Return a response to acknowledge receipt of the event + res.json({received: true}); + }, +); app.listen(3000, function() { - console.log('Example app listening on port 3000!') + console.log('Example app listening on port 3000!'); }); diff --git a/lib/Error.js b/lib/Error.js index 831aaa6eca..cc7a0d18df 100644 --- a/lib/Error.js +++ b/lib/Error.js @@ -9,7 +9,7 @@ module.exports = _Error; */ function _Error(raw) { this.populate.apply(this, arguments); - this.stack = (new Error(this.message)).stack; + this.stack = new Error(this.message).stack; } // Extend Native Error @@ -27,13 +27,13 @@ _Error.extend = utils.protoExtend; * Create subclass of internal Error klass * (Specifically for errors returned from Stripe's REST API) */ -var StripeError = _Error.StripeError = _Error.extend({ +var StripeError = (_Error.StripeError = _Error.extend({ type: 'StripeError', populate: function(raw) { // Move from prototype def (so it appears in stringified obj) this.type = this.type; - this.stack = (new Error(raw.message)).stack; + this.stack = new Error(raw.message).stack; this.rawType = raw.type; this.code = raw.code; this.param = raw.param; @@ -44,35 +44,51 @@ var StripeError = _Error.StripeError = _Error.extend({ this.requestId = raw.requestId; this.statusCode = raw.statusCode; }, -}); +})); /** * Helper factory which takes raw stripe errors and outputs wrapping instances */ StripeError.generate = function(rawStripeError) { switch (rawStripeError.type) { - case 'card_error': - return new _Error.StripeCardError(rawStripeError); - case 'invalid_request_error': - return new _Error.StripeInvalidRequestError(rawStripeError); - case 'api_error': - return new _Error.StripeAPIError(rawStripeError); - case 'idempotency_error': - return new _Error.StripeIdempotencyError(rawStripeError); - case 'invalid_grant': - return new _Error.StripeInvalidGrantError(rawStripeError); + case 'card_error': + return new _Error.StripeCardError(rawStripeError); + case 'invalid_request_error': + return new _Error.StripeInvalidRequestError(rawStripeError); + case 'api_error': + return new _Error.StripeAPIError(rawStripeError); + case 'idempotency_error': + return new _Error.StripeIdempotencyError(rawStripeError); + case 'invalid_grant': + return new _Error.StripeInvalidGrantError(rawStripeError); } return new _Error('Generic', 'Unknown Error'); }; // Specific Stripe Error types: _Error.StripeCardError = StripeError.extend({type: 'StripeCardError'}); -_Error.StripeInvalidRequestError = StripeError.extend({type: 'StripeInvalidRequestError'}); +_Error.StripeInvalidRequestError = StripeError.extend({ + type: 'StripeInvalidRequestError', +}); _Error.StripeAPIError = StripeError.extend({type: 'StripeAPIError'}); -_Error.StripeAuthenticationError = StripeError.extend({type: 'StripeAuthenticationError'}); -_Error.StripePermissionError = StripeError.extend({type: 'StripePermissionError'}); -_Error.StripeRateLimitError = StripeError.extend({type: 'StripeRateLimitError'}); -_Error.StripeConnectionError = StripeError.extend({type: 'StripeConnectionError'}); -_Error.StripeSignatureVerificationError = StripeError.extend({type: 'StripeSignatureVerificationError'}); -_Error.StripeIdempotencyError = StripeError.extend({type: 'StripeIdempotencyError'}); -_Error.StripeInvalidGrantError = StripeError.extend({type: 'StripeInvalidGrantError'}); +_Error.StripeAuthenticationError = StripeError.extend({ + type: 'StripeAuthenticationError', +}); +_Error.StripePermissionError = StripeError.extend({ + type: 'StripePermissionError', +}); +_Error.StripeRateLimitError = StripeError.extend({ + type: 'StripeRateLimitError', +}); +_Error.StripeConnectionError = StripeError.extend({ + type: 'StripeConnectionError', +}); +_Error.StripeSignatureVerificationError = StripeError.extend({ + type: 'StripeSignatureVerificationError', +}); +_Error.StripeIdempotencyError = StripeError.extend({ + type: 'StripeIdempotencyError', +}); +_Error.StripeInvalidGrantError = StripeError.extend({ + type: 'StripeInvalidGrantError', +}); diff --git a/lib/MultipartDataGenerator.js b/lib/MultipartDataGenerator.js index 4225375c40..ca32203a33 100644 --- a/lib/MultipartDataGenerator.js +++ b/lib/MultipartDataGenerator.js @@ -7,13 +7,15 @@ var utils = require('./utils'); // Mostly taken from Fermata.js // https://github.com/natevw/fermata/blob/5d9732a33d776ce925013a265935facd1626cc88/fermata.js#L315-L343 function multipartDataGenerator(method, data, headers) { - var segno = (Math.round(Math.random() * 1e16) + Math.round(Math.random() * 1e16)).toString(); - headers['Content-Type'] = ('multipart/form-data; boundary=' + segno); + var segno = ( + Math.round(Math.random() * 1e16) + Math.round(Math.random() * 1e16) + ).toString(); + headers['Content-Type'] = 'multipart/form-data; boundary=' + segno; var buffer = Buffer.alloc(0); function push(l) { var prevBuffer = buffer; - var newBuffer = (l instanceof Buffer) ? l : Buffer.from(l); + var newBuffer = l instanceof Buffer ? l : Buffer.from(l); buffer = Buffer.alloc(prevBuffer.length + newBuffer.length + 2); prevBuffer.copy(buffer); newBuffer.copy(buffer, prevBuffer.length); @@ -28,7 +30,12 @@ function multipartDataGenerator(method, data, headers) { var v = data[k]; push('--' + segno); if (v.hasOwnProperty('data')) { - push('Content-Disposition: form-data; name=' + q(k) + '; filename=' + q(v.name || 'blob')); + push( + 'Content-Disposition: form-data; name=' + + q(k) + + '; filename=' + + q(v.name || 'blob'), + ); push('Content-Type: ' + (v.type || 'application/octet-stream')); push(''); push(v.data); diff --git a/lib/ResourceNamespace.js b/lib/ResourceNamespace.js index 872b9c4664..2f0c053669 100644 --- a/lib/ResourceNamespace.js +++ b/lib/ResourceNamespace.js @@ -14,7 +14,7 @@ function ResourceNamespace(stripe, resources) { } module.exports = function(namespace, resources) { - return function (stripe) { + return function(stripe) { return new ResourceNamespace(stripe, resources); }; }; diff --git a/lib/StripeMethod.basic.js b/lib/StripeMethod.basic.js index cef6d8d597..6cda377c41 100644 --- a/lib/StripeMethod.basic.js +++ b/lib/StripeMethod.basic.js @@ -5,7 +5,6 @@ var stripeMethod = require('./StripeMethod'); var utils = require('./utils'); module.exports = { - create: stripeMethod({ method: 'POST', }), @@ -54,39 +53,60 @@ module.exports = { var urlData = this.createUrlData(); var path = this.createFullPath('/' + id, urlData); - return utils.callbackifyPromiseWithTimeout(new Promise((function(resolve, reject) { - if (isNull) { - // Reset metadata: - sendMetadata(null, auth); - } else if (!isObject) { - // Set individual metadata property: - var metadata = {}; - metadata[key] = value; - sendMetadata(metadata, auth); - } else { - // Set entire metadata object after resetting it: - this._request('POST', null, path, { - metadata: null, - }, auth, {}, function(err, response) { - if (err) { - return reject(err); + return utils.callbackifyPromiseWithTimeout( + new Promise( + function(resolve, reject) { + if (isNull) { + // Reset metadata: + sendMetadata(null, auth); + } else if (!isObject) { + // Set individual metadata property: + var metadata = {}; + metadata[key] = value; + sendMetadata(metadata, auth); + } else { + // Set entire metadata object after resetting it: + this._request( + 'POST', + null, + path, + { + metadata: null, + }, + auth, + {}, + function(err, response) { + if (err) { + return reject(err); + } + sendMetadata(data, auth); + }, + ); } - sendMetadata(data, auth); - }); - } - function sendMetadata(metadata, auth) { - self._request('POST', null, path, { - metadata: metadata, - }, auth, {}, function(err, response) { - if (err) { - reject(err); - } else { - resolve(response.metadata); + function sendMetadata(metadata, auth) { + self._request( + 'POST', + null, + path, + { + metadata: metadata, + }, + auth, + {}, + function(err, response) { + if (err) { + reject(err); + } else { + resolve(response.metadata); + } + }, + ); } - }); - } - }).bind(this)), cb); + }.bind(this), + ), + cb, + ); }, getMetadata: function(id, auth, cb) { @@ -98,15 +118,22 @@ module.exports = { var urlData = this.createUrlData(); var path = this.createFullPath('/' + id, urlData); - return utils.callbackifyPromiseWithTimeout(new Promise((function(resolve, reject) { - this._request('GET', null, path, {}, auth, {}, function(err, response) { - if (err) { - reject(err); - } else { - resolve(response.metadata); - } - }); - }).bind(this)), cb); + return utils.callbackifyPromiseWithTimeout( + new Promise( + function(resolve, reject) { + this._request('GET', null, path, {}, auth, {}, function( + err, + response, + ) { + if (err) { + reject(err); + } else { + resolve(response.metadata); + } + }); + }.bind(this), + ), + cb, + ); }, - }; diff --git a/lib/StripeMethod.js b/lib/StripeMethod.js index 74bdfae7d5..a79033a918 100644 --- a/lib/StripeMethod.js +++ b/lib/StripeMethod.js @@ -2,7 +2,8 @@ var utils = require('./utils'); var makeRequest = require('./makeRequest'); -var makeAutoPaginationMethods = require('./autoPagination').makeAutoPaginationMethods; +var makeAutoPaginationMethods = require('./autoPagination') + .makeAutoPaginationMethods; /** * Create an API method from the declared spec. @@ -25,10 +26,18 @@ function stripeMethod(spec) { var callback = typeof args[args.length - 1] == 'function' && args.pop(); - var requestPromise = utils.callbackifyPromiseWithTimeout(makeRequest(self, args, spec, {}), callback) + var requestPromise = utils.callbackifyPromiseWithTimeout( + makeRequest(self, args, spec, {}), + callback, + ); if (spec.methodType === 'list') { - var autoPaginationMethods = makeAutoPaginationMethods(self, args, spec, requestPromise); + var autoPaginationMethods = makeAutoPaginationMethods( + self, + args, + spec, + requestPromise, + ); Object.assign(requestPromise, autoPaginationMethods); } diff --git a/lib/StripeResource.js b/lib/StripeResource.js index bea29419ea..6d8423d3ac 100644 --- a/lib/StripeResource.js +++ b/lib/StripeResource.js @@ -29,7 +29,9 @@ function StripeResource(stripe, urlData) { this._stripe = stripe; this._urlData = urlData || {}; - this.basePath = utils.makeURLInterpolator(this.basePath || stripe.getApiField('basePath')); + this.basePath = utils.makeURLInterpolator( + this.basePath || stripe.getApiField('basePath'), + ); this.resourcePath = this.path; this.path = utils.makeURLInterpolator(this.path); @@ -43,7 +45,6 @@ function StripeResource(stripe, urlData) { } StripeResource.prototype = { - path: '', // Methods that don't use the API's default '/v1' path can override it with this setting. @@ -62,22 +63,23 @@ StripeResource.prototype = { validateRequest: null, createFullPath: function(commandPath, urlData) { - return path.join( - this.basePath(urlData), - this.path(urlData), - typeof commandPath == 'function' ? - commandPath(urlData) : commandPath - ).replace(/\\/g, '/'); // ugly workaround for Windows + return path + .join( + this.basePath(urlData), + this.path(urlData), + typeof commandPath == 'function' ? commandPath(urlData) : commandPath, + ) + .replace(/\\/g, '/'); // ugly workaround for Windows }, // Creates a relative resource path with symbols left in (unlike // createFullPath which takes some data to replace them with). For example it // might produce: /invoices/{id} createResourcePathWithSymbols: function(pathWithSymbols) { - return '/' + path.join( - this.resourcePath, - pathWithSymbols || '' - ).replace(/\\/g, '/'); // ugly workaround for Windows + return ( + '/' + + path.join(this.resourcePath, pathWithSymbols || '').replace(/\\/g, '/') + ); // ugly workaround for Windows }, createUrlData: function() { @@ -106,12 +108,13 @@ StripeResource.prototype = { callback.call( self, new Error.StripeConnectionError({ - message: 'Request aborted due to timeout being reached (' + timeout + 'ms)', + message: + 'Request aborted due to timeout being reached (' + timeout + 'ms)', detail: timeoutErr, }), - null + null, ); - } + }; }, _responseHandler: function(req, callback) { @@ -157,8 +160,8 @@ StripeResource.prototype = { if (typeof response.error === 'string') { response.error = { type: response.error, - message: response.error_description - } + message: response.error_description, + }; } response.error.headers = headers; @@ -185,7 +188,7 @@ StripeResource.prototype = { exception: e, requestId: headers['request-id'], }), - null + null, ); } @@ -203,7 +206,12 @@ StripeResource.prototype = { }, _generateConnectionErrorMessage: function(requestRetries) { - return 'An error occurred with our connection to Stripe.' + (requestRetries > 0 ? ' Request was retried ' + requestRetries + ' times.' : ''); + return ( + 'An error occurred with our connection to Stripe.' + + (requestRetries > 0 + ? ' Request was retried ' + requestRetries + ' times.' + : '') + ); }, _errorHandler: function(req, requestRetries, callback) { @@ -219,9 +227,9 @@ StripeResource.prototype = { message: self._generateConnectionErrorMessage(requestRetries), detail: error, }), - null + null, ); - } + }; }, _shouldRetry: function(res, numRetries) { @@ -258,7 +266,7 @@ StripeResource.prototype = { // maxNetworkRetryDelay. var sleepSeconds = Math.min( initialNetworkRetryDelay * Math.pow(numRetries - 1, 2), - maxNetworkRetryDelay + maxNetworkRetryDelay, ); // Apply some jitter by randomizing the value in the range of @@ -272,7 +280,8 @@ StripeResource.prototype = { }, _defaultHeaders: function(auth, contentLength, apiVersion) { - var userAgentString = 'Stripe/v1 NodeBindings/' + this._stripe.getConstant('PACKAGE_VERSION'); + var userAgentString = + 'Stripe/v1 NodeBindings/' + this._stripe.getConstant('PACKAGE_VERSION'); if (this._stripe._appInfo) { userAgentString += ' ' + this._stripe.getAppInfoAsString(); @@ -280,10 +289,8 @@ StripeResource.prototype = { var headers = { // Use specified auth token or use default from this stripe instance: - 'Authorization': auth ? - 'Bearer ' + auth : - this._stripe.getApiField('auth'), - 'Accept': 'application/json', + Authorization: auth ? 'Bearer ' + auth : this._stripe.getApiField('auth'), + Accept: 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': contentLength, 'User-Agent': userAgentString, @@ -297,22 +304,30 @@ StripeResource.prototype = { }, _addTelemetryHeader: function(headers) { - if (this._stripe.getTelemetryEnabled() && this._stripe._prevRequestMetrics.length > 0) { + if ( + this._stripe.getTelemetryEnabled() && + this._stripe._prevRequestMetrics.length > 0 + ) { var metrics = this._stripe._prevRequestMetrics.shift(); headers['X-Stripe-Client-Telemetry'] = JSON.stringify({ - 'last_request_metrics': metrics + last_request_metrics: metrics, }); } }, _recordRequestMetrics: function(requestId, requestDurationMs) { if (this._stripe.getTelemetryEnabled() && requestId) { - if (this._stripe._prevRequestMetrics.length > StripeResource.MAX_BUFFERED_REQUEST_METRICS) { - utils.emitWarning('Request metrics buffer is full, dropping telemetry message.'); + if ( + this._stripe._prevRequestMetrics.length > + StripeResource.MAX_BUFFERED_REQUEST_METRICS + ) { + utils.emitWarning( + 'Request metrics buffer is full, dropping telemetry message.', + ); } else { this._stripe._prevRequestMetrics.push({ - 'request_id': requestId, - 'request_duration_ms': requestDurationMs, + request_id: requestId, + request_duration_ms: requestDurationMs, }); } } @@ -348,7 +363,12 @@ StripeResource.prototype = { } if (self.requestDataProcessor) { - self.requestDataProcessor(method, data, options.headers, makeRequestWithData); + self.requestDataProcessor( + method, + data, + options.headers, + makeRequestWithData, + ); } else { makeRequestWithData(null, utils.stringifyRequestData(data || {})); } @@ -361,7 +381,7 @@ StripeResource.prototype = { self._getSleepTimeInMS(requestRetries), apiVersion, headers, - requestRetries + requestRetries, ); } @@ -373,9 +393,7 @@ StripeResource.prototype = { agent = isInsecureConnection ? defaultHttpAgent : defaultHttpsAgent; } - var req = ( - isInsecureConnection ? http : https - ).request({ + var req = (isInsecureConnection ? http : https).request({ host: host || self._stripe.getApiField('host'), port: self._stripe.getApiField('port'), path: path, @@ -429,11 +447,14 @@ StripeResource.prototype = { req.on('socket', function(socket) { if (socket.connecting) { - socket.on((isInsecureConnection ? 'connect' : 'secureConnect'), function() { - // Send payload; we're safe: - req.write(requestData); - req.end(); - }); + socket.on( + isInsecureConnection ? 'connect' : 'secureConnect', + function() { + // Send payload; we're safe: + req.write(requestData); + req.end(); + }, + ); } else { // we're already connected req.write(requestData); diff --git a/lib/Webhooks.js b/lib/Webhooks.js index ecbe09e603..9bec6550c2 100644 --- a/lib/Webhooks.js +++ b/lib/Webhooks.js @@ -10,7 +10,12 @@ var Webhook = { DEFAULT_TOLERANCE: 300, // 5 minutes constructEvent: function(payload, header, secret, tolerance) { - this.signature.verifyHeader(payload, header, secret, tolerance || Webhook.DEFAULT_TOLERANCE); + this.signature.verifyHeader( + payload, + header, + secret, + tolerance || Webhook.DEFAULT_TOLERANCE, + ); var jsonPayload = JSON.parse(payload); return jsonPayload; @@ -21,7 +26,8 @@ var signature = { EXPECTED_SCHEME: 'v1', _computeSignature: function(payload, secret) { - return crypto.createHmac('sha256', secret) + return crypto + .createHmac('sha256', secret) .update(payload, 'utf8') .digest('hex'); }, @@ -52,15 +58,19 @@ var signature = { }); } - var expectedSignature = this._computeSignature(details.timestamp + '.' + payload, secret); + var expectedSignature = this._computeSignature( + details.timestamp + '.' + payload, + secret, + ); - var signatureFound = !!details.signatures - .filter(utils.secureCompare.bind(utils, expectedSignature)) - .length; + var signatureFound = !!details.signatures.filter( + utils.secureCompare.bind(utils, expectedSignature), + ).length; if (!signatureFound) { throw new Error.StripeSignatureVerificationError({ - message: 'No signatures found matching the expected signature for payload.' + + message: + 'No signatures found matching the expected signature for payload.' + ' Are you passing the raw request body you received from Stripe?' + ' https://github.com/stripe/stripe-node#webhook-signing', detail: { @@ -91,22 +101,25 @@ function parseHeader(header, scheme) { return null; } - return header.split(',').reduce(function(accum, item) { - var kv = item.split('='); - - if (kv[0] === 't') { - accum.timestamp = kv[1]; - } - - if (kv[0] === scheme) { - accum.signatures.push(kv[1]); - } - - return accum; - }, { - timestamp: -1, - signatures: [], - }); + return header.split(',').reduce( + function(accum, item) { + var kv = item.split('='); + + if (kv[0] === 't') { + accum.timestamp = kv[1]; + } + + if (kv[0] === scheme) { + accum.signatures.push(kv[1]); + } + + return accum; + }, + { + timestamp: -1, + signatures: [], + }, + ); } Webhook.signature = signature; diff --git a/lib/autoPagination.js b/lib/autoPagination.js index 2a21c416c2..e060afdf96 100644 --- a/lib/autoPagination.js +++ b/lib/autoPagination.js @@ -9,8 +9,16 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { var i = 0; function iterate(listResult) { - if (!(listResult && listResult.data && typeof listResult.data.length === 'number')) { - throw Error('Unexpected: Stripe API response does not have a well-formed `data` array.'); + if ( + !( + listResult && + listResult.data && + typeof listResult.data.length === 'number' + ) + ) { + throw Error( + 'Unexpected: Stripe API response does not have a well-formed `data` array.', + ); } if (i < listResult.data.length) { @@ -21,7 +29,9 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { // Reset counter, request next page, and recurse. i = 0; var lastId = getLastId(listResult); - listPromise = makeRequest(self, requestArgs, spec, {starting_after: lastId}); + listPromise = makeRequest(self, requestArgs, spec, { + starting_after: lastId, + }); return listPromise.then(iterate); } return {value: undefined, done: true}; @@ -51,7 +61,7 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { }, [getAsyncIteratorSymbol()]: function() { return autoPaginationMethods; - } + }, }; return autoPaginationMethods; } @@ -78,7 +88,10 @@ function getDoneCallback(args) { } var onDone = args[1]; if (typeof onDone !== 'function') { - throw Error('The second argument to autoPagingEach, if present, must be a callback function; receieved ' + typeof onDone); + throw Error( + 'The second argument to autoPagingEach, if present, must be a callback function; receieved ' + + typeof onDone, + ); } return onDone; } @@ -100,7 +113,10 @@ function getItemCallback(args) { } var onItem = args[0]; if (typeof onItem !== 'function') { - throw Error('The first argument to autoPagingEach, if present, must be a callback function; receieved ' + typeof onItem); + throw Error( + 'The first argument to autoPagingEach, if present, must be a callback function; receieved ' + + typeof onItem, + ); } // 4. `.autoPagingEach((item, next) => { doSomething(item); next(false); });` @@ -109,7 +125,10 @@ function getItemCallback(args) { } if (onItem.length > 2) { - throw Error('The `onItem` callback function passed to autoPagingEach must accept at most two arguments; got ' + onItem); + throw Error( + 'The `onItem` callback function passed to autoPagingEach must accept at most two arguments; got ' + + onItem, + ); } // This magically handles all three of these usecases (the latter two being functionally identical): @@ -127,7 +146,9 @@ function getLastId(listResult) { var lastItem = listResult.data[lastIdx]; var lastId = lastItem && lastItem.id; if (!lastId) { - throw Error('Unexpected: No `id` found on the last item while auto-paging a list.'); + throw Error( + 'Unexpected: No `id` found on the last item while auto-paging a list.', + ); } return lastId; } @@ -157,19 +178,26 @@ function makeAutoPagingEach(asyncIteratorNext) { throw Error('autoPagingEach takes up to two arguments; received:', args); } - var autoPagePromise = wrapAsyncIteratorWithCallback(asyncIteratorNext, onItem); + var autoPagePromise = wrapAsyncIteratorWithCallback( + asyncIteratorNext, + onItem, + ); return utils.callbackifyPromiseWithTimeout(autoPagePromise, onDone); - } + }; } function makeAutoPagingToArray(autoPagingEach) { return function autoPagingToArray(opts, onDone) { var limit = opts && opts.limit; if (!limit) { - throw Error('You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.'); + throw Error( + 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.', + ); } if (limit > 10000) { - throw Error('You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.'); + throw Error( + 'You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.', + ); } var promise = new Promise(function(resolve, reject) { var items = []; @@ -178,12 +206,14 @@ function makeAutoPagingToArray(autoPagingEach) { if (items.length >= limit) { return false; } - }).then(function() { - resolve(items); - }).catch(reject); + }) + .then(function() { + resolve(items); + }) + .catch(reject); }); return utils.callbackifyPromiseWithTimeout(promise, onDone); - } + }; } function wrapAsyncIteratorWithCallback(asyncIteratorNext, onItem) { @@ -209,6 +239,8 @@ function wrapAsyncIteratorWithCallback(asyncIteratorNext, onItem) { }); } - asyncIteratorNext().then(handleIteration).catch(reject); + asyncIteratorNext() + .then(handleIteration) + .catch(reject); }); } diff --git a/lib/makeRequest.js b/lib/makeRequest.js index c55ac3aaa3..9d55d90970 100644 --- a/lib/makeRequest.js +++ b/lib/makeRequest.js @@ -5,11 +5,17 @@ var OPTIONAL_REGEX = /^optional!/; function getRequestOpts(self, requestArgs, spec, overrideData) { // Extract spec values with defaults. - var commandPath = typeof spec.path == 'function' ? spec.path - : utils.makeURLInterpolator(spec.path || ''); + var commandPath = + typeof spec.path == 'function' + ? spec.path + : utils.makeURLInterpolator(spec.path || ''); var requestMethod = (spec.method || 'GET').toUpperCase(); var urlParams = spec.urlParams || []; - var encode = spec.encode || function(data) {return data;}; + var encode = + spec.encode || + function(data) { + return data; + }; var host = spec.host; // Don't mutate args externally. @@ -32,8 +38,13 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { if (param == 'id' && typeof arg !== 'string') { path = self.createResourcePathWithSymbols(spec.path); throw new Error( - 'Stripe: "id" must be a string, but got: ' + typeof arg + - ' (on API request to `' + requestMethod + ' ' + path + '`)' + 'Stripe: "id" must be a string, but got: ' + + typeof arg + + ' (on API request to `' + + requestMethod + + ' ' + + path + + '`)', ); } @@ -45,8 +56,15 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { path = self.createResourcePathWithSymbols(spec.path); throw new Error( - 'Stripe: Argument "' + urlParams[i] + '" required, but got: ' + arg + - ' (on API request to `' + requestMethod + ' ' + path + '`)' + 'Stripe: Argument "' + + urlParams[i] + + '" required, but got: ' + + arg + + ' (on API request to `' + + requestMethod + + ' ' + + path + + '`)', ); } @@ -62,9 +80,15 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { if (args.length) { path = self.createResourcePathWithSymbols(spec.path); throw new Error( - 'Stripe: Unknown arguments (' + args + '). Did you mean to pass an options ' + - 'object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.' + - ' (on API request to ' + requestMethod + ' `' + path + '`)' + 'Stripe: Unknown arguments (' + + args + + '). Did you mean to pass an options ' + + 'object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.' + + ' (on API request to ' + + requestMethod + + ' `' + + path + + '`)', ); } @@ -99,14 +123,22 @@ function makeRequest(self, requestArgs, spec, overrideData) { reject(err); } else { resolve( - spec.transformResponseData ? - spec.transformResponseData(response) : - response + spec.transformResponseData + ? spec.transformResponseData(response) + : response, ); } } - self._request(opts.requestMethod, opts.host, opts.requestPath, opts.data, opts.auth, {headers: opts.headers}, requestCallback); + self._request( + opts.requestMethod, + opts.host, + opts.requestPath, + opts.data, + opts.auth, + {headers: opts.headers}, + requestCallback, + ); }); } diff --git a/lib/resources/AccountLinks.js b/lib/resources/AccountLinks.js index 33bd4a2940..d3ce047afd 100644 --- a/lib/resources/AccountLinks.js +++ b/lib/resources/AccountLinks.js @@ -4,4 +4,3 @@ module.exports = require('../StripeResource').extend({ path: 'account_links', includeBasic: ['create'], }); - diff --git a/lib/resources/Accounts.js b/lib/resources/Accounts.js index 2dfd46d571..7e8b4b8781 100644 --- a/lib/resources/Accounts.js +++ b/lib/resources/Accounts.js @@ -93,8 +93,8 @@ module.exports = StripeResource.extend({ }), /** - * Accounts: LoginLink methods - */ + * Accounts: LoginLink methods + */ createLoginLink: stripeMethod({ method: 'POST', diff --git a/lib/resources/ApplicationFees.js b/lib/resources/ApplicationFees.js index 0e96e4ed65..ec41ed3171 100644 --- a/lib/resources/ApplicationFees.js +++ b/lib/resources/ApplicationFees.js @@ -4,12 +4,9 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'application_fees', - includeBasic: [ - 'list', 'retrieve', - ], + includeBasic: ['list', 'retrieve'], refund: stripeMethod({ method: 'POST', diff --git a/lib/resources/Balance.js b/lib/resources/Balance.js index a6c5f1655c..7e8adb9116 100644 --- a/lib/resources/Balance.js +++ b/lib/resources/Balance.js @@ -4,7 +4,6 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'balance', retrieve: stripeMethod({ @@ -22,5 +21,4 @@ module.exports = StripeResource.extend({ path: 'history/{transactionId}', urlParams: ['transactionId'], }), - }); diff --git a/lib/resources/BitcoinReceivers.js b/lib/resources/BitcoinReceivers.js index 430db040ed..600e7ed7b4 100644 --- a/lib/resources/BitcoinReceivers.js +++ b/lib/resources/BitcoinReceivers.js @@ -4,12 +4,9 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'bitcoin/receivers', - includeBasic: [ - 'list', 'retrieve', 'getMetadata', - ], + includeBasic: ['list', 'retrieve', 'getMetadata'], listTransactions: stripeMethod({ method: 'GET', diff --git a/lib/resources/Charges.js b/lib/resources/Charges.js index 28a0798aeb..ebcfeb1fb0 100644 --- a/lib/resources/Charges.js +++ b/lib/resources/Charges.js @@ -4,12 +4,15 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'charges', includeBasic: [ - 'create', 'list', 'retrieve', 'update', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', ], capture: stripeMethod({ @@ -66,10 +69,10 @@ module.exports = StripeResource.extend({ }), markAsSafe: function(chargeId) { - return this.update(chargeId, {'fraud_details': {'user_report': 'safe'}}) + return this.update(chargeId, {fraud_details: {user_report: 'safe'}}); }, markAsFraudulent: function(chargeId) { - return this.update(chargeId, {'fraud_details': {'user_report': 'fraudulent'}}) + return this.update(chargeId, {fraud_details: {user_report: 'fraudulent'}}); }, }); diff --git a/lib/resources/Checkout/Sessions.js b/lib/resources/Checkout/Sessions.js index 3accef7cc0..936377c45a 100644 --- a/lib/resources/Checkout/Sessions.js +++ b/lib/resources/Checkout/Sessions.js @@ -5,4 +5,4 @@ var StripeResource = require('../../StripeResource'); module.exports = StripeResource.extend({ path: 'checkout/sessions', includeBasic: ['create', 'retrieve'], -}) +}); diff --git a/lib/resources/CountrySpecs.js b/lib/resources/CountrySpecs.js index 25210ac31a..690b77cd12 100644 --- a/lib/resources/CountrySpecs.js +++ b/lib/resources/CountrySpecs.js @@ -3,10 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'country_specs', - includeBasic: [ - 'list', 'retrieve', - ], + includeBasic: ['list', 'retrieve'], }); diff --git a/lib/resources/Coupons.js b/lib/resources/Coupons.js index a9f519afa3..89c9191a91 100644 --- a/lib/resources/Coupons.js +++ b/lib/resources/Coupons.js @@ -4,4 +4,3 @@ module.exports = require('../StripeResource').extend({ path: 'coupons', includeBasic: ['create', 'list', 'update', 'retrieve', 'del'], }); - diff --git a/lib/resources/CreditNotes.js b/lib/resources/CreditNotes.js index 24df5aca90..6043c04b41 100644 --- a/lib/resources/CreditNotes.js +++ b/lib/resources/CreditNotes.js @@ -4,7 +4,6 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'credit_notes', includeBasic: ['create', 'list', 'retrieve', 'update'], diff --git a/lib/resources/Customers.js b/lib/resources/Customers.js index 6a182612ad..cdfa6e9e04 100644 --- a/lib/resources/Customers.js +++ b/lib/resources/Customers.js @@ -5,11 +5,15 @@ var utils = require('../utils'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'customers', includeBasic: [ - 'create', 'list', 'retrieve', 'update', 'del', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'del', + 'setMetadata', + 'getMetadata', ], /** diff --git a/lib/resources/Disputes.js b/lib/resources/Disputes.js index eff2aba687..4a60c73eab 100644 --- a/lib/resources/Disputes.js +++ b/lib/resources/Disputes.js @@ -4,18 +4,13 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'disputes', - includeBasic: [ - 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata', - ], + includeBasic: ['list', 'retrieve', 'update', 'setMetadata', 'getMetadata'], close: stripeMethod({ method: 'POST', path: '/{id}/close', urlParams: ['id'], }), - }); - diff --git a/lib/resources/EphemeralKeys.js b/lib/resources/EphemeralKeys.js index 2be6f9c9d5..002cce7ec4 100644 --- a/lib/resources/EphemeralKeys.js +++ b/lib/resources/EphemeralKeys.js @@ -8,7 +8,9 @@ module.exports = StripeResource.extend({ method: 'POST', validator: function(data, options) { if (!options.headers || !options.headers['Stripe-Version']) { - throw new Error('stripe_version must be specified to create an ephemeral key'); + throw new Error( + 'stripe_version must be specified to create an ephemeral key', + ); } }, }), diff --git a/lib/resources/Events.js b/lib/resources/Events.js index ae4f092432..8de01785c6 100644 --- a/lib/resources/Events.js +++ b/lib/resources/Events.js @@ -4,4 +4,3 @@ module.exports = require('../StripeResource').extend({ path: 'events', includeBasic: ['list', 'retrieve'], }); - diff --git a/lib/resources/ExchangeRates.js b/lib/resources/ExchangeRates.js index a7d3b10853..b97e82eae8 100644 --- a/lib/resources/ExchangeRates.js +++ b/lib/resources/ExchangeRates.js @@ -3,10 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'exchange_rates', - includeBasic: [ - 'list', 'retrieve', - ], + includeBasic: ['list', 'retrieve'], }); diff --git a/lib/resources/FileLinks.js b/lib/resources/FileLinks.js index 8052fc7f02..a07235a5a5 100644 --- a/lib/resources/FileLinks.js +++ b/lib/resources/FileLinks.js @@ -3,9 +3,13 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'file_links', includeBasic: [ - 'create', 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', ], }); diff --git a/lib/resources/Files.js b/lib/resources/Files.js index 0315d3092d..8e8f850b37 100644 --- a/lib/resources/Files.js +++ b/lib/resources/Files.js @@ -8,7 +8,6 @@ var multipartDataGenerator = require('../MultipartDataGenerator'); var Error = require('../Error'); module.exports = StripeResource.extend({ - requestDataProcessor: function(method, data, headers, callback) { data = data || {}; @@ -28,19 +27,22 @@ module.exports = StripeResource.extend({ } } - function streamProcessor (fn) { + function streamProcessor(fn) { var bufferArray = []; - data.file.data.on('data', function(line) { - bufferArray.push(line); - }).on('end', function() { - var bufferData = Object.assign({}, data); - bufferData.file.data = Buffer.concat(bufferArray); - var buffer = fn(method, bufferData, headers); - callback(null, buffer); - }).on('error', function(err) { - var errorHandler = streamError(callback); - errorHandler(err); - }); + data.file.data + .on('data', function(line) { + bufferArray.push(line); + }) + .on('end', function() { + var bufferData = Object.assign({}, data); + bufferData.file.data = Buffer.concat(bufferArray); + var buffer = fn(method, bufferData, headers); + callback(null, buffer); + }) + .on('error', function(err) { + var errorHandler = streamError(callback); + errorHandler(err); + }); } function streamError(callback) { @@ -50,17 +52,18 @@ module.exports = StripeResource.extend({ this.type = this.type; this.message = raw.message; this.detail = raw.detail; - } + }, }); return function(error) { callback( new StreamProcessingError({ - message: 'An error occurred while attempting to process the file for upload.', + message: + 'An error occurred while attempting to process the file for upload.', detail: error, }), - null + null, ); - } + }; } }, diff --git a/lib/resources/InvoiceItems.js b/lib/resources/InvoiceItems.js index 00af738ed5..38739d2b7e 100644 --- a/lib/resources/InvoiceItems.js +++ b/lib/resources/InvoiceItems.js @@ -3,8 +3,12 @@ module.exports = require('../StripeResource').extend({ path: 'invoiceitems', includeBasic: [ - 'create', 'list', 'retrieve', 'update', 'del', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'del', + 'setMetadata', + 'getMetadata', ], }); - diff --git a/lib/resources/Invoices.js b/lib/resources/Invoices.js index cac74797ce..a6e21c7f8b 100644 --- a/lib/resources/Invoices.js +++ b/lib/resources/Invoices.js @@ -5,7 +5,6 @@ var stripeMethod = StripeResource.method; var utils = require('../utils'); module.exports = StripeResource.extend({ - path: 'invoices', includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], @@ -40,25 +39,51 @@ module.exports = StripeResource.extend({ var hasParam = false; // If you pass just a hash with the relevant parameters, including customer id inside. - if (urlData.invoiceOptionsOrCustomerId && typeof urlData.invoiceOptionsOrCustomerId === 'object') { - return url + utils.stringifyRequestData(urlData.invoiceOptionsOrCustomerId); + if ( + urlData.invoiceOptionsOrCustomerId && + typeof urlData.invoiceOptionsOrCustomerId === 'object' + ) { + return ( + url + utils.stringifyRequestData(urlData.invoiceOptionsOrCustomerId) + ); } // Legacy implementation where the first parameter is a customer id as a string - if (urlData.invoiceOptionsOrCustomerId && typeof urlData.invoiceOptionsOrCustomerId === 'string') { + if ( + urlData.invoiceOptionsOrCustomerId && + typeof urlData.invoiceOptionsOrCustomerId === 'string' + ) { url = url + 'customer=' + urlData.invoiceOptionsOrCustomerId; hasParam = true; } // Legacy support where second argument is the subscription id - if (urlData.invoiceOptionsOrSubscriptionId && typeof urlData.invoiceOptionsOrSubscriptionId === 'string') { - return url + (hasParam ? '&' : '') + 'subscription=' + urlData.invoiceOptionsOrSubscriptionId; - } else if (urlData.invoiceOptionsOrSubscriptionId && typeof urlData.invoiceOptionsOrSubscriptionId === 'object') { - return url + (hasParam ? '&' : '') + utils.stringifyRequestData(urlData.invoiceOptionsOrSubscriptionId); + if ( + urlData.invoiceOptionsOrSubscriptionId && + typeof urlData.invoiceOptionsOrSubscriptionId === 'string' + ) { + return ( + url + + (hasParam ? '&' : '') + + 'subscription=' + + urlData.invoiceOptionsOrSubscriptionId + ); + } else if ( + urlData.invoiceOptionsOrSubscriptionId && + typeof urlData.invoiceOptionsOrSubscriptionId === 'object' + ) { + return ( + url + + (hasParam ? '&' : '') + + utils.stringifyRequestData(urlData.invoiceOptionsOrSubscriptionId) + ); } return url; }, - urlParams: ['optional!invoiceOptionsOrCustomerId', 'optional!invoiceOptionsOrSubscriptionId'], + urlParams: [ + 'optional!invoiceOptionsOrCustomerId', + 'optional!invoiceOptionsOrSubscriptionId', + ], }), sendInvoice: stripeMethod({ diff --git a/lib/resources/Issuing/Cardholders.js b/lib/resources/Issuing/Cardholders.js index e8a175e918..0e6e5a8bfe 100644 --- a/lib/resources/Issuing/Cardholders.js +++ b/lib/resources/Issuing/Cardholders.js @@ -4,5 +4,12 @@ var StripeResource = require('../../StripeResource'); module.exports = StripeResource.extend({ path: 'issuing/cardholders', - includeBasic: ['create', 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata'], + includeBasic: [ + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', + ], }); diff --git a/lib/resources/Issuing/Cards.js b/lib/resources/Issuing/Cards.js index 99199642e8..5f5664b88f 100644 --- a/lib/resources/Issuing/Cards.js +++ b/lib/resources/Issuing/Cards.js @@ -6,7 +6,14 @@ var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ path: 'issuing/cards', - includeBasic: ['create', 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata'], + includeBasic: [ + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', + ], retrieveDetails: stripeMethod({ method: 'GET', diff --git a/lib/resources/Issuing/Disputes.js b/lib/resources/Issuing/Disputes.js index 296fa779f7..096ba8eb43 100644 --- a/lib/resources/Issuing/Disputes.js +++ b/lib/resources/Issuing/Disputes.js @@ -4,5 +4,12 @@ var StripeResource = require('../../StripeResource'); module.exports = StripeResource.extend({ path: 'issuing/disputes', - includeBasic: ['create', 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata'], + includeBasic: [ + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', + ], }); diff --git a/lib/resources/OAuth.js b/lib/resources/OAuth.js index 1649599119..7258b8c371 100644 --- a/lib/resources/OAuth.js +++ b/lib/resources/OAuth.js @@ -32,7 +32,14 @@ module.exports = StripeResource.extend({ params.scope = 'read_write'; } - return 'https://' + oAuthHost + '/' + path + '?' + utils.stringifyRequestData(params); + return ( + 'https://' + + oAuthHost + + '/' + + path + + '?' + + utils.stringifyRequestData(params) + ); }, token: stripeMethod({ diff --git a/lib/resources/OrderReturns.js b/lib/resources/OrderReturns.js index 777821a682..b0e1be62e3 100644 --- a/lib/resources/OrderReturns.js +++ b/lib/resources/OrderReturns.js @@ -3,10 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'order_returns', - includeBasic: [ - 'list', 'retrieve', - ], + includeBasic: ['list', 'retrieve'], }); diff --git a/lib/resources/Orders.js b/lib/resources/Orders.js index 0e32b3fdca..58e420ec3e 100644 --- a/lib/resources/Orders.js +++ b/lib/resources/Orders.js @@ -4,12 +4,9 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'orders', - includeBasic: [ - 'create', 'list', 'retrieve', 'update', - ], + includeBasic: ['create', 'list', 'retrieve', 'update'], pay: stripeMethod({ method: 'POST', @@ -22,5 +19,4 @@ module.exports = StripeResource.extend({ path: '/{orderId}/returns', urlParams: ['orderId'], }), - }); diff --git a/lib/resources/PaymentIntents.js b/lib/resources/PaymentIntents.js index fae0950b27..70a90ab5d0 100644 --- a/lib/resources/PaymentIntents.js +++ b/lib/resources/PaymentIntents.js @@ -25,4 +25,3 @@ module.exports = StripeResource.extend({ urlParams: ['paymentIntentId'], }), }); - diff --git a/lib/resources/PaymentMethods.js b/lib/resources/PaymentMethods.js index 54f3c829c5..4b8601aa25 100644 --- a/lib/resources/PaymentMethods.js +++ b/lib/resources/PaymentMethods.js @@ -4,7 +4,6 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_methods', includeBasic: ['create', 'list', 'retrieve', 'update'], diff --git a/lib/resources/Payouts.js b/lib/resources/Payouts.js index 433b5b04ae..ec1d8afd35 100644 --- a/lib/resources/Payouts.js +++ b/lib/resources/Payouts.js @@ -4,12 +4,15 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payouts', includeBasic: [ - 'create', 'list', 'retrieve', 'update', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', ], cancel: stripeMethod({ @@ -25,4 +28,3 @@ module.exports = StripeResource.extend({ methodType: 'list', }), }); - diff --git a/lib/resources/Persons.js b/lib/resources/Persons.js index 605bd24b48..6429dd0d26 100644 --- a/lib/resources/Persons.js +++ b/lib/resources/Persons.js @@ -18,4 +18,3 @@ module.exports = StripeResource.extend({ path: 'accounts/{accountId}/persons', includeBasic: ['create', 'del', 'list', 'retrieve', 'update'], }); - diff --git a/lib/resources/Plans.js b/lib/resources/Plans.js index a7d01bae8a..0373839c82 100644 --- a/lib/resources/Plans.js +++ b/lib/resources/Plans.js @@ -4,4 +4,3 @@ module.exports = require('../StripeResource').extend({ path: 'plans', includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], }); - diff --git a/lib/resources/Products.js b/lib/resources/Products.js index d8bcedef5c..6188963d58 100644 --- a/lib/resources/Products.js +++ b/lib/resources/Products.js @@ -3,11 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'products', - includeBasic: [ - 'create', 'list', 'retrieve', 'update', 'del', - ], - + includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], }); diff --git a/lib/resources/Recipients.js b/lib/resources/Recipients.js index 536e98f730..9fce05a6b2 100644 --- a/lib/resources/Recipients.js +++ b/lib/resources/Recipients.js @@ -4,11 +4,15 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'recipients', includeBasic: [ - 'create', 'list', 'retrieve', 'update', 'del', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'del', + 'setMetadata', + 'getMetadata', ], createCard: stripeMethod({ @@ -41,6 +45,4 @@ module.exports = StripeResource.extend({ path: '/{recipientId}/cards/{cardId}', urlParams: ['recipientId', 'cardId'], }), - }); - diff --git a/lib/resources/Refunds.js b/lib/resources/Refunds.js index e4e70c1eb4..a1351a27d2 100644 --- a/lib/resources/Refunds.js +++ b/lib/resources/Refunds.js @@ -3,11 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'refunds', - includeBasic: [ - 'create', 'list', 'retrieve', 'update', - ], + includeBasic: ['create', 'list', 'retrieve', 'update'], }); - diff --git a/lib/resources/Reviews.js b/lib/resources/Reviews.js index 9eeb7f413e..6d3fb2c4f1 100644 --- a/lib/resources/Reviews.js +++ b/lib/resources/Reviews.js @@ -4,7 +4,6 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reviews', includeBasic: ['list', 'retrieve'], @@ -15,4 +14,3 @@ module.exports = StripeResource.extend({ urlParams: ['id'], }), }); - diff --git a/lib/resources/SKUs.js b/lib/resources/SKUs.js index 0364ed4ed2..18aefab236 100644 --- a/lib/resources/SKUs.js +++ b/lib/resources/SKUs.js @@ -3,11 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: 'skus', - includeBasic: [ - 'create', 'list', 'retrieve', 'update', 'del', - ], - + includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], }); diff --git a/lib/resources/Sources.js b/lib/resources/Sources.js index 255896dd38..d0e103509e 100644 --- a/lib/resources/Sources.js +++ b/lib/resources/Sources.js @@ -4,12 +4,9 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'sources', - includeBasic: [ - 'create', 'retrieve', 'update', 'setMetadata', 'getMetadata', - ], + includeBasic: ['create', 'retrieve', 'update', 'setMetadata', 'getMetadata'], listSourceTransactions: stripeMethod({ method: 'GET', @@ -23,5 +20,4 @@ module.exports = StripeResource.extend({ path: '/{id}/verify', urlParams: ['id'], }), - }); diff --git a/lib/resources/SubscriptionItems.js b/lib/resources/SubscriptionItems.js index ea6e8e006e..c6f325ecae 100644 --- a/lib/resources/SubscriptionItems.js +++ b/lib/resources/SubscriptionItems.js @@ -4,6 +4,5 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ path: 'subscription_items', - includeBasic: ['create', 'list', 'retrieve', 'update', 'del',], + includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], }); - diff --git a/lib/resources/SubscriptionScheduleRevisions.js b/lib/resources/SubscriptionScheduleRevisions.js index c230e37379..591f64fc62 100644 --- a/lib/resources/SubscriptionScheduleRevisions.js +++ b/lib/resources/SubscriptionScheduleRevisions.js @@ -16,5 +16,5 @@ var StripeResource = require('../StripeResource'); */ module.exports = StripeResource.extend({ path: 'subscription_schedules/{scheduleId}/revisions', - includeBasic: ['list', 'retrieve',], + includeBasic: ['list', 'retrieve'], }); diff --git a/lib/resources/SubscriptionSchedules.js b/lib/resources/SubscriptionSchedules.js index 0f838bdbb1..6045fd093f 100644 --- a/lib/resources/SubscriptionSchedules.js +++ b/lib/resources/SubscriptionSchedules.js @@ -4,12 +4,15 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscription_schedules', includeBasic: [ - 'create', 'list', 'retrieve', 'update', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', ], release: stripeMethod({ diff --git a/lib/resources/Subscriptions.js b/lib/resources/Subscriptions.js index a014c5d85a..6006a4ad62 100644 --- a/lib/resources/Subscriptions.js +++ b/lib/resources/Subscriptions.js @@ -4,9 +4,8 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscriptions', - includeBasic: ['create', 'list', 'retrieve', 'update', 'del',], + includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], /** * Subscription: Discount methods diff --git a/lib/resources/TaxRates.js b/lib/resources/TaxRates.js index 7bea8e7f33..a6adcb8672 100644 --- a/lib/resources/TaxRates.js +++ b/lib/resources/TaxRates.js @@ -4,4 +4,3 @@ module.exports = require('../StripeResource').extend({ path: 'tax_rates', includeBasic: ['create', 'list', 'update', 'retrieve'], }); - diff --git a/lib/resources/Terminal/ConnectionTokens.js b/lib/resources/Terminal/ConnectionTokens.js index a7c4d68f3b..3b52fc93d1 100644 --- a/lib/resources/Terminal/ConnectionTokens.js +++ b/lib/resources/Terminal/ConnectionTokens.js @@ -5,4 +5,4 @@ var StripeResource = require('../../StripeResource'); module.exports = StripeResource.extend({ path: 'terminal/connection_tokens', includeBasic: ['create'], -}) +}); diff --git a/lib/resources/Terminal/Locations.js b/lib/resources/Terminal/Locations.js index 0f2dccaf03..9cb9eca0e0 100644 --- a/lib/resources/Terminal/Locations.js +++ b/lib/resources/Terminal/Locations.js @@ -5,4 +5,4 @@ var StripeResource = require('../../StripeResource'); module.exports = StripeResource.extend({ path: 'terminal/locations', includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], -}) +}); diff --git a/lib/resources/Terminal/Readers.js b/lib/resources/Terminal/Readers.js index a4b2322a4e..661722af0b 100644 --- a/lib/resources/Terminal/Readers.js +++ b/lib/resources/Terminal/Readers.js @@ -5,4 +5,4 @@ var StripeResource = require('../../StripeResource'); module.exports = StripeResource.extend({ path: 'terminal/readers', includeBasic: ['create', 'list', 'retrieve', 'update', 'del'], -}) +}); diff --git a/lib/resources/ThreeDSecure.js b/lib/resources/ThreeDSecure.js index 52a49e579b..5756019b49 100644 --- a/lib/resources/ThreeDSecure.js +++ b/lib/resources/ThreeDSecure.js @@ -3,11 +3,7 @@ var StripeResource = require('../StripeResource'); module.exports = StripeResource.extend({ - path: '3d_secure', - includeBasic: [ - 'create', - 'retrieve', - ], + includeBasic: ['create', 'retrieve'], }); diff --git a/lib/resources/Topups.js b/lib/resources/Topups.js index 72875168ba..bdbf04a9e1 100644 --- a/lib/resources/Topups.js +++ b/lib/resources/Topups.js @@ -5,7 +5,14 @@ var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ path: 'topups', - includeBasic: ['create', 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata'], + includeBasic: [ + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', + ], cancel: stripeMethod({ method: 'POST', diff --git a/lib/resources/TransferReversals.js b/lib/resources/TransferReversals.js index a73081f12d..6794fde77f 100644 --- a/lib/resources/TransferReversals.js +++ b/lib/resources/TransferReversals.js @@ -18,4 +18,3 @@ module.exports = StripeResource.extend({ path: 'transfers/{transferId}/reversals', includeBasic: ['create', 'list', 'retrieve', 'update'], }); - diff --git a/lib/resources/Transfers.js b/lib/resources/Transfers.js index f93a20f684..36a210b9c8 100644 --- a/lib/resources/Transfers.js +++ b/lib/resources/Transfers.js @@ -4,12 +4,15 @@ var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'transfers', includeBasic: [ - 'create', 'list', 'retrieve', 'update', - 'setMetadata', 'getMetadata', + 'create', + 'list', + 'retrieve', + 'update', + 'setMetadata', + 'getMetadata', ], reverse: stripeMethod({ @@ -59,4 +62,3 @@ module.exports = StripeResource.extend({ urlParams: ['transferId', 'reversalId'], }), }); - diff --git a/lib/resources/WebhookEndpoints.js b/lib/resources/WebhookEndpoints.js index 149d4cd888..be8656069e 100644 --- a/lib/resources/WebhookEndpoints.js +++ b/lib/resources/WebhookEndpoints.js @@ -4,4 +4,3 @@ module.exports = require('../StripeResource').extend({ path: 'webhook_endpoints', includeBasic: ['create', 'list', 'update', 'retrieve', 'del'], }); - diff --git a/lib/stripe.js b/lib/stripe.js index 70a741a431..4b98b5cb1d 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -194,17 +194,14 @@ Stripe.prototype = { setApiKey: function(key) { if (key) { - this._setApiField( - 'auth', - 'Bearer ' + key - ); + this._setApiField('auth', 'Bearer ' + key); } }, setTimeout: function(timeout) { this._setApiField( 'timeout', - timeout == null ? Stripe.DEFAULT_TIMEOUT : timeout + timeout == null ? Stripe.DEFAULT_TIMEOUT : timeout, ); }, @@ -264,7 +261,10 @@ Stripe.prototype = { }, setMaxNetworkRetries: function(maxNetworkRetries) { - if ((maxNetworkRetries && typeof maxNetworkRetries !== 'number') || arguments.length < 1) { + if ( + (maxNetworkRetries && typeof maxNetworkRetries !== 'number') || + arguments.length < 1 + ) { throw new Error('maxNetworkRetries must be a number.'); } @@ -288,7 +288,7 @@ Stripe.prototype = { this.getClientUserAgentSeeded(Stripe.USER_AGENT, function(cua) { Stripe.USER_AGENT_SERIALIZED = cua; cb(Stripe.USER_AGENT_SERIALIZED); - }) + }); }, // Gets a JSON version of a User-Agent by encoding a seeded object and @@ -309,7 +309,7 @@ Stripe.prototype = { userAgent.application = self._appInfo; } - cb(JSON.stringify(userAgent)) + cb(JSON.stringify(userAgent)); }); }, diff --git a/lib/utils.js b/lib/utils.js index d74ea0f432..a439678b84 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -9,18 +9,25 @@ var crypto = require('crypto'); var hasOwn = {}.hasOwnProperty; var isPlainObject = require('lodash.isplainobject'); -var OPTIONS_KEYS = ['api_key', 'idempotency_key', 'stripe_account', 'stripe_version']; - -var utils = module.exports = { - +var OPTIONS_KEYS = [ + 'api_key', + 'idempotency_key', + 'stripe_account', + 'stripe_version', +]; + +var utils = (module.exports = { isAuthKey: function(key) { return typeof key == 'string' && /^(?:[a-z]{2}_)?[A-z0-9]{32}$/.test(key); }, isOptionsHash: function(o) { - return isPlainObject(o) && OPTIONS_KEYS.some(function(key) { - return hasOwn.call(o, key); - }); + return ( + isPlainObject(o) && + OPTIONS_KEYS.some(function(key) { + return hasOwn.call(o, key); + }) + ); }, /** @@ -28,11 +35,19 @@ var utils = module.exports = { * (forming the conventional key 'parent[child]=value') */ stringifyRequestData: function(data) { - return qs.stringify(data, {serializeDate: function (d) { return Math.floor(d.getTime() / 1000); }}) - // Don't use strict form encoding by changing the square bracket control - // characters back to their literals. This is fine by the server, and - // makes these parameter strings easier to read. - .replace(/%5B/g, '[').replace(/%5D/g, ']'); + return ( + qs + .stringify(data, { + serializeDate: function(d) { + return Math.floor(d.getTime() / 1000); + }, + }) + // Don't use strict form encoding by changing the square bracket control + // characters back to their literals. This is fine by the server, and + // makes these parameter strings easier to read. + .replace(/%5B/g, '[') + .replace(/%5D/g, ']') + ); }, /** @@ -43,8 +58,10 @@ var utils = module.exports = { */ makeURLInterpolator: (function() { var rc = { - '\n': '\\n', '\"': '\\\"', - '\u2028': '\\u2028', '\u2029': '\\u2029', + '\n': '\\n', + '"': '\\"', + '\u2028': '\\u2028', + '\u2029': '\\u2029', }; return function makeURLInterpolator(str) { var cleanString = str.replace(/["\n\r\u2028\u2029]/g, function($0) { @@ -56,7 +73,7 @@ var utils = module.exports = { }); }; }; - }()), + })(), /** * Return the data argument from a list of arguments @@ -80,10 +97,15 @@ var utils = module.exports = { // Here we're detecting a case where there are two distinct arguments // (the first being args and the second options) and with known // option keys in the first so that we can warn the user about it. - if (optionKeysInArgs.length > 0 && optionKeysInArgs.length !== argKeys.length) { + if ( + optionKeysInArgs.length > 0 && + optionKeysInArgs.length !== argKeys.length + ) { emitWarning( - 'Options found in arguments (' + optionKeysInArgs.join(', ') + '). Did you mean to pass an options ' + - 'object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.' + 'Options found in arguments (' + + optionKeysInArgs.join(', ') + + '). Did you mean to pass an options ' + + 'object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.', ); } @@ -110,7 +132,9 @@ var utils = module.exports = { }); if (extraKeys.length) { - emitWarning('Invalid options found (' + extraKeys.join(', ') + '); ignoring.'); + emitWarning( + 'Invalid options found (' + extraKeys.join(', ') + '); ignoring.', + ); } if (params.api_key) { @@ -135,9 +159,11 @@ var utils = module.exports = { */ protoExtend: function(sub) { var Super = this; - var Constructor = hasOwn.call(sub, 'constructor') ? sub.constructor : function() { - Super.apply(this, arguments); - }; + var Constructor = hasOwn.call(sub, 'constructor') + ? sub.constructor + : function() { + Super.apply(this, arguments); + }; // This initialization logic is somewhat sensitive to be compatible with // divergent JS implementations like the one found in Qt. See here for more @@ -152,8 +178,8 @@ var utils = module.exports = { }, /** - * Secure compare, from https://github.com/freewil/scmp - */ + * Secure compare, from https://github.com/freewil/scmp + */ secureCompare: function(a, b) { a = Buffer.from(a); b = Buffer.from(b); @@ -180,8 +206,8 @@ var utils = module.exports = { }, /** - * Remove empty values from an object - */ + * Remove empty values from an object + */ removeEmpty: function(obj) { if (typeof obj !== 'object') { throw new Error('Argument must be an object'); @@ -197,10 +223,10 @@ var utils = module.exports = { }, /** - * Determine if file data is a derivative of EventEmitter class. - * https://nodejs.org/api/events.html#events_events - */ - checkForStream: function (obj) { + * Determine if file data is a derivative of EventEmitter class. + * https://nodejs.org/api/events.html#events_events + */ + checkForStream: function(obj) { if (obj.file && obj.file.data) { return obj.file.data instanceof EventEmitter; } @@ -210,11 +236,18 @@ var utils = module.exports = { callbackifyPromiseWithTimeout: function(promise, callback) { if (callback) { // Ensure callback is called outside of promise stack. - return promise.then(function(res) { - setTimeout(function() { callback(null, res) }, 0); - }, function(err) { - setTimeout(function() { callback(err, null); }, 0); - }); + return promise.then( + function(res) { + setTimeout(function() { + callback(null, res); + }, 0); + }, + function(err) { + setTimeout(function() { + callback(err, null); + }, 0); + }, + ); } return promise; @@ -261,7 +294,7 @@ var utils = module.exports = { var result = {}; function step(obj, prevKey) { - Object.keys(obj).forEach(function (key) { + Object.keys(obj).forEach(function(key) { var value = obj[key]; var newKey = prevKey ? `${prevKey}[${key}]` : key; @@ -278,18 +311,20 @@ var utils = module.exports = { // Primitives are converted to strings result[newKey] = String(value); } - }) + }); } step(data); return result; }, -}; +}); function emitWarning(warning) { if (typeof process.emitWarning !== 'function') { - return console.warn('Stripe: ' + warning); /* eslint-disable-line no-console */ + return console.warn( + 'Stripe: ' + warning, + ); /* eslint-disable-line no-console */ } return process.emitWarning(warning, 'Stripe'); diff --git a/test/Error.spec.js b/test/Error.spec.js index ff8f649eff..872d2deef3 100644 --- a/test/Error.spec.js +++ b/test/Error.spec.js @@ -15,22 +15,34 @@ describe('Error', function() { describe('StripeError', function() { it('Generates specific instance depending on error-type', function() { - expect(Error.StripeError.generate({type: 'card_error'})).to.be.instanceOf(Error.StripeCardError); - expect(Error.StripeError.generate({type: 'invalid_request_error'})).to.be.instanceOf( - Error.StripeInvalidRequestError + expect(Error.StripeError.generate({type: 'card_error'})).to.be.instanceOf( + Error.StripeCardError, ); - expect(Error.StripeError.generate({type: 'api_error'})).to.be.instanceOf(Error.StripeAPIError); - expect(Error.StripeError.generate({type: 'idempotency_error'})).to.be.instanceOf(Error.StripeIdempotencyError); + expect( + Error.StripeError.generate({type: 'invalid_request_error'}), + ).to.be.instanceOf(Error.StripeInvalidRequestError); + expect(Error.StripeError.generate({type: 'api_error'})).to.be.instanceOf( + Error.StripeAPIError, + ); + expect( + Error.StripeError.generate({type: 'idempotency_error'}), + ).to.be.instanceOf(Error.StripeIdempotencyError); }); it('Pulls in headers', function() { var headers = {'Request-Id': '123'}; - var e = Error.StripeError.generate({type: 'card_error', headers: headers}); + var e = Error.StripeError.generate({ + type: 'card_error', + headers: headers, + }); expect(e).to.have.property('headers', headers); }); it('Pulls in request IDs', function() { - var e = Error.StripeError.generate({type: 'card_error', requestId: 'foo'}); + var e = Error.StripeError.generate({ + type: 'card_error', + requestId: 'foo', + }); expect(e).to.have.property('requestId', 'foo'); }); diff --git a/test/StripeResource.spec.js b/test/StripeResource.spec.js index 7b19d898a5..c902cac18f 100644 --- a/test/StripeResource.spec.js +++ b/test/StripeResource.spec.js @@ -23,7 +23,11 @@ describe('StripeResource', function() { expect(headers.Authorization).to.equal('Bearer fakeAuthToken'); }); it('sets the Authorization header with Bearer auth using the specified API key', function() { - var headers = stripe.invoices._defaultHeaders('anotherFakeAuthToken', 0, null); + var headers = stripe.invoices._defaultHeaders( + 'anotherFakeAuthToken', + 0, + null, + ); expect(headers.Authorization).to.equal('Bearer anotherFakeAuthToken'); }); it('sets the Stripe-Version header if an API version is provided', function() { @@ -42,7 +46,7 @@ describe('StripeResource', function() { after(function() { nock.cleanAll(); - }) + }); describe('_request', function() { it('encodes the query string in GET requests', function(done) { @@ -62,7 +66,10 @@ describe('StripeResource', function() { .query(Object.assign({customer: 'cus_123'}, options.data)) .reply(200, '{}'); - realStripe.invoices.retrieveUpcoming('cus_123', options.data, function(err, response) { + realStripe.invoices.retrieveUpcoming('cus_123', options.data, function( + err, + response, + ) { done(); scope.done(); }); @@ -74,19 +81,20 @@ describe('StripeResource', function() { path: '/v1/subscriptions/sub_123', data: { customer: 'cus_123', - items: [ - {plan: 'foo', quantity: 2}, - {id: 'si_123', deleted: true}, - ], + items: [{plan: 'foo', quantity: 2}, {id: 'si_123', deleted: true}], }, - body: 'customer=cus_123&items[0][plan]=foo&items[0][quantity]=2&items[1][id]=si_123&items[1][deleted]=true', + body: + 'customer=cus_123&items[0][plan]=foo&items[0][quantity]=2&items[1][id]=si_123&items[1][deleted]=true', }; const scope = nock('https://' + options.host) .post(options.path, options.body) .reply(200, '{}'); - realStripe.subscriptions.update('sub_123', options.data, function(err, response) { + realStripe.subscriptions.update('sub_123', options.data, function( + err, + response, + ) { done(); scope.done(); }); @@ -110,9 +118,9 @@ describe('StripeResource', function() { amount: 1000, currency: 'usd', source: 'tok_visa', - description: 'test' + description: 'test', }, - params: 'amount=1000¤cy=usd&source=tok_visa&description=test' + params: 'amount=1000¤cy=usd&source=tok_visa&description=test', }; afterEach(function() { @@ -122,7 +130,7 @@ describe('StripeResource', function() { after(function() { nock.cleanAll(); - }) + }); describe('_request', function() { it('throws an error on connection failure', function(done) { @@ -147,7 +155,9 @@ describe('StripeResource', function() { realStripe.setMaxNetworkRetries(1); realStripe.charges.create(options.data, function(err) { - var errorMessage = realStripe.invoices._generateConnectionErrorMessage(1); + var errorMessage = realStripe.invoices._generateConnectionErrorMessage( + 1, + ); expect(err.message).to.equal(errorMessage); expect(err.detail.message).to.deep.equal('worse stuff'); done(); @@ -178,8 +188,8 @@ describe('StripeResource', function() { .post(options.path, options.params) .reply(409, { error: { - message: 'Conflict' - } + message: 'Conflict', + }, }) .post(options.path, options.params) .reply(200, { @@ -201,8 +211,8 @@ describe('StripeResource', function() { .post(options.path, options.params) .reply(400, { error: { - type: 'card_error' - } + type: 'card_error', + }, }); realStripe.setMaxNetworkRetries(1); @@ -218,8 +228,8 @@ describe('StripeResource', function() { .post(options.path, options.params) .reply(500, { error: { - type: 'api_error' - } + type: 'api_error', + }, }); realStripe.setMaxNetworkRetries(1); @@ -230,17 +240,18 @@ describe('StripeResource', function() { }); }); - it('should handle OAuth errors gracefully', function (done) { + it('should handle OAuth errors gracefully', function(done) { nock('https://connect.stripe.com') .post('/oauth/token') .reply(400, { error: 'invalid_grant', - error_description: 'This authorization code has already been used. All tokens issued with this code have been revoked.' + error_description: + 'This authorization code has already been used. All tokens issued with this code have been revoked.', }); realStripe.setMaxNetworkRetries(1); - realStripe.oauth.token(options.data, function (err) { + realStripe.oauth.token(options.data, function(err) { expect(err.type).to.equal('StripeInvalidGrantError'); done(); }); @@ -251,8 +262,8 @@ describe('StripeResource', function() { .post(options.path, options.params) .reply(503, { error: { - message: 'Service unavailable' - } + message: 'Service unavailable', + }, }) .post(options.path, options.params) .reply(200, { @@ -274,8 +285,8 @@ describe('StripeResource', function() { .get(options.path + '/ch_123') .reply(500, { error: { - type: 'api_error' - } + type: 'api_error', + }, }) .get(options.path + '/ch_123') .reply(200, { @@ -303,11 +314,14 @@ describe('StripeResource', function() { .reply(function(uri, requestBody, cb) { headers = this.req.headers; - return cb(null, [200, { - id: 'ch_123"', - object: 'charge', - amount: 1000, - }]); + return cb(null, [ + 200, + { + id: 'ch_123"', + object: 'charge', + amount: 1000, + }, + ]); }); realStripe.setMaxNetworkRetries(1); @@ -328,11 +342,14 @@ describe('StripeResource', function() { .reply(function(uri, requestBody, cb) { headers = this.req.headers; - return cb(null, [200, { - id: 'ch_123"', - object: 'charge', - amount: 1000, - }]); + return cb(null, [ + 200, + { + id: 'ch_123"', + object: 'charge', + amount: 1000, + }, + ]); }); realStripe.setMaxNetworkRetries(1); @@ -354,52 +371,71 @@ describe('StripeResource', function() { .reply(function(uri, requestBody, cb) { headers = this.req.headers; - return cb(null, [200, { - id: 'ch_123"', - object: 'charge', - amount: 1000, - }]); + return cb(null, [ + 200, + { + id: 'ch_123"', + object: 'charge', + amount: 1000, + }, + ]); }); realStripe.setMaxNetworkRetries(1); - realStripe.charges.create(options.data, {idempotency_key: key}, function() { - expect(headers['idempotency-key']).to.equal(key); - done(); - }); + realStripe.charges.create( + options.data, + {idempotency_key: key}, + function() { + expect(headers['idempotency-key']).to.equal(key); + done(); + }, + ); }); }); describe('_shouldRetry', function() { - it('should return false if we\'ve reached maximum retries', function() { + it("should return false if we've reached maximum retries", function() { stripe.setMaxNetworkRetries(1); - var res = stripe.invoices._shouldRetry({ - statusCode: 409 - }, 1); + var res = stripe.invoices._shouldRetry( + { + statusCode: 409, + }, + 1, + ); expect(res).to.equal(false); }); it('should return true if we have more retries available', function() { stripe.setMaxNetworkRetries(1); - var res = stripe.invoices._shouldRetry({ - statusCode: 409 - }, 0); + var res = stripe.invoices._shouldRetry( + { + statusCode: 409, + }, + 0, + ); expect(res).to.equal(true); }); it('should return true if the error code is either 409 or 503', function() { stripe.setMaxNetworkRetries(1); - var res = stripe.invoices._shouldRetry({ - statusCode: 409 - }, 0); + var res = stripe.invoices._shouldRetry( + { + statusCode: 409, + }, + 0, + ); expect(res).to.equal(true); - res = stripe.invoices._shouldRetry({ - statusCode: 503 - }, 0); + res = stripe.invoices._shouldRetry( + { + statusCode: 503, + }, + 0, + ); expect(res).to.equal(true); }); @@ -408,10 +444,13 @@ describe('StripeResource', function() { stripe.setMaxNetworkRetries(2); // mocking that we're on our 2nd request - var res = stripe.invoices._shouldRetry({ - statusCode: 200, - req: {_requestEvent: {method: 'POST'}} - }, 1); + var res = stripe.invoices._shouldRetry( + { + statusCode: 200, + req: {_requestEvent: {method: 'POST'}}, + }, + 1, + ); expect(res).to.equal(false); }); diff --git a/test/Webhook.spec.js b/test/Webhook.spec.js index 9576888d59..cd58d41d98 100644 --- a/test/Webhook.spec.js +++ b/test/Webhook.spec.js @@ -19,29 +19,35 @@ describe('Webhooks', function() { payload: EVENT_PAYLOAD_STRING, }); - var event = stripe.webhooks.constructEvent(EVENT_PAYLOAD_STRING, header, SECRET); + var event = stripe.webhooks.constructEvent( + EVENT_PAYLOAD_STRING, + header, + SECRET, + ); expect(event.id).to.equal(EVENT_PAYLOAD.id); }); - it('should raise a JSON error from invalid JSON payload', - function() { - var header = generateHeaderString({ - payload: '} I am not valid JSON; 123][', - }); - expect(function() { - stripe.webhooks.constructEvent('} I am not valid JSON; 123][', header, SECRET); - }).to.throw(/Unexpected token/); + it('should raise a JSON error from invalid JSON payload', function() { + var header = generateHeaderString({ + payload: '} I am not valid JSON; 123][', }); + expect(function() { + stripe.webhooks.constructEvent( + '} I am not valid JSON; 123][', + header, + SECRET, + ); + }).to.throw(/Unexpected token/); + }); - it('should raise a SignatureVerificationError from a valid JSON payload and an invalid signature header', - function() { - var header = 'bad_header'; + it('should raise a SignatureVerificationError from a valid JSON payload and an invalid signature header', function() { + var header = 'bad_header'; - expect(function() { - stripe.webhooks.constructEvent(EVENT_PAYLOAD_STRING, header, SECRET); - }).to.throw(/Unable to extract timestamp and signatures from header/); - }); + expect(function() { + stripe.webhooks.constructEvent(EVENT_PAYLOAD_STRING, header, SECRET); + }).to.throw(/Unable to extract timestamp and signatures from header/); + }); }); describe('.verifySignatureHeader', function() { @@ -51,19 +57,35 @@ describe('Webhooks', function() { var expectedMessage = /Unable to extract timestamp and signatures from header/; expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + ); }).to.throw(expectedMessage); expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, null, SECRET); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + null, + SECRET, + ); }).to.throw(expectedMessage); expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, undefined, SECRET); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + undefined, + SECRET, + ); }).to.throw(expectedMessage); expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, '', SECRET); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + '', + SECRET, + ); }).to.throw(expectedMessage); }); @@ -73,7 +95,11 @@ describe('Webhooks', function() { }); expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + ); }).to.throw(/No signatures found with expected scheme/); }); @@ -83,56 +109,98 @@ describe('Webhooks', function() { }); expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET); - }).to.throw(/No signatures found matching the expected signature for payload/); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + ); + }).to.throw( + /No signatures found matching the expected signature for payload/, + ); }); it('should raise a SignatureVerificationError when the timestamp is not within the tolerance', function() { var header = generateHeaderString({ - timestamp: (Date.now() / 1000) - 15, + timestamp: Date.now() / 1000 - 15, }); expect(function() { - stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET, 10); + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + 10, + ); }).to.throw(/Timestamp outside the tolerance zone/); }); - it('should return true when the header contains a valid signature and ' + - 'the timestamp is within the tolerance', - function() { - var header = generateHeaderString({ - timestamp: (Date.now() / 1000), - }); + it( + 'should return true when the header contains a valid signature and ' + + 'the timestamp is within the tolerance', + function() { + var header = generateHeaderString({ + timestamp: Date.now() / 1000, + }); - expect(stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET, 10)).to.equal(true); - }); + expect( + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + 10, + ), + ).to.equal(true); + }, + ); it('should return true when the header contains at least one valid signature', function() { var header = generateHeaderString({ - timestamp: (Date.now() / 1000), + timestamp: Date.now() / 1000, }); header += ',v1=potato'; - expect(stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET, 10)).to.equal(true); + expect( + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + 10, + ), + ).to.equal(true); }); - it('should return true when the header contains a valid signature ' + - 'and the timestamp is off but no tolerance is provided', - function() { - var header = generateHeaderString({ - timestamp: 12345, - }); + it( + 'should return true when the header contains a valid signature ' + + 'and the timestamp is off but no tolerance is provided', + function() { + var header = generateHeaderString({ + timestamp: 12345, + }); - expect(stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET)).to.equal(true); - }); + expect( + stripe.webhooks.signature.verifyHeader( + EVENT_PAYLOAD_STRING, + header, + SECRET, + ), + ).to.equal(true); + }, + ); it('should accept Buffer instances for the payload and header', function() { var header = generateHeaderString({ - timestamp: (Date.now() / 1000), + timestamp: Date.now() / 1000, }); - expect(stripe.webhooks.signature.verifyHeader(Buffer.from(EVENT_PAYLOAD_STRING), Buffer.from(header), SECRET, 10)).to.equal(true); + expect( + stripe.webhooks.signature.verifyHeader( + Buffer.from(EVENT_PAYLOAD_STRING), + Buffer.from(header), + SECRET, + 10, + ), + ).to.equal(true); }); }); }); @@ -145,8 +213,12 @@ function generateHeaderString(opts) { opts.secret = opts.secret || SECRET; opts.scheme = opts.scheme || stripe.webhooks.signature.EXPECTED_SCHEME; - opts.signature = opts.signature || - stripe.webhooks.signature._computeSignature(opts.timestamp + '.' + opts.payload, opts.secret); + opts.signature = + opts.signature || + stripe.webhooks.signature._computeSignature( + opts.timestamp + '.' + opts.payload, + opts.secret, + ); var generatedHeader = [ 't=' + opts.timestamp, diff --git a/test/autoPagination.spec.js b/test/autoPagination.spec.js index 6674462d78..4960a3bb43 100644 --- a/test/autoPagination.spec.js +++ b/test/autoPagination.spec.js @@ -3,10 +3,7 @@ /* eslint-disable callback-return */ var testUtils = require('../testUtils'); -var stripe = require('../lib/stripe')( - testUtils.getUserStripeKey(), - 'latest' -); +var stripe = require('../lib/stripe')(testUtils.getUserStripeKey(), 'latest'); var expect = require('chai').expect; @@ -24,217 +21,275 @@ describe('auto pagination', function() { for (var i = 0; i < TOTAL_OBJECTS; i++) { createReqs.push(stripe.customers.create({email: email})); } - return Promise.all(createReqs).then(function() { - // re-fetch to ensure correct order - return stripe.customers.list({email: email}).then(function(customers) { - realCustomerIds = customers.data.map(function(customer) {return customer.id}); + return Promise.all(createReqs) + .then(function() { + // re-fetch to ensure correct order + return stripe.customers + .list({email: email}) + .then(function(customers) { + realCustomerIds = customers.data.map(function(customer) { + return customer.id; + }); + }); }) - }).then(resolve); + .then(resolve); }); }); after(function() { return new Promise(function(resolve) { - Promise.all(realCustomerIds.map(function(customerId) { - return stripe.customers.del(customerId); - })).then(resolve); + Promise.all( + realCustomerIds.map(function(customerId) { + return stripe.customers.del(customerId); + }), + ).then(resolve); }); }); describe('callbacks', function() { it('lets you call `next()` to iterate and `next(false)` to break', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - function onCustomer(customer, next) { - customerIds.push(customer.id); - if (customerIds.length === LIMIT) { - next(false); - } else { - expect(customerIds.length).to.be.lessThan(LIMIT); - next(); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + function onCustomer(customer, next) { + customerIds.push(customer.id); + if (customerIds.length === LIMIT) { + next(false); + } else { + expect(customerIds.length).to.be.lessThan(LIMIT); + next(); + } } - } - function onDone(err) { - if (err) { - reject(err); - } else { - resolve(customerIds); + function onDone(err) { + if (err) { + reject(err); + } else { + resolve(customerIds); + } } - } - stripe.customers.list({limit: 3, email: email}) - .autoPagingEach(onCustomer, onDone); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + stripe.customers + .list({limit: 3, email: email}) + .autoPagingEach(onCustomer, onDone); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('lets you ignore the second arg and `return false` to break', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - function onCustomer(customer) { - customerIds.push(customer.id); - if (customerIds.length === LIMIT) { - return false; - } else { - expect(customerIds.length).to.be.lessThan(LIMIT); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + function onCustomer(customer) { + customerIds.push(customer.id); + if (customerIds.length === LIMIT) { + return false; + } else { + expect(customerIds.length).to.be.lessThan(LIMIT); + } } - } - function onDone(err) { - if (err) { - reject(err); - } else { - resolve(customerIds); + function onDone(err) { + if (err) { + reject(err); + } else { + resolve(customerIds); + } } - } - stripe.customers.list({limit: 3, email: email}) - .autoPagingEach(onCustomer, onDone); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + stripe.customers + .list({limit: 3, email: email}) + .autoPagingEach(onCustomer, onDone); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('lets you ignore the second arg and return a Promise which returns `false` to break', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - function onCustomer(customer) { - customerIds.push(customer.id); - if (customerIds.length === LIMIT) { - return Promise.resolve(false); - } else { - expect(customerIds.length).to.be.lessThan(LIMIT); - return Promise.resolve(); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + function onCustomer(customer) { + customerIds.push(customer.id); + if (customerIds.length === LIMIT) { + return Promise.resolve(false); + } else { + expect(customerIds.length).to.be.lessThan(LIMIT); + return Promise.resolve(); + } } - } - function onDone(err) { - if (err) { - reject(err); - } else { - resolve(customerIds); + function onDone(err) { + if (err) { + reject(err); + } else { + resolve(customerIds); + } } - } - stripe.customers.list({limit: 3, email: email}) - .autoPagingEach(onCustomer, onDone); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + stripe.customers + .list({limit: 3, email: email}) + .autoPagingEach(onCustomer, onDone); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('can use a promise instead of a callback for onDone', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - function onCustomer(customer) { - customerIds.push(customer.id); - } - function onDone() { - resolve(customerIds); - } - - stripe.customers.list({limit: 3, email: email}) - .autoPagingEach(onCustomer) - .then(onDone) - .catch(reject); - })).to.eventually.deep.equal(realCustomerIds); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + function onCustomer(customer) { + customerIds.push(customer.id); + } + function onDone() { + resolve(customerIds); + } + + stripe.customers + .list({limit: 3, email: email}) + .autoPagingEach(onCustomer) + .then(onDone) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds); }); it('handles the end of a list properly when the last page is full', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - return stripe.customers.list({email: email, limit: TOTAL_OBJECTS / 2}) - .autoPagingEach(function(customer) { customerIds.push(customer.id); }) - .catch(reject) - .then(function() { - resolve(customerIds); - }); - })).to.eventually.deep.equal(realCustomerIds); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + return stripe.customers + .list({email: email, limit: TOTAL_OBJECTS / 2}) + .autoPagingEach(function(customer) { + customerIds.push(customer.id); + }) + .catch(reject) + .then(function() { + resolve(customerIds); + }); + }), + ).to.eventually.deep.equal(realCustomerIds); }); it('handles the end of a list properly when the last page is not full', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - return stripe.customers.list({email: email, limit: TOTAL_OBJECTS - 2}) - .autoPagingEach(function(customer) { customerIds.push(customer.id); }) - .catch(reject) - .then(function() { - resolve(customerIds); - }); - })).to.eventually.deep.equal(realCustomerIds); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + return stripe.customers + .list({email: email, limit: TOTAL_OBJECTS - 2}) + .autoPagingEach(function(customer) { + customerIds.push(customer.id); + }) + .catch(reject) + .then(function() { + resolve(customerIds); + }); + }), + ).to.eventually.deep.equal(realCustomerIds); }); it('handles a list which is shorter than the page size properly', function() { - return expect(new Promise(function(resolve, reject) { - var customerIds = []; - return stripe.customers.list({email: email, limit: TOTAL_OBJECTS + 2}) - .autoPagingEach(function(customer) { customerIds.push(customer.id); }) - .catch(reject) - .then(function() { - resolve(customerIds); - }); - })).to.eventually.deep.equal(realCustomerIds); + return expect( + new Promise(function(resolve, reject) { + var customerIds = []; + return stripe.customers + .list({email: email, limit: TOTAL_OBJECTS + 2}) + .autoPagingEach(function(customer) { + customerIds.push(customer.id); + }) + .catch(reject) + .then(function() { + resolve(customerIds); + }); + }), + ).to.eventually.deep.equal(realCustomerIds); }); it('handles errors after the first page correctly (callback)', function() { - return expect(new Promise(function(resolve, reject) { - var i = 0; - function onCustomer() { - i += 1; - if (i > 4) { - throw Error('Simulated error'); - } - } - return stripe.customers.list({email: email, limit: 3}) - .autoPagingEach(onCustomer, function(err) { - if (err) { - resolve(err.message); - } else { - reject(Error('Expected an error, did not get one.')); + return expect( + new Promise(function(resolve, reject) { + var i = 0; + function onCustomer() { + i += 1; + if (i > 4) { + throw Error('Simulated error'); } - }); - })).to.eventually.deep.equal('Simulated error'); + } + return stripe.customers + .list({email: email, limit: 3}) + .autoPagingEach(onCustomer, function(err) { + if (err) { + resolve(err.message); + } else { + reject(Error('Expected an error, did not get one.')); + } + }); + }), + ).to.eventually.deep.equal('Simulated error'); }); it('handles errors after the first page correctly (promise)', function() { - return expect(new Promise(function(resolve, reject) { - var i = 0; - function onCustomer() { - i += 1; - if (i > 4) { - throw Error('Simulated error'); + return expect( + new Promise(function(resolve, reject) { + var i = 0; + function onCustomer() { + i += 1; + if (i > 4) { + throw Error('Simulated error'); + } } - } - return stripe.customers.list({email: email, limit: 3}) - .autoPagingEach(onCustomer) - .then(function() { - reject(Error('Expected an error, did not get one.')); - }) - .catch(function(err) { - resolve(err.message); - }); - })).to.eventually.deep.equal('Simulated error'); + return stripe.customers + .list({email: email, limit: 3}) + .autoPagingEach(onCustomer) + .then(function() { + reject(Error('Expected an error, did not get one.')); + }) + .catch(function(err) { + resolve(err.message); + }); + }), + ).to.eventually.deep.equal('Simulated error'); }); }); describe('async iterators', function() { - if (testUtils.envSupportsForAwait()) { // `for await` throws a syntax error everywhere but node 10, // so we must conditionally require it. var forAwaitUntil = require('../testUtils/forAwait.node10').forAwaitUntil; it('works with `for await` when that feature exists (user break)', function() { - return expect(new Promise(function(resolve, reject) { - forAwaitUntil(stripe.customers.list({limit: 3, email: email}), LIMIT) - .then(function(customers) { - resolve(customers.map(function(customer) { return customer.id; })); - }) - .catch(reject) - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + return expect( + new Promise(function(resolve, reject) { + forAwaitUntil( + stripe.customers.list({limit: 3, email: email}), + LIMIT, + ) + .then(function(customers) { + resolve( + customers.map(function(customer) { + return customer.id; + }), + ); + }) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('works with `for await` when that feature exists (end of list)', function() { - return expect(new Promise(function(resolve, reject) { - forAwaitUntil(stripe.customers.list({limit: 3, email: email}), TOTAL_OBJECTS + 1) - .then(function(customers) { - resolve(customers.map(function(customer) { return customer.id; })); - }) - .catch(reject); - })).to.eventually.deep.equal(realCustomerIds); + return expect( + new Promise(function(resolve, reject) { + forAwaitUntil( + stripe.customers.list({limit: 3, email: email}), + TOTAL_OBJECTS + 1, + ) + .then(function(customers) { + resolve( + customers.map(function(customer) { + return customer.id; + }), + ); + }) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds); }); } @@ -243,177 +298,239 @@ describe('auto pagination', function() { var awaitUntil = require('../testUtils/await.node7').awaitUntil; it('works with `await` and a while loop when await exists', function() { - return expect(new Promise(function(resolve, reject) { - awaitUntil(stripe.customers.list({limit: 3, email: email}), LIMIT) - .then(function(customers) { - resolve(customers.map(function(customer) { return customer.id; })); - }) - .catch(reject); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + return expect( + new Promise(function(resolve, reject) { + awaitUntil(stripe.customers.list({limit: 3, email: email}), LIMIT) + .then(function(customers) { + resolve( + customers.map(function(customer) { + return customer.id; + }), + ); + }) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); } it('returns an empty object from .return() so that `break;` works in for-await', function() { - return expect(new Promise(function(resolve, reject) { - var iter = stripe.customers.list({limit: 3, email: email}); - - var customerIds = []; - function handleIter(result) { - customerIds.push(result.value.id); - expect(iter.return()).to.deep.equal({}); - } - - iter.next().then(handleIter).then(function() { - resolve(customerIds); - }).catch(reject); - })).to.eventually.deep.equal(realCustomerIds.slice(0, 1)); + return expect( + new Promise(function(resolve, reject) { + var iter = stripe.customers.list({limit: 3, email: email}); + + var customerIds = []; + function handleIter(result) { + customerIds.push(result.value.id); + expect(iter.return()).to.deep.equal({}); + } + + iter + .next() + .then(handleIter) + .then(function() { + resolve(customerIds); + }) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, 1)); }); it('works when you call it sequentially', function() { - return expect(new Promise(function(resolve, reject) { - var iter = stripe.customers.list({limit: 3, email: email}); - - var customerIds = []; - function handleIter(result) { - customerIds.push(result.value.id); - if (customerIds.length < 7) { - return iter.next().then(handleIter); + return expect( + new Promise(function(resolve, reject) { + var iter = stripe.customers.list({limit: 3, email: email}); + + var customerIds = []; + function handleIter(result) { + customerIds.push(result.value.id); + if (customerIds.length < 7) { + return iter.next().then(handleIter); + } } - } - iter.next().then(handleIter).then(function() { - resolve(customerIds); - }).catch(reject); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + iter + .next() + .then(handleIter) + .then(function() { + resolve(customerIds); + }) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('gives you the same result each time when you call it multiple times in parallel', function() { - return expect(new Promise(function(resolve, reject) { - var iter = stripe.customers.list({limit: 3, email: email}); - - var customerIds = [] - function handleIter(result) { - customerIds.push(result.value.id); - } - - Promise.all([ - iter.next().then(handleIter), - iter.next().then(handleIter).then(function() { - return Promise.all([ - iter.next().then(handleIter), - iter.next().then(handleIter), - ]) - }).then(function() { - return Promise.all([ - iter.next().then(handleIter), - iter.next().then(handleIter), - ]) - }).then(function() { - return Promise.all([ - iter.next().then(handleIter), - iter.next().then(handleIter), - ]) - }) - ]).then(function() { - resolve(customerIds); - }).catch(reject); - })).to.eventually.deep.equal(realCustomerIds.slice(0, 4).reduce(function(acc, x) { - acc.push(x); - acc.push(x); - return acc; - }, [])); + return expect( + new Promise(function(resolve, reject) { + var iter = stripe.customers.list({limit: 3, email: email}); + + var customerIds = []; + function handleIter(result) { + customerIds.push(result.value.id); + } + + Promise.all([ + iter.next().then(handleIter), + iter + .next() + .then(handleIter) + .then(function() { + return Promise.all([ + iter.next().then(handleIter), + iter.next().then(handleIter), + ]); + }) + .then(function() { + return Promise.all([ + iter.next().then(handleIter), + iter.next().then(handleIter), + ]); + }) + .then(function() { + return Promise.all([ + iter.next().then(handleIter), + iter.next().then(handleIter), + ]); + }), + ]) + .then(function() { + resolve(customerIds); + }) + .catch(reject); + }), + ).to.eventually.deep.equal( + realCustomerIds.slice(0, 4).reduce(function(acc, x) { + acc.push(x); + acc.push(x); + return acc; + }, []), + ); }); }); describe('autoPagingToArray', function() { it('can go to the end', function() { - return expect(new Promise(function(resolve, reject) { - stripe.customers.list({limit: 3, email: email}) - .autoPagingToArray({limit: TOTAL_OBJECTS + 1}) - .then(function(customers) { - return customers.map(function(customer) { return customer.id; }); - }) - .then(resolve) - .catch(reject); - })).to.eventually.deep.equal(realCustomerIds); + return expect( + new Promise(function(resolve, reject) { + stripe.customers + .list({limit: 3, email: email}) + .autoPagingToArray({limit: TOTAL_OBJECTS + 1}) + .then(function(customers) { + return customers.map(function(customer) { + return customer.id; + }); + }) + .then(resolve) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds); }); it('returns a promise of an array', function() { - return expect(new Promise(function(resolve, reject) { - stripe.customers.list({limit: 3, email: email}) - .autoPagingToArray({limit: LIMIT}) - .then(function(customers) { - return customers.map(function(customer) { return customer.id; }); - }) - .then(resolve) - .catch(reject); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + return expect( + new Promise(function(resolve, reject) { + stripe.customers + .list({limit: 3, email: email}) + .autoPagingToArray({limit: LIMIT}) + .then(function(customers) { + return customers.map(function(customer) { + return customer.id; + }); + }) + .then(resolve) + .catch(reject); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('accepts an onDone callback, passing an array', function() { - return expect(new Promise(function(resolve, reject) { - function onDone(err, customers) { - if (err) { - reject(err); - } else { - resolve(customers.map(function(customer) { return customer.id; })); + return expect( + new Promise(function(resolve, reject) { + function onDone(err, customers) { + if (err) { + reject(err); + } else { + resolve( + customers.map(function(customer) { + return customer.id; + }), + ); + } } - } - stripe.customers.list({limit: 3, email: email}) - .autoPagingToArray({limit: LIMIT}, onDone); - })).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); + stripe.customers + .list({limit: 3, email: email}) + .autoPagingToArray({limit: LIMIT}, onDone); + }), + ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); it('enforces a `limit` arg', function() { - return expect(new Promise(function(resolve, reject) { - try { - stripe.customers.list({limit: 3, email: email}) - .autoPagingToArray(); - reject(Error('Should have thrown.')); - } catch (err) { - resolve(err.message); - } - })).to.eventually.equal('You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.'); + return expect( + new Promise(function(resolve, reject) { + try { + stripe.customers.list({limit: 3, email: email}).autoPagingToArray(); + reject(Error('Should have thrown.')); + } catch (err) { + resolve(err.message); + } + }), + ).to.eventually.equal( + 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.', + ); }); it('caps the `limit` arg to a reasonable ceiling', function() { - return expect(new Promise(function(resolve, reject) { - try { - stripe.customers.list({limit: 3, email: email}) - .autoPagingToArray({limit: 1000000}); - reject(Error('Should have thrown.')); - } catch (err) { - resolve(err.message); - } - })).to.eventually.equal('You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.'); + return expect( + new Promise(function(resolve, reject) { + try { + stripe.customers + .list({limit: 3, email: email}) + .autoPagingToArray({limit: 1000000}); + reject(Error('Should have thrown.')); + } catch (err) { + resolve(err.message); + } + }), + ).to.eventually.equal( + 'You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.', + ); }); }); describe('api compat edge cases', function() { it('lets you listen to the first request as its own promise, and separately each item, but only sends one request for the first page.', function() { - return expect(new Promise(function(resolve, reject) { - // Count requests: we want one for the first page (not two), and then one for the second page. - var reqCount = 0; - function onRequest() { - reqCount += 1; - } - stripe.on('request', onRequest); - - var customerIds = []; - var p = stripe.customers.list({email: email, limit: 4}) - Promise.all([ - p, - p.autoPagingEach(function(customer) { customerIds.push(customer.id); }), - ]).then(function(results) { - stripe.off('request', onRequest); - expect(reqCount).to.equal(2); // not 3. - - resolve({ - firstReq: results[0].data.map(function(customer) { return customer.id; }), - paginated: customerIds, - }); - }).catch(reject); - })).to.eventually.deep.equal({ + return expect( + new Promise(function(resolve, reject) { + // Count requests: we want one for the first page (not two), and then one for the second page. + var reqCount = 0; + function onRequest() { + reqCount += 1; + } + stripe.on('request', onRequest); + + var customerIds = []; + var p = stripe.customers.list({email: email, limit: 4}); + Promise.all([ + p, + p.autoPagingEach(function(customer) { + customerIds.push(customer.id); + }), + ]) + .then(function(results) { + stripe.off('request', onRequest); + expect(reqCount).to.equal(2); // not 3. + + resolve({ + firstReq: results[0].data.map(function(customer) { + return customer.id; + }), + paginated: customerIds, + }); + }) + .catch(reject); + }), + ).to.eventually.deep.equal({ firstReq: realCustomerIds.slice(0, 4), paginated: realCustomerIds, }); diff --git a/test/flows.spec.js b/test/flows.spec.js index 879918c07a..f58f34c0ef 100644 --- a/test/flows.spec.js +++ b/test/flows.spec.js @@ -2,10 +2,7 @@ var testUtils = require('../testUtils'); var chai = require('chai'); -var stripe = require('../lib/stripe')( - testUtils.getUserStripeKey(), - 'latest' -); +var stripe = require('../lib/stripe')(testUtils.getUserStripeKey(), 'latest'); var fs = require('fs'); var path = require('path'); var stream = require('stream'); @@ -27,11 +24,10 @@ describe('Flows', function() { it('Allows me to retrieve default_currency', function() { return expect( - stripe.account.retrieve() - .then(function(acct) { - CURRENCY = acct.default_currency; - return acct; - }) + stripe.account.retrieve().then(function(acct) { + CURRENCY = acct.default_currency; + return acct; + }), ).to.eventually.have.property('default_currency'); }); @@ -49,7 +45,7 @@ describe('Flows', function() { name: 'product' + testUtils.getRandomString(), }, }), - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers.create(CUSTOMER_DETAILS), ]).then(function(j) { var plan = j[0]; var customer = j[1]; @@ -60,28 +56,27 @@ describe('Flows', function() { return stripe.customers.updateSubscription(customer.id, { plan: plan.id, }); - }) + }), ).to.eventually.have.property('status', 'active'); }); - it( - 'Allows me to: Create a plan and subscribe a customer to it, and update subscription (multi-subs API)', - function() { - var plan; - return expect( - Promise.all([ - stripe.plans.create({ - id: 'plan' + testUtils.getRandomString(), - amount: 1700, - currency: CURRENCY, - interval: 'month', - nickname: 'Gold Super Amazing Tier', - product: { - name: 'product' + testUtils.getRandomString(), - }, - }), - stripe.customers.create(CUSTOMER_DETAILS) - ]).then(function(j) { + it('Allows me to: Create a plan and subscribe a customer to it, and update subscription (multi-subs API)', function() { + var plan; + return expect( + Promise.all([ + stripe.plans.create({ + id: 'plan' + testUtils.getRandomString(), + amount: 1700, + currency: CURRENCY, + interval: 'month', + nickname: 'Gold Super Amazing Tier', + product: { + name: 'product' + testUtils.getRandomString(), + }, + }), + stripe.customers.create(CUSTOMER_DETAILS), + ]) + .then(function(j) { plan = j[0]; var customer = j[1]; @@ -91,33 +86,42 @@ describe('Flows', function() { return stripe.customers.createSubscription(customer.id, { plan: plan.id, }); - }).then(function(subscription) { - return stripe.customers.updateSubscription(subscription.customer, subscription.id, { - plan: plan.id, quantity: '3', - }); - }).then(function(subscription) { - return [subscription.status, subscription.quantity]; }) - ).to.eventually.deep.equal(['active', 3]); - } - ); + .then(function(subscription) { + return stripe.customers.updateSubscription( + subscription.customer, + subscription.id, + { + plan: plan.id, + quantity: '3', + }, + ); + }) + .then(function(subscription) { + return [subscription.status, subscription.quantity]; + }), + ).to.eventually.deep.equal(['active', 3]); + }); it('Errors when I attempt to subscribe a customer to a non-existent plan', function() { return expect( - stripe.customers.create(CUSTOMER_DETAILS) - .then(function(customer) { - cleanup.deleteCustomer(customer.id); + stripe.customers.create(CUSTOMER_DETAILS).then(function(customer) { + cleanup.deleteCustomer(customer.id); - return stripe.customers.updateSubscription(customer.id, { + return stripe.customers + .updateSubscription(customer.id, { plan: 'someNonExistentPlan' + testUtils.getRandomString(), - }).then(null, function(err) { + }) + .then(null, function(err) { // Resolve with the error so we can inspect it below return err; }); - }) + }), ).to.eventually.satisfy(function(err) { - return err.type === 'StripeInvalidRequestError' && - err.rawType === 'invalid_request_error'; + return ( + err.type === 'StripeInvalidRequestError' && + err.rawType === 'invalid_request_error' + ); }); }); @@ -134,7 +138,7 @@ describe('Flows', function() { name: 'product' + testUtils.getRandomString(), }, }), - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers.create(CUSTOMER_DETAILS), ]).then(function(j) { var plan = j[0]; var customer = j[1]; @@ -146,7 +150,7 @@ describe('Flows', function() { plan: plan.id, cancel_at_period_end: true, }); - }) + }), ).to.eventually.have.property('cancel_at_period_end', true); }); @@ -157,23 +161,28 @@ describe('Flows', function() { 'TEST_a-i' + testUtils.getRandomString(), 'foobarbazteston___etwothree' + testUtils.getRandomString(), ].forEach(function(planID) { - it('Allows me to create and retrieve plan with ID: ' + planID, function() { - return expect( - stripe.plans.create({ - id: planID, - amount: 1700, - currency: CURRENCY, - interval: 'month', - nickname: 'generic', - product: { - name: 'product' + testUtils.getRandomString(), - }, - }).then(function() { - cleanup.deletePlan(planID); - return stripe.plans.retrieve(planID); - }) - ).to.eventually.have.property('id', planID); - }); + it( + 'Allows me to create and retrieve plan with ID: ' + planID, + function() { + return expect( + stripe.plans + .create({ + id: planID, + amount: 1700, + currency: CURRENCY, + interval: 'month', + nickname: 'generic', + product: { + name: 'product' + testUtils.getRandomString(), + }, + }) + .then(function() { + cleanup.deletePlan(planID); + return stripe.plans.retrieve(planID); + }), + ).to.eventually.have.property('id', planID); + }, + ); }); }); }); @@ -190,11 +199,11 @@ describe('Flows', function() { percent_off: 20, duration: 'once', }), - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers.create(CUSTOMER_DETAILS), ]).then(function(joined) { coupon = joined[0]; customer = joined[1]; - }) + }), ).to.not.be.eventually.rejected; }); describe('And I apply the coupon to the customer', function() { @@ -202,24 +211,24 @@ describe('Flows', function() { return expect( stripe.customers.update(customer.id, { coupon: coupon.id, - }) + }), ).to.not.be.eventually.rejected; }); it('Can be retrieved from that customer', function() { return expect( - stripe.customers.retrieve(customer.id) + stripe.customers.retrieve(customer.id), ).to.eventually.have.nested.property('discount.coupon.id', coupon.id); }); describe('The resulting discount', function() { it('Can be removed', function() { return expect( - stripe.customers.deleteDiscount(customer.id) + stripe.customers.deleteDiscount(customer.id), ).to.eventually.have.property('deleted', true); }); describe('Re-querying it', function() { it('Does indeed indicate that it is deleted', function() { return expect( - stripe.customers.retrieve(customer.id) + stripe.customers.retrieve(customer.id), ).to.eventually.have.property('discount', null); }); }); @@ -232,7 +241,8 @@ describe('Flows', function() { it('Can save and retrieve metadata', function() { var customer; return expect( - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers + .create(CUSTOMER_DETAILS) .then(function(cust) { customer = cust; cleanup.deleteCustomer(cust.id); @@ -240,13 +250,14 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.getMetadata(customer.id); - }) + }), ).to.eventually.deep.equal({foo: '123'}); }); it('Can reset metadata', function() { var customer; return expect( - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers + .create(CUSTOMER_DETAILS) .then(function(cust) { customer = cust; cleanup.deleteCustomer(cust.id); @@ -257,13 +268,14 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.getMetadata(customer.id); - }) + }), ).to.eventually.deep.equal({}); }); it('Resets metadata when setting new metadata', function() { var customer; return expect( - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers + .create(CUSTOMER_DETAILS) .then(function(cust) { customer = cust; cleanup.deleteCustomer(cust.id); @@ -271,13 +283,14 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.setMetadata(customer.id, {baz: '456'}); - }) + }), ).to.eventually.deep.equal({baz: '456'}); }); it('Can set individual key/value pairs', function() { var customer; return expect( - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers + .create(CUSTOMER_DETAILS) .then(function(cust) { customer = cust; cleanup.deleteCustomer(cust.id); @@ -301,38 +314,63 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.getMetadata(customer.id); - }) + }), ).to.eventually.deep.equal({_other_: '999', foo: '222'}); }); it('Can set individual key/value pairs [with per request token]', function() { var customer; var authToken = testUtils.getUserStripeKey(); return expect( - stripe.customers.create(CUSTOMER_DETAILS) + stripe.customers + .create(CUSTOMER_DETAILS) .then(function(cust) { customer = cust; cleanup.deleteCustomer(cust.id); }) .then(function() { - return stripe.customers.setMetadata(customer.id, {'baz': 456}, authToken); + return stripe.customers.setMetadata( + customer.id, + {baz: 456}, + authToken, + ); }) .then(function() { - return stripe.customers.setMetadata(customer.id, '_other_', 999, authToken); + return stripe.customers.setMetadata( + customer.id, + '_other_', + 999, + authToken, + ); }) .then(function() { - return stripe.customers.setMetadata(customer.id, 'foo', 123, authToken); + return stripe.customers.setMetadata( + customer.id, + 'foo', + 123, + authToken, + ); }) .then(function() { // Change foo - return stripe.customers.setMetadata(customer.id, 'foo', 222, authToken); + return stripe.customers.setMetadata( + customer.id, + 'foo', + 222, + authToken, + ); }) .then(function() { // Delete baz - return stripe.customers.setMetadata(customer.id, 'baz', null, authToken); + return stripe.customers.setMetadata( + customer.id, + 'baz', + null, + authToken, + ); }) .then(function() { return stripe.customers.getMetadata(customer.id, authToken); - }) + }), ).to.eventually.deep.equal({_other_: '999', foo: '222'}); }); }); @@ -341,31 +379,31 @@ describe('Flows', function() { describe('A customer within a charge', function() { it('Allows you to expand a customer object', function() { return expect( - stripe.customers.create(CUSTOMER_DETAILS) - .then(function(cust) { - cleanup.deleteCustomer(cust.id); - return stripe.charges.create({ - customer: cust.id, - amount: 1700, - currency: CURRENCY, - expand: ['customer'], - }); - }) + stripe.customers.create(CUSTOMER_DETAILS).then(function(cust) { + cleanup.deleteCustomer(cust.id); + return stripe.charges.create({ + customer: cust.id, + amount: 1700, + currency: CURRENCY, + expand: ['customer'], + }); + }), ).to.eventually.have.nested.property('customer.created'); }); }); - describe('A customer\'s default source', function() { + describe("A customer's default source", function() { it('Allows you to expand a default_source', function() { return expect( - stripe.customers.create({ - description: 'Some customer', - source: 'tok_visa', - expand: ['default_source'], - }) + stripe.customers + .create({ + description: 'Some customer', + source: 'tok_visa', + expand: ['default_source'], + }) .then(function(cust) { cleanup.deleteCustomer(cust.id); return cust; - }) + }), // Confirm it's expanded by checking that some prop (e.g. exp_year) exists: ).to.eventually.have.nested.property('default_source.exp_year'); }); @@ -375,32 +413,35 @@ describe('Flows', function() { describe('Charge', function() { it('Allows you to create a charge', function() { return expect( - stripe.charges.create({ - amount: 1234, - currency: CURRENCY, - card: 'tok_chargeDeclined', - shipping: { - name: 'Bobby Tables', - address: { - line1: '1 Foo St.', + stripe.charges + .create({ + amount: 1234, + currency: CURRENCY, + card: 'tok_chargeDeclined', + shipping: { + name: 'Bobby Tables', + address: { + line1: '1 Foo St.', + }, }, - }, - }).then(null, function(error) { - return error; - }) + }) + .then(null, function(error) { + return error; + }), ).to.eventually.have.nested.property('raw.charge'); }); }); describe('Getting balance', function() { it('Allows me to do so', function() { - return expect( - stripe.balance.retrieve() - ).to.eventually.have.property('object', 'balance'); + return expect(stripe.balance.retrieve()).to.eventually.have.property( + 'object', + 'balance', + ); }); it('Allows me to do so with specified auth key', function() { return expect( - stripe.balance.retrieve(testUtils.getUserStripeKey()) + stripe.balance.retrieve(testUtils.getUserStripeKey()), ).to.eventually.have.property('object', 'balance'); }); }); @@ -410,24 +451,30 @@ describe('Flows', function() { before(function(done) { // Pick a random connected account to use in the `Stripe-Account` header - stripe.accounts.list({ - limit: 1, - }).then(function(accounts) { - if (accounts.data.length < 1) { - return done( - new Error('Test requires at least one Connected Account in the Test Account') - ); - } - - connectedAccountId = accounts.data[0].id; - - done(); - }); + stripe.accounts + .list({ + limit: 1, + }) + .then(function(accounts) { + if (accounts.data.length < 1) { + return done( + new Error( + 'Test requires at least one Connected Account in the Test Account', + ), + ); + } + + connectedAccountId = accounts.data[0].id; + + done(); + }); }); it('should emit a `request` event to listeners on request', function(done) { var apiVersion = '2017-06-05'; - var idempotencyKey = Math.random().toString(36).slice(2); + var idempotencyKey = Math.random() + .toString(36) + .slice(2); function onRequest(request) { stripe.off('request', onRequest); @@ -445,22 +492,29 @@ describe('Flows', function() { stripe.on('request', onRequest); - stripe.charges.create({ - amount: 1234, - currency: 'usd', - card: 'tok_chargeDeclined', - }, { - stripe_version: apiVersion, - idempotency_key: idempotencyKey, - stripe_account: connectedAccountId, - }).then(null, function() { - // I expect there to be an error here. - }); + stripe.charges + .create( + { + amount: 1234, + currency: 'usd', + card: 'tok_chargeDeclined', + }, + { + stripe_version: apiVersion, + idempotency_key: idempotencyKey, + stripe_account: connectedAccountId, + }, + ) + .then(null, function() { + // I expect there to be an error here. + }); }); it('should emit a `response` event to listeners on response', function(done) { var apiVersion = '2017-06-05'; - var idempotencyKey = Math.random().toString(36).slice(2); + var idempotencyKey = Math.random() + .toString(36) + .slice(2); function onResponse(response) { // On the off chance we're picking up a response from a differentrequest @@ -485,17 +539,22 @@ describe('Flows', function() { stripe.on('response', onResponse); - stripe.charges.create({ - amount: 1234, - currency: 'usd', - card: 'tok_chargeDeclined', - }, { - stripe_version: apiVersion, - idempotency_key: idempotencyKey, - stripe_account: connectedAccountId, - }).then(null, function() { - // I expect there to be an error here. - }); + stripe.charges + .create( + { + amount: 1234, + currency: 'usd', + card: 'tok_chargeDeclined', + }, + { + stripe_version: apiVersion, + idempotency_key: idempotencyKey, + stripe_account: connectedAccountId, + }, + ) + .then(null, function() { + // I expect there to be an error here. + }); }); it('should not emit a `response` event to removed listeners on response', function(done) { @@ -506,13 +565,15 @@ describe('Flows', function() { stripe.on('response', onResponse); stripe.off('response', onResponse); - stripe.charges.create({ - amount: 1234, - currency: 'usd', - card: 'tok_visa', - }).then(function() { - done(); - }); + stripe.charges + .create({ + amount: 1234, + currency: 'usd', + card: 'tok_visa', + }) + .then(function() { + done(); + }); }); }); @@ -522,16 +583,18 @@ describe('Flows', function() { var f = fs.createReadStream(testFilename); return expect( - stripe.fileUploads.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - }).then(null, function(error) { - return error; - }) + stripe.fileUploads + .create({ + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + }) + .then(null, function(error) { + return error; + }), ).to.eventually.have.nested.property('size', 739); }); @@ -540,16 +603,18 @@ describe('Flows', function() { var f = fs.readFileSync(testFilename); return expect( - stripe.fileUploads.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - }).then(null, function(error) { - return error; - }) + stripe.fileUploads + .create({ + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + }) + .then(null, function(error) { + return error; + }), ).to.eventually.have.nested.property('size', 739); }); @@ -563,19 +628,23 @@ describe('Flows', function() { mockedStream.emit('error', fakeError); }); - stripe.fileUploads.create({ - purpose: 'dispute_evidence', - file: { - data: mockedStream, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - }).catch(function(error) { - expect(error.message).to.equal('An error occurred while attempting to process the file for upload.'); - expect(error.detail).to.equal(fakeError); + stripe.fileUploads + .create({ + purpose: 'dispute_evidence', + file: { + data: mockedStream, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + }) + .catch(function(error) { + expect(error.message).to.equal( + 'An error occurred while attempting to process the file for upload.', + ); + expect(error.detail).to.equal(fakeError); - done(); - }); + done(); + }); }); }); }); diff --git a/test/resources/Account.spec.js b/test/resources/Account.spec.js index 378aa433b3..ed7955ecc1 100644 --- a/test/resources/Account.spec.js +++ b/test/resources/Account.spec.js @@ -109,20 +109,29 @@ describe('Account Resource', function() { describe('External account methods', function() { describe('retrieveExternalAccount', function() { it('Sends the correct request', function() { - stripe.account.retrieveExternalAccount('accountIdFoo321', 'externalAccountIdFoo456'); + stripe.account.retrieveExternalAccount( + 'accountIdFoo321', + 'externalAccountIdFoo456', + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', + url: + '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', headers: {}, data: {}, }); }); it('Sends the correct request [with specified auth]', function() { - stripe.account.retrieveExternalAccount('accountIdFoo321', 'externalAccountIdFoo456', TEST_AUTH_KEY); + stripe.account.retrieveExternalAccount( + 'accountIdFoo321', + 'externalAccountIdFoo456', + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', + url: + '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', headers: {}, data: {}, auth: TEST_AUTH_KEY, @@ -133,7 +142,9 @@ describe('Account Resource', function() { describe('createExternalAccount', function() { it('Sends the correct request', function() { stripe.account.createExternalAccount('accountIdFoo321', { - number: '123456', currency: 'usd', country: 'US', + number: '123456', + currency: 'usd', + country: 'US', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -144,9 +155,15 @@ describe('Account Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.account.createExternalAccount('accountIdFoo321', { - number: '123456', currency: 'usd', country: 'US', - }, TEST_AUTH_KEY); + stripe.account.createExternalAccount( + 'accountIdFoo321', + { + number: '123456', + currency: 'usd', + country: 'US', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/accounts/accountIdFoo321/external_accounts', @@ -159,12 +176,17 @@ describe('Account Resource', function() { describe('updateExternalAccount', function() { it('Sends the correct request', function() { - stripe.account.updateExternalAccount('accountIdFoo321', 'externalAccountIdFoo456', { - default_for_currency: true, - }); + stripe.account.updateExternalAccount( + 'accountIdFoo321', + 'externalAccountIdFoo456', + { + default_for_currency: true, + }, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', - url: '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', + url: + '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', headers: {}, data: {default_for_currency: true}, }); @@ -173,20 +195,29 @@ describe('Account Resource', function() { describe('deleteExternalAccount', function() { it('Sends the correct request', function() { - stripe.account.deleteExternalAccount('accountIdFoo321', 'externalAccountIdFoo456'); + stripe.account.deleteExternalAccount( + 'accountIdFoo321', + 'externalAccountIdFoo456', + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', - url: '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', + url: + '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', headers: {}, data: {}, }); }); it('Sends the correct request [with specified auth]', function() { - stripe.account.deleteExternalAccount('accountIdFoo321', 'externalAccountIdFoo456', TEST_AUTH_KEY); + stripe.account.deleteExternalAccount( + 'accountIdFoo321', + 'externalAccountIdFoo456', + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', - url: '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', + url: + '/v1/accounts/accountIdFoo321/external_accounts/externalAccountIdFoo456', headers: {}, data: {}, auth: TEST_AUTH_KEY, @@ -270,9 +301,13 @@ describe('Account Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.account.createPerson('acct_123', { - first_name: 'John', - }, TEST_AUTH_KEY); + stripe.account.createPerson( + 'acct_123', + { + first_name: 'John', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/accounts/acct_123/persons', @@ -297,9 +332,14 @@ describe('Account Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.account.updatePerson('acct_123', 'person_123', { - first_name: 'John', - }, TEST_AUTH_KEY); + stripe.account.updatePerson( + 'acct_123', + 'person_123', + { + first_name: 'John', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/accounts/acct_123/persons/person_123', diff --git a/test/resources/ApplicationFeeRefunds.spec.js b/test/resources/ApplicationFeeRefunds.spec.js index f4f2a72a80..8f97d8db0e 100644 --- a/test/resources/ApplicationFeeRefunds.spec.js +++ b/test/resources/ApplicationFeeRefunds.spec.js @@ -8,10 +8,9 @@ var APPFEE_TEST_ID = 'appFeeIdTest999'; var REFUND_TEST_ID = 'refundIdTest999'; // Create new CustomerCard instance with pre-filled customerId: -var appFeeRefund = new resources.ApplicationFeeRefunds( - stripe, - {feeId: APPFEE_TEST_ID} -); +var appFeeRefund = new resources.ApplicationFeeRefunds(stripe, { + feeId: APPFEE_TEST_ID, +}); // Use spy from existing resource: appFeeRefund._request = stripe.customers._request; @@ -22,7 +21,11 @@ describe('ApplicationFeeRefund Resource', function() { appFeeRefund.retrieve(REFUND_TEST_ID); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/application_fees/' + APPFEE_TEST_ID + '/refunds/' + REFUND_TEST_ID, + url: + '/v1/application_fees/' + + APPFEE_TEST_ID + + '/refunds/' + + REFUND_TEST_ID, data: {}, headers: {}, }); @@ -36,7 +39,11 @@ describe('ApplicationFeeRefund Resource', function() { }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', - url: '/v1/application_fees/' + APPFEE_TEST_ID + '/refunds/' + REFUND_TEST_ID, + url: + '/v1/application_fees/' + + APPFEE_TEST_ID + + '/refunds/' + + REFUND_TEST_ID, data: {metadata: {key: 'value'}}, headers: {}, }); diff --git a/test/resources/ApplicationFees.spec.js b/test/resources/ApplicationFees.spec.js index 2cec4f95ff..3fa4d13426 100644 --- a/test/resources/ApplicationFees.spec.js +++ b/test/resources/ApplicationFees.spec.js @@ -18,7 +18,9 @@ describe('ApplicationFee Resource', function() { describe('refund', function() { it('Sends the correct request', function() { - stripe.applicationFees.refund('applicationFeeIdExample3242', {amount: 23}); + stripe.applicationFees.refund('applicationFeeIdExample3242', { + amount: 23, + }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/application_fees/applicationFeeIdExample3242/refund', @@ -33,21 +35,19 @@ describe('ApplicationFee Resource', function() { stripe.applicationFees.updateRefund( 'appFeeIdExample3242', 'refundIdExample2312', - {metadata: {key: 'value'}} + {metadata: {key: 'value'}}, ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', - url: '/v1/application_fees/appFeeIdExample3242/refunds/refundIdExample2312', + url: + '/v1/application_fees/appFeeIdExample3242/refunds/refundIdExample2312', data: {metadata: {key: 'value'}}, headers: {}, }); }); it('Sends the correct create request', function() { - stripe.applicationFees.createRefund( - 'appFeeIdExample3242', - {amount: 100} - ); + stripe.applicationFees.createRefund('appFeeIdExample3242', {amount: 100}); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/application_fees/appFeeIdExample3242/refunds', @@ -57,9 +57,7 @@ describe('ApplicationFee Resource', function() { }); it('Sends the correct list request', function() { - stripe.applicationFees.listRefunds( - 'appFeeIdExample3242' - ); + stripe.applicationFees.listRefunds('appFeeIdExample3242'); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', url: '/v1/application_fees/appFeeIdExample3242/refunds', @@ -71,11 +69,12 @@ describe('ApplicationFee Resource', function() { it('Sends the correct retrieve request', function() { stripe.applicationFees.retrieveRefund( 'appFeeIdExample3242', - 'refundIdExample2312' + 'refundIdExample2312', ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/application_fees/appFeeIdExample3242/refunds/refundIdExample2312', + url: + '/v1/application_fees/appFeeIdExample3242/refunds/refundIdExample2312', data: {}, headers: {}, }); diff --git a/test/resources/Balance.spec.js b/test/resources/Balance.spec.js index 0845e36106..50fbe0a5a1 100644 --- a/test/resources/Balance.spec.js +++ b/test/resources/Balance.spec.js @@ -62,7 +62,10 @@ describe('Balance Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.balance.retrieveTransaction('transactionIdFoo', 'aGN0bIwXnHdw5645VABjPdSn8nWY7G11'); + stripe.balance.retrieveTransaction( + 'transactionIdFoo', + 'aGN0bIwXnHdw5645VABjPdSn8nWY7G11', + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', url: '/v1/balance/history/transactionIdFoo', diff --git a/test/resources/BitcoinReceivers.spec.js b/test/resources/BitcoinReceivers.spec.js index 2ca675e6bc..ada4e055db 100644 --- a/test/resources/BitcoinReceivers.spec.js +++ b/test/resources/BitcoinReceivers.spec.js @@ -40,7 +40,7 @@ describe('BitcoinReceivers Resource', function() { data: { limit: 1, }, - }) + }); }); }); }); diff --git a/test/resources/ChargeRefunds.spec.js b/test/resources/ChargeRefunds.spec.js index adc1790f49..843930073f 100644 --- a/test/resources/ChargeRefunds.spec.js +++ b/test/resources/ChargeRefunds.spec.js @@ -8,10 +8,9 @@ var CHARGE_TEST_ID = 'chargeIdTest999'; var REFUND_TEST_ID = 'refundIdTest999'; // Create new CustomerCard instance with pre-filled customerId: -var chargeRefund = new resources.ChargeRefunds( - stripe, - {chargeId: CHARGE_TEST_ID} -); +var chargeRefund = new resources.ChargeRefunds(stripe, { + chargeId: CHARGE_TEST_ID, +}); // Use spy from existing resource: chargeRefund._request = stripe.customers._request; diff --git a/test/resources/Charges.spec.js b/test/resources/Charges.spec.js index 6308e82cd0..dcfc13eb3f 100644 --- a/test/resources/Charges.spec.js +++ b/test/resources/Charges.spec.js @@ -93,16 +93,16 @@ describe('Charge Resource', function() { it('Incorrect arguments result in an error', function() { expect( - stripe.charges.refund('chargeIdExample123', 39392) + stripe.charges.refund('chargeIdExample123', 39392), ).to.be.eventually.rejectedWith(/unknown arguments/i); expect( - stripe.charges.refund({potato: 'chargeIdExample123'}) + stripe.charges.refund({potato: 'chargeIdExample123'}), ).to.be.eventually.rejectedWith(/must be a string, but got: object/i); - expect( - stripe.charges.refund(442) - ).to.be.eventually.rejectedWith(/must be a string, but got: number/i); + expect(stripe.charges.refund(442)).to.be.eventually.rejectedWith( + /must be a string, but got: number/i, + ); }); }); @@ -111,7 +111,7 @@ describe('Charge Resource', function() { stripe.charges.updateRefund( 'chargeIdExample3242', 'refundIdExample2312', - {metadata: {key: 'value'}} + {metadata: {key: 'value'}}, ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -122,10 +122,7 @@ describe('Charge Resource', function() { }); it('Sends the correct create request', function() { - stripe.charges.createRefund( - 'chargeIdExample3242', - {amount: 100} - ); + stripe.charges.createRefund('chargeIdExample3242', {amount: 100}); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/charges/chargeIdExample3242/refunds', @@ -135,9 +132,7 @@ describe('Charge Resource', function() { }); it('Sends the correct list request', function() { - stripe.charges.listRefunds( - 'chargeIdExample3242' - ); + stripe.charges.listRefunds('chargeIdExample3242'); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', url: '/v1/charges/chargeIdExample3242/refunds', @@ -149,7 +144,7 @@ describe('Charge Resource', function() { it('Sends the correct retrieve request', function() { stripe.charges.retrieveRefund( 'chargeIdExample3242', - 'refundIdExample2312' + 'refundIdExample2312', ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -190,7 +185,7 @@ describe('Charge Resource', function() { expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/charges/chargeIdExample3242', - data: {'fraud_details': {'user_report': 'fraudulent'}}, + data: {fraud_details: {user_report: 'fraudulent'}}, headers: {}, }); }); @@ -202,7 +197,7 @@ describe('Charge Resource', function() { expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/charges/chargeIdExample3242', - data: {'fraud_details': {'user_report': 'safe'}}, + data: {fraud_details: {user_report: 'safe'}}, headers: {}, }); }); diff --git a/test/resources/Checkout/Sessions.spec.js b/test/resources/Checkout/Sessions.spec.js index b0268ab786..1b071806f0 100644 --- a/test/resources/Checkout/Sessions.spec.js +++ b/test/resources/Checkout/Sessions.spec.js @@ -4,8 +4,8 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Checkout', function () { - describe('Sessions Resource', function () { +describe('Checkout', function() { + describe('Sessions Resource', function() { describe('create', function() { it('Sends the correct request', function() { var params = { @@ -16,9 +16,7 @@ describe('Checkout', function () { amount: 123, currency: 'usd', description: 'item 1', - images: [ - 'https://stripe.com/img1', - ], + images: ['https://stripe.com/img1'], name: 'name', quantity: 2, }, diff --git a/test/resources/CreditNotes.spec.js b/test/resources/CreditNotes.spec.js index eb76a7aa16..b0343e1eca 100644 --- a/test/resources/CreditNotes.spec.js +++ b/test/resources/CreditNotes.spec.js @@ -64,7 +64,7 @@ describe('CreditNotes Resource', function() { method: 'POST', url: '/v1/credit_notes/cn_123/void', headers: {}, - data: {} + data: {}, }); }); }); diff --git a/test/resources/CustomerCards.spec.js b/test/resources/CustomerCards.spec.js index 4c9708c472..0354d9fb7e 100644 --- a/test/resources/CustomerCards.spec.js +++ b/test/resources/CustomerCards.spec.js @@ -7,10 +7,9 @@ var expect = require('chai').expect; var CUSTOMER_TEST_ID = 'customerIdTest999'; // Create new CustomerCard instance with pre-filled customerId: -var customerCard = new resources.CustomerCards( - stripe, - {customerId: CUSTOMER_TEST_ID} -); +var customerCard = new resources.CustomerCards(stripe, { + customerId: CUSTOMER_TEST_ID, +}); // Use spy from existing resource: customerCard._request = stripe.customers._request; @@ -31,7 +30,8 @@ describe('CustomerCard Resource', function() { describe('create', function() { it('Sends the correct request', function() { customerCard.create({ - number: '123456', exp_month: '12', + number: '123456', + exp_month: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/CustomerSubscriptions.spec.js b/test/resources/CustomerSubscriptions.spec.js index 461e19e137..9920dbc743 100644 --- a/test/resources/CustomerSubscriptions.spec.js +++ b/test/resources/CustomerSubscriptions.spec.js @@ -7,10 +7,9 @@ var expect = require('chai').expect; var CUSTOMER_TEST_ID = 'customerIdTest999'; // Create new CustomerSubscription instance with pre-filled customerId: -var customerSubscription = new resources.CustomerSubscriptions( - stripe, - {customerId: CUSTOMER_TEST_ID} -); +var customerSubscription = new resources.CustomerSubscriptions(stripe, { + customerId: CUSTOMER_TEST_ID, +}); // Use spy from existing resource: customerSubscription._request = stripe.customers._request; @@ -21,7 +20,10 @@ describe('CustomerSubscription Resource', function() { customerSubscription.retrieve('subscriptionIdFoo456'); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/customers/' + CUSTOMER_TEST_ID + '/subscriptions/subscriptionIdFoo456', + url: + '/v1/customers/' + + CUSTOMER_TEST_ID + + '/subscriptions/subscriptionIdFoo456', headers: {}, data: {}, }); @@ -31,7 +33,8 @@ describe('CustomerSubscription Resource', function() { describe('create', function() { it('Sends the correct request', function() { customerSubscription.create({ - plan: 'gold', quantity: '12', + plan: 'gold', + quantity: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -49,7 +52,10 @@ describe('CustomerSubscription Resource', function() { }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', - url: '/v1/customers/' + CUSTOMER_TEST_ID + '/subscriptions/subscriptionIdFoo456', + url: + '/v1/customers/' + + CUSTOMER_TEST_ID + + '/subscriptions/subscriptionIdFoo456', headers: {}, data: {name: 'Bob M. Baz'}, }); @@ -61,7 +67,10 @@ describe('CustomerSubscription Resource', function() { customerSubscription.del('subscriptionIdFoo456'); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', - url: '/v1/customers/' + CUSTOMER_TEST_ID + '/subscriptions/subscriptionIdFoo456', + url: + '/v1/customers/' + + CUSTOMER_TEST_ID + + '/subscriptions/subscriptionIdFoo456', headers: {}, data: {}, }); @@ -83,10 +92,14 @@ describe('CustomerSubscription Resource', function() { describe('Discount methods', function() { describe('deleteDiscount', function() { it('Sends the correct request', function() { - customerSubscription.deleteDiscount('customerIdFoo321', 'subscriptionIdBar654'); + customerSubscription.deleteDiscount( + 'customerIdFoo321', + 'subscriptionIdBar654', + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', - url: '/v1/customers/customerIdFoo321/subscriptions/subscriptionIdBar654/discount', + url: + '/v1/customers/customerIdFoo321/subscriptions/subscriptionIdBar654/discount', headers: {}, data: {}, }); diff --git a/test/resources/Customers.spec.js b/test/resources/Customers.spec.js index c895f740a1..365e0e60e0 100644 --- a/test/resources/Customers.spec.js +++ b/test/resources/Customers.spec.js @@ -63,7 +63,10 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified idempotency_key in options]', function() { - stripe.customers.create({description: 'Some customer'}, {idempotency_key: 'foo'}); + stripe.customers.create( + {description: 'Some customer'}, + {idempotency_key: 'foo'}, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers', @@ -73,7 +76,10 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth in options]', function() { - stripe.customers.create({description: 'Some customer'}, {api_key: TEST_AUTH_KEY}); + stripe.customers.create( + {description: 'Some customer'}, + {api_key: TEST_AUTH_KEY}, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers', @@ -84,7 +90,10 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth and idempotent key in options]', function() { - stripe.customers.create({description: 'Some customer'}, {api_key: TEST_AUTH_KEY, idempotency_key: 'foo'}); + stripe.customers.create( + {description: 'Some customer'}, + {api_key: TEST_AUTH_KEY, idempotency_key: 'foo'}, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers', @@ -170,9 +179,13 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.updateSubscription('cus_123', { - plan: 'fooPlan', - }, TEST_AUTH_KEY); + stripe.customers.updateSubscription( + 'cus_123', + { + plan: 'fooPlan', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers/cus_123/subscription', @@ -219,7 +232,11 @@ describe('Customers Resource', function() { describe('With at_period_end defined [with specified auth]', function() { it('Sends the correct request', function() { - stripe.customers.cancelSubscription('cus_123', {at_period_end: true}, TEST_AUTH_KEY); + stripe.customers.cancelSubscription( + 'cus_123', + {at_period_end: true}, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', url: '/v1/customers/cus_123/subscription', @@ -276,19 +293,23 @@ describe('Customers Resource', function() { describe('When setting new metadata', function() { it('Sends one request to get current, and another to set new data', function() { - return expect(new Promise(function(resolve, reject) { - stripe.customers.setMetadata('cus_123', { - foo: 123, - baz: 456, - }).then(function() { - var reqs = stripe.REQUESTS; - resolve([ - // Last two requests - reqs[reqs.length - 2], - reqs[reqs.length - 1], - ]); - }); - })).to.eventually.deep.equal([ + return expect( + new Promise(function(resolve, reject) { + stripe.customers + .setMetadata('cus_123', { + foo: 123, + baz: 456, + }) + .then(function() { + var reqs = stripe.REQUESTS; + resolve([ + // Last two requests + reqs[reqs.length - 2], + reqs[reqs.length - 1], + ]); + }); + }), + ).to.eventually.deep.equal([ { // First reset metadata: method: 'POST', @@ -373,7 +394,8 @@ describe('Customers Resource', function() { describe('createCard', function() { it('Sends the correct request', function() { stripe.customers.createCard('cus_123', { - number: '123456', exp_month: '12', + number: '123456', + exp_month: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -384,9 +406,14 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.createCard('cus_123', { - number: '123456', exp_month: '12', - }, TEST_AUTH_KEY); + stripe.customers.createCard( + 'cus_123', + { + number: '123456', + exp_month: '12', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers/cus_123/cards', @@ -485,7 +512,9 @@ describe('Customers Resource', function() { describe('createSource', function() { it('Sends the correct request', function() { stripe.customers.createSource('cus_123', { - object: 'card', number: '123456', exp_month: '12', + object: 'card', + number: '123456', + exp_month: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -496,9 +525,15 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.createSource('cus_123', { - object: 'card', number: '123456', exp_month: '12', - }, TEST_AUTH_KEY); + stripe.customers.createSource( + 'cus_123', + { + object: 'card', + number: '123456', + exp_month: '12', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers/cus_123/sources', @@ -571,16 +606,21 @@ describe('Customers Resource', function() { describe('verifySource', function() { it('Sends the correct request', function() { - var data = {amounts: [32,45]} + var data = {amounts: [32, 45]}; - stripe.customers.verifySource('cus_123', 'card_123', data, TEST_AUTH_KEY); + stripe.customers.verifySource( + 'cus_123', + 'card_123', + data, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers/cus_123/sources/card_123/verify', headers: {}, data: data, auth: TEST_AUTH_KEY, - }) + }); }); }); }); @@ -598,7 +638,11 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.retrieveSubscription('cus_123', 'sub_123', TEST_AUTH_KEY); + stripe.customers.retrieveSubscription( + 'cus_123', + 'sub_123', + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', url: '/v1/customers/cus_123/subscriptions/sub_123', @@ -612,7 +656,8 @@ describe('Customers Resource', function() { describe('createSubscription', function() { it('Sends the correct request', function() { stripe.customers.createSubscription('cus_123', { - plan: 'gold', quantity: '12', + plan: 'gold', + quantity: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -623,9 +668,14 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.createSubscription('cus_123', { - plan: 'gold', quantity: '12', - }, TEST_AUTH_KEY); + stripe.customers.createSubscription( + 'cus_123', + { + plan: 'gold', + quantity: '12', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers/cus_123/subscriptions', @@ -650,9 +700,14 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.updateSubscription('cus_123', 'sub_123', { - quantity: '2', - }, TEST_AUTH_KEY); + stripe.customers.updateSubscription( + 'cus_123', + 'sub_123', + { + quantity: '2', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/customers/cus_123/subscriptions/sub_123', @@ -675,7 +730,11 @@ describe('Customers Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.customers.cancelSubscription('cus_123', 'sub_123', TEST_AUTH_KEY); + stripe.customers.cancelSubscription( + 'cus_123', + 'sub_123', + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', url: '/v1/customers/cus_123/subscriptions/sub_123', @@ -687,7 +746,9 @@ describe('Customers Resource', function() { describe('With at_period_end defined', function() { it('Sends the correct request', function() { - stripe.customers.cancelSubscription('cus_123', 'sub_123', {at_period_end: true}); + stripe.customers.cancelSubscription('cus_123', 'sub_123', { + at_period_end: true, + }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', url: '/v1/customers/cus_123/subscriptions/sub_123', @@ -703,7 +764,7 @@ describe('Customers Resource', function() { 'cus_123', 'sub_123', {at_period_end: true}, - TEST_AUTH_KEY + TEST_AUTH_KEY, ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', diff --git a/test/resources/EphemeralKeys.spec.js b/test/resources/EphemeralKeys.spec.js index 565a066186..2fe31643a1 100644 --- a/test/resources/EphemeralKeys.spec.js +++ b/test/resources/EphemeralKeys.spec.js @@ -5,14 +5,14 @@ var expect = require('chai').expect; function errorsOnNoStripeVersion() { return expect( - stripe.ephemeralKeys.create({customer: 'cus_123'}) + stripe.ephemeralKeys.create({customer: 'cus_123'}), ).to.be.eventually.rejectedWith(/stripe_version must be specified/i); } function sendsCorrectStripeVersion() { stripe.ephemeralKeys.create( {customer: 'cus_123'}, - {stripe_version: '2017-06-05'} + {stripe_version: '2017-06-05'}, ); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -32,7 +32,7 @@ describe('EphemeralKey Resource', function() { it('Sends the correct request', function() { stripe.ephemeralKeys.create( {customer: 'cus_123'}, - {stripe_version: '2017-05-25'} + {stripe_version: '2017-05-25'}, ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/FileUploads.spec.js b/test/resources/FileUploads.spec.js index c8ea6bb6dd..e39343b3ca 100644 --- a/test/resources/FileUploads.spec.js +++ b/test/resources/FileUploads.spec.js @@ -67,15 +67,18 @@ describe('File Uploads Resource', function() { var testFilename = path.join(__dirname, 'data/minimal.pdf'); var f = fs.readFileSync(testFilename); - stripe.fileUploads.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', + stripe.fileUploads.create( + { + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + file_link_data: {create: true}, }, - file_link_data: {create: true}, - }, TEST_AUTH_KEY); + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); @@ -87,39 +90,52 @@ describe('File Uploads Resource', function() { var testFilename = path.join(__dirname, 'data/minimal.pdf'); var f = fs.createReadStream(testFilename); - return stripe.fileUploads.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - file_link_data: {create: true}, - }).then(function() { - expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); - expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); - expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); - }); + return stripe.fileUploads + .create({ + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + file_link_data: {create: true}, + }) + .then(function() { + expect(stripe.LAST_REQUEST).to.deep.property( + 'host', + 'files.stripe.com', + ); + expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); + expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); + }); }); it('Streams a file and sends the correct file upload request [with specified auth]', function() { var testFilename = path.join(__dirname, 'data/minimal.pdf'); var f = fs.createReadStream(testFilename); - return stripe.fileUploads.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - file_link_data: {create: true}, - }, TEST_AUTH_KEY).then(function() { - expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); - expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); - expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); - expect(stripe.LAST_REQUEST).to.deep.property('auth', TEST_AUTH_KEY); - }); + return stripe.fileUploads + .create( + { + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + file_link_data: {create: true}, + }, + TEST_AUTH_KEY, + ) + .then(function() { + expect(stripe.LAST_REQUEST).to.deep.property( + 'host', + 'files.stripe.com', + ); + expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); + expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); + expect(stripe.LAST_REQUEST).to.deep.property('auth', TEST_AUTH_KEY); + }); }); }); }); diff --git a/test/resources/Files.spec.js b/test/resources/Files.spec.js index 215652cec1..c174e4a68b 100644 --- a/test/resources/Files.spec.js +++ b/test/resources/Files.spec.js @@ -67,15 +67,18 @@ describe('Files Resource', function() { var testFilename = path.join(__dirname, 'data/minimal.pdf'); var f = fs.readFileSync(testFilename); - stripe.files.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', + stripe.files.create( + { + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + file_link_data: {create: true}, }, - file_link_data: {create: true}, - }, TEST_AUTH_KEY); + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); @@ -87,39 +90,52 @@ describe('Files Resource', function() { var testFilename = path.join(__dirname, 'data/minimal.pdf'); var f = fs.createReadStream(testFilename); - return stripe.files.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - file_link_data: {create: true}, - }).then(function() { - expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); - expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); - expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); - }); + return stripe.files + .create({ + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + file_link_data: {create: true}, + }) + .then(function() { + expect(stripe.LAST_REQUEST).to.deep.property( + 'host', + 'files.stripe.com', + ); + expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); + expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); + }); }); it('Streams a file and sends the correct file upload request [with specified auth]', function() { var testFilename = path.join(__dirname, 'data/minimal.pdf'); var f = fs.createReadStream(testFilename); - return stripe.files.create({ - purpose: 'dispute_evidence', - file: { - data: f, - name: 'minimal.pdf', - type: 'application/octet-stream', - }, - file_link_data: {create: true}, - }, TEST_AUTH_KEY).then(function() { - expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); - expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); - expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); - expect(stripe.LAST_REQUEST).to.deep.property('auth', TEST_AUTH_KEY); - }); + return stripe.files + .create( + { + purpose: 'dispute_evidence', + file: { + data: f, + name: 'minimal.pdf', + type: 'application/octet-stream', + }, + file_link_data: {create: true}, + }, + TEST_AUTH_KEY, + ) + .then(function() { + expect(stripe.LAST_REQUEST).to.deep.property( + 'host', + 'files.stripe.com', + ); + expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); + expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); + expect(stripe.LAST_REQUEST).to.deep.property('auth', TEST_AUTH_KEY); + }); }); }); }); diff --git a/test/resources/Invoices.spec.js b/test/resources/Invoices.spec.js index 980e24bcd8..cfd8657b2d 100644 --- a/test/resources/Invoices.spec.js +++ b/test/resources/Invoices.spec.js @@ -104,15 +104,13 @@ describe('Invoices Resource', function() { describe('With an options object that includes `subscription_items`', function() { it('Sends the correct request', function() { stripe.invoices.retrieveUpcoming('cus_123', { - subscription_items: [ - {plan: 'potato'}, - {plan: 'rutabaga'}, - ], + subscription_items: [{plan: 'potato'}, {plan: 'rutabaga'}], }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/invoices/upcoming?customer=cus_123&' + + url: + '/v1/invoices/upcoming?customer=cus_123&' + 'subscription_items[0][plan]=potato&subscription_items[1][plan]=rutabaga', headers: {}, data: {}, @@ -124,15 +122,13 @@ describe('Invoices Resource', function() { it('Sends the correct request', function() { stripe.invoices.retrieveUpcoming({ customer: 'cus_abc', - subscription_items: [ - {plan: 'potato'}, - {plan: 'rutabaga'}, - ], + subscription_items: [{plan: 'potato'}, {plan: 'rutabaga'}], }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/invoices/upcoming?customer=cus_abc&' + + url: + '/v1/invoices/upcoming?customer=cus_abc&' + 'subscription_items[0][plan]=potato&subscription_items[1][plan]=rutabaga', headers: {}, data: {}, @@ -142,15 +138,14 @@ describe('Invoices Resource', function() { describe('With an options object that includes `subscription_items` in addition to a subscription ID', function() { it('Sends the correct request', function() { - stripe.invoices.retrieveUpcoming('cus_123', 'sub_123', - { - subscription_items: [ - {plan: 'potato'}, - {plan: 'rutabaga'}, - {id: 'SOME_ID', deleted: true}, - ], - subscription_prorate: true, - }); + stripe.invoices.retrieveUpcoming('cus_123', 'sub_123', { + subscription_items: [ + {plan: 'potato'}, + {plan: 'rutabaga'}, + {id: 'SOME_ID', deleted: true}, + ], + subscription_prorate: true, + }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -188,7 +183,7 @@ describe('Invoices Resource', function() { method: 'POST', url: '/v1/invoices/in_123/finalize', headers: {}, - data: {} + data: {}, }); }); }); @@ -200,12 +195,11 @@ describe('Invoices Resource', function() { method: 'POST', url: '/v1/invoices/in_123/mark_uncollectible', headers: {}, - data: {} + data: {}, }); }); }); - describe('pay', function() { it('Sends the correct request', function() { stripe.invoices.pay('in_123', { @@ -227,7 +221,7 @@ describe('Invoices Resource', function() { method: 'POST', url: '/v1/invoices/in_123/send', headers: {}, - data: {} + data: {}, }); }); }); @@ -239,7 +233,7 @@ describe('Invoices Resource', function() { method: 'POST', url: '/v1/invoices/in_123/void', headers: {}, - data: {} + data: {}, }); }); }); diff --git a/test/resources/Issuing/Authorization.spec.js b/test/resources/Issuing/Authorization.spec.js index b4eb56de4c..bb3e3d5d01 100644 --- a/test/resources/Issuing/Authorization.spec.js +++ b/test/resources/Issuing/Authorization.spec.js @@ -3,7 +3,7 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Issuing', function () { +describe('Issuing', function() { describe('Authorization Resource', function() { describe('retrieve', function() { it('Sends the correct request', function() { @@ -34,7 +34,7 @@ describe('Issuing', function () { stripe.issuing.authorizations.update('iauth_123', { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -44,7 +44,7 @@ describe('Issuing', function () { data: { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }, }); diff --git a/test/resources/Issuing/Cardholders.spec.js b/test/resources/Issuing/Cardholders.spec.js index b854cd592c..646e735c40 100644 --- a/test/resources/Issuing/Cardholders.spec.js +++ b/test/resources/Issuing/Cardholders.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Issuing', function () { - describe('Cardholders Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Issuing', function() { + describe('Cardholders Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.issuing.cardholders.retrieve('ich_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Issuing', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.issuing.cardholders.create({ billing: {}, name: 'Tim Testperson', @@ -39,12 +39,12 @@ describe('Issuing', function () { }); }); - describe('update', function () { - it('Sends the correct request', function () { + describe('update', function() { + it('Sends the correct request', function() { stripe.issuing.cardholders.update('ich_123', { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -54,15 +54,15 @@ describe('Issuing', function () { data: { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }, }); }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.issuing.cardholders.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Issuing/Cards.spec.js b/test/resources/Issuing/Cards.spec.js index 8cf312a16c..90e8111ff3 100644 --- a/test/resources/Issuing/Cards.spec.js +++ b/test/resources/Issuing/Cards.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Issuing', function () { - describe('Cards Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Issuing', function() { + describe('Cards Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.issuing.cards.retrieve('ic_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Issuing', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.issuing.cards.create({ currency: 'usd', type: 'physical', @@ -37,12 +37,12 @@ describe('Issuing', function () { }); }); - describe('update', function () { - it('Sends the correct request', function () { + describe('update', function() { + it('Sends the correct request', function() { stripe.issuing.cards.update('ic_123', { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -52,15 +52,15 @@ describe('Issuing', function () { data: { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }, }); }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.issuing.cards.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -72,9 +72,9 @@ describe('Issuing', function () { }); }); - describe('Virtual Cards Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { + describe('Virtual Cards Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.issuing.cards.retrieveDetails('ic_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ diff --git a/test/resources/Issuing/Disputes.spec.js b/test/resources/Issuing/Disputes.spec.js index dcb5ac6eb2..2af1f0cd43 100644 --- a/test/resources/Issuing/Disputes.spec.js +++ b/test/resources/Issuing/Disputes.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Issuing', function () { - describe('Disputes Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Issuing', function() { + describe('Disputes Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.issuing.disputes.retrieve('idp_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Issuing', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.issuing.disputes.create({ transaction: 'ipi_123', }); @@ -35,12 +35,12 @@ describe('Issuing', function () { }); }); - describe('update', function () { - it('Sends the correct request', function () { + describe('update', function() { + it('Sends the correct request', function() { stripe.issuing.disputes.update('idp_123', { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -50,15 +50,15 @@ describe('Issuing', function () { data: { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }, }); }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.issuing.disputes.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Issuing/Transactions.spec.js b/test/resources/Issuing/Transactions.spec.js index ca44877232..89e6ffac5f 100644 --- a/test/resources/Issuing/Transactions.spec.js +++ b/test/resources/Issuing/Transactions.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Issuing', function () { - describe('Transactions Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Issuing', function() { + describe('Transactions Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.issuing.transactions.retrieve('ipi_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,12 +19,12 @@ describe('Issuing', function () { }); }); - describe('update', function () { - it('Sends the correct request', function () { + describe('update', function() { + it('Sends the correct request', function() { stripe.issuing.transactions.update('ipi_123', { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -34,15 +34,15 @@ describe('Issuing', function () { data: { metadata: { thing1: true, - thing2: 'yes' + thing2: 'yes', }, }, }); }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.issuing.transactions.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/LoginLinks.spec.js b/test/resources/LoginLinks.spec.js index b796a4356e..f46361259a 100644 --- a/test/resources/LoginLinks.spec.js +++ b/test/resources/LoginLinks.spec.js @@ -7,10 +7,7 @@ var expect = require('chai').expect; var ACCOUNT_ID = 'acct_EXPRESS'; // Create new LoginLink instance with pre-filled accountId: -var loginLink = new resources.LoginLinks( - stripe, - {accountId: ACCOUNT_ID} -); +var loginLink = new resources.LoginLinks(stripe, {accountId: ACCOUNT_ID}); // Use spy from existing resource: loginLink._request = stripe.customers._request; diff --git a/test/resources/OAuth.spec.js b/test/resources/OAuth.spec.js index 5f21e48eea..7db3345309 100644 --- a/test/resources/OAuth.spec.js +++ b/test/resources/OAuth.spec.js @@ -32,7 +32,7 @@ describe('OAuth', function() { it('Uses the correct query', function() { var url = stripe.oauth.authorizeUrl({state: 'some_state'}); - var query = qs.parse(URL.parse(url).query) + var query = qs.parse(URL.parse(url).query); expect(query.client_id).to.equal('default_client_id'); expect(query.response_type).to.equal('code'); @@ -43,7 +43,7 @@ describe('OAuth', function() { it('Uses a provided client_id instead of the default', function() { var url = stripe.oauth.authorizeUrl({client_id: '123abc'}); - var query = qs.parse(URL.parse(url).query) + var query = qs.parse(URL.parse(url).query); expect(query.client_id).to.equal('123abc'); }); @@ -64,7 +64,7 @@ describe('OAuth', function() { it('Sends the correct request', function() { stripe.oauth.token({ code: '123abc', - grant_type: 'authorization_code' + grant_type: 'authorization_code', }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -74,7 +74,7 @@ describe('OAuth', function() { headers: {}, data: { code: '123abc', - grant_type: 'authorization_code' + grant_type: 'authorization_code', }, }); }); @@ -97,7 +97,7 @@ describe('OAuth', function() { headers: {}, data: { client_id: stripe.getClientId(), - stripe_user_id: 'some_user_id' + stripe_user_id: 'some_user_id', }, }); }); @@ -115,7 +115,7 @@ describe('OAuth', function() { headers: {}, data: { client_id: '123abc', - stripe_user_id: 'some_user_id' + stripe_user_id: 'some_user_id', }, }); }); diff --git a/test/resources/Orders.spec.js b/test/resources/Orders.spec.js index 092d6de8d2..d0d05de51c 100644 --- a/test/resources/Orders.spec.js +++ b/test/resources/Orders.spec.js @@ -56,7 +56,7 @@ describe('Order Resource', function() { headers: {}, }); }); - }) + }); describe('list', function() { it('Sends the correct request', function() { @@ -105,9 +105,7 @@ describe('Order Resource', function() { describe('returnOrder', function() { it('Sends the correct request', function() { stripe.orders.returnOrder('orderIdFoo3242', { - items: [ - {parent: 'sku_123'}, - ], + items: [{parent: 'sku_123'}], }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/PaymentMethods.spec.js b/test/resources/PaymentMethods.spec.js index 8106dce73b..bc395521db 100644 --- a/test/resources/PaymentMethods.spec.js +++ b/test/resources/PaymentMethods.spec.js @@ -69,7 +69,7 @@ describe('PaymentMethods Resource', function() { method: 'POST', url: '/v1/payment_methods/pm_123/attach', headers: {}, - data: {customer: 'cus_123'} + data: {customer: 'cus_123'}, }); }); }); @@ -81,7 +81,7 @@ describe('PaymentMethods Resource', function() { method: 'POST', url: '/v1/payment_methods/pm_123/detach', headers: {}, - data: {} + data: {}, }); }); }); diff --git a/test/resources/Payouts.spec.js b/test/resources/Payouts.spec.js index 9d4f92b648..8b19252a64 100644 --- a/test/resources/Payouts.spec.js +++ b/test/resources/Payouts.spec.js @@ -21,7 +21,8 @@ describe('Payouts Resource', function() { describe('create', function() { it('Sends the correct request', function() { stripe.payouts.create({ - amount: 200, currency: 'usd', + amount: 200, + currency: 'usd', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/Persons.spec.js b/test/resources/Persons.spec.js index 0a355d0ad8..8d7112dbce 100644 --- a/test/resources/Persons.spec.js +++ b/test/resources/Persons.spec.js @@ -8,10 +8,7 @@ var ACCOUNT_TEST_ID = 'acct_123'; var PERSON_TEST_ID = 'person_123'; // Create new Person instance with pre-filled accountId: -var person = new resources.Persons( - stripe, - {accountId: ACCOUNT_TEST_ID} -); +var person = new resources.Persons(stripe, {accountId: ACCOUNT_TEST_ID}); // Use spy from existing resource: person._request = stripe.customers._request; @@ -81,4 +78,3 @@ describe('Person Resource', function() { }); }); }); - diff --git a/test/resources/Plans.spec.js b/test/resources/Plans.spec.js index d231ddb6b6..6468c95f46 100644 --- a/test/resources/Plans.spec.js +++ b/test/resources/Plans.spec.js @@ -11,7 +11,7 @@ describe('Plans Resource', function() { method: 'GET', url: '/v1/plans/planId1', headers: {}, - data: {} + data: {}, }); }); }); @@ -20,13 +20,13 @@ describe('Plans Resource', function() { it('Sends the correct request', function() { stripe.plans.create({ amount: 200, - currency: 'usd' + currency: 'usd', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/plans', headers: {}, - data: {amount: 200, currency: 'usd'} + data: {amount: 200, currency: 'usd'}, }); }); @@ -34,13 +34,13 @@ describe('Plans Resource', function() { stripe.plans.create({ amount: 200, currency: 'usd', - usage_type: 'metered' + usage_type: 'metered', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/plans', headers: {}, - data: {amount: 200, currency: 'usd', usage_type: 'metered'} + data: {amount: 200, currency: 'usd', usage_type: 'metered'}, }); }); @@ -49,7 +49,7 @@ describe('Plans Resource', function() { currency: 'usd', billing_scheme: 'tiered', tiers: [{up_to: 123, amount: 100}, {up_to: 'inf', amount: 200}], - tiers_mode: 'volume' + tiers_mode: 'volume', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -59,8 +59,8 @@ describe('Plans Resource', function() { currency: 'usd', billing_scheme: 'tiered', tiers: [{up_to: 123, amount: 100}, {up_to: 'inf', amount: 200}], - tiers_mode: 'volume' - } + tiers_mode: 'volume', + }, }); }); @@ -68,7 +68,7 @@ describe('Plans Resource', function() { stripe.plans.create({ amount: 200, currency: 'usd', - transform_usage: {divide_by: 123, round: 'up'} + transform_usage: {divide_by: 123, round: 'up'}, }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -77,8 +77,8 @@ describe('Plans Resource', function() { data: { amount: 200, currency: 'usd', - transform_usage: {divide_by: 123, round: 'up'} - } + transform_usage: {divide_by: 123, round: 'up'}, + }, }); }); }); @@ -87,13 +87,13 @@ describe('Plans Resource', function() { it('Sends the correct request', function() { stripe.plans.update('planId3', { amount: 1900, - currency: 'usd' + currency: 'usd', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/plans/planId3', headers: {}, - data: {amount: 1900, currency: 'usd'} + data: {amount: 1900, currency: 'usd'}, }); }); }); @@ -105,7 +105,7 @@ describe('Plans Resource', function() { method: 'DELETE', url: '/v1/plans/planId4', headers: {}, - data: {} + data: {}, }); }); }); @@ -117,7 +117,7 @@ describe('Plans Resource', function() { method: 'GET', url: '/v1/plans', headers: {}, - data: {} + data: {}, }); }); }); diff --git a/test/resources/Products.spec.js b/test/resources/Products.spec.js index 274f82ecac..9efb4ec49e 100644 --- a/test/resources/Products.spec.js +++ b/test/resources/Products.spec.js @@ -34,7 +34,7 @@ describe('Product Resource', function() { headers: {}, }); }); - }) + }); describe('list', function() { it('Sends the correct request', function() { diff --git a/test/resources/Radar/ValueListItems.spec.js b/test/resources/Radar/ValueListItems.spec.js index 3ce40f3e17..ee414a1e77 100644 --- a/test/resources/Radar/ValueListItems.spec.js +++ b/test/resources/Radar/ValueListItems.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Radar', function () { - describe('ValueLists Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Radar', function() { + describe('ValueLists Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.radar.valueListItems.retrieve('rsli_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Radar', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.radar.valueListItems.create({ value_list: 'rsl_123', value: 'value', @@ -37,8 +37,8 @@ describe('Radar', function () { }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.radar.valueListItems.list({ value_list: 'rsl_123', }); diff --git a/test/resources/Radar/ValueLists.spec.js b/test/resources/Radar/ValueLists.spec.js index 8c3743af5e..1acaf6dc53 100644 --- a/test/resources/Radar/ValueLists.spec.js +++ b/test/resources/Radar/ValueLists.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Radar', function () { - describe('ValueLists Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Radar', function() { + describe('ValueLists Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.radar.valueLists.retrieve('rsl_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Radar', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.radar.valueLists.create({ alias: 'alias', name: 'name', @@ -37,8 +37,8 @@ describe('Radar', function () { }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.radar.valueLists.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/RecipientCards.spec.js b/test/resources/RecipientCards.spec.js index 85475fd93a..abd4007442 100644 --- a/test/resources/RecipientCards.spec.js +++ b/test/resources/RecipientCards.spec.js @@ -7,10 +7,9 @@ var expect = require('chai').expect; var RECIPIENT_TEST_ID = 'recipientIdTest999'; // Create new recipientCard instance with pre-filled recipientId: -var recipientCard = new resources.RecipientCards( - stripe, - {recipientId: RECIPIENT_TEST_ID} -); +var recipientCard = new resources.RecipientCards(stripe, { + recipientId: RECIPIENT_TEST_ID, +}); // Use spy from existing resource: recipientCard._request = stripe.recipients._request; @@ -31,7 +30,8 @@ describe('RecipientCard Resource', function() { describe('create', function() { it('Sends the correct request', function() { recipientCard.create({ - number: '123456', exp_month: '12', + number: '123456', + exp_month: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/Recipients.spec.js b/test/resources/Recipients.spec.js index 51350d079b..1e3ea46a16 100644 --- a/test/resources/Recipients.spec.js +++ b/test/resources/Recipients.spec.js @@ -21,7 +21,8 @@ describe('Recipients Resource', function() { describe('create', function() { it('Sends the correct request', function() { stripe.recipients.create({ - name: 'Bob', type: 'individual', + name: 'Bob', + type: 'individual', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -83,7 +84,11 @@ describe('Recipients Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.recipients.retrieveCard('recipientIdFoo321', 'cardIdFoo456', TEST_AUTH_KEY); + stripe.recipients.retrieveCard( + 'recipientIdFoo321', + 'cardIdFoo456', + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', url: '/v1/recipients/recipientIdFoo321/cards/cardIdFoo456', @@ -97,7 +102,8 @@ describe('Recipients Resource', function() { describe('createCard', function() { it('Sends the correct request', function() { stripe.recipients.createCard('recipientIdFoo321', { - number: '123456', exp_month: '12', + number: '123456', + exp_month: '12', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -108,9 +114,14 @@ describe('Recipients Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.recipients.createCard('recipientIdFoo321', { - number: '123456', exp_month: '12', - }, TEST_AUTH_KEY); + stripe.recipients.createCard( + 'recipientIdFoo321', + { + number: '123456', + exp_month: '12', + }, + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/recipients/recipientIdFoo321/cards', @@ -147,7 +158,11 @@ describe('Recipients Resource', function() { }); it('Sends the correct request [with specified auth]', function() { - stripe.recipients.deleteCard('recipientIdFoo321', 'cardIdFoo456', TEST_AUTH_KEY); + stripe.recipients.deleteCard( + 'recipientIdFoo321', + 'cardIdFoo456', + TEST_AUTH_KEY, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', url: '/v1/recipients/recipientIdFoo321/cards/cardIdFoo456', diff --git a/test/resources/Refunds.spec.js b/test/resources/Refunds.spec.js index f47550f01b..fd8a32b104 100644 --- a/test/resources/Refunds.spec.js +++ b/test/resources/Refunds.spec.js @@ -9,7 +9,7 @@ describe('Refund Resource', function() { stripe.refunds.create({ amount: '300', charge: 'ch_123', - }) + }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/Reporting/ReportRuns.spec.js b/test/resources/Reporting/ReportRuns.spec.js index fa6cb522cc..a9f04c6692 100644 --- a/test/resources/Reporting/ReportRuns.spec.js +++ b/test/resources/Reporting/ReportRuns.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Reporting', function () { - describe('ReportRuns Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Reporting', function() { + describe('ReportRuns Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.reporting.reportRuns.retrieve('frr_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Reporting', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.reporting.reportRuns.create({ parameters: { connected_account: 'acct_123', @@ -41,8 +41,8 @@ describe('Reporting', function () { }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.reporting.reportRuns.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Reporting/ReportTypes.spec.js b/test/resources/Reporting/ReportTypes.spec.js index 75b99d4d60..a13c2db4b3 100644 --- a/test/resources/Reporting/ReportTypes.spec.js +++ b/test/resources/Reporting/ReportTypes.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Reporting', function () { - describe('ReportTypes Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Reporting', function() { + describe('ReportTypes Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.reporting.reportTypes.retrieve('activity.summary.1'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Reporting', function () { }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.reporting.reportTypes.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/SKUs.spec.js b/test/resources/SKUs.spec.js index 24ce99437d..fc9d1f27e7 100644 --- a/test/resources/SKUs.spec.js +++ b/test/resources/SKUs.spec.js @@ -38,7 +38,7 @@ describe('SKU Resource', function() { headers: {}, }); }); - }) + }); describe('list', function() { it('Sends the correct request', function() { diff --git a/test/resources/Sigma/ScheduledQueryRuns.spec.js b/test/resources/Sigma/ScheduledQueryRuns.spec.js index 88e81ce2b1..857fee694e 100644 --- a/test/resources/Sigma/ScheduledQueryRuns.spec.js +++ b/test/resources/Sigma/ScheduledQueryRuns.spec.js @@ -3,7 +3,7 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Sigma', function () { +describe('Sigma', function() { describe('ScheduledQueryRun Resource', function() { describe('retrieve', function() { it('Sends the correct request', function() { diff --git a/test/resources/SubscriptionSchedule.spec.js b/test/resources/SubscriptionSchedule.spec.js index b38246c129..87cc9d723a 100644 --- a/test/resources/SubscriptionSchedule.spec.js +++ b/test/resources/SubscriptionSchedule.spec.js @@ -11,7 +11,7 @@ describe('Subscription Schedule Resource', function() { it('Sends the correct request', function() { var data = { invoice_now: true, - } + }; stripe.subscriptionSchedules.cancel(SCHEDULE_TEST_ID, data); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -53,7 +53,7 @@ describe('Subscription Schedule Resource', function() { it('Sends the correct request', function() { var data = { preserve_cancel_date: true, - } + }; stripe.subscriptionSchedules.release(SCHEDULE_TEST_ID, data); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -92,10 +92,17 @@ describe('Subscription Schedule Resource', function() { describe('Revision methods', function() { describe('retrieveRevision', function() { it('Sends the correct request', function() { - stripe.subscriptionSchedules.retrieveRevision(SCHEDULE_TEST_ID, REVISION_TEST_ID); + stripe.subscriptionSchedules.retrieveRevision( + SCHEDULE_TEST_ID, + REVISION_TEST_ID, + ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/subscription_schedules/' + SCHEDULE_TEST_ID + '/revisions/' + REVISION_TEST_ID, + url: + '/v1/subscription_schedules/' + + SCHEDULE_TEST_ID + + '/revisions/' + + REVISION_TEST_ID, headers: {}, data: {}, }); diff --git a/test/resources/SubscriptionScheduleRevision.spec.js b/test/resources/SubscriptionScheduleRevision.spec.js index bbc76a5e1b..58adf867cf 100644 --- a/test/resources/SubscriptionScheduleRevision.spec.js +++ b/test/resources/SubscriptionScheduleRevision.spec.js @@ -8,10 +8,9 @@ var SCHEDULE_TEST_ID = 'sub_sched_123'; var REVISION_TEST_ID = 'sub_sched_rev_123'; // Create new SubscriptionScheduleRevision instance with pre-filled scheduleId: -var revision = new resources.SubscriptionScheduleRevisions( - stripe, - {scheduleId: SCHEDULE_TEST_ID} -); +var revision = new resources.SubscriptionScheduleRevisions(stripe, { + scheduleId: SCHEDULE_TEST_ID, +}); // Use spy from existing resource: revision._request = stripe.customers._request; @@ -34,11 +33,14 @@ describe('SubscriptionScheduleRevision Resource', function() { revision.retrieve(REVISION_TEST_ID); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/subscription_schedules/' + SCHEDULE_TEST_ID + '/revisions/' + REVISION_TEST_ID, + url: + '/v1/subscription_schedules/' + + SCHEDULE_TEST_ID + + '/revisions/' + + REVISION_TEST_ID, data: {}, headers: {}, }); }); }); }); - diff --git a/test/resources/Subscriptions.spec.js b/test/resources/Subscriptions.spec.js index 8e732dab61..31b1e876f5 100644 --- a/test/resources/Subscriptions.spec.js +++ b/test/resources/Subscriptions.spec.js @@ -133,8 +133,8 @@ describe('subscriptions Resource', function() { data: { items: { '0': { - 'plan': 'foo', - 'quantity': 2, + plan: 'foo', + quantity: 2, }, }, }, @@ -160,8 +160,8 @@ describe('subscriptions Resource', function() { data: { items: { '0': { - 'plan': 'foo', - 'quantity': 2, + plan: 'foo', + quantity: 2, }, }, }, diff --git a/test/resources/TaxIds.spec.js b/test/resources/TaxIds.spec.js index 4de4cf2804..773400e030 100644 --- a/test/resources/TaxIds.spec.js +++ b/test/resources/TaxIds.spec.js @@ -7,10 +7,7 @@ var expect = require('chai').expect; var CUSTOMER_TEST_ID = 'cus_123'; var TAX_ID_TEST_ID = 'txi_123'; -var taxId = new resources.TaxIds( - stripe, - {customerId: CUSTOMER_TEST_ID} -); +var taxId = new resources.TaxIds(stripe, {customerId: CUSTOMER_TEST_ID}); // Use spy from existing resource: taxId._request = stripe.customers._request; diff --git a/test/resources/Terminal/ConnectionTokens.spec.js b/test/resources/Terminal/ConnectionTokens.spec.js index b0a58510ba..75dd800361 100644 --- a/test/resources/Terminal/ConnectionTokens.spec.js +++ b/test/resources/Terminal/ConnectionTokens.spec.js @@ -5,9 +5,9 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; describe('Terminal', function() { - describe('ConnectionToken Resource', function () { + describe('ConnectionToken Resource', function() { describe('create', function() { - it('Sends the correct request', function () { + it('Sends the correct request', function() { stripe.terminal.connectionTokens.create({}); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/Terminal/Locations.spec.js b/test/resources/Terminal/Locations.spec.js index bc6f7b41ae..335beb55b9 100644 --- a/test/resources/Terminal/Locations.spec.js +++ b/test/resources/Terminal/Locations.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Terminal', function () { - describe('Locations Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Terminal', function() { + describe('Locations Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.terminal.locations.retrieve('loc_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Terminal', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.terminal.locations.create({ display_name: 'name', address: { @@ -61,10 +61,10 @@ describe('Terminal', function () { }); }); - describe('update', function () { - it('Sends the correct request', function () { + describe('update', function() { + it('Sends the correct request', function() { stripe.terminal.locations.update('loc_123', { - display_name: 'name' + display_name: 'name', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -77,8 +77,8 @@ describe('Terminal', function () { }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.terminal.locations.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Terminal/Readers.spec.js b/test/resources/Terminal/Readers.spec.js index c3739c2b39..ab6f60451f 100644 --- a/test/resources/Terminal/Readers.spec.js +++ b/test/resources/Terminal/Readers.spec.js @@ -4,10 +4,10 @@ var stripe = require('../../../testUtils').getSpyableStripe(); var expect = require('chai').expect; -describe('Terminal', function () { - describe('Readers Resource', function () { - describe('retrieve', function () { - it('Sends the correct request', function () { +describe('Terminal', function() { + describe('Readers Resource', function() { + describe('retrieve', function() { + it('Sends the correct request', function() { stripe.terminal.readers.retrieve('rdr_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,8 +19,8 @@ describe('Terminal', function () { }); }); - describe('create', function () { - it('Sends the correct request', function () { + describe('create', function() { + it('Sends the correct request', function() { stripe.terminal.readers.create({ registration_code: 'a-b-c', label: 'name', @@ -49,10 +49,10 @@ describe('Terminal', function () { }); }); - describe('update', function () { - it('Sends the correct request', function () { + describe('update', function() { + it('Sends the correct request', function() { stripe.terminal.readers.update('rdr_123', { - label: 'name' + label: 'name', }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -65,8 +65,8 @@ describe('Terminal', function () { }); }); - describe('list', function () { - it('Sends the correct request', function () { + describe('list', function() { + it('Sends the correct request', function() { stripe.terminal.readers.list(); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Topups.spec.js b/test/resources/Topups.spec.js index 88db95651a..7c1d1c2b94 100644 --- a/test/resources/Topups.spec.js +++ b/test/resources/Topups.spec.js @@ -66,12 +66,12 @@ describe('Topup Resource', function() { describe('update', function() { it('Sends the correct request', function() { - stripe.topups.update('tu_123', {metadata: {'key': 'value'}}); + stripe.topups.update('tu_123', {metadata: {key: 'value'}}); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', url: '/v1/topups/tu_123', headers: {}, - data: {metadata: {'key': 'value'}}, + data: {metadata: {key: 'value'}}, }); }); }); diff --git a/test/resources/TransferReversals.spec.js b/test/resources/TransferReversals.spec.js index 19cb36f8a1..5f06d8c0e9 100644 --- a/test/resources/TransferReversals.spec.js +++ b/test/resources/TransferReversals.spec.js @@ -8,10 +8,9 @@ var TRANSFER_TEST_ID = 'transferIdTest999'; var REVERSAL_TEST_ID = 'reversalIdTest999'; // Create new CustomerCard instance with pre-filled customerId: -var transferReversal = new resources.TransferReversals( - stripe, - {transferId: TRANSFER_TEST_ID} -); +var transferReversal = new resources.TransferReversals(stripe, { + transferId: TRANSFER_TEST_ID, +}); // Use spy from existing resource: transferReversal._request = stripe.customers._request; @@ -22,7 +21,11 @@ describe('TransferReversal Resource', function() { transferReversal.retrieve(REVERSAL_TEST_ID); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', - url: '/v1/transfers/' + TRANSFER_TEST_ID + '/reversals/' + REVERSAL_TEST_ID, + url: + '/v1/transfers/' + + TRANSFER_TEST_ID + + '/reversals/' + + REVERSAL_TEST_ID, data: {}, headers: {}, }); @@ -50,7 +53,11 @@ describe('TransferReversal Resource', function() { }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', - url: '/v1/transfers/' + TRANSFER_TEST_ID + '/reversals/' + REVERSAL_TEST_ID, + url: + '/v1/transfers/' + + TRANSFER_TEST_ID + + '/reversals/' + + REVERSAL_TEST_ID, data: {metadata: {key: 'value'}}, headers: {}, }); @@ -69,4 +76,3 @@ describe('TransferReversal Resource', function() { }); }); }); - diff --git a/test/resources/Transfers.spec.js b/test/resources/Transfers.spec.js index 8fc6cdce71..f00ba9defb 100644 --- a/test/resources/Transfers.spec.js +++ b/test/resources/Transfers.spec.js @@ -19,7 +19,9 @@ describe('Transfers Resource', function() { describe('create', function() { it('Sends the correct request', function() { stripe.transfers.create({ - amount: 200, currency: 'usd', recipient: {}, + amount: 200, + currency: 'usd', + recipient: {}, }); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/UsageRecordSummaries.spec.js b/test/resources/UsageRecordSummaries.spec.js index 7f9a1285a3..07b3f1cbb3 100644 --- a/test/resources/UsageRecordSummaries.spec.js +++ b/test/resources/UsageRecordSummaries.spec.js @@ -12,25 +12,31 @@ describe('UsageRecordSummaries Resource', function() { method: 'GET', url: '/v1/subscription_items/si_123/usage_record_summaries', headers: {}, - data: {} + data: {}, }); }); it('Includes any options that were provided', function(done) { - stripe.usageRecordSummaries.list('si_123', {}, { - stripe_account: 'acct_456', - }).then(function(record) { - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/subscription_items/si_123/usage_record_summaries', - headers: { - 'Stripe-Account': 'acct_456' + stripe.usageRecordSummaries + .list( + 'si_123', + {}, + { + stripe_account: 'acct_456', }, - data: {} - }); + ) + .then(function(record) { + expect(stripe.LAST_REQUEST).to.deep.equal({ + method: 'GET', + url: '/v1/subscription_items/si_123/usage_record_summaries', + headers: { + 'Stripe-Account': 'acct_456', + }, + data: {}, + }); - done(); - }); + done(); + }); }); it('Calls a given callback', function(done) { diff --git a/test/resources/UsageRecords.spec.js b/test/resources/UsageRecords.spec.js index 3dc29e4f71..39cf242358 100644 --- a/test/resources/UsageRecords.spec.js +++ b/test/resources/UsageRecords.spec.js @@ -9,7 +9,7 @@ describe('UsageRecords Resource', function() { stripe.usageRecords.create('si_123', { quantity: 123, timestamp: 123321, - action: 'increment' + action: 'increment', }); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -19,44 +19,54 @@ describe('UsageRecords Resource', function() { data: { quantity: 123, timestamp: 123321, - action: 'increment' - } + action: 'increment', + }, }); }); it('Includes any options that were provided', function(done) { - stripe.usageRecords.create('si_123', { - quantity: 123, - timestamp: 123321, - action: 'increment' - }, { - stripe_account: 'acct_456', - }).then(function(record) { - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/subscription_items/si_123/usage_records', - headers: { - 'Stripe-Account': 'acct_456' - }, - data: { + stripe.usageRecords + .create( + 'si_123', + { quantity: 123, timestamp: 123321, - action: 'increment' - } - }); + action: 'increment', + }, + { + stripe_account: 'acct_456', + }, + ) + .then(function(record) { + expect(stripe.LAST_REQUEST).to.deep.equal({ + method: 'POST', + url: '/v1/subscription_items/si_123/usage_records', + headers: { + 'Stripe-Account': 'acct_456', + }, + data: { + quantity: 123, + timestamp: 123321, + action: 'increment', + }, + }); - done(); - }); + done(); + }); }); it('Calls a given callback', function(done) { - stripe.usageRecords.create('si_123', { - quantity: 123, - timestamp: 123321, - action: 'increment' - }, function(error, record) { - done(error); - }); + stripe.usageRecords.create( + 'si_123', + { + quantity: 123, + timestamp: 123321, + action: 'increment', + }, + function(error, record) { + done(error); + }, + ); }); }); }); diff --git a/test/stripe.spec.js b/test/stripe.spec.js index 566cc93ba0..1a06eeb952 100644 --- a/test/stripe.spec.js +++ b/test/stripe.spec.js @@ -2,10 +2,7 @@ var testUtils = require('../testUtils'); var utils = require('../lib/utils'); -var stripe = require('../lib/stripe')( - testUtils.getUserStripeKey(), - 'latest' -); +var stripe = require('../lib/stripe')(testUtils.getUserStripeKey(), 'latest'); var http = require('http'); @@ -22,37 +19,45 @@ describe('Stripe Module', function() { describe('setApiKey', function() { it('uses Bearer auth', function() { - expect(stripe.getApiField('auth')).to.equal('Bearer ' + testUtils.getUserStripeKey()); + expect(stripe.getApiField('auth')).to.equal( + 'Bearer ' + testUtils.getUserStripeKey(), + ); }); }); describe('GetClientUserAgent', function() { it('Should return a user-agent serialized JSON object', function() { - return expect(new Promise(function(resolve, reject) { - stripe.getClientUserAgent(function(c) { - resolve(JSON.parse(c)); - }); - })).to.eventually.have.property('lang', 'node'); + return expect( + new Promise(function(resolve, reject) { + stripe.getClientUserAgent(function(c) { + resolve(JSON.parse(c)); + }); + }), + ).to.eventually.have.property('lang', 'node'); }); }); describe('GetClientUserAgentSeeded', function() { it('Should return a user-agent serialized JSON object', function() { var userAgent = {lang: 'node'}; - return expect(new Promise(function(resolve, reject) { - stripe.getClientUserAgentSeeded(userAgent, function(c) { - resolve(JSON.parse(c)); - }); - })).to.eventually.have.property('lang', 'node'); + return expect( + new Promise(function(resolve, reject) { + stripe.getClientUserAgentSeeded(userAgent, function(c) { + resolve(JSON.parse(c)); + }); + }), + ).to.eventually.have.property('lang', 'node'); }); it('Should URI-encode user-agent fields', function() { var userAgent = {lang: 'ï'}; - return expect(new Promise(function(resolve, reject) { - stripe.getClientUserAgentSeeded(userAgent, function(c) { - resolve(JSON.parse(c)); - }); - })).to.eventually.have.property('lang', '%C3%AF'); + return expect( + new Promise(function(resolve, reject) { + stripe.getClientUserAgentSeeded(userAgent, function(c) { + resolve(JSON.parse(c)); + }); + }), + ).to.eventually.have.property('lang', '%C3%AF'); }); describe('uname', function() { @@ -66,31 +71,37 @@ describe('Stripe Module', function() { it('gets added to the user-agent', function() { utils.safeExec = function(cmd, cb) { - cb(null, 'foøname') + cb(null, 'foøname'); }; - return expect(new Promise(function(resolve, reject) { - stripe.getClientUserAgentSeeded({lang: 'node'}, function(c) { - resolve(JSON.parse(c)); - }); - })).to.eventually.have.property('uname', 'fo%C3%B8name'); + return expect( + new Promise(function(resolve, reject) { + stripe.getClientUserAgentSeeded({lang: 'node'}, function(c) { + resolve(JSON.parse(c)); + }); + }), + ).to.eventually.have.property('uname', 'fo%C3%B8name'); }); it('sets uname to UNKOWN in case of an error', function() { utils.safeExec = function(cmd, cb) { - cb(new Error('security'), null) + cb(new Error('security'), null); }; - return expect(new Promise(function(resolve, reject) { - stripe.getClientUserAgentSeeded({lang: 'node'}, function(c) { - resolve(JSON.parse(c)); - }); - })).to.eventually.have.property('uname', 'UNKNOWN'); + return expect( + new Promise(function(resolve, reject) { + stripe.getClientUserAgentSeeded({lang: 'node'}, function(c) { + resolve(JSON.parse(c)); + }); + }), + ).to.eventually.have.property('uname', 'UNKNOWN'); }); }); }); describe('setTimeout', function() { it('Should define a default equal to the node default', function() { - expect(stripe.getApiField('timeout')).to.equal(http.createServer().timeout); + expect(stripe.getApiField('timeout')).to.equal( + http.createServer().timeout, + ); }); it('Should allow me to set a custom timeout', function() { stripe.setTimeout(900); @@ -98,7 +109,9 @@ describe('Stripe Module', function() { }); it('Should allow me to set null, to reset to the default', function() { stripe.setTimeout(null); - expect(stripe.getApiField('timeout')).to.equal(http.createServer().timeout); + expect(stripe.getApiField('timeout')).to.equal( + http.createServer().timeout, + ); }); }); @@ -165,7 +178,6 @@ describe('Stripe Module', function() { name: 'MyAwesomeApp', partner_id: 'partner_1234', }); - }); it('should ignore any invalid properties', function() { @@ -197,7 +209,9 @@ describe('Stripe Module', function() { stripe.getClientUserAgent(function(uaString) { expect(JSON.parse(uaString).application).to.eql(appInfo); - expect(stripe.getAppInfoAsString()).to.eql(appInfo.name + '/' + appInfo.version + ' (' + appInfo.url + ')'); + expect(stripe.getAppInfoAsString()).to.eql( + appInfo.name + '/' + appInfo.version + ' (' + appInfo.url + ')', + ); done(); }); @@ -207,40 +221,50 @@ describe('Stripe Module', function() { describe('Callback support', function() { describe('Any given endpoint', function() { it('Will call a callback if successful', function() { - return expect(new Promise(function(resolve, reject) { - stripe.customers.create(CUSTOMER_DETAILS, function(err, customer) { - cleanup.deleteCustomer(customer.id); - resolve('Called!'); - }); - })).to.eventually.equal('Called!'); + return expect( + new Promise(function(resolve, reject) { + stripe.customers.create(CUSTOMER_DETAILS, function(err, customer) { + cleanup.deleteCustomer(customer.id); + resolve('Called!'); + }); + }), + ).to.eventually.equal('Called!'); }); it('Will expose HTTP response object', function() { - return expect(new Promise(function(resolve, reject) { - stripe.customers.create(CUSTOMER_DETAILS, function(err, customer) { - cleanup.deleteCustomer(customer.id); + return expect( + new Promise(function(resolve, reject) { + stripe.customers.create(CUSTOMER_DETAILS, function(err, customer) { + cleanup.deleteCustomer(customer.id); - var headers = customer.lastResponse.headers; - expect(headers).to.contain.keys('request-id'); + var headers = customer.lastResponse.headers; + expect(headers).to.contain.keys('request-id'); - expect(customer.lastResponse.requestId).to.match(/^req_/); - expect(customer.lastResponse.statusCode).to.equal(200); + expect(customer.lastResponse.requestId).to.match(/^req_/); + expect(customer.lastResponse.statusCode).to.equal(200); - resolve('Called!'); - }); - })).to.eventually.equal('Called!'); + resolve('Called!'); + }); + }), + ).to.eventually.equal('Called!'); }); it('Given an error the callback will receive it', function() { - return expect(new Promise(function(resolve, reject) { - stripe.customers.createCard('nonExistentCustId', {card: {}}, function(err, customer) { - if (err) { - resolve('ErrorWasPassed'); - } else { - reject(new Error('NoErrorPassed')); - } - }); - })).to.eventually.become('ErrorWasPassed'); + return expect( + new Promise(function(resolve, reject) { + stripe.customers.createCard( + 'nonExistentCustId', + {card: {}}, + function(err, customer) { + if (err) { + resolve('ErrorWasPassed'); + } else { + reject(new Error('NoErrorPassed')); + } + }, + ); + }), + ).to.eventually.become('ErrorWasPassed'); }); }); }); @@ -248,9 +272,11 @@ describe('Stripe Module', function() { describe('errors', function() { it('Exports errors as types', function() { var Stripe = require('../lib/stripe'); - expect(new Stripe.errors.StripeInvalidRequestError({ - message: 'error' - }).type).to.equal('StripeInvalidRequestError'); + expect( + new Stripe.errors.StripeInvalidRequestError({ + message: 'error', + }).type, + ).to.equal('StripeInvalidRequestError'); }); }); diff --git a/test/telemetry.spec.js b/test/telemetry.spec.js index 845d51770a..9e7d02b66b 100644 --- a/test/telemetry.spec.js +++ b/test/telemetry.spec.js @@ -13,9 +13,11 @@ function createTestServer(handlerFunc, cb) { handlerFunc(req, res); } catch (e) { res.writeHead(400, {'Content-Type': 'application/json'}); - res.end(JSON.stringify({ - error: {type: 'invalid_request_error', message: e.message} - })); + res.end( + JSON.stringify({ + error: {type: 'invalid_request_error', message: e.message}, + }), + ); } }); testServer.listen(0, host, function() { @@ -35,117 +37,142 @@ describe('Client Telemetry', function() { it('Does not send telemetry when disabled', function(done) { var numRequests = 0; - createTestServer(function (req, res) { - numRequests += 1; - - var telemetry = req.headers['x-stripe-client-telemetry']; - - switch (numRequests) { - case 1: - case 2: - expect(telemetry).to.not.exist; - break; - default: - expect.fail(`Should not have reached request ${numRequests}`); - } - - res.setHeader('Request-Id', `req_${numRequests}`); - res.writeHead(200, {'Content-Type': 'application/json'}); - res.end('{}'); - }, function(host, port) { - const stripe = require('../lib/stripe')('sk_test_FEiILxKZwnmmocJDUjUNO6pa') - stripe.setHost(host, port, 'http'); - - stripe.balance.retrieve().then(function (res) { - return stripe.balance.retrieve(); - }).then(function (res) { - expect(numRequests).to.equal(2); - done(); - }).catch(done); - }); + createTestServer( + function(req, res) { + numRequests += 1; + + var telemetry = req.headers['x-stripe-client-telemetry']; + + switch (numRequests) { + case 1: + case 2: + expect(telemetry).to.not.exist; + break; + default: + expect.fail(`Should not have reached request ${numRequests}`); + } + + res.setHeader('Request-Id', `req_${numRequests}`); + res.writeHead(200, {'Content-Type': 'application/json'}); + res.end('{}'); + }, + function(host, port) { + const stripe = require('../lib/stripe')( + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + ); + stripe.setHost(host, port, 'http'); + + stripe.balance + .retrieve() + .then(function(res) { + return stripe.balance.retrieve(); + }) + .then(function(res) { + expect(numRequests).to.equal(2); + done(); + }) + .catch(done); + }, + ); }); it('Sends client telemetry on the second request when enabled', function(done) { var numRequests = 0; - createTestServer(function (req, res) { - numRequests += 1; - - var telemetry = req.headers['x-stripe-client-telemetry']; - - switch (numRequests) { - case 1: - expect(telemetry).to.not.exist; - break; - case 2: - expect(telemetry).to.exist; - expect(JSON.parse(telemetry).last_request_metrics.request_id) - .to.equal('req_1'); - break; - default: - expect.fail(`Should not have reached request ${numRequests}`); - } - - res.setHeader('Request-Id', `req_${numRequests}`); - res.writeHead(200, {'Content-Type': 'application/json'}); - res.end('{}'); - }, function(host, port) { - const stripe = require('../lib/stripe')('sk_test_FEiILxKZwnmmocJDUjUNO6pa') - stripe.setTelemetryEnabled(true); - stripe.setHost(host, port, 'http'); - - stripe.balance.retrieve().then(function (res) { - return stripe.balance.retrieve(); - }).then(function (res) { - expect(numRequests).to.equal(2); - done(); - }).catch(done); - }); + createTestServer( + function(req, res) { + numRequests += 1; + + var telemetry = req.headers['x-stripe-client-telemetry']; + + switch (numRequests) { + case 1: + expect(telemetry).to.not.exist; + break; + case 2: + expect(telemetry).to.exist; + expect( + JSON.parse(telemetry).last_request_metrics.request_id, + ).to.equal('req_1'); + break; + default: + expect.fail(`Should not have reached request ${numRequests}`); + } + + res.setHeader('Request-Id', `req_${numRequests}`); + res.writeHead(200, {'Content-Type': 'application/json'}); + res.end('{}'); + }, + function(host, port) { + const stripe = require('../lib/stripe')( + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + ); + stripe.setTelemetryEnabled(true); + stripe.setHost(host, port, 'http'); + + stripe.balance + .retrieve() + .then(function(res) { + return stripe.balance.retrieve(); + }) + .then(function(res) { + expect(numRequests).to.equal(2); + done(); + }) + .catch(done); + }, + ); }); it('Buffers metrics on concurrent requests', function(done) { var numRequests = 0; - createTestServer(function (req, res) { - numRequests += 1; - - var telemetry = req.headers['x-stripe-client-telemetry']; - - switch (numRequests) { - case 1: - case 2: - expect(telemetry).to.not.exist; - break; - case 3: - case 4: - expect(telemetry).to.exist; - expect(JSON.parse(telemetry).last_request_metrics.request_id) - .to.be.oneOf(['req_1', 'req_2']); - break; - default: - expect.fail(`Should not have reached request ${numRequests}`); - } - - res.setHeader('Request-Id', `req_${numRequests}`); - res.writeHead(200, {'Content-Type': 'application/json'}); - res.end('{}'); - }, function(host, port) { - const stripe = require('../lib/stripe')('sk_test_FEiILxKZwnmmocJDUjUNO6pa') - stripe.setTelemetryEnabled(true); - stripe.setHost(host, port, 'http'); - - Promise.all([ - stripe.balance.retrieve(), - stripe.balance.retrieve() - ]).then(function() { - return Promise.all([ - stripe.balance.retrieve(), - stripe.balance.retrieve() - ]); - }).then(function() { - expect(numRequests).to.equal(4); - done(); - }).catch(done); - }); + createTestServer( + function(req, res) { + numRequests += 1; + + var telemetry = req.headers['x-stripe-client-telemetry']; + + switch (numRequests) { + case 1: + case 2: + expect(telemetry).to.not.exist; + break; + case 3: + case 4: + expect(telemetry).to.exist; + expect( + JSON.parse(telemetry).last_request_metrics.request_id, + ).to.be.oneOf(['req_1', 'req_2']); + break; + default: + expect.fail(`Should not have reached request ${numRequests}`); + } + + res.setHeader('Request-Id', `req_${numRequests}`); + res.writeHead(200, {'Content-Type': 'application/json'}); + res.end('{}'); + }, + function(host, port) { + const stripe = require('../lib/stripe')( + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + ); + stripe.setTelemetryEnabled(true); + stripe.setHost(host, port, 'http'); + + Promise.all([stripe.balance.retrieve(), stripe.balance.retrieve()]) + .then(function() { + return Promise.all([ + stripe.balance.retrieve(), + stripe.balance.retrieve(), + ]); + }) + .then(function() { + expect(numRequests).to.equal(4); + done(); + }) + .catch(done); + }, + ); }); }); diff --git a/test/utils.spec.js b/test/utils.spec.js index f406535825..1186d4887d 100644 --- a/test/utils.spec.js +++ b/test/utils.spec.js @@ -11,89 +11,98 @@ describe('utils', function() { it('Interpolates values into a prepared template', function() { var template = utils.makeURLInterpolator('/some/url/{foo}/{baz}?ok=1'); - expect( - template({foo: 1, baz: 2}) - ).to.equal('/some/url/1/2?ok=1'); + expect(template({foo: 1, baz: 2})).to.equal('/some/url/1/2?ok=1'); - expect( - template({foo: '', baz: ''}) - ).to.equal('/some/url//?ok=1'); + expect(template({foo: '', baz: ''})).to.equal('/some/url//?ok=1'); expect( // Test encoding: - template({foo: 'FOO', baz: '__::baz::__'}) + template({foo: 'FOO', baz: '__::baz::__'}), ).to.equal('/some/url/FOO/__%3A%3Abaz%3A%3A__?ok=1'); }); }); describe('stringifyRequestData', function() { it('Handles basic types', function() { - expect(utils.stringifyRequestData({ - a: 1, - b: 'foo', - })).to.equal('a=1&b=foo'); + expect( + utils.stringifyRequestData({ + a: 1, + b: 'foo', + }), + ).to.equal('a=1&b=foo'); }); it('Handles Dates', function() { - expect(utils.stringifyRequestData({ - date: new Date('2009-02-13T23:31:30Z'), - created: { - gte: new Date('2009-02-13T23:31:30Z'), - lt: new Date('2044-05-01T01:28:21Z'), - }, - })).to.equal([ - 'date=1234567890', - 'created[gte]=1234567890', - 'created[lt]=2345678901' - ].join('&')); + expect( + utils.stringifyRequestData({ + date: new Date('2009-02-13T23:31:30Z'), + created: { + gte: new Date('2009-02-13T23:31:30Z'), + lt: new Date('2044-05-01T01:28:21Z'), + }, + }), + ).to.equal( + [ + 'date=1234567890', + 'created[gte]=1234567890', + 'created[lt]=2345678901', + ].join('&'), + ); }); it('Handles deeply nested object', function() { - expect(utils.stringifyRequestData({ - a: { - b: { - c: { - d: 2, + expect( + utils.stringifyRequestData({ + a: { + b: { + c: { + d: 2, + }, }, }, - }, - })).to.equal('a[b][c][d]=2'); + }), + ).to.equal('a[b][c][d]=2'); }); it('Handles arrays of objects', function() { - expect(utils.stringifyRequestData({ - a: [ - {b: 'c'}, - {b: 'd'}, - ], - })).to.equal('a[0][b]=c&a[1][b]=d'); - }) + expect( + utils.stringifyRequestData({ + a: [{b: 'c'}, {b: 'd'}], + }), + ).to.equal('a[0][b]=c&a[1][b]=d'); + }); it('Handles indexed arrays', function() { - expect(utils.stringifyRequestData({ - a: { - 0: {b: 'c'}, - 1: {b: 'd'}, - }, - })).to.equal('a[0][b]=c&a[1][b]=d'); - }) + expect( + utils.stringifyRequestData({ + a: { + 0: {b: 'c'}, + 1: {b: 'd'}, + }, + }), + ).to.equal('a[0][b]=c&a[1][b]=d'); + }); it('Creates a string from an object, handling shallow nested objects', function() { - expect(utils.stringifyRequestData({ - test: 1, - foo: 'baz', - somethingElse: '::""%&', - nested: { - 1: 2, - 'a n o t h e r': null, - }, - })).to.equal([ - 'test=1', - 'foo=baz', - 'somethingElse=%3A%3A%22%22%25%26', - 'nested[1]=2', - 'nested[a%20n%20o%20t%20h%20e%20r]=', - ].join('&')); + expect( + utils.stringifyRequestData({ + test: 1, + foo: 'baz', + somethingElse: '::""%&', + nested: { + 1: 2, + 'a n o t h e r': null, + }, + }), + ).to.equal( + [ + 'test=1', + 'foo=baz', + 'somethingElse=%3A%3A%22%22%25%26', + 'nested[1]=2', + 'nested[a%20n%20o%20t%20h%20e%20r]=', + ].join('&'), + ); }); }); @@ -125,28 +134,34 @@ describe('utils', function() { it('ignores a hash with only options', function(done) { var args = [{api_key: 'foo'}]; - handleWarnings(function() { - expect(utils.getDataFromArgs(args)).to.deep.equal({}); - expect(args.length).to.equal(1); + handleWarnings( + function() { + expect(utils.getDataFromArgs(args)).to.deep.equal({}); + expect(args.length).to.equal(1); - done(); - }, function(message) { - throw new Error('Should not have warned, but did: ' + message); - }); + done(); + }, + function(message) { + throw new Error('Should not have warned, but did: ' + message); + }, + ); }); it('warns if the hash contains both data and options', function(done) { var args = [{foo: 'bar', api_key: 'foo', idempotency_key: 'baz'}]; - handleWarnings(function() { - utils.getDataFromArgs(args); - }, function(message) { - expect(message).to.equal( - 'Stripe: Options found in arguments (api_key, idempotency_key).' + - ' Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.' - ); + handleWarnings( + function() { + utils.getDataFromArgs(args); + }, + function(message) { + expect(message).to.equal( + 'Stripe: Options found in arguments (api_key, idempotency_key).' + + ' Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.', + ); - done(); - }); + done(); + }, + ); }); it('finds the data', function() { var args = [{foo: 'bar'}, {api_key: 'foo'}]; @@ -203,11 +218,14 @@ describe('utils', function() { expect(args.length).to.equal(1); }); it('parses an idempotency key and api key and api version (with data)', function() { - var args = [{foo: 'bar'}, { - api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - idempotency_key: 'foo', - stripe_version: '2010-01-10', - },]; + var args = [ + {foo: 'bar'}, + { + api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', + idempotency_key: 'foo', + stripe_version: '2010-01-10', + }, + ]; expect(utils.getOptionsFromArgs(args)).to.deep.equal({ auth: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', headers: { @@ -218,11 +236,13 @@ describe('utils', function() { expect(args.length).to.equal(1); }); it('parses an idempotency key and api key and api version', function() { - var args = [{ - api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - idempotency_key: 'foo', - stripe_version: 'hunter2', - },]; + var args = [ + { + api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', + idempotency_key: 'foo', + stripe_version: 'hunter2', + }, + ]; expect(utils.getOptionsFromArgs(args)).to.deep.equal({ auth: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', headers: { @@ -233,23 +253,29 @@ describe('utils', function() { expect(args.length).to.equal(0); }); it('warns if the hash contains something that does not belong', function(done) { - var args = [{foo: 'bar'}, { - api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - idempotency_key: 'foo', - stripe_version: '2010-01-10', - fishsticks: true, - custard: true, - },]; - - handleWarnings(function() { - utils.getOptionsFromArgs(args); - }, function(message) { - expect(message).to.equal( - 'Stripe: Invalid options found (fishsticks, custard); ignoring.' - ); - - done(); - }); + var args = [ + {foo: 'bar'}, + { + api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', + idempotency_key: 'foo', + stripe_version: '2010-01-10', + fishsticks: true, + custard: true, + }, + ]; + + handleWarnings( + function() { + utils.getOptionsFromArgs(args); + }, + function(message) { + expect(message).to.equal( + 'Stripe: Invalid options found (fishsticks, custard); ignoring.', + ); + + done(); + }, + ); }); }); @@ -263,25 +289,31 @@ describe('utils', function() { }); it('throws an error if not given two things to compare', function() { - expect(function() { utils.secureCompare('potato'); }).to.throw(); + expect(function() { + utils.secureCompare('potato'); + }).to.throw(); }); }); describe('removeEmpty', function() { it('removes empty properties and leaves non-empty ones', function() { - expect(utils.removeEmpty({ - cat: 3, - dog: false, - rabbit: undefined, - pointer: null, - })).to.eql({ + expect( + utils.removeEmpty({ + cat: 3, + dog: false, + rabbit: undefined, + pointer: null, + }), + ).to.eql({ cat: 3, dog: false, }); }); it('throws an error if not given two things to compare', function() { - expect(function() { utils.removeEmpty('potato'); }).to.throw(); + expect(function() { + utils.removeEmpty('potato'); + }).to.throw(); }); }); @@ -298,76 +330,76 @@ describe('utils', function() { var calls = []; utils._exec = function(cmd, cb) { calls.push([cmd, cb]); - } + }; function myCb() {} utils.safeExec('hello', myCb); - expect(calls).to.deep.equal([ - ['hello', myCb], - ]); + expect(calls).to.deep.equal([['hello', myCb]]); }); it('passes along normal errors', function() { var myErr = Error('hi'); utils._exec = function(cmd, cb) { - cb(myErr, null) - } + cb(myErr, null); + }; var calls = []; function myCb(err, x) { calls.push([err, x]); } utils.safeExec('hello', myCb); - expect(calls).to.deep.equal([ - [myErr, null], - ]); + expect(calls).to.deep.equal([[myErr, null]]); }); it('passes along thrown errors as normal callback errors', function() { var myErr = Error('hi'); utils._exec = function(cmd, cb) { throw myErr; - } + }; var calls = []; function myCb(err, x) { calls.push([err, x]); } utils.safeExec('hello', myCb); - expect(calls).to.deep.equal([ - [myErr, null], - ]); + expect(calls).to.deep.equal([[myErr, null]]); }); - }) + }); describe('flattenAndStringify', function() { it('Stringifies primitive types', function() { - expect(utils.flattenAndStringify({ - a: 1, - b: 'foo', - c: true, - d: null, - })).to.eql({'a': '1', 'b': 'foo', 'c': 'true', 'd': 'null'}); + expect( + utils.flattenAndStringify({ + a: 1, + b: 'foo', + c: true, + d: null, + }), + ).to.eql({a: '1', b: 'foo', c: 'true', d: 'null'}); }); it('Flattens nested values', function() { - expect(utils.flattenAndStringify({ - x: { - a: 1, - b: 'foo', - }, - })).to.eql({'x[a]': '1', 'x[b]': 'foo'}); + expect( + utils.flattenAndStringify({ + x: { + a: 1, + b: 'foo', + }, + }), + ).to.eql({'x[a]': '1', 'x[b]': 'foo'}); }); it('Does not flatten File objects', function() { - expect(utils.flattenAndStringify({ - file: { - data: 'foo' - }, - x: { - a: 1, - }, - })).to.eql({'file': {data: 'foo'}, 'x[a]': '1'}); + expect( + utils.flattenAndStringify({ + file: { + data: 'foo', + }, + x: { + a: 1, + }, + }), + ).to.eql({file: {data: 'foo'}, 'x[a]': '1'}); }); it('Does not flatten Buffer objects', function() { @@ -401,7 +433,8 @@ function handleWarnings(doWithShimmedConsoleWarn, onWarn) { /* eslint-enable no-console */ } else { - function onProcessWarn(warning) { /* eslint-disable-line no-inner-declarations */ + function onProcessWarn(warning) { + /* eslint-disable-line no-inner-declarations */ onWarn(warning.name + ': ' + warning.message); } @@ -411,6 +444,6 @@ function handleWarnings(doWithShimmedConsoleWarn, onWarn) { process.nextTick(function() { process.removeListener('warning', onProcessWarn); - }) + }); } } diff --git a/testUtils/index.js b/testUtils/index.js index 9d885ff456..2bf3d00c2d 100644 --- a/testUtils/index.js +++ b/testUtils/index.js @@ -8,10 +8,10 @@ require('chai').use(require('chai-as-promised')); var ResourceNamespace = require('../lib/ResourceNamespace').ResourceNamespace; -var utils = module.exports = { - +var utils = (module.exports = { getUserStripeKey: function() { - var key = process.env.STRIPE_TEST_API_KEY || 'tGN0bIwXnHdwOa85VABjPdSn8nWY7G7I'; + var key = + process.env.STRIPE_TEST_API_KEY || 'tGN0bIwXnHdwOa85VABjPdSn8nWY7G7I'; return key; }, @@ -43,12 +43,12 @@ var utils = module.exports = { function patchRequest(stripeInstance, instance) { instance._request = function(method, host, url, data, auth, options, cb) { - var req = stripeInstance.LAST_REQUEST = { + var req = (stripeInstance.LAST_REQUEST = { method: method, url: url, data: data, headers: options.headers || {}, - }; + }); if (auth) { req.auth = auth; } @@ -76,7 +76,7 @@ var utils = module.exports = { this._cleanupFns = []; this._stripe = require('../lib/stripe')( utils.getUserStripeKey(), - 'latest' + 'latest', ); afterEach(function(done) { this.timeout(timeout || CleanupUtility.DEFAULT_TIMEOUT); @@ -85,26 +85,30 @@ var utils = module.exports = { } CleanupUtility.prototype = { - doCleanup: function(done) { var cleanups = this._cleanupFns; var total = cleanups.length; var completed = 0; - for (var fn; (fn = cleanups.shift());) { + for (var fn; (fn = cleanups.shift()); ) { var promise = fn.call(this); if (!promise || !promise.then) { - throw new Error('CleanupUtility expects cleanup functions to return promises!'); + throw new Error( + 'CleanupUtility expects cleanup functions to return promises!', + ); } - promise.then(function() { - // cleanup successful - completed += 1; - if (completed === total) { - done(); - } - }, function(err) { - // not successful - throw err; - }); + promise.then( + function() { + // cleanup successful + completed += 1; + if (completed === total) { + done(); + } + }, + function(err) { + // not successful + throw err; + }, + ); } if (total === 0) { done(); @@ -136,13 +140,15 @@ var utils = module.exports = { }; return CleanupUtility; - }()), + })(), /** - * Get a random string for test Object creation - */ + * Get a random string for test Object creation + */ getRandomString: function() { - return Math.random().toString(36).slice(2); + return Math.random() + .toString(36) + .slice(2); }, envSupportsForAwait: function() { @@ -157,5 +163,4 @@ var utils = module.exports = { return false; } }, - -}; +}); From 173a102048fce204e4eb36c9c329c802859a6163 Mon Sep 17 00:00:00 2001 From: Bryan Irace Date: Fri, 3 May 2019 11:12:56 -0700 Subject: [PATCH 07/10] ES5 commas as per rattrayalex --- .prettierrc | 4 +- examples/webhook-signing/express.js | 2 +- lib/MultipartDataGenerator.js | 2 +- lib/StripeMethod.basic.js | 14 ++-- lib/StripeMethod.js | 4 +- lib/StripeResource.js | 20 +++--- lib/Webhooks.js | 8 +-- lib/autoPagination.js | 16 ++--- lib/makeRequest.js | 10 +-- lib/resources/EphemeralKeys.js | 2 +- lib/resources/Files.js | 2 +- lib/stripe.js | 2 +- lib/utils.js | 8 +-- test/Error.spec.js | 8 +-- test/StripeResource.spec.js | 20 +++--- test/Webhook.spec.js | 42 ++++++------ test/autoPagination.spec.js | 62 ++++++++--------- test/flows.spec.js | 70 ++++++++++---------- test/resources/Account.spec.js | 16 ++--- test/resources/ApplicationFees.spec.js | 4 +- test/resources/Balance.spec.js | 2 +- test/resources/Charges.spec.js | 10 +-- test/resources/CustomerSubscriptions.spec.js | 2 +- test/resources/Customers.spec.js | 28 ++++---- test/resources/EphemeralKeys.spec.js | 6 +- test/resources/FileUploads.spec.js | 8 +-- test/resources/Files.spec.js | 8 +-- test/resources/Recipients.spec.js | 6 +- test/resources/SubscriptionSchedule.spec.js | 2 +- test/resources/UsageRecordSummaries.spec.js | 2 +- test/resources/UsageRecords.spec.js | 4 +- test/stripe.spec.js | 28 ++++---- test/telemetry.spec.js | 18 ++--- test/utils.spec.js | 36 +++++----- testUtils/index.js | 6 +- 35 files changed, 241 insertions(+), 241 deletions(-) diff --git a/.prettierrc b/.prettierrc index 18a383f970..c1d1f967c6 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,6 @@ { "arrowParens": "always", - "trailingComma": "all", + "trailingComma": "es5", "bracketSpacing": false, "singleQuote": true -} \ No newline at end of file +} diff --git a/examples/webhook-signing/express.js b/examples/webhook-signing/express.js index 29be911f56..f011e631ca 100644 --- a/examples/webhook-signing/express.js +++ b/examples/webhook-signing/express.js @@ -34,7 +34,7 @@ app.post( // Return a response to acknowledge receipt of the event res.json({received: true}); - }, + } ); app.listen(3000, function() { diff --git a/lib/MultipartDataGenerator.js b/lib/MultipartDataGenerator.js index ca32203a33..dbdc0e22ba 100644 --- a/lib/MultipartDataGenerator.js +++ b/lib/MultipartDataGenerator.js @@ -34,7 +34,7 @@ function multipartDataGenerator(method, data, headers) { 'Content-Disposition: form-data; name=' + q(k) + '; filename=' + - q(v.name || 'blob'), + q(v.name || 'blob') ); push('Content-Type: ' + (v.type || 'application/octet-stream')); push(''); diff --git a/lib/StripeMethod.basic.js b/lib/StripeMethod.basic.js index 6cda377c41..cad47caaa5 100644 --- a/lib/StripeMethod.basic.js +++ b/lib/StripeMethod.basic.js @@ -80,7 +80,7 @@ module.exports = { return reject(err); } sendMetadata(data, auth); - }, + } ); } @@ -100,12 +100,12 @@ module.exports = { } else { resolve(response.metadata); } - }, + } ); } - }.bind(this), + }.bind(this) ), - cb, + cb ); }, @@ -123,7 +123,7 @@ module.exports = { function(resolve, reject) { this._request('GET', null, path, {}, auth, {}, function( err, - response, + response ) { if (err) { reject(err); @@ -131,9 +131,9 @@ module.exports = { resolve(response.metadata); } }); - }.bind(this), + }.bind(this) ), - cb, + cb ); }, }; diff --git a/lib/StripeMethod.js b/lib/StripeMethod.js index a79033a918..461cee3756 100644 --- a/lib/StripeMethod.js +++ b/lib/StripeMethod.js @@ -28,7 +28,7 @@ function stripeMethod(spec) { var requestPromise = utils.callbackifyPromiseWithTimeout( makeRequest(self, args, spec, {}), - callback, + callback ); if (spec.methodType === 'list') { @@ -36,7 +36,7 @@ function stripeMethod(spec) { self, args, spec, - requestPromise, + requestPromise ); Object.assign(requestPromise, autoPaginationMethods); } diff --git a/lib/StripeResource.js b/lib/StripeResource.js index 6d8423d3ac..e6f39bdd18 100644 --- a/lib/StripeResource.js +++ b/lib/StripeResource.js @@ -30,7 +30,7 @@ function StripeResource(stripe, urlData) { this._urlData = urlData || {}; this.basePath = utils.makeURLInterpolator( - this.basePath || stripe.getApiField('basePath'), + this.basePath || stripe.getApiField('basePath') ); this.resourcePath = this.path; this.path = utils.makeURLInterpolator(this.path); @@ -67,7 +67,7 @@ StripeResource.prototype = { .join( this.basePath(urlData), this.path(urlData), - typeof commandPath == 'function' ? commandPath(urlData) : commandPath, + typeof commandPath == 'function' ? commandPath(urlData) : commandPath ) .replace(/\\/g, '/'); // ugly workaround for Windows }, @@ -112,7 +112,7 @@ StripeResource.prototype = { 'Request aborted due to timeout being reached (' + timeout + 'ms)', detail: timeoutErr, }), - null, + null ); }; }, @@ -188,7 +188,7 @@ StripeResource.prototype = { exception: e, requestId: headers['request-id'], }), - null, + null ); } @@ -227,7 +227,7 @@ StripeResource.prototype = { message: self._generateConnectionErrorMessage(requestRetries), detail: error, }), - null, + null ); }; }, @@ -266,7 +266,7 @@ StripeResource.prototype = { // maxNetworkRetryDelay. var sleepSeconds = Math.min( initialNetworkRetryDelay * Math.pow(numRetries - 1, 2), - maxNetworkRetryDelay, + maxNetworkRetryDelay ); // Apply some jitter by randomizing the value in the range of @@ -322,7 +322,7 @@ StripeResource.prototype = { StripeResource.MAX_BUFFERED_REQUEST_METRICS ) { utils.emitWarning( - 'Request metrics buffer is full, dropping telemetry message.', + 'Request metrics buffer is full, dropping telemetry message.' ); } else { this._stripe._prevRequestMetrics.push({ @@ -367,7 +367,7 @@ StripeResource.prototype = { method, data, options.headers, - makeRequestWithData, + makeRequestWithData ); } else { makeRequestWithData(null, utils.stringifyRequestData(data || {})); @@ -381,7 +381,7 @@ StripeResource.prototype = { self._getSleepTimeInMS(requestRetries), apiVersion, headers, - requestRetries, + requestRetries ); } @@ -453,7 +453,7 @@ StripeResource.prototype = { // Send payload; we're safe: req.write(requestData); req.end(); - }, + } ); } else { // we're already connected diff --git a/lib/Webhooks.js b/lib/Webhooks.js index 9bec6550c2..2543761b87 100644 --- a/lib/Webhooks.js +++ b/lib/Webhooks.js @@ -14,7 +14,7 @@ var Webhook = { payload, header, secret, - tolerance || Webhook.DEFAULT_TOLERANCE, + tolerance || Webhook.DEFAULT_TOLERANCE ); var jsonPayload = JSON.parse(payload); @@ -60,11 +60,11 @@ var signature = { var expectedSignature = this._computeSignature( details.timestamp + '.' + payload, - secret, + secret ); var signatureFound = !!details.signatures.filter( - utils.secureCompare.bind(utils, expectedSignature), + utils.secureCompare.bind(utils, expectedSignature) ).length; if (!signatureFound) { @@ -118,7 +118,7 @@ function parseHeader(header, scheme) { { timestamp: -1, signatures: [], - }, + } ); } diff --git a/lib/autoPagination.js b/lib/autoPagination.js index e060afdf96..f54d5504dd 100644 --- a/lib/autoPagination.js +++ b/lib/autoPagination.js @@ -17,7 +17,7 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { ) ) { throw Error( - 'Unexpected: Stripe API response does not have a well-formed `data` array.', + 'Unexpected: Stripe API response does not have a well-formed `data` array.' ); } @@ -90,7 +90,7 @@ function getDoneCallback(args) { if (typeof onDone !== 'function') { throw Error( 'The second argument to autoPagingEach, if present, must be a callback function; receieved ' + - typeof onDone, + typeof onDone ); } return onDone; @@ -115,7 +115,7 @@ function getItemCallback(args) { if (typeof onItem !== 'function') { throw Error( 'The first argument to autoPagingEach, if present, must be a callback function; receieved ' + - typeof onItem, + typeof onItem ); } @@ -127,7 +127,7 @@ function getItemCallback(args) { if (onItem.length > 2) { throw Error( 'The `onItem` callback function passed to autoPagingEach must accept at most two arguments; got ' + - onItem, + onItem ); } @@ -147,7 +147,7 @@ function getLastId(listResult) { var lastId = lastItem && lastItem.id; if (!lastId) { throw Error( - 'Unexpected: No `id` found on the last item while auto-paging a list.', + 'Unexpected: No `id` found on the last item while auto-paging a list.' ); } return lastId; @@ -180,7 +180,7 @@ function makeAutoPagingEach(asyncIteratorNext) { var autoPagePromise = wrapAsyncIteratorWithCallback( asyncIteratorNext, - onItem, + onItem ); return utils.callbackifyPromiseWithTimeout(autoPagePromise, onDone); }; @@ -191,12 +191,12 @@ function makeAutoPagingToArray(autoPagingEach) { var limit = opts && opts.limit; if (!limit) { throw Error( - 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.', + 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.' ); } if (limit > 10000) { throw Error( - 'You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.', + 'You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.' ); } var promise = new Promise(function(resolve, reject) { diff --git a/lib/makeRequest.js b/lib/makeRequest.js index 9d55d90970..1f5ea60664 100644 --- a/lib/makeRequest.js +++ b/lib/makeRequest.js @@ -44,7 +44,7 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { requestMethod + ' ' + path + - '`)', + '`)' ); } @@ -64,7 +64,7 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { requestMethod + ' ' + path + - '`)', + '`)' ); } @@ -88,7 +88,7 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { requestMethod + ' `' + path + - '`)', + '`)' ); } @@ -125,7 +125,7 @@ function makeRequest(self, requestArgs, spec, overrideData) { resolve( spec.transformResponseData ? spec.transformResponseData(response) - : response, + : response ); } } @@ -137,7 +137,7 @@ function makeRequest(self, requestArgs, spec, overrideData) { opts.data, opts.auth, {headers: opts.headers}, - requestCallback, + requestCallback ); }); } diff --git a/lib/resources/EphemeralKeys.js b/lib/resources/EphemeralKeys.js index 002cce7ec4..7280a69fda 100644 --- a/lib/resources/EphemeralKeys.js +++ b/lib/resources/EphemeralKeys.js @@ -9,7 +9,7 @@ module.exports = StripeResource.extend({ validator: function(data, options) { if (!options.headers || !options.headers['Stripe-Version']) { throw new Error( - 'stripe_version must be specified to create an ephemeral key', + 'stripe_version must be specified to create an ephemeral key' ); } }, diff --git a/lib/resources/Files.js b/lib/resources/Files.js index 8e8f850b37..4fd258fea4 100644 --- a/lib/resources/Files.js +++ b/lib/resources/Files.js @@ -61,7 +61,7 @@ module.exports = StripeResource.extend({ 'An error occurred while attempting to process the file for upload.', detail: error, }), - null, + null ); }; } diff --git a/lib/stripe.js b/lib/stripe.js index 4b98b5cb1d..46ed677b63 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -201,7 +201,7 @@ Stripe.prototype = { setTimeout: function(timeout) { this._setApiField( 'timeout', - timeout == null ? Stripe.DEFAULT_TIMEOUT : timeout, + timeout == null ? Stripe.DEFAULT_TIMEOUT : timeout ); }, diff --git a/lib/utils.js b/lib/utils.js index a439678b84..9cbfe9b918 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -105,7 +105,7 @@ var utils = (module.exports = { 'Options found in arguments (' + optionKeysInArgs.join(', ') + '). Did you mean to pass an options ' + - 'object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.', + 'object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.' ); } @@ -133,7 +133,7 @@ var utils = (module.exports = { if (extraKeys.length) { emitWarning( - 'Invalid options found (' + extraKeys.join(', ') + '); ignoring.', + 'Invalid options found (' + extraKeys.join(', ') + '); ignoring.' ); } @@ -246,7 +246,7 @@ var utils = (module.exports = { setTimeout(function() { callback(err, null); }, 0); - }, + } ); } @@ -323,7 +323,7 @@ var utils = (module.exports = { function emitWarning(warning) { if (typeof process.emitWarning !== 'function') { return console.warn( - 'Stripe: ' + warning, + 'Stripe: ' + warning ); /* eslint-disable-line no-console */ } diff --git a/test/Error.spec.js b/test/Error.spec.js index 872d2deef3..100618c7b0 100644 --- a/test/Error.spec.js +++ b/test/Error.spec.js @@ -16,16 +16,16 @@ describe('Error', function() { describe('StripeError', function() { it('Generates specific instance depending on error-type', function() { expect(Error.StripeError.generate({type: 'card_error'})).to.be.instanceOf( - Error.StripeCardError, + Error.StripeCardError ); expect( - Error.StripeError.generate({type: 'invalid_request_error'}), + Error.StripeError.generate({type: 'invalid_request_error'}) ).to.be.instanceOf(Error.StripeInvalidRequestError); expect(Error.StripeError.generate({type: 'api_error'})).to.be.instanceOf( - Error.StripeAPIError, + Error.StripeAPIError ); expect( - Error.StripeError.generate({type: 'idempotency_error'}), + Error.StripeError.generate({type: 'idempotency_error'}) ).to.be.instanceOf(Error.StripeIdempotencyError); }); diff --git a/test/StripeResource.spec.js b/test/StripeResource.spec.js index c902cac18f..9b30bbb779 100644 --- a/test/StripeResource.spec.js +++ b/test/StripeResource.spec.js @@ -26,7 +26,7 @@ describe('StripeResource', function() { var headers = stripe.invoices._defaultHeaders( 'anotherFakeAuthToken', 0, - null, + null ); expect(headers.Authorization).to.equal('Bearer anotherFakeAuthToken'); }); @@ -68,7 +68,7 @@ describe('StripeResource', function() { realStripe.invoices.retrieveUpcoming('cus_123', options.data, function( err, - response, + response ) { done(); scope.done(); @@ -93,7 +93,7 @@ describe('StripeResource', function() { realStripe.subscriptions.update('sub_123', options.data, function( err, - response, + response ) { done(); scope.done(); @@ -156,7 +156,7 @@ describe('StripeResource', function() { realStripe.charges.create(options.data, function(err) { var errorMessage = realStripe.invoices._generateConnectionErrorMessage( - 1, + 1 ); expect(err.message).to.equal(errorMessage); expect(err.detail.message).to.deep.equal('worse stuff'); @@ -389,7 +389,7 @@ describe('StripeResource', function() { function() { expect(headers['idempotency-key']).to.equal(key); done(); - }, + } ); }); }); @@ -401,7 +401,7 @@ describe('StripeResource', function() { { statusCode: 409, }, - 1, + 1 ); expect(res).to.equal(false); @@ -413,7 +413,7 @@ describe('StripeResource', function() { { statusCode: 409, }, - 0, + 0 ); expect(res).to.equal(true); @@ -425,7 +425,7 @@ describe('StripeResource', function() { { statusCode: 409, }, - 0, + 0 ); expect(res).to.equal(true); @@ -434,7 +434,7 @@ describe('StripeResource', function() { { statusCode: 503, }, - 0, + 0 ); expect(res).to.equal(true); @@ -449,7 +449,7 @@ describe('StripeResource', function() { statusCode: 200, req: {_requestEvent: {method: 'POST'}}, }, - 1, + 1 ); expect(res).to.equal(false); diff --git a/test/Webhook.spec.js b/test/Webhook.spec.js index cd58d41d98..2ba87061a9 100644 --- a/test/Webhook.spec.js +++ b/test/Webhook.spec.js @@ -22,7 +22,7 @@ describe('Webhooks', function() { var event = stripe.webhooks.constructEvent( EVENT_PAYLOAD_STRING, header, - SECRET, + SECRET ); expect(event.id).to.equal(EVENT_PAYLOAD.id); @@ -36,7 +36,7 @@ describe('Webhooks', function() { stripe.webhooks.constructEvent( '} I am not valid JSON; 123][', header, - SECRET, + SECRET ); }).to.throw(/Unexpected token/); }); @@ -60,7 +60,7 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, header, - SECRET, + SECRET ); }).to.throw(expectedMessage); @@ -68,7 +68,7 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, null, - SECRET, + SECRET ); }).to.throw(expectedMessage); @@ -76,7 +76,7 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, undefined, - SECRET, + SECRET ); }).to.throw(expectedMessage); @@ -84,7 +84,7 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, '', - SECRET, + SECRET ); }).to.throw(expectedMessage); }); @@ -98,7 +98,7 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, header, - SECRET, + SECRET ); }).to.throw(/No signatures found with expected scheme/); }); @@ -112,10 +112,10 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, header, - SECRET, + SECRET ); }).to.throw( - /No signatures found matching the expected signature for payload/, + /No signatures found matching the expected signature for payload/ ); }); @@ -129,7 +129,7 @@ describe('Webhooks', function() { EVENT_PAYLOAD_STRING, header, SECRET, - 10, + 10 ); }).to.throw(/Timestamp outside the tolerance zone/); }); @@ -147,10 +147,10 @@ describe('Webhooks', function() { EVENT_PAYLOAD_STRING, header, SECRET, - 10, - ), + 10 + ) ).to.equal(true); - }, + } ); it('should return true when the header contains at least one valid signature', function() { @@ -165,8 +165,8 @@ describe('Webhooks', function() { EVENT_PAYLOAD_STRING, header, SECRET, - 10, - ), + 10 + ) ).to.equal(true); }); @@ -182,10 +182,10 @@ describe('Webhooks', function() { stripe.webhooks.signature.verifyHeader( EVENT_PAYLOAD_STRING, header, - SECRET, - ), + SECRET + ) ).to.equal(true); - }, + } ); it('should accept Buffer instances for the payload and header', function() { @@ -198,8 +198,8 @@ describe('Webhooks', function() { Buffer.from(EVENT_PAYLOAD_STRING), Buffer.from(header), SECRET, - 10, - ), + 10 + ) ).to.equal(true); }); }); @@ -217,7 +217,7 @@ function generateHeaderString(opts) { opts.signature || stripe.webhooks.signature._computeSignature( opts.timestamp + '.' + opts.payload, - opts.secret, + opts.secret ); var generatedHeader = [ diff --git a/test/autoPagination.spec.js b/test/autoPagination.spec.js index 4960a3bb43..8aa204b129 100644 --- a/test/autoPagination.spec.js +++ b/test/autoPagination.spec.js @@ -41,7 +41,7 @@ describe('auto pagination', function() { Promise.all( realCustomerIds.map(function(customerId) { return stripe.customers.del(customerId); - }), + }) ).then(resolve); }); }); @@ -71,7 +71,7 @@ describe('auto pagination', function() { stripe.customers .list({limit: 3, email: email}) .autoPagingEach(onCustomer, onDone); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -98,7 +98,7 @@ describe('auto pagination', function() { stripe.customers .list({limit: 3, email: email}) .autoPagingEach(onCustomer, onDone); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -126,7 +126,7 @@ describe('auto pagination', function() { stripe.customers .list({limit: 3, email: email}) .autoPagingEach(onCustomer, onDone); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -146,7 +146,7 @@ describe('auto pagination', function() { .autoPagingEach(onCustomer) .then(onDone) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds); }); @@ -163,7 +163,7 @@ describe('auto pagination', function() { .then(function() { resolve(customerIds); }); - }), + }) ).to.eventually.deep.equal(realCustomerIds); }); @@ -180,7 +180,7 @@ describe('auto pagination', function() { .then(function() { resolve(customerIds); }); - }), + }) ).to.eventually.deep.equal(realCustomerIds); }); @@ -197,7 +197,7 @@ describe('auto pagination', function() { .then(function() { resolve(customerIds); }); - }), + }) ).to.eventually.deep.equal(realCustomerIds); }); @@ -220,7 +220,7 @@ describe('auto pagination', function() { reject(Error('Expected an error, did not get one.')); } }); - }), + }) ).to.eventually.deep.equal('Simulated error'); }); @@ -243,7 +243,7 @@ describe('auto pagination', function() { .catch(function(err) { resolve(err.message); }); - }), + }) ).to.eventually.deep.equal('Simulated error'); }); }); @@ -259,17 +259,17 @@ describe('auto pagination', function() { new Promise(function(resolve, reject) { forAwaitUntil( stripe.customers.list({limit: 3, email: email}), - LIMIT, + LIMIT ) .then(function(customers) { resolve( customers.map(function(customer) { return customer.id; - }), + }) ); }) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -278,17 +278,17 @@ describe('auto pagination', function() { new Promise(function(resolve, reject) { forAwaitUntil( stripe.customers.list({limit: 3, email: email}), - TOTAL_OBJECTS + 1, + TOTAL_OBJECTS + 1 ) .then(function(customers) { resolve( customers.map(function(customer) { return customer.id; - }), + }) ); }) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds); }); } @@ -305,11 +305,11 @@ describe('auto pagination', function() { resolve( customers.map(function(customer) { return customer.id; - }), + }) ); }) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); } @@ -332,7 +332,7 @@ describe('auto pagination', function() { resolve(customerIds); }) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, 1)); }); @@ -355,7 +355,7 @@ describe('auto pagination', function() { resolve(customerIds); }) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -397,13 +397,13 @@ describe('auto pagination', function() { resolve(customerIds); }) .catch(reject); - }), + }) ).to.eventually.deep.equal( realCustomerIds.slice(0, 4).reduce(function(acc, x) { acc.push(x); acc.push(x); return acc; - }, []), + }, []) ); }); }); @@ -422,7 +422,7 @@ describe('auto pagination', function() { }) .then(resolve) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds); }); @@ -439,7 +439,7 @@ describe('auto pagination', function() { }) .then(resolve) .catch(reject); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -453,7 +453,7 @@ describe('auto pagination', function() { resolve( customers.map(function(customer) { return customer.id; - }), + }) ); } } @@ -461,7 +461,7 @@ describe('auto pagination', function() { stripe.customers .list({limit: 3, email: email}) .autoPagingToArray({limit: LIMIT}, onDone); - }), + }) ).to.eventually.deep.equal(realCustomerIds.slice(0, LIMIT)); }); @@ -474,9 +474,9 @@ describe('auto pagination', function() { } catch (err) { resolve(err.message); } - }), + }) ).to.eventually.equal( - 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.', + 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.' ); }); @@ -491,9 +491,9 @@ describe('auto pagination', function() { } catch (err) { resolve(err.message); } - }), + }) ).to.eventually.equal( - 'You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.', + 'You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.' ); }); }); @@ -529,7 +529,7 @@ describe('auto pagination', function() { }); }) .catch(reject); - }), + }) ).to.eventually.deep.equal({ firstReq: realCustomerIds.slice(0, 4), paginated: realCustomerIds, diff --git a/test/flows.spec.js b/test/flows.spec.js index f58f34c0ef..e577bcc90c 100644 --- a/test/flows.spec.js +++ b/test/flows.spec.js @@ -27,7 +27,7 @@ describe('Flows', function() { stripe.account.retrieve().then(function(acct) { CURRENCY = acct.default_currency; return acct; - }), + }) ).to.eventually.have.property('default_currency'); }); @@ -56,7 +56,7 @@ describe('Flows', function() { return stripe.customers.updateSubscription(customer.id, { plan: plan.id, }); - }), + }) ).to.eventually.have.property('status', 'active'); }); @@ -94,12 +94,12 @@ describe('Flows', function() { { plan: plan.id, quantity: '3', - }, + } ); }) .then(function(subscription) { return [subscription.status, subscription.quantity]; - }), + }) ).to.eventually.deep.equal(['active', 3]); }); @@ -116,7 +116,7 @@ describe('Flows', function() { // Resolve with the error so we can inspect it below return err; }); - }), + }) ).to.eventually.satisfy(function(err) { return ( err.type === 'StripeInvalidRequestError' && @@ -150,7 +150,7 @@ describe('Flows', function() { plan: plan.id, cancel_at_period_end: true, }); - }), + }) ).to.eventually.have.property('cancel_at_period_end', true); }); @@ -179,9 +179,9 @@ describe('Flows', function() { .then(function() { cleanup.deletePlan(planID); return stripe.plans.retrieve(planID); - }), + }) ).to.eventually.have.property('id', planID); - }, + } ); }); }); @@ -203,7 +203,7 @@ describe('Flows', function() { ]).then(function(joined) { coupon = joined[0]; customer = joined[1]; - }), + }) ).to.not.be.eventually.rejected; }); describe('And I apply the coupon to the customer', function() { @@ -211,24 +211,24 @@ describe('Flows', function() { return expect( stripe.customers.update(customer.id, { coupon: coupon.id, - }), + }) ).to.not.be.eventually.rejected; }); it('Can be retrieved from that customer', function() { return expect( - stripe.customers.retrieve(customer.id), + stripe.customers.retrieve(customer.id) ).to.eventually.have.nested.property('discount.coupon.id', coupon.id); }); describe('The resulting discount', function() { it('Can be removed', function() { return expect( - stripe.customers.deleteDiscount(customer.id), + stripe.customers.deleteDiscount(customer.id) ).to.eventually.have.property('deleted', true); }); describe('Re-querying it', function() { it('Does indeed indicate that it is deleted', function() { return expect( - stripe.customers.retrieve(customer.id), + stripe.customers.retrieve(customer.id) ).to.eventually.have.property('discount', null); }); }); @@ -250,7 +250,7 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.getMetadata(customer.id); - }), + }) ).to.eventually.deep.equal({foo: '123'}); }); it('Can reset metadata', function() { @@ -268,7 +268,7 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.getMetadata(customer.id); - }), + }) ).to.eventually.deep.equal({}); }); it('Resets metadata when setting new metadata', function() { @@ -283,7 +283,7 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.setMetadata(customer.id, {baz: '456'}); - }), + }) ).to.eventually.deep.equal({baz: '456'}); }); it('Can set individual key/value pairs', function() { @@ -314,7 +314,7 @@ describe('Flows', function() { }) .then(function() { return stripe.customers.getMetadata(customer.id); - }), + }) ).to.eventually.deep.equal({_other_: '999', foo: '222'}); }); it('Can set individual key/value pairs [with per request token]', function() { @@ -331,7 +331,7 @@ describe('Flows', function() { return stripe.customers.setMetadata( customer.id, {baz: 456}, - authToken, + authToken ); }) .then(function() { @@ -339,7 +339,7 @@ describe('Flows', function() { customer.id, '_other_', 999, - authToken, + authToken ); }) .then(function() { @@ -347,7 +347,7 @@ describe('Flows', function() { customer.id, 'foo', 123, - authToken, + authToken ); }) .then(function() { @@ -356,7 +356,7 @@ describe('Flows', function() { customer.id, 'foo', 222, - authToken, + authToken ); }) .then(function() { @@ -365,12 +365,12 @@ describe('Flows', function() { customer.id, 'baz', null, - authToken, + authToken ); }) .then(function() { return stripe.customers.getMetadata(customer.id, authToken); - }), + }) ).to.eventually.deep.equal({_other_: '999', foo: '222'}); }); }); @@ -387,7 +387,7 @@ describe('Flows', function() { currency: CURRENCY, expand: ['customer'], }); - }), + }) ).to.eventually.have.nested.property('customer.created'); }); }); @@ -403,7 +403,7 @@ describe('Flows', function() { .then(function(cust) { cleanup.deleteCustomer(cust.id); return cust; - }), + }) // Confirm it's expanded by checking that some prop (e.g. exp_year) exists: ).to.eventually.have.nested.property('default_source.exp_year'); }); @@ -427,7 +427,7 @@ describe('Flows', function() { }) .then(null, function(error) { return error; - }), + }) ).to.eventually.have.nested.property('raw.charge'); }); }); @@ -436,12 +436,12 @@ describe('Flows', function() { it('Allows me to do so', function() { return expect(stripe.balance.retrieve()).to.eventually.have.property( 'object', - 'balance', + 'balance' ); }); it('Allows me to do so with specified auth key', function() { return expect( - stripe.balance.retrieve(testUtils.getUserStripeKey()), + stripe.balance.retrieve(testUtils.getUserStripeKey()) ).to.eventually.have.property('object', 'balance'); }); }); @@ -459,8 +459,8 @@ describe('Flows', function() { if (accounts.data.length < 1) { return done( new Error( - 'Test requires at least one Connected Account in the Test Account', - ), + 'Test requires at least one Connected Account in the Test Account' + ) ); } @@ -503,7 +503,7 @@ describe('Flows', function() { stripe_version: apiVersion, idempotency_key: idempotencyKey, stripe_account: connectedAccountId, - }, + } ) .then(null, function() { // I expect there to be an error here. @@ -550,7 +550,7 @@ describe('Flows', function() { stripe_version: apiVersion, idempotency_key: idempotencyKey, stripe_account: connectedAccountId, - }, + } ) .then(null, function() { // I expect there to be an error here. @@ -594,7 +594,7 @@ describe('Flows', function() { }) .then(null, function(error) { return error; - }), + }) ).to.eventually.have.nested.property('size', 739); }); @@ -614,7 +614,7 @@ describe('Flows', function() { }) .then(null, function(error) { return error; - }), + }) ).to.eventually.have.nested.property('size', 739); }); @@ -639,7 +639,7 @@ describe('Flows', function() { }) .catch(function(error) { expect(error.message).to.equal( - 'An error occurred while attempting to process the file for upload.', + 'An error occurred while attempting to process the file for upload.' ); expect(error.detail).to.equal(fakeError); diff --git a/test/resources/Account.spec.js b/test/resources/Account.spec.js index ed7955ecc1..5eaef72394 100644 --- a/test/resources/Account.spec.js +++ b/test/resources/Account.spec.js @@ -111,7 +111,7 @@ describe('Account Resource', function() { it('Sends the correct request', function() { stripe.account.retrieveExternalAccount( 'accountIdFoo321', - 'externalAccountIdFoo456', + 'externalAccountIdFoo456' ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -126,7 +126,7 @@ describe('Account Resource', function() { stripe.account.retrieveExternalAccount( 'accountIdFoo321', 'externalAccountIdFoo456', - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -162,7 +162,7 @@ describe('Account Resource', function() { currency: 'usd', country: 'US', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -181,7 +181,7 @@ describe('Account Resource', function() { 'externalAccountIdFoo456', { default_for_currency: true, - }, + } ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -197,7 +197,7 @@ describe('Account Resource', function() { it('Sends the correct request', function() { stripe.account.deleteExternalAccount( 'accountIdFoo321', - 'externalAccountIdFoo456', + 'externalAccountIdFoo456' ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', @@ -212,7 +212,7 @@ describe('Account Resource', function() { stripe.account.deleteExternalAccount( 'accountIdFoo321', 'externalAccountIdFoo456', - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', @@ -306,7 +306,7 @@ describe('Account Resource', function() { { first_name: 'John', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -338,7 +338,7 @@ describe('Account Resource', function() { { first_name: 'John', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/ApplicationFees.spec.js b/test/resources/ApplicationFees.spec.js index 3fa4d13426..34dbac595e 100644 --- a/test/resources/ApplicationFees.spec.js +++ b/test/resources/ApplicationFees.spec.js @@ -35,7 +35,7 @@ describe('ApplicationFee Resource', function() { stripe.applicationFees.updateRefund( 'appFeeIdExample3242', 'refundIdExample2312', - {metadata: {key: 'value'}}, + {metadata: {key: 'value'}} ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -69,7 +69,7 @@ describe('ApplicationFee Resource', function() { it('Sends the correct retrieve request', function() { stripe.applicationFees.retrieveRefund( 'appFeeIdExample3242', - 'refundIdExample2312', + 'refundIdExample2312' ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Balance.spec.js b/test/resources/Balance.spec.js index 50fbe0a5a1..4951f9e151 100644 --- a/test/resources/Balance.spec.js +++ b/test/resources/Balance.spec.js @@ -64,7 +64,7 @@ describe('Balance Resource', function() { it('Sends the correct request [with specified auth]', function() { stripe.balance.retrieveTransaction( 'transactionIdFoo', - 'aGN0bIwXnHdw5645VABjPdSn8nWY7G11', + 'aGN0bIwXnHdw5645VABjPdSn8nWY7G11' ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/Charges.spec.js b/test/resources/Charges.spec.js index dcfc13eb3f..dc68e835bf 100644 --- a/test/resources/Charges.spec.js +++ b/test/resources/Charges.spec.js @@ -93,15 +93,15 @@ describe('Charge Resource', function() { it('Incorrect arguments result in an error', function() { expect( - stripe.charges.refund('chargeIdExample123', 39392), + stripe.charges.refund('chargeIdExample123', 39392) ).to.be.eventually.rejectedWith(/unknown arguments/i); expect( - stripe.charges.refund({potato: 'chargeIdExample123'}), + stripe.charges.refund({potato: 'chargeIdExample123'}) ).to.be.eventually.rejectedWith(/must be a string, but got: object/i); expect(stripe.charges.refund(442)).to.be.eventually.rejectedWith( - /must be a string, but got: number/i, + /must be a string, but got: number/i ); }); }); @@ -111,7 +111,7 @@ describe('Charge Resource', function() { stripe.charges.updateRefund( 'chargeIdExample3242', 'refundIdExample2312', - {metadata: {key: 'value'}}, + {metadata: {key: 'value'}} ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -144,7 +144,7 @@ describe('Charge Resource', function() { it('Sends the correct retrieve request', function() { stripe.charges.retrieveRefund( 'chargeIdExample3242', - 'refundIdExample2312', + 'refundIdExample2312' ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/CustomerSubscriptions.spec.js b/test/resources/CustomerSubscriptions.spec.js index 9920dbc743..6d9b71933e 100644 --- a/test/resources/CustomerSubscriptions.spec.js +++ b/test/resources/CustomerSubscriptions.spec.js @@ -94,7 +94,7 @@ describe('CustomerSubscription Resource', function() { it('Sends the correct request', function() { customerSubscription.deleteDiscount( 'customerIdFoo321', - 'subscriptionIdBar654', + 'subscriptionIdBar654' ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', diff --git a/test/resources/Customers.spec.js b/test/resources/Customers.spec.js index 365e0e60e0..3193585e12 100644 --- a/test/resources/Customers.spec.js +++ b/test/resources/Customers.spec.js @@ -65,7 +65,7 @@ describe('Customers Resource', function() { it('Sends the correct request [with specified idempotency_key in options]', function() { stripe.customers.create( {description: 'Some customer'}, - {idempotency_key: 'foo'}, + {idempotency_key: 'foo'} ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -78,7 +78,7 @@ describe('Customers Resource', function() { it('Sends the correct request [with specified auth in options]', function() { stripe.customers.create( {description: 'Some customer'}, - {api_key: TEST_AUTH_KEY}, + {api_key: TEST_AUTH_KEY} ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -92,7 +92,7 @@ describe('Customers Resource', function() { it('Sends the correct request [with specified auth and idempotent key in options]', function() { stripe.customers.create( {description: 'Some customer'}, - {api_key: TEST_AUTH_KEY, idempotency_key: 'foo'}, + {api_key: TEST_AUTH_KEY, idempotency_key: 'foo'} ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -184,7 +184,7 @@ describe('Customers Resource', function() { { plan: 'fooPlan', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -235,7 +235,7 @@ describe('Customers Resource', function() { stripe.customers.cancelSubscription( 'cus_123', {at_period_end: true}, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', @@ -308,7 +308,7 @@ describe('Customers Resource', function() { reqs[reqs.length - 1], ]); }); - }), + }) ).to.eventually.deep.equal([ { // First reset metadata: @@ -412,7 +412,7 @@ describe('Customers Resource', function() { number: '123456', exp_month: '12', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -532,7 +532,7 @@ describe('Customers Resource', function() { number: '123456', exp_month: '12', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -612,7 +612,7 @@ describe('Customers Resource', function() { 'cus_123', 'card_123', data, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -641,7 +641,7 @@ describe('Customers Resource', function() { stripe.customers.retrieveSubscription( 'cus_123', 'sub_123', - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -674,7 +674,7 @@ describe('Customers Resource', function() { plan: 'gold', quantity: '12', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -706,7 +706,7 @@ describe('Customers Resource', function() { { quantity: '2', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -733,7 +733,7 @@ describe('Customers Resource', function() { stripe.customers.cancelSubscription( 'cus_123', 'sub_123', - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', @@ -764,7 +764,7 @@ describe('Customers Resource', function() { 'cus_123', 'sub_123', {at_period_end: true}, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', diff --git a/test/resources/EphemeralKeys.spec.js b/test/resources/EphemeralKeys.spec.js index 2fe31643a1..565a066186 100644 --- a/test/resources/EphemeralKeys.spec.js +++ b/test/resources/EphemeralKeys.spec.js @@ -5,14 +5,14 @@ var expect = require('chai').expect; function errorsOnNoStripeVersion() { return expect( - stripe.ephemeralKeys.create({customer: 'cus_123'}), + stripe.ephemeralKeys.create({customer: 'cus_123'}) ).to.be.eventually.rejectedWith(/stripe_version must be specified/i); } function sendsCorrectStripeVersion() { stripe.ephemeralKeys.create( {customer: 'cus_123'}, - {stripe_version: '2017-06-05'}, + {stripe_version: '2017-06-05'} ); expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -32,7 +32,7 @@ describe('EphemeralKey Resource', function() { it('Sends the correct request', function() { stripe.ephemeralKeys.create( {customer: 'cus_123'}, - {stripe_version: '2017-05-25'}, + {stripe_version: '2017-05-25'} ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', diff --git a/test/resources/FileUploads.spec.js b/test/resources/FileUploads.spec.js index e39343b3ca..7cc106e0f5 100644 --- a/test/resources/FileUploads.spec.js +++ b/test/resources/FileUploads.spec.js @@ -77,7 +77,7 @@ describe('File Uploads Resource', function() { }, file_link_data: {create: true}, }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); @@ -103,7 +103,7 @@ describe('File Uploads Resource', function() { .then(function() { expect(stripe.LAST_REQUEST).to.deep.property( 'host', - 'files.stripe.com', + 'files.stripe.com' ); expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); @@ -125,12 +125,12 @@ describe('File Uploads Resource', function() { }, file_link_data: {create: true}, }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ) .then(function() { expect(stripe.LAST_REQUEST).to.deep.property( 'host', - 'files.stripe.com', + 'files.stripe.com' ); expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); diff --git a/test/resources/Files.spec.js b/test/resources/Files.spec.js index c174e4a68b..280eec92c1 100644 --- a/test/resources/Files.spec.js +++ b/test/resources/Files.spec.js @@ -77,7 +77,7 @@ describe('Files Resource', function() { }, file_link_data: {create: true}, }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.property('host', 'files.stripe.com'); @@ -103,7 +103,7 @@ describe('Files Resource', function() { .then(function() { expect(stripe.LAST_REQUEST).to.deep.property( 'host', - 'files.stripe.com', + 'files.stripe.com' ); expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); @@ -125,12 +125,12 @@ describe('Files Resource', function() { }, file_link_data: {create: true}, }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ) .then(function() { expect(stripe.LAST_REQUEST).to.deep.property( 'host', - 'files.stripe.com', + 'files.stripe.com' ); expect(stripe.LAST_REQUEST).to.deep.property('method', 'POST'); expect(stripe.LAST_REQUEST).to.deep.property('url', '/v1/files'); diff --git a/test/resources/Recipients.spec.js b/test/resources/Recipients.spec.js index 1e3ea46a16..3c428b1ff5 100644 --- a/test/resources/Recipients.spec.js +++ b/test/resources/Recipients.spec.js @@ -87,7 +87,7 @@ describe('Recipients Resource', function() { stripe.recipients.retrieveCard( 'recipientIdFoo321', 'cardIdFoo456', - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', @@ -120,7 +120,7 @@ describe('Recipients Resource', function() { number: '123456', exp_month: '12', }, - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'POST', @@ -161,7 +161,7 @@ describe('Recipients Resource', function() { stripe.recipients.deleteCard( 'recipientIdFoo321', 'cardIdFoo456', - TEST_AUTH_KEY, + TEST_AUTH_KEY ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'DELETE', diff --git a/test/resources/SubscriptionSchedule.spec.js b/test/resources/SubscriptionSchedule.spec.js index 87cc9d723a..9e07b182a2 100644 --- a/test/resources/SubscriptionSchedule.spec.js +++ b/test/resources/SubscriptionSchedule.spec.js @@ -94,7 +94,7 @@ describe('Subscription Schedule Resource', function() { it('Sends the correct request', function() { stripe.subscriptionSchedules.retrieveRevision( SCHEDULE_TEST_ID, - REVISION_TEST_ID, + REVISION_TEST_ID ); expect(stripe.LAST_REQUEST).to.deep.equal({ method: 'GET', diff --git a/test/resources/UsageRecordSummaries.spec.js b/test/resources/UsageRecordSummaries.spec.js index 07b3f1cbb3..436dd580d7 100644 --- a/test/resources/UsageRecordSummaries.spec.js +++ b/test/resources/UsageRecordSummaries.spec.js @@ -23,7 +23,7 @@ describe('UsageRecordSummaries Resource', function() { {}, { stripe_account: 'acct_456', - }, + } ) .then(function(record) { expect(stripe.LAST_REQUEST).to.deep.equal({ diff --git a/test/resources/UsageRecords.spec.js b/test/resources/UsageRecords.spec.js index 39cf242358..0bd5f0b04f 100644 --- a/test/resources/UsageRecords.spec.js +++ b/test/resources/UsageRecords.spec.js @@ -35,7 +35,7 @@ describe('UsageRecords Resource', function() { }, { stripe_account: 'acct_456', - }, + } ) .then(function(record) { expect(stripe.LAST_REQUEST).to.deep.equal({ @@ -65,7 +65,7 @@ describe('UsageRecords Resource', function() { }, function(error, record) { done(error); - }, + } ); }); }); diff --git a/test/stripe.spec.js b/test/stripe.spec.js index 1a06eeb952..5b1328ffde 100644 --- a/test/stripe.spec.js +++ b/test/stripe.spec.js @@ -20,7 +20,7 @@ describe('Stripe Module', function() { describe('setApiKey', function() { it('uses Bearer auth', function() { expect(stripe.getApiField('auth')).to.equal( - 'Bearer ' + testUtils.getUserStripeKey(), + 'Bearer ' + testUtils.getUserStripeKey() ); }); }); @@ -32,7 +32,7 @@ describe('Stripe Module', function() { stripe.getClientUserAgent(function(c) { resolve(JSON.parse(c)); }); - }), + }) ).to.eventually.have.property('lang', 'node'); }); }); @@ -45,7 +45,7 @@ describe('Stripe Module', function() { stripe.getClientUserAgentSeeded(userAgent, function(c) { resolve(JSON.parse(c)); }); - }), + }) ).to.eventually.have.property('lang', 'node'); }); @@ -56,7 +56,7 @@ describe('Stripe Module', function() { stripe.getClientUserAgentSeeded(userAgent, function(c) { resolve(JSON.parse(c)); }); - }), + }) ).to.eventually.have.property('lang', '%C3%AF'); }); @@ -78,7 +78,7 @@ describe('Stripe Module', function() { stripe.getClientUserAgentSeeded({lang: 'node'}, function(c) { resolve(JSON.parse(c)); }); - }), + }) ).to.eventually.have.property('uname', 'fo%C3%B8name'); }); @@ -91,7 +91,7 @@ describe('Stripe Module', function() { stripe.getClientUserAgentSeeded({lang: 'node'}, function(c) { resolve(JSON.parse(c)); }); - }), + }) ).to.eventually.have.property('uname', 'UNKNOWN'); }); }); @@ -100,7 +100,7 @@ describe('Stripe Module', function() { describe('setTimeout', function() { it('Should define a default equal to the node default', function() { expect(stripe.getApiField('timeout')).to.equal( - http.createServer().timeout, + http.createServer().timeout ); }); it('Should allow me to set a custom timeout', function() { @@ -110,7 +110,7 @@ describe('Stripe Module', function() { it('Should allow me to set null, to reset to the default', function() { stripe.setTimeout(null); expect(stripe.getApiField('timeout')).to.equal( - http.createServer().timeout, + http.createServer().timeout ); }); }); @@ -210,7 +210,7 @@ describe('Stripe Module', function() { expect(JSON.parse(uaString).application).to.eql(appInfo); expect(stripe.getAppInfoAsString()).to.eql( - appInfo.name + '/' + appInfo.version + ' (' + appInfo.url + ')', + appInfo.name + '/' + appInfo.version + ' (' + appInfo.url + ')' ); done(); @@ -227,7 +227,7 @@ describe('Stripe Module', function() { cleanup.deleteCustomer(customer.id); resolve('Called!'); }); - }), + }) ).to.eventually.equal('Called!'); }); @@ -245,7 +245,7 @@ describe('Stripe Module', function() { resolve('Called!'); }); - }), + }) ).to.eventually.equal('Called!'); }); @@ -261,9 +261,9 @@ describe('Stripe Module', function() { } else { reject(new Error('NoErrorPassed')); } - }, + } ); - }), + }) ).to.eventually.become('ErrorWasPassed'); }); }); @@ -275,7 +275,7 @@ describe('Stripe Module', function() { expect( new Stripe.errors.StripeInvalidRequestError({ message: 'error', - }).type, + }).type ).to.equal('StripeInvalidRequestError'); }); }); diff --git a/test/telemetry.spec.js b/test/telemetry.spec.js index 9e7d02b66b..cc62a61a86 100644 --- a/test/telemetry.spec.js +++ b/test/telemetry.spec.js @@ -16,7 +16,7 @@ function createTestServer(handlerFunc, cb) { res.end( JSON.stringify({ error: {type: 'invalid_request_error', message: e.message}, - }), + }) ); } }); @@ -58,7 +58,7 @@ describe('Client Telemetry', function() { }, function(host, port) { const stripe = require('../lib/stripe')( - 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa' ); stripe.setHost(host, port, 'http'); @@ -72,7 +72,7 @@ describe('Client Telemetry', function() { done(); }) .catch(done); - }, + } ); }); @@ -92,7 +92,7 @@ describe('Client Telemetry', function() { case 2: expect(telemetry).to.exist; expect( - JSON.parse(telemetry).last_request_metrics.request_id, + JSON.parse(telemetry).last_request_metrics.request_id ).to.equal('req_1'); break; default: @@ -105,7 +105,7 @@ describe('Client Telemetry', function() { }, function(host, port) { const stripe = require('../lib/stripe')( - 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa' ); stripe.setTelemetryEnabled(true); stripe.setHost(host, port, 'http'); @@ -120,7 +120,7 @@ describe('Client Telemetry', function() { done(); }) .catch(done); - }, + } ); }); @@ -142,7 +142,7 @@ describe('Client Telemetry', function() { case 4: expect(telemetry).to.exist; expect( - JSON.parse(telemetry).last_request_metrics.request_id, + JSON.parse(telemetry).last_request_metrics.request_id ).to.be.oneOf(['req_1', 'req_2']); break; default: @@ -155,7 +155,7 @@ describe('Client Telemetry', function() { }, function(host, port) { const stripe = require('../lib/stripe')( - 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa' ); stripe.setTelemetryEnabled(true); stripe.setHost(host, port, 'http'); @@ -172,7 +172,7 @@ describe('Client Telemetry', function() { done(); }) .catch(done); - }, + } ); }); }); diff --git a/test/utils.spec.js b/test/utils.spec.js index 1186d4887d..8569a7ef0f 100644 --- a/test/utils.spec.js +++ b/test/utils.spec.js @@ -17,7 +17,7 @@ describe('utils', function() { expect( // Test encoding: - template({foo: 'FOO', baz: '__::baz::__'}), + template({foo: 'FOO', baz: '__::baz::__'}) ).to.equal('/some/url/FOO/__%3A%3Abaz%3A%3A__?ok=1'); }); }); @@ -28,7 +28,7 @@ describe('utils', function() { utils.stringifyRequestData({ a: 1, b: 'foo', - }), + }) ).to.equal('a=1&b=foo'); }); @@ -40,13 +40,13 @@ describe('utils', function() { gte: new Date('2009-02-13T23:31:30Z'), lt: new Date('2044-05-01T01:28:21Z'), }, - }), + }) ).to.equal( [ 'date=1234567890', 'created[gte]=1234567890', 'created[lt]=2345678901', - ].join('&'), + ].join('&') ); }); @@ -60,7 +60,7 @@ describe('utils', function() { }, }, }, - }), + }) ).to.equal('a[b][c][d]=2'); }); @@ -68,7 +68,7 @@ describe('utils', function() { expect( utils.stringifyRequestData({ a: [{b: 'c'}, {b: 'd'}], - }), + }) ).to.equal('a[0][b]=c&a[1][b]=d'); }); @@ -79,7 +79,7 @@ describe('utils', function() { 0: {b: 'c'}, 1: {b: 'd'}, }, - }), + }) ).to.equal('a[0][b]=c&a[1][b]=d'); }); @@ -93,7 +93,7 @@ describe('utils', function() { 1: 2, 'a n o t h e r': null, }, - }), + }) ).to.equal( [ 'test=1', @@ -101,7 +101,7 @@ describe('utils', function() { 'somethingElse=%3A%3A%22%22%25%26', 'nested[1]=2', 'nested[a%20n%20o%20t%20h%20e%20r]=', - ].join('&'), + ].join('&') ); }); }); @@ -143,7 +143,7 @@ describe('utils', function() { }, function(message) { throw new Error('Should not have warned, but did: ' + message); - }, + } ); }); it('warns if the hash contains both data and options', function(done) { @@ -156,11 +156,11 @@ describe('utils', function() { function(message) { expect(message).to.equal( 'Stripe: Options found in arguments (api_key, idempotency_key).' + - ' Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.', + ' Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.' ); done(); - }, + } ); }); it('finds the data', function() { @@ -270,11 +270,11 @@ describe('utils', function() { }, function(message) { expect(message).to.equal( - 'Stripe: Invalid options found (fishsticks, custard); ignoring.', + 'Stripe: Invalid options found (fishsticks, custard); ignoring.' ); done(); - }, + } ); }); }); @@ -303,7 +303,7 @@ describe('utils', function() { dog: false, rabbit: undefined, pointer: null, - }), + }) ).to.eql({ cat: 3, dog: false, @@ -374,7 +374,7 @@ describe('utils', function() { b: 'foo', c: true, d: null, - }), + }) ).to.eql({a: '1', b: 'foo', c: 'true', d: 'null'}); }); @@ -385,7 +385,7 @@ describe('utils', function() { a: 1, b: 'foo', }, - }), + }) ).to.eql({'x[a]': '1', 'x[b]': 'foo'}); }); @@ -398,7 +398,7 @@ describe('utils', function() { x: { a: 1, }, - }), + }) ).to.eql({file: {data: 'foo'}, 'x[a]': '1'}); }); diff --git a/testUtils/index.js b/testUtils/index.js index 2bf3d00c2d..93cba2b9ac 100644 --- a/testUtils/index.js +++ b/testUtils/index.js @@ -76,7 +76,7 @@ var utils = (module.exports = { this._cleanupFns = []; this._stripe = require('../lib/stripe')( utils.getUserStripeKey(), - 'latest', + 'latest' ); afterEach(function(done) { this.timeout(timeout || CleanupUtility.DEFAULT_TIMEOUT); @@ -93,7 +93,7 @@ var utils = (module.exports = { var promise = fn.call(this); if (!promise || !promise.then) { throw new Error( - 'CleanupUtility expects cleanup functions to return promises!', + 'CleanupUtility expects cleanup functions to return promises!' ); } promise.then( @@ -107,7 +107,7 @@ var utils = (module.exports = { function(err) { // not successful throw err; - }, + } ); } if (total === 0) { From 8ee55367f818b340bf4fe1244c66de4213e82560 Mon Sep 17 00:00:00 2001 From: Bryan Irace Date: Fri, 3 May 2019 11:52:45 -0700 Subject: [PATCH 08/10] Fix conflicting eslint rules and update README with information about yarn and prettier --- .eslintrc.js | 247 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 179 +++++++++++++++++++------------- test/utils.spec.js | 2 +- testUtils/index.js | 3 +- 4 files changed, 357 insertions(+), 74 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 32375e1577..2b21ed9160 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,251 @@ module.exports = { + env: { + node: true, + es6: true, + }, + rules: { + 'accessor-pairs': 'error', + 'array-bracket-spacing': ['error', 'never'], + 'array-callback-return': 'off', + 'arrow-body-style': 'error', + 'arrow-parens': 'error', + 'arrow-spacing': 'error', + 'block-scoped-var': 'off', + 'block-spacing': 'off', + 'brace-style': [ + 'error', + '1tbs', + { + allowSingleLine: true, + }, + ], + camelcase: [ + 'error', + { + properties: 'never', + }, + ], + 'capitalized-comments': 'off', + 'class-methods-use-this': 'error', + 'comma-dangle': 'off', + 'comma-spacing': 'off', + 'comma-style': ['error', 'last'], + complexity: 'error', + 'computed-property-spacing': ['error', 'never'], + 'consistent-return': 'off', + 'consistent-this': 'off', + curly: 'error', + 'default-case': 'off', + 'dot-location': ['error', 'property'], + 'dot-notation': 'error', + 'eol-last': 'error', + eqeqeq: 'off', + 'func-call-spacing': 'error', + 'func-name-matching': 'error', + 'func-names': 'off', + 'func-style': ['error', 'declaration'], + 'generator-star-spacing': 'error', + 'global-require': 'off', + 'guard-for-in': 'off', + 'handle-callback-err': 'off', + 'id-blacklist': 'error', + 'id-length': 'off', + 'id-match': 'error', + 'init-declarations': 'off', + 'jsx-quotes': 'error', + 'key-spacing': 'error', + 'keyword-spacing': [ + 'error', + { + after: true, + before: true, + }, + ], + 'line-comment-position': 'off', + 'linebreak-style': ['error', 'unix'], + 'lines-around-comment': 'error', + 'lines-around-directive': 'error', + 'max-depth': 'error', + 'max-len': 'off', + 'max-lines': 'off', + 'max-nested-callbacks': 'error', + 'max-params': 'off', + 'max-statements': 'off', + 'max-statements-per-line': 'off', + 'multiline-ternary': 'off', + 'new-cap': 'error', + 'new-parens': 'error', + 'newline-after-var': 'off', + 'newline-before-return': 'off', + 'newline-per-chained-call': 'off', + 'no-alert': 'error', + 'no-array-constructor': 'error', + 'no-await-in-loop': 'error', + 'no-bitwise': 'off', + 'no-caller': 'error', + 'no-catch-shadow': 'off', + 'no-compare-neg-zero': 'error', + 'no-confusing-arrow': 'error', + 'no-continue': 'off', + 'no-div-regex': 'error', + 'no-duplicate-imports': 'error', + 'no-else-return': 'off', + 'no-empty-function': 'off', + 'no-eq-null': 'off', + 'no-eval': 'error', + 'no-extend-native': 'error', + 'no-extra-bind': 'error', + 'no-extra-label': 'error', + 'no-extra-parens': 'off', + 'no-floating-decimal': 'error', + 'no-implicit-globals': 'error', + 'no-implied-eval': 'error', + 'no-inline-comments': 'off', + 'no-inner-declarations': ['error', 'functions'], + 'no-invalid-this': 'off', + 'no-iterator': 'error', + 'no-label-var': 'error', + 'no-labels': 'error', + 'no-lone-blocks': 'error', + 'no-lonely-if': 'error', + 'no-loop-func': 'error', + 'no-magic-numbers': 'off', + 'no-mixed-requires': 'error', + 'no-multi-assign': 'off', + 'no-multi-spaces': 'error', + 'no-multi-str': 'error', + 'no-multiple-empty-lines': 'error', + 'no-native-reassign': 'error', + 'no-negated-condition': 'off', + 'no-negated-in-lhs': 'error', + 'no-nested-ternary': 'error', + 'no-new': 'error', + 'no-new-func': 'error', + 'no-new-object': 'error', + 'no-new-require': 'error', + 'no-new-wrappers': 'error', + 'no-octal-escape': 'error', + 'no-param-reassign': 'off', + 'no-path-concat': 'error', + 'no-plusplus': [ + 'error', + { + allowForLoopAfterthoughts: true, + }, + ], + 'no-process-env': 'off', + 'no-process-exit': 'error', + 'no-proto': 'error', + 'no-prototype-builtins': 'off', + 'no-restricted-globals': 'error', + 'no-restricted-imports': 'error', + 'no-restricted-modules': 'error', + 'no-restricted-properties': 'error', + 'no-restricted-syntax': 'error', + 'no-return-assign': 'error', + 'no-return-await': 'error', + 'no-script-url': 'error', + 'no-self-compare': 'error', + 'no-sequences': 'error', + 'no-shadow': 'off', + 'no-shadow-restricted-names': 'error', + 'no-spaced-func': 'error', + 'no-sync': 'error', + 'no-tabs': 'error', + 'no-template-curly-in-string': 'error', + 'no-ternary': 'off', + 'no-throw-literal': 'error', + 'no-trailing-spaces': 'error', + 'no-undef-init': 'error', + 'no-undefined': 'off', + 'no-underscore-dangle': 'off', + 'no-unmodified-loop-condition': 'error', + 'no-unneeded-ternary': 'error', + 'no-unused-expressions': 'error', + 'no-unused-vars': [ + 'error', + { + args: 'none', + }, + ], + 'no-use-before-define': 'off', + 'no-useless-call': 'error', + 'no-useless-computed-key': 'error', + 'no-useless-concat': 'error', + 'no-useless-constructor': 'error', + 'no-useless-escape': 'off', + 'no-useless-rename': 'error', + 'no-useless-return': 'error', + 'no-var': 'off', + 'no-void': 'error', + 'no-warning-comments': 'error', + 'no-whitespace-before-property': 'error', + 'no-with': 'error', + 'nonblock-statement-body-position': 'error', + 'object-curly-newline': 'off', + 'object-curly-spacing': ['error', 'never'], + 'object-property-newline': 'off', + 'object-shorthand': 'off', + 'one-var': 'off', + 'one-var-declaration-per-line': 'error', + 'operator-assignment': ['error', 'always'], + 'operator-linebreak': 'off', + 'padded-blocks': 'off', + 'prefer-arrow-callback': 'off', + 'prefer-const': 'error', + 'prefer-destructuring': [ + 'error', + { + array: false, + object: false, + }, + ], + 'prefer-numeric-literals': 'error', + 'prefer-promise-reject-errors': 'error', + 'prefer-reflect': 'off', + 'prefer-rest-params': 'off', + 'prefer-spread': 'off', + 'prefer-template': 'off', + 'quote-props': 'off', + quotes: [ + 'error', + 'single', + { + avoidEscape: true, + }, + ], + radix: 'error', + 'require-await': 'error', + 'require-jsdoc': 'off', + 'rest-spread-spacing': 'error', + semi: 'off', + 'semi-spacing': [ + 'error', + { + after: true, + before: false, + }, + ], + 'sort-imports': 'error', + 'sort-keys': 'off', + 'sort-vars': 'error', + 'space-before-blocks': 'error', + 'space-before-function-paren': 'off', + 'space-in-parens': ['error', 'never'], + 'space-infix-ops': 'error', + 'space-unary-ops': 'error', + 'spaced-comment': ['error', 'always'], + strict: 'off', + 'symbol-description': 'error', + 'template-curly-spacing': 'error', + 'template-tag-spacing': 'error', + 'unicode-bom': ['error', 'never'], + 'valid-jsdoc': 'off', + 'vars-on-top': 'off', + 'wrap-regex': 'off', + 'yield-star-spacing': 'error', + yoda: ['error', 'never'], + }, parser: 'babel-eslint', plugins: ['prettier'], extends: ['plugin:prettier/recommended'], diff --git a/README.md b/README.md index af66e56c8f..8ad39b5beb 100644 --- a/README.md +++ b/README.md @@ -30,28 +30,14 @@ The package needs to be configured with your account's secret key which is available in your [Stripe Dashboard][api-keys]. Require it with the key's value: -``` js +```js const stripe = require('stripe')('sk_test_...'); const customer = await stripe.customers.create({ - email: 'customer@example.com' + email: 'customer@example.com', }); ``` -Or with versions of Node.js prior to v7.9: - -``` js -var stripe = require('stripe')('sk_test_...'); - -stripe.customers.create( - { email: 'customer@example.com' }, - function(err, customer) { - err; // null if no error occurred - customer; // the created customer object - } -); -``` - Or using ES modules, this looks more like: ```js @@ -60,6 +46,9 @@ const stripe = Stripe('sk_test_...'); //… ``` +On older versions of Node, you can use [promises](#using-promises) +or [callbacks](#using-callbacks) instead of `async`/`await`. + ### Usage with TypeScript Stripe does not currently maintain typings for this package, but there are @@ -78,7 +67,9 @@ To use: import * as Stripe from 'stripe'; const stripe = new Stripe('sk_test_...'); -const customer: Promise = stripe.customers.create(/* ... */); +const customer: Promise< + Stripe.customers.ICustomer +> = stripe.customers.create(/* ... */); ``` ### Using Promises @@ -88,30 +79,53 @@ callback: ```js // Create a new customer and then a new charge for that customer: -stripe.customers.create({ - email: 'foo-customer@example.com' -}).then((customer) => { - return stripe.customers.createSource(customer.id, { - source: 'tok_visa' - }); -}).then((source) => { - return stripe.charges.create({ - amount: 1600, - currency: 'usd', - customer: source.customer +stripe.customers + .create({ + email: 'foo-customer@example.com', + }) + .then((customer) => { + return stripe.customers.createSource(customer.id, { + source: 'tok_visa', + }); + }) + .then((source) => { + return stripe.charges.create({ + amount: 1600, + currency: 'usd', + customer: source.customer, + }); + }) + .then((charge) => { + // New charge created on a new customer + }) + .catch((err) => { + // Deal with an error }); -}).then((charge) => { - // New charge created on a new customer -}).catch((err) => { - // Deal with an error -}); +``` + +### Using callbacks + +On versions of Node.js prior to v7.9: + +```js +var stripe = require('stripe')('sk_test_...'); + +stripe.customers.create( + { + email: 'customer@example.com', + }, + function(err, customer) { + err; // null if no error occurred + customer; // the created customer object + } +); ``` ### Configuring Timeout Request timeout is configurable (the default is Node's default of 120 seconds): -``` js +```js stripe.setTimeout(20000); // in ms (this is 20 seconds) ``` @@ -120,15 +134,18 @@ stripe.setTimeout(20000); // in ms (this is 20 seconds) A per-request `Stripe-Account` header for use with [Stripe Connect][connect] can be added to any method: -``` js +```js // Retrieve the balance for a connected account: -stripe.balance.retrieve({ - stripe_account: 'acct_foo' -}).then((balance) => { - // The balance object for the connected account -}).catch((err) => { - // Error -}); +stripe.balance + .retrieve({ + stripe_account: 'acct_foo', + }) + .then((balance) => { + // The balance object for the connected account + }) + .catch((err) => { + // Error + }); ``` ### Configuring a Proxy @@ -136,7 +153,7 @@ stripe.balance.retrieve({ An [https-proxy-agent][https-proxy-agent] can be configured with `setHttpAgent`. -To use stripe behind a proxy you can pass to sdk: +To use stripe behind a proxy you can pass to sdk: ```js if (process.env.http_proxy) { @@ -147,7 +164,9 @@ if (process.env.http_proxy) { ### Network retries -Automatic network retries can be enabled with `setMaxNetworkRetries`. This will retry requests `n` times with exponential backoff if they fail due to an intermittent network problem. [Idempotency keys](https://stripe.com/docs/api/idempotent_requests) are added where appropriate to prevent duplication. +Automatic network retries can be enabled with `setMaxNetworkRetries`. +This will retry requests `n` times with exponential backoff if they fail due to an intermittent network problem. +[Idempotency keys](https://stripe.com/docs/api/idempotent_requests) are added where appropriate to prevent duplication. ```js // Retry a request once before giving up @@ -160,20 +179,20 @@ Some information about the response which generated a resource is available with the `lastResponse` property: ```js -charge.lastResponse.requestId // see: https://stripe.com/docs/api/node#request_ids -charge.lastResponse.statusCode +charge.lastResponse.requestId; // see: https://stripe.com/docs/api/node#request_ids +charge.lastResponse.statusCode; ``` ### `request` and `response` events -The Stripe object emits `request` and `response` events. You can use them like this: +The Stripe object emits `request` and `response` events. You can use them like this: ```js const stripe = require('stripe')('sk_test_...'); const onRequest = (request) => { // Do something. -} +}; // Add the event handler function: stripe.on('request', onRequest); @@ -183,6 +202,7 @@ stripe.off('request', onRequest); ``` #### `request` object + ```js { api_version: 'latest', @@ -194,6 +214,7 @@ stripe.off('request', onRequest); ``` #### `response` object + ```js { api_version: 'latest', @@ -209,7 +230,7 @@ stripe.off('request', onRequest); ### Webhook signing -Stripe can optionally sign the webhook events it sends to your endpoint, allowing you to validate that they were not sent by a third-party. You can read more about it [here](https://stripe.com/docs/webhooks#signatures). +Stripe can optionally sign the webhook events it sends to your endpoint, allowing you to validate that they were not sent by a third-party. You can read more about it [here](https://stripe.com/docs/webhooks#signatures). Please note that you must pass the _raw_ request body, exactly as received from Stripe, to the `constructEvent()` function; this will not work with a parsed (i.e., JSON) request body. @@ -242,7 +263,6 @@ This information is passed along when the library makes calls to the Stripe API. As of stripe-node 6.11.0, you may auto-paginate list methods. We provide a few different APIs for this to aid with a variety of node versions and styles. - #### Async iterators (`for-await-of`) If you are in a Node environment that has support for [async iteration](https://github.com/tc39/proposal-async-iteration#the-async-iteration-statement-for-await-of), @@ -269,22 +289,26 @@ await stripe.customers.list().autoPagingEach(async (customer) => { if (shouldBreak()) { return false; } -}) +}); console.log('Done iterating.'); ``` Equivalently, without `await`, you may return a Promise, which can resolve to `false` to break: ```js -stripe.customers.list().autoPagingEach((customer) => { - return doSomething(customer).then(() => { - if (shouldBreak()) { - return false; - } - }); -}).then(() => { - console.log('Done iterating.'); -}).catch(handleError); +stripe.customers + .list() + .autoPagingEach((customer) => { + return doSomething(customer).then(() => { + if (shouldBreak()) { + return false; + } + }); + }) + .then(() => { + console.log('Done iterating.'); + }) + .catch(handleError); ``` If you prefer callbacks to promises, you may also use a `next` callback and a second `onDone` callback: @@ -307,7 +331,7 @@ stripe.customers.list().autoPagingEach( console.log('Done iterating.'); } } -) +); ``` If your `onItem` function does not accept a `next` callback parameter _or_ return a Promise, @@ -322,44 +346,55 @@ to prevent runaway list growth from consuming too much memory. Returns a promise of an array of all items across pages for a list request. ```js -const allNewCustomers = await stripe.customers.list({created: {gt: lastMonth}}) +const allNewCustomers = await stripe.customers + .list({created: {gt: lastMonth}}) .autoPagingToArray({limit: 10000}); ``` ## More Information - * [REST API Version](https://github.com/stripe/stripe-node/wiki/REST-API-Version) - * [Error Handling](https://github.com/stripe/stripe-node/wiki/Error-Handling) - * [Passing Options](https://github.com/stripe/stripe-node/wiki/Passing-Options) - * [Using Stripe Connect](https://github.com/stripe/stripe-node/wiki/Using-Stripe-Connect-with-node.js) +- [REST API Version](https://github.com/stripe/stripe-node/wiki/REST-API-Version) +- [Error Handling](https://github.com/stripe/stripe-node/wiki/Error-Handling) +- [Passing Options](https://github.com/stripe/stripe-node/wiki/Passing-Options) +- [Using Stripe Connect](https://github.com/stripe/stripe-node/wiki/Using-Stripe-Connect-with-node.js) ## Development Run all tests: ```bash -$ npm install -$ npm test +$ yarn install +$ yarn test ``` +If you do not have `yarn` installed, you can get it with `npm install --global yarn`. + Run a single test suite: ```bash -$ npm run mocha -- test/Error.spec.js +$ yarn mocha test/Error.spec.js ``` Run a single test (case sensitive): ```bash -$ npm run mocha -- test/Error.spec.js --grep 'Populates with type' +$ yarn mocha test/Error.spec.js --grep 'Populates with type' ``` -If you wish, you may run tests using your Stripe *Test* API key by setting the +If you wish, you may run tests using your Stripe _Test_ API key by setting the environment variable `STRIPE_TEST_API_KEY` before running the tests: ```bash $ export STRIPE_TEST_API_KEY='sk_test....' -$ npm test +$ yarn test +``` + +Run prettier: + +Add an [editor integration](https://prettier.io/docs/en/editors.html) or: + +```bash +$ yarn fix ``` [api-keys]: https://dashboard.stripe.com/account/apikeys diff --git a/test/utils.spec.js b/test/utils.spec.js index 8569a7ef0f..d9ae8a6d54 100644 --- a/test/utils.spec.js +++ b/test/utils.spec.js @@ -433,8 +433,8 @@ function handleWarnings(doWithShimmedConsoleWarn, onWarn) { /* eslint-enable no-console */ } else { + /* eslint-disable-next-line no-inner-declarations */ function onProcessWarn(warning) { - /* eslint-disable-line no-inner-declarations */ onWarn(warning.name + ': ' + warning.message); } diff --git a/testUtils/index.js b/testUtils/index.js index 93cba2b9ac..443b2c4655 100644 --- a/testUtils/index.js +++ b/testUtils/index.js @@ -89,7 +89,8 @@ var utils = (module.exports = { var cleanups = this._cleanupFns; var total = cleanups.length; var completed = 0; - for (var fn; (fn = cleanups.shift()); ) { + var fn; + while ((fn = cleanups.shift())) { var promise = fn.call(this); if (!promise || !promise.then) { throw new Error( From 7e00fae7478e20529cd141537cc5456049484519 Mon Sep 17 00:00:00 2001 From: Bryan Irace Date: Mon, 6 May 2019 09:46:35 -0400 Subject: [PATCH 09/10] Remove unnecessary newlines as per rattrayalex-stripe --- lib/StripeMethod.basic.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/StripeMethod.basic.js b/lib/StripeMethod.basic.js index cad47caaa5..a863c38151 100644 --- a/lib/StripeMethod.basic.js +++ b/lib/StripeMethod.basic.js @@ -70,9 +70,7 @@ module.exports = { 'POST', null, path, - { - metadata: null, - }, + {metadata: null}, auth, {}, function(err, response) { @@ -89,9 +87,7 @@ module.exports = { 'POST', null, path, - { - metadata: metadata, - }, + {metadata: metadata}, auth, {}, function(err, response) { From 2b1d7b64cfc49991b0098c0f501de9a584ec0fc0 Mon Sep 17 00:00:00 2001 From: Bryan Irace Date: Mon, 6 May 2019 09:47:42 -0400 Subject: [PATCH 10/10] Better error handling in README as per paulasjes-stripe --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8ad39b5beb..ca885aef9c 100644 --- a/README.md +++ b/README.md @@ -115,8 +115,12 @@ stripe.customers.create( email: 'customer@example.com', }, function(err, customer) { - err; // null if no error occurred - customer; // the created customer object + if (err) { + // Deal with an error (will be `null` if no error occurred). + } + + // Do something with created customer object + console.log(customer.id); } ); ```