rts2003-so 1.4.2 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/index.js +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,12 +19,12 @@ $ npm install --save rts2003-so
|
|
|
19
19
|
const { SingleSignOn, RTS2003_SO_ENDPOINT, RTS2003_SO_CLIENT_KEY, RTS2003_SO_SECRET_KEY } = require('rts2003-so');
|
|
20
20
|
|
|
21
21
|
process.env.RTS2003_SO_ENDPOINT = 'custom-endpoint';
|
|
22
|
-
process.env.
|
|
22
|
+
process.env.RTS2003_SO_CLIENT_ID = 'custom-client-id';
|
|
23
23
|
process.env.RTS2003_SO_SECRET_KEY = 'custom-secret-key';
|
|
24
24
|
|
|
25
25
|
// show env
|
|
26
26
|
console.log('ENDPOINT Key:', RTS2003_SO_ENDPOINT);
|
|
27
|
-
console.log('
|
|
27
|
+
console.log('CLIENT_ID Key:', RTS2003_SO_CLIENT_ID);
|
|
28
28
|
console.log('SECRET_KEY Key:', RTS2003_SO_SECRET_KEY);
|
|
29
29
|
|
|
30
30
|
// use new class
|
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
|
|
2
2
|
|
|
3
3
|
const RTS2003_SO_ENDPOINT = process.env.RTS2003_SO_ENDPOINT || '';
|
|
4
|
-
const
|
|
4
|
+
const RTS2003_SO_CLIENT_ID = process.env.RTS2003_SO_CLIENT_ID || '';
|
|
5
5
|
const RTS2003_SO_SECRET_KEY = process.env.RTS2003_SO_SECRET_KEY || '';
|
|
6
6
|
|
|
7
7
|
class SingleSignOn {
|
|
8
|
-
constructor(endpoint = RTS2003_SO_ENDPOINT, clientId =
|
|
8
|
+
constructor(endpoint = RTS2003_SO_ENDPOINT, clientId = RTS2003_SO_CLIENT_ID, secretKey = RTS2003_SO_SECRET_KEY) {
|
|
9
9
|
this.endpoint = endpoint;
|
|
10
10
|
this.clientId = clientId;
|
|
11
11
|
this.secretKey = secretKey;
|
|
@@ -31,16 +31,16 @@ class SingleSignOn {
|
|
|
31
31
|
if (!dataToSend.email) {
|
|
32
32
|
return { message: "Field email not found", statusCode: 400, error: false };
|
|
33
33
|
}
|
|
34
|
-
if (!
|
|
34
|
+
if (!dataToSend.first_name) {
|
|
35
35
|
return { message: "Field first_name not found", statusCode: 400, error: false };
|
|
36
36
|
}
|
|
37
|
-
if (!
|
|
37
|
+
if (!dataToSend.last_name) {
|
|
38
38
|
return { message: "Field last_name not found", statusCode: 400, error: false };
|
|
39
39
|
}
|
|
40
|
-
if (!
|
|
40
|
+
if (!dataToSend.is_active) {
|
|
41
41
|
return { message: "Field is_active not found", statusCode: 400, error: false };
|
|
42
42
|
}
|
|
43
|
-
if (!
|
|
43
|
+
if (!dataToSend.created_by) {
|
|
44
44
|
return { message: "Field created_by not found", statusCode: 400, error: false };
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -77,16 +77,16 @@ class SingleSignOn {
|
|
|
77
77
|
if (!dataToSend.id) {
|
|
78
78
|
return { message: "Field id not found", statusCode: 400, error: false };
|
|
79
79
|
}
|
|
80
|
-
if (!
|
|
80
|
+
if (!dataToSend.first_name) {
|
|
81
81
|
return { message: "Field first_name not found", statusCode: 400, error: false };
|
|
82
82
|
}
|
|
83
|
-
if (!
|
|
83
|
+
if (!dataToSend.last_name) {
|
|
84
84
|
return { message: "Field last_name not found", statusCode: 400, error: false };
|
|
85
85
|
}
|
|
86
|
-
if (!
|
|
86
|
+
if (!dataToSend.is_active) {
|
|
87
87
|
return { message: "Field is_active not found", statusCode: 400, error: false };
|
|
88
88
|
}
|
|
89
|
-
if (!
|
|
89
|
+
if (!dataToSend.updated_by) {
|
|
90
90
|
return { message: "Field updated_by not found", statusCode: 400, error: false };
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -120,7 +120,7 @@ class SingleSignOn {
|
|
|
120
120
|
if (!dataToSend.id) {
|
|
121
121
|
return { message: "Field id not found", statusCode: 400, error: false };
|
|
122
122
|
}
|
|
123
|
-
if (!
|
|
123
|
+
if (!dataToSend.deleted_by) {
|
|
124
124
|
return { message: "Field deleted_by not found", statusCode: 400, error: false };
|
|
125
125
|
}
|
|
126
126
|
|
package/package.json
CHANGED