@das-fed/utils 1.0.8 → 6.3.0-beta.0

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 (105) hide show
  1. package/api-services/index.d.ts +2 -1
  2. package/api-services/index.js +3 -2
  3. package/api-services/modules/app-manage.js +1 -1
  4. package/api-services/modules/authentication.js +1 -1
  5. package/api-services/modules/bems.js +1 -1
  6. package/api-services/modules/contract.js +1 -1
  7. package/api-services/modules/duty-manage.js +1 -1
  8. package/api-services/modules/enterpriseright.js +1 -1
  9. package/api-services/modules/file.d.ts +1 -1
  10. package/api-services/modules/file.js +355 -342
  11. package/api-services/modules/gateway-edge.js +1 -1
  12. package/api-services/modules/index.d.ts +21 -21
  13. package/api-services/modules/index.js +57 -558
  14. package/api-services/modules/iot.js +1 -1
  15. package/api-services/modules/justauth.js +1 -1
  16. package/api-services/modules/knowledge.js +1 -1
  17. package/api-services/modules/link.js +1 -1
  18. package/api-services/modules/permission.js +1 -1
  19. package/api-services/modules/platformManage.js +1 -1
  20. package/api-services/modules/portal.js +1 -1
  21. package/api-services/modules/space-manage.js +1 -1
  22. package/api-services/modules/super-admin.js +1 -1
  23. package/api-services/modules/supplier.js +1 -1
  24. package/api-services/modules/supplychain-manage.js +1 -1
  25. package/api-services/modules/systemConfiguration.js +1 -1
  26. package/api-services/modules/tool.js +1 -1
  27. package/api-services/src/create-service.d.ts +1 -1
  28. package/api-services/src/create-service.js +2 -3234
  29. package/common-info/{setInfoFromUrl.d.ts → getInfoFromUrl.d.ts} +1 -1
  30. package/common-info/{setInfoFromUrl.js → getInfoFromUrl.js} +26 -29
  31. package/common-info/index.d.ts +18 -7
  32. package/common-info/index.js +82 -143
  33. package/{api-services/src/sso.js → common-info/set-personal-info.js} +754 -667
  34. package/common-tools/get-url-params.d.ts +21 -8
  35. package/common-tools/get-url-params.js +26 -15
  36. package/common-tools/index.d.ts +3 -0
  37. package/common-tools/index.js +3 -0
  38. package/common-tools/obj-tools.d.ts +1 -1
  39. package/common-tools/platform-tools.d.ts +18 -0
  40. package/common-tools/platform-tools.js +15 -0
  41. package/common-tools/queue-promise.d.ts +6 -0
  42. package/common-tools/queue-promise.js +9 -0
  43. package/common-tools/setHtmlMinWH.js +8 -4
  44. package/common-tools/update-fav-icon.d.ts +10 -0
  45. package/common-tools/update-fav-icon.js +22 -0
  46. package/create-api-service/index.d.ts +1 -0
  47. package/create-api-service/index.js +3492 -0
  48. package/create-api-service/proxy-sso.d.ts +3 -0
  49. package/create-api-service/proxy-sso.js +21 -0
  50. package/create-api-service/sso.d.ts +23 -0
  51. package/create-api-service/sso.js +1969 -0
  52. package/curring-http/index.d.ts +3 -2
  53. package/curring-http/index.js +2872 -2662
  54. package/dimple-canvas/index.d.ts +1 -0
  55. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.d.ts +1 -0
  56. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.js +2244 -2265
  57. package/dimple-canvas/use-dimple-canvas/core/konva/index.d.ts +4 -3
  58. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.d.ts +2 -1
  59. package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.d.ts +2 -1
  60. package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.d.ts +2 -1
  61. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.d.ts +2 -1
  62. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.js +1079 -1051
  63. package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.d.ts +2 -1
  64. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.d.ts +3 -2
  65. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.d.ts +2 -1
  66. package/dimple-canvas/use-dimple-canvas/index.d.ts +2 -1
  67. package/directive/auth.js +21 -21
  68. package/directive/clickOutside.d.ts +3 -2
  69. package/directive/hoverInside.d.ts +2 -1
  70. package/dom-check-in/index.js +5 -5
  71. package/hooks/popup-manager/use-zindex.js +8 -8
  72. package/hooks/use-get-auth/apis.d.ts +4 -0
  73. package/hooks/use-get-auth/apis.js +8 -0
  74. package/hooks/use-get-auth/index.d.ts +9 -0
  75. package/hooks/use-get-auth/index.js +57 -0
  76. package/nextTiken/index.d.ts +3 -4
  77. package/nextTiken/index.js +34 -46
  78. package/package.json +5 -4
  79. package/pinyin-first-character/index.js +19792 -20877
  80. package/process-engine-info/index.d.ts +5 -2
  81. package/process-engine-info/index.js +11 -6
  82. package/style/index.js +1 -1
  83. package/style/style.d.ts +2 -1
  84. package/style/style.js +1 -1
  85. package/token-tools/index.d.ts +10 -7
  86. package/token-tools/index.js +44 -59
  87. package/use-low-code/index.d.ts +1 -0
  88. package/use-low-code/index.js +70 -0
  89. package/use-low-code/low-code-iframe.vue.d.ts +2 -0
  90. package/use-low-code/style.css +1 -0
  91. package/webSocket-service/index.d.ts +2 -1
  92. package/with-install/index.d.ts +2 -1
  93. package/api-services/src/sso.d.ts +0 -29
  94. package/api-services/src/util.d.ts +0 -1
  95. package/api-services/src/util.js +0 -1466
  96. package/common-tools/throttled.d.ts +0 -7
  97. package/common-tools/throttled.js +0 -10
  98. package/micro-app/globalData.d.ts +0 -3
  99. package/micro-app/globalData.js +0 -11
  100. package/micro-app/index.d.ts +0 -5
  101. package/micro-app/index.js +0 -3699
  102. package/panel/index.d.ts +0 -31
  103. package/panel/index.js +0 -37
  104. package/set-personal-info/index.js +0 -1468
  105. /package/{set-personal-info/index.d.ts → common-info/set-personal-info.d.ts} +0 -0
@@ -1,10 +1,13 @@
1
1
  /**
2
- * 存储--子应用存储流程引擎需要的token信息
2
+ * 子应用存储流程引擎需要的token信息
3
3
  * @param data token信息
4
4
  */
5
5
  export declare const setProcessEngineToken: (data: Record<any, any>) => void;
6
+ /** 移除流程引擎token */
7
+ export declare const removeProcessEngineToken: () => void;
6
8
  /**
7
- * 存储--子应用存储流程引擎需要的项目信息
9
+ * 子应用存储流程引擎需要的项目信息
8
10
  * @param projectId 项目id
9
11
  */
10
12
  export declare const setProcessEngineProject: (projectId: string) => void;
13
+ export declare const removeProcessEngineProject: () => void;
@@ -1,10 +1,15 @@
1
- const i = (e) => {
2
- var n, s, o, t;
3
- sessionStorage.setItem("hotentToken", e.accessToken || ""), sessionStorage.setItem("currentUser", JSON.stringify({ token: e.accessToken || "" })), e.info && JSON.stringify(e.info) !== "{}" && sessionStorage.setItem("hotentUserInfo", JSON.stringify({ id: ((n = e.info) == null ? void 0 : n.sub) ?? "", name: ((s = e.info) == null ? void 0 : s.name) ?? "", flag: (o = e.info) == null ? void 0 : o.flag, tenantId: ((t = e.info) == null ? void 0 : t.tenant) ?? "" }));
4
- }, r = (e) => {
1
+ const s = (e) => {
2
+ sessionStorage.setItem("hotentToken", e.accessToken || ""), sessionStorage.setItem("currentUser", JSON.stringify({ token: e.accessToken || "" }));
3
+ }, o = () => {
4
+ sessionStorage.removeItem("hotentToken"), sessionStorage.removeItem("currentUser");
5
+ }, t = (e) => {
5
6
  sessionStorage.setItem("project", e);
7
+ }, n = () => {
8
+ sessionStorage.removeItem("project");
6
9
  };
7
10
  export {
8
- r as setProcessEngineProject,
9
- i as setProcessEngineToken
11
+ n as removeProcessEngineProject,
12
+ o as removeProcessEngineToken,
13
+ t as setProcessEngineProject,
14
+ s as setProcessEngineToken
10
15
  };
package/style/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.4.21
2
+ * @vue/shared v3.4.27
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
package/style/style.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { CSSProperties } from 'vue';
1
+ import { CSSProperties } from 'vue';
2
+
2
3
  export declare const classNameToArray: (cls?: string) => string[];
3
4
  export declare const hasClass: (el: Element, cls: string) => boolean;
4
5
  export declare const addClass: (el: Element, cls: string) => void;
package/style/style.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.4.21
2
+ * @vue/shared v3.4.27
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,18 +1,21 @@
1
1
  /**
2
- * 获取token,顺便处理cookie中赋值到sessionStorage的需求
3
- * @returns
2
+ * 获取token
3
+ * @returns token
4
4
  */
5
- export declare const getAccessToken: () => any;
5
+ export declare const getAccessToken: () => string;
6
6
  /**
7
- * 获取token详情
7
+ * 获取tokenInfo相关信息
8
8
  */
9
- export declare const getAccessTokenInfo: () => any;
9
+ export declare const getAccessTokenInfo: (key: 'accessTokenExpiredAt' | 'refreshToken' | 'redirectUri') => any;
10
10
  /**
11
- * 存入cookie
11
+ * 存入token、tokenInfo
12
12
  * @param token
13
+ * @param info
13
14
  */
14
15
  export declare const setAccessToken: (token: string, info?: any) => void;
15
16
  /**
16
- * 删除cookie中的token
17
+ * 删除token、tokenInfo
17
18
  */
18
19
  export declare const removeAccessToken: () => void;
20
+ /** 清除所有的 cookie */
21
+ export declare const clearAllCookies: () => void;
@@ -1,102 +1,87 @@
1
- import { tokenStorage as k } from "@das-fed/utils/api-services/src/sso";
2
- import { setProcessEngineToken as C } from "@das-fed/utils/process-engine-info";
3
- import { setPersonalInfo as D } from "@das-fed/utils/set-personal-info";
4
1
  /*! js-cookie v3.0.5 | MIT */
5
- function u(o) {
6
- for (var t = 1; t < arguments.length; t++) {
7
- var f = arguments[t];
8
- for (var a in f)
9
- o[a] = f[a];
2
+ function d(e) {
3
+ for (var o = 1; o < arguments.length; o++) {
4
+ var f = arguments[o];
5
+ for (var p in f)
6
+ e[p] = f[p];
10
7
  }
11
- return o;
8
+ return e;
12
9
  }
13
- var I = {
14
- read: function(o) {
15
- return o[0] === '"' && (o = o.slice(1, -1)), o.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
10
+ var m = {
11
+ read: function(e) {
12
+ return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
16
13
  },
17
- write: function(o) {
18
- return encodeURIComponent(o).replace(
14
+ write: function(e) {
15
+ return encodeURIComponent(e).replace(
19
16
  /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
20
17
  decodeURIComponent
21
18
  );
22
19
  }
23
20
  };
24
- function m(o, t) {
25
- function f(n, i, e) {
21
+ function u(e, o) {
22
+ function f(n, s, r) {
26
23
  if (!(typeof document > "u")) {
27
- e = u({}, t, e), typeof e.expires == "number" && (e.expires = new Date(Date.now() + e.expires * 864e5)), e.expires && (e.expires = e.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
28
- var r = "";
29
- for (var c in e)
30
- e[c] && (r += "; " + c, e[c] !== !0 && (r += "=" + e[c].split(";")[0]));
31
- return document.cookie = n + "=" + o.write(i, n) + r;
24
+ r = d({}, o, r), typeof r.expires == "number" && (r.expires = new Date(Date.now() + r.expires * 864e5)), r.expires && (r.expires = r.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
25
+ var t = "";
26
+ for (var i in r)
27
+ r[i] && (t += "; " + i, r[i] !== !0 && (t += "=" + r[i].split(";")[0]));
28
+ return document.cookie = n + "=" + e.write(s, n) + t;
32
29
  }
33
30
  }
34
- function a(n) {
31
+ function p(n) {
35
32
  if (!(typeof document > "u" || arguments.length && !n)) {
36
- for (var i = document.cookie ? document.cookie.split("; ") : [], e = {}, r = 0; r < i.length; r++) {
37
- var c = i[r].split("="), p = c.slice(1).join("=");
33
+ for (var s = document.cookie ? document.cookie.split("; ") : [], r = {}, t = 0; t < s.length; t++) {
34
+ var i = s[t].split("="), l = i.slice(1).join("=");
38
35
  try {
39
- var g = decodeURIComponent(c[0]);
40
- if (e[g] = o.read(p, g), n === g)
36
+ var v = decodeURIComponent(i[0]);
37
+ if (r[v] = e.read(l, v), n === v)
41
38
  break;
42
39
  } catch {
43
40
  }
44
41
  }
45
- return n ? e[n] : e;
42
+ return n ? r[n] : r;
46
43
  }
47
44
  }
48
45
  return Object.create(
49
46
  {
50
47
  set: f,
51
- get: a,
52
- remove: function(n, i) {
48
+ get: p,
49
+ remove: function(n, s) {
53
50
  f(
54
51
  n,
55
52
  "",
56
- u({}, i, {
53
+ d({}, s, {
57
54
  expires: -1
58
55
  })
59
56
  );
60
57
  },
61
58
  withAttributes: function(n) {
62
- return m(this.converter, u({}, this.attributes, n));
59
+ return u(this.converter, d({}, this.attributes, n));
63
60
  },
64
61
  withConverter: function(n) {
65
- return m(u({}, this.converter, n), this.attributes);
62
+ return u(d({}, this.converter, n), this.attributes);
66
63
  }
67
64
  },
68
65
  {
69
- attributes: { value: Object.freeze(t) },
70
- converter: { value: Object.freeze(o) }
66
+ attributes: { value: Object.freeze(o) },
67
+ converter: { value: Object.freeze(e) }
71
68
  }
72
69
  );
73
70
  }
74
- var s = m(I, { path: "/" });
75
- const v = "accessToken", d = "accessTokenInfo", U = () => {
76
- var f, a, n, i, e, r, c;
77
- const o = s.get(v) ?? "";
78
- let t = "";
79
- if ((f = k().getData()) != null && f.info && JSON.stringify((a = k().getData()) == null ? void 0 : a.info) !== "{}" && (t = ((i = (n = k().getData()) == null ? void 0 : n.info) == null ? void 0 : i.access_token) ?? ((r = (e = k().getData()) == null ? void 0 : e.info) == null ? void 0 : r.accessToken) ?? ""), o && !t) {
80
- const p = x();
81
- if (p && JSON.stringify(p) !== "{}") {
82
- const { access_token: g, refresh_token: T, expires_in: h } = p, l = {
83
- accessToken: g,
84
- accessTokenExpiredAt: +/* @__PURE__ */ new Date() + h * 1e3,
85
- refreshToken: T,
86
- info: p
87
- };
88
- k().save(l), D(g), C(l);
89
- }
90
- }
91
- return s.get(v) ?? ((c = k().getData()) == null ? void 0 : c.accessToken) ?? "";
92
- }, x = () => s.get(d) ? JSON.parse(s.get(d)) : {}, y = (o, t) => {
93
- s.set(v, o), t && s.set(d, JSON.stringify(t));
94
- }, E = () => {
95
- s.remove(v), s.get(d) && s.remove(d);
71
+ var c = u(m, { path: "/" });
72
+ const k = "accessToken", g = "accessTokenExpiredAt", a = "refreshToken", h = "redirectUri", T = () => c.get(k) ?? "", x = (e) => c.get(e) ?? "", A = (e, o = {}) => {
73
+ c.set(k, e), c.set(g, o.accessTokenExpiredAt ?? "0"), c.set(a, o.refreshToken ?? ""), o.redirectUri && c.set(h, o.redirectUri);
74
+ }, U = () => {
75
+ c.remove(k), c.remove(g), c.remove(a), c.remove(h);
76
+ }, y = () => {
77
+ const e = c.get();
78
+ for (const o in e)
79
+ e.hasOwnProperty(o) && c.remove(o);
96
80
  };
97
81
  export {
98
- U as getAccessToken,
82
+ y as clearAllCookies,
83
+ T as getAccessToken,
99
84
  x as getAccessTokenInfo,
100
- E as removeAccessToken,
101
- y as setAccessToken
85
+ U as removeAccessToken,
86
+ A as setAccessToken
102
87
  };
@@ -0,0 +1 @@
1
+ export { default as LowCode } from './low-code-iframe.vue';
@@ -0,0 +1,70 @@
1
+ import { defineComponent as v, computed as u, onMounted as g, onBeforeUnmount as _, ref as L, openBlock as y, createElementBlock as h } from "vue";
2
+ const x = ["src"], b = /* @__PURE__ */ v({
3
+ __name: "low-code-iframe",
4
+ props: {
5
+ app: {},
6
+ query: {},
7
+ iframeLoading: { type: Boolean }
8
+ },
9
+ emits: ["emit-change", "update:iframeLoading"],
10
+ setup(n, { expose: c, emit: s }) {
11
+ const a = n, r = u(() => {
12
+ if (!a.app)
13
+ return;
14
+ let e = "";
15
+ const o = "";
16
+ let t = a.query || {};
17
+ return a.app && (t.app = a.app), e = `${o}/api/node-low-code/v1/visitor/views/index?${new URLSearchParams(t).toString()}`, e;
18
+ }), d = s, l = u({
19
+ get: () => a.iframeLoading,
20
+ set: (e) => d("update:iframeLoading", e)
21
+ }), p = (e) => {
22
+ const { emitName: o = "", emitData: t = {} } = e.data || {};
23
+ o === "app-mounted" ? l.value = !1 : d("emit-change", o, t);
24
+ };
25
+ g(() => {
26
+ window.addEventListener("message", p, !1);
27
+ }), _(() => {
28
+ window.removeEventListener("message", p, !1);
29
+ });
30
+ const i = L(null), f = (e) => {
31
+ var o;
32
+ l.value || (o = i.value) != null && o.contentWindow && i.value.contentWindow.postMessage(e);
33
+ };
34
+ c({
35
+ onActivated: () => {
36
+ f({ type: "onActivated" });
37
+ },
38
+ onDeactivated: () => {
39
+ f({ type: "onDeactivated" });
40
+ }
41
+ });
42
+ const w = () => {
43
+ var o, t, m;
44
+ const { origin: e } = new URL(r.value || "");
45
+ e && ((m = (t = (o = i.value) == null ? void 0 : o.contentWindow) == null ? void 0 : t.postMessage) == null || m.call(
46
+ t,
47
+ { type: "setProxSsoStatus", data: { visible: !0, parentHref: location.href } },
48
+ e
49
+ ));
50
+ };
51
+ return (e, o) => (y(), h("iframe", {
52
+ class: "low-code-iframe",
53
+ id: "low-code-iframe",
54
+ src: r.value,
55
+ frameborder: "0",
56
+ sandbox: "allow-same-origin allow-scripts allow-forms allow-modals allow-popups allow-downloads allow-top-navigation",
57
+ ref_key: "lowCodeRef",
58
+ ref: i,
59
+ onLoad: w
60
+ }, null, 40, x));
61
+ }
62
+ }), C = (n, c) => {
63
+ const s = n.__vccOpts || n;
64
+ for (const [a, r] of c)
65
+ s[a] = r;
66
+ return s;
67
+ }, B = /* @__PURE__ */ C(b, [["__scopeId", "data-v-dfb25e5d"]]);
68
+ export {
69
+ B as LowCode
70
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ .low-code-iframe[data-v-dfb25e5d]{padding:0;margin:0;border:none;outline:none;height:100%;width:100%;min-height:100px;min-width:100px}
@@ -1,4 +1,5 @@
1
- import type { socketConfig } from './type';
1
+ import { socketConfig } from './type';
2
+
2
3
  export declare class socketService {
3
4
  /** websocket实例 */
4
5
  $ws: any;
@@ -1,4 +1,5 @@
1
- import type { Plugin } from 'vue';
1
+ import { Plugin } from 'vue';
2
+
2
3
  /**
3
4
  * 组件外部使用use时执行install,然后将组件注册为全局
4
5
  */
@@ -1,29 +0,0 @@
1
- declare const getQuery: (name: any) => string;
2
- declare const real_uri: string;
3
- declare const getTokenParams: any;
4
- declare const getTokenFromCode: (code: string, data: {
5
- [key: string]: string;
6
- client_id: string;
7
- client_secret: string;
8
- }, redirectUri: string, keepLogin: boolean) => Promise<any>;
9
- declare const getToken: (config: any) => Promise<any>;
10
- declare const login: (params: any) => void;
11
- declare const refreshToken: (params: any) => Promise<any>;
12
- declare const tokenStorage: () => {
13
- getData: () => {
14
- accessToken: string;
15
- accessTokenExpiredAt: number;
16
- refreshToken: string;
17
- info: any;
18
- redirectUri: string;
19
- };
20
- save: (data: {
21
- accessToken?: string | null;
22
- accessTokenExpiredAt?: number;
23
- refreshToken?: string;
24
- info?: any;
25
- redirectUri?: string;
26
- }) => void;
27
- remove: () => void;
28
- };
29
- export { getTokenParams, real_uri, getQuery, getTokenFromCode, getToken, tokenStorage, login };
@@ -1 +0,0 @@
1
- export declare const getCertificateInstalled: () => Promise<any[]>;