From 01d329c3bc76a44d85f2e1b1f3948a908aeee06a Mon Sep 17 00:00:00 2001 From: nodkz Date: Thu, 7 Sep 2017 14:34:14 +0600 Subject: [PATCH] feat: Migrate on graphql-compose 2.9.0 - update dependencies - cover mongoose lib with flow-typed - refactor using reexported graphql package via graphql-compose/lib/graphql - reassemble type defs and remove definition.js file - bunch of other code-style changes --- .eslintrc | 4 +- .travis.yml | 2 +- flow-typed/npm/babel-cli_vx.x.x.js | 4 +- flow-typed/npm/babel-eslint_vx.x.x.js | 4 +- flow-typed/npm/babel-jest_vx.x.x.js | 32 + ...lugin-transform-flow-strip-types_vx.x.x.js | 4 +- ...gin-transform-object-rest-spread_vx.x.x.js | 4 +- .../babel-plugin-transform-runtime_vx.x.x.js | 39 + flow-typed/npm/babel-preset-env_vx.x.x.js | 4 +- flow-typed/npm/babel-runtime_vx.x.x.js | 1691 +++++++++++++++++ .../npm/cz-conventional-changelog_vx.x.x.js | 4 +- .../npm/eslint-config-airbnb-base_vx.x.x.js | 4 +- .../npm/eslint-config-prettier_vx.x.x.js | 59 + .../npm/eslint-plugin-flowtype_vx.x.x.js | 4 +- flow-typed/npm/eslint-plugin-import_vx.x.x.js | 4 +- .../npm/eslint-plugin-prettier_vx.x.x.js | 32 + flow-typed/npm/eslint_vx.x.x.js | 134 +- flow-typed/npm/jest_vx.x.x.js | 39 + flow-typed/npm/mongoose_v4.x.x.js | 497 +++++ flow-typed/npm/mongoose_vx.x.x.js | 913 --------- flow-typed/npm/object-path_vx.x.x.js | 4 +- flow-typed/npm/prettier_vx.x.x.js | 80 + flow-typed/npm/rimraf_vx.x.x.js | 4 +- flow-typed/npm/semantic-release_vx.x.x.js | 4 +- package.json | 32 +- src/__tests__/composeWithMongoose-test.js | 2 +- src/__tests__/fieldConverter-test.js | 28 +- src/__tests__/typeStorage-test.js | 6 +- src/composeWithMongoose.js | 128 +- src/definition.js | 224 --- src/fieldsConverter.js | 42 +- src/resolvers/__tests__/count-test.js | 5 +- src/resolvers/__tests__/createOne-test.js | 5 +- src/resolvers/__tests__/findById-test.js | 5 +- src/resolvers/__tests__/findByIds-test.js | 5 +- src/resolvers/__tests__/findOne-test.js | 5 +- src/resolvers/__tests__/removeById-test.js | 5 +- src/resolvers/__tests__/removeMany-test.js | 5 +- src/resolvers/__tests__/removeOne-test.js | 5 +- src/resolvers/__tests__/updateById-test.js | 10 +- src/resolvers/__tests__/updateMany-test.js | 5 +- src/resolvers/__tests__/updateOne-test.js | 5 +- src/resolvers/count.js | 7 +- src/resolvers/createOne.js | 7 +- src/resolvers/findById.js | 12 +- src/resolvers/findByIds.js | 20 +- src/resolvers/findMany.js | 21 +- src/resolvers/findOne.js | 18 +- .../helpers/__tests__/filter-test.js | 5 +- .../helpers/__tests__/record-test.js | 5 +- src/resolvers/helpers/__tests__/sort-test.js | 4 +- src/resolvers/helpers/filter.js | 43 +- src/resolvers/helpers/index.js | 8 + src/resolvers/helpers/limit.js | 11 +- src/resolvers/helpers/projection.js | 2 +- src/resolvers/helpers/record.js | 18 +- src/resolvers/helpers/skip.js | 3 +- src/resolvers/helpers/sort.js | 24 +- src/resolvers/index.js | 24 + src/resolvers/removeById.js | 10 +- src/resolvers/removeMany.js | 8 +- src/resolvers/removeOne.js | 8 +- src/resolvers/updateById.js | 5 +- src/resolvers/updateMany.js | 21 +- src/resolvers/updateOne.js | 11 +- src/typeStorage.js | 2 +- src/types/mongoid.js | 4 +- src/utils/getIndexesFromModel.js | 17 +- yarn.lock | 466 ++--- 69 files changed, 3245 insertions(+), 1631 deletions(-) create mode 100644 flow-typed/npm/babel-jest_vx.x.x.js create mode 100644 flow-typed/npm/babel-plugin-transform-runtime_vx.x.x.js create mode 100644 flow-typed/npm/babel-runtime_vx.x.x.js create mode 100644 flow-typed/npm/eslint-config-prettier_vx.x.x.js create mode 100644 flow-typed/npm/eslint-plugin-prettier_vx.x.x.js create mode 100644 flow-typed/npm/jest_vx.x.x.js create mode 100644 flow-typed/npm/mongoose_v4.x.x.js delete mode 100644 flow-typed/npm/mongoose_vx.x.x.js create mode 100644 flow-typed/npm/prettier_vx.x.x.js delete mode 100644 src/definition.js create mode 100644 src/resolvers/helpers/index.js diff --git a/.eslintrc b/.eslintrc index e729458f..c622f03e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -26,7 +26,8 @@ "trailingComma": "es5", }], "import/prefer-default-export": 0, - "arrow-parens": 0 + "arrow-parens": 0, + "prefer-destructuring": 0 }, "env": { "jasmine": true, @@ -40,5 +41,6 @@ "Class": true, "Iterator": true, "$Shape": true, + "$Keys": true, } } diff --git a/.travis.yml b/.travis.yml index 6ad6d642..02d1b8a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,9 @@ cache: notifications: email: true node_js: + - "8" - "7" - "6" - - "5" - "4" before_install: yarn global add greenkeeper-lockfile@1 before_script: greenkeeper-lockfile-update diff --git a/flow-typed/npm/babel-cli_vx.x.x.js b/flow-typed/npm/babel-cli_vx.x.x.js index 4c1daec3..2e574359 100644 --- a/flow-typed/npm/babel-cli_vx.x.x.js +++ b/flow-typed/npm/babel-cli_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 25c5e9a036a3e199649f88360d74aba9 -// flow-typed version: <>/babel-cli_v^6.24.1/flow_v0.47.0 +// flow-typed signature: adfc416d3944bc9e0c30c54aa3ad632b +// flow-typed version: <>/babel-cli_v^6.26.0/flow_v0.54.1 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/babel-eslint_vx.x.x.js b/flow-typed/npm/babel-eslint_vx.x.x.js index 0690494f..1dcd5e9c 100644 --- a/flow-typed/npm/babel-eslint_vx.x.x.js +++ b/flow-typed/npm/babel-eslint_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 3f39e881bf0b4e83c4715f3d9c1be3f9 -// flow-typed version: <>/babel-eslint_v^7.2.3/flow_v0.47.0 +// flow-typed signature: a339a1bc763a819934b7920cfda8cf01 +// flow-typed version: <>/babel-eslint_v^7.2.3/flow_v0.54.1 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/babel-jest_vx.x.x.js b/flow-typed/npm/babel-jest_vx.x.x.js new file mode 100644 index 00000000..f0a1a3dc --- /dev/null +++ b/flow-typed/npm/babel-jest_vx.x.x.js @@ -0,0 +1,32 @@ +// flow-typed signature: 140e378926218ceed9402f883b2debc2 +// flow-typed version: <>/babel-jest_v^21.0.0/flow_v0.54.1 + +/** + * This is an autogenerated libdef stub for: + * + * 'babel-jest' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'babel-jest' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'babel-jest/build/index' { + declare module.exports: any; +} + +// Filename aliases +declare module 'babel-jest/build/index.js' { + declare module.exports: $Exports<'babel-jest/build/index'>; +} diff --git a/flow-typed/npm/babel-plugin-transform-flow-strip-types_vx.x.x.js b/flow-typed/npm/babel-plugin-transform-flow-strip-types_vx.x.x.js index 538df804..aef23cbb 100644 --- a/flow-typed/npm/babel-plugin-transform-flow-strip-types_vx.x.x.js +++ b/flow-typed/npm/babel-plugin-transform-flow-strip-types_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: bbcb803d9f49929318cc761b809a9cf8 -// flow-typed version: <>/babel-plugin-transform-flow-strip-types_v^6.22.0/flow_v0.47.0 +// flow-typed signature: 9d65b0c9d809b07ed1065eb8981071bb +// flow-typed version: <>/babel-plugin-transform-flow-strip-types_v^6.22.0/flow_v0.54.1 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/babel-plugin-transform-object-rest-spread_vx.x.x.js b/flow-typed/npm/babel-plugin-transform-object-rest-spread_vx.x.x.js index 029e4d12..32f96a41 100644 --- a/flow-typed/npm/babel-plugin-transform-object-rest-spread_vx.x.x.js +++ b/flow-typed/npm/babel-plugin-transform-object-rest-spread_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: a7f10d4e1bb10a70f85748b8d561edb8 -// flow-typed version: <>/babel-plugin-transform-object-rest-spread_v^6.23.0/flow_v0.47.0 +// flow-typed signature: 89dfc917947ca47a4c5b9e1992cec48a +// flow-typed version: <>/babel-plugin-transform-object-rest-spread_v^6.26.0/flow_v0.54.1 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/babel-plugin-transform-runtime_vx.x.x.js b/flow-typed/npm/babel-plugin-transform-runtime_vx.x.x.js new file mode 100644 index 00000000..bd06592d --- /dev/null +++ b/flow-typed/npm/babel-plugin-transform-runtime_vx.x.x.js @@ -0,0 +1,39 @@ +// flow-typed signature: 3c0181a4c0caf2048ffeb2f4d65d65a4 +// flow-typed version: <>/babel-plugin-transform-runtime_v^6.23.0/flow_v0.54.1 + +/** + * This is an autogenerated libdef stub for: + * + * 'babel-plugin-transform-runtime' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'babel-plugin-transform-runtime' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'babel-plugin-transform-runtime/lib/definitions' { + declare module.exports: any; +} + +declare module 'babel-plugin-transform-runtime/lib/index' { + declare module.exports: any; +} + +// Filename aliases +declare module 'babel-plugin-transform-runtime/lib/definitions.js' { + declare module.exports: $Exports<'babel-plugin-transform-runtime/lib/definitions'>; +} +declare module 'babel-plugin-transform-runtime/lib/index.js' { + declare module.exports: $Exports<'babel-plugin-transform-runtime/lib/index'>; +} diff --git a/flow-typed/npm/babel-preset-env_vx.x.x.js b/flow-typed/npm/babel-preset-env_vx.x.x.js index ed44958f..39902fd9 100644 --- a/flow-typed/npm/babel-preset-env_vx.x.x.js +++ b/flow-typed/npm/babel-preset-env_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 9be49775f818b1a7831d1122a5bb96c7 -// flow-typed version: <>/babel-preset-env_v^1.5.1/flow_v0.47.0 +// flow-typed signature: 74d80f7769b6753de780fadfe23183ab +// flow-typed version: <>/babel-preset-env_v^1.5.2/flow_v0.54.1 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/babel-runtime_vx.x.x.js b/flow-typed/npm/babel-runtime_vx.x.x.js new file mode 100644 index 00000000..5dbe5b7f --- /dev/null +++ b/flow-typed/npm/babel-runtime_vx.x.x.js @@ -0,0 +1,1691 @@ +// flow-typed signature: d034cd70bf4b0e5fcb160731f5ba83e4 +// flow-typed version: <>/babel-runtime_v^6.26.0/flow_v0.54.1 + +/** + * This is an autogenerated libdef stub for: + * + * 'babel-runtime' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'babel-runtime' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'babel-runtime/core-js' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/concat' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/copy-within' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/entries' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/every' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/fill' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/filter' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/find-index' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/find' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/for-each' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/from' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/includes' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/index-of' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/join' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/keys' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/last-index-of' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/map' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/of' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/pop' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/push' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/reduce-right' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/reduce' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/reverse' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/shift' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/slice' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/some' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/sort' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/splice' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/unshift' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/array/values' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/asap' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/clear-immediate' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/error/is-error' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/get-iterator' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/is-iterable' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/json/stringify' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/map' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/acosh' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/asinh' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/atanh' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/cbrt' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/clz32' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/cosh' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/expm1' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/fround' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/hypot' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/iaddh' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/imul' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/imulh' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/isubh' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/log10' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/log1p' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/log2' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/sign' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/sinh' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/tanh' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/trunc' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/math/umulh' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/number/epsilon' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/number/is-finite' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/number/is-integer' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/number/is-nan' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/number/is-safe-integer' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/number/max-safe-integer' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/number/min-safe-integer' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/number/parse-float' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/number/parse-int' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/assign' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/create' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/define-properties' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/define-property' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/entries' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/freeze' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/get-own-property-descriptor' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/get-own-property-descriptors' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/get-own-property-names' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/get-own-property-symbols' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/get-prototype-of' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/is-extensible' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/is-frozen' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/is-sealed' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/is' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/keys' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/prevent-extensions' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/seal' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/set-prototype-of' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/object/values' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/observable' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/promise' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/apply' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/construct' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/define-metadata' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/define-property' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/delete-metadata' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/delete-property' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/enumerate' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/get-metadata-keys' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/get-metadata' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/get-own-metadata-keys' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/get-own-metadata' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/get-own-property-descriptor' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/get-prototype-of' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/get' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/has-metadata' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/has-own-metadata' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/has' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/is-extensible' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/metadata' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/own-keys' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/prevent-extensions' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/set-prototype-of' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/reflect/set' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/regexp/escape' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/set-immediate' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/set' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/at' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/code-point-at' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/ends-with' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/from-code-point' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/includes' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/match-all' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/pad-end' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/pad-left' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/pad-right' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/pad-start' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/raw' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/repeat' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/starts-with' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/trim-end' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/trim-left' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/trim-right' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/trim-start' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/string/trim' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/async-iterator' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/for' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/has-instance' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/is-concat-spreadable' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/iterator' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/key-for' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/match' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/observable' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/replace' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/search' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/species' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/split' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/to-primitive' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/to-string-tag' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/symbol/unscopables' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/system/global' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/weak-map' { + declare module.exports: any; +} + +declare module 'babel-runtime/core-js/weak-set' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_async-generator-delegate' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_async-generator' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_async-iterator' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_async-to-generator' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_class-call-check' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_create-class' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_defaults' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_define-enumerable-properties' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_define-property' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_extends' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_get' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_inherits' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_instanceof' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_interop-require-default' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_interop-require-wildcard' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_jsx' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_new-arrow-check' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_object-destructuring-empty' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_object-without-properties' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_possible-constructor-return' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_self-global' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_set' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_sliced-to-array-loose' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_sliced-to-array' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_tagged-template-literal-loose' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_tagged-template-literal' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_temporal-ref' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_temporal-undefined' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_to-array' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_to-consumable-array' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/_typeof' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/async-generator-delegate' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/async-generator' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/async-iterator' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/async-to-generator' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/asyncGenerator' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/asyncGeneratorDelegate' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/asyncIterator' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/asyncToGenerator' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/class-call-check' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/classCallCheck' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/create-class' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/createClass' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/defaults' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/define-enumerable-properties' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/define-property' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/defineEnumerableProperties' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/defineProperty' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/extends' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/get' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/inherits' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/instanceof' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/interop-require-default' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/interop-require-wildcard' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/interopRequireDefault' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/interopRequireWildcard' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/jsx' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/new-arrow-check' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/newArrowCheck' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/object-destructuring-empty' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/object-without-properties' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/objectDestructuringEmpty' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/objectWithoutProperties' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/possible-constructor-return' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/possibleConstructorReturn' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/self-global' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/selfGlobal' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/set' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/sliced-to-array-loose' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/sliced-to-array' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/slicedToArray' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/slicedToArrayLoose' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/tagged-template-literal-loose' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/tagged-template-literal' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/taggedTemplateLiteral' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/taggedTemplateLiteralLoose' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/temporal-ref' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/temporal-undefined' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/temporalRef' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/temporalUndefined' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/to-array' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/to-consumable-array' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/toArray' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/toConsumableArray' { + declare module.exports: any; +} + +declare module 'babel-runtime/helpers/typeof' { + declare module.exports: any; +} + +declare module 'babel-runtime/regenerator/index' { + declare module.exports: any; +} + +// Filename aliases +declare module 'babel-runtime/core-js.js' { + declare module.exports: $Exports<'babel-runtime/core-js'>; +} +declare module 'babel-runtime/core-js/array/concat.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/concat'>; +} +declare module 'babel-runtime/core-js/array/copy-within.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/copy-within'>; +} +declare module 'babel-runtime/core-js/array/entries.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/entries'>; +} +declare module 'babel-runtime/core-js/array/every.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/every'>; +} +declare module 'babel-runtime/core-js/array/fill.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/fill'>; +} +declare module 'babel-runtime/core-js/array/filter.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/filter'>; +} +declare module 'babel-runtime/core-js/array/find-index.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/find-index'>; +} +declare module 'babel-runtime/core-js/array/find.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/find'>; +} +declare module 'babel-runtime/core-js/array/for-each.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/for-each'>; +} +declare module 'babel-runtime/core-js/array/from.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/from'>; +} +declare module 'babel-runtime/core-js/array/includes.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/includes'>; +} +declare module 'babel-runtime/core-js/array/index-of.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/index-of'>; +} +declare module 'babel-runtime/core-js/array/join.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/join'>; +} +declare module 'babel-runtime/core-js/array/keys.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/keys'>; +} +declare module 'babel-runtime/core-js/array/last-index-of.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/last-index-of'>; +} +declare module 'babel-runtime/core-js/array/map.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/map'>; +} +declare module 'babel-runtime/core-js/array/of.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/of'>; +} +declare module 'babel-runtime/core-js/array/pop.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/pop'>; +} +declare module 'babel-runtime/core-js/array/push.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/push'>; +} +declare module 'babel-runtime/core-js/array/reduce-right.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/reduce-right'>; +} +declare module 'babel-runtime/core-js/array/reduce.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/reduce'>; +} +declare module 'babel-runtime/core-js/array/reverse.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/reverse'>; +} +declare module 'babel-runtime/core-js/array/shift.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/shift'>; +} +declare module 'babel-runtime/core-js/array/slice.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/slice'>; +} +declare module 'babel-runtime/core-js/array/some.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/some'>; +} +declare module 'babel-runtime/core-js/array/sort.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/sort'>; +} +declare module 'babel-runtime/core-js/array/splice.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/splice'>; +} +declare module 'babel-runtime/core-js/array/unshift.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/unshift'>; +} +declare module 'babel-runtime/core-js/array/values.js' { + declare module.exports: $Exports<'babel-runtime/core-js/array/values'>; +} +declare module 'babel-runtime/core-js/asap.js' { + declare module.exports: $Exports<'babel-runtime/core-js/asap'>; +} +declare module 'babel-runtime/core-js/clear-immediate.js' { + declare module.exports: $Exports<'babel-runtime/core-js/clear-immediate'>; +} +declare module 'babel-runtime/core-js/error/is-error.js' { + declare module.exports: $Exports<'babel-runtime/core-js/error/is-error'>; +} +declare module 'babel-runtime/core-js/get-iterator.js' { + declare module.exports: $Exports<'babel-runtime/core-js/get-iterator'>; +} +declare module 'babel-runtime/core-js/is-iterable.js' { + declare module.exports: $Exports<'babel-runtime/core-js/is-iterable'>; +} +declare module 'babel-runtime/core-js/json/stringify.js' { + declare module.exports: $Exports<'babel-runtime/core-js/json/stringify'>; +} +declare module 'babel-runtime/core-js/map.js' { + declare module.exports: $Exports<'babel-runtime/core-js/map'>; +} +declare module 'babel-runtime/core-js/math/acosh.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/acosh'>; +} +declare module 'babel-runtime/core-js/math/asinh.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/asinh'>; +} +declare module 'babel-runtime/core-js/math/atanh.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/atanh'>; +} +declare module 'babel-runtime/core-js/math/cbrt.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/cbrt'>; +} +declare module 'babel-runtime/core-js/math/clz32.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/clz32'>; +} +declare module 'babel-runtime/core-js/math/cosh.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/cosh'>; +} +declare module 'babel-runtime/core-js/math/expm1.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/expm1'>; +} +declare module 'babel-runtime/core-js/math/fround.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/fround'>; +} +declare module 'babel-runtime/core-js/math/hypot.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/hypot'>; +} +declare module 'babel-runtime/core-js/math/iaddh.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/iaddh'>; +} +declare module 'babel-runtime/core-js/math/imul.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/imul'>; +} +declare module 'babel-runtime/core-js/math/imulh.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/imulh'>; +} +declare module 'babel-runtime/core-js/math/isubh.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/isubh'>; +} +declare module 'babel-runtime/core-js/math/log10.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/log10'>; +} +declare module 'babel-runtime/core-js/math/log1p.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/log1p'>; +} +declare module 'babel-runtime/core-js/math/log2.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/log2'>; +} +declare module 'babel-runtime/core-js/math/sign.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/sign'>; +} +declare module 'babel-runtime/core-js/math/sinh.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/sinh'>; +} +declare module 'babel-runtime/core-js/math/tanh.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/tanh'>; +} +declare module 'babel-runtime/core-js/math/trunc.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/trunc'>; +} +declare module 'babel-runtime/core-js/math/umulh.js' { + declare module.exports: $Exports<'babel-runtime/core-js/math/umulh'>; +} +declare module 'babel-runtime/core-js/number/epsilon.js' { + declare module.exports: $Exports<'babel-runtime/core-js/number/epsilon'>; +} +declare module 'babel-runtime/core-js/number/is-finite.js' { + declare module.exports: $Exports<'babel-runtime/core-js/number/is-finite'>; +} +declare module 'babel-runtime/core-js/number/is-integer.js' { + declare module.exports: $Exports<'babel-runtime/core-js/number/is-integer'>; +} +declare module 'babel-runtime/core-js/number/is-nan.js' { + declare module.exports: $Exports<'babel-runtime/core-js/number/is-nan'>; +} +declare module 'babel-runtime/core-js/number/is-safe-integer.js' { + declare module.exports: $Exports<'babel-runtime/core-js/number/is-safe-integer'>; +} +declare module 'babel-runtime/core-js/number/max-safe-integer.js' { + declare module.exports: $Exports<'babel-runtime/core-js/number/max-safe-integer'>; +} +declare module 'babel-runtime/core-js/number/min-safe-integer.js' { + declare module.exports: $Exports<'babel-runtime/core-js/number/min-safe-integer'>; +} +declare module 'babel-runtime/core-js/number/parse-float.js' { + declare module.exports: $Exports<'babel-runtime/core-js/number/parse-float'>; +} +declare module 'babel-runtime/core-js/number/parse-int.js' { + declare module.exports: $Exports<'babel-runtime/core-js/number/parse-int'>; +} +declare module 'babel-runtime/core-js/object/assign.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/assign'>; +} +declare module 'babel-runtime/core-js/object/create.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/create'>; +} +declare module 'babel-runtime/core-js/object/define-properties.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/define-properties'>; +} +declare module 'babel-runtime/core-js/object/define-property.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/define-property'>; +} +declare module 'babel-runtime/core-js/object/entries.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/entries'>; +} +declare module 'babel-runtime/core-js/object/freeze.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/freeze'>; +} +declare module 'babel-runtime/core-js/object/get-own-property-descriptor.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/get-own-property-descriptor'>; +} +declare module 'babel-runtime/core-js/object/get-own-property-descriptors.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/get-own-property-descriptors'>; +} +declare module 'babel-runtime/core-js/object/get-own-property-names.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/get-own-property-names'>; +} +declare module 'babel-runtime/core-js/object/get-own-property-symbols.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/get-own-property-symbols'>; +} +declare module 'babel-runtime/core-js/object/get-prototype-of.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/get-prototype-of'>; +} +declare module 'babel-runtime/core-js/object/is-extensible.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/is-extensible'>; +} +declare module 'babel-runtime/core-js/object/is-frozen.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/is-frozen'>; +} +declare module 'babel-runtime/core-js/object/is-sealed.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/is-sealed'>; +} +declare module 'babel-runtime/core-js/object/is.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/is'>; +} +declare module 'babel-runtime/core-js/object/keys.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/keys'>; +} +declare module 'babel-runtime/core-js/object/prevent-extensions.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/prevent-extensions'>; +} +declare module 'babel-runtime/core-js/object/seal.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/seal'>; +} +declare module 'babel-runtime/core-js/object/set-prototype-of.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/set-prototype-of'>; +} +declare module 'babel-runtime/core-js/object/values.js' { + declare module.exports: $Exports<'babel-runtime/core-js/object/values'>; +} +declare module 'babel-runtime/core-js/observable.js' { + declare module.exports: $Exports<'babel-runtime/core-js/observable'>; +} +declare module 'babel-runtime/core-js/promise.js' { + declare module.exports: $Exports<'babel-runtime/core-js/promise'>; +} +declare module 'babel-runtime/core-js/reflect/apply.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/apply'>; +} +declare module 'babel-runtime/core-js/reflect/construct.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/construct'>; +} +declare module 'babel-runtime/core-js/reflect/define-metadata.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/define-metadata'>; +} +declare module 'babel-runtime/core-js/reflect/define-property.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/define-property'>; +} +declare module 'babel-runtime/core-js/reflect/delete-metadata.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/delete-metadata'>; +} +declare module 'babel-runtime/core-js/reflect/delete-property.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/delete-property'>; +} +declare module 'babel-runtime/core-js/reflect/enumerate.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/enumerate'>; +} +declare module 'babel-runtime/core-js/reflect/get-metadata-keys.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/get-metadata-keys'>; +} +declare module 'babel-runtime/core-js/reflect/get-metadata.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/get-metadata'>; +} +declare module 'babel-runtime/core-js/reflect/get-own-metadata-keys.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/get-own-metadata-keys'>; +} +declare module 'babel-runtime/core-js/reflect/get-own-metadata.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/get-own-metadata'>; +} +declare module 'babel-runtime/core-js/reflect/get-own-property-descriptor.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/get-own-property-descriptor'>; +} +declare module 'babel-runtime/core-js/reflect/get-prototype-of.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/get-prototype-of'>; +} +declare module 'babel-runtime/core-js/reflect/get.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/get'>; +} +declare module 'babel-runtime/core-js/reflect/has-metadata.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/has-metadata'>; +} +declare module 'babel-runtime/core-js/reflect/has-own-metadata.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/has-own-metadata'>; +} +declare module 'babel-runtime/core-js/reflect/has.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/has'>; +} +declare module 'babel-runtime/core-js/reflect/is-extensible.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/is-extensible'>; +} +declare module 'babel-runtime/core-js/reflect/metadata.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/metadata'>; +} +declare module 'babel-runtime/core-js/reflect/own-keys.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/own-keys'>; +} +declare module 'babel-runtime/core-js/reflect/prevent-extensions.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/prevent-extensions'>; +} +declare module 'babel-runtime/core-js/reflect/set-prototype-of.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/set-prototype-of'>; +} +declare module 'babel-runtime/core-js/reflect/set.js' { + declare module.exports: $Exports<'babel-runtime/core-js/reflect/set'>; +} +declare module 'babel-runtime/core-js/regexp/escape.js' { + declare module.exports: $Exports<'babel-runtime/core-js/regexp/escape'>; +} +declare module 'babel-runtime/core-js/set-immediate.js' { + declare module.exports: $Exports<'babel-runtime/core-js/set-immediate'>; +} +declare module 'babel-runtime/core-js/set.js' { + declare module.exports: $Exports<'babel-runtime/core-js/set'>; +} +declare module 'babel-runtime/core-js/string/at.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/at'>; +} +declare module 'babel-runtime/core-js/string/code-point-at.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/code-point-at'>; +} +declare module 'babel-runtime/core-js/string/ends-with.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/ends-with'>; +} +declare module 'babel-runtime/core-js/string/from-code-point.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/from-code-point'>; +} +declare module 'babel-runtime/core-js/string/includes.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/includes'>; +} +declare module 'babel-runtime/core-js/string/match-all.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/match-all'>; +} +declare module 'babel-runtime/core-js/string/pad-end.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/pad-end'>; +} +declare module 'babel-runtime/core-js/string/pad-left.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/pad-left'>; +} +declare module 'babel-runtime/core-js/string/pad-right.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/pad-right'>; +} +declare module 'babel-runtime/core-js/string/pad-start.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/pad-start'>; +} +declare module 'babel-runtime/core-js/string/raw.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/raw'>; +} +declare module 'babel-runtime/core-js/string/repeat.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/repeat'>; +} +declare module 'babel-runtime/core-js/string/starts-with.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/starts-with'>; +} +declare module 'babel-runtime/core-js/string/trim-end.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/trim-end'>; +} +declare module 'babel-runtime/core-js/string/trim-left.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/trim-left'>; +} +declare module 'babel-runtime/core-js/string/trim-right.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/trim-right'>; +} +declare module 'babel-runtime/core-js/string/trim-start.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/trim-start'>; +} +declare module 'babel-runtime/core-js/string/trim.js' { + declare module.exports: $Exports<'babel-runtime/core-js/string/trim'>; +} +declare module 'babel-runtime/core-js/symbol.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol'>; +} +declare module 'babel-runtime/core-js/symbol/async-iterator.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/async-iterator'>; +} +declare module 'babel-runtime/core-js/symbol/for.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/for'>; +} +declare module 'babel-runtime/core-js/symbol/has-instance.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/has-instance'>; +} +declare module 'babel-runtime/core-js/symbol/is-concat-spreadable.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/is-concat-spreadable'>; +} +declare module 'babel-runtime/core-js/symbol/iterator.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/iterator'>; +} +declare module 'babel-runtime/core-js/symbol/key-for.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/key-for'>; +} +declare module 'babel-runtime/core-js/symbol/match.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/match'>; +} +declare module 'babel-runtime/core-js/symbol/observable.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/observable'>; +} +declare module 'babel-runtime/core-js/symbol/replace.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/replace'>; +} +declare module 'babel-runtime/core-js/symbol/search.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/search'>; +} +declare module 'babel-runtime/core-js/symbol/species.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/species'>; +} +declare module 'babel-runtime/core-js/symbol/split.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/split'>; +} +declare module 'babel-runtime/core-js/symbol/to-primitive.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/to-primitive'>; +} +declare module 'babel-runtime/core-js/symbol/to-string-tag.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/to-string-tag'>; +} +declare module 'babel-runtime/core-js/symbol/unscopables.js' { + declare module.exports: $Exports<'babel-runtime/core-js/symbol/unscopables'>; +} +declare module 'babel-runtime/core-js/system/global.js' { + declare module.exports: $Exports<'babel-runtime/core-js/system/global'>; +} +declare module 'babel-runtime/core-js/weak-map.js' { + declare module.exports: $Exports<'babel-runtime/core-js/weak-map'>; +} +declare module 'babel-runtime/core-js/weak-set.js' { + declare module.exports: $Exports<'babel-runtime/core-js/weak-set'>; +} +declare module 'babel-runtime/helpers/_async-generator-delegate.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_async-generator-delegate'>; +} +declare module 'babel-runtime/helpers/_async-generator.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_async-generator'>; +} +declare module 'babel-runtime/helpers/_async-iterator.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_async-iterator'>; +} +declare module 'babel-runtime/helpers/_async-to-generator.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_async-to-generator'>; +} +declare module 'babel-runtime/helpers/_class-call-check.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_class-call-check'>; +} +declare module 'babel-runtime/helpers/_create-class.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_create-class'>; +} +declare module 'babel-runtime/helpers/_defaults.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_defaults'>; +} +declare module 'babel-runtime/helpers/_define-enumerable-properties.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_define-enumerable-properties'>; +} +declare module 'babel-runtime/helpers/_define-property.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_define-property'>; +} +declare module 'babel-runtime/helpers/_extends.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_extends'>; +} +declare module 'babel-runtime/helpers/_get.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_get'>; +} +declare module 'babel-runtime/helpers/_inherits.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_inherits'>; +} +declare module 'babel-runtime/helpers/_instanceof.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_instanceof'>; +} +declare module 'babel-runtime/helpers/_interop-require-default.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_interop-require-default'>; +} +declare module 'babel-runtime/helpers/_interop-require-wildcard.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_interop-require-wildcard'>; +} +declare module 'babel-runtime/helpers/_jsx.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_jsx'>; +} +declare module 'babel-runtime/helpers/_new-arrow-check.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_new-arrow-check'>; +} +declare module 'babel-runtime/helpers/_object-destructuring-empty.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_object-destructuring-empty'>; +} +declare module 'babel-runtime/helpers/_object-without-properties.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_object-without-properties'>; +} +declare module 'babel-runtime/helpers/_possible-constructor-return.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_possible-constructor-return'>; +} +declare module 'babel-runtime/helpers/_self-global.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_self-global'>; +} +declare module 'babel-runtime/helpers/_set.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_set'>; +} +declare module 'babel-runtime/helpers/_sliced-to-array-loose.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_sliced-to-array-loose'>; +} +declare module 'babel-runtime/helpers/_sliced-to-array.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_sliced-to-array'>; +} +declare module 'babel-runtime/helpers/_tagged-template-literal-loose.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_tagged-template-literal-loose'>; +} +declare module 'babel-runtime/helpers/_tagged-template-literal.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_tagged-template-literal'>; +} +declare module 'babel-runtime/helpers/_temporal-ref.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_temporal-ref'>; +} +declare module 'babel-runtime/helpers/_temporal-undefined.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_temporal-undefined'>; +} +declare module 'babel-runtime/helpers/_to-array.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_to-array'>; +} +declare module 'babel-runtime/helpers/_to-consumable-array.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_to-consumable-array'>; +} +declare module 'babel-runtime/helpers/_typeof.js' { + declare module.exports: $Exports<'babel-runtime/helpers/_typeof'>; +} +declare module 'babel-runtime/helpers/async-generator-delegate.js' { + declare module.exports: $Exports<'babel-runtime/helpers/async-generator-delegate'>; +} +declare module 'babel-runtime/helpers/async-generator.js' { + declare module.exports: $Exports<'babel-runtime/helpers/async-generator'>; +} +declare module 'babel-runtime/helpers/async-iterator.js' { + declare module.exports: $Exports<'babel-runtime/helpers/async-iterator'>; +} +declare module 'babel-runtime/helpers/async-to-generator.js' { + declare module.exports: $Exports<'babel-runtime/helpers/async-to-generator'>; +} +declare module 'babel-runtime/helpers/asyncGenerator.js' { + declare module.exports: $Exports<'babel-runtime/helpers/asyncGenerator'>; +} +declare module 'babel-runtime/helpers/asyncGeneratorDelegate.js' { + declare module.exports: $Exports<'babel-runtime/helpers/asyncGeneratorDelegate'>; +} +declare module 'babel-runtime/helpers/asyncIterator.js' { + declare module.exports: $Exports<'babel-runtime/helpers/asyncIterator'>; +} +declare module 'babel-runtime/helpers/asyncToGenerator.js' { + declare module.exports: $Exports<'babel-runtime/helpers/asyncToGenerator'>; +} +declare module 'babel-runtime/helpers/class-call-check.js' { + declare module.exports: $Exports<'babel-runtime/helpers/class-call-check'>; +} +declare module 'babel-runtime/helpers/classCallCheck.js' { + declare module.exports: $Exports<'babel-runtime/helpers/classCallCheck'>; +} +declare module 'babel-runtime/helpers/create-class.js' { + declare module.exports: $Exports<'babel-runtime/helpers/create-class'>; +} +declare module 'babel-runtime/helpers/createClass.js' { + declare module.exports: $Exports<'babel-runtime/helpers/createClass'>; +} +declare module 'babel-runtime/helpers/defaults.js' { + declare module.exports: $Exports<'babel-runtime/helpers/defaults'>; +} +declare module 'babel-runtime/helpers/define-enumerable-properties.js' { + declare module.exports: $Exports<'babel-runtime/helpers/define-enumerable-properties'>; +} +declare module 'babel-runtime/helpers/define-property.js' { + declare module.exports: $Exports<'babel-runtime/helpers/define-property'>; +} +declare module 'babel-runtime/helpers/defineEnumerableProperties.js' { + declare module.exports: $Exports<'babel-runtime/helpers/defineEnumerableProperties'>; +} +declare module 'babel-runtime/helpers/defineProperty.js' { + declare module.exports: $Exports<'babel-runtime/helpers/defineProperty'>; +} +declare module 'babel-runtime/helpers/extends.js' { + declare module.exports: $Exports<'babel-runtime/helpers/extends'>; +} +declare module 'babel-runtime/helpers/get.js' { + declare module.exports: $Exports<'babel-runtime/helpers/get'>; +} +declare module 'babel-runtime/helpers/inherits.js' { + declare module.exports: $Exports<'babel-runtime/helpers/inherits'>; +} +declare module 'babel-runtime/helpers/instanceof.js' { + declare module.exports: $Exports<'babel-runtime/helpers/instanceof'>; +} +declare module 'babel-runtime/helpers/interop-require-default.js' { + declare module.exports: $Exports<'babel-runtime/helpers/interop-require-default'>; +} +declare module 'babel-runtime/helpers/interop-require-wildcard.js' { + declare module.exports: $Exports<'babel-runtime/helpers/interop-require-wildcard'>; +} +declare module 'babel-runtime/helpers/interopRequireDefault.js' { + declare module.exports: $Exports<'babel-runtime/helpers/interopRequireDefault'>; +} +declare module 'babel-runtime/helpers/interopRequireWildcard.js' { + declare module.exports: $Exports<'babel-runtime/helpers/interopRequireWildcard'>; +} +declare module 'babel-runtime/helpers/jsx.js' { + declare module.exports: $Exports<'babel-runtime/helpers/jsx'>; +} +declare module 'babel-runtime/helpers/new-arrow-check.js' { + declare module.exports: $Exports<'babel-runtime/helpers/new-arrow-check'>; +} +declare module 'babel-runtime/helpers/newArrowCheck.js' { + declare module.exports: $Exports<'babel-runtime/helpers/newArrowCheck'>; +} +declare module 'babel-runtime/helpers/object-destructuring-empty.js' { + declare module.exports: $Exports<'babel-runtime/helpers/object-destructuring-empty'>; +} +declare module 'babel-runtime/helpers/object-without-properties.js' { + declare module.exports: $Exports<'babel-runtime/helpers/object-without-properties'>; +} +declare module 'babel-runtime/helpers/objectDestructuringEmpty.js' { + declare module.exports: $Exports<'babel-runtime/helpers/objectDestructuringEmpty'>; +} +declare module 'babel-runtime/helpers/objectWithoutProperties.js' { + declare module.exports: $Exports<'babel-runtime/helpers/objectWithoutProperties'>; +} +declare module 'babel-runtime/helpers/possible-constructor-return.js' { + declare module.exports: $Exports<'babel-runtime/helpers/possible-constructor-return'>; +} +declare module 'babel-runtime/helpers/possibleConstructorReturn.js' { + declare module.exports: $Exports<'babel-runtime/helpers/possibleConstructorReturn'>; +} +declare module 'babel-runtime/helpers/self-global.js' { + declare module.exports: $Exports<'babel-runtime/helpers/self-global'>; +} +declare module 'babel-runtime/helpers/selfGlobal.js' { + declare module.exports: $Exports<'babel-runtime/helpers/selfGlobal'>; +} +declare module 'babel-runtime/helpers/set.js' { + declare module.exports: $Exports<'babel-runtime/helpers/set'>; +} +declare module 'babel-runtime/helpers/sliced-to-array-loose.js' { + declare module.exports: $Exports<'babel-runtime/helpers/sliced-to-array-loose'>; +} +declare module 'babel-runtime/helpers/sliced-to-array.js' { + declare module.exports: $Exports<'babel-runtime/helpers/sliced-to-array'>; +} +declare module 'babel-runtime/helpers/slicedToArray.js' { + declare module.exports: $Exports<'babel-runtime/helpers/slicedToArray'>; +} +declare module 'babel-runtime/helpers/slicedToArrayLoose.js' { + declare module.exports: $Exports<'babel-runtime/helpers/slicedToArrayLoose'>; +} +declare module 'babel-runtime/helpers/tagged-template-literal-loose.js' { + declare module.exports: $Exports<'babel-runtime/helpers/tagged-template-literal-loose'>; +} +declare module 'babel-runtime/helpers/tagged-template-literal.js' { + declare module.exports: $Exports<'babel-runtime/helpers/tagged-template-literal'>; +} +declare module 'babel-runtime/helpers/taggedTemplateLiteral.js' { + declare module.exports: $Exports<'babel-runtime/helpers/taggedTemplateLiteral'>; +} +declare module 'babel-runtime/helpers/taggedTemplateLiteralLoose.js' { + declare module.exports: $Exports<'babel-runtime/helpers/taggedTemplateLiteralLoose'>; +} +declare module 'babel-runtime/helpers/temporal-ref.js' { + declare module.exports: $Exports<'babel-runtime/helpers/temporal-ref'>; +} +declare module 'babel-runtime/helpers/temporal-undefined.js' { + declare module.exports: $Exports<'babel-runtime/helpers/temporal-undefined'>; +} +declare module 'babel-runtime/helpers/temporalRef.js' { + declare module.exports: $Exports<'babel-runtime/helpers/temporalRef'>; +} +declare module 'babel-runtime/helpers/temporalUndefined.js' { + declare module.exports: $Exports<'babel-runtime/helpers/temporalUndefined'>; +} +declare module 'babel-runtime/helpers/to-array.js' { + declare module.exports: $Exports<'babel-runtime/helpers/to-array'>; +} +declare module 'babel-runtime/helpers/to-consumable-array.js' { + declare module.exports: $Exports<'babel-runtime/helpers/to-consumable-array'>; +} +declare module 'babel-runtime/helpers/toArray.js' { + declare module.exports: $Exports<'babel-runtime/helpers/toArray'>; +} +declare module 'babel-runtime/helpers/toConsumableArray.js' { + declare module.exports: $Exports<'babel-runtime/helpers/toConsumableArray'>; +} +declare module 'babel-runtime/helpers/typeof.js' { + declare module.exports: $Exports<'babel-runtime/helpers/typeof'>; +} +declare module 'babel-runtime/regenerator/index.js' { + declare module.exports: $Exports<'babel-runtime/regenerator/index'>; +} diff --git a/flow-typed/npm/cz-conventional-changelog_vx.x.x.js b/flow-typed/npm/cz-conventional-changelog_vx.x.x.js index 64bd33ab..9dbe62c2 100644 --- a/flow-typed/npm/cz-conventional-changelog_vx.x.x.js +++ b/flow-typed/npm/cz-conventional-changelog_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 98fa4f62b7a9ad35a7a43f0fc38c54f6 -// flow-typed version: <>/cz-conventional-changelog_v^2.0.0/flow_v0.47.0 +// flow-typed signature: 14f08f6fb00b23789863dc2dfb573350 +// flow-typed version: <>/cz-conventional-changelog_v^2.0.0/flow_v0.54.1 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/eslint-config-airbnb-base_vx.x.x.js b/flow-typed/npm/eslint-config-airbnb-base_vx.x.x.js index 38437768..da4309e1 100644 --- a/flow-typed/npm/eslint-config-airbnb-base_vx.x.x.js +++ b/flow-typed/npm/eslint-config-airbnb-base_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 7dd13c80f73219071633f222958e8ef8 -// flow-typed version: <>/eslint-config-airbnb-base_v^11.2.0/flow_v0.47.0 +// flow-typed signature: 865f24e3b831228744b25759c2f008a0 +// flow-typed version: <>/eslint-config-airbnb-base_v^12.0.0/flow_v0.54.1 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/eslint-config-prettier_vx.x.x.js b/flow-typed/npm/eslint-config-prettier_vx.x.x.js new file mode 100644 index 00000000..8644ee7e --- /dev/null +++ b/flow-typed/npm/eslint-config-prettier_vx.x.x.js @@ -0,0 +1,59 @@ +// flow-typed signature: 69ef6d4efe092588f3a851dc30d6d869 +// flow-typed version: <>/eslint-config-prettier_v^2.4.0/flow_v0.54.1 + +/** + * This is an autogenerated libdef stub for: + * + * 'eslint-config-prettier' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'eslint-config-prettier' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'eslint-config-prettier/bin/cli' { + declare module.exports: any; +} + +declare module 'eslint-config-prettier/bin/validators' { + declare module.exports: any; +} + +declare module 'eslint-config-prettier/flowtype' { + declare module.exports: any; +} + +declare module 'eslint-config-prettier/react' { + declare module.exports: any; +} + +// Filename aliases +declare module 'eslint-config-prettier/bin/cli.js' { + declare module.exports: $Exports<'eslint-config-prettier/bin/cli'>; +} +declare module 'eslint-config-prettier/bin/validators.js' { + declare module.exports: $Exports<'eslint-config-prettier/bin/validators'>; +} +declare module 'eslint-config-prettier/flowtype.js' { + declare module.exports: $Exports<'eslint-config-prettier/flowtype'>; +} +declare module 'eslint-config-prettier/index' { + declare module.exports: $Exports<'eslint-config-prettier'>; +} +declare module 'eslint-config-prettier/index.js' { + declare module.exports: $Exports<'eslint-config-prettier'>; +} +declare module 'eslint-config-prettier/react.js' { + declare module.exports: $Exports<'eslint-config-prettier/react'>; +} diff --git a/flow-typed/npm/eslint-plugin-flowtype_vx.x.x.js b/flow-typed/npm/eslint-plugin-flowtype_vx.x.x.js index 1a501d78..7e098f7b 100644 --- a/flow-typed/npm/eslint-plugin-flowtype_vx.x.x.js +++ b/flow-typed/npm/eslint-plugin-flowtype_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 76c6377cfbfae74fc012426575a72672 -// flow-typed version: <>/eslint-plugin-flowtype_v^2.34.0/flow_v0.47.0 +// flow-typed signature: b337881bcd475ba74e4f385f5284d792 +// flow-typed version: <>/eslint-plugin-flowtype_v^2.35.1/flow_v0.54.1 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/eslint-plugin-import_vx.x.x.js b/flow-typed/npm/eslint-plugin-import_vx.x.x.js index 0b32c21c..b085cb9a 100644 --- a/flow-typed/npm/eslint-plugin-import_vx.x.x.js +++ b/flow-typed/npm/eslint-plugin-import_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 9eb967c73a45d2b171be28455df24670 -// flow-typed version: <>/eslint-plugin-import_v^2.3.0/flow_v0.47.0 +// flow-typed signature: 6fbf610c7f983a335def5ef026c6096a +// flow-typed version: <>/eslint-plugin-import_v^2.3.0/flow_v0.54.1 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/eslint-plugin-prettier_vx.x.x.js b/flow-typed/npm/eslint-plugin-prettier_vx.x.x.js new file mode 100644 index 00000000..d25f4b6d --- /dev/null +++ b/flow-typed/npm/eslint-plugin-prettier_vx.x.x.js @@ -0,0 +1,32 @@ +// flow-typed signature: b1370f19e3bbb4a40a87a527f06a977f +// flow-typed version: <>/eslint-plugin-prettier_v^2.2.0/flow_v0.54.1 + +/** + * This is an autogenerated libdef stub for: + * + * 'eslint-plugin-prettier' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'eslint-plugin-prettier' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'eslint-plugin-prettier/eslint-plugin-prettier' { + declare module.exports: any; +} + +// Filename aliases +declare module 'eslint-plugin-prettier/eslint-plugin-prettier.js' { + declare module.exports: $Exports<'eslint-plugin-prettier/eslint-plugin-prettier'>; +} diff --git a/flow-typed/npm/eslint_vx.x.x.js b/flow-typed/npm/eslint_vx.x.x.js index e5c18868..f4e72b38 100644 --- a/flow-typed/npm/eslint_vx.x.x.js +++ b/flow-typed/npm/eslint_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 1c4fabf7fb32c872df5e4e32a449f056 -// flow-typed version: <>/eslint_v^3.19.0/flow_v0.47.0 +// flow-typed signature: b4d0a131a8866156c23d02ea64f4f7fa +// flow-typed version: <>/eslint_v^4.6.1/flow_v0.54.1 /** * This is an autogenerated libdef stub for: @@ -26,7 +26,15 @@ declare module 'eslint/bin/eslint' { declare module.exports: any; } -declare module 'eslint/conf/cli-options' { +declare module 'eslint/conf/config-schema' { + declare module.exports: any; +} + +declare module 'eslint/conf/default-cli-options' { + declare module.exports: any; +} + +declare module 'eslint/conf/default-config-options' { declare module.exports: any; } @@ -94,6 +102,10 @@ declare module 'eslint/lib/config/autoconfig' { declare module.exports: any; } +declare module 'eslint/lib/config/config-cache' { + declare module.exports: any; +} + declare module 'eslint/lib/config/config-file' { declare module.exports: any; } @@ -122,10 +134,6 @@ declare module 'eslint/lib/config/plugins' { declare module.exports: any; } -declare module 'eslint/lib/eslint' { - declare module.exports: any; -} - declare module 'eslint/lib/file-finder' { declare module.exports: any; } @@ -190,6 +198,10 @@ declare module 'eslint/lib/internal-rules/internal-no-invalid-meta' { declare module.exports: any; } +declare module 'eslint/lib/linter' { + declare module.exports: any; +} + declare module 'eslint/lib/load-rules' { declare module.exports: any; } @@ -202,7 +214,7 @@ declare module 'eslint/lib/options' { declare module.exports: any; } -declare module 'eslint/lib/rule-context' { +declare module 'eslint/lib/report-translator' { declare module.exports: any; } @@ -214,6 +226,10 @@ declare module 'eslint/lib/rules/accessor-pairs' { declare module.exports: any; } +declare module 'eslint/lib/rules/array-bracket-newline' { + declare module.exports: any; +} + declare module 'eslint/lib/rules/array-bracket-spacing' { declare module.exports: any; } @@ -222,6 +238,10 @@ declare module 'eslint/lib/rules/array-callback-return' { declare module.exports: any; } +declare module 'eslint/lib/rules/array-element-newline' { + declare module.exports: any; +} + declare module 'eslint/lib/rules/arrow-body-style' { declare module.exports: any; } @@ -318,6 +338,10 @@ declare module 'eslint/lib/rules/eqeqeq' { declare module.exports: any; } +declare module 'eslint/lib/rules/for-direction' { + declare module.exports: any; +} + declare module 'eslint/lib/rules/func-call-spacing' { declare module.exports: any; } @@ -334,10 +358,18 @@ declare module 'eslint/lib/rules/func-style' { declare module.exports: any; } +declare module 'eslint/lib/rules/function-paren-newline' { + declare module.exports: any; +} + declare module 'eslint/lib/rules/generator-star-spacing' { declare module.exports: any; } +declare module 'eslint/lib/rules/getter-return' { + declare module.exports: any; +} + declare module 'eslint/lib/rules/global-require' { declare module.exports: any; } @@ -362,6 +394,10 @@ declare module 'eslint/lib/rules/id-match' { declare module.exports: any; } +declare module 'eslint/lib/rules/indent-legacy' { + declare module.exports: any; +} + declare module 'eslint/lib/rules/indent' { declare module.exports: any; } @@ -466,6 +502,10 @@ declare module 'eslint/lib/rules/no-bitwise' { declare module.exports: any; } +declare module 'eslint/lib/rules/no-buffer-constructor' { + declare module.exports: any; +} + declare module 'eslint/lib/rules/no-caller' { declare module.exports: any; } @@ -1026,6 +1066,10 @@ declare module 'eslint/lib/rules/padded-blocks' { declare module.exports: any; } +declare module 'eslint/lib/rules/padding-line-between-statements' { + declare module.exports: any; +} + declare module 'eslint/lib/rules/prefer-arrow-callback' { declare module.exports: any; } @@ -1094,6 +1138,10 @@ declare module 'eslint/lib/rules/semi-spacing' { declare module.exports: any; } +declare module 'eslint/lib/rules/semi-style' { + declare module.exports: any; +} + declare module 'eslint/lib/rules/semi' { declare module.exports: any; } @@ -1138,6 +1186,10 @@ declare module 'eslint/lib/rules/strict' { declare module.exports: any; } +declare module 'eslint/lib/rules/switch-colon-spacing' { + declare module.exports: any; +} + declare module 'eslint/lib/rules/symbol-description' { declare module.exports: any; } @@ -1186,10 +1238,6 @@ declare module 'eslint/lib/rules/yoda' { declare module.exports: any; } -declare module 'eslint/lib/testers/event-generator-tester' { - declare module.exports: any; -} - declare module 'eslint/lib/testers/rule-tester' { declare module.exports: any; } @@ -1250,7 +1298,7 @@ declare module 'eslint/lib/token-store/utils' { declare module.exports: any; } -declare module 'eslint/lib/util/comment-event-generator' { +declare module 'eslint/lib/util/ajv' { declare module.exports: any; } @@ -1322,8 +1370,14 @@ declare module 'eslint/lib/util/xml-escape' { declare module 'eslint/bin/eslint.js' { declare module.exports: $Exports<'eslint/bin/eslint'>; } -declare module 'eslint/conf/cli-options.js' { - declare module.exports: $Exports<'eslint/conf/cli-options'>; +declare module 'eslint/conf/config-schema.js' { + declare module.exports: $Exports<'eslint/conf/config-schema'>; +} +declare module 'eslint/conf/default-cli-options.js' { + declare module.exports: $Exports<'eslint/conf/default-cli-options'>; +} +declare module 'eslint/conf/default-config-options.js' { + declare module.exports: $Exports<'eslint/conf/default-config-options'>; } declare module 'eslint/conf/environments.js' { declare module.exports: $Exports<'eslint/conf/environments'>; @@ -1373,6 +1427,9 @@ declare module 'eslint/lib/config.js' { declare module 'eslint/lib/config/autoconfig.js' { declare module.exports: $Exports<'eslint/lib/config/autoconfig'>; } +declare module 'eslint/lib/config/config-cache.js' { + declare module.exports: $Exports<'eslint/lib/config/config-cache'>; +} declare module 'eslint/lib/config/config-file.js' { declare module.exports: $Exports<'eslint/lib/config/config-file'>; } @@ -1394,9 +1451,6 @@ declare module 'eslint/lib/config/environments.js' { declare module 'eslint/lib/config/plugins.js' { declare module.exports: $Exports<'eslint/lib/config/plugins'>; } -declare module 'eslint/lib/eslint.js' { - declare module.exports: $Exports<'eslint/lib/eslint'>; -} declare module 'eslint/lib/file-finder.js' { declare module.exports: $Exports<'eslint/lib/file-finder'>; } @@ -1445,6 +1499,9 @@ declare module 'eslint/lib/internal-rules/internal-consistent-docs-description.j declare module 'eslint/lib/internal-rules/internal-no-invalid-meta.js' { declare module.exports: $Exports<'eslint/lib/internal-rules/internal-no-invalid-meta'>; } +declare module 'eslint/lib/linter.js' { + declare module.exports: $Exports<'eslint/lib/linter'>; +} declare module 'eslint/lib/load-rules.js' { declare module.exports: $Exports<'eslint/lib/load-rules'>; } @@ -1454,8 +1511,8 @@ declare module 'eslint/lib/logging.js' { declare module 'eslint/lib/options.js' { declare module.exports: $Exports<'eslint/lib/options'>; } -declare module 'eslint/lib/rule-context.js' { - declare module.exports: $Exports<'eslint/lib/rule-context'>; +declare module 'eslint/lib/report-translator.js' { + declare module.exports: $Exports<'eslint/lib/report-translator'>; } declare module 'eslint/lib/rules.js' { declare module.exports: $Exports<'eslint/lib/rules'>; @@ -1463,12 +1520,18 @@ declare module 'eslint/lib/rules.js' { declare module 'eslint/lib/rules/accessor-pairs.js' { declare module.exports: $Exports<'eslint/lib/rules/accessor-pairs'>; } +declare module 'eslint/lib/rules/array-bracket-newline.js' { + declare module.exports: $Exports<'eslint/lib/rules/array-bracket-newline'>; +} declare module 'eslint/lib/rules/array-bracket-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/array-bracket-spacing'>; } declare module 'eslint/lib/rules/array-callback-return.js' { declare module.exports: $Exports<'eslint/lib/rules/array-callback-return'>; } +declare module 'eslint/lib/rules/array-element-newline.js' { + declare module.exports: $Exports<'eslint/lib/rules/array-element-newline'>; +} declare module 'eslint/lib/rules/arrow-body-style.js' { declare module.exports: $Exports<'eslint/lib/rules/arrow-body-style'>; } @@ -1541,6 +1604,9 @@ declare module 'eslint/lib/rules/eol-last.js' { declare module 'eslint/lib/rules/eqeqeq.js' { declare module.exports: $Exports<'eslint/lib/rules/eqeqeq'>; } +declare module 'eslint/lib/rules/for-direction.js' { + declare module.exports: $Exports<'eslint/lib/rules/for-direction'>; +} declare module 'eslint/lib/rules/func-call-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/func-call-spacing'>; } @@ -1553,9 +1619,15 @@ declare module 'eslint/lib/rules/func-names.js' { declare module 'eslint/lib/rules/func-style.js' { declare module.exports: $Exports<'eslint/lib/rules/func-style'>; } +declare module 'eslint/lib/rules/function-paren-newline.js' { + declare module.exports: $Exports<'eslint/lib/rules/function-paren-newline'>; +} declare module 'eslint/lib/rules/generator-star-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/generator-star-spacing'>; } +declare module 'eslint/lib/rules/getter-return.js' { + declare module.exports: $Exports<'eslint/lib/rules/getter-return'>; +} declare module 'eslint/lib/rules/global-require.js' { declare module.exports: $Exports<'eslint/lib/rules/global-require'>; } @@ -1574,6 +1646,9 @@ declare module 'eslint/lib/rules/id-length.js' { declare module 'eslint/lib/rules/id-match.js' { declare module.exports: $Exports<'eslint/lib/rules/id-match'>; } +declare module 'eslint/lib/rules/indent-legacy.js' { + declare module.exports: $Exports<'eslint/lib/rules/indent-legacy'>; +} declare module 'eslint/lib/rules/indent.js' { declare module.exports: $Exports<'eslint/lib/rules/indent'>; } @@ -1652,6 +1727,9 @@ declare module 'eslint/lib/rules/no-await-in-loop.js' { declare module 'eslint/lib/rules/no-bitwise.js' { declare module.exports: $Exports<'eslint/lib/rules/no-bitwise'>; } +declare module 'eslint/lib/rules/no-buffer-constructor.js' { + declare module.exports: $Exports<'eslint/lib/rules/no-buffer-constructor'>; +} declare module 'eslint/lib/rules/no-caller.js' { declare module.exports: $Exports<'eslint/lib/rules/no-caller'>; } @@ -2072,6 +2150,9 @@ declare module 'eslint/lib/rules/operator-linebreak.js' { declare module 'eslint/lib/rules/padded-blocks.js' { declare module.exports: $Exports<'eslint/lib/rules/padded-blocks'>; } +declare module 'eslint/lib/rules/padding-line-between-statements.js' { + declare module.exports: $Exports<'eslint/lib/rules/padding-line-between-statements'>; +} declare module 'eslint/lib/rules/prefer-arrow-callback.js' { declare module.exports: $Exports<'eslint/lib/rules/prefer-arrow-callback'>; } @@ -2123,6 +2204,9 @@ declare module 'eslint/lib/rules/rest-spread-spacing.js' { declare module 'eslint/lib/rules/semi-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/semi-spacing'>; } +declare module 'eslint/lib/rules/semi-style.js' { + declare module.exports: $Exports<'eslint/lib/rules/semi-style'>; +} declare module 'eslint/lib/rules/semi.js' { declare module.exports: $Exports<'eslint/lib/rules/semi'>; } @@ -2156,6 +2240,9 @@ declare module 'eslint/lib/rules/spaced-comment.js' { declare module 'eslint/lib/rules/strict.js' { declare module.exports: $Exports<'eslint/lib/rules/strict'>; } +declare module 'eslint/lib/rules/switch-colon-spacing.js' { + declare module.exports: $Exports<'eslint/lib/rules/switch-colon-spacing'>; +} declare module 'eslint/lib/rules/symbol-description.js' { declare module.exports: $Exports<'eslint/lib/rules/symbol-description'>; } @@ -2192,9 +2279,6 @@ declare module 'eslint/lib/rules/yield-star-spacing.js' { declare module 'eslint/lib/rules/yoda.js' { declare module.exports: $Exports<'eslint/lib/rules/yoda'>; } -declare module 'eslint/lib/testers/event-generator-tester.js' { - declare module.exports: $Exports<'eslint/lib/testers/event-generator-tester'>; -} declare module 'eslint/lib/testers/rule-tester.js' { declare module.exports: $Exports<'eslint/lib/testers/rule-tester'>; } @@ -2240,8 +2324,8 @@ declare module 'eslint/lib/token-store/skip-cursor.js' { declare module 'eslint/lib/token-store/utils.js' { declare module.exports: $Exports<'eslint/lib/token-store/utils'>; } -declare module 'eslint/lib/util/comment-event-generator.js' { - declare module.exports: $Exports<'eslint/lib/util/comment-event-generator'>; +declare module 'eslint/lib/util/ajv.js' { + declare module.exports: $Exports<'eslint/lib/util/ajv'>; } declare module 'eslint/lib/util/fix-tracker.js' { declare module.exports: $Exports<'eslint/lib/util/fix-tracker'>; diff --git a/flow-typed/npm/jest_vx.x.x.js b/flow-typed/npm/jest_vx.x.x.js new file mode 100644 index 00000000..baeee98b --- /dev/null +++ b/flow-typed/npm/jest_vx.x.x.js @@ -0,0 +1,39 @@ +// flow-typed signature: e3d2cb4f62a81c60200a3d062b033a30 +// flow-typed version: <>/jest_v^21.0.1/flow_v0.54.1 + +/** + * This is an autogenerated libdef stub for: + * + * 'jest' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'jest' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'jest/bin/jest' { + declare module.exports: any; +} + +declare module 'jest/build/jest' { + declare module.exports: any; +} + +// Filename aliases +declare module 'jest/bin/jest.js' { + declare module.exports: $Exports<'jest/bin/jest'>; +} +declare module 'jest/build/jest.js' { + declare module.exports: $Exports<'jest/build/jest'>; +} diff --git a/flow-typed/npm/mongoose_v4.x.x.js b/flow-typed/npm/mongoose_v4.x.x.js new file mode 100644 index 00000000..b11bb084 --- /dev/null +++ b/flow-typed/npm/mongoose_v4.x.x.js @@ -0,0 +1,497 @@ +// flow-typed signature: 71dcb1446e05672c1b40a8e951ef91f1 +// flow-typed version: 51eb97ee97/mongoose_v4.x.x/flow_>=v0.50.x + +/* eslint-disable */ + +import mongoose from "mongoose"; + +type MongoId = + | typeof mongoose.Types.ObjectId + | { + toString(): string + }; + +type MongoOrScalarId = MongoId | string | number; + +type SchemaFields = { + [fieldName: string]: any +}; + +type ToObjectOpts = { + getters?: boolean, + virtuals?: boolean, + minimize?: boolean, + transform?: (doc: Doc, ret: Object, options: Object) => any, + depopulate?: boolean, + versionKey?: boolean, + retainKeyOrder?: boolean +}; + +type SchemaOpts = { + autoIndex?: boolean, + bufferCommands?: boolean, + capped?: boolean, + collection?: string, + emitIndexErrors?: boolean, + id?: boolean, + _id?: boolean, + minimize?: boolean, + read?: string, + safe?: boolean, + shardKey?: boolean, + strict?: boolean, + toJSON?: ToObjectOpts, + toObject?: ToObjectOpts, + typeKey?: string, + useNestedStrict?: boolean, + validateBeforeSave?: boolean, + versionKey?: string, + timestamps?: boolean +}; + +type IndexFields = { + [fieldName: string]: 1 | -1 | true | false | string +}; + +type IndexOpts = {| + background?: boolean, + unique?: boolean, + sparse?: boolean, + partialFilterExpression?: Object, + name?: string, + default_language?: string, + weights?: Object +|}; + +type Mongoose$Types = {| + ObjectId: { + $call: (id: string | MongoId) => MongoId + }, + Mixed: Object, + Embedded: Object, + Document: Object, + DocumentArray: Object, + Subdocument: Object, + Array: Object, + Buffer: Object, + Decimal128: Object +|}; + +type Mongoose$SchemaMethods = { + [name: string]: Function +}; + +type Mongoose$SchemaStatics = { + [name: string]: Function +}; + +type VirtualType = Object; + +type Mongoose$SchemaHookTypes = + | "save" + | "validate" + | "find" + | "update" + | "remove" + | "findOneAndRemove" + | "init"; + +type Mongoose$SchemaPlugin = ( + schema: Mongoose$Schema, + opts: Opts +) => void; + +declare class Mongoose$Schema { + static Types: Mongoose$Types, + constructor( + fields: SchemaFields, + opts?: SchemaOpts + ): Mongoose$Schema, + index(fields: IndexFields, opts?: IndexOpts): void, + methods: Mongoose$SchemaMethods, + statics: Mongoose$SchemaStatics, + virtual(fieldName: string): Mongoose$SchemaVirtualField, + pre( + hookType: Mongoose$SchemaHookTypes, + serialCb: (next: Function) => any + ): void, + pre( + hookType: Mongoose$SchemaHookTypes, + true, + parallelCb: (next: Function, done: Function) => any + ): void, + // post(hookType: Mongoose$SchemaHookTypes, parallelCb: (doc: Doc) => any): void; + post( + hookType: Mongoose$SchemaHookTypes, + serialCb: (doc: Doc, next: Function) => any + ): void, + // post(hookType: Mongoose$SchemaHookTypes, serialCb: (error: Error, doc: Doc, next: Function) => any): void; + plugin(plugin: Mongoose$SchemaPlugin, opts: Opts): void, + add(fields: SchemaFields, prefix?: string): void, + loadClass(cls: Class): void, + paths: { + [name: string]: Mongoose$SchemaField + }, + clone(): Mongoose$Schema, + eachPath(fn: (path: string, fieldOpts: Object) => void): this, + get(optionKey: string): any, + set(optionKey: string, value: any): void, + indexes(): ?Array<[string, IndexOpts]>, + path(path: string): Object, + path(path: string, schemaType: Object): void, + pathType(path: string): string, + remove(path: string | string[]): void, + requiredPaths(invalidate?: boolean): string[], + method(method: string, fn: Function): this, + method(methods: { [method: string]: Function }): this, + static (method: string, fn: Function): this, + static (methods: { [method: string]: Function }): this, + virtual(name: string, opts?: Object): VirtualType, + virtualpath(name: string): ?VirtualType, + indexTypes(): string[], + reserved: string[], + obj: SchemaOpts, + _indexes: Array<[{ [fieldName: string]: number | string }, { [optionName: string]: mixed }]> +} + +type Mongoose$SchemaField = { + path?: string, + instance: string, + caster?: ?Mongoose$SchemaField, + options?: ?{ + description: ?string + }, + enumValues?: ?(string[]), + schema?: Schema +}; + +declare class Mongoose$SchemaVirtualField { + get(() => any): this, + set((value: any) => any): this +} + +type MongooseProjection = Object | string; + +type UpdateResult = { + nMatched: number, + nUpserted: number, + nModified: number, + ok?: boolean +}; + +declare class Mongoose$Document { + static find( + criteria?: Object, + projection?: MongooseProjection, + options?: Object + ): Mongoose$Query, this>, + static findOne( + criteria?: Object, + projection?: MongooseProjection + ): Mongoose$Query, + static findById( + id: MongoOrScalarId, + projection?: MongooseProjection, + options?: Object + ): Mongoose$Query, + static findOneAndRemove( + criteria: ?Object, + options?: Object + ): Mongoose$Query, + static findOneAndUpdate( + criteria: ?Object, + data: Object, + options?: Object + ): Mongoose$Query, + static findByIdAndRemove( + id: MongoOrScalarId, + options?: Object + ): Mongoose$Query, + static findByIdAndUpdate( + id: MongoOrScalarId, + data: Object, + options?: Object + ): Mongoose$Query, + static count(criteria: Object): Promise, + static remove(criteria: Object): Promise, + static update( + criteria: Object, + update: Object, + options?: Object + ): Promise & { exec(): Promise }, + static updateOne( + criteria: Object, + update: Object, + options?: Object + ): Promise & { exec(): Promise }, + static updateMany( + criteria: Object, + update: Object, + options?: Object + ): Promise & { exec(): Promise }, + static create(doc: $Shape | Array<$Shape>): Promise, + static where(criteria?: Object): Mongoose$Query, + static aggregate(pipeline: Object[]): Promise, + static bulkWrite(ops: Object[]): Promise, + static deleteMany(criteria: Object): Promise, + static deleteOne(criteria: Object): Promise, + static distinct(field: string, criteria?: Object): Promise, + static ensureIndexes(opts?: Object): Promise, + static hydrate(data: Object): Mongoose$Document, + static insertMany(docs: Object | Object[], opts?: Object): Promise, + static mapReduce(o: Object): Promise, + static collection: Mongoose$Collection, + static db: any, + static modelName: string, + static schema: Mongoose$Schema, + static on(type: string, cb: Function): void, + + constructor(data?: $Shape): this, + id: string | number, + _id: MongoOrScalarId, + __v?: number, + save(): Promise, + update(update: Object, options?: Object): Promise, + set(data: $Shape): this, + set(path: string, val: any, type?: any, options?: Object): this, + isSelected(fieldName: string): boolean, + validate(opts?: Object): Promise<*>, + validateSync(pathsToValidate: string | string[]): Error | void, + errors: Object, + isNew: boolean, + schema: Mongoose$Schema, + + $ignore(path: string): void, + $isDefault(path: string): boolean, + depopulate(path: string): this, + equals(doc: Mongoose$Document): boolean, + get(path: string, type?: Object): any, + + inspect(): Object, + invalidate( + path: string, + errorMsg: string | Error, + value?: any, + kind?: string + ): ValidationError, + isDirectModified(path: string): boolean, + isDirectSelected(path: string): boolean, + isInit(path: string): boolean, + isModified(path?: string): boolean, + isSelected(path: string): boolean, + markModified(path: string): void, + modifiedPaths(): string[], + + populate(path?: string | Object, cb?: (err: Error, doc: this) => void): void, + execPopulate(): Promise, + populated(path: string): ?MongoOrScalarId, + toJSON(options: ToObjectOpts): Object, + toObject(options: ToObjectOpts): Object, + toString(): string, + unmarkModified(path: string): void, + + increment(): void, + remove(): Promise +} + +type ValidationError = Object; + +// Try to replace `Mongoose$Query` on `this` in Flow above v0.53 +// For better dropdown suggesting used `Mongoose$Query` +// Fast check: `User.find().limit(5).` does not suggest if used `this` +declare class Mongoose$Query extends Promise { + exec(): Promise, + where(criteria: Object): Mongoose$Query, + sort(fields: Object | string): Mongoose$Query, + limit(n: number): Mongoose$Query, + skip(n: number): Mongoose$Query, + select(fields: MongooseProjection): Mongoose$Query, + setOptions(opts: Object): Mongoose$Query, + update(data: Object): Mongoose$Query, + update( + criteria: Object, + data: Object, + opts?: { + safe?: boolean, + upsert?: boolean, + multi?: boolean, + runValidators?: boolean, + setDefaultsOnInsert?: boolean, + strict?: boolean, + overwrite?: boolean + } + ): Mongoose$Query, + updateMany( + criteria: Object, + data: Object, + opts?: Object + ): Mongoose$Query, + updateOne( + criteria: Object, + data: Object, + opts?: Object + ): Mongoose$Query, + remove(criteria?: Object): Mongoose$Query, + count(criteria?: Object): Promise, + schema: Mongoose$Schema, + $where(fn: Function): Mongoose$Query, + batchSize(n: number): Mongoose$Query, + collation(value: Object): Mongoose$Query, + comment(val: string): Mongoose$Query, + cursor(opts: Object): Mongoose$QueryCursor, + deleteMany(criteria?: Object): Mongoose$Query, + deleteOne(criteria?: Object): Mongoose$Query, + distinct(field: string, criteria?: Object): Mongoose$Query, + find(criteria: Object): Mongoose$Query, + findOne(criteria?: Object, projection?: Object): Mongoose$Query, + findOneAndRemove( + criteria: Object, + opts?: { sort?: Object, maxTimeMS?: number, passRawResult?: boolean } + ): Mongoose$Query, + findOneAndUpdate( + criteria: Object, + data: Object, + opts?: { + new?: boolean, + upsert?: boolean, + fields?: Object | string, + maxTimeMS?: number, + runValidators?: boolean, + setDefaultsOnInsert?: boolean, + passRawResult?: boolean, + runSettersOnQuery?: boolean + } + ): Mongoose$Query, + getQuery(): Object, + getUpdate(): Object, + hint(index: Object): Mongoose$Query, + lean(passPlainObject?: boolean): Mongoose$Query, + maxScan(n: number): Mongoose$Query, + populate(path: string): Mongoose$Query, + populate(obj: { + path: string, + select?: string, + match?: Object, + options?: Object + }): Mongoose$Query, + read( + pref: + | "primary" + | "secondary" + | "primaryPreferred" + | "secondaryPreferred" + | "nearest", + tags?: Object[] + ): Mongoose$Query, + selected(): boolean, + selectedExclusively(): boolean, + selectedInclusively(): boolean, + setOptions(options: Object): Mongoose$Query, + slice( + path: string, + val: number | [number, number] + ): Mongoose$Query, + snapshot(bool: boolean): Mongoose$Query, + stream(opts?: Object): Mongoose$QueryStream, + tailable(bool: boolean, opts?: Object): Mongoose$Query, + toConstructor(): Class> +} + +declare class Mongoose$QueryCursor { + on(type: "data" | "end" | string, cb: Function): void, + next(cb: (err: Error, doc: Doc) => void): void +} + +declare class Mongoose$QueryStream { + destroy(): void, + pause(): void, + pipe(): void, + resume(): void, + paused: boolean, + readable: boolean, + on(event: "data" | "error" | "close", cb: Function): void +} + +declare class Mongoose$Collection { + constructor(name: string, conn: Mongoose$Connection, opts?: Object): this, + ensureIndex(): any, + find(): any, + findAndModify(): any, + findOne(): any, + getIndexes(): any, + inser(): any, + mapReduce(): any, + save(): any, + update(): any, + collectionName: string, + conn: Mongoose$Connection, + name: string +} + +type ConnectionConnectOpts = { + promiseLibrary?: any, + autoReconnect?: boolean, + reconnectTries?: number, + reconnectInterval?: number, + useMongoClient?: boolean, + config?: { + autoIndex?: boolean + } +}; +type ConnectionEventTypes = "error" | "open" | "disconnected" | string; + +declare class Mongoose$Connection { + constructor(): this, + close(): Promise, + connect(uri: string, opts?: ConnectionConnectOpts): void, + openUri(uri: string, opts?: ConnectionConnectOpts): void, + model( + name: string, + schema: Mongoose$Schema, + collection?: Mongoose$Collection + ): Class, + collection(name: string): Mongoose$Collection, + modelNames(): string[], + config: Object, + db: any, + collections: Mongoose$Collection[], + readyState: number, + + // EventEmitter + addListener(event: ConnectionEventTypes, listener: Function): this, + emit(event: ConnectionEventTypes, ...args: Array): boolean, + eventNames(): Array, + listeners(event: ConnectionEventTypes): Array, + listenerCount(event: ConnectionEventTypes): number, + on(event: ConnectionEventTypes, listener: Function): this, + once(event: ConnectionEventTypes, listener: Function): this, + prependListener(event: ConnectionEventTypes, listener: Function): this, + prependOnceListener(event: ConnectionEventTypes, listener: Function): this, + removeAllListeners(event?: ConnectionEventTypes): this, + removeListener(event: ConnectionEventTypes, listener: Function): this, + setMaxListeners(n: number): this, + getMaxListeners(): number +} + +declare module "mongoose" { + declare export type MongooseConnection = Mongoose$Connection; + declare export type MongoId = MongoId; + declare export type MongoOrScalarId = MongoOrScalarId; + declare export type MongooseQuery = Mongoose$Query; + declare export type MongooseDocument = Mongoose$Document; + declare export type MongooseModel = typeof Mongoose$Document; + declare export type MongooseSchema = Mongoose$Schema; + declare export type MongooseSchemaField = Mongoose$SchemaField; + + declare module.exports: { + Schema: typeof Mongoose$Schema, + Types: Mongoose$Types, + Promise: any, + model: $PropertyType, + createConnection(): Mongoose$Connection, + set: (key: string, value: string | Function | boolean) => void, + connect: Function, + connection: Mongoose$Connection, + Query: typeof Mongoose$Query, + }; +} diff --git a/flow-typed/npm/mongoose_vx.x.x.js b/flow-typed/npm/mongoose_vx.x.x.js deleted file mode 100644 index 01478b69..00000000 --- a/flow-typed/npm/mongoose_vx.x.x.js +++ /dev/null @@ -1,913 +0,0 @@ -// flow-typed signature: 000cb4094204269380076d579ce0b34e -// flow-typed version: <>/mongoose_v^4.10.4/flow_v0.47.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'mongoose' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'mongoose' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'mongoose/examples/aggregate/aggregate' { - declare module.exports: any; -} - -declare module 'mongoose/examples/aggregate/person' { - declare module.exports: any; -} - -declare module 'mongoose/examples/doc-methods' { - declare module.exports: any; -} - -declare module 'mongoose/examples/express/connection-sharing/app' { - declare module.exports: any; -} - -declare module 'mongoose/examples/express/connection-sharing/modelA' { - declare module.exports: any; -} - -declare module 'mongoose/examples/express/connection-sharing/routes' { - declare module.exports: any; -} - -declare module 'mongoose/examples/geospatial/geoJSONexample' { - declare module.exports: any; -} - -declare module 'mongoose/examples/geospatial/geoJSONSchema' { - declare module.exports: any; -} - -declare module 'mongoose/examples/geospatial/geospatial' { - declare module.exports: any; -} - -declare module 'mongoose/examples/geospatial/person' { - declare module.exports: any; -} - -declare module 'mongoose/examples/globalschemas/gs_example' { - declare module.exports: any; -} - -declare module 'mongoose/examples/globalschemas/person' { - declare module.exports: any; -} - -declare module 'mongoose/examples/lean/lean' { - declare module.exports: any; -} - -declare module 'mongoose/examples/lean/person' { - declare module.exports: any; -} - -declare module 'mongoose/examples/mapreduce/mapreduce' { - declare module.exports: any; -} - -declare module 'mongoose/examples/mapreduce/person' { - declare module.exports: any; -} - -declare module 'mongoose/examples/population/population-across-three-collections' { - declare module.exports: any; -} - -declare module 'mongoose/examples/population/population-basic' { - declare module.exports: any; -} - -declare module 'mongoose/examples/population/population-of-existing-doc' { - declare module.exports: any; -} - -declare module 'mongoose/examples/population/population-of-multiple-existing-docs' { - declare module.exports: any; -} - -declare module 'mongoose/examples/population/population-options' { - declare module.exports: any; -} - -declare module 'mongoose/examples/population/population-plain-objects' { - declare module.exports: any; -} - -declare module 'mongoose/examples/promises/person' { - declare module.exports: any; -} - -declare module 'mongoose/examples/promises/promise' { - declare module.exports: any; -} - -declare module 'mongoose/examples/querybuilder/person' { - declare module.exports: any; -} - -declare module 'mongoose/examples/querybuilder/querybuilder' { - declare module.exports: any; -} - -declare module 'mongoose/examples/replicasets/person' { - declare module.exports: any; -} - -declare module 'mongoose/examples/replicasets/replica-sets' { - declare module.exports: any; -} - -declare module 'mongoose/examples/schema/schema' { - declare module.exports: any; -} - -declare module 'mongoose/examples/schema/storing-schemas-as-json/index' { - declare module.exports: any; -} - -declare module 'mongoose/examples/statics/person' { - declare module.exports: any; -} - -declare module 'mongoose/examples/statics/statics' { - declare module.exports: any; -} - -declare module 'mongoose/lib/aggregate' { - declare module.exports: any; -} - -declare module 'mongoose/lib/browser' { - declare module.exports: any; -} - -declare module 'mongoose/lib/browserDocument' { - declare module.exports: any; -} - -declare module 'mongoose/lib/cast' { - declare module.exports: any; -} - -declare module 'mongoose/lib/collection' { - declare module.exports: any; -} - -declare module 'mongoose/lib/connection' { - declare module.exports: any; -} - -declare module 'mongoose/lib/connectionstate' { - declare module.exports: any; -} - -declare module 'mongoose/lib/cursor/AggregationCursor' { - declare module.exports: any; -} - -declare module 'mongoose/lib/document_provider' { - declare module.exports: any; -} - -declare module 'mongoose/lib/document_provider.web' { - declare module.exports: any; -} - -declare module 'mongoose/lib/document' { - declare module.exports: any; -} - -declare module 'mongoose/lib/drivers/browser/binary' { - declare module.exports: any; -} - -declare module 'mongoose/lib/drivers/browser/index' { - declare module.exports: any; -} - -declare module 'mongoose/lib/drivers/browser/objectid' { - declare module.exports: any; -} - -declare module 'mongoose/lib/drivers/browser/ReadPreference' { - declare module.exports: any; -} - -declare module 'mongoose/lib/drivers/index' { - declare module.exports: any; -} - -declare module 'mongoose/lib/drivers/index.web' { - declare module.exports: any; -} - -declare module 'mongoose/lib/drivers/node-mongodb-native/binary' { - declare module.exports: any; -} - -declare module 'mongoose/lib/drivers/node-mongodb-native/collection' { - declare module.exports: any; -} - -declare module 'mongoose/lib/drivers/node-mongodb-native/connection' { - declare module.exports: any; -} - -declare module 'mongoose/lib/drivers/node-mongodb-native/index' { - declare module.exports: any; -} - -declare module 'mongoose/lib/drivers/node-mongodb-native/objectid' { - declare module.exports: any; -} - -declare module 'mongoose/lib/drivers/node-mongodb-native/ReadPreference' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/browserMissingSchema' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/cast' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/disconnected' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/divergentArray' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/messages' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/missingSchema' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/notFound' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/objectExpected' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/overwriteModel' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/strict' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/validation' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/validator' { - declare module.exports: any; -} - -declare module 'mongoose/lib/error/version' { - declare module.exports: any; -} - -declare module 'mongoose/lib/ES6Promise' { - declare module.exports: any; -} - -declare module 'mongoose/lib/index' { - declare module.exports: any; -} - -declare module 'mongoose/lib/internal' { - declare module.exports: any; -} - -declare module 'mongoose/lib/model' { - declare module.exports: any; -} - -declare module 'mongoose/lib/plugins/saveSubdocs' { - declare module.exports: any; -} - -declare module 'mongoose/lib/plugins/sharding' { - declare module.exports: any; -} - -declare module 'mongoose/lib/plugins/validateBeforeSave' { - declare module.exports: any; -} - -declare module 'mongoose/lib/promise_provider' { - declare module.exports: any; -} - -declare module 'mongoose/lib/promise' { - declare module.exports: any; -} - -declare module 'mongoose/lib/query' { - declare module.exports: any; -} - -declare module 'mongoose/lib/querycursor' { - declare module.exports: any; -} - -declare module 'mongoose/lib/queryhelpers' { - declare module.exports: any; -} - -declare module 'mongoose/lib/querystream' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/array' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/boolean' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/buffer' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/date' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/decimal128' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/documentarray' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/embedded' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/index' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/mixed' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/number' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/objectid' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/operators/bitwise' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/operators/exists' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/operators/geospatial' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/operators/helpers' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/operators/type' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schema/string' { - declare module.exports: any; -} - -declare module 'mongoose/lib/schematype' { - declare module.exports: any; -} - -declare module 'mongoose/lib/services/common' { - declare module.exports: any; -} - -declare module 'mongoose/lib/services/model/applyHooks' { - declare module.exports: any; -} - -declare module 'mongoose/lib/services/model/applyMethods' { - declare module.exports: any; -} - -declare module 'mongoose/lib/services/model/applyStatics' { - declare module.exports: any; -} - -declare module 'mongoose/lib/services/model/discriminator' { - declare module.exports: any; -} - -declare module 'mongoose/lib/services/projection/isPathSelectedInclusive' { - declare module.exports: any; -} - -declare module 'mongoose/lib/services/query/castUpdate' { - declare module.exports: any; -} - -declare module 'mongoose/lib/services/query/hasDollarKeys' { - declare module.exports: any; -} - -declare module 'mongoose/lib/services/setDefaultsOnInsert' { - declare module.exports: any; -} - -declare module 'mongoose/lib/services/updateValidators' { - declare module.exports: any; -} - -declare module 'mongoose/lib/statemachine' { - declare module.exports: any; -} - -declare module 'mongoose/lib/types/array' { - declare module.exports: any; -} - -declare module 'mongoose/lib/types/buffer' { - declare module.exports: any; -} - -declare module 'mongoose/lib/types/decimal128' { - declare module.exports: any; -} - -declare module 'mongoose/lib/types/documentarray' { - declare module.exports: any; -} - -declare module 'mongoose/lib/types/embedded' { - declare module.exports: any; -} - -declare module 'mongoose/lib/types/index' { - declare module.exports: any; -} - -declare module 'mongoose/lib/types/objectid' { - declare module.exports: any; -} - -declare module 'mongoose/lib/types/subdocument' { - declare module.exports: any; -} - -declare module 'mongoose/lib/utils' { - declare module.exports: any; -} - -declare module 'mongoose/lib/virtualtype' { - declare module.exports: any; -} - -declare module 'mongoose/static' { - declare module.exports: any; -} - -declare module 'mongoose/tools/repl' { - declare module.exports: any; -} - -declare module 'mongoose/tools/sharded' { - declare module.exports: any; -} - -declare module 'mongoose/website' { - declare module.exports: any; -} - -// Filename aliases -declare module 'mongoose/examples/aggregate/aggregate.js' { - declare module.exports: $Exports<'mongoose/examples/aggregate/aggregate'>; -} -declare module 'mongoose/examples/aggregate/person.js' { - declare module.exports: $Exports<'mongoose/examples/aggregate/person'>; -} -declare module 'mongoose/examples/doc-methods.js' { - declare module.exports: $Exports<'mongoose/examples/doc-methods'>; -} -declare module 'mongoose/examples/express/connection-sharing/app.js' { - declare module.exports: $Exports<'mongoose/examples/express/connection-sharing/app'>; -} -declare module 'mongoose/examples/express/connection-sharing/modelA.js' { - declare module.exports: $Exports<'mongoose/examples/express/connection-sharing/modelA'>; -} -declare module 'mongoose/examples/express/connection-sharing/routes.js' { - declare module.exports: $Exports<'mongoose/examples/express/connection-sharing/routes'>; -} -declare module 'mongoose/examples/geospatial/geoJSONexample.js' { - declare module.exports: $Exports<'mongoose/examples/geospatial/geoJSONexample'>; -} -declare module 'mongoose/examples/geospatial/geoJSONSchema.js' { - declare module.exports: $Exports<'mongoose/examples/geospatial/geoJSONSchema'>; -} -declare module 'mongoose/examples/geospatial/geospatial.js' { - declare module.exports: $Exports<'mongoose/examples/geospatial/geospatial'>; -} -declare module 'mongoose/examples/geospatial/person.js' { - declare module.exports: $Exports<'mongoose/examples/geospatial/person'>; -} -declare module 'mongoose/examples/globalschemas/gs_example.js' { - declare module.exports: $Exports<'mongoose/examples/globalschemas/gs_example'>; -} -declare module 'mongoose/examples/globalschemas/person.js' { - declare module.exports: $Exports<'mongoose/examples/globalschemas/person'>; -} -declare module 'mongoose/examples/lean/lean.js' { - declare module.exports: $Exports<'mongoose/examples/lean/lean'>; -} -declare module 'mongoose/examples/lean/person.js' { - declare module.exports: $Exports<'mongoose/examples/lean/person'>; -} -declare module 'mongoose/examples/mapreduce/mapreduce.js' { - declare module.exports: $Exports<'mongoose/examples/mapreduce/mapreduce'>; -} -declare module 'mongoose/examples/mapreduce/person.js' { - declare module.exports: $Exports<'mongoose/examples/mapreduce/person'>; -} -declare module 'mongoose/examples/population/population-across-three-collections.js' { - declare module.exports: $Exports<'mongoose/examples/population/population-across-three-collections'>; -} -declare module 'mongoose/examples/population/population-basic.js' { - declare module.exports: $Exports<'mongoose/examples/population/population-basic'>; -} -declare module 'mongoose/examples/population/population-of-existing-doc.js' { - declare module.exports: $Exports<'mongoose/examples/population/population-of-existing-doc'>; -} -declare module 'mongoose/examples/population/population-of-multiple-existing-docs.js' { - declare module.exports: $Exports<'mongoose/examples/population/population-of-multiple-existing-docs'>; -} -declare module 'mongoose/examples/population/population-options.js' { - declare module.exports: $Exports<'mongoose/examples/population/population-options'>; -} -declare module 'mongoose/examples/population/population-plain-objects.js' { - declare module.exports: $Exports<'mongoose/examples/population/population-plain-objects'>; -} -declare module 'mongoose/examples/promises/person.js' { - declare module.exports: $Exports<'mongoose/examples/promises/person'>; -} -declare module 'mongoose/examples/promises/promise.js' { - declare module.exports: $Exports<'mongoose/examples/promises/promise'>; -} -declare module 'mongoose/examples/querybuilder/person.js' { - declare module.exports: $Exports<'mongoose/examples/querybuilder/person'>; -} -declare module 'mongoose/examples/querybuilder/querybuilder.js' { - declare module.exports: $Exports<'mongoose/examples/querybuilder/querybuilder'>; -} -declare module 'mongoose/examples/replicasets/person.js' { - declare module.exports: $Exports<'mongoose/examples/replicasets/person'>; -} -declare module 'mongoose/examples/replicasets/replica-sets.js' { - declare module.exports: $Exports<'mongoose/examples/replicasets/replica-sets'>; -} -declare module 'mongoose/examples/schema/schema.js' { - declare module.exports: $Exports<'mongoose/examples/schema/schema'>; -} -declare module 'mongoose/examples/schema/storing-schemas-as-json/index.js' { - declare module.exports: $Exports<'mongoose/examples/schema/storing-schemas-as-json/index'>; -} -declare module 'mongoose/examples/statics/person.js' { - declare module.exports: $Exports<'mongoose/examples/statics/person'>; -} -declare module 'mongoose/examples/statics/statics.js' { - declare module.exports: $Exports<'mongoose/examples/statics/statics'>; -} -declare module 'mongoose/index' { - declare module.exports: $Exports<'mongoose'>; -} -declare module 'mongoose/index.js' { - declare module.exports: $Exports<'mongoose'>; -} -declare module 'mongoose/lib/aggregate.js' { - declare module.exports: $Exports<'mongoose/lib/aggregate'>; -} -declare module 'mongoose/lib/browser.js' { - declare module.exports: $Exports<'mongoose/lib/browser'>; -} -declare module 'mongoose/lib/browserDocument.js' { - declare module.exports: $Exports<'mongoose/lib/browserDocument'>; -} -declare module 'mongoose/lib/cast.js' { - declare module.exports: $Exports<'mongoose/lib/cast'>; -} -declare module 'mongoose/lib/collection.js' { - declare module.exports: $Exports<'mongoose/lib/collection'>; -} -declare module 'mongoose/lib/connection.js' { - declare module.exports: $Exports<'mongoose/lib/connection'>; -} -declare module 'mongoose/lib/connectionstate.js' { - declare module.exports: $Exports<'mongoose/lib/connectionstate'>; -} -declare module 'mongoose/lib/cursor/AggregationCursor.js' { - declare module.exports: $Exports<'mongoose/lib/cursor/AggregationCursor'>; -} -declare module 'mongoose/lib/document_provider.js' { - declare module.exports: $Exports<'mongoose/lib/document_provider'>; -} -declare module 'mongoose/lib/document_provider.web.js' { - declare module.exports: $Exports<'mongoose/lib/document_provider.web'>; -} -declare module 'mongoose/lib/document.js' { - declare module.exports: $Exports<'mongoose/lib/document'>; -} -declare module 'mongoose/lib/drivers/browser/binary.js' { - declare module.exports: $Exports<'mongoose/lib/drivers/browser/binary'>; -} -declare module 'mongoose/lib/drivers/browser/index.js' { - declare module.exports: $Exports<'mongoose/lib/drivers/browser/index'>; -} -declare module 'mongoose/lib/drivers/browser/objectid.js' { - declare module.exports: $Exports<'mongoose/lib/drivers/browser/objectid'>; -} -declare module 'mongoose/lib/drivers/browser/ReadPreference.js' { - declare module.exports: $Exports<'mongoose/lib/drivers/browser/ReadPreference'>; -} -declare module 'mongoose/lib/drivers/index.js' { - declare module.exports: $Exports<'mongoose/lib/drivers/index'>; -} -declare module 'mongoose/lib/drivers/index.web.js' { - declare module.exports: $Exports<'mongoose/lib/drivers/index.web'>; -} -declare module 'mongoose/lib/drivers/node-mongodb-native/binary.js' { - declare module.exports: $Exports<'mongoose/lib/drivers/node-mongodb-native/binary'>; -} -declare module 'mongoose/lib/drivers/node-mongodb-native/collection.js' { - declare module.exports: $Exports<'mongoose/lib/drivers/node-mongodb-native/collection'>; -} -declare module 'mongoose/lib/drivers/node-mongodb-native/connection.js' { - declare module.exports: $Exports<'mongoose/lib/drivers/node-mongodb-native/connection'>; -} -declare module 'mongoose/lib/drivers/node-mongodb-native/index.js' { - declare module.exports: $Exports<'mongoose/lib/drivers/node-mongodb-native/index'>; -} -declare module 'mongoose/lib/drivers/node-mongodb-native/objectid.js' { - declare module.exports: $Exports<'mongoose/lib/drivers/node-mongodb-native/objectid'>; -} -declare module 'mongoose/lib/drivers/node-mongodb-native/ReadPreference.js' { - declare module.exports: $Exports<'mongoose/lib/drivers/node-mongodb-native/ReadPreference'>; -} -declare module 'mongoose/lib/error.js' { - declare module.exports: $Exports<'mongoose/lib/error'>; -} -declare module 'mongoose/lib/error/browserMissingSchema.js' { - declare module.exports: $Exports<'mongoose/lib/error/browserMissingSchema'>; -} -declare module 'mongoose/lib/error/cast.js' { - declare module.exports: $Exports<'mongoose/lib/error/cast'>; -} -declare module 'mongoose/lib/error/disconnected.js' { - declare module.exports: $Exports<'mongoose/lib/error/disconnected'>; -} -declare module 'mongoose/lib/error/divergentArray.js' { - declare module.exports: $Exports<'mongoose/lib/error/divergentArray'>; -} -declare module 'mongoose/lib/error/messages.js' { - declare module.exports: $Exports<'mongoose/lib/error/messages'>; -} -declare module 'mongoose/lib/error/missingSchema.js' { - declare module.exports: $Exports<'mongoose/lib/error/missingSchema'>; -} -declare module 'mongoose/lib/error/notFound.js' { - declare module.exports: $Exports<'mongoose/lib/error/notFound'>; -} -declare module 'mongoose/lib/error/objectExpected.js' { - declare module.exports: $Exports<'mongoose/lib/error/objectExpected'>; -} -declare module 'mongoose/lib/error/overwriteModel.js' { - declare module.exports: $Exports<'mongoose/lib/error/overwriteModel'>; -} -declare module 'mongoose/lib/error/strict.js' { - declare module.exports: $Exports<'mongoose/lib/error/strict'>; -} -declare module 'mongoose/lib/error/validation.js' { - declare module.exports: $Exports<'mongoose/lib/error/validation'>; -} -declare module 'mongoose/lib/error/validator.js' { - declare module.exports: $Exports<'mongoose/lib/error/validator'>; -} -declare module 'mongoose/lib/error/version.js' { - declare module.exports: $Exports<'mongoose/lib/error/version'>; -} -declare module 'mongoose/lib/ES6Promise.js' { - declare module.exports: $Exports<'mongoose/lib/ES6Promise'>; -} -declare module 'mongoose/lib/index.js' { - declare module.exports: $Exports<'mongoose/lib/index'>; -} -declare module 'mongoose/lib/internal.js' { - declare module.exports: $Exports<'mongoose/lib/internal'>; -} -declare module 'mongoose/lib/model.js' { - declare module.exports: $Exports<'mongoose/lib/model'>; -} -declare module 'mongoose/lib/plugins/saveSubdocs.js' { - declare module.exports: $Exports<'mongoose/lib/plugins/saveSubdocs'>; -} -declare module 'mongoose/lib/plugins/sharding.js' { - declare module.exports: $Exports<'mongoose/lib/plugins/sharding'>; -} -declare module 'mongoose/lib/plugins/validateBeforeSave.js' { - declare module.exports: $Exports<'mongoose/lib/plugins/validateBeforeSave'>; -} -declare module 'mongoose/lib/promise_provider.js' { - declare module.exports: $Exports<'mongoose/lib/promise_provider'>; -} -declare module 'mongoose/lib/promise.js' { - declare module.exports: $Exports<'mongoose/lib/promise'>; -} -declare module 'mongoose/lib/query.js' { - declare module.exports: $Exports<'mongoose/lib/query'>; -} -declare module 'mongoose/lib/querycursor.js' { - declare module.exports: $Exports<'mongoose/lib/querycursor'>; -} -declare module 'mongoose/lib/queryhelpers.js' { - declare module.exports: $Exports<'mongoose/lib/queryhelpers'>; -} -declare module 'mongoose/lib/querystream.js' { - declare module.exports: $Exports<'mongoose/lib/querystream'>; -} -declare module 'mongoose/lib/schema.js' { - declare module.exports: $Exports<'mongoose/lib/schema'>; -} -declare module 'mongoose/lib/schema/array.js' { - declare module.exports: $Exports<'mongoose/lib/schema/array'>; -} -declare module 'mongoose/lib/schema/boolean.js' { - declare module.exports: $Exports<'mongoose/lib/schema/boolean'>; -} -declare module 'mongoose/lib/schema/buffer.js' { - declare module.exports: $Exports<'mongoose/lib/schema/buffer'>; -} -declare module 'mongoose/lib/schema/date.js' { - declare module.exports: $Exports<'mongoose/lib/schema/date'>; -} -declare module 'mongoose/lib/schema/decimal128.js' { - declare module.exports: $Exports<'mongoose/lib/schema/decimal128'>; -} -declare module 'mongoose/lib/schema/documentarray.js' { - declare module.exports: $Exports<'mongoose/lib/schema/documentarray'>; -} -declare module 'mongoose/lib/schema/embedded.js' { - declare module.exports: $Exports<'mongoose/lib/schema/embedded'>; -} -declare module 'mongoose/lib/schema/index.js' { - declare module.exports: $Exports<'mongoose/lib/schema/index'>; -} -declare module 'mongoose/lib/schema/mixed.js' { - declare module.exports: $Exports<'mongoose/lib/schema/mixed'>; -} -declare module 'mongoose/lib/schema/number.js' { - declare module.exports: $Exports<'mongoose/lib/schema/number'>; -} -declare module 'mongoose/lib/schema/objectid.js' { - declare module.exports: $Exports<'mongoose/lib/schema/objectid'>; -} -declare module 'mongoose/lib/schema/operators/bitwise.js' { - declare module.exports: $Exports<'mongoose/lib/schema/operators/bitwise'>; -} -declare module 'mongoose/lib/schema/operators/exists.js' { - declare module.exports: $Exports<'mongoose/lib/schema/operators/exists'>; -} -declare module 'mongoose/lib/schema/operators/geospatial.js' { - declare module.exports: $Exports<'mongoose/lib/schema/operators/geospatial'>; -} -declare module 'mongoose/lib/schema/operators/helpers.js' { - declare module.exports: $Exports<'mongoose/lib/schema/operators/helpers'>; -} -declare module 'mongoose/lib/schema/operators/type.js' { - declare module.exports: $Exports<'mongoose/lib/schema/operators/type'>; -} -declare module 'mongoose/lib/schema/string.js' { - declare module.exports: $Exports<'mongoose/lib/schema/string'>; -} -declare module 'mongoose/lib/schematype.js' { - declare module.exports: $Exports<'mongoose/lib/schematype'>; -} -declare module 'mongoose/lib/services/common.js' { - declare module.exports: $Exports<'mongoose/lib/services/common'>; -} -declare module 'mongoose/lib/services/model/applyHooks.js' { - declare module.exports: $Exports<'mongoose/lib/services/model/applyHooks'>; -} -declare module 'mongoose/lib/services/model/applyMethods.js' { - declare module.exports: $Exports<'mongoose/lib/services/model/applyMethods'>; -} -declare module 'mongoose/lib/services/model/applyStatics.js' { - declare module.exports: $Exports<'mongoose/lib/services/model/applyStatics'>; -} -declare module 'mongoose/lib/services/model/discriminator.js' { - declare module.exports: $Exports<'mongoose/lib/services/model/discriminator'>; -} -declare module 'mongoose/lib/services/projection/isPathSelectedInclusive.js' { - declare module.exports: $Exports<'mongoose/lib/services/projection/isPathSelectedInclusive'>; -} -declare module 'mongoose/lib/services/query/castUpdate.js' { - declare module.exports: $Exports<'mongoose/lib/services/query/castUpdate'>; -} -declare module 'mongoose/lib/services/query/hasDollarKeys.js' { - declare module.exports: $Exports<'mongoose/lib/services/query/hasDollarKeys'>; -} -declare module 'mongoose/lib/services/setDefaultsOnInsert.js' { - declare module.exports: $Exports<'mongoose/lib/services/setDefaultsOnInsert'>; -} -declare module 'mongoose/lib/services/updateValidators.js' { - declare module.exports: $Exports<'mongoose/lib/services/updateValidators'>; -} -declare module 'mongoose/lib/statemachine.js' { - declare module.exports: $Exports<'mongoose/lib/statemachine'>; -} -declare module 'mongoose/lib/types/array.js' { - declare module.exports: $Exports<'mongoose/lib/types/array'>; -} -declare module 'mongoose/lib/types/buffer.js' { - declare module.exports: $Exports<'mongoose/lib/types/buffer'>; -} -declare module 'mongoose/lib/types/decimal128.js' { - declare module.exports: $Exports<'mongoose/lib/types/decimal128'>; -} -declare module 'mongoose/lib/types/documentarray.js' { - declare module.exports: $Exports<'mongoose/lib/types/documentarray'>; -} -declare module 'mongoose/lib/types/embedded.js' { - declare module.exports: $Exports<'mongoose/lib/types/embedded'>; -} -declare module 'mongoose/lib/types/index.js' { - declare module.exports: $Exports<'mongoose/lib/types/index'>; -} -declare module 'mongoose/lib/types/objectid.js' { - declare module.exports: $Exports<'mongoose/lib/types/objectid'>; -} -declare module 'mongoose/lib/types/subdocument.js' { - declare module.exports: $Exports<'mongoose/lib/types/subdocument'>; -} -declare module 'mongoose/lib/utils.js' { - declare module.exports: $Exports<'mongoose/lib/utils'>; -} -declare module 'mongoose/lib/virtualtype.js' { - declare module.exports: $Exports<'mongoose/lib/virtualtype'>; -} -declare module 'mongoose/static.js' { - declare module.exports: $Exports<'mongoose/static'>; -} -declare module 'mongoose/tools/repl.js' { - declare module.exports: $Exports<'mongoose/tools/repl'>; -} -declare module 'mongoose/tools/sharded.js' { - declare module.exports: $Exports<'mongoose/tools/sharded'>; -} -declare module 'mongoose/website.js' { - declare module.exports: $Exports<'mongoose/website'>; -} diff --git a/flow-typed/npm/object-path_vx.x.x.js b/flow-typed/npm/object-path_vx.x.x.js index 3db79737..fdac30ea 100644 --- a/flow-typed/npm/object-path_vx.x.x.js +++ b/flow-typed/npm/object-path_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: cf02b50a11397b5fe6547e721192bd17 -// flow-typed version: <>/object-path_v^0.11.4/flow_v0.47.0 +// flow-typed signature: fb09d0c62c84a90007779c4ec5a07157 +// flow-typed version: <>/object-path_v^0.11.4/flow_v0.54.1 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/prettier_vx.x.x.js b/flow-typed/npm/prettier_vx.x.x.js new file mode 100644 index 00000000..d1f6980b --- /dev/null +++ b/flow-typed/npm/prettier_vx.x.x.js @@ -0,0 +1,80 @@ +// flow-typed signature: d003fe8fa6770c8af843a5f64e9641de +// flow-typed version: <>/prettier_v^1.6.1/flow_v0.54.1 + +/** + * This is an autogenerated libdef stub for: + * + * 'prettier' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'prettier' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'prettier/bin/prettier' { + declare module.exports: any; +} + +declare module 'prettier/parser-babylon' { + declare module.exports: any; +} + +declare module 'prettier/parser-flow' { + declare module.exports: any; +} + +declare module 'prettier/parser-graphql' { + declare module.exports: any; +} + +declare module 'prettier/parser-parse5' { + declare module.exports: any; +} + +declare module 'prettier/parser-postcss' { + declare module.exports: any; +} + +declare module 'prettier/parser-typescript' { + declare module.exports: any; +} + +// Filename aliases +declare module 'prettier/bin/prettier.js' { + declare module.exports: $Exports<'prettier/bin/prettier'>; +} +declare module 'prettier/index' { + declare module.exports: $Exports<'prettier'>; +} +declare module 'prettier/index.js' { + declare module.exports: $Exports<'prettier'>; +} +declare module 'prettier/parser-babylon.js' { + declare module.exports: $Exports<'prettier/parser-babylon'>; +} +declare module 'prettier/parser-flow.js' { + declare module.exports: $Exports<'prettier/parser-flow'>; +} +declare module 'prettier/parser-graphql.js' { + declare module.exports: $Exports<'prettier/parser-graphql'>; +} +declare module 'prettier/parser-parse5.js' { + declare module.exports: $Exports<'prettier/parser-parse5'>; +} +declare module 'prettier/parser-postcss.js' { + declare module.exports: $Exports<'prettier/parser-postcss'>; +} +declare module 'prettier/parser-typescript.js' { + declare module.exports: $Exports<'prettier/parser-typescript'>; +} diff --git a/flow-typed/npm/rimraf_vx.x.x.js b/flow-typed/npm/rimraf_vx.x.x.js index 65617a59..8972caec 100644 --- a/flow-typed/npm/rimraf_vx.x.x.js +++ b/flow-typed/npm/rimraf_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: b2a29c9ccb46319b117ba1c937811560 -// flow-typed version: <>/rimraf_v^2.6.1/flow_v0.47.0 +// flow-typed signature: 4b7bccb2735580438711ebecb7134886 +// flow-typed version: <>/rimraf_v^2.6.1/flow_v0.54.1 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/semantic-release_vx.x.x.js b/flow-typed/npm/semantic-release_vx.x.x.js index e8132f90..92ac3fbb 100644 --- a/flow-typed/npm/semantic-release_vx.x.x.js +++ b/flow-typed/npm/semantic-release_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 4afebfe8b27973c18cd40ad5dc9324fb -// flow-typed version: <>/semantic-release_v^6.3.6/flow_v0.47.0 +// flow-typed signature: c01fd07cc4d7da4eab76e96afbb75fdd +// flow-typed version: <>/semantic-release_v^7.0.2/flow_v0.54.1 /** * This is an autogenerated libdef stub for: diff --git a/package.json b/package.json index 90548562..e4602c92 100644 --- a/package.json +++ b/package.json @@ -27,37 +27,37 @@ "object-path": "^0.11.4" }, "optionalDependencies": { - "graphql-compose-connection": ">=2.2.1", - "graphql-compose-pagination": ">=1.0.0" + "graphql-compose-connection": "^2.3.0", + "graphql-compose-pagination": "^1.1.0" }, "peerDependencies": { - "graphql-compose": ">=1.20.3 || >=2.0.0", + "graphql-compose": ">=2.9.0", "mongoose": ">=4.0.0" }, "devDependencies": { "babel-cli": "^6.26.0", "babel-eslint": "^7.2.3", - "babel-jest": "^20.0.3", + "babel-jest": "^21.0.0", "babel-plugin-transform-flow-strip-types": "^6.22.0", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.5.2", "cz-conventional-changelog": "^2.0.0", - "eslint": "^4.5.0", - "eslint-config-airbnb-base": "^11.3.2", - "eslint-config-prettier": "^2.2.0", - "eslint-plugin-flowtype": "^2.34.0", + "eslint": "^4.6.1", + "eslint-config-airbnb-base": "^12.0.0", + "eslint-config-prettier": "^2.4.0", + "eslint-plugin-flowtype": "^2.35.1", "eslint-plugin-import": "^2.3.0", "eslint-plugin-prettier": "^2.2.0", - "flow-bin": "^0.53.1", - "graphql": "0.10.3", - "graphql-compose": "^2.3.2", - "graphql-compose-connection": ">=2.2.1", - "graphql-compose-pagination": ">=1.0.0", - "jest": "^20.0.4", + "flow-bin": "^0.54.1", + "graphql": "^0.11.3", + "graphql-compose": "^2.9.0", + "graphql-compose-connection": ">=2.3.0", + "graphql-compose-pagination": ">=1.1.0", + "jest": "^21.0.1", "mongodb-memory-server": "^1.5.0", - "mongoose": "^4.11.9", - "prettier": "^1.4.4", + "mongoose": "^4.11.10", + "prettier": "^1.6.1", "rimraf": "^2.6.1", "semantic-release": "^7.0.2" }, diff --git a/src/__tests__/composeWithMongoose-test.js b/src/__tests__/composeWithMongoose-test.js index 8d1048a0..222dc132 100644 --- a/src/__tests__/composeWithMongoose-test.js +++ b/src/__tests__/composeWithMongoose-test.js @@ -16,7 +16,7 @@ describe('composeWithMongoose ->', () => { UserModel.schema._gqcTypeComposer = undefined; }); - describe('mongooseModelToTypeComposer()', () => { + describe('MongooseModeloTypeComposer()', () => { describe('basics', () => { it('should return TypeComposer', () => { expect(composeWithMongoose(UserModel)).toBeInstanceOf(TypeComposer); diff --git a/src/__tests__/fieldConverter-test.js b/src/__tests__/fieldConverter-test.js index bd7b2cb0..65cbfee6 100644 --- a/src/__tests__/fieldConverter-test.js +++ b/src/__tests__/fieldConverter-test.js @@ -1,7 +1,17 @@ /* @flow */ /* eslint-disable no-unused-expressions, no-template-curly-in-string */ -import { GraphQLDate, GraphQLBuffer, GraphQLGeneric, GraphQLJSON, graphql } from 'graphql-compose'; +import { GraphQLDate, GraphQLBuffer, GraphQLGeneric, GraphQLJSON } from 'graphql-compose'; +import { + GraphQLString, + GraphQLFloat, + GraphQLBoolean, + GraphQLList, + GraphQLEnumType, + GraphQLSchema, + GraphQLObjectType, + graphql, +} from 'graphql-compose/lib/graphql'; import { UserModel } from '../__mocks__/userModel'; import { deriveComplexType, @@ -22,16 +32,6 @@ import GraphQLMongoID from '../types/mongoid'; beforeAll(() => UserModel.base.connect()); afterAll(() => UserModel.base.disconnect()); -const { - GraphQLString, - GraphQLFloat, - GraphQLBoolean, - GraphQLList, - GraphQLEnumType, - GraphQLSchema, - GraphQLObjectType, -} = graphql; - describe('fieldConverter', () => { const fields = getFieldsFromModel(UserModel); const fieldNames = Object.keys(fields); @@ -212,7 +212,7 @@ describe('fieldConverter', () => { name: 'Test empty subDoc', }); await user.save(); - const result = await graphql.graphql( + const result = await graphql( schema, `{ user(_id: "${user._id}") { @@ -255,7 +255,7 @@ describe('fieldConverter', () => { subDoc: { field2: { field21: 'ok' } }, }); await user2.save(); - const result2 = await graphql.graphql( + const result2 = await graphql( schema, `{ user(_id: "${user2._id}") { @@ -341,7 +341,7 @@ describe('fieldConverter', () => { someDynamic } }`; - const result = await graphql.graphql(schema, query); + const result = await graphql(schema, query); // $FlowFixMe expect(result.data.user.name).toBe(user.name); // $FlowFixMe diff --git a/src/__tests__/typeStorage-test.js b/src/__tests__/typeStorage-test.js index 84bae800..a7be43da 100644 --- a/src/__tests__/typeStorage-test.js +++ b/src/__tests__/typeStorage-test.js @@ -10,9 +10,9 @@ describe('typeStorage', () => { it('should work `get`, `set`, `has`, `clear` methods and `size` property', () => { typeStorage.clear(); expect(typeStorage.size).toBe(0); - typeStorage.set(123, 567); - expect(typeStorage.get(123)).toBe(567); - expect(typeStorage.has(123)).toBe(true); + typeStorage.set('Type', 567); + expect(typeStorage.get('Type')).toBe(567); + expect(typeStorage.has('Type')).toBe(true); expect(typeStorage.size).toBe(1); typeStorage.clear(); expect(typeStorage.size).toBe(0); diff --git a/src/composeWithMongoose.js b/src/composeWithMongoose.js index 6fe3ad53..2dd829da 100644 --- a/src/composeWithMongoose.js +++ b/src/composeWithMongoose.js @@ -2,21 +2,117 @@ /* eslint-disable no-use-before-define, no-param-reassign, global-require */ import { TypeComposer, InputTypeComposer } from 'graphql-compose'; +import type { MongooseModel } from 'mongoose'; +import type { ConnectionSortMapOpts } from 'graphql-compose-connection'; import { convertModelToGraphQL } from './fieldsConverter'; import * as resolvers from './resolvers'; import { getUniqueIndexes, extendByReversedIndexes } from './utils/getIndexesFromModel'; - import type { - MongooseModelT, - TypeConverterOpts, - TypeConverterResolversOpts, - TypeConverterInputTypeOpts, - ConnectionSortMapOpts, - PaginationOpts, -} from './definition'; + FilterHelperArgsOpts, + LimitHelperArgsOpts, + SortHelperArgsOpts, + RecordHelperArgsOpts, +} from './resolvers/helpers'; + +export type TypeConverterOpts = { + name?: string, + description?: string, + fields?: { + only?: string[], + // rename?: { [oldName: string]: string }, + remove?: string[], + }, + inputType?: TypeConverterInputTypeOpts, + resolvers?: false | TypeConverterResolversOpts, +}; + +export type TypeConverterInputTypeOpts = { + name?: string, + description?: string, + fields?: { + only?: string[], + remove?: string[], + required?: string[], + }, +}; + +export type TypeConverterResolversOpts = { + findById?: false, + findByIds?: + | false + | { + limit?: LimitHelperArgsOpts | false, + sort?: SortHelperArgsOpts | false, + }, + findOne?: + | false + | { + filter?: FilterHelperArgsOpts | false, + sort?: SortHelperArgsOpts | false, + skip?: false, + }, + findMany?: + | false + | { + filter?: FilterHelperArgsOpts | false, + sort?: SortHelperArgsOpts | false, + limit?: LimitHelperArgsOpts | false, + skip?: false, + }, + updateById?: + | false + | { + input?: RecordHelperArgsOpts | false, + }, + updateOne?: + | false + | { + input?: RecordHelperArgsOpts | false, + filter?: FilterHelperArgsOpts | false, + sort?: SortHelperArgsOpts | false, + skip?: false, + }, + updateMany?: + | false + | { + input?: RecordHelperArgsOpts | false, + filter?: FilterHelperArgsOpts | false, + sort?: SortHelperArgsOpts | false, + limit?: LimitHelperArgsOpts | false, + skip?: false, + }, + removeById?: false, + removeOne?: + | false + | { + filter?: FilterHelperArgsOpts | false, + sort?: SortHelperArgsOpts | false, + }, + removeMany?: + | false + | { + filter?: FilterHelperArgsOpts | false, + }, + createOne?: + | false + | { + input?: RecordHelperArgsOpts | false, + }, + count?: + | false + | { + filter?: FilterHelperArgsOpts | false, + }, + connection?: ConnectionSortMapOpts | false, + pagination?: PaginationResolverOpts | false, +}; + +export type PaginationResolverOpts = { + perPage?: number, +}; export function composeWithMongoose( - model: Object, // MongooseModelT, TODO use Model from mongoose_v4.x.x definition when it will be public + model: Object, // MongooseModel, TODO use Model from mongoose_v4.x.x definition when it will be public opts: TypeConverterOpts = {} ): TypeComposer { const name: string = (opts && opts.name) || model.modelName; @@ -104,7 +200,7 @@ export function createInputType( } export function createResolvers( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts: TypeConverterResolversOpts ): void { @@ -128,7 +224,10 @@ export function createResolvers( } } -export function preparePaginationResolver(typeComposer: TypeComposer, opts: PaginationOpts) { +export function preparePaginationResolver( + typeComposer: TypeComposer, + opts: PaginationResolverOpts +) { try { require.resolve('graphql-compose-pagination'); } catch (e) { @@ -143,7 +242,7 @@ export function preparePaginationResolver(typeComposer: TypeComposer, opts: Pagi } export function prepareConnectionResolver( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts: ConnectionSortMapOpts ) { @@ -160,7 +259,10 @@ export function prepareConnectionResolver( const sortConfigs = {}; uniqueIndexes.forEach(indexData => { const keys = Object.keys(indexData); - let name = keys.join('__').toUpperCase().replace(/[^_a-zA-Z0-9]/i, '__'); + let name = keys + .join('__') + .toUpperCase() + .replace(/[^_a-zA-Z0-9]/i, '__'); if (indexData[keys[0]] === 1) { name = `${name}_ASC`; } else if (indexData[keys[0]] === -1) { diff --git a/src/definition.js b/src/definition.js deleted file mode 100644 index 1b718766..00000000 --- a/src/definition.js +++ /dev/null @@ -1,224 +0,0 @@ -/* @flow */ -/* eslint-disable */ - -import type { TypeComposer } from 'graphql-compose'; -import type { ConnectionSortMapOpts as _ConnectionSortMapOpts} from 'graphql-compose-connection/lib/definition'; - -export type ConnectionSortMapOpts = _ConnectionSortMapOpts; - -export type ObjectMap = { [optName: string]: any }; - -export type ComplexTypesT = - 'ARRAY' | 'EMBEDDED' | 'DOCUMENT_ARRAY' | 'ENUM' | 'REFERENCE' | 'MIXED' | 'SCALAR'; - -export type MongooseModelSchemaT = { - paths: { - [optName: string]: MongooseFieldT, - }, - _indexes?: MonooseModelIndex[], - _gqcTypeComposer?: TypeComposer, -} - -export type MonooseModelIndex = [ - { [fieldName: string]: number | string }, - { [optionName: string]: mixed }, -]; - -export type MongoosePseudoModelT = { - _gqcTypeComposer?: TypeComposer, - schema: MongooseModelSchemaT, -} - -export type MongooseModelT = { - modelName: string, - schema: MongooseModelSchemaT, - create(doc: Object | Object[]): Promise, - findOne(conditions: ?Object, projection?: Object): MongooseQuery, - findById(id: mixed, projection?: Object, options?: Object): MongooseQuery, - find(conditions: ?Object, projection?: Object, options?: Object): MongooseQuery, - findOneAndRemove(conditions: ?Object, options?: Object): MongooseQuery, - where(conditions: ObjectMap): MongooseQuery, - findByIdAndRemove(id: mixed, options?: Object): MongooseQuery, - findOneAndRemove(conditions: ?Object, options?: Object): MongooseQuery, -} - -export type MongooseFieldOptionsT = { - description: ?string, -} - -export type MongooseFieldT = { - path?: string, - instance: string, - caster?: ?MongooseFieldT, - options?: ?MongooseFieldOptionsT, - enumValues?: ?string[], - schema?: MongooseModelSchemaT, -}; - -export type MongooseFieldMapT = { [fieldName: string]: MongooseFieldT }; - -export type ResolverNames = 'findById' | 'findByIds' | 'findOne' | 'findMany' | - 'updateById' | 'updateOne' | 'updateMany' | - 'removeById' | 'removeOne' | 'removeMany' | - 'createOne' | 'count' | 'connection'; - -export type MongooseQuery = { - exec(): Promise, - where(criteria: ObjectMap): MongooseQuery, - // where(fieldName: string, equalTo: string): MongooseQuery, - skip(num: number): MongooseQuery, - limit(num: number): MongooseQuery, - select(projection: ObjectMap): MongooseQuery, - sort(fields: ObjectMap): MongooseQuery, - setOptions(opts: ObjectMap): MongooseQuery, - update(data: ObjectMap): MongooseQuery, - remove(conditions: ?Object, options?: Object): MongooseQuery, - count(conditions: ?Object): MongooseQuery, - schema: MongooseModelSchemaT, -}; - -export type MongoseDocument = { - set(values: ObjectMap): void, - save(): Promise, -} - -// RE-EXPORT graphql-compose definitions -import type { - GraphQLObjectType as _GraphQLObjectType, - GraphQLOutputType as _GraphQLOutputType, - ResolveParams as _ResolveParams, - ComposeFieldConfigArgumentMap as _ComposeFieldConfigArgumentMap, - ResolverMWResolveFn as _ResolverMWResolveFn, - GraphQLResolveInfo as _GraphQLResolveInfo, -} from 'graphql-compose/lib/definition.js'; - -export type GraphQLObjectType = _GraphQLObjectType; -export type GraphQLOutputType = _GraphQLOutputType; -export type ComposeFieldConfigArgumentMap = _ComposeFieldConfigArgumentMap; -export type ResolveParams = _ResolveParams; -export type GraphQLResolveInfo = _GraphQLResolveInfo; -export type ResolverMWResolveFn = _ResolverMWResolveFn; -export type ExtendedResolveParams = $Shape> & { - query: MongooseQuery, - rawQuery: ObjectMap, - beforeQuery?: (query: mixed, rp: ExtendedResolveParams) => Promise<*>, - beforeRecordMutate?: (record: mixed, rp: ExtendedResolveParams) => Promise<*>, -}; - - -// HELPERS OPTIONS - -export type GenResolverOpts = { - filter?: FilterHelperArgsOpts, - sort?: SortHelperArgsOpts, - record?: RecordHelperArgsOpts, - limit?: LimitHelperArgsOpts, -} - - -export type TypeConverterOpts = { - name?: string, - description?: string, - fields?: { - only?: string[], - // rename?: { [oldName: string]: string }, - remove?: string[], - }, - inputType?: TypeConverterInputTypeOpts, - resolvers?: false | TypeConverterResolversOpts, -}; - -export type TypeConverterInputTypeOpts = { - name?: string, - description?: string, - fields?: { - only?: string[], - remove?: string[], - required?: string[] - }, -}; - -export type TypeConverterResolversOpts = { - findById?: false, - findByIds?: false | { - limit?: LimitHelperArgsOpts | false, - sort?: SortHelperArgsOpts | false, - }, - findOne?: false | { - filter?: FilterHelperArgsOpts | false, - sort?: SortHelperArgsOpts | false, - skip?: false, - }, - findMany?: false | { - filter?: FilterHelperArgsOpts | false, - sort?: SortHelperArgsOpts | false, - limit?: LimitHelperArgsOpts | false, - skip?: false, - }, - updateById?: false | { - input?: RecordHelperArgsOpts | false, - }, - updateOne?: false | { - input?: RecordHelperArgsOpts | false, - filter?: FilterHelperArgsOpts | false, - sort?: SortHelperArgsOpts | false, - skip?: false, - }, - updateMany?: false | { - input?: RecordHelperArgsOpts | false, - filter?: FilterHelperArgsOpts | false, - sort?: SortHelperArgsOpts | false, - limit?: LimitHelperArgsOpts | false, - skip?: false, - }, - removeById?: false, - removeOne?: false | { - filter?: FilterHelperArgsOpts | false, - sort?: SortHelperArgsOpts | false, - }, - removeMany?: false | { - filter?: FilterHelperArgsOpts | false, - }, - createOne?: false | { - input?: RecordHelperArgsOpts | false, - }, - count?: false | { - filter?: FilterHelperArgsOpts | false, - }, - connection?: ConnectionSortMapOpts | false, - pagination?: PaginationOpts | false, -}; - -export type PaginationOpts = { - perPage?: number -}; - -export type FilterHelperArgsOpts = { - filterTypeName?: string, - isRequired?: boolean, - onlyIndexed?: boolean, - requiredFields?: string | string[], - operators?: FilterOperatorsOpts | false, - removeFields?: string | string[], -}; - -export type FilterOperatorNames = 'gt' | 'gte' | 'lt' | 'lte' | 'ne' | 'in[]' | 'nin[]'; - -export type FilterOperatorsOpts = { - [fieldName: string]: FilterOperatorNames[] | false, -}; - -export type SortHelperArgsOpts = { - sortTypeName?: string, -}; - -export type RecordHelperArgsOpts = { - recordTypeName?: string, - isRequired?: boolean, - removeFields?: string[], - requiredFields?: string[], -}; - -export type LimitHelperArgsOpts = { - defaultValue?: number, -}; diff --git a/src/fieldsConverter.js b/src/fieldsConverter.js index 682d0587..cc9f49d8 100644 --- a/src/fieldsConverter.js +++ b/src/fieldsConverter.js @@ -2,6 +2,7 @@ /* eslint-disable no-use-before-define */ import mongoose from 'mongoose'; +import type { Schema, MongooseModel, MongooseSchemaField } from 'mongoose'; import objectPath from 'object-path'; import { TypeComposer, @@ -9,30 +10,27 @@ import { GraphQLBuffer, GraphQLGeneric, GraphQLJSON, - graphql, } from 'graphql-compose'; - -import GraphQLMongoID from './types/mongoid'; -import typeStorage from './typeStorage'; - -import type { - MongooseModelT, - // MongooseModelSchemaT, - MongoosePseudoModelT, - MongooseFieldT, - MongooseFieldMapT, - ComplexTypesT, - GraphQLOutputType, -} from './definition'; - -const { +import { GraphQLString, GraphQLFloat, GraphQLBoolean, GraphQLList, GraphQLEnumType, GraphQLObjectType, -} = graphql; + type GraphQLOutputType, +} from 'graphql-compose/lib/graphql'; + +import GraphQLMongoID from './types/mongoid'; +import typeStorage from './typeStorage'; + +type MongooseFieldT = MongooseSchemaField; +type MongooseFieldMapT = { [fieldName: string]: MongooseFieldT }; + +export type MongoosePseudoModelT = { + _gqcTypeComposer?: TypeComposer, + schema: Schema, +}; export const ComplexTypes = { ARRAY: 'ARRAY', @@ -109,9 +107,7 @@ export function dotPathsToEmbedded(fields: MongooseFieldMapT): MongooseFieldMapT return result; } -export function getFieldsFromModel( - model: MongooseModelT | MongoosePseudoModelT -): MongooseFieldMapT { +export function getFieldsFromModel(model: MongooseModel | MongoosePseudoModelT): MongooseFieldMapT { if (!model || !model.schema || !model.schema.paths) { throw new Error( 'You provide incorrect mongoose model to `getFieldsFromModel()`. ' + @@ -132,7 +128,7 @@ export function getFieldsFromModel( } export function convertModelToGraphQL( - model: MongooseModelT | MongoosePseudoModelT, + model: MongooseModel | MongoosePseudoModelT, typeName: string ): TypeComposer { // if model already has generated TypeComposer early, then return it @@ -155,6 +151,8 @@ export function convertModelToGraphQL( }) ) ); + + // $FlowFixMe model.schema._gqcTypeComposer = typeComposer; // eslint-disable-line const mongooseFields = getFieldsFromModel(model); @@ -231,7 +229,7 @@ export function convertFieldToGraphQL( } } -export function deriveComplexType(field: MongooseFieldT): ComplexTypesT { +export function deriveComplexType(field: MongooseFieldT): $Keys { if (!field || !field.path || !field.instance) { throw new Error( 'You provide incorrect mongoose field to `deriveComplexType()`. ' + diff --git a/src/resolvers/__tests__/count-test.js b/src/resolvers/__tests__/count-test.js index ebe6237b..76bd10e8 100644 --- a/src/resolvers/__tests__/count-test.js +++ b/src/resolvers/__tests__/count-test.js @@ -1,13 +1,12 @@ /* @flow */ -import { Resolver, graphql } from 'graphql-compose'; +import { Resolver } from 'graphql-compose'; +import { GraphQLInt } from 'graphql-compose/lib/graphql'; import { UserModel } from '../../__mocks__/userModel'; import count from '../count'; import { composeWithMongoose } from '../../composeWithMongoose'; import typeStorage from '../../typeStorage'; -const { GraphQLInt } = graphql; - beforeAll(() => UserModel.base.connect()); afterAll(() => UserModel.base.disconnect()); diff --git a/src/resolvers/__tests__/createOne-test.js b/src/resolvers/__tests__/createOne-test.js index d0b5590c..f9fcf424 100644 --- a/src/resolvers/__tests__/createOne-test.js +++ b/src/resolvers/__tests__/createOne-test.js @@ -1,15 +1,14 @@ /* @flow */ /* eslint-disable no-param-reassign */ -import { Resolver, TypeComposer, graphql } from 'graphql-compose'; +import { Resolver, TypeComposer } from 'graphql-compose'; +import { GraphQLNonNull, GraphQLObjectType } from 'graphql-compose/lib/graphql'; import { UserModel } from '../../__mocks__/userModel'; import createOne from '../createOne'; import { composeWithMongoose } from '../../composeWithMongoose'; import GraphQLMongoID from '../../types/mongoid'; import typeStorage from '../../typeStorage'; -const { GraphQLNonNull, GraphQLObjectType } = graphql; - beforeAll(() => UserModel.base.connect()); afterAll(() => UserModel.base.disconnect()); diff --git a/src/resolvers/__tests__/findById-test.js b/src/resolvers/__tests__/findById-test.js index e7cd1b15..aecabc2c 100644 --- a/src/resolvers/__tests__/findById-test.js +++ b/src/resolvers/__tests__/findById-test.js @@ -1,6 +1,7 @@ /* @flow */ -import { Resolver, graphql } from 'graphql-compose'; +import { Resolver } from 'graphql-compose'; +import { GraphQLNonNull } from 'graphql-compose/lib/graphql'; import { UserModel } from '../../__mocks__/userModel'; import { PostModel } from '../../__mocks__/postModel'; import findById from '../findById'; @@ -8,8 +9,6 @@ import GraphQLMongoID from '../../types/mongoid'; import { composeWithMongoose } from '../../composeWithMongoose'; import typeStorage from '../../typeStorage'; -const { GraphQLNonNull } = graphql; - beforeAll(() => UserModel.base.connect()); afterAll(() => UserModel.base.disconnect()); diff --git a/src/resolvers/__tests__/findByIds-test.js b/src/resolvers/__tests__/findByIds-test.js index 2f0435ba..056813e8 100644 --- a/src/resolvers/__tests__/findByIds-test.js +++ b/src/resolvers/__tests__/findByIds-test.js @@ -1,6 +1,7 @@ /* @flow */ -import { Resolver, graphql } from 'graphql-compose'; +import { Resolver } from 'graphql-compose'; +import { GraphQLNonNull, GraphQLList } from 'graphql-compose/lib/graphql'; import { UserModel } from '../../__mocks__/userModel'; import { PostModel } from '../../__mocks__/postModel'; import findByIds from '../findByIds'; @@ -8,8 +9,6 @@ import GraphQLMongoID from '../../types/mongoid'; import { composeWithMongoose } from '../../composeWithMongoose'; import typeStorage from '../../typeStorage'; -const { GraphQLNonNull, GraphQLList } = graphql; - beforeAll(() => UserModel.base.connect()); afterAll(() => UserModel.base.disconnect()); diff --git a/src/resolvers/__tests__/findOne-test.js b/src/resolvers/__tests__/findOne-test.js index bf5dcc35..39e4bb95 100644 --- a/src/resolvers/__tests__/findOne-test.js +++ b/src/resolvers/__tests__/findOne-test.js @@ -1,13 +1,12 @@ /* @flow */ -import { Resolver, graphql } from 'graphql-compose'; +import { Resolver } from 'graphql-compose'; +import { GraphQLNonNull } from 'graphql-compose/lib/graphql'; import { UserModel } from '../../__mocks__/userModel'; import findOne from '../findOne'; import { composeWithMongoose } from '../../composeWithMongoose'; import typeStorage from '../../typeStorage'; -const { GraphQLNonNull } = graphql; - beforeAll(() => UserModel.base.connect()); afterAll(() => UserModel.base.disconnect()); diff --git a/src/resolvers/__tests__/removeById-test.js b/src/resolvers/__tests__/removeById-test.js index 5afb8225..13a6452e 100644 --- a/src/resolvers/__tests__/removeById-test.js +++ b/src/resolvers/__tests__/removeById-test.js @@ -1,15 +1,14 @@ /* @flow */ /* eslint-disable no-param-reassign */ -import { Resolver, TypeComposer, graphql } from 'graphql-compose'; +import { Resolver, TypeComposer } from 'graphql-compose'; +import { GraphQLNonNull, GraphQLObjectType } from 'graphql-compose/lib/graphql'; import { UserModel } from '../../__mocks__/userModel'; import removeById from '../removeById'; import GraphQLMongoID from '../../types/mongoid'; import { composeWithMongoose } from '../../composeWithMongoose'; import typeStorage from '../../typeStorage'; -const { GraphQLNonNull, GraphQLObjectType } = graphql; - beforeAll(() => UserModel.base.connect()); afterAll(() => UserModel.base.disconnect()); diff --git a/src/resolvers/__tests__/removeMany-test.js b/src/resolvers/__tests__/removeMany-test.js index 9f35c02e..3fb27f02 100644 --- a/src/resolvers/__tests__/removeMany-test.js +++ b/src/resolvers/__tests__/removeMany-test.js @@ -1,14 +1,13 @@ /* @flow */ import { Query } from 'mongoose'; -import { Resolver, TypeComposer, graphql } from 'graphql-compose'; +import { Resolver, TypeComposer } from 'graphql-compose'; +import { GraphQLInt, GraphQLNonNull, GraphQLObjectType } from 'graphql-compose/lib/graphql'; import { UserModel } from '../../__mocks__/userModel'; import removeMany from '../removeMany'; import { composeWithMongoose } from '../../composeWithMongoose'; import typeStorage from '../../typeStorage'; -const { GraphQLInt, GraphQLNonNull, GraphQLObjectType } = graphql; - beforeAll(() => UserModel.base.connect()); afterAll(() => UserModel.base.disconnect()); diff --git a/src/resolvers/__tests__/removeOne-test.js b/src/resolvers/__tests__/removeOne-test.js index 0c6f420f..d8d67bd7 100644 --- a/src/resolvers/__tests__/removeOne-test.js +++ b/src/resolvers/__tests__/removeOne-test.js @@ -1,15 +1,14 @@ /* @flow */ /* eslint-disable no-param-reassign */ -import { Resolver, TypeComposer, graphql } from 'graphql-compose'; +import { Resolver, TypeComposer } from 'graphql-compose'; +import { GraphQLObjectType } from 'graphql-compose/lib/graphql'; import { UserModel } from '../../__mocks__/userModel'; import removeOne from '../removeOne'; import GraphQLMongoID from '../../types/mongoid'; import { composeWithMongoose } from '../../composeWithMongoose'; import typeStorage from '../../typeStorage'; -const { GraphQLObjectType } = graphql; - beforeAll(() => UserModel.base.connect()); afterAll(() => UserModel.base.disconnect()); diff --git a/src/resolvers/__tests__/updateById-test.js b/src/resolvers/__tests__/updateById-test.js index 0eaeecba..535f6374 100644 --- a/src/resolvers/__tests__/updateById-test.js +++ b/src/resolvers/__tests__/updateById-test.js @@ -1,15 +1,19 @@ /* @flow */ /* eslint-disable no-param-reassign */ -import { Resolver, TypeComposer, InputTypeComposer, graphql } from 'graphql-compose'; +import { Resolver, TypeComposer, InputTypeComposer } from 'graphql-compose'; +import { + GraphQLNonNull, + GraphQLInputObjectType, + getNullableType, + GraphQLObjectType, +} from 'graphql-compose/lib/graphql'; import { UserModel } from '../../__mocks__/userModel'; import updateById from '../updateById'; import GraphQLMongoID from '../../types/mongoid'; import { composeWithMongoose } from '../../composeWithMongoose'; import typeStorage from '../../typeStorage'; -const { GraphQLNonNull, GraphQLInputObjectType, getNullableType, GraphQLObjectType } = graphql; - beforeAll(() => UserModel.base.connect()); afterAll(() => UserModel.base.disconnect()); diff --git a/src/resolvers/__tests__/updateMany-test.js b/src/resolvers/__tests__/updateMany-test.js index da5e784a..53afea29 100644 --- a/src/resolvers/__tests__/updateMany-test.js +++ b/src/resolvers/__tests__/updateMany-test.js @@ -1,14 +1,13 @@ /* @flow */ import { Query } from 'mongoose'; -import { Resolver, TypeComposer, graphql } from 'graphql-compose'; +import { Resolver, TypeComposer } from 'graphql-compose'; +import { GraphQLInt, GraphQLNonNull, GraphQLObjectType } from 'graphql-compose/lib/graphql'; import { UserModel } from '../../__mocks__/userModel'; import updateMany from '../updateMany'; import { composeWithMongoose } from '../../composeWithMongoose'; import typeStorage from '../../typeStorage'; -const { GraphQLInt, GraphQLNonNull, GraphQLObjectType } = graphql; - beforeAll(() => UserModel.base.connect()); afterAll(() => UserModel.base.disconnect()); diff --git a/src/resolvers/__tests__/updateOne-test.js b/src/resolvers/__tests__/updateOne-test.js index 0d80cd96..7402b8a8 100644 --- a/src/resolvers/__tests__/updateOne-test.js +++ b/src/resolvers/__tests__/updateOne-test.js @@ -1,15 +1,14 @@ /* @flow */ /* eslint-disable no-param-reassign */ -import { Resolver, TypeComposer, graphql } from 'graphql-compose'; +import { Resolver, TypeComposer } from 'graphql-compose'; +import { GraphQLNonNull, GraphQLObjectType } from 'graphql-compose/lib/graphql'; import { UserModel } from '../../__mocks__/userModel'; import updateOne from '../updateOne'; import GraphQLMongoID from '../../types/mongoid'; import { composeWithMongoose } from '../../composeWithMongoose'; import typeStorage from '../../typeStorage'; -const { GraphQLNonNull, GraphQLObjectType } = graphql; - beforeAll(() => UserModel.base.connect()); afterAll(() => UserModel.base.disconnect()); diff --git a/src/resolvers/count.js b/src/resolvers/count.js index 6bb9e294..7f723aba 100644 --- a/src/resolvers/count.js +++ b/src/resolvers/count.js @@ -2,11 +2,12 @@ /* eslint-disable no-param-reassign */ import { Resolver, TypeComposer } from 'graphql-compose'; -import { filterHelperArgs, filterHelper } from './helpers/filter'; -import type { MongooseModelT, ExtendedResolveParams, GenResolverOpts } from '../definition'; +import type { MongooseModel } from 'mongoose'; +import { filterHelper, filterHelperArgs } from './helpers'; +import type { ExtendedResolveParams, GenResolverOpts } from './index'; export default function count( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts?: GenResolverOpts ): Resolver<*, *> { diff --git a/src/resolvers/createOne.js b/src/resolvers/createOne.js index f57d71f0..329872a0 100644 --- a/src/resolvers/createOne.js +++ b/src/resolvers/createOne.js @@ -2,13 +2,14 @@ /* eslint-disable no-param-reassign, new-cap */ import { Resolver, TypeComposer } from 'graphql-compose'; -import { recordHelperArgs } from './helpers/record'; +import type { MongooseModel } from 'mongoose'; +import { recordHelperArgs } from './helpers'; import typeStorage from '../typeStorage'; import GraphQLMongoID from '../types/mongoid'; -import type { MongooseModelT, ExtendedResolveParams, GenResolverOpts } from '../definition'; +import type { ExtendedResolveParams, GenResolverOpts } from './index'; export default function createOne( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts?: GenResolverOpts ): Resolver<*, *> { diff --git a/src/resolvers/findById.js b/src/resolvers/findById.js index 6409d3f5..961d4efa 100644 --- a/src/resolvers/findById.js +++ b/src/resolvers/findById.js @@ -1,14 +1,14 @@ /* @flow */ -import { Resolver, TypeComposer, graphql } from 'graphql-compose'; +import { Resolver, TypeComposer } from 'graphql-compose'; +import type { MongooseModel } from 'mongoose'; +import { GraphQLNonNull } from 'graphql-compose/lib/graphql'; import GraphQLMongoID from '../types/mongoid'; -import { projectionHelper } from './helpers/projection'; -import type { MongooseModelT, ExtendedResolveParams, GenResolverOpts } from '../definition'; - -const { GraphQLNonNull } = graphql; +import { projectionHelper } from './helpers'; +import type { ExtendedResolveParams, GenResolverOpts } from './index'; export default function findById( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts?: GenResolverOpts // eslint-disable-line no-unused-vars ): Resolver<*, *> { diff --git a/src/resolvers/findByIds.js b/src/resolvers/findByIds.js index 2106aa8a..126bc553 100644 --- a/src/resolvers/findByIds.js +++ b/src/resolvers/findByIds.js @@ -1,16 +1,20 @@ /* @flow */ -import { Resolver, TypeComposer, graphql } from 'graphql-compose'; +import { Resolver, TypeComposer } from 'graphql-compose'; +import type { MongooseModel } from 'mongoose'; +import { GraphQLNonNull, GraphQLList } from 'graphql-compose/lib/graphql'; import GraphQLMongoID from '../types/mongoid'; -import { limitHelperArgs, limitHelper } from './helpers/limit'; -import { sortHelperArgs, sortHelper } from './helpers/sort'; -import { projectionHelper } from './helpers/projection'; -import type { MongooseModelT, ExtendedResolveParams, GenResolverOpts } from '../definition'; - -const { GraphQLNonNull, GraphQLList } = graphql; +import { + limitHelper, + limitHelperArgs, + sortHelper, + sortHelperArgs, + projectionHelper, +} from './helpers'; +import type { ExtendedResolveParams, GenResolverOpts } from './index'; export default function findByIds( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts?: GenResolverOpts ): Resolver<*, *> { diff --git a/src/resolvers/findMany.js b/src/resolvers/findMany.js index b0f9dd45..4d3b8641 100644 --- a/src/resolvers/findMany.js +++ b/src/resolvers/findMany.js @@ -2,15 +2,22 @@ /* eslint-disable no-param-reassign */ import { Resolver, TypeComposer } from 'graphql-compose'; -import { skipHelperArgs, skipHelper } from './helpers/skip'; -import { limitHelperArgs, limitHelper } from './helpers/limit'; -import { filterHelperArgs, filterHelper } from './helpers/filter'; -import { sortHelperArgs, sortHelper } from './helpers/sort'; -import { projectionHelper } from './helpers/projection'; -import type { MongooseModelT, ExtendedResolveParams, GenResolverOpts } from '../definition'; +import type { MongooseModel } from 'mongoose'; +import { + limitHelper, + limitHelperArgs, + skipHelper, + skipHelperArgs, + filterHelper, + filterHelperArgs, + sortHelper, + sortHelperArgs, + projectionHelper, +} from './helpers'; +import type { ExtendedResolveParams, GenResolverOpts } from './index'; export default function findMany( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts?: GenResolverOpts ): Resolver<*, *> { diff --git a/src/resolvers/findOne.js b/src/resolvers/findOne.js index 7b938c3d..97601fc4 100644 --- a/src/resolvers/findOne.js +++ b/src/resolvers/findOne.js @@ -2,14 +2,20 @@ /* eslint-disable no-param-reassign */ import { Resolver, TypeComposer } from 'graphql-compose'; -import { skipHelperArgs, skipHelper } from './helpers/skip'; -import { filterHelperArgs, filterHelper } from './helpers/filter'; -import { sortHelperArgs, sortHelper } from './helpers/sort'; -import { projectionHelper } from './helpers/projection'; -import type { MongooseModelT, ExtendedResolveParams, GenResolverOpts } from '../definition'; +import type { MongooseModel } from 'mongoose'; +import { + skipHelper, + skipHelperArgs, + filterHelper, + filterHelperArgs, + sortHelper, + sortHelperArgs, + projectionHelper, +} from './helpers'; +import type { ExtendedResolveParams, GenResolverOpts } from './index'; export default function findOne( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts?: GenResolverOpts ): Resolver<*, *> { diff --git a/src/resolvers/helpers/__tests__/filter-test.js b/src/resolvers/helpers/__tests__/filter-test.js index f9b42d07..509ef0a5 100644 --- a/src/resolvers/helpers/__tests__/filter-test.js +++ b/src/resolvers/helpers/__tests__/filter-test.js @@ -1,6 +1,7 @@ /* @flow */ -import { InputTypeComposer, graphql } from 'graphql-compose'; +import { InputTypeComposer } from 'graphql-compose'; +import { GraphQLInputObjectType, GraphQLNonNull, GraphQLList } from 'graphql-compose/lib/graphql'; import { filterHelperArgs, filterHelper, @@ -13,8 +14,6 @@ import { UserModel } from '../../../__mocks__/userModel'; import { composeWithMongoose } from '../../../composeWithMongoose'; import typeStorage from '../../../typeStorage'; -const { GraphQLInputObjectType, GraphQLNonNull, GraphQLList } = graphql; - describe('Resolver helper `filter` ->', () => { let UserTypeComposer; diff --git a/src/resolvers/helpers/__tests__/record-test.js b/src/resolvers/helpers/__tests__/record-test.js index 7b122cf2..0c48525d 100644 --- a/src/resolvers/helpers/__tests__/record-test.js +++ b/src/resolvers/helpers/__tests__/record-test.js @@ -1,13 +1,12 @@ /* @flow */ -import { InputTypeComposer, graphql } from 'graphql-compose'; +import { InputTypeComposer } from 'graphql-compose'; +import { GraphQLInputObjectType, GraphQLNonNull } from 'graphql-compose/lib/graphql'; import { recordHelperArgs } from '../record'; import { UserModel } from '../../../__mocks__/userModel'; import { composeWithMongoose } from '../../../composeWithMongoose'; import typeStorage from '../../../typeStorage'; -const { GraphQLInputObjectType, GraphQLNonNull } = graphql; - describe('Resolver helper `record` ->', () => { let UserTypeComposer; diff --git a/src/resolvers/helpers/__tests__/sort-test.js b/src/resolvers/helpers/__tests__/sort-test.js index 369cd5ec..c0b592c2 100644 --- a/src/resolvers/helpers/__tests__/sort-test.js +++ b/src/resolvers/helpers/__tests__/sort-test.js @@ -1,13 +1,11 @@ /* @flow */ -import { graphql } from 'graphql-compose'; +import { GraphQLEnumType } from 'graphql-compose/lib/graphql'; import { sortHelperArgs, sortHelper, getSortTypeFromModel } from '../sort'; import { UserModel } from '../../../__mocks__/userModel'; import { getIndexesFromModel } from '../../../utils/getIndexesFromModel'; import typeStorage from '../../../typeStorage'; -const { GraphQLEnumType } = graphql; - describe('Resolver helper `sort` ->', () => { beforeEach(() => { typeStorage.clear(); diff --git a/src/resolvers/helpers/filter.js b/src/resolvers/helpers/filter.js index c04ff645..d3cee42b 100644 --- a/src/resolvers/helpers/filter.js +++ b/src/resolvers/helpers/filter.js @@ -1,27 +1,41 @@ /* @flow */ /* eslint-disable no-use-before-define */ -import { TypeComposer, InputTypeComposer, isObject, graphql } from 'graphql-compose'; +import { TypeComposer, InputTypeComposer, isObject } from 'graphql-compose'; +import type { ComposeFieldConfigArgumentMap } from 'graphql-compose'; +import type { MongooseModel } from 'mongoose'; +import { + GraphQLNonNull, + GraphQLInputObjectType, + GraphQLList, + getNamedType, +} from 'graphql-compose/lib/graphql'; import { getIndexesFromModel } from '../../utils/getIndexesFromModel'; import GraphQLMongoID from '../../types/mongoid'; import { toMongoDottedObject, upperFirst } from '../../utils'; import typeStorage from '../../typeStorage'; -import type { - ComposeFieldConfigArgumentMap, - ExtendedResolveParams, - MongooseModelT, - FilterHelperArgsOpts, - FilterOperatorsOpts, - FilterOperatorNames, -} from '../../definition'; - -const { GraphQLNonNull, GraphQLInputObjectType, GraphQLList, getNamedType } = graphql; +import type { ExtendedResolveParams } from '../index'; export const OPERATORS_FIELDNAME = '_operators'; +export type FilterOperatorNames = 'gt' | 'gte' | 'lt' | 'lte' | 'ne' | 'in[]' | 'nin[]'; + +export type FilterOperatorsOpts = { + [fieldName: string]: FilterOperatorNames[] | false, +}; + +export type FilterHelperArgsOpts = { + filterTypeName?: string, + isRequired?: boolean, + onlyIndexed?: boolean, + requiredFields?: string | string[], + operators?: FilterOperatorsOpts | false, + removeFields?: string | string[], +}; + export const filterHelperArgs = ( typeComposer: TypeComposer, - model: MongooseModelT, + model: MongooseModel, opts?: FilterHelperArgsOpts ): ComposeFieldConfigArgumentMap => { if (!(typeComposer instanceof TypeComposer)) { @@ -138,7 +152,7 @@ export function filterHelper(resolveParams: ExtendedResolveParams): void { } } -export function getIndexedFieldNames(model: MongooseModelT): string[] { +export function getIndexedFieldNames(model: MongooseModel): string[] { const indexes = getIndexesFromModel(model); const fieldNames = []; @@ -162,7 +176,7 @@ export function getIndexedFieldNames(model: MongooseModelT): string[] { export function addFieldsWithOperator( typeName: string, inputComposer: InputTypeComposer, - model: MongooseModelT, + model: MongooseModel, operatorsOpts: FilterOperatorsOpts ): InputTypeComposer { const operatorsComposer = new InputTypeComposer( @@ -218,6 +232,7 @@ export function addFieldsWithOperator( } else { fields[operatorName] = { ...existedFields[fieldName], + // $FlowFixMe type: namedType, }; } diff --git a/src/resolvers/helpers/index.js b/src/resolvers/helpers/index.js new file mode 100644 index 00000000..b8c9ac85 --- /dev/null +++ b/src/resolvers/helpers/index.js @@ -0,0 +1,8 @@ +/* @flow */ + +export * from './filter'; +export * from './limit'; +export * from './projection'; +export * from './record'; +export * from './skip'; +export * from './sort'; diff --git a/src/resolvers/helpers/limit.js b/src/resolvers/helpers/limit.js index 96e2e5b6..d69d6acb 100644 --- a/src/resolvers/helpers/limit.js +++ b/src/resolvers/helpers/limit.js @@ -1,10 +1,11 @@ /* @flow */ -import type { - ComposeFieldConfigArgumentMap, - ExtendedResolveParams, - LimitHelperArgsOpts, -} from '../../definition'; +import type { ComposeFieldConfigArgumentMap } from 'graphql-compose'; +import type { ExtendedResolveParams } from '../index'; + +export type LimitHelperArgsOpts = { + defaultValue?: number, +}; export const limitHelperArgs = (opts?: LimitHelperArgsOpts): ComposeFieldConfigArgumentMap => { return { diff --git a/src/resolvers/helpers/projection.js b/src/resolvers/helpers/projection.js index 748dc407..cf464c08 100644 --- a/src/resolvers/helpers/projection.js +++ b/src/resolvers/helpers/projection.js @@ -1,6 +1,6 @@ /* @flow */ -import type { ExtendedResolveParams } from '../../definition'; +import type { ExtendedResolveParams } from '../index'; export function projectionHelper(resolveParams: ExtendedResolveParams): void { // eslint-disable-line const projection = resolveParams.projection; diff --git a/src/resolvers/helpers/record.js b/src/resolvers/helpers/record.js index 2edce520..c50d32dc 100644 --- a/src/resolvers/helpers/record.js +++ b/src/resolvers/helpers/record.js @@ -1,11 +1,16 @@ /* @flow */ -import { TypeComposer, InputTypeComposer, graphql } from 'graphql-compose'; +import { TypeComposer, InputTypeComposer } from 'graphql-compose'; +import type { ComposeFieldConfigArgumentMap } from 'graphql-compose'; +import { GraphQLNonNull } from 'graphql-compose/lib/graphql'; import typeStorage from '../../typeStorage'; -import type { ComposeFieldConfigArgumentMap, RecordHelperArgsOpts } from '../../definition'; - -const { GraphQLNonNull } = graphql; +export type RecordHelperArgsOpts = { + recordTypeName?: string, + isRequired?: boolean, + removeFields?: string[], + requiredFields?: string[], +}; export const recordHelperArgs = ( typeComposer: TypeComposer, @@ -24,7 +29,10 @@ export const recordHelperArgs = ( const recordComposer = new InputTypeComposer( typeStorage.getOrSet( recordTypeName, - typeComposer.getInputTypeComposer().clone(recordTypeName).getType() + typeComposer + .getInputTypeComposer() + .clone(recordTypeName) + .getType() ) ); if (opts && opts.removeFields) { diff --git a/src/resolvers/helpers/skip.js b/src/resolvers/helpers/skip.js index 82b65957..50384915 100644 --- a/src/resolvers/helpers/skip.js +++ b/src/resolvers/helpers/skip.js @@ -1,6 +1,7 @@ /* @flow */ -import type { ComposeFieldConfigArgumentMap, ExtendedResolveParams } from '../../definition'; +import type { ComposeFieldConfigArgumentMap } from 'graphql-compose'; +import type { ExtendedResolveParams } from '../index'; export const skipHelperArgs = (): ComposeFieldConfigArgumentMap => { return { diff --git a/src/resolvers/helpers/sort.js b/src/resolvers/helpers/sort.js index ef107628..59e6b2f2 100644 --- a/src/resolvers/helpers/sort.js +++ b/src/resolvers/helpers/sort.js @@ -1,20 +1,19 @@ /* @flow */ /* eslint-disable no-use-before-define */ -import { graphql } from 'graphql-compose'; +import type { MongooseModel } from 'mongoose'; +import { GraphQLEnumType } from 'graphql-compose/lib/graphql'; +import type { ComposeFieldConfigArgumentMap } from 'graphql-compose'; import { getIndexesFromModel, extendByReversedIndexes } from '../../utils/getIndexesFromModel'; import typeStorage from '../../typeStorage'; -import type { - ExtendedResolveParams, - ComposeFieldConfigArgumentMap, - MongooseModelT, - SortHelperArgsOpts, -} from '../../definition'; +import type { ExtendedResolveParams } from '../index'; -const { GraphQLEnumType } = graphql; +export type SortHelperArgsOpts = { + sortTypeName?: string, +}; export const sortHelperArgs = ( - model: MongooseModelT, + model: MongooseModel, opts?: SortHelperArgsOpts ): ComposeFieldConfigArgumentMap => { if (!model || !model.modelName || !model.schema) { @@ -42,13 +41,16 @@ export function sortHelper(resolveParams: ExtendedResolveParams): void { } } -export function getSortTypeFromModel(typeName: string, model: MongooseModelT): GraphQLEnumType { +export function getSortTypeFromModel(typeName: string, model: MongooseModel): GraphQLEnumType { const indexes = extendByReversedIndexes(getIndexesFromModel(model)); const sortEnumValues = {}; indexes.forEach(indexData => { const keys = Object.keys(indexData); - let name = keys.join('__').toUpperCase().replace(/[^_a-zA-Z0-9]/i, '__'); + let name = keys + .join('__') + .toUpperCase() + .replace(/[^_a-zA-Z0-9]/i, '__'); if (indexData[keys[0]] === 1) { name = `${name}_ASC`; } else if (indexData[keys[0]] === -1) { diff --git a/src/resolvers/index.js b/src/resolvers/index.js index 9706bb35..68772b32 100644 --- a/src/resolvers/index.js +++ b/src/resolvers/index.js @@ -1,5 +1,8 @@ /* @flow */ +import type { MongooseQuery } from 'mongoose'; +import type { ResolveParams } from 'graphql-compose'; + import findById from './findById'; import findByIds from './findByIds'; import findOne from './findOne'; @@ -16,6 +19,27 @@ import removeMany from './removeMany'; import createOne from './createOne'; import count from './count'; +import type { + FilterHelperArgsOpts, + SortHelperArgsOpts, + RecordHelperArgsOpts, + LimitHelperArgsOpts, +} from './helpers'; + +export type GenResolverOpts = { + filter?: FilterHelperArgsOpts, + sort?: SortHelperArgsOpts, + record?: RecordHelperArgsOpts, + limit?: LimitHelperArgsOpts, +}; + +export type ExtendedResolveParams = $Shape> & { + query: MongooseQuery<*, *>, + rawQuery: { [optName: string]: any }, + beforeQuery?: (query: mixed, rp: ExtendedResolveParams) => Promise<*>, + beforeRecordMutate?: (record: mixed, rp: ExtendedResolveParams) => Promise<*>, +}; + export { findById, findByIds, diff --git a/src/resolvers/removeById.js b/src/resolvers/removeById.js index 02d58309..833e868a 100644 --- a/src/resolvers/removeById.js +++ b/src/resolvers/removeById.js @@ -1,16 +1,16 @@ /* @flow */ /* eslint-disable no-param-reassign */ -import { Resolver, TypeComposer, graphql } from 'graphql-compose'; +import { Resolver, TypeComposer } from 'graphql-compose'; +import type { MongooseModel } from 'mongoose'; +import { GraphQLNonNull } from 'graphql-compose/lib/graphql'; import findById from './findById'; import GraphQLMongoID from '../types/mongoid'; import typeStorage from '../typeStorage'; -import type { MongooseModelT, ExtendedResolveParams, GenResolverOpts } from '../definition'; - -const { GraphQLNonNull } = graphql; +import type { ExtendedResolveParams, GenResolverOpts } from './index'; export default function removeById( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts?: GenResolverOpts // eslint-disable-line no-unused-vars ): Resolver<*, *> { diff --git a/src/resolvers/removeMany.js b/src/resolvers/removeMany.js index bb97a662..741f26d0 100644 --- a/src/resolvers/removeMany.js +++ b/src/resolvers/removeMany.js @@ -2,13 +2,13 @@ /* eslint-disable no-param-reassign */ import { Resolver, TypeComposer } from 'graphql-compose'; -import { filterHelperArgs, filterHelper } from './helpers/filter'; +import type { MongooseModel } from 'mongoose'; +import { filterHelperArgs, filterHelper } from './helpers'; import typeStorage from '../typeStorage'; - -import type { MongooseModelT, ExtendedResolveParams, GenResolverOpts } from '../definition'; +import type { ExtendedResolveParams, GenResolverOpts } from './index'; export default function removeMany( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts?: GenResolverOpts ): Resolver<*, *> { diff --git a/src/resolvers/removeOne.js b/src/resolvers/removeOne.js index 8a0aae78..543236c7 100644 --- a/src/resolvers/removeOne.js +++ b/src/resolvers/removeOne.js @@ -2,15 +2,15 @@ /* eslint-disable no-param-reassign */ import { Resolver, TypeComposer } from 'graphql-compose'; +import type { MongooseModel } from 'mongoose'; import GraphQLMongoID from '../types/mongoid'; import typeStorage from '../typeStorage'; -import { filterHelperArgs } from './helpers/filter'; -import { sortHelperArgs } from './helpers/sort'; +import { filterHelperArgs, sortHelperArgs } from './helpers'; import findOne from './findOne'; -import type { MongooseModelT, ExtendedResolveParams, GenResolverOpts } from '../definition'; +import type { ExtendedResolveParams, GenResolverOpts } from './index'; export default function removeOne( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts?: GenResolverOpts ): Resolver<*, *> { diff --git a/src/resolvers/updateById.js b/src/resolvers/updateById.js index cfd499ff..a44e271b 100644 --- a/src/resolvers/updateById.js +++ b/src/resolvers/updateById.js @@ -2,15 +2,16 @@ /* eslint-disable no-param-reassign */ import { Resolver, TypeComposer } from 'graphql-compose'; +import type { MongooseModel } from 'mongoose'; import { recordHelperArgs } from './helpers/record'; import findById from './findById'; import GraphQLMongoID from '../types/mongoid'; import typeStorage from '../typeStorage'; -import type { MongooseModelT, ExtendedResolveParams, GenResolverOpts } from '../definition'; +import type { ExtendedResolveParams, GenResolverOpts } from './index'; export default function updateById( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts?: GenResolverOpts ): Resolver<*, *> { diff --git a/src/resolvers/updateMany.js b/src/resolvers/updateMany.js index c7a2009f..ba0718c6 100644 --- a/src/resolvers/updateMany.js +++ b/src/resolvers/updateMany.js @@ -2,17 +2,24 @@ /* eslint-disable no-param-reassign */ import { Resolver, TypeComposer } from 'graphql-compose'; -import { recordHelperArgs } from './helpers/record'; -import { skipHelperArgs, skipHelper } from './helpers/skip'; -import { limitHelperArgs, limitHelper } from './helpers/limit'; -import { filterHelperArgs, filterHelper } from './helpers/filter'; -import { sortHelperArgs, sortHelper } from './helpers/sort'; +import type { MongooseModel } from 'mongoose'; +import { + limitHelper, + limitHelperArgs, + skipHelper, + skipHelperArgs, + recordHelperArgs, + filterHelper, + filterHelperArgs, + sortHelper, + sortHelperArgs, +} from './helpers'; import toMongoDottedObject from '../utils/toMongoDottedObject'; import typeStorage from '../typeStorage'; -import type { MongooseModelT, ExtendedResolveParams, GenResolverOpts } from '../definition'; +import type { ExtendedResolveParams, GenResolverOpts } from './index'; export default function updateMany( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts?: GenResolverOpts ): Resolver<*, *> { diff --git a/src/resolvers/updateOne.js b/src/resolvers/updateOne.js index c67e5d7c..e599fdde 100644 --- a/src/resolvers/updateOne.js +++ b/src/resolvers/updateOne.js @@ -2,18 +2,15 @@ /* eslint-disable no-param-reassign */ import { Resolver, TypeComposer } from 'graphql-compose'; -import { skipHelperArgs } from './helpers/skip'; -import { recordHelperArgs } from './helpers/record'; -import { filterHelperArgs } from './helpers/filter'; -import { sortHelperArgs } from './helpers/sort'; +import type { MongooseModel } from 'mongoose'; +import type { ExtendedResolveParams, GenResolverOpts } from './index'; +import { skipHelperArgs, recordHelperArgs, filterHelperArgs, sortHelperArgs } from './helpers'; import findOne from './findOne'; import GraphQLMongoID from '../types/mongoid'; import typeStorage from '../typeStorage'; -import type { MongooseModelT, ExtendedResolveParams, GenResolverOpts } from '../definition'; - export default function updateOne( - model: MongooseModelT, + model: MongooseModel, typeComposer: TypeComposer, opts?: GenResolverOpts ): Resolver<*, *> { diff --git a/src/typeStorage.js b/src/typeStorage.js index b0f090e9..dfa47b6a 100644 --- a/src/typeStorage.js +++ b/src/typeStorage.js @@ -2,7 +2,7 @@ import { isFunction } from 'graphql-compose'; -class TypeStorage extends Map { +class TypeStorage extends Map { // this `create` hack due TypeError: // Constructor Map requires 'new' at TypeStorage.Map (native) static create(array?: any[]): TypeStorage { diff --git a/src/types/mongoid.js b/src/types/mongoid.js index f62cf300..6cb05076 100644 --- a/src/types/mongoid.js +++ b/src/types/mongoid.js @@ -1,8 +1,6 @@ /* @flow */ -import { graphql } from 'graphql-compose'; - -const { GraphQLScalarType, Kind } = graphql; +import { GraphQLScalarType, Kind } from 'graphql-compose/lib/graphql'; const GraphQLMongoID = new GraphQLScalarType({ name: 'MongoID', diff --git a/src/utils/getIndexesFromModel.js b/src/utils/getIndexesFromModel.js index 30ceb585..82e073a3 100644 --- a/src/utils/getIndexesFromModel.js +++ b/src/utils/getIndexesFromModel.js @@ -1,12 +1,14 @@ /* @flow */ -import type { ObjectMap, MongooseModelT } from '../definition'; +import type { MongooseModel } from 'mongoose'; export type getIndexesFromModelOpts = { extractCompound?: boolean, // true by default skipSpecificIndeces?: boolean, // eg text, 2d, 2dsphere (true by default) }; +export type IndexT = { [fieldName: string]: any }; + function isSpecificIndex(idx) { let hasSpecialIndex = false; Object.keys(idx).forEach(k => { @@ -22,9 +24,9 @@ function isSpecificIndex(idx) { * MongooseModel -> [ { _id: 1 }, { name: 1, surname: -1 } ] */ export function getIndexesFromModel( - mongooseModel: MongooseModelT, + mongooseModel: MongooseModel, opts: getIndexesFromModelOpts = {} -): ObjectMap[] { +): IndexT[] { const extractCompound = opts.extractCompound === undefined ? true : Boolean(opts.extractCompound); const skipSpecificIndexes = opts.skipSpecificIndexes === undefined ? true : Boolean(opts.skipSpecificIndexes); @@ -76,7 +78,7 @@ export function getIndexesFromModel( return result; } -export function getUniqueIndexes(mongooseModel: MongooseModelT): ObjectMap[] { +export function getUniqueIndexes(mongooseModel: MongooseModel): IndexT[] { const indexedFields = []; // add _id field if existed @@ -109,13 +111,10 @@ export type extendByReversedIndexesOpts = { reversedFirst?: boolean, // false by default }; -export function extendByReversedIndexes( - indexes: ObjectMap[], - opts: extendByReversedIndexesOpts = {} -) { +export function extendByReversedIndexes(indexes: IndexT[], opts: extendByReversedIndexesOpts = {}) { const reversedFirst = opts.reversedFirst === undefined ? false : Boolean(opts.reversedFirst); - const result: ObjectMap[] = []; + const result: IndexT[] = []; indexes.forEach(indexObj => { let hasSpecificIndex = false; diff --git a/yarn.lock b/yarn.lock index ef7d8fff..47367818 100644 --- a/yarn.lock +++ b/yarn.lock @@ -113,15 +113,11 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" -ansi-escapes@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" - ansi-escapes@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b" -ansi-regex@^2.0.0, ansi-regex@^2.1.1: +ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -133,7 +129,7 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.0.0, ansi-styles@^3.1.0: +ansi-styles@^3.1.0, ansi-styles@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" dependencies: @@ -489,13 +485,12 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-jest@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.3.tgz#e4a03b13dc10389e140fc645d09ffc4ced301671" +babel-jest@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-21.0.0.tgz#4f636a7dce105aa5753d5f3dde4422ff50c1d6c5" dependencies: - babel-core "^6.0.0" babel-plugin-istanbul "^4.0.0" - babel-preset-jest "^20.0.3" + babel-preset-jest "^21.0.0" babel-messages@^6.23.0: version "6.23.0" @@ -517,9 +512,9 @@ babel-plugin-istanbul@^4.0.0: istanbul-lib-instrument "^1.7.2" test-exclude "^4.1.1" -babel-plugin-jest-hoist@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" +babel-plugin-jest-hoist@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-21.0.0.tgz#aa2dbab7b0d58fa635640efd53aab730be7b3273" babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" @@ -809,11 +804,11 @@ babel-preset-env@^1.5.2: invariant "^2.2.2" semver "^5.3.0" -babel-preset-jest@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.3.tgz#cbacaadecb5d689ca1e1de1360ebfc66862c178a" +babel-preset-jest@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-21.0.0.tgz#13a8d82e999aa49f8b2dc14d0023d362f2e4ba23" dependencies: - babel-plugin-jest-hoist "^20.0.3" + babel-plugin-jest-hoist "^21.0.0" babel-register@^6.24.1: version "6.24.1" @@ -839,7 +834,7 @@ babel-register@^6.26.0: mkdirp "^0.5.1" source-map-support "^0.4.15" -babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtime@^6.25.0: +babel-runtime@^6.18.0, babel-runtime@^6.22.0: version "6.25.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.25.0.tgz#33b98eaa5d482bb01a8d1aa6b437ad2b01aec41c" dependencies: @@ -1005,12 +1000,6 @@ browserslist@^2.1.2: caniuse-lite "^1.0.30000710" electron-to-chromium "^1.3.17" -bser@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bser/-/bser-1.0.2.tgz#381116970b2a6deea5646dd15dd7278444b56169" - dependencies: - node-int64 "^0.4.0" - bser@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" @@ -1103,7 +1092,7 @@ chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.1.0: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e" dependencies: @@ -1630,15 +1619,15 @@ escodegen@^1.6.1: optionalDependencies: source-map "~0.2.0" -eslint-config-airbnb-base@^11.3.2: - version "11.3.2" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-11.3.2.tgz#8703b11abe3c88ac7ec2b745b7fdf52e00ae680a" +eslint-config-airbnb-base@^12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-12.0.0.tgz#99063aaef4b8698083481a00e165cbe15e82d615" dependencies: eslint-restricted-globals "^0.1.1" -eslint-config-prettier@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.3.0.tgz#b75b1eabea0c8b97b34403647ee25db349b9d8a0" +eslint-config-prettier@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.4.0.tgz#fb7cf29c0ab2ba61af5164fb1930f9bef3be2872" dependencies: get-stdin "^5.0.1" @@ -1656,9 +1645,9 @@ eslint-module-utils@^2.1.1: debug "^2.6.8" pkg-dir "^1.0.0" -eslint-plugin-flowtype@^2.34.0: - version "2.35.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.35.0.tgz#d17494f0ae8b727c632d8b9d4b4a848e7e0c04af" +eslint-plugin-flowtype@^2.35.1: + version "2.35.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.35.1.tgz#9ad98181b467a3645fbd2a8d430393cc17a4ea63" dependencies: lodash "^4.15.0" @@ -1695,9 +1684,9 @@ eslint-scope@^3.7.1: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.5.0.tgz#bb75d3b8bde97fb5e13efcd539744677feb019c3" +eslint@^4.6.1: + version "4.6.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.6.1.tgz#ddc7fc7fd70bf93205b0b3449bb16a1e9e7d4950" dependencies: ajv "^5.2.0" babel-code-frame "^6.22.0" @@ -1807,6 +1796,17 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" +expect@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-21.0.0.tgz#55fbb07e989479863663975ae8e9ec51753c99ca" + dependencies: + ansi-styles "^3.2.0" + jest-diff "^21.0.0" + jest-get-type "^21.0.0" + jest-matcher-utils "^21.0.0" + jest-message-util "^21.0.0" + jest-regex-util "^21.0.0" + extend@3, extend@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" @@ -1841,12 +1841,6 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -fb-watchman@^1.8.0: - version "1.9.2" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-1.9.2.tgz#a24cf47827f82d38fb59a69ad70b76e3b6ae7383" - dependencies: - bser "1.0.2" - fb-watchman@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" @@ -1923,9 +1917,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.53.1: - version "0.53.1" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.53.1.tgz#9b22b63a23c99763ae533ebbab07f88c88c97d84" +flow-bin@^0.54.1: + version "0.54.1" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.54.1.tgz#7101bcccf006dc0652714a8aef0c72078a760510" follow-redirects@0.0.7: version "0.0.7" @@ -1987,7 +1981,7 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.0.0: +fsevents@^1.0.0, fsevents@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.2.tgz#3282b713fb3ad80ede0e9fcf4611b5aa6fc033f4" dependencies: @@ -2209,28 +2203,28 @@ graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4 version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" -graphql-compose-connection@>=2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/graphql-compose-connection/-/graphql-compose-connection-2.2.2.tgz#16bc70feade9a127c672ef96fd7a4974bcd0559a" +graphql-compose-connection@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/graphql-compose-connection/-/graphql-compose-connection-2.3.0.tgz#a3c55dc92f992944ec5a814ae717d112d2b635a0" dependencies: - babel-runtime "^6.23.0" + babel-runtime "^6.26.0" -graphql-compose-pagination@>=1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/graphql-compose-pagination/-/graphql-compose-pagination-1.0.0.tgz#ae880d7ca2f22dc8337ac1b98f1628d17f944d3f" +graphql-compose-pagination@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/graphql-compose-pagination/-/graphql-compose-pagination-1.1.0.tgz#2968919f465e10ebe99c67fdc0d6ad79277c4bc3" dependencies: - babel-runtime "^6.25.0" + babel-runtime "^6.26.0" -graphql-compose@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/graphql-compose/-/graphql-compose-2.3.2.tgz#016243eb3dc5253ea5b5c62f24b7410ed617fdc1" +graphql-compose@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/graphql-compose/-/graphql-compose-2.9.0.tgz#9277d69e6213dbb56983b87ef1b3b3e27f35eb92" dependencies: - babel-runtime "^6.23.0" + babel-runtime "^6.26.0" object-path "^0.11.4" -graphql@0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.10.3.tgz#c313afd5518e673351bee18fb63e2a0e487407ab" +graphql@^0.11.3: + version "0.11.3" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.11.3.tgz#9934e2df28f17d397a85f83cb39d1d179bffef47" dependencies: iterall "^1.1.0" @@ -2652,216 +2646,234 @@ iterall@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.1.1.tgz#f7f0af11e9a04ec6426260f5019d9fcca4d50214" -jest-changed-files@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.3.tgz#9394d5cc65c438406149bef1bf4d52b68e03e3f8" +jest-changed-files@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-21.0.0.tgz#fa7cfc353187e2fb852dd5830e8d09068dde78d1" + dependencies: + throat "^4.0.0" -jest-cli@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.4.tgz#e532b19d88ae5bc6c417e8b0593a6fe954b1dc93" +jest-cli@^21.0.1: + version "21.0.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-21.0.1.tgz#b3e9ef6d0ae0e43870932d2ed3d10de0515e9d34" dependencies: - ansi-escapes "^1.4.0" - callsites "^2.0.0" - chalk "^1.1.3" + ansi-escapes "^2.0.0" + chalk "^2.0.1" + glob "^7.1.2" graceful-fs "^4.1.11" is-ci "^1.0.10" istanbul-api "^1.1.1" istanbul-lib-coverage "^1.0.1" istanbul-lib-instrument "^1.4.2" istanbul-lib-source-maps "^1.1.0" - jest-changed-files "^20.0.3" - jest-config "^20.0.4" - jest-docblock "^20.0.3" - jest-environment-jsdom "^20.0.3" - jest-haste-map "^20.0.4" - jest-jasmine2 "^20.0.4" - jest-message-util "^20.0.3" - jest-regex-util "^20.0.3" - jest-resolve-dependencies "^20.0.3" - jest-runtime "^20.0.4" - jest-snapshot "^20.0.3" - jest-util "^20.0.3" + jest-changed-files "^21.0.0" + jest-config "^21.0.0" + jest-environment-jsdom "^21.0.0" + jest-haste-map "^21.0.0" + jest-message-util "^21.0.0" + jest-regex-util "^21.0.0" + jest-resolve-dependencies "^21.0.0" + jest-runner "^21.0.0" + jest-runtime "^21.0.0" + jest-snapshot "^21.0.0" + jest-util "^21.0.0" micromatch "^2.3.11" node-notifier "^5.0.2" pify "^2.3.0" slash "^1.0.0" string-length "^1.0.1" - throat "^3.0.0" + strip-ansi "^4.0.0" which "^1.2.12" worker-farm "^1.3.1" yargs "^7.0.2" -jest-config@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.4.tgz#e37930ab2217c913605eff13e7bd763ec48faeea" +jest-config@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-21.0.0.tgz#81dcb20d15971f31bf44a82c6fe85b4423d98d95" dependencies: - chalk "^1.1.3" + chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^20.0.3" - jest-environment-node "^20.0.3" - jest-jasmine2 "^20.0.4" - jest-matcher-utils "^20.0.3" - jest-regex-util "^20.0.3" - jest-resolve "^20.0.4" - jest-validate "^20.0.3" - pretty-format "^20.0.3" - -jest-diff@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-20.0.3.tgz#81f288fd9e675f0fb23c75f1c2b19445fe586617" - dependencies: - chalk "^1.1.3" + jest-environment-jsdom "^21.0.0" + jest-environment-node "^21.0.0" + jest-get-type "^21.0.0" + jest-jasmine2 "^21.0.0" + jest-regex-util "^21.0.0" + jest-resolve "^21.0.0" + jest-util "^21.0.0" + jest-validate "^21.0.0" + pretty-format "^21.0.0" + +jest-diff@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-21.0.0.tgz#b996ba2963a783125e6bc59fd5623bce67df7f17" + dependencies: + chalk "^2.0.1" diff "^3.2.0" - jest-matcher-utils "^20.0.3" - pretty-format "^20.0.3" + jest-get-type "^21.0.0" + pretty-format "^21.0.0" -jest-docblock@^20.0.1, jest-docblock@^20.0.3: +jest-docblock@^20.0.1: version "20.0.3" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712" -jest-environment-jsdom@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.3.tgz#048a8ac12ee225f7190417713834bb999787de99" +jest-docblock@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.0.0.tgz#7dd57568543aec98910f749540afc15fab53a27f" + +jest-environment-jsdom@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-21.0.0.tgz#1d53e34b1656254b8c539700e35360d8f8ebb579" dependencies: - jest-mock "^20.0.3" - jest-util "^20.0.3" + jest-mock "^21.0.0" + jest-util "^21.0.0" jsdom "^9.12.0" -jest-environment-node@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-20.0.3.tgz#d488bc4612af2c246e986e8ae7671a099163d403" +jest-environment-node@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-21.0.0.tgz#ffc781b82569f3f4bc2d8fb8f1ea7373cb11f043" dependencies: - jest-mock "^20.0.3" - jest-util "^20.0.3" + jest-mock "^21.0.0" + jest-util "^21.0.0" + +jest-get-type@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-21.0.0.tgz#ed8667533c0a24a4feebbf492661f23abac3620b" -jest-haste-map@^20.0.4: - version "20.0.5" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.5.tgz#abad74efb1a005974a7b6517e11010709cab9112" +jest-haste-map@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-21.0.0.tgz#1f099ff6aedb52ec55fa9773ce26e4bbb00b0580" dependencies: fb-watchman "^2.0.0" graceful-fs "^4.1.11" - jest-docblock "^20.0.3" + jest-docblock "^21.0.0" micromatch "^2.3.11" - sane "~1.6.0" + sane "^2.0.0" worker-farm "^1.3.1" -jest-jasmine2@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.4.tgz#fcc5b1411780d911d042902ef1859e852e60d5e1" +jest-jasmine2@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-21.0.0.tgz#539725989e45ab0b00029fcf37bc679aa39c2941" dependencies: - chalk "^1.1.3" + chalk "^2.0.1" + expect "^21.0.0" graceful-fs "^4.1.11" - jest-diff "^20.0.3" - jest-matcher-utils "^20.0.3" - jest-matchers "^20.0.3" - jest-message-util "^20.0.3" - jest-snapshot "^20.0.3" - once "^1.4.0" - p-map "^1.1.1" + jest-diff "^21.0.0" + jest-matcher-utils "^21.0.0" + jest-message-util "^21.0.0" + jest-snapshot "^21.0.0" + p-cancelable "^0.3.0" -jest-matcher-utils@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.3.tgz#b3a6b8e37ca577803b0832a98b164f44b7815612" +jest-matcher-utils@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-21.0.0.tgz#493dc25b9ed6a23a61802ca20656f0f1c16f15b1" dependencies: - chalk "^1.1.3" - pretty-format "^20.0.3" - -jest-matchers@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-20.0.3.tgz#ca69db1c32db5a6f707fa5e0401abb55700dfd60" - dependencies: - jest-diff "^20.0.3" - jest-matcher-utils "^20.0.3" - jest-message-util "^20.0.3" - jest-regex-util "^20.0.3" + chalk "^2.0.1" + jest-get-type "^21.0.0" + pretty-format "^21.0.0" -jest-message-util@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-20.0.3.tgz#6aec2844306fcb0e6e74d5796c1006d96fdd831c" +jest-message-util@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-21.0.0.tgz#cd49c2e91d7a227e622884c418185a1a7cbe1fd6" dependencies: - chalk "^1.1.3" + chalk "^2.0.1" micromatch "^2.3.11" slash "^1.0.0" -jest-mock@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-20.0.3.tgz#8bc070e90414aa155c11a8d64c869a0d5c71da59" +jest-mock@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-21.0.0.tgz#948fdbb44ef702ca998e078ca62b4968780e102e" -jest-regex-util@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-20.0.3.tgz#85bbab5d133e44625b19faf8c6aa5122d085d762" +jest-regex-util@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-21.0.0.tgz#f13c382a1c55515c20471390ab38e5d71cbd320e" -jest-resolve-dependencies@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.3.tgz#6e14a7b717af0f2cb3667c549de40af017b1723a" +jest-resolve-dependencies@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-21.0.0.tgz#09dfd9654a8af92880a2f66076871d48810bd48d" dependencies: - jest-regex-util "^20.0.3" + jest-regex-util "^21.0.0" -jest-resolve@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.4.tgz#9448b3e8b6bafc15479444c6499045b7ffe597a5" +jest-resolve@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-21.0.0.tgz#04d3939203633cc57ae8219b34ad42687dd8d111" dependencies: browser-resolve "^1.11.2" + chalk "^2.0.1" is-builtin-module "^1.0.0" - resolve "^1.3.2" -jest-runtime@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.4.tgz#a2c802219c4203f754df1404e490186169d124d8" +jest-runner@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-21.0.0.tgz#8969dd22ff73911c84043cf16b6cfadf609f3d1f" + dependencies: + jest-config "^21.0.0" + jest-docblock "^21.0.0" + jest-haste-map "^21.0.0" + jest-jasmine2 "^21.0.0" + jest-message-util "^21.0.0" + jest-runtime "^21.0.0" + jest-util "^21.0.0" + pify "^2.3.0" + throat "^3.0.0" + worker-farm "^1.3.1" + +jest-runtime@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-21.0.0.tgz#54af290dc664a49ddc251c7d7ce1a5661afc1ead" dependencies: babel-core "^6.0.0" - babel-jest "^20.0.3" + babel-jest "^21.0.0" babel-plugin-istanbul "^4.0.0" - chalk "^1.1.3" + chalk "^2.0.1" convert-source-map "^1.4.0" graceful-fs "^4.1.11" - jest-config "^20.0.4" - jest-haste-map "^20.0.4" - jest-regex-util "^20.0.3" - jest-resolve "^20.0.4" - jest-util "^20.0.3" + jest-config "^21.0.0" + jest-haste-map "^21.0.0" + jest-regex-util "^21.0.0" + jest-resolve "^21.0.0" + jest-util "^21.0.0" json-stable-stringify "^1.0.1" micromatch "^2.3.11" + slash "^1.0.0" strip-bom "3.0.0" + write-file-atomic "^2.1.0" yargs "^7.0.2" -jest-snapshot@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-20.0.3.tgz#5b847e1adb1a4d90852a7f9f125086e187c76566" +jest-snapshot@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-21.0.0.tgz#00b582b13ef42112bd431b498e37f7829b30cd66" dependencies: - chalk "^1.1.3" - jest-diff "^20.0.3" - jest-matcher-utils "^20.0.3" - jest-util "^20.0.3" + chalk "^2.0.1" + jest-diff "^21.0.0" + jest-matcher-utils "^21.0.0" + mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^20.0.3" + pretty-format "^21.0.0" -jest-util@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-20.0.3.tgz#0c07f7d80d82f4e5a67c6f8b9c3fe7f65cfd32ad" +jest-util@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-21.0.0.tgz#62b3a3ec3ff91022ef7e1ffbcf3293424715919f" dependencies: - chalk "^1.1.3" + callsites "^2.0.0" + chalk "^2.0.1" graceful-fs "^4.1.11" - jest-message-util "^20.0.3" - jest-mock "^20.0.3" - jest-validate "^20.0.3" - leven "^2.1.0" + jest-message-util "^21.0.0" + jest-mock "^21.0.0" + jest-validate "^21.0.0" mkdirp "^0.5.1" -jest-validate@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.3.tgz#d0cfd1de4f579f298484925c280f8f1d94ec3cab" +jest-validate@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-21.0.0.tgz#f906d54eca2a485ffbfb2d8a7d58831c026e6dd5" dependencies: - chalk "^1.1.3" - jest-matcher-utils "^20.0.3" + chalk "^2.0.1" + jest-get-type "^21.0.0" leven "^2.1.0" - pretty-format "^20.0.3" + pretty-format "^21.0.0" -jest@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.4.tgz#3dd260c2989d6dad678b1e9cc4d91944f6d602ac" +jest@^21.0.1: + version "21.0.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-21.0.1.tgz#746cddc89477beaea5b208e7017ca26652bfdb38" dependencies: - jest-cli "^20.0.4" + jest-cli "^21.0.1" js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" @@ -3311,9 +3323,9 @@ mongodb@2.2.31: mongodb-core "2.1.15" readable-stream "2.2.7" -mongoose@^4.11.9: - version "4.11.9" - resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-4.11.9.tgz#58f89a72e75674d9bcdfa4e65ebe1b49b4477637" +mongoose@^4.11.10: + version "4.11.10" + resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-4.11.10.tgz#f68b131df09893b9f0073f46d5dcab0116789f56" dependencies: async "2.1.4" bson "~1.0.4" @@ -3586,6 +3598,10 @@ output-file-sync@^1.1.2: mkdirp "^0.5.1" object-assign "^4.1.0" +p-cancelable@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" + p-limit@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" @@ -3596,10 +3612,6 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" -p-map@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" - pad-right@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/pad-right/-/pad-right-0.2.2.tgz#6fbc924045d244f2a2a244503060d3bfc6009774" @@ -3718,16 +3730,16 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@^1.4.4: - version "1.5.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.5.3.tgz#59dadc683345ec6b88f88b94ed4ae7e1da394bfe" +prettier@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.6.1.tgz#850f411a3116226193e32ea5acfc21c0f9a76d7d" -pretty-format@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.3.tgz#020e350a560a1fe1a98dc3beb6ccffb386de8b14" +pretty-format@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-21.0.0.tgz#bea1522c4c47e49b44db5b6fbf83e7737251f305" dependencies: - ansi-regex "^2.1.1" - ansi-styles "^3.0.0" + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" private@^0.1.6, private@^0.1.7: version "0.1.7" @@ -4039,7 +4051,7 @@ resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.2.0, resolve@^1.3.2: +resolve@^1.2.0: version "1.4.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" dependencies: @@ -4102,17 +4114,19 @@ safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" -sane@~1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-1.6.0.tgz#9610c452307a135d29c1fdfe2547034180c46775" +sane@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-2.0.0.tgz#99cb79f21f4a53a69d4d0cd957c2db04024b8eb2" dependencies: anymatch "^1.3.0" exec-sh "^0.2.0" - fb-watchman "^1.8.0" + fb-watchman "^2.0.0" minimatch "^3.0.2" minimist "^1.1.1" walker "~1.0.5" watch "~0.10.0" + optionalDependencies: + fsevents "^1.1.1" sax@^1.2.1: version "1.2.4" @@ -4459,6 +4473,10 @@ throat@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/throat/-/throat-3.2.0.tgz#50cb0670edbc40237b9e347d7e1f88e4620af836" +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + through2@^2.0.0, through2@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" @@ -4719,6 +4737,14 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +write-file-atomic@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757"