diff --git a/.gitignore b/.gitignore
index 3363920..c0d46f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,8 @@ prepros.cfg
/demo/node_modules
demo/node_modules
+/loginradius-sdk/node_modules
+/loginradius-sdk/lib
/nbproject/private/
nbproject/project.properties
nbproject/project.xml
diff --git a/README.md b/README.md
index a31180e..1e4cdf2 100644
--- a/README.md
+++ b/README.md
@@ -74,7 +74,7 @@ The originIp will be added in `var config`
Require the loginradius-sdk package and pass the config object.
```js
- var lrv2 = require('loginradius-sdk')(config);
+ var lrv2 = new require('loginradius-sdk')(config);
```
The below APIs will be used to implement the loginradius functionalities.
@@ -5520,7 +5520,7 @@ var startDate="2022-05-17 07:10:42"; // (Optional) Valid Start Date with Date an
var endDate="2022-05-17 07:20:42"; // (Optional) Valid End Date with Date and time
-lrv2.helper.getSott(sottConfig,startDate, endDate,timeDifference).then(function (sott) {
+lrv2.getSott(sottConfig, startDate, endDate, timeDifference).then(function (sott) {
console.log(sott)
});
diff --git a/demo/package.json b/demo/package.json
index 4e2eafb..8b4a2be 100644
--- a/demo/package.json
+++ b/demo/package.json
@@ -1,6 +1,6 @@
{
"name": "nodeJsDemo",
- "version": "11.5.0-demo",
+ "version": "12.0.0-demo",
"keywords": [
"util",
"functional",
@@ -13,6 +13,6 @@
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.3",
- "loginradius-sdk": "11.5.0"
+ "loginradius-sdk": "12.0.0"
}
}
diff --git a/demo/server.js b/demo/server.js
index 63db9fa..ea86d3b 100644
--- a/demo/server.js
+++ b/demo/server.js
@@ -17,7 +17,7 @@ var config = {
// Module dependencies.
var express = require('express');
-var lrv2 = require('loginradius-sdk')(config);
+var lrv2 = new require('loginradius-sdk')(config);
var bodyParser = require('body-parser');
var path = require('path');
var app = express();
@@ -100,7 +100,7 @@ app.post('/ajax_handler/login', function (req, res) {
var fields = '';
var options = '';
- lrv2.helper.getSott(config).then(function (sott) {
+ lrv2.getSott(config).then(function (sott) {
lrv2.authenticationApi.userRegistrationByEmail(userprofileModel, sott, emailTemplate, fields, options, verificationUrl, welcomeEmailTemplate).then(function (response) {
if ((response.EmailVerified)) {
output.data = response;
diff --git a/loginradius-sdk/.eslintrc b/loginradius-sdk/.eslintrc
index c3cb901..8128a25 100644
--- a/loginradius-sdk/.eslintrc
+++ b/loginradius-sdk/.eslintrc
@@ -5,7 +5,15 @@
"es6": true,
"node": true
},
- "extends": "eslint:recommended",
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint", "prettier"],
+ "extends": [
+ "plugin:@typescript-eslint/recommended",
+ "eslint:recommended"
+ ],
+ "ignorePatterns": [
+ "lib"
+ ],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
@@ -14,6 +22,7 @@
"ecmaVersion": 2018
},
"rules": {
+ "@typescript-eslint/no-explicit-any": 0,
"accessor-pairs": "error",
"array-bracket-newline": "error",
"array-bracket-spacing": "error",
@@ -112,7 +121,7 @@
],
"lines-around-comment": "off",
"lines-around-directive": "error",
- "lines-between-class-members": "error",
+ "lines-between-class-members": "off",
"max-classes-per-file": "error",
"max-depth": "error",
"max-len": "off",
@@ -218,6 +227,7 @@
"no-unused-vars": "warn",
"no-use-before-define": "off",
"no-useless-call": "error",
+ "no-useless-catch": "off",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
diff --git a/loginradius-sdk/.prettierrc b/loginradius-sdk/.prettierrc
new file mode 100644
index 0000000..29ed0c4
--- /dev/null
+++ b/loginradius-sdk/.prettierrc
@@ -0,0 +1,4 @@
+{
+ "singleQuote": true,
+ "trailingComma": "none"
+}
\ No newline at end of file
diff --git a/loginradius-sdk/package-lock.json b/loginradius-sdk/package-lock.json
new file mode 100644
index 0000000..2cc90c9
--- /dev/null
+++ b/loginradius-sdk/package-lock.json
@@ -0,0 +1,2470 @@
+{
+ "name": "loginradius-sdk",
+ "version": "12.0.0",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "loginradius-sdk",
+ "version": "12.0.0",
+ "dependencies": {
+ "eslint": "^8.29.0",
+ "prettier": "^2.8.1"
+ },
+ "devDependencies": {
+ "@types/node": "^18.11.18",
+ "@typescript-eslint/eslint-plugin": "^5.49.0",
+ "eslint-config-prettier": "^8.6.0",
+ "eslint-plugin-prettier": "^4.2.1",
+ "typescript": "^4.9.4"
+ }
+ },
+ "node_modules/@eslint/eslintrc": {
+ "version": "1.4.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@eslint/eslintrc/-/eslintrc-1.4.1.tgz",
+ "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==",
+ "dependencies": {
+ "ajv": "^6.12.4",
+ "debug": "^4.3.2",
+ "espree": "^9.4.0",
+ "globals": "^13.19.0",
+ "ignore": "^5.2.0",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^4.1.0",
+ "minimatch": "^3.1.2",
+ "strip-json-comments": "^3.1.1"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ }
+ },
+ "node_modules/@humanwhocodes/config-array": {
+ "version": "0.11.8",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@humanwhocodes/config-array/-/config-array-0.11.8.tgz",
+ "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==",
+ "dependencies": {
+ "@humanwhocodes/object-schema": "^1.2.1",
+ "debug": "^4.1.1",
+ "minimatch": "^3.0.5"
+ },
+ "engines": {
+ "node": ">=10.10.0"
+ }
+ },
+ "node_modules/@humanwhocodes/module-importer": {
+ "version": "1.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
+ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
+ "engines": {
+ "node": ">=12.22"
+ }
+ },
+ "node_modules/@humanwhocodes/object-schema": {
+ "version": "1.2.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
+ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
+ },
+ "node_modules/@nodelib/fs.scandir": {
+ "version": "2.1.5",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
+ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
+ "dependencies": {
+ "@nodelib/fs.stat": "2.0.5",
+ "run-parallel": "^1.1.9"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@nodelib/fs.stat": {
+ "version": "2.0.5",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
+ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@nodelib/fs.walk": {
+ "version": "1.2.8",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
+ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
+ "dependencies": {
+ "@nodelib/fs.scandir": "2.1.5",
+ "fastq": "^1.6.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@types/json-schema": {
+ "version": "7.0.11",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@types/json-schema/-/json-schema-7.0.11.tgz",
+ "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==",
+ "dev": true
+ },
+ "node_modules/@types/node": {
+ "version": "18.11.18",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@types/node/-/node-18.11.18.tgz",
+ "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==",
+ "dev": true
+ },
+ "node_modules/@types/semver": {
+ "version": "7.3.13",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@types/semver/-/semver-7.3.13.tgz",
+ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==",
+ "dev": true
+ },
+ "node_modules/@typescript-eslint/eslint-plugin": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.49.0.tgz",
+ "integrity": "sha512-IhxabIpcf++TBaBa1h7jtOWyon80SXPRLDq0dVz5SLFC/eW6tofkw/O7Ar3lkx5z5U6wzbKDrl2larprp5kk5Q==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/scope-manager": "5.49.0",
+ "@typescript-eslint/type-utils": "5.49.0",
+ "@typescript-eslint/utils": "5.49.0",
+ "debug": "^4.3.4",
+ "ignore": "^5.2.0",
+ "natural-compare-lite": "^1.4.0",
+ "regexpp": "^3.2.0",
+ "semver": "^7.3.7",
+ "tsutils": "^3.21.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "@typescript-eslint/parser": "^5.0.0",
+ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/parser": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/parser/-/parser-5.49.0.tgz",
+ "integrity": "sha512-veDlZN9mUhGqU31Qiv2qEp+XrJj5fgZpJ8PW30sHU+j/8/e5ruAhLaVDAeznS7A7i4ucb/s8IozpDtt9NqCkZg==",
+ "dev": true,
+ "peer": true,
+ "dependencies": {
+ "@typescript-eslint/scope-manager": "5.49.0",
+ "@typescript-eslint/types": "5.49.0",
+ "@typescript-eslint/typescript-estree": "5.49.0",
+ "debug": "^4.3.4"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/scope-manager": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/scope-manager/-/scope-manager-5.49.0.tgz",
+ "integrity": "sha512-clpROBOiMIzpbWNxCe1xDK14uPZh35u4QaZO1GddilEzoCLAEz4szb51rBpdgurs5k2YzPtJeTEN3qVbG+LRUQ==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/types": "5.49.0",
+ "@typescript-eslint/visitor-keys": "5.49.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/type-utils": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/type-utils/-/type-utils-5.49.0.tgz",
+ "integrity": "sha512-eUgLTYq0tR0FGU5g1YHm4rt5H/+V2IPVkP0cBmbhRyEmyGe4XvJ2YJ6sYTmONfjmdMqyMLad7SB8GvblbeESZA==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/typescript-estree": "5.49.0",
+ "@typescript-eslint/utils": "5.49.0",
+ "debug": "^4.3.4",
+ "tsutils": "^3.21.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "eslint": "*"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/types": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/types/-/types-5.49.0.tgz",
+ "integrity": "sha512-7If46kusG+sSnEpu0yOz2xFv5nRz158nzEXnJFCGVEHWnuzolXKwrH5Bsf9zsNlOQkyZuk0BZKKoJQI+1JPBBg==",
+ "dev": true,
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/typescript-estree/-/typescript-estree-5.49.0.tgz",
+ "integrity": "sha512-PBdx+V7deZT/3GjNYPVQv1Nc0U46dAHbIuOG8AZ3on3vuEKiPDwFE/lG1snN2eUB9IhF7EyF7K1hmTcLztNIsA==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/types": "5.49.0",
+ "@typescript-eslint/visitor-keys": "5.49.0",
+ "debug": "^4.3.4",
+ "globby": "^11.1.0",
+ "is-glob": "^4.0.3",
+ "semver": "^7.3.7",
+ "tsutils": "^3.21.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/utils": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/utils/-/utils-5.49.0.tgz",
+ "integrity": "sha512-cPJue/4Si25FViIb74sHCLtM4nTSBXtLx1d3/QT6mirQ/c65bV8arBEebBJJizfq8W2YyMoPI/WWPFWitmNqnQ==",
+ "dev": true,
+ "dependencies": {
+ "@types/json-schema": "^7.0.9",
+ "@types/semver": "^7.3.12",
+ "@typescript-eslint/scope-manager": "5.49.0",
+ "@typescript-eslint/types": "5.49.0",
+ "@typescript-eslint/typescript-estree": "5.49.0",
+ "eslint-scope": "^5.1.1",
+ "eslint-utils": "^3.0.0",
+ "semver": "^7.3.7"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": {
+ "version": "5.1.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-scope/-/eslint-scope-5.1.1.tgz",
+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
+ "dev": true,
+ "dependencies": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^4.1.1"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/utils/node_modules/estraverse": {
+ "version": "4.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/estraverse/-/estraverse-4.3.0.tgz",
+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
+ "dev": true,
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/@typescript-eslint/visitor-keys": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/visitor-keys/-/visitor-keys-5.49.0.tgz",
+ "integrity": "sha512-v9jBMjpNWyn8B6k/Mjt6VbUS4J1GvUlR4x3Y+ibnP1z7y7V4n0WRz+50DY6+Myj0UaXVSuUlHohO+eZ8IJEnkg==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/types": "5.49.0",
+ "eslint-visitor-keys": "^3.3.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.8.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/acorn/-/acorn-8.8.2.tgz",
+ "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/acorn-jsx": {
+ "version": "5.3.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
+ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
+ "peerDependencies": {
+ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ }
+ },
+ "node_modules/ajv": {
+ "version": "6.12.6",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ }
+ },
+ "node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
+ },
+ "node_modules/array-union": {
+ "version": "2.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/array-union/-/array-union-2.1.0.tgz",
+ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
+ },
+ "node_modules/brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "node_modules/braces": {
+ "version": "3.0.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "dev": true,
+ "dependencies": {
+ "fill-range": "^7.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/callsites": {
+ "version": "3.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/chalk": {
+ "version": "4.1.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+ },
+ "node_modules/concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
+ },
+ "node_modules/cross-spawn": {
+ "version": "7.0.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/cross-spawn/-/cross-spawn-7.0.3.tgz",
+ "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "dependencies": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/debug": {
+ "version": "4.3.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/debug/-/debug-4.3.4.tgz",
+ "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
+ "dependencies": {
+ "ms": "2.1.2"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/deep-is": {
+ "version": "0.1.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/deep-is/-/deep-is-0.1.4.tgz",
+ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="
+ },
+ "node_modules/dir-glob": {
+ "version": "3.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/dir-glob/-/dir-glob-3.0.1.tgz",
+ "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
+ "dev": true,
+ "dependencies": {
+ "path-type": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/doctrine": {
+ "version": "3.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/doctrine/-/doctrine-3.0.0.tgz",
+ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+ "dependencies": {
+ "esutils": "^2.0.2"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/escape-string-regexp": {
+ "version": "4.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/eslint": {
+ "version": "8.32.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint/-/eslint-8.32.0.tgz",
+ "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==",
+ "dependencies": {
+ "@eslint/eslintrc": "^1.4.1",
+ "@humanwhocodes/config-array": "^0.11.8",
+ "@humanwhocodes/module-importer": "^1.0.1",
+ "@nodelib/fs.walk": "^1.2.8",
+ "ajv": "^6.10.0",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.2",
+ "debug": "^4.3.2",
+ "doctrine": "^3.0.0",
+ "escape-string-regexp": "^4.0.0",
+ "eslint-scope": "^7.1.1",
+ "eslint-utils": "^3.0.0",
+ "eslint-visitor-keys": "^3.3.0",
+ "espree": "^9.4.0",
+ "esquery": "^1.4.0",
+ "esutils": "^2.0.2",
+ "fast-deep-equal": "^3.1.3",
+ "file-entry-cache": "^6.0.1",
+ "find-up": "^5.0.0",
+ "glob-parent": "^6.0.2",
+ "globals": "^13.19.0",
+ "grapheme-splitter": "^1.0.4",
+ "ignore": "^5.2.0",
+ "import-fresh": "^3.0.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "is-path-inside": "^3.0.3",
+ "js-sdsl": "^4.1.4",
+ "js-yaml": "^4.1.0",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "levn": "^0.4.1",
+ "lodash.merge": "^4.6.2",
+ "minimatch": "^3.1.2",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.1",
+ "regexpp": "^3.2.0",
+ "strip-ansi": "^6.0.1",
+ "strip-json-comments": "^3.1.0",
+ "text-table": "^0.2.0"
+ },
+ "bin": {
+ "eslint": "bin/eslint.js"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ }
+ },
+ "node_modules/eslint-config-prettier": {
+ "version": "8.6.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz",
+ "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==",
+ "dev": true,
+ "bin": {
+ "eslint-config-prettier": "bin/cli.js"
+ },
+ "peerDependencies": {
+ "eslint": ">=7.0.0"
+ }
+ },
+ "node_modules/eslint-plugin-prettier": {
+ "version": "4.2.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz",
+ "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==",
+ "dev": true,
+ "dependencies": {
+ "prettier-linter-helpers": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "eslint": ">=7.28.0",
+ "prettier": ">=2.0.0"
+ },
+ "peerDependenciesMeta": {
+ "eslint-config-prettier": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/eslint-scope": {
+ "version": "7.1.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-scope/-/eslint-scope-7.1.1.tgz",
+ "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==",
+ "dependencies": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ }
+ },
+ "node_modules/eslint-utils": {
+ "version": "3.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-utils/-/eslint-utils-3.0.0.tgz",
+ "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
+ "dependencies": {
+ "eslint-visitor-keys": "^2.0.0"
+ },
+ "engines": {
+ "node": "^10.0.0 || ^12.0.0 || >= 14.0.0"
+ },
+ "peerDependencies": {
+ "eslint": ">=5"
+ }
+ },
+ "node_modules/eslint-utils/node_modules/eslint-visitor-keys": {
+ "version": "2.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
+ "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/eslint-visitor-keys": {
+ "version": "3.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz",
+ "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==",
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ }
+ },
+ "node_modules/espree": {
+ "version": "9.4.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/espree/-/espree-9.4.1.tgz",
+ "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==",
+ "dependencies": {
+ "acorn": "^8.8.0",
+ "acorn-jsx": "^5.3.2",
+ "eslint-visitor-keys": "^3.3.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ }
+ },
+ "node_modules/esquery": {
+ "version": "1.4.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/esquery/-/esquery-1.4.0.tgz",
+ "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==",
+ "dependencies": {
+ "estraverse": "^5.1.0"
+ },
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
+ "node_modules/esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "dependencies": {
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/estraverse": {
+ "version": "5.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/estraverse/-/estraverse-5.3.0.tgz",
+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/esutils": {
+ "version": "2.0.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
+ },
+ "node_modules/fast-diff": {
+ "version": "1.2.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fast-diff/-/fast-diff-1.2.0.tgz",
+ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
+ "dev": true
+ },
+ "node_modules/fast-glob": {
+ "version": "3.2.12",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fast-glob/-/fast-glob-3.2.12.tgz",
+ "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==",
+ "dev": true,
+ "dependencies": {
+ "@nodelib/fs.stat": "^2.0.2",
+ "@nodelib/fs.walk": "^1.2.3",
+ "glob-parent": "^5.1.2",
+ "merge2": "^1.3.0",
+ "micromatch": "^4.0.4"
+ },
+ "engines": {
+ "node": ">=8.6.0"
+ }
+ },
+ "node_modules/fast-glob/node_modules/glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "dev": true,
+ "dependencies": {
+ "is-glob": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/fast-json-stable-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
+ },
+ "node_modules/fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="
+ },
+ "node_modules/fastq": {
+ "version": "1.15.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fastq/-/fastq-1.15.0.tgz",
+ "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==",
+ "dependencies": {
+ "reusify": "^1.0.4"
+ }
+ },
+ "node_modules/file-entry-cache": {
+ "version": "6.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
+ "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
+ "dependencies": {
+ "flat-cache": "^3.0.4"
+ },
+ "engines": {
+ "node": "^10.12.0 || >=12.0.0"
+ }
+ },
+ "node_modules/fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "dev": true,
+ "dependencies": {
+ "to-regex-range": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/find-up": {
+ "version": "5.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/find-up/-/find-up-5.0.0.tgz",
+ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
+ "dependencies": {
+ "locate-path": "^6.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/flat-cache": {
+ "version": "3.0.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/flat-cache/-/flat-cache-3.0.4.tgz",
+ "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "dependencies": {
+ "flatted": "^3.1.0",
+ "rimraf": "^3.0.2"
+ },
+ "engines": {
+ "node": "^10.12.0 || >=12.0.0"
+ }
+ },
+ "node_modules/flatted": {
+ "version": "3.2.7",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/flatted/-/flatted-3.2.7.tgz",
+ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ=="
+ },
+ "node_modules/fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
+ },
+ "node_modules/glob": {
+ "version": "7.2.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/glob/-/glob-7.2.3.tgz",
+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.1.1",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/glob-parent": {
+ "version": "6.0.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/glob-parent/-/glob-parent-6.0.2.tgz",
+ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
+ "dependencies": {
+ "is-glob": "^4.0.3"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/globals": {
+ "version": "13.19.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/globals/-/globals-13.19.0.tgz",
+ "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==",
+ "dependencies": {
+ "type-fest": "^0.20.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/globby": {
+ "version": "11.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/globby/-/globby-11.1.0.tgz",
+ "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
+ "dev": true,
+ "dependencies": {
+ "array-union": "^2.1.0",
+ "dir-glob": "^3.0.1",
+ "fast-glob": "^3.2.9",
+ "ignore": "^5.2.0",
+ "merge2": "^1.4.1",
+ "slash": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/grapheme-splitter": {
+ "version": "1.0.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz",
+ "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ=="
+ },
+ "node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ignore": {
+ "version": "5.2.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/ignore/-/ignore-5.2.4.tgz",
+ "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/import-fresh": {
+ "version": "3.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/import-fresh/-/import-fresh-3.3.0.tgz",
+ "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "dependencies": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
+ "engines": {
+ "node": ">=0.8.19"
+ }
+ },
+ "node_modules/inflight": {
+ "version": "1.0.6",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
+ "dependencies": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "node_modules/is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "dependencies": {
+ "is-extglob": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-number": {
+ "version": "7.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.12.0"
+ }
+ },
+ "node_modules/is-path-inside": {
+ "version": "3.0.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/is-path-inside/-/is-path-inside-3.0.3.tgz",
+ "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/isexe": {
+ "version": "2.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
+ },
+ "node_modules/js-sdsl": {
+ "version": "4.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/js-sdsl/-/js-sdsl-4.3.0.tgz",
+ "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ=="
+ },
+ "node_modules/js-yaml": {
+ "version": "4.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/js-yaml/-/js-yaml-4.1.0.tgz",
+ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+ },
+ "node_modules/json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="
+ },
+ "node_modules/levn": {
+ "version": "0.4.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "dependencies": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/locate-path": {
+ "version": "6.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/locate-path/-/locate-path-6.0.0.tgz",
+ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
+ "dependencies": {
+ "p-locate": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/lodash.merge": {
+ "version": "4.6.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/lodash.merge/-/lodash.merge-4.6.2.tgz",
+ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="
+ },
+ "node_modules/lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dev": true,
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/merge2": {
+ "version": "1.4.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/merge2/-/merge2-1.4.1.tgz",
+ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
+ "dev": true,
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/micromatch": {
+ "version": "4.0.5",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/micromatch/-/micromatch-4.0.5.tgz",
+ "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
+ "dev": true,
+ "dependencies": {
+ "braces": "^3.0.2",
+ "picomatch": "^2.3.1"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/minimatch": {
+ "version": "3.1.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-3.1.2.tgz",
+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+ },
+ "node_modules/natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="
+ },
+ "node_modules/natural-compare-lite": {
+ "version": "1.4.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz",
+ "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==",
+ "dev": true
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/optionator": {
+ "version": "0.9.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/optionator/-/optionator-0.9.1.tgz",
+ "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
+ "dependencies": {
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.3"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/p-limit": {
+ "version": "3.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/p-limit/-/p-limit-3.1.0.tgz",
+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
+ "dependencies": {
+ "yocto-queue": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/p-locate": {
+ "version": "5.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/p-locate/-/p-locate-5.0.0.tgz",
+ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
+ "dependencies": {
+ "p-limit": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dependencies": {
+ "callsites": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/path-exists": {
+ "version": "4.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/path-key": {
+ "version": "3.1.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-type": {
+ "version": "4.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/path-type/-/path-type-4.0.0.tgz",
+ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/prettier": {
+ "version": "2.8.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/prettier/-/prettier-2.8.3.tgz",
+ "integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==",
+ "bin": {
+ "prettier": "bin-prettier.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/prettier-linter-helpers": {
+ "version": "1.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
+ "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
+ "dev": true,
+ "dependencies": {
+ "fast-diff": "^1.1.2"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/punycode": {
+ "version": "2.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/punycode/-/punycode-2.3.0.tgz",
+ "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/queue-microtask": {
+ "version": "1.2.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/queue-microtask/-/queue-microtask-1.2.3.tgz",
+ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="
+ },
+ "node_modules/regexpp": {
+ "version": "3.2.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/regexpp/-/regexpp-3.2.0.tgz",
+ "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/reusify": {
+ "version": "1.0.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/reusify/-/reusify-1.0.4.tgz",
+ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
+ "engines": {
+ "iojs": ">=1.0.0",
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dependencies": {
+ "glob": "^7.1.3"
+ },
+ "bin": {
+ "rimraf": "bin.js"
+ }
+ },
+ "node_modules/run-parallel": {
+ "version": "1.2.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/run-parallel/-/run-parallel-1.2.0.tgz",
+ "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
+ "dependencies": {
+ "queue-microtask": "^1.2.2"
+ }
+ },
+ "node_modules/semver": {
+ "version": "7.3.8",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/semver/-/semver-7.3.8.tgz",
+ "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
+ "dev": true,
+ "dependencies": {
+ "lru-cache": "^6.0.0"
+ },
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "dependencies": {
+ "shebang-regex": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/slash": {
+ "version": "3.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/slash/-/slash-3.0.0.tgz",
+ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/text-table": {
+ "version": "0.2.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/text-table/-/text-table-0.2.0.tgz",
+ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="
+ },
+ "node_modules/to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dev": true,
+ "dependencies": {
+ "is-number": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=8.0"
+ }
+ },
+ "node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "dev": true
+ },
+ "node_modules/tsutils": {
+ "version": "3.21.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/tsutils/-/tsutils-3.21.0.tgz",
+ "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==",
+ "dev": true,
+ "dependencies": {
+ "tslib": "^1.8.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ },
+ "peerDependencies": {
+ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta"
+ }
+ },
+ "node_modules/type-check": {
+ "version": "0.4.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "dependencies": {
+ "prelude-ls": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/type-fest": {
+ "version": "0.20.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/type-fest/-/type-fest-0.20.2.tgz",
+ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "4.9.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/typescript/-/typescript-4.9.4.tgz",
+ "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==",
+ "dev": true,
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=4.2.0"
+ }
+ },
+ "node_modules/uri-js": {
+ "version": "4.4.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/uri-js/-/uri-js-4.4.1.tgz",
+ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+ "dependencies": {
+ "punycode": "^2.1.0"
+ }
+ },
+ "node_modules/which": {
+ "version": "2.0.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/node-which"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/word-wrap": {
+ "version": "1.2.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/word-wrap/-/word-wrap-1.2.3.tgz",
+ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
+ },
+ "node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
+ "node_modules/yocto-queue": {
+ "version": "0.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/yocto-queue/-/yocto-queue-0.1.0.tgz",
+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
+ "engines": {
+ "node": ">=10"
+ }
+ }
+ },
+ "dependencies": {
+ "@eslint/eslintrc": {
+ "version": "1.4.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@eslint/eslintrc/-/eslintrc-1.4.1.tgz",
+ "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==",
+ "requires": {
+ "ajv": "^6.12.4",
+ "debug": "^4.3.2",
+ "espree": "^9.4.0",
+ "globals": "^13.19.0",
+ "ignore": "^5.2.0",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^4.1.0",
+ "minimatch": "^3.1.2",
+ "strip-json-comments": "^3.1.1"
+ }
+ },
+ "@humanwhocodes/config-array": {
+ "version": "0.11.8",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@humanwhocodes/config-array/-/config-array-0.11.8.tgz",
+ "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==",
+ "requires": {
+ "@humanwhocodes/object-schema": "^1.2.1",
+ "debug": "^4.1.1",
+ "minimatch": "^3.0.5"
+ }
+ },
+ "@humanwhocodes/module-importer": {
+ "version": "1.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
+ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA=="
+ },
+ "@humanwhocodes/object-schema": {
+ "version": "1.2.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
+ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
+ },
+ "@nodelib/fs.scandir": {
+ "version": "2.1.5",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
+ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
+ "requires": {
+ "@nodelib/fs.stat": "2.0.5",
+ "run-parallel": "^1.1.9"
+ }
+ },
+ "@nodelib/fs.stat": {
+ "version": "2.0.5",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
+ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A=="
+ },
+ "@nodelib/fs.walk": {
+ "version": "1.2.8",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
+ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
+ "requires": {
+ "@nodelib/fs.scandir": "2.1.5",
+ "fastq": "^1.6.0"
+ }
+ },
+ "@types/json-schema": {
+ "version": "7.0.11",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@types/json-schema/-/json-schema-7.0.11.tgz",
+ "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==",
+ "dev": true
+ },
+ "@types/node": {
+ "version": "18.11.18",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@types/node/-/node-18.11.18.tgz",
+ "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==",
+ "dev": true
+ },
+ "@types/semver": {
+ "version": "7.3.13",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@types/semver/-/semver-7.3.13.tgz",
+ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==",
+ "dev": true
+ },
+ "@typescript-eslint/eslint-plugin": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.49.0.tgz",
+ "integrity": "sha512-IhxabIpcf++TBaBa1h7jtOWyon80SXPRLDq0dVz5SLFC/eW6tofkw/O7Ar3lkx5z5U6wzbKDrl2larprp5kk5Q==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/scope-manager": "5.49.0",
+ "@typescript-eslint/type-utils": "5.49.0",
+ "@typescript-eslint/utils": "5.49.0",
+ "debug": "^4.3.4",
+ "ignore": "^5.2.0",
+ "natural-compare-lite": "^1.4.0",
+ "regexpp": "^3.2.0",
+ "semver": "^7.3.7",
+ "tsutils": "^3.21.0"
+ }
+ },
+ "@typescript-eslint/parser": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/parser/-/parser-5.49.0.tgz",
+ "integrity": "sha512-veDlZN9mUhGqU31Qiv2qEp+XrJj5fgZpJ8PW30sHU+j/8/e5ruAhLaVDAeznS7A7i4ucb/s8IozpDtt9NqCkZg==",
+ "dev": true,
+ "peer": true,
+ "requires": {
+ "@typescript-eslint/scope-manager": "5.49.0",
+ "@typescript-eslint/types": "5.49.0",
+ "@typescript-eslint/typescript-estree": "5.49.0",
+ "debug": "^4.3.4"
+ }
+ },
+ "@typescript-eslint/scope-manager": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/scope-manager/-/scope-manager-5.49.0.tgz",
+ "integrity": "sha512-clpROBOiMIzpbWNxCe1xDK14uPZh35u4QaZO1GddilEzoCLAEz4szb51rBpdgurs5k2YzPtJeTEN3qVbG+LRUQ==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/types": "5.49.0",
+ "@typescript-eslint/visitor-keys": "5.49.0"
+ }
+ },
+ "@typescript-eslint/type-utils": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/type-utils/-/type-utils-5.49.0.tgz",
+ "integrity": "sha512-eUgLTYq0tR0FGU5g1YHm4rt5H/+V2IPVkP0cBmbhRyEmyGe4XvJ2YJ6sYTmONfjmdMqyMLad7SB8GvblbeESZA==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/typescript-estree": "5.49.0",
+ "@typescript-eslint/utils": "5.49.0",
+ "debug": "^4.3.4",
+ "tsutils": "^3.21.0"
+ }
+ },
+ "@typescript-eslint/types": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/types/-/types-5.49.0.tgz",
+ "integrity": "sha512-7If46kusG+sSnEpu0yOz2xFv5nRz158nzEXnJFCGVEHWnuzolXKwrH5Bsf9zsNlOQkyZuk0BZKKoJQI+1JPBBg==",
+ "dev": true
+ },
+ "@typescript-eslint/typescript-estree": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/typescript-estree/-/typescript-estree-5.49.0.tgz",
+ "integrity": "sha512-PBdx+V7deZT/3GjNYPVQv1Nc0U46dAHbIuOG8AZ3on3vuEKiPDwFE/lG1snN2eUB9IhF7EyF7K1hmTcLztNIsA==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/types": "5.49.0",
+ "@typescript-eslint/visitor-keys": "5.49.0",
+ "debug": "^4.3.4",
+ "globby": "^11.1.0",
+ "is-glob": "^4.0.3",
+ "semver": "^7.3.7",
+ "tsutils": "^3.21.0"
+ }
+ },
+ "@typescript-eslint/utils": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/utils/-/utils-5.49.0.tgz",
+ "integrity": "sha512-cPJue/4Si25FViIb74sHCLtM4nTSBXtLx1d3/QT6mirQ/c65bV8arBEebBJJizfq8W2YyMoPI/WWPFWitmNqnQ==",
+ "dev": true,
+ "requires": {
+ "@types/json-schema": "^7.0.9",
+ "@types/semver": "^7.3.12",
+ "@typescript-eslint/scope-manager": "5.49.0",
+ "@typescript-eslint/types": "5.49.0",
+ "@typescript-eslint/typescript-estree": "5.49.0",
+ "eslint-scope": "^5.1.1",
+ "eslint-utils": "^3.0.0",
+ "semver": "^7.3.7"
+ },
+ "dependencies": {
+ "eslint-scope": {
+ "version": "5.1.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-scope/-/eslint-scope-5.1.1.tgz",
+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^4.1.1"
+ }
+ },
+ "estraverse": {
+ "version": "4.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/estraverse/-/estraverse-4.3.0.tgz",
+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
+ "dev": true
+ }
+ }
+ },
+ "@typescript-eslint/visitor-keys": {
+ "version": "5.49.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/visitor-keys/-/visitor-keys-5.49.0.tgz",
+ "integrity": "sha512-v9jBMjpNWyn8B6k/Mjt6VbUS4J1GvUlR4x3Y+ibnP1z7y7V4n0WRz+50DY6+Myj0UaXVSuUlHohO+eZ8IJEnkg==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/types": "5.49.0",
+ "eslint-visitor-keys": "^3.3.0"
+ }
+ },
+ "acorn": {
+ "version": "8.8.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/acorn/-/acorn-8.8.2.tgz",
+ "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw=="
+ },
+ "acorn-jsx": {
+ "version": "5.3.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
+ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
+ "requires": {}
+ },
+ "ajv": {
+ "version": "6.12.6",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "requires": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ }
+ },
+ "ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
+ },
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "argparse": {
+ "version": "2.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
+ },
+ "array-union": {
+ "version": "2.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/array-union/-/array-union-2.1.0.tgz",
+ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
+ "dev": true
+ },
+ "balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
+ },
+ "brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "requires": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "braces": {
+ "version": "3.0.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "dev": true,
+ "requires": {
+ "fill-range": "^7.0.1"
+ }
+ },
+ "callsites": {
+ "version": "3.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
+ },
+ "chalk": {
+ "version": "4.1.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
+ },
+ "cross-spawn": {
+ "version": "7.0.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/cross-spawn/-/cross-spawn-7.0.3.tgz",
+ "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "requires": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ }
+ },
+ "debug": {
+ "version": "4.3.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/debug/-/debug-4.3.4.tgz",
+ "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "deep-is": {
+ "version": "0.1.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/deep-is/-/deep-is-0.1.4.tgz",
+ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="
+ },
+ "dir-glob": {
+ "version": "3.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/dir-glob/-/dir-glob-3.0.1.tgz",
+ "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
+ "dev": true,
+ "requires": {
+ "path-type": "^4.0.0"
+ }
+ },
+ "doctrine": {
+ "version": "3.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/doctrine/-/doctrine-3.0.0.tgz",
+ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+ "requires": {
+ "esutils": "^2.0.2"
+ }
+ },
+ "escape-string-regexp": {
+ "version": "4.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="
+ },
+ "eslint": {
+ "version": "8.32.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint/-/eslint-8.32.0.tgz",
+ "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==",
+ "requires": {
+ "@eslint/eslintrc": "^1.4.1",
+ "@humanwhocodes/config-array": "^0.11.8",
+ "@humanwhocodes/module-importer": "^1.0.1",
+ "@nodelib/fs.walk": "^1.2.8",
+ "ajv": "^6.10.0",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.2",
+ "debug": "^4.3.2",
+ "doctrine": "^3.0.0",
+ "escape-string-regexp": "^4.0.0",
+ "eslint-scope": "^7.1.1",
+ "eslint-utils": "^3.0.0",
+ "eslint-visitor-keys": "^3.3.0",
+ "espree": "^9.4.0",
+ "esquery": "^1.4.0",
+ "esutils": "^2.0.2",
+ "fast-deep-equal": "^3.1.3",
+ "file-entry-cache": "^6.0.1",
+ "find-up": "^5.0.0",
+ "glob-parent": "^6.0.2",
+ "globals": "^13.19.0",
+ "grapheme-splitter": "^1.0.4",
+ "ignore": "^5.2.0",
+ "import-fresh": "^3.0.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "is-path-inside": "^3.0.3",
+ "js-sdsl": "^4.1.4",
+ "js-yaml": "^4.1.0",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "levn": "^0.4.1",
+ "lodash.merge": "^4.6.2",
+ "minimatch": "^3.1.2",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.1",
+ "regexpp": "^3.2.0",
+ "strip-ansi": "^6.0.1",
+ "strip-json-comments": "^3.1.0",
+ "text-table": "^0.2.0"
+ }
+ },
+ "eslint-config-prettier": {
+ "version": "8.6.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz",
+ "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==",
+ "dev": true,
+ "requires": {}
+ },
+ "eslint-plugin-prettier": {
+ "version": "4.2.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz",
+ "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==",
+ "dev": true,
+ "requires": {
+ "prettier-linter-helpers": "^1.0.0"
+ }
+ },
+ "eslint-scope": {
+ "version": "7.1.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-scope/-/eslint-scope-7.1.1.tgz",
+ "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==",
+ "requires": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^5.2.0"
+ }
+ },
+ "eslint-utils": {
+ "version": "3.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-utils/-/eslint-utils-3.0.0.tgz",
+ "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
+ "requires": {
+ "eslint-visitor-keys": "^2.0.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "2.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
+ "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw=="
+ }
+ }
+ },
+ "eslint-visitor-keys": {
+ "version": "3.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz",
+ "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA=="
+ },
+ "espree": {
+ "version": "9.4.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/espree/-/espree-9.4.1.tgz",
+ "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==",
+ "requires": {
+ "acorn": "^8.8.0",
+ "acorn-jsx": "^5.3.2",
+ "eslint-visitor-keys": "^3.3.0"
+ }
+ },
+ "esquery": {
+ "version": "1.4.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/esquery/-/esquery-1.4.0.tgz",
+ "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==",
+ "requires": {
+ "estraverse": "^5.1.0"
+ }
+ },
+ "esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "requires": {
+ "estraverse": "^5.2.0"
+ }
+ },
+ "estraverse": {
+ "version": "5.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/estraverse/-/estraverse-5.3.0.tgz",
+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="
+ },
+ "esutils": {
+ "version": "2.0.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="
+ },
+ "fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
+ },
+ "fast-diff": {
+ "version": "1.2.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fast-diff/-/fast-diff-1.2.0.tgz",
+ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
+ "dev": true
+ },
+ "fast-glob": {
+ "version": "3.2.12",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fast-glob/-/fast-glob-3.2.12.tgz",
+ "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==",
+ "dev": true,
+ "requires": {
+ "@nodelib/fs.stat": "^2.0.2",
+ "@nodelib/fs.walk": "^1.2.3",
+ "glob-parent": "^5.1.2",
+ "merge2": "^1.3.0",
+ "micromatch": "^4.0.4"
+ },
+ "dependencies": {
+ "glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "dev": true,
+ "requires": {
+ "is-glob": "^4.0.1"
+ }
+ }
+ }
+ },
+ "fast-json-stable-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
+ },
+ "fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="
+ },
+ "fastq": {
+ "version": "1.15.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fastq/-/fastq-1.15.0.tgz",
+ "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==",
+ "requires": {
+ "reusify": "^1.0.4"
+ }
+ },
+ "file-entry-cache": {
+ "version": "6.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
+ "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
+ "requires": {
+ "flat-cache": "^3.0.4"
+ }
+ },
+ "fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "dev": true,
+ "requires": {
+ "to-regex-range": "^5.0.1"
+ }
+ },
+ "find-up": {
+ "version": "5.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/find-up/-/find-up-5.0.0.tgz",
+ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
+ "requires": {
+ "locate-path": "^6.0.0",
+ "path-exists": "^4.0.0"
+ }
+ },
+ "flat-cache": {
+ "version": "3.0.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/flat-cache/-/flat-cache-3.0.4.tgz",
+ "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "requires": {
+ "flatted": "^3.1.0",
+ "rimraf": "^3.0.2"
+ }
+ },
+ "flatted": {
+ "version": "3.2.7",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/flatted/-/flatted-3.2.7.tgz",
+ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ=="
+ },
+ "fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
+ },
+ "glob": {
+ "version": "7.2.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/glob/-/glob-7.2.3.tgz",
+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.1.1",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
+ "glob-parent": {
+ "version": "6.0.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/glob-parent/-/glob-parent-6.0.2.tgz",
+ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
+ "requires": {
+ "is-glob": "^4.0.3"
+ }
+ },
+ "globals": {
+ "version": "13.19.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/globals/-/globals-13.19.0.tgz",
+ "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==",
+ "requires": {
+ "type-fest": "^0.20.2"
+ }
+ },
+ "globby": {
+ "version": "11.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/globby/-/globby-11.1.0.tgz",
+ "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
+ "dev": true,
+ "requires": {
+ "array-union": "^2.1.0",
+ "dir-glob": "^3.0.1",
+ "fast-glob": "^3.2.9",
+ "ignore": "^5.2.0",
+ "merge2": "^1.4.1",
+ "slash": "^3.0.0"
+ }
+ },
+ "grapheme-splitter": {
+ "version": "1.0.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz",
+ "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ=="
+ },
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
+ },
+ "ignore": {
+ "version": "5.2.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/ignore/-/ignore-5.2.4.tgz",
+ "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ=="
+ },
+ "import-fresh": {
+ "version": "3.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/import-fresh/-/import-fresh-3.3.0.tgz",
+ "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "requires": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ }
+ },
+ "imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="
+ },
+ "inflight": {
+ "version": "1.0.6",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
+ "requires": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "inherits": {
+ "version": "2.0.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="
+ },
+ "is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ },
+ "is-number": {
+ "version": "7.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true
+ },
+ "is-path-inside": {
+ "version": "3.0.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/is-path-inside/-/is-path-inside-3.0.3.tgz",
+ "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ=="
+ },
+ "isexe": {
+ "version": "2.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
+ },
+ "js-sdsl": {
+ "version": "4.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/js-sdsl/-/js-sdsl-4.3.0.tgz",
+ "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ=="
+ },
+ "js-yaml": {
+ "version": "4.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/js-yaml/-/js-yaml-4.1.0.tgz",
+ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "requires": {
+ "argparse": "^2.0.1"
+ }
+ },
+ "json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+ },
+ "json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="
+ },
+ "levn": {
+ "version": "0.4.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "requires": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ }
+ },
+ "locate-path": {
+ "version": "6.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/locate-path/-/locate-path-6.0.0.tgz",
+ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
+ "requires": {
+ "p-locate": "^5.0.0"
+ }
+ },
+ "lodash.merge": {
+ "version": "4.6.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/lodash.merge/-/lodash.merge-4.6.2.tgz",
+ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="
+ },
+ "lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dev": true,
+ "requires": {
+ "yallist": "^4.0.0"
+ }
+ },
+ "merge2": {
+ "version": "1.4.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/merge2/-/merge2-1.4.1.tgz",
+ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
+ "dev": true
+ },
+ "micromatch": {
+ "version": "4.0.5",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/micromatch/-/micromatch-4.0.5.tgz",
+ "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
+ "dev": true,
+ "requires": {
+ "braces": "^3.0.2",
+ "picomatch": "^2.3.1"
+ }
+ },
+ "minimatch": {
+ "version": "3.1.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-3.1.2.tgz",
+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "requires": {
+ "brace-expansion": "^1.1.7"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+ },
+ "natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="
+ },
+ "natural-compare-lite": {
+ "version": "1.4.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz",
+ "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==",
+ "dev": true
+ },
+ "once": {
+ "version": "1.4.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "requires": {
+ "wrappy": "1"
+ }
+ },
+ "optionator": {
+ "version": "0.9.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/optionator/-/optionator-0.9.1.tgz",
+ "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
+ "requires": {
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.3"
+ }
+ },
+ "p-limit": {
+ "version": "3.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/p-limit/-/p-limit-3.1.0.tgz",
+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
+ "requires": {
+ "yocto-queue": "^0.1.0"
+ }
+ },
+ "p-locate": {
+ "version": "5.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/p-locate/-/p-locate-5.0.0.tgz",
+ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
+ "requires": {
+ "p-limit": "^3.0.2"
+ }
+ },
+ "parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "requires": {
+ "callsites": "^3.0.0"
+ }
+ },
+ "path-exists": {
+ "version": "4.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="
+ },
+ "path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="
+ },
+ "path-key": {
+ "version": "3.1.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="
+ },
+ "path-type": {
+ "version": "4.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/path-type/-/path-type-4.0.0.tgz",
+ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
+ "dev": true
+ },
+ "picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "dev": true
+ },
+ "prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="
+ },
+ "prettier": {
+ "version": "2.8.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/prettier/-/prettier-2.8.3.tgz",
+ "integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw=="
+ },
+ "prettier-linter-helpers": {
+ "version": "1.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
+ "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
+ "dev": true,
+ "requires": {
+ "fast-diff": "^1.1.2"
+ }
+ },
+ "punycode": {
+ "version": "2.3.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/punycode/-/punycode-2.3.0.tgz",
+ "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA=="
+ },
+ "queue-microtask": {
+ "version": "1.2.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/queue-microtask/-/queue-microtask-1.2.3.tgz",
+ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="
+ },
+ "regexpp": {
+ "version": "3.2.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/regexpp/-/regexpp-3.2.0.tgz",
+ "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg=="
+ },
+ "resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
+ },
+ "reusify": {
+ "version": "1.0.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/reusify/-/reusify-1.0.4.tgz",
+ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw=="
+ },
+ "rimraf": {
+ "version": "3.0.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "requires": {
+ "glob": "^7.1.3"
+ }
+ },
+ "run-parallel": {
+ "version": "1.2.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/run-parallel/-/run-parallel-1.2.0.tgz",
+ "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
+ "requires": {
+ "queue-microtask": "^1.2.2"
+ }
+ },
+ "semver": {
+ "version": "7.3.8",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/semver/-/semver-7.3.8.tgz",
+ "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ },
+ "shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "requires": {
+ "shebang-regex": "^3.0.0"
+ }
+ },
+ "shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="
+ },
+ "slash": {
+ "version": "3.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/slash/-/slash-3.0.0.tgz",
+ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "requires": {
+ "ansi-regex": "^5.0.1"
+ }
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ },
+ "text-table": {
+ "version": "0.2.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/text-table/-/text-table-0.2.0.tgz",
+ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="
+ },
+ "to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dev": true,
+ "requires": {
+ "is-number": "^7.0.0"
+ }
+ },
+ "tslib": {
+ "version": "1.14.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "dev": true
+ },
+ "tsutils": {
+ "version": "3.21.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/tsutils/-/tsutils-3.21.0.tgz",
+ "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.8.1"
+ }
+ },
+ "type-check": {
+ "version": "0.4.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "requires": {
+ "prelude-ls": "^1.2.1"
+ }
+ },
+ "type-fest": {
+ "version": "0.20.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/type-fest/-/type-fest-0.20.2.tgz",
+ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ=="
+ },
+ "typescript": {
+ "version": "4.9.4",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/typescript/-/typescript-4.9.4.tgz",
+ "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==",
+ "dev": true
+ },
+ "uri-js": {
+ "version": "4.4.1",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/uri-js/-/uri-js-4.4.1.tgz",
+ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+ "requires": {
+ "punycode": "^2.1.0"
+ }
+ },
+ "which": {
+ "version": "2.0.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ },
+ "word-wrap": {
+ "version": "1.2.3",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/word-wrap/-/word-wrap-1.2.3.tgz",
+ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ=="
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
+ },
+ "yallist": {
+ "version": "4.0.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
+ },
+ "yocto-queue": {
+ "version": "0.1.0",
+ "resolved": "https://pelmorex.jfrog.io/artifactory/api/npm/npm/yocto-queue/-/yocto-queue-0.1.0.tgz",
+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="
+ }
+ }
+}
diff --git a/loginradius-sdk/package.json b/loginradius-sdk/package.json
index 11302db..d53b2ea 100644
--- a/loginradius-sdk/package.json
+++ b/loginradius-sdk/package.json
@@ -1,14 +1,23 @@
{
"name": "loginradius-sdk",
"readme": "",
+ "sideEffects": false,
"scripts": {
- "lint": "prettier --check sdk/**/*.js && eslint sdk/**/*.js",
- "lint:fix": "prettier --write sdk/**/*.js && eslint sdk/**/*.js --fix"
+ "lint": "prettier --check src/**/*.ts && eslint src/**/*.ts",
+ "lint:fix": "prettier --write 'src/**/*.ts' && eslint 'src/**/*.ts' --fix",
+ "clean": "npx rimraf ./lib",
+ "build": "npm run clean && npm run build:esm && npm run build:cjs && npm run build:declarations",
+ "build:esm": "tsc --outDir lib/esm --module ES6 --declaration false",
+ "build:cjs": "tsc --outDir lib/cjs --module commonjs --declaration false",
+ "build:declarations": "tsc --declaration --emitDeclarationOnly",
+ "prepublishOnly": "npm run-script build"
},
- "version": "11.5.0",
+ "version": "12.0.0",
"description": "A LoginRadius SDK for node.js",
"homepage": "https://www.loginradius.com",
- "main": "./sdk/util/lr.js",
+ "main": "./lib/cjs/util/lr.js",
+ "module": "./lib/esm/util/lr.js",
+ "types": "./lib/types/util/lr.d.ts",
"repository": {
"type": "git",
"url": "",
@@ -27,8 +36,16 @@
"email": "developers@loginradius.com"
}
],
- "dependencies": {
+ "files": [
+ "lib"
+ ],
+ "devDependencies": {
+ "@types/node": "^18.11.18",
+ "@typescript-eslint/eslint-plugin": "^5.49.0",
+ "eslint-config-prettier": "^8.6.0",
+ "eslint-plugin-prettier": "^4.2.1",
+ "typescript": "^4.9.4",
"eslint": "^8.29.0",
"prettier": "^2.8.1"
}
-}
\ No newline at end of file
+}
diff --git a/loginradius-sdk/sdk/api/account/accountApi.js b/loginradius-sdk/sdk/api/account/accountApi.js
deleted file mode 100644
index d0755f5..0000000
--- a/loginradius-sdk/sdk/api/account/accountApi.js
+++ /dev/null
@@ -1,655 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API is used to retrieve all of the accepted Policies by the user, associated with their UID.
- * @param {uid} UID, the unified identifier for each user account
- * @return Complete Policy History data
- *15.1.1
- */
-
- module.getPrivacyPolicyHistoryByUid = function (uid) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath =
- 'identity/v2/manage/account/' + uid + '/privacypolicy/history';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to create an account in Cloud Storage. This API bypass the normal email verification process and manually creates the user.
In order to use this API, you need to format a JSON request body with all of the mandatory fields
- * @param {accountCreateModel} Model Class containing Definition of payload for Account Create API
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Response containing Definition for Complete profile data
- *18.1
- */
-
- module.createAccount = function (accountCreateModel, fields) {
- if (helper.checkJson(accountCreateModel)) {
- return Promise.reject(helper.getValidationMessage('accountCreateModel'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath = 'identity/v2/manage/account';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- accountCreateModel
- );
- };
-
- /**
- * This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage.
- * @param {email} Email of the user
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Response containing Definition for Complete profile data
- *18.2
- */
-
- module.getAccountProfileByEmail = function (email, fields) {
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.email = email;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath = 'identity/v2/manage/account';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to retrieve all of the profile data associated with the specified account by user name in Cloud Storage.
- * @param {userName} UserName of the user
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Response containing Definition for Complete profile data
- *18.3
- */
-
- module.getAccountProfileByUserName = function (userName, fields) {
- if (helper.isNullOrWhiteSpace(userName)) {
- return Promise.reject(helper.getValidationMessage('userName'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.userName = userName;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath = 'identity/v2/manage/account';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to retrieve all of the profile data, associated with the account by phone number in Cloud Storage.
- * @param {phone} The Registered Phone Number
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Response containing Definition for Complete profile data
- *18.4
- */
-
- module.getAccountProfileByPhone = function (phone, fields) {
- if (helper.isNullOrWhiteSpace(phone)) {
- return Promise.reject(helper.getValidationMessage('phone'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.phone = phone;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath = 'identity/v2/manage/account';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to retrieve all of the profile data, associated with the account by uid in Cloud Storage.
- * @param {uid} UID, the unified identifier for each user account
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Response containing Definition for Complete profile data
- *18.5
- */
-
- module.getAccountProfileByUid = function (uid, fields) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath = 'identity/v2/manage/account/' + uid;
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section Here for more capabilities.
- * @param {accountUserProfileUpdateModel} Model Class containing Definition of payload for Account Update API
- * @param {uid} UID, the unified identifier for each user account
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {nullSupport} Boolean, pass true if you wish to update any user profile field with a NULL value, You can get the details
- * @return Response containing Definition for Complete profile data
- *18.15
- */
-
- module.updateAccountByUid = function (
- accountUserProfileUpdateModel,
- uid,
- fields,
- nullSupport
- ) {
- if (helper.checkJson(accountUserProfileUpdateModel)) {
- return Promise.reject(
- helper.getValidationMessage('accountUserProfileUpdateModel')
- );
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (nullSupport !== null) {
- queryParameters.nullSupport = nullSupport;
- }
-
- var resourcePath = 'identity/v2/manage/account/' + uid;
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- accountUserProfileUpdateModel
- );
- };
-
- /**
- * This API is used to update the PhoneId by using the Uid's. Admin can update the PhoneId's for both the verified and unverified profiles. It will directly replace the PhoneId and bypass the OTP verification process.
- * @param {phone} Phone number
- * @param {uid} UID, the unified identifier for each user account
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Response containing Definition for Complete profile data
- *18.16
- */
-
- module.updatePhoneIDByUid = function (phone, uid, fields) {
- if (helper.isNullOrWhiteSpace(phone)) {
- return Promise.reject(helper.getValidationMessage('phone'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var bodyParameters = {};
- bodyParameters.phone = phone;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/phoneid';
-
- return config.request('PUT', resourcePath, queryParameters, bodyParameters);
- };
-
- /**
- * This API use to retrive the hashed password of a specified account in Cloud Storage.
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition for Complete PasswordHash data
- *18.17
- */
-
- module.getAccountPasswordHashByUid = function (uid) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/password';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to set the password of an account in Cloud Storage.
- * @param {password} New password
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition for Complete PasswordHash data
- *18.18
- */
-
- module.setAccountPasswordByUid = function (password, uid) {
- if (helper.isNullOrWhiteSpace(password)) {
- return Promise.reject(helper.getValidationMessage('password'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var bodyParameters = {};
- bodyParameters.password = password;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/password';
-
- return config.request('PUT', resourcePath, queryParameters, bodyParameters);
- };
-
- /**
- * This API deletes the Users account and allows them to re-register for a new account.
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Delete Request
- *18.19
- */
-
- module.deleteAccountByUid = function (uid) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/account/' + uid;
-
- return config.request('DELETE', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to invalidate the Email Verification status on an account.
- * @param {uid} UID, the unified identifier for each user account
- * @param {emailTemplate} Email template name
- * @param {verificationUrl} Email verification url
- * @return Response containing Definition of Complete Validation data
- *18.20
- */
-
- module.invalidateAccountEmailVerification = function (
- uid,
- emailTemplate,
- verificationUrl
- ) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/invalidateemail';
-
- return config.request('PUT', resourcePath, queryParameters, null);
- };
-
- /**
- * This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body.
- * @param {email} user's email
- * @param {emailTemplate} Email template name
- * @param {resetPasswordUrl} Url to which user should get re-directed to for resetting the password
- * @param {sendEmail} If set to true, the API will also send a Forgot Password email to the customer, bypassing any Bot Protection challenges that they are faced with.
- * @return Response containing Definition of Complete Forgot Password data
- *18.22
- */
-
- module.getForgotPasswordToken = function (
- email,
- emailTemplate,
- resetPasswordUrl,
- sendEmail
- ) {
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(resetPasswordUrl)) {
- queryParameters.resetPasswordUrl = resetPasswordUrl;
- }
- if (sendEmail !== null) {
- queryParameters.sendEmail = sendEmail;
- }
-
- var bodyParameters = {};
- bodyParameters.email = email;
-
- var resourcePath = 'identity/v2/manage/account/forgot/token';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API Returns an Email Verification token.
- * @param {email} user's email
- * @return Response containing Definition of Complete Verification data
- *18.23
- */
-
- module.getEmailVerificationToken = function (email) {
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var bodyParameters = {};
- bodyParameters.email = email;
-
- var resourcePath = 'identity/v2/manage/account/verify/token';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * The API is used to get LoginRadius access token based on UID.
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Complete Token data
- *18.24
- */
-
- module.getAccessTokenByUid = function (uid) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.uid = uid;
-
- var resourcePath = 'identity/v2/manage/account/access_token';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API Allows you to reset the phone no verification of an end user’s account.
- * @param {uid} UID, the unified identifier for each user account
- * @param {smsTemplate} SMS Template name
- * @return Response containing Definition of Complete Validation data
- *18.27
- */
-
- module.resetPhoneIDVerificationByUid = function (uid, smsTemplate) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/invalidatephone';
-
- return config.request('PUT', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to add/upsert another emails in account profile by different-different email types. If the email type is same then it will simply update the existing email, otherwise it will add a new email in Email array.
- * @param {upsertEmailModel} Model Class containing Definition of payload for UpsertEmail Property
- * @param {uid} UID, the unified identifier for each user account
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Response containing Definition for Complete profile data
- *18.29
- */
-
- module.upsertEmail = function (upsertEmailModel, uid, fields) {
- if (helper.checkJson(upsertEmailModel)) {
- return Promise.reject(helper.getValidationMessage('upsertEmailModel'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/email';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- upsertEmailModel
- );
- };
-
- /**
- * Use this API to Remove emails from a user Account
- * @param {email} user's email
- * @param {uid} UID, the unified identifier for each user account
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Response containing Definition for Complete profile data
- *18.30
- */
-
- module.removeEmail = function (email, uid, fields) {
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var bodyParameters = {};
- bodyParameters.email = email;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/email';
-
- return config.request(
- 'DELETE',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API is used to refresh an access token via it's associated refresh token.
- * @param {refreshToken} LoginRadius refresh token
- * @return Response containing Definition of Complete Token data
- *18.31
- */
-
- module.refreshAccessTokenByRefreshToken = function (refreshToken) {
- if (helper.isNullOrWhiteSpace(refreshToken)) {
- return Promise.reject(helper.getValidationMessage('refreshToken'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.refresh_Token = refreshToken;
-
- var resourcePath = 'identity/v2/manage/account/access_token/refresh';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * The Revoke Refresh Access Token API is used to revoke a refresh token or the Provider Access Token, revoking an existing refresh token will invalidate the refresh token but the associated access token will work until the expiry.
- * @param {refreshToken} LoginRadius refresh token
- * @return Response containing Definition of Delete Request
- *18.32
- */
-
- module.revokeRefreshToken = function (refreshToken) {
- if (helper.isNullOrWhiteSpace(refreshToken)) {
- return Promise.reject(helper.getValidationMessage('refreshToken'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.refresh_Token = refreshToken;
-
- var resourcePath = 'identity/v2/manage/account/access_token/refresh/revoke';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * Note: This is intended for specific workflows where an email may be associated to multiple UIDs. This API is used to retrieve all of the identities (UID and Profiles), associated with a specified email in Cloud Storage.
- * @param {email} Email of the user
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Complete user Identity data
- *18.35
- */
-
- module.getAccountIdentitiesByEmail = function (email, fields) {
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.email = email;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath = 'identity/v2/manage/account/identities';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to delete all user profiles associated with an Email.
- * @param {email} Email of the user
- * @return Response containing Definition of Delete Request
- *18.36
- */
-
- module.accountDeleteByEmail = function (email) {
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.email = email;
-
- var resourcePath = 'identity/v2/manage/account';
-
- return config.request('DELETE', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to update a user's Uid. It will update all profiles, custom objects and consent management logs associated with the Uid.
- * @param {updateUidModel} Payload containing Update UID
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Complete Validation data
- *18.41
- */
-
- module.accountUpdateUid = function (updateUidModel, uid) {
- if (helper.checkJson(updateUidModel)) {
- return Promise.reject(helper.getValidationMessage('updateUidModel'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.uid = uid;
-
- var resourcePath = 'identity/v2/manage/account/uid';
-
- return config.request('PUT', resourcePath, queryParameters, updateUidModel);
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/account/roleApi.js b/loginradius-sdk/sdk/api/account/roleApi.js
deleted file mode 100644
index 79661d0..0000000
--- a/loginradius-sdk/sdk/api/account/roleApi.js
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * API is used to retrieve all the assigned roles of a particular User.
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Complete Roles data
- *18.6
- */
-
- module.getRolesByUid = function (uid) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/role';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to assign your desired roles to a given user.
- * @param {accountRolesModel} Model Class containing Definition of payload for Create Role API
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Complete Roles data
- *18.7
- */
-
- module.assignRolesByUid = function (accountRolesModel, uid) {
- if (helper.checkJson(accountRolesModel)) {
- return Promise.reject(helper.getValidationMessage('accountRolesModel'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/role';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- accountRolesModel
- );
- };
-
- /**
- * This API is used to unassign roles from a user.
- * @param {accountRolesModel} Model Class containing Definition of payload for Create Role API
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Delete Request
- *18.8
- */
-
- module.unassignRolesByUid = function (accountRolesModel, uid) {
- if (helper.checkJson(accountRolesModel)) {
- return Promise.reject(helper.getValidationMessage('accountRolesModel'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/role';
-
- return config.request(
- 'DELETE',
- resourcePath,
- queryParameters,
- accountRolesModel
- );
- };
-
- /**
- * This API Gets the contexts that have been configured and the associated roles and permissions.
- * @param {uid} UID, the unified identifier for each user account
- * @return Complete user RoleContext data
- *18.9
- */
-
- module.getRoleContextByUid = function (uid) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/rolecontext';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * The API is used to retrieve role context by the context name.
- * @param {contextName} Name of context
- * @return Complete user RoleContext data
- *18.10
- */
-
- module.getRoleContextByContextName = function (contextName) {
- if (helper.isNullOrWhiteSpace(contextName)) {
- return Promise.reject(helper.getValidationMessage('contextName'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/account/rolecontext/' + contextName;
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API creates a Context with a set of Roles
- * @param {accountRoleContextModel} Model Class containing Definition of RoleContext payload
- * @param {uid} UID, the unified identifier for each user account
- * @return Complete user RoleContext data
- *18.11
- */
-
- module.updateRoleContextByUid = function (accountRoleContextModel, uid) {
- if (helper.checkJson(accountRoleContextModel)) {
- return Promise.reject(
- helper.getValidationMessage('accountRoleContextModel')
- );
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/rolecontext';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- accountRoleContextModel
- );
- };
-
- /**
- * This API Deletes the specified Role Context
- * @param {contextName} Name of context
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Delete Request
- *18.12
- */
-
- module.deleteRoleContextByUid = function (contextName, uid) {
- if (helper.isNullOrWhiteSpace(contextName)) {
- return Promise.reject(helper.getValidationMessage('contextName'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath =
- 'identity/v2/manage/account/' + uid + '/rolecontext/' + contextName;
-
- return config.request('DELETE', resourcePath, queryParameters, null);
- };
-
- /**
- * This API Deletes the specified Role from a Context.
- * @param {contextName} Name of context
- * @param {roleContextRemoveRoleModel} Model Class containing Definition of payload for RoleContextRemoveRole API
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Delete Request
- *18.13
- */
-
- module.deleteRolesFromRoleContextByUid = function (
- contextName,
- roleContextRemoveRoleModel,
- uid
- ) {
- if (helper.isNullOrWhiteSpace(contextName)) {
- return Promise.reject(helper.getValidationMessage('contextName'));
- }
- if (helper.checkJson(roleContextRemoveRoleModel)) {
- return Promise.reject(
- helper.getValidationMessage('roleContextRemoveRoleModel')
- );
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath =
- 'identity/v2/manage/account/' +
- uid +
- '/rolecontext/' +
- contextName +
- '/role';
-
- return config.request(
- 'DELETE',
- resourcePath,
- queryParameters,
- roleContextRemoveRoleModel
- );
- };
-
- /**
- * This API Deletes Additional Permissions from Context.
- * @param {contextName} Name of context
- * @param {roleContextAdditionalPermissionRemoveRoleModel} Model Class containing Definition of payload for RoleContextAdditionalPermissionRemoveRole API
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Delete Request
- *18.14
- */
-
- module.deleteAdditionalPermissionFromRoleContextByUid = function (
- contextName,
- roleContextAdditionalPermissionRemoveRoleModel,
- uid
- ) {
- if (helper.isNullOrWhiteSpace(contextName)) {
- return Promise.reject(helper.getValidationMessage('contextName'));
- }
- if (helper.checkJson(roleContextAdditionalPermissionRemoveRoleModel)) {
- return Promise.reject(
- helper.getValidationMessage(
- 'roleContextAdditionalPermissionRemoveRoleModel'
- )
- );
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath =
- 'identity/v2/manage/account/' +
- uid +
- '/rolecontext/' +
- contextName +
- '/additionalpermission';
-
- return config.request(
- 'DELETE',
- resourcePath,
- queryParameters,
- roleContextAdditionalPermissionRemoveRoleModel
- );
- };
-
- /**
- * This API retrieves the complete list of created roles with permissions of your app.
- * @return Complete user Roles List data
- *41.1
- */
-
- module.getRolesList = function () {
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/role';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API creates a role with permissions.
- * @param {rolesModel} Model Class containing Definition of payload for Roles API
- * @return Complete user Roles data
- *41.2
- */
-
- module.createRoles = function (rolesModel) {
- if (helper.checkJson(rolesModel)) {
- return Promise.reject(helper.getValidationMessage('rolesModel'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/role';
-
- return config.request('POST', resourcePath, queryParameters, rolesModel);
- };
-
- /**
- * This API is used to delete the role.
- * @param {role} Created RoleName
- * @return Response containing Definition of Delete Request
- *41.3
- */
-
- module.deleteRole = function (role) {
- if (helper.isNullOrWhiteSpace(role)) {
- return Promise.reject(helper.getValidationMessage('role'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/role/' + role;
-
- return config.request('DELETE', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to add permissions to a given role.
- * @param {permissionsModel} Model Class containing Definition for PermissionsModel Property
- * @param {role} Created RoleName
- * @return Response containing Definition of Complete role data
- *41.4
- */
-
- module.addRolePermissions = function (permissionsModel, role) {
- if (helper.checkJson(permissionsModel)) {
- return Promise.reject(helper.getValidationMessage('permissionsModel'));
- }
- if (helper.isNullOrWhiteSpace(role)) {
- return Promise.reject(helper.getValidationMessage('role'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/role/' + role + '/permission';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- permissionsModel
- );
- };
-
- /**
- * API is used to remove permissions from a role.
- * @param {permissionsModel} Model Class containing Definition for PermissionsModel Property
- * @param {role} Created RoleName
- * @return Response containing Definition of Complete role data
- *41.5
- */
-
- module.removeRolePermissions = function (permissionsModel, role) {
- if (helper.checkJson(permissionsModel)) {
- return Promise.reject(helper.getValidationMessage('permissionsModel'));
- }
- if (helper.isNullOrWhiteSpace(role)) {
- return Promise.reject(helper.getValidationMessage('role'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/role/' + role + '/permission';
-
- return config.request(
- 'DELETE',
- resourcePath,
- queryParameters,
- permissionsModel
- );
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/account/sottApi.js b/loginradius-sdk/sdk/api/account/sottApi.js
deleted file mode 100644
index 6c2ddca..0000000
--- a/loginradius-sdk/sdk/api/account/sottApi.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API allows you to generate SOTT with a given expiration time.
- * @param {timeDifference} The time difference you would like to pass, If you not pass difference then the default value is 10 minutes
- * @return Sott data For Registration
- *18.28
- */
-
- module.generateSott = function (timeDifference) {
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- if (timeDifference !== null) {
- queryParameters.timeDifference = timeDifference;
- }
-
- var resourcePath = 'identity/v2/manage/account/sott';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/advanced/consentManagementApi.js b/loginradius-sdk/sdk/api/advanced/consentManagementApi.js
deleted file mode 100644
index ba28a79..0000000
--- a/loginradius-sdk/sdk/api/advanced/consentManagementApi.js
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API is used to get the Consent logs of the user.
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing consent logs
- *18.37
- */
-
- module.getConsentLogsByUid = function (uid) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/consent/logs';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is to submit consent form using consent token.
- * @param {consentToken} The consent token received after login error 1226
- * @param {consentSubmitModel} Model class containing list of multiple consent
- * @return Response containing User Profile Data and access token
- *43.1
- */
-
- module.submitConsentByConsentToken = function (
- consentToken,
- consentSubmitModel
- ) {
- if (helper.isNullOrWhiteSpace(consentToken)) {
- return Promise.reject(helper.getValidationMessage('consentToken'));
- }
- if (helper.checkJson(consentSubmitModel)) {
- return Promise.reject(helper.getValidationMessage('consentSubmitModel'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.consentToken = consentToken;
-
- var resourcePath = 'identity/v2/auth/consent';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- consentSubmitModel
- );
- };
-
- /**
- * This API is used to fetch consent logs.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @return Response containing consent logs
- *43.2
- */
-
- module.getConsentLogs = function (accessToken) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/consent/logs';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * API to provide a way to end user to submit a consent form for particular event type.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {consentSubmitModel} Model class containing list of multiple consent
- * @return Response containing Definition for Complete profile data
- *43.3
- */
-
- module.submitConsentByAccessToken = function (
- accessToken,
- consentSubmitModel
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(consentSubmitModel)) {
- return Promise.reject(helper.getValidationMessage('consentSubmitModel'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/consent/profile';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- consentSubmitModel
- );
- };
-
- /**
- * This API is used to check if consent is submitted for a particular event or not.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {event} Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject
- * @param {isCustom} true/false
- * @return Response containing consent profile
- *43.4
- */
-
- module.verifyConsentByAccessToken = function (accessToken, event, isCustom) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(event)) {
- return Promise.reject(helper.getValidationMessage('event'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- queryParameters.event = event;
- queryParameters.isCustom = isCustom;
-
- var resourcePath = 'identity/v2/auth/consent/verify';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is to update consents using access token.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {consentUpdateModel} Model class containg list of multiple consent
- * @return Response containing consent profile
- *43.5
- */
-
- module.updateConsentProfileByAccessToken = function (
- accessToken,
- consentUpdateModel
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(consentUpdateModel)) {
- return Promise.reject(helper.getValidationMessage('consentUpdateModel'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/consent';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- consentUpdateModel
- );
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/advanced/customObjectApi.js b/loginradius-sdk/sdk/api/advanced/customObjectApi.js
deleted file mode 100644
index 9f19b4d..0000000
--- a/loginradius-sdk/sdk/api/advanced/customObjectApi.js
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API is used to write information in JSON format to the custom object for the specified account.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {objectName} LoginRadius Custom Object Name
- * @param {payload} LoginRadius Custom Object Name
- * @return Response containing Definition for Complete user custom object data
- *6.1
- */
-
- module.createCustomObjectByToken = function (
- accessToken,
- objectName,
- payload
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(objectName)) {
- return Promise.reject(helper.getValidationMessage('objectName'));
- }
- if (helper.checkJson(payload)) {
- return Promise.reject(helper.getValidationMessage('payload'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- queryParameters.objectName = objectName;
-
- var resourcePath = 'identity/v2/auth/customobject';
-
- return config.request('POST', resourcePath, queryParameters, payload);
- };
-
- /**
- * This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {objectName} LoginRadius Custom Object Name
- * @param {objectRecordId} Unique identifier of the user's record in Custom Object
- * @param {payload} LoginRadius Custom Object Name
- * @param {updateType} Possible values: replace, partialreplace.
- * @return Response containing Definition for Complete user custom object data
- *6.2
- */
-
- module.updateCustomObjectByToken = function (
- accessToken,
- objectName,
- objectRecordId,
- payload,
- updateType
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(objectName)) {
- return Promise.reject(helper.getValidationMessage('objectName'));
- }
- if (helper.isNullOrWhiteSpace(objectRecordId)) {
- return Promise.reject(helper.getValidationMessage('objectRecordId'));
- }
- if (helper.checkJson(payload)) {
- return Promise.reject(helper.getValidationMessage('payload'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- queryParameters.objectName = objectName;
- if (updateType !== null) {
- queryParameters.updateType = updateType;
- }
-
- var resourcePath = 'identity/v2/auth/customobject/' + objectRecordId;
-
- return config.request('PUT', resourcePath, queryParameters, payload);
- };
-
- /**
- * This API is used to retrieve the specified Custom Object data for the specified account.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {objectName} LoginRadius Custom Object Name
- * @return Complete user CustomObject data
- *6.3
- */
-
- module.getCustomObjectByToken = function (accessToken, objectName) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(objectName)) {
- return Promise.reject(helper.getValidationMessage('objectName'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- queryParameters.objectName = objectName;
-
- var resourcePath = 'identity/v2/auth/customobject';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to retrieve the Custom Object data for the specified account.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {objectName} LoginRadius Custom Object Name
- * @param {objectRecordId} Unique identifier of the user's record in Custom Object
- * @return Response containing Definition for Complete user custom object data
- *6.4
- */
-
- module.getCustomObjectByRecordIDAndToken = function (
- accessToken,
- objectName,
- objectRecordId
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(objectName)) {
- return Promise.reject(helper.getValidationMessage('objectName'));
- }
- if (helper.isNullOrWhiteSpace(objectRecordId)) {
- return Promise.reject(helper.getValidationMessage('objectRecordId'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- queryParameters.objectName = objectName;
-
- var resourcePath = 'identity/v2/auth/customobject/' + objectRecordId;
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {objectName} LoginRadius Custom Object Name
- * @param {objectRecordId} Unique identifier of the user's record in Custom Object
- * @return Response containing Definition of Delete Request
- *6.5
- */
-
- module.deleteCustomObjectByToken = function (
- accessToken,
- objectName,
- objectRecordId
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(objectName)) {
- return Promise.reject(helper.getValidationMessage('objectName'));
- }
- if (helper.isNullOrWhiteSpace(objectRecordId)) {
- return Promise.reject(helper.getValidationMessage('objectRecordId'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- queryParameters.objectName = objectName;
-
- var resourcePath = 'identity/v2/auth/customobject/' + objectRecordId;
-
- return config.request('DELETE', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to write information in JSON format to the custom object for the specified account.
- * @param {objectName} LoginRadius Custom Object Name
- * @param {payload} LoginRadius Custom Object Name
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition for Complete user custom object data
- *19.1
- */
-
- module.createCustomObjectByUid = function (objectName, payload, uid) {
- if (helper.isNullOrWhiteSpace(objectName)) {
- return Promise.reject(helper.getValidationMessage('objectName'));
- }
- if (helper.checkJson(payload)) {
- return Promise.reject(helper.getValidationMessage('payload'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.objectName = objectName;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/customobject';
-
- return config.request('POST', resourcePath, queryParameters, payload);
- };
-
- /**
- * This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation.
- * @param {objectName} LoginRadius Custom Object Name
- * @param {objectRecordId} Unique identifier of the user's record in Custom Object
- * @param {payload} LoginRadius Custom Object Name
- * @param {uid} UID, the unified identifier for each user account
- * @param {updateType} Possible values: replace, partialreplace.
- * @return Response containing Definition for Complete user custom object data
- *19.2
- */
-
- module.updateCustomObjectByUid = function (
- objectName,
- objectRecordId,
- payload,
- uid,
- updateType
- ) {
- if (helper.isNullOrWhiteSpace(objectName)) {
- return Promise.reject(helper.getValidationMessage('objectName'));
- }
- if (helper.isNullOrWhiteSpace(objectRecordId)) {
- return Promise.reject(helper.getValidationMessage('objectRecordId'));
- }
- if (helper.checkJson(payload)) {
- return Promise.reject(helper.getValidationMessage('payload'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.objectName = objectName;
- if (updateType !== null) {
- queryParameters.updateType = updateType;
- }
-
- var resourcePath =
- 'identity/v2/manage/account/' + uid + '/customobject/' + objectRecordId;
-
- return config.request('PUT', resourcePath, queryParameters, payload);
- };
-
- /**
- * This API is used to retrieve all the custom objects by UID from cloud storage.
- * @param {objectName} LoginRadius Custom Object Name
- * @param {uid} UID, the unified identifier for each user account
- * @return Complete user CustomObject data
- *19.3
- */
-
- module.getCustomObjectByUid = function (objectName, uid) {
- if (helper.isNullOrWhiteSpace(objectName)) {
- return Promise.reject(helper.getValidationMessage('objectName'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.objectName = objectName;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/customobject';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to retrieve the Custom Object data for the specified account.
- * @param {objectName} LoginRadius Custom Object Name
- * @param {objectRecordId} Unique identifier of the user's record in Custom Object
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition for Complete user custom object data
- *19.4
- */
-
- module.getCustomObjectByRecordID = function (
- objectName,
- objectRecordId,
- uid
- ) {
- if (helper.isNullOrWhiteSpace(objectName)) {
- return Promise.reject(helper.getValidationMessage('objectName'));
- }
- if (helper.isNullOrWhiteSpace(objectRecordId)) {
- return Promise.reject(helper.getValidationMessage('objectRecordId'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.objectName = objectName;
-
- var resourcePath =
- 'identity/v2/manage/account/' + uid + '/customobject/' + objectRecordId;
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to remove the specified Custom Object data using ObjectRecordId of specified account.
- * @param {objectName} LoginRadius Custom Object Name
- * @param {objectRecordId} Unique identifier of the user's record in Custom Object
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Delete Request
- *19.5
- */
-
- module.deleteCustomObjectByRecordID = function (
- objectName,
- objectRecordId,
- uid
- ) {
- if (helper.isNullOrWhiteSpace(objectName)) {
- return Promise.reject(helper.getValidationMessage('objectName'));
- }
- if (helper.isNullOrWhiteSpace(objectRecordId)) {
- return Promise.reject(helper.getValidationMessage('objectRecordId'));
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.objectName = objectName;
-
- var resourcePath =
- 'identity/v2/manage/account/' + uid + '/customobject/' + objectRecordId;
-
- return config.request('DELETE', resourcePath, queryParameters, null);
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/advanced/multiFactorAuthenticationApi.js b/loginradius-sdk/sdk/api/advanced/multiFactorAuthenticationApi.js
deleted file mode 100644
index 21ea8d9..0000000
--- a/loginradius-sdk/sdk/api/advanced/multiFactorAuthenticationApi.js
+++ /dev/null
@@ -1,1233 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API is used to configure the Multi-factor authentication after login by using the access token when MFA is set as optional on the LoginRadius site.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {smsTemplate2FA} SMS Template Name
- * @return Response containing Definition of Complete Multi-Factor Authentication Settings data
- *5.7
- */
-
- module.mfaConfigureByAccessToken = function (accessToken, smsTemplate2FA) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(smsTemplate2FA)) {
- queryParameters.smsTemplate2FA = smsTemplate2FA;
- }
-
- var resourcePath = 'identity/v2/auth/account/2fa';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to trigger the Multi-factor authentication settings after login for secure actions
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {multiFactorAuthModelWithLockout} Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Response containing Definition for Complete profile data
- *5.9
- */
-
- module.mfaUpdateSetting = function (
- accessToken,
- multiFactorAuthModelWithLockout,
- fields
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(multiFactorAuthModelWithLockout)) {
- return Promise.reject(
- helper.getValidationMessage('multiFactorAuthModelWithLockout')
- );
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath = 'identity/v2/auth/account/2fa/verification/otp';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- multiFactorAuthModelWithLockout
- );
- };
-
- /**
- * This API is used to Enable Multi-factor authentication by access token on user login
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {multiFactorAuthModelByGoogleAuthenticatorCode} Model Class containing Definition of payload for MultiFactorAuthModel By GoogleAuthenticator Code API
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {smsTemplate} SMS Template name
- * @return Response containing Definition for Complete profile data
- *5.10
- */
-
- module.mfaUpdateByAccessToken = function (
- accessToken,
- multiFactorAuthModelByGoogleAuthenticatorCode,
- fields,
- smsTemplate
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(multiFactorAuthModelByGoogleAuthenticatorCode)) {
- return Promise.reject(
- helper.getValidationMessage(
- 'multiFactorAuthModelByGoogleAuthenticatorCode'
- )
- );
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var resourcePath =
- 'identity/v2/auth/account/2fa/verification/googleauthenticatorcode';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- multiFactorAuthModelByGoogleAuthenticatorCode
- );
- };
-
- /**
- * This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {phoneNo2FA} Phone Number For 2FA
- * @param {smsTemplate2FA} SMS Template Name
- * @return Response containing Definition for Complete SMS data
- *5.11
- */
-
- module.mfaUpdatePhoneNumberByToken = function (
- accessToken,
- phoneNo2FA,
- smsTemplate2FA
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(phoneNo2FA)) {
- return Promise.reject(helper.getValidationMessage('phoneNo2FA'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(smsTemplate2FA)) {
- queryParameters.smsTemplate2FA = smsTemplate2FA;
- }
-
- var bodyParameters = {};
- bodyParameters.phoneNo2FA = phoneNo2FA;
-
- var resourcePath = 'identity/v2/auth/account/2fa';
-
- return config.request('PUT', resourcePath, queryParameters, bodyParameters);
- };
-
- /**
- * This API Resets the Google Authenticator configurations on a given account via the access token
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {googleauthenticator} boolean type value,Enable google Authenticator Code.
- * @return Response containing Definition of Delete Request
- *5.12.1
- */
-
- module.mfaResetGoogleAuthByToken = function (
- accessToken,
- googleauthenticator
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var bodyParameters = {};
- bodyParameters.googleauthenticator = googleauthenticator;
-
- var resourcePath = 'identity/v2/auth/account/2fa/authenticator';
-
- return config.request(
- 'DELETE',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API resets the SMS Authenticator configurations on a given account via the access token.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {otpauthenticator} Pass 'otpauthenticator' to remove SMS Authenticator
- * @return Response containing Definition of Delete Request
- *5.12.2
- */
-
- module.mfaResetSMSAuthByToken = function (accessToken, otpauthenticator) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var bodyParameters = {};
- bodyParameters.otpauthenticator = otpauthenticator;
-
- var resourcePath = 'identity/v2/auth/account/2fa/authenticator';
-
- return config.request(
- 'DELETE',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API is used to get a set of backup codes via access token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @return Response containing Definition of Complete Backup Code data
- *5.13
- */
-
- module.mfaBackupCodeByAccessToken = function (accessToken) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/account/2fa/backupcode';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * API is used to reset the backup codes on a given account via the access token. This API call will generate 10 new codes, each code can only be consumed once
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @return Response containing Definition of Complete Backup Code data
- *5.14
- */
-
- module.mfaResetBackupCodeByAccessToken = function (accessToken) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/account/2fa/backupcode/reset';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is created to send the OTP to the email if email OTP authenticator is enabled in app's MFA configuration.
- * @param {accessToken} access_token
- * @param {emailId} EmailId
- * @param {emailTemplate2FA} EmailTemplate2FA
- * @return Response containing Definition of Complete Validation data
- *5.17
- */
-
- module.mfaEmailOtpByAccessToken = function (
- accessToken,
- emailId,
- emailTemplate2FA
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(emailId)) {
- return Promise.reject(helper.getValidationMessage('emailId'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- queryParameters.emailId = emailId;
- if (!helper.isNullOrWhiteSpace(emailTemplate2FA)) {
- queryParameters.emailTemplate2FA = emailTemplate2FA;
- }
-
- var resourcePath = 'identity/v2/auth/account/2fa/otp/email';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to set up MFA Email OTP authenticator on profile after login.
- * @param {accessToken} access_token
- * @param {multiFactorAuthModelByEmailOtpWithLockout} payload
- * @return Response containing Definition for Complete profile data
- *5.18
- */
-
- module.mfaValidateEmailOtpByAccessToken = function (
- accessToken,
- multiFactorAuthModelByEmailOtpWithLockout
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(multiFactorAuthModelByEmailOtpWithLockout)) {
- return Promise.reject(
- helper.getValidationMessage('multiFactorAuthModelByEmailOtpWithLockout')
- );
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/account/2fa/verification/otp/email';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- multiFactorAuthModelByEmailOtpWithLockout
- );
- };
-
- /**
- * This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user
- * @param {accessToken} access_token
- * @return Response containing Definition of Delete Request
- *5.19
- */
-
- module.mfaResetEmailOtpAuthenticatorByAccessToken = function (accessToken) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/account/2fa/authenticator/otp/email';
-
- return config.request('DELETE', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to set up MFA Security Question authenticator on profile after login.
- * @param {accessToken} access_token
- * @param {securityQuestionAnswerModelByAccessToken} payload
- * @return Response containing Definition of Complete Validation data
- *5.20
- */
-
- module.mfaSecurityQuestionAnswerByAccessToken = function (
- accessToken,
- securityQuestionAnswerModelByAccessToken
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(securityQuestionAnswerModelByAccessToken)) {
- return Promise.reject(
- helper.getValidationMessage('securityQuestionAnswerModelByAccessToken')
- );
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/account/2fa/securityquestionanswer';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- securityQuestionAnswerModelByAccessToken
- );
- };
-
- /**
- * This API is used to Reset MFA Security Question Authenticator By Access Token
- * @param {accessToken} access_token
- * @return Response containing Definition of Delete Request
- *5.21
- */
-
- module.mfaResetSecurityQuestionAuthenticatorByAccessToken = function (
- accessToken
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath =
- 'identity/v2/auth/account/2fa/authenticator/securityquestionanswer';
-
- return config.request('DELETE', resourcePath, queryParameters, null);
- };
-
- /**
- * This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site.
- * @param {email} user's email
- * @param {password} Password for the email
- * @param {emailTemplate} Email template name
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {loginUrl} Url where the user is logging from
- * @param {smsTemplate} SMS Template name
- * @param {smsTemplate2FA} SMS Template Name
- * @param {verificationUrl} Email verification url
- * @param {emailTemplate2FA} 2FA Email Template name
- * @return Complete user UserProfile data
-
- *9.8.1
- */
-
- module.mfaLoginByEmail = function (
- email,
- password,
- emailTemplate,
- fields,
- loginUrl,
- smsTemplate,
- smsTemplate2FA,
- verificationUrl,
- emailTemplate2FA
- ) {
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- if (helper.isNullOrWhiteSpace(password)) {
- return Promise.reject(helper.getValidationMessage('password'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(loginUrl)) {
- queryParameters.loginUrl = loginUrl;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate2FA)) {
- queryParameters.smsTemplate2FA = smsTemplate2FA;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
- if (!helper.isNullOrWhiteSpace(emailTemplate2FA)) {
- queryParameters.emailTemplate2FA = emailTemplate2FA;
- }
-
- var bodyParameters = {};
- bodyParameters.email = email;
- bodyParameters.password = password;
-
- var resourcePath = 'identity/v2/auth/login/2fa';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site.
- * @param {password} Password for the email
- * @param {username} Username of the user
- * @param {emailTemplate} Email template name
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {loginUrl} Url where the user is logging from
- * @param {smsTemplate} SMS Template name
- * @param {smsTemplate2FA} SMS Template Name
- * @param {verificationUrl} Email verification url
- * @param {emailTemplate2FA} 2FA Email Template name
- * @return Complete user UserProfile data
- *9.8.2
- */
-
- module.mfaLoginByUserName = function (
- password,
- username,
- emailTemplate,
- fields,
- loginUrl,
- smsTemplate,
- smsTemplate2FA,
- verificationUrl,
- emailTemplate2FA
- ) {
- if (helper.isNullOrWhiteSpace(password)) {
- return Promise.reject(helper.getValidationMessage('password'));
- }
- if (helper.isNullOrWhiteSpace(username)) {
- return Promise.reject(helper.getValidationMessage('username'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(loginUrl)) {
- queryParameters.loginUrl = loginUrl;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate2FA)) {
- queryParameters.smsTemplate2FA = smsTemplate2FA;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
- if (!helper.isNullOrWhiteSpace(emailTemplate2FA)) {
- queryParameters.emailTemplate2FA = emailTemplate2FA;
- }
-
- var bodyParameters = {};
- bodyParameters.password = password;
- bodyParameters.username = username;
-
- var resourcePath = 'identity/v2/auth/login/2fa';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site.
- * @param {password} Password for the email
- * @param {phone} New Phone Number
- * @param {emailTemplate} Email template name
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {loginUrl} Url where the user is logging from
- * @param {smsTemplate} SMS Template name
- * @param {smsTemplate2FA} SMS Template Name
- * @param {verificationUrl} Email verification url
- * @param {emailTemplate2FA} 2FA Email Template name
- * @return Complete user UserProfile data
- *9.8.3
- */
-
- module.mfaLoginByPhone = function (
- password,
- phone,
- emailTemplate,
- fields,
- loginUrl,
- smsTemplate,
- smsTemplate2FA,
- verificationUrl,
- emailTemplate2FA
- ) {
- if (helper.isNullOrWhiteSpace(password)) {
- return Promise.reject(helper.getValidationMessage('password'));
- }
- if (helper.isNullOrWhiteSpace(phone)) {
- return Promise.reject(helper.getValidationMessage('phone'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(loginUrl)) {
- queryParameters.loginUrl = loginUrl;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate2FA)) {
- queryParameters.smsTemplate2FA = smsTemplate2FA;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
- if (!helper.isNullOrWhiteSpace(emailTemplate2FA)) {
- queryParameters.emailTemplate2FA = emailTemplate2FA;
- }
- var bodyParameters = {};
- bodyParameters.password = password;
- bodyParameters.phone = phone;
-
- var resourcePath = 'identity/v2/auth/login/2fa';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API is used to login via Multi-factor authentication by passing the One Time Password received via SMS
- * @param {multiFactorAuthModelWithLockout} Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API
- * @param {secondFactorAuthenticationToken} A Uniquely generated MFA identifier token after successful authentication
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {smsTemplate2FA} SMS Template Name
- * @param {rbaBrowserEmailTemplate}
- * @param {rbaCityEmailTemplate}
- * @param {rbaCountryEmailTemplate}
- * @param {rbaIpEmailTemplate}
- * @return Complete user UserProfile data
- *9.12
- */
-
- module.mfaValidateOTPByPhone = function (
- multiFactorAuthModelWithLockout,
- secondFactorAuthenticationToken,
- fields,
- smsTemplate2FA,
- rbaBrowserEmailTemplate,
- rbaCityEmailTemplate,
- rbaCountryEmailTemplate,
- rbaIpEmailTemplate
- ) {
- if (helper.checkJson(multiFactorAuthModelWithLockout)) {
- return Promise.reject(
- helper.getValidationMessage('multiFactorAuthModelWithLockout')
- );
- }
- if (helper.isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
- return Promise.reject(
- helper.getValidationMessage('secondFactorAuthenticationToken')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.secondFactorAuthenticationToken =
- secondFactorAuthenticationToken;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate2FA)) {
- queryParameters.smsTemplate2FA = smsTemplate2FA;
- }
- if (!helper.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
- queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCityEmailTemplate)) {
- queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
- queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaIpEmailTemplate)) {
- queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/login/2fa/verification/otp';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- multiFactorAuthModelWithLockout
- );
- };
-
- /**
- * This API is used to login via Multi-factor-authentication by passing the google authenticator code.
- * @param {googleAuthenticatorCode} The code generated by google authenticator app after scanning QR code
- * @param {secondFactorAuthenticationToken} SecondFactorAuthenticationToken
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {rbaBrowserEmailTemplate} RbaBrowserEmailTemplate
- * @param {rbaCityEmailTemplate} RbaCityEmailTemplate
- * @param {rbaCountryEmailTemplate} RbaCountryEmailTemplate
- * @param {rbaIpEmailTemplate} RbaIpEmailTemplate
- * @return Complete user UserProfile data
- *9.13
- */
-
- module.mfaValidateGoogleAuthCode = function (
- googleAuthenticatorCode,
- secondFactorAuthenticationToken,
- fields,
- rbaBrowserEmailTemplate,
- rbaCityEmailTemplate,
- rbaCountryEmailTemplate,
- rbaIpEmailTemplate
- ) {
- if (helper.isNullOrWhiteSpace(googleAuthenticatorCode)) {
- return Promise.reject(
- helper.getValidationMessage('googleAuthenticatorCode')
- );
- }
- if (helper.isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
- return Promise.reject(
- helper.getValidationMessage('secondFactorAuthenticationToken')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.secondFactorAuthenticationToken =
- secondFactorAuthenticationToken;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
- queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCityEmailTemplate)) {
- queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
- queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaIpEmailTemplate)) {
- queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
- }
-
- var bodyParameters = {};
- bodyParameters.googleAuthenticatorCode = googleAuthenticatorCode;
-
- var resourcePath =
- 'identity/v2/auth/login/2fa/verification/googleauthenticatorcode';
-
- return config.request('PUT', resourcePath, queryParameters, bodyParameters);
- };
-
- /**
- * This API is used to validate the backup code provided by the user and if valid, we return an access token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
- * @param {multiFactorAuthModelByBackupCode} Model Class containing Definition of payload for MultiFactorAuth By BackupCode API
- * @param {secondFactorAuthenticationToken} A Uniquely generated MFA identifier token after successful authentication
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {rbaBrowserEmailTemplate}
- * @param {rbaCityEmailTemplate}
- * @param {rbaCountryEmailTemplate}
- * @param {rbaIpEmailTemplate}
- * @return Complete user UserProfile data
- *9.14
- */
-
- module.mfaValidateBackupCode = function (
- multiFactorAuthModelByBackupCode,
- secondFactorAuthenticationToken,
- fields,
- rbaBrowserEmailTemplate,
- rbaCityEmailTemplate,
- rbaCountryEmailTemplate,
- rbaIpEmailTemplate
- ) {
- if (helper.checkJson(multiFactorAuthModelByBackupCode)) {
- return Promise.reject(
- helper.getValidationMessage('multiFactorAuthModelByBackupCode')
- );
- }
- if (helper.isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
- return Promise.reject(
- helper.getValidationMessage('secondFactorAuthenticationToken')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.secondFactorAuthenticationToken =
- secondFactorAuthenticationToken;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
- queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCityEmailTemplate)) {
- queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
- queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaIpEmailTemplate)) {
- queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/login/2fa/verification/backupcode';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- multiFactorAuthModelByBackupCode
- );
- };
-
- /**
- * This API is used to update (if configured) the phone number used for Multi-factor authentication by sending the verification OTP to the provided phone number
- * @param {phoneNo2FA} Phone Number For 2FA
- * @param {secondFactorAuthenticationToken} A Uniquely generated MFA identifier token after successful authentication
- * @param {smsTemplate2FA} SMS Template Name
- * @return Response containing Definition for Complete SMS data
- *9.16
- */
-
- module.mfaUpdatePhoneNumber = function (
- phoneNo2FA,
- secondFactorAuthenticationToken,
- smsTemplate2FA
- ) {
- if (helper.isNullOrWhiteSpace(phoneNo2FA)) {
- return Promise.reject(helper.getValidationMessage('phoneNo2FA'));
- }
- if (helper.isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
- return Promise.reject(
- helper.getValidationMessage('secondFactorAuthenticationToken')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.secondFactorAuthenticationToken =
- secondFactorAuthenticationToken;
- if (!helper.isNullOrWhiteSpace(smsTemplate2FA)) {
- queryParameters.smsTemplate2FA = smsTemplate2FA;
- }
-
- var bodyParameters = {};
- bodyParameters.phoneNo2FA = phoneNo2FA;
-
- var resourcePath = 'identity/v2/auth/login/2fa';
-
- return config.request('PUT', resourcePath, queryParameters, bodyParameters);
- };
-
- /**
- * This API is used to resending the verification OTP to the provided phone number
- * @param {secondFactorAuthenticationToken} A Uniquely generated MFA identifier token after successful authentication
- * @param {smsTemplate2FA} SMS Template Name
- * @return Response containing Definition for Complete SMS data
- *9.17
- */
-
- module.mfaResendOTP = function (
- secondFactorAuthenticationToken,
- smsTemplate2FA
- ) {
- if (helper.isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
- return Promise.reject(
- helper.getValidationMessage('secondFactorAuthenticationToken')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.secondFactorAuthenticationToken =
- secondFactorAuthenticationToken;
- if (!helper.isNullOrWhiteSpace(smsTemplate2FA)) {
- queryParameters.smsTemplate2FA = smsTemplate2FA;
- }
-
- var resourcePath = 'identity/v2/auth/login/2fa/resend';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * An API designed to send the MFA Email OTP to the email.
- * @param {emailIdModel} payload
- * @param {secondFactorAuthenticationToken} SecondFactorAuthenticationToken
- * @param {emailTemplate2FA} EmailTemplate2FA
- * @return Response containing Definition of Complete Validation data
- *9.18
- */
-
- module.mfaEmailOTP = function (
- emailIdModel,
- secondFactorAuthenticationToken,
- emailTemplate2FA
- ) {
- if (helper.checkJson(emailIdModel)) {
- return Promise.reject(helper.getValidationMessage('emailIdModel'));
- }
- if (helper.isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
- return Promise.reject(
- helper.getValidationMessage('secondFactorAuthenticationToken')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.secondFactorAuthenticationToken =
- secondFactorAuthenticationToken;
- if (!helper.isNullOrWhiteSpace(emailTemplate2FA)) {
- queryParameters.emailTemplate2FA = emailTemplate2FA;
- }
-
- var resourcePath = 'identity/v2/auth/login/2fa/otp/email';
-
- return config.request('POST', resourcePath, queryParameters, emailIdModel);
- };
-
- /**
- * This API is used to Verify MFA Email OTP by MFA Token
- * @param {multiFactorAuthModelByEmailOtp} payload
- * @param {secondFactorAuthenticationToken} SecondFactorAuthenticationToken
- * @param {rbaBrowserEmailTemplate} RbaBrowserEmailTemplate
- * @param {rbaCityEmailTemplate} RbaCityEmailTemplate
- * @param {rbaCountryEmailTemplate} RbaCountryEmailTemplate
- * @param {rbaIpEmailTemplate} RbaIpEmailTemplate
- * @return Response Containing Access Token and Complete Profile Data
- *9.25
- */
-
- module.mfaValidateEmailOtp = function (
- multiFactorAuthModelByEmailOtp,
- secondFactorAuthenticationToken,
- rbaBrowserEmailTemplate,
- rbaCityEmailTemplate,
- rbaCountryEmailTemplate,
- rbaIpEmailTemplate
- ) {
- if (helper.checkJson(multiFactorAuthModelByEmailOtp)) {
- return Promise.reject(
- helper.getValidationMessage('multiFactorAuthModelByEmailOtp')
- );
- }
- if (helper.isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
- return Promise.reject(
- helper.getValidationMessage('secondFactorAuthenticationToken')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.secondFactorAuthenticationToken =
- secondFactorAuthenticationToken;
- if (!helper.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
- queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCityEmailTemplate)) {
- queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
- queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaIpEmailTemplate)) {
- queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/login/2fa/verification/otp/email';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- multiFactorAuthModelByEmailOtp
- );
- };
-
- /**
- * This API is used to set the security questions on the profile with the MFA token when MFA flow is required.
- * @param {securityQuestionAnswerUpdateModel} payload
- * @param {secondFactorAuthenticationToken} SecondFactorAuthenticationToken
- * @return Response Containing Access Token and Complete Profile Data
- *9.26
- */
-
- module.mfaSecurityQuestionAnswer = function (
- securityQuestionAnswerUpdateModel,
- secondFactorAuthenticationToken
- ) {
- if (helper.checkJson(securityQuestionAnswerUpdateModel)) {
- return Promise.reject(
- helper.getValidationMessage('securityQuestionAnswerUpdateModel')
- );
- }
- if (helper.isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
- return Promise.reject(
- helper.getValidationMessage('secondFactorAuthenticationToken')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.secondFactorAuthenticationToken =
- secondFactorAuthenticationToken;
-
- var resourcePath = 'identity/v2/auth/login/2fa/securityquestionanswer';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- securityQuestionAnswerUpdateModel
- );
- };
-
- /**
- * This API is used to resending the verification OTP to the provided phone number
- * @param {securityQuestionAnswerUpdateModel} payload
- * @param {secondFactorAuthenticationToken} SecondFactorAuthenticationToken
- * @param {rbaBrowserEmailTemplate} RbaBrowserEmailTemplate
- * @param {rbaCityEmailTemplate} RbaCityEmailTemplate
- * @param {rbaCountryEmailTemplate} RbaCountryEmailTemplate
- * @param {rbaIpEmailTemplate} RbaIpEmailTemplate
- * @return Response Containing Access Token and Complete Profile Data
- *9.27
- */
-
- module.mfaSecurityQuestionAnswerVerification = function (
- securityQuestionAnswerUpdateModel,
- secondFactorAuthenticationToken,
- rbaBrowserEmailTemplate,
- rbaCityEmailTemplate,
- rbaCountryEmailTemplate,
- rbaIpEmailTemplate
- ) {
- if (helper.checkJson(securityQuestionAnswerUpdateModel)) {
- return Promise.reject(
- helper.getValidationMessage('securityQuestionAnswerUpdateModel')
- );
- }
- if (helper.isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
- return Promise.reject(
- helper.getValidationMessage('secondFactorAuthenticationToken')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.secondFactorAuthenticationToken =
- secondFactorAuthenticationToken;
- if (!helper.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
- queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCityEmailTemplate)) {
- queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
- queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaIpEmailTemplate)) {
- queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
- }
-
- var resourcePath =
- 'identity/v2/auth/login/2fa/verification/securityquestionanswer';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- securityQuestionAnswerUpdateModel
- );
- };
-
- /**
- * This API resets the SMS Authenticator configurations on a given account via the UID.
- * @param {otpauthenticator} Pass 'otpauthenticator' to remove SMS Authenticator
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Delete Request
- *18.21.1
- */
-
- module.mfaResetSMSAuthenticatorByUid = function (otpauthenticator, uid) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.uid = uid;
-
- var bodyParameters = {};
- bodyParameters.otpauthenticator = otpauthenticator;
-
- var resourcePath = 'identity/v2/manage/account/2fa/authenticator';
-
- return config.request(
- 'DELETE',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API resets the Google Authenticator configurations on a given account via the UID.
- * @param {googleauthenticator} boolean type value,Enable google Authenticator Code.
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Delete Request
- *18.21.2
- */
-
- module.mfaResetGoogleAuthenticatorByUid = function (
- googleauthenticator,
- uid
- ) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.uid = uid;
-
- var bodyParameters = {};
- bodyParameters.googleauthenticator = googleauthenticator;
-
- var resourcePath = 'identity/v2/manage/account/2fa/authenticator';
-
- return config.request(
- 'DELETE',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once.
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Complete Backup Code data
- *18.25
- */
-
- module.mfaBackupCodeByUid = function (uid) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.uid = uid;
-
- var resourcePath = 'identity/v2/manage/account/2fa/backupcode';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once.
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Complete Backup Code data
- *18.26
- */
-
- module.mfaResetBackupCodeByUid = function (uid) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.uid = uid;
-
- var resourcePath = 'identity/v2/manage/account/2fa/backupcode/reset';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user.
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Delete Request
- *18.42
- */
-
- module.mfaResetEmailOtpAuthenticatorByUid = function (uid) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.uid = uid;
-
- var resourcePath = 'identity/v2/manage/account/2fa/authenticator/otp/email';
-
- return config.request('DELETE', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to reset the Security Question Authenticator settings for an MFA-enabled user.
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Delete Request
- *18.43
- */
-
- module.mfaResetSecurityQuestionAuthenticatorByUid = function (uid) {
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
- queryParameters.uid = uid;
-
- var resourcePath =
- 'identity/v2/manage/account/2fa/authenticator/securityquestionanswer';
-
- return config.request('DELETE', resourcePath, queryParameters, null);
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/advanced/reAuthenticationApi.js b/loginradius-sdk/sdk/api/advanced/reAuthenticationApi.js
deleted file mode 100644
index 070ba83..0000000
--- a/loginradius-sdk/sdk/api/advanced/reAuthenticationApi.js
+++ /dev/null
@@ -1,425 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API is used to trigger the Multi-Factor Autentication workflow for the provided access token
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {smsTemplate2FA} SMS Template Name
- * @return Response containing Definition of Complete Multi-Factor Authentication Settings data
- *14.3
- */
-
- module.mfaReAuthenticate = function (accessToken, smsTemplate2FA) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(smsTemplate2FA)) {
- queryParameters.smsTemplate2FA = smsTemplate2FA;
- }
-
- var resourcePath = 'identity/v2/auth/account/reauth/2fa';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {reauthByOtpModel} Model Class containing Definition for MFA Reauthentication by OTP
- * @return Complete user Multi-Factor Authentication Token data
- *14.4
- */
-
- module.mfaReAuthenticateByOTP = function (accessToken, reauthByOtpModel) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(reauthByOtpModel)) {
- return Promise.reject(helper.getValidationMessage('reauthByOtpModel'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/account/reauth/2fa/otp';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- reauthByOtpModel
- );
- };
-
- /**
- * This API is used to re-authenticate by set of backup codes via access token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {reauthByBackupCodeModel} Model Class containing Definition for MFA Reauthentication by Backup code
- * @return Complete user Multi-Factor Authentication Token data
- *14.5
- */
-
- module.mfaReAuthenticateByBackupCode = function (
- accessToken,
- reauthByBackupCodeModel
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(reauthByBackupCodeModel)) {
- return Promise.reject(
- helper.getValidationMessage('reauthByBackupCodeModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/account/reauth/2fa/backupcode';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- reauthByBackupCodeModel
- );
- };
-
- /**
- * This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {reauthByGoogleAuthenticatorCodeModel} Model Class containing Definition for MFA Reauthentication by Google Authenticator
- * @return Complete user Multi-Factor Authentication Token data
- *14.6
- */
-
- module.mfaReAuthenticateByGoogleAuth = function (
- accessToken,
- reauthByGoogleAuthenticatorCodeModel
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(reauthByGoogleAuthenticatorCodeModel)) {
- return Promise.reject(
- helper.getValidationMessage('reauthByGoogleAuthenticatorCodeModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath =
- 'identity/v2/auth/account/reauth/2fa/googleauthenticatorcode';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- reauthByGoogleAuthenticatorCodeModel
- );
- };
-
- /**
- * This API is used to re-authenticate via Multi-factor-authentication by passing the password
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {passwordEventBasedAuthModelWithLockout} Model Class containing Definition of payload for PasswordEventBasedAuthModel with Lockout API
- * @param {smsTemplate2FA} SMS Template Name
- * @return Complete user Multi-Factor Authentication Token data
- *14.7
- */
-
- module.mfaReAuthenticateByPassword = function (
- accessToken,
- passwordEventBasedAuthModelWithLockout,
- smsTemplate2FA
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(passwordEventBasedAuthModelWithLockout)) {
- return Promise.reject(
- helper.getValidationMessage('passwordEventBasedAuthModelWithLockout')
- );
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(smsTemplate2FA)) {
- queryParameters.smsTemplate2FA = smsTemplate2FA;
- }
-
- var resourcePath = 'identity/v2/auth/account/reauth/password';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- passwordEventBasedAuthModelWithLockout
- );
- };
-
- /**
- * This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by OTP.
- * @param {eventBasedMultiFactorToken} Model Class containing Definition for SecondFactorValidationToken
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Complete Validation data
- *18.38
- */
-
- module.verifyMultiFactorOtpReauthentication = function (
- eventBasedMultiFactorToken,
- uid
- ) {
- if (helper.checkJson(eventBasedMultiFactorToken)) {
- return Promise.reject(
- helper.getValidationMessage('eventBasedMultiFactorToken')
- );
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/reauth/2fa';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- eventBasedMultiFactorToken
- );
- };
-
- /**
- * This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by password.
- * @param {eventBasedMultiFactorToken} Model Class containing Definition for SecondFactorValidationToken
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Complete Validation data
- *18.39
- */
-
- module.verifyMultiFactorPasswordReauthentication = function (
- eventBasedMultiFactorToken,
- uid
- ) {
- if (helper.checkJson(eventBasedMultiFactorToken)) {
- return Promise.reject(
- helper.getValidationMessage('eventBasedMultiFactorToken')
- );
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/reauth/password';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- eventBasedMultiFactorToken
- );
- };
-
- /**
- * This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by PIN.
- * @param {eventBasedMultiFactorToken} Model Class containing Definition for SecondFactorValidationToken
- * @param {uid} UID, the unified identifier for each user account
- * @return Response containing Definition of Complete Validation data
- *18.40
- */
-
- module.verifyMultiFactorPINReauthentication = function (
- eventBasedMultiFactorToken,
- uid
- ) {
- if (helper.checkJson(eventBasedMultiFactorToken)) {
- return Promise.reject(
- helper.getValidationMessage('eventBasedMultiFactorToken')
- );
- }
- if (helper.isNullOrWhiteSpace(uid)) {
- return Promise.reject(helper.getValidationMessage('uid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.apiSecret = config.apiSecret;
-
- var resourcePath = 'identity/v2/manage/account/' + uid + '/reauth/pin';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- eventBasedMultiFactorToken
- );
- };
-
- /**
- * This API is used to validate the triggered MFA authentication flow with a password.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {pINAuthEventBasedAuthModelWithLockout} Model Class containing Definition of payload for PIN
- * @param {smsTemplate2FA} SMS Template Name
- * @return Response containing Definition response of MFA reauthentication
- *42.13
- */
-
- module.verifyPINAuthentication = function (
- accessToken,
- pINAuthEventBasedAuthModelWithLockout,
- smsTemplate2FA
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(pINAuthEventBasedAuthModelWithLockout)) {
- return Promise.reject(
- helper.getValidationMessage('pINAuthEventBasedAuthModelWithLockout')
- );
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(smsTemplate2FA)) {
- queryParameters.smsTemplate2FA = smsTemplate2FA;
- }
-
- var resourcePath = 'identity/v2/auth/account/reauth/pin';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- pINAuthEventBasedAuthModelWithLockout
- );
- };
-
- /**
- * This API is used to validate the triggered MFA authentication flow with an Email OTP.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {reauthByEmailOtpModel} payload
- * @return Response containing Definition response of MFA reauthentication
- *42.14
- */
-
- module.reAuthValidateEmailOtp = function (
- accessToken,
- reauthByEmailOtpModel
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(reauthByEmailOtpModel)) {
- return Promise.reject(
- helper.getValidationMessage('reauthByEmailOtpModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/account/reauth/2fa/otp/email/verify';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- reauthByEmailOtpModel
- );
- };
-
- /**
- * This API is used to send the MFA Email OTP to the email for Re-authentication
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {emailId} EmailId
- * @param {emailTemplate2FA} EmailTemplate2FA
- * @return Response containing Definition of Complete Validation data
- *42.15
- */
-
- module.reAuthSendEmailOtp = function (
- accessToken,
- emailId,
- emailTemplate2FA
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(emailId)) {
- return Promise.reject(helper.getValidationMessage('emailId'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- queryParameters.emailId = emailId;
- if (!helper.isNullOrWhiteSpace(emailTemplate2FA)) {
- queryParameters.emailTemplate2FA = emailTemplate2FA;
- }
-
- var resourcePath = 'identity/v2/auth/account/reauth/2fa/otp/email';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to validate the triggered MFA re-authentication flow with security questions answers.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {securityQuestionAnswerUpdateModel} payload
- * @return Response containing Definition response of MFA reauthentication
- *42.16
- */
-
- module.reAuthBySecurityQuestion = function (
- accessToken,
- securityQuestionAnswerUpdateModel
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(securityQuestionAnswerUpdateModel)) {
- return Promise.reject(
- helper.getValidationMessage('securityQuestionAnswerUpdateModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath =
- 'identity/v2/auth/account/reauth/2fa/securityquestionanswer/verify';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- securityQuestionAnswerUpdateModel
- );
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/advanced/webHookApi.js b/loginradius-sdk/sdk/api/advanced/webHookApi.js
deleted file mode 100644
index 9b52b69..0000000
--- a/loginradius-sdk/sdk/api/advanced/webHookApi.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API is used to fatch all the subscribed URLs, for particular event
- * @param {event} Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject
- * @return Response Containing List of Webhhook Data
- *40.1
- */
-
- module.getWebHookSubscribedURLs = function (event) {
- if (helper.isNullOrWhiteSpace(event)) {
- return Promise.reject(helper.getValidationMessage('event'));
- }
- var queryParameters = {};
-
- queryParameters.apikey = config.apiKey;
- queryParameters.apisecret = config.apiSecret;
- queryParameters.event = event;
-
- var resourcePath = 'api/v2/webhook';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * API can be used to configure a WebHook on your LoginRadius site. Webhooks also work on subscribe and notification model, subscribe your hook and get a notification. Equivalent to RESThook but these provide security on basis of signature and RESThook work on unique URL. Following are the events that are allowed by LoginRadius to trigger a WebHook service call.
- * @param {webHookSubscribeModel} Model Class containing Definition of payload for Webhook Subscribe API
- * @return Response containing Definition of Complete Validation data
- *40.2
- */
-
- module.webHookSubscribe = function (webHookSubscribeModel) {
- if (helper.checkJson(webHookSubscribeModel)) {
- return Promise.reject(
- helper.getValidationMessage('webHookSubscribeModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apikey = config.apiKey;
- queryParameters.apisecret = config.apiSecret;
-
- var resourcePath = 'api/v2/webhook';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- webHookSubscribeModel
- );
- };
-
- /**
- * API can be used to test a subscribed WebHook.
- * @return Response containing Definition of Complete Validation data
- *40.3
- */
-
- module.webhookTest = function () {
- var queryParameters = {};
-
- queryParameters.apikey = config.apiKey;
- queryParameters.apisecret = config.apiSecret;
-
- var resourcePath = 'api/v2/webhook/test';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * API can be used to unsubscribe a WebHook configured on your LoginRadius site.
- * @param {webHookSubscribeModel} Model Class containing Definition of payload for Webhook Subscribe API
- * @return Response containing Definition of Delete Request
- *40.4
- */
-
- module.webHookUnsubscribe = function (webHookSubscribeModel) {
- if (helper.checkJson(webHookSubscribeModel)) {
- return Promise.reject(
- helper.getValidationMessage('webHookSubscribeModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apikey = config.apiKey;
- queryParameters.apisecret = config.apiSecret;
-
- var resourcePath = 'api/v2/webhook';
-
- return config.request(
- 'DELETE',
- resourcePath,
- queryParameters,
- webHookSubscribeModel
- );
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/authentication/authenticationApi.js b/loginradius-sdk/sdk/api/authentication/authenticationApi.js
deleted file mode 100644
index f49be30..0000000
--- a/loginradius-sdk/sdk/api/authentication/authenticationApi.js
+++ /dev/null
@@ -1,1300 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API is used to retrieve the list of questions that are configured on the respective LoginRadius site.
- * @param {email} Email of the user
- * @return Response containing Definition for Complete SecurityQuestions data
- *2.1
- */
-
- module.getSecurityQuestionsByEmail = function (email) {
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.email = email;
-
- var resourcePath = 'identity/v2/auth/securityquestion/email';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to retrieve the list of questions that are configured on the respective LoginRadius site.
- * @param {userName} UserName of the user
- * @return Response containing Definition for Complete SecurityQuestions data
- *2.2
- */
-
- module.getSecurityQuestionsByUserName = function (userName) {
- if (helper.isNullOrWhiteSpace(userName)) {
- return Promise.reject(helper.getValidationMessage('userName'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.userName = userName;
-
- var resourcePath = 'identity/v2/auth/securityquestion/username';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to retrieve the list of questions that are configured on the respective LoginRadius site.
- * @param {phone} The Registered Phone Number
- * @return Response containing Definition for Complete SecurityQuestions data
- *2.3
- */
-
- module.getSecurityQuestionsByPhone = function (phone) {
- if (helper.isNullOrWhiteSpace(phone)) {
- return Promise.reject(helper.getValidationMessage('phone'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.phone = phone;
-
- var resourcePath = 'identity/v2/auth/securityquestion/phone';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to retrieve the list of questions that are configured on the respective LoginRadius site.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @return Response containing Definition for Complete SecurityQuestions data
- *2.4
- */
-
- module.getSecurityQuestionsByAccessToken = function (accessToken) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/securityquestion/accesstoken';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This api validates access token, if valid then returns a response with its expiry otherwise error.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @return Response containing Definition of Complete Token data
- *4.1
- */
-
- module.authValidateAccessToken = function (accessToken) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/access_token/validate';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This api call invalidates the active access token or expires an access token's validity.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {preventRefresh} Boolean value that when set as true, in addition of the access token being invalidated, it will no longer have the capability of being refreshed.
- * @return Response containing Definition of Complete Validation data
- *4.2
- */
-
- module.authInValidateAccessToken = function (accessToken, preventRefresh) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (preventRefresh !== null) {
- queryParameters.preventRefresh = preventRefresh;
- }
-
- var resourcePath = 'identity/v2/auth/access_token/invalidate';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This api call provide the active access token Information
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @return Response containing Definition of Token Information
- *4.3
- */
-
- module.getAccessTokenInfo = function (accessToken) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/access_token';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API retrieves a copy of the user data based on the access token.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {emailTemplate}
- * @param {verificationUrl}
- * @param {welcomeEmailTemplate}
- * @return Response containing Definition for Complete profile data
- *5.2
- */
-
- module.getProfileByAccessToken = function (
- accessToken,
- fields,
- emailTemplate,
- verificationUrl,
- welcomeEmailTemplate
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/account';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API sends a welcome email
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {welcomeEmailTemplate} Name of the welcome email template
- * @return Response containing Definition of Complete Validation data
- *5.3
- */
-
- module.sendWelcomeEmail = function (accessToken, welcomeEmailTemplate) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/account/sendwelcomeemail';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to update the user's profile by passing the access token.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {userProfileUpdateModel} Model Class containing Definition of payload for User Profile update API
- * @param {emailTemplate} Email template name
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {nullSupport} Boolean, pass true if you wish to update any user profile field with a NULL value, You can get the details
- * @param {smsTemplate} SMS Template name
- * @param {verificationUrl} Email verification url
- * @return Response containing Definition of Complete Validation and UserProfile data
- *5.4
- */
-
- module.updateProfileByAccessToken = function (
- accessToken,
- userProfileUpdateModel,
- emailTemplate,
- fields,
- nullSupport,
- smsTemplate,
- verificationUrl
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(userProfileUpdateModel)) {
- return Promise.reject(
- helper.getValidationMessage('userProfileUpdateModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (nullSupport !== null) {
- queryParameters.nullSupport = nullSupport;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
-
- var resourcePath = 'identity/v2/auth/account';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- userProfileUpdateModel
- );
- };
-
- /**
- * This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {deleteUrl} Url of the site
- * @param {emailTemplate} Email template name
- * @return Response containing Definition of Delete Request
- *5.5
- */
-
- module.deleteAccountWithEmailConfirmation = function (
- accessToken,
- deleteUrl,
- emailTemplate
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(deleteUrl)) {
- queryParameters.deleteUrl = deleteUrl;
- }
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/account';
-
- return config.request('DELETE', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to delete an account by passing it a delete token.
- * @param {deletetoken} Delete token received in the email
- * @return Response containing Definition of Complete Validation data
- *5.6
- */
-
- module.deleteAccountByDeleteToken = function (deletetoken) {
- if (helper.isNullOrWhiteSpace(deletetoken)) {
- return Promise.reject(helper.getValidationMessage('deletetoken'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.deletetoken = deletetoken;
-
- var resourcePath = 'identity/v2/auth/account/delete';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to allow a customer with a valid access token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {unlockProfileModel} Payload containing Unlock Profile API
- * @return Response containing Definition of Complete Validation data
- *5.15
- */
-
- module.unlockAccountByToken = function (accessToken, unlockProfileModel) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(unlockProfileModel)) {
- return Promise.reject(helper.getValidationMessage('unlockProfileModel'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/account/unlock';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- unlockProfileModel
- );
- };
-
- /**
- * This API is used to get a user's profile using the clientGuid parameter if no callback feature enabled
- * @param {clientGuid} ClientGuid
- * @param {emailTemplate} EmailTemplate
- * @param {fields} Fields
- * @param {verificationUrl} VerificationUrl
- * @param {welcomeEmailTemplate} WelcomeEmailTemplate
- * @return Response containing User Profile Data and access token
- *5.16
- */
-
- module.getProfileByPing = function (
- clientGuid,
- emailTemplate,
- fields,
- verificationUrl,
- welcomeEmailTemplate
- ) {
- if (helper.isNullOrWhiteSpace(clientGuid)) {
- return Promise.reject(helper.getValidationMessage('clientGuid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.clientGuid = clientGuid;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/account/ping';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to check the email exists or not on your site.
- * @param {email} Email of the user
- * @return Response containing Definition Complete ExistResponse data
- *8.1
- */
-
- module.checkEmailAvailability = function (email) {
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.email = email;
-
- var resourcePath = 'identity/v2/auth/email';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to verify the email of user. Note: This API will only return the full profile if you have 'Enable auto login after email verification' set in your LoginRadius Admin Console's Email Workflow settings under 'Verification Email'.
- * @param {verificationToken} Verification token received in the email
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {url} Mention URL to log the main URL(Domain name) in Database.
- * @param {welcomeEmailTemplate} Name of the welcome email template
- * @return Response containing Definition of Complete Validation, UserProfile data and Access Token
- *8.2
- */
-
- module.verifyEmail = function (
- verificationToken,
- fields,
- url,
- welcomeEmailTemplate
- ) {
- if (helper.isNullOrWhiteSpace(verificationToken)) {
- return Promise.reject(helper.getValidationMessage('verificationToken'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.verificationToken = verificationToken;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(url)) {
- queryParameters.url = url;
- }
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/email';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to verify the email of user when the OTP Email verification flow is enabled, please note that you must contact LoginRadius to have this feature enabled.
- * @param {emailVerificationByOtpModel} Model Class containing Definition for EmailVerificationByOtpModel API
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {url} Mention URL to log the main URL(Domain name) in Database.
- * @param {welcomeEmailTemplate} Name of the welcome email template
- * @return Response containing Definition of Complete Validation, UserProfile data and Access Token
- *8.3
- */
-
- module.verifyEmailByOTP = function (
- emailVerificationByOtpModel,
- fields,
- url,
- welcomeEmailTemplate
- ) {
- if (helper.checkJson(emailVerificationByOtpModel)) {
- return Promise.reject(
- helper.getValidationMessage('emailVerificationByOtpModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(url)) {
- queryParameters.url = url;
- }
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/email';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- emailVerificationByOtpModel
- );
- };
-
- /**
- * This API is used to add additional emails to a user's account.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {email} user's email
- * @param {type} String to identify the type of parameter
- * @param {emailTemplate} Email template name
- * @param {verificationUrl} Email verification url
- * @return Response containing Definition of Complete Validation data
- *8.5
- */
-
- module.addEmail = function (
- accessToken,
- email,
- type,
- emailTemplate,
- verificationUrl
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- if (helper.isNullOrWhiteSpace(type)) {
- return Promise.reject(helper.getValidationMessage('type'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
-
- var bodyParameters = {};
- bodyParameters.email = email;
- bodyParameters.type = type;
-
- var resourcePath = 'identity/v2/auth/email';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API is used to remove additional emails from a user's account.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {email} user's email
- * @return Response containing Definition of Delete Request
- *8.6
- */
-
- module.removeEmail = function (accessToken, email) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var bodyParameters = {};
- bodyParameters.email = email;
-
- var resourcePath = 'identity/v2/auth/email';
-
- return config.request(
- 'DELETE',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API retrieves a copy of the user data based on the Email
- * @param {emailAuthenticationModel} Model Class containing Definition of payload for Email Authentication API
- * @param {emailTemplate} Email template name
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {loginUrl} Url where the user is logging from
- * @param {verificationUrl} Email verification url
- * @return Response containing User Profile Data and access token
- *9.2.1
- */
-
- module.loginByEmail = function (
- emailAuthenticationModel,
- emailTemplate,
- fields,
- loginUrl,
- verificationUrl
- ) {
- if (helper.checkJson(emailAuthenticationModel)) {
- return Promise.reject(
- helper.getValidationMessage('emailAuthenticationModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(loginUrl)) {
- queryParameters.loginUrl = loginUrl;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
-
- var resourcePath = 'identity/v2/auth/login';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- emailAuthenticationModel
- );
- };
-
- /**
- * This API retrieves a copy of the user data based on the Username
- * @param {userNameAuthenticationModel} Model Class containing Definition of payload for Username Authentication API
- * @param {emailTemplate} Email template name
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {loginUrl} Url where the user is logging from
- * @param {verificationUrl} Email verification url
- * @return Response containing User Profile Data and access token
- *9.2.2
- */
-
- module.loginByUserName = function (
- userNameAuthenticationModel,
- emailTemplate,
- fields,
- loginUrl,
- verificationUrl
- ) {
- if (helper.checkJson(userNameAuthenticationModel)) {
- return Promise.reject(
- helper.getValidationMessage('userNameAuthenticationModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(loginUrl)) {
- queryParameters.loginUrl = loginUrl;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
-
- var resourcePath = 'identity/v2/auth/login';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- userNameAuthenticationModel
- );
- };
-
- /**
- * This API is used to send the reset password url to a specified account. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username'
- * @param {email} user's email
- * @param {resetPasswordUrl} Url to which user should get re-directed to for resetting the password
- * @param {emailTemplate} Email template name
- * @return Response containing Definition of Complete Validation data
- *10.1
- */
-
- module.forgotPassword = function (email, resetPasswordUrl, emailTemplate) {
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- if (helper.isNullOrWhiteSpace(resetPasswordUrl)) {
- return Promise.reject(helper.getValidationMessage('resetPasswordUrl'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.resetPasswordUrl = resetPasswordUrl;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
-
- var bodyParameters = {};
- bodyParameters.email = email;
-
- var resourcePath = 'identity/v2/auth/password';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API is used to reset password for the specified account by security question
- * @param {resetPasswordBySecurityAnswerAndEmailModel} Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndEmail API
- * @return Response containing Definition of Validation data and access token
- *10.3.1
- */
-
- module.resetPasswordBySecurityAnswerAndEmail = function (
- resetPasswordBySecurityAnswerAndEmailModel
- ) {
- if (helper.checkJson(resetPasswordBySecurityAnswerAndEmailModel)) {
- return Promise.reject(
- helper.getValidationMessage(
- 'resetPasswordBySecurityAnswerAndEmailModel'
- )
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/password/securityanswer';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPasswordBySecurityAnswerAndEmailModel
- );
- };
-
- /**
- * This API is used to reset password for the specified account by security question
- * @param {resetPasswordBySecurityAnswerAndPhoneModel} Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndPhone API
- * @return Response containing Definition of Validation data and access token
- *10.3.2
- */
-
- module.resetPasswordBySecurityAnswerAndPhone = function (
- resetPasswordBySecurityAnswerAndPhoneModel
- ) {
- if (helper.checkJson(resetPasswordBySecurityAnswerAndPhoneModel)) {
- return Promise.reject(
- helper.getValidationMessage(
- 'resetPasswordBySecurityAnswerAndPhoneModel'
- )
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/password/securityanswer';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPasswordBySecurityAnswerAndPhoneModel
- );
- };
-
- /**
- * This API is used to reset password for the specified account by security question
- * @param {resetPasswordBySecurityAnswerAndUserNameModel} Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndUserName API
- * @return Response containing Definition of Validation data and access token
- *10.3.3
- */
-
- module.resetPasswordBySecurityAnswerAndUserName = function (
- resetPasswordBySecurityAnswerAndUserNameModel
- ) {
- if (helper.checkJson(resetPasswordBySecurityAnswerAndUserNameModel)) {
- return Promise.reject(
- helper.getValidationMessage(
- 'resetPasswordBySecurityAnswerAndUserNameModel'
- )
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/password/securityanswer';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPasswordBySecurityAnswerAndUserNameModel
- );
- };
-
- /**
- * This API is used to set a new password for the specified account.
- * @param {resetPasswordByResetTokenModel} Model Class containing Definition of payload for ResetToken API
- * @return Response containing Definition of Validation data and access token
- *10.7.1
- */
-
- module.resetPasswordByResetToken = function (resetPasswordByResetTokenModel) {
- if (helper.checkJson(resetPasswordByResetTokenModel)) {
- return Promise.reject(
- helper.getValidationMessage('resetPasswordByResetTokenModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/password/reset';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPasswordByResetTokenModel
- );
- };
-
- /**
- * This API is used to set a new password for the specified account.
- * @param {resetPasswordByEmailAndOtpModel} Model Class containing Definition of payload for ResetPasswordByEmailAndOtp API
- * @return Response containing Definition of Validation data and access token
- *10.7.2
- */
-
- module.resetPasswordByEmailOTP = function (resetPasswordByEmailAndOtpModel) {
- if (helper.checkJson(resetPasswordByEmailAndOtpModel)) {
- return Promise.reject(
- helper.getValidationMessage('resetPasswordByEmailAndOtpModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/password/reset';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPasswordByEmailAndOtpModel
- );
- };
-
- /**
- * This API is used to set a new password for the specified account if you are using the username as the unique identifier in your workflow
- * @param {resetPasswordByUserNameModel} Model Class containing Definition of payload for ResetPasswordByUserName API
- * @return Response containing Definition of Validation data and access token
- *10.7.3
- */
-
- module.resetPasswordByOTPAndUserName = function (
- resetPasswordByUserNameModel
- ) {
- if (helper.checkJson(resetPasswordByUserNameModel)) {
- return Promise.reject(
- helper.getValidationMessage('resetPasswordByUserNameModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/password/reset';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPasswordByUserNameModel
- );
- };
-
- /**
- * This API is used to change the accounts password based on the previous password
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {newPassword} New password
- * @param {oldPassword} User's current password
- * @return Response containing Definition of Complete Validation data
- *10.8
- */
-
- module.changePassword = function (accessToken, newPassword, oldPassword) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(newPassword)) {
- return Promise.reject(helper.getValidationMessage('newPassword'));
- }
- if (helper.isNullOrWhiteSpace(oldPassword)) {
- return Promise.reject(helper.getValidationMessage('oldPassword'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var bodyParameters = {};
- bodyParameters.newPassword = newPassword;
- bodyParameters.oldPassword = oldPassword;
-
- var resourcePath = 'identity/v2/auth/password/change';
-
- return config.request('PUT', resourcePath, queryParameters, bodyParameters);
- };
-
- /**
- * This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database.
- * @param {accessToken} Access_Token
- * @param {provider} Name of the provider
- * @param {providerId} Unique ID of the linked account
- * @return Response containing Definition of Delete Request
- *12.2
- */
-
- module.unlinkSocialIdentities = function (accessToken, provider, providerId) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(provider)) {
- return Promise.reject(helper.getValidationMessage('provider'));
- }
- if (helper.isNullOrWhiteSpace(providerId)) {
- return Promise.reject(helper.getValidationMessage('providerId'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var bodyParameters = {};
- bodyParameters.provider = provider;
- bodyParameters.providerId = providerId;
-
- var resourcePath = 'identity/v2/auth/socialidentity';
-
- return config.request(
- 'DELETE',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API is used to link up a social provider account with an existing LoginRadius account on the basis of access token and the social providers user access token.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {candidateToken} Access token of the account to be linked
- * @return Response containing Definition of Complete Validation data
- *12.4
- */
-
- module.linkSocialIdentities = function (accessToken, candidateToken) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(candidateToken)) {
- return Promise.reject(helper.getValidationMessage('candidateToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var bodyParameters = {};
- bodyParameters.candidateToken = candidateToken;
-
- var resourcePath = 'identity/v2/auth/socialidentity';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API is used to link up a social provider account with an existing LoginRadius account on the basis of ping and the social providers user access token.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {clientGuid} Unique ID generated by client
- * @return Response containing Definition of Complete Validation data
- *12.5
- */
-
- module.linkSocialIdentitiesByPing = function (accessToken, clientGuid) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(clientGuid)) {
- return Promise.reject(helper.getValidationMessage('clientGuid'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var bodyParameters = {};
- bodyParameters.clientGuid = clientGuid;
-
- var resourcePath = 'identity/v2/auth/socialidentity';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API is used to set or change UserName by access token.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {username} Username of the user
- * @return Response containing Definition of Complete Validation data
- *13.1
- */
-
- module.setOrChangeUserName = function (accessToken, username) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(username)) {
- return Promise.reject(helper.getValidationMessage('username'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var bodyParameters = {};
- bodyParameters.username = username;
-
- var resourcePath = 'identity/v2/auth/username';
-
- return config.request('PUT', resourcePath, queryParameters, bodyParameters);
- };
-
- /**
- * This API is used to check the UserName exists or not on your site.
- * @param {username} UserName of the user
- * @return Response containing Definition Complete ExistResponse data
- *13.2
- */
-
- module.checkUserNameAvailability = function (username) {
- if (helper.isNullOrWhiteSpace(username)) {
- return Promise.reject(helper.getValidationMessage('username'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.username = username;
-
- var resourcePath = 'identity/v2/auth/username';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to update the privacy policy stored in the user's profile by providing the access token of the user accepting the privacy policy
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Response containing Definition for Complete profile data
- *15.1
- */
-
- module.acceptPrivacyPolicy = function (accessToken, fields) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath = 'identity/v2/auth/privacypolicy/accept';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API will return all the accepted privacy policies for the user by providing the access token of that user.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @return Complete Policy History data
- *15.2
- */
-
- module.getPrivacyPolicyHistoryByAccessToken = function (accessToken) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/privacypolicy/history';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API creates a user in the database as well as sends a verification email to the user.
- * @param {authUserRegistrationModel} Model Class containing Definition of payload for Auth User Registration API
- * @param {sott} LoginRadius Secured One Time Token
- * @param {emailTemplate} Email template name
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {options} PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow)
- * @param {verificationUrl} Email verification url
- * @param {welcomeEmailTemplate} Name of the welcome email template
- * @return Response containing Definition of Complete Validation, UserProfile data and Access Token
- *17.1.1
- */
-
- module.userRegistrationByEmail = function (
- authUserRegistrationModel,
- sott,
- emailTemplate,
- fields,
- options,
- verificationUrl,
- welcomeEmailTemplate
- ) {
- if (helper.checkJson(authUserRegistrationModel)) {
- return Promise.reject(
- helper.getValidationMessage('authUserRegistrationModel')
- );
- }
- if (helper.isNullOrWhiteSpace(sott)) {
- return Promise.reject(helper.getValidationMessage('sott'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.sott = sott;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(options)) {
- queryParameters.options = options;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/register';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- authUserRegistrationModel
- );
- };
-
- /**
- * This API creates a user in the database as well as sends a verification email to the user.
- * @param {authUserRegistrationModelWithCaptcha} Model Class containing Definition of payload for Auth User Registration by Recaptcha API
- * @param {emailTemplate} Email template name
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {options} PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow)
- * @param {smsTemplate} SMS Template name
- * @param {verificationUrl} Email verification url
- * @param {welcomeEmailTemplate} Name of the welcome email template
- * @return Response containing Definition of Complete Validation, UserProfile data and Access Token
- *17.2
- */
-
- module.userRegistrationByCaptcha = function (
- authUserRegistrationModelWithCaptcha,
- emailTemplate,
- fields,
- options,
- smsTemplate,
- verificationUrl,
- welcomeEmailTemplate
- ) {
- if (helper.checkJson(authUserRegistrationModelWithCaptcha)) {
- return Promise.reject(
- helper.getValidationMessage('authUserRegistrationModelWithCaptcha')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(options)) {
- queryParameters.options = options;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/register/captcha';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- authUserRegistrationModelWithCaptcha
- );
- };
-
- /**
- * This API resends the verification email to the user.
- * @param {email} user's email
- * @param {emailTemplate} Email template name
- * @param {verificationUrl} Email verification url
- * @return Response containing Definition of Complete Validation data
- *17.3
- */
-
- module.authResendEmailVerification = function (
- email,
- emailTemplate,
- verificationUrl
- ) {
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
-
- var bodyParameters = {};
- bodyParameters.email = email;
-
- var resourcePath = 'identity/v2/auth/register';
-
- return config.request('PUT', resourcePath, queryParameters, bodyParameters);
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/authentication/oneTouchLoginApi.js b/loginradius-sdk/sdk/api/authentication/oneTouchLoginApi.js
deleted file mode 100644
index c2416a0..0000000
--- a/loginradius-sdk/sdk/api/authentication/oneTouchLoginApi.js
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API is used to send a link to a specified email for a frictionless login/registration
- * @param {oneTouchLoginByEmailModel} Model Class containing Definition of payload for OneTouchLogin By EmailModel API
- * @param {oneTouchLoginEmailTemplate} Name of the One Touch Login Email Template
- * @param {redirecturl} Url where the user will redirect after success authentication
- * @param {welcomeemailtemplate} Name of the welcome email template
- * @return Response containing Definition of Complete Validation data
- *1.2
- */
-
- module.oneTouchLoginByEmail = function (
- oneTouchLoginByEmailModel,
- oneTouchLoginEmailTemplate,
- redirecturl,
- welcomeemailtemplate
- ) {
- if (helper.checkJson(oneTouchLoginByEmailModel)) {
- return Promise.reject(
- helper.getValidationMessage('oneTouchLoginByEmailModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(oneTouchLoginEmailTemplate)) {
- queryParameters.oneTouchLoginEmailTemplate = oneTouchLoginEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(redirecturl)) {
- queryParameters.redirecturl = redirecturl;
- }
- if (!helper.isNullOrWhiteSpace(welcomeemailtemplate)) {
- queryParameters.welcomeemailtemplate = welcomeemailtemplate;
- }
-
- var resourcePath = 'identity/v2/auth/onetouchlogin/email';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- oneTouchLoginByEmailModel
- );
- };
-
- /**
- * This API is used to send one time password to a given phone number for a frictionless login/registration.
- * @param {oneTouchLoginByPhoneModel} Model Class containing Definition of payload for OneTouchLogin By PhoneModel API
- * @param {smsTemplate} SMS Template name
- * @return Response containing Definition of Complete Validation data
- *1.4
- */
-
- module.oneTouchLoginByPhone = function (
- oneTouchLoginByPhoneModel,
- smsTemplate
- ) {
- if (helper.checkJson(oneTouchLoginByPhoneModel)) {
- return Promise.reject(
- helper.getValidationMessage('oneTouchLoginByPhoneModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/onetouchlogin/phone';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- oneTouchLoginByPhoneModel
- );
- };
-
- /**
- * This API is used to verify the otp for One Touch Login.
- * @param {otp} The Verification Code
- * @param {phone} New Phone Number
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {smsTemplate} SMS Template name
- * @return Response Containing Access Token and Complete Profile Data
- *1.5
- */
-
- module.oneTouchLoginOTPVerification = function (
- otp,
- phone,
- fields,
- smsTemplate
- ) {
- if (helper.isNullOrWhiteSpace(otp)) {
- return Promise.reject(helper.getValidationMessage('otp'));
- }
- if (helper.isNullOrWhiteSpace(phone)) {
- return Promise.reject(helper.getValidationMessage('phone'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.otp = otp;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var bodyParameters = {};
- bodyParameters.phone = phone;
-
- var resourcePath = 'identity/v2/auth/onetouchlogin/phone/verify';
-
- return config.request('PUT', resourcePath, queryParameters, bodyParameters);
- };
-
- /**
- * This API verifies the provided token for One Touch Login
- * @param {verificationToken} Verification token received in the email
- * @param {welcomeEmailTemplate} Name of the welcome email template
- * @return Complete verified response data
- *8.4.2
- */
-
- module.oneTouchEmailVerification = function (
- verificationToken,
- welcomeEmailTemplate
- ) {
- if (helper.isNullOrWhiteSpace(verificationToken)) {
- return Promise.reject(helper.getValidationMessage('verificationToken'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.verificationToken = verificationToken;
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/email/onetouchlogin';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to check if the One Touch Login link has been clicked or not.
- * @param {clientGuid} Unique string used in the Smart Login request
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Response containing User Profile Data and access token
- *9.21.2
- */
-
- module.oneTouchLoginPing = function (clientGuid, fields) {
- if (helper.isNullOrWhiteSpace(clientGuid)) {
- return Promise.reject(helper.getValidationMessage('clientGuid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.clientGuid = clientGuid;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath = 'identity/v2/auth/login/smartlogin/ping';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/authentication/passwordLessLoginApi.js b/loginradius-sdk/sdk/api/authentication/passwordLessLoginApi.js
deleted file mode 100644
index 3bf69f7..0000000
--- a/loginradius-sdk/sdk/api/authentication/passwordLessLoginApi.js
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API verifies an account by OTP and allows the customer to login.
- * @param {passwordLessLoginOtpModel} Model Class containing Definition of payload for PasswordLessLoginOtpModel API
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {smsTemplate} SMS Template name
- * @return Response containing User Profile Data and access token
- *9.6
- */
-
- module.passwordlessLoginPhoneVerification = function (
- passwordLessLoginOtpModel,
- fields,
- smsTemplate
- ) {
- if (helper.checkJson(passwordLessLoginOtpModel)) {
- return Promise.reject(
- helper.getValidationMessage('passwordLessLoginOtpModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/login/passwordlesslogin/otp/verify';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- passwordLessLoginOtpModel
- );
- };
-
- /**
- * API can be used to send a One-time Passcode (OTP) provided that the account has a verified PhoneID
- * @param {phone} The Registered Phone Number
- * @param {smsTemplate} SMS Template name
- * @return Response Containing Definition of SMS Data
- *9.15
- */
-
- module.passwordlessLoginByPhone = function (phone, smsTemplate) {
- if (helper.isNullOrWhiteSpace(phone)) {
- return Promise.reject(helper.getValidationMessage('phone'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.phone = phone;
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/login/passwordlesslogin/otp';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to send a Passwordless Login verification link to the provided Email ID
- * @param {email} Email of the user
- * @param {passwordLessLoginTemplate} Passwordless Login Template Name
- * @param {verificationUrl} Email verification url
- * @return Response containing Definition of Complete Validation data
- *9.18.1
- */
-
- module.passwordlessLoginByEmail = function (
- email,
- passwordLessLoginTemplate,
- verificationUrl
- ) {
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.email = email;
- if (!helper.isNullOrWhiteSpace(passwordLessLoginTemplate)) {
- queryParameters.passwordLessLoginTemplate = passwordLessLoginTemplate;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
-
- var resourcePath = 'identity/v2/auth/login/passwordlesslogin/email';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to send a Passwordless Login Verification Link to a customer by providing their UserName
- * @param {username} UserName of the user
- * @param {passwordLessLoginTemplate} Passwordless Login Template Name
- * @param {verificationUrl} Email verification url
- * @return Response containing Definition of Complete Validation data
- *9.18.2
- */
-
- module.passwordlessLoginByUserName = function (
- username,
- passwordLessLoginTemplate,
- verificationUrl
- ) {
- if (helper.isNullOrWhiteSpace(username)) {
- return Promise.reject(helper.getValidationMessage('username'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.username = username;
- if (!helper.isNullOrWhiteSpace(passwordLessLoginTemplate)) {
- queryParameters.passwordLessLoginTemplate = passwordLessLoginTemplate;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
-
- var resourcePath = 'identity/v2/auth/login/passwordlesslogin/email';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to verify the Passwordless Login verification link. Note: If you are using Passwordless Login by Phone you will need to use the Passwordless Login Phone Verification API
- * @param {verificationToken} Verification token received in the email
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {welcomeEmailTemplate} Name of the welcome email template
- * @return Response containing User Profile Data and access token
- *9.19
- */
-
- module.passwordlessLoginVerification = function (
- verificationToken,
- fields,
- welcomeEmailTemplate
- ) {
- if (helper.isNullOrWhiteSpace(verificationToken)) {
- return Promise.reject(helper.getValidationMessage('verificationToken'));
- }
- var queryParameters = {};
-
- queryParameters.apikey = config.apiKey;
- queryParameters.verificationToken = verificationToken;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/login/passwordlesslogin/email/verify';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to verify the otp sent to the email when doing a passwordless login.
- * @param {passwordLessLoginByEmailAndOtpModel} payload
- * @param {fields} Fields
- * @return Response containing User Profile Data and access token
- *9.23
- */
-
- module.passwordlessLoginVerificationByEmailAndOTP = function (
- passwordLessLoginByEmailAndOtpModel,
- fields
- ) {
- if (helper.checkJson(passwordLessLoginByEmailAndOtpModel)) {
- return Promise.reject(
- helper.getValidationMessage('passwordLessLoginByEmailAndOtpModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath =
- 'identity/v2/auth/login/passwordlesslogin/email/verifyotp';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- passwordLessLoginByEmailAndOtpModel
- );
- };
-
- /**
- * This API is used to verify the otp sent to the email when doing a passwordless login.
- * @param {passwordLessLoginByUserNameAndOtpModel} payload
- * @param {fields} Fields
- * @return Response containing User Profile Data and access token
- *9.24
- */
-
- module.passwordlessLoginVerificationByUserNameAndOTP = function (
- passwordLessLoginByUserNameAndOtpModel,
- fields
- ) {
- if (helper.checkJson(passwordLessLoginByUserNameAndOtpModel)) {
- return Promise.reject(
- helper.getValidationMessage('passwordLessLoginByUserNameAndOtpModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath =
- 'identity/v2/auth/login/passwordlesslogin/username/verifyotp';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- passwordLessLoginByUserNameAndOtpModel
- );
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/authentication/phoneAuthenticationApi.js b/loginradius-sdk/sdk/api/authentication/phoneAuthenticationApi.js
deleted file mode 100644
index 8222bd7..0000000
--- a/loginradius-sdk/sdk/api/authentication/phoneAuthenticationApi.js
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API retrieves a copy of the user data based on the Phone
- * @param {phoneAuthenticationModel} Model Class containing Definition of payload for PhoneAuthenticationModel API
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {loginUrl} Url where the user is logging from
- * @param {smsTemplate} SMS Template name
- * @return Response containing User Profile Data and access token
- *9.2.3
- */
-
- module.loginByPhone = function (
- phoneAuthenticationModel,
- fields,
- loginUrl,
- smsTemplate
- ) {
- if (helper.checkJson(phoneAuthenticationModel)) {
- return Promise.reject(
- helper.getValidationMessage('phoneAuthenticationModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(loginUrl)) {
- queryParameters.loginUrl = loginUrl;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/login';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- phoneAuthenticationModel
- );
- };
-
- /**
- * This API is used to send the OTP to reset the account password.
- * @param {phone} New Phone Number
- * @param {smsTemplate} SMS Template name
- * @return Response Containing Validation Data and SMS Data
- *10.4
- */
-
- module.forgotPasswordByPhoneOTP = function (phone, smsTemplate) {
- if (helper.isNullOrWhiteSpace(phone)) {
- return Promise.reject(helper.getValidationMessage('phone'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var bodyParameters = {};
- bodyParameters.phone = phone;
-
- var resourcePath = 'identity/v2/auth/password/otp';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API is used to reset the password
- * @param {resetPasswordByOTPModel} Model Class containing Definition of payload for ResetPasswordByOTP API
- * @return Response containing Definition of Complete Validation data
- *10.5
- */
-
- module.resetPasswordByPhoneOTP = function (resetPasswordByOTPModel) {
- if (helper.checkJson(resetPasswordByOTPModel)) {
- return Promise.reject(
- helper.getValidationMessage('resetPasswordByOTPModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/password/otp';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPasswordByOTPModel
- );
- };
-
- /**
- * This API is used to validate the verification code sent to verify a user's phone number
- * @param {otp} The Verification Code
- * @param {phone} New Phone Number
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {smsTemplate} SMS Template name
- * @return Response containing User Profile Data and access token
- *11.1.1
- */
-
- module.phoneVerificationByOTP = function (otp, phone, fields, smsTemplate) {
- if (helper.isNullOrWhiteSpace(otp)) {
- return Promise.reject(helper.getValidationMessage('otp'));
- }
- if (helper.isNullOrWhiteSpace(phone)) {
- return Promise.reject(helper.getValidationMessage('phone'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.otp = otp;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var bodyParameters = {};
- bodyParameters.phone = phone;
-
- var resourcePath = 'identity/v2/auth/phone/otp';
-
- return config.request('PUT', resourcePath, queryParameters, bodyParameters);
- };
-
- /**
- * This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {otp} The Verification Code
- * @param {smsTemplate} SMS Template name
- * @return Response containing Definition of Complete Validation data
- *11.1.2
- */
-
- module.phoneVerificationOTPByAccessToken = function (
- accessToken,
- otp,
- smsTemplate
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(otp)) {
- return Promise.reject(helper.getValidationMessage('otp'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- queryParameters.otp = otp;
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/phone/otp';
-
- return config.request('PUT', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input
- * @param {phone} New Phone Number
- * @param {smsTemplate} SMS Template name
- * @return Response Containing Validation Data and SMS Data
- *11.2.1
- */
-
- module.phoneResendVerificationOTP = function (phone, smsTemplate) {
- if (helper.isNullOrWhiteSpace(phone)) {
- return Promise.reject(helper.getValidationMessage('phone'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var bodyParameters = {};
- bodyParameters.phone = phone;
-
- var resourcePath = 'identity/v2/auth/phone/otp';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API is used to resend a verification OTP to verify a user's Phone Number in cases in which an active token already exists
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {phone} New Phone Number
- * @param {smsTemplate} SMS Template name
- * @return Response Containing Validation Data and SMS Data
- *11.2.2
- */
-
- module.phoneResendVerificationOTPByToken = function (
- accessToken,
- phone,
- smsTemplate
- ) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(phone)) {
- return Promise.reject(helper.getValidationMessage('phone'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var bodyParameters = {};
- bodyParameters.phone = phone;
-
- var resourcePath = 'identity/v2/auth/phone/otp';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- bodyParameters
- );
- };
-
- /**
- * This API is used to update the login Phone Number of users
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {phone} New Phone Number
- * @param {smsTemplate} SMS Template name
- * @return Response Containing Validation Data and SMS Data
- *11.5
- */
-
- module.updatePhoneNumber = function (accessToken, phone, smsTemplate) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.isNullOrWhiteSpace(phone)) {
- return Promise.reject(helper.getValidationMessage('phone'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var bodyParameters = {};
- bodyParameters.phone = phone;
-
- var resourcePath = 'identity/v2/auth/phone';
-
- return config.request('PUT', resourcePath, queryParameters, bodyParameters);
- };
-
- /**
- * This API is used to check the Phone Number exists or not on your site.
- * @param {phone} The Registered Phone Number
- * @return Response containing Definition Complete ExistResponse data
- *11.6
- */
-
- module.checkPhoneNumberAvailability = function (phone) {
- if (helper.isNullOrWhiteSpace(phone)) {
- return Promise.reject(helper.getValidationMessage('phone'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.phone = phone;
-
- var resourcePath = 'identity/v2/auth/phone';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to delete the Phone ID on a user's account via the access token
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @return Response containing Definition of Delete Request
- *11.7
- */
-
- module.removePhoneIDByAccessToken = function (accessToken) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/phone';
-
- return config.request('DELETE', resourcePath, queryParameters, null);
- };
-
- /**
- * This API registers the new users into your Cloud Storage and triggers the phone verification process.
- * @param {authUserRegistrationModel} Model Class containing Definition of payload for Auth User Registration API
- * @param {sott} LoginRadius Secured One Time Token
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {options} PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow)
- * @param {smsTemplate} SMS Template name
- * @param {verificationUrl} Email verification url
- * @param {welcomeEmailTemplate} Name of the welcome email template
- * @return Response containing Definition of Complete Validation, UserProfile data and Access Token
- * @param {emailTemplate} Email Template Name
- *17.1.2
- */
-
- module.userRegistrationByPhone = function (
- authUserRegistrationModel,
- sott,
- fields,
- options,
- smsTemplate,
- verificationUrl,
- welcomeEmailTemplate,
- emailTemplate
- ) {
- if (helper.checkJson(authUserRegistrationModel)) {
- return Promise.reject(
- helper.getValidationMessage('authUserRegistrationModel')
- );
- }
- if (helper.isNullOrWhiteSpace(sott)) {
- return Promise.reject(helper.getValidationMessage('sott'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.sott = sott;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(options)) {
- queryParameters.options = options;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/register';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- authUserRegistrationModel
- );
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/authentication/pinAuthenticationApi.js b/loginradius-sdk/sdk/api/authentication/pinAuthenticationApi.js
deleted file mode 100644
index 5337d48..0000000
--- a/loginradius-sdk/sdk/api/authentication/pinAuthenticationApi.js
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API is used to login a user by pin and session token.
- * @param {loginByPINModel} Model Class containing Definition of payload for LoginByPin API
- * @param {sessionToken} Session Token of user
- * @return Response containing User Profile Data and access token
- *9.22
- */
-
- module.pinLogin = function (loginByPINModel, sessionToken) {
- if (helper.checkJson(loginByPINModel)) {
- return Promise.reject(helper.getValidationMessage('loginByPINModel'));
- }
- if (helper.isNullOrWhiteSpace(sessionToken)) {
- return Promise.reject(helper.getValidationMessage('sessionToken'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.session_token = sessionToken;
-
- var resourcePath = 'identity/v2/auth/login/pin';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- loginByPINModel
- );
- };
-
- /**
- * This API sends the reset pin email to specified email address.
- * @param {forgotPINLinkByEmailModel} Model Class containing Definition for Forgot Pin Link By Email API
- * @param {emailTemplate} Email template name
- * @param {resetPINUrl} Reset PIN Url
- * @return Response containing Definition of Complete Validation data
- *42.1
- */
-
- module.sendForgotPINEmailByEmail = function (
- forgotPINLinkByEmailModel,
- emailTemplate,
- resetPINUrl
- ) {
- if (helper.checkJson(forgotPINLinkByEmailModel)) {
- return Promise.reject(
- helper.getValidationMessage('forgotPINLinkByEmailModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(resetPINUrl)) {
- queryParameters.resetPINUrl = resetPINUrl;
- }
-
- var resourcePath = 'identity/v2/auth/pin/forgot/email';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- forgotPINLinkByEmailModel
- );
- };
-
- /**
- * This API sends the reset pin email using username.
- * @param {forgotPINLinkByUserNameModel} Model Class containing Definition for Forgot Pin Link By UserName API
- * @param {emailTemplate} Email template name
- * @param {resetPINUrl} Reset PIN Url
- * @return Response containing Definition of Complete Validation data
- *42.2
- */
-
- module.sendForgotPINEmailByUsername = function (
- forgotPINLinkByUserNameModel,
- emailTemplate,
- resetPINUrl
- ) {
- if (helper.checkJson(forgotPINLinkByUserNameModel)) {
- return Promise.reject(
- helper.getValidationMessage('forgotPINLinkByUserNameModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(resetPINUrl)) {
- queryParameters.resetPINUrl = resetPINUrl;
- }
-
- var resourcePath = 'identity/v2/auth/pin/forgot/username';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- forgotPINLinkByUserNameModel
- );
- };
-
- /**
- * This API is used to reset pin using reset token.
- * @param {resetPINByResetToken} Model Class containing Definition of payload for Reset Pin By Reset Token API
- * @return Response containing Definition of Complete Validation data
- *42.3
- */
-
- module.resetPINByResetToken = function (resetPINByResetToken) {
- if (helper.checkJson(resetPINByResetToken)) {
- return Promise.reject(
- helper.getValidationMessage('resetPINByResetToken')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/pin/reset/token';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPINByResetToken
- );
- };
-
- /**
- * This API is used to reset pin using security question answer and email.
- * @param {resetPINBySecurityQuestionAnswerAndEmailModel} Model Class containing Definition of payload for Reset Pin By Security Question and Email API
- * @return Response containing Definition of Complete Validation data
- *42.4
- */
-
- module.resetPINByEmailAndSecurityAnswer = function (
- resetPINBySecurityQuestionAnswerAndEmailModel
- ) {
- if (helper.checkJson(resetPINBySecurityQuestionAnswerAndEmailModel)) {
- return Promise.reject(
- helper.getValidationMessage(
- 'resetPINBySecurityQuestionAnswerAndEmailModel'
- )
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/pin/reset/securityanswer/email';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPINBySecurityQuestionAnswerAndEmailModel
- );
- };
-
- /**
- * This API is used to reset pin using security question answer and username.
- * @param {resetPINBySecurityQuestionAnswerAndUsernameModel} Model Class containing Definition of payload for Reset Pin By Security Question and UserName API
- * @return Response containing Definition of Complete Validation data
- *42.5
- */
-
- module.resetPINByUsernameAndSecurityAnswer = function (
- resetPINBySecurityQuestionAnswerAndUsernameModel
- ) {
- if (helper.checkJson(resetPINBySecurityQuestionAnswerAndUsernameModel)) {
- return Promise.reject(
- helper.getValidationMessage(
- 'resetPINBySecurityQuestionAnswerAndUsernameModel'
- )
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/pin/reset/securityanswer/username';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPINBySecurityQuestionAnswerAndUsernameModel
- );
- };
-
- /**
- * This API is used to reset pin using security question answer and phone.
- * @param {resetPINBySecurityQuestionAnswerAndPhoneModel} Model Class containing Definition of payload for Reset Pin By Security Question and Phone API
- * @return Response containing Definition of Complete Validation data
- *42.6
- */
-
- module.resetPINByPhoneAndSecurityAnswer = function (
- resetPINBySecurityQuestionAnswerAndPhoneModel
- ) {
- if (helper.checkJson(resetPINBySecurityQuestionAnswerAndPhoneModel)) {
- return Promise.reject(
- helper.getValidationMessage(
- 'resetPINBySecurityQuestionAnswerAndPhoneModel'
- )
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/pin/reset/securityanswer/phone';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPINBySecurityQuestionAnswerAndPhoneModel
- );
- };
-
- /**
- * This API sends the OTP to specified phone number
- * @param {forgotPINOtpByPhoneModel} Model Class containing Definition for Forgot Pin Otp By Phone API
- * @param {smsTemplate}
- * @return Response Containing Validation Data and SMS Data
- *42.7
- */
-
- module.sendForgotPINSMSByPhone = function (
- forgotPINOtpByPhoneModel,
- smsTemplate
- ) {
- if (helper.checkJson(forgotPINOtpByPhoneModel)) {
- return Promise.reject(
- helper.getValidationMessage('forgotPINOtpByPhoneModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/pin/forgot/otp';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- forgotPINOtpByPhoneModel
- );
- };
-
- /**
- * This API is used to change a user's PIN using access token.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {changePINModel} Model Class containing Definition for change PIN Property
- * @return Response containing Definition of Complete Validation data
- *42.8
- */
-
- module.changePINByAccessToken = function (accessToken, changePINModel) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- if (helper.checkJson(changePINModel)) {
- return Promise.reject(helper.getValidationMessage('changePINModel'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/pin/change';
-
- return config.request('PUT', resourcePath, queryParameters, changePINModel);
- };
-
- /**
- * This API is used to reset pin using phoneId and OTP.
- * @param {resetPINByPhoneAndOTPModel} Model Class containing Definition of payload for Reset Pin By Phone and Otp API
- * @return Response containing Definition of Complete Validation data
- *42.9
- */
-
- module.resetPINByPhoneAndOtp = function (resetPINByPhoneAndOTPModel) {
- if (helper.checkJson(resetPINByPhoneAndOTPModel)) {
- return Promise.reject(
- helper.getValidationMessage('resetPINByPhoneAndOTPModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/pin/reset/otp/phone';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPINByPhoneAndOTPModel
- );
- };
-
- /**
- * This API is used to reset pin using email and OTP.
- * @param {resetPINByEmailAndOtpModel} Model Class containing Definition of payload for Reset Pin By Email and Otp API
- * @return Response containing Definition of Complete Validation data
- *42.10
- */
-
- module.resetPINByEmailAndOtp = function (resetPINByEmailAndOtpModel) {
- if (helper.checkJson(resetPINByEmailAndOtpModel)) {
- return Promise.reject(
- helper.getValidationMessage('resetPINByEmailAndOtpModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/pin/reset/otp/email';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPINByEmailAndOtpModel
- );
- };
-
- /**
- * This API is used to reset pin using username and OTP.
- * @param {resetPINByUsernameAndOtpModel} Model Class containing Definition of payload for Reset Pin By Username and Otp API
- * @return Response containing Definition of Complete Validation data
- *42.11
- */
-
- module.resetPINByUsernameAndOtp = function (resetPINByUsernameAndOtpModel) {
- if (helper.checkJson(resetPINByUsernameAndOtpModel)) {
- return Promise.reject(
- helper.getValidationMessage('resetPINByUsernameAndOtpModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
-
- var resourcePath = 'identity/v2/auth/pin/reset/otp/username';
-
- return config.request(
- 'PUT',
- resourcePath,
- queryParameters,
- resetPINByUsernameAndOtpModel
- );
- };
-
- /**
- * This API is used to change a user's PIN using Pin Auth token.
- * @param {pINRequiredModel} Model Class containing Definition for PIN
- * @param {pinAuthToken} Pin Auth Token
- * @return Response containing User Profile Data and access token
- *42.12
- */
-
- module.setPINByPinAuthToken = function (pINRequiredModel, pinAuthToken) {
- if (helper.checkJson(pINRequiredModel)) {
- return Promise.reject(helper.getValidationMessage('pINRequiredModel'));
- }
- if (helper.isNullOrWhiteSpace(pinAuthToken)) {
- return Promise.reject(helper.getValidationMessage('pinAuthToken'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.pinAuthToken = pinAuthToken;
-
- var resourcePath = 'identity/v2/auth/pin/set/pinauthtoken';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- pINRequiredModel
- );
- };
-
- /**
- * This API is used to invalidate pin session token.
- * @param {sessionToken} Session Token of user
- * @return Response containing Definition of Complete Validation data
- *44.1
- */
-
- module.inValidatePinSessionToken = function (sessionToken) {
- if (helper.isNullOrWhiteSpace(sessionToken)) {
- return Promise.reject(helper.getValidationMessage('sessionToken'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.session_token = sessionToken;
-
- var resourcePath = 'identity/v2/auth/session_token/invalidate';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/authentication/riskBasedAuthenticationApi.js b/loginradius-sdk/sdk/api/authentication/riskBasedAuthenticationApi.js
deleted file mode 100644
index 24ccbc1..0000000
--- a/loginradius-sdk/sdk/api/authentication/riskBasedAuthenticationApi.js
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API retrieves a copy of the user data based on the Email
- * @param {emailAuthenticationModel} Model Class containing Definition of payload for Email Authentication API
- * @param {emailTemplate} Email template name
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {loginUrl} Url where the user is logging from
- * @param {passwordDelegation} Password Delegation Allows you to use a third-party service to store your passwords rather than LoginRadius Cloud storage.
- * @param {passwordDelegationApp} RiskBased Authentication Password Delegation App
- * @param {rbaBrowserEmailTemplate} Risk Based Authentication Browser EmailTemplate
- * @param {rbaBrowserSmsTemplate} Risk Based Authentication Browser Sms Template
- * @param {rbaCityEmailTemplate} Risk Based Authentication City Email Template
- * @param {rbaCitySmsTemplate} Risk Based Authentication City SmsTemplate
- * @param {rbaCountryEmailTemplate} Risk Based Authentication Country EmailTemplate
- * @param {rbaCountrySmsTemplate} Risk Based Authentication Country SmsTemplate
- * @param {rbaIpEmailTemplate} Risk Based Authentication Ip EmailTemplate
- * @param {rbaIpSmsTemplate} Risk Based Authentication Ip SmsTemplate
- * @param {rbaOneclickEmailTemplate} Risk Based Authentication Oneclick EmailTemplate
- * @param {rbaOTPSmsTemplate} Risk Based Authentication Oneclick EmailTemplate
- * @param {smsTemplate} SMS Template name
- * @param {verificationUrl} Email verification url
- * @return Response containing User Profile Data and access token
- *9.2.4
- */
-
- module.rbaLoginByEmail = function (
- emailAuthenticationModel,
- emailTemplate,
- fields,
- loginUrl,
- passwordDelegation,
- passwordDelegationApp,
- rbaBrowserEmailTemplate,
- rbaBrowserSmsTemplate,
- rbaCityEmailTemplate,
- rbaCitySmsTemplate,
- rbaCountryEmailTemplate,
- rbaCountrySmsTemplate,
- rbaIpEmailTemplate,
- rbaIpSmsTemplate,
- rbaOneclickEmailTemplate,
- rbaOTPSmsTemplate,
- smsTemplate,
- verificationUrl
- ) {
- if (helper.checkJson(emailAuthenticationModel)) {
- return Promise.reject(
- helper.getValidationMessage('emailAuthenticationModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(loginUrl)) {
- queryParameters.loginUrl = loginUrl;
- }
- if (passwordDelegation !== null) {
- queryParameters.passwordDelegation = passwordDelegation;
- }
- if (!helper.isNullOrWhiteSpace(passwordDelegationApp)) {
- queryParameters.passwordDelegationApp = passwordDelegationApp;
- }
- if (!helper.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
- queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaBrowserSmsTemplate)) {
- queryParameters.rbaBrowserSmsTemplate = rbaBrowserSmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCityEmailTemplate)) {
- queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCitySmsTemplate)) {
- queryParameters.rbaCitySmsTemplate = rbaCitySmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
- queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCountrySmsTemplate)) {
- queryParameters.rbaCountrySmsTemplate = rbaCountrySmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaIpEmailTemplate)) {
- queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaIpSmsTemplate)) {
- queryParameters.rbaIpSmsTemplate = rbaIpSmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaOneclickEmailTemplate)) {
- queryParameters.rbaOneclickEmailTemplate = rbaOneclickEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaOTPSmsTemplate)) {
- queryParameters.rbaOTPSmsTemplate = rbaOTPSmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
-
- var resourcePath = 'identity/v2/auth/login';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- emailAuthenticationModel
- );
- };
-
- /**
- * This API retrieves a copy of the user data based on the Username
- * @param {userNameAuthenticationModel} Model Class containing Definition of payload for Username Authentication API
- * @param {emailTemplate} Email template name
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {loginUrl} Url where the user is logging from
- * @param {passwordDelegation} Password Delegation Allows you to use a third-party service to store your passwords rather than LoginRadius Cloud storage.
- * @param {passwordDelegationApp} RiskBased Authentication Password Delegation App
- * @param {rbaBrowserEmailTemplate} Risk Based Authentication Browser EmailTemplate
- * @param {rbaBrowserSmsTemplate} Risk Based Authentication Browser Sms Template
- * @param {rbaCityEmailTemplate} Risk Based Authentication City Email Template
- * @param {rbaCitySmsTemplate} Risk Based Authentication City SmsTemplate
- * @param {rbaCountryEmailTemplate} Risk Based Authentication Country EmailTemplate
- * @param {rbaCountrySmsTemplate} Risk Based Authentication Country SmsTemplate
- * @param {rbaIpEmailTemplate} Risk Based Authentication Ip EmailTemplate
- * @param {rbaIpSmsTemplate} Risk Based Authentication Ip SmsTemplate
- * @param {rbaOneclickEmailTemplate} Risk Based Authentication Oneclick EmailTemplate
- * @param {rbaOTPSmsTemplate} Risk Based Authentication OTPSmsTemplate
- * @param {smsTemplate} SMS Template name
- * @param {verificationUrl} Email verification url
- * @return Response containing User Profile Data and access token
- *9.2.5
- */
-
- module.rbaLoginByUserName = function (
- userNameAuthenticationModel,
- emailTemplate,
- fields,
- loginUrl,
- passwordDelegation,
- passwordDelegationApp,
- rbaBrowserEmailTemplate,
- rbaBrowserSmsTemplate,
- rbaCityEmailTemplate,
- rbaCitySmsTemplate,
- rbaCountryEmailTemplate,
- rbaCountrySmsTemplate,
- rbaIpEmailTemplate,
- rbaIpSmsTemplate,
- rbaOneclickEmailTemplate,
- rbaOTPSmsTemplate,
- smsTemplate,
- verificationUrl
- ) {
- if (helper.checkJson(userNameAuthenticationModel)) {
- return Promise.reject(
- helper.getValidationMessage('userNameAuthenticationModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(loginUrl)) {
- queryParameters.loginUrl = loginUrl;
- }
- if (passwordDelegation !== null) {
- queryParameters.passwordDelegation = passwordDelegation;
- }
- if (!helper.isNullOrWhiteSpace(passwordDelegationApp)) {
- queryParameters.passwordDelegationApp = passwordDelegationApp;
- }
- if (!helper.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
- queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaBrowserSmsTemplate)) {
- queryParameters.rbaBrowserSmsTemplate = rbaBrowserSmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCityEmailTemplate)) {
- queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCitySmsTemplate)) {
- queryParameters.rbaCitySmsTemplate = rbaCitySmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
- queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCountrySmsTemplate)) {
- queryParameters.rbaCountrySmsTemplate = rbaCountrySmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaIpEmailTemplate)) {
- queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaIpSmsTemplate)) {
- queryParameters.rbaIpSmsTemplate = rbaIpSmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaOneclickEmailTemplate)) {
- queryParameters.rbaOneclickEmailTemplate = rbaOneclickEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaOTPSmsTemplate)) {
- queryParameters.rbaOTPSmsTemplate = rbaOTPSmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
-
- var resourcePath = 'identity/v2/auth/login';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- userNameAuthenticationModel
- );
- };
-
- /**
- * This API retrieves a copy of the user data based on the Phone
- * @param {phoneAuthenticationModel} Model Class containing Definition of payload for PhoneAuthenticationModel API
- * @param {emailTemplate} Email template name
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @param {loginUrl} Url where the user is logging from
- * @param {passwordDelegation} Password Delegation Allows you to use a third-party service to store your passwords rather than LoginRadius Cloud storage.
- * @param {passwordDelegationApp} RiskBased Authentication Password Delegation App
- * @param {rbaBrowserEmailTemplate} Risk Based Authentication Browser EmailTemplate
- * @param {rbaBrowserSmsTemplate} Risk Based Authentication Browser Sms Template
- * @param {rbaCityEmailTemplate} Risk Based Authentication City Email Template
- * @param {rbaCitySmsTemplate} Risk Based Authentication City SmsTemplate
- * @param {rbaCountryEmailTemplate} Risk Based Authentication Country EmailTemplate
- * @param {rbaCountrySmsTemplate} Risk Based Authentication Country SmsTemplate
- * @param {rbaIpEmailTemplate} Risk Based Authentication Ip EmailTemplate
- * @param {rbaIpSmsTemplate} Risk Based Authentication Ip SmsTemplate
- * @param {rbaOneclickEmailTemplate} Risk Based Authentication Oneclick EmailTemplate
- * @param {rbaOTPSmsTemplate} Risk Based Authentication OTPSmsTemplate
- * @param {smsTemplate} SMS Template name
- * @param {verificationUrl} Email verification url
- * @return Response containing User Profile Data and access token
- *9.2.6
- */
-
- module.rbaLoginByPhone = function (
- phoneAuthenticationModel,
- emailTemplate,
- fields,
- loginUrl,
- passwordDelegation,
- passwordDelegationApp,
- rbaBrowserEmailTemplate,
- rbaBrowserSmsTemplate,
- rbaCityEmailTemplate,
- rbaCitySmsTemplate,
- rbaCountryEmailTemplate,
- rbaCountrySmsTemplate,
- rbaIpEmailTemplate,
- rbaIpSmsTemplate,
- rbaOneclickEmailTemplate,
- rbaOTPSmsTemplate,
- smsTemplate,
- verificationUrl
- ) {
- if (helper.checkJson(phoneAuthenticationModel)) {
- return Promise.reject(
- helper.getValidationMessage('phoneAuthenticationModel')
- );
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- if (!helper.isNullOrWhiteSpace(emailTemplate)) {
- queryParameters.emailTemplate = emailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
- if (!helper.isNullOrWhiteSpace(loginUrl)) {
- queryParameters.loginUrl = loginUrl;
- }
- if (passwordDelegation !== null) {
- queryParameters.passwordDelegation = passwordDelegation;
- }
- if (!helper.isNullOrWhiteSpace(passwordDelegationApp)) {
- queryParameters.passwordDelegationApp = passwordDelegationApp;
- }
- if (!helper.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
- queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaBrowserSmsTemplate)) {
- queryParameters.rbaBrowserSmsTemplate = rbaBrowserSmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCityEmailTemplate)) {
- queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCitySmsTemplate)) {
- queryParameters.rbaCitySmsTemplate = rbaCitySmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
- queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaCountrySmsTemplate)) {
- queryParameters.rbaCountrySmsTemplate = rbaCountrySmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaIpEmailTemplate)) {
- queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaIpSmsTemplate)) {
- queryParameters.rbaIpSmsTemplate = rbaIpSmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaOneclickEmailTemplate)) {
- queryParameters.rbaOneclickEmailTemplate = rbaOneclickEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(rbaOTPSmsTemplate)) {
- queryParameters.rbaOTPSmsTemplate = rbaOTPSmsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(smsTemplate)) {
- queryParameters.smsTemplate = smsTemplate;
- }
- if (!helper.isNullOrWhiteSpace(verificationUrl)) {
- queryParameters.verificationUrl = verificationUrl;
- }
-
- var resourcePath = 'identity/v2/auth/login';
-
- return config.request(
- 'POST',
- resourcePath,
- queryParameters,
- phoneAuthenticationModel
- );
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/authentication/smartLoginApi.js b/loginradius-sdk/sdk/api/authentication/smartLoginApi.js
deleted file mode 100644
index 8d69ea3..0000000
--- a/loginradius-sdk/sdk/api/authentication/smartLoginApi.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API verifies the provided token for Smart Login
- * @param {verificationToken} Verification token received in the email
- * @param {welcomeEmailTemplate} Name of the welcome email template
- * @return Complete verified response data
- *8.4.1
- */
-
- module.smartLoginTokenVerification = function (
- verificationToken,
- welcomeEmailTemplate
- ) {
- if (helper.isNullOrWhiteSpace(verificationToken)) {
- return Promise.reject(helper.getValidationMessage('verificationToken'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.verificationToken = verificationToken;
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/email/smartlogin';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API sends a Smart Login link to the user's Email Id.
- * @param {clientGuid} Unique string used in the Smart Login request
- * @param {email} Email of the user
- * @param {redirectUrl} Url where the user will redirect after success authentication
- * @param {smartLoginEmailTemplate} Email template for Smart Login link
- * @param {welcomeEmailTemplate} Name of the welcome email template
- * @return Response containing Definition of Complete Validation data
- *9.17.1
- */
-
- module.smartLoginByEmail = function (
- clientGuid,
- email,
- redirectUrl,
- smartLoginEmailTemplate,
- welcomeEmailTemplate
- ) {
- if (helper.isNullOrWhiteSpace(clientGuid)) {
- return Promise.reject(helper.getValidationMessage('clientGuid'));
- }
- if (helper.isNullOrWhiteSpace(email)) {
- return Promise.reject(helper.getValidationMessage('email'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.clientGuid = clientGuid;
- queryParameters.email = email;
- if (!helper.isNullOrWhiteSpace(redirectUrl)) {
- queryParameters.redirectUrl = redirectUrl;
- }
- if (!helper.isNullOrWhiteSpace(smartLoginEmailTemplate)) {
- queryParameters.smartLoginEmailTemplate = smartLoginEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/login/smartlogin';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API sends a Smart Login link to the user's Email Id.
- * @param {clientGuid} Unique string used in the Smart Login request
- * @param {username} UserName of the user
- * @param {redirectUrl} Url where the user will redirect after success authentication
- * @param {smartLoginEmailTemplate} Email template for Smart Login link
- * @param {welcomeEmailTemplate} Name of the welcome email template
- * @return Response containing Definition of Complete Validation data
- *9.17.2
- */
-
- module.smartLoginByUserName = function (
- clientGuid,
- username,
- redirectUrl,
- smartLoginEmailTemplate,
- welcomeEmailTemplate
- ) {
- if (helper.isNullOrWhiteSpace(clientGuid)) {
- return Promise.reject(helper.getValidationMessage('clientGuid'));
- }
- if (helper.isNullOrWhiteSpace(username)) {
- return Promise.reject(helper.getValidationMessage('username'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.clientGuid = clientGuid;
- queryParameters.username = username;
- if (!helper.isNullOrWhiteSpace(redirectUrl)) {
- queryParameters.redirectUrl = redirectUrl;
- }
- if (!helper.isNullOrWhiteSpace(smartLoginEmailTemplate)) {
- queryParameters.smartLoginEmailTemplate = smartLoginEmailTemplate;
- }
- if (!helper.isNullOrWhiteSpace(welcomeEmailTemplate)) {
- queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
- }
-
- var resourcePath = 'identity/v2/auth/login/smartlogin';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to check if the Smart Login link has been clicked or not
- * @param {clientGuid} Unique string used in the Smart Login request
- * @param {fields} The fields parameter filters the API response so that the response only includes a specific set of fields
- * @return Response containing User Profile Data and access token
- *9.21.1
- */
-
- module.smartLoginPing = function (clientGuid, fields) {
- if (helper.isNullOrWhiteSpace(clientGuid)) {
- return Promise.reject(helper.getValidationMessage('clientGuid'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.clientGuid = clientGuid;
- if (!helper.isNullOrWhiteSpace(fields)) {
- queryParameters.fields = fields;
- }
-
- var resourcePath = 'identity/v2/auth/login/smartlogin/ping';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/social/nativeSocialApi.js b/loginradius-sdk/sdk/api/social/nativeSocialApi.js
deleted file mode 100644
index f7b8164..0000000
--- a/loginradius-sdk/sdk/api/social/nativeSocialApi.js
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * The API is used to get LoginRadius access token by sending Facebook's access token. It will be valid for the specific duration of time specified in the response.
- * @param {fbAccessToken} Facebook Access Token
- * @param {socialAppName} Name of Social provider APP
- * @return Response containing Definition of Complete Token data
- *20.3
- */
-
- module.getAccessTokenByFacebookAccessToken = function (
- fbAccessToken,
- socialAppName
- ) {
- if (helper.isNullOrWhiteSpace(fbAccessToken)) {
- return Promise.reject(helper.getValidationMessage('fbAccessToken'));
- }
- var queryParameters = {};
-
- queryParameters.fb_Access_Token = fbAccessToken;
- queryParameters.key = config.apiKey;
- if (!helper.isNullOrWhiteSpace(socialAppName)) {
- queryParameters.socialAppName = socialAppName;
- }
-
- var resourcePath = 'api/v2/access_token/facebook';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * The API is used to get LoginRadius access token by sending Twitter's access token. It will be valid for the specific duration of time specified in the response.
- * @param {twAccessToken} Twitter Access Token
- * @param {twTokenSecret} Twitter Token Secret
- * @param {socialAppName} Name of Social provider APP
- * @return Response containing Definition of Complete Token data
- *20.4
- */
-
- module.getAccessTokenByTwitterAccessToken = function (
- twAccessToken,
- twTokenSecret,
- socialAppName
- ) {
- if (helper.isNullOrWhiteSpace(twAccessToken)) {
- return Promise.reject(helper.getValidationMessage('twAccessToken'));
- }
- if (helper.isNullOrWhiteSpace(twTokenSecret)) {
- return Promise.reject(helper.getValidationMessage('twTokenSecret'));
- }
- var queryParameters = {};
-
- queryParameters.key = config.apiKey;
- queryParameters.tw_Access_Token = twAccessToken;
- queryParameters.tw_Token_Secret = twTokenSecret;
- if (!helper.isNullOrWhiteSpace(socialAppName)) {
- queryParameters.socialAppName = socialAppName;
- }
-
- var resourcePath = 'api/v2/access_token/twitter';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * The API is used to get LoginRadius access token by sending Google's access token. It will be valid for the specific duration of time specified in the response.
- * @param {googleAccessToken} Google Access Token
- * @param {clientId} Google Client ID
- * @param {refreshToken} LoginRadius refresh token
- * @param {socialAppName} Name of Social provider APP
- * @return Response containing Definition of Complete Token data
- *20.5
- */
-
- module.getAccessTokenByGoogleAccessToken = function (
- googleAccessToken,
- clientId,
- refreshToken,
- socialAppName
- ) {
- if (helper.isNullOrWhiteSpace(googleAccessToken)) {
- return Promise.reject(helper.getValidationMessage('googleAccessToken'));
- }
- var queryParameters = {};
-
- queryParameters.google_Access_Token = googleAccessToken;
- queryParameters.key = config.apiKey;
- if (!helper.isNullOrWhiteSpace(clientId)) {
- queryParameters.client_id = clientId;
- }
- if (!helper.isNullOrWhiteSpace(refreshToken)) {
- queryParameters.refresh_token = refreshToken;
- }
- if (!helper.isNullOrWhiteSpace(socialAppName)) {
- queryParameters.socialAppName = socialAppName;
- }
-
- var resourcePath = 'api/v2/access_token/google';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration.
- * @param {idToken} Google JWT id_token
- * @return Response containing Definition of Complete Token data
- *20.6
- */
-
- module.getAccessTokenByGoogleJWTAccessToken = function (idToken) {
- if (helper.isNullOrWhiteSpace(idToken)) {
- return Promise.reject(helper.getValidationMessage('idToken'));
- }
- var queryParameters = {};
-
- queryParameters.id_Token = idToken;
- queryParameters.key = config.apiKey;
-
- var resourcePath = 'api/v2/access_token/googlejwt';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * The API is used to get LoginRadius access token by sending Linkedin's access token. It will be valid for the specific duration of time specified in the response.
- * @param {lnAccessToken} Linkedin Access Token
- * @param {socialAppName} Name of Social provider APP
- * @return Response containing Definition of Complete Token data
- *20.7
- */
-
- module.getAccessTokenByLinkedinAccessToken = function (
- lnAccessToken,
- socialAppName
- ) {
- if (helper.isNullOrWhiteSpace(lnAccessToken)) {
- return Promise.reject(helper.getValidationMessage('lnAccessToken'));
- }
- var queryParameters = {};
-
- queryParameters.key = config.apiKey;
- queryParameters.ln_Access_Token = lnAccessToken;
- if (!helper.isNullOrWhiteSpace(socialAppName)) {
- queryParameters.socialAppName = socialAppName;
- }
-
- var resourcePath = 'api/v2/access_token/linkedin';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * The API is used to get LoginRadius access token by sending Foursquare's access token. It will be valid for the specific duration of time specified in the response.
- * @param {fsAccessToken} Foursquare Access Token
- * @return Response containing Definition of Complete Token data
- *20.8
- */
-
- module.getAccessTokenByFoursquareAccessToken = function (fsAccessToken) {
- if (helper.isNullOrWhiteSpace(fsAccessToken)) {
- return Promise.reject(helper.getValidationMessage('fsAccessToken'));
- }
- var queryParameters = {};
-
- queryParameters.fs_Access_Token = fsAccessToken;
- queryParameters.key = config.apiKey;
-
- var resourcePath = 'api/v2/access_token/foursquare';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * The API is used to get LoginRadius access token by sending a valid Apple ID OAuth Code. It will be valid for the specific duration of time specified in the response.
- * @param {code} Apple Code
- * @param {socialAppName} Name of Social provider APP
- * @return Response containing Definition of Complete Token data
- *20.12
- */
-
- module.getAccessTokenByAppleIdCode = function (code, socialAppName) {
- if (helper.isNullOrWhiteSpace(code)) {
- return Promise.reject(helper.getValidationMessage('code'));
- }
- var queryParameters = {};
-
- queryParameters.code = code;
- queryParameters.key = config.apiKey;
- if (!helper.isNullOrWhiteSpace(socialAppName)) {
- queryParameters.socialAppName = socialAppName;
- }
-
- var resourcePath = 'api/v2/access_token/apple';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API is used to retrieve a LoginRadius access token by passing in a valid WeChat OAuth Code.
- * @param {code} WeChat Code
- * @return Response containing Definition of Complete Token data
- *20.13
- */
-
- module.getAccessTokenByWeChatCode = function (code) {
- if (helper.isNullOrWhiteSpace(code)) {
- return Promise.reject(helper.getValidationMessage('code'));
- }
- var queryParameters = {};
-
- queryParameters.code = code;
- queryParameters.key = config.apiKey;
-
- var resourcePath = 'api/v2/access_token/wechat';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * The API is used to get LoginRadius access token by sending Google's AuthCode. It will be valid for the specific duration of time specified in the response.
- * @param {googleAuthcode} Google AuthCode
- * @param {socialAppName} Name of Social provider APP
- * @return Response containing Definition of Complete Token data
- *20.16
- */
-
- module.getAccessTokenByGoogleAuthCode = function (
- googleAuthcode,
- socialAppName
- ) {
- if (helper.isNullOrWhiteSpace(googleAuthcode)) {
- return Promise.reject(helper.getValidationMessage('googleAuthcode'));
- }
- var queryParameters = {};
-
- queryParameters.apiKey = config.apiKey;
- queryParameters.google_authcode = googleAuthcode;
- if (!helper.isNullOrWhiteSpace(socialAppName)) {
- queryParameters.socialAppName = socialAppName;
- }
-
- var resourcePath = 'api/v2/access_token/google';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/api/social/socialApi.js b/loginradius-sdk/sdk/api/social/socialApi.js
deleted file mode 100644
index 43df014..0000000
--- a/loginradius-sdk/sdk/api/social/socialApi.js
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
-
- /**
- * This API Is used to translate the Request Token returned during authentication into an Access Token that can be used with other API calls.
- * @param {token} Token generated from a successful oauth from social platform
- * @return Response containing Definition of Complete Token data
- *20.1
- */
-
- module.exchangeAccessToken = function (token) {
- if (helper.isNullOrWhiteSpace(token)) {
- return Promise.reject(helper.getValidationMessage('token'));
- }
- var queryParameters = {};
-
- queryParameters.secret = config.apiSecret;
- queryParameters.token = token;
-
- var resourcePath = 'api/v2/access_token';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * The Refresh Access Token API is used to refresh the provider access token after authentication. It will be valid for up to 60 days on LoginRadius depending on the provider. In order to use the access token in other APIs, always refresh the token using this API.
Supported Providers : Facebook,Yahoo,Google,Twitter, Linkedin.
Contact LoginRadius support team to enable this API.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @param {expiresIn} Allows you to specify a desired expiration time in minutes for the newly issued access token.
- * @param {isWeb} Is web or not.
- * @return Response containing Definition of Complete Token data
- *20.2
- */
-
- module.refreshAccessToken = function (accessToken, expiresIn, isWeb) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.secret = config.apiSecret;
- if (expiresIn !== null) {
- queryParameters.expiresIn = expiresIn;
- }
- if (isWeb !== null) {
- queryParameters.isWeb = isWeb;
- }
-
- var resourcePath = 'api/v2/access_token/refresh';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This API validates access token, if valid then returns a response with its expiry otherwise error.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @return Response containing Definition of Complete Token data
- *20.9
- */
-
- module.validateAccessToken = function (accessToken) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.key = config.apiKey;
- queryParameters.secret = config.apiSecret;
-
- var resourcePath = 'api/v2/access_token/validate';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This api invalidates the active access token or expires an access token validity.
- * @param {accessToken} Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- * @return Response containing Definition for Complete Validation data
- *20.10
- */
-
- module.inValidateAccessToken = function (accessToken) {
- if (helper.isNullOrWhiteSpace(accessToken)) {
- return Promise.reject(helper.getValidationMessage('accessToken'));
- }
- var queryParameters = {};
-
- queryParameters.access_token = accessToken;
- queryParameters.key = config.apiKey;
- queryParameters.secret = config.apiSecret;
-
- var resourcePath = 'api/v2/access_token/invalidate';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This api is use to get all active session by Access Token.
- * @param {token} Token generated from a successful oauth from social platform
- * @return Response containing Definition for Complete active sessions
- *20.11.1
- */
-
- module.getActiveSession = function (token) {
- if (helper.isNullOrWhiteSpace(token)) {
- return Promise.reject(helper.getValidationMessage('token'));
- }
- var queryParameters = {};
-
- queryParameters.key = config.apiKey;
- queryParameters.secret = config.apiSecret;
- queryParameters.token = token;
-
- var resourcePath = 'api/v2/access_token/activesession';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This api is used to get all active sessions by AccountID(UID).
- * @param {accountId} UID, the unified identifier for each user account
- * @return Response containing Definition for Complete active sessions
- *20.11.2
- */
-
- module.getActiveSessionByAccountID = function (accountId) {
- if (helper.isNullOrWhiteSpace(accountId)) {
- return Promise.reject(helper.getValidationMessage('accountId'));
- }
- var queryParameters = {};
-
- queryParameters.accountId = accountId;
- queryParameters.key = config.apiKey;
- queryParameters.secret = config.apiSecret;
-
- var resourcePath = 'api/v2/access_token/activesession';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
-
- /**
- * This api is used to get all active sessions by ProfileId.
- * @param {profileId} Social Provider Id
- * @return Response containing Definition for Complete active sessions
- *20.11.3
- */
-
- module.getActiveSessionByProfileID = function (profileId) {
- if (helper.isNullOrWhiteSpace(profileId)) {
- return Promise.reject(helper.getValidationMessage('profileId'));
- }
- var queryParameters = {};
-
- queryParameters.key = config.apiKey;
- queryParameters.profileId = profileId;
- queryParameters.secret = config.apiSecret;
-
- var resourcePath = 'api/v2/access_token/activesession';
-
- return config.request('GET', resourcePath, queryParameters, null);
- };
- return module;
-};
diff --git a/loginradius-sdk/sdk/util/helper.js b/loginradius-sdk/sdk/util/helper.js
deleted file mode 100644
index be3d48a..0000000
--- a/loginradius-sdk/sdk/util/helper.js
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-module.exports = function (config = {}) {
- var module = {};
- var querystring = require('querystring');
- var crypto = require('crypto');
-
- /**
- * Define the JSON error format
- */
- var jsondata = {
- Description: 'Oops something went wrong, Please try again.',
- ErrorCode: 1000,
- Message: 'Oops something went wrong, Please try again.',
- IsProviderError: false,
- ProviderErrorResponse: null
- };
- /**
- * Check null or undefined
- * @param {string} as input
- * @return input is null or not
- */
- module.isNullOrWhiteSpace = function (input) {
- return !(input === null || typeof input === 'undefined' ? '' : input);
- };
-
- /**
- * Get Error response
- * @param {string} status
- * @param {json} input
- * @return json of api response
- */
- module.checkError = function (status, input) {
- if (status === 'serverError') {
- return input !== '' ? input : jsondata;
- }
- return input && input.ErrorCode;
- };
-
- /**
- * Check json is correct or not
- * @param {string} input
- * @return input is json or not
- */
- module.checkJson = function (input) {
- return !!(
- input === null ||
- input === undefined ||
- Array.isArray(input) ||
- typeof input !== 'object'
- );
- };
-
- /**
- * Generate the sott
- * @param {json} config as site config
- * @param {string} startDate as start date
- * @param {string} endDate as end date
- * @return generated sott
- */
- module.getSott = function (sottconfig, startDate, endDate, timeDifference) {
- return new Promise(function (resolve, reject) {
- var cipher = require('./sott')(config, sottconfig,
- startDate,
- endDate,
- timeDifference
- );
- cipher.then(
- function (sott) {
- resolve(sott);
- },
- function (reason) {
- reject(reason);
- }
- );
- });
- };
-
- /**
- * Get Validation Message
- * @param {string} type as error string
- * @return jsondata as json error object
- */
- module.getValidationMessage = function (type) {
- jsondata.Description =
- 'The API Request Parameter ' + type + ' is not Correct or WellFormated';
- return jsondata;
- };
-
- /**
- * Manage the api response
- * @param {string} status as error status
- * @param {json} data as response data
- * @param {*} resolve as promise resolve
- * @param {*} reject as promise reject
- */
- module.manageRequestResponse = function (status, data, resolve, reject) {
- if (this.checkError(status, data)) {
- if (!data) {
- data = this.checkError(status, data);
- }
- reject(data);
- } else {
- resolve(data);
- }
- };
- /**
- * Get Query String
- * @param {object} string as json input object
- * @return qauery string
- */
- module.getQueryString = function (string) {
- return querystring.stringify(string, null, null, encodeURIComponent);
- };
-
- /**
- * Generate signin header
- * @param {object} options as options object
- * @param {string} apiSecret
- * @return header object
- */
- module.generateSigningHeader = function (options, apiSecret) {
- var SIXTY = 60;
- var SIXTYTHOUSAND = 60000;
- var TEN = 10;
- var expiryDate = new Date();
- expiryDate = new Date(expiryDate.getTime() + SIXTY * SIXTYTHOUSAND);
- var month = expiryDate.getMonth() + 1;
-
- expiryDate =
- expiryDate.getFullYear() +
- '-' +
- (month < TEN ? '0' + month : month) +
- '-' +
- (expiryDate.getDate() < TEN
- ? '0' + expiryDate.getDate()
- : expiryDate.getDate()) +
- ' ' +
- (expiryDate.getHours() < TEN
- ? '0' + expiryDate.getHours()
- : expiryDate.getHours()) +
- ':' +
- (expiryDate.getMinutes() < TEN
- ? '0' + expiryDate.getMinutes()
- : expiryDate.getMinutes()) +
- ':' +
- (expiryDate.getSeconds() < TEN
- ? '0' + expiryDate.getSeconds()
- : expiryDate.getSeconds());
-
- var encodeUrl = encodeURIComponent(
- decodeURIComponent(options.uri)
- ).toLowerCase();
-
- var urlString;
- if (options.body) {
- urlString = expiryDate + ':' + encodeUrl + ':' + options.body;
- } else {
- urlString = expiryDate + ':' + encodeUrl;
- }
- var hash = crypto
- .createHmac('sha256', apiSecret)
- .update(urlString)
- .digest('base64');
-
- return {
- 'X-Request-Expires': expiryDate,
- digest: 'SHA-256=' + hash
- };
- };
- return module;
-}
-
diff --git a/loginradius-sdk/sdk/util/lr.js b/loginradius-sdk/sdk/util/lr.js
deleted file mode 100644
index c1f5f5b..0000000
--- a/loginradius-sdk/sdk/util/lr.js
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Created by LoginRadius Development Team
- Copyright 2019 LoginRadius Inc. All rights reserved.
-*/
-var https = require('https');
-var path = require('path');
-
-module.exports = function (config = {}) {
- if (config.apiKey === undefined || config.apiSecret === undefined) {
- console.error('Please set apiKey API & apiSecret');
- return;
- }
-
- config.HELPER_PATH = path.join(__dirname, 'helper.js');
- var helper = require(config.HELPER_PATH)(config);
- config.request = function (type, resourcePath, queryParameters, formData) {
- var isApiSecret;
- if (queryParameters.apiSecret) {
- isApiSecret = queryParameters.apiSecret;
- delete queryParameters.apiSecret;
- }
-
- if (!helper.isNullOrWhiteSpace(config.serverRegion)) {
- queryParameters.region = config.serverRegion;
- }
-
- var headers = { 'Content-Type': 'application/json' };
-
- if (queryParameters.sott) {
- Object.assign(headers, { 'X-LoginRadius-Sott': queryParameters.sott });
- delete queryParameters.sott;
- }
- if (!helper.isNullOrWhiteSpace(config.originIp)) {
- Object.assign(headers, { 'X-Origin-IP': config.originIp });
- }
- var queryString = helper.getQueryString(queryParameters);
-
- if (queryParameters.access_token) {
- Object.assign(headers, {
- authorization: 'Bearer ' + queryParameters.access_token
- });
- delete queryParameters.access_token;
- }
- var options = {
- method: type,
- hostname:
- resourcePath === 'ciam/appinfo'
- ? 'config.lrcontent.com'
- : config.apiDomain,
- path: '/' + resourcePath + (queryString ? '?' + queryString : ''),
- headers: headers
- };
-
- if (formData !== '' && formData !== null) {
- var out_text = JSON.stringify(formData);
- Object.assign(headers, { 'Content-Length': out_text.length });
- }
-
- if (config.proxy && config.proxy.host && config.proxy.port) {
- options.proxy =
- (config.proxy.protocol ? config.proxy.protocol : 'http') +
- '://' +
- config.proxy.user +
- ':' +
- config.proxy.password +
- '@' +
- config.proxy.host +
- ':' +
- config.proxy.port;
- }
-
- var customHeader = {
- 'X-LoginRadius-apiKey': config.apiKey,
- 'X-LoginRadius-apiSecret': config.apiSecret
- };
-
- if (config.fieldsParam && config.fieldsValue) {
- var fieldsList;
- if (options.path.match(/\?./)) {
- fieldsList =
- config.fieldsParam + encodeURIComponent(config.fieldsValue);
- } else {
- fieldsList = '?fields=' + encodeURIComponent(config.fieldsValue);
- }
- options.path += fieldsList;
- }
-
- if (isApiSecret) {
- if (config.apiRequestSigning) {
- if (!options.path.match('apiKey')) {
- options.path += '&apiKey=' + encodeURIComponent(config.apiKey);
- }
- var signingHeader = helper.generateSigningHeader(
- options,
- config.apiSecret
- );
-
- Object.assign(options.headers, signingHeader);
- } else {
- Object.assign(options.headers, customHeader);
- }
- }
- return new Promise(function (resolve, reject) {
- const req = https
- .request(options, (resp) => {
- var data = '';
- if (
- Object.prototype.hasOwnProperty.call(resp, 'statusCode') &&
- resp.statusCode === 429
- ) {
- var jsondata = {
- Description: 'Too many request in particular time frame',
- ErrorCode: 429,
- Message: 'Too many request in particular time frame',
- IsProviderError: false,
- ProviderErrorResponse: null
- };
- helper.manageRequestResponse(
- 'serverError',
- jsondata,
- resolve,
- reject
- );
- } else {
- resp.on('data', (chunk) => {
- data += chunk;
- });
-
- resp.on('end', () => {
- try {
- var response = JSON.parse(data);
- helper.manageRequestResponse('', response, resolve, reject);
- } catch (err) {
- helper.manageRequestResponse(
- 'serverError',
- '',
- resolve,
- reject
- );
- }
- });
- }
- })
- .on('error', (error) => {
- helper.manageRequestResponse('serverError', error, resolve, reject);
- });
-
- if (out_text) {
- req.write(out_text);
- }
-
- req.end();
- });
- };
-
- config.apiDomain =
- config.apiDomain && config.apiDomain !== ''
- ? config.apiDomain
- : 'api.loginradius.com';
- return {
- helper,
- accountApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'account',
- 'accountApi'
- ))(config),
- roleApi: require(path.join(__dirname, '..', 'api', 'account', 'roleApi'))(
- config
- ),
- sottApi: require(path.join(__dirname, '..', 'api', 'account', 'sottApi'))(
- config
- ),
- configurationApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'advanced',
- 'configurationApi'
- ))(config),
- customObjectApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'advanced',
- 'customObjectApi'
- ))(config),
- multiFactorAuthenticationApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'advanced',
- 'multiFactorAuthenticationApi'
- ))(config),
- webHookApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'advanced',
- 'webHookApi'
- ))(config),
- consentManagementApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'advanced',
- 'consentManagementApi'
- ))(config),
- reAuthenticationApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'advanced',
- 'reAuthenticationApi'
- ))(config),
- authenticationApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'authentication',
- 'authenticationApi'
- ))(config),
- oneTouchLoginApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'authentication',
- 'oneTouchLoginApi'
- ))(config),
- passwordLessLoginApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'authentication',
- 'passwordLessLoginApi'
- ))(config),
- phoneAuthenticationApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'authentication',
- 'phoneAuthenticationApi'
- ))(config),
- riskBasedAuthenticationApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'authentication',
- 'riskBasedAuthenticationApi'
- ))(config),
- pinAuthenticationApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'authentication',
- 'pinAuthenticationApi'
- ))(config),
- smartLoginApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'authentication',
- 'smartLoginApi'
- ))(config),
- nativeSocialApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'social',
- 'nativeSocialApi'
- ))(config),
- socialApi: require(path.join(
- __dirname,
- '..',
- 'api',
- 'social',
- 'socialApi'
- ))(config)
- };
-};
diff --git a/loginradius-sdk/src/api/account/accountApi.ts b/loginradius-sdk/src/api/account/accountApi.ts
new file mode 100644
index 0000000..eb8642e
--- /dev/null
+++ b/loginradius-sdk/src/api/account/accountApi.ts
@@ -0,0 +1,651 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class AccountApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API is used to retrieve all of the accepted Policies by the user, associated with their UID.
+ * @param uid the unified identifier for each user account
+ * @return Complete Policy History data
+ *15.1.1
+ */
+ getPrivacyPolicyHistoryByUid (uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath =
+ 'identity/v2/manage/account/' + uid + '/privacypolicy/history';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to create an account in Cloud Storage. This API bypass the normal email verification process and manually creates the user.
In order to use this API, you need to format a JSON request body with all of the mandatory fields
+ * @param accountCreateModel Model Class containing Definition of payload for Account Create API
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Response containing Definition for Complete profile data
+ *18.1
+ */
+ createAccount (accountCreateModel: object, fields?: string) {
+ if (checkJson(accountCreateModel)) {
+ return Promise.reject(getValidationMessage('accountCreateModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath = 'identity/v2/manage/account';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ accountCreateModel
+ );
+ }
+
+ /**
+ * This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage.
+ * @param email Email of the user
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Response containing Definition for Complete profile data
+ *18.2
+ */
+ getAccountProfileByEmail (email: string, fields?: string) {
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.email = email;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath = 'identity/v2/manage/account';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to retrieve all of the profile data associated with the specified account by user name in Cloud Storage.
+ * @param userName UserName of the user
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Response containing Definition for Complete profile data
+ *18.3
+ */
+ getAccountProfileByUserName (userName: string, fields?: string) {
+ if (isNullOrWhiteSpace(userName)) {
+ return Promise.reject(getValidationMessage('userName'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.userName = userName;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath = 'identity/v2/manage/account';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to retrieve all of the profile data, associated with the account by phone number in Cloud Storage.
+ * @param phone The Registered Phone Number
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Response containing Definition for Complete profile data
+ *18.4
+ */
+ getAccountProfileByPhone (phone: string, fields?: string) {
+ if (isNullOrWhiteSpace(phone)) {
+ return Promise.reject(getValidationMessage('phone'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.phone = phone;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath = 'identity/v2/manage/account';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to retrieve all of the profile data, associated with the account by uid in Cloud Storage.
+ * @param id The unified identifier for each user account
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Response containing Definition for Complete profile data
+ *18.5
+ */
+ getAccountProfileByUid (uid: string, fields?: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath = 'identity/v2/manage/account/' + uid;
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section Here for more capabilities.
+ * @param accountUserProfileUpdateModel Model Class containing Definition of payload for Account Update API
+ * @param uid The unified identifier for each user account
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param nullSupport Boolean, pass true if you wish to update any user profile field with a NULL value, You can get the details
+ * @return Response containing Definition for Complete profile data
+ *18.15
+ */
+ updateAccountByUid (accountUserProfileUpdateModel: object, uid: string, fields: string, nullSupport: boolean) {
+ if (checkJson(accountUserProfileUpdateModel)) {
+ return Promise.reject(
+ getValidationMessage('accountUserProfileUpdateModel')
+ );
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (nullSupport !== null) {
+ queryParameters.nullSupport = nullSupport;
+ }
+
+ var resourcePath = 'identity/v2/manage/account/' + uid;
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ accountUserProfileUpdateModel
+ );
+ }
+
+ /**
+ * This API is used to update the PhoneId by using the Uid's. Admin can update the PhoneId's for both the verified and unverified profiles. It will directly replace the PhoneId and bypass the OTP verification process.
+ * @param phone Phone number
+ * @param uid The unified identifier for each user account
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Response containing Definition for Complete profile data
+ *18.16
+ */
+ updatePhoneIDByUid (phone: string, uid: string, fields?: string) {
+ if (isNullOrWhiteSpace(phone)) {
+ return Promise.reject(getValidationMessage('phone'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.phone = phone;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/phoneid';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API use to retrive the hashed password of a specified account in Cloud Storage.
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition for Complete PasswordHash data
+ *18.17
+ */
+
+ getAccountPasswordHashByUid (uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/password';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to set the password of an account in Cloud Storage.
+ * @param password New password
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition for Complete PasswordHash data
+ *18.18
+ */
+ setAccountPasswordByUid (password: string, uid: string) {
+ if (isNullOrWhiteSpace(password)) {
+ return Promise.reject(getValidationMessage('password'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var bodyParameters: any = {};
+ bodyParameters.password = password;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/password';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API deletes the Users account and allows them to re-register for a new account.
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition of Delete Request
+ *18.19
+ */
+ deleteAccountByUid (uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid;
+
+ return request(this.config, 'DELETE', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to invalidate the Email Verification status on an account.
+ * @param uid The unified identifier for each user account
+ * @param emailTemplate Email template name
+ * @param verificationUrl Email verification url
+ * @return Response containing Definition of Complete Validation data
+ *18.20
+ */
+ invalidateAccountEmailVerification (uid: string, emailTemplate?: string, verificationUrl?: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/invalidateemail';
+
+ return request(this.config, 'PUT', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body.
+ * @param email user's email
+ * @param emailTemplate Email template name
+ * @param resetPasswordUrl Url to which user should get re-directed to for resetting the password
+ * @param sendEmail If set to true, the API will also send a Forgot Password email to the customer, bypassing any Bot Protection challenges that they are faced with.
+ * @return Response containing Definition of Complete Forgot Password data
+ *18.22
+ */
+ getForgotPasswordToken (email: string, emailTemplate?: string, resetPasswordUrl?: string, sendEmail?: boolean) {
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(resetPasswordUrl)) {
+ queryParameters.resetPasswordUrl = resetPasswordUrl;
+ }
+ if (sendEmail !== null) {
+ queryParameters.sendEmail = sendEmail;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.email = email;
+
+ var resourcePath = 'identity/v2/manage/account/forgot/token';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API Returns an Email Verification token.
+ * @param email user's email
+ * @return Response containing Definition of Complete Verification data
+ *18.23
+ */
+ getEmailVerificationToken (email: string) {
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var bodyParameters: any = {};
+ bodyParameters.email = email;
+
+ var resourcePath = 'identity/v2/manage/account/verify/token';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * The API is used to get LoginRadius access token based on UID.
+ * @param uid The unified identifier for each user account
+ * @return Response containing Definition of Complete Token data
+ *18.24
+ */
+ getAccessTokenByUid (uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.uid = uid;
+
+ var resourcePath = 'identity/v2/manage/account/access_token';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API Allows you to reset the phone no verification of an end user’s account.
+ * @param uid The unified identifier for each user account
+ * @param smsTemplate SMS Template name
+ * @return Response containing Definition of Complete Validation data
+ *18.27
+ */
+ resetPhoneIDVerificationByUid (uid: string, smsTemplate?: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/invalidatephone';
+
+ return request(this.config, 'PUT', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to add/upsert another emails in account profile by different-different email types. If the email type is same then it will simply update the existing email, otherwise it will add a new email in Email array.
+ * @param upsertEmailModel Model Class containing Definition of payload for UpsertEmail Property
+ * @param uid The unified identifier for each user account
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Response containing Definition for Complete profile data
+ *18.29
+ */
+ upsertEmail (upsertEmailModel: object, uid: string, fields: string) {
+ if (checkJson(upsertEmailModel)) {
+ return Promise.reject(getValidationMessage('upsertEmailModel'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/email';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ upsertEmailModel
+ );
+ }
+
+ /**
+ * Use this API to Remove emails from a user Account
+ * @param email user's email
+ * @param uid The unified identifier for each user account
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Response containing Definition for Complete profile data
+ *18.30
+ */
+ removeEmail (email: string, uid: string, fields?: string) {
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.email = email;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/email';
+
+ return request(
+ this.config,
+ 'DELETE',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to refresh an access token via it's associated refresh token.
+ * @param refreshToken LoginRadius refresh token
+ * @return Response containing Definition of Complete Token data
+ *18.31
+ */
+ refreshAccessTokenByRefreshToken (refreshToken: string) {
+ if (isNullOrWhiteSpace(refreshToken)) {
+ return Promise.reject(getValidationMessage('refreshToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.refresh_Token = refreshToken;
+
+ var resourcePath = 'identity/v2/manage/account/access_token/refresh';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * The Revoke Refresh Access Token API is used to revoke a refresh token or the Provider Access Token, revoking an existing refresh token will invalidate the refresh token but the associated access token will work until the expiry.
+ * @param refreshToken LoginRadius refresh token
+ * @return Response containing Definition of Delete Request
+ *18.32
+ */
+ revokeRefreshToken (refreshToken: string) {
+ if (isNullOrWhiteSpace(refreshToken)) {
+ return Promise.reject(getValidationMessage('refreshToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.refresh_Token = refreshToken;
+
+ var resourcePath = 'identity/v2/manage/account/access_token/refresh/revoke';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * Note: This is intended for specific workflows where an email may be associated to multiple UIDs. This API is used to retrieve all of the identities (UID and Profiles), associated with a specified email in Cloud Storage.
+ * @param email Email of the user
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Complete user Identity data
+ *18.35
+ */
+ getAccountIdentitiesByEmail (email: string, fields?: string) {
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.email = email;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath = 'identity/v2/manage/account/identities';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to delete all user profiles associated with an Email.
+ * @param email Email of the user
+ * @return Response containing Definition of Delete Request
+ *18.36
+ */
+ accountDeleteByEmail (email: string) {
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.email = email;
+
+ var resourcePath = 'identity/v2/manage/account';
+
+ return request(this.config, 'DELETE', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to update a user's Uid. It will update all profiles, custom objects and consent management logs associated with the Uid.
+ * @param updateUidModel Payload containing Update UID
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition of Complete Validation data
+ *18.41
+ */
+ accountUpdateUid (updateUidModel: object, uid: string) {
+ if (checkJson(updateUidModel)) {
+ return Promise.reject(getValidationMessage('updateUidModel'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.uid = uid;
+
+ var resourcePath = 'identity/v2/manage/account/uid';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ updateUidModel
+ );
+ }
+}
diff --git a/loginradius-sdk/src/api/account/roleApi.ts b/loginradius-sdk/src/api/account/roleApi.ts
new file mode 100644
index 0000000..f06b70f
--- /dev/null
+++ b/loginradius-sdk/src/api/account/roleApi.ts
@@ -0,0 +1,402 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class RoleApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * API is used to retrieve all the assigned roles of a particular User.
+ * @param uid The unified identifier for each user account
+ * @return Response containing Definition of Complete Roles data
+ *18.6
+ */
+ getRolesByUid (uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/role';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to assign your desired roles to a given user.
+ * @param accountRolesModel Model Class containing Definition of payload for Create Role API
+ * @param uid The unified identifier for each user account
+ * @return Response containing Definition of Complete Roles data
+ *18.7
+ */
+ assignRolesByUid (accountRolesModel: object, uid: string) {
+ if (checkJson(accountRolesModel)) {
+ return Promise.reject(getValidationMessage('accountRolesModel'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/role';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ accountRolesModel
+ );
+ }
+
+ /**
+ * This API is used to unassign roles from a user.
+ * @param accountRolesModel Model Class containing Definition of payload for Create Role API
+ * @param uid The unified identifier for each user account
+ * @return Response containing Definition of Delete Request
+ *18.8
+ */
+ unassignRolesByUid (accountRolesModel: object, uid: string) {
+ if (checkJson(accountRolesModel)) {
+ return Promise.reject(getValidationMessage('accountRolesModel'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/role';
+
+ return request(
+ this.config,
+ 'DELETE',
+ resourcePath,
+ queryParameters,
+ accountRolesModel
+ );
+ }
+
+ /**
+ * This API Gets the contexts that have been configured and the associated roles and permissions.
+ * @param uid The unified identifier for each user account
+ * @return Complete user RoleContext data
+ *18.9
+ */
+ getRoleContextByUid (uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/rolecontext';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * The API is used to retrieve role context by the context name.
+ * @param contextName Name of context
+ * @return Complete user RoleContext data
+ *18.10
+ */
+ getRoleContextByContextName (contextName: string) {
+ if (isNullOrWhiteSpace(contextName)) {
+ return Promise.reject(getValidationMessage('contextName'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/account/rolecontext/' + contextName;
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API creates a Context with a set of Roles
+ * @param accountRoleContextModel Model Class containing Definition of RoleContext payload
+ * @param uid The unified identifier for each user account
+ * @return Complete user RoleContext data
+ *18.11
+ */
+ updateRoleContextByUid (accountRoleContextModel: object, uid: string) {
+ if (checkJson(accountRoleContextModel)) {
+ return Promise.reject(getValidationMessage('accountRoleContextModel'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/rolecontext';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ accountRoleContextModel
+ );
+ }
+
+ /**
+ * This API Deletes the specified Role Context
+ * @param contextName Name of context
+ * @param uid The unified identifier for each user account
+ * @return Response containing Definition of Delete Request
+ *18.12
+ */
+ deleteRoleContextByUid (contextName: string, uid: string) {
+ if (isNullOrWhiteSpace(contextName)) {
+ return Promise.reject(getValidationMessage('contextName'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath =
+ 'identity/v2/manage/account/' + uid + '/rolecontext/' + contextName;
+
+ return request(this.config, 'DELETE', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API Deletes the specified Role from a Context.
+ * @param contextName Name of context
+ * @param roleContextRemoveRoleModel Model Class containing Definition of payload for RoleContextRemoveRole API
+ * @param uid The unified identifier for each user account
+ * @return Response containing Definition of Delete Request
+ *18.13
+ */
+ deleteRolesFromRoleContextByUid (
+ contextName: string,
+ roleContextRemoveRoleModel: object,
+ uid: string
+ ) {
+ if (isNullOrWhiteSpace(contextName)) {
+ return Promise.reject(getValidationMessage('contextName'));
+ }
+ if (checkJson(roleContextRemoveRoleModel)) {
+ return Promise.reject(getValidationMessage('roleContextRemoveRoleModel'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath =
+ 'identity/v2/manage/account/' +
+ uid +
+ '/rolecontext/' +
+ contextName +
+ '/role';
+
+ return request(
+ this.config,
+ 'DELETE',
+ resourcePath,
+ queryParameters,
+ roleContextRemoveRoleModel
+ );
+ }
+
+ /**
+ * This API Deletes Additional Permissions from Context.
+ * @param contextName Name of context
+ * @param roleContextAdditionalPermissionRemoveRoleModel Model Class containing Definition of payload for RoleContextAdditionalPermissionRemoveRole API
+ * @param uid The unified identifier for each user account
+ * @return Response containing Definition of Delete Request
+ *18.14
+ */
+ deleteAdditionalPermissionFromRoleContextByUid (
+ contextName: string,
+ roleContextAdditionalPermissionRemoveRoleModel: object,
+ uid: string
+ ) {
+ if (isNullOrWhiteSpace(contextName)) {
+ return Promise.reject(getValidationMessage('contextName'));
+ }
+ if (checkJson(roleContextAdditionalPermissionRemoveRoleModel)) {
+ return Promise.reject(
+ getValidationMessage('roleContextAdditionalPermissionRemoveRoleModel')
+ );
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath =
+ 'identity/v2/manage/account/' +
+ uid +
+ '/rolecontext/' +
+ contextName +
+ '/additionalpermission';
+
+ return request(
+ this.config,
+ 'DELETE',
+ resourcePath,
+ queryParameters,
+ roleContextAdditionalPermissionRemoveRoleModel
+ );
+ }
+
+ /**
+ * This API retrieves the complete list of created roles with permissions of your app.
+ * @return Complete user Roles List data
+ *41.1
+ */
+ getRolesList () {
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/role';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API creates a role with permissions.
+ * @param rolesModel Model Class containing Definition of payload for Roles API
+ * @return Complete user Roles data
+ *41.2
+ */
+ createRoles (rolesModel: object) {
+ if (checkJson(rolesModel)) {
+ return Promise.reject(getValidationMessage('rolesModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/role';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ rolesModel
+ );
+ }
+
+ /**
+ * This API is used to delete the role.
+ * @param role Created RoleName
+ * @return Response containing Definition of Delete Request
+ *41.3
+ */
+ deleteRole (role: string) {
+ if (isNullOrWhiteSpace(role)) {
+ return Promise.reject(getValidationMessage('role'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/role/' + role;
+
+ return request(this.config, 'DELETE', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to add permissions to a given role.
+ * @param permissionsModel Model Class containing Definition for PermissionsModel Property
+ * @param role Created RoleName
+ * @return Response containing Definition of Complete role data
+ *41.4
+ */
+ addRolePermissions (permissionsModel: object, role: string) {
+ if (checkJson(permissionsModel)) {
+ return Promise.reject(getValidationMessage('permissionsModel'));
+ }
+ if (isNullOrWhiteSpace(role)) {
+ return Promise.reject(getValidationMessage('role'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/role/' + role + '/permission';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ permissionsModel
+ );
+ }
+
+ /**
+ * API is used to remove permissions from a role.
+ * @param permissionsModel Model Class containing Definition for PermissionsModel Property
+ * @param role Created RoleName
+ * @return Response containing Definition of Complete role data
+ *41.5
+ */
+ removeRolePermissions (permissionsModel: object, role: string) {
+ if (checkJson(permissionsModel)) {
+ return Promise.reject(getValidationMessage('permissionsModel'));
+ }
+ if (isNullOrWhiteSpace(role)) {
+ return Promise.reject(getValidationMessage('role'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/role/' + role + '/permission';
+
+ return request(
+ this.config,
+ 'DELETE',
+ resourcePath,
+ queryParameters,
+ permissionsModel
+ );
+ }
+}
diff --git a/loginradius-sdk/src/api/account/sottApi.ts b/loginradius-sdk/src/api/account/sottApi.ts
new file mode 100644
index 0000000..1ccca42
--- /dev/null
+++ b/loginradius-sdk/src/api/account/sottApi.ts
@@ -0,0 +1,32 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+
+import { LoginRadiusConfig } from '../../types';
+import { request } from '../../util/helper';
+
+export default class SottApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API allows you to generate SOTT with a given expiration time.
+ * @param timeDifference The time difference you would like to pass, If you not pass difference then the default value is 10 minutes
+ * @return Sott data For Registration
+ *18.28
+ */
+ generateSott (timeDifference: number) {
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ if (timeDifference !== null) {
+ queryParameters.timeDifference = timeDifference;
+ }
+
+ var resourcePath = 'identity/v2/manage/account/sott';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+}
diff --git a/loginradius-sdk/sdk/api/advanced/configurationApi.js b/loginradius-sdk/src/api/advanced/configurationApi.ts
similarity index 51%
rename from loginradius-sdk/sdk/api/advanced/configurationApi.js
rename to loginradius-sdk/src/api/advanced/configurationApi.ts
index fbe54a1..6b49b86 100644
--- a/loginradius-sdk/sdk/api/advanced/configurationApi.js
+++ b/loginradius-sdk/src/api/advanced/configurationApi.ts
@@ -2,42 +2,44 @@
* Created by LoginRadius Development Team
Copyright 2019 LoginRadius Inc. All rights reserved.
*/
-module.exports = function (config) {
- var module = {};
- var helper = require(config.HELPER_PATH)();
+import { LoginRadiusConfig } from '../../types';
+import { request } from '../../util/helper';
+
+export default class ConfigurationApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
/**
* This API is used to get the configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment
* @return Response containing LoginRadius App configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment
*100
*/
- module.getConfigurations = function () {
+ getConfigurations () {
var resourcePath = 'ciam/appinfo';
- var queryParameters = {};
- queryParameters.apiKey = config.apiKey;
+ var queryParameters: any = {};
+ queryParameters.apiKey = this.config.apiKey;
- return config.request('GET', resourcePath, queryParameters, null);
- };
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
/**
* This API allows you to query your LoginRadius account for basic server information and server time information which is useful when generating an SOTT token.
- * @param {timeDifference} The time difference you would like to pass, If you not pass difference then the default value is 10 minutes
+ * @param timeDifference The time difference you would like to pass, If you not pass difference then the default value is 10 minutes
* @return Response containing Definition of Complete service info data
*3.1
*/
- module.getServerInfo = function (timeDifference) {
- var queryParameters = {};
+ getServerInfo (timeDifference: number) {
+ var queryParameters: any = {};
- queryParameters.apiKey = config.apiKey;
+ queryParameters.apiKey = this.config.apiKey;
if (timeDifference !== null) {
queryParameters.timeDifference = timeDifference;
}
var resourcePath = 'identity/v2/serverinfo';
- return config.request('GET', resourcePath, queryParameters, null);
- };
- return module;
-};
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+}
diff --git a/loginradius-sdk/src/api/advanced/consentManagementApi.ts b/loginradius-sdk/src/api/advanced/consentManagementApi.ts
new file mode 100644
index 0000000..489b23d
--- /dev/null
+++ b/loginradius-sdk/src/api/advanced/consentManagementApi.ts
@@ -0,0 +1,173 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class ConsentManagementApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API is used to get the Consent logs of the user.
+ * @param uid The unified identifier for each user account
+ * @return Response containing consent logs
+ *18.37
+ */
+ getConsentLogsByUid (uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/consent/logs';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is to submit consent form using consent token.
+ * @param consentToken The consent token received after login error 1226
+ * @param consentSubmitModel Model class containing list of multiple consent
+ * @return Response containing User Profile Data and access token
+ *43.1
+ */
+ submitConsentByConsentToken (consentToken: string, consentSubmitModel: object) {
+ if (isNullOrWhiteSpace(consentToken)) {
+ return Promise.reject(getValidationMessage('consentToken'));
+ }
+ if (checkJson(consentSubmitModel)) {
+ return Promise.reject(getValidationMessage('consentSubmitModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.consentToken = consentToken;
+
+ var resourcePath = 'identity/v2/auth/consent';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ consentSubmitModel
+ );
+ }
+
+ /**
+ * This API is used to fetch consent logs.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @return Response containing consent logs
+ *43.2
+ */
+ getConsentLogs (accessToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/consent/logs';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * API to provide a way to end user to submit a consent form for particular event type.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param consentSubmitModel Model class containing list of multiple consent
+ * @return Response containing Definition for Complete profile data
+ *43.3
+ */
+ submitConsentByAccessToken (accessToken: string, consentSubmitModel: object) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(consentSubmitModel)) {
+ return Promise.reject(getValidationMessage('consentSubmitModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/consent/profile';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ consentSubmitModel
+ );
+ }
+
+ /**
+ * This API is used to check if consent is submitted for a particular event or not.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param event Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject
+ * @param isCustom true/false
+ * @return Response containing consent profile
+ *43.4
+ */
+ verifyConsentByAccessToken (accessToken: string, event: string, isCustom: boolean) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(event)) {
+ return Promise.reject(getValidationMessage('event'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.event = event;
+ queryParameters.isCustom = isCustom;
+
+ var resourcePath = 'identity/v2/auth/consent/verify';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is to update consents using access token.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param consentUpdateModel Model class containg list of multiple consent
+ * @return Response containing consent profile
+ *43.5
+ */
+ updateConsentProfileByAccessToken (accessToken: string, consentUpdateModel: object) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(consentUpdateModel)) {
+ return Promise.reject(getValidationMessage('consentUpdateModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/consent';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ consentUpdateModel
+ );
+ }
+}
diff --git a/loginradius-sdk/src/api/advanced/customObjectApi.ts b/loginradius-sdk/src/api/advanced/customObjectApi.ts
new file mode 100644
index 0000000..14a7a1e
--- /dev/null
+++ b/loginradius-sdk/src/api/advanced/customObjectApi.ts
@@ -0,0 +1,329 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class CustomObjectApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API is used to write information in JSON format to the custom object for the specified account.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param objectName LoginRadius Custom Object Name
+ * @param payload LoginRadius Custom Object Name
+ * @return Response containing Definition for Complete user custom object data
+ *6.1
+ */
+ createCustomObjectByToken (accessToken: string, objectName: string, payload: object) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(objectName)) {
+ return Promise.reject(getValidationMessage('objectName'));
+ }
+ if (checkJson(payload)) {
+ return Promise.reject(getValidationMessage('payload'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.objectName = objectName;
+
+ var resourcePath = 'identity/v2/auth/customobject';
+
+ return request(this.config, 'POST', resourcePath, queryParameters, payload);
+ }
+
+ /**
+ * This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param objectName LoginRadius Custom Object Name
+ * @param objectRecordId Unique identifier of the user's record in Custom Object
+ * @param payload LoginRadius Custom Object Name
+ * @param updateType Possible values: replace, partialreplace.
+ * @return Response containing Definition for Complete user custom object data
+ *6.2
+ */
+ updateCustomObjectByToken (
+ accessToken: string,
+ objectName: string,
+ objectRecordId: string,
+ payload: object,
+ updateType: string
+ ) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(objectName)) {
+ return Promise.reject(getValidationMessage('objectName'));
+ }
+ if (isNullOrWhiteSpace(objectRecordId)) {
+ return Promise.reject(getValidationMessage('objectRecordId'));
+ }
+ if (checkJson(payload)) {
+ return Promise.reject(getValidationMessage('payload'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.objectName = objectName;
+ if (updateType !== null) {
+ queryParameters.updateType = updateType;
+ }
+
+ var resourcePath = 'identity/v2/auth/customobject/' + objectRecordId;
+
+ return request(this.config, 'PUT', resourcePath, queryParameters, payload);
+ }
+
+ /**
+ * This API is used to retrieve the specified Custom Object data for the specified account.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param objectName LoginRadius Custom Object Name
+ * @return Complete user CustomObject data
+ *6.3
+ */
+ getCustomObjectByToken (accessToken: string, objectName: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(objectName)) {
+ return Promise.reject(getValidationMessage('objectName'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.objectName = objectName;
+
+ var resourcePath = 'identity/v2/auth/customobject';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to retrieve the Custom Object data for the specified account.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param objectName LoginRadius Custom Object Name
+ * @param objectRecordId Unique identifier of the user's record in Custom Object
+ * @return Response containing Definition for Complete user custom object data
+ *6.4
+ */
+ getCustomObjectByRecordIDAndToken (accessToken: string, objectName: string, objectRecordId: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(objectName)) {
+ return Promise.reject(getValidationMessage('objectName'));
+ }
+ if (isNullOrWhiteSpace(objectRecordId)) {
+ return Promise.reject(getValidationMessage('objectRecordId'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.objectName = objectName;
+
+ var resourcePath = 'identity/v2/auth/customobject/' + objectRecordId;
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param objectName LoginRadius Custom Object Name
+ * @param objectRecordId Unique identifier of the user's record in Custom Object
+ * @return Response containing Definition of Delete Request
+ *6.5
+ */
+ deleteCustomObjectByToken (accessToken: string, objectName: string, objectRecordId: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(objectName)) {
+ return Promise.reject(getValidationMessage('objectName'));
+ }
+ if (isNullOrWhiteSpace(objectRecordId)) {
+ return Promise.reject(getValidationMessage('objectRecordId'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.objectName = objectName;
+
+ var resourcePath = 'identity/v2/auth/customobject/' + objectRecordId;
+
+ return request(this.config, 'DELETE', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to write information in JSON format to the custom object for the specified account.
+ * @param objectName LoginRadius Custom Object Name
+ * @param payload LoginRadius Custom Object Name
+ * @param uid The unified identifier for each user account
+ * @return Response containing Definition for Complete user custom object data
+ *19.1
+ */
+ createCustomObjectByUid (objectName: string, payload: object, uid: string) {
+ if (isNullOrWhiteSpace(objectName)) {
+ return Promise.reject(getValidationMessage('objectName'));
+ }
+ if (checkJson(payload)) {
+ return Promise.reject(getValidationMessage('payload'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.objectName = objectName;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/customobject';
+
+ return request(this.config, 'POST', resourcePath, queryParameters, payload);
+ }
+
+ /**
+ * This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation.
+ * @param objectName LoginRadius Custom Object Name
+ * @param objectRecordId Unique identifier of the user's record in Custom Object
+ * @param payload LoginRadius Custom Object Name
+ * @param uid UID, the unified identifier for each user account
+ * @param updateType Possible values: replace, partialreplace.
+ * @return Response containing Definition for Complete user custom object data
+ *19.2
+ */
+ updateCustomObjectByUid (
+ objectName: string,
+ objectRecordId: string,
+ payload: object,
+ uid: string,
+ updateType: string
+ ) {
+ if (isNullOrWhiteSpace(objectName)) {
+ return Promise.reject(getValidationMessage('objectName'));
+ }
+ if (isNullOrWhiteSpace(objectRecordId)) {
+ return Promise.reject(getValidationMessage('objectRecordId'));
+ }
+ if (checkJson(payload)) {
+ return Promise.reject(getValidationMessage('payload'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.objectName = objectName;
+ if (updateType !== null) {
+ queryParameters.updateType = updateType;
+ }
+
+ var resourcePath =
+ 'identity/v2/manage/account/' + uid + '/customobject/' + objectRecordId;
+
+ return request(this.config, 'PUT', resourcePath, queryParameters, payload);
+ }
+
+ /**
+ * This API is used to retrieve all the custom objects by UID from cloud storage.
+ * @param objectName LoginRadius Custom Object Name
+ * @param uid The unified identifier for each user account
+ * @return Complete user CustomObject data
+ *19.3
+ */
+ getCustomObjectByUid (objectName: string, uid: string) {
+ if (isNullOrWhiteSpace(objectName)) {
+ return Promise.reject(getValidationMessage('objectName'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.objectName = objectName;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/customobject';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to retrieve the Custom Object data for the specified account.
+ * @param objectName LoginRadius Custom Object Name
+ * @param objectRecordId Unique identifier of the user's record in Custom Object
+ * @param uid The unified identifier for each user account
+ * @return Response containing Definition for Complete user custom object data
+ *19.4
+ */
+ getCustomObjectByRecordID (objectName: string, objectRecordId: string, uid: string) {
+ if (isNullOrWhiteSpace(objectName)) {
+ return Promise.reject(getValidationMessage('objectName'));
+ }
+ if (isNullOrWhiteSpace(objectRecordId)) {
+ return Promise.reject(getValidationMessage('objectRecordId'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.objectName = objectName;
+
+ var resourcePath =
+ 'identity/v2/manage/account/' + uid + '/customobject/' + objectRecordId;
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to remove the specified Custom Object data using ObjectRecordId of specified account.
+ * @param objectName LoginRadius Custom Object Name
+ * @param objectRecordId Unique identifier of the user's record in Custom Object
+ * @param uid The unified identifier for each user account
+ * @return Response containing Definition of Delete Request
+ *19.5
+ */
+ deleteCustomObjectByRecordID (objectName: string, objectRecordId: string, uid: string) {
+ if (isNullOrWhiteSpace(objectName)) {
+ return Promise.reject(getValidationMessage('objectName'));
+ }
+ if (isNullOrWhiteSpace(objectRecordId)) {
+ return Promise.reject(getValidationMessage('objectRecordId'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.objectName = objectName;
+
+ var resourcePath =
+ 'identity/v2/manage/account/' + uid + '/customobject/' + objectRecordId;
+
+ return request(this.config, 'DELETE', resourcePath, queryParameters, null);
+ }
+}
diff --git a/loginradius-sdk/src/api/advanced/multiFactorAuthenticationApi.ts b/loginradius-sdk/src/api/advanced/multiFactorAuthenticationApi.ts
new file mode 100644
index 0000000..c37b535
--- /dev/null
+++ b/loginradius-sdk/src/api/advanced/multiFactorAuthenticationApi.ts
@@ -0,0 +1,1217 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class MultiFactorAuthenticationApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API is used to configure the Multi-factor authentication after login by using the access token when MFA is set as optional on the LoginRadius site.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param smsTemplate2FA SMS Template Name
+ * @return Response containing Definition of Complete Multi-Factor Authentication Settings data
+ *5.7
+ */
+ mfaConfigureByAccessToken (accessToken: string, smsTemplate2FA?: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(smsTemplate2FA)) {
+ queryParameters.smsTemplate2FA = smsTemplate2FA;
+ }
+
+ var resourcePath = 'identity/v2/auth/account/2fa';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to trigger the Multi-factor authentication settings after login for secure actions
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param multiFactorAuthModelWithLockout Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Response containing Definition for Complete profile data
+ *5.9
+ */
+ mfaUpdateSetting (accessToken: string, multiFactorAuthModelWithLockout: object, fields: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(multiFactorAuthModelWithLockout)) {
+ return Promise.reject(
+ getValidationMessage('multiFactorAuthModelWithLockout')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath = 'identity/v2/auth/account/2fa/verification/otp';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ multiFactorAuthModelWithLockout
+ );
+ }
+
+ /**
+ * This API is used to Enable Multi-factor authentication by access token on user login
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param multiFactorAuthModelByGoogleAuthenticatorCode Model Class containing Definition of payload for MultiFactorAuthModel By GoogleAuthenticator Code API
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param smsTemplate SMS Template name
+ * @return Response containing Definition for Complete profile data
+ *5.10
+ */
+ mfaUpdateByAccessToken (
+ accessToken: string,
+ multiFactorAuthModelByGoogleAuthenticatorCode: object,
+ fields?: string,
+ smsTemplate?: string
+ ) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(multiFactorAuthModelByGoogleAuthenticatorCode)) {
+ return Promise.reject(
+ getValidationMessage('multiFactorAuthModelByGoogleAuthenticatorCode')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var resourcePath =
+ 'identity/v2/auth/account/2fa/verification/googleauthenticatorcode';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ multiFactorAuthModelByGoogleAuthenticatorCode
+ );
+ }
+
+ /**
+ * This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param phoneNo2FA Phone Number For 2FA
+ * @param smsTemplate2FA SMS Template Name
+ * @return Response containing Definition for Complete SMS data
+ *5.11
+ */
+ mfaUpdatePhoneNumberByToken (accessToken: string, phoneNo2FA: string, smsTemplate2FA?: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(phoneNo2FA)) {
+ return Promise.reject(getValidationMessage('phoneNo2FA'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(smsTemplate2FA)) {
+ queryParameters.smsTemplate2FA = smsTemplate2FA;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.phoneNo2FA = phoneNo2FA;
+
+ var resourcePath = 'identity/v2/auth/account/2fa';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API Resets the Google Authenticator configurations on a given account via the access token
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param googleauthenticator boolean type value,Enable google Authenticator Code.
+ * @return Response containing Definition of Delete Request
+ *5.12.1
+ */
+ mfaResetGoogleAuthByToken (accessToken: string, googleauthenticator?: boolean) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var bodyParameters: any = {};
+ bodyParameters.googleauthenticator = googleauthenticator;
+
+ var resourcePath = 'identity/v2/auth/account/2fa/authenticator';
+
+ return request(
+ this.config,
+ 'DELETE',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API resets the SMS Authenticator configurations on a given account via the access token.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param otpauthenticator Pass 'otpauthenticator' to remove SMS Authenticator
+ * @return Response containing Definition of Delete Request
+ *5.12.2
+ */
+ mfaResetSMSAuthByToken (accessToken: string, otpauthenticator?: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var bodyParameters: any = {};
+ bodyParameters.otpauthenticator = otpauthenticator;
+
+ var resourcePath = 'identity/v2/auth/account/2fa/authenticator';
+
+ return request(
+ this.config,
+ 'DELETE',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to get a set of backup codes via access token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @return Response containing Definition of Complete Backup Code data
+ *5.13
+ */
+ mfaBackupCodeByAccessToken (accessToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/account/2fa/backupcode';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * API is used to reset the backup codes on a given account via the access token. This API call will generate 10 new codes, each code can only be consumed once
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @return Response containing Definition of Complete Backup Code data
+ *5.14
+ */
+ mfaResetBackupCodeByAccessToken (accessToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/account/2fa/backupcode/reset';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is created to send the OTP to the email if email OTP authenticator is enabled in app's MFA configuration.
+ * @param accessToken access_token
+ * @param emailId EmailId
+ * @param emailTemplate2FA EmailTemplate2FA
+ * @return Response containing Definition of Complete Validation data
+ *5.17
+ */
+ mfaEmailOtpByAccessToken (accessToken: string, emailId: string, emailTemplate2FA?: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(emailId)) {
+ return Promise.reject(getValidationMessage('emailId'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.emailId = emailId;
+ if (!isNullOrWhiteSpace(emailTemplate2FA)) {
+ queryParameters.emailTemplate2FA = emailTemplate2FA;
+ }
+
+ var resourcePath = 'identity/v2/auth/account/2fa/otp/email';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to set up MFA Email OTP authenticator on profile after login.
+ * @param accessToken access_token
+ * @param multiFactorAuthModelByEmailOtpWithLockout payload
+ * @return Response containing Definition for Complete profile data
+ *5.18
+ */
+ mfaValidateEmailOtpByAccessToken (
+ accessToken: string,
+ multiFactorAuthModelByEmailOtpWithLockout: any
+ ) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(multiFactorAuthModelByEmailOtpWithLockout)) {
+ return Promise.reject(
+ getValidationMessage('multiFactorAuthModelByEmailOtpWithLockout')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/account/2fa/verification/otp/email';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ multiFactorAuthModelByEmailOtpWithLockout
+ );
+ }
+
+ /**
+ * This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user
+ * @param accessToken access_token
+ * @return Response containing Definition of Delete Request
+ *5.19
+ */
+ mfaResetEmailOtpAuthenticatorByAccessToken (accessToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/account/2fa/authenticator/otp/email';
+
+ return request(this.config, 'DELETE', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to set up MFA Security Question authenticator on profile after login.
+ * @param accessToken access_token
+ * @param securityQuestionAnswerModelByAccessToken payload
+ * @return Response containing Definition of Complete Validation data
+ *5.20
+ */
+ mfaSecurityQuestionAnswerByAccessToken (
+ accessToken: string,
+ securityQuestionAnswerModelByAccessToken: any
+ ) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(securityQuestionAnswerModelByAccessToken)) {
+ return Promise.reject(
+ getValidationMessage('securityQuestionAnswerModelByAccessToken')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/account/2fa/securityquestionanswer';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ securityQuestionAnswerModelByAccessToken
+ );
+ }
+
+ /**
+ * This API is used to Reset MFA Security Question Authenticator By Access Token
+ * @param accessToken access_token
+ * @return Response containing Definition of Delete Request
+ *5.21
+ */
+ mfaResetSecurityQuestionAuthenticatorByAccessToken (accessToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath =
+ 'identity/v2/auth/account/2fa/authenticator/securityquestionanswer';
+
+ return request(this.config, 'DELETE', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site.
+ * @param email user's email
+ * @param password Password for the email
+ * @param emailTemplate Email template name
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param loginUrl Url where the user is logging from
+ * @param smsTemplate SMS Template name
+ * @param smsTemplate2FA SMS Template Name
+ * @param verificationUrl Email verification url
+ * @param emailTemplate2FA 2FA Email Template name
+ * @return Complete user UserProfile data
+ *9.8.1
+ */
+ mfaLoginByEmail (
+ email: string,
+ password: string,
+ emailTemplate: string,
+ fields: string,
+ loginUrl: string,
+ smsTemplate: string,
+ smsTemplate2FA: string,
+ verificationUrl: string,
+ emailTemplate2FA: string
+ ) {
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ if (isNullOrWhiteSpace(password)) {
+ return Promise.reject(getValidationMessage('password'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(loginUrl)) {
+ queryParameters.loginUrl = loginUrl;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate2FA)) {
+ queryParameters.smsTemplate2FA = smsTemplate2FA;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+ if (!isNullOrWhiteSpace(emailTemplate2FA)) {
+ queryParameters.emailTemplate2FA = emailTemplate2FA;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.email = email;
+ bodyParameters.password = password;
+
+ var resourcePath = 'identity/v2/auth/login/2fa';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site.
+ * @param password Password for the email
+ * @param username Username of the user
+ * @param emailTemplate Email template name
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param loginUrl Url where the user is logging from
+ * @param smsTemplate SMS Template name
+ * @param smsTemplate2FA SMS Template Name
+ * @param verificationUrl Email verification url
+ * @param emailTemplate2FA 2FA Email Template name
+ * @return Complete user UserProfile data
+ *9.8.2
+ */
+ mfaLoginByUserName (
+ password: string,
+ username: string,
+ emailTemplate?: string,
+ fields?: string,
+ loginUrl?: string,
+ smsTemplate?: string,
+ smsTemplate2FA?: string,
+ verificationUrl?: string,
+ emailTemplate2FA?: string
+ ) {
+ if (isNullOrWhiteSpace(password)) {
+ return Promise.reject(getValidationMessage('password'));
+ }
+ if (isNullOrWhiteSpace(username)) {
+ return Promise.reject(getValidationMessage('username'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(loginUrl)) {
+ queryParameters.loginUrl = loginUrl;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate2FA)) {
+ queryParameters.smsTemplate2FA = smsTemplate2FA;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+ if (!isNullOrWhiteSpace(emailTemplate2FA)) {
+ queryParameters.emailTemplate2FA = emailTemplate2FA;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.password = password;
+ bodyParameters.username = username;
+
+ var resourcePath = 'identity/v2/auth/login/2fa';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site.
+ * @param password Password for the email
+ * @param phone New Phone Number
+ * @param emailTemplate Email template name
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param loginUrl Url where the user is logging from
+ * @param smsTemplate SMS Template name
+ * @param smsTemplate2FA SMS Template Name
+ * @param verificationUrl Email verification url
+ * @param emailTemplate2FA 2FA Email Template name
+ * @return Complete user UserProfile data
+ *9.8.3
+ */
+ mfaLoginByPhone (
+ password: string,
+ phone: string,
+ emailTemplate?: string,
+ fields?: string,
+ loginUrl?: string,
+ smsTemplate?: string,
+ smsTemplate2FA?: string,
+ verificationUrl?: string,
+ emailTemplate2FA?: string
+ ) {
+ if (isNullOrWhiteSpace(password)) {
+ return Promise.reject(getValidationMessage('password'));
+ }
+ if (isNullOrWhiteSpace(phone)) {
+ return Promise.reject(getValidationMessage('phone'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(loginUrl)) {
+ queryParameters.loginUrl = loginUrl;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate2FA)) {
+ queryParameters.smsTemplate2FA = smsTemplate2FA;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+ if (!isNullOrWhiteSpace(emailTemplate2FA)) {
+ queryParameters.emailTemplate2FA = emailTemplate2FA;
+ }
+ var bodyParameters: any = {};
+ bodyParameters.password = password;
+ bodyParameters.phone = phone;
+
+ var resourcePath = 'identity/v2/auth/login/2fa';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to login via Multi-factor authentication by passing the One Time Password received via SMS
+ * @param multiFactorAuthModelWithLockout Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API
+ * @param secondFactorAuthenticationToken A Uniquely generated MFA identifier token after successful authentication
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param smsTemplate2FA SMS Template Name
+ * @param rbaBrowserEmailTemplate
+ * @param rbaCityEmailTemplate
+ * @param rbaCountryEmailTemplate
+ * @param rbaIpEmailTemplate
+ * @return Complete user UserProfile data
+ *9.12
+ */
+ mfaValidateOTPByPhone (
+ multiFactorAuthModelWithLockout: object,
+ secondFactorAuthenticationToken: string,
+ fields?: string,
+ smsTemplate2FA?: string,
+ rbaBrowserEmailTemplate?: string,
+ rbaCityEmailTemplate?: string,
+ rbaCountryEmailTemplate?: string,
+ rbaIpEmailTemplate?: string
+ ) {
+ if (checkJson(multiFactorAuthModelWithLockout)) {
+ return Promise.reject(
+ getValidationMessage('multiFactorAuthModelWithLockout')
+ );
+ }
+ if (isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
+ return Promise.reject(
+ getValidationMessage('secondFactorAuthenticationToken')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.secondFactorAuthenticationToken =
+ secondFactorAuthenticationToken;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate2FA)) {
+ queryParameters.smsTemplate2FA = smsTemplate2FA;
+ }
+ if (!isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
+ queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCityEmailTemplate)) {
+ queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
+ queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaIpEmailTemplate)) {
+ queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/2fa/verification/otp';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ multiFactorAuthModelWithLockout
+ );
+ }
+
+ /**
+ * This API is used to login via Multi-factor-authentication by passing the google authenticator code.
+ * @param googleAuthenticatorCode The code generated by google authenticator app after scanning QR code
+ * @param secondFactorAuthenticationToken SecondFactorAuthenticationToken
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param rbaBrowserEmailTemplate RbaBrowserEmailTemplate
+ * @param rbaCityEmailTemplate RbaCityEmailTemplate
+ * @param rbaCountryEmailTemplate RbaCountryEmailTemplate
+ * @param rbaIpEmailTemplate RbaIpEmailTemplate
+ * @return Complete user UserProfile data
+ *9.13
+ */
+ mfaValidateGoogleAuthCode (
+ googleAuthenticatorCode: string,
+ secondFactorAuthenticationToken: string,
+ fields?: string,
+ rbaBrowserEmailTemplate?: string,
+ rbaCityEmailTemplate?: string,
+ rbaCountryEmailTemplate?: string,
+ rbaIpEmailTemplate?: string
+ ) {
+ if (isNullOrWhiteSpace(googleAuthenticatorCode)) {
+ return Promise.reject(getValidationMessage('googleAuthenticatorCode'));
+ }
+ if (isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
+ return Promise.reject(
+ getValidationMessage('secondFactorAuthenticationToken')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.secondFactorAuthenticationToken =
+ secondFactorAuthenticationToken;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
+ queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCityEmailTemplate)) {
+ queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
+ queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaIpEmailTemplate)) {
+ queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.googleAuthenticatorCode = googleAuthenticatorCode;
+
+ var resourcePath =
+ 'identity/v2/auth/login/2fa/verification/googleauthenticatorcode';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to validate the backup code provided by the user and if valid, we return an access token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
+ * @param multiFactorAuthModelByBackupCode Model Class containing Definition of payload for MultiFactorAuth By BackupCode API
+ * @param secondFactorAuthenticationToken A Uniquely generated MFA identifier token after successful authentication
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param rbaBrowserEmailTemplate
+ * @param rbaCityEmailTemplate
+ * @param rbaCountryEmailTemplate
+ * @param rbaIpEmailTemplate
+ * @return Complete user UserProfile data
+ *9.14
+ */
+ mfaValidateBackupCode (
+ multiFactorAuthModelByBackupCode: object,
+ secondFactorAuthenticationToken: string,
+ fields?: string,
+ rbaBrowserEmailTemplate?: string,
+ rbaCityEmailTemplate?: string,
+ rbaCountryEmailTemplate?: string,
+ rbaIpEmailTemplate?: string
+ ) {
+ if (checkJson(multiFactorAuthModelByBackupCode)) {
+ return Promise.reject(
+ getValidationMessage('multiFactorAuthModelByBackupCode')
+ );
+ }
+ if (isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
+ return Promise.reject(
+ getValidationMessage('secondFactorAuthenticationToken')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.secondFactorAuthenticationToken =
+ secondFactorAuthenticationToken;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
+ queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCityEmailTemplate)) {
+ queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
+ queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaIpEmailTemplate)) {
+ queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/2fa/verification/backupcode';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ multiFactorAuthModelByBackupCode
+ );
+ }
+
+ /**
+ * This API is used to update (if configured) the phone number used for Multi-factor authentication by sending the verification OTP to the provided phone number
+ * @param phoneNo2FA Phone Number For 2FA
+ * @param secondFactorAuthenticationToken A Uniquely generated MFA identifier token after successful authentication
+ * @param smsTemplate2FA SMS Template Name
+ * @return Response containing Definition for Complete SMS data
+ *9.16
+ */
+ mfaUpdatePhoneNumber (
+ phoneNo2FA: string,
+ secondFactorAuthenticationToken: string,
+ smsTemplate2FA?: string
+ ) {
+ if (isNullOrWhiteSpace(phoneNo2FA)) {
+ return Promise.reject(getValidationMessage('phoneNo2FA'));
+ }
+ if (isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
+ return Promise.reject(
+ getValidationMessage('secondFactorAuthenticationToken')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.secondFactorAuthenticationToken =
+ secondFactorAuthenticationToken;
+ if (!isNullOrWhiteSpace(smsTemplate2FA)) {
+ queryParameters.smsTemplate2FA = smsTemplate2FA;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.phoneNo2FA = phoneNo2FA;
+
+ var resourcePath = 'identity/v2/auth/login/2fa';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to resending the verification OTP to the provided phone number
+ * @param secondFactorAuthenticationToken A Uniquely generated MFA identifier token after successful authentication
+ * @param smsTemplate2FA SMS Template Name
+ * @return Response containing Definition for Complete SMS data
+ *9.17
+ */
+ mfaResendOTP (secondFactorAuthenticationToken, smsTemplate2FA) {
+ if (isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
+ return Promise.reject(
+ getValidationMessage('secondFactorAuthenticationToken')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.secondFactorAuthenticationToken =
+ secondFactorAuthenticationToken;
+ if (!isNullOrWhiteSpace(smsTemplate2FA)) {
+ queryParameters.smsTemplate2FA = smsTemplate2FA;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/2fa/resend';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * An API designed to send the MFA Email OTP to the email.
+ * @param emailIdModel payload
+ * @param secondFactorAuthenticationToken SecondFactorAuthenticationToken
+ * @param emailTemplate2FA EmailTemplate2FA
+ * @return Response containing Definition of Complete Validation data
+ *9.18
+ */
+ mfaEmailOTP (emailIdModel: object, secondFactorAuthenticationToken: string, emailTemplate2FA?: string) {
+ if (checkJson(emailIdModel)) {
+ return Promise.reject(getValidationMessage('emailIdModel'));
+ }
+ if (isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
+ return Promise.reject(
+ getValidationMessage('secondFactorAuthenticationToken')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.secondFactorAuthenticationToken =
+ secondFactorAuthenticationToken;
+ if (!isNullOrWhiteSpace(emailTemplate2FA)) {
+ queryParameters.emailTemplate2FA = emailTemplate2FA;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/2fa/otp/email';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ emailIdModel
+ );
+ }
+
+ /**
+ * This API is used to Verify MFA Email OTP by MFA Token
+ * @param multiFactorAuthModelByEmailOtp payload
+ * @param secondFactorAuthenticationToken SecondFactorAuthenticationToken
+ * @param rbaBrowserEmailTemplate RbaBrowserEmailTemplate
+ * @param rbaCityEmailTemplate RbaCityEmailTemplate
+ * @param rbaCountryEmailTemplate RbaCountryEmailTemplate
+ * @param rbaIpEmailTemplate RbaIpEmailTemplate
+ * @return Response Containing Access Token and Complete Profile Data
+ *9.25
+ */
+ mfaValidateEmailOtp (
+ multiFactorAuthModelByEmailOtp: object,
+ secondFactorAuthenticationToken: string,
+ rbaBrowserEmailTemplate?: string,
+ rbaCityEmailTemplate?: string,
+ rbaCountryEmailTemplate?: string,
+ rbaIpEmailTemplate?: string
+ ) {
+ if (checkJson(multiFactorAuthModelByEmailOtp)) {
+ return Promise.reject(
+ getValidationMessage('multiFactorAuthModelByEmailOtp')
+ );
+ }
+ if (isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
+ return Promise.reject(
+ getValidationMessage('secondFactorAuthenticationToken')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.secondFactorAuthenticationToken =
+ secondFactorAuthenticationToken;
+ if (!isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
+ queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCityEmailTemplate)) {
+ queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
+ queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaIpEmailTemplate)) {
+ queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/2fa/verification/otp/email';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ multiFactorAuthModelByEmailOtp
+ );
+ }
+
+ /**
+ * This API is used to set the security questions on the profile with the MFA token when MFA flow is required.
+ * @param securityQuestionAnswerUpdateModel payload
+ * @param secondFactorAuthenticationToken SecondFactorAuthenticationToken
+ * @return Response Containing Access Token and Complete Profile Data
+ *9.26
+ */
+ mfaSecurityQuestionAnswer (
+ securityQuestionAnswerUpdateModel: object,
+ secondFactorAuthenticationToken: string
+ ) {
+ if (checkJson(securityQuestionAnswerUpdateModel)) {
+ return Promise.reject(
+ getValidationMessage('securityQuestionAnswerUpdateModel')
+ );
+ }
+ if (isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
+ return Promise.reject(
+ getValidationMessage('secondFactorAuthenticationToken')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.secondFactorAuthenticationToken =
+ secondFactorAuthenticationToken;
+
+ var resourcePath = 'identity/v2/auth/login/2fa/securityquestionanswer';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ securityQuestionAnswerUpdateModel
+ );
+ }
+
+ /**
+ * This API is used to resending the verification OTP to the provided phone number
+ * @param securityQuestionAnswerUpdateModel payload
+ * @param secondFactorAuthenticationToken SecondFactorAuthenticationToken
+ * @param rbaBrowserEmailTemplate RbaBrowserEmailTemplate
+ * @param rbaCityEmailTemplate RbaCityEmailTemplate
+ * @param rbaCountryEmailTemplate RbaCountryEmailTemplate
+ * @param rbaIpEmailTemplate RbaIpEmailTemplate
+ * @return Response Containing Access Token and Complete Profile Data
+ *9.27
+ */
+ mfaSecurityQuestionAnswerVerification (
+ securityQuestionAnswerUpdateModel: object,
+ secondFactorAuthenticationToken: string,
+ rbaBrowserEmailTemplate?: string,
+ rbaCityEmailTemplate?: string,
+ rbaCountryEmailTemplate?: string,
+ rbaIpEmailTemplate?: string
+ ) {
+ if (checkJson(securityQuestionAnswerUpdateModel)) {
+ return Promise.reject(
+ getValidationMessage('securityQuestionAnswerUpdateModel')
+ );
+ }
+ if (isNullOrWhiteSpace(secondFactorAuthenticationToken)) {
+ return Promise.reject(
+ getValidationMessage('secondFactorAuthenticationToken')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.secondFactorAuthenticationToken =
+ secondFactorAuthenticationToken;
+ if (!isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
+ queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCityEmailTemplate)) {
+ queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
+ queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaIpEmailTemplate)) {
+ queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
+ }
+
+ var resourcePath =
+ 'identity/v2/auth/login/2fa/verification/securityquestionanswer';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ securityQuestionAnswerUpdateModel
+ );
+ }
+
+ /**
+ * This API resets the SMS Authenticator configurations on a given account via the UID.
+ * @param otpauthenticator Pass 'otpauthenticator' to remove SMS Authenticator
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition of Delete Request
+ *18.21.1
+ */
+ mfaResetSMSAuthenticatorByUid (otpauthenticator: string, uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.uid = uid;
+
+ var bodyParameters: any = {};
+ bodyParameters.otpauthenticator = otpauthenticator;
+
+ var resourcePath = 'identity/v2/manage/account/2fa/authenticator';
+
+ return request(
+ this.config,
+ 'DELETE',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API resets the Google Authenticator configurations on a given account via the UID.
+ * @param googleauthenticator boolean type value,Enable google Authenticator Code.
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition of Delete Request
+ *18.21.2
+ */
+ mfaResetGoogleAuthenticatorByUid (googleauthenticator: boolean, uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.uid = uid;
+
+ var bodyParameters: any = {};
+ bodyParameters.googleauthenticator = googleauthenticator;
+
+ var resourcePath = 'identity/v2/manage/account/2fa/authenticator';
+
+ return request(
+ this.config,
+ 'DELETE',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once.
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition of Complete Backup Code data
+ *18.25
+ */
+ mfaBackupCodeByUid (uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.uid = uid;
+
+ var resourcePath = 'identity/v2/manage/account/2fa/backupcode';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once.
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition of Complete Backup Code data
+ *18.26
+ */
+ mfaResetBackupCodeByUid (uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.uid = uid;
+
+ var resourcePath = 'identity/v2/manage/account/2fa/backupcode/reset';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user.
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition of Delete Request
+ *18.42
+ */
+ mfaResetEmailOtpAuthenticatorByUid (uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.uid = uid;
+
+ var resourcePath = 'identity/v2/manage/account/2fa/authenticator/otp/email';
+
+ return request(this.config, 'DELETE', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to reset the Security Question Authenticator settings for an MFA-enabled user.
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition of Delete Request
+ *18.43
+ */
+ mfaResetSecurityQuestionAuthenticatorByUid (uid: string) {
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+ queryParameters.uid = uid;
+
+ var resourcePath =
+ 'identity/v2/manage/account/2fa/authenticator/securityquestionanswer';
+
+ return request(this.config, 'DELETE', resourcePath, queryParameters, null);
+ }
+}
diff --git a/loginradius-sdk/src/api/advanced/reAuthenticationApi.ts b/loginradius-sdk/src/api/advanced/reAuthenticationApi.ts
new file mode 100644
index 0000000..2d8a046
--- /dev/null
+++ b/loginradius-sdk/src/api/advanced/reAuthenticationApi.ts
@@ -0,0 +1,398 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class ReAuthenticationApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API is used to trigger the Multi-Factor Autentication workflow for the provided access token
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param smsTemplate2FA SMS Template Name
+ * @return Response containing Definition of Complete Multi-Factor Authentication Settings data
+ *14.3
+ */
+ mfaReAuthenticate (accessToken: string, smsTemplate2FA?: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(smsTemplate2FA)) {
+ queryParameters.smsTemplate2FA = smsTemplate2FA;
+ }
+
+ var resourcePath = 'identity/v2/auth/account/reauth/2fa';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param reauthByOtpModel Model Class containing Definition for MFA Reauthentication by OTP
+ * @return Complete user Multi-Factor Authentication Token data
+ *14.4
+ */
+ mfaReAuthenticateByOTP (accessToken: string, reauthByOtpModel: object) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(reauthByOtpModel)) {
+ return Promise.reject(getValidationMessage('reauthByOtpModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/account/reauth/2fa/otp';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ reauthByOtpModel
+ );
+ }
+
+ /**
+ * This API is used to re-authenticate by set of backup codes via access token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param reauthByBackupCodeModel Model Class containing Definition for MFA Reauthentication by Backup code
+ * @return Complete user Multi-Factor Authentication Token data
+ *14.5
+ */
+ mfaReAuthenticateByBackupCode (accessToken: string, reauthByBackupCodeModel: object) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(reauthByBackupCodeModel)) {
+ return Promise.reject(getValidationMessage('reauthByBackupCodeModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/account/reauth/2fa/backupcode';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ reauthByBackupCodeModel
+ );
+ }
+
+ /**
+ * This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param reauthByGoogleAuthenticatorCodeModel Model Class containing Definition for MFA Reauthentication by Google Authenticator
+ * @return Complete user Multi-Factor Authentication Token data
+ *14.6
+ */
+ mfaReAuthenticateByGoogleAuth (
+ accessToken: string,
+ reauthByGoogleAuthenticatorCodeModel: object
+ ) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(reauthByGoogleAuthenticatorCodeModel)) {
+ return Promise.reject(
+ getValidationMessage('reauthByGoogleAuthenticatorCodeModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath =
+ 'identity/v2/auth/account/reauth/2fa/googleauthenticatorcode';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ reauthByGoogleAuthenticatorCodeModel
+ );
+ }
+
+ /**
+ * This API is used to re-authenticate via Multi-factor-authentication by passing the password
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param passwordEventBasedAuthModelWithLockout Model Class containing Definition of payload for PasswordEventBasedAuthModel with Lockout API
+ * @param smsTemplate2FA SMS Template Name
+ * @return Complete user Multi-Factor Authentication Token data
+ *14.7
+ */
+ mfaReAuthenticateByPassword (
+ accessToken: string,
+ passwordEventBasedAuthModelWithLockout: object,
+ smsTemplate2FA?: string
+ ) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(passwordEventBasedAuthModelWithLockout)) {
+ return Promise.reject(
+ getValidationMessage('passwordEventBasedAuthModelWithLockout')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(smsTemplate2FA)) {
+ queryParameters.smsTemplate2FA = smsTemplate2FA;
+ }
+
+ var resourcePath = 'identity/v2/auth/account/reauth/password';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ passwordEventBasedAuthModelWithLockout
+ );
+ }
+
+ /**
+ * This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by OTP.
+ * @param eventBasedMultiFactorToken Model Class containing Definition for SecondFactorValidationToken
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition of Complete Validation data
+ *18.38
+ */
+ verifyMultiFactorOtpReauthentication (eventBasedMultiFactorToken, uid) {
+ if (checkJson(eventBasedMultiFactorToken)) {
+ return Promise.reject(getValidationMessage('eventBasedMultiFactorToken'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/reauth/2fa';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ eventBasedMultiFactorToken
+ );
+ }
+
+ /**
+ * This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by password.
+ * @param eventBasedMultiFactorToken Model Class containing Definition for SecondFactorValidationToken
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition of Complete Validation data
+ *18.39
+ */
+ verifyMultiFactorPasswordReauthentication (eventBasedMultiFactorToken, uid) {
+ if (checkJson(eventBasedMultiFactorToken)) {
+ return Promise.reject(getValidationMessage('eventBasedMultiFactorToken'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/reauth/password';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ eventBasedMultiFactorToken
+ );
+ }
+
+ /**
+ * This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by PIN.
+ * @param eventBasedMultiFactorToken Model Class containing Definition for SecondFactorValidationToken
+ * @param uid UID, the unified identifier for each user account
+ * @return Response containing Definition of Complete Validation data
+ *18.40
+ */
+ verifyMultiFactorPINReauthentication (eventBasedMultiFactorToken, uid) {
+ if (checkJson(eventBasedMultiFactorToken)) {
+ return Promise.reject(getValidationMessage('eventBasedMultiFactorToken'));
+ }
+ if (isNullOrWhiteSpace(uid)) {
+ return Promise.reject(getValidationMessage('uid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.apiSecret = this.config.apiSecret;
+
+ var resourcePath = 'identity/v2/manage/account/' + uid + '/reauth/pin';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ eventBasedMultiFactorToken
+ );
+ }
+
+ /**
+ * This API is used to validate the triggered MFA authentication flow with a password.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param pINAuthEventBasedAuthModelWithLockout Model Class containing Definition of payload for PIN
+ * @param smsTemplate2FA SMS Template Name
+ * @return Response containing Definition response of MFA reauthentication
+ *42.13
+ */
+ verifyPINAuthentication (
+ accessToken,
+ pINAuthEventBasedAuthModelWithLockout,
+ smsTemplate2FA
+ ) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(pINAuthEventBasedAuthModelWithLockout)) {
+ return Promise.reject(
+ getValidationMessage('pINAuthEventBasedAuthModelWithLockout')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(smsTemplate2FA)) {
+ queryParameters.smsTemplate2FA = smsTemplate2FA;
+ }
+
+ var resourcePath = 'identity/v2/auth/account/reauth/pin';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ pINAuthEventBasedAuthModelWithLockout
+ );
+ }
+
+ /**
+ * This API is used to validate the triggered MFA authentication flow with an Email OTP.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param reauthByEmailOtpModel payload
+ * @return Response containing Definition response of MFA reauthentication
+ *42.14
+ */
+ reAuthValidateEmailOtp (accessToken, reauthByEmailOtpModel) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(reauthByEmailOtpModel)) {
+ return Promise.reject(getValidationMessage('reauthByEmailOtpModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/account/reauth/2fa/otp/email/verify';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ reauthByEmailOtpModel
+ );
+ }
+
+ /**
+ * This API is used to send the MFA Email OTP to the email for Re-authentication
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param emailId EmailId
+ * @param emailTemplate2FA EmailTemplate2FA
+ * @return Response containing Definition of Complete Validation data
+ *42.15
+ */
+ reAuthSendEmailOtp (accessToken, emailId, emailTemplate2FA) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(emailId)) {
+ return Promise.reject(getValidationMessage('emailId'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.emailId = emailId;
+ if (!isNullOrWhiteSpace(emailTemplate2FA)) {
+ queryParameters.emailTemplate2FA = emailTemplate2FA;
+ }
+
+ var resourcePath = 'identity/v2/auth/account/reauth/2fa/otp/email';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to validate the triggered MFA re-authentication flow with security questions answers.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param securityQuestionAnswerUpdateModel payload
+ * @return Response containing Definition response of MFA reauthentication
+ *42.16
+ */
+ reAuthBySecurityQuestion (accessToken, securityQuestionAnswerUpdateModel) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(securityQuestionAnswerUpdateModel)) {
+ return Promise.reject(
+ getValidationMessage('securityQuestionAnswerUpdateModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath =
+ 'identity/v2/auth/account/reauth/2fa/securityquestionanswer/verify';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ securityQuestionAnswerUpdateModel
+ );
+ }
+}
diff --git a/loginradius-sdk/src/api/advanced/webHookApi.ts b/loginradius-sdk/src/api/advanced/webHookApi.ts
new file mode 100644
index 0000000..8263e97
--- /dev/null
+++ b/loginradius-sdk/src/api/advanced/webHookApi.ts
@@ -0,0 +1,105 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class WebHookApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API is used to fatch all the subscribed URLs, for particular event
+ * @param event Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject
+ * @return Response Containing List of Webhhook Data
+ *40.1
+ */
+ getWebHookSubscribedURLs (event: string) {
+ if (isNullOrWhiteSpace(event)) {
+ return Promise.reject(getValidationMessage('event'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apikey = this.config.apiKey;
+ queryParameters.apisecret = this.config.apiSecret;
+ queryParameters.event = event;
+
+ var resourcePath = 'api/v2/webhook';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * API can be used to configure a WebHook on your LoginRadius site. Webhooks also work on subscribe and notification model, subscribe your hook and get a notification. Equivalent to RESThook but these provide security on basis of signature and RESThook work on unique URL. Following are the events that are allowed by LoginRadius to trigger a WebHook service call.
+ * @param webHookSubscribeModel Model Class containing Definition of payload for Webhook Subscribe API
+ * @return Response containing Definition of Complete Validation data
+ *40.2
+ */
+ webHookSubscribe (webHookSubscribeModel: object) {
+ if (checkJson(webHookSubscribeModel)) {
+ return Promise.reject(getValidationMessage('webHookSubscribeModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apikey = this.config.apiKey;
+ queryParameters.apisecret = this.config.apiSecret;
+
+ var resourcePath = 'api/v2/webhook';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ webHookSubscribeModel
+ );
+ }
+
+ /**
+ * API can be used to test a subscribed WebHook.
+ * @return Response containing Definition of Complete Validation data
+ *40.3
+ */
+ webhookTest () {
+ var queryParameters: any = {};
+
+ queryParameters.apikey = this.config.apiKey;
+ queryParameters.apisecret = this.config.apiSecret;
+
+ var resourcePath = 'api/v2/webhook/test';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * API can be used to unsubscribe a WebHook configured on your LoginRadius site.
+ * @param webHookSubscribeModel Model Class containing Definition of payload for Webhook Subscribe API
+ * @return Response containing Definition of Delete Request
+ *40.4
+ */
+ webHookUnsubscribe (webHookSubscribeModel: object) {
+ if (checkJson(webHookSubscribeModel)) {
+ return Promise.reject(getValidationMessage('webHookSubscribeModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apikey = this.config.apiKey;
+ queryParameters.apisecret = this.config.apiSecret;
+
+ var resourcePath = 'api/v2/webhook';
+
+ return request(
+ this.config,
+ 'DELETE',
+ resourcePath,
+ queryParameters,
+ webHookSubscribeModel
+ );
+ }
+}
diff --git a/loginradius-sdk/src/api/authentication/authenticationApi.ts b/loginradius-sdk/src/api/authentication/authenticationApi.ts
new file mode 100644
index 0000000..8e5e538
--- /dev/null
+++ b/loginradius-sdk/src/api/authentication/authenticationApi.ts
@@ -0,0 +1,1272 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class AuthenticationApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API is used to retrieve the list of questions that are configured on the respective LoginRadius site.
+ * @param email Email of the user
+ * @return Response containing Definition for Complete SecurityQuestions data
+ *2.1
+ */
+ getSecurityQuestionsByEmail (email: string) {
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.email = email;
+
+ var resourcePath = 'identity/v2/auth/securityquestion/email';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to retrieve the list of questions that are configured on the respective LoginRadius site.
+ * @param userName UserName of the user
+ * @return Response containing Definition for Complete SecurityQuestions data
+ *2.2
+ */
+ getSecurityQuestionsByUserName (userName: string) {
+ if (isNullOrWhiteSpace(userName)) {
+ return Promise.reject(getValidationMessage('userName'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.userName = userName;
+
+ var resourcePath = 'identity/v2/auth/securityquestion/username';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to retrieve the list of questions that are configured on the respective LoginRadius site.
+ * @param phone The Registered Phone Number
+ * @return Response containing Definition for Complete SecurityQuestions data
+ *2.3
+ */
+ getSecurityQuestionsByPhone (phone: string) {
+ if (isNullOrWhiteSpace(phone)) {
+ return Promise.reject(getValidationMessage('phone'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.phone = phone;
+
+ var resourcePath = 'identity/v2/auth/securityquestion/phone';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to retrieve the list of questions that are configured on the respective LoginRadius site.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @return Response containing Definition for Complete SecurityQuestions data
+ *2.4
+ */
+ getSecurityQuestionsByAccessToken (accessToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/securityquestion/accesstoken';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This api validates access token, if valid then returns a response with its expiry otherwise error.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @return Response containing Definition of Complete Token data
+ *4.1
+ */
+ authValidateAccessToken (accessToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/access_token/validate';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This api call invalidates the active access token or expires an access token's validity.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param preventRefresh Boolean value that when set as true, in addition of the access token being invalidated, it will no longer have the capability of being refreshed.
+ * @return Response containing Definition of Complete Validation data
+ *4.2
+ this.config.this.config.*/
+ authInValidateAccessToken (accessToken: string, preventRefresh: boolean) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (preventRefresh !== null) {
+ queryParameters.preventRefresh = preventRefresh;
+ }
+
+ var resourcePath = 'identity/v2/auth/access_token/invalidate';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This api call provide the active access token Information
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @return Response containing Definition of Token Information
+ *4.3
+ */
+ getAccessTokenInfo (accessToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/access_token';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API retrieves a copy of the user data based on the access token.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param emailTemplate
+ * @param verificationUrl
+ * @param welcomeEmailTemplate
+ * @return Response containing Definition for Complete profile data
+ *5.2
+ */
+ getProfileByAccessToken (
+ accessToken: string,
+ fields?: string,
+ emailTemplate?: string,
+ verificationUrl?: string,
+ welcomeEmailTemplate?: string
+ ) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/account';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API sends a welcome email
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param welcomeEmailTemplate Name of the welcome email template
+ * @return Response containing Definition of Complete Validation data
+ *5.3
+ */
+ sendWelcomeEmail (accessToken: string, welcomeEmailTemplate?: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/account/sendwelcomeemail';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to update the user's profile by passing the access token.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param userProfileUpdateModel Model Class containing Definition of payload for User Profile update API
+ * @param emailTemplate Email template name
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param nullSupport Boolean, pass true if you wish to update any user profile field with a NULL value, You can get the details
+ * @param smsTemplate SMS Template name
+ * @param verificationUrl Email verification url
+ * @return Response containing Definition of Complete Validation and UserProfile data
+ *5.4
+ */
+ updateProfileByAccessToken (
+ accessToken: string,
+ userProfileUpdateModel: object,
+ emailTemplate?: string,
+ fields?: string,
+ nullSupport?: boolean,
+ smsTemplate?: string,
+ verificationUrl?: string
+ ) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(userProfileUpdateModel)) {
+ return Promise.reject(getValidationMessage('userProfileUpdateModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (nullSupport !== null) {
+ queryParameters.nullSupport = nullSupport;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+
+ var resourcePath = 'identity/v2/auth/account';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ userProfileUpdateModel
+ );
+ }
+
+ /**
+ * This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param deleteUrl Url of the site
+ * @param emailTemplate Email template name
+ * @return Response containing Definition of Delete Request
+ *5.5
+ */
+ deleteAccountWithEmailConfirmation (accessToken: string, deleteUrl?: string, emailTemplate?: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(deleteUrl)) {
+ queryParameters.deleteUrl = deleteUrl;
+ }
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/account';
+
+ return request(this.config, 'DELETE', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to delete an account by passing it a delete token.
+ * @param deletetoken Delete token received in the email
+ * @return Response containing Definition of Complete Validation data
+ *5.6
+ */
+ deleteAccountByDeleteToken (deletetoken: string) {
+ if (isNullOrWhiteSpace(deletetoken)) {
+ return Promise.reject(getValidationMessage('deletetoken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.deletetoken = deletetoken;
+
+ var resourcePath = 'identity/v2/auth/account/delete';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to allow a customer with a valid access token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param unlockProfileModel Payload containing Unlock Profile API
+ * @return Response containing Definition of Complete Validation data
+ *5.15
+ */
+ unlockAccountByToken (accessToken: string, unlockProfileModel: object) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(unlockProfileModel)) {
+ return Promise.reject(getValidationMessage('unlockProfileModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/account/unlock';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ unlockProfileModel
+ );
+ }
+
+ /**
+ * This API is used to get a user's profile using the clientGuid parameter if no callback feature enabled
+ * @param clientGuid ClientGuid
+ * @param emailTemplate EmailTemplate
+ * @param fields Fields
+ * @param verificationUrl VerificationUrl
+ * @param welcomeEmailTemplate WelcomeEmailTemplate
+ * @return Response containing User Profile Data and access token
+ *5.16
+ */
+ getProfileByPing (
+ clientGuid: string,
+ emailTemplate?: string,
+ fields?: string,
+ verificationUrl?: string,
+ welcomeEmailTemplate?: string
+ ) {
+ if (isNullOrWhiteSpace(clientGuid)) {
+ return Promise.reject(getValidationMessage('clientGuid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.clientGuid = clientGuid;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/account/ping';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to check the email exists or not on your site.
+ * @param email Email of the user
+ * @return Response containing Definition Complete ExistResponse data
+ *8.1
+ */
+ checkEmailAvailability (email: string) {
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.email = email;
+
+ var resourcePath = 'identity/v2/auth/email';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to verify the email of user. Note: This API will only return the full profile if you have 'Enable auto login after email verification' set in your LoginRadius Admin Console's Email Workflow settings under 'Verification Email'.
+ * @param verificationToken Verification token received in the email
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param url Mention URL to log the main URL(Domain name) in Database.
+ * @param welcomeEmailTemplate Name of the welcome email template
+ * @return Response containing Definition of Complete Validation, UserProfile data and Access Token
+ *8.2
+ */
+ verifyEmail (verificationToken: string, fields?: string, url?: string, welcomeEmailTemplate?: string) {
+ if (isNullOrWhiteSpace(verificationToken)) {
+ return Promise.reject(getValidationMessage('verificationToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.verificationToken = verificationToken;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(url)) {
+ queryParameters.url = url;
+ }
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/email';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to verify the email of user when the OTP Email verification flow is enabled, please note that you must contact LoginRadius to have this feature enabled.
+ * @param emailVerificationByOtpModel Model Class containing Definition for EmailVerificationByOtpModel API
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param url Mention URL to log the main URL(Domain name) in Database.
+ * @param welcomeEmailTemplate Name of the welcome email template
+ * @return Response containing Definition of Complete Validation, UserProfile data and Access Token
+ *8.3
+ */
+ verifyEmailByOTP (
+ emailVerificationByOtpModel: object,
+ fields?: string,
+ url?: string,
+ welcomeEmailTemplate?: string
+ ) {
+ if (checkJson(emailVerificationByOtpModel)) {
+ return Promise.reject(
+ getValidationMessage('emailVerificationByOtpModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(url)) {
+ queryParameters.url = url;
+ }
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/email';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ emailVerificationByOtpModel
+ );
+ }
+
+ /**
+ * This API is used to add additional emails to a user's account.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param email user's email
+ * @param type String to identify the type of parameter
+ * @param emailTemplate Email template name
+ * @param verificationUrl Email verification url
+ * @return Response containing Definition of Complete Validation data
+ *8.5
+ */
+ addEmail (accessToken: string, email: string, type: string, emailTemplate: string, verificationUrl: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ if (isNullOrWhiteSpace(type)) {
+ return Promise.reject(getValidationMessage('type'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.email = email;
+ bodyParameters.type = type;
+
+ var resourcePath = 'identity/v2/auth/email';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to remove additional emails from a user's account.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param email user's email
+ * @return Response containing Definition of Delete Request
+ *8.6
+ */
+ removeEmail (accessToken: string, email: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var bodyParameters: any = {};
+ bodyParameters.email = email;
+
+ var resourcePath = 'identity/v2/auth/email';
+
+ return request(
+ this.config,
+ 'DELETE',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API retrieves a copy of the user data based on the Email
+ * @param emailAuthenticationModel Model Class containing Definition of payload for Email Authentication API
+ * @param emailTemplate Email template name
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param loginUrl Url where the user is logging from
+ * @param verificationUrl Email verification url
+ * @return Response containing User Profile Data and access token
+ *9.2.1
+ */
+ loginByEmail (
+ emailAuthenticationModel: object,
+ emailTemplate?: string,
+ fields?: string,
+ loginUrl?: string,
+ verificationUrl?: string
+ ) {
+ if (checkJson(emailAuthenticationModel)) {
+ return Promise.reject(getValidationMessage('emailAuthenticationModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(loginUrl)) {
+ queryParameters.loginUrl = loginUrl;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+
+ var resourcePath = 'identity/v2/auth/login';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ emailAuthenticationModel
+ );
+ }
+
+ /**
+ * This API retrieves a copy of the user data based on the Username
+ * @param userNameAuthenticationModel Model Class containing Definition of payload for Username Authentication API
+ * @param emailTemplate Email template name
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param loginUrl Url where the user is logging from
+ * @param verificationUrl Email verification url
+ * @return Response containing User Profile Data and access token
+ *9.2.2
+ */
+ loginByUserName (
+ userNameAuthenticationModel: object,
+ emailTemplate?: string,
+ fields?: string,
+ loginUrl?: string,
+ verificationUrl?: string
+ ) {
+ if (checkJson(userNameAuthenticationModel)) {
+ return Promise.reject(
+ getValidationMessage('userNameAuthenticationModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(loginUrl)) {
+ queryParameters.loginUrl = loginUrl;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+
+ var resourcePath = 'identity/v2/auth/login';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ userNameAuthenticationModel
+ );
+ }
+
+ /**
+ * This API is used to send the reset password url to a specified account. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username'
+ * @param email user's email
+ * @param resetPasswordUrl Url to which user should get re-directed to for resetting the password
+ * @param emailTemplate Email template name
+ * @return Response containing Definition of Complete Validation data
+ *10.1
+ */
+ forgotPassword (email: string, resetPasswordUrl: string, emailTemplate?: string) {
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ if (isNullOrWhiteSpace(resetPasswordUrl)) {
+ return Promise.reject(getValidationMessage('resetPasswordUrl'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.resetPasswordUrl = resetPasswordUrl;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.email = email;
+
+ var resourcePath = 'identity/v2/auth/password';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to reset password for the specified account by security question
+ * @param resetPasswordBySecurityAnswerAndEmailModel Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndEmail API
+ * @return Response containing Definition of Validation data and access token
+ *10.3.1
+ */
+ resetPasswordBySecurityAnswerAndEmail (
+ resetPasswordBySecurityAnswerAndEmailModel: object
+ ) {
+ if (checkJson(resetPasswordBySecurityAnswerAndEmailModel)) {
+ return Promise.reject(
+ getValidationMessage('resetPasswordBySecurityAnswerAndEmailModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/password/securityanswer';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPasswordBySecurityAnswerAndEmailModel
+ );
+ }
+
+ /**
+ * This API is used to reset password for the specified account by security question
+ * @param resetPasswordBySecurityAnswerAndPhoneModel Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndPhone API
+ * @return Response containing Definition of Validation data and access token
+ *10.3.2
+ */
+ resetPasswordBySecurityAnswerAndPhone (
+ resetPasswordBySecurityAnswerAndPhoneModel: object
+ ) {
+ if (checkJson(resetPasswordBySecurityAnswerAndPhoneModel)) {
+ return Promise.reject(
+ getValidationMessage('resetPasswordBySecurityAnswerAndPhoneModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/password/securityanswer';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPasswordBySecurityAnswerAndPhoneModel
+ );
+ }
+
+ /**
+ * This API is used to reset password for the specified account by security question
+ * @param resetPasswordBySecurityAnswerAndUserNameModel Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndUserName API
+ * @return Response containing Definition of Validation data and access token
+ *10.3.3
+ */
+ resetPasswordBySecurityAnswerAndUserName (
+ resetPasswordBySecurityAnswerAndUserNameModel: object
+ ) {
+ if (checkJson(resetPasswordBySecurityAnswerAndUserNameModel)) {
+ return Promise.reject(
+ getValidationMessage('resetPasswordBySecurityAnswerAndUserNameModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/password/securityanswer';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPasswordBySecurityAnswerAndUserNameModel
+ );
+ }
+
+ /**
+ * This API is used to set a new password for the specified account.
+ * @param resetPasswordByResetTokenModel Model Class containing Definition of payload for ResetToken API
+ * @return Response containing Definition of Validation data and access token
+ *10.7.1
+ */
+ resetPasswordByResetToken (resetPasswordByResetTokenModel: object) {
+ if (checkJson(resetPasswordByResetTokenModel)) {
+ return Promise.reject(
+ getValidationMessage('resetPasswordByResetTokenModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/password/reset';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPasswordByResetTokenModel
+ );
+ }
+
+ /**
+ * This API is used to set a new password for the specified account.
+ * @param resetPasswordByEmailAndOtpModel Model Class containing Definition of payload for ResetPasswordByEmailAndOtp API
+ * @return Response containing Definition of Validation data and access token
+ *10.7.2
+ */
+ resetPasswordByEmailOTP (resetPasswordByEmailAndOtpModel: object) {
+ if (checkJson(resetPasswordByEmailAndOtpModel)) {
+ return Promise.reject(
+ getValidationMessage('resetPasswordByEmailAndOtpModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/password/reset';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPasswordByEmailAndOtpModel
+ );
+ }
+
+ /**
+ * This API is used to set a new password for the specified account if you are using the username as the unique identifier in your workflow
+ * @param resetPasswordByUserNameModel Model Class containing Definition of payload for ResetPasswordByUserName API
+ * @return Response containing Definition of Validation data and access token
+ *10.7.3
+ */
+ resetPasswordByOTPAndUserName (resetPasswordByUserNameModel: object) {
+ if (checkJson(resetPasswordByUserNameModel)) {
+ return Promise.reject(
+ getValidationMessage('resetPasswordByUserNameModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/password/reset';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPasswordByUserNameModel
+ );
+ }
+
+ /**
+ * This API is used to change the accounts password based on the previous password
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param newPassword New password
+ * @param oldPassword User's current password
+ * @return Response containing Definition of Complete Validation data
+ *10.8
+ */
+ changePassword (accessToken: string, newPassword: string, oldPassword: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(newPassword)) {
+ return Promise.reject(getValidationMessage('newPassword'));
+ }
+ if (isNullOrWhiteSpace(oldPassword)) {
+ return Promise.reject(getValidationMessage('oldPassword'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var bodyParameters: any = {};
+ bodyParameters.newPassword = newPassword;
+ bodyParameters.oldPassword = oldPassword;
+
+ var resourcePath = 'identity/v2/auth/password/change';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database.
+ * @param accessToken Access_Token
+ * @param provider Name of the provider
+ * @param providerId Unique ID of the linked account
+ * @return Response containing Definition of Delete Request
+ *12.2
+ */
+ unlinkSocialIdentities (accessToken: string, provider: string, providerId: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(provider)) {
+ return Promise.reject(getValidationMessage('provider'));
+ }
+ if (isNullOrWhiteSpace(providerId)) {
+ return Promise.reject(getValidationMessage('providerId'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var bodyParameters: any = {};
+ bodyParameters.provider = provider;
+ bodyParameters.providerId = providerId;
+
+ var resourcePath = 'identity/v2/auth/socialidentity';
+
+ return request(
+ this.config,
+ 'DELETE',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to link up a social provider account with an existing LoginRadius account on the basis of access token and the social providers user access token.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param candidateToken Access token of the account to be linked
+ * @return Response containing Definition of Complete Validation data
+ *12.4
+ */
+ linkSocialIdentities (accessToken: string, candidateToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(candidateToken)) {
+ return Promise.reject(getValidationMessage('candidateToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var bodyParameters: any = {};
+ bodyParameters.candidateToken = candidateToken;
+
+ var resourcePath = 'identity/v2/auth/socialidentity';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to link up a social provider account with an existing LoginRadius account on the basis of ping and the social providers user access token.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param clientGuid Unique ID generated by client
+ * @return Response containing Definition of Complete Validation data
+ *12.5
+ */
+ linkSocialIdentitiesByPing (accessToken: string, clientGuid: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(clientGuid)) {
+ return Promise.reject(getValidationMessage('clientGuid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var bodyParameters: any = {};
+ bodyParameters.clientGuid = clientGuid;
+
+ var resourcePath = 'identity/v2/auth/socialidentity';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to set or change UserName by access token.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param username Username of the user
+ * @return Response containing Definition of Complete Validation data
+ *13.1
+ */
+ setOrChangeUserName (accessToken: string, username: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(username)) {
+ return Promise.reject(getValidationMessage('username'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var bodyParameters: any = {};
+ bodyParameters.username = username;
+
+ var resourcePath = 'identity/v2/auth/username';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to check the UserName exists or not on your site.
+ * @param username UserName of the user
+ * @return Response containing Definition Complete ExistResponse data
+ *13.2
+ */
+ checkUserNameAvailability (username: string) {
+ if (isNullOrWhiteSpace(username)) {
+ return Promise.reject(getValidationMessage('username'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.username = username;
+
+ var resourcePath = 'identity/v2/auth/username';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to update the privacy policy stored in the user's profile by providing the access token of the user accepting the privacy policy
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Response containing Definition for Complete profile data
+ *15.1
+ */
+ acceptPrivacyPolicy (accessToken: string, fields?: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath = 'identity/v2/auth/privacypolicy/accept';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API will return all the accepted privacy policies for the user by providing the access token of that user.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @return Complete Policy History data
+ *15.2
+ */
+ getPrivacyPolicyHistoryByAccessToken (accessToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/privacypolicy/history';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API creates a user in the database as well as sends a verification email to the user.
+ * @param authUserRegistrationModel Model Class containing Definition of payload for Auth User Registration API
+ * @param sott LoginRadius Secured One Time Token
+ * @param emailTemplate Email template name
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param options PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow)
+ * @param verificationUrl Email verification url
+ * @param welcomeEmailTemplate Name of the welcome email template
+ * @return Response containing Definition of Complete Validation, UserProfile data and Access Token
+ *17.1.1
+ */
+ userRegistrationByEmail (
+ authUserRegistrationModel: object,
+ sott: string,
+ emailTemplate?: string,
+ fields?: string,
+ options?: string,
+ verificationUrl?: string,
+ welcomeEmailTemplate?: string
+ ) {
+ if (checkJson(authUserRegistrationModel)) {
+ return Promise.reject(getValidationMessage('authUserRegistrationModel'));
+ }
+ if (isNullOrWhiteSpace(sott)) {
+ return Promise.reject(getValidationMessage('sott'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.sott = sott;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(options)) {
+ queryParameters.options = options;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/register';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ authUserRegistrationModel
+ );
+ }
+
+ /**
+ * This API creates a user in the database as well as sends a verification email to the user.
+ * @param authUserRegistrationModelWithCaptcha Model Class containing Definition of payload for Auth User Registration by Recaptcha API
+ * @param emailTemplate Email template name
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param options PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow)
+ * @param smsTemplate SMS Template name
+ * @param verificationUrl Email verification url
+ * @param welcomeEmailTemplate Name of the welcome email template
+ * @return Response containing Definition of Complete Validation, UserProfile data and Access Token
+ *17.2
+ */
+ userRegistrationByCaptcha (
+ authUserRegistrationModelWithCaptcha: object,
+ emailTemplate?: string,
+ fields?: string,
+ options?: string,
+ smsTemplate?: string,
+ verificationUrl?: string,
+ welcomeEmailTemplate?: string
+ ) {
+ if (checkJson(authUserRegistrationModelWithCaptcha)) {
+ return Promise.reject(
+ getValidationMessage('authUserRegistrationModelWithCaptcha')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(options)) {
+ queryParameters.options = options;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/register/captcha';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ authUserRegistrationModelWithCaptcha
+ );
+ }
+
+ /**
+ * This API resends the verification email to the user.
+ * @param email user's email
+ * @param emailTemplate Email template name
+ * @param verificationUrl Email verification url
+ * @return Response containing Definition of Complete Validation data
+ *17.3
+ */
+ authResendEmailVerification (email: string, emailTemplate?: string, verificationUrl?: string) {
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.email = email;
+
+ var resourcePath = 'identity/v2/auth/register';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+}
diff --git a/loginradius-sdk/src/api/authentication/oneTouchLoginApi.ts b/loginradius-sdk/src/api/authentication/oneTouchLoginApi.ts
new file mode 100644
index 0000000..bfcb33e
--- /dev/null
+++ b/loginradius-sdk/src/api/authentication/oneTouchLoginApi.ts
@@ -0,0 +1,176 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class OneTouchLoginApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API is used to send a link to a specified email for a frictionless login/registration
+ * @param oneTouchLoginByEmailModel Model Class containing Definition of payload for OneTouchLogin By EmailModel API
+ * @param oneTouchLoginEmailTemplate Name of the One Touch Login Email Template
+ * @param redirecturl Url where the user will redirect after success authentication
+ * @param welcomeemailtemplate Name of the welcome email template
+ * @return Response containing Definition of Complete Validation data
+ *1.2
+ */
+ oneTouchLoginByEmail (
+ oneTouchLoginByEmailModel: object,
+ oneTouchLoginEmailTemplate?: string,
+ redirecturl?: string,
+ welcomeemailtemplate?: string
+ ) {
+ if (checkJson(oneTouchLoginByEmailModel)) {
+ return Promise.reject(getValidationMessage('oneTouchLoginByEmailModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(oneTouchLoginEmailTemplate)) {
+ queryParameters.oneTouchLoginEmailTemplate = oneTouchLoginEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(redirecturl)) {
+ queryParameters.redirecturl = redirecturl;
+ }
+ if (!isNullOrWhiteSpace(welcomeemailtemplate)) {
+ queryParameters.welcomeemailtemplate = welcomeemailtemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/onetouchlogin/email';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ oneTouchLoginByEmailModel
+ );
+ }
+
+ /**
+ * This API is used to send one time password to a given phone number for a frictionless login/registration.
+ * @param oneTouchLoginByPhoneModel Model Class containing Definition of payload for OneTouchLogin By PhoneModel API
+ * @param smsTemplate SMS Template name
+ * @return Response containing Definition of Complete Validation data
+ *1.4
+ */
+ oneTouchLoginByPhone (oneTouchLoginByPhoneModel: object, smsTemplate?: string) {
+ if (checkJson(oneTouchLoginByPhoneModel)) {
+ return Promise.reject(getValidationMessage('oneTouchLoginByPhoneModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/onetouchlogin/phone';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ oneTouchLoginByPhoneModel
+ );
+ }
+
+ /**
+ * This API is used to verify the otp for One Touch Login.
+ * @param otp The Verification Code
+ * @param phone New Phone Number
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param smsTemplate SMS Template name
+ * @return Response Containing Access Token and Complete Profile Data
+ *1.5
+ */
+ oneTouchLoginOTPVerification (otp: string, phone: string, fields?: string, smsTemplate?: string) {
+ if (isNullOrWhiteSpace(otp)) {
+ return Promise.reject(getValidationMessage('otp'));
+ }
+ if (isNullOrWhiteSpace(phone)) {
+ return Promise.reject(getValidationMessage('phone'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.otp = otp;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.phone = phone;
+
+ var resourcePath = 'identity/v2/auth/onetouchlogin/phone/verify';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API verifies the provided token for One Touch Login
+ * @param verificationToken Verification token received in the email
+ * @param welcomeEmailTemplate Name of the welcome email template
+ * @return Complete verified response data
+ *8.4.2
+ */
+ oneTouchEmailVerification (verificationToken: string, welcomeEmailTemplate?: string) {
+ if (isNullOrWhiteSpace(verificationToken)) {
+ return Promise.reject(getValidationMessage('verificationToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.verificationToken = verificationToken;
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/email/onetouchlogin';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to check if the One Touch Login link has been clicked or not.
+ * @param clientGuid Unique string used in the Smart Login request
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Response containing User Profile Data and access token
+ *9.21.2
+ */
+ oneTouchLoginPing (clientGuid: string, fields?: string) {
+ if (isNullOrWhiteSpace(clientGuid)) {
+ return Promise.reject(getValidationMessage('clientGuid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.clientGuid = clientGuid;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/smartlogin/ping';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+}
diff --git a/loginradius-sdk/src/api/authentication/passwordLessLoginApi.ts b/loginradius-sdk/src/api/authentication/passwordLessLoginApi.ts
new file mode 100644
index 0000000..42c19ba
--- /dev/null
+++ b/loginradius-sdk/src/api/authentication/passwordLessLoginApi.ts
@@ -0,0 +1,239 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class PasswordlessLoginApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API verifies an account by OTP and allows the customer to login.
+ * @param passwordLessLoginOtpModel Model Class containing Definition of payload for PasswordLessLoginOtpModel API
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param smsTemplate SMS Template name
+ * @return Response containing User Profile Data and access token
+ *9.6
+ */
+ passwordlessLoginPhoneVerification (
+ passwordLessLoginOtpModel: object,
+ fields?: string,
+ smsTemplate?: string
+ ) {
+ if (checkJson(passwordLessLoginOtpModel)) {
+ return Promise.reject(getValidationMessage('passwordLessLoginOtpModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/passwordlesslogin/otp/verify';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ passwordLessLoginOtpModel
+ );
+ }
+
+ /**
+ * API can be used to send a One-time Passcode (OTP) provided that the account has a verified PhoneID
+ * @param phone The Registered Phone Number
+ * @param smsTemplate SMS Template name
+ * @return Response Containing Definition of SMS Data
+ *9.15
+ */
+ passwordlessLoginByPhone (phone: string, smsTemplate?: string) {
+ if (isNullOrWhiteSpace(phone)) {
+ return Promise.reject(getValidationMessage('phone'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.phone = phone;
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/passwordlesslogin/otp';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to send a Passwordless Login verification link to the provided Email ID
+ * @param email Email of the user
+ * @param passwordLessLoginTemplate Passwordless Login Template Name
+ * @param verificationUrl Email verification url
+ * @return Response containing Definition of Complete Validation data
+ *9.18.1
+ */
+ passwordlessLoginByEmail (email: string, passwordLessLoginTemplate?: string, verificationUrl?: string) {
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.email = email;
+ if (!isNullOrWhiteSpace(passwordLessLoginTemplate)) {
+ queryParameters.passwordLessLoginTemplate = passwordLessLoginTemplate;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/passwordlesslogin/email';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to send a Passwordless Login Verification Link to a customer by providing their UserName
+ * @param username UserName of the user
+ * @param passwordLessLoginTemplate Passwordless Login Template Name
+ * @param verificationUrl Email verification url
+ * @return Response containing Definition of Complete Validation data
+ *9.18.2
+ */
+ passwordlessLoginByUserName (
+ username: string,
+ passwordLessLoginTemplate: string,
+ verificationUrl: string
+ ) {
+ if (isNullOrWhiteSpace(username)) {
+ return Promise.reject(getValidationMessage('username'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.username = username;
+ if (!isNullOrWhiteSpace(passwordLessLoginTemplate)) {
+ queryParameters.passwordLessLoginTemplate = passwordLessLoginTemplate;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/passwordlesslogin/email';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to verify the Passwordless Login verification link. Note: If you are using Passwordless Login by Phone you will need to use the Passwordless Login Phone Verification API
+ * @param verificationToken Verification token received in the email
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param welcomeEmailTemplate Name of the welcome email template
+ * @return Response containing User Profile Data and access token
+ *9.19
+ */
+ passwordlessLoginVerification (
+ verificationToken: string,
+ fields?: string,
+ welcomeEmailTemplate?: string
+ ) {
+ if (isNullOrWhiteSpace(verificationToken)) {
+ return Promise.reject(getValidationMessage('verificationToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apikey = this.config.apiKey;
+ queryParameters.verificationToken = verificationToken;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/passwordlesslogin/email/verify';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to verify the otp sent to the email when doing a passwordless login.
+ * @param passwordLessLoginByEmailAndOtpModel payload
+ * @param fields Fields
+ * @return Response containing User Profile Data and access token
+ *9.23
+ */
+ passwordlessLoginVerificationByEmailAndOTP (
+ passwordLessLoginByEmailAndOtpModel: object,
+ fields?: string
+ ) {
+ if (checkJson(passwordLessLoginByEmailAndOtpModel)) {
+ return Promise.reject(
+ getValidationMessage('passwordLessLoginByEmailAndOtpModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath =
+ 'identity/v2/auth/login/passwordlesslogin/email/verifyotp';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ passwordLessLoginByEmailAndOtpModel
+ );
+ }
+
+ /**
+ * This API is used to verify the otp sent to the email when doing a passwordless login.
+ * @param passwordLessLoginByUserNameAndOtpModel payload
+ * @param fields Fields
+ * @return Response containing User Profile Data and access token
+ *9.24
+ */
+ passwordlessLoginVerificationByUserNameAndOTP (
+ passwordLessLoginByUserNameAndOtpModel: object,
+ fields: string
+ ) {
+ if (checkJson(passwordLessLoginByUserNameAndOtpModel)) {
+ return Promise.reject(
+ getValidationMessage('passwordLessLoginByUserNameAndOtpModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath =
+ 'identity/v2/auth/login/passwordlesslogin/username/verifyotp';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ passwordLessLoginByUserNameAndOtpModel
+ );
+ }
+}
diff --git a/loginradius-sdk/src/api/authentication/phoneAuthenticationApi.ts b/loginradius-sdk/src/api/authentication/phoneAuthenticationApi.ts
new file mode 100644
index 0000000..ef393f3
--- /dev/null
+++ b/loginradius-sdk/src/api/authentication/phoneAuthenticationApi.ts
@@ -0,0 +1,389 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class PhoneAuthenticationApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API retrieves a copy of the user data based on the Phone
+ * @param phoneAuthenticationModel Model Class containing Definition of payload for PhoneAuthenticationModel API
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param loginUrl Url where the user is logging from
+ * @param smsTemplate SMS Template name
+ * @return Response containing User Profile Data and access token
+ *9.2.3
+ */
+ loginByPhone (phoneAuthenticationModel: object, fields?: string, loginUrl?: string, smsTemplate?: string) {
+ if (checkJson(phoneAuthenticationModel)) {
+ return Promise.reject(getValidationMessage('phoneAuthenticationModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(loginUrl)) {
+ queryParameters.loginUrl = loginUrl;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/login';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ phoneAuthenticationModel
+ );
+ }
+
+ /**
+ * This API is used to send the OTP to reset the account password.
+ * @param phone New Phone Number
+ * @param smsTemplate SMS Template name
+ * @return Response Containing Validation Data and SMS Data
+ *10.4
+ */
+ forgotPasswordByPhoneOTP (phone: string, smsTemplate?: string) {
+ if (isNullOrWhiteSpace(phone)) {
+ return Promise.reject(getValidationMessage('phone'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.phone = phone;
+
+ var resourcePath = 'identity/v2/auth/password/otp';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to reset the password
+ * @param resetPasswordByOTPModel Model Class containing Definition of payload for ResetPasswordByOTP API
+ * @return Response containing Definition of Complete Validation data
+ *10.5
+ */
+ resetPasswordByPhoneOTP (resetPasswordByOTPModel: object) {
+ if (checkJson(resetPasswordByOTPModel)) {
+ return Promise.reject(getValidationMessage('resetPasswordByOTPModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/password/otp';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPasswordByOTPModel
+ );
+ }
+
+ /**
+ * This API is used to validate the verification code sent to verify a user's phone number
+ * @param otp The Verification Code
+ * @param phone New Phone Number
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param smsTemplate SMS Template name
+ * @return Response containing User Profile Data and access token
+ *11.1.1
+ */
+ phoneVerificationByOTP (otp: string, phone: string, fields?: string, smsTemplate?: string) {
+ if (isNullOrWhiteSpace(otp)) {
+ return Promise.reject(getValidationMessage('otp'));
+ }
+ if (isNullOrWhiteSpace(phone)) {
+ return Promise.reject(getValidationMessage('phone'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.otp = otp;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.phone = phone;
+
+ var resourcePath = 'identity/v2/auth/phone/otp';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param otp The Verification Code
+ * @param smsTemplate SMS Template name
+ * @return Response containing Definition of Complete Validation data
+ *11.1.2
+ */
+ phoneVerificationOTPByAccessToken (accessToken: string, otp: string, smsTemplate?: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(otp)) {
+ return Promise.reject(getValidationMessage('otp'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.otp = otp;
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/phone/otp';
+
+ return request(this.config, 'PUT', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input
+ * @param phone New Phone Number
+ * @param smsTemplate SMS Template name
+ * @return Response Containing Validation Data and SMS Data
+ *11.2.1
+ */
+ phoneResendVerificationOTP (phone: string, smsTemplate?: string) {
+ if (isNullOrWhiteSpace(phone)) {
+ return Promise.reject(getValidationMessage('phone'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.phone = phone;
+
+ var resourcePath = 'identity/v2/auth/phone/otp';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to resend a verification OTP to verify a user's Phone Number in cases in which an active token already exists
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param phone New Phone Number
+ * @param smsTemplate SMS Template name
+ * @return Response Containing Validation Data and SMS Data
+ *11.2.2
+ */
+ phoneResendVerificationOTPByToken (accessToken: string, phone: string, smsTemplate?: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(phone)) {
+ return Promise.reject(getValidationMessage('phone'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.phone = phone;
+
+ var resourcePath = 'identity/v2/auth/phone/otp';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to update the login Phone Number of users
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param phone New Phone Number
+ * @param smsTemplate SMS Template name
+ * @return Response Containing Validation Data and SMS Data
+ *11.5
+ */
+ updatePhoneNumber (accessToken: string, phone: string, smsTemplate?: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (isNullOrWhiteSpace(phone)) {
+ return Promise.reject(getValidationMessage('phone'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var bodyParameters: any = {};
+ bodyParameters.phone = phone;
+
+ var resourcePath = 'identity/v2/auth/phone';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ bodyParameters
+ );
+ }
+
+ /**
+ * This API is used to check the Phone Number exists or not on your site.
+ * @param phone The Registered Phone Number
+ * @return Response containing Definition Complete ExistResponse data
+ *11.6
+ */
+ checkPhoneNumberAvailability (phone: string) {
+ if (isNullOrWhiteSpace(phone)) {
+ return Promise.reject(getValidationMessage('phone'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.phone = phone;
+
+ var resourcePath = 'identity/v2/auth/phone';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to delete the Phone ID on a user's account via the access token
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @return Response containing Definition of Delete Request
+ *11.7
+ */
+ removePhoneIDByAccessToken (accessToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/phone';
+
+ return request(this.config, 'DELETE', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API registers the new users into your Cloud Storage and triggers the phone verification process.
+ * @param authUserRegistrationModel Model Class containing Definition of payload for Auth User Registration API
+ * @param sott LoginRadius Secured One Time Token
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param options PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow)
+ * @param smsTemplate SMS Template name
+ * @param verificationUrl Email verification url
+ * @param welcomeEmailTemplate Name of the welcome email template
+ * @return Response containing Definition of Complete Validation, UserProfile data and Access Token
+ * @param emailTemplate Email Template Name
+ *17.1.2
+ */
+ userRegistrationByPhone (
+ authUserRegistrationModel: object,
+ sott: string,
+ fields?: string,
+ options?: string,
+ smsTemplate?: string,
+ verificationUrl?: string,
+ welcomeEmailTemplate?: string,
+ emailTemplate?: string
+ ) {
+ if (checkJson(authUserRegistrationModel)) {
+ return Promise.reject(getValidationMessage('authUserRegistrationModel'));
+ }
+ if (isNullOrWhiteSpace(sott)) {
+ return Promise.reject(getValidationMessage('sott'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.sott = sott;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(options)) {
+ queryParameters.options = options;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/register';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ authUserRegistrationModel
+ );
+ }
+}
diff --git a/loginradius-sdk/src/api/authentication/pinAuthenticationApi.ts b/loginradius-sdk/src/api/authentication/pinAuthenticationApi.ts
new file mode 100644
index 0000000..9c8aafc
--- /dev/null
+++ b/loginradius-sdk/src/api/authentication/pinAuthenticationApi.ts
@@ -0,0 +1,420 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class PinAuthenticationApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API is used to login a user by pin and session token.
+ * @param loginByPINModel Model Class containing Definition of payload for LoginByPin API
+ * @param sessionToken Session Token of user
+ * @return Response containing User Profile Data and access token
+ *9.22
+ */
+ pinLogin (loginByPINModel: object, sessionToken: string) {
+ if (checkJson(loginByPINModel)) {
+ return Promise.reject(getValidationMessage('loginByPINModel'));
+ }
+ if (isNullOrWhiteSpace(sessionToken)) {
+ return Promise.reject(getValidationMessage('sessionToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.session_token = sessionToken;
+
+ var resourcePath = 'identity/v2/auth/login/pin';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ loginByPINModel
+ );
+ }
+
+ /**
+ * This API sends the reset pin email to specified email address.
+ * @param forgotPINLinkByEmailModel Model Class containing Definition for Forgot Pin Link By Email API
+ * @param emailTemplate Email template name
+ * @param resetPINUrl Reset PIN Url
+ * @return Response containing Definition of Complete Validation data
+ *42.1
+ */
+ sendForgotPINEmailByEmail (
+ forgotPINLinkByEmailModel: object,
+ emailTemplate?: string,
+ resetPINUrl?: string
+ ) {
+ if (checkJson(forgotPINLinkByEmailModel)) {
+ return Promise.reject(getValidationMessage('forgotPINLinkByEmailModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(resetPINUrl)) {
+ queryParameters.resetPINUrl = resetPINUrl;
+ }
+
+ var resourcePath = 'identity/v2/auth/pin/forgot/email';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ forgotPINLinkByEmailModel
+ );
+ }
+
+ /**
+ * This API sends the reset pin email using username.
+ * @param forgotPINLinkByUserNameModel Model Class containing Definition for Forgot Pin Link By UserName API
+ * @param emailTemplate Email template name
+ * @param resetPINUrl Reset PIN Url
+ * @return Response containing Definition of Complete Validation data
+ *42.2
+ */
+ sendForgotPINEmailByUsername (
+ forgotPINLinkByUserNameModel: object,
+ emailTemplate?: string,
+ resetPINUrl?: string
+ ) {
+ if (checkJson(forgotPINLinkByUserNameModel)) {
+ return Promise.reject(
+ getValidationMessage('forgotPINLinkByUserNameModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(resetPINUrl)) {
+ queryParameters.resetPINUrl = resetPINUrl;
+ }
+
+ var resourcePath = 'identity/v2/auth/pin/forgot/username';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ forgotPINLinkByUserNameModel
+ );
+ }
+
+ /**
+ * This API is used to reset pin using reset token.
+ * @param resetPINByResetToken Model Class containing Definition of payload for Reset Pin By Reset Token API
+ * @return Response containing Definition of Complete Validation data
+ *42.3
+ */
+ resetPINByResetToken (resetPINByResetToken: object) {
+ if (checkJson(resetPINByResetToken)) {
+ return Promise.reject(getValidationMessage('resetPINByResetToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/pin/reset/token';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPINByResetToken
+ );
+ }
+
+ /**
+ * This API is used to reset pin using security question answer and email.
+ * @param resetPINBySecurityQuestionAnswerAndEmailModel Model Class containing Definition of payload for Reset Pin By Security Question and Email API
+ * @return Response containing Definition of Complete Validation data
+ *42.4
+ */
+ resetPINByEmailAndSecurityAnswer (
+ resetPINBySecurityQuestionAnswerAndEmailModel: object
+ ) {
+ if (checkJson(resetPINBySecurityQuestionAnswerAndEmailModel)) {
+ return Promise.reject(
+ getValidationMessage('resetPINBySecurityQuestionAnswerAndEmailModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/pin/reset/securityanswer/email';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPINBySecurityQuestionAnswerAndEmailModel
+ );
+ }
+
+ /**
+ * This API is used to reset pin using security question answer and username.
+ * @param resetPINBySecurityQuestionAnswerAndUsernameModel Model Class containing Definition of payload for Reset Pin By Security Question and UserName API
+ * @return Response containing Definition of Complete Validation data
+ *42.5
+ */
+ resetPINByUsernameAndSecurityAnswer (
+ resetPINBySecurityQuestionAnswerAndUsernameModel: object
+ ) {
+ if (checkJson(resetPINBySecurityQuestionAnswerAndUsernameModel)) {
+ return Promise.reject(
+ getValidationMessage('resetPINBySecurityQuestionAnswerAndUsernameModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/pin/reset/securityanswer/username';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPINBySecurityQuestionAnswerAndUsernameModel
+ );
+ }
+
+ /**
+ * This API is used to reset pin using security question answer and phone.
+ * @param resetPINBySecurityQuestionAnswerAndPhoneModel Model Class containing Definition of payload for Reset Pin By Security Question and Phone API
+ * @return Response containing Definition of Complete Validation data
+ *42.6
+ */
+ resetPINByPhoneAndSecurityAnswer (
+ resetPINBySecurityQuestionAnswerAndPhoneModel: object
+ ) {
+ if (checkJson(resetPINBySecurityQuestionAnswerAndPhoneModel)) {
+ return Promise.reject(
+ getValidationMessage('resetPINBySecurityQuestionAnswerAndPhoneModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/pin/reset/securityanswer/phone';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPINBySecurityQuestionAnswerAndPhoneModel
+ );
+ }
+
+ /**
+ * This API sends the OTP to specified phone number
+ * @param forgotPINOtpByPhoneModel Model Class containing Definition for Forgot Pin Otp By Phone API
+ * @param smsTemplate
+ * @return Response Containing Validation Data and SMS Data
+ *42.7
+ */
+ sendForgotPINSMSByPhone (forgotPINOtpByPhoneModel: object, smsTemplate?: string) {
+ if (checkJson(forgotPINOtpByPhoneModel)) {
+ return Promise.reject(getValidationMessage('forgotPINOtpByPhoneModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/pin/forgot/otp';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ forgotPINOtpByPhoneModel
+ );
+ }
+
+ /**
+ * This API is used to change a user's PIN using access token.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param changePINModel Model Class containing Definition for change PIN Property
+ * @return Response containing Definition of Complete Validation data
+ *42.8
+ */
+ changePINByAccessToken (accessToken: string, changePINModel: object) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ if (checkJson(changePINModel)) {
+ return Promise.reject(getValidationMessage('changePINModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/pin/change';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ changePINModel
+ );
+ }
+
+ /**
+ * This API is used to reset pin using phoneId and OTP.
+ * @param resetPINByPhoneAndOTPModel Model Class containing Definition of payload for Reset Pin By Phone and Otp API
+ * @return Response containing Definition of Complete Validation data
+ *42.9
+ */
+ resetPINByPhoneAndOtp (resetPINByPhoneAndOTPModel: object) {
+ if (checkJson(resetPINByPhoneAndOTPModel)) {
+ return Promise.reject(getValidationMessage('resetPINByPhoneAndOTPModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/pin/reset/otp/phone';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPINByPhoneAndOTPModel
+ );
+ }
+
+ /**
+ * This API is used to reset pin using email and OTP.
+ * @param resetPINByEmailAndOtpModel Model Class containing Definition of payload for Reset Pin By Email and Otp API
+ * @return Response containing Definition of Complete Validation data
+ *42.10
+ */
+ resetPINByEmailAndOtp (resetPINByEmailAndOtpModel: object) {
+ if (checkJson(resetPINByEmailAndOtpModel)) {
+ return Promise.reject(getValidationMessage('resetPINByEmailAndOtpModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/pin/reset/otp/email';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPINByEmailAndOtpModel
+ );
+ }
+
+ /**
+ * This API is used to reset pin using username and OTP.
+ * @param resetPINByUsernameAndOtpModel Model Class containing Definition of payload for Reset Pin By Username and Otp API
+ * @return Response containing Definition of Complete Validation data
+ *42.11
+ */
+ resetPINByUsernameAndOtp (resetPINByUsernameAndOtpModel: object) {
+ if (checkJson(resetPINByUsernameAndOtpModel)) {
+ return Promise.reject(
+ getValidationMessage('resetPINByUsernameAndOtpModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+
+ var resourcePath = 'identity/v2/auth/pin/reset/otp/username';
+
+ return request(
+ this.config,
+ 'PUT',
+ resourcePath,
+ queryParameters,
+ resetPINByUsernameAndOtpModel
+ );
+ }
+
+ /**
+ * This API is used to change a user's PIN using Pin Auth token.
+ * @param pINRequiredModel Model Class containing Definition for PIN
+ * @param pinAuthToken Pin Auth Token
+ * @return Response containing User Profile Data and access token
+ *42.12
+ */
+ setPINByPinAuthToken (pINRequiredModel: object, pinAuthToken: string) {
+ if (checkJson(pINRequiredModel)) {
+ return Promise.reject(getValidationMessage('pINRequiredModel'));
+ }
+ if (isNullOrWhiteSpace(pinAuthToken)) {
+ return Promise.reject(getValidationMessage('pinAuthToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.pinAuthToken = pinAuthToken;
+
+ var resourcePath = 'identity/v2/auth/pin/set/pinauthtoken';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ pINRequiredModel
+ );
+ }
+
+ /**
+ * This API is used to invalidate pin session token.
+ * @param sessionToken Session Token of user
+ * @return Response containing Definition of Complete Validation data
+ *44.1
+ */
+ inValidatePinSessionToken (sessionToken: string) {
+ if (isNullOrWhiteSpace(sessionToken)) {
+ return Promise.reject(getValidationMessage('sessionToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.session_token = sessionToken;
+
+ var resourcePath = 'identity/v2/auth/session_token/invalidate';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+}
diff --git a/loginradius-sdk/src/api/authentication/riskBasedAuthenticationApi.ts b/loginradius-sdk/src/api/authentication/riskBasedAuthenticationApi.ts
new file mode 100644
index 0000000..301d217
--- /dev/null
+++ b/loginradius-sdk/src/api/authentication/riskBasedAuthenticationApi.ts
@@ -0,0 +1,354 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ checkJson,
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class RiskBasedAuthenticationApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API retrieves a copy of the user data based on the Email
+ * @param emailAuthenticationModel Model Class containing Definition of payload for Email Authentication API
+ * @param emailTemplate Email template name
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param loginUrl Url where the user is logging from
+ * @param passwordDelegation Password Delegation Allows you to use a third-party service to store your passwords rather than LoginRadius Cloud storage.
+ * @param passwordDelegationApp RiskBased Authentication Password Delegation App
+ * @param rbaBrowserEmailTemplate Risk Based Authentication Browser EmailTemplate
+ * @param rbaBrowserSmsTemplate Risk Based Authentication Browser Sms Template
+ * @param rbaCityEmailTemplate Risk Based Authentication City Email Template
+ * @param rbaCitySmsTemplate Risk Based Authentication City SmsTemplate
+ * @param rbaCountryEmailTemplate Risk Based Authentication Country EmailTemplate
+ * @param rbaCountrySmsTemplate Risk Based Authentication Country SmsTemplate
+ * @param rbaIpEmailTemplate Risk Based Authentication Ip EmailTemplate
+ * @param rbaIpSmsTemplate Risk Based Authentication Ip SmsTemplate
+ * @param rbaOneclickEmailTemplate Risk Based Authentication Oneclick EmailTemplate
+ * @param rbaOTPSmsTemplate Risk Based Authentication Oneclick EmailTemplate
+ * @param smsTemplate SMS Template name
+ * @param verificationUrl Email verification url
+ * @return Response containing User Profile Data and access token
+ *9.2.4
+ */
+ rbaLoginByEmail (
+ emailAuthenticationModel: object,
+ emailTemplate?: string,
+ fields?: string,
+ loginUrl?: string,
+ passwordDelegation?: string,
+ passwordDelegationApp?: string,
+ rbaBrowserEmailTemplate?: string,
+ rbaBrowserSmsTemplate?: string,
+ rbaCityEmailTemplate?: string,
+ rbaCitySmsTemplate?: string,
+ rbaCountryEmailTemplate?: string,
+ rbaCountrySmsTemplate?: string,
+ rbaIpEmailTemplate?: string,
+ rbaIpSmsTemplate?: string,
+ rbaOneclickEmailTemplate?: string,
+ rbaOTPSmsTemplate?: string,
+ smsTemplate?: string,
+ verificationUrl?: string
+ ) {
+ if (checkJson(emailAuthenticationModel)) {
+ return Promise.reject(getValidationMessage('emailAuthenticationModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(loginUrl)) {
+ queryParameters.loginUrl = loginUrl;
+ }
+ if (passwordDelegation !== null) {
+ queryParameters.passwordDelegation = passwordDelegation;
+ }
+ if (!isNullOrWhiteSpace(passwordDelegationApp)) {
+ queryParameters.passwordDelegationApp = passwordDelegationApp;
+ }
+ if (!isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
+ queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaBrowserSmsTemplate)) {
+ queryParameters.rbaBrowserSmsTemplate = rbaBrowserSmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCityEmailTemplate)) {
+ queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCitySmsTemplate)) {
+ queryParameters.rbaCitySmsTemplate = rbaCitySmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
+ queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCountrySmsTemplate)) {
+ queryParameters.rbaCountrySmsTemplate = rbaCountrySmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaIpEmailTemplate)) {
+ queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaIpSmsTemplate)) {
+ queryParameters.rbaIpSmsTemplate = rbaIpSmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaOneclickEmailTemplate)) {
+ queryParameters.rbaOneclickEmailTemplate = rbaOneclickEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaOTPSmsTemplate)) {
+ queryParameters.rbaOTPSmsTemplate = rbaOTPSmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+
+ var resourcePath = 'identity/v2/auth/login';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ emailAuthenticationModel
+ );
+ }
+
+ /**
+ * This API retrieves a copy of the user data based on the Username
+ * @param userNameAuthenticationModel Model Class containing Definition of payload for Username Authentication API
+ * @param emailTemplate Email template name
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param loginUrl Url where the user is logging from
+ * @param passwordDelegation Password Delegation Allows you to use a third-party service to store your passwords rather than LoginRadius Cloud storage.
+ * @param passwordDelegationApp RiskBased Authentication Password Delegation App
+ * @param rbaBrowserEmailTemplate Risk Based Authentication Browser EmailTemplate
+ * @param rbaBrowserSmsTemplate Risk Based Authentication Browser Sms Template
+ * @param rbaCityEmailTemplate Risk Based Authentication City Email Template
+ * @param rbaCitySmsTemplate Risk Based Authentication City SmsTemplate
+ * @param rbaCountryEmailTemplate Risk Based Authentication Country EmailTemplate
+ * @param rbaCountrySmsTemplate Risk Based Authentication Country SmsTemplate
+ * @param rbaIpEmailTemplate Risk Based Authentication Ip EmailTemplate
+ * @param rbaIpSmsTemplate Risk Based Authentication Ip SmsTemplate
+ * @param rbaOneclickEmailTemplate Risk Based Authentication Oneclick EmailTemplate
+ * @param rbaOTPSmsTemplate Risk Based Authentication OTPSmsTemplate
+ * @param smsTemplate SMS Template name
+ * @param verificationUrl Email verification url
+ * @return Response containing User Profile Data and access token
+ *9.2.5
+ */
+ rbaLoginByUserName (
+ userNameAuthenticationModel: object,
+ emailTemplate?: string,
+ fields?: string,
+ loginUrl?: string,
+ passwordDelegation?: string,
+ passwordDelegationApp?: string,
+ rbaBrowserEmailTemplate?: string,
+ rbaBrowserSmsTemplate?: string,
+ rbaCityEmailTemplate?: string,
+ rbaCitySmsTemplate?: string,
+ rbaCountryEmailTemplate?: string,
+ rbaCountrySmsTemplate?: string,
+ rbaIpEmailTemplate?: string,
+ rbaIpSmsTemplate?: string,
+ rbaOneclickEmailTemplate?: string,
+ rbaOTPSmsTemplate?: string,
+ smsTemplate?: string,
+ verificationUrl?: string
+ ) {
+ if (checkJson(userNameAuthenticationModel)) {
+ return Promise.reject(
+ getValidationMessage('userNameAuthenticationModel')
+ );
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(loginUrl)) {
+ queryParameters.loginUrl = loginUrl;
+ }
+ if (passwordDelegation !== null) {
+ queryParameters.passwordDelegation = passwordDelegation;
+ }
+ if (!isNullOrWhiteSpace(passwordDelegationApp)) {
+ queryParameters.passwordDelegationApp = passwordDelegationApp;
+ }
+ if (!isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
+ queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaBrowserSmsTemplate)) {
+ queryParameters.rbaBrowserSmsTemplate = rbaBrowserSmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCityEmailTemplate)) {
+ queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCitySmsTemplate)) {
+ queryParameters.rbaCitySmsTemplate = rbaCitySmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
+ queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCountrySmsTemplate)) {
+ queryParameters.rbaCountrySmsTemplate = rbaCountrySmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaIpEmailTemplate)) {
+ queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaIpSmsTemplate)) {
+ queryParameters.rbaIpSmsTemplate = rbaIpSmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaOneclickEmailTemplate)) {
+ queryParameters.rbaOneclickEmailTemplate = rbaOneclickEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaOTPSmsTemplate)) {
+ queryParameters.rbaOTPSmsTemplate = rbaOTPSmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+
+ var resourcePath = 'identity/v2/auth/login';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ userNameAuthenticationModel
+ );
+ }
+
+ /**
+ * This API retrieves a copy of the user data based on the Phone
+ * @param phoneAuthenticationModel Model Class containing Definition of payload for PhoneAuthenticationModel API
+ * @param emailTemplate Email template name
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @param loginUrl Url where the user is logging from
+ * @param passwordDelegation Password Delegation Allows you to use a third-party service to store your passwords rather than LoginRadius Cloud storage.
+ * @param passwordDelegationApp RiskBased Authentication Password Delegation App
+ * @param rbaBrowserEmailTemplate Risk Based Authentication Browser EmailTemplate
+ * @param rbaBrowserSmsTemplate Risk Based Authentication Browser Sms Template
+ * @param rbaCityEmailTemplate Risk Based Authentication City Email Template
+ * @param rbaCitySmsTemplate Risk Based Authentication City SmsTemplate
+ * @param rbaCountryEmailTemplate Risk Based Authentication Country EmailTemplate
+ * @param rbaCountrySmsTemplate Risk Based Authentication Country SmsTemplate
+ * @param rbaIpEmailTemplate Risk Based Authentication Ip EmailTemplate
+ * @param rbaIpSmsTemplate Risk Based Authentication Ip SmsTemplate
+ * @param rbaOneclickEmailTemplate Risk Based Authentication Oneclick EmailTemplate
+ * @param rbaOTPSmsTemplate Risk Based Authentication OTPSmsTemplate
+ * @param smsTemplate SMS Template name
+ * @param verificationUrl Email verification url
+ * @return Response containing User Profile Data and access token
+ *9.2.6
+ */
+ rbaLoginByPhone (
+ phoneAuthenticationModel: object,
+ emailTemplate?: string,
+ fields?: string,
+ loginUrl?: string,
+ passwordDelegation?: string,
+ passwordDelegationApp?: string,
+ rbaBrowserEmailTemplate?: string,
+ rbaBrowserSmsTemplate?: string,
+ rbaCityEmailTemplate?: string,
+ rbaCitySmsTemplate?: string,
+ rbaCountryEmailTemplate?: string,
+ rbaCountrySmsTemplate?: string,
+ rbaIpEmailTemplate?: string,
+ rbaIpSmsTemplate?: string,
+ rbaOneclickEmailTemplate?: string,
+ rbaOTPSmsTemplate?: string,
+ smsTemplate?: string,
+ verificationUrl?: string
+ ) {
+ if (checkJson(phoneAuthenticationModel)) {
+ return Promise.reject(getValidationMessage('phoneAuthenticationModel'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ if (!isNullOrWhiteSpace(emailTemplate)) {
+ queryParameters.emailTemplate = emailTemplate;
+ }
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+ if (!isNullOrWhiteSpace(loginUrl)) {
+ queryParameters.loginUrl = loginUrl;
+ }
+ if (passwordDelegation !== null) {
+ queryParameters.passwordDelegation = passwordDelegation;
+ }
+ if (!isNullOrWhiteSpace(passwordDelegationApp)) {
+ queryParameters.passwordDelegationApp = passwordDelegationApp;
+ }
+ if (!isNullOrWhiteSpace(rbaBrowserEmailTemplate)) {
+ queryParameters.rbaBrowserEmailTemplate = rbaBrowserEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaBrowserSmsTemplate)) {
+ queryParameters.rbaBrowserSmsTemplate = rbaBrowserSmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCityEmailTemplate)) {
+ queryParameters.rbaCityEmailTemplate = rbaCityEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCitySmsTemplate)) {
+ queryParameters.rbaCitySmsTemplate = rbaCitySmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCountryEmailTemplate)) {
+ queryParameters.rbaCountryEmailTemplate = rbaCountryEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaCountrySmsTemplate)) {
+ queryParameters.rbaCountrySmsTemplate = rbaCountrySmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaIpEmailTemplate)) {
+ queryParameters.rbaIpEmailTemplate = rbaIpEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaIpSmsTemplate)) {
+ queryParameters.rbaIpSmsTemplate = rbaIpSmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaOneclickEmailTemplate)) {
+ queryParameters.rbaOneclickEmailTemplate = rbaOneclickEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(rbaOTPSmsTemplate)) {
+ queryParameters.rbaOTPSmsTemplate = rbaOTPSmsTemplate;
+ }
+ if (!isNullOrWhiteSpace(smsTemplate)) {
+ queryParameters.smsTemplate = smsTemplate;
+ }
+ if (!isNullOrWhiteSpace(verificationUrl)) {
+ queryParameters.verificationUrl = verificationUrl;
+ }
+
+ var resourcePath = 'identity/v2/auth/login';
+
+ return request(
+ this.config,
+ 'POST',
+ resourcePath,
+ queryParameters,
+ phoneAuthenticationModel
+ );
+ }
+}
diff --git a/loginradius-sdk/src/api/authentication/smartLoginApi.ts b/loginradius-sdk/src/api/authentication/smartLoginApi.ts
new file mode 100644
index 0000000..0c456a9
--- /dev/null
+++ b/loginradius-sdk/src/api/authentication/smartLoginApi.ts
@@ -0,0 +1,149 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class SmartLoginApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API verifies the provided token for Smart Login
+ * @param verificationToken Verification token received in the email
+ * @param welcomeEmailTemplate Name of the welcome email template
+ * @return Complete verified response data
+ *8.4.1
+ */
+ smartLoginTokenVerification (verificationToken: string, welcomeEmailTemplate?: string) {
+ if (isNullOrWhiteSpace(verificationToken)) {
+ return Promise.reject(getValidationMessage('verificationToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.verificationToken = verificationToken;
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/email/smartlogin';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API sends a Smart Login link to the user's Email Id.
+ * @param clientGuid Unique string used in the Smart Login request
+ * @param email Email of the user
+ * @param redirectUrl Url where the user will redirect after success authentication
+ * @param smartLoginEmailTemplate Email template for Smart Login link
+ * @param welcomeEmailTemplate Name of the welcome email template
+ * @return Response containing Definition of Complete Validation data
+ *9.17.1
+ */
+ smartLoginByEmail (
+ clientGuid: string,
+ email: string,
+ redirectUrl?: string,
+ smartLoginEmailTemplate?: string,
+ welcomeEmailTemplate?: string
+ ) {
+ if (isNullOrWhiteSpace(clientGuid)) {
+ return Promise.reject(getValidationMessage('clientGuid'));
+ }
+ if (isNullOrWhiteSpace(email)) {
+ return Promise.reject(getValidationMessage('email'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.clientGuid = clientGuid;
+ queryParameters.email = email;
+ if (!isNullOrWhiteSpace(redirectUrl)) {
+ queryParameters.redirectUrl = redirectUrl;
+ }
+ if (!isNullOrWhiteSpace(smartLoginEmailTemplate)) {
+ queryParameters.smartLoginEmailTemplate = smartLoginEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/smartlogin';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API sends a Smart Login link to the user's Email Id.
+ * @param clientGuid Unique string used in the Smart Login request
+ * @param username UserName of the user
+ * @param redirectUrl Url where the user will redirect after success authentication
+ * @param smartLoginEmailTemplate Email template for Smart Login link
+ * @param welcomeEmailTemplate Name of the welcome email template
+ * @return Response containing Definition of Complete Validation data
+ *9.17.2
+ */
+ smartLoginByUserName (
+ clientGuid: string,
+ username: string,
+ redirectUrl?: string,
+ smartLoginEmailTemplate?: string,
+ welcomeEmailTemplate?: string
+ ) {
+ if (isNullOrWhiteSpace(clientGuid)) {
+ return Promise.reject(getValidationMessage('clientGuid'));
+ }
+ if (isNullOrWhiteSpace(username)) {
+ return Promise.reject(getValidationMessage('username'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.clientGuid = clientGuid;
+ queryParameters.username = username;
+ if (!isNullOrWhiteSpace(redirectUrl)) {
+ queryParameters.redirectUrl = redirectUrl;
+ }
+ if (!isNullOrWhiteSpace(smartLoginEmailTemplate)) {
+ queryParameters.smartLoginEmailTemplate = smartLoginEmailTemplate;
+ }
+ if (!isNullOrWhiteSpace(welcomeEmailTemplate)) {
+ queryParameters.welcomeEmailTemplate = welcomeEmailTemplate;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/smartlogin';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to check if the Smart Login link has been clicked or not
+ * @param clientGuid Unique string used in the Smart Login request
+ * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields
+ * @return Response containing User Profile Data and access token
+ *9.21.1
+ */
+ smartLoginPing (clientGuid, fields) {
+ if (isNullOrWhiteSpace(clientGuid)) {
+ return Promise.reject(getValidationMessage('clientGuid'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.clientGuid = clientGuid;
+ if (!isNullOrWhiteSpace(fields)) {
+ queryParameters.fields = fields;
+ }
+
+ var resourcePath = 'identity/v2/auth/login/smartlogin/ping';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+}
diff --git a/loginradius-sdk/src/api/social/nativeSocialApi.ts b/loginradius-sdk/src/api/social/nativeSocialApi.ts
new file mode 100644
index 0000000..b085311
--- /dev/null
+++ b/loginradius-sdk/src/api/social/nativeSocialApi.ts
@@ -0,0 +1,241 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class NativeSocialApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * The API is used to get LoginRadius access token by sending Facebook's access token. It will be valid for the specific duration of time specified in the response.
+ * @param fbAccessToken Facebook Access Token
+ * @param socialAppName Name of Social provider APP
+ * @return Response containing Definition of Complete Token data
+ *20.3
+ */
+ getAccessTokenByFacebookAccessToken (fbAccessToken: string, socialAppName?: string) {
+ if (isNullOrWhiteSpace(fbAccessToken)) {
+ return Promise.reject(getValidationMessage('fbAccessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.fb_Access_Token = fbAccessToken;
+ queryParameters.key = this.config.apiKey;
+ if (!isNullOrWhiteSpace(socialAppName)) {
+ queryParameters.socialAppName = socialAppName;
+ }
+
+ var resourcePath = 'api/v2/access_token/facebook';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * The API is used to get LoginRadius access token by sending Twitter's access token. It will be valid for the specific duration of time specified in the response.
+ * @param twAccessToken Twitter Access Token
+ * @param twTokenSecret Twitter Token Secret
+ * @param socialAppName Name of Social provider APP
+ * @return Response containing Definition of Complete Token data
+ *20.4
+ */
+ getAccessTokenByTwitterAccessToken (
+ twAccessToken: string,
+ twTokenSecret: string,
+ socialAppName?: string
+ ) {
+ if (isNullOrWhiteSpace(twAccessToken)) {
+ return Promise.reject(getValidationMessage('twAccessToken'));
+ }
+ if (isNullOrWhiteSpace(twTokenSecret)) {
+ return Promise.reject(getValidationMessage('twTokenSecret'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.key = this.config.apiKey;
+ queryParameters.tw_Access_Token = twAccessToken;
+ queryParameters.tw_Token_Secret = twTokenSecret;
+ if (!isNullOrWhiteSpace(socialAppName)) {
+ queryParameters.socialAppName = socialAppName;
+ }
+
+ var resourcePath = 'api/v2/access_token/twitter';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * The API is used to get LoginRadius access token by sending Google's access token. It will be valid for the specific duration of time specified in the response.
+ * @param googleAccessToken Google Access Token
+ * @param clientId Google Client ID
+ * @param refreshToken LoginRadius refresh token
+ * @param socialAppName Name of Social provider APP
+ * @return Response containing Definition of Complete Token data
+ *20.5
+ */
+ getAccessTokenByGoogleAccessToken (
+ googleAccessToken: string,
+ clientId?: string,
+ refreshToken?: string,
+ socialAppName?: string
+ ) {
+ if (isNullOrWhiteSpace(googleAccessToken)) {
+ return Promise.reject(getValidationMessage('googleAccessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.google_Access_Token = googleAccessToken;
+ queryParameters.key = this.config.apiKey;
+ if (!isNullOrWhiteSpace(clientId)) {
+ queryParameters.client_id = clientId;
+ }
+ if (!isNullOrWhiteSpace(refreshToken)) {
+ queryParameters.refresh_token = refreshToken;
+ }
+ if (!isNullOrWhiteSpace(socialAppName)) {
+ queryParameters.socialAppName = socialAppName;
+ }
+
+ var resourcePath = 'api/v2/access_token/google';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration.
+ * @param idToken Google JWT id_token
+ * @return Response containing Definition of Complete Token data
+ *20.6
+ */
+ getAccessTokenByGoogleJWTAccessToken (idToken: string) {
+ if (isNullOrWhiteSpace(idToken)) {
+ return Promise.reject(getValidationMessage('idToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.id_Token = idToken;
+ queryParameters.key = this.config.apiKey;
+
+ var resourcePath = 'api/v2/access_token/googlejwt';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * The API is used to get LoginRadius access token by sending Linkedin's access token. It will be valid for the specific duration of time specified in the response.
+ * @param lnAccessToken Linkedin Access Token
+ * @param socialAppName Name of Social provider APP
+ * @return Response containing Definition of Complete Token data
+ *20.7
+ */
+ getAccessTokenByLinkedinAccessToken (lnAccessToken: string, socialAppName?: string) {
+ if (isNullOrWhiteSpace(lnAccessToken)) {
+ return Promise.reject(getValidationMessage('lnAccessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.key = this.config.apiKey;
+ queryParameters.ln_Access_Token = lnAccessToken;
+ if (!isNullOrWhiteSpace(socialAppName)) {
+ queryParameters.socialAppName = socialAppName;
+ }
+
+ var resourcePath = 'api/v2/access_token/linkedin';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * The API is used to get LoginRadius access token by sending Foursquare's access token. It will be valid for the specific duration of time specified in the response.
+ * @param fsAccessToken Foursquare Access Token
+ * @return Response containing Definition of Complete Token data
+ *20.8
+ */
+ getAccessTokenByFoursquareAccessToken (fsAccessToken: string) {
+ if (isNullOrWhiteSpace(fsAccessToken)) {
+ return Promise.reject(getValidationMessage('fsAccessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.fs_Access_Token = fsAccessToken;
+ queryParameters.key = this.config.apiKey;
+
+ var resourcePath = 'api/v2/access_token/foursquare';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * The API is used to get LoginRadius access token by sending a valid Apple ID OAuth Code. It will be valid for the specific duration of time specified in the response.
+ * @param code Apple Code
+ * @param socialAppName Name of Social provider APP
+ * @return Response containing Definition of Complete Token data
+ *20.12
+ */
+ getAccessTokenByAppleIdCode (code: string, socialAppName: string) {
+ if (isNullOrWhiteSpace(code)) {
+ return Promise.reject(getValidationMessage('code'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.code = code;
+ queryParameters.key = this.config.apiKey;
+ if (!isNullOrWhiteSpace(socialAppName)) {
+ queryParameters.socialAppName = socialAppName;
+ }
+
+ var resourcePath = 'api/v2/access_token/apple';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API is used to retrieve a LoginRadius access token by passing in a valid WeChat OAuth Code.
+ * @param code WeChat Code
+ * @return Response containing Definition of Complete Token data
+ *20.13
+ */
+ getAccessTokenByWeChatCode (code: string) {
+ if (isNullOrWhiteSpace(code)) {
+ return Promise.reject(getValidationMessage('code'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.code = code;
+ queryParameters.key = this.config.apiKey;
+
+ var resourcePath = 'api/v2/access_token/wechat';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * The API is used to get LoginRadius access token by sending Google's AuthCode. It will be valid for the specific duration of time specified in the response.
+ * @param googleAuthcode Google AuthCode
+ * @param socialAppName Name of Social provider APP
+ * @return Response containing Definition of Complete Token data
+ *20.16
+ */
+ getAccessTokenByGoogleAuthCode (googleAuthcode: string, socialAppName?: string) {
+ if (isNullOrWhiteSpace(googleAuthcode)) {
+ return Promise.reject(getValidationMessage('googleAuthcode'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.apiKey = this.config.apiKey;
+ queryParameters.google_authcode = googleAuthcode;
+ if (!isNullOrWhiteSpace(socialAppName)) {
+ queryParameters.socialAppName = socialAppName;
+ }
+
+ var resourcePath = 'api/v2/access_token/google';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+}
diff --git a/loginradius-sdk/src/api/social/socialApi.ts b/loginradius-sdk/src/api/social/socialApi.ts
new file mode 100644
index 0000000..1094365
--- /dev/null
+++ b/loginradius-sdk/src/api/social/socialApi.ts
@@ -0,0 +1,168 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import {
+ getValidationMessage,
+ isNullOrWhiteSpace,
+ request
+} from '../../util/helper';
+import { LoginRadiusConfig } from '../../types';
+
+export default class SocialApi {
+ // eslint-disable-next-line no-useless-constructor, no-unused-vars, no-empty-function
+ constructor (private config: LoginRadiusConfig) {}
+
+ /**
+ * This API Is used to translate the Request Token returned during authentication into an Access Token that can be used with other API calls.
+ * @param token Token generated from a successful oauth from social platform
+ * @return Response containing Definition of Complete Token data
+ *20.1
+ */
+ exchangeAccessToken (token: string) {
+ if (isNullOrWhiteSpace(token)) {
+ return Promise.reject(getValidationMessage('token'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.secret = this.config.apiSecret;
+ queryParameters.token = token;
+
+ var resourcePath = 'api/v2/access_token';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * The Refresh Access Token API is used to refresh the provider access token after authentication. It will be valid for up to 60 days on LoginRadius depending on the provider. In order to use the access token in other APIs, always refresh the token using this API.
Supported Providers : Facebook,Yahoo,Google,Twitter, Linkedin.
Contact LoginRadius support team to enable this API.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @param expiresIn Allows you to specify a desired expiration time in minutes for the newly issued access token.
+ * @param isWeb Is web or not.
+ * @return Response containing Definition of Complete Token data
+ *20.2
+ */
+ refreshAccessToken (accessToken: string, expiresIn: number, isWeb: boolean) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.secret = this.config.apiSecret;
+ if (expiresIn !== null) {
+ queryParameters.expiresIn = expiresIn;
+ }
+ if (isWeb !== null) {
+ queryParameters.isWeb = isWeb;
+ }
+
+ var resourcePath = 'api/v2/access_token/refresh';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This API validates access token, if valid then returns a response with its expiry otherwise error.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @return Response containing Definition of Complete Token data
+ *20.9
+ */
+ validateAccessToken (accessToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.key = this.config.apiKey;
+ queryParameters.secret = this.config.apiSecret;
+
+ var resourcePath = 'api/v2/access_token/validate';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This api invalidates the active access token or expires an access token validity.
+ * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ * @return Response containing Definition for Complete Validation data
+ *20.10
+ */
+ inValidateAccessToken (accessToken: string) {
+ if (isNullOrWhiteSpace(accessToken)) {
+ return Promise.reject(getValidationMessage('accessToken'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.access_token = accessToken;
+ queryParameters.key = this.config.apiKey;
+ queryParameters.secret = this.config.apiSecret;
+
+ var resourcePath = 'api/v2/access_token/invalidate';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This api is use to get all active session by Access Token.
+ * @param token Token generated from a successful oauth from social platform
+ * @return Response containing Definition for Complete active sessions
+ *20.11.1
+ */
+ getActiveSession (token: string) {
+ if (isNullOrWhiteSpace(token)) {
+ return Promise.reject(getValidationMessage('token'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.key = this.config.apiKey;
+ queryParameters.secret = this.config.apiSecret;
+ queryParameters.token = token;
+
+ var resourcePath = 'api/v2/access_token/activesession';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This api is used to get all active sessions by AccountID(UID).
+ * @param accountId UID, the unified identifier for each user account
+ * @return Response containing Definition for Complete active sessions
+ *20.11.2
+ */
+ getActiveSessionByAccountID (accountId: string) {
+ if (isNullOrWhiteSpace(accountId)) {
+ return Promise.reject(getValidationMessage('accountId'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.accountId = accountId;
+ queryParameters.key = this.config.apiKey;
+ queryParameters.secret = this.config.apiSecret;
+
+ var resourcePath = 'api/v2/access_token/activesession';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+
+ /**
+ * This api is used to get all active sessions by ProfileId.
+ * @param profileId Social Provider Id
+ * @return Response containing Definition for Complete active sessions
+ *20.11.3
+ */
+ getActiveSessionByProfileID (profileId: string) {
+ if (isNullOrWhiteSpace(profileId)) {
+ return Promise.reject(getValidationMessage('profileId'));
+ }
+ var queryParameters: any = {};
+
+ queryParameters.key = this.config.apiKey;
+ queryParameters.profileId = profileId;
+ queryParameters.secret = this.config.apiSecret;
+
+ var resourcePath = 'api/v2/access_token/activesession';
+
+ return request(this.config, 'GET', resourcePath, queryParameters, null);
+ }
+}
diff --git a/loginradius-sdk/src/types.ts b/loginradius-sdk/src/types.ts
new file mode 100644
index 0000000..d65232a
--- /dev/null
+++ b/loginradius-sdk/src/types.ts
@@ -0,0 +1,21 @@
+export interface LoginRadiusConfig {
+ apiSecret: string;
+ serverRegion?: string;
+ originIp?: string;
+ apiDomain?: any;
+ proxy?: {
+ host: string;
+ port: number;
+ user?: string;
+ password?: string;
+ };
+ fieldsParam?: string;
+ fieldsValue?: string;
+ apiRequestSigning?: boolean;
+ apiKey: string;
+}
+
+export interface SottConfig {
+ apiKey: string,
+ apiSecret: string
+}
diff --git a/loginradius-sdk/src/util/helper.ts b/loginradius-sdk/src/util/helper.ts
new file mode 100644
index 0000000..08e4ebc
--- /dev/null
+++ b/loginradius-sdk/src/util/helper.ts
@@ -0,0 +1,279 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import crypto from 'crypto';
+import https from 'https';
+import querystring from 'querystring';
+
+const jsonData = {
+ Description: 'Oops something went wrong, Please try again.',
+ ErrorCode: 1000,
+ Message: 'Oops something went wrong, Please try again.',
+ IsProviderError: false,
+ ProviderErrorResponse: null
+};
+
+/**
+ * Check null or undefined
+ * @param input as input
+ * @return input is null or not
+ */
+export function isNullOrWhiteSpace (input?: string) {
+ return !(input === null || typeof input === 'undefined' ? '' : input);
+}
+
+/**
+ * Get Error response
+ * @param status
+ * @param input
+ * @return json of api response
+ */
+export function checkError (status: string, input: any) {
+ if (status === 'serverError') {
+ return input !== '' ? input : jsonData;
+ }
+ return input && input.ErrorCode;
+}
+
+/**
+ * Check json is correct or not
+ * @param input
+ * @return true if input is invalid
+ */
+export function checkJson (input: object) {
+ return !!(
+ input === null ||
+ input === undefined ||
+ Array.isArray(input) ||
+ typeof input !== 'object'
+ );
+}
+
+/**
+ * Get Validation Message
+ * @param type error string
+ * @return jsondata as json error object
+ */
+export function getValidationMessage (type: string) {
+ return {
+ ...jsonData,
+ Description: `The API Request Parameter ${type} is not Correct or WellFormated`
+ };
+}
+
+/**
+ * Manage the api response
+ * @param status error status
+ * @param data response data
+ * @param resolve as promise resolve
+ * @param reject as promise reject
+ */
+export function manageRequestResponse (status: string, data: any, resolve, reject) {
+ if (checkError(status, data)) {
+ if (!data) {
+ data = checkError(status, data);
+ }
+ reject(data);
+ } else {
+ resolve(data);
+ }
+}
+
+/**
+ * Get Query String
+ * @param string json input object
+ * @return query string
+ */
+export function getQueryString (string) {
+ return querystring.stringify(string, undefined, undefined, {
+ encodeURIComponent
+ });
+}
+
+/**
+ * Generate signin header
+ * @param options as options object
+ * @param apiSecret
+ * @return header object
+ */
+export function generateSigningHeader (options: any, apiSecret: string) {
+ var SIXTY = 60;
+ var SIXTYTHOUSAND = 60000;
+ var TEN = 10;
+ var expiryDate = new Date();
+ expiryDate = new Date(expiryDate.getTime() + SIXTY * SIXTYTHOUSAND);
+ var month = expiryDate.getMonth() + 1;
+
+ var expiryDateStr =
+ expiryDate.getFullYear() +
+ '-' +
+ (month < TEN ? '0' + month : month) +
+ '-' +
+ (expiryDate.getDate() < TEN
+ ? '0' + expiryDate.getDate()
+ : expiryDate.getDate()) +
+ ' ' +
+ (expiryDate.getHours() < TEN
+ ? '0' + expiryDate.getHours()
+ : expiryDate.getHours()) +
+ ':' +
+ (expiryDate.getMinutes() < TEN
+ ? '0' + expiryDate.getMinutes()
+ : expiryDate.getMinutes()) +
+ ':' +
+ (expiryDate.getSeconds() < TEN
+ ? '0' + expiryDate.getSeconds()
+ : expiryDate.getSeconds());
+
+ var encodeUrl = encodeURIComponent(
+ decodeURIComponent(options.uri)
+ ).toLowerCase();
+
+ var urlString;
+ if (options.body) {
+ urlString = expiryDateStr + ':' + encodeUrl + ':' + options.body;
+ } else {
+ urlString = expiryDateStr + ':' + encodeUrl;
+ }
+ var hash = crypto
+ .createHmac('sha256', apiSecret)
+ .update(urlString)
+ .digest('base64');
+
+ return {
+ 'X-Request-Expires': expiryDateStr,
+ digest: 'SHA-256=' + hash
+ };
+}
+
+export function request (config, type, resourcePath, queryParameters, formData) {
+ var isApiSecret;
+ if (queryParameters.apiSecret) {
+ isApiSecret = queryParameters.apiSecret;
+ delete queryParameters.apiSecret;
+ }
+
+ if (!isNullOrWhiteSpace(config.serverRegion)) {
+ queryParameters.region = config.serverRegion;
+ }
+
+ var headers = { 'Content-Type': 'application/json' };
+
+ if (queryParameters.sott) {
+ Object.assign(headers, { 'X-LoginRadius-Sott': queryParameters.sott });
+ delete queryParameters.sott;
+ }
+ if (!isNullOrWhiteSpace(config.originIp)) {
+ Object.assign(headers, { 'X-Origin-IP': config.originIp });
+ }
+ var queryString = getQueryString(queryParameters);
+
+ if (queryParameters.access_token) {
+ Object.assign(headers, {
+ authorization: 'Bearer ' + queryParameters.access_token
+ });
+ delete queryParameters.access_token;
+ }
+ var options: any = {
+ method: type,
+ hostname:
+ resourcePath === 'ciam/appinfo'
+ ? 'config.lrcontent.com'
+ : config.apiDomain,
+ path: '/' + resourcePath + (queryString ? '?' + queryString : ''),
+ headers: headers
+ };
+
+ if (formData !== '' && formData !== null) {
+ var out_text = JSON.stringify(formData);
+ Object.assign(headers, { 'Content-Length': out_text.length });
+ }
+
+ if (config.proxy && config.proxy.host && config.proxy.port) {
+ options.proxy =
+ (config.proxy.protocol ? config.proxy.protocol : 'http') +
+ '://' +
+ config.proxy.user +
+ ':' +
+ config.proxy.password +
+ '@' +
+ config.proxy.host +
+ ':' +
+ config.proxy.port;
+ }
+
+ var customHeader = {
+ 'X-LoginRadius-apiKey': config.apiKey,
+ 'X-LoginRadius-apiSecret': config.apiSecret
+ };
+
+ if (config.fieldsParam && config.fieldsValue) {
+ var fieldsList;
+ if (options.path.match(/\?./)) {
+ fieldsList = config.fieldsParam + encodeURIComponent(config.fieldsValue);
+ } else {
+ fieldsList = '?fields=' + encodeURIComponent(config.fieldsValue);
+ }
+ options.path += fieldsList;
+ }
+
+ if (isApiSecret) {
+ if (config.apiRequestSigning) {
+ if (!options.path.match('apiKey')) {
+ options.path += '&apiKey=' + encodeURIComponent(config.apiKey);
+ }
+ var signingHeader = generateSigningHeader(options, config.apiSecret);
+
+ Object.assign(options.headers, signingHeader);
+ } else {
+ Object.assign(options.headers, customHeader);
+ }
+ }
+ return new Promise(function (resolve, reject) {
+ const req = https
+ .request(options, (resp) => {
+ var data = '';
+ if (
+ Object.prototype.hasOwnProperty.call(resp, 'statusCode') &&
+ resp.statusCode === 429
+ ) {
+ var tooManyRequestsData = {
+ Description: 'Too many request in particular time frame',
+ ErrorCode: 429,
+ Message: 'Too many request in particular time frame',
+ IsProviderError: false,
+ ProviderErrorResponse: null
+ };
+ manageRequestResponse(
+ 'serverError',
+ tooManyRequestsData,
+ resolve,
+ reject
+ );
+ } else {
+ resp.on('data', (chunk) => {
+ data += chunk;
+ });
+
+ resp.on('end', () => {
+ try {
+ var response = JSON.parse(data);
+ manageRequestResponse('', response, resolve, reject);
+ } catch (err) {
+ manageRequestResponse('serverError', '', resolve, reject);
+ }
+ });
+ }
+ })
+ .on('error', (error) => {
+ manageRequestResponse('serverError', error, resolve, reject);
+ });
+
+ if (out_text) {
+ req.write(out_text);
+ }
+
+ req.end();
+ });
+}
diff --git a/loginradius-sdk/src/util/lr.ts b/loginradius-sdk/src/util/lr.ts
new file mode 100644
index 0000000..c07035a
--- /dev/null
+++ b/loginradius-sdk/src/util/lr.ts
@@ -0,0 +1,97 @@
+/*
+ * Created by LoginRadius Development Team
+ Copyright 2019 LoginRadius Inc. All rights reserved.
+*/
+import { LoginRadiusConfig, SottConfig } from '../types';
+import AccountApi from '../api/account/accountApi';
+import AuthenticationApi from '../api/authentication/authenticationApi';
+import ConfigurationApi from '../api/advanced/configurationApi';
+import ConsentManagementApi from '../api/advanced/consentManagementApi';
+import CustomObjectApi from '../api/advanced/customObjectApi';
+import MultiFactorAuthenticationApi from '../api/advanced/multiFactorAuthenticationApi';
+import NativeSocialApi from '../api/social/nativeSocialApi';
+import OneTouchLoginApi from '../api/authentication/oneTouchLoginApi';
+import PasswordlessLoginApi from '../api/authentication/passwordLessLoginApi';
+import PhoneAuthenticationApi from '../api/authentication/phoneAuthenticationApi';
+import PinAuthenticationApi from '../api/authentication/pinAuthenticationApi';
+import ReAuthenticationApi from '../api/advanced/reAuthenticationApi';
+import RiskBasedAuthenticationApi from '../api/authentication/riskBasedAuthenticationApi';
+import RoleApi from '../api/account/roleApi';
+import SmartLoginApi from '../api/authentication/smartLoginApi';
+import SocialApi from '../api/social/socialApi';
+import SottApi from '../api/account/sottApi';
+import WebHookApi from '../api/advanced/webHookApi';
+import sott from './sott';
+
+export default class LoginRadiusApi {
+
+ accountApi: AccountApi;
+ roleApi: RoleApi;
+ sottApi: SottApi;
+ configurationApi: ConfigurationApi;
+ customObjectApi: CustomObjectApi;
+ multiFactorAuthenticationApi: MultiFactorAuthenticationApi;
+ webHookApi: WebHookApi;
+ consentManagementApi: ConsentManagementApi;
+ reAuthenticationApi: ReAuthenticationApi;
+ authenticationApi: AuthenticationApi;
+ oneTouchLoginApi: OneTouchLoginApi;
+ passwordLessLoginApi: PasswordlessLoginApi;
+ phoneAuthenticationApi: PhoneAuthenticationApi;
+ riskBasedAuthenticationApi: RiskBasedAuthenticationApi;
+ pinAuthenticationApi: PinAuthenticationApi;
+ smartLoginApi: SmartLoginApi;
+ nativeSocialApi: NativeSocialApi;
+ socialApi: SocialApi;
+
+ constructor (private config: LoginRadiusConfig) {
+ if (config.apiKey === undefined || config.apiSecret === undefined) {
+ throw new Error('Please set apiKey API & apiSecret');
+ }
+ if (!config.apiDomain || config.apiDomain === '') {
+ config.apiDomain = 'api.loginradius.com';
+ }
+ this.accountApi = new AccountApi(config);
+ this.roleApi = new RoleApi(config);
+ this.sottApi = new SottApi(config);
+ this.configurationApi = new ConfigurationApi(config);
+ this.customObjectApi = new CustomObjectApi(config);
+ this.multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(config);
+ this.webHookApi = new WebHookApi(config);
+ this.consentManagementApi = new ConsentManagementApi(config);
+ this.reAuthenticationApi = new ReAuthenticationApi(config);
+ this.authenticationApi = new AuthenticationApi(config);
+ this.oneTouchLoginApi = new OneTouchLoginApi(config);
+ this.passwordLessLoginApi = new PasswordlessLoginApi(config);
+ this.phoneAuthenticationApi = new PhoneAuthenticationApi(config);
+ this.riskBasedAuthenticationApi = new RiskBasedAuthenticationApi(config);
+ this.pinAuthenticationApi = new PinAuthenticationApi(config);
+ this.smartLoginApi = new SmartLoginApi(config);
+ this.nativeSocialApi = new NativeSocialApi(config);
+ this.socialApi = new SocialApi(config);
+ }
+
+ /**
+ * Generate the sott
+ * @param sottconfig site config
+ * @param startDate start date
+ * @param endDate end date
+ * @return generated sott
+ */
+ async getSott (sottconfig: Partial, startDate: string, endDate: string, timeDifference: number) {
+ try {
+ return await sott(
+ {
+ apiKey: this.config.apiKey,
+ apiSecret: this.config.apiSecret,
+ ...sottconfig
+ },
+ startDate,
+ endDate,
+ timeDifference
+ );
+ } catch (err) {
+ throw err;
+ }
+ }
+}
diff --git a/loginradius-sdk/sdk/util/sott.js b/loginradius-sdk/src/util/sott.ts
similarity index 74%
rename from loginradius-sdk/sdk/util/sott.js
rename to loginradius-sdk/src/util/sott.ts
index c00384e..0090f8b 100644
--- a/loginradius-sdk/sdk/util/sott.js
+++ b/loginradius-sdk/src/util/sott.ts
@@ -1,18 +1,14 @@
-'use strict';
+import { SottConfig } from '../types';
+import crypto from 'crypto';
-module.exports = function (config, sottconfig, startDate, endDate, timeDifference) {
- var helper = require(config.HELPER_PATH)();
-
- var key = !helper.isNullOrWhiteSpace(sottconfig.apiKey) ? sottconfig.apiKey : config.apiKey;
- var secret = !helper.isNullOrWhiteSpace(sottconfig.apiSecret) ? sottconfig.apiSecret : config.apiSecret;
- var time = !helper.isNullOrWhiteSpace(timeDifference) ? parseInt(timeDifference) : 10;
+export default function (sottconfig: SottConfig, startDate: string, endDate: string, timeDifference: number) {
+ var key = sottconfig.apiKey;
+ var secret = sottconfig.apiSecret;
+ var time = timeDifference;
-
- var crypto = require('crypto');
return new Promise(function (resolve, reject) {
var tempToken = '';
-
if (startDate && endDate) {
tempToken = startDate + '#' + key + '#' + endDate;
} else {
@@ -58,13 +54,12 @@ module.exports = function (config, sottconfig, startDate, endDate, timeDifferenc
encrypt(tempToken, resolve, reject);
});
- function encrypt(plainText, resolve, reject) {
+ function encrypt (plainText, resolve, reject) {
var initVector = 'tu89geji340t89u2';
var keySize = 256;
var iterations = 10000;
var keyLenNumber = 8;
var initVectorBuffer = Buffer.from(initVector, 'utf8');
- var plainTextBuffer = Buffer.from(plainText, 'utf8');
crypto.pbkdf2(
secret,
Buffer.from(new Array(keyLenNumber)),
@@ -78,7 +73,7 @@ module.exports = function (config, sottconfig, startDate, endDate, timeDifferenc
keyBytes,
initVectorBuffer
);
- var cryptedText = cipher.update(plainTextBuffer, 'utf8', 'base64');
+ var cryptedText = cipher.update(plainText, 'utf8', 'base64');
cryptedText += cipher.final('base64');
var hash = crypto.createHash('md5');
@@ -87,4 +82,4 @@ module.exports = function (config, sottconfig, startDate, endDate, timeDifferenc
}
);
}
-};
\ No newline at end of file
+}
diff --git a/loginradius-sdk/tsconfig.json b/loginradius-sdk/tsconfig.json
new file mode 100644
index 0000000..85cb063
--- /dev/null
+++ b/loginradius-sdk/tsconfig.json
@@ -0,0 +1,104 @@
+{
+ "compilerOptions": {
+ /* Visit https://aka.ms/tsconfig to read more about this file */
+
+ /* Projects */
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
+
+ /* Language and Environment */
+ "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
+ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
+
+ /* Modules */
+ "module": "commonjs", /* Specify what module code is generated. */
+ // "rootDir": "./", /* Specify the root folder within your source files. */
+ // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
+ // "resolveJsonModule": true, /* Enable importing .json files. */
+ // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */
+
+ /* JavaScript Support */
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
+
+ /* Emit */
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
+ "outDir": "./lib/types", /* Specify an output folder for all emitted files. */
+ // "removeComments": true, /* Disable emitting comments. */
+ // "noEmit": true, /* Disable emitting files from a compilation. */
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
+
+ /* Interop Constraints */
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
+
+ /* Type Checking */
+ "strict": true, /* Enable all strict type-checking options. */
+ "noImplicitAny": false, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
+
+ /* Completeness */
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
+ },
+ "include": [ "src/**/*"]
+}