├── .env_example ├── .gitignore ├── LICENSE ├── README.md ├── app.js ├── config ├── auth.js ├── cron.js └── options.js ├── graphql ├── index.js ├── mutations │ └── User.js ├── queries │ ├── Init.js │ └── User.js ├── resolvers │ ├── Init.js │ └── User.js └── types │ ├── Address.js │ ├── Generic.js │ └── User.js ├── middleware └── uploadProfilePicture.js ├── models └── User.js ├── package-lock.json ├── package.json └── public ├── graphiql.png └── node+mongoDB+GraphQL.png /.env_example: -------------------------------------------------------------------------------- 1 | /** 2 | IMPORTANT 3 | 4 | 1. You should never commit this file to a public repository. 5 | 6 | 4. Use API keys below for local development, but create a separate set of API keys for production use. 7 | 8 | 5. All hosting providers allow you to configure environment variables. 9 | 10 | 6. Rename this file to `.env` and update `dotenv.load` path in `app.js`. 11 | */ 12 | 13 | NODE_ENV=development 14 | 15 | PORT=3000 16 | MONGODB=mongodb://127.0.0.1:27017/graphqlseed 17 | JWT_SECRET_KEY=Your@Key131 18 | 19 | AWS_ACCESS_KEY=accessKey 20 | AWS_SECRET_KEY=secretKey 21 | AWS_S3_REGION=awsRegion 22 | AWS_PROFILE_IMAGE_BUCKET=profileImageBucket 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Node template 3 | # Logs 4 | logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | *.pid.lock 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # nyc test coverage 23 | .nyc_output 24 | 25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 26 | .grunt 27 | 28 | # Bower dependency directory (https://bower.io/) 29 | bower_components 30 | 31 | # node-waf configuration 32 | .lock-wscript 33 | 34 | # Compiled binary addons (https://nodejs.org/api/addons.html) 35 | build/Release 36 | 37 | # Dependency directories 38 | node_modules/ 39 | jspm_packages/ 40 | 41 | # Typescript v1 declaration files 42 | typings/ 43 | 44 | # Optional npm cache directory 45 | .npm 46 | 47 | # Optional eslint cache 48 | .eslintcache 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | # Output of 'npm pack' 54 | *.tgz 55 | 56 | # Yarn Integrity file 57 | .yarn-integrity 58 | 59 | # dotenv environment variables file 60 | .env 61 | .idea/ 62 | .DS_Store 63 | ### JetBrains template 64 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 65 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 66 | 67 | # User-specific stuff: 68 | .idea/**/workspace.xml 69 | .idea/**/tasks.xml 70 | .idea/dictionaries 71 | 72 | # Sensitive or high-churn files: 73 | .idea/**/dataSources/ 74 | .idea/**/dataSources.ids 75 | .idea/**/dataSources.xml 76 | .idea/**/dataSources.local.xml 77 | .idea/**/sqlDataSources.xml 78 | .idea/**/dynamic.xml 79 | .idea/**/uiDesigner.xml 80 | 81 | # Gradle: 82 | .idea/**/gradle.xml 83 | .idea/**/libraries 84 | 85 | # CMake 86 | cmake-build-debug/ 87 | 88 | # Mongo Explorer plugin: 89 | .idea/**/mongoSettings.xml 90 | 91 | ## File-based project format: 92 | *.iws 93 | 94 | ## Plugin-specific files: 95 | 96 | # IntelliJ 97 | out/ 98 | 99 | # mpeltonen/sbt-idea plugin 100 | .idea_modules/ 101 | 102 | # JIRA plugin 103 | atlassian-ide-plugin.xml 104 | 105 | # Cursive Clojure plugin 106 | .idea/replstate.xml 107 | 108 | # Crashlytics plugin (for Android Studio and IntelliJ) 109 | com_crashlytics_export_strings.xml 110 | crashlytics.properties 111 | crashlytics-build.properties 112 | fabric.properties 113 | 114 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![NodeJs + MongoDB + GraphQL Starter](https://raw.githubusercontent.com/ailoitte/node-mongodb-graphql-starter/master/public/node%2BmongoDB%2BGraphQL.png) 3 | 4 | 5 | NodeJs + MongoDB + GraphQL Starter 6 | ---------------------------------- 7 | _A boilerplate for Node.js, MongoDB & GraphQL applications._ 8 | 9 | :bulb: ES6 code 10 | 11 | I started this project to simplify and make it ease of use. I also tried to make it as generic and reusable as possible to cover most use cases of GraphQL apps, without being too specific. 12 | 13 | 14 | Table of Contents 15 | ----------------- 16 | - [Features](#features) 17 | - [Prerequisites](#prerequisites) 18 | - [Getting Started](#getting-started) 19 | - [Packages](#packages) 20 | - [Query & Mutations](#query-mutation) 21 | 22 | Features 23 | -------- 24 | 25 | - **Local Authentication** using Email and Password 26 | - MVC Project Structure 27 | - GraphQL Mutations, Queries, Resolvers 28 | - **Account Management** 29 | - Register 30 | - Login 31 | - Update profile 32 | - Profile Details 33 | - Add user address 34 | - Update Address 35 | - Remove Address 36 | - Cron job scheduler 37 | - JSON Web Token (JWT) Sign in 38 | 39 | 40 | Prerequisites 41 | ------------- 42 | 43 | - [MongoDB](https://www.mongodb.org/downloads) 44 | - [Node.js 6.0+](http://nodejs.org) 45 | - Command Line Tools 46 | -  **Mac OS X:** [Xcode](https://itunes.apple.com/us/app/xcode/id497799835?mt=12) (or **OS X 10.9+**: `xcode-select --install`) 47 | -  **Windows:** [Visual Studio](https://www.visualstudio.com/products/visual-studio-community-vs) 48 | -  **Ubuntu** /  **Linux Mint:** `sudo apt-get install build-essential` 49 | -  **Fedora**: `sudo dnf groupinstall "Development Tools"` 50 | -  **OpenSUSE:** `sudo zypper install --type pattern devel_basis` 51 | 52 | Getting Started 53 | --------------- 54 | 55 | The easiest way to get started is to clone the repository: 56 | 57 | ```bash 58 | # Get the latest snapshot 59 | git clone --depth=1 https://github.com/ailoitte/node-mongodb-graphql-starter.git myproject 60 | 61 | # Change directory 62 | cd myproject 63 | 64 | # Install NPM dependencies 65 | npm install 66 | 67 | # Then simply start your app 68 | node app.js 69 | ``` 70 | 71 | **Note:** I highly recommend installing [Nodemon](https://github.com/remy/nodemon). 72 | It watches for any changes in your node.js app and automatically restarts the 73 | server. Once installed, instead of `node app.js` use `nodemon app.js`. It will 74 | save you a lot of time in the long run, because you won't need to manually 75 | restart the server each time you make a small change in code. To install, run 76 | `sudo npm install -g nodemon`. 77 | 78 | Packages 79 | -------- 80 | 81 | | Package | Description | 82 | | ------------------------------- | --------------------------------------------------------------------- | 83 | | async | Utility library that provides asynchronous control flow. | 84 | | bcrypt-nodejs | Library for hashing and salting user passwords. | 85 | | connect-mongo | MongoDB session store for Express. | 86 | | dotenv | Loads environment variables from .env file. | 87 | | express | Node.js web framework. | 88 | | body-parser | Express 4 middleware. | 89 | | morgan | Express 4 middleware. | 90 | | mongoose | MongoDB ODM. | 91 | | nodemailer | Node.js library for sending emails. | 92 | | request | Simplified HTTP request library. | 93 | | lodash | Handy JavaScript utilities library. | 94 | | validator | Used in conjunction with express-validator. | 95 | | jsonwebtoken | An implementation of JSON Web Tokens. | 96 | | mongoose-paginate | MongoDB mongoose pagination | 97 | | moment | JS date library- parsing,validating,manipulating,andformatting dates. | 98 | | mime | Comprehensive MIME type mapping API based on mime-db module. | 99 | | firebase-admin | Push notification | 100 | | aws-sdk | AWS client SDK | 101 | | multer-s3 | Upload multipart to S3 | 102 | | winston | async logging library | 103 | | cron | Cron job | 104 | 105 | 106 | 107 | Query & Mutation 108 | ---------------- 109 | 110 | ![](https://raw.githubusercontent.com/ailoitte/node-mongodb-graphql-starter/master/public/graphiql.png) 111 | 112 | 113 | ### ADD USER 114 | 115 | ``` 116 | mutation { 117 | addUser(name: "Sunil Kumar", email: "sunilkumar707@yahoo.in", mobileNumber:"8867371492", password: "123567"){ 118 | id 119 | name 120 | email 121 | mobileNumber 122 | } 123 | } 124 | ``` 125 | 126 | ### UPDATE 127 | 128 | ``` 129 | mutation { 130 | updateUser(name: "Ravi Sanker"){ 131 | id 132 | name 133 | email 134 | mobileNumber 135 | } 136 | } 137 | ``` 138 | 139 | ### LOGIN 140 | 141 | ``` 142 | mutation { 143 | loginUser(mobileNumber: "8867371492", password:"1234567") { 144 | id 145 | token 146 | name 147 | email 148 | } 149 | } 150 | ``` 151 | 152 | ### ADD ADDRESS 153 | 154 | ``` 155 | mutation { 156 | addUserAddress(street: ["s1", "s2"], 157 | city:"Dehradun", 158 | countryId: "IN", 159 | addressType: "home", 160 | postcode:"23455" 161 | ) { 162 | id 163 | street 164 | city 165 | countryId 166 | landmark 167 | locality 168 | addressType 169 | postcode 170 | } 171 | } 172 | ``` 173 | 174 | ### UPDATE ADDRESS 175 | 176 | ``` 177 | mutation { 178 | updateUserAddress(id: "59e4d803d3528728b99b3c53", 179 | street: ["Nesh", "Indra Road"], 180 | city:"Dehradun", 181 | countryId: "IN", 182 | addressType: "home", 183 | postcode:"234551" 184 | ) { 185 | id 186 | street 187 | city 188 | countryId 189 | landmark 190 | locality 191 | addressType 192 | postcode 193 | } 194 | } 195 | ``` 196 | 197 | ### DELETE ADDRESS 198 | 199 | ``` 200 | mutation { 201 | deleteUserAddress( 202 | id: "59e4dc6b875e8829539b20d7" 203 | ){ 204 | message 205 | } 206 | } 207 | ``` 208 | 209 | ### ALL ADDRESS 210 | 211 | ``` 212 | query { 213 | me{ 214 | address{ 215 | street 216 | city 217 | } 218 | } 219 | } 220 | ``` 221 | 222 | 223 | ### ADDRESS BY ID 224 | 225 | ``` 226 | query { 227 | userAddress(id: "59e4d803d3528728b99b3c53"){ 228 | id 229 | city 230 | street 231 | countryId 232 | } 233 | } 234 | } 235 | ``` -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Application Entry point 3 | * @type {createApplication} 4 | */ 5 | const express = require('express'); 6 | const bodyParser = require('body-parser'); 7 | const logger = require('morgan'); 8 | const fs = require('fs'); 9 | const dotenv = require('dotenv'); 10 | const path = require('path'); 11 | const mongoose = require('mongoose'); 12 | const winston = require('winston'); 13 | const moment = require('moment'); 14 | 15 | const expressGraphQL = require('express-graphql'); 16 | const jwt = require('express-jwt'); 17 | 18 | const User = require('./models/User'); 19 | 20 | // let's import the schema file we just created 21 | const GraphQLSchema = require('./graphql'); 22 | 23 | 24 | /** 25 | * Load environment variables from .env file, where API keys and passwords are configured. 26 | * 27 | * Default path: .env (You can remove the path argument entirely, after renaming `.env.example` to `.env`) 28 | */ 29 | dotenv.load({path: '.env'}); 30 | 31 | const UploadProfilePicture = require('./middleware/uploadProfilePicture'); 32 | 33 | /** 34 | * Create Express server. 35 | */ 36 | const app = express(); 37 | 38 | /** 39 | * Connect to MongoDB. 40 | */ 41 | mongoose.connect(process.env.MONGODB, { 42 | useMongoClient: true 43 | }); 44 | mongoose.connection.on('error', function () { 45 | console.log('MongoDB Connection Error. Please make sure that MongoDB is running.'); 46 | process.exit(1); 47 | }); 48 | mongoose.set('debug', true); 49 | 50 | /** 51 | * Express configuration. 52 | */ 53 | app.set('port', process.env.PORT || 3000); 54 | 55 | app.use(logger('dev')); 56 | 57 | app.use(bodyParser.urlencoded({limit: '50mb', extended: true, parameterLimit: 5000})); 58 | app.use(bodyParser.json({limit: '50mb'})); 59 | 60 | 61 | /** 62 | * GraphQL server 63 | */ 64 | 65 | app.use('/graphql', jwt({ 66 | secret: process.env.JWT_SECRET_KEY, 67 | requestProperty: 'auth', 68 | credentialsRequired: false, 69 | })); 70 | 71 | // =========== GraphQL setting ========== // 72 | app.use('/graphql', async (req, res, done) => { 73 | var userId = (req.auth && req.auth.id ) ? req.auth.id : undefined; 74 | const user = ( userId ) ? await User.findById(userId): undefined; 75 | req.context = { 76 | user: user, 77 | } 78 | done(); 79 | }); 80 | app.use('/graphql', UploadProfilePicture); 81 | app.use('/graphql', expressGraphQL(req => ({ 82 | schema: GraphQLSchema, 83 | context: req.context, 84 | graphiql: process.env.NODE_ENV === 'development', 85 | }) 86 | )); 87 | // =========== GraphQL setting END ========== // 88 | 89 | /** 90 | * Start Express server. 91 | */ 92 | app.listen(app.get('port'), function () { 93 | console.log('Express server listening on port %d in %s mode', app.get('port'), app.get('env')); 94 | }); 95 | 96 | module.exports = app; 97 | -------------------------------------------------------------------------------- /config/auth.js: -------------------------------------------------------------------------------- 1 | exports.isAuthenticated = (context) => { 2 | if (context.user) { 3 | return true; 4 | } 5 | throw new Error('User is not logged in (or authenticated).'); 6 | }; -------------------------------------------------------------------------------- /config/cron.js: -------------------------------------------------------------------------------- 1 | var schedule = require('node-schedule'); 2 | 3 | /** 4 | * Every minutes 5 | */ 6 | var j = schedule.scheduleJob('* * * * *', function () { 7 | //Executes every minutes 8 | 9 | }); 10 | -------------------------------------------------------------------------------- /config/options.js: -------------------------------------------------------------------------------- 1 | var _ = require('lodash'); 2 | 3 | var options = { 4 | appVersion: '0.0.1', 5 | mobileNumberLocale: 'en-IN', 6 | minPasswordLength: 6, 7 | devicePlatforms: { 8 | ANDROID: 'android', 9 | IOS: 'ios' 10 | }, 11 | user: { 12 | status: { 13 | ACTIVE: 'active', 14 | DISABLED: 'disabled' 15 | } 16 | }, 17 | generateOtp: () => { 18 | return Math.floor(1000 + Math.random() * 9000); 19 | } 20 | }; 21 | module.exports = options; -------------------------------------------------------------------------------- /graphql/index.js: -------------------------------------------------------------------------------- 1 | const GraphQL = require('graphql'); 2 | const { 3 | GraphQLObjectType, 4 | GraphQLSchema, 5 | } = GraphQL; 6 | 7 | 8 | // import the user query file we created 9 | const UserQuery = require('./queries/User'); 10 | const InitQuery = require('./queries/Init'); 11 | 12 | // import the user mutation file we created 13 | const UserMutation = require('./mutations/User'); 14 | 15 | 16 | // lets define our root query 17 | const RootQuery = new GraphQLObjectType({ 18 | name: 'RootQueryType', 19 | description: 'This is the default root query provided by the backend', 20 | fields: { 21 | // Init 22 | init: InitQuery.index(), 23 | // User 24 | users: UserQuery.index(), 25 | user: UserQuery.single(), 26 | me: UserQuery.me(), 27 | userAddress: UserQuery.userAddress(), 28 | }, 29 | }); 30 | 31 | 32 | // lets define our root mutation 33 | const RootMutation = new GraphQLObjectType({ 34 | name: 'Mutation', 35 | description: 'Default mutation provided by the backend APIs', 36 | fields: { 37 | // User 38 | loginUser: UserMutation.login(), 39 | addUser: UserMutation.create(), 40 | updateUser: UserMutation.update(), 41 | addDeviceTokenUser: UserMutation.fcm(), 42 | addUserAddress: UserMutation.createAddress(), 43 | updateUserAddress: UserMutation.updateAddress(), 44 | deleteUserAddress: UserMutation.deleteAddress() 45 | }, 46 | }); 47 | 48 | 49 | 50 | // export the schema 51 | module.exports = new GraphQLSchema({ 52 | query: RootQuery, 53 | mutation: RootMutation, 54 | }); 55 | 56 | -------------------------------------------------------------------------------- /graphql/mutations/User.js: -------------------------------------------------------------------------------- 1 | const GraphQL = require('graphql'); 2 | var validator = require('validator'); 3 | 4 | const auth = require('../../config/auth'); 5 | const option = require('../../config/options'); 6 | const Generic = require('../types/Generic'); 7 | 8 | 9 | const { 10 | GraphQLNonNull, 11 | GraphQLString, 12 | GraphQLInt, 13 | GraphQLID, 14 | GraphQLList 15 | } = GraphQL; 16 | 17 | // lets import our user type 18 | const UserType = require('../types/User'); 19 | const AddressType = require('../types/Address'); 20 | 21 | // lets import our user resolver 22 | const UserResolver = require('../resolvers/User'); 23 | 24 | 25 | module.exports = { 26 | 27 | login() { 28 | return { 29 | type: UserType, 30 | description: 'Add new User', 31 | 32 | args: { 33 | mobileNumber: { 34 | type: new GraphQLNonNull(GraphQLString), 35 | description: 'Mobile number cannot be left empty', 36 | }, 37 | password: { 38 | type: new GraphQLNonNull(GraphQLString), 39 | description: 'Enter password, will be automatically hashed', 40 | } 41 | }, 42 | resolve(parent, fields) { 43 | return UserResolver.auth(fields); 44 | } 45 | } 46 | }, 47 | 48 | create() { 49 | return { 50 | type: UserType, 51 | description: 'Add new User', 52 | 53 | args: { 54 | name: { 55 | type: new GraphQLNonNull(GraphQLString), 56 | description: 'Enter full name, Cannot be left empty', 57 | }, 58 | email: { 59 | type: new GraphQLNonNull(GraphQLString), 60 | description: 'Enter email', 61 | }, 62 | mobileNumber: { 63 | type: new GraphQLNonNull(GraphQLString), 64 | description: 'Enter mobile number', 65 | }, 66 | password: { 67 | type: new GraphQLNonNull(GraphQLString), 68 | description: 'Enter password, will be automatically hashed', 69 | } 70 | }, 71 | resolve(parent, fields) { 72 | if (!validator.isMobilePhone(fields.mobileNumber, option.mobileNumberLocale)) { 73 | throw new Error("Invalid mobile number!"); 74 | } 75 | 76 | if (!validator.isLength(fields.password, {min: option.minPasswordLength, max: undefined})) { 77 | throw new Error("Your password should be greater then " + option.minPasswordLength + " characters!"); 78 | } 79 | 80 | return UserResolver.create(fields); 81 | } 82 | } 83 | }, 84 | 85 | 86 | update() { 87 | return { 88 | type: UserType, 89 | description: 'Update user details', 90 | args: { 91 | name: { 92 | type: GraphQLString, 93 | description: 'Enter full name, Cannot be left empty', 94 | }, 95 | email: { 96 | type: GraphQLString, 97 | description: 'Enter email address, Must be valid and unique', 98 | }, 99 | password: { 100 | type: GraphQLString, 101 | description: 'Enter password, will be automatically hashed', 102 | }, 103 | mobileNumber: { 104 | type: GraphQLString, 105 | description: 'Enter mobile number', 106 | }, 107 | dob: { 108 | type: GraphQLString, 109 | description: 'Enter mobile number', 110 | } 111 | }, 112 | resolve(parent, fields, context, info) { 113 | 114 | if (auth.isAuthenticated(context)) { 115 | 116 | if (fields.email && !validator.isEmail(fields.email)) { 117 | throw new Error("Invalid email address!"); 118 | } 119 | if (fields.mobileNumber && !validator.isMobilePhone(fields.mobileNumber, option.mobileNumberLocale)) { 120 | throw new Error("Invalid mobile number!"); 121 | } 122 | 123 | if (fields.password && !validator.isLength(fields.password, { 124 | min: option.minPasswordLength, 125 | max: undefined 126 | })) { 127 | throw new Error("Your password should be greater then " + option.minPasswordLength + " characters!"); 128 | } 129 | 130 | fields['picture'] = context.picture; 131 | 132 | return UserResolver.update(context.user, fields); 133 | } 134 | } 135 | 136 | } 137 | }, 138 | 139 | 140 | fcm() { 141 | return { 142 | type: Generic.messageOutputType, 143 | description: 'Update user Device token', 144 | 145 | args: { 146 | deviceToken: { 147 | type: new GraphQLNonNull(GraphQLString), 148 | description: 'Enter device token', 149 | }, 150 | platform: { 151 | type: new GraphQLNonNull(GraphQLString), 152 | description: 'Enter platform android, ios', 153 | } 154 | }, 155 | resolve(parent, fields, context, info) { 156 | 157 | if (auth.isAuthenticated(context)) { 158 | return UserResolver.updateFcmDeviceToken(context.user, fields); 159 | } 160 | } 161 | 162 | } 163 | }, 164 | 165 | createAddress() { 166 | return { 167 | type: AddressType, 168 | description: 'Add new User\'s address', 169 | 170 | args: { 171 | street: { 172 | type: new GraphQLList(GraphQLString), 173 | description: 'Enter street', 174 | }, 175 | city: { 176 | type: new GraphQLNonNull(GraphQLString), 177 | description: 'Enter city', 178 | }, 179 | countryId: { 180 | type: new GraphQLNonNull(GraphQLString), 181 | description: 'Enter country id', 182 | }, 183 | locality: { 184 | type: GraphQLString, 185 | description: 'Enter locality', 186 | }, 187 | landmark: { 188 | type: GraphQLString, 189 | description: 'Enter landmark', 190 | }, 191 | addressType: { 192 | type: new GraphQLNonNull(GraphQLString), 193 | description: 'Enter address type', 194 | }, 195 | postcode: { 196 | type: new GraphQLNonNull(GraphQLString), 197 | description: 'Enter postcode', 198 | } 199 | }, 200 | resolve(parent, fields, context, info) { 201 | 202 | if (auth.isAuthenticated(context)) { 203 | return UserResolver.createAddress(context.user, fields); 204 | } 205 | } 206 | } 207 | }, 208 | 209 | 210 | updateAddress() { 211 | return { 212 | type: AddressType, 213 | description: 'Update User\'s address', 214 | 215 | args: { 216 | id: { 217 | type: new GraphQLNonNull(GraphQLString), 218 | description: 'Enter id', 219 | }, 220 | street: { 221 | type: new GraphQLList(GraphQLString), 222 | description: 'Enter street', 223 | }, 224 | city: { 225 | type: GraphQLString, 226 | description: 'Enter city', 227 | }, 228 | countryId: { 229 | type: GraphQLString, 230 | description: 'Enter country id', 231 | }, 232 | locality: { 233 | type: GraphQLString, 234 | description: 'Enter locality', 235 | }, 236 | landmark: { 237 | type: GraphQLString, 238 | description: 'Enter landmark', 239 | }, 240 | addressType: { 241 | type: GraphQLString, 242 | description: 'Enter address type', 243 | }, 244 | postcode: { 245 | type: GraphQLString, 246 | description: 'Enter postcode', 247 | } 248 | }, 249 | resolve(parent, fields, context, info) { 250 | 251 | if (auth.isAuthenticated(context)) { 252 | return UserResolver.updateAddress(context.user, fields); 253 | } 254 | } 255 | } 256 | }, 257 | 258 | deleteAddress() { 259 | return { 260 | type: Generic.messageOutputType, 261 | description: 'Delete User\'s address', 262 | 263 | args: { 264 | id: { 265 | type: new GraphQLNonNull(GraphQLString), 266 | description: 'Enter id', 267 | } 268 | }, 269 | resolve(parent, fields, context, info) { 270 | 271 | if (auth.isAuthenticated(context)) { 272 | return UserResolver.deleteAddress(context.user, fields); 273 | } 274 | } 275 | } 276 | } 277 | 278 | 279 | }; 280 | -------------------------------------------------------------------------------- /graphql/queries/Init.js: -------------------------------------------------------------------------------- 1 | const GraphQL = require('graphql'); 2 | const auth = require('../../config/auth'); 3 | const Generic = require('../types/Generic'); 4 | 5 | const { 6 | GraphQLList, 7 | GraphQLID, 8 | GraphQLString, 9 | GraphQLNonNull, 10 | } = GraphQL; 11 | 12 | // import the init resolver we created 13 | const InitResolver = require('../resolvers/Init'); 14 | 15 | 16 | module.exports = { 17 | 18 | index() { 19 | return { 20 | type: Generic.initOutputType, 21 | description: 'Return app initialization data', 22 | resolve(parent, args, context, info) { 23 | return InitResolver.index({}); 24 | } 25 | } 26 | } 27 | }; -------------------------------------------------------------------------------- /graphql/queries/User.js: -------------------------------------------------------------------------------- 1 | const GraphQL = require('graphql'); 2 | const auth = require('../../config/auth'); 3 | 4 | const { 5 | GraphQLList, 6 | GraphQLID, 7 | GraphQLString, 8 | GraphQLNonNull, 9 | } = GraphQL; 10 | 11 | // import the user type we created 12 | const UserType = require('../types/User'); 13 | const AddressType = require('../types/Address'); 14 | 15 | // import the user resolver we created 16 | const UserResolver = require('../resolvers/User'); 17 | 18 | 19 | module.exports = { 20 | 21 | index() { 22 | return { 23 | type: new GraphQLList(UserType), 24 | description: 'This will return all the users present in the database', 25 | resolve(parent, args, context, info) { 26 | return UserResolver.index({}); 27 | } 28 | } 29 | }, 30 | 31 | single() { 32 | return { 33 | type: UserType, 34 | description: 'This will return data of a single users based on the id provided', 35 | args: { 36 | id: { 37 | type: new GraphQLNonNull(GraphQLID), 38 | description: 'Please enter user id', 39 | } 40 | }, 41 | resolve(parent, args, context, info) { 42 | return UserResolver.single({ id: args.id }); 43 | } 44 | } 45 | }, 46 | 47 | me() { 48 | return { 49 | type: UserType, 50 | description: 'This will return current user profile details', 51 | resolve(parent, args, context, info){ 52 | if (auth.isAuthenticated(context)) { 53 | return context.user; 54 | } 55 | } 56 | } 57 | }, 58 | 59 | userAddress() { 60 | return { 61 | type: AddressType, 62 | description: 'This will return current user profile details', 63 | args: { 64 | id: { 65 | type: new GraphQLNonNull(GraphQLID), 66 | description: 'Please enter address id', 67 | } 68 | }, 69 | resolve(parent, args, context, info){ 70 | if (auth.isAuthenticated(context)) { 71 | return context.user.address.id(args.id); 72 | } 73 | } 74 | } 75 | }, 76 | 77 | }; 78 | 79 | -------------------------------------------------------------------------------- /graphql/resolvers/Init.js: -------------------------------------------------------------------------------- 1 | const option = require('../../config/options'); 2 | 3 | class InitController { 4 | 5 | // this will find all the records in database and return it 6 | index() { 7 | return { 8 | appVersion: option.appVersion 9 | } 10 | } 11 | }; 12 | 13 | const init = new InitController(); 14 | module.exports = init; 15 | -------------------------------------------------------------------------------- /graphql/resolvers/User.js: -------------------------------------------------------------------------------- 1 | const bcrypt = require('bcrypt-nodejs'); 2 | const jwt = require('jsonwebtoken'); 3 | const User = require('../../models/User'); 4 | const option = require('../../config/options'); 5 | const moment = require('moment'); 6 | 7 | const includeAccessToken = (user) => { 8 | const payload = {id: user.id, username: user.username}; 9 | let userObject = user.toJSON(); 10 | const token = jwt.sign(payload, process.env.JWT_SECRET_KEY); 11 | userObject['token'] = token; 12 | 13 | return userObject; 14 | }; 15 | 16 | class UserController { 17 | 18 | constructor(model) { 19 | this.model = User; 20 | } 21 | 22 | // this will find a single record based on username and return it. 23 | auth(options) { 24 | return this.model.findOne({mobileNumber: options.mobileNumber}) 25 | .exec() 26 | .then((user) => { 27 | 28 | if (!user) { 29 | return new Error('Invalid login credentials.'); 30 | } 31 | 32 | if (bcrypt.compareSync(options.password, user.password)) { 33 | return includeAccessToken(user); 34 | } else { 35 | return new Error('Invalid login credentials.'); 36 | } 37 | 38 | }).catch(error => { 39 | return error; 40 | }); 41 | 42 | } 43 | 44 | // this will find all the records in database and return it 45 | index() { 46 | return this.model.find() 47 | .sort('createdAt') 48 | .exec() 49 | .then(records => { 50 | return records; 51 | }) 52 | .catch(error => { 53 | return error; 54 | }); 55 | } 56 | 57 | // this will find a single record based on id and return it. 58 | single(options) { 59 | return this.model.findOne({_id: options.id}) 60 | .exec() 61 | .then(record => { 62 | return record; 63 | }) 64 | .catch(error => { 65 | return error; 66 | }); 67 | } 68 | 69 | // this will insert a new record in database 70 | create(data) { 71 | const record = new this.model(data); 72 | return record.save() 73 | .then((user) => { 74 | 75 | var otp = option.generateOtp(); 76 | 77 | user.mobileVerificationOTP = otp; 78 | var todayDate = new Date(); 79 | todayDate.setDate(todayDate.getDate() + 1); // OTP expiry 1 day 80 | user.mobileVerificationExpires = todayDate; 81 | 82 | var message = user.mobileVerificationOTP + " is the OTP for your new account"; 83 | 84 | return user.save() 85 | .then(updated => { 86 | return includeAccessToken(updated); 87 | }) 88 | .catch((error) => { 89 | return error; 90 | }); 91 | 92 | 93 | }) 94 | .catch((error) => { 95 | return error; 96 | }); 97 | } 98 | 99 | // this will update existing record in database 100 | update(user, data) { 101 | return this.model.findOne({_id: user.id}) 102 | .exec() 103 | .then((record) => { 104 | let mobileNumberModified = false; 105 | Object.keys(data).map(field => { 106 | if (field == 'mobileNumber' && data[field] != user.mobileNumber) { 107 | mobileNumberModified = true; 108 | } 109 | 110 | if (field == 'picture' && (!data[field] || data[field] == '' || data[field] == null ) ) { 111 | data[field] = record.picture; 112 | } 113 | record[field] = data[field]; 114 | }); 115 | 116 | return record.save() 117 | .then(user => { 118 | 119 | if (mobileNumberModified) { 120 | // Send OTP if mobileNumber changed 121 | var otp = option.generateOtp(); 122 | 123 | user.mobileVerificationOTP = otp; 124 | var todayDate = new Date(); 125 | todayDate.setDate(todayDate.getDate() + 1); // OTP expiry 1 day 126 | user.mobileVerificationExpires = todayDate; 127 | 128 | const message = user.mobileVerificationOTP + " is the OTP for your mobile number"; 129 | 130 | return user.save() 131 | .then(updated => { 132 | return updated; 133 | }) 134 | .catch((error) => { 135 | return error; 136 | }); 137 | } else { 138 | return user; 139 | } 140 | }) 141 | .catch((error) => { 142 | return error; 143 | }); 144 | 145 | }) 146 | .catch((error) => { 147 | return error; 148 | }); 149 | } 150 | 151 | // this will insert a new record in database 152 | createAddress(user, data) { 153 | 154 | return this.model.findById(user.id) 155 | .exec() 156 | .then((record) => { 157 | 158 | if (!record) { 159 | return new Error('Invalid request user does\'t exist.'); 160 | } 161 | 162 | const address = record.address.create(data); 163 | record.address.push(address); 164 | 165 | return record.save() 166 | .then((updated) => { 167 | return address; 168 | }) 169 | .catch((error) => { 170 | return error; 171 | }); 172 | 173 | }).catch(error => { 174 | return error; 175 | }); 176 | 177 | } 178 | 179 | 180 | // this will update existing record in database 181 | updateAddress(user, data) { 182 | 183 | return this.model.findOne({_id: user.id}) 184 | .exec() 185 | .then((user) => { 186 | 187 | let address = user.address.id(data.id); 188 | 189 | if(!address) throw new Error("Address not found"); 190 | 191 | delete data.id; 192 | Object.keys(data).map(field => { 193 | address[field] = data[field]; 194 | }); 195 | 196 | return user.save() 197 | .then(user => { 198 | return address; 199 | }) 200 | .catch((error) => { 201 | return error; 202 | }); 203 | 204 | }) 205 | .catch((error) => { 206 | return error; 207 | }); 208 | } 209 | 210 | 211 | // this will delete the user address 212 | deleteAddress(user, data) { 213 | 214 | return this.model.findOne({_id: user.id}) 215 | .exec() 216 | .then((user) => { 217 | 218 | user.address.pull(data.id) 219 | return user.save() 220 | .then(user => { 221 | return {message: "Address deleted successfully!"}; 222 | }) 223 | .catch((error) => { 224 | return error; 225 | }); 226 | 227 | }) 228 | .catch((error) => { 229 | return error; 230 | }); 231 | } 232 | 233 | 234 | 235 | } 236 | ; 237 | 238 | const user_controller = new UserController(); 239 | module.exports = user_controller; 240 | -------------------------------------------------------------------------------- /graphql/types/Address.js: -------------------------------------------------------------------------------- 1 | const GraphQL = require('graphql'); 2 | const { 3 | GraphQLObjectType, 4 | GraphQLString, 5 | GraphQLBoolean, 6 | GraphQLID, 7 | GraphQLInt, 8 | GraphQLList, 9 | } = GraphQL; 10 | 11 | const Generic = require('./Generic'); 12 | 13 | 14 | const UserType = new GraphQL.GraphQLObjectType({ 15 | name: 'Address', 16 | description: 'Address type for managing all the user\'s address in our application.', 17 | 18 | fields: () => ({ 19 | id: { 20 | type: GraphQLID, 21 | description: 'ID of the address, Generated automatically by MongoDB', 22 | }, 23 | street: { 24 | type: new GraphQLList(GraphQLString), 25 | description: 'Address streets', 26 | }, 27 | city: { 28 | type: GraphQLString, 29 | description: 'Address city', 30 | }, 31 | countryId: { 32 | type: GraphQLString, 33 | description: 'Address country id', 34 | }, 35 | locality: { 36 | type: GraphQLString, 37 | description: 'Address locality', 38 | }, 39 | landmark: { 40 | type: GraphQLString, 41 | description: 'Address landmark', 42 | }, 43 | addressType: { 44 | type: GraphQLString, 45 | description: 'Address addressType', 46 | }, 47 | postcode: { 48 | type: GraphQLString, 49 | description: 'Address postcode', 50 | }, 51 | createdAt: { 52 | type: GraphQLString, 53 | description: 'Generate system to allow user to have secure resource access', 54 | }, 55 | updatedAt: { 56 | type: GraphQLString, 57 | description: 'Date and time when this users account was last updated', 58 | } 59 | 60 | }) 61 | 62 | }); 63 | 64 | 65 | module.exports = UserType; 66 | 67 | -------------------------------------------------------------------------------- /graphql/types/Generic.js: -------------------------------------------------------------------------------- 1 | const GraphQL = require('graphql'); 2 | const { 3 | GraphQLObjectType, 4 | GraphQLInputObjectType, 5 | GraphQLString, 6 | GraphQLBoolean, 7 | GraphQLID, 8 | GraphQLInt, 9 | GraphQLList, 10 | } = GraphQL; 11 | 12 | 13 | 14 | exports.mobileNumberInputType = new GraphQLInputObjectType({ 15 | name: 'mobileNumberInput', 16 | description: 'Accept only mobile number in input', 17 | fields: () => ({ 18 | mobileNumber: { 19 | type: GraphQLString, 20 | description: 'Phone number of the user', 21 | }, 22 | }) 23 | }); 24 | 25 | exports.messageOutputType = new GraphQLObjectType({ 26 | name: 'messageOutput', 27 | description: 'Send success message', 28 | fields: () => ({ 29 | message: { 30 | type: GraphQLString, 31 | description: 'Success message string', 32 | }, 33 | }) 34 | }); 35 | 36 | 37 | exports.initOutputType = new GraphQLObjectType({ 38 | name: 'initOutput', 39 | description: 'Init response structure', 40 | fields: () => ({ 41 | appVersion: { 42 | type: GraphQLString, 43 | description: 'Return app version', 44 | }, 45 | }) 46 | }); 47 | 48 | -------------------------------------------------------------------------------- /graphql/types/User.js: -------------------------------------------------------------------------------- 1 | const GraphQL = require('graphql'); 2 | const { 3 | GraphQLObjectType, 4 | GraphQLString, 5 | GraphQLBoolean, 6 | GraphQLID, 7 | GraphQLInt, 8 | GraphQLList, 9 | } = GraphQL; 10 | 11 | const Generic = require('./Generic'); 12 | const Address = require('./Address'); 13 | 14 | 15 | const UserType = new GraphQL.GraphQLObjectType({ 16 | name: 'User', 17 | description: 'User type for managing all the users in our application.', 18 | 19 | fields: () => ({ 20 | id: { 21 | type: GraphQLID, 22 | description: 'ID of the user, Generated automatically by MongoDB', 23 | }, 24 | name: { 25 | type: GraphQLString, 26 | description: 'Full name of the user', 27 | }, 28 | gender: { 29 | type: GraphQLString, 30 | description: 'Gender of the user', 31 | }, 32 | picture: { 33 | type: GraphQLString, 34 | description: 'Profile picture of the user', 35 | }, 36 | 37 | email: { 38 | type: GraphQLString, 39 | description: 'Email address of the user, must be valid and unique', 40 | }, 41 | 42 | isEmailVerified: { 43 | type: GraphQLBoolean, 44 | description: 'Email is verified', 45 | }, 46 | 47 | mobileNumber: { 48 | type: GraphQLString, 49 | description: 'Phone number of the user', 50 | }, 51 | 52 | isMobileVerified: { 53 | type: GraphQLBoolean, 54 | description: 'Mobile number is verified', 55 | }, 56 | 57 | status: { 58 | type: GraphQLString, 59 | description: 'Status of the user, whether active or disabled', 60 | }, 61 | 62 | dob: { 63 | type: GraphQLString, 64 | description: 'Date of birth in 1992-01-02', 65 | }, 66 | 67 | token: { 68 | type: GraphQLString, 69 | description: 'Status of the user, whether active or disabled', 70 | }, 71 | 72 | address: { 73 | type: new GraphQLList(Address), 74 | description: 'User address', 75 | }, 76 | createdAt: { 77 | type: GraphQLString, 78 | description: 'Generate system to allow user to have secure resource access', 79 | }, 80 | updatedAt: { 81 | type: GraphQLString, 82 | description: 'Date and time when this users account was last updated', 83 | } 84 | 85 | }) 86 | 87 | }); 88 | 89 | 90 | module.exports = UserType; 91 | 92 | -------------------------------------------------------------------------------- /middleware/uploadProfilePicture.js: -------------------------------------------------------------------------------- 1 | const multer = require('multer') 2 | const multerS3 = require('multer-s3') 3 | 4 | const path = require('path'); 5 | const mime = require('mime'); 6 | const crypto = require('crypto'); 7 | const sanitize = require('sanitize-filename'); 8 | 9 | const AWS = require('aws-sdk'); 10 | 11 | AWS.config.update({ 12 | accessKeyId: process.env.AWS_ACCESS_KEY, 13 | secretAccessKey: process.env.AWS_SECRET_KEY, 14 | region: process.env.AWS_S3_REGION 15 | }); 16 | 17 | const s3 = new AWS.S3(); 18 | 19 | 20 | // Profile Pic upload 21 | const profilePictureCloudStorage = multerS3({ 22 | s3: s3, 23 | bucket: process.env.AWS_PROFILE_IMAGE_BUCKET, 24 | contentType: multerS3.AUTO_CONTENT_TYPE, 25 | metadata: function (request, file, ab_callback) { 26 | ab_callback(null, {fieldname: file.fieldname}); 27 | }, 28 | key: function (request, file, ab_callback) { 29 | 30 | // add hash to sanitized file name 31 | const filename = `${Date.now()}_${sanitize( 32 | file.originalname.replace( 33 | /[`~!@#$%^&*()_|+\-=÷¿?;:'",<>{}[]\\\/]/gi, 34 | '', 35 | ), 36 | )}`; 37 | 38 | var newFileName = Date.now() + "-" + filename; 39 | var fullPath = 'users/profile/' + newFileName; 40 | ab_callback(null, fullPath); 41 | }, 42 | }); 43 | 44 | const multerS3ProfilePictureUpload = multer({ 45 | storage: profilePictureCloudStorage 46 | }).single('picture'); 47 | 48 | 49 | const profilePictureUpload = (req, res, next) => { 50 | multerS3ProfilePictureUpload(req, res, () => { 51 | 52 | const file = req.file; 53 | 54 | if (!file || file.length === 0 || !file.key) { 55 | next() 56 | return 57 | } 58 | 59 | req.context['picture'] = file.location || ''; 60 | next(); 61 | }) 62 | } 63 | 64 | module.exports = profilePictureUpload; -------------------------------------------------------------------------------- /models/User.js: -------------------------------------------------------------------------------- 1 | var bcrypt = require('bcrypt-nodejs'); 2 | var crypto = require('crypto'); 3 | var mongoose = require('mongoose'); 4 | var _ = require('lodash'); 5 | var mongoosePaginate = require('mongoose-paginate'); 6 | 7 | var addressSchema = new mongoose.Schema({ 8 | street: [{type: String}], 9 | city: String, 10 | countryId: String, 11 | locality: String, 12 | landmark: String, 13 | addressType: {type: String, default: "home"}, 14 | postcode: String 15 | }, {timestamps: true}); 16 | 17 | var userSchema = new mongoose.Schema({ 18 | email: {type: String, default: ''}, 19 | isEmailVerified: Boolean, 20 | 21 | password: String, 22 | passwordResetToken: String, 23 | passwordResetExpires: Date, 24 | 25 | mobileNumber: {type: String, unique: true}, 26 | mobileVerificationOTP: String, 27 | mobileVerificationExpires: Date, 28 | isMobileVerified: Boolean, 29 | 30 | deviceTokens: [{fcm: String, platform: String}], 31 | 32 | name: {type: String, default: ''}, 33 | gender: {type: String, default: ''}, 34 | dob: {type: Date}, 35 | picture: {type: String, default: ''}, 36 | 37 | status: {type: String, default: "active"}, 38 | 39 | address: [addressSchema], 40 | 41 | }, {timestamps: true, toObject: {virtuals: true}, toJSON: {virtuals: true}}); 42 | 43 | /** 44 | * Password hash middleware. 45 | */ 46 | userSchema.pre('save', function (next) { 47 | var user = this; 48 | if (!user.isModified('password')) { 49 | return next(); 50 | } 51 | bcrypt.genSalt(10, function (err, salt) { 52 | if (err) { 53 | return next(err); 54 | } 55 | bcrypt.hash(user.password, salt, null, function (err, hash) { 56 | if (err) { 57 | return next(err); 58 | } 59 | user.password = hash; 60 | next(); 61 | }); 62 | }); 63 | }); 64 | 65 | userSchema.plugin(mongoosePaginate); 66 | 67 | var User = mongoose.model('User', userSchema); 68 | 69 | 70 | module.exports = User; 71 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NIQ", 3 | "version": "0.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "accepts": { 8 | "version": "1.3.4", 9 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", 10 | "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", 11 | "requires": { 12 | "mime-types": "2.1.16", 13 | "negotiator": "0.6.1" 14 | } 15 | }, 16 | "addressparser": { 17 | "version": "1.0.1", 18 | "resolved": "https://registry.npmjs.org/addressparser/-/addressparser-1.0.1.tgz", 19 | "integrity": "sha1-R6++GiqSYhkdtoOOT9HTm0CCF0Y=" 20 | }, 21 | "ajv": { 22 | "version": "4.11.8", 23 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", 24 | "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", 25 | "requires": { 26 | "co": "4.6.0", 27 | "json-stable-stringify": "1.0.1" 28 | } 29 | }, 30 | "append-field": { 31 | "version": "0.1.0", 32 | "resolved": "https://registry.npmjs.org/append-field/-/append-field-0.1.0.tgz", 33 | "integrity": "sha1-bdxY+gg8e8VF08WZWygwzCNm1Eo=" 34 | }, 35 | "array-flatten": { 36 | "version": "1.1.1", 37 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 38 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 39 | }, 40 | "asn1": { 41 | "version": "0.2.3", 42 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", 43 | "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" 44 | }, 45 | "assert-plus": { 46 | "version": "0.2.0", 47 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", 48 | "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=" 49 | }, 50 | "async": { 51 | "version": "1.5.2", 52 | "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", 53 | "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" 54 | }, 55 | "asynckit": { 56 | "version": "0.4.0", 57 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 58 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 59 | }, 60 | "aws-sdk": { 61 | "version": "2.100.0", 62 | "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.100.0.tgz", 63 | "integrity": "sha1-/A+8p2kNbCjv/Si9Uf6F99ukK/8=", 64 | "requires": { 65 | "buffer": "4.9.1", 66 | "crypto-browserify": "1.0.9", 67 | "events": "1.1.1", 68 | "jmespath": "0.15.0", 69 | "querystring": "0.2.0", 70 | "sax": "1.2.4", 71 | "url": "0.10.3", 72 | "uuid": "3.1.0", 73 | "xml2js": "0.4.17", 74 | "xmlbuilder": "9.0.1" 75 | } 76 | }, 77 | "aws-sign2": { 78 | "version": "0.6.0", 79 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", 80 | "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=" 81 | }, 82 | "aws4": { 83 | "version": "1.6.0", 84 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", 85 | "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" 86 | }, 87 | "base64-js": { 88 | "version": "1.2.1", 89 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", 90 | "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==" 91 | }, 92 | "base64url": { 93 | "version": "2.0.0", 94 | "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", 95 | "integrity": "sha1-6sFuA+oUOO/5Qj1puqNiYu0fcLs=" 96 | }, 97 | "bcrypt-nodejs": { 98 | "version": "0.0.3", 99 | "resolved": "https://registry.npmjs.org/bcrypt-nodejs/-/bcrypt-nodejs-0.0.3.tgz", 100 | "integrity": "sha1-xgkX8m3CNWYVZsaBBhwwPCsohCs=" 101 | }, 102 | "bcrypt-pbkdf": { 103 | "version": "1.0.1", 104 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", 105 | "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", 106 | "optional": true, 107 | "requires": { 108 | "tweetnacl": "0.14.5" 109 | } 110 | }, 111 | "bluebird": { 112 | "version": "3.5.0", 113 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", 114 | "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=" 115 | }, 116 | "body-parser": { 117 | "version": "1.17.2", 118 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.17.2.tgz", 119 | "integrity": "sha1-+IkqvI+eYn1Crtr7yma/WrmRBO4=", 120 | "requires": { 121 | "bytes": "2.4.0", 122 | "content-type": "1.0.2", 123 | "debug": "2.6.7", 124 | "depd": "1.1.1", 125 | "http-errors": "1.6.1", 126 | "iconv-lite": "0.4.15", 127 | "on-finished": "2.3.0", 128 | "qs": "6.4.0", 129 | "raw-body": "2.2.0", 130 | "type-is": "1.6.15" 131 | } 132 | }, 133 | "boom": { 134 | "version": "2.10.1", 135 | "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", 136 | "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", 137 | "requires": { 138 | "hoek": "2.16.3" 139 | } 140 | }, 141 | "bson": { 142 | "version": "1.0.4", 143 | "resolved": "https://registry.npmjs.org/bson/-/bson-1.0.4.tgz", 144 | "integrity": "sha1-k8ENOeqltYQVy8QFLz5T5WKwtyw=" 145 | }, 146 | "buffer": { 147 | "version": "4.9.1", 148 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", 149 | "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", 150 | "requires": { 151 | "base64-js": "1.2.1", 152 | "ieee754": "1.1.8", 153 | "isarray": "0.0.1" 154 | } 155 | }, 156 | "buffer-equal-constant-time": { 157 | "version": "1.0.1", 158 | "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", 159 | "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" 160 | }, 161 | "buffer-shims": { 162 | "version": "1.0.0", 163 | "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", 164 | "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=" 165 | }, 166 | "buildmail": { 167 | "version": "4.0.1", 168 | "resolved": "https://registry.npmjs.org/buildmail/-/buildmail-4.0.1.tgz", 169 | "integrity": "sha1-h393OLeHKYccmhBeO4N9K+EaenI=", 170 | "requires": { 171 | "addressparser": "1.0.1", 172 | "libbase64": "0.1.0", 173 | "libmime": "3.0.0", 174 | "libqp": "1.1.0", 175 | "nodemailer-fetch": "1.6.0", 176 | "nodemailer-shared": "1.1.0", 177 | "punycode": "1.4.1" 178 | } 179 | }, 180 | "busboy": { 181 | "version": "0.2.14", 182 | "resolved": "https://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz", 183 | "integrity": "sha1-bCpiLvz0fFe7vh4qnDetNseSVFM=", 184 | "requires": { 185 | "dicer": "0.2.5", 186 | "readable-stream": "1.1.14" 187 | } 188 | }, 189 | "bytes": { 190 | "version": "2.4.0", 191 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz", 192 | "integrity": "sha1-fZcZb51br39pNeJZhVSe3SpsIzk=" 193 | }, 194 | "caseless": { 195 | "version": "0.12.0", 196 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", 197 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" 198 | }, 199 | "co": { 200 | "version": "4.6.0", 201 | "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", 202 | "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" 203 | }, 204 | "combined-stream": { 205 | "version": "1.0.5", 206 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", 207 | "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", 208 | "requires": { 209 | "delayed-stream": "1.0.0" 210 | } 211 | }, 212 | "concat-stream": { 213 | "version": "1.6.0", 214 | "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", 215 | "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", 216 | "requires": { 217 | "inherits": "2.0.3", 218 | "readable-stream": "2.3.3", 219 | "typedarray": "0.0.6" 220 | }, 221 | "dependencies": { 222 | "inherits": { 223 | "version": "2.0.3", 224 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 225 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 226 | }, 227 | "isarray": { 228 | "version": "1.0.0", 229 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 230 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 231 | }, 232 | "readable-stream": { 233 | "version": "2.3.3", 234 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", 235 | "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", 236 | "requires": { 237 | "core-util-is": "1.0.2", 238 | "inherits": "2.0.3", 239 | "isarray": "1.0.0", 240 | "process-nextick-args": "1.0.7", 241 | "safe-buffer": "5.1.1", 242 | "string_decoder": "1.0.3", 243 | "util-deprecate": "1.0.2" 244 | } 245 | }, 246 | "string_decoder": { 247 | "version": "1.0.3", 248 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", 249 | "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", 250 | "requires": { 251 | "safe-buffer": "5.1.1" 252 | } 253 | } 254 | } 255 | }, 256 | "connect-mongo": { 257 | "version": "1.3.2", 258 | "resolved": "https://registry.npmjs.org/connect-mongo/-/connect-mongo-1.3.2.tgz", 259 | "integrity": "sha1-fL9Y3/8mdg5eAOAX0KhbS8kLnTc=", 260 | "requires": { 261 | "bluebird": "3.5.0", 262 | "mongodb": "2.2.30" 263 | } 264 | }, 265 | "connect-timeout": { 266 | "version": "1.9.0", 267 | "resolved": "https://registry.npmjs.org/connect-timeout/-/connect-timeout-1.9.0.tgz", 268 | "integrity": "sha1-vCcyaxIhA3FL6/oNlYurM/ZSLjo=", 269 | "requires": { 270 | "http-errors": "1.6.1", 271 | "ms": "2.0.0", 272 | "on-finished": "2.3.0", 273 | "on-headers": "1.0.1" 274 | } 275 | }, 276 | "content-disposition": { 277 | "version": "0.5.2", 278 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", 279 | "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" 280 | }, 281 | "content-type": { 282 | "version": "1.0.2", 283 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz", 284 | "integrity": "sha1-t9ETrueo3Se9IRM8TcJSnfFyHu0=" 285 | }, 286 | "cookie": { 287 | "version": "0.3.1", 288 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", 289 | "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" 290 | }, 291 | "cookie-signature": { 292 | "version": "1.0.6", 293 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 294 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 295 | }, 296 | "core-util-is": { 297 | "version": "1.0.2", 298 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 299 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 300 | }, 301 | "cron-parser": { 302 | "version": "2.4.1", 303 | "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-2.4.1.tgz", 304 | "integrity": "sha512-b5IKyY/Dqyjfnnog15TsIMxshVmRXb298FQ5+Wfqe87ZImimZ+E/GFMISGeIvzuJOvQoESbSU6lYhIh3SbA2/w==", 305 | "requires": { 306 | "is-nan": "1.2.1", 307 | "moment-timezone": "0.5.13" 308 | } 309 | }, 310 | "cryptiles": { 311 | "version": "2.0.5", 312 | "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", 313 | "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", 314 | "requires": { 315 | "boom": "2.10.1" 316 | } 317 | }, 318 | "crypto": { 319 | "version": "0.0.3", 320 | "resolved": "https://registry.npmjs.org/crypto/-/crypto-0.0.3.tgz", 321 | "integrity": "sha1-RwqBuGvkxe4XrMggeh9TFa4g27A=" 322 | }, 323 | "crypto-browserify": { 324 | "version": "1.0.9", 325 | "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-1.0.9.tgz", 326 | "integrity": "sha1-zFRJaF37hesRyYKKzHy4erW7/MA=" 327 | }, 328 | "cycle": { 329 | "version": "1.0.3", 330 | "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", 331 | "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=" 332 | }, 333 | "dashdash": { 334 | "version": "1.14.1", 335 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", 336 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 337 | "requires": { 338 | "assert-plus": "1.0.0" 339 | }, 340 | "dependencies": { 341 | "assert-plus": { 342 | "version": "1.0.0", 343 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 344 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 345 | } 346 | } 347 | }, 348 | "debug": { 349 | "version": "2.6.7", 350 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", 351 | "integrity": "sha1-krrR9tBbu2u6Isyoi80OyJTChh4=", 352 | "requires": { 353 | "ms": "2.0.0" 354 | } 355 | }, 356 | "define-properties": { 357 | "version": "1.1.2", 358 | "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", 359 | "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", 360 | "requires": { 361 | "foreach": "2.0.5", 362 | "object-keys": "1.0.11" 363 | } 364 | }, 365 | "delayed-stream": { 366 | "version": "1.0.0", 367 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 368 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 369 | }, 370 | "depd": { 371 | "version": "1.1.1", 372 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", 373 | "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" 374 | }, 375 | "destroy": { 376 | "version": "1.0.4", 377 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 378 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 379 | }, 380 | "dicer": { 381 | "version": "0.2.5", 382 | "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz", 383 | "integrity": "sha1-WZbAhrszIYyBLAkL3cCc0S+stw8=", 384 | "requires": { 385 | "readable-stream": "1.1.14", 386 | "streamsearch": "0.1.2" 387 | } 388 | }, 389 | "dotenv": { 390 | "version": "2.0.0", 391 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-2.0.0.tgz", 392 | "integrity": "sha1-vXWcNXqqcDZeAclrewvsCKbg2Uk=" 393 | }, 394 | "ecc-jsbn": { 395 | "version": "0.1.1", 396 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", 397 | "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", 398 | "optional": true, 399 | "requires": { 400 | "jsbn": "0.1.1" 401 | } 402 | }, 403 | "ecdsa-sig-formatter": { 404 | "version": "1.0.9", 405 | "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.9.tgz", 406 | "integrity": "sha1-S8kmJ07Dtau1AW5+HWCSGsJisqE=", 407 | "requires": { 408 | "base64url": "2.0.0", 409 | "safe-buffer": "5.1.1" 410 | } 411 | }, 412 | "ee-first": { 413 | "version": "1.1.1", 414 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 415 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 416 | }, 417 | "encodeurl": { 418 | "version": "1.0.1", 419 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", 420 | "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=" 421 | }, 422 | "escape-html": { 423 | "version": "1.0.3", 424 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 425 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 426 | }, 427 | "etag": { 428 | "version": "1.8.1", 429 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 430 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 431 | }, 432 | "events": { 433 | "version": "1.1.1", 434 | "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", 435 | "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" 436 | }, 437 | "express": { 438 | "version": "4.16.2", 439 | "resolved": "https://registry.npmjs.org/express/-/express-4.16.2.tgz", 440 | "integrity": "sha1-41xt/i1kt9ygpc1PIXgb4ymeB2w=", 441 | "requires": { 442 | "accepts": "1.3.4", 443 | "array-flatten": "1.1.1", 444 | "body-parser": "1.18.2", 445 | "content-disposition": "0.5.2", 446 | "content-type": "1.0.4", 447 | "cookie": "0.3.1", 448 | "cookie-signature": "1.0.6", 449 | "debug": "2.6.9", 450 | "depd": "1.1.1", 451 | "encodeurl": "1.0.1", 452 | "escape-html": "1.0.3", 453 | "etag": "1.8.1", 454 | "finalhandler": "1.1.0", 455 | "fresh": "0.5.2", 456 | "merge-descriptors": "1.0.1", 457 | "methods": "1.1.2", 458 | "on-finished": "2.3.0", 459 | "parseurl": "1.3.2", 460 | "path-to-regexp": "0.1.7", 461 | "proxy-addr": "2.0.2", 462 | "qs": "6.5.1", 463 | "range-parser": "1.2.0", 464 | "safe-buffer": "5.1.1", 465 | "send": "0.16.1", 466 | "serve-static": "1.13.1", 467 | "setprototypeof": "1.1.0", 468 | "statuses": "1.3.1", 469 | "type-is": "1.6.15", 470 | "utils-merge": "1.0.1", 471 | "vary": "1.1.2" 472 | }, 473 | "dependencies": { 474 | "body-parser": { 475 | "version": "1.18.2", 476 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", 477 | "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", 478 | "requires": { 479 | "bytes": "3.0.0", 480 | "content-type": "1.0.4", 481 | "debug": "2.6.9", 482 | "depd": "1.1.1", 483 | "http-errors": "1.6.2", 484 | "iconv-lite": "0.4.19", 485 | "on-finished": "2.3.0", 486 | "qs": "6.5.1", 487 | "raw-body": "2.3.2", 488 | "type-is": "1.6.15" 489 | } 490 | }, 491 | "bytes": { 492 | "version": "3.0.0", 493 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", 494 | "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" 495 | }, 496 | "content-type": { 497 | "version": "1.0.4", 498 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 499 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 500 | }, 501 | "debug": { 502 | "version": "2.6.9", 503 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 504 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 505 | "requires": { 506 | "ms": "2.0.0" 507 | } 508 | }, 509 | "http-errors": { 510 | "version": "1.6.2", 511 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", 512 | "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", 513 | "requires": { 514 | "depd": "1.1.1", 515 | "inherits": "2.0.3", 516 | "setprototypeof": "1.0.3", 517 | "statuses": "1.3.1" 518 | }, 519 | "dependencies": { 520 | "setprototypeof": { 521 | "version": "1.0.3", 522 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", 523 | "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" 524 | } 525 | } 526 | }, 527 | "iconv-lite": { 528 | "version": "0.4.19", 529 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", 530 | "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" 531 | }, 532 | "inherits": { 533 | "version": "2.0.3", 534 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 535 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 536 | }, 537 | "qs": { 538 | "version": "6.5.1", 539 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", 540 | "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" 541 | }, 542 | "raw-body": { 543 | "version": "2.3.2", 544 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", 545 | "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", 546 | "requires": { 547 | "bytes": "3.0.0", 548 | "http-errors": "1.6.2", 549 | "iconv-lite": "0.4.19", 550 | "unpipe": "1.0.0" 551 | } 552 | }, 553 | "setprototypeof": { 554 | "version": "1.1.0", 555 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", 556 | "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" 557 | } 558 | } 559 | }, 560 | "express-graphql": { 561 | "version": "0.6.11", 562 | "resolved": "https://registry.npmjs.org/express-graphql/-/express-graphql-0.6.11.tgz", 563 | "integrity": "sha512-dC/FAun5rqcRxhDe78047hqc048mo3xZpBDS0Z7RZOw9UleO9mZE0rHMS9yrVSaYzsLiz+q4PldKu6Oaqop+CA==", 564 | "requires": { 565 | "accepts": "1.3.4", 566 | "content-type": "1.0.2", 567 | "http-errors": "1.6.1", 568 | "raw-body": "2.2.0" 569 | } 570 | }, 571 | "express-jwt": { 572 | "version": "5.3.0", 573 | "resolved": "https://registry.npmjs.org/express-jwt/-/express-jwt-5.3.0.tgz", 574 | "integrity": "sha1-PZDNZYAuYzYlLxnmo98+FJ4MXqA=", 575 | "requires": { 576 | "async": "1.5.2", 577 | "express-unless": "0.3.1", 578 | "jsonwebtoken": "7.4.3", 579 | "lodash.set": "4.3.2" 580 | }, 581 | "dependencies": { 582 | "jsonwebtoken": { 583 | "version": "7.4.3", 584 | "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-7.4.3.tgz", 585 | "integrity": "sha1-d/UCHeBYtgWheD+hKD6ZgS5kVjg=", 586 | "requires": { 587 | "joi": "6.10.1", 588 | "jws": "3.1.4", 589 | "lodash.once": "4.1.1", 590 | "ms": "2.0.0", 591 | "xtend": "4.0.1" 592 | } 593 | } 594 | } 595 | }, 596 | "express-unless": { 597 | "version": "0.3.1", 598 | "resolved": "https://registry.npmjs.org/express-unless/-/express-unless-0.3.1.tgz", 599 | "integrity": "sha1-JVfBRudb65A+LSR/m1ugFFJpbiA=" 600 | }, 601 | "extend": { 602 | "version": "3.0.0", 603 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", 604 | "integrity": "sha1-WkdDU7nzNT3dgXbf03uRyDpG8dQ=" 605 | }, 606 | "extsprintf": { 607 | "version": "1.0.2", 608 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", 609 | "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=" 610 | }, 611 | "eyes": { 612 | "version": "0.1.8", 613 | "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", 614 | "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" 615 | }, 616 | "file-type": { 617 | "version": "3.9.0", 618 | "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", 619 | "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=" 620 | }, 621 | "finalhandler": { 622 | "version": "1.1.0", 623 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", 624 | "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", 625 | "requires": { 626 | "debug": "2.6.9", 627 | "encodeurl": "1.0.1", 628 | "escape-html": "1.0.3", 629 | "on-finished": "2.3.0", 630 | "parseurl": "1.3.2", 631 | "statuses": "1.3.1", 632 | "unpipe": "1.0.0" 633 | }, 634 | "dependencies": { 635 | "debug": { 636 | "version": "2.6.9", 637 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 638 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 639 | "requires": { 640 | "ms": "2.0.0" 641 | } 642 | } 643 | } 644 | }, 645 | "firebase-admin": { 646 | "version": "5.1.0", 647 | "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-5.1.0.tgz", 648 | "integrity": "sha1-SMimeETSMZoqSVgrzTw1U0q08Xg=", 649 | "requires": { 650 | "@types/jsonwebtoken": "7.2.2", 651 | "faye-websocket": "0.9.3", 652 | "jsonwebtoken": "7.1.9", 653 | "node-forge": "0.7.1" 654 | }, 655 | "dependencies": { 656 | "@types/jsonwebtoken": { 657 | "version": "7.2.2", 658 | "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-7.2.2.tgz", 659 | "integrity": "sha512-T2kcdrbS8dE94dnsaMVbIc/ENrCpIEByUqyc8Qa1mc04E8iVO/I6lsyTyGn+rV7Zo2+8gg/7P+lXDoLGFLwSKg==", 660 | "requires": { 661 | "@types/node": "8.0.16" 662 | } 663 | }, 664 | "@types/node": { 665 | "version": "8.0.16", 666 | "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.16.tgz", 667 | "integrity": "sha512-P2XfbkmcAnP/XT5J5m59cQPbcIbszCwXRdngnBZefmqt1RgOv4RIFoIkG85QFDHWIt1T6bXogZP/tvh2dm/xEQ==" 668 | }, 669 | "base64url": { 670 | "version": "2.0.0", 671 | "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", 672 | "integrity": "sha1-6sFuA+oUOO/5Qj1puqNiYu0fcLs=" 673 | }, 674 | "buffer-equal-constant-time": { 675 | "version": "1.0.1", 676 | "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", 677 | "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" 678 | }, 679 | "ecdsa-sig-formatter": { 680 | "version": "1.0.9", 681 | "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.9.tgz", 682 | "integrity": "sha1-S8kmJ07Dtau1AW5+HWCSGsJisqE=", 683 | "requires": { 684 | "base64url": "2.0.0", 685 | "safe-buffer": "5.1.1" 686 | } 687 | }, 688 | "faye-websocket": { 689 | "version": "0.9.3", 690 | "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.9.3.tgz", 691 | "integrity": "sha1-SCpQWw3wrmJrlphm0710DNuWLoM=", 692 | "requires": { 693 | "websocket-driver": "0.6.5" 694 | } 695 | }, 696 | "hoek": { 697 | "version": "2.16.3", 698 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", 699 | "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" 700 | }, 701 | "isemail": { 702 | "version": "1.2.0", 703 | "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz", 704 | "integrity": "sha1-vgPfjMPineTSxd9lASY/H6RZXpo=" 705 | }, 706 | "joi": { 707 | "version": "6.10.1", 708 | "resolved": "https://registry.npmjs.org/joi/-/joi-6.10.1.tgz", 709 | "integrity": "sha1-TVDDGAeRIgAP5fFq8f+OGRe3fgY=", 710 | "requires": { 711 | "hoek": "2.16.3", 712 | "isemail": "1.2.0", 713 | "moment": "2.18.1", 714 | "topo": "1.1.0" 715 | } 716 | }, 717 | "jsonwebtoken": { 718 | "version": "7.1.9", 719 | "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-7.1.9.tgz", 720 | "integrity": "sha1-hHgE5SWL7FqUmajcSl56O64I1Yo=", 721 | "requires": { 722 | "joi": "6.10.1", 723 | "jws": "3.1.4", 724 | "lodash.once": "4.1.1", 725 | "ms": "0.7.3", 726 | "xtend": "4.0.1" 727 | } 728 | }, 729 | "jwa": { 730 | "version": "1.1.5", 731 | "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.5.tgz", 732 | "integrity": "sha1-oFUs4CIHQs1S4VN3SjKQXDDnVuU=", 733 | "requires": { 734 | "base64url": "2.0.0", 735 | "buffer-equal-constant-time": "1.0.1", 736 | "ecdsa-sig-formatter": "1.0.9", 737 | "safe-buffer": "5.1.1" 738 | } 739 | }, 740 | "jws": { 741 | "version": "3.1.4", 742 | "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.4.tgz", 743 | "integrity": "sha1-+ei5M46KhHJ31kRLFGT2GIDgUKI=", 744 | "requires": { 745 | "base64url": "2.0.0", 746 | "jwa": "1.1.5", 747 | "safe-buffer": "5.1.1" 748 | } 749 | }, 750 | "lodash.once": { 751 | "version": "4.1.1", 752 | "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", 753 | "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" 754 | }, 755 | "moment": { 756 | "version": "2.18.1", 757 | "resolved": "https://registry.npmjs.org/moment/-/moment-2.18.1.tgz", 758 | "integrity": "sha1-w2GT3Tzhwu7SrbfIAtu8d6gbHA8=" 759 | }, 760 | "ms": { 761 | "version": "0.7.3", 762 | "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.3.tgz", 763 | "integrity": "sha1-cIFVpeROM/X9D8U+gdDUCpG+H/8=" 764 | }, 765 | "node-forge": { 766 | "version": "0.7.1", 767 | "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.1.tgz", 768 | "integrity": "sha1-naYR6giYL0uUIGs760zJZl8gwwA=" 769 | }, 770 | "safe-buffer": { 771 | "version": "5.1.1", 772 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", 773 | "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" 774 | }, 775 | "topo": { 776 | "version": "1.1.0", 777 | "resolved": "https://registry.npmjs.org/topo/-/topo-1.1.0.tgz", 778 | "integrity": "sha1-6ddRYV0buH3IZdsYL6HKCl71NtU=", 779 | "requires": { 780 | "hoek": "2.16.3" 781 | } 782 | }, 783 | "websocket-driver": { 784 | "version": "0.6.5", 785 | "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.6.5.tgz", 786 | "integrity": "sha1-XLJVbOuF9Dc8bYI4qmkchFThOjY=", 787 | "requires": { 788 | "websocket-extensions": "0.1.1" 789 | } 790 | }, 791 | "websocket-extensions": { 792 | "version": "0.1.1", 793 | "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.1.tgz", 794 | "integrity": "sha1-domUmcGEtu91Q3fC27DNbLVdKec=" 795 | }, 796 | "xtend": { 797 | "version": "4.0.1", 798 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", 799 | "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" 800 | } 801 | } 802 | }, 803 | "foreach": { 804 | "version": "2.0.5", 805 | "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", 806 | "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" 807 | }, 808 | "forever-agent": { 809 | "version": "0.6.1", 810 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", 811 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" 812 | }, 813 | "forwarded": { 814 | "version": "0.1.2", 815 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 816 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 817 | }, 818 | "fresh": { 819 | "version": "0.5.2", 820 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 821 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 822 | }, 823 | "getpass": { 824 | "version": "0.1.7", 825 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", 826 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 827 | "requires": { 828 | "assert-plus": "1.0.0" 829 | }, 830 | "dependencies": { 831 | "assert-plus": { 832 | "version": "1.0.0", 833 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 834 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 835 | } 836 | } 837 | }, 838 | "graphql": { 839 | "version": "0.11.7", 840 | "resolved": "https://registry.npmjs.org/graphql/-/graphql-0.11.7.tgz", 841 | "integrity": "sha512-x7uDjyz8Jx+QPbpCFCMQ8lltnQa4p4vSYHx6ADe8rVYRTdsyhCJbvSty5DAsLVmU6cGakl+r8HQYolKHxk/tiw==", 842 | "requires": { 843 | "iterall": "1.1.3" 844 | } 845 | }, 846 | "har-schema": { 847 | "version": "1.0.5", 848 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", 849 | "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=" 850 | }, 851 | "har-validator": { 852 | "version": "4.2.1", 853 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", 854 | "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", 855 | "requires": { 856 | "ajv": "4.11.8", 857 | "har-schema": "1.0.5" 858 | } 859 | }, 860 | "hawk": { 861 | "version": "3.1.3", 862 | "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", 863 | "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", 864 | "requires": { 865 | "boom": "2.10.1", 866 | "cryptiles": "2.0.5", 867 | "hoek": "2.16.3", 868 | "sntp": "1.0.9" 869 | } 870 | }, 871 | "hoek": { 872 | "version": "2.16.3", 873 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", 874 | "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" 875 | }, 876 | "hooks-fixed": { 877 | "version": "2.0.0", 878 | "resolved": "https://registry.npmjs.org/hooks-fixed/-/hooks-fixed-2.0.0.tgz", 879 | "integrity": "sha1-oB2JTVKsf2WZu7H2PfycQR33DLo=" 880 | }, 881 | "http-errors": { 882 | "version": "1.6.1", 883 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.1.tgz", 884 | "integrity": "sha1-X4uO2YrKVFZWv1cplzh/kEpyIlc=", 885 | "requires": { 886 | "depd": "1.1.0", 887 | "inherits": "2.0.3", 888 | "setprototypeof": "1.0.3", 889 | "statuses": "1.3.1" 890 | }, 891 | "dependencies": { 892 | "depd": { 893 | "version": "1.1.0", 894 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz", 895 | "integrity": "sha1-4b2Cxqq2ztlluXuIsX7T5SjKGMM=" 896 | }, 897 | "inherits": { 898 | "version": "2.0.3", 899 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 900 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 901 | } 902 | } 903 | }, 904 | "http-signature": { 905 | "version": "1.1.1", 906 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", 907 | "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", 908 | "requires": { 909 | "assert-plus": "0.2.0", 910 | "jsprim": "1.4.0", 911 | "sshpk": "1.13.1" 912 | } 913 | }, 914 | "httpntlm": { 915 | "version": "1.6.1", 916 | "resolved": "https://registry.npmjs.org/httpntlm/-/httpntlm-1.6.1.tgz", 917 | "integrity": "sha1-rQFScUOi6Hc8+uapb1hla7UqNLI=", 918 | "requires": { 919 | "httpreq": "0.4.24", 920 | "underscore": "1.7.0" 921 | } 922 | }, 923 | "httpreq": { 924 | "version": "0.4.24", 925 | "resolved": "https://registry.npmjs.org/httpreq/-/httpreq-0.4.24.tgz", 926 | "integrity": "sha1-QzX/2CzZaWaKOUZckprGHWOTYn8=" 927 | }, 928 | "iconv-lite": { 929 | "version": "0.4.15", 930 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz", 931 | "integrity": "sha1-/iZaIYrGpXz+hUkn6dBMGYJe3es=" 932 | }, 933 | "ieee754": { 934 | "version": "1.1.8", 935 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", 936 | "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=" 937 | }, 938 | "inherits": { 939 | "version": "2.0.1", 940 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", 941 | "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" 942 | }, 943 | "ip": { 944 | "version": "1.1.5", 945 | "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", 946 | "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" 947 | }, 948 | "ipaddr.js": { 949 | "version": "1.5.2", 950 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.5.2.tgz", 951 | "integrity": "sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A=" 952 | }, 953 | "is-nan": { 954 | "version": "1.2.1", 955 | "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.2.1.tgz", 956 | "integrity": "sha1-n69ltvttskt/XAYoR16nH5iEAeI=", 957 | "requires": { 958 | "define-properties": "1.1.2" 959 | } 960 | }, 961 | "is-typedarray": { 962 | "version": "1.0.0", 963 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 964 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 965 | }, 966 | "isarray": { 967 | "version": "0.0.1", 968 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", 969 | "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" 970 | }, 971 | "isemail": { 972 | "version": "1.2.0", 973 | "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz", 974 | "integrity": "sha1-vgPfjMPineTSxd9lASY/H6RZXpo=" 975 | }, 976 | "isstream": { 977 | "version": "0.1.2", 978 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 979 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 980 | }, 981 | "iterall": { 982 | "version": "1.1.3", 983 | "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.1.3.tgz", 984 | "integrity": "sha512-Cu/kb+4HiNSejAPhSaN1VukdNTTi/r4/e+yykqjlG/IW+1gZH5b4+Bq3whDX4tvbYugta3r8KTMUiqT3fIGxuQ==" 985 | }, 986 | "jmespath": { 987 | "version": "0.15.0", 988 | "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", 989 | "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=" 990 | }, 991 | "joi": { 992 | "version": "6.10.1", 993 | "resolved": "https://registry.npmjs.org/joi/-/joi-6.10.1.tgz", 994 | "integrity": "sha1-TVDDGAeRIgAP5fFq8f+OGRe3fgY=", 995 | "requires": { 996 | "hoek": "2.16.3", 997 | "isemail": "1.2.0", 998 | "moment": "2.18.1", 999 | "topo": "1.1.0" 1000 | } 1001 | }, 1002 | "jsbn": { 1003 | "version": "0.1.1", 1004 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 1005 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", 1006 | "optional": true 1007 | }, 1008 | "json-schema": { 1009 | "version": "0.2.3", 1010 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", 1011 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" 1012 | }, 1013 | "json-stable-stringify": { 1014 | "version": "1.0.1", 1015 | "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", 1016 | "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", 1017 | "requires": { 1018 | "jsonify": "0.0.0" 1019 | } 1020 | }, 1021 | "json-stringify-safe": { 1022 | "version": "5.0.1", 1023 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 1024 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 1025 | }, 1026 | "jsonify": { 1027 | "version": "0.0.0", 1028 | "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", 1029 | "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" 1030 | }, 1031 | "jsonwebtoken": { 1032 | "version": "8.1.0", 1033 | "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.1.0.tgz", 1034 | "integrity": "sha1-xjl80uX9WD1lwAeoPce7eOaYK4M=", 1035 | "requires": { 1036 | "jws": "3.1.4", 1037 | "lodash.includes": "4.3.0", 1038 | "lodash.isboolean": "3.0.3", 1039 | "lodash.isinteger": "4.0.4", 1040 | "lodash.isnumber": "3.0.3", 1041 | "lodash.isplainobject": "4.0.6", 1042 | "lodash.isstring": "4.0.1", 1043 | "lodash.once": "4.1.1", 1044 | "ms": "2.0.0", 1045 | "xtend": "4.0.1" 1046 | } 1047 | }, 1048 | "jsprim": { 1049 | "version": "1.4.0", 1050 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", 1051 | "integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=", 1052 | "requires": { 1053 | "assert-plus": "1.0.0", 1054 | "extsprintf": "1.0.2", 1055 | "json-schema": "0.2.3", 1056 | "verror": "1.3.6" 1057 | }, 1058 | "dependencies": { 1059 | "assert-plus": { 1060 | "version": "1.0.0", 1061 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 1062 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 1063 | } 1064 | } 1065 | }, 1066 | "jwa": { 1067 | "version": "1.1.5", 1068 | "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.5.tgz", 1069 | "integrity": "sha1-oFUs4CIHQs1S4VN3SjKQXDDnVuU=", 1070 | "requires": { 1071 | "base64url": "2.0.0", 1072 | "buffer-equal-constant-time": "1.0.1", 1073 | "ecdsa-sig-formatter": "1.0.9", 1074 | "safe-buffer": "5.1.1" 1075 | } 1076 | }, 1077 | "jws": { 1078 | "version": "3.1.4", 1079 | "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.4.tgz", 1080 | "integrity": "sha1-+ei5M46KhHJ31kRLFGT2GIDgUKI=", 1081 | "requires": { 1082 | "base64url": "2.0.0", 1083 | "jwa": "1.1.5", 1084 | "safe-buffer": "5.1.1" 1085 | } 1086 | }, 1087 | "kareem": { 1088 | "version": "1.5.0", 1089 | "resolved": "https://registry.npmjs.org/kareem/-/kareem-1.5.0.tgz", 1090 | "integrity": "sha1-4+QQHZ3P3imXadr0tNtk2JXRdEg=" 1091 | }, 1092 | "libbase64": { 1093 | "version": "0.1.0", 1094 | "resolved": "https://registry.npmjs.org/libbase64/-/libbase64-0.1.0.tgz", 1095 | "integrity": "sha1-YjUag5VjrF/1vSbxL2Dpgwu3UeY=" 1096 | }, 1097 | "libmime": { 1098 | "version": "3.0.0", 1099 | "resolved": "https://registry.npmjs.org/libmime/-/libmime-3.0.0.tgz", 1100 | "integrity": "sha1-UaGp50SOy9Ms2lRCFnW7IbwJPaY=", 1101 | "requires": { 1102 | "iconv-lite": "0.4.15", 1103 | "libbase64": "0.1.0", 1104 | "libqp": "1.1.0" 1105 | } 1106 | }, 1107 | "libqp": { 1108 | "version": "1.1.0", 1109 | "resolved": "https://registry.npmjs.org/libqp/-/libqp-1.1.0.tgz", 1110 | "integrity": "sha1-9ebgatdLeU+1tbZpiL9yjvHe2+g=" 1111 | }, 1112 | "lodash": { 1113 | "version": "4.17.4", 1114 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", 1115 | "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" 1116 | }, 1117 | "lodash.includes": { 1118 | "version": "4.3.0", 1119 | "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", 1120 | "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" 1121 | }, 1122 | "lodash.isboolean": { 1123 | "version": "3.0.3", 1124 | "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", 1125 | "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" 1126 | }, 1127 | "lodash.isinteger": { 1128 | "version": "4.0.4", 1129 | "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", 1130 | "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" 1131 | }, 1132 | "lodash.isnumber": { 1133 | "version": "3.0.3", 1134 | "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", 1135 | "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" 1136 | }, 1137 | "lodash.isplainobject": { 1138 | "version": "4.0.6", 1139 | "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", 1140 | "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" 1141 | }, 1142 | "lodash.isstring": { 1143 | "version": "4.0.1", 1144 | "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", 1145 | "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" 1146 | }, 1147 | "lodash.once": { 1148 | "version": "4.1.1", 1149 | "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", 1150 | "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" 1151 | }, 1152 | "lodash.set": { 1153 | "version": "4.3.2", 1154 | "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", 1155 | "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=" 1156 | }, 1157 | "long-timeout": { 1158 | "version": "0.1.1", 1159 | "resolved": "https://registry.npmjs.org/long-timeout/-/long-timeout-0.1.1.tgz", 1160 | "integrity": "sha1-lyHXiLR+C8taJMLivuGg2lXatRQ=" 1161 | }, 1162 | "mailcomposer": { 1163 | "version": "4.0.1", 1164 | "resolved": "https://registry.npmjs.org/mailcomposer/-/mailcomposer-4.0.1.tgz", 1165 | "integrity": "sha1-DhxEsqB890DuF9wUm6AJ8Zyt/rQ=", 1166 | "requires": { 1167 | "buildmail": "4.0.1", 1168 | "libmime": "3.0.0" 1169 | } 1170 | }, 1171 | "media-typer": { 1172 | "version": "0.3.0", 1173 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 1174 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 1175 | }, 1176 | "merge-descriptors": { 1177 | "version": "1.0.1", 1178 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 1179 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 1180 | }, 1181 | "methods": { 1182 | "version": "1.1.2", 1183 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 1184 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 1185 | }, 1186 | "mime": { 1187 | "version": "1.3.6", 1188 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.6.tgz", 1189 | "integrity": "sha1-WR2E02U6awtKO5343lqoEI5y5eA=" 1190 | }, 1191 | "mime-db": { 1192 | "version": "1.29.0", 1193 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.29.0.tgz", 1194 | "integrity": "sha1-SNJtI1WJZRcErFkWygYAGRQmaHg=" 1195 | }, 1196 | "mime-types": { 1197 | "version": "2.1.16", 1198 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.16.tgz", 1199 | "integrity": "sha1-K4WKUuXs1RbbiXrCvodIeDBpjiM=", 1200 | "requires": { 1201 | "mime-db": "1.29.0" 1202 | } 1203 | }, 1204 | "minimist": { 1205 | "version": "0.0.8", 1206 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 1207 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" 1208 | }, 1209 | "mkdirp": { 1210 | "version": "0.5.1", 1211 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 1212 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 1213 | "requires": { 1214 | "minimist": "0.0.8" 1215 | } 1216 | }, 1217 | "moment": { 1218 | "version": "2.18.1", 1219 | "resolved": "https://registry.npmjs.org/moment/-/moment-2.18.1.tgz", 1220 | "integrity": "sha1-w2GT3Tzhwu7SrbfIAtu8d6gbHA8=" 1221 | }, 1222 | "moment-timezone": { 1223 | "version": "0.5.13", 1224 | "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.13.tgz", 1225 | "integrity": "sha1-mc5cfYJyYusPH3AgRBd/YHRde5A=", 1226 | "requires": { 1227 | "moment": "2.18.1" 1228 | } 1229 | }, 1230 | "mongodb": { 1231 | "version": "2.2.30", 1232 | "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.2.30.tgz", 1233 | "integrity": "sha1-jM2AH2dsgXIEDC8rR+lgKg1WNKs=", 1234 | "requires": { 1235 | "es6-promise": "3.2.1", 1236 | "mongodb-core": "2.1.14", 1237 | "readable-stream": "2.2.7" 1238 | }, 1239 | "dependencies": { 1240 | "es6-promise": { 1241 | "version": "3.2.1", 1242 | "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.2.1.tgz", 1243 | "integrity": "sha1-7FYjOGgDKQkgcXDDlEjiREndH8Q=" 1244 | }, 1245 | "isarray": { 1246 | "version": "1.0.0", 1247 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 1248 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 1249 | }, 1250 | "readable-stream": { 1251 | "version": "2.2.7", 1252 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.7.tgz", 1253 | "integrity": "sha1-BwV6y+JGeyIELTb5jFrVBwVOlbE=", 1254 | "requires": { 1255 | "buffer-shims": "1.0.0", 1256 | "core-util-is": "1.0.2", 1257 | "inherits": "2.0.1", 1258 | "isarray": "1.0.0", 1259 | "process-nextick-args": "1.0.7", 1260 | "string_decoder": "1.0.3", 1261 | "util-deprecate": "1.0.2" 1262 | } 1263 | }, 1264 | "string_decoder": { 1265 | "version": "1.0.3", 1266 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", 1267 | "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", 1268 | "requires": { 1269 | "safe-buffer": "5.1.1" 1270 | } 1271 | } 1272 | } 1273 | }, 1274 | "mongodb-core": { 1275 | "version": "2.1.14", 1276 | "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.14.tgz", 1277 | "integrity": "sha1-E8uidkImtb49GJkq8Mljzl6g8P0=", 1278 | "requires": { 1279 | "bson": "1.0.4", 1280 | "require_optional": "1.0.1" 1281 | } 1282 | }, 1283 | "mongoose": { 1284 | "version": "4.11.5", 1285 | "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-4.11.5.tgz", 1286 | "integrity": "sha1-WeSh2E3NNsxR8+Y5t3HLg1n1Oao=", 1287 | "requires": { 1288 | "async": "2.1.4", 1289 | "bson": "1.0.4", 1290 | "hooks-fixed": "2.0.0", 1291 | "kareem": "1.5.0", 1292 | "mongodb": "2.2.27", 1293 | "mpath": "0.3.0", 1294 | "mpromise": "0.5.5", 1295 | "mquery": "2.3.1", 1296 | "ms": "2.0.0", 1297 | "muri": "1.2.2", 1298 | "regexp-clone": "0.0.1", 1299 | "sliced": "1.0.1" 1300 | }, 1301 | "dependencies": { 1302 | "async": { 1303 | "version": "2.1.4", 1304 | "resolved": "https://registry.npmjs.org/async/-/async-2.1.4.tgz", 1305 | "integrity": "sha1-LSFgx3iAMuTdbL4lAvH5osj2zeQ=", 1306 | "requires": { 1307 | "lodash": "4.17.4" 1308 | } 1309 | }, 1310 | "es6-promise": { 1311 | "version": "3.2.1", 1312 | "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.2.1.tgz", 1313 | "integrity": "sha1-7FYjOGgDKQkgcXDDlEjiREndH8Q=" 1314 | }, 1315 | "isarray": { 1316 | "version": "1.0.0", 1317 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 1318 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 1319 | }, 1320 | "mongodb": { 1321 | "version": "2.2.27", 1322 | "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.2.27.tgz", 1323 | "integrity": "sha1-NBIgNNtm2YO89qta2yaiSnD+9uY=", 1324 | "requires": { 1325 | "es6-promise": "3.2.1", 1326 | "mongodb-core": "2.1.11", 1327 | "readable-stream": "2.2.7" 1328 | } 1329 | }, 1330 | "mongodb-core": { 1331 | "version": "2.1.11", 1332 | "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.11.tgz", 1333 | "integrity": "sha1-HDh3bOsXSZepnCiGDu2QKNqbPho=", 1334 | "requires": { 1335 | "bson": "1.0.4", 1336 | "require_optional": "1.0.1" 1337 | } 1338 | }, 1339 | "readable-stream": { 1340 | "version": "2.2.7", 1341 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.7.tgz", 1342 | "integrity": "sha1-BwV6y+JGeyIELTb5jFrVBwVOlbE=", 1343 | "requires": { 1344 | "buffer-shims": "1.0.0", 1345 | "core-util-is": "1.0.2", 1346 | "inherits": "2.0.1", 1347 | "isarray": "1.0.0", 1348 | "process-nextick-args": "1.0.7", 1349 | "string_decoder": "1.0.3", 1350 | "util-deprecate": "1.0.2" 1351 | } 1352 | }, 1353 | "string_decoder": { 1354 | "version": "1.0.3", 1355 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", 1356 | "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", 1357 | "requires": { 1358 | "safe-buffer": "5.1.1" 1359 | } 1360 | } 1361 | } 1362 | }, 1363 | "mongoose-paginate": { 1364 | "version": "5.0.3", 1365 | "resolved": "https://registry.npmjs.org/mongoose-paginate/-/mongoose-paginate-5.0.3.tgz", 1366 | "integrity": "sha1-165J7Vv2Tx9692IOqGW2cFjFU3E=", 1367 | "requires": { 1368 | "bluebird": "3.0.5" 1369 | }, 1370 | "dependencies": { 1371 | "bluebird": { 1372 | "version": "3.0.5", 1373 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.0.5.tgz", 1374 | "integrity": "sha1-L/nQfJs+2ynW0oD+B1KDZefs05I=" 1375 | } 1376 | } 1377 | }, 1378 | "morgan": { 1379 | "version": "1.8.2", 1380 | "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.8.2.tgz", 1381 | "integrity": "sha1-eErHc05KRTqcbm6GgKkyknXItoc=", 1382 | "requires": { 1383 | "basic-auth": "1.1.0", 1384 | "debug": "2.6.8", 1385 | "depd": "1.1.1", 1386 | "on-finished": "2.3.0", 1387 | "on-headers": "1.0.1" 1388 | }, 1389 | "dependencies": { 1390 | "basic-auth": { 1391 | "version": "1.1.0", 1392 | "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz", 1393 | "integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=" 1394 | }, 1395 | "debug": { 1396 | "version": "2.6.8", 1397 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", 1398 | "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", 1399 | "requires": { 1400 | "ms": "2.0.0" 1401 | } 1402 | } 1403 | } 1404 | }, 1405 | "mpath": { 1406 | "version": "0.3.0", 1407 | "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.3.0.tgz", 1408 | "integrity": "sha1-elj3iem1/TyUUgY0FXlg8mvV70Q=" 1409 | }, 1410 | "mpromise": { 1411 | "version": "0.5.5", 1412 | "resolved": "https://registry.npmjs.org/mpromise/-/mpromise-0.5.5.tgz", 1413 | "integrity": "sha1-9bJCWddjrMIlewoMjG2Gb9UXMuY=" 1414 | }, 1415 | "mquery": { 1416 | "version": "2.3.1", 1417 | "resolved": "https://registry.npmjs.org/mquery/-/mquery-2.3.1.tgz", 1418 | "integrity": "sha1-mrNnSXFIAP8LtTpoHOS8TV8HyHs=", 1419 | "requires": { 1420 | "bluebird": "2.10.2", 1421 | "debug": "2.6.8", 1422 | "regexp-clone": "0.0.1", 1423 | "sliced": "0.0.5" 1424 | }, 1425 | "dependencies": { 1426 | "bluebird": { 1427 | "version": "2.10.2", 1428 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz", 1429 | "integrity": "sha1-AkpVFylTCIV/FPkfEQb8O1VfRGs=" 1430 | }, 1431 | "debug": { 1432 | "version": "2.6.8", 1433 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", 1434 | "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", 1435 | "requires": { 1436 | "ms": "2.0.0" 1437 | } 1438 | }, 1439 | "sliced": { 1440 | "version": "0.0.5", 1441 | "resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz", 1442 | "integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8=" 1443 | } 1444 | } 1445 | }, 1446 | "ms": { 1447 | "version": "2.0.0", 1448 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 1449 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 1450 | }, 1451 | "multer": { 1452 | "version": "1.3.0", 1453 | "resolved": "https://registry.npmjs.org/multer/-/multer-1.3.0.tgz", 1454 | "integrity": "sha1-CSsmcPaEb6SRSWXvyM+Uwg/sbNI=", 1455 | "requires": { 1456 | "append-field": "0.1.0", 1457 | "busboy": "0.2.14", 1458 | "concat-stream": "1.6.0", 1459 | "mkdirp": "0.5.1", 1460 | "object-assign": "3.0.0", 1461 | "on-finished": "2.3.0", 1462 | "type-is": "1.6.15", 1463 | "xtend": "4.0.1" 1464 | } 1465 | }, 1466 | "multer-s3": { 1467 | "version": "2.7.0", 1468 | "resolved": "https://registry.npmjs.org/multer-s3/-/multer-s3-2.7.0.tgz", 1469 | "integrity": "sha1-XgnOhV13+Rq9H/V/TPMhGKPhZHU=", 1470 | "requires": { 1471 | "file-type": "3.9.0", 1472 | "run-parallel": "1.1.6" 1473 | } 1474 | }, 1475 | "muri": { 1476 | "version": "1.2.2", 1477 | "resolved": "https://registry.npmjs.org/muri/-/muri-1.2.2.tgz", 1478 | "integrity": "sha1-YxmBMmUNsIoEzHnM0A3Tia/SYxw=" 1479 | }, 1480 | "negotiator": { 1481 | "version": "0.6.1", 1482 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", 1483 | "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" 1484 | }, 1485 | "node-schedule": { 1486 | "version": "1.2.4", 1487 | "resolved": "https://registry.npmjs.org/node-schedule/-/node-schedule-1.2.4.tgz", 1488 | "integrity": "sha1-x3Zbyy8Y2Iz3N+q14QmCI6PeerY=", 1489 | "requires": { 1490 | "cron-parser": "2.4.1", 1491 | "long-timeout": "0.1.1", 1492 | "sorted-array-functions": "1.0.0" 1493 | } 1494 | }, 1495 | "nodemailer": { 1496 | "version": "2.7.2", 1497 | "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-2.7.2.tgz", 1498 | "integrity": "sha1-8kLmSa7q45tsftdA73sGHEBNMPk=", 1499 | "requires": { 1500 | "libmime": "3.0.0", 1501 | "mailcomposer": "4.0.1", 1502 | "nodemailer-direct-transport": "3.3.2", 1503 | "nodemailer-shared": "1.1.0", 1504 | "nodemailer-smtp-pool": "2.8.2", 1505 | "nodemailer-smtp-transport": "2.7.2", 1506 | "socks": "1.1.9" 1507 | }, 1508 | "dependencies": { 1509 | "socks": { 1510 | "version": "1.1.9", 1511 | "resolved": "https://registry.npmjs.org/socks/-/socks-1.1.9.tgz", 1512 | "integrity": "sha1-Yo1+TQSRJDVEWsC25Fk3bLPm1pE=", 1513 | "requires": { 1514 | "ip": "1.1.5", 1515 | "smart-buffer": "1.1.15" 1516 | } 1517 | } 1518 | } 1519 | }, 1520 | "nodemailer-direct-transport": { 1521 | "version": "3.3.2", 1522 | "resolved": "https://registry.npmjs.org/nodemailer-direct-transport/-/nodemailer-direct-transport-3.3.2.tgz", 1523 | "integrity": "sha1-6W+vuQNYVglH5WkBfZfmBzilCoY=", 1524 | "requires": { 1525 | "nodemailer-shared": "1.1.0", 1526 | "smtp-connection": "2.12.0" 1527 | } 1528 | }, 1529 | "nodemailer-fetch": { 1530 | "version": "1.6.0", 1531 | "resolved": "https://registry.npmjs.org/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz", 1532 | "integrity": "sha1-ecSQihwPXzdbc/6IjamCj23JY6Q=" 1533 | }, 1534 | "nodemailer-shared": { 1535 | "version": "1.1.0", 1536 | "resolved": "https://registry.npmjs.org/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz", 1537 | "integrity": "sha1-z1mU4v0mjQD1zw+nZ6CBae2wfsA=", 1538 | "requires": { 1539 | "nodemailer-fetch": "1.6.0" 1540 | } 1541 | }, 1542 | "nodemailer-smtp-pool": { 1543 | "version": "2.8.2", 1544 | "resolved": "https://registry.npmjs.org/nodemailer-smtp-pool/-/nodemailer-smtp-pool-2.8.2.tgz", 1545 | "integrity": "sha1-LrlNbPhXgLG0clzoU7nL1ejajHI=", 1546 | "requires": { 1547 | "nodemailer-shared": "1.1.0", 1548 | "nodemailer-wellknown": "0.1.10", 1549 | "smtp-connection": "2.12.0" 1550 | } 1551 | }, 1552 | "nodemailer-smtp-transport": { 1553 | "version": "2.7.2", 1554 | "resolved": "https://registry.npmjs.org/nodemailer-smtp-transport/-/nodemailer-smtp-transport-2.7.2.tgz", 1555 | "integrity": "sha1-A9ccdjFPFKx9vHvwM6am0W1n+3c=", 1556 | "requires": { 1557 | "nodemailer-shared": "1.1.0", 1558 | "nodemailer-wellknown": "0.1.10", 1559 | "smtp-connection": "2.12.0" 1560 | } 1561 | }, 1562 | "nodemailer-wellknown": { 1563 | "version": "0.1.10", 1564 | "resolved": "https://registry.npmjs.org/nodemailer-wellknown/-/nodemailer-wellknown-0.1.10.tgz", 1565 | "integrity": "sha1-WG24EB2zDLRDjrVGc3pBqtDPE9U=" 1566 | }, 1567 | "oauth-sign": { 1568 | "version": "0.8.2", 1569 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", 1570 | "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" 1571 | }, 1572 | "object-assign": { 1573 | "version": "3.0.0", 1574 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", 1575 | "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=" 1576 | }, 1577 | "object-keys": { 1578 | "version": "1.0.11", 1579 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", 1580 | "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=" 1581 | }, 1582 | "on-finished": { 1583 | "version": "2.3.0", 1584 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 1585 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 1586 | "requires": { 1587 | "ee-first": "1.1.1" 1588 | } 1589 | }, 1590 | "on-headers": { 1591 | "version": "1.0.1", 1592 | "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", 1593 | "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" 1594 | }, 1595 | "parseurl": { 1596 | "version": "1.3.2", 1597 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", 1598 | "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" 1599 | }, 1600 | "path-to-regexp": { 1601 | "version": "0.1.7", 1602 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 1603 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 1604 | }, 1605 | "performance-now": { 1606 | "version": "0.2.0", 1607 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", 1608 | "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=" 1609 | }, 1610 | "process-nextick-args": { 1611 | "version": "1.0.7", 1612 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", 1613 | "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" 1614 | }, 1615 | "proxy-addr": { 1616 | "version": "2.0.2", 1617 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.2.tgz", 1618 | "integrity": "sha1-ZXFQT0e7mI7IGAJT+F3X4UlSvew=", 1619 | "requires": { 1620 | "forwarded": "0.1.2", 1621 | "ipaddr.js": "1.5.2" 1622 | } 1623 | }, 1624 | "punycode": { 1625 | "version": "1.4.1", 1626 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", 1627 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" 1628 | }, 1629 | "qs": { 1630 | "version": "6.4.0", 1631 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", 1632 | "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=" 1633 | }, 1634 | "querystring": { 1635 | "version": "0.2.0", 1636 | "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", 1637 | "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" 1638 | }, 1639 | "range-parser": { 1640 | "version": "1.2.0", 1641 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", 1642 | "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" 1643 | }, 1644 | "raw-body": { 1645 | "version": "2.2.0", 1646 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.2.0.tgz", 1647 | "integrity": "sha1-mUl2z2pQlqQRYoQEkvC9xdbn+5Y=", 1648 | "requires": { 1649 | "bytes": "2.4.0", 1650 | "iconv-lite": "0.4.15", 1651 | "unpipe": "1.0.0" 1652 | } 1653 | }, 1654 | "readable-stream": { 1655 | "version": "1.1.14", 1656 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", 1657 | "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", 1658 | "requires": { 1659 | "core-util-is": "1.0.2", 1660 | "inherits": "2.0.1", 1661 | "isarray": "0.0.1", 1662 | "string_decoder": "0.10.31" 1663 | } 1664 | }, 1665 | "regexp-clone": { 1666 | "version": "0.0.1", 1667 | "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", 1668 | "integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=" 1669 | }, 1670 | "request": { 1671 | "version": "2.81.0", 1672 | "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", 1673 | "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", 1674 | "requires": { 1675 | "aws-sign2": "0.6.0", 1676 | "aws4": "1.6.0", 1677 | "caseless": "0.12.0", 1678 | "combined-stream": "1.0.5", 1679 | "extend": "3.0.0", 1680 | "forever-agent": "0.6.1", 1681 | "form-data": "2.1.4", 1682 | "har-validator": "4.2.1", 1683 | "hawk": "3.1.3", 1684 | "http-signature": "1.1.1", 1685 | "is-typedarray": "1.0.0", 1686 | "isstream": "0.1.2", 1687 | "json-stringify-safe": "5.0.1", 1688 | "mime-types": "2.1.16", 1689 | "oauth-sign": "0.8.2", 1690 | "performance-now": "0.2.0", 1691 | "qs": "6.4.0", 1692 | "safe-buffer": "5.1.1", 1693 | "stringstream": "0.0.5", 1694 | "tough-cookie": "2.3.2", 1695 | "tunnel-agent": "0.6.0", 1696 | "uuid": "3.1.0" 1697 | }, 1698 | "dependencies": { 1699 | "form-data": { 1700 | "version": "2.1.4", 1701 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", 1702 | "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", 1703 | "requires": { 1704 | "asynckit": "0.4.0", 1705 | "combined-stream": "1.0.5", 1706 | "mime-types": "2.1.16" 1707 | } 1708 | } 1709 | } 1710 | }, 1711 | "require_optional": { 1712 | "version": "1.0.1", 1713 | "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", 1714 | "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", 1715 | "requires": { 1716 | "resolve-from": "2.0.0", 1717 | "semver": "5.4.1" 1718 | }, 1719 | "dependencies": { 1720 | "semver": { 1721 | "version": "5.4.1", 1722 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", 1723 | "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" 1724 | } 1725 | } 1726 | }, 1727 | "resolve-from": { 1728 | "version": "2.0.0", 1729 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", 1730 | "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" 1731 | }, 1732 | "run-parallel": { 1733 | "version": "1.1.6", 1734 | "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.6.tgz", 1735 | "integrity": "sha1-KQA8miFj4B4tLfyQV18sbB1hoDk=" 1736 | }, 1737 | "safe-buffer": { 1738 | "version": "5.1.1", 1739 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", 1740 | "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" 1741 | }, 1742 | "sanitize-filename": { 1743 | "version": "1.6.1", 1744 | "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.1.tgz", 1745 | "integrity": "sha1-YS2hyWRz+gLczaktzVtKsWSmdyo=", 1746 | "requires": { 1747 | "truncate-utf8-bytes": "1.0.2" 1748 | } 1749 | }, 1750 | "sax": { 1751 | "version": "1.2.4", 1752 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", 1753 | "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" 1754 | }, 1755 | "send": { 1756 | "version": "0.16.1", 1757 | "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", 1758 | "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", 1759 | "requires": { 1760 | "debug": "2.6.9", 1761 | "depd": "1.1.1", 1762 | "destroy": "1.0.4", 1763 | "encodeurl": "1.0.1", 1764 | "escape-html": "1.0.3", 1765 | "etag": "1.8.1", 1766 | "fresh": "0.5.2", 1767 | "http-errors": "1.6.2", 1768 | "mime": "1.4.1", 1769 | "ms": "2.0.0", 1770 | "on-finished": "2.3.0", 1771 | "range-parser": "1.2.0", 1772 | "statuses": "1.3.1" 1773 | }, 1774 | "dependencies": { 1775 | "debug": { 1776 | "version": "2.6.9", 1777 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 1778 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 1779 | "requires": { 1780 | "ms": "2.0.0" 1781 | } 1782 | }, 1783 | "http-errors": { 1784 | "version": "1.6.2", 1785 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", 1786 | "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", 1787 | "requires": { 1788 | "depd": "1.1.1", 1789 | "inherits": "2.0.3", 1790 | "setprototypeof": "1.0.3", 1791 | "statuses": "1.3.1" 1792 | } 1793 | }, 1794 | "inherits": { 1795 | "version": "2.0.3", 1796 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 1797 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 1798 | }, 1799 | "mime": { 1800 | "version": "1.4.1", 1801 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", 1802 | "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" 1803 | } 1804 | } 1805 | }, 1806 | "serve-static": { 1807 | "version": "1.13.1", 1808 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz", 1809 | "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", 1810 | "requires": { 1811 | "encodeurl": "1.0.1", 1812 | "escape-html": "1.0.3", 1813 | "parseurl": "1.3.2", 1814 | "send": "0.16.1" 1815 | } 1816 | }, 1817 | "setprototypeof": { 1818 | "version": "1.0.3", 1819 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", 1820 | "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" 1821 | }, 1822 | "sliced": { 1823 | "version": "1.0.1", 1824 | "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", 1825 | "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" 1826 | }, 1827 | "smart-buffer": { 1828 | "version": "1.1.15", 1829 | "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-1.1.15.tgz", 1830 | "integrity": "sha1-fxFLW2X6s+KjWqd1uxLw0cZJvxY=" 1831 | }, 1832 | "smtp-connection": { 1833 | "version": "2.12.0", 1834 | "resolved": "https://registry.npmjs.org/smtp-connection/-/smtp-connection-2.12.0.tgz", 1835 | "integrity": "sha1-1275EnyyPCJZ7bHoNJwujV4tdME=", 1836 | "requires": { 1837 | "httpntlm": "1.6.1", 1838 | "nodemailer-shared": "1.1.0" 1839 | } 1840 | }, 1841 | "sntp": { 1842 | "version": "1.0.9", 1843 | "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", 1844 | "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", 1845 | "requires": { 1846 | "hoek": "2.16.3" 1847 | } 1848 | }, 1849 | "sorted-array-functions": { 1850 | "version": "1.0.0", 1851 | "resolved": "https://registry.npmjs.org/sorted-array-functions/-/sorted-array-functions-1.0.0.tgz", 1852 | "integrity": "sha1-wLVU2ecJr/y+VtNMGyUUGX/Tgnk=" 1853 | }, 1854 | "sshpk": { 1855 | "version": "1.13.1", 1856 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", 1857 | "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", 1858 | "requires": { 1859 | "asn1": "0.2.3", 1860 | "assert-plus": "1.0.0", 1861 | "bcrypt-pbkdf": "1.0.1", 1862 | "dashdash": "1.14.1", 1863 | "ecc-jsbn": "0.1.1", 1864 | "getpass": "0.1.7", 1865 | "jsbn": "0.1.1", 1866 | "tweetnacl": "0.14.5" 1867 | }, 1868 | "dependencies": { 1869 | "assert-plus": { 1870 | "version": "1.0.0", 1871 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 1872 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 1873 | } 1874 | } 1875 | }, 1876 | "stack-trace": { 1877 | "version": "0.0.10", 1878 | "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", 1879 | "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" 1880 | }, 1881 | "statuses": { 1882 | "version": "1.3.1", 1883 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", 1884 | "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" 1885 | }, 1886 | "streamsearch": { 1887 | "version": "0.1.2", 1888 | "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", 1889 | "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" 1890 | }, 1891 | "string_decoder": { 1892 | "version": "0.10.31", 1893 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", 1894 | "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" 1895 | }, 1896 | "stringstream": { 1897 | "version": "0.0.5", 1898 | "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", 1899 | "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" 1900 | }, 1901 | "topo": { 1902 | "version": "1.1.0", 1903 | "resolved": "https://registry.npmjs.org/topo/-/topo-1.1.0.tgz", 1904 | "integrity": "sha1-6ddRYV0buH3IZdsYL6HKCl71NtU=", 1905 | "requires": { 1906 | "hoek": "2.16.3" 1907 | } 1908 | }, 1909 | "tough-cookie": { 1910 | "version": "2.3.2", 1911 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", 1912 | "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", 1913 | "requires": { 1914 | "punycode": "1.4.1" 1915 | } 1916 | }, 1917 | "truncate-utf8-bytes": { 1918 | "version": "1.0.2", 1919 | "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", 1920 | "integrity": "sha1-QFkjkJWS1W94pYGENLC3hInKXys=", 1921 | "requires": { 1922 | "utf8-byte-length": "1.0.4" 1923 | } 1924 | }, 1925 | "tunnel-agent": { 1926 | "version": "0.6.0", 1927 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 1928 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 1929 | "requires": { 1930 | "safe-buffer": "5.1.1" 1931 | } 1932 | }, 1933 | "tweetnacl": { 1934 | "version": "0.14.5", 1935 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", 1936 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", 1937 | "optional": true 1938 | }, 1939 | "type-is": { 1940 | "version": "1.6.15", 1941 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", 1942 | "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", 1943 | "requires": { 1944 | "media-typer": "0.3.0", 1945 | "mime-types": "2.1.16" 1946 | } 1947 | }, 1948 | "typedarray": { 1949 | "version": "0.0.6", 1950 | "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", 1951 | "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" 1952 | }, 1953 | "underscore": { 1954 | "version": "1.7.0", 1955 | "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", 1956 | "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=" 1957 | }, 1958 | "unpipe": { 1959 | "version": "1.0.0", 1960 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1961 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 1962 | }, 1963 | "url": { 1964 | "version": "0.10.3", 1965 | "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", 1966 | "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", 1967 | "requires": { 1968 | "punycode": "1.4.1", 1969 | "querystring": "0.2.0" 1970 | } 1971 | }, 1972 | "utf8-byte-length": { 1973 | "version": "1.0.4", 1974 | "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", 1975 | "integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=" 1976 | }, 1977 | "util-deprecate": { 1978 | "version": "1.0.2", 1979 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1980 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 1981 | }, 1982 | "utils-merge": { 1983 | "version": "1.0.1", 1984 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1985 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 1986 | }, 1987 | "uuid": { 1988 | "version": "3.1.0", 1989 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", 1990 | "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" 1991 | }, 1992 | "validator": { 1993 | "version": "9.0.0", 1994 | "resolved": "https://registry.npmjs.org/validator/-/validator-9.0.0.tgz", 1995 | "integrity": "sha512-AkO6xRuOVNCb2B4+Ld61kQ6oJGcJ34coeEKMlGglRO9F3/8KLSS8biOrzN1PDEg2LC04R+pPKAEgNqqcZ1vSvg==" 1996 | }, 1997 | "vary": { 1998 | "version": "1.1.2", 1999 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 2000 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 2001 | }, 2002 | "verror": { 2003 | "version": "1.3.6", 2004 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", 2005 | "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", 2006 | "requires": { 2007 | "extsprintf": "1.0.2" 2008 | } 2009 | }, 2010 | "winston": { 2011 | "version": "2.3.1", 2012 | "resolved": "https://registry.npmjs.org/winston/-/winston-2.3.1.tgz", 2013 | "integrity": "sha1-C0hCDZeMAYBM8CMLZIhhWYIloRk=", 2014 | "requires": { 2015 | "async": "1.0.0", 2016 | "colors": "1.0.3", 2017 | "cycle": "1.0.3", 2018 | "eyes": "0.1.8", 2019 | "isstream": "0.1.2", 2020 | "stack-trace": "0.0.10" 2021 | }, 2022 | "dependencies": { 2023 | "async": { 2024 | "version": "1.0.0", 2025 | "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", 2026 | "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=" 2027 | }, 2028 | "colors": { 2029 | "version": "1.0.3", 2030 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", 2031 | "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" 2032 | } 2033 | } 2034 | }, 2035 | "xml2js": { 2036 | "version": "0.4.17", 2037 | "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.17.tgz", 2038 | "integrity": "sha1-F76T6q4/O3eTWceVtBlwWogX6Gg=", 2039 | "requires": { 2040 | "sax": "1.2.4", 2041 | "xmlbuilder": "4.2.1" 2042 | }, 2043 | "dependencies": { 2044 | "xmlbuilder": { 2045 | "version": "4.2.1", 2046 | "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-4.2.1.tgz", 2047 | "integrity": "sha1-qlijBBoGb5DqoWwvU4n/GfP0YaU=", 2048 | "requires": { 2049 | "lodash": "4.17.4" 2050 | } 2051 | } 2052 | } 2053 | }, 2054 | "xmlbuilder": { 2055 | "version": "9.0.1", 2056 | "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.1.tgz", 2057 | "integrity": "sha1-kc1wiXdVNj66V8Et3uq0o0GmH2U=" 2058 | }, 2059 | "xtend": { 2060 | "version": "4.0.1", 2061 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", 2062 | "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" 2063 | } 2064 | } 2065 | } 2066 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NodeMongoDbQraphQL", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "start": "node app.js" 6 | }, 7 | "dependencies": { 8 | "aws-sdk": "^2.100.0", 9 | "bcrypt-nodejs": "^0.0.3", 10 | "body-parser": "^1.15.1", 11 | "connect-mongo": "^1.1.0", 12 | "connect-timeout": "^1.9.0", 13 | "crypto": "0.0.3", 14 | "dotenv": "^2.0.0", 15 | "express": "^4.16.2", 16 | "express-graphql": "^0.6.11", 17 | "express-jwt": "^5.3.0", 18 | "firebase-admin": "^5.1.0", 19 | "graphql": "^0.11.7", 20 | "jsonwebtoken": "^8.1.0", 21 | "lodash": "^4.12.0", 22 | "mime": "^1.3.6", 23 | "moment": "^2.18.1", 24 | "mongoose": "^4.4.16", 25 | "mongoose-paginate": "^5.0.3", 26 | "morgan": "^1.7.0", 27 | "multer": "^1.3.0", 28 | "multer-s3": "^2.7.0", 29 | "node-schedule": "^1.2.4", 30 | "nodemailer": "^2.3.2", 31 | "request": "^2.72.0", 32 | "sanitize-filename": "^1.6.1", 33 | "validator": "^9.0.0", 34 | "winston": "^2.3.1" 35 | }, 36 | "devDependencies": {} 37 | } 38 | -------------------------------------------------------------------------------- /public/graphiql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ailoitte/node-mongodb-graphql-starter/df14e2c86cb2cecc355e6c9e4ae005bbb5a79c78/public/graphiql.png -------------------------------------------------------------------------------- /public/node+mongoDB+GraphQL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ailoitte/node-mongodb-graphql-starter/df14e2c86cb2cecc355e6c9e4ae005bbb5a79c78/public/node+mongoDB+GraphQL.png --------------------------------------------------------------------------------