@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.
@@ -1,17 +1,25 @@
1
- import { u } from "../useMutation-3rykrmeD.js";
2
- import { useBasePropsStore as t } from "../stores/BasePropsStore.js";
3
- const f = ({
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: e,
6
- topic: s
5
+ queue: s,
6
+ topic: o
7
7
  }) => {
8
- const r = t((o) => o.serviceBusNotification), n = t((o) => o.throwError);
9
- if (!r)
10
- throw n?.("serviceBusNotification is not defined", 400);
11
- return u({
12
- mutationFn: (o) => r(o, i, e, s)
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
- f as useServiceBus
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
- * @returns
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
- serviceBusNotification?: (message: import('../types/ServiceBus').AlertServiceBusMessage, apiKey: string, queue: string, topic: string) => Promise<unknown>;
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" | "serviceBusNotification" | "navigateInHortiview" | "addBreadcrumbTranslation" | "showSnackbar" | "showMessage" | "logEvent" | "logError" | "throwError">;
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;
@@ -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
- serviceBusNotification?: (message: AlertServiceBusMessage, //currently only used for alerts
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 l } from "./hooks/useEntity.js";
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 { useServiceBus as h } from "./hooks/useServiceBus.js";
11
- import { mutateOnCustomApi as x } from "./utils/fetches.js";
12
- import { A as g, B as v, F as P, H as f, I as y, a as L, b as k, L as D, c as H, M, d as B, N as O, e as b, f as T, O as w, P as I, R as V, g as q, h as z, i as G, S as K, j as W, k as j, l as J, m as Q, D as X, n as Y, E as Z, o as $, p as aa, q as ea, r as sa, s as ta, t as ra, u as oa, v as ua, V as ia, w as na, x as ca, y as Sa, z as Ra, C as ma, G as Ea, J as Fa, K as la, Q as Na, T as Aa, U as _a, W as da, X as pa, Y as ha, Z as Ua, _ as xa, $ as Ca, a0 as ga, a1 as va, a2 as Pa, a3 as fa, a4 as ya, a5 as La, a6 as ka, a7 as Da, a8 as Ha, a9 as Ma, aa as Ba, ab as Oa, ac as ba, ad as Ta, ae as wa, af as Ia, ag as Va, ah as qa, ai as za, aj as Ga, ak as Ka, al as Wa, am as ja, an as Ja, ao as Qa, ap as Xa, aq as Ya, ar as Za, as as $a, at as ae, au as ee, av as se, aw as te, ax as re, ay as oe, az as ue, aA as ie, aB as ne, aC as ce, aD as Se, aE as Re, aF as me, aG as Ee, aH as Fe, aI as le, aJ as Ne, aK as Ae, aL as _e, aM as de, aN as pe, aO as he, aP as Ue, aQ as xe, aR as Ce, aS as ge, aT as ve } from "./chunk-IR6S3I6Y-BmDdD3SP.js";
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
- g as Await,
15
- v as BrowserRouter,
14
+ v as Await,
15
+ f as BrowserRouter,
16
16
  P as Form,
17
- f as HashRouter,
18
- y as IDLE_BLOCKER,
19
- L as IDLE_FETCHER,
20
- k as IDLE_NAVIGATION,
21
- D as Link,
22
- H as Links,
23
- M as MemoryRouter,
24
- B as Meta,
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
- O as NavLink,
27
- b as Navigate,
28
- T as NavigationType,
29
- w as Outlet,
30
- I as PrefetchPageLinks,
31
- V as Route,
32
- q as Router,
33
- z as RouterProvider,
34
- G as Routes,
35
- K as Scripts,
36
- W as ScrollRestoration,
37
- j as ServerRouter,
38
- J as StaticRouter,
39
- Q as StaticRouterProvider,
40
- X as UNSAFE_DataRouterContext,
41
- Y as UNSAFE_DataRouterStateContext,
42
- Z as UNSAFE_ErrorResponseImpl,
43
- $ as UNSAFE_FetchersContext,
44
- aa as UNSAFE_FrameworkContext,
45
- ea as UNSAFE_LocationContext,
46
- sa as UNSAFE_NavigationContext,
47
- ta as UNSAFE_RemixErrorBoundary,
48
- ra as UNSAFE_RouteContext,
49
- oa as UNSAFE_ServerMode,
50
- ua as UNSAFE_SingleFetchRedirectSymbol,
51
- ia as UNSAFE_ViewTransitionContext,
52
- na as UNSAFE_createBrowserHistory,
53
- ca as UNSAFE_createClientRoutes,
54
- Sa as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
55
- Ra as UNSAFE_createRouter,
56
- ma as UNSAFE_decodeViaTurboStream,
57
- Ea as UNSAFE_deserializeErrors,
58
- Fa as UNSAFE_getPatchRoutesOnNavigationFunction,
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
- Na as UNSAFE_invariant,
61
- Aa as UNSAFE_mapRouteProperties,
62
- _a as UNSAFE_shouldHydrateRouteLoader,
63
- da as UNSAFE_useFogOFWarDiscovery,
64
- pa as UNSAFE_useScrollRestoration,
65
- ha as createBrowserRouter,
66
- Ua as createCookie,
67
- xa as createCookieSessionStorage,
68
- Ca as createHashRouter,
69
- ga as createMemoryRouter,
70
- va as createMemorySessionStorage,
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
- fa as createRequestHandler,
73
- ya as createRoutesFromChildren,
74
- La as createRoutesFromElements,
75
- ka as createRoutesStub,
76
- Da as createSearchParams,
77
- Ha as createSession,
78
- Ma as createSessionStorage,
79
- Ba as createStaticHandler,
80
- Oa as createStaticRouter,
81
- ba as data,
82
- Ta as generatePath,
83
- wa as isCookie,
84
- Ia as isRouteErrorResponse,
85
- Va as isSession,
86
- qa as matchPath,
87
- za as matchRoutes,
88
- x as mutateOnCustomApi,
89
- Ga as parsePath,
90
- Ka as redirect,
91
- Wa as redirectDocument,
92
- ja as renderMatches,
93
- Ja as replace,
94
- Qa as resolvePath,
95
- Xa as unstable_HistoryRouter,
96
- Ya as unstable_setDevServerHooks,
97
- Za as unstable_usePrompt,
98
- $a as useActionData,
99
- ae as useAsyncError,
100
- ee as useAsyncValue,
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
- se as useBeforeUnload,
103
- te as useBlocker,
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
- l as useEntity,
109
- re as useFetcher,
110
- oe as useFetchers,
111
- ue as useFormAction,
112
- ie as useHref,
113
- ne as useInRouterContext,
114
- ce as useLinkClickHandler,
115
- Se as useLoaderData,
116
- Re as useLocation,
117
- me as useMatch,
118
- Ee as useMatches,
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
- Fe as useNavigation,
120
+ Ne as useNavigation,
121
121
  le as useNavigationType,
122
+ h as useNotification,
122
123
  A as useOption,
123
- Ne as useOutlet,
124
- Ae as useOutletContext,
125
- _e as useParams,
126
- de as useResolvedPath,
127
- pe as useRevalidator,
128
- he as useRouteError,
129
- Ue as useRouteLoaderData,
130
- xe as useRoutes,
131
- Ce as useSearchParams,
132
- h as useServiceBus,
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
- ge as useSubmit,
135
- ve as useViewTransitionState
135
+ ve as useSubmit,
136
+ fe as useViewTransitionState
136
137
  };
@@ -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.13179", v = (r) => p.every((e) => I(e, r)), I = (r, e) => {
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.13179",
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
  ],