rts2003-so 1.4.0 → 1.4.1

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 +6 -2
  2. package/index.js +2 -5
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -60,11 +60,15 @@ 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({
63
+ // user get user for api
64
+ const result = sso.getOne({
65
65
  "email": "string"
66
66
  });
67
67
 
68
+ const result = sso.getOne({
69
+ "id": "string"
70
+ });
71
+
68
72
  // user update password for api
69
73
  const result = sso.userUpdatePassword({
70
74
  "email": "string",
package/index.js CHANGED
@@ -140,7 +140,7 @@ class SingleSignOn {
140
140
  }
141
141
  }
142
142
 
143
- async getUserByEmail(dataToSend = {
143
+ async getOne(dataToSend = {
144
144
  email
145
145
  }) {
146
146
  try {
@@ -150,11 +150,8 @@ class SingleSignOn {
150
150
  if (!this.secretKey) {
151
151
  return { message: "Environment secret key not found", statusCode: 400, error: false };
152
152
  }
153
- if (!dataToSend.email) {
154
- return { message: "Field email not found", statusCode: 400, error: false };
155
- }
156
153
 
157
- const response = await fetch(`${this.endpoint}/user/get-user-by-email/${this.clientId}/${this.secretKey}`, {
154
+ const response = await fetch(`${this.endpoint}/user/get-one/${this.clientId}/${this.secretKey}`, {
158
155
  method: 'POST',
159
156
  headers: {
160
157
  '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.1",
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"