diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 00000000..20b5fa92
Binary files /dev/null and b/.DS_Store differ
diff --git a/README.md b/README.md
index 3921a746..f2834591 100644
--- a/README.md
+++ b/README.md
@@ -181,9 +181,8 @@ This project is part of the following Open Source programs:
_There are many beginner level issues to begin with, which include documentation, development and design. Also, feel free to make issues for features as well as for reporting bugs.Participants can claim an issue by commenting that they are interested in it. We are also open to new ideas and suggestions._
-#### _2. Is this a hardware/IoT project?_
-_Yes, it is a hardware/IoT + software project. There would be maximum tasks related to frontend, backend, design and documentation of the website and later, it would be integrated with the real-time data from the sensors._
+
#### _3. How to communicate with us?_
@@ -212,115 +211,6 @@ _Mentors can assign issues to participants and also mention a deadline before wh
-```javascript
-
-var baseURL = `https://github.com`,
- projectsInRGSoC = _.filter(appliedProjects,
- (project) => {
- RGSoC.isSelected(project,
- new Date().getFullYear())
- });
-
-if (_.contains(projectsInRGSoC, {
- name: `Water Monitoring System`,
- url: `${baseURL}Water-Monitoring-System`
- })) {
- fork('Water Monitoring System');
- // Looking forward to awesome contributions
- console.log('Thank You RGSoC');
-}
-
-```
-
-**Glad to share that this project is shortlisted for [Rails Girls Summer Of Code 2020](https://railsgirlssummerofcode.org/)**, a global fellowship program for women and non-binary coders. Students receive a three-month scholarship to work on existing Open Source projects and expand their skill set.
-
-- [Click here](https://railsgirlssummerofcode.org/blog/) to learn more.
-- **RGSoC student applications have officially started on Monday, 02 March 2020. Apply [here](https://teams.railsgirlssummerofcode.org/apply).**
-- Check out the project [here](https://teams.railsgirlssummerofcode.org/projects/293-water-monitoring-system).
-- **[Click here](https://twitter.com/Vinit_Shahdeo/status/1234936360613695489) to view the tweet**. RTs are most welcome! :heart:
-- Feel free to **shoot your doubts [here](https://github.com/vinitshahdeo/Water-Monitoring-System/issues/141)**.
-
-## Leapcode
-
-[![leapcode-logo-full-png](https://user-images.githubusercontent.com/20594326/86490975-e5639f00-bd86-11ea-853b-1a0ecdc59201.png)](http://leapcode.io/)
-
-Now, we're officially a part of [leapcode.io](http://leapcode.io/). They're still building and hopeful to have their platform up pretty soon. [Click here](https://www.leapcode.io/) to get an early access.
-
-## Hacktoberfest
-
-
-
-**Register [here](https://hacktoberfest.digitalocean.com) for Hacktoberfest and make four pull requests (PRs) between October 1-31 to earn a free t-shirt.**
-
-There are many beginner level issues to begin with, with **Hacktoberfest** as the label which include documentation, development and design. Take up any issue and send your first PR!
-
-## Script Winter of Code
-
-
-
-We are now a part of Script Winter of Code (SWoC), an open source program by [Script Foundation](https://www.scriptindia.org/), with the aim to introduce more and more people to the world of Open source. You can submit a PR with an issue labelled as **SWoC 2021** to get exciting perks and opportunities.
-
-## Additional Info
-
-- If you're interested in contributing for **documentation**, please checkout `feature/documentation` branch.
-
-- If you're interested in contributing for **backend**, please checkout the following branch according to the tech stack:
-
- - **Django**: `feature/backend-django`
- - **Node.js**: `feature/backend-node`
-
-- If you're interested in contributing for **frontend**, please checkout `feature/frontend` branch.
-
-> **Note:** Are you an **absolute beginner?** Please [check the issues](https://github.com/vinitshahdeo/Water-Monitoring-System/issues?q=is%3Aopen+is%3Aissue+label%3Afirst-timers-only) labeled with `first-timers-only`. These issues might _let your Open Source journey begin_ - **Welcome onboard!**
-
-## Mentors
-
-[![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/vinitshahdeo) [![GitHub pull requests](https://img.shields.io/github/issues-pr-closed-raw/vinitshahdeo/Water-Monitoring-System?logo=git&logoColor=white)](https://github.com/vinitshahdeo/Water-Monitoring-System/pulls?q=is%3Apr+is%3Aclosed)
-
-| GitHub Usernames | Domain |
-| ----------------------------------------------------- | -------------------------- |
-| [@vinitshahdeo](https://github.com/vinitshahdeo) | Full Stack + Documentation |
-| [@ShreyaAnand](https://github.com/ShreyaAnand) | Full Stack |
-| [@YashMeh](https://github.com/YashMeh) | Backend |
-| [@PragatiVerma18](https://github.com/PragatiVerma18) | Backend + Documentation |
-| [@ramanaditya](https://github.com/ramanaditya) | Backend + Hardware |
-| [@ArpitKotecha](https://github.com/ArpitKotecha) | Backend |
-| [@Manvityagi](https://github.com/Manvityagi) | APIs + Cloud |
-| [@divyabhushan](https://github.com/divyabhushan) | Documentation |
-| [@jainpawan21](https://github.com/jainpawan21) | Frontend |
-| [@amaaniqbal](https://github.com/amaaniqbal) | Frontend |
-| [@nainikaB](https://github.com/nainikaB) | UI/UX |
-| [@roypratik](https://github.com/roypratik) | IoT |
-| [@sharmishthadash](https://github.com/sharmishthadash)| Product Management |
-| [@nandikajain](https://github.com/nandikajain) | Frontend (React) |
-| [@harshita19244](https://github.com/harshita19244) | Frontend (React) |
-
-[![](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/images/0)](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/links/0)[![](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/images/1)](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/links/1)[![](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/images/2)](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/links/2)[![](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/images/3)](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/links/3)[![](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/images/4)](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/links/4)[![](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/images/5)](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/links/5)[![](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/images/6)](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/links/6)[![](https://sourcerer.io/fame/vinitshahdeo/vinitshahdeo/Water-Monitoring-System/images/7)]()
-
-## Useful Resources
-
-- [Django Docs](https://docs.djangoproject.com/en/3.0/)
-- [React Docs](https://reactjs.org/docs/getting-started.html)
-- [Node.js Docs](https://nodejs.org/api/)
-- [Git and GitHub](https://www.digitalocean.com/community/tutorials/how-to-use-git-a-reference-guide)
-
-## Project Admin
-
-[![Relative date](https://img.shields.io/date/1577392258?color=important&label=started&logo=github)](https://github.com/vinitshahdeo/) [![Maintenance](https://img.shields.io/maintenance/yes/2020?color=green&logo=github)](https://github.com/vinitshahdeo/)
-
-| |
-| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
-| **[Vinit Shahdeo](https://www.linkedin.com/in/vinitshahdeo/)** |
-| |
-
-> **_Need help?_**
-> **_Feel free to contact me @ [vinitshahdeo@gmail.com](mailto:vinitshahdeo@gmail.com?Subject=WaterMonitoringProject)_**
-
-[![GitHub followers](https://img.shields.io/github/followers/vinitshahdeo.svg?label=Follow%20@vinitshahdeo&style=social)](https://github.com/vinitshahdeo/) [![Twitter Follow](https://img.shields.io/twitter/follow/Vinit_Shahdeo?style=social)](https://twitter.com/Vinit_Shahdeo)
-
-## COVID-19Stay Home, Stay Safe!
-
-I hope you are all staying safe at your home and enjoying the contribution for your awesome open source projects.
```javascript
/**
@@ -334,14 +224,9 @@ function stayAtHome() {
repeat();
}
-while(_.isAlive(new Virus('COVID-19'))) {
- // Stay home, Stay safe
- stayAtHome();
-}
```
-### :wave: [DO THE FIVE](https://www.mohfw.gov.in/): Help stop coronavirus
1. **HANDS**: Wash them often
2. **ELBOW**: Cough into it
diff --git a/package.json b/package.json
new file mode 100644
index 00000000..83796a47
--- /dev/null
+++ b/package.json
@@ -0,0 +1,22 @@
+{
+ "name": "water-monitoring-system",
+ "version": "1.0.0",
+ "description": "--- > ## :mask: [COVID-19](http://corona-cases-india.netlify.com/) | Stay Home, Stay Safe! :house: :mag_right: Checkout [this](http://corona-cases-india.netlify.com/) web app for live CORONA updates. > ### :incoming_envelope: Read my open letter [here](https://github.com/vinitshahdeo/Water-Monitoring-System/issues/236). :heart: > ## :bar_chart: Checkout the [COVID-19 Tracker :mask: | INDIA](https://indiafightscorona.netlify.app/) :india: > ### :point_right: You can find the repo [here](https://github.com/vinitshahdeo/COVID19/). :star:",
+ "main": "index.js",
+ "directories": {
+ "doc": "docs"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/kishankr7979/Water-Monitoring-System.git"
+ },
+ "author": "",
+ "license": "ISC",
+ "bugs": {
+ "url": "https://github.com/kishankr7979/Water-Monitoring-System/issues"
+ },
+ "homepage": "https://github.com/kishankr7979/Water-Monitoring-System#readme"
+}
diff --git a/src/.DS_Store b/src/.DS_Store
new file mode 100644
index 00000000..5385cd5a
Binary files /dev/null and b/src/.DS_Store differ
diff --git a/src/home.html b/src/home.html
index 0c363ff1..3ab7ec8f 100644
--- a/src/home.html
+++ b/src/home.html
@@ -21,186 +21,25 @@
Water Level Monitoring System - IoT Project
-
-
-
-
- Water Monitoring System
-
- Water Monitoring System is an IOT based Liquid Level Monitoring system
- that has mechanisms to keep the user alerted in case of liquid
- overflow or when tank depletes.
-
-
-
-
-
-
Danger Zone <30%
+
-
- Warning Zone <50%
+
-
Safe Zone >50%
+
@@ -213,6 +52,7 @@
Safe Zone >50%
diff --git a/userauthentication/.DS_Store b/userauthentication/.DS_Store
new file mode 100644
index 00000000..982e8a63
Binary files /dev/null and b/userauthentication/.DS_Store differ
diff --git a/userauthentication/index.js b/userauthentication/index.js
new file mode 100644
index 00000000..90d86037
--- /dev/null
+++ b/userauthentication/index.js
@@ -0,0 +1,129 @@
+const express = require("express");
+const mongoose = require("mongoose");
+const cookieSession = require("cookie-session");
+const bcrypt = require("bcrypt");
+
+const User = require("./models/Users");
+
+const authenticateUser = require("./middlewares/authenticateUser");
+
+const app = express();
+
+// connect the cloud database here with Mongodb Cloud.
+mongoose
+ .connect("#", {
+ useNewUrlParser: true,
+ useUnifiedTopology: true,
+ useCreateIndex: true,
+ useFindAndModify: false,
+ })
+ .then(() => {
+ console.log("connected to mongodb cloud! :)");
+ })
+ .catch((err) => {
+ console.log(err);
+ });
+
+// middlewares
+app.use(express.urlencoded({ extened: true }));
+app.use(express.static("public"));
+app.set("view engine", "ejs");
+
+// cookie session
+app.use(
+ cookieSession({
+ keys: ["randomStringASyoulikehjudfsajk"],
+ })
+);
+
+// route for serving frontend files
+app
+ .get("/", (req, res) => {
+ res.render("index");
+ })
+ .get("/login", (req, res) => {
+ res.render("login");
+ })
+ .get("/register", (req, res) => {
+ res.render("register");
+ })
+
+ .get("/home", authenticateUser, (req, res) => {
+ res.render("home", { user: req.session.user });
+ });
+
+// route for handling post requirests
+app
+ .post("/login", async (req, res) => {
+ const { email, password } = req.body;
+
+ // check for missing filds
+ if (!email || !password) {
+ res.send("Please enter all the fields");
+ return;
+ }
+
+ const doesUserExits = await User.findOne({ email });
+
+ if (!doesUserExits) {
+ res.send("invalid username or password");
+ return;
+ }
+
+ const doesPasswordMatch = await bcrypt.compare(
+ password,
+ doesUserExits.password
+ );
+
+ if (!doesPasswordMatch) {
+ res.send("invalid useranme or password");
+ return;
+ }
+
+ // else he\s logged in
+ req.session.user = {
+ email,
+ };
+
+ res.redirect("/home");
+ })
+ .post("/register", async (req, res) => {
+ const { email, password } = req.body;
+
+ // check for missing filds
+ if (!email || !password) {
+ res.send("Please enter all the fields");
+ return;
+ }
+
+ const doesUserExitsAlreay = await User.findOne({ email });
+
+ if (doesUserExitsAlreay) {
+ res.send("A user with that email already exits please try another one!");
+ return;
+ }
+
+ // hashing of password
+ const hashedPassword = await bcrypt.hash(password, 12);
+ const latestUser = new User({ email, password: hashedPassword });
+
+ latestUser
+ .save()
+ .then(() => {
+ res.send("registered account!");
+ return;
+ })
+ .catch((err) => console.log(err));
+ });
+
+//logout
+app.get("/logout", authenticateUser, (req, res) => {
+ req.session.user = null;
+ res.redirect("/login");
+});
+
+// server config
+const PORT = 400; // port setup
+app.listen(PORT, () => {
+ console.log(`Server started listening on port: `,PORT);
+});
diff --git a/userauthentication/middlewares/authenticateUser.js b/userauthentication/middlewares/authenticateUser.js
new file mode 100644
index 00000000..e4d7abb8
--- /dev/null
+++ b/userauthentication/middlewares/authenticateUser.js
@@ -0,0 +1,9 @@
+module.exports = (req, res, next) => {
+ if (!req.session.user) {
+ res.send("You're not allowed to view this content! please log in first!");
+ return;
+ }
+ //else continue
+ next();
+ };
+
\ No newline at end of file
diff --git a/userauthentication/models/Users.js b/userauthentication/models/Users.js
new file mode 100644
index 00000000..b7e0e551
--- /dev/null
+++ b/userauthentication/models/Users.js
@@ -0,0 +1,14 @@
+const mongoose = require("mongoose");
+
+const UserSchema = new mongoose.Schema({
+ email: {
+ type: String,
+ required: true,
+ },
+ password: {
+ type: String,
+ required: true,
+ },
+});
+
+module.exports = new mongoose.model("User", UserSchema);
diff --git a/userauthentication/node_modules/.bin/detect-libc b/userauthentication/node_modules/.bin/detect-libc
new file mode 120000
index 00000000..b4c4b767
--- /dev/null
+++ b/userauthentication/node_modules/.bin/detect-libc
@@ -0,0 +1 @@
+../detect-libc/bin/detect-libc.js
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/ejs b/userauthentication/node_modules/.bin/ejs
new file mode 120000
index 00000000..88e80d01
--- /dev/null
+++ b/userauthentication/node_modules/.bin/ejs
@@ -0,0 +1 @@
+../ejs/bin/cli.js
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/is-ci b/userauthentication/node_modules/.bin/is-ci
new file mode 120000
index 00000000..fe6aca6f
--- /dev/null
+++ b/userauthentication/node_modules/.bin/is-ci
@@ -0,0 +1 @@
+../is-ci/bin.js
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/jake b/userauthentication/node_modules/.bin/jake
new file mode 120000
index 00000000..36267456
--- /dev/null
+++ b/userauthentication/node_modules/.bin/jake
@@ -0,0 +1 @@
+../jake/bin/cli.js
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/mime b/userauthentication/node_modules/.bin/mime
new file mode 120000
index 00000000..fbb7ee0e
--- /dev/null
+++ b/userauthentication/node_modules/.bin/mime
@@ -0,0 +1 @@
+../mime/cli.js
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/mkdirp b/userauthentication/node_modules/.bin/mkdirp
new file mode 120000
index 00000000..017896ce
--- /dev/null
+++ b/userauthentication/node_modules/.bin/mkdirp
@@ -0,0 +1 @@
+../mkdirp/bin/cmd.js
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/needle b/userauthentication/node_modules/.bin/needle
new file mode 120000
index 00000000..82809694
--- /dev/null
+++ b/userauthentication/node_modules/.bin/needle
@@ -0,0 +1 @@
+../needle/bin/needle
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/node-pre-gyp b/userauthentication/node_modules/.bin/node-pre-gyp
new file mode 120000
index 00000000..47a90a51
--- /dev/null
+++ b/userauthentication/node_modules/.bin/node-pre-gyp
@@ -0,0 +1 @@
+../node-pre-gyp/bin/node-pre-gyp
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/nodemon b/userauthentication/node_modules/.bin/nodemon
new file mode 120000
index 00000000..1056ddc1
--- /dev/null
+++ b/userauthentication/node_modules/.bin/nodemon
@@ -0,0 +1 @@
+../nodemon/bin/nodemon.js
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/nodetouch b/userauthentication/node_modules/.bin/nodetouch
new file mode 120000
index 00000000..3409fdb7
--- /dev/null
+++ b/userauthentication/node_modules/.bin/nodetouch
@@ -0,0 +1 @@
+../touch/bin/nodetouch.js
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/nopt b/userauthentication/node_modules/.bin/nopt
new file mode 120000
index 00000000..6b6566ea
--- /dev/null
+++ b/userauthentication/node_modules/.bin/nopt
@@ -0,0 +1 @@
+../nopt/bin/nopt.js
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/rc b/userauthentication/node_modules/.bin/rc
new file mode 120000
index 00000000..48b3cda7
--- /dev/null
+++ b/userauthentication/node_modules/.bin/rc
@@ -0,0 +1 @@
+../rc/cli.js
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/rimraf b/userauthentication/node_modules/.bin/rimraf
new file mode 120000
index 00000000..4cd49a49
--- /dev/null
+++ b/userauthentication/node_modules/.bin/rimraf
@@ -0,0 +1 @@
+../rimraf/bin.js
\ No newline at end of file
diff --git a/userauthentication/node_modules/.bin/semver b/userauthentication/node_modules/.bin/semver
new file mode 120000
index 00000000..317eb293
--- /dev/null
+++ b/userauthentication/node_modules/.bin/semver
@@ -0,0 +1 @@
+../semver/bin/semver
\ No newline at end of file
diff --git a/userauthentication/node_modules/@sindresorhus/is/dist/index.d.ts b/userauthentication/node_modules/@sindresorhus/is/dist/index.d.ts
new file mode 100644
index 00000000..e94d30b7
--- /dev/null
+++ b/userauthentication/node_modules/@sindresorhus/is/dist/index.d.ts
@@ -0,0 +1,132 @@
+///
+///
+///
+///
+///
+declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
+declare type Primitive = null | undefined | string | number | boolean | Symbol;
+export interface ArrayLike {
+ length: number;
+}
+export interface Class
{
+ new (...args: any[]): T;
+}
+declare type DomElement = object & {
+ nodeType: 1;
+ nodeName: string;
+};
+declare type NodeStream = object & {
+ pipe: Function;
+};
+export declare const enum TypeName {
+ null = "null",
+ boolean = "boolean",
+ undefined = "undefined",
+ string = "string",
+ number = "number",
+ symbol = "symbol",
+ Function = "Function",
+ GeneratorFunction = "GeneratorFunction",
+ AsyncFunction = "AsyncFunction",
+ Observable = "Observable",
+ Array = "Array",
+ Buffer = "Buffer",
+ Object = "Object",
+ RegExp = "RegExp",
+ Date = "Date",
+ Error = "Error",
+ Map = "Map",
+ Set = "Set",
+ WeakMap = "WeakMap",
+ WeakSet = "WeakSet",
+ Int8Array = "Int8Array",
+ Uint8Array = "Uint8Array",
+ Uint8ClampedArray = "Uint8ClampedArray",
+ Int16Array = "Int16Array",
+ Uint16Array = "Uint16Array",
+ Int32Array = "Int32Array",
+ Uint32Array = "Uint32Array",
+ Float32Array = "Float32Array",
+ Float64Array = "Float64Array",
+ ArrayBuffer = "ArrayBuffer",
+ SharedArrayBuffer = "SharedArrayBuffer",
+ DataView = "DataView",
+ Promise = "Promise",
+ URL = "URL"
+}
+declare function is(value: unknown): TypeName;
+declare namespace is {
+ const undefined: (value: unknown) => value is undefined;
+ const string: (value: unknown) => value is string;
+ const number: (value: unknown) => value is number;
+ const function_: (value: unknown) => value is Function;
+ const null_: (value: unknown) => value is null;
+ const class_: (value: unknown) => value is Class;
+ const boolean: (value: unknown) => value is boolean;
+ const symbol: (value: unknown) => value is Symbol;
+ const numericString: (value: unknown) => boolean;
+ const array: (arg: any) => arg is any[];
+ const buffer: (input: unknown) => input is Buffer;
+ const nullOrUndefined: (value: unknown) => value is null | undefined;
+ const object: (value: unknown) => value is object;
+ const iterable: (value: unknown) => value is IterableIterator;
+ const asyncIterable: (value: unknown) => value is AsyncIterableIterator;
+ const generator: (value: unknown) => value is Generator;
+ const nativePromise: (value: unknown) => value is Promise;
+ const promise: (value: unknown) => value is Promise;
+ const generatorFunction: (value: unknown) => value is GeneratorFunction;
+ const asyncFunction: (value: unknown) => value is Function;
+ const boundFunction: (value: unknown) => value is Function;
+ const regExp: (value: unknown) => value is RegExp;
+ const date: (value: unknown) => value is Date;
+ const error: (value: unknown) => value is Error;
+ const map: (value: unknown) => value is Map;
+ const set: (value: unknown) => value is Set;
+ const weakMap: (value: unknown) => value is WeakMap;
+ const weakSet: (value: unknown) => value is WeakSet;
+ const int8Array: (value: unknown) => value is Int8Array;
+ const uint8Array: (value: unknown) => value is Uint8Array;
+ const uint8ClampedArray: (value: unknown) => value is Uint8ClampedArray;
+ const int16Array: (value: unknown) => value is Int16Array;
+ const uint16Array: (value: unknown) => value is Uint16Array;
+ const int32Array: (value: unknown) => value is Int32Array;
+ const uint32Array: (value: unknown) => value is Uint32Array;
+ const float32Array: (value: unknown) => value is Float32Array;
+ const float64Array: (value: unknown) => value is Float64Array;
+ const arrayBuffer: (value: unknown) => value is ArrayBuffer;
+ const sharedArrayBuffer: (value: unknown) => value is SharedArrayBuffer;
+ const dataView: (value: unknown) => value is DataView;
+ const directInstanceOf: (instance: unknown, klass: Class) => instance is T;
+ const urlInstance: (value: unknown) => value is URL;
+ const urlString: (value: unknown) => boolean;
+ const truthy: (value: unknown) => boolean;
+ const falsy: (value: unknown) => boolean;
+ const nan: (value: unknown) => boolean;
+ const primitive: (value: unknown) => value is Primitive;
+ const integer: (value: unknown) => value is number;
+ const safeInteger: (value: unknown) => value is number;
+ const plainObject: (value: unknown) => boolean;
+ const typedArray: (value: unknown) => value is TypedArray;
+ const arrayLike: (value: unknown) => value is ArrayLike;
+ const inRange: (value: number, range: number | number[]) => boolean;
+ const domElement: (value: unknown) => value is DomElement;
+ const observable: (value: unknown) => boolean;
+ const nodeStream: (value: unknown) => value is NodeStream;
+ const infinite: (value: unknown) => boolean;
+ const even: (value: number) => boolean;
+ const odd: (value: number) => boolean;
+ const emptyArray: (value: unknown) => boolean;
+ const nonEmptyArray: (value: unknown) => boolean;
+ const emptyString: (value: unknown) => boolean;
+ const nonEmptyString: (value: unknown) => boolean;
+ const emptyStringOrWhitespace: (value: unknown) => boolean;
+ const emptyObject: (value: unknown) => boolean;
+ const nonEmptyObject: (value: unknown) => boolean;
+ const emptySet: (value: unknown) => boolean;
+ const nonEmptySet: (value: unknown) => boolean;
+ const emptyMap: (value: unknown) => boolean;
+ const nonEmptyMap: (value: unknown) => boolean;
+ const any: (predicate: unknown, ...values: unknown[]) => boolean;
+ const all: (predicate: unknown, ...values: unknown[]) => boolean;
+}
+export default is;
diff --git a/userauthentication/node_modules/@sindresorhus/is/dist/index.js b/userauthentication/node_modules/@sindresorhus/is/dist/index.js
new file mode 100644
index 00000000..3cbafae1
--- /dev/null
+++ b/userauthentication/node_modules/@sindresorhus/is/dist/index.js
@@ -0,0 +1,245 @@
+"use strict";
+///
+///
+///
+///
+Object.defineProperty(exports, "__esModule", { value: true });
+// TODO: Use the `URL` global when targeting Node.js 10
+// tslint:disable-next-line
+const URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL;
+const toString = Object.prototype.toString;
+const isOfType = (type) => (value) => typeof value === type;
+const isBuffer = (input) => !is.nullOrUndefined(input) && !is.nullOrUndefined(input.constructor) && is.function_(input.constructor.isBuffer) && input.constructor.isBuffer(input);
+const getObjectType = (value) => {
+ const objectName = toString.call(value).slice(8, -1);
+ if (objectName) {
+ return objectName;
+ }
+ return null;
+};
+const isObjectOfType = (type) => (value) => getObjectType(value) === type;
+function is(value) {
+ switch (value) {
+ case null:
+ return "null" /* null */;
+ case true:
+ case false:
+ return "boolean" /* boolean */;
+ default:
+ }
+ switch (typeof value) {
+ case 'undefined':
+ return "undefined" /* undefined */;
+ case 'string':
+ return "string" /* string */;
+ case 'number':
+ return "number" /* number */;
+ case 'symbol':
+ return "symbol" /* symbol */;
+ default:
+ }
+ if (is.function_(value)) {
+ return "Function" /* Function */;
+ }
+ if (is.observable(value)) {
+ return "Observable" /* Observable */;
+ }
+ if (Array.isArray(value)) {
+ return "Array" /* Array */;
+ }
+ if (isBuffer(value)) {
+ return "Buffer" /* Buffer */;
+ }
+ const tagType = getObjectType(value);
+ if (tagType) {
+ return tagType;
+ }
+ if (value instanceof String || value instanceof Boolean || value instanceof Number) {
+ throw new TypeError('Please don\'t use object wrappers for primitive types');
+ }
+ return "Object" /* Object */;
+}
+(function (is) {
+ // tslint:disable-next-line:strict-type-predicates
+ const isObject = (value) => typeof value === 'object';
+ // tslint:disable:variable-name
+ is.undefined = isOfType('undefined');
+ is.string = isOfType('string');
+ is.number = isOfType('number');
+ is.function_ = isOfType('function');
+ // tslint:disable-next-line:strict-type-predicates
+ is.null_ = (value) => value === null;
+ is.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');
+ is.boolean = (value) => value === true || value === false;
+ is.symbol = isOfType('symbol');
+ // tslint:enable:variable-name
+ is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value));
+ is.array = Array.isArray;
+ is.buffer = isBuffer;
+ is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);
+ is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value));
+ is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]);
+ is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]);
+ is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw);
+ is.nativePromise = (value) => isObjectOfType("Promise" /* Promise */)(value);
+ const hasPromiseAPI = (value) => !is.null_(value) &&
+ isObject(value) &&
+ is.function_(value.then) &&
+ is.function_(value.catch);
+ is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);
+ is.generatorFunction = isObjectOfType("GeneratorFunction" /* GeneratorFunction */);
+ is.asyncFunction = isObjectOfType("AsyncFunction" /* AsyncFunction */);
+ is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype');
+ is.regExp = isObjectOfType("RegExp" /* RegExp */);
+ is.date = isObjectOfType("Date" /* Date */);
+ is.error = isObjectOfType("Error" /* Error */);
+ is.map = (value) => isObjectOfType("Map" /* Map */)(value);
+ is.set = (value) => isObjectOfType("Set" /* Set */)(value);
+ is.weakMap = (value) => isObjectOfType("WeakMap" /* WeakMap */)(value);
+ is.weakSet = (value) => isObjectOfType("WeakSet" /* WeakSet */)(value);
+ is.int8Array = isObjectOfType("Int8Array" /* Int8Array */);
+ is.uint8Array = isObjectOfType("Uint8Array" /* Uint8Array */);
+ is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray" /* Uint8ClampedArray */);
+ is.int16Array = isObjectOfType("Int16Array" /* Int16Array */);
+ is.uint16Array = isObjectOfType("Uint16Array" /* Uint16Array */);
+ is.int32Array = isObjectOfType("Int32Array" /* Int32Array */);
+ is.uint32Array = isObjectOfType("Uint32Array" /* Uint32Array */);
+ is.float32Array = isObjectOfType("Float32Array" /* Float32Array */);
+ is.float64Array = isObjectOfType("Float64Array" /* Float64Array */);
+ is.arrayBuffer = isObjectOfType("ArrayBuffer" /* ArrayBuffer */);
+ is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer" /* SharedArrayBuffer */);
+ is.dataView = isObjectOfType("DataView" /* DataView */);
+ is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype;
+ is.urlInstance = (value) => isObjectOfType("URL" /* URL */)(value);
+ is.urlString = (value) => {
+ if (!is.string(value)) {
+ return false;
+ }
+ try {
+ new URLGlobal(value); // tslint:disable-line no-unused-expression
+ return true;
+ }
+ catch (_a) {
+ return false;
+ }
+ };
+ is.truthy = (value) => Boolean(value);
+ is.falsy = (value) => !value;
+ is.nan = (value) => Number.isNaN(value);
+ const primitiveTypes = new Set([
+ 'undefined',
+ 'string',
+ 'number',
+ 'boolean',
+ 'symbol'
+ ]);
+ is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value);
+ is.integer = (value) => Number.isInteger(value);
+ is.safeInteger = (value) => Number.isSafeInteger(value);
+ is.plainObject = (value) => {
+ // From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js
+ let prototype;
+ return getObjectType(value) === "Object" /* Object */ &&
+ (prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator
+ prototype === Object.getPrototypeOf({}));
+ };
+ const typedArrayTypes = new Set([
+ "Int8Array" /* Int8Array */,
+ "Uint8Array" /* Uint8Array */,
+ "Uint8ClampedArray" /* Uint8ClampedArray */,
+ "Int16Array" /* Int16Array */,
+ "Uint16Array" /* Uint16Array */,
+ "Int32Array" /* Int32Array */,
+ "Uint32Array" /* Uint32Array */,
+ "Float32Array" /* Float32Array */,
+ "Float64Array" /* Float64Array */
+ ]);
+ is.typedArray = (value) => {
+ const objectType = getObjectType(value);
+ if (objectType === null) {
+ return false;
+ }
+ return typedArrayTypes.has(objectType);
+ };
+ const isValidLength = (value) => is.safeInteger(value) && value > -1;
+ is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length);
+ is.inRange = (value, range) => {
+ if (is.number(range)) {
+ return value >= Math.min(0, range) && value <= Math.max(range, 0);
+ }
+ if (is.array(range) && range.length === 2) {
+ return value >= Math.min(...range) && value <= Math.max(...range);
+ }
+ throw new TypeError(`Invalid range: ${JSON.stringify(range)}`);
+ };
+ const NODE_TYPE_ELEMENT = 1;
+ const DOM_PROPERTIES_TO_CHECK = [
+ 'innerHTML',
+ 'ownerDocument',
+ 'style',
+ 'attributes',
+ 'nodeValue'
+ ];
+ is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) &&
+ !is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value);
+ is.observable = (value) => {
+ if (!value) {
+ return false;
+ }
+ if (value[Symbol.observable] && value === value[Symbol.observable]()) {
+ return true;
+ }
+ if (value['@@observable'] && value === value['@@observable']()) {
+ return true;
+ }
+ return false;
+ };
+ is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe) && !is.observable(value);
+ is.infinite = (value) => value === Infinity || value === -Infinity;
+ const isAbsoluteMod2 = (rem) => (value) => is.integer(value) && Math.abs(value % 2) === rem;
+ is.even = isAbsoluteMod2(0);
+ is.odd = isAbsoluteMod2(1);
+ const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false;
+ is.emptyArray = (value) => is.array(value) && value.length === 0;
+ is.nonEmptyArray = (value) => is.array(value) && value.length > 0;
+ is.emptyString = (value) => is.string(value) && value.length === 0;
+ is.nonEmptyString = (value) => is.string(value) && value.length > 0;
+ is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value);
+ is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0;
+ is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0;
+ is.emptySet = (value) => is.set(value) && value.size === 0;
+ is.nonEmptySet = (value) => is.set(value) && value.size > 0;
+ is.emptyMap = (value) => is.map(value) && value.size === 0;
+ is.nonEmptyMap = (value) => is.map(value) && value.size > 0;
+ const predicateOnArray = (method, predicate, values) => {
+ if (is.function_(predicate) === false) {
+ throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);
+ }
+ if (values.length === 0) {
+ throw new TypeError('Invalid number of values');
+ }
+ return method.call(values, predicate);
+ };
+ // tslint:disable variable-name
+ is.any = (predicate, ...values) => predicateOnArray(Array.prototype.some, predicate, values);
+ is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values);
+ // tslint:enable variable-name
+})(is || (is = {}));
+// Some few keywords are reserved, but we'll populate them for Node.js users
+// See https://github.com/Microsoft/TypeScript/issues/2536
+Object.defineProperties(is, {
+ class: {
+ value: is.class_
+ },
+ function: {
+ value: is.function_
+ },
+ null: {
+ value: is.null_
+ }
+});
+exports.default = is;
+// For CommonJS default export support
+module.exports = is;
+module.exports.default = is;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/userauthentication/node_modules/@sindresorhus/is/dist/index.js.map b/userauthentication/node_modules/@sindresorhus/is/dist/index.js.map
new file mode 100644
index 00000000..cd827fc2
--- /dev/null
+++ b/userauthentication/node_modules/@sindresorhus/is/dist/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,0CAA0C;AAC1C,2CAA2C;AAC3C,0BAA0B;;AAE1B,uDAAuD;AACvD,2BAA2B;AAC3B,MAAM,SAAS,GAAG,OAAO,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AAqDxE,MAAM,QAAQ,GAAG,MAAM,CAAC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AE;YACnC,MAAM,IAAI,SAAS,CAAC,sBAAsB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;SACvE;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACxB,MAAM,IAAI,SAAS,CAAC,0BAA0B,CAAC,CAAC;SAChD;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,SAAgB,CAAC,CAAC;IAC9C,CAAC,CAAC;IAEF,+BAA+B;IAClB,MAAG,GAAG,CAAC,SAAkB,EAAE,GAAG,MAAiB,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC9G,MAAG,GAAG,CAAC,SAAkB,EAAE,GAAG,MAAiB,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC5H,8BAA8B;AAC/B,CAAC,EAvNS,EAAE,KAAF,EAAE,QAuNX;AAED,4EAA4E;AAC5E,0DAA0D;AAC1D,MAAM,CAAC,gBAAgB,CAAC,EAAE,EAAE;IAC3B,KAAK,EAAE;QACN,KAAK,EAAE,EAAE,CAAC,MAAM;KAChB;IACD,QAAQ,EAAE;QACT,KAAK,EAAE,EAAE,CAAC,SAAS;KACnB;IACD,IAAI,EAAE;QACL,KAAK,EAAE,EAAE,CAAC,KAAK;KACf;CACD,CAAC,CAAC;AAEH,kBAAe,EAAE,CAAC;AAElB,sCAAsC;AACtC,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;AACpB,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC"}
\ No newline at end of file
diff --git a/userauthentication/node_modules/@sindresorhus/is/license b/userauthentication/node_modules/@sindresorhus/is/license
new file mode 100644
index 00000000..e7af2f77
--- /dev/null
+++ b/userauthentication/node_modules/@sindresorhus/is/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/userauthentication/node_modules/@sindresorhus/is/package.json b/userauthentication/node_modules/@sindresorhus/is/package.json
new file mode 100644
index 00000000..68339da6
--- /dev/null
+++ b/userauthentication/node_modules/@sindresorhus/is/package.json
@@ -0,0 +1,96 @@
+{
+ "_from": "@sindresorhus/is@^0.14.0",
+ "_id": "@sindresorhus/is@0.14.0",
+ "_inBundle": false,
+ "_integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==",
+ "_location": "/@sindresorhus/is",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "@sindresorhus/is@^0.14.0",
+ "name": "@sindresorhus/is",
+ "escapedName": "@sindresorhus%2fis",
+ "scope": "@sindresorhus",
+ "rawSpec": "^0.14.0",
+ "saveSpec": null,
+ "fetchSpec": "^0.14.0"
+ },
+ "_requiredBy": [
+ "/got"
+ ],
+ "_resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
+ "_shasum": "9fb3a3cf3132328151f353de4632e01e52102bea",
+ "_spec": "@sindresorhus/is@^0.14.0",
+ "_where": "/Users/kishankumar/Desktop/kishan/Login_server/node_modules/got",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/is/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Type check values: `is.string('🦄') //=> true`",
+ "devDependencies": {
+ "@sindresorhus/tsconfig": "^0.1.0",
+ "@types/jsdom": "^11.12.0",
+ "@types/node": "^10.12.10",
+ "@types/tempy": "^0.2.0",
+ "@types/zen-observable": "^0.8.0",
+ "ava": "^0.25.0",
+ "del-cli": "^1.1.0",
+ "jsdom": "^11.6.2",
+ "rxjs": "^6.3.3",
+ "tempy": "^0.2.1",
+ "tslint": "^5.9.1",
+ "tslint-xo": "^0.10.0",
+ "typescript": "^3.2.1",
+ "zen-observable": "^0.8.8"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "files": [
+ "dist"
+ ],
+ "homepage": "https://github.com/sindresorhus/is#readme",
+ "keywords": [
+ "type",
+ "types",
+ "is",
+ "check",
+ "checking",
+ "validate",
+ "validation",
+ "utility",
+ "util",
+ "typeof",
+ "instanceof",
+ "object",
+ "assert",
+ "assertion",
+ "test",
+ "kind",
+ "primitive",
+ "verify",
+ "compare"
+ ],
+ "license": "MIT",
+ "main": "dist/index.js",
+ "name": "@sindresorhus/is",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/is.git"
+ },
+ "scripts": {
+ "build": "del dist && tsc",
+ "lint": "tslint --format stylish --project .",
+ "prepublish": "npm run build && del dist/tests",
+ "test": "npm run lint && npm run build && ava dist/tests"
+ },
+ "types": "dist/index.d.ts",
+ "version": "0.14.0"
+}
diff --git a/userauthentication/node_modules/@sindresorhus/is/readme.md b/userauthentication/node_modules/@sindresorhus/is/readme.md
new file mode 100644
index 00000000..97c023b5
--- /dev/null
+++ b/userauthentication/node_modules/@sindresorhus/is/readme.md
@@ -0,0 +1,451 @@
+# is [![Build Status](https://travis-ci.org/sindresorhus/is.svg?branch=master)](https://travis-ci.org/sindresorhus/is)
+
+> Type check values: `is.string('🦄') //=> true`
+
+
+
+
+## Install
+
+```
+$ npm install @sindresorhus/is
+```
+
+
+## Usage
+
+```js
+const is = require('@sindresorhus/is');
+
+is('🦄');
+//=> 'string'
+
+is(new Map());
+//=> 'Map'
+
+is.number(6);
+//=> true
+```
+
+When using `is` together with TypeScript, [type guards](http://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types) are being used to infer the correct type inside if-else statements.
+
+```ts
+import is from '@sindresorhus/is';
+
+const padLeft = (value: string, padding: string | number) => {
+ if (is.number(padding)) {
+ // `padding` is typed as `number`
+ return Array(padding + 1).join(' ') + value;
+ }
+
+ if (is.string(padding)) {
+ // `padding` is typed as `string`
+ return padding + value;
+ }
+
+ throw new TypeError(`Expected 'padding' to be of type 'string' or 'number', got '${is(padding)}'.`);
+}
+
+padLeft('🦄', 3);
+//=> ' 🦄'
+
+padLeft('🦄', '🌈');
+//=> '🌈🦄'
+```
+
+
+## API
+
+### is(value)
+
+Returns the type of `value`.
+
+Primitives are lowercase and object types are camelcase.
+
+Example:
+
+- `'undefined'`
+- `'null'`
+- `'string'`
+- `'symbol'`
+- `'Array'`
+- `'Function'`
+- `'Object'`
+
+Note: It will throw an error if you try to feed it object-wrapped primitives, as that's a bad practice. For example `new String('foo')`.
+
+### is.{method}
+
+All the below methods accept a value and returns a boolean for whether the value is of the desired type.
+
+#### Primitives
+
+##### .undefined(value)
+##### .null(value)
+##### .string(value)
+##### .number(value)
+##### .boolean(value)
+##### .symbol(value)
+
+#### Built-in types
+
+##### .array(value)
+##### .function(value)
+##### .buffer(value)
+##### .object(value)
+
+Keep in mind that [functions are objects too](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions).
+
+##### .numericString(value)
+
+Returns `true` for a string that represents a number. For example, `'42'` and `'-8'`.
+
+Note: `'NaN'` returns `false`, but `'Infinity'` and `'-Infinity'` return `true`.
+
+##### .regExp(value)
+##### .date(value)
+##### .error(value)
+##### .nativePromise(value)
+##### .promise(value)
+
+Returns `true` for any object with a `.then()` and `.catch()` method. Prefer this one over `.nativePromise()` as you usually want to allow userland promise implementations too.
+
+##### .generator(value)
+
+Returns `true` for any object that implements its own `.next()` and `.throw()` methods and has a function definition for `Symbol.iterator`.
+
+##### .generatorFunction(value)
+
+##### .asyncFunction(value)
+
+Returns `true` for any `async` function that can be called with the `await` operator.
+
+```js
+is.asyncFunction(async () => {});
+// => true
+
+is.asyncFunction(() => {});
+// => false
+```
+
+##### .boundFunction(value)
+
+Returns `true` for any `bound` function.
+
+```js
+is.boundFunction(() => {});
+// => true
+
+is.boundFunction(function () {}.bind(null));
+// => true
+
+is.boundFunction(function () {});
+// => false
+```
+
+##### .map(value)
+##### .set(value)
+##### .weakMap(value)
+##### .weakSet(value)
+
+#### Typed arrays
+
+##### .int8Array(value)
+##### .uint8Array(value)
+##### .uint8ClampedArray(value)
+##### .int16Array(value)
+##### .uint16Array(value)
+##### .int32Array(value)
+##### .uint32Array(value)
+##### .float32Array(value)
+##### .float64Array(value)
+
+#### Structured data
+
+##### .arrayBuffer(value)
+##### .sharedArrayBuffer(value)
+##### .dataView(value)
+
+#### Emptiness
+
+##### .emptyString(value)
+
+Returns `true` if the value is a `string` and the `.length` is 0.
+
+##### .nonEmptyString(value)
+
+Returns `true` if the value is a `string` and the `.length` is more than 0.
+
+##### .emptyStringOrWhitespace(value)
+
+Returns `true` if `is.emptyString(value)` or if it's a `string` that is all whitespace.
+
+##### .emptyArray(value)
+
+Returns `true` if the value is an `Array` and the `.length` is 0.
+
+##### .nonEmptyArray(value)
+
+Returns `true` if the value is an `Array` and the `.length` is more than 0.
+
+##### .emptyObject(value)
+
+Returns `true` if the value is an `Object` and `Object.keys(value).length` is 0.
+
+Please note that `Object.keys` returns only own enumerable properties. Hence something like this can happen:
+
+```js
+const object1 = {};
+
+Object.defineProperty(object1, 'property1', {
+ value: 42,
+ writable: true,
+ enumerable: false,
+ configurable: true
+});
+
+is.emptyObject(object1);
+// => true
+```
+
+##### .nonEmptyObject(value)
+
+Returns `true` if the value is an `Object` and `Object.keys(value).length` is more than 0.
+
+##### .emptySet(value)
+
+Returns `true` if the value is a `Set` and the `.size` is 0.
+
+##### .nonEmptySet(Value)
+
+Returns `true` if the value is a `Set` and the `.size` is more than 0.
+
+##### .emptyMap(value)
+
+Returns `true` if the value is a `Map` and the `.size` is 0.
+
+##### .nonEmptyMap(value)
+
+Returns `true` if the value is a `Map` and the `.size` is more than 0.
+
+#### Miscellaneous
+
+##### .directInstanceOf(value, class)
+
+Returns `true` if `value` is a direct instance of `class`.
+
+```js
+is.directInstanceOf(new Error(), Error);
+//=> true
+
+class UnicornError extends Error {}
+
+is.directInstanceOf(new UnicornError(), Error);
+//=> false
+```
+
+##### .urlInstance(value)
+
+Returns `true` if `value` is an instance of the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL).
+
+```js
+const url = new URL('https://example.com');
+
+is.urlInstance(url);
+//=> true
+```
+
+### .url(value)
+
+Returns `true` if `value` is a URL string.
+
+Note: this only does basic checking using the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL) constructor.
+
+```js
+const url = 'https://example.com';
+
+is.url(url);
+//=> true
+
+is.url(new URL(url));
+//=> false
+```
+
+##### .truthy(value)
+
+Returns `true` for all values that evaluate to true in a boolean context:
+
+```js
+is.truthy('🦄');
+//=> true
+
+is.truthy(undefined);
+//=> false
+```
+
+##### .falsy(value)
+
+Returns `true` if `value` is one of: `false`, `0`, `''`, `null`, `undefined`, `NaN`.
+
+##### .nan(value)
+##### .nullOrUndefined(value)
+##### .primitive(value)
+
+JavaScript primitives are as follows: `null`, `undefined`, `string`, `number`, `boolean`, `symbol`.
+
+##### .integer(value)
+
+##### .safeInteger(value)
+
+Returns `true` if `value` is a [safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger).
+
+##### .plainObject(value)
+
+An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`.
+
+##### .iterable(value)
+##### .asyncIterable(value)
+##### .class(value)
+
+Returns `true` for instances created by a class.
+
+##### .typedArray(value)
+
+##### .arrayLike(value)
+
+A `value` is array-like if it is not a function and has a `value.length` that is a safe integer greater than or equal to 0.
+
+```js
+is.arrayLike(document.forms);
+//=> true
+
+function foo() {
+ is.arrayLike(arguments);
+ //=> true
+}
+foo();
+```
+
+##### .inRange(value, range)
+
+Check if `value` (number) is in the given `range`. The range is an array of two values, lower bound and upper bound, in no specific order.
+
+```js
+is.inRange(3, [0, 5]);
+is.inRange(3, [5, 0]);
+is.inRange(0, [-2, 2]);
+```
+
+##### .inRange(value, upperBound)
+
+Check if `value` (number) is in the range of `0` to `upperBound`.
+
+```js
+is.inRange(3, 10);
+```
+
+##### .domElement(value)
+
+Returns `true` if `value` is a DOM Element.
+
+##### .nodeStream(value)
+
+Returns `true` if `value` is a Node.js [stream](https://nodejs.org/api/stream.html).
+
+```js
+const fs = require('fs');
+
+is.nodeStream(fs.createReadStream('unicorn.png'));
+//=> true
+```
+
+##### .observable(value)
+
+Returns `true` if `value` is an `Observable`.
+
+```js
+const {Observable} = require('rxjs');
+
+is.observable(new Observable());
+//=> true
+```
+
+##### .infinite(value)
+
+Check if `value` is `Infinity` or `-Infinity`.
+
+##### .even(value)
+
+Returns `true` if `value` is an even integer.
+
+##### .odd(value)
+
+Returns `true` if `value` is an odd integer.
+
+##### .any(predicate, ...values)
+
+Returns `true` if **any** of the input `values` returns true in the `predicate`:
+
+```js
+is.any(is.string, {}, true, '🦄');
+//=> true
+
+is.any(is.boolean, 'unicorns', [], new Map());
+//=> false
+```
+
+##### .all(predicate, ...values)
+
+Returns `true` if **all** of the input `values` returns true in the `predicate`:
+
+```js
+is.all(is.object, {}, new Map(), new Set());
+//=> true
+
+is.all(is.string, '🦄', [], 'unicorns');
+//=> false
+```
+
+
+## FAQ
+
+### Why yet another type checking module?
+
+There are hundreds of type checking modules on npm, unfortunately, I couldn't find any that fit my needs:
+
+- Includes both type methods and ability to get the type
+- Types of primitives returned as lowercase and object types as camelcase
+- Covers all built-ins
+- Unsurprising behavior
+- Well-maintained
+- Comprehensive test suite
+
+For the ones I found, pick 3 of these.
+
+The most common mistakes I noticed in these modules was using `instanceof` for type checking, forgetting that functions are objects, and omitting `symbol` as a primitive.
+
+
+## Related
+
+- [ow](https://github.com/sindresorhus/ow) - Function argument validation for humans
+- [is-stream](https://github.com/sindresorhus/is-stream) - Check if something is a Node.js stream
+- [is-observable](https://github.com/sindresorhus/is-observable) - Check if a value is an Observable
+- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array
+- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address
+- [is-array-sorted](https://github.com/sindresorhus/is-array-sorted) - Check if an Array is sorted
+- [is-error-constructor](https://github.com/sindresorhus/is-error-constructor) - Check if a value is an error constructor
+- [is-empty-iterable](https://github.com/sindresorhus/is-empty-iterable) - Check if an Iterable is empty
+- [is-blob](https://github.com/sindresorhus/is-blob) - Check if a value is a Blob - File-like object of immutable, raw data
+- [has-emoji](https://github.com/sindresorhus/has-emoji) - Check whether a string has any emoji
+
+
+## Created by
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Giora Guttsait](https://github.com/gioragutt)
+- [Brandon Smith](https://github.com/brandon93s)
+
+
+## License
+
+MIT
diff --git a/userauthentication/node_modules/@szmarczak/http-timer/LICENSE b/userauthentication/node_modules/@szmarczak/http-timer/LICENSE
new file mode 100755
index 00000000..15ad2e8d
--- /dev/null
+++ b/userauthentication/node_modules/@szmarczak/http-timer/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Szymon Marczak
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/userauthentication/node_modules/@szmarczak/http-timer/README.md b/userauthentication/node_modules/@szmarczak/http-timer/README.md
new file mode 100755
index 00000000..13279ed8
--- /dev/null
+++ b/userauthentication/node_modules/@szmarczak/http-timer/README.md
@@ -0,0 +1,70 @@
+# http-timer
+> Timings for HTTP requests
+
+[![Build Status](https://travis-ci.org/szmarczak/http-timer.svg?branch=master)](https://travis-ci.org/szmarczak/http-timer)
+[![Coverage Status](https://coveralls.io/repos/github/szmarczak/http-timer/badge.svg?branch=master)](https://coveralls.io/github/szmarczak/http-timer?branch=master)
+[![install size](https://packagephobia.now.sh/badge?p=@szmarczak/http-timer)](https://packagephobia.now.sh/result?p=@szmarczak/http-timer)
+
+Inspired by the [`request` package](https://github.com/request/request).
+
+## Usage
+```js
+'use strict';
+const https = require('https');
+const timer = require('@szmarczak/http-timer');
+
+const request = https.get('https://httpbin.org/anything');
+const timings = timer(request);
+
+request.on('response', response => {
+ response.on('data', () => {}); // Consume the data somehow
+ response.on('end', () => {
+ console.log(timings);
+ });
+});
+
+// { start: 1535708511443,
+// socket: 1535708511444,
+// lookup: 1535708511444,
+// connect: 1535708511582,
+// upload: 1535708511887,
+// response: 1535708512037,
+// end: 1535708512040,
+// phases:
+// { wait: 1,
+// dns: 0,
+// tcp: 138,
+// request: 305,
+// firstByte: 150,
+// download: 3,
+// total: 597 } }
+```
+
+## API
+
+### timer(request)
+
+Returns: `Object`
+
+- `start` - Time when the request started.
+- `socket` - Time when a socket was assigned to the request.
+- `lookup` - Time when the DNS lookup finished.
+- `connect` - Time when the socket successfully connected.
+- `upload` - Time when the request finished uploading.
+- `response` - Time when the request fired the `response` event.
+- `end` - Time when the response fired the `end` event.
+- `error` - Time when the request fired the `error` event.
+- `phases`
+ - `wait` - `timings.socket - timings.start`
+ - `dns` - `timings.lookup - timings.socket`
+ - `tcp` - `timings.connect - timings.lookup`
+ - `request` - `timings.upload - timings.connect`
+ - `firstByte` - `timings.response - timings.upload`
+ - `download` - `timings.end - timings.response`
+ - `total` - `timings.end - timings.start` or `timings.error - timings.start`
+
+**Note**: The time is a `number` representing the milliseconds elapsed since the UNIX epoch.
+
+## License
+
+MIT
diff --git a/userauthentication/node_modules/@szmarczak/http-timer/package.json b/userauthentication/node_modules/@szmarczak/http-timer/package.json
new file mode 100755
index 00000000..1e008500
--- /dev/null
+++ b/userauthentication/node_modules/@szmarczak/http-timer/package.json
@@ -0,0 +1,75 @@
+{
+ "_from": "@szmarczak/http-timer@^1.1.2",
+ "_id": "@szmarczak/http-timer@1.1.2",
+ "_inBundle": false,
+ "_integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==",
+ "_location": "/@szmarczak/http-timer",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "@szmarczak/http-timer@^1.1.2",
+ "name": "@szmarczak/http-timer",
+ "escapedName": "@szmarczak%2fhttp-timer",
+ "scope": "@szmarczak",
+ "rawSpec": "^1.1.2",
+ "saveSpec": null,
+ "fetchSpec": "^1.1.2"
+ },
+ "_requiredBy": [
+ "/got"
+ ],
+ "_resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz",
+ "_shasum": "b1665e2c461a2cd92f4c1bbf50d5454de0d4b421",
+ "_spec": "@szmarczak/http-timer@^1.1.2",
+ "_where": "/Users/kishankumar/Desktop/kishan/Login_server/node_modules/got",
+ "author": {
+ "name": "Szymon Marczak"
+ },
+ "bugs": {
+ "url": "https://github.com/szmarczak/http-timer/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "defer-to-connect": "^1.0.1"
+ },
+ "deprecated": false,
+ "description": "Timings for HTTP requests",
+ "devDependencies": {
+ "ava": "^0.25.0",
+ "coveralls": "^3.0.2",
+ "nyc": "^12.0.2",
+ "p-event": "^2.1.0",
+ "xo": "^0.22.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "files": [
+ "source"
+ ],
+ "homepage": "https://github.com/szmarczak/http-timer#readme",
+ "keywords": [
+ "http",
+ "https",
+ "timer",
+ "timings"
+ ],
+ "license": "MIT",
+ "main": "source",
+ "name": "@szmarczak/http-timer",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/szmarczak/http-timer.git"
+ },
+ "scripts": {
+ "coveralls": "nyc report --reporter=text-lcov | coveralls",
+ "test": "xo && nyc ava"
+ },
+ "version": "1.1.2",
+ "xo": {
+ "rules": {
+ "unicorn/filename-case": "camelCase"
+ }
+ }
+}
diff --git a/userauthentication/node_modules/@szmarczak/http-timer/source/index.js b/userauthentication/node_modules/@szmarczak/http-timer/source/index.js
new file mode 100755
index 00000000..e2945804
--- /dev/null
+++ b/userauthentication/node_modules/@szmarczak/http-timer/source/index.js
@@ -0,0 +1,99 @@
+'use strict';
+const deferToConnect = require('defer-to-connect');
+
+module.exports = request => {
+ const timings = {
+ start: Date.now(),
+ socket: null,
+ lookup: null,
+ connect: null,
+ upload: null,
+ response: null,
+ end: null,
+ error: null,
+ phases: {
+ wait: null,
+ dns: null,
+ tcp: null,
+ request: null,
+ firstByte: null,
+ download: null,
+ total: null
+ }
+ };
+
+ const handleError = origin => {
+ const emit = origin.emit.bind(origin);
+ origin.emit = (event, ...args) => {
+ // Catches the `error` event
+ if (event === 'error') {
+ timings.error = Date.now();
+ timings.phases.total = timings.error - timings.start;
+
+ origin.emit = emit;
+ }
+
+ // Saves the original behavior
+ return emit(event, ...args);
+ };
+ };
+
+ let uploadFinished = false;
+ const onUpload = () => {
+ timings.upload = Date.now();
+ timings.phases.request = timings.upload - timings.connect;
+ };
+
+ handleError(request);
+
+ request.once('socket', socket => {
+ timings.socket = Date.now();
+ timings.phases.wait = timings.socket - timings.start;
+
+ const lookupListener = () => {
+ timings.lookup = Date.now();
+ timings.phases.dns = timings.lookup - timings.socket;
+ };
+
+ socket.once('lookup', lookupListener);
+
+ deferToConnect(socket, () => {
+ timings.connect = Date.now();
+
+ if (timings.lookup === null) {
+ socket.removeListener('lookup', lookupListener);
+ timings.lookup = timings.connect;
+ timings.phases.dns = timings.lookup - timings.socket;
+ }
+
+ timings.phases.tcp = timings.connect - timings.lookup;
+
+ if (uploadFinished && !timings.upload) {
+ onUpload();
+ }
+ });
+ });
+
+ request.once('finish', () => {
+ uploadFinished = true;
+
+ if (timings.connect) {
+ onUpload();
+ }
+ });
+
+ request.once('response', response => {
+ timings.response = Date.now();
+ timings.phases.firstByte = timings.response - timings.upload;
+
+ handleError(response);
+
+ response.once('end', () => {
+ timings.end = Date.now();
+ timings.phases.download = timings.end - timings.response;
+ timings.phases.total = timings.end - timings.start;
+ });
+ });
+
+ return timings;
+};
diff --git a/userauthentication/node_modules/@types/bson/LICENSE b/userauthentication/node_modules/@types/bson/LICENSE
new file mode 100644
index 00000000..9e841e7a
--- /dev/null
+++ b/userauthentication/node_modules/@types/bson/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/userauthentication/node_modules/@types/bson/README.md b/userauthentication/node_modules/@types/bson/README.md
new file mode 100644
index 00000000..b97e090e
--- /dev/null
+++ b/userauthentication/node_modules/@types/bson/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/bson`
+
+# Summary
+This package contains type definitions for bson (https://github.com/mongodb/js-bson).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bson.
+
+### Additional Details
+ * Last updated: Tue, 20 Oct 2020 02:03:19 GMT
+ * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
+ * Global values: none
+
+# Credits
+These definitions were written by [Hiroki Horiuchi](https://github.com/horiuchi), [Federico Caselli](https://github.com/CaselIT), [Justin Grant](https://github.com/justingrant), and [Mikael Lirbank](https://github.com/lirbank).
diff --git a/userauthentication/node_modules/@types/bson/index.d.ts b/userauthentication/node_modules/@types/bson/index.d.ts
new file mode 100644
index 00000000..4f781acd
--- /dev/null
+++ b/userauthentication/node_modules/@types/bson/index.d.ts
@@ -0,0 +1,600 @@
+// Type definitions for bson 4.0
+// Project: https://github.com/mongodb/js-bson
+// Definitions by: Hiroki Horiuchi
+// Federico Caselli
+// Justin Grant
+// Mikael Lirbank
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+interface CommonSerializeOptions {
+ /** {default:false}, the serializer will check if keys are valid. */
+ checkKeys?: boolean;
+ /** {default:false}, serialize the javascript functions. */
+ serializeFunctions?: boolean;
+ /** {default:true}, ignore undefined fields. */
+ ignoreUndefined?: boolean;
+}
+
+export interface SerializeOptions extends CommonSerializeOptions {
+ /** {default:1024*1024*17}, minimum size of the internal temporary serialization buffer. */
+ minInternalBufferSize?: number;
+}
+
+export interface SerializeWithBufferAndIndexOptions extends CommonSerializeOptions {
+ /** {default:0}, the index in the buffer where we wish to start serializing into. */
+ index?: number;
+}
+
+export interface DeserializeOptions {
+ /** {default:false}, evaluate functions in the BSON document scoped to the object deserialized. */
+ evalFunctions?: boolean;
+ /** {default:false}, cache evaluated functions for reuse. */
+ cacheFunctions?: boolean;
+ /** {default:false}, use a crc32 code for caching, otherwise use the string of the function. */
+ cacheFunctionsCrc32?: boolean;
+ /** {default:true}, when deserializing a Long will fit it into a Number if it's smaller than 53 bits. */
+ promoteLongs?: boolean;
+ /** {default:false}, deserialize Binary data directly into node.js Buffer object. */
+ promoteBuffers?: boolean;
+ /** {default:false}, when deserializing will promote BSON values to their Node.js closest equivalent types. */
+ promoteValues?: boolean;
+ /** {default:null}, allow to specify if there what fields we wish to return as unserialized raw buffer. */
+ fieldsAsRaw?: { readonly [fieldName: string]: boolean };
+ /** {default:false}, return BSON regular expressions as BSONRegExp instances. */
+ bsonRegExp?: boolean;
+ /** {default:false}, allows the buffer to be larger than the parsed BSON object. */
+ allowObjectSmallerThanBufferSize?: boolean;
+}
+
+export interface CalculateObjectSizeOptions {
+ /** {default:false}, serialize the javascript functions */
+ serializeFunctions?: boolean;
+ /** {default:true}, ignore undefined fields. */
+ ignoreUndefined?: boolean;
+}
+
+
+/**
+ * Serialize a Javascript object.
+ *
+ * @param object The Javascript object to serialize.
+ * @param options Serialize options.
+ * @return The Buffer object containing the serialized object.
+ */
+export function serialize(object: any, options?: SerializeOptions): Buffer;
+
+/**
+ * Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.
+ *
+ * @param object The Javascript object to serialize.
+ * @param buffer The Buffer you pre-allocated to store the serialized BSON object.
+ * @param options Serialize options.
+ * @returns The index pointing to the last written byte in the buffer
+ */
+export function serializeWithBufferAndIndex(object: any, buffer: Buffer, options?: SerializeWithBufferAndIndexOptions): number;
+
+/**
+ * Deserialize data as BSON.
+ *
+ * @param buffer The buffer containing the serialized set of BSON documents.
+ * @param options Deserialize options.
+ * @returns The deserialized Javascript Object.
+ */
+export function deserialize(buffer: Buffer, options?: DeserializeOptions): any;
+
+/**
+ * Calculate the bson size for a passed in Javascript object.
+ *
+ * @param {Object} object the Javascript object to calculate the BSON byte size for.
+ * @param {CalculateObjectSizeOptions} Options
+ * @return {Number} returns the number of bytes the BSON object will take up.
+ */
+export function calculateObjectSize(object: any, options?: CalculateObjectSizeOptions): number;
+
+/**
+ * Deserialize stream data as BSON documents.
+ *
+ * @param data The buffer containing the serialized set of BSON documents.
+ * @param startIndex The start index in the data Buffer where the deserialization is to start.
+ * @param numberOfDocuments Number of documents to deserialize
+ * @param documents An array where to store the deserialized documents
+ * @param docStartIndex The index in the documents array from where to start inserting documents
+ * @param options Additional options used for the deserialization
+ * @returns The next index in the buffer after deserialization of the `numberOfDocuments`
+ */
+export function deserializeStream(
+ data: Buffer,
+ startIndex: number,
+ numberOfDocuments: number,
+ documents: Array,
+ docStartIndex: number,
+ options?: DeserializeOptions
+): number;
+
+/** A class representation of the BSON Binary type. */
+export class Binary {
+
+ static readonly SUBTYPE_DEFAULT: number;
+ static readonly SUBTYPE_FUNCTION: number;
+ static readonly SUBTYPE_BYTE_ARRAY: number;
+ static readonly SUBTYPE_UUID_OLD: number;
+ static readonly SUBTYPE_UUID: number;
+ static readonly SUBTYPE_MD5: number;
+ static readonly SUBTYPE_USER_DEFINED: number;
+
+ /**
+ * @param buffer A buffer object containing the binary data
+ * @param subType Binary data subtype
+ */
+ constructor(buffer: Buffer, subType?: number);
+
+ /** The underlying Buffer which stores the binary data. */
+ readonly buffer: Buffer;
+ /** Binary data subtype */
+ readonly sub_type?: number;
+
+ /** The length of the binary. */
+ length(): number;
+ /** Updates this binary with byte_value */
+ put(byte_value: number | string): void;
+ /** Reads length bytes starting at position. */
+ read(position: number, length: number): Buffer;
+ /** Returns the value of this binary as a string. */
+ value(): string;
+ /** Writes a buffer or string to the binary */
+ write(buffer: Buffer | string, offset: number): void;
+}
+
+/** A class representation of the BSON Code type. */
+export class Code {
+
+ /**
+ * @param code A string or function.
+ * @param scope An optional scope for the function.
+ */
+ constructor(code: string | Function, scope?: any);
+
+ readonly code: string | Function;
+ readonly scope?: any;
+
+}
+
+/**
+ * A class representation of the BSON DBRef type.
+ */
+export class DBRef {
+ /**
+ * @param namespace The collection name.
+ * @param oid The reference ObjectId.
+ * @param db Optional db name, if omitted the reference is local to the current db
+ */
+ constructor(namespace: string, oid: ObjectId, db?: string);
+ namespace: string;
+ oid: ObjectId;
+ db?: string;
+}
+
+/** A class representation of the BSON Double type. */
+export class Double {
+ /**
+ * @param value The number we want to represent as a double.
+ */
+ constructor(value: number);
+
+ /**
+ * https://github.com/mongodb/js-bson/blob/master/lib/double.js#L17
+ */
+ value: number;
+
+
+ valueOf(): number;
+}
+
+/** A class representation of the BSON Int32 type. */
+export class Int32 {
+ /**
+ * @param value The number we want to represent as an int32.
+ */
+ constructor(value: number);
+
+ valueOf(): number;
+}
+
+/**
+ * Base class for Long and Timestamp.
+ * In original js-node@1.0.x code 'Timestamp' is a 100% copy-paste of 'Long'
+ * with 'Long' replaced by 'Timestamp' (changed to inheritance in js-node@2.0.0)
+ */
+declare class LongLike {
+
+ /**
+ * @param low The low (signed) 32 bits.
+ * @param high The high (signed) 32 bits.
+ */
+ constructor(low: number, high: number);
+
+ /** Returns the sum of `this` and the `other`. */
+ add(other: T): T;
+ /** Returns the bitwise-AND of `this` and the `other`. */
+ and(other: T): T;
+ /**
+ * Compares `this` with the given `other`.
+ * @returns 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
+ */
+ compare(other: T): number;
+ /** Returns `this` divided by the given `other`. */
+ div(other: T): T;
+ /** Return whether `this` equals the `other` */
+ equals(other: T): boolean;
+ /** Return the high 32-bits value. */
+ getHighBits(): number;
+ /** Return the low 32-bits value. */
+ getLowBits(): number;
+ /** Return the low unsigned 32-bits value. */
+ getLowBitsUnsigned(): number;
+ /** Returns the number of bits needed to represent the absolute value of `this`. */
+ getNumBitsAbs(): number;
+ /** Return whether `this` is greater than the `other`. */
+ greaterThan(other: T): boolean;
+ /** Return whether `this` is greater than or equal to the `other`. */
+ greaterThanOrEqual(other: T): boolean;
+ /** Return whether `this` value is negative. */
+ isNegative(): boolean;
+ /** Return whether `this` value is odd. */
+ isOdd(): boolean;
+ /** Return whether `this` value is zero. */
+ isZero(): boolean;
+ /** Return whether `this` is less than the `other`. */
+ lessThan(other: T): boolean;
+ /** Return whether `this` is less than or equal to the `other`. */
+ lessThanOrEqual(other: T): boolean;
+ /** Returns `this` modulo the given `other`. */
+ modulo(other: T): T;
+ /** Returns the product of `this` and the given `other`. */
+ multiply(other: T): T;
+ /** The negation of this value. */
+ negate(): T;
+ /** The bitwise-NOT of this value. */
+ not(): T;
+ /** Return whether `this` does not equal to the `other`. */
+ notEquals(other: T): boolean;
+ /** Returns the bitwise-OR of `this` and the given `other`. */
+ or(other: T): T;
+ /**
+ * Returns `this` with bits shifted to the left by the given amount.
+ * @param numBits The number of bits by which to shift.
+ */
+ shiftLeft(numBits: number): T;
+ /**
+ * Returns `this` with bits shifted to the right by the given amount.
+ * @param numBits The number of bits by which to shift.
+ */
+ shiftRight(numBits: number): T;
+ /**
+ * Returns `this` with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
+ * @param numBits The number of bits by which to shift.
+ */
+ shiftRightUnsigned(numBits: number): T;
+ /** Returns the difference of `this` and the given `other`. */
+ subtract(other: T): T;
+ /** Return the int value (low 32 bits). */
+ toInt(): number;
+ /** Return the JSON value. */
+ toJSON(): string;
+ /** Returns closest floating-point representation to `this` value */
+ toNumber(): number;
+ /**
+ * Return as a string
+ * @param radix the radix in which the text should be written. {default:10}
+ */
+ toString(radix?: number): string;
+ /** Returns the bitwise-XOR of `this` and the given `other`. */
+ xor(other: T): T;
+
+}
+
+/**
+ * A class representation of the BSON Long type, a 64-bit two's-complement
+ * integer value, which faithfully simulates the behavior of a Java "Long". This
+ * implementation is derived from LongLib in GWT.
+ */
+export class Long extends LongLike {
+
+ static readonly MAX_VALUE: Long;
+ static readonly MIN_VALUE: Long;
+ static readonly NEG_ONE: Long;
+ static readonly ONE: Long;
+ static readonly ZERO: Long;
+
+ /** Returns a Long representing the given (32-bit) integer value. */
+ static fromInt(i: number): Long;
+ /** Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. */
+ static fromNumber(n: number): Long;
+ /**
+ * Returns a Long representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
+ * @param lowBits The low 32-bits.
+ * @param highBits The high 32-bits.
+ */
+ static fromBits(lowBits: number, highBits: number): Long;
+ /**
+ * Returns a Long representation of the given string
+ * @param opt_radix The radix in which the text is written. {default:10}
+ */
+ static fromString(s: string, opt_radix?: number): Long;
+
+}
+
+/** A class representation of the BSON Decimal128 type. */
+export class Decimal128 {
+
+ /** Create a Decimal128 instance from a string representation. */
+ static fromString(s: string): Decimal128;
+
+ /**
+ * @param bytes A buffer containing the raw Decimal128 bytes.
+ */
+ constructor(bytes: Buffer);
+
+ /** A buffer containing the raw Decimal128 bytes. */
+ readonly bytes: Buffer;
+
+ toJSON(): string;
+ toString(): string;
+}
+
+/** A class representation of the BSON MaxKey type. */
+export class MaxKey {
+ constructor();
+}
+
+/** A class representation of the BSON MinKey type. */
+export class MinKey {
+ constructor();
+}
+
+/** A class representation of the BSON ObjectId type. */
+export class ObjectId {
+ /**
+ * Create a new ObjectId instance
+ * @param {(string|number|ObjectId)} id Can be a 24 byte hex string, 12 byte binary string or a Number.
+ */
+ constructor(id?: string | number | ObjectId);
+ /** The generation time of this ObjectId instance */
+ generationTime: number;
+ /** If true cache the hex string representation of ObjectId */
+ static cacheHexString?: boolean;
+ /**
+ * Creates an ObjectId from a hex string representation of an ObjectId.
+ * @param {string} hexString create a ObjectId from a passed in 24 byte hexstring.
+ * @return {ObjectId} return the created ObjectId
+ */
+ static createFromHexString(hexString: string): ObjectId;
+ /**
+ * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId.
+ * @param {number} time an integer number representing a number of seconds.
+ * @return {ObjectId} return the created ObjectId
+ */
+ static createFromTime(time: number): ObjectId;
+ /**
+ * Checks if a value is a valid bson ObjectId
+ *
+ * @return {boolean} return true if the value is a valid bson ObjectId, return false otherwise.
+ */
+ static isValid(id: string | number | ObjectId): boolean;
+ /**
+ * Compares the equality of this ObjectId with `otherID`.
+ * @param {ObjectId|string} otherID ObjectId instance to compare against.
+ * @return {boolean} the result of comparing two ObjectId's
+ */
+ equals(otherID: ObjectId | string): boolean;
+ /**
+ * Generate a 12 byte id string used in ObjectId's
+ * @param {number} time optional parameter allowing to pass in a second based timestamp.
+ * @return {string} return the 12 byte id binary string.
+ */
+ static generate(time?: number): Buffer;
+ /**
+ * Returns the generation date (accurate up to the second) that this ID was generated.
+ * @return {Date} the generation date
+ */
+ getTimestamp(): Date;
+ /**
+ * Return the ObjectId id as a 24 byte hex string representation
+ * @return {string} return the 24 byte hex string representation.
+ */
+ toHexString(): string;
+}
+
+/**
+ * ObjectID (with capital "D") is deprecated. Use ObjectId (lowercase "d") instead.
+ * @deprecated
+ */
+export { ObjectId as ObjectID };
+
+/** A class representation of the BSON RegExp type. */
+export class BSONRegExp {
+
+ constructor(pattern: string, options: string);
+
+ readonly pattern: string;
+ readonly options: string;
+
+}
+
+/**
+ * A class representation of the BSON Symbol type.
+ * @deprecated
+ */
+export class Symbol {
+
+ constructor(value: string);
+
+ /** Access the wrapped string value. */
+ valueOf(): string;
+
+}
+
+/** A class representation of the BSON Timestamp type. */
+export class Timestamp extends LongLike {
+
+ static readonly MAX_VALUE: Timestamp;
+ static readonly MIN_VALUE: Timestamp;
+ static readonly NEG_ONE: Timestamp;
+ static readonly ONE: Timestamp;
+ static readonly ZERO: Timestamp;
+
+ /** Returns a Timestamp represented by the given (32-bit) integer value */
+ static fromInt(value: number): Timestamp;
+ /** Returns a Timestamp representing the given number value, provided that it is a finite number. */
+ static fromNumber(value: number): Timestamp;
+ /**
+ * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits.
+ * @param lowBits The low 32-bits.
+ * @param highBits The high 32-bits.
+ */
+ static fromBits(lowBits: number, highBits: number): Timestamp;
+ /**
+ * Returns a Timestamp from the given string.
+ * @param opt_radix The radix in which the text is written. {default:10}
+ */
+ static fromString(str: string, opt_radix?: number): Timestamp;
+
+}
+
+/**
+ * Functions for serializing JavaScript objects into Mongodb Extended JSON (EJSON).
+ * @namespace EJSON
+ */
+export namespace EJSON {
+
+ /**
+ * Parse an Extended JSON string, constructing the JavaScript value or object described by that
+ * string.
+ *
+ * @memberof EJSON
+ * @param {string} text
+ * @param {object} [options] Optional settings
+ * @param {boolean} [options.relaxed=true] Attempt to return native JS types where possible, rather than BSON types (if true)
+ * @return {object}
+ *
+ * @example
+ * const { EJSON } = require('bson');
+ * const text = '{ "int32": { "$numberInt": "10" } }';
+ *
+ * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } }
+ * console.log(EJSON.parse(text, { relaxed: false }));
+ *
+ * // prints { int32: 10 }
+ * console.log(EJSON.parse(text));
+ */
+ export function parse(text: string, options?: {relaxed?: boolean;}): {};
+
+ /**
+ * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types
+ *
+ * @memberof EJSON
+ * @param {object} ejson The Extended JSON object to deserialize
+ * @param {object} [options] Optional settings passed to the parse method
+ * @return {object}
+ */
+ export function deserialize(ejson: {}, options?: {relaxed?: boolean;}): {};
+
+ /**
+ * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object.
+ *
+ * @memberof EJSON
+ * @param {object} bson The object to serialize
+ * @param {object} [options] Optional settings passed to the `stringify` function
+ * @return {object}
+ */
+ export function serialize(bson: {}, options?: {relaxed?: boolean;}): {};
+
+ /**
+ * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer
+ * function is specified or optionally including only the specified properties if a replacer array
+ * is specified.
+ *
+ * @memberof EJSON
+ * @param {object} value The value to convert to extended JSON
+ * @param {function|array} [replacer] A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string
+ * @param {string|number} [space] A String or Number object that's used to insert white space into the output JSON string for readability purposes.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.relaxed=true] Enabled Extended JSON's `relaxed` mode
+ * @returns {string}
+ *
+ * @example
+ * const { EJSON, Int32 } = require('bson');
+ * const doc = { int32: new Int32(10) };
+ *
+ * // prints '{"int32":{"$numberInt":"10"}}'
+ * console.log(EJSON.stringify(doc, { relaxed: false }));
+ *
+ * // prints '{"int32":10}'
+ * console.log(EJSON.stringify(doc));
+ */
+ export function stringify(
+ value: {},
+ options?: {relaxed?: boolean;}
+ ): string;
+
+ /**
+ * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer
+ * function is specified or optionally including only the specified properties if a replacer array
+ * is specified.
+ *
+ * @memberof EJSON
+ * @param {object} value The value to convert to extended JSON
+ * @param {function|array} [replacer] A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string
+ * @param {string|number} [space] A String or Number object that's used to insert white space into the output JSON string for readability purposes.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.relaxed=true] Enabled Extended JSON's `relaxed` mode
+ * @returns {string}
+ *
+ * @example
+ * const { EJSON, Int32 } = require('bson');
+ * const doc = { int32: new Int32(10) };
+ *
+ * // prints '{"int32":{"$numberInt":"10"}}'
+ * console.log(EJSON.stringify(doc, { relaxed: false }));
+ *
+ * // prints '{"int32":10}'
+ * console.log(EJSON.stringify(doc));
+ */
+
+ export function stringify(
+ value: {},
+ replacer: ((key: string, value: any) => any) | Array | null | undefined,
+ options?: {relaxed?: boolean;}
+ ): string;
+ /**
+ * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer
+ * function is specified or optionally including only the specified properties if a replacer array
+ * is specified.
+ *
+ * @memberof EJSON
+ * @param {object} value The value to convert to extended JSON
+ * @param {function|array} [replacer] A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string
+ * @param {string|number} [space] A String or Number object that's used to insert white space into the output JSON string for readability purposes.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.relaxed=true] Enabled Extended JSON's `relaxed` mode
+ * @returns {string}
+ *
+ * @example
+ * const { EJSON, Int32 } = require('bson');
+ * const doc = { int32: new Int32(10) };
+ *
+ * // prints '{"int32":{"$numberInt":"10"}}'
+ * console.log(EJSON.stringify(doc, { relaxed: false }));
+ *
+ * // prints '{"int32":10}'
+ * console.log(EJSON.stringify(doc));
+ */
+ export function stringify(
+ value: {},
+ replacer: ((key: string, value: any) => any) | Array | null | undefined,
+ indents?: string | number,
+ options?: {relaxed?: boolean;}
+ ): string;
+}
diff --git a/userauthentication/node_modules/@types/bson/package.json b/userauthentication/node_modules/@types/bson/package.json
new file mode 100644
index 00000000..689cbe91
--- /dev/null
+++ b/userauthentication/node_modules/@types/bson/package.json
@@ -0,0 +1,67 @@
+{
+ "_from": "@types/bson@*",
+ "_id": "@types/bson@4.0.3",
+ "_inBundle": false,
+ "_integrity": "sha512-mVRvYnTOZJz3ccpxhr3wgxVmSeiYinW+zlzQz3SXWaJmD1DuL05Jeq7nKw3SnbKmbleW5qrLG5vdyWe/A9sXhw==",
+ "_location": "/@types/bson",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "@types/bson@*",
+ "name": "@types/bson",
+ "escapedName": "@types%2fbson",
+ "scope": "@types",
+ "rawSpec": "*",
+ "saveSpec": null,
+ "fetchSpec": "*"
+ },
+ "_requiredBy": [
+ "/@types/mongodb"
+ ],
+ "_resolved": "https://registry.npmjs.org/@types/bson/-/bson-4.0.3.tgz",
+ "_shasum": "30889d2ffde6262abbe38659364c631454999fbf",
+ "_spec": "@types/bson@*",
+ "_where": "/Users/kishankumar/Desktop/kishan/Login_server/node_modules/@types/mongodb",
+ "bugs": {
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Hiroki Horiuchi",
+ "url": "https://github.com/horiuchi"
+ },
+ {
+ "name": "Federico Caselli",
+ "url": "https://github.com/CaselIT"
+ },
+ {
+ "name": "Justin Grant",
+ "url": "https://github.com/justingrant"
+ },
+ {
+ "name": "Mikael Lirbank",
+ "url": "https://github.com/lirbank"
+ }
+ ],
+ "dependencies": {
+ "@types/node": "*"
+ },
+ "deprecated": false,
+ "description": "TypeScript definitions for bson",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
+ "license": "MIT",
+ "main": "",
+ "name": "@types/bson",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/bson"
+ },
+ "scripts": {},
+ "typeScriptVersion": "3.2",
+ "types": "index.d.ts",
+ "typesPublisherContentHash": "de339c6ae3194d7c34d771d4580048f1007707bafc646731b539c3a79638ebe9",
+ "version": "4.0.3"
+}
diff --git a/userauthentication/node_modules/@types/mongodb/LICENSE b/userauthentication/node_modules/@types/mongodb/LICENSE
new file mode 100644
index 00000000..9e841e7a
--- /dev/null
+++ b/userauthentication/node_modules/@types/mongodb/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/userauthentication/node_modules/@types/mongodb/README.md b/userauthentication/node_modules/@types/mongodb/README.md
new file mode 100644
index 00000000..0d560cf0
--- /dev/null
+++ b/userauthentication/node_modules/@types/mongodb/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/mongodb`
+
+# Summary
+This package contains type definitions for MongoDB (https://github.com/mongodb/node-mongodb-native).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongodb.
+
+### Additional Details
+ * Last updated: Tue, 08 Dec 2020 22:56:55 GMT
+ * Dependencies: [@types/bson](https://npmjs.com/package/@types/bson), [@types/node](https://npmjs.com/package/@types/node)
+ * Global values: none
+
+# Credits
+These definitions were written by [Federico Caselli](https://github.com/CaselIT), [Alan Marcell](https://github.com/alanmarcell), [Gaurav Lahoti](https://github.com/dante-101), [Mariano Cortesi](https://github.com/mcortesi), [Enrico Picci](https://github.com/EnricoPicci), [Alexander Christie](https://github.com/AJCStriker), [Julien Chaumond](https://github.com/julien-c), [Dan Aprahamian](https://github.com/daprahamian), [Denys Bushulyak](https://github.com/denys-bushulyak), [Bastien Arata](https://github.com/BastienAr), [Wan Bachtiar](https://github.com/sindbach), [Geraldine Lemeur](https://github.com/geraldinelemeur), [Dominik Heigl](https://github.com/various89), [Angela-1](https://github.com/angela-1), [Hector Ribes](https://github.com/hector7), [Florian Richter](https://github.com/floric), [Erik Christensen](https://github.com/erikc5000), [Nick Zahn](https://github.com/Manc), [Jarom Loveridge](https://github.com/jloveridge), [Luis Pais](https://github.com/ranguna), [Hossein Saniei](https://github.com/HosseinAgha), [Alberto Silva](https://github.com/albertossilva), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Linus Unnebäck](https://github.com/LinusU), [Richard Bateman](https://github.com/taxilian), [Igor Strebezhev](https://github.com/xamgore), [Valentin Agachi](https://github.com/avaly), [HitkoDev](https://github.com/HitkoDev), [TJT](https://github.com/Celend), [Julien TASSIN](https://github.com/jtassin), [Anna Henningsen](https://github.com/addaleax), and [Emmanuel Gautier](https://github.com/emmanuelgautier).
diff --git a/userauthentication/node_modules/@types/mongodb/index.d.ts b/userauthentication/node_modules/@types/mongodb/index.d.ts
new file mode 100644
index 00000000..84d64f62
--- /dev/null
+++ b/userauthentication/node_modules/@types/mongodb/index.d.ts
@@ -0,0 +1,3286 @@
+// Type definitions for MongoDB 3.6
+// Project: https://github.com/mongodb/node-mongodb-native
+// https://github.com/mongodb/node-mongodb-native/tree/3.1
+// Definitions by: Federico Caselli
+// Alan Marcell
+// Gaurav Lahoti
+// Mariano Cortesi
+// Enrico Picci
+// Alexander Christie
+// Julien Chaumond
+// Dan Aprahamian
+// Denys Bushulyak
+// Bastien Arata
+// Wan Bachtiar
+// Geraldine Lemeur
+// Dominik Heigl
+// Angela-1
+// Hector Ribes
+// Florian Richter
+// Erik Christensen
+// Nick Zahn
+// Jarom Loveridge
+// Luis Pais
+// Hossein Saniei
+// Alberto Silva
+// Piotr Błażejewicz
+// Linus Unnebäck
+// Richard Bateman
+// Igor Strebezhev
+// Valentin Agachi
+// HitkoDev
+// TJT
+// Julien TASSIN
+// Anna Henningsen
+// Emmanuel Gautier
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// Minimum TypeScript Version: 3.2
+
+// Documentation: https://mongodb.github.io/node-mongodb-native/3.6/api/
+
+///
+///
+
+import { Binary, Decimal128, Double, Int32, Long, ObjectId, Timestamp } from 'bson';
+import { EventEmitter } from 'events';
+import { Readable, Writable } from 'stream';
+import { checkServerIdentity } from 'tls';
+
+type FlattenIfArray = T extends ReadonlyArray ? R : T;
+
+export function connect(uri: string, options?: MongoClientOptions): Promise;
+export function connect(uri: string, callback: MongoCallback): void;
+export function connect(uri: string, options: MongoClientOptions, callback: MongoCallback): void;
+
+export { Binary, DBRef, Decimal128, Double, Int32, Long, MaxKey, MinKey, ObjectID, ObjectId, Timestamp } from 'bson';
+
+type NumericTypes = number | Decimal128 | Double | Int32 | Long;
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html */
+export class MongoClient extends EventEmitter {
+ constructor(uri: string, options?: MongoClientOptions);
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#.connect */
+ static connect(uri: string, callback: MongoCallback): void;
+ static connect(uri: string, options?: MongoClientOptions): Promise;
+ static connect(uri: string, options: MongoClientOptions, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#connect */
+ connect(): Promise;
+ connect(callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#close */
+ close(callback: MongoCallback): void;
+ close(force?: boolean): Promise;
+ close(force: boolean, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#db */
+ db(dbName?: string, options?: MongoClientCommonOption): Db;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#isConnected */
+ isConnected(options?: MongoClientCommonOption): boolean;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#logout */
+ logout(callback: MongoCallback): void;
+ logout(options?: { dbName?: string }): Promise;
+ logout(options: { dbName?: string }, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#startSession */
+ startSession(options?: SessionOptions): ClientSession;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.3/api/MongoClient.html#watch */
+ watch(
+ pipeline?: object[],
+ options?: ChangeStreamOptions & { session?: ClientSession },
+ ): ChangeStream;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#withSession */
+ withSession(operation: (session: ClientSession) => Promise): Promise;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#withSession */
+ withSession(options: SessionOptions, operation: (session: ClientSession) => Promise): Promise;
+
+ readPreference: ReadPreference;
+ writeConcern: WriteConcern;
+}
+
+export type ClientSessionId = unknown;
+
+/**
+ * @see https://mongodb.github.io/node-mongodb-native/3.6/api/ClientSession.html
+ */
+export interface ClientSession extends EventEmitter {
+ /** The server id associated with this session */
+ id: ClientSessionId;
+
+ /**
+ * Aborts the currently active transaction in this session.
+ */
+ abortTransaction(): Promise;
+ /**
+ * Aborts the currently active transaction in this session.
+ * @param callback for completion of this operation
+ */
+ abortTransaction(callback?: MongoCallback): void;
+
+ /**
+ * Advances the operationTime for a {@link ClientSession}.
+ */
+ advanceOperationTime(operationTime: Timestamp): void;
+
+ /**
+ * Commits the currently active transaction in this session.
+ */
+ commitTransaction(): Promise;
+ /**
+ * Commits the currently active transaction in this session.
+ * @param callback - for completion of this operation
+ */
+ commitTransaction(callback: MongoCallback): void;
+
+ /**
+ * Ends this session on the server
+ * @param callback - for completion of this operation
+ */
+ endSession(callback?: MongoCallback): void;
+ /**
+ * Ends this session on the server
+ * @param options - settings. Currently reserved for future use
+ * @param callback - for completion of this operation
+ */
+ endSession(options: unknown, callback: MongoCallback): void;
+ /**
+ * Ends this session on the server
+ * @param options - settings. Currently reserved for future use
+ */
+ endSession(options?: unknown): Promise;
+
+ /**
+ * Used to determine if this session equals another
+ *
+ * @param session - a class representing a client session on the server
+ * @returns `true` if the sessions are equal
+ */
+ equals(session: ClientSession): boolean;
+
+ /** Increment the transaction number on the internal `ServerSession` */
+ incrementTransactionNumber(): void;
+
+ /**
+ * @returns whether this session is currently in a transaction or not
+ */
+ inTransaction(): boolean;
+
+ /**
+ * Starts a new transaction with the given options.
+ */
+ startTransaction(options?: TransactionOptions): void;
+
+ /**
+ * Runs a provided lambda within a transaction, retrying either the commit operation
+ * or entire transaction as needed (and when the error permits) to better ensure that
+ * the transaction can complete successfully.
+ *
+ * IMPORTANT: This method requires the user to return a {@link Promise}, all lambdas that do not
+ * return a {@link Promise} will result in undefined behavior.
+ *
+ * @param fn
+ * @param options - settings for the transaction
+ */
+ withTransaction(fn: WithTransactionCallback, options?: TransactionOptions): Promise;
+}
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.6/api/global.html#ReadConcern */
+type ReadConcernLevel = 'local' | 'available' | 'majority' | 'linearizable' | 'snapshot';
+
+/**
+ * The MongoDB ReadConcern, which allows for control of the consistency and isolation properties
+ * of the data read from replica sets and replica set shards.
+ * @see https://mongodb.github.io/node-mongodb-native/3.6/api/global.html#ReadConcern
+ */
+export interface ReadConcern {
+ level: ReadConcernLevel;
+}
+
+/**
+ * A MongoDB WriteConcern, which describes the level of acknowledgement
+ * requested from MongoDB for write operations.
+ * @see https://mongodb.github.io/node-mongodb-native/3.6/api/global.html#WriteConcern
+ */
+interface WriteConcern {
+ /**
+ * requests acknowledgement that the write operation has
+ * propagated to a specified number of mongod hosts
+ * @default 1
+ */
+ w?: number | 'majority' | string;
+ /**
+ * requests acknowledgement from MongoDB that the write operation has
+ * been written to the journal
+ * @default false
+ */
+ j?: boolean;
+ /**
+ * a time limit, in milliseconds, for the write concern
+ */
+ wtimeout?: number;
+}
+
+/**
+ * Options to pass when creating a Client Session
+ * @see https://mongodb.github.io/node-mongodb-native/3.6/api/global.html#SessionOptions
+ */
+export interface SessionOptions {
+ /**
+ * Whether causal consistency should be enabled on this session
+ * @default true
+ */
+ causalConsistency?: boolean;
+ /**
+ * The default TransactionOptions to use for transactions started on this session.
+ */
+ defaultTransactionOptions?: TransactionOptions;
+}
+
+/**
+ * Configuration options for a transaction.
+ * @see https://mongodb.github.io/node-mongodb-native/3.6/api/global.html#TransactionOptions
+ */
+export interface TransactionOptions {
+ readConcern?: ReadConcern;
+ writeConcern?: WriteConcern;
+ readPreference?: ReadPreferenceOrMode;
+}
+
+export interface MongoClientCommonOption {
+ /** Do not make the db an event listener to the original connection. */
+ noListener?: boolean;
+ /** Control if you want to return a cached instance or have a new one created */
+ returnNonCachedInstance?: boolean;
+}
+
+export interface MongoCallback {
+ (error: MongoError, result: T): void;
+}
+
+/**
+ * A user provided function to be run within a transaction
+ *
+ * @param session - the parent session of the transaction running the operation.
+ * This should be passed into each operation within the lambda.
+ * @returns - the resulting {@link Promise} of operations run within this transaction
+ */
+export type WithTransactionCallback = (session: ClientSession) => Promise;
+
+/**
+ * Creates a new MongoError
+ * @see https://mongodb.github.io/node-mongodb-native/3.6/api/MongoError.html
+ */
+export class MongoError extends Error {
+ constructor(message: string | Error | object);
+ /**
+ * @deprecated Use `new MongoError()` instead.
+ */
+ static create(options: string | Error | object): MongoError;
+ /**
+ * Checks the error to see if it has an error label
+ * @return `true` if the error has the provided error label
+ */
+ hasErrorLabel(label: string): boolean;
+ readonly errorLabels: string[];
+ code?: number | string;
+ /**
+ * While not documented, the `errmsg` prop is AFAIK the only way to find out
+ * which unique index caused a duplicate key error. When you have multiple
+ * unique indexes on a collection, knowing which index caused a duplicate
+ * key error enables you to send better (more precise) error messages to the
+ * client/user (eg. "Email address must be unique" instead of "Both email
+ * address and username must be unique") – which caters for a better (app)
+ * user experience.
+ *
+ * Details:
+ * {@link https://github.com/Automattic/mongoose/issues/2129 How to get index name on duplicate document 11000 error?}
+ * (issue for mongoose, but the same applies for the native mongodb driver).
+ *
+ * Note that in mongoose (the link above) the prop in question is called
+ * 'message' while in mongodb it is called 'errmsg'. This can be seen in
+ * multiple places in the source code, for example
+ * {@link https://github.com/mongodb/node-mongodb-native/blob/a12aa15ac3eaae3ad5c4166ea1423aec4560f155/test/functional/find_tests.js#L1111 here}.
+ */
+ errmsg?: string;
+ name: string;
+}
+
+/**
+ * An error indicating an issue with the network, including TCP errors and timeouts
+ * @see https://mongodb.github.io/node-mongodb-native/3.6/api/MongoNetworkError.html
+ */
+export class MongoNetworkError extends MongoError {}
+
+/**
+ * An error used when attempting to parse a value (like a connection string)
+ * @see https://mongodb.github.io/node-mongodb-native/3.6/api/MongoParseError.html
+ */
+export class MongoParseError extends MongoError {}
+
+/**
+ * An error signifying a client-side timeout event
+ * @see https://mongodb.github.io/node-mongodb-native/3.6/api/MongoTimeoutError.html
+ */
+export class MongoTimeoutError extends MongoError {
+ /**
+ * An optional reason context for the timeout, generally an error
+ * saved during flow of monitoring and selecting servers
+ */
+ reason?: string | object;
+}
+
+/**
+ * An error signifying a client-side server selection error
+ * @see https://mongodb.github.io/node-mongodb-native/3.6/api/MongoServerSelectionError.html
+ */
+export class MongoServerSelectionError extends MongoTimeoutError {}
+
+/**
+ * An error thrown when the server reports a writeConcernError
+ * @see https://mongodb.github.io/node-mongodb-native/3.6/api/MongoWriteConcernError.html
+ */
+export class MongoWriteConcernError extends MongoError {
+ /**
+ * The result document (provided if ok: 1)
+ */
+ result?: object;
+}
+
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.6/api/MongoClient.html#.connect */
+export interface MongoClientOptions
+ extends DbCreateOptions,
+ ServerOptions,
+ MongosOptions,
+ ReplSetOptions,
+ SocketOptions,
+ SSLOptions,
+ TLSOptions,
+ HighAvailabilityOptions,
+ WriteConcern,
+ UnifiedTopologyOptions {
+ /**
+ * The logging level (error/warn/info/debug)
+ */
+ loggerLevel?: string;
+
+ /**
+ * Custom logger object
+ */
+ logger?: object | log;
+
+ /**
+ * Validate MongoClient passed in options for correctness.
+ * @default false
+ */
+ validateOptions?: object | boolean;
+
+ /**
+ * The name of the application that created this MongoClient instance.
+ */
+ appname?: string;
+
+ /**
+ * Authentication credentials
+ */
+ auth?: {
+ /**
+ * The username for auth
+ */
+ user: string;
+ /**
+ * The password for auth
+ */
+ password: string;
+ };
+
+ /**
+ * Determines whether or not to use the new url parser. Enables the new, spec-compliant
+ * url parser shipped in the core driver. This url parser fixes a number of problems with
+ * the original parser, and aims to outright replace that parser in the near future.
+ * @default true
+ */
+ useNewUrlParser?: boolean;
+
+ /**
+ * Number of retries for a tailable cursor
+ * @default 5
+ */
+ numberOfRetries?: number;
+
+ /**
+ * An authentication mechanism to use for connection authentication,
+ * see the {@link https://docs.mongodb.com/manual/reference/connection-string/#urioption.authMechanism authMechanism}
+ * reference for supported options.
+ */
+ authMechanism?:
+ | 'DEFAULT'
+ | 'GSSAPI'
+ | 'PLAIN'
+ | 'MONGODB-X509'
+ | 'MONGODB-CR'
+ | 'MONGODB-AWS'
+ | 'SCRAM-SHA-1'
+ | 'SCRAM-SHA-256'
+ | string;
+
+ /** Type of compression to use */
+ compression?: {
+ /** The selected compressors in preference order */
+ compressors?: Array<'snappy' | 'zlib'>;
+ };
+}
+
+export interface SSLOptions {
+ /**
+ * Passed directly through to tls.createSecureContext.
+ * See {@link https://nodejs.org/dist/latest/docs/api/tls.html#tls_tls_createsecurecontext_options documentation}
+ * for more info.
+ */
+ ciphers?: string;
+ /**
+ * Passed directly through to tls.createSecureContext.
+ * See {@link https://nodejs.org/dist/latest/docs/api/tls.html#tls_tls_createsecurecontext_options documentation}
+ * for more info.
+ */
+ ecdhCurve?: string;
+ /**
+ * Number of connections for each server instance; set to 5 as default for legacy reasons.
+ * @default 5
+ */
+ poolSize?: number;
+ /**
+ * If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections
+ */
+ minSize?: number;
+ /**
+ * Use ssl connection (needs to have a mongod server with ssl support)
+ */
+ ssl?: boolean;
+ /**
+ * Validate mongod server certificate against ca (mongod server >=2.4 with ssl support required)
+ * @default true
+ */
+ sslValidate?: boolean;
+ /**
+ * Server identity checking during SSL
+ * @default true
+ */
+ checkServerIdentity?: boolean | typeof checkServerIdentity;
+ /**
+ * Array of valid certificates either as Buffers or Strings
+ */
+ sslCA?: ReadonlyArray;
+ /**
+ * SSL Certificate revocation list binary buffer
+ */
+ sslCRL?: ReadonlyArray;
+ /**
+ * SSL Certificate binary buffer
+ */
+ sslCert?: Buffer | string;
+ /**
+ * SSL Key file binary buffer
+ */
+ sslKey?: Buffer | string;
+ /**
+ * SSL Certificate pass phrase
+ */
+ sslPass?: Buffer | string;
+ /**
+ * String containing the server name requested via TLS SNI.
+ */
+ servername?: string;
+}
+
+export interface TLSOptions {
+ /**
+ * Enable TLS connections
+ * @default false
+ */
+ tls?: boolean;
+ /**
+ * Relax TLS constraints, disabling validation
+ * @default false
+ */
+ tlsInsecure?: boolean;
+ /**
+ * Path to file with either a single or bundle of certificate authorities
+ * to be considered trusted when making a TLS connection
+ */
+ tlsCAFile?: string;
+ /**
+ * Path to the client certificate file or the client private key file;
+ * in the case that they both are needed, the files should be concatenated
+ */
+ tlsCertificateKeyFile?: string;
+ /**
+ * The password to decrypt the client private key to be used for TLS connections
+ */
+ tlsCertificateKeyFilePassword?: string;
+ /**
+ * Specifies whether or not the driver should error when the server’s TLS certificate is invalid
+ */
+ tlsAllowInvalidCertificates?: boolean;
+ /**
+ * Specifies whether or not the driver should error when there is a mismatch between the server’s hostname
+ * and the hostname specified by the TLS certificate
+ */
+ tlsAllowInvalidHostnames?: boolean;
+}
+
+export interface HighAvailabilityOptions {
+ /**
+ * Turn on high availability monitoring.
+ * @default true
+ */
+ ha?: boolean;
+ /**
+ * The High availability period for replicaset inquiry
+ * @default 10000
+ */
+ haInterval?: number;
+ /**
+ * @default false
+ */
+ domainsEnabled?: boolean;
+
+ /**
+ * The {@link ReadPreference} mode as listed
+ * {@link https://mongodb.github.io/node-mongodb-native/3.6/api/MongoClient.html here}
+ */
+ readPreference?: ReadPreferenceOrMode;
+ /**
+ * An object representing read preference tags
+ * @see https://docs.mongodb.com/manual/core/read-preference-tags/
+ */
+ readPreferenceTags?: ReadPreferenceTags;
+}
+
+export type ReadPreferenceTags = ReadonlyArray>;
+export type ReadPreferenceMode = 'primary' | 'primaryPreferred' | 'secondary' | 'secondaryPreferred' | 'nearest';
+export type ReadPreferenceOrMode = ReadPreference | ReadPreferenceMode;
+export type ReadPreferenceOptions = {
+ /** Server mode in which the same query is dispatched in parallel to multiple replica set members. */
+ hedge?: {
+ /** Explicitly enable or disable hedged reads. */
+ enabled?: boolean;
+ };
+ /**
+ * Max secondary read staleness in seconds, Minimum value is 90 seconds.
+ */
+ maxStalenessSeconds?: number;
+};
+
+/**
+ * The **ReadPreference** class represents a MongoDB ReadPreference and is used to construct connections.
+ * @see https://docs.mongodb.com/manual/core/read-preference/
+ */
+export class ReadPreference {
+ constructor(mode: ReadPreferenceMode, tags: object, options?: ReadPreferenceOptions);
+ mode: ReadPreferenceMode;
+ tags: ReadPreferenceTags;
+ static PRIMARY: 'primary';
+ static PRIMARY_PREFERRED: 'primaryPreferred';
+ static SECONDARY: 'secondary';
+ static SECONDARY_PREFERRED: 'secondaryPreferred';
+ static NEAREST: 'nearest';
+ isValid(mode: ReadPreferenceMode | string): boolean;
+ static isValid(mode: string): boolean;
+ /**
+ * Indicates that this readPreference needs the "slaveOk" bit when sent over the wire
+ * @see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query
+ */
+ slaveOk(): boolean;
+ /**
+ * Are the two read preference equal
+ * @param readPreference - the read preference with which to check equality
+ * @return `true` if the two {@link ReadPreference}s are equivalent
+ */
+ equals(readPreference: ReadPreference): boolean;
+}
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.6/api/Db.html */
+export interface DbCreateOptions extends CommonOptions {
+ /**
+ * If the database authentication is dependent on another databaseName.
+ */
+ authSource?: string;
+ /**
+ * Force server to assign `_id` fields instead of driver.
+ * @default false
+ */
+ forceServerObjectId?: boolean;
+ /**
+ * Use c++ bson parser.
+ * @default false
+ */
+ native_parser?: boolean;
+ /**
+ * Serialize functions on any object.
+ * @default false
+ */
+ serializeFunctions?: boolean;
+ /**
+ * Specify if the BSON serializer should ignore undefined fields.
+ * @default false
+ */
+ ignoreUndefined?: boolean;
+ /**
+ * Return document results as raw BSON buffers.
+ * @default false
+ */
+ raw?: boolean;
+ /**
+ * Promotes Long values to number if they fit inside the 53 bits resolution.
+ * @default true
+ */
+ promoteLongs?: boolean;
+ /**
+ * Promotes Binary BSON values to native Node Buffers
+ * @default false
+ */
+ promoteBuffers?: boolean;
+ /**
+ * Promotes BSON values to native types where possible, set to false to only receive wrapper types.
+ * @default true
+ */
+ promoteValues?: boolean;
+ /**
+ * The preferred read preference. Use {@link ReadPreference} class.
+ */
+ readPreference?: ReadPreferenceOrMode;
+ /**
+ * A primary key factory object for generation of custom `_id` keys.
+ */
+ pkFactory?: object;
+ /**
+ * A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
+ */
+ promiseLibrary?: PromiseConstructor;
+ /**
+ * @see https://docs.mongodb.com/manual/reference/read-concern/#read-concern
+ * @since MongoDB 3.2
+ */
+ readConcern?: ReadConcern | string;
+ /**
+ * Sets a cap on how many operations the driver will buffer up before giving up on getting a
+ * working connection, default is -1 which is unlimited.
+ */
+ bufferMaxEntries?: number;
+}
+
+export interface UnifiedTopologyOptions {
+ /**
+ * Enables the new unified topology layer
+ */
+ useUnifiedTopology?: boolean;
+
+ /**
+ * **Only applies to the unified topology**
+ * The size of the latency window for selecting among multiple suitable servers
+ * @default 15
+ */
+ localThresholdMS?: number;
+
+ /**
+ * With `useUnifiedTopology`, the MongoDB driver will try to find a server to send any given operation to
+ * and keep retrying for `serverSelectionTimeoutMS` milliseconds.
+ * @default 30000
+ */
+ serverSelectionTimeoutMS?: number;
+
+ /**
+ * **Only applies to the unified topology**
+ * The frequency with which topology updates are scheduled
+ * @default 10000
+ */
+ heartbeatFrequencyMS?: number;
+
+ /**
+ * **Only applies to the unified topology**
+ * The maximum number of connections that may be associated with a pool at a given time.
+ * This includes in use and available connections
+ * @default 10
+ */
+ maxPoolSize?: number;
+
+ /**
+ * **Only applies to the unified topology**
+ * The minimum number of connections that MUST exist at any moment in a single connection pool.
+ * @default 0
+ */
+ minPoolSize?: number;
+
+ /**
+ * **Only applies to the unified topology**
+ * The maximum amount of time a connection should remain idle in the connection pool before being marked idle.
+ * @default Infinity
+ */
+ maxIdleTimeMS?: number;
+
+ /**
+ * **Only applies to the unified topology**
+ * The maximum amount of time operation execution should wait for a connection to become available.
+ * The default is 0 which means there is no limit.
+ * @default 0
+ */
+ waitQueueTimeoutMS?: number;
+}
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.6/api/Server.html */
+export interface SocketOptions {
+ /**
+ * Reconnect on error.
+ * @default true
+ */
+ autoReconnect?: boolean;
+ /**
+ * TCP Socket NoDelay option.
+ * @default true
+ */
+ noDelay?: boolean;
+ /**
+ * TCP KeepAlive enabled on the socket.
+ * @default true
+ */
+ keepAlive?: boolean;
+ /**
+ * TCP KeepAlive initial delay before sending first keep-alive packet when idle.
+ * @default 30000
+ */
+ keepAliveInitialDelay?: number;
+ /**
+ * TCP Connection timeout setting.
+ * @default 10000
+ */
+ connectTimeoutMS?: number;
+ /**
+ * Version of IP stack. Can be 4, 6 or null.
+ * @default null
+ *
+ * If null, will attempt to connect with IPv6, and will fall back to IPv4 on failure
+ * @see https://mongodb.github.io/node-mongodb-native/3.6/api/MongoClient.html
+ */
+ family?: 4 | 6 | null;
+ /**
+ * TCP Socket timeout setting.
+ * @default 360000
+ */
+ socketTimeoutMS?: number;
+}
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Server.html */
+export interface ServerOptions extends SSLOptions {
+ /**
+ * If you're connected to a single server or mongos proxy (as opposed to a replica set),
+ * the MongoDB driver will try to reconnect every reconnectInterval milliseconds for reconnectTries
+ * times, and give up afterward. When the driver gives up, the mongoose connection emits a
+ * reconnectFailed event.
+ * @default 30
+ */
+ reconnectTries?: number;
+ /**
+ * Will wait # milliseconds between retries
+ * @default 1000
+ */
+ reconnectInterval?: number;
+ /**
+ * @default true
+ */
+ monitoring?: boolean;
+
+ /**
+ * Enable command monitoring for this client
+ * @default false
+ */
+ monitorCommands?: boolean;
+
+ /**
+ * Socket Options
+ */
+ socketOptions?: SocketOptions;
+
+ /**
+ * The High availability period for replicaset inquiry
+ * @default 10000
+ */
+ haInterval?: number;
+ /**
+ * @default false
+ */
+ domainsEnabled?: boolean;
+
+ /**
+ * Specify a file sync write concern
+ * @default false
+ */
+ fsync?: boolean;
+}
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.6/api/Mongos.html */
+export interface MongosOptions extends SSLOptions, HighAvailabilityOptions {
+ /**
+ * Cutoff latency point in MS for MongoS proxy selection
+ * @default 15
+ */
+ acceptableLatencyMS?: number;
+
+ /**
+ * Socket Options
+ */
+ socketOptions?: SocketOptions;
+}
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.6/api/ReplSet.html */
+export interface ReplSetOptions extends SSLOptions, HighAvailabilityOptions {
+ /**
+ * The max staleness to secondary reads (values under 10 seconds cannot be guaranteed);
+ */
+ maxStalenessSeconds?: number;
+ /**
+ * The name of the replicaset to connect to.
+ */
+ replicaSet?: string;
+ /**
+ * Range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms)
+ * @default 15
+ */
+ secondaryAcceptableLatencyMS?: number;
+ connectWithNoPrimary?: boolean;
+ socketOptions?: SocketOptions;
+}
+
+export type ProfilingLevel = 'off' | 'slow_only' | 'all';
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html */
+export class Db extends EventEmitter {
+ constructor(databaseName: string, serverConfig: Server | ReplSet | Mongos, options?: DbCreateOptions);
+
+ serverConfig: Server | ReplSet | Mongos;
+ bufferMaxEntries: number;
+ databaseName: string;
+ options: any;
+ native_parser: boolean;
+ slaveOk: boolean;
+ writeConcern: WriteConcern;
+
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#addUser */
+ addUser(username: string, password: string, callback: MongoCallback): void;
+ addUser(username: string, password: string, options?: DbAddUserOptions): Promise;
+ addUser(username: string, password: string, options: DbAddUserOptions, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#admin */
+ admin(): Admin;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#collection */
+ collection(
+ name: string,
+ callback?: MongoCallback>,
+ ): Collection;
+ collection(
+ name: string,
+ options: DbCollectionOptions,
+ callback?: MongoCallback>,
+ ): Collection;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#collections */
+ collections(): Promise>>;
+ collections(callback: MongoCallback>>): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#command */
+ command(command: object, callback: MongoCallback): void;
+ command(
+ command: object,
+ options?: { readPreference?: ReadPreferenceOrMode; session?: ClientSession },
+ ): Promise;
+ command(
+ command: object,
+ options: { readPreference: ReadPreferenceOrMode; session?: ClientSession },
+ callback: MongoCallback,
+ ): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#createCollection */
+ createCollection(name: string, callback: MongoCallback>): void;
+ createCollection(
+ name: string,
+ options?: CollectionCreateOptions,
+ ): Promise>;
+ createCollection(
+ name: string,
+ options: CollectionCreateOptions,
+ callback: MongoCallback>,
+ ): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#createIndex */
+ createIndex(name: string, fieldOrSpec: string | object, callback: MongoCallback): void;
+ createIndex(name: string, fieldOrSpec: string | object, options?: IndexOptions): Promise;
+ createIndex(name: string, fieldOrSpec: string | object, options: IndexOptions, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#dropCollection */
+ dropCollection(name: string): Promise;
+ dropCollection(name: string, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#dropDatabase */
+ dropDatabase(): Promise;
+ dropDatabase(callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#executeDbAdminCommand */
+ executeDbAdminCommand(command: object, callback: MongoCallback): void;
+ executeDbAdminCommand(
+ command: object,
+ options?: { readPreference?: ReadPreferenceOrMode; session?: ClientSession },
+ ): Promise;
+ executeDbAdminCommand(
+ command: object,
+ options: { readPreference?: ReadPreferenceOrMode; session?: ClientSession },
+ callback: MongoCallback,
+ ): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#indexInformation */
+ indexInformation(name: string, callback: MongoCallback): void;
+ indexInformation(name: string, options?: { full?: boolean; readPreference?: ReadPreferenceOrMode }): Promise;
+ indexInformation(
+ name: string,
+ options: { full?: boolean; readPreference?: ReadPreferenceOrMode },
+ callback: MongoCallback,
+ ): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#listCollections */
+ listCollections(
+ filter?: object,
+ options?: {
+ nameOnly?: boolean;
+ batchSize?: number;
+ readPreference?: ReadPreferenceOrMode;
+ session?: ClientSession;
+ },
+ ): CommandCursor;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#profilingInfo */
+ /** @deprecated Query the system.profile collection directly. */
+ profilingInfo(callback: MongoCallback): void;
+ profilingInfo(options?: { session?: ClientSession }): Promise;
+ profilingInfo(options: { session?: ClientSession }, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#profilingLevel */
+ profilingLevel(callback: MongoCallback): void;
+ profilingLevel(options?: { session?: ClientSession }): Promise;
+ profilingLevel(options: { session?: ClientSession }, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#removeUser */
+ removeUser(username: string, callback: MongoCallback): void;
+ removeUser(username: string, options?: CommonOptions): Promise;
+ removeUser(username: string, options: CommonOptions, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#renameCollection */
+ renameCollection(
+ fromCollection: string,
+ toCollection: string,
+ callback: MongoCallback>,
+ ): void;
+ renameCollection(
+ fromCollection: string,
+ toCollection: string,
+ options?: { dropTarget?: boolean },
+ ): Promise>;
+ renameCollection(
+ fromCollection: string,
+ toCollection: string,
+ options: { dropTarget?: boolean },
+ callback: MongoCallback>,
+ ): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#setProfilingLevel */
+ setProfilingLevel(level: ProfilingLevel, callback: MongoCallback): void;
+ setProfilingLevel(level: ProfilingLevel, options?: { session?: ClientSession }): Promise;
+ setProfilingLevel(
+ level: ProfilingLevel,
+ options: { session?: ClientSession },
+ callback: MongoCallback,
+ ): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#stats */
+ stats(callback: MongoCallback): void;
+ stats(options?: { scale?: number }): Promise;
+ stats(options: { scale?: number }, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.3/api/Db.html#watch */
+ watch(
+ pipeline?: object[],
+ options?: ChangeStreamOptions & { session?: ClientSession },
+ ): ChangeStream;
+}
+
+export interface CommonOptions extends WriteConcern {
+ session?: ClientSession;
+}
+
+/**
+ * @deprecated
+ * @see https://mongodb.github.io/node-mongodb-native/3.1/api/Server.html
+ */
+export class Server extends EventEmitter {
+ constructor(host: string, port: number, options?: ServerOptions);
+
+ connections(): any[];
+}
+
+/**
+ * @deprecated
+ * @see https://mongodb.github.io/node-mongodb-native/3.1/api/ReplSet.html
+ */
+export class ReplSet extends EventEmitter {
+ constructor(servers: Server[], options?: ReplSetOptions);
+
+ connections(): any[];
+}
+
+/**
+ * @deprecated
+ * @see https://mongodb.github.io/node-mongodb-native/3.1/api/Mongos.html
+ */
+export class Mongos extends EventEmitter {
+ constructor(servers: Server[], options?: MongosOptions);
+
+ connections(): any[];
+}
+
+/**
+ * @deprecated
+ * @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#addUser
+ */
+export interface DbAddUserOptions extends CommonOptions {
+ customData?: object;
+ roles?: object[];
+}
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#createCollection */
+export interface CollectionCreateOptions extends CommonOptions {
+ raw?: boolean;
+ pkFactory?: object;
+ readPreference?: ReadPreferenceOrMode;
+ serializeFunctions?: boolean;
+ /**
+ * @deprecated
+ * @see https://jira.mongodb.org/browse/NODE-2746
+ */
+ strict?: boolean;
+ capped?: boolean;
+ /**
+ * @deprecated
+ */
+ autoIndexId?: boolean;
+ size?: number;
+ max?: number;
+ flags?: number;
+ storageEngine?: object;
+ validator?: object;
+ validationLevel?: 'off' | 'strict' | 'moderate';
+ validationAction?: 'error' | 'warn';
+ indexOptionDefaults?: object;
+ viewOn?: string;
+ pipeline?: any[];
+ collation?: CollationDocument;
+}
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#collection */
+export interface DbCollectionOptions extends CommonOptions {
+ raw?: boolean;
+ pkFactory?: object;
+ readPreference?: ReadPreferenceOrMode;
+ serializeFunctions?: boolean;
+ strict?: boolean;
+ readConcern?: ReadConcern;
+}
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#createIndex */
+export interface IndexOptions extends CommonOptions {
+ /**
+ * Creates an unique index.
+ */
+ unique?: boolean;
+ /**
+ * Creates a sparse index.
+ */
+ sparse?: boolean;
+ /**
+ * Creates the index in the background, yielding whenever possible.
+ */
+ background?: boolean;
+ /**
+ * A unique index cannot be created on a key that has pre-existing duplicate values.
+ *
+ * If you would like to create the index anyway, keeping the first document the database indexes and
+ * deleting all subsequent documents that have duplicate value
+ */
+ dropDups?: boolean;
+ /**
+ * For geo spatial indexes set the lower bound for the co-ordinates.
+ */
+ min?: number;
+ /**
+ * For geo spatial indexes set the high bound for the co-ordinates.
+ */
+ max?: number;
+ /**
+ * Specify the format version of the indexes.
+ */
+ v?: number;
+ /**
+ * Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher)
+ */
+ expireAfterSeconds?: number;
+ /**
+ * Override the auto generated index name (useful if the resulting name is larger than 128 bytes)
+ */
+ name?: string;
+ /**
+ * Creates a partial index based on the given filter object (MongoDB 3.2 or higher)
+ */
+ partialFilterExpression?: any;
+ collation?: CollationDocument;
+ default_language?: string;
+}
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html */
+export interface Admin {
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#addUser */
+ addUser(username: string, password: string, callback: MongoCallback): void;
+ addUser(username: string, password: string, options?: AddUserOptions): Promise;
+ addUser(username: string, password: string, options: AddUserOptions, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#buildInfo */
+ buildInfo(options?: { session?: ClientSession }): Promise;
+ buildInfo(options: { session?: ClientSession }, callback: MongoCallback): void;
+ buildInfo(callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#command */
+ command(command: object, callback: MongoCallback): void;
+ command(command: object, options?: { readPreference?: ReadPreferenceOrMode; maxTimeMS?: number }): Promise;
+ command(
+ command: object,
+ options: { readPreference?: ReadPreferenceOrMode; maxTimeMS?: number },
+ callback: MongoCallback,
+ ): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#listDatabases */
+ listDatabases(options?: { nameOnly?: boolean; session?: ClientSession }): Promise;
+ listDatabases(options: { nameOnly?: boolean; session?: ClientSession }, callback: MongoCallback): void;
+ listDatabases(callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#ping */
+ ping(options?: { session?: ClientSession }): Promise;
+ ping(options: { session?: ClientSession }, callback: MongoCallback): void;
+ ping(callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#removeUser */
+ removeUser(username: string, callback: MongoCallback): void;
+ removeUser(username: string, options?: FSyncOptions): Promise;
+ removeUser(username: string, options: FSyncOptions, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#replSetGetStatus */
+ replSetGetStatus(options?: { session?: ClientSession }): Promise;
+ replSetGetStatus(options: { session?: ClientSession }, callback: MongoCallback): void;
+ replSetGetStatus(callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#serverInfo */
+ serverInfo(): Promise;
+ serverInfo(callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#serverStatus */
+ serverStatus(options?: { session?: ClientSession }): Promise;
+ serverStatus(options: { session?: ClientSession }, callback: MongoCallback): void;
+ serverStatus(callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#validateCollection */
+ validateCollection(collectionNme: string, callback: MongoCallback): void;
+ validateCollection(collectionNme: string, options?: object): Promise;
+ validateCollection(collectionNme: string, options: object, callback: MongoCallback): void;
+}
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#addUser */
+export interface AddUserOptions extends CommonOptions {
+ fsync: boolean;
+ customData?: object;
+ roles?: object[];
+}
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Admin.html#removeUser */
+export interface FSyncOptions extends CommonOptions {
+ fsync?: boolean;
+}
+
+// TypeScript Omit (Exclude to be specific) does not work for objects with an "any" indexed type, and breaks discriminated unions
+type EnhancedOmit = string | number extends keyof T
+ ? T // T has indexed type e.g. { _id: string; [k: string]: any; } or it is "any"
+ : T extends any
+ ? Pick> // discriminated unions
+ : never;
+
+type ExtractIdType = TSchema extends { _id: infer U } // user has defined a type for _id
+ ? {} extends U
+ ? Exclude
+ : unknown extends U
+ ? ObjectId
+ : U
+ : ObjectId; // user has not defined _id on schema
+
+// this makes _id optional
+export type OptionalId = ObjectId extends TSchema['_id']
+ ? // a Schema with ObjectId _id type or "any" or "indexed type" provided
+ EnhancedOmit & { _id?: ExtractIdType }
+ : // a Schema provided but _id type is not ObjectId
+ WithId;
+
+// this adds _id as a required property
+export type WithId = EnhancedOmit & { _id: ExtractIdType };
+
+/** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html */
+export interface Collection {
+ /**
+ * Get the collection name.
+ */
+ collectionName: string;
+ /**
+ * Get the full collection namespace.
+ */
+ namespace: string;
+ /**
+ * The current write concern values.
+ */
+ writeConcern: WriteConcern;
+ /**
+ * The current read concern values.
+ */
+ readConcern: ReadConcern;
+ /**
+ * Get current index hint for collection.
+ */
+ hint: any;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#aggregate */
+ aggregate(callback: MongoCallback>): AggregationCursor;
+ aggregate(pipeline: object[], callback: MongoCallback>): AggregationCursor;
+ aggregate(
+ pipeline?: object[],
+ options?: CollectionAggregationOptions,
+ callback?: MongoCallback>,
+ ): AggregationCursor;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#bulkWrite */
+ bulkWrite(operations: Array>, callback: MongoCallback): void;
+ bulkWrite(
+ operations: Array>,
+ options?: CollectionBulkWriteOptions,
+ ): Promise;
+ bulkWrite(
+ operations: Array>,
+ options: CollectionBulkWriteOptions,
+ callback: MongoCallback,
+ ): void;
+ /**
+ * @see https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#count
+ * @deprecated Use countDocuments or estimatedDocumentCount
+ */
+ count(callback: MongoCallback): void;
+ count(query: FilterQuery, callback: MongoCallback): void;
+ count(query?: FilterQuery, options?: MongoCountPreferences): Promise;
+ count(query: FilterQuery, options: MongoCountPreferences, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#countDocuments */
+ countDocuments(callback: MongoCallback): void;
+ countDocuments(query: FilterQuery, callback: MongoCallback): void;
+ countDocuments(query?: FilterQuery, options?: MongoCountPreferences): Promise;
+ countDocuments(query: FilterQuery, options: MongoCountPreferences, callback: MongoCallback): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#createIndex */
+ createIndex(fieldOrSpec: string | any, callback: MongoCallback): void;
+ createIndex(fieldOrSpec: string | any, options?: IndexOptions): Promise;
+ createIndex(fieldOrSpec: string | any, options: IndexOptions, callback: MongoCallback): void;
+ /**
+ * @see https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#createIndexes
+ * @see https://docs.mongodb.org/manual/reference/command/createIndexes/
+ */
+ createIndexes(indexSpecs: IndexSpecification[], callback: MongoCallback): void;
+ createIndexes(indexSpecs: IndexSpecification[], options?: { session?: ClientSession }): Promise;
+ createIndexes(
+ indexSpecs: IndexSpecification[],
+ options: { session?: ClientSession },
+ callback: MongoCallback,
+ ): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#deleteMany */
+ deleteMany(filter: FilterQuery, callback: MongoCallback): void;
+ deleteMany(filter: FilterQuery, options?: CommonOptions): Promise;
+ deleteMany(
+ filter: FilterQuery,
+ options: CommonOptions,
+ callback: MongoCallback,
+ ): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#deleteOne */
+ deleteOne(filter: FilterQuery, callback: MongoCallback): void;
+ deleteOne(
+ filter: FilterQuery,
+ options?: CommonOptions & { bypassDocumentValidation?: boolean },
+ ): Promise;
+ deleteOne(
+ filter: FilterQuery,
+ options: CommonOptions & { bypassDocumentValidation?: boolean },
+ callback: MongoCallback,
+ ): void;
+ /** @see https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#distinct */
+ distinct>(
+ key: Key,
+ callback: MongoCallback[Key]>>>,
+ ): void;
+ distinct>(
+ key: Key,
+ query: FilterQuery,
+ callback: MongoCallback[Key]>>>,
+ ): void;
+ distinct>(
+ key: Key,
+ query?: FilterQuery,
+ options?: MongoDistinctPreferences,
+ ): Promise[Key]>>>;
+ distinct>(
+ key: Key,
+ query: FilterQuery,
+ options: MongoDistinctPreferences,
+ callback: MongoCallback[Key]>>>,
+ ): void;
+ distinct(key: string, callback: MongoCallback): void;
+ distinct(key: string, query: FilterQuery, callback: MongoCallback): void;
+ distinct(key: string, query?: FilterQuery, options?: MongoDistinctPreferences): Promise