rts2003-so 1.4.0 → 1.4.2

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.
Files changed (3) hide show
  1. package/README.md +4 -3
  2. package/index.js +4 -6
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -60,9 +60,10 @@ const result = sso.userDelete({
60
60
  "deleted_by": 0
61
61
  });
62
62
 
63
- // user get user by email for api
64
- const result = sso.getUserByEmail({
65
- "email": "string"
63
+ // user get user for api
64
+ const result = sso.userGetOne({
65
+ "email": "string",
66
+ "id": 0
66
67
  });
67
68
 
68
69
  // user update password for api
package/index.js CHANGED
@@ -140,8 +140,9 @@ class SingleSignOn {
140
140
  }
141
141
  }
142
142
 
143
- async getUserByEmail(dataToSend = {
144
- email
143
+ async userGetOne(dataToSend = {
144
+ email,
145
+ id
145
146
  }) {
146
147
  try {
147
148
  if (!this.endpoint) {
@@ -150,11 +151,8 @@ class SingleSignOn {
150
151
  if (!this.secretKey) {
151
152
  return { message: "Environment secret key not found", statusCode: 400, error: false };
152
153
  }
153
- if (!dataToSend.email) {
154
- return { message: "Field email not found", statusCode: 400, error: false };
155
- }
156
154
 
157
- const response = await fetch(`${this.endpoint}/user/get-user-by-email/${this.clientId}/${this.secretKey}`, {
155
+ const response = await fetch(`${this.endpoint}/user/get-one/${this.clientId}/${this.secretKey}`, {
158
156
  method: 'POST',
159
157
  headers: {
160
158
  'Content-Type': 'application/json',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rts2003-so",
3
- "version": "1.4.0",
4
- "description": "RTS2003 SO is service order, manage user, like re-token, logout, register, update, delete, update password, get user by email.",
3
+ "version": "1.4.2",
4
+ "description": "RTS2003 SO is service order, manage user, like re-token, logout, register, update, delete, update password, get user.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "jest -o ./test.js"