@hortiview/modulebase 0.0.16348 → 0.0.20436
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/ModuleCore-DpwHP0IU.js +14973 -0
- package/dist/{QueryClientProvider-VtJdNkDw.js → QueryClientProvider-Beog9TR7.js} +25 -23
- package/dist/{_baseGet-B7FwMMGI.js → _baseGet-C6jMXSsQ.js} +447 -447
- package/dist/api-CogBuK0n.js +473 -0
- package/dist/components/ModuleBase.js +1 -1
- package/dist/components/ModuleCore.js +9 -14698
- package/dist/constants.js +1 -1
- package/dist/enum/ActionStorage.js +4 -0
- package/dist/hooks/useCustom.js +15 -18
- package/dist/hooks/useCustomMutation.js +12 -11
- package/dist/hooks/useEntity.js +48 -60
- package/dist/hooks/useOffline.js +57 -0
- package/dist/hooks/useOption.js +20 -20
- package/dist/hooks/useServiceBus.js +1 -1
- package/dist/hooks/useStores.js +1 -1
- package/dist/{query-CFoO2uy7.js → isRestoring-CLuxJVSA.js} +21 -17
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/enum/ActionStorage.d.ts +7 -0
- package/dist/lib/hooks/useCustom.d.ts +3 -2
- package/dist/lib/hooks/useCustomMutation.d.ts +2 -1
- package/dist/lib/hooks/useEntity.d.ts +9 -23
- package/dist/lib/hooks/useOffline.d.ts +15 -0
- package/dist/lib/hooks/useStores.d.ts +10 -2
- package/dist/lib/main.d.ts +4 -0
- package/dist/lib/types/ActionStorage.d.ts +8 -0
- package/dist/lib/types/BaseProps.d.ts +10 -1
- package/dist/lib/types/Deprecated.d.ts +4 -0
- package/dist/lib/types/Entities.d.ts +22 -0
- package/dist/lib/utils/IndexedDbService.d.ts +33 -0
- package/dist/lib/utils/api.d.ts +1 -1
- package/dist/lib/utils/baseFetches.d.ts +2 -2
- package/dist/lib/utils/fetches.d.ts +2 -2
- package/dist/lib/utils/helper.d.ts +1 -0
- package/dist/main.js +218 -144
- package/dist/{mutation-CnKIetRs.js → mutation-DSKlaYzY.js} +1 -1
- package/dist/{omit-B7MWDtHq.js → omit-C9Qe80rl.js} +1 -1
- package/dist/types/ActionStorage.js +1 -0
- package/dist/types/Entities.js +25 -0
- package/dist/{useMutation-Num57Ulc.js → useMutation-zu8uxBak.js} +16 -16
- package/dist/{useQuery-XBGd5Kep.js → useQuery-Bj9k9zik.js} +39 -39
- package/dist/utils/IndexedDbService.js +43 -0
- package/dist/utils/api.js +1 -1
- package/dist/utils/baseFetches.js +15 -15
- package/dist/utils/fetches.js +10 -10
- package/dist/utils/helper.js +25 -20
- package/package.json +7 -3
- package/dist/api-D9Lmqe6S.js +0 -458
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { S as
|
|
2
|
-
import { f as $ } from "./
|
|
3
|
-
import * as
|
|
1
|
+
import { S as B, p as U, b as f, s as w, g as O, a as N, j as Q, k, t as H, l as V, r as M, n as A, u as z } from "./QueryClientProvider-Beog9TR7.js";
|
|
2
|
+
import { f as W, u as $ } from "./isRestoring-CLuxJVSA.js";
|
|
3
|
+
import * as y from "react";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import { s as K, n as _ } from "./utils-DxRR_XLb.js";
|
|
6
|
-
var G = class extends
|
|
6
|
+
var G = class extends B {
|
|
7
7
|
constructor(e, t) {
|
|
8
8
|
super(), this.options = t, this.#s = e, this.#r = null, this.#i = U(), this.options.experimental_prefetchInRender || this.#i.reject(
|
|
9
9
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
@@ -117,7 +117,7 @@ var G = class extends N {
|
|
|
117
117
|
this.options,
|
|
118
118
|
e
|
|
119
119
|
);
|
|
120
|
-
return e?.throwOnError || (t = t.catch(
|
|
120
|
+
return e?.throwOnError || (t = t.catch(N)), t;
|
|
121
121
|
}
|
|
122
122
|
#b() {
|
|
123
123
|
this.#v();
|
|
@@ -127,7 +127,7 @@ var G = class extends N {
|
|
|
127
127
|
);
|
|
128
128
|
if (Q || this.#t.isStale || !k(e))
|
|
129
129
|
return;
|
|
130
|
-
const s =
|
|
130
|
+
const s = H(this.#t.dataUpdatedAt, e) + 1;
|
|
131
131
|
this.#o = setTimeout(() => {
|
|
132
132
|
this.#t.isStale || this.updateResult();
|
|
133
133
|
}, s);
|
|
@@ -137,7 +137,7 @@ var G = class extends N {
|
|
|
137
137
|
}
|
|
138
138
|
#g(e) {
|
|
139
139
|
this.#O(), this.#n = e, !(Q || f(this.options.enabled, this.#e) === !1 || !k(this.#n) || this.#n === 0) && (this.#h = setInterval(() => {
|
|
140
|
-
(this.options.refetchIntervalInBackground ||
|
|
140
|
+
(this.options.refetchIntervalInBackground || V.isFocused()) && this.#u();
|
|
141
141
|
}, this.#n));
|
|
142
142
|
}
|
|
143
143
|
#R() {
|
|
@@ -156,10 +156,10 @@ var G = class extends N {
|
|
|
156
156
|
const h = this.hasListeners(), b = !h && j(e, t), m = h && L(e, s, t, r);
|
|
157
157
|
(b || m) && (n = {
|
|
158
158
|
...n,
|
|
159
|
-
|
|
159
|
+
...W(c.data, e.options)
|
|
160
160
|
}), t._optimisticResults === "isRestoring" && (n.fetchStatus = "idle");
|
|
161
161
|
}
|
|
162
|
-
let { error:
|
|
162
|
+
let { error: F, errorUpdatedAt: x, status: p } = n;
|
|
163
163
|
if (t.select && n.data !== void 0)
|
|
164
164
|
if (a && n.data === u?.data && t.select === this.#y)
|
|
165
165
|
l = this.#l;
|
|
@@ -171,7 +171,7 @@ var G = class extends N {
|
|
|
171
171
|
}
|
|
172
172
|
else
|
|
173
173
|
l = n.data;
|
|
174
|
-
if (t.placeholderData !== void 0 && l === void 0 &&
|
|
174
|
+
if (t.placeholderData !== void 0 && l === void 0 && p === "pending") {
|
|
175
175
|
let h;
|
|
176
176
|
if (a?.isPlaceholderData && t.placeholderData === i?.placeholderData)
|
|
177
177
|
h = a.data;
|
|
@@ -184,25 +184,25 @@ var G = class extends N {
|
|
|
184
184
|
} catch (b) {
|
|
185
185
|
this.#r = b;
|
|
186
186
|
}
|
|
187
|
-
h !== void 0 && (
|
|
187
|
+
h !== void 0 && (p = "success", l = M(
|
|
188
188
|
a?.data,
|
|
189
189
|
h,
|
|
190
190
|
t
|
|
191
191
|
), R = !0);
|
|
192
192
|
}
|
|
193
|
-
this.#r && (
|
|
194
|
-
const C = n.fetchStatus === "fetching", S =
|
|
195
|
-
status:
|
|
193
|
+
this.#r && (F = this.#r, l = this.#l, x = Date.now(), p = "error");
|
|
194
|
+
const C = n.fetchStatus === "fetching", S = p === "pending", E = p === "error", D = S && C, P = l !== void 0, d = {
|
|
195
|
+
status: p,
|
|
196
196
|
fetchStatus: n.fetchStatus,
|
|
197
197
|
isPending: S,
|
|
198
|
-
isSuccess:
|
|
198
|
+
isSuccess: p === "success",
|
|
199
199
|
isError: E,
|
|
200
200
|
isInitialLoading: D,
|
|
201
201
|
isLoading: D,
|
|
202
202
|
data: l,
|
|
203
203
|
dataUpdatedAt: n.dataUpdatedAt,
|
|
204
|
-
error:
|
|
205
|
-
errorUpdatedAt:
|
|
204
|
+
error: F,
|
|
205
|
+
errorUpdatedAt: x,
|
|
206
206
|
failureCount: n.fetchFailureCount,
|
|
207
207
|
failureReason: n.fetchFailureReason,
|
|
208
208
|
errorUpdateCount: n.errorUpdateCount,
|
|
@@ -303,9 +303,7 @@ function I(e, t) {
|
|
|
303
303
|
function X(e, t) {
|
|
304
304
|
return !w(e.getCurrentResult(), t);
|
|
305
305
|
}
|
|
306
|
-
|
|
307
|
-
B.Provider;
|
|
308
|
-
function Z() {
|
|
306
|
+
function Y() {
|
|
309
307
|
let e = !1;
|
|
310
308
|
return {
|
|
311
309
|
clearReset: () => {
|
|
@@ -317,43 +315,43 @@ function Z() {
|
|
|
317
315
|
isReset: () => e
|
|
318
316
|
};
|
|
319
317
|
}
|
|
320
|
-
var
|
|
318
|
+
var Z = y.createContext(Y()), ee = () => y.useContext(Z), te = (e, t) => {
|
|
321
319
|
(e.suspense || e.throwOnError || e.experimental_prefetchInRender) && (t.isReset() || (e.retryOnMount = !1));
|
|
322
|
-
},
|
|
323
|
-
|
|
320
|
+
}, se = (e) => {
|
|
321
|
+
y.useEffect(() => {
|
|
324
322
|
e.clearReset();
|
|
325
323
|
}, [e]);
|
|
326
|
-
},
|
|
324
|
+
}, re = ({
|
|
327
325
|
result: e,
|
|
328
326
|
errorResetBoundary: t,
|
|
329
327
|
throwOnError: s,
|
|
330
328
|
query: r,
|
|
331
329
|
suspense: a
|
|
332
|
-
}) => e.isError && !t.isReset() && !e.isFetching && r && (a && e.data === void 0 || K(s, [e.error, r])),
|
|
330
|
+
}) => e.isError && !t.isReset() && !e.isFetching && r && (a && e.data === void 0 || K(s, [e.error, r])), ie = (e) => {
|
|
333
331
|
const t = e.staleTime;
|
|
334
332
|
e.suspense && (e.staleTime = typeof t == "function" ? (...s) => Math.max(t(...s), 1e3) : Math.max(t ?? 1e3, 1e3), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, 1e3)));
|
|
335
|
-
},
|
|
333
|
+
}, ne = (e, t) => e.isLoading && e.isFetching && !t, ae = (e, t) => e?.suspense && t.isPending, q = (e, t, s) => t.fetchOptimistic(e).catch(() => {
|
|
336
334
|
s.clearReset();
|
|
337
335
|
});
|
|
338
|
-
function
|
|
336
|
+
function oe(e, t, s) {
|
|
339
337
|
if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
|
|
340
338
|
throw new Error(
|
|
341
339
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
342
340
|
);
|
|
343
|
-
const r =
|
|
341
|
+
const r = z(s), a = $(), u = ee(), i = r.defaultQueryOptions(e);
|
|
344
342
|
r.getDefaultOptions().queries?._experimental_beforeQuery?.(
|
|
345
343
|
i
|
|
346
344
|
), process.env.NODE_ENV !== "production" && (i.queryFn || console.error(
|
|
347
345
|
`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
348
|
-
)), i._optimisticResults = a ? "isRestoring" : "optimistic",
|
|
349
|
-
const g = !r.getQueryCache().get(i.queryHash), [o] =
|
|
346
|
+
)), i._optimisticResults = a ? "isRestoring" : "optimistic", ie(i), te(i, u), se(u);
|
|
347
|
+
const g = !r.getQueryCache().get(i.queryHash), [o] = y.useState(
|
|
350
348
|
() => new t(
|
|
351
349
|
r,
|
|
352
350
|
i
|
|
353
351
|
)
|
|
354
352
|
), c = o.getOptimisticResult(i), n = !a && e.subscribed !== !1;
|
|
355
|
-
if (
|
|
356
|
-
|
|
353
|
+
if (y.useSyncExternalStore(
|
|
354
|
+
y.useCallback(
|
|
357
355
|
(R) => {
|
|
358
356
|
const l = n ? o.subscribe(A.batchCalls(R)) : _;
|
|
359
357
|
return o.updateResult(), l;
|
|
@@ -362,11 +360,11 @@ function he(e, t, s) {
|
|
|
362
360
|
),
|
|
363
361
|
() => o.getCurrentResult(),
|
|
364
362
|
() => o.getCurrentResult()
|
|
365
|
-
),
|
|
363
|
+
), y.useEffect(() => {
|
|
366
364
|
o.setOptions(i, { listeners: !1 });
|
|
367
|
-
}, [i, o]),
|
|
365
|
+
}, [i, o]), ae(i, c))
|
|
368
366
|
throw q(i, o, u);
|
|
369
|
-
if (
|
|
367
|
+
if (re({
|
|
370
368
|
result: c,
|
|
371
369
|
errorResetBoundary: u,
|
|
372
370
|
throwOnError: i.throwOnError,
|
|
@@ -377,7 +375,7 @@ function he(e, t, s) {
|
|
|
377
375
|
return r.getDefaultOptions().queries?._experimental_afterQuery?.(
|
|
378
376
|
i,
|
|
379
377
|
c
|
|
380
|
-
), i.experimental_prefetchInRender && !Q &&
|
|
378
|
+
), i.experimental_prefetchInRender && !Q && ne(c, a) && (g ? (
|
|
381
379
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
382
380
|
q(i, o, u)
|
|
383
381
|
) : (
|
|
@@ -387,9 +385,11 @@ function he(e, t, s) {
|
|
|
387
385
|
o.updateResult();
|
|
388
386
|
}), i.notifyOnChangeProps ? c : o.trackResult(c);
|
|
389
387
|
}
|
|
390
|
-
function
|
|
391
|
-
return
|
|
388
|
+
function fe(e, t) {
|
|
389
|
+
return oe(e, G, t);
|
|
392
390
|
}
|
|
393
391
|
export {
|
|
394
|
-
|
|
392
|
+
G as Q,
|
|
393
|
+
oe as a,
|
|
394
|
+
fe as u
|
|
395
395
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function a(e) {
|
|
2
|
+
return new Promise((n, t) => {
|
|
3
|
+
e.oncomplete = e.onsuccess = () => n(e.result), e.onabort = e.onerror = () => t(e.error);
|
|
4
|
+
});
|
|
5
|
+
}
|
|
6
|
+
function s(e, n) {
|
|
7
|
+
let t;
|
|
8
|
+
const o = () => {
|
|
9
|
+
if (t)
|
|
10
|
+
return t;
|
|
11
|
+
const r = indexedDB.open(e);
|
|
12
|
+
return r.onupgradeneeded = () => r.result.createObjectStore(n), t = a(r), t.then((c) => {
|
|
13
|
+
c.onclose = () => t = void 0;
|
|
14
|
+
}, () => {
|
|
15
|
+
}), t;
|
|
16
|
+
};
|
|
17
|
+
return (r, c) => o().then((d) => c(d.transaction(n, r).objectStore(n)));
|
|
18
|
+
}
|
|
19
|
+
let u;
|
|
20
|
+
function i() {
|
|
21
|
+
return u || (u = s("keyval-store", "keyval")), u;
|
|
22
|
+
}
|
|
23
|
+
function l(e, n = i()) {
|
|
24
|
+
return n("readonly", (t) => a(t.get(e)));
|
|
25
|
+
}
|
|
26
|
+
function f(e, n, t = i()) {
|
|
27
|
+
return t("readwrite", (o) => (o.put(n, e), a(o.transaction)));
|
|
28
|
+
}
|
|
29
|
+
function p(e, n = i()) {
|
|
30
|
+
return n("readwrite", (t) => (t.delete(e), a(t.transaction)));
|
|
31
|
+
}
|
|
32
|
+
const y = {
|
|
33
|
+
getItem: async (e) => await l(e),
|
|
34
|
+
setItem: async (e, n) => {
|
|
35
|
+
await f(e, n);
|
|
36
|
+
},
|
|
37
|
+
removeItem: async (e) => {
|
|
38
|
+
await p(e);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
y as indexedDbStorage
|
|
43
|
+
};
|
package/dist/utils/api.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as u, f as m, i as S, b as I } from "../api-CogBuK0n.js";
|
|
2
2
|
import { useBasePropsStore as t } from "../stores/BasePropsStore.js";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
if (!
|
|
6
|
-
return
|
|
7
|
-
const
|
|
8
|
-
return
|
|
9
|
-
},
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
12
|
-
return
|
|
13
|
-
const
|
|
14
|
-
return
|
|
3
|
+
const E = (s, e, g, o, r, n = !1) => {
|
|
4
|
+
const a = n ? void 0 : o ?? t.getState().modulePermissionToken, i = t.getState().organizationId, c = t.getState().currentLanguageId, d = t.getState().throwError;
|
|
5
|
+
if (!n && !a)
|
|
6
|
+
return d?.("No token found", 404), Promise.reject();
|
|
7
|
+
const f = u(a, i, c, g, r);
|
|
8
|
+
return f.body = JSON.stringify(e), m(s, f);
|
|
9
|
+
}, h = (s, e, g, o = !1) => {
|
|
10
|
+
const r = o ? void 0 : g ?? t.getState().modulePermissionToken, n = t.getState().organizationId, a = t.getState().currentLanguageId, i = t.getState().throwError;
|
|
11
|
+
if (!o && !r)
|
|
12
|
+
return i?.("No token found", 404), Promise.reject();
|
|
13
|
+
const c = u(r, n, a), d = S(e) ? "" : I(e);
|
|
14
|
+
return m(`${s}${d}`, c);
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
h as baseFetch,
|
|
18
|
+
E as baseMutation
|
|
19
19
|
};
|
package/dist/utils/fetches.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { useBasePropsStore as
|
|
1
|
+
import { useBasePropsStore as a } from "../stores/BasePropsStore.js";
|
|
2
2
|
import { useEnvironmentStore as i } from "../stores/EnvironmentStore.js";
|
|
3
3
|
import { baseMutation as d, baseFetch as o } from "./baseFetches.js";
|
|
4
|
-
const
|
|
5
|
-
const t = i.getState().environment, n =
|
|
4
|
+
const I = (e, t, n = "POST", s, m, u = !1) => d(e, t, n, s, m, u), g = (e, t) => r(`FarmOrgEntities/${e}/byId/${t}`), E = (e, t) => r(`ModuleDependentEntities/${e}/byId/${t}`), A = (e, t) => r(`ModuleDependentEntitiesRaw/${e}/byId/${t}`), M = (e, t, n = !1) => o(`${e}`, {}, t, n), r = (e) => {
|
|
5
|
+
const t = i.getState().environment, n = a.getState().organizationId;
|
|
6
6
|
return o(
|
|
7
7
|
`${t?.MODULE_AUTH_API}${t?.API_PREFIX}/${n}/${e}`,
|
|
8
8
|
{}
|
|
9
9
|
);
|
|
10
|
-
},
|
|
10
|
+
}, f = (e) => {
|
|
11
11
|
const t = i.getState().environment;
|
|
12
12
|
return o(`${t?.COMMON_API}${t?.API_PREFIX}/${e}`, {});
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
f as fetchFromCommonApi,
|
|
16
|
+
M as fetchFromCustomApi,
|
|
17
17
|
r as fetchFromModuleApi,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
g as getFarmOrgEntities,
|
|
19
|
+
E as getModuleDependedEntities,
|
|
20
|
+
A as getModuleDependedEntitiesRaw,
|
|
21
|
+
I as mutateOnCustomApi
|
|
22
22
|
};
|
package/dist/utils/helper.js
CHANGED
|
@@ -1,50 +1,55 @@
|
|
|
1
|
-
import { REQUIRED_PROPS as
|
|
2
|
-
|
|
1
|
+
import { REQUIRED_PROPS as m } from "../constants.js";
|
|
2
|
+
import { useBasePropsStore as u } from "../stores/BasePropsStore.js";
|
|
3
|
+
const g = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, c = (r) => {
|
|
3
4
|
if (typeof r != "string")
|
|
4
5
|
throw new TypeError("Invalid argument expected string");
|
|
5
|
-
const e = r.match(
|
|
6
|
+
const e = r.match(g);
|
|
6
7
|
if (!e)
|
|
7
8
|
throw new Error(`Invalid argument not valid semver ('${r}' received)`);
|
|
8
9
|
return e.shift(), e;
|
|
9
|
-
},
|
|
10
|
+
}, f = (r) => r === "*" || r === "x" || r === "X", l = (r) => {
|
|
10
11
|
const e = parseInt(r, 10);
|
|
11
12
|
return isNaN(e) ? r : e;
|
|
12
|
-
},
|
|
13
|
-
if (
|
|
13
|
+
}, h = (r, e) => typeof r != typeof e ? [String(r), String(e)] : [r, e], E = (r, e) => {
|
|
14
|
+
if (f(r) || f(e))
|
|
14
15
|
return 0;
|
|
15
|
-
const [n, t] =
|
|
16
|
+
const [n, t] = h(l(r), l(e));
|
|
16
17
|
return n > t ? 1 : n < t ? -1 : 0;
|
|
17
|
-
},
|
|
18
|
+
}, p = (r, e) => {
|
|
18
19
|
for (let n = 0; n < Math.max(r.length, e.length); n++) {
|
|
19
20
|
const t = E(r[n] || "0", e[n] || "0");
|
|
20
21
|
if (t !== 0)
|
|
21
22
|
return t;
|
|
22
23
|
}
|
|
23
24
|
return 0;
|
|
24
|
-
},
|
|
25
|
-
const n =
|
|
26
|
-
return s !== 0 ? s :
|
|
27
|
-
},
|
|
25
|
+
}, y = (r, e) => {
|
|
26
|
+
const n = c(r), t = c(e), o = n.pop(), i = t.pop(), s = p(n, t);
|
|
27
|
+
return s !== 0 ? s : o && i ? p(o.split("."), i.split(".")) : o || i ? o ? -1 : 1 : 0;
|
|
28
|
+
}, d = "0.0.20436", w = (r) => m.every((e) => a(e, r)), a = (r, e) => {
|
|
28
29
|
if (!e[r]) {
|
|
29
30
|
if (e.throwError)
|
|
30
31
|
return e.throwError(`Missing required prop: ${r}`, 404), !1;
|
|
31
32
|
throw new Error(`Missing required prop: ${r}`);
|
|
32
33
|
}
|
|
33
34
|
return !0;
|
|
34
|
-
},
|
|
35
|
+
}, P = () => {
|
|
35
36
|
const r = window.__env__;
|
|
36
37
|
if (r && r.COMMON_API && r.MODULE_AUTH_API && r.API_PREFIX && r.ENVIRONMENT)
|
|
37
38
|
return r;
|
|
38
|
-
},
|
|
39
|
+
}, S = (r) => {
|
|
39
40
|
if (!r?.REQ_VERSION) return null;
|
|
40
41
|
const e = r.REQ_VERSION;
|
|
41
|
-
return
|
|
42
|
-
}, _ = (r) => typeof r == "string" || typeof r == "boolean" || typeof r == "number" ? r : typeof r == "object" && "value" in r ? r.value : typeof r == "object" && "items" in r ? r.items : (Array.isArray(r), r),
|
|
42
|
+
return y(d, e) < 0 ? `ModuleBase version ${d} is probably not compatible with the current HortiView version ${e}. Please update the modulebase to be at least ${e}` : null;
|
|
43
|
+
}, _ = (r) => typeof r == "string" || typeof r == "boolean" || typeof r == "number" ? r : typeof r == "object" && "value" in r ? r.value : typeof r == "object" && "items" in r ? r.items : (Array.isArray(r), r), M = (r) => r, R = (r) => {
|
|
44
|
+
const e = u.getState().organizationId, n = u.getState().moduleId;
|
|
45
|
+
return [...r, e, n];
|
|
46
|
+
};
|
|
43
47
|
export {
|
|
44
48
|
w as arePropsValid,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
M as checkConfig,
|
|
50
|
+
a as checkIfPropExists,
|
|
51
|
+
S as checkVersion,
|
|
52
|
+
P as getEnvironmentVariables,
|
|
53
|
+
R as getModuleQueryKey,
|
|
49
54
|
_ as universalSelector
|
|
50
55
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hortiview/modulebase",
|
|
3
3
|
"description": "This is a base module for hortiview",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.20436",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Falk Menge <falk.menge.ext@bayer.com>",
|
|
7
7
|
"contributors": [
|
|
@@ -20,13 +20,16 @@
|
|
|
20
20
|
"dev": "vite",
|
|
21
21
|
"build": "tsc -b && vite build",
|
|
22
22
|
"lint": "eslint .",
|
|
23
|
-
"preview": "vite preview"
|
|
23
|
+
"preview": "vite preview",
|
|
24
|
+
"tsCheck": "tsc --build --pretty --watch"
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"@hortiview/default-components": "^1.2.1",
|
|
27
28
|
"@hortiview/shared-components": "^2.0.0",
|
|
28
29
|
"@microsoft/signalr": "^8.0.7",
|
|
30
|
+
"@tanstack/query-async-storage-persister": "^5.85.5",
|
|
29
31
|
"@tanstack/react-query": "^5.67.3",
|
|
32
|
+
"@tanstack/react-query-persist-client": "^5.85.5",
|
|
30
33
|
"compare-versions": "^6.1.1",
|
|
31
34
|
"lodash": "^4.17.21",
|
|
32
35
|
"odata-query": "^7.0.9",
|
|
@@ -37,7 +40,8 @@
|
|
|
37
40
|
"socket.io-client": "^4.8.1",
|
|
38
41
|
"vite-plugin-dts": "^4.5.0",
|
|
39
42
|
"vite-plugin-lib-inject-css": "^2.2.1",
|
|
40
|
-
"zustand": "^5.0.3"
|
|
43
|
+
"zustand": "^5.0.3",
|
|
44
|
+
"idb-keyval": "^6.2.2"
|
|
41
45
|
},
|
|
42
46
|
"devDependencies": {
|
|
43
47
|
"@eslint/js": "^9.17.0",
|