Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript Support #27

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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)
});

Expand Down
4 changes: 2 additions & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodeJsDemo",
"version": "11.5.0-demo",
"version": "12.0.0-demo",
"keywords": [
"util",
"functional",
Expand All @@ -13,6 +13,6 @@
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.3",
"loginradius-sdk": "11.5.0"
"loginradius-sdk": "12.0.0"
}
}
4 changes: 2 additions & 2 deletions demo/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 12 additions & 2 deletions loginradius-sdk/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -14,6 +22,7 @@
"ecmaVersion": 2018
},
"rules": {
"@typescript-eslint/no-explicit-any": 0,
"accessor-pairs": "error",
"array-bracket-newline": "error",
"array-bracket-spacing": "error",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions loginradius-sdk/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "none"
}
Loading