@etsoo/appscript 1.5.73 → 1.5.74

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.
@@ -37,10 +37,11 @@ export declare class AuthApi extends BaseApi {
37
37
  * Change password
38
38
  * @param oldPassword Ole password
39
39
  * @param password New password
40
+ * @param isSecure Is secure or not
40
41
  * @param payload Payload
41
42
  * @returns Result
42
43
  */
43
- changePassword(oldPassword: string, password: string, payload?: ResultPayload): Promise<IActionResult<{}> | undefined>;
44
+ changePassword(oldPassword: string, password: string, isSecure?: boolean, payload?: ResultPayload): Promise<IActionResult<{}> | undefined>;
44
45
  /**
45
46
  * Exchange token
46
47
  * @param rq Request data
@@ -28,15 +28,21 @@ class AuthApi extends BaseApi_1.BaseApi {
28
28
  * Change password
29
29
  * @param oldPassword Ole password
30
30
  * @param password New password
31
+ * @param isSecure Is secure or not
31
32
  * @param payload Payload
32
33
  * @returns Result
33
34
  */
34
- changePassword(oldPassword, password, payload) {
35
- const rq = {
36
- deviceId: this.app.deviceId,
37
- oldPassword: this.app.encrypt(this.app.hash(oldPassword)),
38
- password: this.app.encrypt(this.app.hash(password))
39
- };
35
+ changePassword(oldPassword, password, isSecure, payload) {
36
+ const rq = isSecure === false
37
+ ? {
38
+ oldPassword: this.app.hash(oldPassword),
39
+ password: this.app.hash(password)
40
+ }
41
+ : {
42
+ deviceId: this.app.deviceId,
43
+ oldPassword: this.app.encrypt(this.app.hash(oldPassword)),
44
+ password: this.app.encrypt(this.app.hash(password))
45
+ };
40
46
  return this.api.put("Auth/ChangePassword", rq, payload);
41
47
  }
42
48
  /**
@@ -3,7 +3,7 @@ export type ChangePasswordRQ = {
3
3
  * Device id
4
4
  * 设备编号
5
5
  */
6
- deviceId: string;
6
+ deviceId?: string;
7
7
  /**
8
8
  * Current password
9
9
  * 当前密码
@@ -37,10 +37,11 @@ export declare class AuthApi extends BaseApi {
37
37
  * Change password
38
38
  * @param oldPassword Ole password
39
39
  * @param password New password
40
+ * @param isSecure Is secure or not
40
41
  * @param payload Payload
41
42
  * @returns Result
42
43
  */
43
- changePassword(oldPassword: string, password: string, payload?: ResultPayload): Promise<IActionResult<{}> | undefined>;
44
+ changePassword(oldPassword: string, password: string, isSecure?: boolean, payload?: ResultPayload): Promise<IActionResult<{}> | undefined>;
44
45
  /**
45
46
  * Exchange token
46
47
  * @param rq Request data
@@ -25,15 +25,21 @@ export class AuthApi extends BaseApi {
25
25
  * Change password
26
26
  * @param oldPassword Ole password
27
27
  * @param password New password
28
+ * @param isSecure Is secure or not
28
29
  * @param payload Payload
29
30
  * @returns Result
30
31
  */
31
- changePassword(oldPassword, password, payload) {
32
- const rq = {
33
- deviceId: this.app.deviceId,
34
- oldPassword: this.app.encrypt(this.app.hash(oldPassword)),
35
- password: this.app.encrypt(this.app.hash(password))
36
- };
32
+ changePassword(oldPassword, password, isSecure, payload) {
33
+ const rq = isSecure === false
34
+ ? {
35
+ oldPassword: this.app.hash(oldPassword),
36
+ password: this.app.hash(password)
37
+ }
38
+ : {
39
+ deviceId: this.app.deviceId,
40
+ oldPassword: this.app.encrypt(this.app.hash(oldPassword)),
41
+ password: this.app.encrypt(this.app.hash(password))
42
+ };
37
43
  return this.api.put("Auth/ChangePassword", rq, payload);
38
44
  }
39
45
  /**
@@ -3,7 +3,7 @@ export type ChangePasswordRQ = {
3
3
  * Device id
4
4
  * 设备编号
5
5
  */
6
- deviceId: string;
6
+ deviceId?: string;
7
7
  /**
8
8
  * Current password
9
9
  * 当前密码
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.5.73",
3
+ "version": "1.5.74",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -48,19 +48,27 @@ export class AuthApi extends BaseApi {
48
48
  * Change password
49
49
  * @param oldPassword Ole password
50
50
  * @param password New password
51
+ * @param isSecure Is secure or not
51
52
  * @param payload Payload
52
53
  * @returns Result
53
54
  */
54
55
  changePassword(
55
56
  oldPassword: string,
56
57
  password: string,
58
+ isSecure?: boolean,
57
59
  payload?: ResultPayload
58
60
  ) {
59
- const rq: ChangePasswordRQ = {
60
- deviceId: this.app.deviceId,
61
- oldPassword: this.app.encrypt(this.app.hash(oldPassword)),
62
- password: this.app.encrypt(this.app.hash(password))
63
- };
61
+ const rq: ChangePasswordRQ =
62
+ isSecure === false
63
+ ? {
64
+ oldPassword: this.app.hash(oldPassword),
65
+ password: this.app.hash(password)
66
+ }
67
+ : {
68
+ deviceId: this.app.deviceId,
69
+ oldPassword: this.app.encrypt(this.app.hash(oldPassword)),
70
+ password: this.app.encrypt(this.app.hash(password))
71
+ };
64
72
  return this.api.put("Auth/ChangePassword", rq, payload);
65
73
  }
66
74
 
@@ -3,7 +3,7 @@ export type ChangePasswordRQ = {
3
3
  * Device id
4
4
  * 设备编号
5
5
  */
6
- deviceId: string;
6
+ deviceId?: string;
7
7
 
8
8
  /**
9
9
  * Current password