@etsoo/appscript 1.5.17 → 1.5.19
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/lib/cjs/app/CoreApp.d.ts +2 -2
- package/lib/cjs/app/CoreApp.js +4 -2
- package/lib/cjs/app/IApp.d.ts +2 -10
- package/lib/cjs/erp/rq/RefreshTokenRQ.d.ts +0 -12
- package/lib/cjs/state/User.d.ts +2 -2
- package/lib/mjs/app/CoreApp.d.ts +2 -2
- package/lib/mjs/app/CoreApp.js +4 -2
- package/lib/mjs/app/IApp.d.ts +2 -10
- package/lib/mjs/erp/rq/RefreshTokenRQ.d.ts +0 -12
- package/lib/mjs/state/User.d.ts +2 -2
- package/package.json +1 -1
- package/src/app/CoreApp.ts +5 -3
- package/src/app/IApp.ts +2 -14
- package/src/erp/rq/RefreshTokenRQ.ts +0 -15
- package/src/state/User.ts +2 -2
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
83
83
|
get region(): string;
|
|
84
84
|
private _deviceId;
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
86
|
+
* Device id, randome string from ServiceBase.InitCallAsync
|
|
87
87
|
*/
|
|
88
88
|
get deviceId(): string;
|
|
89
89
|
/**
|
|
@@ -550,7 +550,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
550
550
|
* Refresh token
|
|
551
551
|
* @param props Props
|
|
552
552
|
*/
|
|
553
|
-
refreshToken
|
|
553
|
+
refreshToken(props?: RefreshTokenProps): Promise<boolean>;
|
|
554
554
|
/**
|
|
555
555
|
* Setup callback
|
|
556
556
|
*/
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -36,7 +36,7 @@ class CoreApp {
|
|
|
36
36
|
return this._region;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Device id, randome string from ServiceBase.InitCallAsync
|
|
40
40
|
*/
|
|
41
41
|
get deviceId() {
|
|
42
42
|
return this._deviceId;
|
|
@@ -1391,7 +1391,9 @@ class CoreApp {
|
|
|
1391
1391
|
userLogin(user, refreshToken, keep) {
|
|
1392
1392
|
this.userData = user;
|
|
1393
1393
|
// Cache the encrypted serverside device id
|
|
1394
|
-
|
|
1394
|
+
if (user.deviceId) {
|
|
1395
|
+
this.storage.setData(this.fields.serversideDeviceId, user.deviceId);
|
|
1396
|
+
}
|
|
1395
1397
|
if (keep) {
|
|
1396
1398
|
this.authorize(user.token, user.tokenScheme, refreshToken);
|
|
1397
1399
|
}
|
package/lib/cjs/app/IApp.d.ts
CHANGED
|
@@ -41,19 +41,11 @@ export type FormatResultCustomCallback = ((data: FormatResultCustom) => string |
|
|
|
41
41
|
/**
|
|
42
42
|
* Refresh token props
|
|
43
43
|
*/
|
|
44
|
-
export interface RefreshTokenProps
|
|
44
|
+
export interface RefreshTokenProps {
|
|
45
45
|
/**
|
|
46
46
|
* Callback
|
|
47
47
|
*/
|
|
48
48
|
callback?: (result: RefreshTokenResult, successData?: string) => void;
|
|
49
|
-
/**
|
|
50
|
-
* Data to pass
|
|
51
|
-
*/
|
|
52
|
-
data?: D;
|
|
53
|
-
/**
|
|
54
|
-
* Support relogin or not
|
|
55
|
-
*/
|
|
56
|
-
relogin?: boolean;
|
|
57
49
|
/**
|
|
58
50
|
* Show loading bar or not
|
|
59
51
|
*/
|
|
@@ -478,7 +470,7 @@ export interface IApp {
|
|
|
478
470
|
* Refresh token
|
|
479
471
|
* @param props Props
|
|
480
472
|
*/
|
|
481
|
-
refreshToken
|
|
473
|
+
refreshToken(props?: RefreshTokenProps): Promise<boolean>;
|
|
482
474
|
/**
|
|
483
475
|
* Setup Api error handler
|
|
484
476
|
* @param api Api
|
package/lib/cjs/state/User.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { IState } from './State';
|
|
|
4
4
|
*/
|
|
5
5
|
export interface IUserData {
|
|
6
6
|
/**
|
|
7
|
-
* Serverside device id encrypted
|
|
7
|
+
* Serverside device id encrypted, not the same device id of the app
|
|
8
8
|
*/
|
|
9
|
-
readonly deviceId
|
|
9
|
+
readonly deviceId?: string;
|
|
10
10
|
/**
|
|
11
11
|
* User name
|
|
12
12
|
* 用户姓名
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
83
83
|
get region(): string;
|
|
84
84
|
private _deviceId;
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
86
|
+
* Device id, randome string from ServiceBase.InitCallAsync
|
|
87
87
|
*/
|
|
88
88
|
get deviceId(): string;
|
|
89
89
|
/**
|
|
@@ -550,7 +550,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
550
550
|
* Refresh token
|
|
551
551
|
* @param props Props
|
|
552
552
|
*/
|
|
553
|
-
refreshToken
|
|
553
|
+
refreshToken(props?: RefreshTokenProps): Promise<boolean>;
|
|
554
554
|
/**
|
|
555
555
|
* Setup callback
|
|
556
556
|
*/
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -33,7 +33,7 @@ export class CoreApp {
|
|
|
33
33
|
return this._region;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Device id, randome string from ServiceBase.InitCallAsync
|
|
37
37
|
*/
|
|
38
38
|
get deviceId() {
|
|
39
39
|
return this._deviceId;
|
|
@@ -1388,7 +1388,9 @@ export class CoreApp {
|
|
|
1388
1388
|
userLogin(user, refreshToken, keep) {
|
|
1389
1389
|
this.userData = user;
|
|
1390
1390
|
// Cache the encrypted serverside device id
|
|
1391
|
-
|
|
1391
|
+
if (user.deviceId) {
|
|
1392
|
+
this.storage.setData(this.fields.serversideDeviceId, user.deviceId);
|
|
1393
|
+
}
|
|
1392
1394
|
if (keep) {
|
|
1393
1395
|
this.authorize(user.token, user.tokenScheme, refreshToken);
|
|
1394
1396
|
}
|
package/lib/mjs/app/IApp.d.ts
CHANGED
|
@@ -41,19 +41,11 @@ export type FormatResultCustomCallback = ((data: FormatResultCustom) => string |
|
|
|
41
41
|
/**
|
|
42
42
|
* Refresh token props
|
|
43
43
|
*/
|
|
44
|
-
export interface RefreshTokenProps
|
|
44
|
+
export interface RefreshTokenProps {
|
|
45
45
|
/**
|
|
46
46
|
* Callback
|
|
47
47
|
*/
|
|
48
48
|
callback?: (result: RefreshTokenResult, successData?: string) => void;
|
|
49
|
-
/**
|
|
50
|
-
* Data to pass
|
|
51
|
-
*/
|
|
52
|
-
data?: D;
|
|
53
|
-
/**
|
|
54
|
-
* Support relogin or not
|
|
55
|
-
*/
|
|
56
|
-
relogin?: boolean;
|
|
57
49
|
/**
|
|
58
50
|
* Show loading bar or not
|
|
59
51
|
*/
|
|
@@ -478,7 +470,7 @@ export interface IApp {
|
|
|
478
470
|
* Refresh token
|
|
479
471
|
* @param props Props
|
|
480
472
|
*/
|
|
481
|
-
refreshToken
|
|
473
|
+
refreshToken(props?: RefreshTokenProps): Promise<boolean>;
|
|
482
474
|
/**
|
|
483
475
|
* Setup Api error handler
|
|
484
476
|
* @param api Api
|
package/lib/mjs/state/User.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { IState } from './State';
|
|
|
4
4
|
*/
|
|
5
5
|
export interface IUserData {
|
|
6
6
|
/**
|
|
7
|
-
* Serverside device id encrypted
|
|
7
|
+
* Serverside device id encrypted, not the same device id of the app
|
|
8
8
|
*/
|
|
9
|
-
readonly deviceId
|
|
9
|
+
readonly deviceId?: string;
|
|
10
10
|
/**
|
|
11
11
|
* User name
|
|
12
12
|
* 用户姓名
|
package/package.json
CHANGED
package/src/app/CoreApp.ts
CHANGED
|
@@ -155,7 +155,7 @@ export abstract class CoreApp<
|
|
|
155
155
|
|
|
156
156
|
private _deviceId: string;
|
|
157
157
|
/**
|
|
158
|
-
*
|
|
158
|
+
* Device id, randome string from ServiceBase.InitCallAsync
|
|
159
159
|
*/
|
|
160
160
|
get deviceId() {
|
|
161
161
|
return this._deviceId;
|
|
@@ -1813,7 +1813,7 @@ export abstract class CoreApp<
|
|
|
1813
1813
|
* Refresh token
|
|
1814
1814
|
* @param props Props
|
|
1815
1815
|
*/
|
|
1816
|
-
async refreshToken
|
|
1816
|
+
async refreshToken(props?: RefreshTokenProps) {
|
|
1817
1817
|
if (props && props.callback) props.callback(true, undefined);
|
|
1818
1818
|
return true;
|
|
1819
1819
|
}
|
|
@@ -1891,7 +1891,9 @@ export abstract class CoreApp<
|
|
|
1891
1891
|
this.userData = user;
|
|
1892
1892
|
|
|
1893
1893
|
// Cache the encrypted serverside device id
|
|
1894
|
-
|
|
1894
|
+
if (user.deviceId) {
|
|
1895
|
+
this.storage.setData(this.fields.serversideDeviceId, user.deviceId);
|
|
1896
|
+
}
|
|
1895
1897
|
|
|
1896
1898
|
if (keep) {
|
|
1897
1899
|
this.authorize(user.token, user.tokenScheme, refreshToken);
|
package/src/app/IApp.ts
CHANGED
|
@@ -68,22 +68,12 @@ export type FormatResultCustomCallback =
|
|
|
68
68
|
/**
|
|
69
69
|
* Refresh token props
|
|
70
70
|
*/
|
|
71
|
-
export interface RefreshTokenProps
|
|
71
|
+
export interface RefreshTokenProps {
|
|
72
72
|
/**
|
|
73
73
|
* Callback
|
|
74
74
|
*/
|
|
75
75
|
callback?: (result: RefreshTokenResult, successData?: string) => void;
|
|
76
76
|
|
|
77
|
-
/**
|
|
78
|
-
* Data to pass
|
|
79
|
-
*/
|
|
80
|
-
data?: D;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Support relogin or not
|
|
84
|
-
*/
|
|
85
|
-
relogin?: boolean;
|
|
86
|
-
|
|
87
77
|
/**
|
|
88
78
|
* Show loading bar or not
|
|
89
79
|
*/
|
|
@@ -650,9 +640,7 @@ export interface IApp {
|
|
|
650
640
|
* Refresh token
|
|
651
641
|
* @param props Props
|
|
652
642
|
*/
|
|
653
|
-
refreshToken
|
|
654
|
-
props?: RefreshTokenProps<D>
|
|
655
|
-
): Promise<boolean>;
|
|
643
|
+
refreshToken(props?: RefreshTokenProps): Promise<boolean>;
|
|
656
644
|
|
|
657
645
|
/**
|
|
658
646
|
* Setup Api error handler
|
package/src/state/User.ts
CHANGED
|
@@ -5,9 +5,9 @@ import { IState } from './State';
|
|
|
5
5
|
*/
|
|
6
6
|
export interface IUserData {
|
|
7
7
|
/**
|
|
8
|
-
* Serverside device id encrypted
|
|
8
|
+
* Serverside device id encrypted, not the same device id of the app
|
|
9
9
|
*/
|
|
10
|
-
readonly deviceId
|
|
10
|
+
readonly deviceId?: string;
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* User name
|