@hortiview/modulebase 0.0.13179 → 0.0.13318
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/hooks/useServiceBus.js +19 -11
- package/dist/lib/hooks/useServiceBus.d.ts +6 -2
- package/dist/lib/hooks/useStores.d.ts +2 -2
- package/dist/lib/main.d.ts +1 -1
- package/dist/lib/types/BaseProps.d.ts +1 -2
- package/dist/lib/types/Deprecated.d.ts +6 -0
- package/dist/main.js +114 -113
- package/dist/utils/helper.js +1 -1
- package/package.json +2 -2
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import { u } from "../useMutation-3rykrmeD.js";
|
|
2
|
-
import { useBasePropsStore as
|
|
3
|
-
const
|
|
1
|
+
import { u as n } from "../useMutation-3rykrmeD.js";
|
|
2
|
+
import { useBasePropsStore as r } from "../stores/BasePropsStore.js";
|
|
3
|
+
const a = ({
|
|
4
4
|
authenticationKey: i,
|
|
5
|
-
queue:
|
|
6
|
-
topic:
|
|
5
|
+
queue: s,
|
|
6
|
+
topic: o
|
|
7
7
|
}) => {
|
|
8
|
-
const
|
|
9
|
-
if (!
|
|
10
|
-
throw
|
|
11
|
-
return
|
|
12
|
-
mutationFn: (
|
|
8
|
+
const e = r((t) => t.serviceBusNotification), c = r((t) => t.throwError);
|
|
9
|
+
if (!e)
|
|
10
|
+
throw c?.("serviceBusNotification is not defined", 400);
|
|
11
|
+
return n({
|
|
12
|
+
mutationFn: (t) => e(t, i, s, o)
|
|
13
|
+
});
|
|
14
|
+
}, N = () => {
|
|
15
|
+
const i = r((o) => o.riseNotification), s = r((o) => o.throwError);
|
|
16
|
+
if (!i)
|
|
17
|
+
throw s?.("riseNotification is not defined", 400);
|
|
18
|
+
return n({
|
|
19
|
+
mutationFn: (o) => i(o)
|
|
13
20
|
});
|
|
14
21
|
};
|
|
15
22
|
export {
|
|
16
|
-
|
|
23
|
+
N as useNotification,
|
|
24
|
+
a as useServiceBus
|
|
17
25
|
};
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
2
|
-
import { AlertServiceBusMessage } from '../types/ServiceBus';
|
|
3
2
|
import { BaseResponse } from '../types/Requests';
|
|
3
|
+
import { AlertServiceBusMessage } from '../types/ServiceBus';
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
6
|
* @param authenticationKey SASToken, that will be provided by the vendor portal of HortiView
|
|
7
7
|
* @param queue url of the service bus queue
|
|
8
8
|
* @param topic topic of the service bus, where the message will be sent to
|
|
9
|
-
* @
|
|
9
|
+
* @deprecated use useNotification instead
|
|
10
10
|
*/
|
|
11
11
|
export declare const useServiceBus: ({ authenticationKey, queue, topic, }: {
|
|
12
12
|
authenticationKey: string;
|
|
13
13
|
queue: string;
|
|
14
14
|
topic: string;
|
|
15
15
|
}) => UseMutationResult<BaseResponse<unknown>, Error, AlertServiceBusMessage, unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* create a notification in the service bus
|
|
18
|
+
*/
|
|
19
|
+
export declare const useNotification: () => UseMutationResult<BaseResponse<unknown>, Error, AlertServiceBusMessage, unknown>;
|
|
@@ -9,7 +9,7 @@ export declare const useBaseProps: () => Pick<import('../types/Deprecated').Depr
|
|
|
9
9
|
currentLanguageId?: string;
|
|
10
10
|
alertRules?: string;
|
|
11
11
|
commonOptions?: import('../types/CommonOptions').AllDropdownsData<import('../types/CommonOptions').CommonOption>["items"];
|
|
12
|
-
|
|
12
|
+
riseNotification?: (message: import('../types/ServiceBus').AlertServiceBusMessage) => Promise<unknown>;
|
|
13
13
|
navigateInHortiview?: (path: string) => void;
|
|
14
14
|
addBreadcrumbTranslation?: (translation: {
|
|
15
15
|
key: string;
|
|
@@ -22,7 +22,7 @@ export declare const useBaseProps: () => Pick<import('../types/Deprecated').Depr
|
|
|
22
22
|
throwError?: (message: string, code: number) => void;
|
|
23
23
|
} & {
|
|
24
24
|
setBaseProps: (props: import('../main').BaseProps) => void;
|
|
25
|
-
}, keyof import('../types/Deprecated').DeprecatedBaseProps | "modulePermissionToken" | "moduleId" | "organizationId" | "basePath" | "currentNavigationPath" | "sourcePath" | "currentLanguage" | "currentLanguageId" | "alertRules" | "commonOptions" | "
|
|
25
|
+
}, keyof import('../types/Deprecated').DeprecatedBaseProps | "modulePermissionToken" | "moduleId" | "organizationId" | "basePath" | "currentNavigationPath" | "sourcePath" | "currentLanguage" | "currentLanguageId" | "alertRules" | "commonOptions" | "riseNotification" | "navigateInHortiview" | "addBreadcrumbTranslation" | "showSnackbar" | "showMessage" | "logEvent" | "logError" | "throwError">;
|
|
26
26
|
export declare const useConfig: () => Pick<{
|
|
27
27
|
environment: import('../types/Environment').HortiViewEnvironments;
|
|
28
28
|
setEnvironment: (environment: import('../types/Environment').HortiViewEnvironments) => void;
|
package/dist/lib/main.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ export { useCustom } from './hooks/useCustom';
|
|
|
9
9
|
export { useEntity } from './hooks/useEntity';
|
|
10
10
|
export { useOption } from './hooks/useOption';
|
|
11
11
|
export { useCustomMutation } from './hooks/useCustomMutation';
|
|
12
|
-
export { useServiceBus } from './hooks/useServiceBus';
|
|
12
|
+
export { useServiceBus, useNotification } from './hooks/useServiceBus';
|
|
13
13
|
export { mutateOnCustomApi } from './utils/fetches';
|
|
@@ -26,8 +26,7 @@ export type BaseProps = DeprecatedBaseProps & {
|
|
|
26
26
|
currentLanguageId?: string;
|
|
27
27
|
alertRules?: string;
|
|
28
28
|
commonOptions?: AllDropdownsData<CommonOption>['items'];
|
|
29
|
-
|
|
30
|
-
apiKey: string, queue: string, topic: string) => Promise<unknown>;
|
|
29
|
+
riseNotification?: (message: AlertServiceBusMessage) => Promise<unknown>;
|
|
31
30
|
navigateInHortiview?: (path: string) => void;
|
|
32
31
|
addBreadcrumbTranslation?: (translation: {
|
|
33
32
|
key: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AlertServiceBusMessage } from './ServiceBus';
|
|
1
2
|
import { SystemMessage } from './SystemMessage';
|
|
2
3
|
/**
|
|
3
4
|
* @deprecated should not be used anymore, will be removed in the near future (max 2 months)
|
|
@@ -21,6 +22,11 @@ export type DeprecatedBaseProps = {
|
|
|
21
22
|
* @deprecated
|
|
22
23
|
*/
|
|
23
24
|
addNotification?: (notification: OldAlertDto) => void;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated use `riseNotification` instead
|
|
27
|
+
*/
|
|
28
|
+
serviceBusNotification?: (message: AlertServiceBusMessage, //currently only used for alerts
|
|
29
|
+
apiKey: string, queue: string, topic: string) => Promise<unknown>;
|
|
24
30
|
/**
|
|
25
31
|
* @deprecated Use `showMessage` instead
|
|
26
32
|
*/
|
package/dist/main.js
CHANGED
|
@@ -4,133 +4,134 @@ import { useSignalRMessages as u } from "./hooks/useSignalRMessages.js";
|
|
|
4
4
|
import { useNavigate as n } from "./module-router.js";
|
|
5
5
|
import { useBaseProps as S, useConfig as R } from "./hooks/useStores.js";
|
|
6
6
|
import { useCustom as E } from "./hooks/useCustom.js";
|
|
7
|
-
import { useEntity as
|
|
7
|
+
import { useEntity as N } from "./hooks/useEntity.js";
|
|
8
8
|
import { useOption as A } from "./hooks/useOption.js";
|
|
9
9
|
import { useCustomMutation as d } from "./hooks/useCustomMutation.js";
|
|
10
|
-
import {
|
|
11
|
-
import { mutateOnCustomApi as
|
|
12
|
-
import { A as
|
|
10
|
+
import { useNotification as h, useServiceBus as U } from "./hooks/useServiceBus.js";
|
|
11
|
+
import { mutateOnCustomApi as C } from "./utils/fetches.js";
|
|
12
|
+
import { A as v, B as f, F as P, H as y, I as L, a as k, b as D, L as H, c as M, M as B, d as O, N as b, e as T, f as w, O as I, P as V, R as q, g as z, h as G, i as K, S as W, j, k as J, l as Q, m as X, D as Y, n as Z, E as $, o as aa, p as ea, q as sa, r as ta, s as ra, t as oa, u as ua, v as ia, V as na, w as ca, x as Sa, y as Ra, z as ma, C as Ea, G as Fa, J as Na, K as la, Q as Aa, T as _a, U as da, W as pa, X as ha, Y as Ua, Z as xa, _ as Ca, $ as ga, a0 as va, a1 as fa, a2 as Pa, a3 as ya, a4 as La, a5 as ka, a6 as Da, a7 as Ha, a8 as Ma, a9 as Ba, aa as Oa, ab as ba, ac as Ta, ad as wa, ae as Ia, af as Va, ag as qa, ah as za, ai as Ga, aj as Ka, ak as Wa, al as ja, am as Ja, an as Qa, ao as Xa, ap as Ya, aq as Za, ar as $a, as as ae, at as ee, au as se, av as te, aw as re, ax as oe, ay as ue, az as ie, aA as ne, aB as ce, aC as Se, aD as Re, aE as me, aF as Ee, aG as Fe, aH as Ne, aI as le, aJ as Ae, aK as _e, aL as de, aM as pe, aN as he, aO as Ue, aP as xe, aQ as Ce, aR as ge, aS as ve, aT as fe } from "./chunk-IR6S3I6Y-BmDdD3SP.js";
|
|
13
13
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
v as Await,
|
|
15
|
+
f as BrowserRouter,
|
|
16
16
|
P as Form,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
y as HashRouter,
|
|
18
|
+
L as IDLE_BLOCKER,
|
|
19
|
+
k as IDLE_FETCHER,
|
|
20
|
+
D as IDLE_NAVIGATION,
|
|
21
|
+
H as Link,
|
|
22
|
+
M as Links,
|
|
23
|
+
B as MemoryRouter,
|
|
24
|
+
O as Meta,
|
|
25
25
|
s as ModuleBase,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
26
|
+
b as NavLink,
|
|
27
|
+
T as Navigate,
|
|
28
|
+
w as NavigationType,
|
|
29
|
+
I as Outlet,
|
|
30
|
+
V as PrefetchPageLinks,
|
|
31
|
+
q as Route,
|
|
32
|
+
z as Router,
|
|
33
|
+
G as RouterProvider,
|
|
34
|
+
K as Routes,
|
|
35
|
+
W as Scripts,
|
|
36
|
+
j as ScrollRestoration,
|
|
37
|
+
J as ServerRouter,
|
|
38
|
+
Q as StaticRouter,
|
|
39
|
+
X as StaticRouterProvider,
|
|
40
|
+
Y as UNSAFE_DataRouterContext,
|
|
41
|
+
Z as UNSAFE_DataRouterStateContext,
|
|
42
|
+
$ as UNSAFE_ErrorResponseImpl,
|
|
43
|
+
aa as UNSAFE_FetchersContext,
|
|
44
|
+
ea as UNSAFE_FrameworkContext,
|
|
45
|
+
sa as UNSAFE_LocationContext,
|
|
46
|
+
ta as UNSAFE_NavigationContext,
|
|
47
|
+
ra as UNSAFE_RemixErrorBoundary,
|
|
48
|
+
oa as UNSAFE_RouteContext,
|
|
49
|
+
ua as UNSAFE_ServerMode,
|
|
50
|
+
ia as UNSAFE_SingleFetchRedirectSymbol,
|
|
51
|
+
na as UNSAFE_ViewTransitionContext,
|
|
52
|
+
ca as UNSAFE_createBrowserHistory,
|
|
53
|
+
Sa as UNSAFE_createClientRoutes,
|
|
54
|
+
Ra as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
|
|
55
|
+
ma as UNSAFE_createRouter,
|
|
56
|
+
Ea as UNSAFE_decodeViaTurboStream,
|
|
57
|
+
Fa as UNSAFE_deserializeErrors,
|
|
58
|
+
Na as UNSAFE_getPatchRoutesOnNavigationFunction,
|
|
59
59
|
la as UNSAFE_getSingleFetchDataStrategy,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
60
|
+
Aa as UNSAFE_invariant,
|
|
61
|
+
_a as UNSAFE_mapRouteProperties,
|
|
62
|
+
da as UNSAFE_shouldHydrateRouteLoader,
|
|
63
|
+
pa as UNSAFE_useFogOFWarDiscovery,
|
|
64
|
+
ha as UNSAFE_useScrollRestoration,
|
|
65
|
+
Ua as createBrowserRouter,
|
|
66
|
+
xa as createCookie,
|
|
67
|
+
Ca as createCookieSessionStorage,
|
|
68
|
+
ga as createHashRouter,
|
|
69
|
+
va as createMemoryRouter,
|
|
70
|
+
fa as createMemorySessionStorage,
|
|
71
71
|
Pa as createPath,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
72
|
+
ya as createRequestHandler,
|
|
73
|
+
La as createRoutesFromChildren,
|
|
74
|
+
ka as createRoutesFromElements,
|
|
75
|
+
Da as createRoutesStub,
|
|
76
|
+
Ha as createSearchParams,
|
|
77
|
+
Ma as createSession,
|
|
78
|
+
Ba as createSessionStorage,
|
|
79
|
+
Oa as createStaticHandler,
|
|
80
|
+
ba as createStaticRouter,
|
|
81
|
+
Ta as data,
|
|
82
|
+
wa as generatePath,
|
|
83
|
+
Ia as isCookie,
|
|
84
|
+
Va as isRouteErrorResponse,
|
|
85
|
+
qa as isSession,
|
|
86
|
+
za as matchPath,
|
|
87
|
+
Ga as matchRoutes,
|
|
88
|
+
C as mutateOnCustomApi,
|
|
89
|
+
Ka as parsePath,
|
|
90
|
+
Wa as redirect,
|
|
91
|
+
ja as redirectDocument,
|
|
92
|
+
Ja as renderMatches,
|
|
93
|
+
Qa as replace,
|
|
94
|
+
Xa as resolvePath,
|
|
95
|
+
Ya as unstable_HistoryRouter,
|
|
96
|
+
Za as unstable_setDevServerHooks,
|
|
97
|
+
$a as unstable_usePrompt,
|
|
98
|
+
ae as useActionData,
|
|
99
|
+
ee as useAsyncError,
|
|
100
|
+
se as useAsyncValue,
|
|
101
101
|
S as useBaseProps,
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
te as useBeforeUnload,
|
|
103
|
+
re as useBlocker,
|
|
104
104
|
r as useBreadcrumbTranslation,
|
|
105
105
|
R as useConfig,
|
|
106
106
|
E as useCustom,
|
|
107
107
|
d as useCustomMutation,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
108
|
+
N as useEntity,
|
|
109
|
+
oe as useFetcher,
|
|
110
|
+
ue as useFetchers,
|
|
111
|
+
ie as useFormAction,
|
|
112
|
+
ne as useHref,
|
|
113
|
+
ce as useInRouterContext,
|
|
114
|
+
Se as useLinkClickHandler,
|
|
115
|
+
Re as useLoaderData,
|
|
116
|
+
me as useLocation,
|
|
117
|
+
Ee as useMatch,
|
|
118
|
+
Fe as useMatches,
|
|
119
119
|
n as useNavigate,
|
|
120
|
-
|
|
120
|
+
Ne as useNavigation,
|
|
121
121
|
le as useNavigationType,
|
|
122
|
+
h as useNotification,
|
|
122
123
|
A as useOption,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
124
|
+
Ae as useOutlet,
|
|
125
|
+
_e as useOutletContext,
|
|
126
|
+
de as useParams,
|
|
127
|
+
pe as useResolvedPath,
|
|
128
|
+
he as useRevalidator,
|
|
129
|
+
Ue as useRouteError,
|
|
130
|
+
xe as useRouteLoaderData,
|
|
131
|
+
Ce as useRoutes,
|
|
132
|
+
ge as useSearchParams,
|
|
133
|
+
U as useServiceBus,
|
|
133
134
|
u as useSignalRMessages,
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
ve as useSubmit,
|
|
136
|
+
fe as useViewTransitionState
|
|
136
137
|
};
|
package/dist/utils/helper.js
CHANGED
|
@@ -24,7 +24,7 @@ const l = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([
|
|
|
24
24
|
}, m = (r, e) => {
|
|
25
25
|
const t = u(r), n = u(e), i = t.pop(), o = n.pop(), s = a(t, n);
|
|
26
26
|
return s !== 0 ? s : i && o ? a(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
|
|
27
|
-
}, f = "0.0.
|
|
27
|
+
}, f = "0.0.13318", v = (r) => p.every((e) => I(e, r)), I = (r, e) => {
|
|
28
28
|
if (!e[r]) {
|
|
29
29
|
if (e.throwError)
|
|
30
30
|
return e.throwError(`Missing required prop: ${r}`, 404), !1;
|
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.13318",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Falk Menge <falk.menge.ext@bayer.com>",
|
|
7
7
|
"contributors": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"license": "GPL-3.0",
|
|
11
11
|
"main": "dist/main.js",
|
|
12
|
-
"types": "dist/main.d.ts",
|
|
12
|
+
"types": "dist/lib/main.d.ts",
|
|
13
13
|
"files": [
|
|
14
14
|
"dist"
|
|
15
15
|
],
|