@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
|
@@ -7,10 +7,10 @@ export var ExternalSettings;
|
|
|
7
7
|
* Create instance
|
|
8
8
|
*/
|
|
9
9
|
function create() {
|
|
10
|
-
if (
|
|
11
|
-
const settings = Reflect.get(globalThis,
|
|
12
|
-
if (typeof settings ===
|
|
13
|
-
if (typeof window !==
|
|
10
|
+
if ("settings" in globalThis) {
|
|
11
|
+
const settings = Reflect.get(globalThis, "settings");
|
|
12
|
+
if (typeof settings === "object") {
|
|
13
|
+
if (typeof window !== "undefined") {
|
|
14
14
|
// Host name
|
|
15
15
|
const hostname = globalThis.location.hostname;
|
|
16
16
|
// replace {hostname}
|
|
@@ -25,14 +25,14 @@ export var ExternalSettings;
|
|
|
25
25
|
function format(settings, hostname) {
|
|
26
26
|
// Default hostname
|
|
27
27
|
if (!hostname)
|
|
28
|
-
hostname =
|
|
28
|
+
hostname = "localhost";
|
|
29
29
|
// replace {hostname}
|
|
30
30
|
for (const key in settings) {
|
|
31
31
|
const value = settings[key];
|
|
32
|
-
if (typeof value ===
|
|
33
|
-
settings[key] = value.replace(
|
|
32
|
+
if (typeof value === "string") {
|
|
33
|
+
settings[key] = value.replace("{hostname}", hostname);
|
|
34
34
|
}
|
|
35
|
-
else if (typeof value ===
|
|
35
|
+
else if (typeof value === "object") {
|
|
36
36
|
format(value, hostname);
|
|
37
37
|
}
|
|
38
38
|
}
|
package/lib/mjs/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/mjs/app/IApp.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* App fields
|
|
3
3
|
*/
|
|
4
4
|
export const appFields = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
"headerToken",
|
|
6
|
+
"serversideDeviceId",
|
|
7
|
+
"deviceId",
|
|
8
|
+
"devices",
|
|
9
|
+
"devicePassphrase",
|
|
10
|
+
"cachedUrl",
|
|
11
|
+
"embedded",
|
|
12
|
+
"keepLogin"
|
|
13
13
|
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlutterHost } from
|
|
1
|
+
import { FlutterHost } from "./FlutterHost";
|
|
2
2
|
/**
|
|
3
3
|
* Bridge utils
|
|
4
4
|
*/
|
|
@@ -8,9 +8,9 @@ export var BridgeUtils;
|
|
|
8
8
|
/**
|
|
9
9
|
* Bridge host
|
|
10
10
|
*/
|
|
11
|
-
BridgeUtils.host = typeof g.flutter_inappwebview ===
|
|
11
|
+
BridgeUtils.host = typeof g.flutter_inappwebview === "object"
|
|
12
12
|
? new FlutterHost(g.flutter_inappwebview)
|
|
13
|
-
: typeof g.electron ===
|
|
13
|
+
: typeof g.electron === "object"
|
|
14
14
|
? g.electron
|
|
15
15
|
: undefined;
|
|
16
16
|
})(BridgeUtils || (BridgeUtils = {}));
|
package/lib/mjs/i18n/en.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.69",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
},
|
|
56
56
|
"homepage": "https://github.com/ETSOO/AppScript#readme",
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@etsoo/notificationbase": "^1.1.
|
|
59
|
-
"@etsoo/restclient": "^1.1.
|
|
60
|
-
"@etsoo/shared": "^1.2.
|
|
58
|
+
"@etsoo/notificationbase": "^1.1.54",
|
|
59
|
+
"@etsoo/restclient": "^1.1.16",
|
|
60
|
+
"@etsoo/shared": "^1.2.55",
|
|
61
61
|
"crypto-js": "^4.2.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|