@etsoo/appscript 1.5.66 → 1.5.68

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.
@@ -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,
@@ -1,18 +1,18 @@
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';
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
  /**