@hortiview/modulebase 0.0.13925 → 0.0.14044

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.
@@ -2,13 +2,35 @@ import { QueryClient } from '@tanstack/react-query';
2
2
  import { RouteObject } from 'react-router';
3
3
  import { BaseProps } from '../types/BaseProps';
4
4
  import { EnvConfig } from '../types/Environment';
5
- /**
6
- * Main component of the module. This component is used to create a module with a router and a signalR provider.
7
- */
8
- export declare const ModuleBase: ({ props, routes, env, useSignalR, queryClient, }: {
5
+ type ModuleBaseProps = {
6
+ /**
7
+ * Properties that are passed to the Base component by the host application, {@link BaseProps}
8
+ */
9
9
  props: BaseProps;
10
+ /**
11
+ * Routes that are used in the module, {@link RouteObject}
12
+ */
10
13
  routes: RouteObject[];
14
+ /**
15
+ * @deprecated
16
+ * Environment configuration that is used to configure the module, {@link EnvConfig}.
17
+ * New way to pass environment variables is through the base props:
18
+ * Setup the environment variables in the host application (module edit in the vendor section).
19
+ * They are then passed to the module within the base props.
20
+ */
11
21
  env?: EnvConfig;
22
+ /**
23
+ * If true, the module will use the SignalR provider to connect to the module API.
24
+ */
12
25
  useSignalR?: boolean;
26
+ /**
27
+ * Query client that is used to provide the module with a query client, {@link QueryClient}.
28
+ * If not provided, the default query client will be used.
29
+ */
13
30
  queryClient?: QueryClient;
14
- }) => import("react/jsx-runtime").JSX.Element;
31
+ };
32
+ /**
33
+ * Main component of the module. This component is used to create a module with a router and a signalR provider.
34
+ */
35
+ export declare const ModuleBase: ({ props, routes, env, useSignalR, queryClient, }: ModuleBaseProps) => import("react/jsx-runtime").JSX.Element;
36
+ export {};
@@ -2,12 +2,31 @@ import { QueryClient } from '@tanstack/react-query';
2
2
  import { BaseProps } from '../types/BaseProps';
3
3
  import { EnvConfig } from '../types/Environment';
4
4
  export declare const ModuleQueryClient: QueryClient;
5
- /**
6
- * Minimal component to create a module with a query client and a signalR provider (to use module api)
7
- */
8
- export declare const ModuleCore: ({ props, env, queryClient, children, }: {
5
+ type ModuleCoreProps = {
6
+ /**
7
+ * Properties that are passed to the Base component by the host application, {@link BaseProps}
8
+ */
9
9
  props: BaseProps;
10
+ /**
11
+ * @deprecated
12
+ * Environment configuration that is used to configure the module, {@link EnvConfig}.
13
+ * New way to pass environment variables is through the base props:
14
+ * Setup the environment variables in the host application (module edit in the vendor section).
15
+ * They are then passed to the module within the base props.
16
+ */
10
17
  env?: EnvConfig;
18
+ /**
19
+ * Query client that is used to provide the module with a query client, {@link QueryClient}.
20
+ * If not provided, the default query client will be used.
21
+ */
11
22
  queryClient?: QueryClient;
23
+ /**
24
+ * Children components that are rendered within the module core
25
+ */
12
26
  children: React.ReactNode;
13
- }) => import("react/jsx-runtime").JSX.Element;
27
+ };
28
+ /**
29
+ * Minimal component to create a module with a query client and a signalR provider (to use module api)
30
+ */
31
+ export declare const ModuleCore: ({ props, env, queryClient, children, }: ModuleCoreProps) => import("react/jsx-runtime").JSX.Element;
32
+ export {};
@@ -1,4 +1,4 @@
1
- import { BaseProps } from './main';
1
+ import { BaseProps } from './types/BaseProps';
2
2
  export declare const REQUIRED_PROPS: (keyof BaseProps)[];
3
3
  export declare const RETRIES = 1;
4
4
  export declare const RETRY_HTTP_STATUS_CODES: {
@@ -20,9 +20,10 @@ export declare const useBaseProps: () => Pick<import('../main').DeprecatedBasePr
20
20
  logEvent?: (event: import('../main').AppInsightsEvent, customProperties?: import('../main').AppInsightsProperties) => void;
21
21
  logError?: (exception: import('../main').AppInsightsException) => void;
22
22
  throwError?: (message: string, code: number) => void;
23
+ environmentVariables?: import('../main').EnvironmentVariable[];
23
24
  } & {
24
25
  setBaseProps: (props: import('../main').BaseProps) => void;
25
- }, keyof import('../main').DeprecatedBaseProps | "modulePermissionToken" | "moduleId" | "organizationId" | "basePath" | "currentNavigationPath" | "sourcePath" | "currentLanguage" | "currentLanguageId" | "alertRules" | "commonOptions" | "riseNotification" | "navigateInHortiview" | "addBreadcrumbTranslation" | "showSnackbar" | "showMessage" | "logEvent" | "logError" | "throwError">;
26
+ }, keyof import('../main').DeprecatedBaseProps | "modulePermissionToken" | "moduleId" | "organizationId" | "basePath" | "currentNavigationPath" | "sourcePath" | "currentLanguage" | "currentLanguageId" | "alertRules" | "commonOptions" | "riseNotification" | "navigateInHortiview" | "addBreadcrumbTranslation" | "showSnackbar" | "showMessage" | "logEvent" | "logError" | "throwError" | "environmentVariables">;
26
27
  export declare const useConfig: () => Pick<{
27
28
  environment: import('../main').HortiViewEnvironments;
28
29
  setEnvironment: (environment: import('../main').HortiViewEnvironments) => void;
@@ -5,6 +5,7 @@ export type * from './types/BaseProps';
5
5
  export type * from './types/CommonOptions';
6
6
  export type * from './types/Deprecated';
7
7
  export type * from './types/Environment';
8
+ export type * from './types/EnvironmentVariable';
8
9
  export type * from './types/ModuleApi';
9
10
  export type * from './types/Requests';
10
11
  export type * from './types/ServiceBus';
@@ -1,6 +1,7 @@
1
1
  import { AppInsightsEvent, AppInsightsException, AppInsightsProperties } from './AppInsights';
2
2
  import { AllDropdownsData, CommonOption } from './CommonOptions';
3
3
  import { DeprecatedBaseProps } from './Deprecated';
4
+ import { EnvironmentVariable } from './EnvironmentVariable';
4
5
  import { AlertServiceBusMessage } from './ServiceBus';
5
6
  import { SystemMessage } from './SystemMessage';
6
7
  /**
@@ -37,4 +38,5 @@ export type BaseProps = DeprecatedBaseProps & {
37
38
  logEvent?: (event: AppInsightsEvent, customProperties?: AppInsightsProperties) => void;
38
39
  logError?: (exception: AppInsightsException) => void;
39
40
  throwError?: (message: string, code: number) => void;
41
+ environmentVariables?: EnvironmentVariable[];
40
42
  };
@@ -0,0 +1,6 @@
1
+ export type EnvironmentVariable = {
2
+ id?: string;
3
+ appEnvironmentId: string;
4
+ key: string;
5
+ value: string;
6
+ };
@@ -0,0 +1 @@
1
+
@@ -24,7 +24,7 @@ const h = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([
24
24
  }, g = (r, e) => {
25
25
  const n = u(r), t = u(e), i = n.pop(), o = t.pop(), s = l(n, t);
26
26
  return s !== 0 ? s : i && o ? l(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
27
- }, p = "0.0.13925", w = (r) => d.every((e) => v(e, r)), v = (r, e) => {
27
+ }, p = "0.0.14044", w = (r) => d.every((e) => v(e, r)), v = (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.13925",
4
+ "version": "0.0.14044",
5
5
  "type": "module",
6
6
  "author": "Falk Menge <falk.menge.ext@bayer.com>",
7
7
  "contributors": [