@etsoo/appscript 1.5.60 → 1.5.62

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.
@@ -635,8 +635,9 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
635
635
  protected setupTasks(): void;
636
636
  /**
637
637
  * Signout, with userLogout and toLoginPage
638
+ * @param action Callback
638
639
  */
639
- signout(): Promise<void>;
640
+ signout(action?: () => void | boolean): Promise<void>;
640
641
  /**
641
642
  * Go to the login page
642
643
  * @param data Login parameters
@@ -1632,8 +1632,9 @@ class CoreApp {
1632
1632
  }
1633
1633
  /**
1634
1634
  * Signout, with userLogout and toLoginPage
1635
+ * @param action Callback
1635
1636
  */
1636
- async signout() {
1637
+ async signout(action) {
1637
1638
  // Clear the keep login status
1638
1639
  this.keepLogin = false;
1639
1640
  // Reset all APIs
@@ -1656,8 +1657,10 @@ class CoreApp {
1656
1657
  }
1657
1658
  // Clear, noTrigger = true, avoid state update
1658
1659
  this.userLogout(true, true);
1659
- // Go to login page
1660
- this.toLoginPage({ params: { tryLogin: false }, removeUrl: true });
1660
+ if (action == null || action() !== false) {
1661
+ // Go to login page
1662
+ this.toLoginPage({ params: { tryLogin: false }, removeUrl: true });
1663
+ }
1661
1664
  }
1662
1665
  /**
1663
1666
  * Go to the login page
@@ -571,8 +571,9 @@ export interface IApp {
571
571
  setupLogging(action?: (data: ErrorData) => void | Promise<void>, preventDefault?: ((type: ErrorType) => boolean) | boolean): void;
572
572
  /**
573
573
  * Signout, with userLogout and toLoginPage
574
+ * @param action Callback
574
575
  */
575
- signout(): Promise<void>;
576
+ signout(action?: () => void | boolean): Promise<void>;
576
577
  /**
577
578
  * Persist settings to source when application exit
578
579
  */
@@ -12,6 +12,26 @@ export interface IUserData {
12
12
  * 用户姓名
13
13
  */
14
14
  readonly name: string;
15
+ /**
16
+ * Given name
17
+ * 名
18
+ */
19
+ readonly givenName?: string;
20
+ /**
21
+ * Family name
22
+ * 姓
23
+ */
24
+ readonly familyName?: string;
25
+ /**
26
+ * Latin given name
27
+ * 拉丁名(拼音)
28
+ */
29
+ readonly latinGivenName?: string;
30
+ /**
31
+ * Latin family name
32
+ * 拉丁姓(拼音)
33
+ */
34
+ readonly latinFamilyName?: string;
15
35
  /**
16
36
  * User avatar
17
37
  * 用户头像
@@ -635,8 +635,9 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
635
635
  protected setupTasks(): void;
636
636
  /**
637
637
  * Signout, with userLogout and toLoginPage
638
+ * @param action Callback
638
639
  */
639
- signout(): Promise<void>;
640
+ signout(action?: () => void | boolean): Promise<void>;
640
641
  /**
641
642
  * Go to the login page
642
643
  * @param data Login parameters
@@ -1629,8 +1629,9 @@ export class CoreApp {
1629
1629
  }
1630
1630
  /**
1631
1631
  * Signout, with userLogout and toLoginPage
1632
+ * @param action Callback
1632
1633
  */
1633
- async signout() {
1634
+ async signout(action) {
1634
1635
  // Clear the keep login status
1635
1636
  this.keepLogin = false;
1636
1637
  // Reset all APIs
@@ -1653,8 +1654,10 @@ export class CoreApp {
1653
1654
  }
1654
1655
  // Clear, noTrigger = true, avoid state update
1655
1656
  this.userLogout(true, true);
1656
- // Go to login page
1657
- this.toLoginPage({ params: { tryLogin: false }, removeUrl: true });
1657
+ if (action == null || action() !== false) {
1658
+ // Go to login page
1659
+ this.toLoginPage({ params: { tryLogin: false }, removeUrl: true });
1660
+ }
1658
1661
  }
1659
1662
  /**
1660
1663
  * Go to the login page
@@ -571,8 +571,9 @@ export interface IApp {
571
571
  setupLogging(action?: (data: ErrorData) => void | Promise<void>, preventDefault?: ((type: ErrorType) => boolean) | boolean): void;
572
572
  /**
573
573
  * Signout, with userLogout and toLoginPage
574
+ * @param action Callback
574
575
  */
575
- signout(): Promise<void>;
576
+ signout(action?: () => void | boolean): Promise<void>;
576
577
  /**
577
578
  * Persist settings to source when application exit
578
579
  */
@@ -12,6 +12,26 @@ export interface IUserData {
12
12
  * 用户姓名
13
13
  */
14
14
  readonly name: string;
15
+ /**
16
+ * Given name
17
+ * 名
18
+ */
19
+ readonly givenName?: string;
20
+ /**
21
+ * Family name
22
+ * 姓
23
+ */
24
+ readonly familyName?: string;
25
+ /**
26
+ * Latin given name
27
+ * 拉丁名(拼音)
28
+ */
29
+ readonly latinGivenName?: string;
30
+ /**
31
+ * Latin family name
32
+ * 拉丁姓(拼音)
33
+ */
34
+ readonly latinFamilyName?: string;
15
35
  /**
16
36
  * User avatar
17
37
  * 用户头像
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.5.60",
3
+ "version": "1.5.62",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -58,13 +58,13 @@
58
58
  "crypto-js": "^4.2.0"
59
59
  },
60
60
  "devDependencies": {
61
- "@babel/cli": "^7.25.7",
62
- "@babel/core": "^7.25.8",
63
- "@babel/plugin-transform-runtime": "^7.25.7",
64
- "@babel/preset-env": "^7.25.8",
65
- "@babel/runtime-corejs3": "^7.25.7",
61
+ "@babel/cli": "^7.25.9",
62
+ "@babel/core": "^7.25.9",
63
+ "@babel/plugin-transform-runtime": "^7.25.9",
64
+ "@babel/preset-env": "^7.25.9",
65
+ "@babel/runtime-corejs3": "^7.25.9",
66
66
  "@types/crypto-js": "^4.2.2",
67
- "@types/jest": "^29.5.13",
67
+ "@types/jest": "^29.5.14",
68
68
  "jest": "^29.7.0",
69
69
  "jest-environment-jsdom": "^29.7.0",
70
70
  "ts-jest": "^29.2.5",
@@ -2218,8 +2218,9 @@ export abstract class CoreApp<
2218
2218
 
2219
2219
  /**
2220
2220
  * Signout, with userLogout and toLoginPage
2221
+ * @param action Callback
2221
2222
  */
2222
- async signout() {
2223
+ async signout(action?: () => void | boolean) {
2223
2224
  // Clear the keep login status
2224
2225
  this.keepLogin = false;
2225
2226
 
@@ -2253,8 +2254,10 @@ export abstract class CoreApp<
2253
2254
  // Clear, noTrigger = true, avoid state update
2254
2255
  this.userLogout(true, true);
2255
2256
 
2256
- // Go to login page
2257
- this.toLoginPage({ params: { tryLogin: false }, removeUrl: true });
2257
+ if (action == null || action() !== false) {
2258
+ // Go to login page
2259
+ this.toLoginPage({ params: { tryLogin: false }, removeUrl: true });
2260
+ }
2258
2261
  }
2259
2262
 
2260
2263
  /**
package/src/app/IApp.ts CHANGED
@@ -770,8 +770,9 @@ export interface IApp {
770
770
 
771
771
  /**
772
772
  * Signout, with userLogout and toLoginPage
773
+ * @param action Callback
773
774
  */
774
- signout(): Promise<void>;
775
+ signout(action?: () => void | boolean): Promise<void>;
775
776
 
776
777
  /**
777
778
  * Persist settings to source when application exit
package/src/state/User.ts CHANGED
@@ -15,6 +15,30 @@ export interface IUserData {
15
15
  */
16
16
  readonly name: string;
17
17
 
18
+ /**
19
+ * Given name
20
+ * 名
21
+ */
22
+ readonly givenName?: string;
23
+
24
+ /**
25
+ * Family name
26
+ * 姓
27
+ */
28
+ readonly familyName?: string;
29
+
30
+ /**
31
+ * Latin given name
32
+ * 拉丁名(拼音)
33
+ */
34
+ readonly latinGivenName?: string;
35
+
36
+ /**
37
+ * Latin family name
38
+ * 拉丁姓(拼音)
39
+ */
40
+ readonly latinFamilyName?: string;
41
+
18
42
  /**
19
43
  * User avatar
20
44
  * 用户头像