@hortiview/modulebase 1.1.2-alpha.a0b1047e.1 → 2.0.0-alpha.e897c28d.1
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/dist/IsRestoringProvider-Dc5Evyjr.js +6 -0
- package/dist/QueryClientProvider-DZI32rjZ.js +21 -0
- package/dist/api-CSxWxEZl.js +148 -0
- package/dist/{chunk-EVOBXE3Y-B43QN6RE.js → chunk-EVOBXE3Y-BRmUxtwH.js} +126 -127
- package/dist/components/ModuleBase.js +13 -17
- package/dist/components/ModuleCore.js +11398 -9
- package/dist/constants.js +1 -2
- package/dist/defaultQueryClient-Cfsorhtn.js +620 -0
- package/dist/hooks/useBreadcrumbTranslation.js +13 -16
- package/dist/hooks/useCustom.js +1 -1
- package/dist/hooks/useCustomMutation.js +5 -5
- package/dist/hooks/useEntity.js +1 -1
- package/dist/hooks/useOffline.js +1 -1
- package/dist/hooks/useOption.js +2 -2
- package/dist/hooks/useSignalRMessages.js +1 -1
- package/dist/lib/components/ModuleBase.d.ts +3 -22
- package/dist/lib/components/ModuleCore.d.ts +3 -17
- package/dist/lib/main.d.ts +0 -3
- package/dist/lib/module-router.d.ts +1 -1
- package/dist/lib/provider/SignalR/SignalRProvider.d.ts +0 -4
- package/dist/lib/types/BaseProps.d.ts +38 -1
- package/dist/lib/utils/defaultQueryClient.d.ts +2 -0
- package/dist/lib/utils/defaultSignalRClient.d.ts +4 -0
- package/dist/lib/utils/helper.d.ts +1 -2
- package/dist/main.js +56 -187
- package/dist/module-router.js +2 -2
- package/dist/provider/SignalR/SignalRProvider.js +22 -5966
- package/dist/{IsRestoringProvider-SzKJZczp.js → query-DZDIN635.js} +211 -232
- package/dist/stores/BasePropsStore.js +1 -0
- package/dist/{useCustomMutation-9VUQ7NbQ.js → useCustomMutation-C1aVbjpt.js} +13 -12
- package/dist/{useQuery-DUDyh33-.js → useQuery-CUSHkb38.js} +33 -31
- package/dist/utils/api.js +1 -1
- package/dist/utils/baseFetches.js +1 -1
- package/dist/utils/defaultQueryClient.js +4 -0
- package/dist/utils/defaultSignalRClient.js +5949 -0
- package/dist/utils/helper.js +9 -10
- package/package.json +1 -1
- package/dist/ModuleCore-DRMqZO8r.js +0 -12017
- package/dist/api-COabZnyn.js +0 -147
- package/dist/lib/types/ServiceBus.d.ts +0 -17
- package/dist/types/ServiceBus.js +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
3
|
+
var o = t.createContext(
|
|
4
|
+
void 0
|
|
5
|
+
), s = (r) => {
|
|
6
|
+
const e = t.useContext(o);
|
|
7
|
+
if (r)
|
|
8
|
+
return r;
|
|
9
|
+
if (!e)
|
|
10
|
+
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
11
|
+
return e;
|
|
12
|
+
}, i = ({
|
|
13
|
+
client: r,
|
|
14
|
+
children: e
|
|
15
|
+
}) => (t.useEffect(() => (r.mount(), () => {
|
|
16
|
+
r.unmount();
|
|
17
|
+
}), [r]), /* @__PURE__ */ u(o.Provider, { value: r, children: e }));
|
|
18
|
+
export {
|
|
19
|
+
i as Q,
|
|
20
|
+
s as u
|
|
21
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { g as m } from "./_commonjsHelpers-ByX85dGu.js";
|
|
2
|
+
import { r as b, a as j, b as I, c as M, d as R, e as v, f as _, g as B, h as C } from "./isTypedArray-SkhznY1k.js";
|
|
3
|
+
import { RETRY_HTTP_STATUS_CODES as z } from "./constants.js";
|
|
4
|
+
import { useBasePropsStore as c } from "./stores/BasePropsStore.js";
|
|
5
|
+
var d, y;
|
|
6
|
+
function H() {
|
|
7
|
+
if (y) return d;
|
|
8
|
+
y = 1;
|
|
9
|
+
var t = b();
|
|
10
|
+
function e(s, r, o) {
|
|
11
|
+
var n = s == null ? void 0 : t(s, r);
|
|
12
|
+
return n === void 0 ? o : n;
|
|
13
|
+
}
|
|
14
|
+
return d = e, d;
|
|
15
|
+
}
|
|
16
|
+
var O = H();
|
|
17
|
+
const U = /* @__PURE__ */ m(O);
|
|
18
|
+
var p, T;
|
|
19
|
+
function $() {
|
|
20
|
+
if (T) return p;
|
|
21
|
+
T = 1;
|
|
22
|
+
var t = j(), e = I(), s = M(), r = R(), o = v(), n = _(), i = C(), h = B(), k = "[object Map]", q = "[object Set]", S = Object.prototype, x = S.hasOwnProperty;
|
|
23
|
+
function A(a) {
|
|
24
|
+
if (a == null)
|
|
25
|
+
return !0;
|
|
26
|
+
if (o(a) && (r(a) || typeof a == "string" || typeof a.splice == "function" || n(a) || h(a) || s(a)))
|
|
27
|
+
return !a.length;
|
|
28
|
+
var g = e(a);
|
|
29
|
+
if (g == k || g == q)
|
|
30
|
+
return !a.size;
|
|
31
|
+
if (i(a))
|
|
32
|
+
return !t(a).length;
|
|
33
|
+
for (var P in a)
|
|
34
|
+
if (x.call(a, P))
|
|
35
|
+
return !1;
|
|
36
|
+
return !0;
|
|
37
|
+
}
|
|
38
|
+
return p = A, p;
|
|
39
|
+
}
|
|
40
|
+
var G = $();
|
|
41
|
+
const D = /* @__PURE__ */ m(G), Y = (t, e, s, r = "GET", o) => {
|
|
42
|
+
const n = new Headers();
|
|
43
|
+
return n.append("Content-Type", "application/json"), e && n.append("orgId", e), s && n.append("languageId", s), t && n.append("Authorization", `Bearer ${t}`), o && o.forEach((i, h) => {
|
|
44
|
+
n.set(h, i);
|
|
45
|
+
}), {
|
|
46
|
+
redirect: "follow",
|
|
47
|
+
credentials: "omit",
|
|
48
|
+
method: r,
|
|
49
|
+
headers: n
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
let u = "moduleTokenIsFresh";
|
|
53
|
+
const f = async (t, e, s = !0) => {
|
|
54
|
+
for (; u === "isModuleTokenRefreshing"; )
|
|
55
|
+
await l(100);
|
|
56
|
+
const r = c.getState().throwError;
|
|
57
|
+
if (u === "unableToRefreshModuleToken") throw r?.("Unauthorized", 401);
|
|
58
|
+
let o;
|
|
59
|
+
try {
|
|
60
|
+
const i = { ...e };
|
|
61
|
+
o = await fetch(t, i);
|
|
62
|
+
} catch {
|
|
63
|
+
if (s)
|
|
64
|
+
return await l(5e3), f(t, e, !1);
|
|
65
|
+
throw r?.("Network error", 500), new Error("Network error");
|
|
66
|
+
}
|
|
67
|
+
if (N(o, t, e), o?.ok)
|
|
68
|
+
return w(o);
|
|
69
|
+
if (u === "isModuleTokenRefreshing")
|
|
70
|
+
return await f(t, e, s);
|
|
71
|
+
if (o?.status === 401)
|
|
72
|
+
return await F(t, e);
|
|
73
|
+
const n = Object.values(z);
|
|
74
|
+
return s && n.includes(o?.status) ? (await l(5e3), f(t, e, !1)) : w(o);
|
|
75
|
+
}, F = async (t, e) => {
|
|
76
|
+
const s = c.getState().throwError, r = c.getState().refreshModulePermissionToken;
|
|
77
|
+
if (r == null || typeof r != "function")
|
|
78
|
+
throw s?.("refreshModulePermissionToken is not a function or was not found", 401);
|
|
79
|
+
u = "isModuleTokenRefreshing";
|
|
80
|
+
const o = await r();
|
|
81
|
+
if (o === void 0)
|
|
82
|
+
throw u = "unableToRefreshModuleToken", s?.("Unauthorized", 401);
|
|
83
|
+
const n = new Headers(e.headers);
|
|
84
|
+
n.set("Authorization", `Bearer ${o}`);
|
|
85
|
+
const i = {
|
|
86
|
+
...e,
|
|
87
|
+
headers: n
|
|
88
|
+
};
|
|
89
|
+
return u = "moduleTokenIsFresh", f(t, i);
|
|
90
|
+
}, E = async (t) => {
|
|
91
|
+
const e = await t.text();
|
|
92
|
+
let s;
|
|
93
|
+
try {
|
|
94
|
+
s = JSON.parse(e);
|
|
95
|
+
} catch {
|
|
96
|
+
s = {
|
|
97
|
+
value: e
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return s;
|
|
101
|
+
}, N = async (t, e, s) => {
|
|
102
|
+
const r = t.clone(), o = c.getState().logEvent, n = c.getState().logError;
|
|
103
|
+
try {
|
|
104
|
+
const i = {
|
|
105
|
+
requestUrl: e,
|
|
106
|
+
requestHeaders: { ...s.headers, Authorization: void 0 },
|
|
107
|
+
requestMethod: s.method,
|
|
108
|
+
requestBody: U(s, "body"),
|
|
109
|
+
responseStatus: r?.status.toString(),
|
|
110
|
+
responseStatusText: r?.statusText,
|
|
111
|
+
responseBody: await E(r)
|
|
112
|
+
};
|
|
113
|
+
t.ok && o ? o({
|
|
114
|
+
name: `request: ${r?.status.toString()} - ${e}`,
|
|
115
|
+
properties: i
|
|
116
|
+
}) : n?.({
|
|
117
|
+
exception: {
|
|
118
|
+
name: `request: ${r?.status.toString()} - ${e}`,
|
|
119
|
+
message: r?.statusText
|
|
120
|
+
},
|
|
121
|
+
properties: i
|
|
122
|
+
});
|
|
123
|
+
} catch {
|
|
124
|
+
console.error("Error while tracking event or exception in AppInsights");
|
|
125
|
+
}
|
|
126
|
+
}, w = async (t) => {
|
|
127
|
+
if (t.ok)
|
|
128
|
+
return E(t);
|
|
129
|
+
const e = {
|
|
130
|
+
detail: t.statusText,
|
|
131
|
+
status: t.status,
|
|
132
|
+
stack: void 0,
|
|
133
|
+
title: "BaseError"
|
|
134
|
+
}, s = c.getState().throwError;
|
|
135
|
+
try {
|
|
136
|
+
const r = await t.json();
|
|
137
|
+
D(r) || (e.title = r.title ?? "UnexpectedError", e.stack = r.message ?? r.title ?? t.statusText, e.detail = r.detail);
|
|
138
|
+
} catch {
|
|
139
|
+
e.detail = t.statusText;
|
|
140
|
+
}
|
|
141
|
+
throw s?.(e.detail, e.status);
|
|
142
|
+
}, l = (t) => new Promise((e) => setTimeout(e, t));
|
|
143
|
+
export {
|
|
144
|
+
Y as a,
|
|
145
|
+
f,
|
|
146
|
+
U as g,
|
|
147
|
+
w as h
|
|
148
|
+
};
|
|
@@ -8646,135 +8646,134 @@ function $o(e) {
|
|
|
8646
8646
|
}
|
|
8647
8647
|
var zs = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
8648
8648
|
export {
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8649
|
+
Su as $,
|
|
8650
|
+
Ys as A,
|
|
8651
|
+
Js as B,
|
|
8652
|
+
Hr as C,
|
|
8653
|
+
me as D,
|
|
8654
8654
|
Te as E,
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8655
|
+
lr as F,
|
|
8656
|
+
vs as G,
|
|
8657
|
+
Cr as H,
|
|
8658
|
+
qe as I,
|
|
8659
|
+
Yi as J,
|
|
8660
|
+
se as K,
|
|
8661
|
+
Fi as L,
|
|
8662
|
+
vu as M,
|
|
8663
|
+
Yl as N,
|
|
8664
8664
|
iu as O,
|
|
8665
|
-
|
|
8666
|
-
|
|
8665
|
+
su as P,
|
|
8666
|
+
Lu as Q,
|
|
8667
8667
|
lu as R,
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8668
|
+
Fu as S,
|
|
8669
|
+
Mo as T,
|
|
8670
|
+
Du as U,
|
|
8671
|
+
Qe as V,
|
|
8672
|
+
Ur as W,
|
|
8673
|
+
Wt as X,
|
|
8674
|
+
To as Y,
|
|
8675
|
+
Ru as Z,
|
|
8676
|
+
nu as _,
|
|
8677
8677
|
bl as a,
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
dn as z
|
|
8678
|
+
Zr as a$,
|
|
8679
|
+
ks as a0,
|
|
8680
|
+
ou as a1,
|
|
8681
|
+
ai as a2,
|
|
8682
|
+
Co as a3,
|
|
8683
|
+
rt as a4,
|
|
8684
|
+
Cs as a5,
|
|
8685
|
+
Ns as a6,
|
|
8686
|
+
_u as a7,
|
|
8687
|
+
Ks as a8,
|
|
8688
|
+
Ie as a9,
|
|
8689
|
+
Qt as aA,
|
|
8690
|
+
uu as aB,
|
|
8691
|
+
Or as aC,
|
|
8692
|
+
$u as aD,
|
|
8693
|
+
Ci as aE,
|
|
8694
|
+
Ws as aF,
|
|
8695
|
+
Pt as aG,
|
|
8696
|
+
ve as aH,
|
|
8697
|
+
cu as aI,
|
|
8698
|
+
Ei as aJ,
|
|
8699
|
+
Ms as aK,
|
|
8700
|
+
Nu as aL,
|
|
8701
|
+
tu as aM,
|
|
8702
|
+
ea as aN,
|
|
8703
|
+
eu as aO,
|
|
8704
|
+
dl as aP,
|
|
8705
|
+
ku as aQ,
|
|
8706
|
+
hl as aR,
|
|
8707
|
+
Tu as aS,
|
|
8708
|
+
Mu as aT,
|
|
8709
|
+
Is as aU,
|
|
8710
|
+
el as aV,
|
|
8711
|
+
tt as aW,
|
|
8712
|
+
_s as aX,
|
|
8713
|
+
qr as aY,
|
|
8714
|
+
ye as aZ,
|
|
8715
|
+
Xs as a_,
|
|
8716
|
+
We as aa,
|
|
8717
|
+
ar as ab,
|
|
8718
|
+
ht as ac,
|
|
8719
|
+
pe as ad,
|
|
8720
|
+
Se as ae,
|
|
8721
|
+
rr as af,
|
|
8722
|
+
du as ag,
|
|
8723
|
+
pu as ah,
|
|
8724
|
+
hu as ai,
|
|
8725
|
+
dn as aj,
|
|
8726
|
+
fa as ak,
|
|
8727
|
+
wu as al,
|
|
8728
|
+
fn as am,
|
|
8729
|
+
cn as an,
|
|
8730
|
+
zr as ao,
|
|
8731
|
+
bu as ap,
|
|
8732
|
+
gu as aq,
|
|
8733
|
+
ra as ar,
|
|
8734
|
+
A as as,
|
|
8735
|
+
Tt as at,
|
|
8736
|
+
Eu as au,
|
|
8737
|
+
As as av,
|
|
8738
|
+
xu as aw,
|
|
8739
|
+
Bs as ax,
|
|
8740
|
+
Cu as ay,
|
|
8741
|
+
he as az,
|
|
8742
|
+
Iu as b,
|
|
8743
|
+
cl as b0,
|
|
8744
|
+
Gs as b1,
|
|
8745
|
+
rl as b2,
|
|
8746
|
+
Qs as b3,
|
|
8747
|
+
Gr as b4,
|
|
8748
|
+
Ot as b5,
|
|
8749
|
+
Zs as b6,
|
|
8750
|
+
qs as b7,
|
|
8751
|
+
al as b8,
|
|
8752
|
+
Ou as b9,
|
|
8753
|
+
No as ba,
|
|
8754
|
+
Hs as bb,
|
|
8755
|
+
cs as c,
|
|
8756
|
+
Pu as d,
|
|
8757
|
+
Jl as e,
|
|
8758
|
+
lt as f,
|
|
8759
|
+
et as g,
|
|
8760
|
+
ru as h,
|
|
8761
|
+
au as i,
|
|
8762
|
+
Kn as j,
|
|
8763
|
+
Wl as k,
|
|
8764
|
+
Zi as l,
|
|
8765
|
+
Ce as m,
|
|
8766
|
+
qi as n,
|
|
8767
|
+
Ct as o,
|
|
8768
|
+
xe as p,
|
|
8769
|
+
_i as q,
|
|
8770
|
+
Vs as r,
|
|
8771
|
+
hs as s,
|
|
8772
|
+
yu as t,
|
|
8773
|
+
ta as u,
|
|
8774
|
+
mu as v,
|
|
8775
|
+
Dr as w,
|
|
8776
|
+
fu as x,
|
|
8777
|
+
ts as y,
|
|
8778
|
+
_r as z
|
|
8780
8779
|
};
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
t && e && t.startsWith(e) && n(t, { replace: !0 });
|
|
11
|
-
}, [t, e, n]);
|
|
12
|
-
}, g = () => (v(), /* @__PURE__ */ a(c, {})), B = ({
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { R as m, a as i } from "../chunk-EVOBXE3Y-BRmUxtwH.js";
|
|
3
|
+
import { SignalRProvider as d } from "../provider/SignalR/SignalRProvider.js";
|
|
4
|
+
import { M as h } from "../defaultQueryClient-Cfsorhtn.js";
|
|
5
|
+
import { ModuleCore as o } from "./ModuleCore.js";
|
|
6
|
+
const a = (t) => t.map((e, l) => {
|
|
7
|
+
const r = e.id ?? e.path ?? `route-${l}`;
|
|
8
|
+
return e.index ? /* @__PURE__ */ n(i, { index: !0, element: e.element }, r) : e.children ? /* @__PURE__ */ n(i, { path: e.path, element: e.element, children: a(e.children) }, r) : /* @__PURE__ */ n(i, { path: e.path, element: e.element }, r);
|
|
9
|
+
}), M = ({
|
|
13
10
|
props: t,
|
|
14
11
|
routes: e,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}) => /* @__PURE__ */ a(d, { props: t, env: n, queryClient: l, children: /* @__PURE__ */ a(u, { enabled: r, children: /* @__PURE__ */ a(p, { children: /* @__PURE__ */ a(i, { path: t.basePath, element: /* @__PURE__ */ a(g, {}), children: s(e) }) }) }) });
|
|
12
|
+
useSignalR: l = !1,
|
|
13
|
+
queryClient: r = h
|
|
14
|
+
}) => /* @__PURE__ */ n(o, { props: t, queryClient: r, children: /* @__PURE__ */ n(d, { enabled: l, children: /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(i, { path: t.basePath, children: a(e) }) }) }) });
|
|
19
15
|
export {
|
|
20
|
-
|
|
16
|
+
M as ModuleBase
|
|
21
17
|
};
|