@etsoo/appscript 1.5.16 → 1.5.18

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.
@@ -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
- * Country or region, like CN
86
+ * Device id, randome string from ServiceBase.InitCallAsync
87
87
  */
88
88
  get deviceId(): string;
89
89
  /**
@@ -36,7 +36,7 @@ class CoreApp {
36
36
  return this._region;
37
37
  }
38
38
  /**
39
- * Country or region, like CN
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
- this.storage.setData(this.fields.serversideDeviceId, user.deviceId);
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
  }
@@ -6,16 +6,4 @@ export type RefreshTokenRQ = {
6
6
  * Device id
7
7
  */
8
8
  deviceId: string;
9
- /**
10
- * Country or region
11
- */
12
- region: string;
13
- /**
14
- * Login password
15
- */
16
- pwd?: string;
17
- /**
18
- * Time zone
19
- */
20
- timezone?: string;
21
9
  };
@@ -4,6 +4,7 @@
4
4
  "add": "Add",
5
5
  "assignedId": "Assigned ID",
6
6
  "audits": "Audits",
7
+ "authFailed": "Authentication failed",
7
8
  "author": "Author",
8
9
  "authorizer": "Authorizer",
9
10
  "applicant": "Applicant",
@@ -4,6 +4,7 @@
4
4
  "add": "添加",
5
5
  "assignedId": "分配的编号",
6
6
  "audits": "操作历史",
7
+ "authFailed": "认证失败",
7
8
  "author": "作者",
8
9
  "authorizer": "授权人",
9
10
  "applicant": "申请人",
@@ -4,6 +4,7 @@
4
4
  "add": "添加",
5
5
  "assignedId": "分配的編號",
6
6
  "audits": "操作歷史",
7
+ "authFailed": "認證失敗",
7
8
  "author": "作者",
8
9
  "authorizer": "授權人",
9
10
  "applicant": "申請人",
@@ -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: string;
9
+ readonly deviceId?: string;
10
10
  /**
11
11
  * User name
12
12
  * 用户姓名
@@ -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
- * Country or region, like CN
86
+ * Device id, randome string from ServiceBase.InitCallAsync
87
87
  */
88
88
  get deviceId(): string;
89
89
  /**
@@ -33,7 +33,7 @@ export class CoreApp {
33
33
  return this._region;
34
34
  }
35
35
  /**
36
- * Country or region, like CN
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
- this.storage.setData(this.fields.serversideDeviceId, user.deviceId);
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
  }
@@ -6,16 +6,4 @@ export type RefreshTokenRQ = {
6
6
  * Device id
7
7
  */
8
8
  deviceId: string;
9
- /**
10
- * Country or region
11
- */
12
- region: string;
13
- /**
14
- * Login password
15
- */
16
- pwd?: string;
17
- /**
18
- * Time zone
19
- */
20
- timezone?: string;
21
9
  };
@@ -4,6 +4,7 @@
4
4
  "add": "Add",
5
5
  "assignedId": "Assigned ID",
6
6
  "audits": "Audits",
7
+ "authFailed": "Authentication failed",
7
8
  "author": "Author",
8
9
  "authorizer": "Authorizer",
9
10
  "applicant": "Applicant",
@@ -4,6 +4,7 @@
4
4
  "add": "添加",
5
5
  "assignedId": "分配的编号",
6
6
  "audits": "操作历史",
7
+ "authFailed": "认证失败",
7
8
  "author": "作者",
8
9
  "authorizer": "授权人",
9
10
  "applicant": "申请人",
@@ -4,6 +4,7 @@
4
4
  "add": "添加",
5
5
  "assignedId": "分配的編號",
6
6
  "audits": "操作歷史",
7
+ "authFailed": "認證失敗",
7
8
  "author": "作者",
8
9
  "authorizer": "授權人",
9
10
  "applicant": "申請人",
@@ -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: string;
9
+ readonly deviceId?: string;
10
10
  /**
11
11
  * User name
12
12
  * 用户姓名
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.5.16",
3
+ "version": "1.5.18",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -155,7 +155,7 @@ export abstract class CoreApp<
155
155
 
156
156
  private _deviceId: string;
157
157
  /**
158
- * Country or region, like CN
158
+ * Device id, randome string from ServiceBase.InitCallAsync
159
159
  */
160
160
  get deviceId() {
161
161
  return this._deviceId;
@@ -1891,7 +1891,9 @@ export abstract class CoreApp<
1891
1891
  this.userData = user;
1892
1892
 
1893
1893
  // Cache the encrypted serverside device id
1894
- this.storage.setData(this.fields.serversideDeviceId, user.deviceId);
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);
@@ -6,19 +6,4 @@ export type RefreshTokenRQ = {
6
6
  * Device id
7
7
  */
8
8
  deviceId: string;
9
-
10
- /**
11
- * Country or region
12
- */
13
- region: string;
14
-
15
- /**
16
- * Login password
17
- */
18
- pwd?: string;
19
-
20
- /**
21
- * Time zone
22
- */
23
- timezone?: string;
24
9
  };
package/src/i18n/en.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "add": "Add",
5
5
  "assignedId": "Assigned ID",
6
6
  "audits": "Audits",
7
+ "authFailed": "Authentication failed",
7
8
  "author": "Author",
8
9
  "authorizer": "Authorizer",
9
10
  "applicant": "Applicant",
@@ -4,6 +4,7 @@
4
4
  "add": "添加",
5
5
  "assignedId": "分配的编号",
6
6
  "audits": "操作历史",
7
+ "authFailed": "认证失败",
7
8
  "author": "作者",
8
9
  "authorizer": "授权人",
9
10
  "applicant": "申请人",
@@ -4,6 +4,7 @@
4
4
  "add": "添加",
5
5
  "assignedId": "分配的編號",
6
6
  "audits": "操作歷史",
7
+ "authFailed": "認證失敗",
7
8
  "author": "作者",
8
9
  "authorizer": "授權人",
9
10
  "applicant": "申請人",
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: string;
10
+ readonly deviceId?: string;
11
11
 
12
12
  /**
13
13
  * User name