@etsoo/appscript 1.5.67 → 1.5.69
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/__tests__/app/CoreApp.ts +12 -0
- package/lib/cjs/app/CoreApp.d.ts +15 -15
- package/lib/cjs/app/CoreApp.js +97 -109
- package/lib/cjs/app/ExternalSettings.d.ts +1 -1
- package/lib/cjs/app/ExternalSettings.js +8 -8
- package/lib/cjs/app/IApp.d.ts +12 -12
- package/lib/cjs/app/IApp.js +8 -8
- package/lib/cjs/bridges/BridgeUtils.d.ts +2 -2
- package/lib/cjs/bridges/BridgeUtils.js +2 -2
- package/lib/cjs/i18n/en.json +1 -0
- package/lib/cjs/i18n/zh-Hans.json +1 -0
- package/lib/cjs/i18n/zh-Hant.json +1 -0
- package/lib/mjs/app/CoreApp.d.ts +15 -15
- package/lib/mjs/app/CoreApp.js +108 -120
- package/lib/mjs/app/ExternalSettings.d.ts +1 -1
- package/lib/mjs/app/ExternalSettings.js +8 -8
- package/lib/mjs/app/IApp.d.ts +12 -12
- package/lib/mjs/app/IApp.js +8 -8
- package/lib/mjs/bridges/BridgeUtils.d.ts +2 -2
- package/lib/mjs/bridges/BridgeUtils.js +3 -3
- package/lib/mjs/i18n/en.json +1 -0
- package/lib/mjs/i18n/zh-Hans.json +1 -0
- package/lib/mjs/i18n/zh-Hant.json +1 -0
- package/package.json +4 -4
- package/src/app/CoreApp.ts +2246 -2303
- package/src/app/ExternalSettings.ts +61 -61
- package/src/app/IApp.ts +760 -766
- package/src/bridges/BridgeUtils.ts +12 -12
- package/src/i18n/en.json +1 -0
- package/src/i18n/zh-Hans.json +1 -0
- package/src/i18n/zh-Hant.json +1 -0
package/__tests__/app/CoreApp.ts
CHANGED
|
@@ -127,6 +127,18 @@ test("Tests for formatResult", () => {
|
|
|
127
127
|
);
|
|
128
128
|
});
|
|
129
129
|
|
|
130
|
+
test("Tests for formatResult with type", () => {
|
|
131
|
+
const result: IActionResult = {
|
|
132
|
+
ok: false,
|
|
133
|
+
type: "TokenExpired",
|
|
134
|
+
title: "您的令牌已过期",
|
|
135
|
+
data: {}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const formatted = app.formatResult(result);
|
|
139
|
+
expect(formatted).toBe("您的令牌已过期 (TokenExpired)");
|
|
140
|
+
});
|
|
141
|
+
|
|
130
142
|
test("Tests for formatResult with custom label", () => {
|
|
131
143
|
const result: IActionResult = {
|
|
132
144
|
ok: false,
|
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { INotifier, NotificationAlign, NotificationCallProps, NotificationContent, NotificationReturn } from
|
|
2
|
-
import { ApiDataError, IApi, IPData } from
|
|
3
|
-
import { DataTypes, DateUtils, ErrorData, ErrorType, IActionResult, IStorage, ListType, ListType1 } from
|
|
4
|
-
import { AddressRegion } from
|
|
5
|
-
import { EntityStatus } from
|
|
6
|
-
import { InitCallDto } from
|
|
7
|
-
import { InitCallResult, InitCallResultData } from
|
|
8
|
-
import { IUser } from
|
|
9
|
-
import { IAppSettings } from
|
|
10
|
-
import { AppLoginParams, AppTryLoginParams, FormatResultCustomCallback, IApp, IAppFields, IDetectIPCallback, NavigateOptions, RefreshTokenProps } from
|
|
11
|
-
import { UserRole } from
|
|
12
|
-
import { ExternalEndpoint } from
|
|
13
|
-
import { ApiRefreshTokenDto } from
|
|
14
|
-
import { ApiRefreshTokenRQ } from
|
|
15
|
-
import { AuthApi } from
|
|
1
|
+
import { INotifier, NotificationAlign, NotificationCallProps, NotificationContent, NotificationReturn } from "@etsoo/notificationbase";
|
|
2
|
+
import { ApiDataError, IApi, IPData } from "@etsoo/restclient";
|
|
3
|
+
import { DataTypes, DateUtils, ErrorData, ErrorType, IActionResult, IStorage, ListType, ListType1 } from "@etsoo/shared";
|
|
4
|
+
import { AddressRegion } from "../address/AddressRegion";
|
|
5
|
+
import { EntityStatus } from "../business/EntityStatus";
|
|
6
|
+
import { InitCallDto } from "../api/dto/InitCallDto";
|
|
7
|
+
import { InitCallResult, InitCallResultData } from "../result/InitCallResult";
|
|
8
|
+
import { IUser } from "../state/User";
|
|
9
|
+
import { IAppSettings } from "./AppSettings";
|
|
10
|
+
import { AppLoginParams, AppTryLoginParams, FormatResultCustomCallback, IApp, IAppFields, IDetectIPCallback, NavigateOptions, RefreshTokenProps } from "./IApp";
|
|
11
|
+
import { UserRole } from "./UserRole";
|
|
12
|
+
import { ExternalEndpoint } from "./ExternalSettings";
|
|
13
|
+
import { ApiRefreshTokenDto } from "../api/dto/ApiRefreshTokenDto";
|
|
14
|
+
import { ApiRefreshTokenRQ } from "../api/rq/ApiRefreshTokenRQ";
|
|
15
|
+
import { AuthApi } from "../api/AuthApi";
|
|
16
16
|
type ApiRefreshTokenFunction = (api: IApi, rq: ApiRefreshTokenRQ) => Promise<[string, number] | undefined>;
|
|
17
17
|
type ApiTaskData = [IApi, number, number, ApiRefreshTokenFunction, string?];
|
|
18
18
|
/**
|