@das-fed/upf-utils 6.4.0-dev.158 → 6.4.0-dev.159

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.
Files changed (44) hide show
  1. package/api-services/index.js +926 -944
  2. package/api-services/index.js.gz +0 -0
  3. package/api-services/modules/app-manage/index.js +818 -836
  4. package/api-services/modules/app-manage/index.js.gz +0 -0
  5. package/api-services/modules/contract/index.js +806 -792
  6. package/api-services/modules/contract/index.js.gz +0 -0
  7. package/api-services/modules/enterpriseright/index.js +792 -806
  8. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  9. package/api-services/modules/gateway-edge/index.js +818 -836
  10. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  11. package/api-services/modules/index.js +721 -717
  12. package/api-services/modules/index.js.gz +0 -0
  13. package/api-services/modules/iot/index.js +1094 -1076
  14. package/api-services/modules/iot/index.js.gz +0 -0
  15. package/api-services/modules/justauth/index.js +837 -819
  16. package/api-services/modules/justauth/index.js.gz +0 -0
  17. package/api-services/modules/link/index.js +662 -658
  18. package/api-services/modules/link/index.js.gz +0 -0
  19. package/api-services/modules/permission/index.js +818 -836
  20. package/api-services/modules/permission/index.js.gz +0 -0
  21. package/api-services/modules/platformManage/index.js +656 -660
  22. package/api-services/modules/platformManage/index.js.gz +0 -0
  23. package/api-services/modules/portal/index.js +836 -818
  24. package/api-services/modules/portal/index.js.gz +0 -0
  25. package/api-services/modules/space-manage/index.js +818 -836
  26. package/api-services/modules/space-manage/index.js.gz +0 -0
  27. package/api-services/modules/supplychain-manage/index.js +818 -836
  28. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  29. package/api-services/modules/systemConfiguration/index.js +662 -658
  30. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  31. package/api-services/modules/tool/index.js +818 -836
  32. package/api-services/modules/tool/index.js.gz +0 -0
  33. package/api-services/src/create-service/index.js +789 -807
  34. package/api-services/src/create-service/index.js.gz +0 -0
  35. package/common-tools/handle-data/index.d.ts +7 -1
  36. package/common-tools/handle-data/index.js +61 -12
  37. package/common-tools/handle-data/index.js.gz +0 -0
  38. package/create-api-service/check-token/index.d.ts +2 -1
  39. package/create-api-service/check-token/index.js +2 -3
  40. package/create-api-service/check-token/index.js.gz +0 -0
  41. package/create-api-service/index.js +807 -789
  42. package/create-api-service/index.js.gz +0 -0
  43. package/esm-map.json +5 -2
  44. package/package.json +4 -4
@@ -4,8 +4,14 @@
4
4
  * @returns
5
5
  */
6
6
  export declare const isEmpty: (value: any) => boolean;
7
+ export declare const getSysLangArr: (langArr: string[]) => any;
8
+ export declare const getCurrentSysLang: {};
7
9
  /**
8
10
  * 处理多语言在打包时的数据
9
11
  * @param opt
10
- */
12
+ */
11
13
  export declare const handleI18nData: (opt: any) => unknown;
14
+ /**
15
+ * 处理不同语言包中公共的全局变量
16
+ */
17
+ export declare const handleGlobalI18n: (pathname?: string) => unknown;
@@ -1,16 +1,65 @@
1
- const i = (n) => n === null || typeof n > "u" || n === "", o = async (n) => {
2
- let { pathname: a = "back-end", langArr: l = ["zh-CN", "en"], urlPrefix: f = "" } = n || {}, t = {};
3
- for (let e of l)
4
- if (!t[e]) {
5
- const r = await import(
6
- /* @vite-ignore */
7
- `${f}/i18n/${a}/${e}.js`
8
- );
9
- t[e] = (r == null ? void 0 : r.default) || {};
1
+ const y = (e) => e === null || typeof e > "u" || e === "", c = [
2
+ "zh-CN",
3
+ "zh-TW",
4
+ "zh-HK",
5
+ "en",
6
+ "ja",
7
+ "ko",
8
+ "fr",
9
+ "de",
10
+ "es",
11
+ "it",
12
+ "pt",
13
+ "ru",
14
+ "ar",
15
+ "hi",
16
+ "nl",
17
+ "tr",
18
+ "vi",
19
+ "sv",
20
+ "pl",
21
+ "th"
22
+ ], u = (e) => c.filter((t) => e.includes(t)), f = ["zh-CN", "en", "ar"];
23
+ async function h(e) {
24
+ try {
25
+ const t = await fetch(e, { method: "HEAD" });
26
+ if (t != null && t.ok) {
27
+ const n = t.headers.get("content-type");
28
+ return !!(n && n.includes("text/javascript"));
10
29
  }
11
- return t;
30
+ return !1;
31
+ } catch {
32
+ return !1;
33
+ }
34
+ }
35
+ const p = async (e) => {
36
+ try {
37
+ let { pathname: t = "front-end", urlPrefix: n = "", langArr: r = ["zh-CN", "en"] } = e || {}, s = {}, i = u(f);
38
+ for (let a of i)
39
+ if (!s[a]) {
40
+ let o = `${n}i18n/${t}/${a}.js`;
41
+ if (!await h(o))
42
+ continue;
43
+ const l = await import(
44
+ /* @vite-ignore */
45
+ `${n}i18n/${t}/${a}.js`
46
+ );
47
+ s[a] = (l == null ? void 0 : l.default) || null;
48
+ }
49
+ return s;
50
+ } catch {
51
+ }
52
+ }, g = async (e = "front-end") => {
53
+ let t = {}, r = await import(
54
+ /* @vite-ignore */
55
+ `/i18n/${e}/global.js`
56
+ );
57
+ return t = (r == null ? void 0 : r.default) || {}, t;
12
58
  };
13
59
  export {
14
- o as handleI18nData,
15
- i as isEmpty
60
+ f as getCurrentSysLang,
61
+ u as getSysLangArr,
62
+ g as handleGlobalI18n,
63
+ p as handleI18nData,
64
+ y as isEmpty
16
65
  };
@@ -13,4 +13,5 @@ export interface RefreshDataType {
13
13
  * @param retryCount 内部重试计数器(外部调用无需传递)
14
14
  * @returns 有效的 access_token
15
15
  */
16
- export declare function getValidAccessToken(tokenData: RefreshDataType, updateTokenCallback: (newToken: RefreshDataType) => void, retryCount?: number): Promise<string>;
16
+ declare const getValidAccessToken: (tokenData: RefreshDataType, updateTokenCallback: (newToken: RefreshDataType) => void, retryCount?: number) => Promise<string>;
17
+ export { getValidAccessToken };
@@ -1696,8 +1696,7 @@ const {
1696
1696
  mergeConfig: rr
1697
1697
  } = E, { baseURL: Dn } = st();
1698
1698
  let W = !1, q = [];
1699
- const Ne = 1 * 60 * 1e3, Pe = 1, _e = 1e3;
1700
- async function jn(e, t, n = 0) {
1699
+ const Ne = 1 * 60 * 1e3, Pe = 1, _e = 1e3, jn = async (e, t, n = 0) => {
1701
1700
  const r = Date.now();
1702
1701
  if (r < +e.accessExp - Ne)
1703
1702
  return e.accessToken;
@@ -1725,7 +1724,7 @@ async function jn(e, t, n = 0) {
1725
1724
  }
1726
1725
  return Fe(), Promise.reject("Token refresh failed after retries");
1727
1726
  }
1728
- }
1727
+ };
1729
1728
  async function rt(e, t, n, r = 0) {
1730
1729
  try {
1731
1730
  let s = await E.create().post(