@das-fed/upf-utils 6.4.0-dev.290 → 6.4.0-dev.292

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 (68) hide show
  1. package/api-services/es5.js +1016 -1014
  2. package/api-services/index.js +775 -771
  3. package/api-services/index.js.gz +0 -0
  4. package/api-services/modules/app-manage/es5.js +1110 -1122
  5. package/api-services/modules/app-manage/index.js +918 -936
  6. package/api-services/modules/app-manage/index.js.gz +0 -0
  7. package/api-services/modules/authentication/es5.js +1122 -1132
  8. package/api-services/modules/authentication/index.js +930 -944
  9. package/api-services/modules/authentication/index.js.gz +0 -0
  10. package/api-services/modules/bems/es5.js +1153 -1141
  11. package/api-services/modules/bems/index.js +964 -946
  12. package/api-services/modules/bems/index.js.gz +0 -0
  13. package/api-services/modules/duty-manage/es5.js +1120 -1108
  14. package/api-services/modules/duty-manage/index.js +935 -917
  15. package/api-services/modules/duty-manage/index.js.gz +0 -0
  16. package/api-services/modules/enterpriseright/es5.js +857 -860
  17. package/api-services/modules/enterpriseright/index.js +670 -674
  18. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  19. package/api-services/modules/file/es5.js +1266 -1275
  20. package/api-services/modules/file/index.js +1026 -1040
  21. package/api-services/modules/file/index.js.gz +0 -0
  22. package/api-services/modules/gateway-edge/es5.js +1134 -1122
  23. package/api-services/modules/gateway-edge/index.js +948 -930
  24. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  25. package/api-services/modules/iot/es5.js +1241 -1229
  26. package/api-services/modules/iot/index.js +1039 -1021
  27. package/api-services/modules/iot/index.js.gz +0 -0
  28. package/api-services/modules/knowledge/es5.js +1134 -1122
  29. package/api-services/modules/knowledge/index.js +948 -930
  30. package/api-services/modules/knowledge/index.js.gz +0 -0
  31. package/api-services/modules/link/es5.js +860 -857
  32. package/api-services/modules/link/index.js +674 -670
  33. package/api-services/modules/link/index.js.gz +0 -0
  34. package/api-services/modules/platformManage/es5.js +1238 -1226
  35. package/api-services/modules/platformManage/index.js +1032 -1014
  36. package/api-services/modules/platformManage/index.js.gz +0 -0
  37. package/api-services/modules/super-admin/es5.js +1128 -1137
  38. package/api-services/modules/super-admin/index.js +935 -949
  39. package/api-services/modules/super-admin/index.js.gz +0 -0
  40. package/api-services/modules/supplier/es5.js +1114 -1126
  41. package/api-services/modules/supplier/index.js +920 -938
  42. package/api-services/modules/supplier/index.js.gz +0 -0
  43. package/api-services/modules/supplychain-manage/es5.js +1134 -1122
  44. package/api-services/modules/supplychain-manage/index.js +948 -930
  45. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  46. package/api-services/modules/systemConfiguration/es5.js +1122 -1134
  47. package/api-services/modules/systemConfiguration/index.js +930 -948
  48. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  49. package/api-services/src/create-service/es5.js +1120 -1132
  50. package/api-services/src/create-service/index.js +929 -947
  51. package/api-services/src/create-service/index.js.gz +0 -0
  52. package/browser-importmap.json +40 -0
  53. package/browser.d.ts +16 -0
  54. package/browser.js +267 -0
  55. package/browser.js.gz +0 -0
  56. package/common-info/es5.js +1293 -1281
  57. package/common-info/getPermissionMethod/es5.js +1388 -1376
  58. package/common-info/getPermissionMethod/index.js +1155 -1137
  59. package/common-info/getPermissionMethod/index.js.gz +0 -0
  60. package/common-info/index.js +1073 -1055
  61. package/common-info/index.js.gz +0 -0
  62. package/package.json +7 -7
  63. package/realtime-connection/es5.d.ts +12 -1
  64. package/realtime-connection/es5.js +205 -129
  65. package/realtime-connection/index.d.ts +12 -1
  66. package/realtime-connection/index.js +139 -91
  67. package/realtime-connection/index.js.gz +0 -0
  68. package/release-meta.json +4 -4
@@ -0,0 +1,40 @@
1
+ {
2
+ "packageName": "@das-fed/upf-utils",
3
+ "entrySpecifier": "@das-fed/upf-utils/browser",
4
+ "entry": "./browser.js",
5
+ "match": "static-named-import-only",
6
+ "imports": {
7
+ "@das-fed/upf-utils/atob": "./browser.js",
8
+ "@das-fed/upf-utils/atob/index.js": "./browser.js",
9
+ "@das-fed/upf-utils/common-info/getInfoFromUrl": "./browser.js",
10
+ "@das-fed/upf-utils/common-info/getInfoFromUrl/index.js": "./browser.js",
11
+ "@das-fed/upf-utils/common-tools/arr-tools": "./browser.js",
12
+ "@das-fed/upf-utils/common-tools/arr-tools/index.js": "./browser.js",
13
+ "@das-fed/upf-utils/common-tools/calc-text-width": "./browser.js",
14
+ "@das-fed/upf-utils/common-tools/calc-text-width/index.js": "./browser.js",
15
+ "@das-fed/upf-utils/common-tools/date-format": "./browser.js",
16
+ "@das-fed/upf-utils/common-tools/date-format/index.js": "./browser.js",
17
+ "@das-fed/upf-utils/common-tools/get-file-extension": "./browser.js",
18
+ "@das-fed/upf-utils/common-tools/get-file-extension/index.js": "./browser.js",
19
+ "@das-fed/upf-utils/common-tools/get-url-params": "./browser.js",
20
+ "@das-fed/upf-utils/common-tools/get-url-params/index.js": "./browser.js",
21
+ "@das-fed/upf-utils/common-tools/nest-tree-format": "./browser.js",
22
+ "@das-fed/upf-utils/common-tools/nest-tree-format/index.js": "./browser.js",
23
+ "@das-fed/upf-utils/common-tools/obj-tools": "./browser.js",
24
+ "@das-fed/upf-utils/common-tools/obj-tools/index.js": "./browser.js",
25
+ "@das-fed/upf-utils/common-tools/queue-promise": "./browser.js",
26
+ "@das-fed/upf-utils/common-tools/queue-promise/index.js": "./browser.js",
27
+ "@das-fed/upf-utils/common-tools/setHtmlMinWH": "./browser.js",
28
+ "@das-fed/upf-utils/common-tools/setHtmlMinWH/index.js": "./browser.js",
29
+ "@das-fed/upf-utils/config": "./browser.js",
30
+ "@das-fed/upf-utils/config/index.js": "./browser.js",
31
+ "@das-fed/upf-utils/dom-watcher": "./browser.js",
32
+ "@das-fed/upf-utils/dom-watcher/index.js": "./browser.js",
33
+ "@das-fed/upf-utils/process-engine-info": "./browser.js",
34
+ "@das-fed/upf-utils/process-engine-info/index.js": "./browser.js",
35
+ "@das-fed/upf-utils/pure-image-src": "./browser.js",
36
+ "@das-fed/upf-utils/pure-image-src/index.js": "./browser.js",
37
+ "@das-fed/upf-utils/token-tools": "./browser.js",
38
+ "@das-fed/upf-utils/token-tools/index.js": "./browser.js"
39
+ }
40
+ }
package/browser.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ export * from './atob';
2
+ export * from './common-info/getInfoFromUrl';
3
+ export * from './common-tools/arr-tools';
4
+ export * from './common-tools/calc-text-width';
5
+ export * from './common-tools/date-format';
6
+ export * from './common-tools/get-file-extension';
7
+ export * from './common-tools/get-url-params';
8
+ export * from './common-tools/nest-tree-format';
9
+ export * from './common-tools/obj-tools';
10
+ export * from './common-tools/queue-promise';
11
+ export * from './common-tools/setHtmlMinWH';
12
+ export * from './config';
13
+ export * from './dom-watcher';
14
+ export * from './process-engine-info';
15
+ export * from './pure-image-src';
16
+ export * from './token-tools';
package/browser.js ADDED
@@ -0,0 +1,267 @@
1
+ const A = (e) => {
2
+ var t = encodeURIComponent(e);
3
+ return t = btoa(t), t;
4
+ }, B = (e) => {
5
+ var t = atob(e);
6
+ return t = decodeURIComponent(t), t;
7
+ };
8
+ /*! js-cookie v3.0.5 | MIT */
9
+ function f(e) {
10
+ for (var t = 1; t < arguments.length; t++) {
11
+ var n = arguments[t];
12
+ for (var r in n)
13
+ e[r] = n[r];
14
+ }
15
+ return e;
16
+ }
17
+ var w = {
18
+ read: function(e) {
19
+ return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
20
+ },
21
+ write: function(e) {
22
+ return encodeURIComponent(e).replace(
23
+ /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
24
+ decodeURIComponent
25
+ );
26
+ }
27
+ };
28
+ function d(e, t) {
29
+ function n(o, c, s) {
30
+ if (!(typeof document > "u")) {
31
+ s = f({}, t, s), typeof s.expires == "number" && (s.expires = new Date(Date.now() + s.expires * 864e5)), s.expires && (s.expires = s.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
32
+ var i = "";
33
+ for (var a in s)
34
+ s[a] && (i += "; " + a, s[a] !== !0 && (i += "=" + s[a].split(";")[0]));
35
+ return document.cookie = o + "=" + e.write(c, o) + i;
36
+ }
37
+ }
38
+ function r(o) {
39
+ if (!(typeof document > "u" || arguments.length && !o)) {
40
+ for (var c = document.cookie ? document.cookie.split("; ") : [], s = {}, i = 0; i < c.length; i++) {
41
+ var a = c[i].split("="), U = a.slice(1).join("=");
42
+ try {
43
+ var g = decodeURIComponent(a[0]);
44
+ if (s[g] = e.read(U, g), o === g)
45
+ break;
46
+ } catch {
47
+ }
48
+ }
49
+ return o ? s[o] : s;
50
+ }
51
+ }
52
+ return Object.create(
53
+ {
54
+ set: n,
55
+ get: r,
56
+ remove: function(o, c) {
57
+ n(
58
+ o,
59
+ "",
60
+ f({}, c, {
61
+ expires: -1
62
+ })
63
+ );
64
+ },
65
+ withAttributes: function(o) {
66
+ return d(this.converter, f({}, this.attributes, o));
67
+ },
68
+ withConverter: function(o) {
69
+ return d(f({}, this.converter, o), this.attributes);
70
+ }
71
+ },
72
+ {
73
+ attributes: { value: Object.freeze(t) },
74
+ converter: { value: Object.freeze(e) }
75
+ }
76
+ );
77
+ }
78
+ var h = d(w, { path: "/" });
79
+ const D = () => {
80
+ const e = new URL(location.href).searchParams, t = e.get("token") || e.get("accessToken") || e.get("accesstoken") || "";
81
+ t && (JSON.stringify({ access_token: t }), h.set("accessToken", t));
82
+ }, F = () => {
83
+ const e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}"), t = new URL(location.href).searchParams, n = t.get("project") || t.get("projectId") || "";
84
+ if (!n) return;
85
+ const r = t.get("projectParent") || t.get("projectParentId") || (e == null ? void 0 : e.parentId) || "", o = t.get("projectName") || (e == null ? void 0 : e.name) || "";
86
+ sessionStorage.setItem("project", n), sessionStorage.setItem("projectInfo", JSON.stringify({ ...e, id: n, name: o, parentId: r }));
87
+ }, H = (e, t, n = !0) => e.length !== t.length ? !1 : n ? e.sort().toString() === t.sort().toString() : e.toString() === t.toString(), M = (e, t) => {
88
+ const n = /* @__PURE__ */ new Map();
89
+ return e.filter((r) => !n.has(r[t]) && n.set(r[t], 1));
90
+ }, W = (e, t) => {
91
+ if (!e) return 0;
92
+ const n = document.createElement("div");
93
+ n.style.visibility = "hidden", n.style.whiteSpace = "pre", n.style.display = "inline-block", n.style.fontSize = t + "px", n.textContent = e, document.body.appendChild(n);
94
+ const r = n.offsetWidth;
95
+ return document.body.removeChild(n), r;
96
+ }, K = (e, t = "yyyy-MM-dd HH:mm:ss") => {
97
+ let n = e ? new Date(e) : /* @__PURE__ */ new Date();
98
+ var r = {
99
+ "M+": n.getMonth() + 1,
100
+ "d+": n.getDate(),
101
+ "H+": n.getHours(),
102
+ "m+": n.getMinutes(),
103
+ "s+": n.getSeconds(),
104
+ "q+": Math.floor((n.getMonth() + 3) / 3),
105
+ S: n.getMilliseconds()
106
+ }, o = n.getFullYear().toString();
107
+ o = o.length >= 4 ? o : "0000".substr(0, 4 - o.length) + o, /(y+)/.test(t) && (t = t.replace(RegExp.$1, (o + "").substr(4 - RegExp.$1.length)));
108
+ for (var c in r)
109
+ new RegExp("(" + c + ")").test(t) && (t = t.replace(RegExp.$1, RegExp.$1.length === 1 ? r[c] : ("00" + r[c]).substr(("" + r[c]).length)));
110
+ return t;
111
+ }, q = (e) => {
112
+ const t = e.lastIndexOf(".");
113
+ return t === -1 ? "" : e.slice(t);
114
+ }, I = (e, t) => {
115
+ let n = window.location.search || "";
116
+ if (e && e !== location.href) {
117
+ const o = e.indexOf("?");
118
+ o !== -1 ? n = e.slice(o) : n = "";
119
+ }
120
+ const r = new URLSearchParams(n);
121
+ if (t)
122
+ return r.get(t);
123
+ {
124
+ let o = {};
125
+ for (let [c, s] of r.entries())
126
+ o[c] = s;
127
+ return o;
128
+ }
129
+ }, J = (e, t = {}) => {
130
+ let n = "", r = "";
131
+ const o = Object.keys(t);
132
+ return o && o.length && o.forEach((c, s) => {
133
+ s === o.length - 1 ? r += `${c}=${t[c]}` : r += `${c}=${t[c]}&`;
134
+ }), r ? n = location.origin + e + `?${r}` : n = location.origin + e, n;
135
+ }, N = (e, t) => {
136
+ const n = t || location.href, r = I(n), o = Object.keys(r) || [];
137
+ if (!o || !o.length) return n.includes("?") ? n.split("?")[0] : n.split("&")[0];
138
+ let c = o.filter((i) => !e.includes(i));
139
+ if (!c || !c.length) return n.includes("?") ? n.split("?")[0] : n.split("&")[0];
140
+ let s = "";
141
+ return c.forEach((i, a) => {
142
+ a === o.length - 1 ? s += `${i}=${r[i]}` : s += `${i}=${r[i]}&`;
143
+ }), n.includes("?") ? n.split("?")[0] + `?${s}` : n.split("&")[0] + `?${s}`;
144
+ }, z = (e) => {
145
+ const t = new URLSearchParams(e.split("?")[1]), n = {};
146
+ for (const [r, o] of t)
147
+ n.hasOwnProperty(r) ? Array.isArray(n[r]) ? n[r].push(o) : n[r] = [n[r], o] : n[r] = o;
148
+ return n;
149
+ }, Q = (e) => {
150
+ let t = "";
151
+ const n = Object.keys(e);
152
+ return n && n.length && n.forEach((r, o) => {
153
+ o === n.length - 1 ? t += `${r}=${e[r]}` : t += `${r}=${e[r]}&`;
154
+ }), t;
155
+ }, X = (e, t) => {
156
+ const n = new URL(e, location.origin);
157
+ let { origin: r, pathname: o } = n;
158
+ o === "/" && (o = ""), t.map((s) => o += `/${s}`);
159
+ const c = new URL(`${r}${o}`);
160
+ return n.searchParams.forEach((s, i) => {
161
+ c.searchParams.append(i, s);
162
+ }), c.toString();
163
+ };
164
+ function Y(e) {
165
+ const t = /^(https?:\/\/[^/]+)/, n = e.match(t);
166
+ return n && n.length > 1 ? n[1] : null;
167
+ }
168
+ const v = (e, t = "children") => {
169
+ let n = [];
170
+ for (let r = 0; r < e.length; r++)
171
+ e[r][t] && e[r][t].length > 0 && (n.push(e[r]), n = n.concat(v(e[r][t])));
172
+ return n;
173
+ }, y = (e, t = "children", n = !0) => Array.isArray(e) && e.length ? e.reduce((r, o) => {
174
+ let c = o[t], s = { ...o };
175
+ return n && delete s[t], c && c.length ? r.concat(s, y(c, t, n)) : r.concat(s);
176
+ }, []) : [], R = (e, t, n = "children") => e.filter((r) => t(r)).map((r) => (r = Object.assign({}, r), r[n] && (r[n] = R(r[n], t)), r)), $ = (e, t, n = "children") => {
177
+ for (const r of e) {
178
+ if (t(r)) return r;
179
+ if (r != null && r[n] && r[n].length) {
180
+ const o = $(r[n], t, n = "children");
181
+ if (o) return o;
182
+ }
183
+ }
184
+ return null;
185
+ }, k = (e, t) => {
186
+ if (!e || !t || Object.keys(e).length !== Object.keys(t).length) return !1;
187
+ for (let n in e) {
188
+ if (t[n] === void 0) return !1;
189
+ if (typeof t[n] == "function" || typeof e[n] == "function") throw new Error("type error");
190
+ if (typeof t[n] != typeof e[n]) return !1;
191
+ if (typeof e[n] == "object") return k(e[n], t[n]);
192
+ if (e[n] !== t[n]) return !1;
193
+ }
194
+ return !0;
195
+ };
196
+ function _(e) {
197
+ const t = [];
198
+ return new Promise((n, r) => {
199
+ e.reduce((o, c) => o.then(c).then((s) => t.push(s)), Promise.resolve()).then(() => n(t));
200
+ });
201
+ }
202
+ const G = (e) => {
203
+ let t = "1366px", n = "528px";
204
+ e != null && e.minWidth && (t = e.minWidth), e != null && e.minHeight && (n = e.minHeight), document.documentElement.style.minWidth = t, document.documentElement.style.minHeight = n, document.documentElement.style.overflow = "auto";
205
+ }, T = (e, t) => {
206
+ const n = String(e || "").trim();
207
+ return n ? (n.startsWith("/") ? `${String(t || "").replace(/\/+$/, "")}${n}` : n).replace(/^https:/i, "wss:").replace(/^http:/i, "ws:").replace(/\/+$/, "") : "";
208
+ }, V = () => {
209
+ let t = { ...(window == null ? void 0 : window.config) || {} };
210
+ t.rootContainer || (t.rootContainer = "#app"), t.baseURL || (t.baseURL = location.origin), t.wsBaseURL && (t.wsBaseURL = T(t.wsBaseURL, t.baseURL)), t.ossBaseURL || (t.ossBaseURL = "/oss"), t.ossBaseURL.startsWith("/") && (t.ossBaseURL = `${t.baseURL}/oss`), t.ssoBaseURL || (t.ssoBaseURL = t.baseURL);
211
+ let { microAppName: n, publicPath: r, mainAppName: o } = t;
212
+ return n && !0 && !r && (r = `/${n}/`.replace(/\/\//g, "/")), r || (r = "/"), t.publicPath = r, t.autoOssBucket || (t.autoOssBucket = o || n), t;
213
+ }, Z = (e, t, n = { attributes: !0, childList: !0, subtree: !0 }) => {
214
+ const r = t || document.body, o = new MutationObserver((c) => {
215
+ e(c);
216
+ });
217
+ return o.observe(r, n), o;
218
+ }, ee = (e) => {
219
+ sessionStorage.setItem("hotentToken", e.accessToken || ""), sessionStorage.setItem("currentUser", JSON.stringify({ token: e.accessToken || "" }));
220
+ }, te = () => {
221
+ sessionStorage.removeItem("hotentToken"), sessionStorage.removeItem("currentUser");
222
+ }, ne = (e) => {
223
+ sessionStorage.setItem("project", e);
224
+ }, re = () => {
225
+ sessionStorage.removeItem("project");
226
+ }, u = "oss", x = (e) => e.indexOf(`/${u}/`) === 0 ? e : null, E = (e) => e.indexOf("/") === 0 ? `/${u}${e}` : null, P = (e) => e.indexOf(`${u}/`) === 0 ? `/${e}` : null, C = (e) => `/${u}/${e}`, j = (...e) => (t) => e.reduce((n, r) => n !== null ? n : r(t), null), O = j(x, E, P, C), oe = (e) => e ? O(e) : "", l = "accessToken", p = "accessTokenExpiredAt", m = "refreshToken", S = "redirectUri", L = "csrf-token", se = () => localStorage.getItem(l) ?? h.get(l) ?? sessionStorage.getItem(l) ?? "", ce = (e) => localStorage.getItem(e) ?? h.get(e) ?? sessionStorage.getItem(e) ?? "", ie = (e, t = {}) => {
227
+ var n;
228
+ (n = window.webConfig) != null && n.disableSaveToken || (localStorage.setItem(l, e), localStorage.setItem(p, t.accessTokenExpiredAt ?? "0"), localStorage.setItem(m, t.refreshToken ?? ""), t.redirectUri && localStorage.setItem(S, t.redirectUri));
229
+ }, ae = () => {
230
+ localStorage.removeItem(l), localStorage.removeItem(p), localStorage.removeItem(m), localStorage.removeItem(S), localStorage.removeItem(L);
231
+ };
232
+ export {
233
+ Z as DomWatcher,
234
+ X as addPathParamsToUrl,
235
+ H as arrEqual,
236
+ M as arrUnique,
237
+ W as calcTextWidth,
238
+ K as dateFormat,
239
+ B as decrypt,
240
+ A as encryption,
241
+ R as filterTreeArray,
242
+ v as findNonEmptyChildrenItems,
243
+ y as flatTree,
244
+ N as funcUrlDel,
245
+ se as getAccessToken,
246
+ ce as getAccessTokenInfo,
247
+ V as getConfig,
248
+ q as getFileExtension,
249
+ J as getFullPath,
250
+ Y as getOriginFromUrl,
251
+ F as getProjectInfoFromQuery,
252
+ D as getTokenFromQuery,
253
+ I as getUrlParams,
254
+ k as objEqual,
255
+ Q as objectToUrlparams,
256
+ oe as pureImageSrc,
257
+ ae as removeAccessToken,
258
+ re as removeProcessEngineProject,
259
+ te as removeProcessEngineToken,
260
+ _ as runPromiseByQueue,
261
+ ie as setAccessToken,
262
+ G as setHtmlMinWH,
263
+ ne as setProcessEngineProject,
264
+ ee as setProcessEngineToken,
265
+ $ as treeFind,
266
+ z as urlParamsToObject
267
+ };
package/browser.js.gz ADDED
Binary file