@etsoo/appscript 1.5.67 → 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.
- 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/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/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
|
@@ -10,10 +10,10 @@ var ExternalSettings;
|
|
|
10
10
|
* Create instance
|
|
11
11
|
*/
|
|
12
12
|
function create() {
|
|
13
|
-
if (
|
|
14
|
-
const settings = Reflect.get(globalThis,
|
|
15
|
-
if (typeof settings ===
|
|
16
|
-
if (typeof window !==
|
|
13
|
+
if ("settings" in globalThis) {
|
|
14
|
+
const settings = Reflect.get(globalThis, "settings");
|
|
15
|
+
if (typeof settings === "object") {
|
|
16
|
+
if (typeof window !== "undefined") {
|
|
17
17
|
// Host name
|
|
18
18
|
const hostname = globalThis.location.hostname;
|
|
19
19
|
// replace {hostname}
|
|
@@ -28,14 +28,14 @@ var ExternalSettings;
|
|
|
28
28
|
function format(settings, hostname) {
|
|
29
29
|
// Default hostname
|
|
30
30
|
if (!hostname)
|
|
31
|
-
hostname =
|
|
31
|
+
hostname = "localhost";
|
|
32
32
|
// replace {hostname}
|
|
33
33
|
for (const key in settings) {
|
|
34
34
|
const value = settings[key];
|
|
35
|
-
if (typeof value ===
|
|
36
|
-
settings[key] = value.replace(
|
|
35
|
+
if (typeof value === "string") {
|
|
36
|
+
settings[key] = value.replace("{hostname}", hostname);
|
|
37
37
|
}
|
|
38
|
-
else if (typeof value ===
|
|
38
|
+
else if (typeof value === "object") {
|
|
39
39
|
format(value, hostname);
|
|
40
40
|
}
|
|
41
41
|
}
|
package/lib/cjs/app/IApp.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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 { IUser } from
|
|
6
|
-
import { IAppSettings } from
|
|
7
|
-
import { UserRole } from
|
|
8
|
-
import { EntityStatus } from
|
|
9
|
-
import { Currency } from
|
|
10
|
-
import { ExternalEndpoint } from
|
|
11
|
-
import { ApiRefreshTokenDto } from
|
|
12
|
-
import { ApiRefreshTokenRQ } 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 { IUser } from "../state/User";
|
|
6
|
+
import { IAppSettings } from "./AppSettings";
|
|
7
|
+
import { UserRole } from "./UserRole";
|
|
8
|
+
import { EntityStatus } from "../business/EntityStatus";
|
|
9
|
+
import { Currency } from "../business/Currency";
|
|
10
|
+
import { ExternalEndpoint } from "./ExternalSettings";
|
|
11
|
+
import { ApiRefreshTokenDto } from "../api/dto/ApiRefreshTokenDto";
|
|
12
|
+
import { ApiRefreshTokenRQ } from "../api/rq/ApiRefreshTokenRQ";
|
|
13
13
|
/**
|
|
14
14
|
* Detect IP callback interface
|
|
15
15
|
*/
|
package/lib/cjs/app/IApp.js
CHANGED
|
@@ -5,12 +5,12 @@ exports.appFields = void 0;
|
|
|
5
5
|
* App fields
|
|
6
6
|
*/
|
|
7
7
|
exports.appFields = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
"headerToken",
|
|
9
|
+
"serversideDeviceId",
|
|
10
|
+
"deviceId",
|
|
11
|
+
"devices",
|
|
12
|
+
"devicePassphrase",
|
|
13
|
+
"cachedUrl",
|
|
14
|
+
"embedded",
|
|
15
|
+
"keepLogin"
|
|
16
16
|
];
|
|
@@ -11,9 +11,9 @@ var BridgeUtils;
|
|
|
11
11
|
/**
|
|
12
12
|
* Bridge host
|
|
13
13
|
*/
|
|
14
|
-
BridgeUtils.host = typeof g.flutter_inappwebview ===
|
|
14
|
+
BridgeUtils.host = typeof g.flutter_inappwebview === "object"
|
|
15
15
|
? new FlutterHost_1.FlutterHost(g.flutter_inappwebview)
|
|
16
|
-
: typeof g.electron ===
|
|
16
|
+
: typeof g.electron === "object"
|
|
17
17
|
? g.electron
|
|
18
18
|
: undefined;
|
|
19
19
|
})(BridgeUtils || (exports.BridgeUtils = BridgeUtils = {}));
|
package/lib/mjs/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
|
/**
|