@hortiview/modulebase 0.0.1-7.1-beta
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/README.md +8 -0
- package/dist/ModuleCore-YCIFN_02.js +14973 -0
- package/dist/QueryClientProvider-Beog9TR7.js +437 -0
- package/dist/_baseGet-C6jMXSsQ.js +805 -0
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/api-s6E2GJtu.js +458 -0
- package/dist/assets/ModuleCore.css +1 -0
- package/dist/chunk-IR6S3I6Y-BmDdD3SP.js +8162 -0
- package/dist/components/ModuleBase.js +30 -0
- package/dist/components/ModuleCore.js +10 -0
- package/dist/constants.js +34 -0
- package/dist/hooks/useBreadcrumbTranslation.js +23 -0
- package/dist/hooks/useCustom.js +19 -0
- package/dist/hooks/useCustomMutation.js +23 -0
- package/dist/hooks/useEntity.js +57 -0
- package/dist/hooks/useOffline.js +45 -0
- package/dist/hooks/useOption.js +25 -0
- package/dist/hooks/useServiceBus.js +25 -0
- package/dist/hooks/useSignalRMessages.js +13 -0
- package/dist/hooks/useStores.js +14 -0
- package/dist/isRestoring-CLuxJVSA.js +281 -0
- package/dist/lib/components/ModuleBase.d.ts +36 -0
- package/dist/lib/components/ModuleCore.d.ts +32 -0
- package/dist/lib/constants.d.ts +25 -0
- package/dist/lib/hooks/useBreadcrumbTranslation.d.ts +1 -0
- package/dist/lib/hooks/useCustom.d.ts +8 -0
- package/dist/lib/hooks/useCustomMutation.d.ts +9 -0
- package/dist/lib/hooks/useEntity.d.ts +162 -0
- package/dist/lib/hooks/useOffline.d.ts +15 -0
- package/dist/lib/hooks/useOption.d.ts +17 -0
- package/dist/lib/hooks/useServiceBus.d.ts +19 -0
- package/dist/lib/hooks/useSignalRMessages.d.ts +6 -0
- package/dist/lib/hooks/useStores.d.ts +37 -0
- package/dist/lib/main.d.ts +27 -0
- package/dist/lib/module-router.d.ts +7 -0
- package/dist/lib/provider/SignalR/SignalRProvider.d.ts +13 -0
- package/dist/lib/provider/SignalR/signalR.d.ts +53 -0
- package/dist/lib/stores/BasePropsStore.d.ts +6 -0
- package/dist/lib/stores/EnvironmentStore.d.ts +8 -0
- package/dist/lib/types/ActionStorage.d.ts +12 -0
- package/dist/lib/types/AppInsights.d.ts +12 -0
- package/dist/lib/types/BaseProps.d.ts +49 -0
- package/dist/lib/types/CommonOptions.d.ts +61 -0
- package/dist/lib/types/Deprecated.d.ts +99 -0
- package/dist/lib/types/Entities.d.ts +22 -0
- package/dist/lib/types/Environment.d.ts +18 -0
- package/dist/lib/types/EnvironmentVariable.d.ts +6 -0
- package/dist/lib/types/ModuleApi.d.ts +163 -0
- package/dist/lib/types/Requests.d.ts +44 -0
- package/dist/lib/types/ServiceBus.d.ts +17 -0
- package/dist/lib/types/SystemMessage.d.ts +14 -0
- package/dist/lib/utils/api.d.ts +20 -0
- package/dist/lib/utils/baseFetches.d.ts +19 -0
- package/dist/lib/utils/fetches.d.ts +43 -0
- package/dist/lib/utils/helper.d.ts +29 -0
- package/dist/main.js +218 -0
- package/dist/module-router.js +129 -0
- package/dist/mutation-DSKlaYzY.js +192 -0
- package/dist/omit-C9Qe80rl.js +835 -0
- package/dist/provider/SignalR/SignalRProvider.js +6408 -0
- package/dist/provider/SignalR/signalR.js +11 -0
- package/dist/react-QiIgv49H.js +27 -0
- package/dist/stores/BasePropsStore.js +7 -0
- package/dist/stores/EnvironmentStore.js +15 -0
- package/dist/types/ActionStorage.js +4 -0
- package/dist/types/AppInsights.js +1 -0
- package/dist/types/BaseProps.js +1 -0
- package/dist/types/CommonOptions.js +4 -0
- package/dist/types/Deprecated.js +1 -0
- package/dist/types/Entities.js +25 -0
- package/dist/types/Environment.js +1 -0
- package/dist/types/EnvironmentVariable.js +1 -0
- package/dist/types/ModuleApi.js +1 -0
- package/dist/types/Requests.js +1 -0
- package/dist/types/ServiceBus.js +1 -0
- package/dist/types/SystemMessage.js +1 -0
- package/dist/useMutation-zu8uxBak.js +97 -0
- package/dist/useQuery-Bj9k9zik.js +395 -0
- package/dist/utils/api.js +9 -0
- package/dist/utils/baseFetches.js +19 -0
- package/dist/utils/fetches.js +22 -0
- package/dist/utils/helper.js +55 -0
- package/dist/utils-DxRR_XLb.js +9 -0
- package/dist/vite-env.d.js +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,55 @@
|
|
|
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) => {
|
|
4
|
+
if (typeof r != "string")
|
|
5
|
+
throw new TypeError("Invalid argument expected string");
|
|
6
|
+
const e = r.match(g);
|
|
7
|
+
if (!e)
|
|
8
|
+
throw new Error(`Invalid argument not valid semver ('${r}' received)`);
|
|
9
|
+
return e.shift(), e;
|
|
10
|
+
}, f = (r) => r === "*" || r === "x" || r === "X", l = (r) => {
|
|
11
|
+
const e = parseInt(r, 10);
|
|
12
|
+
return isNaN(e) ? r : e;
|
|
13
|
+
}, h = (r, e) => typeof r != typeof e ? [String(r), String(e)] : [r, e], E = (r, e) => {
|
|
14
|
+
if (f(r) || f(e))
|
|
15
|
+
return 0;
|
|
16
|
+
const [t, n] = h(l(r), l(e));
|
|
17
|
+
return t > n ? 1 : t < n ? -1 : 0;
|
|
18
|
+
}, p = (r, e) => {
|
|
19
|
+
for (let t = 0; t < Math.max(r.length, e.length); t++) {
|
|
20
|
+
const n = E(r[t] || "0", e[t] || "0");
|
|
21
|
+
if (n !== 0)
|
|
22
|
+
return n;
|
|
23
|
+
}
|
|
24
|
+
return 0;
|
|
25
|
+
}, a = (r, e) => {
|
|
26
|
+
const t = c(r), n = c(e), o = t.pop(), i = n.pop(), s = p(t, n);
|
|
27
|
+
return s !== 0 ? s : o && i ? p(o.split("."), i.split(".")) : o || i ? o ? -1 : 1 : 0;
|
|
28
|
+
}, d = "0.0.17.1-beta", w = (r) => m.every((e) => y(e, r)), y = (r, e) => {
|
|
29
|
+
if (!e[r]) {
|
|
30
|
+
if (e.throwError)
|
|
31
|
+
return e.throwError(`Missing required prop: ${r}`, 404), !1;
|
|
32
|
+
throw new Error(`Missing required prop: ${r}`);
|
|
33
|
+
}
|
|
34
|
+
return !0;
|
|
35
|
+
}, P = () => {
|
|
36
|
+
const r = window.__env__;
|
|
37
|
+
if (r && r.COMMON_API && r.MODULE_AUTH_API && r.API_PREFIX && r.ENVIRONMENT)
|
|
38
|
+
return r;
|
|
39
|
+
}, S = (r) => {
|
|
40
|
+
if (!r?.REQ_VERSION) return null;
|
|
41
|
+
const e = r.REQ_VERSION;
|
|
42
|
+
return a(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, t = u.getState().moduleId;
|
|
45
|
+
return [...r, e, t];
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
w as arePropsValid,
|
|
49
|
+
M as checkConfig,
|
|
50
|
+
y as checkIfPropExists,
|
|
51
|
+
S as checkVersion,
|
|
52
|
+
P as getEnvironmentVariables,
|
|
53
|
+
R as getModuleQueryKey,
|
|
54
|
+
_ as universalSelector
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hortiview/modulebase",
|
|
3
|
+
"description": "This is a base module for hortiview",
|
|
4
|
+
"version": "0.0.17.1-beta",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"author": "Falk Menge <falk.menge.ext@bayer.com>",
|
|
7
|
+
"contributors": [
|
|
8
|
+
"Nico Pfeiffer <nico.pfeiffer.ext@bayer.com>"
|
|
9
|
+
],
|
|
10
|
+
"license": "GPL-3.0",
|
|
11
|
+
"main": "dist/main.js",
|
|
12
|
+
"types": "dist/lib/main.d.ts",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"registry": "https://registry.npmjs.org/"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "vite",
|
|
21
|
+
"build": "tsc -b && vite build",
|
|
22
|
+
"lint": "eslint .",
|
|
23
|
+
"preview": "vite preview"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@hortiview/default-components": "^1.2.1",
|
|
27
|
+
"@hortiview/shared-components": "^2.0.0",
|
|
28
|
+
"@microsoft/signalr": "^8.0.7",
|
|
29
|
+
"@tanstack/query-async-storage-persister": "^5.85.5",
|
|
30
|
+
"@tanstack/react-query": "^5.67.3",
|
|
31
|
+
"@tanstack/react-query-persist-client": "^5.85.5",
|
|
32
|
+
"compare-versions": "^6.1.1",
|
|
33
|
+
"lodash": "^4.17.21",
|
|
34
|
+
"odata-query": "^7.0.9",
|
|
35
|
+
"react": "^18.3.1",
|
|
36
|
+
"react-dom": "^18.3.1",
|
|
37
|
+
"react-router": "^7.1.5",
|
|
38
|
+
"react-signalr": "^0.2.24",
|
|
39
|
+
"socket.io-client": "^4.8.1",
|
|
40
|
+
"vite-plugin-dts": "^4.5.0",
|
|
41
|
+
"vite-plugin-lib-inject-css": "^2.2.1",
|
|
42
|
+
"zustand": "^5.0.3"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@eslint/js": "^9.17.0",
|
|
46
|
+
"@types/lodash": "^4.17.15",
|
|
47
|
+
"@types/node": "^22.10.7",
|
|
48
|
+
"@types/react": "^18.3.18",
|
|
49
|
+
"@types/react-dom": "^18.3.5",
|
|
50
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
51
|
+
"eslint": "^9.17.0",
|
|
52
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
53
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
54
|
+
"glob": "^11.0.1",
|
|
55
|
+
"globals": "^15.14.0",
|
|
56
|
+
"typescript": "~5.6.2",
|
|
57
|
+
"typescript-eslint": "^8.18.2",
|
|
58
|
+
"vite": "^6.0.5"
|
|
59
|
+
}
|
|
60
|
+
}
|