rts2003-so
v1.4.3
Published
RTS2003 SO is service order, manage user, like re-token, logout, register, update, delete, update password, get user.
Downloads
414
Maintainers
Readme
RTS2003-SO
RTS2003 SO is service order, manage user, like register, update, delete, update password.
Install
Install with npm:
$ npm install --save rts2003-soUsage
const { SingleSignOn, RTS2003_SO_ENDPOINT, RTS2003_SO_CLIENT_KEY, RTS2003_SO_SECRET_KEY } = require('rts2003-so');
process.env.RTS2003_SO_ENDPOINT = 'custom-endpoint';
process.env.RTS2003_SO_CLIENT_KEY = 'custom-client-id';
process.env.RTS2003_SO_SECRET_KEY = 'custom-secret-key';
// show env
console.log('ENDPOINT Key:', RTS2003_SO_ENDPOINT);
console.log('CLIENT_KEY Key:', RTS2003_SO_CLIENT_KEY);
console.log('SECRET_KEY Key:', RTS2003_SO_SECRET_KEY);
// use new class
const sso = new SingleSignOn();
// api require
// process.env.RTS2003_SO_ENDPOINT = 'custom-endpoint';
// process.env.RTS2003_SO_CLIENT_KEY = 'custom-client-id';
// process.env.RTS2003_SO_SECRET_KEY = 'custom-secret-key';
// user register for api
const result = sso.userRegister({
"email": "string",
"first_name": "string",
"last_name": "string",
"is_active": 0,
"created_by": 0
});
// user update for api
const result = sso.userUpdate({
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"is_active": 0,
"updated_by": 0
});
// user delete for api
const result = sso.userDelete({
"id": 0,
"deleted_by": 0
});
// user get user for api
const result = sso.userGetOne({
"email": "string",
"id": 0
});
// user update password for api
const result = sso.userUpdatePassword({
"email": "string",
"current_password": "string",
"new_password": "string",
});
// frontend require
// process.env.RTS2003_SO_ENDPOINT = 'custom-endpoint';
// process.env.RTS2003_SO_CLIENT_KEY = 'custom-client-id';
// user refresh token for frontend
const result = sso.userRefreshToken({
"token": "string"
});
// user logout for frontend
const result = sso.userLogout({
"token": "string"
});