├── .babelrc ├── .editorconfig ├── .env.sample ├── .flowconfig ├── .gitignore ├── .travis.yml ├── README.md ├── docker-compose.yml ├── flow-typed └── npm │ ├── babel-core_vx.x.x.js │ ├── babel-jest_vx.x.x.js │ ├── babel-plugin-syntax-flow_vx.x.x.js │ ├── babel-plugin-transform-flow-strip-types_vx.x.x.js │ ├── babel-polyfill_vx.x.x.js │ ├── babel-preset-env_vx.x.x.js │ ├── babel-register_vx.x.x.js │ ├── bcrypt_v1.x.x.js │ ├── dotenv_vx.x.x.js │ ├── fancy-log_vx.x.x.js │ ├── flow-bin_v0.x.x.js │ ├── glob_vx.x.x.js │ ├── graphql-relay_vx.x.x.js │ ├── husky_vx.x.x.js │ ├── jest_v20.x.x.js │ ├── jsonwebtoken_vx.x.x.js │ ├── kcors_vx.x.x.js │ ├── knex_vx.x.x.js │ ├── koa-bodyparser_vx.x.x.js │ ├── koa-convert_vx.x.x.js │ ├── koa-graphql_vx.x.x.js │ ├── koa-jwt_vx.x.x.js │ ├── koa-logger_vx.x.x.js │ ├── koa-passport_vx.x.x.js │ ├── koa-router_vx.x.x.js │ ├── koa_v2.x.x.js │ ├── lint-staged_vx.x.x.js │ ├── nodemon_vx.x.x.js │ ├── passport-local_vx.x.x.js │ ├── pg_v6.x.x.js │ ├── prettier_vx.x.x.js │ ├── ramda_v0.x.x.js │ ├── sqlite3_vx.x.x.js │ ├── supertest_vx.x.x.js │ └── uuid_v3.x.x.js ├── keyrings └── live │ ├── blackbox-admins.txt │ └── blackbox-files.txt ├── knexfile.js ├── migrations └── 20170523215418_users.js ├── package.json ├── scripts └── postgres-initdb.sh ├── seeds └── users.js ├── sqlite3 └── README.md ├── src ├── DataLoader.js ├── db.js ├── index.js ├── middleware │ └── validate-user.js ├── models │ ├── User.js │ └── __tests__ │ │ └── User.test.js ├── modules │ ├── auth │ │ ├── controller.js │ │ └── router.js │ ├── graphql │ │ ├── controller.js │ │ └── router.js │ └── index.js ├── passport.js ├── schema.js ├── server.js └── types │ ├── Node.js │ └── UserType.js ├── tests ├── authenticate.test.js ├── graphql.test.js └── utils.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "syntax-flow", 4 | "transform-flow-strip-types" 5 | ], 6 | "presets": [ 7 | [ 8 | "env", 9 | { 10 | targets: { 11 | node: true 12 | } 13 | } 14 | ] 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /.env.sample: -------------------------------------------------------------------------------- 1 | PORT=5000 2 | 3 | APP_SECRET=always_bet_on_javascript 4 | 5 | DB_HOSTNAME=localhost 6 | DB_NAME= 7 | DB_USERNAME=postgres 8 | DB_PASSWORD= 9 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | /node_modules/express-graphql 3 | /node_modules/koa-graphql 4 | /coverage 5 | 6 | [include] 7 | 8 | [libs] 9 | 10 | [options] 11 | emoji=true 12 | esproposal.class_static_fields=enable 13 | esproposal.class_instance_fields=enable 14 | suppress_comment=.*\\$FlowFixMe 15 | suppress_comment=.*\\$FlowIgnoreNextLine 16 | unsafe.enable_getters_and_setters=true 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/node,sublimetext,webstorm 3 | 4 | ### Node ### 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | .node-xmlhttprequest* 10 | 11 | # dotenv 12 | .env 13 | 14 | # Runtime data 15 | pids 16 | *.pid 17 | *.seed 18 | *.pid.lock 19 | 20 | # Directory for instrumented libs generated by jscoverage/JSCover 21 | lib-cov 22 | 23 | # Coverage directory used by tools like istanbul 24 | coverage 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # node-waf configuration 33 | .lock-wscript 34 | 35 | # Compiled binary addons (http://nodejs.org/api/addons.html) 36 | build/Release 37 | 38 | # Dependency directories 39 | node_modules 40 | jspm_packages 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | 52 | ### SublimeText ### 53 | # cache files for sublime text 54 | *.tmlanguage.cache 55 | *.tmPreferences.cache 56 | *.stTheme.cache 57 | 58 | # workspace files are user-specific 59 | *.sublime-workspace 60 | 61 | # project files should be checked into the repository, unless a significant 62 | # proportion of contributors will probably not be using SublimeText 63 | # *.sublime-project 64 | 65 | # sftp configuration file 66 | sftp-config.json 67 | 68 | # Package control specific files 69 | Package Control.last-run 70 | Package Control.ca-list 71 | Package Control.ca-bundle 72 | Package Control.system-ca-bundle 73 | Package Control.cache/ 74 | Package Control.ca-certs/ 75 | bh_unicode_properties.cache 76 | 77 | # Sublime-github package stores a github token in this file 78 | # https://packagecontrol.io/packages/sublime-github 79 | GitHub.sublime-settings 80 | 81 | 82 | ### WebStorm ### 83 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 84 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 85 | 86 | # User-specific stuff: 87 | .idea/workspace.xml 88 | .idea/tasks.xml 89 | .idea/dictionaries 90 | .idea/vcs.xml 91 | .idea/jsLibraryMappings.xml 92 | 93 | # Sensitive or high-churn files: 94 | .idea/dataSources.ids 95 | .idea/dataSources.xml 96 | .idea/dataSources.local.xml 97 | .idea/sqlDataSources.xml 98 | .idea/dynamic.xml 99 | .idea/uiDesigner.xml 100 | 101 | # Gradle: 102 | .idea/gradle.xml 103 | .idea/libraries 104 | 105 | # Mongo Explorer plugin: 106 | .idea/mongoSettings.xml 107 | 108 | ## File-based project format: 109 | *.iws 110 | 111 | ## Plugin-specific files: 112 | 113 | # IntelliJ 114 | /out/ 115 | 116 | # mpeltonen/sbt-idea plugin 117 | .idea_modules/ 118 | 119 | # JIRA plugin 120 | atlassian-ide-plugin.xml 121 | 122 | # Crashlytics plugin (for Android Studio and IntelliJ) 123 | com_crashlytics_export_strings.xml 124 | crashlytics.properties 125 | crashlytics-build.properties 126 | fabric.properties 127 | 128 | ### WebStorm Patch ### 129 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 130 | 131 | # *.iml 132 | # modules.xml 133 | # .idea/misc.xml 134 | # *.ipr 135 | 136 | ### CanChain Extras ### 137 | docs 138 | 139 | /build 140 | .ebignore 141 | /keyrings/live/pubring.gpg~ 142 | /keyrings/live/pubring.kbx~ 143 | /keyrings/live/secring.gpg 144 | 145 | ### SQLite3 ### 146 | /sqlite3 147 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '8.1' 4 | services: 5 | - postgresql 6 | addons: 7 | postgresql: "9.4" 8 | apt: 9 | sources: 10 | - ubuntu-toolchain-r-test 11 | packages: 12 | - gcc-4.8 13 | - g++-4.8 14 | env: 15 | - CXX=g++-4.8 16 | install: 17 | - yarn global add codecov 18 | - yarn 19 | before_script: 20 | - psql -c 'create database test;' -U postgres 21 | - cp .env.sample .env 22 | script: 23 | - yarn test:coverage 24 | - codecov 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![K2](https://gist.githubusercontent.com/hongymagic/44b775944afd136e2cafbde8868b7df2/raw/3edeb106a828b538808ecb7252112a5fedf62da9/logo.png) 2 | 3 | # K2 4 | 5 | [![Build Status](https://travis-ci.org/hongymagic/k2.svg?branch=master)](https://travis-ci.org/hongymagic/k2) [![codecov](https://codecov.io/gh/hongymagic/k2/branch/master/graph/badge.svg)](https://codecov.io/gh/hongymagic/k2) ![Package dependencies](https://david-dm.org/hongymagic/k2.svg) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/b01ca9655eb54672910339f7f653ad93)](https://www.codacy.com/app/hongymagic-github/k2?utm_source=github.com&utm_medium=referral&utm_content=hongymagic/k2&utm_campaign=Badge_Grade) 6 | 7 | Koa 2 and GraphQL server that _just works™_. We've climbed the mountain of 8 | boilerplate for you, so you don't have to. 9 | 10 | ## Included… 11 | 12 | - [koa2](http://koajs.com) - write stuff in middleware 13 | - [babel](http://babeljs.io) - use latest ES6/7 features today. why wait? 14 | - [passport.js](http://passportjs.org) - easy authentication 15 | - [knex.js](http://knexjs.org) - documentation is better than sequelize 16 | - [GraphQL](http://graphql.org) - it's the way to go 17 | - [Jest](https://facebook.github.io/jest/) - don't let tests get in your way 18 | - [ramda](http://ramdajs.com) - please don't use lodash or underscore 19 | - [prettier](https://prettier.github.io/prettier/) - don't worry about formatting… 20 | - [flowtype](https://flow.org) - get your types right 21 | 22 | ## Getting started 23 | 24 | Make sure you have Docker installed as PostgreSQL is run on the docker 25 | container. 26 | 27 | ``` 28 | git clone -o k2 -b master --single-branch https://github.com/hongymagic/k2.git example-api 29 | 30 | cd example-api # Change current directory to the newly created one 31 | yarn install # Install required packages via yarn 32 | cp .env.sample .env # Configuration on development mode is done via dotenv 33 | yarn migrate:latest # Run database migrations 34 | yarn seed:run # Add some seed data 35 | yarn start:dev # Start the server in development mode 36 | ``` 37 | 38 | By default the API server starts on port 5000, http://localhost:5000. 39 | 40 | ## Structure 41 | 42 | ``` 43 | ┌── .env.sample # Sample .env file loaded into process.env 44 | ├── docker-compose.yml # Auxiliary services such as postgresql via docker 45 | ├── knexfile.js # Configuration for knex.js 46 | ├── migrations/ # Database migrations. See below for more info 47 | ├── seeds/ # Database seeds. See below for more info 48 | ├── tests/ # Integration tests using supertest 49 | ├── sqlite3/ # SQLite3 database location 50 | └── src/ 51 |    ├── db.js # DB instance used by the app and/or models 52 |    ├── models/ # ORM models written in ES6 classes 53 |    ├── middleware/ # Custom middleware to be used by modules 54 |    ├── modules/ # Route-Controller pair for koa2 55 |    │   ├── auth/ # Sample /authenticate module 56 |    │   ├── graphql/ # GraphQL 57 |    │   └── index.js # Don't touch this 58 |    ├── passport.js # Passport.js configuration using passport-local 59 |    ├── DataLoader.js # Data fetching layer for GraphQL 60 |    ├── schema.js # GraphQL schema 61 |    └── types/ # GraphQL types 62 | ``` 63 | 64 | ## Testing 65 | 66 | K2 uses [Facebook Jest](https://facebook.github.io/jest/) so you can add a 67 | directory named `__tests__` at any level and start writing tests. 68 | 69 | Root level `tests` directory is reserved for integration tests using supertest. 70 | Currently requires you to run the database server via docker-compose: see above. 71 | 72 | ``` 73 | yarn test # Run all tests including unit and integration tests 74 | yarn test:unit # Only run unit tests inside src/ directory 75 | yarn test:integration # Only run integration tests inside tests/ directory 76 | yarn test:coverage # Generate coverage report. Also travis default 77 | ``` 78 | 79 | ## Deployments 80 | 81 | This is a standard Node.js version 8.0+ application. You can deploy it to 82 | anywhere you like including, but not limited to: 83 | 84 | - [now.sh](https://zeit.co/now) 85 | - [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/) 86 | - Pretty much anything that runs docker or Node.js 87 | 88 | ### Now.sh 89 | 90 | Deploying to now is super simple if you're using SQLite3 (default). Just run: 91 | 92 | ``` 93 | now 94 | ``` 95 | 96 | ### AWS ElasticBeanstalk 97 | 98 | Simply create a version of AWS EB with Node version 8.0.1 and deploy. I 99 | personally have travis CI deploy it via a `eb` script. 100 | 101 | - TODO: Sample `.ebextensions/` 102 | - Database is already configured to prefer `RDS_{HOSTNAME,DB_NAME,USERNAME,PASSWORD}` connection information 103 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | # SQL and document data store 5 | db: 6 | image: postgres:9.6.2-alpine 7 | volumes: 8 | - ./scripts/postgres-initdb.sh:/docker-entrypoint-initdb.d/initdb.sh 9 | ports: 10 | - "5432:5432" 11 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-core_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: c4194d38cc4a42c90ff5de803ee1c218 2 | // flow-typed version: <>/babel-core_v^6.25.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-core' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-core' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-core/lib/api/browser' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-core/lib/api/node' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-core/lib/helpers/get-possible-plugin-names' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'babel-core/lib/helpers/get-possible-preset-names' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'babel-core/lib/helpers/merge' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'babel-core/lib/helpers/normalize-ast' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'babel-core/lib/helpers/resolve-from-possible-names' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'babel-core/lib/helpers/resolve-plugin' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'babel-core/lib/helpers/resolve-preset' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'babel-core/lib/helpers/resolve' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'babel-core/lib/store' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'babel-core/lib/tools/build-external-helpers' { 70 | declare module.exports: any; 71 | } 72 | 73 | declare module 'babel-core/lib/transformation/file/index' { 74 | declare module.exports: any; 75 | } 76 | 77 | declare module 'babel-core/lib/transformation/file/logger' { 78 | declare module.exports: any; 79 | } 80 | 81 | declare module 'babel-core/lib/transformation/file/metadata' { 82 | declare module.exports: any; 83 | } 84 | 85 | declare module 'babel-core/lib/transformation/file/options/build-config-chain' { 86 | declare module.exports: any; 87 | } 88 | 89 | declare module 'babel-core/lib/transformation/file/options/config' { 90 | declare module.exports: any; 91 | } 92 | 93 | declare module 'babel-core/lib/transformation/file/options/index' { 94 | declare module.exports: any; 95 | } 96 | 97 | declare module 'babel-core/lib/transformation/file/options/option-manager' { 98 | declare module.exports: any; 99 | } 100 | 101 | declare module 'babel-core/lib/transformation/file/options/parsers' { 102 | declare module.exports: any; 103 | } 104 | 105 | declare module 'babel-core/lib/transformation/file/options/removed' { 106 | declare module.exports: any; 107 | } 108 | 109 | declare module 'babel-core/lib/transformation/internal-plugins/block-hoist' { 110 | declare module.exports: any; 111 | } 112 | 113 | declare module 'babel-core/lib/transformation/internal-plugins/shadow-functions' { 114 | declare module.exports: any; 115 | } 116 | 117 | declare module 'babel-core/lib/transformation/pipeline' { 118 | declare module.exports: any; 119 | } 120 | 121 | declare module 'babel-core/lib/transformation/plugin-pass' { 122 | declare module.exports: any; 123 | } 124 | 125 | declare module 'babel-core/lib/transformation/plugin' { 126 | declare module.exports: any; 127 | } 128 | 129 | declare module 'babel-core/lib/util' { 130 | declare module.exports: any; 131 | } 132 | 133 | declare module 'babel-core/register' { 134 | declare module.exports: any; 135 | } 136 | 137 | // Filename aliases 138 | declare module 'babel-core/index' { 139 | declare module.exports: $Exports<'babel-core'>; 140 | } 141 | declare module 'babel-core/index.js' { 142 | declare module.exports: $Exports<'babel-core'>; 143 | } 144 | declare module 'babel-core/lib/api/browser.js' { 145 | declare module.exports: $Exports<'babel-core/lib/api/browser'>; 146 | } 147 | declare module 'babel-core/lib/api/node.js' { 148 | declare module.exports: $Exports<'babel-core/lib/api/node'>; 149 | } 150 | declare module 'babel-core/lib/helpers/get-possible-plugin-names.js' { 151 | declare module.exports: $Exports<'babel-core/lib/helpers/get-possible-plugin-names'>; 152 | } 153 | declare module 'babel-core/lib/helpers/get-possible-preset-names.js' { 154 | declare module.exports: $Exports<'babel-core/lib/helpers/get-possible-preset-names'>; 155 | } 156 | declare module 'babel-core/lib/helpers/merge.js' { 157 | declare module.exports: $Exports<'babel-core/lib/helpers/merge'>; 158 | } 159 | declare module 'babel-core/lib/helpers/normalize-ast.js' { 160 | declare module.exports: $Exports<'babel-core/lib/helpers/normalize-ast'>; 161 | } 162 | declare module 'babel-core/lib/helpers/resolve-from-possible-names.js' { 163 | declare module.exports: $Exports<'babel-core/lib/helpers/resolve-from-possible-names'>; 164 | } 165 | declare module 'babel-core/lib/helpers/resolve-plugin.js' { 166 | declare module.exports: $Exports<'babel-core/lib/helpers/resolve-plugin'>; 167 | } 168 | declare module 'babel-core/lib/helpers/resolve-preset.js' { 169 | declare module.exports: $Exports<'babel-core/lib/helpers/resolve-preset'>; 170 | } 171 | declare module 'babel-core/lib/helpers/resolve.js' { 172 | declare module.exports: $Exports<'babel-core/lib/helpers/resolve'>; 173 | } 174 | declare module 'babel-core/lib/store.js' { 175 | declare module.exports: $Exports<'babel-core/lib/store'>; 176 | } 177 | declare module 'babel-core/lib/tools/build-external-helpers.js' { 178 | declare module.exports: $Exports<'babel-core/lib/tools/build-external-helpers'>; 179 | } 180 | declare module 'babel-core/lib/transformation/file/index.js' { 181 | declare module.exports: $Exports<'babel-core/lib/transformation/file/index'>; 182 | } 183 | declare module 'babel-core/lib/transformation/file/logger.js' { 184 | declare module.exports: $Exports<'babel-core/lib/transformation/file/logger'>; 185 | } 186 | declare module 'babel-core/lib/transformation/file/metadata.js' { 187 | declare module.exports: $Exports<'babel-core/lib/transformation/file/metadata'>; 188 | } 189 | declare module 'babel-core/lib/transformation/file/options/build-config-chain.js' { 190 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/build-config-chain'>; 191 | } 192 | declare module 'babel-core/lib/transformation/file/options/config.js' { 193 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/config'>; 194 | } 195 | declare module 'babel-core/lib/transformation/file/options/index.js' { 196 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/index'>; 197 | } 198 | declare module 'babel-core/lib/transformation/file/options/option-manager.js' { 199 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/option-manager'>; 200 | } 201 | declare module 'babel-core/lib/transformation/file/options/parsers.js' { 202 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/parsers'>; 203 | } 204 | declare module 'babel-core/lib/transformation/file/options/removed.js' { 205 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/removed'>; 206 | } 207 | declare module 'babel-core/lib/transformation/internal-plugins/block-hoist.js' { 208 | declare module.exports: $Exports<'babel-core/lib/transformation/internal-plugins/block-hoist'>; 209 | } 210 | declare module 'babel-core/lib/transformation/internal-plugins/shadow-functions.js' { 211 | declare module.exports: $Exports<'babel-core/lib/transformation/internal-plugins/shadow-functions'>; 212 | } 213 | declare module 'babel-core/lib/transformation/pipeline.js' { 214 | declare module.exports: $Exports<'babel-core/lib/transformation/pipeline'>; 215 | } 216 | declare module 'babel-core/lib/transformation/plugin-pass.js' { 217 | declare module.exports: $Exports<'babel-core/lib/transformation/plugin-pass'>; 218 | } 219 | declare module 'babel-core/lib/transformation/plugin.js' { 220 | declare module.exports: $Exports<'babel-core/lib/transformation/plugin'>; 221 | } 222 | declare module 'babel-core/lib/util.js' { 223 | declare module.exports: $Exports<'babel-core/lib/util'>; 224 | } 225 | declare module 'babel-core/register.js' { 226 | declare module.exports: $Exports<'babel-core/register'>; 227 | } 228 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-jest_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 12d8b7453c77e6a653f60f79d24b2443 2 | // flow-typed version: <>/babel-jest_v^20.0.3/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-jest' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-jest' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-jest/build/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-jest/build/index.js' { 31 | declare module.exports: $Exports<'babel-jest/build/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-plugin-syntax-flow_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 0a75e0818343ba451331c3aaf9ab754d 2 | // flow-typed version: <>/babel-plugin-syntax-flow_v^6.18.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-plugin-syntax-flow' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-plugin-syntax-flow' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-plugin-syntax-flow/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-plugin-syntax-flow/lib/index.js' { 31 | declare module.exports: $Exports<'babel-plugin-syntax-flow/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-plugin-transform-flow-strip-types_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 05c9b6d874189e6a815f12a19a72e2fe 2 | // flow-typed version: <>/babel-plugin-transform-flow-strip-types_v^6.22.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-plugin-transform-flow-strip-types' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-plugin-transform-flow-strip-types' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-plugin-transform-flow-strip-types/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-plugin-transform-flow-strip-types/lib/index.js' { 31 | declare module.exports: $Exports<'babel-plugin-transform-flow-strip-types/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-polyfill_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: fc01b7422d34ca4cab6b4968df825caa 2 | // flow-typed version: <>/babel-polyfill_v^6.23.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-polyfill' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-polyfill' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-polyfill/browser' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-polyfill/dist/polyfill' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-polyfill/dist/polyfill.min' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'babel-polyfill/lib/index' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'babel-polyfill/scripts/postpublish' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'babel-polyfill/scripts/prepublish' { 46 | declare module.exports: any; 47 | } 48 | 49 | // Filename aliases 50 | declare module 'babel-polyfill/browser.js' { 51 | declare module.exports: $Exports<'babel-polyfill/browser'>; 52 | } 53 | declare module 'babel-polyfill/dist/polyfill.js' { 54 | declare module.exports: $Exports<'babel-polyfill/dist/polyfill'>; 55 | } 56 | declare module 'babel-polyfill/dist/polyfill.min.js' { 57 | declare module.exports: $Exports<'babel-polyfill/dist/polyfill.min'>; 58 | } 59 | declare module 'babel-polyfill/lib/index.js' { 60 | declare module.exports: $Exports<'babel-polyfill/lib/index'>; 61 | } 62 | declare module 'babel-polyfill/scripts/postpublish.js' { 63 | declare module.exports: $Exports<'babel-polyfill/scripts/postpublish'>; 64 | } 65 | declare module 'babel-polyfill/scripts/prepublish.js' { 66 | declare module.exports: $Exports<'babel-polyfill/scripts/prepublish'>; 67 | } 68 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-preset-env_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 4c1af56df4d19a909cc956e9f351162e 2 | // flow-typed version: <>/babel-preset-env_v^1.5.2/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-preset-env' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-preset-env' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-preset-env/data/built-in-features' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-preset-env/data/plugin-features' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-preset-env/lib/default-includes' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'babel-preset-env/lib/index' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'babel-preset-env/lib/module-transformations' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'babel-preset-env/lib/normalize-options' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'babel-preset-env/lib/targets-parser' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'babel-preset-env/lib/transform-polyfill-require-plugin' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'babel-preset-env/lib/utils' { 58 | declare module.exports: any; 59 | } 60 | 61 | // Filename aliases 62 | declare module 'babel-preset-env/data/built-in-features.js' { 63 | declare module.exports: $Exports<'babel-preset-env/data/built-in-features'>; 64 | } 65 | declare module 'babel-preset-env/data/plugin-features.js' { 66 | declare module.exports: $Exports<'babel-preset-env/data/plugin-features'>; 67 | } 68 | declare module 'babel-preset-env/lib/default-includes.js' { 69 | declare module.exports: $Exports<'babel-preset-env/lib/default-includes'>; 70 | } 71 | declare module 'babel-preset-env/lib/index.js' { 72 | declare module.exports: $Exports<'babel-preset-env/lib/index'>; 73 | } 74 | declare module 'babel-preset-env/lib/module-transformations.js' { 75 | declare module.exports: $Exports<'babel-preset-env/lib/module-transformations'>; 76 | } 77 | declare module 'babel-preset-env/lib/normalize-options.js' { 78 | declare module.exports: $Exports<'babel-preset-env/lib/normalize-options'>; 79 | } 80 | declare module 'babel-preset-env/lib/targets-parser.js' { 81 | declare module.exports: $Exports<'babel-preset-env/lib/targets-parser'>; 82 | } 83 | declare module 'babel-preset-env/lib/transform-polyfill-require-plugin.js' { 84 | declare module.exports: $Exports<'babel-preset-env/lib/transform-polyfill-require-plugin'>; 85 | } 86 | declare module 'babel-preset-env/lib/utils.js' { 87 | declare module.exports: $Exports<'babel-preset-env/lib/utils'>; 88 | } 89 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-register_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 2343b1bba59f3e3e72af26c2345b8508 2 | // flow-typed version: <>/babel-register_v^6.24.1/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-register' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-register' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-register/lib/browser' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-register/lib/cache' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-register/lib/node' { 34 | declare module.exports: any; 35 | } 36 | 37 | // Filename aliases 38 | declare module 'babel-register/lib/browser.js' { 39 | declare module.exports: $Exports<'babel-register/lib/browser'>; 40 | } 41 | declare module 'babel-register/lib/cache.js' { 42 | declare module.exports: $Exports<'babel-register/lib/cache'>; 43 | } 44 | declare module 'babel-register/lib/node.js' { 45 | declare module.exports: $Exports<'babel-register/lib/node'>; 46 | } 47 | -------------------------------------------------------------------------------- /flow-typed/npm/bcrypt_v1.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: de994876c9a9c710a0d5f03841d1747d 2 | // flow-typed version: f3b8b37d70/bcrypt_v1.x.x/flow_>=v0.29.x 3 | 4 | declare module bcrypt { 5 | declare function genSaltSync(rounds?: number): string; 6 | declare function genSalt(rounds: number): Promise; 7 | declare function genSalt(): Promise; 8 | declare function genSalt(callback: (err: Error, salt:string) => void): void; 9 | declare function genSalt(rounds: number, callback: (err: Error, salt: string) => void): void; 10 | declare function hashSync(data: string, salt: string): string; 11 | declare function hashSync(data: string, rounds: number): string; 12 | declare function hash(data: string, saltOrRounds: string|number): Promise; 13 | declare function hash(data: string, rounds: number, callback: (err: Error, encrypted: string) => void): void; 14 | declare function hash(data: string, salt: string, callback: (err: Error, encrypted: string) => void): void; 15 | declare function compareSync(data: string, encrypted: string): boolean; 16 | declare function compare(data: string, encrypted: string): Promise; 17 | declare function compare(data: string, encrypted: string, callback: (err: Error, same: boolean) => void): void; 18 | declare function getRounds(encrypted: string): number; 19 | } 20 | -------------------------------------------------------------------------------- /flow-typed/npm/dotenv_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 8ec0a37a174cf8dc761a62448af4d1c8 2 | // flow-typed version: <>/dotenv_v^4.0.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'dotenv' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'dotenv' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'dotenv/config' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'dotenv/lib/main' { 30 | declare module.exports: any; 31 | } 32 | 33 | // Filename aliases 34 | declare module 'dotenv/config.js' { 35 | declare module.exports: $Exports<'dotenv/config'>; 36 | } 37 | declare module 'dotenv/lib/main.js' { 38 | declare module.exports: $Exports<'dotenv/lib/main'>; 39 | } 40 | -------------------------------------------------------------------------------- /flow-typed/npm/fancy-log_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: cdbf9e9aed32833ec3fa132916119268 2 | // flow-typed version: <>/fancy-log_v^1.3.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'fancy-log' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'fancy-log' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'fancy-log/index' { 29 | declare module.exports: $Exports<'fancy-log'>; 30 | } 31 | declare module 'fancy-log/index.js' { 32 | declare module.exports: $Exports<'fancy-log'>; 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/flow-bin_v0.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 6a5610678d4b01e13bbfbbc62bdaf583 2 | // flow-typed version: 3817bc6980/flow-bin_v0.x.x/flow_>=v0.25.x 3 | 4 | declare module "flow-bin" { 5 | declare module.exports: string; 6 | } 7 | -------------------------------------------------------------------------------- /flow-typed/npm/glob_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 733cb570da2a25baf24c75dfce4c2b39 2 | // flow-typed version: <>/glob_v^7.1.2/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'glob' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'glob' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'glob/common' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'glob/glob' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'glob/sync' { 34 | declare module.exports: any; 35 | } 36 | 37 | // Filename aliases 38 | declare module 'glob/common.js' { 39 | declare module.exports: $Exports<'glob/common'>; 40 | } 41 | declare module 'glob/glob.js' { 42 | declare module.exports: $Exports<'glob/glob'>; 43 | } 44 | declare module 'glob/sync.js' { 45 | declare module.exports: $Exports<'glob/sync'>; 46 | } 47 | -------------------------------------------------------------------------------- /flow-typed/npm/graphql-relay_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 1f57af4bc21b30f5957e529666b12d34 2 | // flow-typed version: <>/graphql-relay_v^0.5.1/flow_v0.47.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'graphql-relay' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'graphql-relay' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'graphql-relay/lib/connection/arrayconnection' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'graphql-relay/lib/connection/connection' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'graphql-relay/lib/connection/connectiontypes' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'graphql-relay/lib/index' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'graphql-relay/lib/mutation/mutation' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'graphql-relay/lib/node/node' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'graphql-relay/lib/node/plural' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'graphql-relay/lib/utils/base64' { 54 | declare module.exports: any; 55 | } 56 | 57 | // Filename aliases 58 | declare module 'graphql-relay/lib/connection/arrayconnection.js' { 59 | declare module.exports: $Exports<'graphql-relay/lib/connection/arrayconnection'>; 60 | } 61 | declare module 'graphql-relay/lib/connection/connection.js' { 62 | declare module.exports: $Exports<'graphql-relay/lib/connection/connection'>; 63 | } 64 | declare module 'graphql-relay/lib/connection/connectiontypes.js' { 65 | declare module.exports: $Exports<'graphql-relay/lib/connection/connectiontypes'>; 66 | } 67 | declare module 'graphql-relay/lib/index.js' { 68 | declare module.exports: $Exports<'graphql-relay/lib/index'>; 69 | } 70 | declare module 'graphql-relay/lib/mutation/mutation.js' { 71 | declare module.exports: $Exports<'graphql-relay/lib/mutation/mutation'>; 72 | } 73 | declare module 'graphql-relay/lib/node/node.js' { 74 | declare module.exports: $Exports<'graphql-relay/lib/node/node'>; 75 | } 76 | declare module 'graphql-relay/lib/node/plural.js' { 77 | declare module.exports: $Exports<'graphql-relay/lib/node/plural'>; 78 | } 79 | declare module 'graphql-relay/lib/utils/base64.js' { 80 | declare module.exports: $Exports<'graphql-relay/lib/utils/base64'>; 81 | } 82 | -------------------------------------------------------------------------------- /flow-typed/npm/husky_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: f104f8b25cb07f05a908061a451d57f5 2 | // flow-typed version: <>/husky_v^0.14.3/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'husky' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'husky' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'husky/__tests__/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'husky/bin/install' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'husky/bin/uninstall' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'husky/src/install' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'husky/src/uninstall' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'husky/src/utils/find-hooks-dir' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'husky/src/utils/find-parent' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'husky/src/utils/get-hook-script' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'husky/src/utils/is-husky' { 58 | declare module.exports: any; 59 | } 60 | 61 | // Filename aliases 62 | declare module 'husky/__tests__/index.js' { 63 | declare module.exports: $Exports<'husky/__tests__/index'>; 64 | } 65 | declare module 'husky/bin/install.js' { 66 | declare module.exports: $Exports<'husky/bin/install'>; 67 | } 68 | declare module 'husky/bin/uninstall.js' { 69 | declare module.exports: $Exports<'husky/bin/uninstall'>; 70 | } 71 | declare module 'husky/src/install.js' { 72 | declare module.exports: $Exports<'husky/src/install'>; 73 | } 74 | declare module 'husky/src/uninstall.js' { 75 | declare module.exports: $Exports<'husky/src/uninstall'>; 76 | } 77 | declare module 'husky/src/utils/find-hooks-dir.js' { 78 | declare module.exports: $Exports<'husky/src/utils/find-hooks-dir'>; 79 | } 80 | declare module 'husky/src/utils/find-parent.js' { 81 | declare module.exports: $Exports<'husky/src/utils/find-parent'>; 82 | } 83 | declare module 'husky/src/utils/get-hook-script.js' { 84 | declare module.exports: $Exports<'husky/src/utils/get-hook-script'>; 85 | } 86 | declare module 'husky/src/utils/is-husky.js' { 87 | declare module.exports: $Exports<'husky/src/utils/is-husky'>; 88 | } 89 | -------------------------------------------------------------------------------- /flow-typed/npm/jest_v20.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: a0369c11661f437ec4ccdd805579ddcf 2 | // flow-typed version: c4b9fea7c9/jest_v20.x.x/flow_>=v0.33.x 3 | 4 | type JestMockFn = { 5 | (...args: Array): any, 6 | /** 7 | * An object for introspecting mock calls 8 | */ 9 | mock: { 10 | /** 11 | * An array that represents all calls that have been made into this mock 12 | * function. Each call is represented by an array of arguments that were 13 | * passed during the call. 14 | */ 15 | calls: Array>, 16 | /** 17 | * An array that contains all the object instances that have been 18 | * instantiated from this mock function. 19 | */ 20 | instances: mixed 21 | }, 22 | /** 23 | * Resets all information stored in the mockFn.mock.calls and 24 | * mockFn.mock.instances arrays. Often this is useful when you want to clean 25 | * up a mock's usage data between two assertions. 26 | */ 27 | mockClear(): Function, 28 | /** 29 | * Resets all information stored in the mock. This is useful when you want to 30 | * completely restore a mock back to its initial state. 31 | */ 32 | mockReset(): Function, 33 | /** 34 | * Removes the mock and restores the initial implementation. This is useful 35 | * when you want to mock functions in certain test cases and restore the 36 | * original implementation in others. Beware that mockFn.mockRestore only 37 | * works when mock was created with jest.spyOn. Thus you have to take care of 38 | * restoration yourself when manually assigning jest.fn(). 39 | */ 40 | mockRestore(): Function, 41 | /** 42 | * Accepts a function that should be used as the implementation of the mock. 43 | * The mock itself will still record all calls that go into and instances 44 | * that come from itself -- the only difference is that the implementation 45 | * will also be executed when the mock is called. 46 | */ 47 | mockImplementation(fn: Function): JestMockFn, 48 | /** 49 | * Accepts a function that will be used as an implementation of the mock for 50 | * one call to the mocked function. Can be chained so that multiple function 51 | * calls produce different results. 52 | */ 53 | mockImplementationOnce(fn: Function): JestMockFn, 54 | /** 55 | * Just a simple sugar function for returning `this` 56 | */ 57 | mockReturnThis(): void, 58 | /** 59 | * Deprecated: use jest.fn(() => value) instead 60 | */ 61 | mockReturnValue(value: any): JestMockFn, 62 | /** 63 | * Sugar for only returning a value once inside your mock 64 | */ 65 | mockReturnValueOnce(value: any): JestMockFn 66 | }; 67 | 68 | type JestAsymmetricEqualityType = { 69 | /** 70 | * A custom Jasmine equality tester 71 | */ 72 | asymmetricMatch(value: mixed): boolean 73 | }; 74 | 75 | type JestCallsType = { 76 | allArgs(): mixed, 77 | all(): mixed, 78 | any(): boolean, 79 | count(): number, 80 | first(): mixed, 81 | mostRecent(): mixed, 82 | reset(): void 83 | }; 84 | 85 | type JestClockType = { 86 | install(): void, 87 | mockDate(date: Date): void, 88 | tick(milliseconds?: number): void, 89 | uninstall(): void 90 | }; 91 | 92 | type JestMatcherResult = { 93 | message?: string | (() => string), 94 | pass: boolean 95 | }; 96 | 97 | type JestMatcher = (actual: any, expected: any) => JestMatcherResult; 98 | 99 | type JestPromiseType = { 100 | /** 101 | * Use rejects to unwrap the reason of a rejected promise so any other 102 | * matcher can be chained. If the promise is fulfilled the assertion fails. 103 | */ 104 | rejects: JestExpectType, 105 | /** 106 | * Use resolves to unwrap the value of a fulfilled promise so any other 107 | * matcher can be chained. If the promise is rejected the assertion fails. 108 | */ 109 | resolves: JestExpectType 110 | }; 111 | 112 | /** 113 | * Plugin: jest-enzyme 114 | */ 115 | type EnzymeMatchersType = { 116 | toBeChecked(): void, 117 | toBeDisabled(): void, 118 | toBeEmpty(): void, 119 | toBePresent(): void, 120 | toContainReact(element: React$Element): void, 121 | toHaveClassName(className: string): void, 122 | toHaveHTML(html: string): void, 123 | toHaveProp(propKey: string, propValue?: any): void, 124 | toHaveRef(refName: string): void, 125 | toHaveState(stateKey: string, stateValue?: any): void, 126 | toHaveStyle(styleKey: string, styleValue?: any): void, 127 | toHaveTagName(tagName: string): void, 128 | toHaveText(text: string): void, 129 | toIncludeText(text: string): void, 130 | toHaveValue(value: any): void, 131 | toMatchElement(element: React$Element): void, 132 | toMatchSelector(selector: string): void, 133 | }; 134 | 135 | type JestExpectType = { 136 | not: JestExpectType & EnzymeMatchersType, 137 | /** 138 | * If you have a mock function, you can use .lastCalledWith to test what 139 | * arguments it was last called with. 140 | */ 141 | lastCalledWith(...args: Array): void, 142 | /** 143 | * toBe just checks that a value is what you expect. It uses === to check 144 | * strict equality. 145 | */ 146 | toBe(value: any): void, 147 | /** 148 | * Use .toHaveBeenCalled to ensure that a mock function got called. 149 | */ 150 | toBeCalled(): void, 151 | /** 152 | * Use .toBeCalledWith to ensure that a mock function was called with 153 | * specific arguments. 154 | */ 155 | toBeCalledWith(...args: Array): void, 156 | /** 157 | * Using exact equality with floating point numbers is a bad idea. Rounding 158 | * means that intuitive things fail. 159 | */ 160 | toBeCloseTo(num: number, delta: any): void, 161 | /** 162 | * Use .toBeDefined to check that a variable is not undefined. 163 | */ 164 | toBeDefined(): void, 165 | /** 166 | * Use .toBeFalsy when you don't care what a value is, you just want to 167 | * ensure a value is false in a boolean context. 168 | */ 169 | toBeFalsy(): void, 170 | /** 171 | * To compare floating point numbers, you can use toBeGreaterThan. 172 | */ 173 | toBeGreaterThan(number: number): void, 174 | /** 175 | * To compare floating point numbers, you can use toBeGreaterThanOrEqual. 176 | */ 177 | toBeGreaterThanOrEqual(number: number): void, 178 | /** 179 | * To compare floating point numbers, you can use toBeLessThan. 180 | */ 181 | toBeLessThan(number: number): void, 182 | /** 183 | * To compare floating point numbers, you can use toBeLessThanOrEqual. 184 | */ 185 | toBeLessThanOrEqual(number: number): void, 186 | /** 187 | * Use .toBeInstanceOf(Class) to check that an object is an instance of a 188 | * class. 189 | */ 190 | toBeInstanceOf(cls: Class<*>): void, 191 | /** 192 | * .toBeNull() is the same as .toBe(null) but the error messages are a bit 193 | * nicer. 194 | */ 195 | toBeNull(): void, 196 | /** 197 | * Use .toBeTruthy when you don't care what a value is, you just want to 198 | * ensure a value is true in a boolean context. 199 | */ 200 | toBeTruthy(): void, 201 | /** 202 | * Use .toBeUndefined to check that a variable is undefined. 203 | */ 204 | toBeUndefined(): void, 205 | /** 206 | * Use .toContain when you want to check that an item is in a list. For 207 | * testing the items in the list, this uses ===, a strict equality check. 208 | */ 209 | toContain(item: any): void, 210 | /** 211 | * Use .toContainEqual when you want to check that an item is in a list. For 212 | * testing the items in the list, this matcher recursively checks the 213 | * equality of all fields, rather than checking for object identity. 214 | */ 215 | toContainEqual(item: any): void, 216 | /** 217 | * Use .toEqual when you want to check that two objects have the same value. 218 | * This matcher recursively checks the equality of all fields, rather than 219 | * checking for object identity. 220 | */ 221 | toEqual(value: any): void, 222 | /** 223 | * Use .toHaveBeenCalled to ensure that a mock function got called. 224 | */ 225 | toHaveBeenCalled(): void, 226 | /** 227 | * Use .toHaveBeenCalledTimes to ensure that a mock function got called exact 228 | * number of times. 229 | */ 230 | toHaveBeenCalledTimes(number: number): void, 231 | /** 232 | * Use .toHaveBeenCalledWith to ensure that a mock function was called with 233 | * specific arguments. 234 | */ 235 | toHaveBeenCalledWith(...args: Array): void, 236 | /** 237 | * Use .toHaveBeenLastCalledWith to ensure that a mock function was last called 238 | * with specific arguments. 239 | */ 240 | toHaveBeenLastCalledWith(...args: Array): void, 241 | /** 242 | * Check that an object has a .length property and it is set to a certain 243 | * numeric value. 244 | */ 245 | toHaveLength(number: number): void, 246 | /** 247 | * 248 | */ 249 | toHaveProperty(propPath: string, value?: any): void, 250 | /** 251 | * Use .toMatch to check that a string matches a regular expression or string. 252 | */ 253 | toMatch(regexpOrString: RegExp | string): void, 254 | /** 255 | * Use .toMatchObject to check that a javascript object matches a subset of the properties of an object. 256 | */ 257 | toMatchObject(object: Object): void, 258 | /** 259 | * This ensures that a React component matches the most recent snapshot. 260 | */ 261 | toMatchSnapshot(name?: string): void, 262 | /** 263 | * Use .toThrow to test that a function throws when it is called. 264 | * If you want to test that a specific error gets thrown, you can provide an 265 | * argument to toThrow. The argument can be a string for the error message, 266 | * a class for the error, or a regex that should match the error. 267 | * 268 | * Alias: .toThrowError 269 | */ 270 | toThrow(message?: string | Error | RegExp): void, 271 | toThrowError(message?: string | Error | RegExp): void, 272 | /** 273 | * Use .toThrowErrorMatchingSnapshot to test that a function throws a error 274 | * matching the most recent snapshot when it is called. 275 | */ 276 | toThrowErrorMatchingSnapshot(): void 277 | }; 278 | 279 | type JestObjectType = { 280 | /** 281 | * Disables automatic mocking in the module loader. 282 | * 283 | * After this method is called, all `require()`s will return the real 284 | * versions of each module (rather than a mocked version). 285 | */ 286 | disableAutomock(): JestObjectType, 287 | /** 288 | * An un-hoisted version of disableAutomock 289 | */ 290 | autoMockOff(): JestObjectType, 291 | /** 292 | * Enables automatic mocking in the module loader. 293 | */ 294 | enableAutomock(): JestObjectType, 295 | /** 296 | * An un-hoisted version of enableAutomock 297 | */ 298 | autoMockOn(): JestObjectType, 299 | /** 300 | * Clears the mock.calls and mock.instances properties of all mocks. 301 | * Equivalent to calling .mockClear() on every mocked function. 302 | */ 303 | clearAllMocks(): JestObjectType, 304 | /** 305 | * Resets the state of all mocks. Equivalent to calling .mockReset() on every 306 | * mocked function. 307 | */ 308 | resetAllMocks(): JestObjectType, 309 | /** 310 | * Removes any pending timers from the timer system. 311 | */ 312 | clearAllTimers(): void, 313 | /** 314 | * The same as `mock` but not moved to the top of the expectation by 315 | * babel-jest. 316 | */ 317 | doMock(moduleName: string, moduleFactory?: any): JestObjectType, 318 | /** 319 | * The same as `unmock` but not moved to the top of the expectation by 320 | * babel-jest. 321 | */ 322 | dontMock(moduleName: string): JestObjectType, 323 | /** 324 | * Returns a new, unused mock function. Optionally takes a mock 325 | * implementation. 326 | */ 327 | fn(implementation?: Function): JestMockFn, 328 | /** 329 | * Determines if the given function is a mocked function. 330 | */ 331 | isMockFunction(fn: Function): boolean, 332 | /** 333 | * Given the name of a module, use the automatic mocking system to generate a 334 | * mocked version of the module for you. 335 | */ 336 | genMockFromModule(moduleName: string): any, 337 | /** 338 | * Mocks a module with an auto-mocked version when it is being required. 339 | * 340 | * The second argument can be used to specify an explicit module factory that 341 | * is being run instead of using Jest's automocking feature. 342 | * 343 | * The third argument can be used to create virtual mocks -- mocks of modules 344 | * that don't exist anywhere in the system. 345 | */ 346 | mock( 347 | moduleName: string, 348 | moduleFactory?: any, 349 | options?: Object 350 | ): JestObjectType, 351 | /** 352 | * Resets the module registry - the cache of all required modules. This is 353 | * useful to isolate modules where local state might conflict between tests. 354 | */ 355 | resetModules(): JestObjectType, 356 | /** 357 | * Exhausts the micro-task queue (usually interfaced in node via 358 | * process.nextTick). 359 | */ 360 | runAllTicks(): void, 361 | /** 362 | * Exhausts the macro-task queue (i.e., all tasks queued by setTimeout(), 363 | * setInterval(), and setImmediate()). 364 | */ 365 | runAllTimers(): void, 366 | /** 367 | * Exhausts all tasks queued by setImmediate(). 368 | */ 369 | runAllImmediates(): void, 370 | /** 371 | * Executes only the macro task queue (i.e. all tasks queued by setTimeout() 372 | * or setInterval() and setImmediate()). 373 | */ 374 | runTimersToTime(msToRun: number): void, 375 | /** 376 | * Executes only the macro-tasks that are currently pending (i.e., only the 377 | * tasks that have been queued by setTimeout() or setInterval() up to this 378 | * point) 379 | */ 380 | runOnlyPendingTimers(): void, 381 | /** 382 | * Explicitly supplies the mock object that the module system should return 383 | * for the specified module. Note: It is recommended to use jest.mock() 384 | * instead. 385 | */ 386 | setMock(moduleName: string, moduleExports: any): JestObjectType, 387 | /** 388 | * Indicates that the module system should never return a mocked version of 389 | * the specified module from require() (e.g. that it should always return the 390 | * real module). 391 | */ 392 | unmock(moduleName: string): JestObjectType, 393 | /** 394 | * Instructs Jest to use fake versions of the standard timer functions 395 | * (setTimeout, setInterval, clearTimeout, clearInterval, nextTick, 396 | * setImmediate and clearImmediate). 397 | */ 398 | useFakeTimers(): JestObjectType, 399 | /** 400 | * Instructs Jest to use the real versions of the standard timer functions. 401 | */ 402 | useRealTimers(): JestObjectType, 403 | /** 404 | * Creates a mock function similar to jest.fn but also tracks calls to 405 | * object[methodName]. 406 | */ 407 | spyOn(object: Object, methodName: string): JestMockFn 408 | }; 409 | 410 | type JestSpyType = { 411 | calls: JestCallsType 412 | }; 413 | 414 | /** Runs this function after every test inside this context */ 415 | declare function afterEach(fn: Function): void; 416 | /** Runs this function before every test inside this context */ 417 | declare function beforeEach(fn: Function): void; 418 | /** Runs this function after all tests have finished inside this context */ 419 | declare function afterAll(fn: Function): void; 420 | /** Runs this function before any tests have started inside this context */ 421 | declare function beforeAll(fn: Function): void; 422 | 423 | /** A context for grouping tests together */ 424 | declare var describe: { 425 | /** 426 | * Creates a block that groups together several related tests in one "test suite" 427 | */ 428 | (name: string, fn: Function): void, 429 | 430 | /** 431 | * Only run this describe block 432 | */ 433 | only(name: string, fn: Function): void, 434 | 435 | /** 436 | * Skip running this describe block 437 | */ 438 | skip(name: string, fn: Function): void, 439 | }; 440 | 441 | 442 | /** An individual test unit */ 443 | declare var it: { 444 | /** 445 | * An individual test unit 446 | * 447 | * @param {string} Name of Test 448 | * @param {Function} Test 449 | */ 450 | (name: string, fn?: Function): ?Promise, 451 | /** 452 | * Only run this test 453 | * 454 | * @param {string} Name of Test 455 | * @param {Function} Test 456 | */ 457 | only(name: string, fn?: Function): ?Promise, 458 | /** 459 | * Skip running this test 460 | * 461 | * @param {string} Name of Test 462 | * @param {Function} Test 463 | */ 464 | skip(name: string, fn?: Function): ?Promise, 465 | /** 466 | * Run the test concurrently 467 | * 468 | * @param {string} Name of Test 469 | * @param {Function} Test 470 | */ 471 | concurrent(name: string, fn?: Function): ?Promise 472 | }; 473 | declare function fit(name: string, fn: Function): ?Promise; 474 | /** An individual test unit */ 475 | declare var test: typeof it; 476 | /** A disabled group of tests */ 477 | declare var xdescribe: typeof describe; 478 | /** A focused group of tests */ 479 | declare var fdescribe: typeof describe; 480 | /** A disabled individual test */ 481 | declare var xit: typeof it; 482 | /** A disabled individual test */ 483 | declare var xtest: typeof it; 484 | 485 | /** The expect function is used every time you want to test a value */ 486 | declare var expect: { 487 | /** The object that you want to make assertions against */ 488 | (value: any): JestExpectType & JestPromiseType & EnzymeMatchersType, 489 | /** Add additional Jasmine matchers to Jest's roster */ 490 | extend(matchers: { [name: string]: JestMatcher }): void, 491 | /** Add a module that formats application-specific data structures. */ 492 | addSnapshotSerializer(serializer: (input: Object) => string): void, 493 | assertions(expectedAssertions: number): void, 494 | hasAssertions(): void, 495 | any(value: mixed): JestAsymmetricEqualityType, 496 | anything(): void, 497 | arrayContaining(value: Array): void, 498 | objectContaining(value: Object): void, 499 | /** Matches any received string that contains the exact expected string. */ 500 | stringContaining(value: string): void, 501 | stringMatching(value: string | RegExp): void 502 | }; 503 | 504 | // TODO handle return type 505 | // http://jasmine.github.io/2.4/introduction.html#section-Spies 506 | declare function spyOn(value: mixed, method: string): Object; 507 | 508 | /** Holds all functions related to manipulating test runner */ 509 | declare var jest: JestObjectType; 510 | 511 | /** 512 | * The global Jamine object, this is generally not exposed as the public API, 513 | * using features inside here could break in later versions of Jest. 514 | */ 515 | declare var jasmine: { 516 | DEFAULT_TIMEOUT_INTERVAL: number, 517 | any(value: mixed): JestAsymmetricEqualityType, 518 | anything(): void, 519 | arrayContaining(value: Array): void, 520 | clock(): JestClockType, 521 | createSpy(name: string): JestSpyType, 522 | createSpyObj( 523 | baseName: string, 524 | methodNames: Array 525 | ): { [methodName: string]: JestSpyType }, 526 | objectContaining(value: Object): void, 527 | stringMatching(value: string): void 528 | }; 529 | -------------------------------------------------------------------------------- /flow-typed/npm/jsonwebtoken_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: b318bdf60854855714344e3ba0962109 2 | // flow-typed version: <>/jsonwebtoken_v^7.4.1/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'jsonwebtoken' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'jsonwebtoken' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'jsonwebtoken/decode' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'jsonwebtoken/lib/JsonWebTokenError' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'jsonwebtoken/lib/NotBeforeError' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'jsonwebtoken/lib/timespan' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'jsonwebtoken/lib/TokenExpiredError' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'jsonwebtoken/sign' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'jsonwebtoken/test/async_sign.tests' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'jsonwebtoken/test/buffer.tests' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'jsonwebtoken/test/encoding.tests' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'jsonwebtoken/test/expires_format.tests' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'jsonwebtoken/test/iat.tests' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'jsonwebtoken/test/invalid_exp.tests' { 70 | declare module.exports: any; 71 | } 72 | 73 | declare module 'jsonwebtoken/test/issue_147.tests' { 74 | declare module.exports: any; 75 | } 76 | 77 | declare module 'jsonwebtoken/test/issue_196.tests' { 78 | declare module.exports: any; 79 | } 80 | 81 | declare module 'jsonwebtoken/test/issue_304.tests' { 82 | declare module.exports: any; 83 | } 84 | 85 | declare module 'jsonwebtoken/test/issue_70.tests' { 86 | declare module.exports: any; 87 | } 88 | 89 | declare module 'jsonwebtoken/test/jwt.hs.tests' { 90 | declare module.exports: any; 91 | } 92 | 93 | declare module 'jsonwebtoken/test/jwt.rs.tests' { 94 | declare module.exports: any; 95 | } 96 | 97 | declare module 'jsonwebtoken/test/keyid.tests' { 98 | declare module.exports: any; 99 | } 100 | 101 | declare module 'jsonwebtoken/test/non_object_values.tests' { 102 | declare module.exports: any; 103 | } 104 | 105 | declare module 'jsonwebtoken/test/noTimestamp.tests' { 106 | declare module.exports: any; 107 | } 108 | 109 | declare module 'jsonwebtoken/test/rsa-public-key.tests' { 110 | declare module.exports: any; 111 | } 112 | 113 | declare module 'jsonwebtoken/test/set_headers.tests' { 114 | declare module.exports: any; 115 | } 116 | 117 | declare module 'jsonwebtoken/test/undefined_secretOrPublickey.tests' { 118 | declare module.exports: any; 119 | } 120 | 121 | declare module 'jsonwebtoken/test/util/fakeDate' { 122 | declare module.exports: any; 123 | } 124 | 125 | declare module 'jsonwebtoken/test/verify.tests' { 126 | declare module.exports: any; 127 | } 128 | 129 | declare module 'jsonwebtoken/test/wrong_alg.tests' { 130 | declare module.exports: any; 131 | } 132 | 133 | declare module 'jsonwebtoken/verify' { 134 | declare module.exports: any; 135 | } 136 | 137 | // Filename aliases 138 | declare module 'jsonwebtoken/decode.js' { 139 | declare module.exports: $Exports<'jsonwebtoken/decode'>; 140 | } 141 | declare module 'jsonwebtoken/index' { 142 | declare module.exports: $Exports<'jsonwebtoken'>; 143 | } 144 | declare module 'jsonwebtoken/index.js' { 145 | declare module.exports: $Exports<'jsonwebtoken'>; 146 | } 147 | declare module 'jsonwebtoken/lib/JsonWebTokenError.js' { 148 | declare module.exports: $Exports<'jsonwebtoken/lib/JsonWebTokenError'>; 149 | } 150 | declare module 'jsonwebtoken/lib/NotBeforeError.js' { 151 | declare module.exports: $Exports<'jsonwebtoken/lib/NotBeforeError'>; 152 | } 153 | declare module 'jsonwebtoken/lib/timespan.js' { 154 | declare module.exports: $Exports<'jsonwebtoken/lib/timespan'>; 155 | } 156 | declare module 'jsonwebtoken/lib/TokenExpiredError.js' { 157 | declare module.exports: $Exports<'jsonwebtoken/lib/TokenExpiredError'>; 158 | } 159 | declare module 'jsonwebtoken/sign.js' { 160 | declare module.exports: $Exports<'jsonwebtoken/sign'>; 161 | } 162 | declare module 'jsonwebtoken/test/async_sign.tests.js' { 163 | declare module.exports: $Exports<'jsonwebtoken/test/async_sign.tests'>; 164 | } 165 | declare module 'jsonwebtoken/test/buffer.tests.js' { 166 | declare module.exports: $Exports<'jsonwebtoken/test/buffer.tests'>; 167 | } 168 | declare module 'jsonwebtoken/test/encoding.tests.js' { 169 | declare module.exports: $Exports<'jsonwebtoken/test/encoding.tests'>; 170 | } 171 | declare module 'jsonwebtoken/test/expires_format.tests.js' { 172 | declare module.exports: $Exports<'jsonwebtoken/test/expires_format.tests'>; 173 | } 174 | declare module 'jsonwebtoken/test/iat.tests.js' { 175 | declare module.exports: $Exports<'jsonwebtoken/test/iat.tests'>; 176 | } 177 | declare module 'jsonwebtoken/test/invalid_exp.tests.js' { 178 | declare module.exports: $Exports<'jsonwebtoken/test/invalid_exp.tests'>; 179 | } 180 | declare module 'jsonwebtoken/test/issue_147.tests.js' { 181 | declare module.exports: $Exports<'jsonwebtoken/test/issue_147.tests'>; 182 | } 183 | declare module 'jsonwebtoken/test/issue_196.tests.js' { 184 | declare module.exports: $Exports<'jsonwebtoken/test/issue_196.tests'>; 185 | } 186 | declare module 'jsonwebtoken/test/issue_304.tests.js' { 187 | declare module.exports: $Exports<'jsonwebtoken/test/issue_304.tests'>; 188 | } 189 | declare module 'jsonwebtoken/test/issue_70.tests.js' { 190 | declare module.exports: $Exports<'jsonwebtoken/test/issue_70.tests'>; 191 | } 192 | declare module 'jsonwebtoken/test/jwt.hs.tests.js' { 193 | declare module.exports: $Exports<'jsonwebtoken/test/jwt.hs.tests'>; 194 | } 195 | declare module 'jsonwebtoken/test/jwt.rs.tests.js' { 196 | declare module.exports: $Exports<'jsonwebtoken/test/jwt.rs.tests'>; 197 | } 198 | declare module 'jsonwebtoken/test/keyid.tests.js' { 199 | declare module.exports: $Exports<'jsonwebtoken/test/keyid.tests'>; 200 | } 201 | declare module 'jsonwebtoken/test/non_object_values.tests.js' { 202 | declare module.exports: $Exports<'jsonwebtoken/test/non_object_values.tests'>; 203 | } 204 | declare module 'jsonwebtoken/test/noTimestamp.tests.js' { 205 | declare module.exports: $Exports<'jsonwebtoken/test/noTimestamp.tests'>; 206 | } 207 | declare module 'jsonwebtoken/test/rsa-public-key.tests.js' { 208 | declare module.exports: $Exports<'jsonwebtoken/test/rsa-public-key.tests'>; 209 | } 210 | declare module 'jsonwebtoken/test/set_headers.tests.js' { 211 | declare module.exports: $Exports<'jsonwebtoken/test/set_headers.tests'>; 212 | } 213 | declare module 'jsonwebtoken/test/undefined_secretOrPublickey.tests.js' { 214 | declare module.exports: $Exports<'jsonwebtoken/test/undefined_secretOrPublickey.tests'>; 215 | } 216 | declare module 'jsonwebtoken/test/util/fakeDate.js' { 217 | declare module.exports: $Exports<'jsonwebtoken/test/util/fakeDate'>; 218 | } 219 | declare module 'jsonwebtoken/test/verify.tests.js' { 220 | declare module.exports: $Exports<'jsonwebtoken/test/verify.tests'>; 221 | } 222 | declare module 'jsonwebtoken/test/wrong_alg.tests.js' { 223 | declare module.exports: $Exports<'jsonwebtoken/test/wrong_alg.tests'>; 224 | } 225 | declare module 'jsonwebtoken/verify.js' { 226 | declare module.exports: $Exports<'jsonwebtoken/verify'>; 227 | } 228 | -------------------------------------------------------------------------------- /flow-typed/npm/kcors_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: c3ec4eeb66a3cfc00ff1ceb05ccfebfe 2 | // flow-typed version: <>/kcors_v^2.2.1/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'kcors' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'kcors' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'kcors/index' { 29 | declare module.exports: $Exports<'kcors'>; 30 | } 31 | declare module 'kcors/index.js' { 32 | declare module.exports: $Exports<'kcors'>; 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/knex_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 26014f46307f6d6571d923aeda7f3920 2 | // flow-typed version: <>/knex_v^0.13.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'knex' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'knex' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'knex/bin/cli' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'knex/knex' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'knex/lib/client' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'knex/lib/dialects/maria/index' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'knex/lib/dialects/maria/transaction' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'knex/lib/dialects/mssql/index' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'knex/lib/dialects/mssql/query/compiler' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'knex/lib/dialects/mssql/schema/columncompiler' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'knex/lib/dialects/mssql/schema/compiler' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'knex/lib/dialects/mssql/schema/tablecompiler' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'knex/lib/dialects/mssql/transaction' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'knex/lib/dialects/mysql/index' { 70 | declare module.exports: any; 71 | } 72 | 73 | declare module 'knex/lib/dialects/mysql/query/compiler' { 74 | declare module.exports: any; 75 | } 76 | 77 | declare module 'knex/lib/dialects/mysql/schema/columncompiler' { 78 | declare module.exports: any; 79 | } 80 | 81 | declare module 'knex/lib/dialects/mysql/schema/compiler' { 82 | declare module.exports: any; 83 | } 84 | 85 | declare module 'knex/lib/dialects/mysql/schema/tablecompiler' { 86 | declare module.exports: any; 87 | } 88 | 89 | declare module 'knex/lib/dialects/mysql/transaction' { 90 | declare module.exports: any; 91 | } 92 | 93 | declare module 'knex/lib/dialects/mysql2/index' { 94 | declare module.exports: any; 95 | } 96 | 97 | declare module 'knex/lib/dialects/mysql2/transaction' { 98 | declare module.exports: any; 99 | } 100 | 101 | declare module 'knex/lib/dialects/oracle/formatter' { 102 | declare module.exports: any; 103 | } 104 | 105 | declare module 'knex/lib/dialects/oracle/index' { 106 | declare module.exports: any; 107 | } 108 | 109 | declare module 'knex/lib/dialects/oracle/query/compiler' { 110 | declare module.exports: any; 111 | } 112 | 113 | declare module 'knex/lib/dialects/oracle/schema/columnbuilder' { 114 | declare module.exports: any; 115 | } 116 | 117 | declare module 'knex/lib/dialects/oracle/schema/columncompiler' { 118 | declare module.exports: any; 119 | } 120 | 121 | declare module 'knex/lib/dialects/oracle/schema/compiler' { 122 | declare module.exports: any; 123 | } 124 | 125 | declare module 'knex/lib/dialects/oracle/schema/tablecompiler' { 126 | declare module.exports: any; 127 | } 128 | 129 | declare module 'knex/lib/dialects/oracle/schema/trigger' { 130 | declare module.exports: any; 131 | } 132 | 133 | declare module 'knex/lib/dialects/oracle/transaction' { 134 | declare module.exports: any; 135 | } 136 | 137 | declare module 'knex/lib/dialects/oracle/utils' { 138 | declare module.exports: any; 139 | } 140 | 141 | declare module 'knex/lib/dialects/oracledb/index' { 142 | declare module.exports: any; 143 | } 144 | 145 | declare module 'knex/lib/dialects/oracledb/query/compiler' { 146 | declare module.exports: any; 147 | } 148 | 149 | declare module 'knex/lib/dialects/oracledb/schema/columncompiler' { 150 | declare module.exports: any; 151 | } 152 | 153 | declare module 'knex/lib/dialects/oracledb/transaction' { 154 | declare module.exports: any; 155 | } 156 | 157 | declare module 'knex/lib/dialects/oracledb/utils' { 158 | declare module.exports: any; 159 | } 160 | 161 | declare module 'knex/lib/dialects/postgres/index' { 162 | declare module.exports: any; 163 | } 164 | 165 | declare module 'knex/lib/dialects/postgres/query/compiler' { 166 | declare module.exports: any; 167 | } 168 | 169 | declare module 'knex/lib/dialects/postgres/schema/columncompiler' { 170 | declare module.exports: any; 171 | } 172 | 173 | declare module 'knex/lib/dialects/postgres/schema/compiler' { 174 | declare module.exports: any; 175 | } 176 | 177 | declare module 'knex/lib/dialects/postgres/schema/tablecompiler' { 178 | declare module.exports: any; 179 | } 180 | 181 | declare module 'knex/lib/dialects/sqlite3/index' { 182 | declare module.exports: any; 183 | } 184 | 185 | declare module 'knex/lib/dialects/sqlite3/query/compiler' { 186 | declare module.exports: any; 187 | } 188 | 189 | declare module 'knex/lib/dialects/sqlite3/schema/columncompiler' { 190 | declare module.exports: any; 191 | } 192 | 193 | declare module 'knex/lib/dialects/sqlite3/schema/compiler' { 194 | declare module.exports: any; 195 | } 196 | 197 | declare module 'knex/lib/dialects/sqlite3/schema/ddl' { 198 | declare module.exports: any; 199 | } 200 | 201 | declare module 'knex/lib/dialects/sqlite3/schema/tablecompiler' { 202 | declare module.exports: any; 203 | } 204 | 205 | declare module 'knex/lib/dialects/strong-oracle/index' { 206 | declare module.exports: any; 207 | } 208 | 209 | declare module 'knex/lib/dialects/websql/index' { 210 | declare module.exports: any; 211 | } 212 | 213 | declare module 'knex/lib/dialects/websql/transaction' { 214 | declare module.exports: any; 215 | } 216 | 217 | declare module 'knex/lib/formatter' { 218 | declare module.exports: any; 219 | } 220 | 221 | declare module 'knex/lib/functionhelper' { 222 | declare module.exports: any; 223 | } 224 | 225 | declare module 'knex/lib/helpers' { 226 | declare module.exports: any; 227 | } 228 | 229 | declare module 'knex/lib/index' { 230 | declare module.exports: any; 231 | } 232 | 233 | declare module 'knex/lib/interface' { 234 | declare module.exports: any; 235 | } 236 | 237 | declare module 'knex/lib/migrate/index' { 238 | declare module.exports: any; 239 | } 240 | 241 | declare module 'knex/lib/migrate/migrate-stub' { 242 | declare module.exports: any; 243 | } 244 | 245 | declare module 'knex/lib/query/builder' { 246 | declare module.exports: any; 247 | } 248 | 249 | declare module 'knex/lib/query/compiler' { 250 | declare module.exports: any; 251 | } 252 | 253 | declare module 'knex/lib/query/joinclause' { 254 | declare module.exports: any; 255 | } 256 | 257 | declare module 'knex/lib/query/methods' { 258 | declare module.exports: any; 259 | } 260 | 261 | declare module 'knex/lib/query/string' { 262 | declare module.exports: any; 263 | } 264 | 265 | declare module 'knex/lib/raw' { 266 | declare module.exports: any; 267 | } 268 | 269 | declare module 'knex/lib/runner' { 270 | declare module.exports: any; 271 | } 272 | 273 | declare module 'knex/lib/schema/builder' { 274 | declare module.exports: any; 275 | } 276 | 277 | declare module 'knex/lib/schema/columnbuilder' { 278 | declare module.exports: any; 279 | } 280 | 281 | declare module 'knex/lib/schema/columncompiler' { 282 | declare module.exports: any; 283 | } 284 | 285 | declare module 'knex/lib/schema/compiler' { 286 | declare module.exports: any; 287 | } 288 | 289 | declare module 'knex/lib/schema/helpers' { 290 | declare module.exports: any; 291 | } 292 | 293 | declare module 'knex/lib/schema/tablebuilder' { 294 | declare module.exports: any; 295 | } 296 | 297 | declare module 'knex/lib/schema/tablecompiler' { 298 | declare module.exports: any; 299 | } 300 | 301 | declare module 'knex/lib/seed/index' { 302 | declare module.exports: any; 303 | } 304 | 305 | declare module 'knex/lib/seed/seed-stub' { 306 | declare module.exports: any; 307 | } 308 | 309 | declare module 'knex/lib/transaction' { 310 | declare module.exports: any; 311 | } 312 | 313 | declare module 'knex/lib/util/batchInsert' { 314 | declare module.exports: any; 315 | } 316 | 317 | declare module 'knex/lib/util/make-knex' { 318 | declare module.exports: any; 319 | } 320 | 321 | declare module 'knex/lib/util/noop' { 322 | declare module.exports: any; 323 | } 324 | 325 | declare module 'knex/lib/util/parse-connection' { 326 | declare module.exports: any; 327 | } 328 | 329 | declare module 'knex/scripts/build' { 330 | declare module.exports: any; 331 | } 332 | 333 | declare module 'knex/src/client' { 334 | declare module.exports: any; 335 | } 336 | 337 | declare module 'knex/src/dialects/maria/index' { 338 | declare module.exports: any; 339 | } 340 | 341 | declare module 'knex/src/dialects/maria/transaction' { 342 | declare module.exports: any; 343 | } 344 | 345 | declare module 'knex/src/dialects/mssql/index' { 346 | declare module.exports: any; 347 | } 348 | 349 | declare module 'knex/src/dialects/mssql/query/compiler' { 350 | declare module.exports: any; 351 | } 352 | 353 | declare module 'knex/src/dialects/mssql/schema/columncompiler' { 354 | declare module.exports: any; 355 | } 356 | 357 | declare module 'knex/src/dialects/mssql/schema/compiler' { 358 | declare module.exports: any; 359 | } 360 | 361 | declare module 'knex/src/dialects/mssql/schema/tablecompiler' { 362 | declare module.exports: any; 363 | } 364 | 365 | declare module 'knex/src/dialects/mssql/transaction' { 366 | declare module.exports: any; 367 | } 368 | 369 | declare module 'knex/src/dialects/mysql/index' { 370 | declare module.exports: any; 371 | } 372 | 373 | declare module 'knex/src/dialects/mysql/query/compiler' { 374 | declare module.exports: any; 375 | } 376 | 377 | declare module 'knex/src/dialects/mysql/schema/columncompiler' { 378 | declare module.exports: any; 379 | } 380 | 381 | declare module 'knex/src/dialects/mysql/schema/compiler' { 382 | declare module.exports: any; 383 | } 384 | 385 | declare module 'knex/src/dialects/mysql/schema/tablecompiler' { 386 | declare module.exports: any; 387 | } 388 | 389 | declare module 'knex/src/dialects/mysql/transaction' { 390 | declare module.exports: any; 391 | } 392 | 393 | declare module 'knex/src/dialects/mysql2/index' { 394 | declare module.exports: any; 395 | } 396 | 397 | declare module 'knex/src/dialects/mysql2/transaction' { 398 | declare module.exports: any; 399 | } 400 | 401 | declare module 'knex/src/dialects/oracle/formatter' { 402 | declare module.exports: any; 403 | } 404 | 405 | declare module 'knex/src/dialects/oracle/index' { 406 | declare module.exports: any; 407 | } 408 | 409 | declare module 'knex/src/dialects/oracle/query/compiler' { 410 | declare module.exports: any; 411 | } 412 | 413 | declare module 'knex/src/dialects/oracle/schema/columnbuilder' { 414 | declare module.exports: any; 415 | } 416 | 417 | declare module 'knex/src/dialects/oracle/schema/columncompiler' { 418 | declare module.exports: any; 419 | } 420 | 421 | declare module 'knex/src/dialects/oracle/schema/compiler' { 422 | declare module.exports: any; 423 | } 424 | 425 | declare module 'knex/src/dialects/oracle/schema/tablecompiler' { 426 | declare module.exports: any; 427 | } 428 | 429 | declare module 'knex/src/dialects/oracle/schema/trigger' { 430 | declare module.exports: any; 431 | } 432 | 433 | declare module 'knex/src/dialects/oracle/transaction' { 434 | declare module.exports: any; 435 | } 436 | 437 | declare module 'knex/src/dialects/oracle/utils' { 438 | declare module.exports: any; 439 | } 440 | 441 | declare module 'knex/src/dialects/oracledb/index' { 442 | declare module.exports: any; 443 | } 444 | 445 | declare module 'knex/src/dialects/oracledb/query/compiler' { 446 | declare module.exports: any; 447 | } 448 | 449 | declare module 'knex/src/dialects/oracledb/schema/columncompiler' { 450 | declare module.exports: any; 451 | } 452 | 453 | declare module 'knex/src/dialects/oracledb/transaction' { 454 | declare module.exports: any; 455 | } 456 | 457 | declare module 'knex/src/dialects/oracledb/utils' { 458 | declare module.exports: any; 459 | } 460 | 461 | declare module 'knex/src/dialects/postgres/index' { 462 | declare module.exports: any; 463 | } 464 | 465 | declare module 'knex/src/dialects/postgres/query/compiler' { 466 | declare module.exports: any; 467 | } 468 | 469 | declare module 'knex/src/dialects/postgres/schema/columncompiler' { 470 | declare module.exports: any; 471 | } 472 | 473 | declare module 'knex/src/dialects/postgres/schema/compiler' { 474 | declare module.exports: any; 475 | } 476 | 477 | declare module 'knex/src/dialects/postgres/schema/tablecompiler' { 478 | declare module.exports: any; 479 | } 480 | 481 | declare module 'knex/src/dialects/sqlite3/index' { 482 | declare module.exports: any; 483 | } 484 | 485 | declare module 'knex/src/dialects/sqlite3/query/compiler' { 486 | declare module.exports: any; 487 | } 488 | 489 | declare module 'knex/src/dialects/sqlite3/schema/columncompiler' { 490 | declare module.exports: any; 491 | } 492 | 493 | declare module 'knex/src/dialects/sqlite3/schema/compiler' { 494 | declare module.exports: any; 495 | } 496 | 497 | declare module 'knex/src/dialects/sqlite3/schema/ddl' { 498 | declare module.exports: any; 499 | } 500 | 501 | declare module 'knex/src/dialects/sqlite3/schema/tablecompiler' { 502 | declare module.exports: any; 503 | } 504 | 505 | declare module 'knex/src/dialects/strong-oracle/index' { 506 | declare module.exports: any; 507 | } 508 | 509 | declare module 'knex/src/dialects/websql/index' { 510 | declare module.exports: any; 511 | } 512 | 513 | declare module 'knex/src/dialects/websql/transaction' { 514 | declare module.exports: any; 515 | } 516 | 517 | declare module 'knex/src/formatter' { 518 | declare module.exports: any; 519 | } 520 | 521 | declare module 'knex/src/functionhelper' { 522 | declare module.exports: any; 523 | } 524 | 525 | declare module 'knex/src/helpers' { 526 | declare module.exports: any; 527 | } 528 | 529 | declare module 'knex/src/index' { 530 | declare module.exports: any; 531 | } 532 | 533 | declare module 'knex/src/interface' { 534 | declare module.exports: any; 535 | } 536 | 537 | declare module 'knex/src/migrate/index' { 538 | declare module.exports: any; 539 | } 540 | 541 | declare module 'knex/src/migrate/migrate-stub' { 542 | declare module.exports: any; 543 | } 544 | 545 | declare module 'knex/src/query/builder' { 546 | declare module.exports: any; 547 | } 548 | 549 | declare module 'knex/src/query/compiler' { 550 | declare module.exports: any; 551 | } 552 | 553 | declare module 'knex/src/query/joinclause' { 554 | declare module.exports: any; 555 | } 556 | 557 | declare module 'knex/src/query/methods' { 558 | declare module.exports: any; 559 | } 560 | 561 | declare module 'knex/src/query/string' { 562 | declare module.exports: any; 563 | } 564 | 565 | declare module 'knex/src/raw' { 566 | declare module.exports: any; 567 | } 568 | 569 | declare module 'knex/src/runner' { 570 | declare module.exports: any; 571 | } 572 | 573 | declare module 'knex/src/schema/builder' { 574 | declare module.exports: any; 575 | } 576 | 577 | declare module 'knex/src/schema/columnbuilder' { 578 | declare module.exports: any; 579 | } 580 | 581 | declare module 'knex/src/schema/columncompiler' { 582 | declare module.exports: any; 583 | } 584 | 585 | declare module 'knex/src/schema/compiler' { 586 | declare module.exports: any; 587 | } 588 | 589 | declare module 'knex/src/schema/helpers' { 590 | declare module.exports: any; 591 | } 592 | 593 | declare module 'knex/src/schema/tablebuilder' { 594 | declare module.exports: any; 595 | } 596 | 597 | declare module 'knex/src/schema/tablecompiler' { 598 | declare module.exports: any; 599 | } 600 | 601 | declare module 'knex/src/seed/index' { 602 | declare module.exports: any; 603 | } 604 | 605 | declare module 'knex/src/seed/seed-stub' { 606 | declare module.exports: any; 607 | } 608 | 609 | declare module 'knex/src/transaction' { 610 | declare module.exports: any; 611 | } 612 | 613 | declare module 'knex/src/util/batchInsert' { 614 | declare module.exports: any; 615 | } 616 | 617 | declare module 'knex/src/util/make-knex' { 618 | declare module.exports: any; 619 | } 620 | 621 | declare module 'knex/src/util/noop' { 622 | declare module.exports: any; 623 | } 624 | 625 | declare module 'knex/src/util/parse-connection' { 626 | declare module.exports: any; 627 | } 628 | 629 | // Filename aliases 630 | declare module 'knex/bin/cli.js' { 631 | declare module.exports: $Exports<'knex/bin/cli'>; 632 | } 633 | declare module 'knex/knex.js' { 634 | declare module.exports: $Exports<'knex/knex'>; 635 | } 636 | declare module 'knex/lib/client.js' { 637 | declare module.exports: $Exports<'knex/lib/client'>; 638 | } 639 | declare module 'knex/lib/dialects/maria/index.js' { 640 | declare module.exports: $Exports<'knex/lib/dialects/maria/index'>; 641 | } 642 | declare module 'knex/lib/dialects/maria/transaction.js' { 643 | declare module.exports: $Exports<'knex/lib/dialects/maria/transaction'>; 644 | } 645 | declare module 'knex/lib/dialects/mssql/index.js' { 646 | declare module.exports: $Exports<'knex/lib/dialects/mssql/index'>; 647 | } 648 | declare module 'knex/lib/dialects/mssql/query/compiler.js' { 649 | declare module.exports: $Exports<'knex/lib/dialects/mssql/query/compiler'>; 650 | } 651 | declare module 'knex/lib/dialects/mssql/schema/columncompiler.js' { 652 | declare module.exports: $Exports<'knex/lib/dialects/mssql/schema/columncompiler'>; 653 | } 654 | declare module 'knex/lib/dialects/mssql/schema/compiler.js' { 655 | declare module.exports: $Exports<'knex/lib/dialects/mssql/schema/compiler'>; 656 | } 657 | declare module 'knex/lib/dialects/mssql/schema/tablecompiler.js' { 658 | declare module.exports: $Exports<'knex/lib/dialects/mssql/schema/tablecompiler'>; 659 | } 660 | declare module 'knex/lib/dialects/mssql/transaction.js' { 661 | declare module.exports: $Exports<'knex/lib/dialects/mssql/transaction'>; 662 | } 663 | declare module 'knex/lib/dialects/mysql/index.js' { 664 | declare module.exports: $Exports<'knex/lib/dialects/mysql/index'>; 665 | } 666 | declare module 'knex/lib/dialects/mysql/query/compiler.js' { 667 | declare module.exports: $Exports<'knex/lib/dialects/mysql/query/compiler'>; 668 | } 669 | declare module 'knex/lib/dialects/mysql/schema/columncompiler.js' { 670 | declare module.exports: $Exports<'knex/lib/dialects/mysql/schema/columncompiler'>; 671 | } 672 | declare module 'knex/lib/dialects/mysql/schema/compiler.js' { 673 | declare module.exports: $Exports<'knex/lib/dialects/mysql/schema/compiler'>; 674 | } 675 | declare module 'knex/lib/dialects/mysql/schema/tablecompiler.js' { 676 | declare module.exports: $Exports<'knex/lib/dialects/mysql/schema/tablecompiler'>; 677 | } 678 | declare module 'knex/lib/dialects/mysql/transaction.js' { 679 | declare module.exports: $Exports<'knex/lib/dialects/mysql/transaction'>; 680 | } 681 | declare module 'knex/lib/dialects/mysql2/index.js' { 682 | declare module.exports: $Exports<'knex/lib/dialects/mysql2/index'>; 683 | } 684 | declare module 'knex/lib/dialects/mysql2/transaction.js' { 685 | declare module.exports: $Exports<'knex/lib/dialects/mysql2/transaction'>; 686 | } 687 | declare module 'knex/lib/dialects/oracle/formatter.js' { 688 | declare module.exports: $Exports<'knex/lib/dialects/oracle/formatter'>; 689 | } 690 | declare module 'knex/lib/dialects/oracle/index.js' { 691 | declare module.exports: $Exports<'knex/lib/dialects/oracle/index'>; 692 | } 693 | declare module 'knex/lib/dialects/oracle/query/compiler.js' { 694 | declare module.exports: $Exports<'knex/lib/dialects/oracle/query/compiler'>; 695 | } 696 | declare module 'knex/lib/dialects/oracle/schema/columnbuilder.js' { 697 | declare module.exports: $Exports<'knex/lib/dialects/oracle/schema/columnbuilder'>; 698 | } 699 | declare module 'knex/lib/dialects/oracle/schema/columncompiler.js' { 700 | declare module.exports: $Exports<'knex/lib/dialects/oracle/schema/columncompiler'>; 701 | } 702 | declare module 'knex/lib/dialects/oracle/schema/compiler.js' { 703 | declare module.exports: $Exports<'knex/lib/dialects/oracle/schema/compiler'>; 704 | } 705 | declare module 'knex/lib/dialects/oracle/schema/tablecompiler.js' { 706 | declare module.exports: $Exports<'knex/lib/dialects/oracle/schema/tablecompiler'>; 707 | } 708 | declare module 'knex/lib/dialects/oracle/schema/trigger.js' { 709 | declare module.exports: $Exports<'knex/lib/dialects/oracle/schema/trigger'>; 710 | } 711 | declare module 'knex/lib/dialects/oracle/transaction.js' { 712 | declare module.exports: $Exports<'knex/lib/dialects/oracle/transaction'>; 713 | } 714 | declare module 'knex/lib/dialects/oracle/utils.js' { 715 | declare module.exports: $Exports<'knex/lib/dialects/oracle/utils'>; 716 | } 717 | declare module 'knex/lib/dialects/oracledb/index.js' { 718 | declare module.exports: $Exports<'knex/lib/dialects/oracledb/index'>; 719 | } 720 | declare module 'knex/lib/dialects/oracledb/query/compiler.js' { 721 | declare module.exports: $Exports<'knex/lib/dialects/oracledb/query/compiler'>; 722 | } 723 | declare module 'knex/lib/dialects/oracledb/schema/columncompiler.js' { 724 | declare module.exports: $Exports<'knex/lib/dialects/oracledb/schema/columncompiler'>; 725 | } 726 | declare module 'knex/lib/dialects/oracledb/transaction.js' { 727 | declare module.exports: $Exports<'knex/lib/dialects/oracledb/transaction'>; 728 | } 729 | declare module 'knex/lib/dialects/oracledb/utils.js' { 730 | declare module.exports: $Exports<'knex/lib/dialects/oracledb/utils'>; 731 | } 732 | declare module 'knex/lib/dialects/postgres/index.js' { 733 | declare module.exports: $Exports<'knex/lib/dialects/postgres/index'>; 734 | } 735 | declare module 'knex/lib/dialects/postgres/query/compiler.js' { 736 | declare module.exports: $Exports<'knex/lib/dialects/postgres/query/compiler'>; 737 | } 738 | declare module 'knex/lib/dialects/postgres/schema/columncompiler.js' { 739 | declare module.exports: $Exports<'knex/lib/dialects/postgres/schema/columncompiler'>; 740 | } 741 | declare module 'knex/lib/dialects/postgres/schema/compiler.js' { 742 | declare module.exports: $Exports<'knex/lib/dialects/postgres/schema/compiler'>; 743 | } 744 | declare module 'knex/lib/dialects/postgres/schema/tablecompiler.js' { 745 | declare module.exports: $Exports<'knex/lib/dialects/postgres/schema/tablecompiler'>; 746 | } 747 | declare module 'knex/lib/dialects/sqlite3/index.js' { 748 | declare module.exports: $Exports<'knex/lib/dialects/sqlite3/index'>; 749 | } 750 | declare module 'knex/lib/dialects/sqlite3/query/compiler.js' { 751 | declare module.exports: $Exports<'knex/lib/dialects/sqlite3/query/compiler'>; 752 | } 753 | declare module 'knex/lib/dialects/sqlite3/schema/columncompiler.js' { 754 | declare module.exports: $Exports<'knex/lib/dialects/sqlite3/schema/columncompiler'>; 755 | } 756 | declare module 'knex/lib/dialects/sqlite3/schema/compiler.js' { 757 | declare module.exports: $Exports<'knex/lib/dialects/sqlite3/schema/compiler'>; 758 | } 759 | declare module 'knex/lib/dialects/sqlite3/schema/ddl.js' { 760 | declare module.exports: $Exports<'knex/lib/dialects/sqlite3/schema/ddl'>; 761 | } 762 | declare module 'knex/lib/dialects/sqlite3/schema/tablecompiler.js' { 763 | declare module.exports: $Exports<'knex/lib/dialects/sqlite3/schema/tablecompiler'>; 764 | } 765 | declare module 'knex/lib/dialects/strong-oracle/index.js' { 766 | declare module.exports: $Exports<'knex/lib/dialects/strong-oracle/index'>; 767 | } 768 | declare module 'knex/lib/dialects/websql/index.js' { 769 | declare module.exports: $Exports<'knex/lib/dialects/websql/index'>; 770 | } 771 | declare module 'knex/lib/dialects/websql/transaction.js' { 772 | declare module.exports: $Exports<'knex/lib/dialects/websql/transaction'>; 773 | } 774 | declare module 'knex/lib/formatter.js' { 775 | declare module.exports: $Exports<'knex/lib/formatter'>; 776 | } 777 | declare module 'knex/lib/functionhelper.js' { 778 | declare module.exports: $Exports<'knex/lib/functionhelper'>; 779 | } 780 | declare module 'knex/lib/helpers.js' { 781 | declare module.exports: $Exports<'knex/lib/helpers'>; 782 | } 783 | declare module 'knex/lib/index.js' { 784 | declare module.exports: $Exports<'knex/lib/index'>; 785 | } 786 | declare module 'knex/lib/interface.js' { 787 | declare module.exports: $Exports<'knex/lib/interface'>; 788 | } 789 | declare module 'knex/lib/migrate/index.js' { 790 | declare module.exports: $Exports<'knex/lib/migrate/index'>; 791 | } 792 | declare module 'knex/lib/migrate/migrate-stub.js' { 793 | declare module.exports: $Exports<'knex/lib/migrate/migrate-stub'>; 794 | } 795 | declare module 'knex/lib/query/builder.js' { 796 | declare module.exports: $Exports<'knex/lib/query/builder'>; 797 | } 798 | declare module 'knex/lib/query/compiler.js' { 799 | declare module.exports: $Exports<'knex/lib/query/compiler'>; 800 | } 801 | declare module 'knex/lib/query/joinclause.js' { 802 | declare module.exports: $Exports<'knex/lib/query/joinclause'>; 803 | } 804 | declare module 'knex/lib/query/methods.js' { 805 | declare module.exports: $Exports<'knex/lib/query/methods'>; 806 | } 807 | declare module 'knex/lib/query/string.js' { 808 | declare module.exports: $Exports<'knex/lib/query/string'>; 809 | } 810 | declare module 'knex/lib/raw.js' { 811 | declare module.exports: $Exports<'knex/lib/raw'>; 812 | } 813 | declare module 'knex/lib/runner.js' { 814 | declare module.exports: $Exports<'knex/lib/runner'>; 815 | } 816 | declare module 'knex/lib/schema/builder.js' { 817 | declare module.exports: $Exports<'knex/lib/schema/builder'>; 818 | } 819 | declare module 'knex/lib/schema/columnbuilder.js' { 820 | declare module.exports: $Exports<'knex/lib/schema/columnbuilder'>; 821 | } 822 | declare module 'knex/lib/schema/columncompiler.js' { 823 | declare module.exports: $Exports<'knex/lib/schema/columncompiler'>; 824 | } 825 | declare module 'knex/lib/schema/compiler.js' { 826 | declare module.exports: $Exports<'knex/lib/schema/compiler'>; 827 | } 828 | declare module 'knex/lib/schema/helpers.js' { 829 | declare module.exports: $Exports<'knex/lib/schema/helpers'>; 830 | } 831 | declare module 'knex/lib/schema/tablebuilder.js' { 832 | declare module.exports: $Exports<'knex/lib/schema/tablebuilder'>; 833 | } 834 | declare module 'knex/lib/schema/tablecompiler.js' { 835 | declare module.exports: $Exports<'knex/lib/schema/tablecompiler'>; 836 | } 837 | declare module 'knex/lib/seed/index.js' { 838 | declare module.exports: $Exports<'knex/lib/seed/index'>; 839 | } 840 | declare module 'knex/lib/seed/seed-stub.js' { 841 | declare module.exports: $Exports<'knex/lib/seed/seed-stub'>; 842 | } 843 | declare module 'knex/lib/transaction.js' { 844 | declare module.exports: $Exports<'knex/lib/transaction'>; 845 | } 846 | declare module 'knex/lib/util/batchInsert.js' { 847 | declare module.exports: $Exports<'knex/lib/util/batchInsert'>; 848 | } 849 | declare module 'knex/lib/util/make-knex.js' { 850 | declare module.exports: $Exports<'knex/lib/util/make-knex'>; 851 | } 852 | declare module 'knex/lib/util/noop.js' { 853 | declare module.exports: $Exports<'knex/lib/util/noop'>; 854 | } 855 | declare module 'knex/lib/util/parse-connection.js' { 856 | declare module.exports: $Exports<'knex/lib/util/parse-connection'>; 857 | } 858 | declare module 'knex/scripts/build.js' { 859 | declare module.exports: $Exports<'knex/scripts/build'>; 860 | } 861 | declare module 'knex/src/client.js' { 862 | declare module.exports: $Exports<'knex/src/client'>; 863 | } 864 | declare module 'knex/src/dialects/maria/index.js' { 865 | declare module.exports: $Exports<'knex/src/dialects/maria/index'>; 866 | } 867 | declare module 'knex/src/dialects/maria/transaction.js' { 868 | declare module.exports: $Exports<'knex/src/dialects/maria/transaction'>; 869 | } 870 | declare module 'knex/src/dialects/mssql/index.js' { 871 | declare module.exports: $Exports<'knex/src/dialects/mssql/index'>; 872 | } 873 | declare module 'knex/src/dialects/mssql/query/compiler.js' { 874 | declare module.exports: $Exports<'knex/src/dialects/mssql/query/compiler'>; 875 | } 876 | declare module 'knex/src/dialects/mssql/schema/columncompiler.js' { 877 | declare module.exports: $Exports<'knex/src/dialects/mssql/schema/columncompiler'>; 878 | } 879 | declare module 'knex/src/dialects/mssql/schema/compiler.js' { 880 | declare module.exports: $Exports<'knex/src/dialects/mssql/schema/compiler'>; 881 | } 882 | declare module 'knex/src/dialects/mssql/schema/tablecompiler.js' { 883 | declare module.exports: $Exports<'knex/src/dialects/mssql/schema/tablecompiler'>; 884 | } 885 | declare module 'knex/src/dialects/mssql/transaction.js' { 886 | declare module.exports: $Exports<'knex/src/dialects/mssql/transaction'>; 887 | } 888 | declare module 'knex/src/dialects/mysql/index.js' { 889 | declare module.exports: $Exports<'knex/src/dialects/mysql/index'>; 890 | } 891 | declare module 'knex/src/dialects/mysql/query/compiler.js' { 892 | declare module.exports: $Exports<'knex/src/dialects/mysql/query/compiler'>; 893 | } 894 | declare module 'knex/src/dialects/mysql/schema/columncompiler.js' { 895 | declare module.exports: $Exports<'knex/src/dialects/mysql/schema/columncompiler'>; 896 | } 897 | declare module 'knex/src/dialects/mysql/schema/compiler.js' { 898 | declare module.exports: $Exports<'knex/src/dialects/mysql/schema/compiler'>; 899 | } 900 | declare module 'knex/src/dialects/mysql/schema/tablecompiler.js' { 901 | declare module.exports: $Exports<'knex/src/dialects/mysql/schema/tablecompiler'>; 902 | } 903 | declare module 'knex/src/dialects/mysql/transaction.js' { 904 | declare module.exports: $Exports<'knex/src/dialects/mysql/transaction'>; 905 | } 906 | declare module 'knex/src/dialects/mysql2/index.js' { 907 | declare module.exports: $Exports<'knex/src/dialects/mysql2/index'>; 908 | } 909 | declare module 'knex/src/dialects/mysql2/transaction.js' { 910 | declare module.exports: $Exports<'knex/src/dialects/mysql2/transaction'>; 911 | } 912 | declare module 'knex/src/dialects/oracle/formatter.js' { 913 | declare module.exports: $Exports<'knex/src/dialects/oracle/formatter'>; 914 | } 915 | declare module 'knex/src/dialects/oracle/index.js' { 916 | declare module.exports: $Exports<'knex/src/dialects/oracle/index'>; 917 | } 918 | declare module 'knex/src/dialects/oracle/query/compiler.js' { 919 | declare module.exports: $Exports<'knex/src/dialects/oracle/query/compiler'>; 920 | } 921 | declare module 'knex/src/dialects/oracle/schema/columnbuilder.js' { 922 | declare module.exports: $Exports<'knex/src/dialects/oracle/schema/columnbuilder'>; 923 | } 924 | declare module 'knex/src/dialects/oracle/schema/columncompiler.js' { 925 | declare module.exports: $Exports<'knex/src/dialects/oracle/schema/columncompiler'>; 926 | } 927 | declare module 'knex/src/dialects/oracle/schema/compiler.js' { 928 | declare module.exports: $Exports<'knex/src/dialects/oracle/schema/compiler'>; 929 | } 930 | declare module 'knex/src/dialects/oracle/schema/tablecompiler.js' { 931 | declare module.exports: $Exports<'knex/src/dialects/oracle/schema/tablecompiler'>; 932 | } 933 | declare module 'knex/src/dialects/oracle/schema/trigger.js' { 934 | declare module.exports: $Exports<'knex/src/dialects/oracle/schema/trigger'>; 935 | } 936 | declare module 'knex/src/dialects/oracle/transaction.js' { 937 | declare module.exports: $Exports<'knex/src/dialects/oracle/transaction'>; 938 | } 939 | declare module 'knex/src/dialects/oracle/utils.js' { 940 | declare module.exports: $Exports<'knex/src/dialects/oracle/utils'>; 941 | } 942 | declare module 'knex/src/dialects/oracledb/index.js' { 943 | declare module.exports: $Exports<'knex/src/dialects/oracledb/index'>; 944 | } 945 | declare module 'knex/src/dialects/oracledb/query/compiler.js' { 946 | declare module.exports: $Exports<'knex/src/dialects/oracledb/query/compiler'>; 947 | } 948 | declare module 'knex/src/dialects/oracledb/schema/columncompiler.js' { 949 | declare module.exports: $Exports<'knex/src/dialects/oracledb/schema/columncompiler'>; 950 | } 951 | declare module 'knex/src/dialects/oracledb/transaction.js' { 952 | declare module.exports: $Exports<'knex/src/dialects/oracledb/transaction'>; 953 | } 954 | declare module 'knex/src/dialects/oracledb/utils.js' { 955 | declare module.exports: $Exports<'knex/src/dialects/oracledb/utils'>; 956 | } 957 | declare module 'knex/src/dialects/postgres/index.js' { 958 | declare module.exports: $Exports<'knex/src/dialects/postgres/index'>; 959 | } 960 | declare module 'knex/src/dialects/postgres/query/compiler.js' { 961 | declare module.exports: $Exports<'knex/src/dialects/postgres/query/compiler'>; 962 | } 963 | declare module 'knex/src/dialects/postgres/schema/columncompiler.js' { 964 | declare module.exports: $Exports<'knex/src/dialects/postgres/schema/columncompiler'>; 965 | } 966 | declare module 'knex/src/dialects/postgres/schema/compiler.js' { 967 | declare module.exports: $Exports<'knex/src/dialects/postgres/schema/compiler'>; 968 | } 969 | declare module 'knex/src/dialects/postgres/schema/tablecompiler.js' { 970 | declare module.exports: $Exports<'knex/src/dialects/postgres/schema/tablecompiler'>; 971 | } 972 | declare module 'knex/src/dialects/sqlite3/index.js' { 973 | declare module.exports: $Exports<'knex/src/dialects/sqlite3/index'>; 974 | } 975 | declare module 'knex/src/dialects/sqlite3/query/compiler.js' { 976 | declare module.exports: $Exports<'knex/src/dialects/sqlite3/query/compiler'>; 977 | } 978 | declare module 'knex/src/dialects/sqlite3/schema/columncompiler.js' { 979 | declare module.exports: $Exports<'knex/src/dialects/sqlite3/schema/columncompiler'>; 980 | } 981 | declare module 'knex/src/dialects/sqlite3/schema/compiler.js' { 982 | declare module.exports: $Exports<'knex/src/dialects/sqlite3/schema/compiler'>; 983 | } 984 | declare module 'knex/src/dialects/sqlite3/schema/ddl.js' { 985 | declare module.exports: $Exports<'knex/src/dialects/sqlite3/schema/ddl'>; 986 | } 987 | declare module 'knex/src/dialects/sqlite3/schema/tablecompiler.js' { 988 | declare module.exports: $Exports<'knex/src/dialects/sqlite3/schema/tablecompiler'>; 989 | } 990 | declare module 'knex/src/dialects/strong-oracle/index.js' { 991 | declare module.exports: $Exports<'knex/src/dialects/strong-oracle/index'>; 992 | } 993 | declare module 'knex/src/dialects/websql/index.js' { 994 | declare module.exports: $Exports<'knex/src/dialects/websql/index'>; 995 | } 996 | declare module 'knex/src/dialects/websql/transaction.js' { 997 | declare module.exports: $Exports<'knex/src/dialects/websql/transaction'>; 998 | } 999 | declare module 'knex/src/formatter.js' { 1000 | declare module.exports: $Exports<'knex/src/formatter'>; 1001 | } 1002 | declare module 'knex/src/functionhelper.js' { 1003 | declare module.exports: $Exports<'knex/src/functionhelper'>; 1004 | } 1005 | declare module 'knex/src/helpers.js' { 1006 | declare module.exports: $Exports<'knex/src/helpers'>; 1007 | } 1008 | declare module 'knex/src/index.js' { 1009 | declare module.exports: $Exports<'knex/src/index'>; 1010 | } 1011 | declare module 'knex/src/interface.js' { 1012 | declare module.exports: $Exports<'knex/src/interface'>; 1013 | } 1014 | declare module 'knex/src/migrate/index.js' { 1015 | declare module.exports: $Exports<'knex/src/migrate/index'>; 1016 | } 1017 | declare module 'knex/src/migrate/migrate-stub.js' { 1018 | declare module.exports: $Exports<'knex/src/migrate/migrate-stub'>; 1019 | } 1020 | declare module 'knex/src/query/builder.js' { 1021 | declare module.exports: $Exports<'knex/src/query/builder'>; 1022 | } 1023 | declare module 'knex/src/query/compiler.js' { 1024 | declare module.exports: $Exports<'knex/src/query/compiler'>; 1025 | } 1026 | declare module 'knex/src/query/joinclause.js' { 1027 | declare module.exports: $Exports<'knex/src/query/joinclause'>; 1028 | } 1029 | declare module 'knex/src/query/methods.js' { 1030 | declare module.exports: $Exports<'knex/src/query/methods'>; 1031 | } 1032 | declare module 'knex/src/query/string.js' { 1033 | declare module.exports: $Exports<'knex/src/query/string'>; 1034 | } 1035 | declare module 'knex/src/raw.js' { 1036 | declare module.exports: $Exports<'knex/src/raw'>; 1037 | } 1038 | declare module 'knex/src/runner.js' { 1039 | declare module.exports: $Exports<'knex/src/runner'>; 1040 | } 1041 | declare module 'knex/src/schema/builder.js' { 1042 | declare module.exports: $Exports<'knex/src/schema/builder'>; 1043 | } 1044 | declare module 'knex/src/schema/columnbuilder.js' { 1045 | declare module.exports: $Exports<'knex/src/schema/columnbuilder'>; 1046 | } 1047 | declare module 'knex/src/schema/columncompiler.js' { 1048 | declare module.exports: $Exports<'knex/src/schema/columncompiler'>; 1049 | } 1050 | declare module 'knex/src/schema/compiler.js' { 1051 | declare module.exports: $Exports<'knex/src/schema/compiler'>; 1052 | } 1053 | declare module 'knex/src/schema/helpers.js' { 1054 | declare module.exports: $Exports<'knex/src/schema/helpers'>; 1055 | } 1056 | declare module 'knex/src/schema/tablebuilder.js' { 1057 | declare module.exports: $Exports<'knex/src/schema/tablebuilder'>; 1058 | } 1059 | declare module 'knex/src/schema/tablecompiler.js' { 1060 | declare module.exports: $Exports<'knex/src/schema/tablecompiler'>; 1061 | } 1062 | declare module 'knex/src/seed/index.js' { 1063 | declare module.exports: $Exports<'knex/src/seed/index'>; 1064 | } 1065 | declare module 'knex/src/seed/seed-stub.js' { 1066 | declare module.exports: $Exports<'knex/src/seed/seed-stub'>; 1067 | } 1068 | declare module 'knex/src/transaction.js' { 1069 | declare module.exports: $Exports<'knex/src/transaction'>; 1070 | } 1071 | declare module 'knex/src/util/batchInsert.js' { 1072 | declare module.exports: $Exports<'knex/src/util/batchInsert'>; 1073 | } 1074 | declare module 'knex/src/util/make-knex.js' { 1075 | declare module.exports: $Exports<'knex/src/util/make-knex'>; 1076 | } 1077 | declare module 'knex/src/util/noop.js' { 1078 | declare module.exports: $Exports<'knex/src/util/noop'>; 1079 | } 1080 | declare module 'knex/src/util/parse-connection.js' { 1081 | declare module.exports: $Exports<'knex/src/util/parse-connection'>; 1082 | } 1083 | -------------------------------------------------------------------------------- /flow-typed/npm/koa-bodyparser_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 542dbdb350e8995e0d882c400fa3d30e 2 | // flow-typed version: <>/koa-bodyparser_v^4.2.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'koa-bodyparser' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'koa-bodyparser' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'koa-bodyparser/index' { 29 | declare module.exports: $Exports<'koa-bodyparser'>; 30 | } 31 | declare module 'koa-bodyparser/index.js' { 32 | declare module.exports: $Exports<'koa-bodyparser'>; 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/koa-convert_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: af691af57613b9e9a063b33e1a2e3c4d 2 | // flow-typed version: <>/koa-convert_v^1.2.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'koa-convert' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'koa-convert' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'koa-convert/test' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'koa-convert/index' { 31 | declare module.exports: $Exports<'koa-convert'>; 32 | } 33 | declare module 'koa-convert/index.js' { 34 | declare module.exports: $Exports<'koa-convert'>; 35 | } 36 | declare module 'koa-convert/test.js' { 37 | declare module.exports: $Exports<'koa-convert/test'>; 38 | } 39 | -------------------------------------------------------------------------------- /flow-typed/npm/koa-graphql_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 7d79bb0adcbec7bacc101fbe624ff7b3 2 | // flow-typed version: <>/koa-graphql_v^0.7.0/flow_v0.47.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'koa-graphql' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'koa-graphql' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'koa-graphql/dist/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'koa-graphql/dist/renderGraphiQL' { 30 | declare module.exports: any; 31 | } 32 | 33 | // Filename aliases 34 | declare module 'koa-graphql/dist/index.js' { 35 | declare module.exports: $Exports<'koa-graphql/dist/index'>; 36 | } 37 | declare module 'koa-graphql/dist/renderGraphiQL.js' { 38 | declare module.exports: $Exports<'koa-graphql/dist/renderGraphiQL'>; 39 | } 40 | -------------------------------------------------------------------------------- /flow-typed/npm/koa-jwt_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: b3476d36f576dda995633817daa21bf2 2 | // flow-typed version: <>/koa-jwt_v^3.2.2/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'koa-jwt' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'koa-jwt' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'koa-jwt/lib/get-secret' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'koa-jwt/lib/index' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'koa-jwt/lib/resolvers/auth-header' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'koa-jwt/lib/resolvers/cookie' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'koa-jwt/lib/verify' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'koa-jwt/test/test-server' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'koa-jwt/test/test' { 50 | declare module.exports: any; 51 | } 52 | 53 | // Filename aliases 54 | declare module 'koa-jwt/lib/get-secret.js' { 55 | declare module.exports: $Exports<'koa-jwt/lib/get-secret'>; 56 | } 57 | declare module 'koa-jwt/lib/index.js' { 58 | declare module.exports: $Exports<'koa-jwt/lib/index'>; 59 | } 60 | declare module 'koa-jwt/lib/resolvers/auth-header.js' { 61 | declare module.exports: $Exports<'koa-jwt/lib/resolvers/auth-header'>; 62 | } 63 | declare module 'koa-jwt/lib/resolvers/cookie.js' { 64 | declare module.exports: $Exports<'koa-jwt/lib/resolvers/cookie'>; 65 | } 66 | declare module 'koa-jwt/lib/verify.js' { 67 | declare module.exports: $Exports<'koa-jwt/lib/verify'>; 68 | } 69 | declare module 'koa-jwt/test/test-server.js' { 70 | declare module.exports: $Exports<'koa-jwt/test/test-server'>; 71 | } 72 | declare module 'koa-jwt/test/test.js' { 73 | declare module.exports: $Exports<'koa-jwt/test/test'>; 74 | } 75 | -------------------------------------------------------------------------------- /flow-typed/npm/koa-logger_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 971aa5d7f1e5d0ba393c2777c39e3995 2 | // flow-typed version: <>/koa-logger_v^3.0.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'koa-logger' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'koa-logger' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'koa-logger/index' { 29 | declare module.exports: $Exports<'koa-logger'>; 30 | } 31 | declare module 'koa-logger/index.js' { 32 | declare module.exports: $Exports<'koa-logger'>; 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/koa-passport_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: bb2f7ee71b021c2fea23339aa0c4b17c 2 | // flow-typed version: <>/koa-passport_v^3.0.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'koa-passport' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'koa-passport' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'koa-passport/lib/framework/koa' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'koa-passport/lib/framework/request' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'koa-passport/lib/index' { 34 | declare module.exports: any; 35 | } 36 | 37 | // Filename aliases 38 | declare module 'koa-passport/lib/framework/koa.js' { 39 | declare module.exports: $Exports<'koa-passport/lib/framework/koa'>; 40 | } 41 | declare module 'koa-passport/lib/framework/request.js' { 42 | declare module.exports: $Exports<'koa-passport/lib/framework/request'>; 43 | } 44 | declare module 'koa-passport/lib/index.js' { 45 | declare module.exports: $Exports<'koa-passport/lib/index'>; 46 | } 47 | -------------------------------------------------------------------------------- /flow-typed/npm/koa-router_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: db430baafabc2d55fb5f2a250e76c973 2 | // flow-typed version: <>/koa-router_v^7.2.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'koa-router' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'koa-router' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'koa-router/lib/layer' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'koa-router/lib/router' { 30 | declare module.exports: any; 31 | } 32 | 33 | // Filename aliases 34 | declare module 'koa-router/lib/layer.js' { 35 | declare module.exports: $Exports<'koa-router/lib/layer'>; 36 | } 37 | declare module 'koa-router/lib/router.js' { 38 | declare module.exports: $Exports<'koa-router/lib/router'>; 39 | } 40 | -------------------------------------------------------------------------------- /flow-typed/npm/koa_v2.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 70235df2192cd868462f3194d0e3229f 2 | // flow-typed version: c22e89bf0c/koa_v2.x.x/flow_>=v0.47.x 3 | 4 | /* 5 | * Type def from from source code of koa. 6 | * this: https://github.com/koajs/koa/commit/08eb1a20c3975230aa1fe1c693b0cd1ac7a0752b 7 | * previous: https://github.com/koajs/koa/commit/fabf5864c6a5dca0782b867a263b1b0825a05bf9 8 | * 9 | * Changelog 10 | * breaking: remove unused app.name 11 | * breaking: ctx.throw([status], [msg], [properties]) (caused by http-errors (#957) ) 12 | **/ 13 | declare module 'koa' { 14 | // Currently, import type doesnt work well ? 15 | // so copy `Server` from flow/lib/node.js#L820 16 | declare class Server extends net$Server { 17 | listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server, 18 | listen(path: string, callback?: Function): Server, 19 | listen(handle: Object, callback?: Function): Server, 20 | close(callback?: Function): Server, 21 | maxHeadersCount: number, 22 | setTimeout(msecs: number, callback: Function): Server, 23 | timeout: number, 24 | } 25 | declare type ServerType = Server; 26 | 27 | declare type JSON = | string | number | boolean | null | JSONObject | JSONArray; 28 | declare type JSONObject = { [key: string]: JSON }; 29 | declare type JSONArray = Array; 30 | 31 | declare type SimpleHeader = { 32 | 'set-cookie'?: Array, 33 | [key: string]: string, 34 | }; 35 | 36 | declare type RequestJSON = { 37 | 'method': string, 38 | 'url': string, 39 | 'header': SimpleHeader, 40 | }; 41 | declare type RequestInspect = void|RequestJSON; 42 | declare type Request = { 43 | app: Application, 44 | req: http$IncomingMessage, 45 | res: http$ServerResponse, 46 | ctx: Context, 47 | response: Response, 48 | 49 | fresh: boolean, 50 | header: SimpleHeader, 51 | headers: SimpleHeader, // alias as header 52 | host: string, 53 | hostname: string, 54 | href: string, 55 | idempotent: boolean, 56 | ip: string, 57 | ips: string[], 58 | method: string, 59 | origin: string, 60 | originalUrl: string, 61 | path: string, 62 | protocol: string, 63 | query: {[key: string]: string}, // always string 64 | querystring: string, 65 | search: string, 66 | secure: boolean, // Shorthand for ctx.protocol == "https" to check if a request was issued via TLS. 67 | socket: net$Socket, 68 | stale: boolean, 69 | subdomains: string[], 70 | type: string, 71 | url: string, 72 | 73 | charset: string|void, 74 | length: number|void, 75 | 76 | // Those functions comes from https://github.com/jshttp/accepts/blob/master/index.js 77 | // request.js$L445 78 | // https://github.com/jshttp/accepts/blob/master/test/type.js 79 | accepts: ((args: string[]) => string|false)& 80 | // ToDo: There is an issue https://github.com/facebook/flow/issues/3009 81 | // if you meet some error here, temporarily add an additional annotation 82 | // like: `request.accepts((['json', 'text']:Array))` to fix it. 83 | ((arg: string, ...args: string[]) => string|false) & 84 | ( () => string[] ) , // return the old value. 85 | 86 | // https://github.com/jshttp/accepts/blob/master/index.js#L153 87 | // https://github.com/jshttp/accepts/blob/master/test/charset.js 88 | acceptsCharsets: ( (args: string[]) => buffer$Encoding|false)& 89 | // ToDo: https://github.com/facebook/flow/issues/3009 90 | // if you meet some error here, see L70. 91 | ( (arg: string, ...args: string[]) => buffer$Encoding|false ) & 92 | ( () => string[] ), 93 | 94 | // https://github.com/jshttp/accepts/blob/master/index.js#L119 95 | // https://github.com/jshttp/accepts/blob/master/test/encoding.js 96 | acceptsEncodings: ( (args: string[]) => string|false)& 97 | // ToDo: https://github.com/facebook/flow/issues/3009 98 | // if you meet some error here, see L70. 99 | ( (arg: string, ...args: string[]) => string|false ) & 100 | ( () => string[] ), 101 | 102 | // https://github.com/jshttp/accepts/blob/master/index.js#L185 103 | // https://github.com/jshttp/accepts/blob/master/test/language.js 104 | acceptsLanguages: ( (args: string[]) => string|false) & 105 | // ToDo: https://github.com/facebook/flow/issues/3009 106 | // if you meet some error here, see L70. 107 | ( (arg: string, ...args: string[]) => string|false ) & 108 | ( () => string[] ), 109 | 110 | get: (field: string) => string, 111 | 112 | /* https://github.com/jshttp/type-is/blob/master/test/test.js 113 | * Check if the incoming request contains the "Content-Type" 114 | * header field, and it contains any of the give mime `type`s. 115 | * If there is no request body, `null` is returned. 116 | * If there is no content type, `false` is returned. 117 | * Otherwise, it returns the first `type` that matches. 118 | */ 119 | is: ( (args: string[]) => null|false|string)& 120 | ( (arg: string, ...args: string[]) => null|false|string ) & 121 | ( () => string ), // should return the mime type 122 | 123 | toJSON: () => RequestJSON, 124 | inspect: () => RequestInspect, 125 | 126 | [key: string]: mixed, // props added by middlewares. 127 | }; 128 | 129 | declare type ResponseJSON = { 130 | 'status': mixed, 131 | 'message': mixed, 132 | 'header': mixed, 133 | }; 134 | declare type ResponseInspect = { 135 | 'status': mixed, 136 | 'message': mixed, 137 | 'header': mixed, 138 | 'body': mixed, 139 | }; 140 | declare type Response = { 141 | app: Application, 142 | req: http$IncomingMessage, 143 | res: http$ServerResponse, 144 | ctx: Context, 145 | request: Request, 146 | 147 | // docs/api/response.md#L113. 148 | body: string|Buffer|stream$Stream|Object|Array|null, // JSON contains null 149 | etag: string, 150 | header: SimpleHeader, 151 | headers: SimpleHeader, // alias as header 152 | headerSent: boolean, 153 | // can be set with string|Date, but get with Date. 154 | // set lastModified(v: string|Date), // 0.36 doesn't support this. 155 | lastModified: Date, 156 | message: string, 157 | socket: net$Socket, 158 | status: number, 159 | type: string, 160 | writable: boolean, 161 | 162 | // charset: string, // doesn't find in response.js 163 | length: number|void, 164 | 165 | append: (field: string, val: string | string[]) => void, 166 | attachment: (filename?: string) => void, 167 | get: (field: string) => string, 168 | // https://github.com/jshttp/type-is/blob/master/test/test.js 169 | // https://github.com/koajs/koa/blob/v2.x/lib/response.js#L382 170 | is: ( (arg: string[]) => false|string) & 171 | ( (arg: string, ...args: string[]) => false|string ) & 172 | ( () => string ), // should return the mime type 173 | redirect: (url: string, alt?: string) => void, 174 | remove: (field: string) => void, 175 | // https://github.com/koajs/koa/blob/v2.x/lib/response.js#L418 176 | set: ((field: string, val: string | string[]) => void)& 177 | ((field: {[key: string]: string | string[]}) => void), 178 | 179 | vary: (field: string) => void, 180 | 181 | // https://github.com/koajs/koa/blob/v2.x/lib/response.js#L519 182 | toJSON(): ResponseJSON, 183 | inspect(): ResponseInspect, 184 | 185 | [key: string]: mixed, // props added by middlewares. 186 | } 187 | 188 | declare type ContextJSON = { 189 | request: RequestJSON, 190 | response: ResponseJSON, 191 | app: ApplicationJSON, 192 | originalUrl: string, 193 | req: '', 194 | res: '', 195 | socket: '', 196 | }; 197 | // https://github.com/pillarjs/cookies 198 | declare type CookiesSetOptions = { 199 | maxAge: number, // milliseconds from Date.now() for expiry 200 | expires: Date, //cookie's expiration date (expires at the end of session by default). 201 | path: string, // the path of the cookie (/ by default). 202 | domain: string, // domain of the cookie (no default). 203 | secure: boolean, // false by default for HTTP, true by default for HTTPS 204 | httpOnly: boolean, // a boolean indicating whether the cookie is only to be sent over HTTP(S), 205 | // and not made available to client JavaScript (true by default). 206 | signed: boolean, // whether the cookie is to be signed (false by default) 207 | overwrite: boolean, // whether to overwrite previously set cookies of the same name (false by default). 208 | }; 209 | declare type Cookies = { 210 | get: (name: string, options?: {signed: boolean}) => string|void, 211 | set: ((name: string, value: string, options?: CookiesSetOptions) => Context)& 212 | // delete cookie (an outbound header with an expired date is used.) 213 | ( (name: string) => Context), 214 | }; 215 | // The default props of context come from two files 216 | // `application.createContext` & `context.js` 217 | declare type Context = { 218 | accept: $PropertyType, 219 | app: Application, 220 | cookies: Cookies, 221 | name?: string, // ? 222 | originalUrl: string, 223 | req: http$IncomingMessage, 224 | request: Request, 225 | res: http$ServerResponse, 226 | respond?: boolean, // should not be used, allow bypassing koa application.js#L193 227 | response: Response, 228 | state: Object, 229 | 230 | // context.js#L55 231 | assert: (test: mixed, status: number, message?: string, opts?: mixed) => void, 232 | // context.js#L107 233 | // if (!(err instanceof Error)) err = new Error(`non-error thrown: ${err}`); 234 | onerror: (err?: mixed) => void, 235 | // context.md#L88 236 | throw: ( status: number, msg?: string, opts?: Object) => void, 237 | toJSON(): ContextJSON, 238 | inspect(): ContextJSON, 239 | 240 | // ToDo: add const for some props, 241 | // while the `const props` feature of Flow is landing in future 242 | // cherry pick from response 243 | attachment: $PropertyType, 244 | redirect: $PropertyType, 245 | remove: $PropertyType, 246 | vary: $PropertyType, 247 | set: $PropertyType, 248 | append: $PropertyType, 249 | flushHeaders: $PropertyType, 250 | status: $PropertyType, 251 | message: $PropertyType, 252 | body: $PropertyType, 253 | length: $PropertyType, 254 | type: $PropertyType, 255 | lastModified: $PropertyType, 256 | etag: $PropertyType, 257 | headerSent: $PropertyType, 258 | writable: $PropertyType, 259 | 260 | // cherry pick from request 261 | acceptsLanguages: $PropertyType, 262 | acceptsEncodings: $PropertyType, 263 | acceptsCharsets: $PropertyType, 264 | accepts: $PropertyType, 265 | get: $PropertyType, 266 | is: $PropertyType, 267 | querystring: $PropertyType, 268 | idempotent: $PropertyType, 269 | socket: $PropertyType, 270 | search: $PropertyType, 271 | method: $PropertyType, 272 | query: $PropertyType, 273 | path: $PropertyType, 274 | url: $PropertyType, 275 | origin: $PropertyType, 276 | href: $PropertyType, 277 | subdomains: $PropertyType, 278 | protocol: $PropertyType, 279 | host: $PropertyType, 280 | hostname: $PropertyType, 281 | header: $PropertyType, 282 | headers: $PropertyType, 283 | secure: $PropertyType, 284 | stale: $PropertyType, 285 | fresh: $PropertyType, 286 | ips: $PropertyType, 287 | ip: $PropertyType, 288 | 289 | [key: string]: any, // props added by middlewares. 290 | } 291 | 292 | declare type Middleware = 293 | (ctx: Context, next: () => Promise) => Promise|void; 294 | declare type ApplicationJSON = { 295 | 'subdomainOffset': mixed, 296 | 'proxy': mixed, 297 | 'env': string, 298 | }; 299 | declare class Application extends events$EventEmitter { 300 | context: Context, 301 | // request handler for node's native http server. 302 | callback: () => (req: http$IncomingMessage, res: http$ServerResponse) => void, 303 | env: string, 304 | keys?: Array|Object, // https://github.com/crypto-utils/keygrip 305 | middleware: Array, 306 | proxy: boolean, // when true proxy header fields will be trusted 307 | request: Request, 308 | response: Response, 309 | server: Server, 310 | subdomainOffset: number, 311 | 312 | listen: $PropertyType, 313 | toJSON(): ApplicationJSON, 314 | inspect(): ApplicationJSON, 315 | use(fn: Middleware): this, 316 | } 317 | 318 | declare module.exports: Class; 319 | } 320 | -------------------------------------------------------------------------------- /flow-typed/npm/lint-staged_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 81f13497de329522a77f55b50061798c 2 | // flow-typed version: <>/lint-staged_v^4.0.2/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'lint-staged' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'lint-staged' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'lint-staged/src/calcChunkSize' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'lint-staged/src/findBin' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'lint-staged/src/generateTasks' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'lint-staged/src/index' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'lint-staged/src/readConfigOption' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'lint-staged/src/runScript' { 46 | declare module.exports: any; 47 | } 48 | 49 | // Filename aliases 50 | declare module 'lint-staged/index' { 51 | declare module.exports: $Exports<'lint-staged'>; 52 | } 53 | declare module 'lint-staged/index.js' { 54 | declare module.exports: $Exports<'lint-staged'>; 55 | } 56 | declare module 'lint-staged/src/calcChunkSize.js' { 57 | declare module.exports: $Exports<'lint-staged/src/calcChunkSize'>; 58 | } 59 | declare module 'lint-staged/src/findBin.js' { 60 | declare module.exports: $Exports<'lint-staged/src/findBin'>; 61 | } 62 | declare module 'lint-staged/src/generateTasks.js' { 63 | declare module.exports: $Exports<'lint-staged/src/generateTasks'>; 64 | } 65 | declare module 'lint-staged/src/index.js' { 66 | declare module.exports: $Exports<'lint-staged/src/index'>; 67 | } 68 | declare module 'lint-staged/src/readConfigOption.js' { 69 | declare module.exports: $Exports<'lint-staged/src/readConfigOption'>; 70 | } 71 | declare module 'lint-staged/src/runScript.js' { 72 | declare module.exports: $Exports<'lint-staged/src/runScript'>; 73 | } 74 | -------------------------------------------------------------------------------- /flow-typed/npm/nodemon_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 4e5b0023dd8adf61a91dbfa64710f11a 2 | // flow-typed version: <>/nodemon_v^1.11.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'nodemon' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'nodemon' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'nodemon/bin/nodemon' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'nodemon/lib/cli/index' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'nodemon/lib/cli/parse' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'nodemon/lib/config/command' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'nodemon/lib/config/defaults' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'nodemon/lib/config/exec' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'nodemon/lib/config/index' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'nodemon/lib/config/load' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'nodemon/lib/help/index' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'nodemon/lib/index' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'nodemon/lib/monitor/index' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'nodemon/lib/monitor/match' { 70 | declare module.exports: any; 71 | } 72 | 73 | declare module 'nodemon/lib/monitor/run' { 74 | declare module.exports: any; 75 | } 76 | 77 | declare module 'nodemon/lib/monitor/watch' { 78 | declare module.exports: any; 79 | } 80 | 81 | declare module 'nodemon/lib/nodemon' { 82 | declare module.exports: any; 83 | } 84 | 85 | declare module 'nodemon/lib/rules/add' { 86 | declare module.exports: any; 87 | } 88 | 89 | declare module 'nodemon/lib/rules/index' { 90 | declare module.exports: any; 91 | } 92 | 93 | declare module 'nodemon/lib/rules/parse' { 94 | declare module.exports: any; 95 | } 96 | 97 | declare module 'nodemon/lib/spawn' { 98 | declare module.exports: any; 99 | } 100 | 101 | declare module 'nodemon/lib/utils/bus' { 102 | declare module.exports: any; 103 | } 104 | 105 | declare module 'nodemon/lib/utils/clone' { 106 | declare module.exports: any; 107 | } 108 | 109 | declare module 'nodemon/lib/utils/colour' { 110 | declare module.exports: any; 111 | } 112 | 113 | declare module 'nodemon/lib/utils/index' { 114 | declare module.exports: any; 115 | } 116 | 117 | declare module 'nodemon/lib/utils/log' { 118 | declare module.exports: any; 119 | } 120 | 121 | declare module 'nodemon/lib/utils/merge' { 122 | declare module.exports: any; 123 | } 124 | 125 | declare module 'nodemon/lib/version' { 126 | declare module.exports: any; 127 | } 128 | 129 | declare module 'nodemon/web/index' { 130 | declare module.exports: any; 131 | } 132 | 133 | // Filename aliases 134 | declare module 'nodemon/bin/nodemon.js' { 135 | declare module.exports: $Exports<'nodemon/bin/nodemon'>; 136 | } 137 | declare module 'nodemon/lib/cli/index.js' { 138 | declare module.exports: $Exports<'nodemon/lib/cli/index'>; 139 | } 140 | declare module 'nodemon/lib/cli/parse.js' { 141 | declare module.exports: $Exports<'nodemon/lib/cli/parse'>; 142 | } 143 | declare module 'nodemon/lib/config/command.js' { 144 | declare module.exports: $Exports<'nodemon/lib/config/command'>; 145 | } 146 | declare module 'nodemon/lib/config/defaults.js' { 147 | declare module.exports: $Exports<'nodemon/lib/config/defaults'>; 148 | } 149 | declare module 'nodemon/lib/config/exec.js' { 150 | declare module.exports: $Exports<'nodemon/lib/config/exec'>; 151 | } 152 | declare module 'nodemon/lib/config/index.js' { 153 | declare module.exports: $Exports<'nodemon/lib/config/index'>; 154 | } 155 | declare module 'nodemon/lib/config/load.js' { 156 | declare module.exports: $Exports<'nodemon/lib/config/load'>; 157 | } 158 | declare module 'nodemon/lib/help/index.js' { 159 | declare module.exports: $Exports<'nodemon/lib/help/index'>; 160 | } 161 | declare module 'nodemon/lib/index.js' { 162 | declare module.exports: $Exports<'nodemon/lib/index'>; 163 | } 164 | declare module 'nodemon/lib/monitor/index.js' { 165 | declare module.exports: $Exports<'nodemon/lib/monitor/index'>; 166 | } 167 | declare module 'nodemon/lib/monitor/match.js' { 168 | declare module.exports: $Exports<'nodemon/lib/monitor/match'>; 169 | } 170 | declare module 'nodemon/lib/monitor/run.js' { 171 | declare module.exports: $Exports<'nodemon/lib/monitor/run'>; 172 | } 173 | declare module 'nodemon/lib/monitor/watch.js' { 174 | declare module.exports: $Exports<'nodemon/lib/monitor/watch'>; 175 | } 176 | declare module 'nodemon/lib/nodemon.js' { 177 | declare module.exports: $Exports<'nodemon/lib/nodemon'>; 178 | } 179 | declare module 'nodemon/lib/rules/add.js' { 180 | declare module.exports: $Exports<'nodemon/lib/rules/add'>; 181 | } 182 | declare module 'nodemon/lib/rules/index.js' { 183 | declare module.exports: $Exports<'nodemon/lib/rules/index'>; 184 | } 185 | declare module 'nodemon/lib/rules/parse.js' { 186 | declare module.exports: $Exports<'nodemon/lib/rules/parse'>; 187 | } 188 | declare module 'nodemon/lib/spawn.js' { 189 | declare module.exports: $Exports<'nodemon/lib/spawn'>; 190 | } 191 | declare module 'nodemon/lib/utils/bus.js' { 192 | declare module.exports: $Exports<'nodemon/lib/utils/bus'>; 193 | } 194 | declare module 'nodemon/lib/utils/clone.js' { 195 | declare module.exports: $Exports<'nodemon/lib/utils/clone'>; 196 | } 197 | declare module 'nodemon/lib/utils/colour.js' { 198 | declare module.exports: $Exports<'nodemon/lib/utils/colour'>; 199 | } 200 | declare module 'nodemon/lib/utils/index.js' { 201 | declare module.exports: $Exports<'nodemon/lib/utils/index'>; 202 | } 203 | declare module 'nodemon/lib/utils/log.js' { 204 | declare module.exports: $Exports<'nodemon/lib/utils/log'>; 205 | } 206 | declare module 'nodemon/lib/utils/merge.js' { 207 | declare module.exports: $Exports<'nodemon/lib/utils/merge'>; 208 | } 209 | declare module 'nodemon/lib/version.js' { 210 | declare module.exports: $Exports<'nodemon/lib/version'>; 211 | } 212 | declare module 'nodemon/web/index.js' { 213 | declare module.exports: $Exports<'nodemon/web/index'>; 214 | } 215 | -------------------------------------------------------------------------------- /flow-typed/npm/passport-local_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: af698b0e12ba80bc9b0326ebb7032ce0 2 | // flow-typed version: <>/passport-local_v^1.0.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'passport-local' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'passport-local' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'passport-local/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'passport-local/lib/strategy' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'passport-local/lib/utils' { 34 | declare module.exports: any; 35 | } 36 | 37 | // Filename aliases 38 | declare module 'passport-local/lib/index.js' { 39 | declare module.exports: $Exports<'passport-local/lib/index'>; 40 | } 41 | declare module 'passport-local/lib/strategy.js' { 42 | declare module.exports: $Exports<'passport-local/lib/strategy'>; 43 | } 44 | declare module 'passport-local/lib/utils.js' { 45 | declare module.exports: $Exports<'passport-local/lib/utils'>; 46 | } 47 | -------------------------------------------------------------------------------- /flow-typed/npm/pg_v6.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 0fa8645f698c218659697bf5a3573a9c 2 | // flow-typed version: cb69951a83/pg_v6.x.x/flow_>=v0.32.x 3 | 4 | declare module pg { 5 | // Note: Currently There are some issues in Function overloading. 6 | // https://github.com/facebook/flow/issues/2423 7 | // So i temporarily remove the 8 | // `((event: string, listener: Function) => EventEmitter );` 9 | // from all overloading for EventEmitter.on(). 10 | 11 | // `any` types exised in this file, cause of currently `mixed` did not work well 12 | // in Function Overloading. 13 | 14 | // `Function` types exised in this file, cause of they come from another 15 | // untyped npm lib. 16 | 17 | /* Cause of > 31 | /* 32 | * PgPoolConfig's properties are passed unchanged to both 33 | * the node-postgres Client constructor and the node-pool constructor 34 | * allowing you to fully configure the behavior of both 35 | * node-pool (https://github.com/coopernurse/node-pool) 36 | */ 37 | declare type PgPoolConfig = { 38 | // node-pool ---------------- 39 | name: string, 40 | create: Function, 41 | destroy: Function, 42 | max: number, 43 | min: number, 44 | refreshIdle: boolean, 45 | idleTimeoutMillis: number, 46 | reapIntervalMillis: number, 47 | returnToHead: boolean, 48 | priorityRange: number, 49 | validate: Function, 50 | validateAsync: Function, 51 | log: Function, 52 | 53 | // node-postgres Client ------ 54 | //database user's name 55 | user: string, 56 | //name of database to connect 57 | database: string, 58 | //database user's password 59 | password: string, 60 | //database port 61 | port: number, 62 | // database host. defaults to localhost 63 | host?: string, 64 | // whether to try SSL/TLS to connect to server. default value: false 65 | ssl?: boolean, 66 | // name displayed in the pg_stat_activity view and included in CSV log entries 67 | // default value: process.env.PGAPPNAME 68 | application_name?: string, 69 | // fallback value for the application_name configuration parameter 70 | // default value: false 71 | fallback_application_name?: string, 72 | 73 | // pg-pool 74 | Client: mixed, 75 | Promise: mixed, 76 | onCreate: Function, 77 | }; 78 | 79 | /* 80 | * Not extends from Client, cause some of Client's functions(ex: connect and end) 81 | * should not be used by PoolClient (which returned from Pool.connect). 82 | */ 83 | declare type PoolClient = { 84 | release(error?: mixed): void, 85 | 86 | query: 87 | ( (query: QueryConfig|string, callback?: QueryCallback) => Query ) & 88 | ( (text: string, values: Array, callback?: QueryCallback) => Query ), 89 | 90 | on: 91 | ((event: 'drain', listener: () => void) => events$EventEmitter )& 92 | ((event: 'error', listener: (err: PG_ERROR) => void) => events$EventEmitter )& 93 | ((event: 'notification', listener: (message: any) => void) => events$EventEmitter )& 94 | ((event: 'notice', listener: (message: any) => void) => events$EventEmitter )& 95 | ((event: 'end', listener: () => void) => events$EventEmitter ), 96 | } 97 | 98 | declare type PoolConnectCallback = (error: PG_ERROR|null, 99 | client: PoolClient|null, done: DoneCallback) => void; 100 | declare type DoneCallback = (error?: mixed) => void; 101 | // https://github.com/facebook/flow/blob/master/lib/node.js#L581 102 | // on() returns a events$EventEmitter 103 | declare class Pool extends events$EventEmitter { 104 | constructor(options: $Shape, Client?: Class): void; 105 | connect(cb?: PoolConnectCallback): Promise; 106 | take(cb?: PoolConnectCallback): Promise; 107 | end(cb?: DoneCallback): Promise; 108 | 109 | // Note: not like the pg's Client, the Pool.query return a Promise, 110 | // not a Thenable Query which Client returned. 111 | // And there is a flow(<0.34) issue here, when Array, 112 | // the overloading will not work 113 | query: 114 | ( (query: QueryConfig|string, callback?: QueryCallback) => Promise ) & 115 | ( (text: string, values: Array, callback?: QueryCallback) => Promise); 116 | 117 | /* flow issue: https://github.com/facebook/flow/issues/2423 118 | * When this fixed, this overloading can be used. 119 | */ 120 | /* 121 | on: 122 | ((event: 'connect', listener: (client: PoolClient) => void) => events$EventEmitter )& 123 | ((event: 'acquire', listener: (client: PoolClient) => void) => events$EventEmitter )& 124 | ((event: "error", listener: (err: PG_ERROR) => void) => events$EventEmitter )& 125 | ((event: string, listener: Function) => events$EventEmitter); 126 | */ 127 | } 128 | 129 | // <<------------- copy from 'pg-pool' ------------------------------ 130 | 131 | 132 | // error 133 | declare type PG_ERROR = { 134 | name: string, 135 | length: number, 136 | severity: string, 137 | code: string, 138 | detail: string|void, 139 | hint: string|void, 140 | position: string|void, 141 | internalPosition: string|void, 142 | internalQuery: string|void, 143 | where: string|void, 144 | schema: string|void, 145 | table: string|void, 146 | column: string|void, 147 | dataType: string|void, 148 | constraint: string|void, 149 | file: string|void, 150 | line: string|void, 151 | routine: string|void 152 | }; 153 | 154 | declare type ClientConfig = { 155 | //database user's name 156 | user: string, 157 | //name of database to connect 158 | database: string, 159 | //database user's password 160 | password: string, 161 | //database port 162 | port: number, 163 | // database host. defaults to localhost 164 | host: string, 165 | // whether to try SSL/TLS to connect to server. default value: false 166 | ssl: boolean, 167 | // name displayed in the pg_stat_activity view and included in CSV log entries 168 | // default value: process.env.PGAPPNAME 169 | application_name: string, 170 | // fallback value for the application_name configuration parameter 171 | // default value: false 172 | fallback_application_name: string, 173 | } 174 | 175 | declare type Row = { 176 | [key: string]: mixed, 177 | }; 178 | declare type ResultSet = { 179 | command: string, 180 | rowCount: number, 181 | oid: number, 182 | rows: Array, 183 | }; 184 | declare type ResultBuilder = { 185 | command: string, 186 | rowCount: number, 187 | oid: number, 188 | rows: Array, 189 | addRow: (row: Row) => void, 190 | }; 191 | declare type QueryConfig = { 192 | name?: string, 193 | text: string, 194 | values?: any[], 195 | }; 196 | 197 | declare type QueryCallback = (err: PG_ERROR|null, result: ResultSet|void) => void; 198 | declare type ClientConnectCallback = (err: PG_ERROR|null, client: Client|void) => void; 199 | 200 | /* 201 | * lib/query.js 202 | * Query extends from EventEmitter in source code. 203 | * but in Flow there is no multiple extends. 204 | * And in Flow await is a `declare function $await(p: Promise | T): T;` 205 | * seems can not resolve a Thenable's value type directly 206 | * so `Query extends Promise` to make thing temporarily work. 207 | * like this: 208 | * const q = client.query('select * from some'); 209 | * q.on('row',cb); // Event 210 | * const result = await q; // or await 211 | * 212 | * ToDo: should find a better way. 213 | */ 214 | declare class Query extends Promise { 215 | then( onFulfill?: (value: ResultSet) => Promise | U, 216 | onReject?: (error: PG_ERROR) => Promise | U 217 | ): Promise; 218 | // Because then and catch return a Promise, 219 | // .then.catch will lose catch's type information PG_ERROR. 220 | catch( onReject?: (error: PG_ERROR) => ?Promise | U ): Promise; 221 | 222 | on : 223 | ((event: 'row', listener: (row: Row, result: ResultBuilder) => void) => events$EventEmitter )& 224 | ((event: 'end', listener: (result: ResultBuilder) => void) => events$EventEmitter )& 225 | ((event: 'error', listener: (err: PG_ERROR) => void) => events$EventEmitter ); 226 | } 227 | 228 | /* 229 | * lib/client.js 230 | * Note: not extends from EventEmitter, for This Type returned by on(). 231 | * Flow's EventEmitter force return a EventEmitter in on(). 232 | * ToDo: Not sure in on() if return events$EventEmitter or this will be more suitable 233 | * return this will restrict event to given literial when chain on().on().on(). 234 | * return a events$EventEmitter will fallback to raw EventEmitter, when chains 235 | */ 236 | declare class Client { 237 | constructor(config?: string | ClientConfig): void; 238 | connect(callback?: ClientConnectCallback):void; 239 | end(): void; 240 | 241 | query: 242 | ( (query: QueryConfig|string, callback?: QueryCallback) => Query ) & 243 | ( (text: string, values: Array, callback?: QueryCallback) => Query ); 244 | 245 | on: 246 | ((event: 'drain', listener: () => void) => this )& 247 | ((event: 'error', listener: (err: PG_ERROR) => void) => this )& 248 | ((event: 'notification', listener: (message: any) => void) => this )& 249 | ((event: 'notice', listener: (message: any) => void) => this )& 250 | ((event: 'end', listener: () => void) => this ); 251 | } 252 | 253 | /* 254 | * require('pg-types') 255 | */ 256 | declare type TypeParserText = (value: string) => any; 257 | declare type TypeParserBinary = (value: Buffer) => any; 258 | declare type Types = { 259 | getTypeParser: 260 | ((oid: number, format?: 'text') => TypeParserText )& 261 | ((oid: number, format: 'binary') => TypeParserBinary ); 262 | 263 | setTypeParser: 264 | ((oid: number, format?: 'text', parseFn: TypeParserText) => void )& 265 | ((oid: number, format: 'binary', parseFn: TypeParserBinary) => void)& 266 | ((oid: number, parseFn: TypeParserText) => void), 267 | } 268 | 269 | /* 270 | * lib/index.js ( class PG) 271 | */ 272 | declare class PG extends events$EventEmitter { 273 | types: Types; 274 | Client: Class; 275 | Pool: Class; 276 | Connection: mixed; //Connection is used internally by the Client. 277 | constructor(client: Client): void; 278 | native: { // native binding, have the same capability like PG 279 | types: Types; 280 | Client: Class; 281 | Pool: Class; 282 | Connection: mixed; 283 | }; 284 | // The end(),connect(),cancel() in PG is abandoned ? 285 | } 286 | 287 | // These class are not exposed by pg. 288 | declare type PoolType = Pool; 289 | declare type PGType = PG; 290 | declare type QueryType = Query; 291 | // module export, keep same structure with index.js 292 | declare module.exports: PG; 293 | } 294 | -------------------------------------------------------------------------------- /flow-typed/npm/prettier_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: ffa8cb62b35c24aac2641fd82f55089e 2 | // flow-typed version: <>/prettier_v^1.4.4/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'prettier' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'prettier' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'prettier/bin/prettier' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'prettier/parser-babylon' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'prettier/parser-flow' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'prettier/parser-graphql' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'prettier/parser-json' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'prettier/parser-parse5' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'prettier/parser-postcss' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'prettier/parser-typescript' { 54 | declare module.exports: any; 55 | } 56 | 57 | // Filename aliases 58 | declare module 'prettier/bin/prettier.js' { 59 | declare module.exports: $Exports<'prettier/bin/prettier'>; 60 | } 61 | declare module 'prettier/index' { 62 | declare module.exports: $Exports<'prettier'>; 63 | } 64 | declare module 'prettier/index.js' { 65 | declare module.exports: $Exports<'prettier'>; 66 | } 67 | declare module 'prettier/parser-babylon.js' { 68 | declare module.exports: $Exports<'prettier/parser-babylon'>; 69 | } 70 | declare module 'prettier/parser-flow.js' { 71 | declare module.exports: $Exports<'prettier/parser-flow'>; 72 | } 73 | declare module 'prettier/parser-graphql.js' { 74 | declare module.exports: $Exports<'prettier/parser-graphql'>; 75 | } 76 | declare module 'prettier/parser-json.js' { 77 | declare module.exports: $Exports<'prettier/parser-json'>; 78 | } 79 | declare module 'prettier/parser-parse5.js' { 80 | declare module.exports: $Exports<'prettier/parser-parse5'>; 81 | } 82 | declare module 'prettier/parser-postcss.js' { 83 | declare module.exports: $Exports<'prettier/parser-postcss'>; 84 | } 85 | declare module 'prettier/parser-typescript.js' { 86 | declare module.exports: $Exports<'prettier/parser-typescript'>; 87 | } 88 | -------------------------------------------------------------------------------- /flow-typed/npm/ramda_v0.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: fb41b34bb0832bbf65201e563f3ca56c 2 | // flow-typed version: ef808615f5/ramda_v0.x.x/flow_>=v0.39.x 3 | 4 | /* eslint-disable no-unused-vars, no-redeclare */ 5 | 6 | type Transformer = { 7 | '@@transducer/step': (r: A, a: *) => R, 8 | '@@transducer/init': () => A, 9 | '@@transducer/result': (result: *) => B 10 | } 11 | 12 | 13 | declare module ramda { 14 | declare type UnaryFn = (a: A) => R; 15 | declare type BinaryFn = ((a: A, b: B) => R) & ((a:A) => (b: B) => R); 16 | declare type UnarySameTypeFn = UnaryFn 17 | declare type BinarySameTypeFn = BinaryFn 18 | declare type NestedObject = { [k: string]: T | NestedObject } 19 | declare type UnaryPredicateFn = (x:T) => boolean 20 | declare type BinaryPredicateFn = (x:T, y:T) => boolean 21 | declare type BinaryPredicateFn2 = (x:T, y:S) => boolean 22 | 23 | declare interface ObjPredicate { 24 | (value: any, key: string): boolean; 25 | } 26 | 27 | declare type __CurriedFunction1 = 28 | & ((...r: [AA]) => R) 29 | declare type CurriedFunction1 = __CurriedFunction1 30 | 31 | declare type __CurriedFunction2 = 32 | & ((...r: [AA]) => CurriedFunction1) 33 | & ((...r: [AA, BB]) => R) 34 | declare type CurriedFunction2 = __CurriedFunction2 35 | 36 | declare type __CurriedFunction3 = 37 | & ((...r: [AA]) => CurriedFunction2) 38 | & ((...r: [AA, BB]) => CurriedFunction1) 39 | & ((...r: [AA, BB, CC]) => R) 40 | declare type CurriedFunction3 = __CurriedFunction3 41 | 42 | declare type __CurriedFunction4 = 43 | & ((...r: [AA]) => CurriedFunction3) 44 | & ((...r: [AA, BB]) => CurriedFunction2) 45 | & ((...r: [AA, BB, CC]) => CurriedFunction1) 46 | & ((...r: [AA, BB, CC, DD]) => R) 47 | declare type CurriedFunction4 = __CurriedFunction4 48 | 49 | declare type __CurriedFunction5 = 50 | & ((...r: [AA]) => CurriedFunction4) 51 | & ((...r: [AA, BB]) => CurriedFunction3) 52 | & ((...r: [AA, BB, CC]) => CurriedFunction2) 53 | & ((...r: [AA, BB, CC, DD]) => CurriedFunction1) 54 | & ((...r: [AA, BB, CC, DD, EE]) => R) 55 | declare type CurriedFunction5 = __CurriedFunction5 56 | 57 | declare type __CurriedFunction6 = 58 | & ((...r: [AA]) => CurriedFunction5) 59 | & ((...r: [AA, BB]) => CurriedFunction4) 60 | & ((...r: [AA, BB, CC]) => CurriedFunction3) 61 | & ((...r: [AA, BB, CC, DD]) => CurriedFunction2) 62 | & ((...r: [AA, BB, CC, DD, EE]) => CurriedFunction1) 63 | & ((...r: [AA, BB, CC, DD, EE, FF]) => R) 64 | declare type CurriedFunction6 = __CurriedFunction6 65 | 66 | declare type Curry = 67 | & (((...r: [A]) => R) => CurriedFunction1) 68 | & (((...r: [A, B]) => R) => CurriedFunction2) 69 | & (((...r: [A, B, C]) => R) => CurriedFunction3) 70 | & (((...r: [A, B, C, D]) => R) => CurriedFunction4) 71 | & (((...r: [A, B, C, D, E]) => R) => CurriedFunction5) 72 | & (((...r: [A, B, C, D, E, F]) => R) => CurriedFunction6) 73 | 74 | declare type Pipe = ((ab: UnaryFn, bc: UnaryFn, cd: UnaryFn, de: UnaryFn, ef: UnaryFn, fg: UnaryFn, ...rest: Array) => UnaryFn) 75 | & ((ab: UnaryFn, bc: UnaryFn, cd: UnaryFn, de: UnaryFn, ef: UnaryFn, ...rest: Array) => UnaryFn) 76 | & ((ab: UnaryFn, bc: UnaryFn, cd: UnaryFn, de: UnaryFn, ...rest: Array) => UnaryFn) 77 | & ((ab: UnaryFn, bc: UnaryFn, cd: UnaryFn, ...rest: Array) => UnaryFn) 78 | & ((ab: UnaryFn, bc: UnaryFn, ...rest: Array) => UnaryFn) 79 | & ((ab: UnaryFn, ...rest: Array) => UnaryFn) 80 | 81 | declare type Compose = & ((fg: UnaryFn, ef: UnaryFn, de: UnaryFn, cd: UnaryFn, bc: UnaryFn, ab: UnaryFn, ...rest: Array) => UnaryFn) 82 | & ((ef: UnaryFn, de: UnaryFn, cd: UnaryFn, bc: UnaryFn, ab: UnaryFn, ...rest: Array) => UnaryFn) 83 | & ((de: UnaryFn, cd: UnaryFn, bc: UnaryFn, ab: UnaryFn, ...rest: Array) => UnaryFn) 84 | & ((cd: UnaryFn, bc: UnaryFn, ab: UnaryFn, ...rest: Array) => UnaryFn) 85 | & ((bc: UnaryFn, ab: UnaryFn, ...rest: Array) => UnaryFn) 86 | & ((ab: UnaryFn, ...rest: Array) => UnaryFn) 87 | 88 | declare type Filter = 89 | & (|{[key:K]:V}>(fn: UnaryPredicateFn, xs:T) => T) 90 | & (|{[key:K]:V}>(fn: UnaryPredicateFn) => (xs:T) => T) 91 | 92 | 93 | declare class Monad { 94 | chain: Function 95 | } 96 | 97 | declare class Semigroup {} 98 | 99 | declare class Chain { 100 | chain|Array>(fn: (a:T) => V, x: V): V; 101 | chain|Array>(fn: (a:T) => V): (x: V) => V; 102 | } 103 | 104 | declare class GenericContructor { 105 | constructor(x: T): GenericContructor 106 | } 107 | 108 | declare class GenericContructorMulti { 109 | constructor(...args: Array): GenericContructor 110 | } 111 | 112 | 113 | /** 114 | * DONE: 115 | * Function* 116 | * List* 117 | * Logic 118 | * Math 119 | * Object* 120 | * Relation 121 | * String 122 | * Type 123 | */ 124 | 125 | declare var compose: Compose; 126 | declare var pipe: Pipe; 127 | declare var curry: Curry; 128 | declare function curryN(length: number, fn: (...args: Array) => any): Function 129 | 130 | // *Math 131 | declare var add: CurriedFunction2; 132 | declare var inc: UnaryFn; 133 | declare var dec: UnaryFn; 134 | declare var mean: UnaryFn,number>; 135 | declare var divide: CurriedFunction2 136 | declare var mathMod: CurriedFunction2; 137 | declare var median: UnaryFn,number>; 138 | declare var modulo: CurriedFunction2; 139 | declare var multiply: CurriedFunction2; 140 | declare var negate: UnaryFn; 141 | declare var product: UnaryFn,number>; 142 | declare var subtract: CurriedFunction2; 143 | declare var sum: UnaryFn,number>; 144 | 145 | // Filter 146 | declare var filter: Filter; 147 | declare var reject: Filter; 148 | 149 | // *String 150 | declare var match: CurriedFunction2>; 151 | declare var replace: CurriedFunction3; 152 | declare var split: CurriedFunction2> 153 | declare var test: CurriedFunction2 154 | declare function toLower(a: string): string; 155 | declare function toString(a: any): string; 156 | declare function toUpper(a: string): string; 157 | declare function trim(a: string): string; 158 | 159 | // *Type 160 | declare function is(t: T, ...rest: Array): (v: any) => boolean; 161 | declare function is(t: T, v: any): boolean; 162 | declare var propIs: CurriedFunction3; 163 | declare function type(x: ?any): string; 164 | declare function isArrayLike(x: any): boolean; 165 | 166 | declare function isNil(x: void|null): true; 167 | declare function isNil(x: mixed): false; 168 | 169 | // *List 170 | declare function adjust(fn:(a: T) => T, ...rest: Array): (index: number, ...rest: Array) => (src: Array) => Array; 171 | declare function adjust(fn:(a: T) => T, index: number, ...rest: Array): (src: Array) => Array; 172 | declare function adjust(fn:(a: T) => T, index: number, src: Array): Array; 173 | 174 | declare function all(fn: UnaryPredicateFn, xs: Array): boolean; 175 | declare function all(fn: UnaryPredicateFn, ...rest: Array): (xs: Array) => boolean; 176 | 177 | declare function any(fn: UnaryPredicateFn, xs: Array): boolean; 178 | declare function any(fn: UnaryPredicateFn, ...rest: Array): (xs: Array) => boolean; 179 | 180 | declare function aperture(n: number, xs: Array): Array>; 181 | declare function aperture(n: number, ...rest: Array): (xs: Array) => Array>; 182 | 183 | declare function append(x: E, xs: Array): Array 184 | declare function append(x: E, ...rest: Array): (xs: Array) => Array 185 | 186 | declare function prepend(x: E, xs: Array): Array 187 | declare function prepend(x: E, ...rest: Array): (xs: Array) => Array 188 | 189 | declare function concat|string>(x: T, y: T): T; 190 | declare function concat|string>(x: T): (y: T) => T; 191 | 192 | declare function contains|string>(x: E, xs: T): boolean 193 | declare function contains|string>(x: E, ...rest: Array): (xs: T) => boolean 194 | 195 | declare function drop|string>(n: number, ...rest: Array):(xs: T) => T; 196 | declare function drop|string>(n: number, xs: T): T; 197 | 198 | declare function dropLast|string>(n: number, ...rest: Array):(xs: T) => T; 199 | declare function dropLast|string>(n: number, xs: T): T; 200 | 201 | declare function dropLastWhile>(fn: UnaryPredicateFn, ...rest: Array): (xs:T) => T; 202 | declare function dropLastWhile>(fn: UnaryPredicateFn, xs:T): T; 203 | 204 | declare function dropWhile>(fn: UnaryPredicateFn, ...rest: Array): (xs:T) => T; 205 | declare function dropWhile>(fn: UnaryPredicateFn, xs:T): T; 206 | 207 | declare function dropRepeats>(xs:T): T; 208 | 209 | declare function dropRepeatsWith>(fn: BinaryPredicateFn, ...rest: Array): (xs:T) => T; 210 | declare function dropRepeatsWith>(fn: BinaryPredicateFn, xs:T): T; 211 | 212 | declare function groupBy(fn: (x: T) => string, xs: Array): {[key: string]: Array} 213 | declare function groupBy(fn: (x: T) => string, ...rest: Array): (xs: Array) => {[key: string]: Array} 214 | 215 | declare function groupWith|string>(fn: BinaryPredicateFn, xs: V): Array 216 | declare function groupWith|string>(fn: BinaryPredicateFn, ...rest: Array): (xs: V) => Array 217 | 218 | declare function head>(xs: V): ?T 219 | declare function head(xs: V): V 220 | 221 | declare function into,R:Array<*>|string|Object>(accum: R, xf: (a: A) => I, input: A): R 222 | declare function into,R>(accum: Transformer, xf: (a: A) => R, input: A): R 223 | 224 | declare function indexOf(x: E, xs: Array): number 225 | declare function indexOf(x: E, ...rest: Array): (xs: Array) => number 226 | 227 | declare function indexBy(fn: (x: T) => string, ...rest: Array): (xs: Array) => {[key: string]: T} 228 | declare function indexBy(fn: (x: T) => string, xs: Array): {[key: string]: T} 229 | 230 | declare function insert(index: number, ...rest: Array): (elem: T) => (src: Array) => Array 231 | declare function insert(index: number, elem: T, ...rest: Array): (src: Array) => Array 232 | declare function insert(index: number, elem: T, src: Array): Array 233 | 234 | declare function insertAll(index: number, ...rest: Array): (elem: Array) => (src: Array) => Array 235 | declare function insertAll(index: number, elems: Array, ...rest: Array): (src: Array) => Array 236 | declare function insertAll(index: number, elems: Array, src: Array): Array 237 | 238 | declare function join(x: string, xs: Array): string 239 | declare function join(x: string, ...rest: Array): (xs: Array) => string 240 | 241 | declare function last>(xs: V): ?T 242 | declare function last(xs: V): V 243 | 244 | declare function none(fn: UnaryPredicateFn, xs: Array): boolean; 245 | declare function none(fn: UnaryPredicateFn, ...rest: Array): (xs: Array) => boolean; 246 | 247 | declare function nth>(i: number, xs: T): ?V 248 | declare function nth|string>(i: number, ...rest: Array): ((xs: string) => string)&((xs: T) => ?V) 249 | declare function nth(i: number, xs: T): T 250 | 251 | declare function find|O>(fn: UnaryPredicateFn, ...rest: Array): (xs:T|O) => ?V|O; 252 | declare function find|O>(fn: UnaryPredicateFn, xs:T|O): ?V|O; 253 | declare function findLast|O>(fn: UnaryPredicateFn, ...rest: Array): (xs:T|O) => ?V|O; 254 | declare function findLast|O>(fn: UnaryPredicateFn, xs:T|O): ?V|O; 255 | 256 | declare function findIndex|{[key:K]:V}>(fn: UnaryPredicateFn, ...rest: Array): (xs:T) => number 257 | declare function findIndex|{[key:K]:V}>(fn: UnaryPredicateFn, xs:T): number 258 | declare function findLastIndex|{[key:K]:V}>(fn: UnaryPredicateFn, ...rest: Array): (xs:T) => number 259 | declare function findLastIndex|{[key:K]:V}>(fn: UnaryPredicateFn, xs:T): number 260 | 261 | declare function forEach(fn:(x:T) => ?V, xs: Array): Array 262 | declare function forEach(fn:(x:T) => ?V, ...rest: Array): (xs: Array) => Array 263 | 264 | declare function lastIndexOf(x: E, xs: Array): number 265 | declare function lastIndexOf(x: E, ...rest: Array): (xs: Array) => number 266 | 267 | declare function map(fn: (x:T) => R, xs: Array): Array; 268 | declare function map(fn: (x:T) => R, xs: S): S; 269 | declare function map(fn: (x:T) => R, ...rest: Array): ((xs: {[key: string]: T}) => {[key: string]: R}) & ((xs: Array) => Array) 270 | declare function map(fn: (x:T) => R, ...rest: Array): ((xs:S) => S) & ((xs: S) => S) 271 | declare function map(fn: (x:T) => R, xs: {[key: string]: T}): {[key: string]: R} 272 | 273 | declare type AccumIterator = (acc: R, x: A) => [R,B] 274 | declare function mapAccum(fn: AccumIterator, acc: R, xs: Array): [R, Array]; 275 | declare function mapAccum(fn: AccumIterator, ...rest: Array): (acc: R, xs: Array) => [R, Array]; 276 | 277 | declare function mapAccumRight(fn: AccumIterator, acc: R, xs: Array): [R, Array]; 278 | declare function mapAccumRight(fn: AccumIterator, ...rest: Array): (acc: R, xs: Array) => [R, Array]; 279 | 280 | declare function intersperse(x: E, xs: Array): Array 281 | declare function intersperse(x: E, ...rest: Array): (xs: Array) => Array 282 | 283 | declare function pair(a:A, b:B): [A,B] 284 | declare function pair(a:A, ...rest: Array): (b:B) => [A,B] 285 | 286 | declare function partition|{[key:K]:V}>(fn: UnaryPredicateFn, xs:T): [T,T] 287 | declare function partition|{[key:K]:V}>(fn: UnaryPredicateFn, ...rest: Array): (xs:T) => [T,T] 288 | 289 | declare function pluck|{[key:string]:V}>>(k: K, xs: T): Array 290 | declare function pluck|{[key:string]:V}>>(k: K,...rest: Array): (xs: T) => Array 291 | 292 | declare var range: CurriedFunction2>; 293 | 294 | declare function remove(from: number, ...rest: Array): ((to: number, ...rest: Array) => (src: Array) => Array) & ((to: number, src: Array) => Array) 295 | declare function remove(from: number, to: number, ...rest: Array): (src: Array) => Array 296 | declare function remove(from: number, to: number, src: Array): Array 297 | 298 | declare function repeat(x: T, times: number): Array 299 | declare function repeat(x: T, ...rest: Array): (times: number) => Array 300 | 301 | declare function slice|string>(from: number, ...rest: Array): ((to: number, ...rest: Array) => (src: T) => T) & ((to: number, src: T) => T) 302 | declare function slice|string>(from: number, to: number, ...rest: Array): (src: T) => T 303 | declare function slice|string>(from: number, to: number, src: T): T 304 | 305 | declare function sort>(fn: (a:V, b:V) => number, xs:T): T 306 | declare function sort>(fn: (a:V, b:V) => number, ...rest: Array): (xs:T) => T 307 | 308 | declare function times(fn:(i: number) => T, n: number): Array 309 | declare function times(fn:(i: number) => T, ...rest: Array): (n: number) => Array 310 | 311 | declare function take|string>(n: number, xs: T): T; 312 | declare function take|string>(n: number):(xs: T) => T; 313 | 314 | declare function takeLast|string>(n: number, xs: T): T; 315 | declare function takeLast|string>(n: number):(xs: T) => T; 316 | 317 | declare function takeLastWhile>(fn: UnaryPredicateFn, xs:T): T; 318 | declare function takeLastWhile>(fn: UnaryPredicateFn): (xs:T) => T; 319 | 320 | declare function takeWhile>(fn: UnaryPredicateFn, xs:T): T; 321 | declare function takeWhile>(fn: UnaryPredicateFn): (xs:T) => T; 322 | 323 | declare function unfold(fn: (seed: T) => [R, T]|boolean, ...rest: Array): (seed: T) => Array 324 | declare function unfold(fn: (seed: T) => [R, T]|boolean, seed: T): Array 325 | 326 | declare function uniqBy(fn:(x: T) => V, ...rest: Array): (xs: Array) => Array 327 | declare function uniqBy(fn:(x: T) => V, xs: Array): Array 328 | 329 | declare function uniqWith(fn: BinaryPredicateFn, ...rest: Array): (xs: Array) => Array 330 | declare function uniqWith(fn: BinaryPredicateFn, xs: Array): Array 331 | 332 | declare function update(index: number, ...rest: Array): ((elem: T, ...rest: Array) => (src: Array) => Array) & ((elem: T, src: Array) => Array) 333 | declare function update(index: number, elem: T, ...rest: Array): (src: Array) => Array 334 | declare function update(index: number, elem: T, src: Array): Array 335 | 336 | // TODO `without` as a transducer 337 | declare function without(xs: Array, src: Array): Array 338 | declare function without(xs: Array, ...rest: Array): (src: Array) => Array 339 | 340 | declare function xprod(xs: Array, ys: Array): Array<[T,S]> 341 | declare function xprod(xs: Array, ...rest: Array): (ys: Array) => Array<[T,S]> 342 | 343 | declare function zip(xs: Array, ys: Array): Array<[T,S]> 344 | declare function zip(xs: Array, ...rest: Array): (ys: Array) => Array<[T,S]> 345 | 346 | declare function zipObj(xs: Array, ys: Array): {[key:T]:S} 347 | declare function zipObj(xs: Array, ...rest: Array): (ys: Array) => {[key:T]:S} 348 | 349 | declare type NestedArray = Array> 350 | declare function flatten(xs: NestedArray): Array; 351 | 352 | declare function fromPairs(pair: Array<[T,V]>): {[key: string]:V}; 353 | 354 | declare function init|string>(xs: V): V; 355 | 356 | declare function length(xs: Array): number; 357 | 358 | declare function mergeAll(objs: Array<{[key: string]: any}>):{[key: string]: any}; 359 | 360 | declare function reverse|string>(xs: V): V; 361 | 362 | declare function reduce(fn: (acc: A, elem: B) => A, ...rest: Array): ((init: A, xs: Array) => A) & ((init: A, ...rest: Array) => (xs: Array) => A); 363 | declare function reduce(fn: (acc: A, elem: B) => A, init: A, ...rest: Array): (xs: Array) => A; 364 | declare function reduce(fn: (acc: A, elem: B) => A, init: A, xs: Array): A; 365 | 366 | declare function reduceBy(fn: (acc: B, elem: A) => B, ...rest: Array): 367 | ((acc: B, ...rest: Array) => ((keyFn:(elem: A) => string, ...rest: Array) => (xs: Array) => {[key: string]: B}) & ((keyFn:(elem: A) => string, xs: Array) => {[key: string]: B})) 368 | & ((acc: B, keyFn:(elem: A) => string, ...rest: Array) => (xs: Array) => {[key: string]: B}) 369 | & ((acc: B, keyFn:(elem: A) => string, xs: Array) => {[key: string]: B}) 370 | declare function reduceBy(fn: (acc: B, elem: A) => B, acc: B, ...rest: Array): 371 | ((keyFn:(elem: A) => string, ...rest: Array) => (xs: Array) => {[key: string]: B}) 372 | & ((keyFn:(elem: A) => string, xs: Array) => {[key: string]: B}) 373 | declare function reduceBy(fn: (acc: B, elem: A) => B, acc: B, keyFn:(elem: A) => string): (xs: Array) => {[key: string]: B}; 374 | declare function reduceBy(fn: (acc: B, elem: A) => B, acc: B, keyFn:(elem: A) => string, xs: Array): {[key: string]: B}; 375 | 376 | declare function reduceRight(fn: (acc: A, elem: B) => A, ...rest: Array): ((init: A, xs: Array) => A) & ((init: A, ...rest: Array) => (xs: Array) => A); 377 | declare function reduceRight(fn: (acc: A, elem: B) => A, init: A, ...rest: Array): (xs: Array) => A; 378 | declare function reduceRight(fn: (acc: A, elem: B) => A, init: A, xs: Array): A; 379 | 380 | declare function scan(fn: (acc: A, elem: B) => A, ...rest: Array): ((init: A, xs: Array) => Array) & ((init: A, ...rest: Array) => (xs: Array) => Array); 381 | declare function scan(fn: (acc: A, elem: B) => A, init: A, ...rest: Array): (xs: Array) => Array; 382 | declare function scan(fn: (acc: A, elem: B) => A, init: A, xs: Array): Array; 383 | 384 | declare function splitAt|string>(i: number, xs: T): [T,T]; 385 | declare function splitAt|string>(i: number): (xs: T) => [T,T]; 386 | declare function splitEvery|string>(i: number, xs: T): Array; 387 | declare function splitEvery|string>(i: number): (xs: T) => Array; 388 | declare function splitWhen>(fn: UnaryPredicateFn, xs:T): [T,T]; 389 | declare function splitWhen>(fn: UnaryPredicateFn): (xs:T) => [T,T]; 390 | 391 | declare function tail|string>(xs: V): V; 392 | 393 | declare function transpose(xs: Array>): Array>; 394 | 395 | declare function uniq(xs: Array): Array; 396 | 397 | declare function unnest(xs: NestedArray): NestedArray; 398 | 399 | declare function zipWith(fn: (a: T, b: S) => R, ...rest: Array): ((xs: Array, ys: Array) => Array) & ((xs: Array, ...rest: Array ) => (ys: Array) => Array) 400 | declare function zipWith(fn: (a: T, b: S) => R, xs: Array, ...rest: Array): (ys: Array) => Array; 401 | declare function zipWith(fn: (a: T, b: S) => R, xs: Array, ys: Array): Array; 402 | 403 | // *Relation 404 | declare function equals(x: T, ...rest: Array): (y: T) => boolean; 405 | declare function equals(x: T, y: T): boolean; 406 | 407 | declare function eqBy(fn: (x: A) => B, ...rest: Array): ((x: A, y: A) => boolean) & ((x: A, ...rest: Array) => (y: A) => boolean); 408 | declare function eqBy(fn: (x: A) => B, x: A, ...rest: Array): (y: A) => boolean; 409 | declare function eqBy(fn: (x: A) => B, x: A, y: A): boolean; 410 | 411 | declare function propEq(prop: string, ...rest: Array): ((val: *, o: {[k:string]: *}) => boolean) & ((val: *, ...rest: Array) => (o: {[k:string]: *}) => boolean) 412 | declare function propEq(prop: string, val: *, ...rest: Array): (o: {[k:string]: *}) => boolean; 413 | declare function propEq(prop: string, val: *, o: {[k:string]:*}): boolean; 414 | 415 | declare function pathEq(path: Array, ...rest: Array): ((val: any, o: Object) => boolean) & ((val: any, ...rest: Array) => (o: Object) => boolean); 416 | declare function pathEq(path: Array, val: any, ...rest: Array): (o: Object) => boolean; 417 | declare function pathEq(path: Array, val: any, o: Object): boolean; 418 | 419 | declare function clamp(min: T, ...rest: Array): 420 | ((max: T, ...rest: Array) => (v: T) => T) & ((max: T, v: T) => T); 421 | declare function clamp(min: T, max: T, ...rest: Array): (v: T) => T; 422 | declare function clamp(min: T, max: T, v: T): T; 423 | 424 | declare function countBy(fn: (x: T) => string, ...rest: Array): (list: Array) => {[key: string]: number}; 425 | declare function countBy(fn: (x: T) => string, list: Array): {[key: string]: number}; 426 | 427 | declare function difference(xs1: Array, ...rest: Array): (xs2: Array) => Array; 428 | declare function difference(xs1: Array, xs2: Array): Array; 429 | 430 | declare function differenceWith(fn: BinaryPredicateFn, ...rest: Array): ((xs1: Array) => (xs2: Array) => Array) & ((xs1: Array, xs2: Array) => Array); 431 | declare function differenceWith(fn: BinaryPredicateFn, xs1: Array, ...rest: Array): (xs2: Array) => Array; 432 | declare function differenceWith(fn: BinaryPredicateFn, xs1: Array, xs2: Array): Array; 433 | 434 | declare function eqBy(fn: (x: T) => T, x: T, y: T): boolean; 435 | declare function eqBy(fn: (x: T) => T): (x: T, y: T) => boolean; 436 | declare function eqBy(fn: (x: T) => T, x: T): (y: T) => boolean; 437 | declare function eqBy(fn: (x: T) => T): (x: T) => (y: T) => boolean; 438 | 439 | declare function gt(x: T, ...rest: Array): (y: T) => boolean; 440 | declare function gt(x: T, y: T): boolean; 441 | 442 | declare function gte(x: T, ...rest: Array): (y: T) => boolean; 443 | declare function gte(x: T, y: T): boolean; 444 | 445 | declare function identical(x: T, ...rest: Array): (y: T) => boolean; 446 | declare function identical(x: T, y: T): boolean; 447 | 448 | declare function intersection(x: Array, y: Array): Array; 449 | declare function intersection(x: Array): (y: Array) => Array; 450 | 451 | declare function intersectionWith(fn: BinaryPredicateFn, ...rest: Array): ((x: Array, y: Array) => Array) & ((x: Array) => (y: Array) => Array); 452 | declare function intersectionWith(fn: BinaryPredicateFn, x: Array, ...rest: Array): (y: Array) => Array; 453 | declare function intersectionWith(fn: BinaryPredicateFn, x: Array, y: Array): Array; 454 | 455 | declare function lt(x: T, ...rest: Array): (y: T) => boolean; 456 | declare function lt(x: T, y: T): boolean; 457 | 458 | declare function lte(x: T, ...rest: Array): (y: T) => boolean; 459 | declare function lte(x: T, y: T): boolean; 460 | 461 | declare function max(x: T, ...rest: Array): (y: T) => T; 462 | declare function max(x: T, y: T): T; 463 | 464 | declare function maxBy(fn: (x:T) => V, ...rest: Array): ((x: T, y: T) => T) & ((x: T) => (y: T) => T); 465 | declare function maxBy(fn: (x:T) => V, x: T, ...rest: Array): (y: T) => T; 466 | declare function maxBy(fn: (x:T) => V, x: T, y: T): T; 467 | 468 | declare function min(x: T, ...rest: Array): (y: T) => T; 469 | declare function min(x: T, y: T): T; 470 | 471 | declare function minBy(fn: (x:T) => V, ...rest: Array): ((x: T, y: T) => T) & ((x: T) => (y: T) => T); 472 | declare function minBy(fn: (x:T) => V, x: T, ...rest: Array): (y: T) => T; 473 | declare function minBy(fn: (x:T) => V, x: T, y: T): T; 474 | 475 | // TODO: sortBy: Started failing in v38... 476 | // declare function sortBy(fn: (x:T) => V, ...rest: Array): (x: Array) => Array; 477 | // declare function sortBy(fn: (x:T) => V, x: Array): Array; 478 | 479 | declare function symmetricDifference(x: Array, ...rest: Array): (y: Array) => Array; 480 | declare function symmetricDifference(x: Array, y: Array): Array; 481 | 482 | declare function symmetricDifferenceWith(fn: BinaryPredicateFn, ...rest: Array): ((x: Array, ...rest: Array) => (y: Array) => Array) & ((x: Array, y: Array) => Array); 483 | declare function symmetricDifferenceWith(fn: BinaryPredicateFn, x: Array, ...rest: Array): (y: Array) => Array; 484 | declare function symmetricDifferenceWith(fn: BinaryPredicateFn, x: Array, y: Array): Array; 485 | 486 | declare function union(x: Array, ...rest: Array): (y: Array) => Array; 487 | declare function union(x: Array, y: Array): Array; 488 | 489 | declare function unionWith(fn: BinaryPredicateFn, ...rest: Array): ((x: Array, ...rest: Array) => (y: Array) => Array) & (x: Array, y: Array) => Array; 490 | declare function unionWith(fn: BinaryPredicateFn, x: Array, ...rest: Array): (y: Array) => Array; 491 | declare function unionWith(fn: BinaryPredicateFn, x: Array, y: Array): Array; 492 | 493 | // *Object 494 | declare function assoc(key: string, ...args: Array): 495 | ((val: T, ...rest: Array) => (src: {[k:string]:S}) => {[k:string]:S|T}) & ((val: T, src: {[k:string]:S}) => {[k:string]:S|T}); 496 | declare function assoc(key: string, val:T, ...args: Array): (src: {[k:string]:S}) => {[k:string]:S|T}; 497 | declare function assoc(key: string, val: T, src: {[k:string]:S}): {[k:string]:S|T}; 498 | 499 | declare function assocPath(key: Array, ...args: Array): 500 | ((val: T, ...rest: Array) => (src: {[k:string]:S}) => {[k:string]:S|T}) 501 | & ((val: T) => (src: {[k:string]:S}) => {[k:string]:S|T}); 502 | declare function assocPath(key: Array, val:T, ...args: Array): (src: {[k:string]:S}) => {[k:string]:S|T}; 503 | declare function assocPath(key: Array, val:T, src: {[k:string]:S}): {[k:string]:S|T}; 504 | 505 | declare function clone(src: T): $Shape; 506 | 507 | declare function dissoc(key: string, ...args: Array): 508 | ((val: T, ...rest: Array) => (src: {[k:string]:T}) => {[k:string]:T}) & ((val: T, src: {[k:string]:T}) => {[k:string]:T}); 509 | declare function dissoc(key: string, val:T, ...args: Array): (src: {[k:string]:T}) => {[k:string]:T}; 510 | declare function dissoc(key: string, val: T, src: {[k:string]:T}): {[k:string]:T}; 511 | 512 | declare function dissocPath(key: Array, ...args: Array): 513 | ((val: T, ...rest: Array) => (src: {[k:string]:T}) => {[k:string]:T}) 514 | & ((val: T) => (src: {[k:string]:T}) => {[k:string]:T}); 515 | declare function dissocPath(key: Array, val:T, ...args: Array): (src: {[k:string]:T}) => {[k:string]:T}; 516 | declare function dissocPath(key: Array, val:T, src: {[k:string]:T}): {[k:string]:T}; 517 | 518 | // TODO: Started failing in v31... (Attempt to fix below) 519 | // declare type __UnwrapNestedObjectR U>> = U 520 | // declare type UnwrapNestedObjectR = UnwrapNestedObjectR<*, *, T> 521 | // 522 | // declare function evolve R>>(fn: T, ...rest: Array): (src: NestedObject) => UnwrapNestedObjectR; 523 | // declare function evolve R>>(fn: T, src: NestedObject): UnwrapNestedObjectR; 524 | 525 | declare function eqProps(key: string, ...args: Array): 526 | ((o1: Object, ...rest: Array) => (o2: Object) => boolean) 527 | & ((o1: Object, o2: Object) => boolean); 528 | declare function eqProps(key: string, o1: Object, ...args: Array): (o2: Object) => boolean; 529 | declare function eqProps(key: string, o1: Object, o2: Object): boolean; 530 | 531 | declare function has(key: string, o: Object): boolean; 532 | declare function has(key: string):(o: Object) => boolean; 533 | 534 | declare function hasIn(key: string, o: Object): boolean; 535 | declare function hasIn(key: string): (o: Object) => boolean; 536 | 537 | declare function invert(o: Object): {[k: string]: Array}; 538 | declare function invertObj(o: Object): {[k: string]: string}; 539 | 540 | declare function keys(o: Object): Array; 541 | 542 | /* TODO 543 | lens 544 | lensIndex 545 | lensPath 546 | lensProp 547 | */ 548 | 549 | declare function mapObjIndexed(fn: (val: A, key: string, o: Object) => B, o: {[key: string]: A}): {[key: string]: B}; 550 | declare function mapObjIndexed(fn: (val: A, key: string, o: Object) => B, ...args: Array): (o: {[key: string]: A}) => {[key: string]: B}; 551 | 552 | declare function merge(o1: A, ...rest: Array): (o2: B) => A & B; 553 | declare function merge(o1: A, o2: B): A & B; 554 | 555 | declare function mergeAll(os: Array<{[k:string]:T}>): {[k:string]:T}; 556 | 557 | declare function mergeWith(fn: (v1: T, v2: S) => R): 558 | ((o1: A, ...rest: Array) => (o2: B) => A & B) & ((o1: A, o2: B) => A & B); 559 | declare function mergeWith(fn: (v1: T, v2: S) => R, o1: A, o2: B): A & B; 560 | declare function mergeWith(fn: (v1: T, v2: S) => R, o1: A, ...rest: Array): (o2: B) => A & B; 561 | 562 | declare function mergeWithKey(fn: (key: $Keys, v1: T, v2: S) => R): 563 | ((o1: A, ...rest: Array) => (o2: B) => A & B) & ((o1: A, o2: B) => A & B); 564 | declare function mergeWithKey(fn: (key: $Keys, v1: T, v2: S) => R, o1: A, o2: B): A & B; 565 | declare function mergeWithKey(fn: (key: $Keys, v1: T, v2: S) => R, o1: A, ...rest: Array): (o2: B) => A & B; 566 | 567 | declare function objOf(key: string, ...rest: Array): (val: T) => {[key: string]: T}; 568 | declare function objOf(key: string, val: T): {[key: string]: T}; 569 | 570 | declare function omit(keys: Array<$Keys>, ...rest: Array): (val: T) => Object; 571 | declare function omit(keys: Array<$Keys>, val: T): Object; 572 | 573 | // TODO over 574 | 575 | declare function path(p: Array, ...rest: Array): (o: NestedObject) => V; 576 | declare function path(p: Array, ...rest: Array): (o: null|void) => void; 577 | declare function path(p: Array, ...rest: Array): (o: mixed) => ?V; 578 | declare function path>(p: Array, o: A): V; 579 | declare function path(p: Array, o: A): void; 580 | declare function path(p: Array, o: A): ?V; 581 | 582 | declare function path(p: Array, ...rest: Array): (o: NestedObject) => V; 583 | declare function path(p: Array, ...rest: Array): (o: null|void) => void; 584 | declare function path(p: Array, ...rest: Array): (o: mixed) => ?V; 585 | declare function path>(p: Array, o: A): V; 586 | declare function path(p: Array, o: A): void; 587 | declare function path(p: Array, o: A): ?V; 588 | 589 | declare function pathOr>(or: T, ...rest: Array): 590 | ((p: Array, ...rest: Array) => (o: ?A) => V|T) 591 | & ((p: Array, o: ?A) => V|T); 592 | declare function pathOr>(or: T, p: Array, ...rest: Array): (o: ?A) => V|T; 593 | declare function pathOr>(or: T, p: Array, o: ?A): V|T; 594 | 595 | declare function pick(keys: Array, ...rest: Array): (val: {[key:string]: A}) => {[key:string]: A}; 596 | declare function pick(keys: Array, val: {[key:string]: A}): {[key:string]: A}; 597 | 598 | declare function pickAll(keys: Array, ...rest: Array): (val: {[key:string]: A}) => {[key:string]: ?A}; 599 | declare function pickAll(keys: Array, val: {[key:string]: A}): {[key:string]: ?A}; 600 | 601 | declare function pickBy(fn: BinaryPredicateFn2, ...rest: Array): (val: {[key:string]: A}) => {[key:string]: A}; 602 | declare function pickBy(fn: BinaryPredicateFn2, val: {[key:string]: A}): {[key:string]: A}; 603 | 604 | declare function project(keys: Array, ...rest: Array): (val: Array<{[key:string]: T}>) => Array<{[key:string]: T}>; 605 | declare function project(keys: Array, val: Array<{[key:string]: T}>): Array<{[key:string]: T}>; 606 | 607 | declare function prop(key: $Keys, ...rest: Array): (o: O) => ?T; 608 | declare function prop(key: $Keys, o: O): ?T; 609 | 610 | declare function propOr(or: T, ...rest: Array): 611 | ((p: $Keys, ...rest: Array) => (o: A) => V|T) 612 | & ((p: $Keys, o: A) => V|T); 613 | declare function propOr(or: T, p: $Keys, ...rest: Array): (o: A) => V|T; 614 | declare function propOr(or: T, p: $Keys, o: A): V|T; 615 | 616 | declare function keysIn(o: Object): Array; 617 | 618 | declare function props(keys: Array<$Keys>, ...rest: Array): (o: O) => Array; 619 | declare function props(keys: Array<$Keys>, o: O): Array; 620 | 621 | // TODO set 622 | 623 | declare function toPairs(o: O): Array<[$Keys, T]>; 624 | 625 | declare function toPairsIn(o: O): Array<[string, T]>; 626 | 627 | 628 | declare function values(o: O): Array; 629 | 630 | declare function valuesIn(o: O): Array; 631 | 632 | declare function where(predObj: {[key: string]: UnaryPredicateFn}, ...rest: Array): (o: {[k:string]:T}) => boolean; 633 | declare function where(predObj: {[key: string]: UnaryPredicateFn}, o: {[k:string]:T}): boolean; 634 | 635 | declare function whereEq(predObj: O, ...rest: Array): (o: $Shape) => boolean; 636 | declare function whereEq(predObj: O, o: $Shape): boolean; 637 | 638 | // TODO view 639 | 640 | // *Function 641 | declare var __: *; 642 | 643 | declare var T: (_: any) => true; 644 | declare var F: (_: any) => false; 645 | 646 | declare function addIndex(iterFn:(fn:(x:A) => B, xs: Array) => Array): (fn: (x: A, idx: number, xs: Array) => B, xs: Array) => Array; 647 | 648 | declare function always(x:T): (x: any) => T; 649 | 650 | declare function ap(fns: Array<(x:T) => V>, ...rest: Array): (xs: Array) => Array; 651 | declare function ap(fns: Array<(x:T) => V>, xs: Array): Array; 652 | 653 | declare function apply(fn: (...args: Array) => V, ...rest: Array): (xs: Array) => V; 654 | declare function apply(fn: (...args: Array) => V, xs: Array): V; 655 | 656 | declare function applySpec, T: NestedObject<(...args: A) => S>>(spec: T): (...args: A) => NestedObject 657 | 658 | declare function binary(fn:(...args: Array) => T): (x: any, y: any) => T; 659 | 660 | declare function bind(fn: (...args: Array) => any, thisObj: T): (...args: Array) => any; 661 | 662 | declare function call(fn: (...args: Array) => T, ...args: Array): T; 663 | 664 | declare function comparator(fn: BinaryPredicateFn): (x:T, y:T) => number; 665 | 666 | // TODO add tests 667 | declare function construct(ctor: Class>): (x: T) => GenericContructor; 668 | 669 | // TODO add tests 670 | declare function constructN(n: number, ctor: Class>): (...args: any) => GenericContructorMulti; 671 | 672 | // TODO make less generic 673 | declare function converge(after: Function, fns: Array): Function; 674 | 675 | declare function empty(x: T): T; 676 | 677 | declare function flip(fn: (arg0: A, arg1: B) => TResult): CurriedFunction2; 678 | declare function flip(fn: (arg0: A, arg1: B, arg2: C) => TResult): (( arg0: B, arg1: A, ...rest: Array) => (arg2: C) => TResult) & (( arg0: B, arg1: A, arg2: C) => TResult); 679 | declare function flip(fn: (arg0: A, arg1: B, arg2: C, arg3: D) => TResult): ((arg1: B, arg0: A, ...rest: Array) => (arg2: C, arg3: D) => TResult) & ((arg1: B, arg0: A, arg2: C, arg3: D) => TResult); 680 | declare function flip(fn: (arg0: A, arg1: B, arg2: C, arg3: D, arg4:E) => TResult): ((arg1: B, arg0: A, ...rest: Array) => (arg2: C, arg3: D, arg4: E) => TResult) & ((arg1: B, arg0: A, arg2: C, arg3: D, arg4: E) => TResult); 681 | 682 | declare function identity(x:T): T; 683 | 684 | declare function invoker(arity: number, name: $Enum): CurriedFunction2 & CurriedFunction3 & CurriedFunction4 685 | 686 | declare function juxt(fns: Array<(...args: Array) => T>): (...args: Array) => Array; 687 | 688 | // TODO lift 689 | 690 | // TODO liftN 691 | 692 | declare function memoize) => B>(fn:T):T; 693 | 694 | declare function nAry(arity: number, fn:(...args: Array) => T): (...args: Array) => T; 695 | 696 | declare function nthArg(n: number): (...args: Array) => T; 697 | 698 | declare function of(x: T): Array; 699 | 700 | declare function once) => B>(fn:T):T; 701 | 702 | // TODO partial 703 | // TODO partialRight 704 | // TODO pipeK 705 | // TODO pipeP 706 | 707 | declare function tap(fn: (x: T) => any, ...rest: Array): (x: T) => T; 708 | declare function tap(fn: (x: T) => any, x: T): T; 709 | 710 | // TODO tryCatch 711 | 712 | declare function unapply(fn: (xs: Array) => V): (...args: Array) => V; 713 | 714 | declare function unary(fn:(...args: Array) => T): (x: any) => T; 715 | 716 | declare var uncurryN: 717 | & ((2, A => B => C) => (A, B) => C) 718 | & ((3, A => B => C => D) => (A, B, C) => D) 719 | & ((4, A => B => C => D => E) => (A, B, C, D) => E) 720 | & ((5, A => B => C => D => E => F) => (A, B, C, D, E) => F) 721 | & ((6, A => B => C => D => E => F => G) => (A, B, C, D, E, F) => G) 722 | & ((7, A => B => C => D => E => F => G => H) => (A, B, C, D, E, F, G) => H) 723 | & ((8, A => B => C => D => E => F => G => H => I) => (A, B, C, D, E, F, G, H) => I) 724 | 725 | //TODO useWith 726 | 727 | declare function wrap) => B>(fn: F, fn2: (fn: F, ...args: Array) => D): (...args: Array) => D; 728 | 729 | // *Logic 730 | 731 | declare function allPass(fns: Array<(...args: Array) => boolean>): (...args: Array) => boolean; 732 | 733 | declare function and(x: boolean, ...rest: Array): (y: boolean) => boolean; 734 | declare function and(x: boolean, y: boolean): boolean; 735 | 736 | declare function anyPass(fns: Array<(...args: Array) => boolean>): (...args: Array) => boolean; 737 | 738 | declare function both(x: (...args: Array) => boolean, ...rest: Array): (y: (...args: Array) => boolean) => (...args: Array) => boolean; 739 | declare function both(x: (...args: Array) => boolean, y: (...args: Array) => boolean): (...args: Array) => boolean; 740 | 741 | declare function complement(x: (...args: Array) => boolean): (...args: Array) => boolean; 742 | 743 | declare function cond(fns: Array<[(...args: Array) => boolean, (...args: Array) => B]>): (...args: Array) => B; 744 | 745 | 746 | declare function defaultTo(d: T, ...rest: Array): (x: ?V) => V|T; 747 | declare function defaultTo(d: T, x: ?V): V|T; 748 | 749 | declare function either(x: (...args: Array) => *, ...rest: Array): (y: (...args: Array) => *) => (...args: Array) => *; 750 | declare function either(x: (...args: Array) => *, y: (...args: Array) => *): (...args: Array) => *; 751 | 752 | declare function ifElse(cond:(...args: Array) => boolean, ...rest: Array): 753 | ((f1: (...args: Array) => B, ...rest: Array) => (f2: (...args: Array) => C) => (...args: Array) => B|C) 754 | & ((f1: (...args: Array) => B, f2: (...args: Array) => C) => (...args: Array) => B|C) 755 | declare function ifElse( 756 | cond:(...args: Array) => boolean, 757 | f1: (...args: Array) => B, 758 | f2: (...args: Array) => C 759 | ): (...args: Array) => B|C; 760 | 761 | declare function isEmpty(x:?Array|Object|string): boolean; 762 | 763 | declare function not(x:boolean): boolean; 764 | 765 | declare function or(x: boolean, y: boolean): boolean; 766 | declare function or(x: boolean): (y: boolean) => boolean; 767 | 768 | // TODO: pathSatisfies: Started failing in v39... 769 | // declare function pathSatisfies(cond: (x: T) => boolean, path: Array, o: NestedObject): boolean; 770 | // declare function pathSatisfies(cond: (x: T) => boolean, path: Array, ...rest: Array): (o: NestedObject) => boolean; 771 | // declare function pathSatisfies(cond: (x: T) => boolean, ...rest: Array): 772 | // ((path: Array, ...rest: Array) => (o: NestedObject) => boolean) 773 | // & ((path: Array, o: NestedObject) => boolean) 774 | 775 | declare function propSatisfies(cond: (x: T) => boolean, prop: string, o: NestedObject): boolean; 776 | declare function propSatisfies(cond: (x: T) => boolean, prop: string, ...rest: Array): (o: NestedObject) => boolean; 777 | declare function propSatisfies(cond: (x: T) => boolean, ...rest: Array): 778 | ((prop: string, ...rest: Array) => (o: NestedObject) => boolean) 779 | & ((prop: string, o: NestedObject) => boolean) 780 | 781 | declare function unless(pred: UnaryPredicateFn, ...rest: Array): 782 | ((fn: (x: S) => V, ...rest: Array) => (x: T|S) => T|V) 783 | & ((fn: (x: S) => V, x: T|S) => T|V); 784 | declare function unless(pred: UnaryPredicateFn, fn: (x: S) => V, ...rest: Array): (x: T|S) => V|T; 785 | declare function unless(pred: UnaryPredicateFn, fn: (x: S) => V, x: T|S): T|V; 786 | 787 | declare function until(pred: UnaryPredicateFn, ...rest: Array): 788 | ((fn: (x: T) => T, ...rest: Array) => (x: T) => T) 789 | & ((fn: (x: T) => T, x: T) => T); 790 | declare function until(pred: UnaryPredicateFn, fn: (x: T) => T, ...rest: Array): (x: T) => T; 791 | declare function until(pred: UnaryPredicateFn, fn: (x: T) => T, x: T): T; 792 | 793 | declare function when(pred: UnaryPredicateFn, ...rest: Array): 794 | ((fn: (x: S) => V, ...rest: Array) => (x: T|S) => T|V) 795 | & ((fn: (x: S) => V, x: T|S) => T|V); 796 | declare function when(pred: UnaryPredicateFn, fn: (x: S) => V, ...rest: Array): (x: T|S) => V|T; 797 | declare function when(pred: UnaryPredicateFn, fn: (x: S) => V, x: T|S): T|V; 798 | } 799 | -------------------------------------------------------------------------------- /flow-typed/npm/sqlite3_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 42a3ccc722d486446361b9bb59c6dc3b 2 | // flow-typed version: <>/sqlite3_v^3.1.8/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'sqlite3' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'sqlite3' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'sqlite3/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'sqlite3/lib/sqlite3' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'sqlite3/lib/trace' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'sqlite3/sqlite3' { 38 | declare module.exports: any; 39 | } 40 | 41 | // Filename aliases 42 | declare module 'sqlite3/lib/index.js' { 43 | declare module.exports: $Exports<'sqlite3/lib/index'>; 44 | } 45 | declare module 'sqlite3/lib/sqlite3.js' { 46 | declare module.exports: $Exports<'sqlite3/lib/sqlite3'>; 47 | } 48 | declare module 'sqlite3/lib/trace.js' { 49 | declare module.exports: $Exports<'sqlite3/lib/trace'>; 50 | } 51 | declare module 'sqlite3/sqlite3.js' { 52 | declare module.exports: $Exports<'sqlite3/sqlite3'>; 53 | } 54 | -------------------------------------------------------------------------------- /flow-typed/npm/supertest_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 1a94db5551d1f36f4f1c3fcee013a236 2 | // flow-typed version: <>/supertest_v^3.0.0/flow_v0.50.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'supertest' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'supertest' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'supertest/lib/agent' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'supertest/lib/test' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'supertest/test/supertest' { 34 | declare module.exports: any; 35 | } 36 | 37 | // Filename aliases 38 | declare module 'supertest/index' { 39 | declare module.exports: $Exports<'supertest'>; 40 | } 41 | declare module 'supertest/index.js' { 42 | declare module.exports: $Exports<'supertest'>; 43 | } 44 | declare module 'supertest/lib/agent.js' { 45 | declare module.exports: $Exports<'supertest/lib/agent'>; 46 | } 47 | declare module 'supertest/lib/test.js' { 48 | declare module.exports: $Exports<'supertest/lib/test'>; 49 | } 50 | declare module 'supertest/test/supertest.js' { 51 | declare module.exports: $Exports<'supertest/test/supertest'>; 52 | } 53 | -------------------------------------------------------------------------------- /flow-typed/npm/uuid_v3.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: c07f382c8238bb78e545b60dd4f097a6 2 | // flow-typed version: 27f92307d3/uuid_v3.x.x/flow_>=v0.33.x 3 | 4 | declare module 'uuid' { 5 | declare function v1(options?: {| 6 | node?: number[], 7 | clockseq?: number, 8 | msecs?: number | Date, 9 | nsecs?: number, 10 | |}, buffer?: number[] | Buffer, offset?: number): string; 11 | declare function v4(options?: {| 12 | random?: number[], 13 | rng?: () => number[] | Buffer, 14 | |}, buffer?: number[] | Buffer, offset?: number): string; 15 | } 16 | -------------------------------------------------------------------------------- /keyrings/live/blackbox-admins.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongymagic/k2/a513d1c1973632c297b4d7b9eb6d02a97fd038be/keyrings/live/blackbox-admins.txt -------------------------------------------------------------------------------- /keyrings/live/blackbox-files.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongymagic/k2/a513d1c1973632c297b4d7b9eb6d02a97fd038be/keyrings/live/blackbox-files.txt -------------------------------------------------------------------------------- /knexfile.js: -------------------------------------------------------------------------------- 1 | require('dotenv').config(); 2 | 3 | // Default to use sqlite3 database and store the db file in git. sqlite3's file 4 | // based db makes it easier to deploy to cloud services such as now.sh or heroku 5 | // without setting up external database(s). If you wish to change this default 6 | // behaviour, you must provide and setup your own database elsewhere. 7 | // 8 | // See below for postgresql example (use it with provided docker-compose.yml). 9 | module.exports = { 10 | client: 'sqlite3', 11 | connection: { 12 | filename: './sqlite3/k2.db', 13 | }, 14 | useNullAsDefault: true, 15 | migrations: { 16 | tableName: 'migrations', 17 | }, 18 | }; 19 | 20 | // The following configuration is setup to prefer AWS RDS connection information 21 | // which is used in Elastic Beanstalk; otherwise it will require you to setup 22 | // custom database environment variables either via .env file or by explicitly 23 | // adding them to the environment before starting up the server. 24 | 25 | // Uncomment the below lines to use postgres. 26 | //module.exports = { 27 | // client: 'pg', 28 | // connection: { 29 | // host: process.env.RDS_HOSTNAME || process.env.DB_HOSTNAME || 'localhost', 30 | // database: process.env.RDS_DB_NAME || process.env.DB_NAME || process.env.NODE_ENV || 'development', 31 | // user: process.env.RDS_USERNAME || process.env.DB_USERNAME || 'postgres', 32 | // password: process.env.RDS_PASSWORD || process.env.DB_PASSWORD || '', 33 | // }, 34 | // migrations: { 35 | // tableName: 'migrations', 36 | // }, 37 | //}; 38 | -------------------------------------------------------------------------------- /migrations/20170523215418_users.js: -------------------------------------------------------------------------------- 1 | exports.up = async (db) => { 2 | await db.schema.createTable('users', (table) => { 3 | table.uuid('id').notNullable().primary(); 4 | table.string('email').unique(); 5 | table.boolean('email_confirmed').notNullable(); 6 | table.string('password_hash', 100); 7 | table.string('name').notNullable(); 8 | }); 9 | }; 10 | 11 | exports.down = async (db) => { 12 | await db.schema.dropTableIfExists('users'); 13 | }; 14 | 15 | module.exports.configuration = { transaction: true }; 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "k2", 3 | "version": "1.0.0", 4 | "private": true, 5 | "engines": { 6 | "node": ">= 8.1.4" 7 | }, 8 | "description": "Koa based API with JWT and GraphQL", 9 | "main": "src/index.js", 10 | "license": "MIT", 11 | "dependencies": { 12 | "babel-core": "^6.25.0", 13 | "babel-plugin-syntax-flow": "^6.18.0", 14 | "babel-plugin-transform-flow-strip-types": "^6.22.0", 15 | "babel-polyfill": "^6.23.0", 16 | "babel-preset-env": "^1.5.2", 17 | "babel-register": "^6.24.1", 18 | "bcrypt": "^1.0.2", 19 | "dataloader": "^1.3.0", 20 | "dotenv": "^4.0.0", 21 | "fancy-log": "^1.3.0", 22 | "glob": "^7.1.2", 23 | "graphql": "^0.10.5", 24 | "graphql-relay": "^0.5.2", 25 | "jsonwebtoken": "^7.4.1", 26 | "kcors": "^2.2.1", 27 | "knex": "^0.13.0", 28 | "koa": "^2.2.0", 29 | "koa-bodyparser": "^4.2.0", 30 | "koa-convert": "^1.2.0", 31 | "koa-graphql": "^0.7.0", 32 | "koa-jwt": "^3.2.2", 33 | "koa-logger": "^3.0.0", 34 | "koa-passport": "^3.0.0", 35 | "koa-router": "^7.2.0", 36 | "passport-local": "^1.0.0", 37 | "ramda": "^0.24.1", 38 | "sqlite3": "^3.1.8", 39 | "uuid": "^3.0.1" 40 | }, 41 | "scripts": { 42 | "start": "node src/index", 43 | "start:dev": "nodemon src/index", 44 | "flow": "flow", 45 | "test:unit": "jest src/", 46 | "test:integration": "jest --runInBand --forceExit tests/", 47 | "test": "jest --runInBand --forceExit ", 48 | "test:coverage": "jest --runInBand --forceExit --coverage", 49 | "knex": "knex", 50 | "migrate:make": "knex migrate:make", 51 | "migrate:latest": "knex migrate:latest", 52 | "migrate:rollback": "knex migrate:rollback", 53 | "seed:make": "knex seed:make", 54 | "seed:run": "knex seed:run", 55 | "precommit": "lint-staged", 56 | "prepush": "yarn flow && CI=true yarn test:coverage", 57 | "now-build": "npm run migrate:latest" 58 | }, 59 | "lint-staged": { 60 | "{src,tests}/**/*.js": [ 61 | "prettier --single-quote --trailing-comma es5 --write", 62 | "git add" 63 | ] 64 | }, 65 | "devDependencies": { 66 | "babel-jest": "^20.0.3", 67 | "flow-bin": "^0.51.1", 68 | "husky": "^0.14.3", 69 | "jest": "^20.0.4", 70 | "lint-staged": "^4.0.2", 71 | "nodemon": "^1.11.0", 72 | "prettier": "^1.4.4", 73 | "supertest": "^3.0.0" 74 | }, 75 | "jest": { 76 | "modulePathIgnorePatterns": [ 77 | "/coverage", 78 | "/flow-typed", 79 | "/migrations", 80 | "/seeds" 81 | ], 82 | "testEnvironment": "node" 83 | }, 84 | "now": { 85 | "engines": { 86 | "node": "8.1.4" 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /scripts/postgres-initdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL 4 | CREATE DATABASE production; 5 | CREATE DATABASE development; 6 | CREATE DATABASE test; 7 | EOSQL 8 | -------------------------------------------------------------------------------- /seeds/users.js: -------------------------------------------------------------------------------- 1 | const bcrypt = require('bcrypt'); 2 | const uuid = require('uuid'); 3 | 4 | const table = 'users'; 5 | const users = [ 6 | { email: 'john.doe@example.com', name: 'John Doe', password: 'johndoe' }, 7 | { email: 'jane.doe@example.com', name: 'Jane Doe', password: 'janedoe' }, 8 | ]; 9 | 10 | module.exports.seed = async (knex) => { 11 | // Deletes ALL existing entries 12 | const rows = await knex(table).del(); 13 | console.log(`${rows} deleted from ${table}`); 14 | return knex(table).insert( 15 | users.map( 16 | ({ name, email, password }) => ({ 17 | id: uuid(), 18 | name, 19 | email, 20 | email_confirmed: true, 21 | password_hash: bcrypt.hashSync(password, 10), 22 | }) 23 | ) 24 | ); 25 | }; 26 | -------------------------------------------------------------------------------- /sqlite3/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongymagic/k2/a513d1c1973632c297b4d7b9eb6d02a97fd038be/sqlite3/README.md -------------------------------------------------------------------------------- /src/DataLoader.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import DataLoader from 'dataloader'; 4 | import User from './models/User'; 5 | 6 | /** 7 | * Data access utility to be used with GraphQL resolve() functions. For example: 8 | * 9 | * new GraphQLObjectType({ 10 | * ... 11 | * resolve(post, args, { loader }) { 12 | * return loader.users.load(post.authorId); 13 | * } 14 | * }) 15 | * 16 | * For more information visit https://github.com/facebook/dataloader 17 | */ 18 | export default { 19 | create: () => ({ 20 | users: new DataLoader(keys => User.findByIds(keys)), 21 | }), 22 | }; 23 | -------------------------------------------------------------------------------- /src/db.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import knex from 'knex'; 4 | import Client from 'knex/lib/dialects/sqlite3'; 5 | import Formatter from 'knex/lib/formatter'; 6 | import knexConfig from '../knexfile'; 7 | 8 | // Converts "camelCase" strings to "snake_case" 9 | const toSnakeCase = (cache => (key: string) => { 10 | let snakeCaseKey = cache.get(key); 11 | if (!snakeCaseKey) { 12 | snakeCaseKey = key.replace(/([A-Z])/g, (_, s) => `_${s.toLowerCase()}`); 13 | cache.set(key, snakeCaseKey); 14 | } 15 | return snakeCaseKey; 16 | })(new Map()); 17 | 18 | // Automatically convert "camelCase" identifiers to "snake_case". For example: 19 | // db.table('users').where('userId', '=', 1).update({ firstName: 'Bill' }) 20 | // => UPDATE "users" SET "first_name" = ? WHERE "user_id" = ? 21 | Client.prototype.wrapIdentifier = value => { 22 | if (value === '*') return value; 23 | const matched = value.match(/(.*?)(\[[0-9]\])/); 24 | if (matched) 25 | return ( 26 | Client.prototype.wrapIdentifier.wrapIdentifier(matched[1]) + matched[2] 27 | ); 28 | return `"${toSnakeCase(value).replace(/"/g, '""')}"`; 29 | }; 30 | 31 | // The above should not apply to the "as " identifiers. For example: 32 | // db.table('users').select('user_id as userId') => SELECT "user_id" as "userId" from "users" 33 | Formatter.prototype.wrapAsIdentifier = value => 34 | `"${(value || '').replace(/"/g, '""')}"`; 35 | 36 | const config: Object = { 37 | acquireConnectionTimeout: 60000, 38 | debug: process.env.DATABASE_DEBUG === 'true', 39 | }; 40 | const db = knex( 41 | Object.assign({}, knexConfig, config, { 42 | client: Client, 43 | }) 44 | ); 45 | 46 | export default db; 47 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | require('dotenv').config(); 2 | require('babel-register')(); 3 | require('babel-polyfill'); 4 | 5 | const log = require('fancy-log'); 6 | const server = require('./server').default; 7 | 8 | const port = process.env.PORT || 5000; 9 | server.listen(port, () => log(`API server started on ${port}`)); 10 | -------------------------------------------------------------------------------- /src/middleware/validate-user.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import User from '../models/User'; 4 | 5 | export default async function validateUser(ctx: any, next: any) { 6 | if (!ctx.state.user) { 7 | return ctx.throw(401); 8 | } 9 | 10 | // Convert koa-jwt's ctx.state.user Object to the User model. 11 | ctx.state.user = new User(ctx.state.user); 12 | 13 | if (next) { 14 | return next(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/models/User.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { compareSync } from 'bcrypt'; 4 | import { sign } from 'jsonwebtoken'; 5 | import pick from 'ramda/src/pick'; 6 | import db from '../db'; 7 | 8 | const fields = ['id', 'email', 'name']; 9 | 10 | class User { 11 | id: string; 12 | email: string; 13 | name: string; 14 | 15 | constructor(props: Object) { 16 | // Whitelist fields. 17 | Object.assign(this, pick(fields, props)); 18 | } 19 | 20 | async verify(password: string): Promise { 21 | // Grab raw data from database to get access to other fields. 22 | const user = await db.table('users').where({ email: this.email }).first(); 23 | 24 | if (!user || !user.password_hash) { 25 | return false; 26 | } 27 | 28 | return compareSync(password, user.password_hash); 29 | } 30 | 31 | token(): string { 32 | return sign(this, process.env.APP_SECRET, { 33 | expiresIn: 60 * 60 * 2 /* hours */, 34 | }); 35 | } 36 | 37 | static async find(...args) { 38 | return db 39 | .table('users') 40 | .where(...(args.length ? args : [{}])) 41 | .select(...fields) 42 | .then(rows => rows.map(x => new User(x))); 43 | } 44 | 45 | static async findByIds(ids: string[]): Promise> { 46 | return db.table('users').whereIn('id', ids).then(rows => 47 | ids.map(id => { 48 | const row = rows.find(x => x.id === id); 49 | return row && new User(row); 50 | }) 51 | ); 52 | } 53 | 54 | static async findOne(...args): Promise { 55 | return db 56 | .table('users') 57 | .where(...(args.length ? args : [{}])) 58 | .first() 59 | .then(x => x && new User(x)); 60 | } 61 | 62 | static async any(...args): Promise { 63 | return db 64 | .raw( 65 | 'SELECT EXISTS ?', 66 | db 67 | .table('users') 68 | .where(...(args.length ? args : [{}])) 69 | .select(db.raw('1')) 70 | ) 71 | .then(x => x.rows[0].exists); 72 | } 73 | 74 | static create(user) { 75 | return db.table('users').insert(user, fields).then(x => new User(x[0])); 76 | } 77 | } 78 | 79 | export default User; 80 | -------------------------------------------------------------------------------- /src/models/__tests__/User.test.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import User from '../User'; 4 | 5 | it('should whitelist props given', () => { 6 | expect( 7 | new User({ 8 | name: 'The Hulk', 9 | superhero: true, 10 | }) 11 | ).not.toHaveProperty('superhero'); 12 | }); 13 | -------------------------------------------------------------------------------- /src/modules/auth/controller.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import passport from 'koa-passport'; 4 | 5 | export async function authenticate(ctx: any, next: any) { 6 | return passport.authenticate('local', (err, user) => { 7 | if (err) { 8 | return ctx.throw(500, err); 9 | } 10 | 11 | // If there were no errors and no user was retrieved, it's an 12 | // authentication issue. i.e., HTTP 401 Unauthorized. 13 | if (!user) { 14 | return ctx.throw(401, err); 15 | } 16 | 17 | ctx.body = user.token(); 18 | })(ctx, next); 19 | } 20 | -------------------------------------------------------------------------------- /src/modules/auth/router.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import * as auth from './controller'; 4 | 5 | export const baseUrl = '/authenticate'; 6 | 7 | export default [ 8 | { 9 | method: 'POST', 10 | route: '/', 11 | handlers: [auth.authenticate], 12 | }, 13 | ]; 14 | -------------------------------------------------------------------------------- /src/modules/graphql/controller.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import graphqlHTTP from 'koa-graphql'; 4 | import { printSchema } from 'graphql'; 5 | import schema from '../../schema'; 6 | 7 | export const http = graphqlHTTP({ 8 | schema, 9 | graphiql: process.env.NODE_ENV !== 'production', 10 | pretty: process.env.NODE_ENV !== 'production', 11 | }); 12 | 13 | export async function print(ctx: any) { 14 | ctx.type = 'text/plain'; 15 | ctx.body = printSchema(schema); 16 | } 17 | -------------------------------------------------------------------------------- /src/modules/graphql/router.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import validateUser from '../../middleware/validate-user'; 4 | import * as graphql from './controller'; 5 | 6 | export const baseUrl = '/graphql'; 7 | 8 | export default [ 9 | { 10 | method: 'ALL', 11 | route: '/', 12 | handlers: [validateUser, graphql.http], 13 | }, 14 | { 15 | method: 'GET', 16 | route: '/schema', 17 | handlers: [validateUser, graphql.print], 18 | }, 19 | ]; 20 | -------------------------------------------------------------------------------- /src/modules/index.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import glob from 'glob'; 4 | import Router from 'koa-router'; 5 | 6 | exports = module.exports = function initModules(app: any) { 7 | glob(`${__dirname}/*`, { ignore: '**/index.js' }, (err, matches) => { 8 | if (err) { 9 | throw err; 10 | } 11 | 12 | matches.forEach(mod => { 13 | // $FlowIgnoreNextLine: yes we know what we're doing. 14 | const router = require(`${mod}/router`); 15 | 16 | const routes = router.default; 17 | const baseUrl = router.baseUrl; 18 | const instance = new Router({ prefix: baseUrl }); 19 | 20 | routes.forEach(config => { 21 | const { method = '', route = '', handlers = [] } = config; 22 | 23 | const lastHandler = handlers.pop(); 24 | 25 | instance[method.toLowerCase()](route, ...handlers, async function(ctx) { 26 | return await lastHandler(ctx); 27 | }); 28 | 29 | app.use(instance.routes()).use(instance.allowedMethods()); 30 | }); 31 | }); 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /src/passport.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import passport from 'koa-passport'; 4 | import { Strategy } from 'passport-local'; 5 | import User from './models/User'; 6 | 7 | passport.serializeUser((user, done) => { 8 | done(null, user.id); 9 | }); 10 | 11 | passport.deserializeUser((id, done) => { 12 | User.findOne({ id }).then(user => done(null, user || null), done); 13 | }); 14 | 15 | passport.use( 16 | 'local', 17 | new Strategy( 18 | { 19 | usernameField: 'email', 20 | passwordField: 'password', 21 | session: false, 22 | }, 23 | async (email, password, done) => { 24 | try { 25 | const user = await User.findOne({ email }); 26 | 27 | if (!user) { 28 | return done(null, false); 29 | } 30 | 31 | return done(null, (await user.verify(password)) ? user : false); 32 | } catch (err) { 33 | return done(err); 34 | } 35 | } 36 | ) 37 | ); 38 | 39 | export default passport; 40 | -------------------------------------------------------------------------------- /src/schema.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { GraphQLSchema, GraphQLObjectType } from 'graphql'; 4 | import { 5 | connectionArgs, 6 | connectionDefinitions, 7 | connectionFromPromisedArray, 8 | } from 'graphql-relay'; 9 | import { nodeField, nodesField } from './types/Node'; 10 | import UserType from './types/UserType'; 11 | 12 | export default new GraphQLSchema({ 13 | query: new GraphQLObjectType({ 14 | name: 'Query', 15 | fields: { 16 | node: nodeField, 17 | nodes: nodesField, 18 | me: { 19 | type: UserType, 20 | resolve(root, args, { user }) { 21 | return user; 22 | }, 23 | }, 24 | }, 25 | }), 26 | }); 27 | -------------------------------------------------------------------------------- /src/server.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import Koa from 'koa'; 4 | import Router from 'koa-router'; 5 | import convert from 'koa-convert'; 6 | import logger from 'koa-logger'; 7 | import cors from 'kcors'; 8 | import jwt from 'koa-jwt'; 9 | import bodyParser from 'koa-bodyparser'; 10 | import passport from './passport'; 11 | 12 | const app = new Koa(); 13 | 14 | if (process.env.NODE_ENV === 'development') { 15 | app.use(logger()); 16 | } 17 | app.use(convert(cors({ credentials: true }))); 18 | app.use(bodyParser()); 19 | app.use(passport.initialize()); 20 | 21 | // Parse Authorization Header for JWT tokens, and set ctx.state.user if token is 22 | // valid. Passthrough to middleware to make decisions on whether or not their 23 | // routes require users. See src/middleware/validate-user.js 24 | app.use(jwt({ secret: process.env.APP_SECRET, passthrough: true })); 25 | 26 | // Custom API modules that define their own routes. 27 | const modules = require('./modules'); 28 | modules(app); 29 | 30 | export default app; 31 | -------------------------------------------------------------------------------- /src/types/Node.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { nodeDefinitions, fromGlobalId } from 'graphql-relay'; 4 | import User from '../models/User'; 5 | 6 | /* eslint-disable global-require */ 7 | const { nodeInterface, nodeField, nodesField } = nodeDefinitions( 8 | globalId => { 9 | const { type, id } = fromGlobalId(globalId); 10 | 11 | switch (type) { 12 | case 'User': 13 | return User.findOne({ id }); 14 | default: 15 | return null; 16 | } 17 | }, 18 | obj => { 19 | if (obj instanceof User) { 20 | return require('./UserType').default; 21 | } 22 | 23 | return null; 24 | } 25 | ); 26 | 27 | export { nodeInterface, nodeField, nodesField }; 28 | -------------------------------------------------------------------------------- /src/types/UserType.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { GraphQLObjectType, GraphQLString } from 'graphql'; 4 | import { globalIdField } from 'graphql-relay'; 5 | import { nodeInterface } from './Node'; 6 | 7 | export default new GraphQLObjectType({ 8 | name: 'User', 9 | 10 | fields: { 11 | id: globalIdField(), 12 | 13 | email: { 14 | type: GraphQLString, 15 | }, 16 | }, 17 | 18 | interfaces: [nodeInterface], 19 | }); 20 | -------------------------------------------------------------------------------- /tests/authenticate.test.js: -------------------------------------------------------------------------------- 1 | import request from 'supertest'; 2 | import server from '../src/server'; 3 | import { setupDatabase } from './utils'; 4 | 5 | const check = done => (err, res) => (err ? done.fail(err) : done()); 6 | 7 | beforeAll(setupDatabase); 8 | 9 | describe('POST /authenticate', () => { 10 | test('should throw 401 is credentials are incorrect', done => { 11 | request(server.listen()) 12 | .post('/authenticate') 13 | .send({ 14 | // If these aren't unique enough, then wtf. Change it yourself. 15 | email: `user-${(Math.random() * 1000000) | 0}`, 16 | password: `password-${(Math.random() * 1000000) | 0}`, 17 | }) 18 | // Note that examples on supertest website uses mocha which has a 19 | // slightly different implmentation of callback fn `done` to jasmine. 20 | .expect(401, check(done)); 21 | }); 22 | 23 | test('should give me a token if credentials are valid', done => { 24 | request(server.listen()) 25 | .post('/authenticate') 26 | .send({ 27 | email: 'john.doe@example.com', 28 | password: 'johndoe', 29 | }) 30 | .expect(200, check(done)); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /tests/graphql.test.js: -------------------------------------------------------------------------------- 1 | import request from 'supertest'; 2 | import server from '../src/server'; 3 | import { setupDatabase, authenticate } from './utils'; 4 | 5 | const check = done => (err, res) => (err ? done.fail(err) : done()); 6 | let token; 7 | 8 | beforeAll(async () => { 9 | await setupDatabase(); 10 | token = await authenticate(request(server.listen()), { 11 | email: 'john.doe@example.com', 12 | password: 'johndoe', 13 | }); 14 | 15 | // TODO: should really set the request to pre-authorized state, and have tests 16 | // use them instead 17 | }); 18 | 19 | describe('POST /graphql', () => { 20 | test('should return 401 for unauthenticated requests', done => { 21 | request(server.listen()).get('/graphql').expect(401, check(done)); 22 | request(server.listen()).get('/graphql/schema').expect(401, check(done)); 23 | }); 24 | 25 | test('should return 200 when asked for /schema', done => { 26 | request(server.listen()) 27 | .get('/graphql/schema') 28 | .set('Authorization', `Bearer ${token}`) 29 | .expect(200, check(done)); 30 | }); 31 | 32 | test('should return 400 if not query is sent', done => { 33 | request(server.listen()) 34 | .post('/graphql') 35 | .set('Authorization', `Bearer ${token}`) 36 | .expect(400, check(done)); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /tests/utils.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import db from '../src/db'; 4 | 5 | export const setupDatabase = () => 6 | db.migrate.latest().then(() => db.seed.run()); 7 | 8 | export const authenticate = async ( 9 | agent: any, 10 | login: {| email: string, password: string |} 11 | ) => { 12 | const response = await agent 13 | .post('/authenticate') 14 | .set('Accept', 'application/json') 15 | .send(login); 16 | 17 | return response.text; 18 | }; 19 | --------------------------------------------------------------------------------