@trackunit/iris-app-runtime-core-api 1.7.9 → 1.7.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-runtime-core-api",
3
- "version": "1.7.9",
3
+ "version": "1.7.10",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -8,8 +8,8 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "jest-fetch-mock": "^3.0.3",
11
- "@trackunit/react-core-contexts-api": "1.8.9",
12
- "@trackunit/react-test-setup": "1.4.7"
11
+ "@trackunit/react-core-contexts-api": "1.8.10",
12
+ "@trackunit/react-test-setup": "1.4.8"
13
13
  },
14
14
  "module": "./index.esm.js",
15
15
  "main": "./index.cjs.js",
@@ -44,4 +44,10 @@ export interface ChildConnectorApi {
44
44
  * @deprecated Use { ChildConnectorApi.onAssetsFilterBarValuesChanged} instead.
45
45
  */
46
46
  onFilterBarValuesChanged: (filters: FilterBarValues | null) => void;
47
+ /**
48
+ * Gets called when the widget poll interval changes.
49
+ *
50
+ * @param pollInterval new poll interval
51
+ */
52
+ onWidgetPollIntervalChanged: (pollInterval: number) => void;
47
53
  }
@@ -1,4 +1,4 @@
1
- import { AssetSortingContextValue, ConfirmationDialogContextValue, CurrentUserContextInterface, FilterBarValues, IAnalyticsContextAsync, ICurrentUserPreferenceContext, IEnvironmentContext, INavigationContext, ITokenContext, IUserSubscriptionContext, ModalDialogContextValue, OemBrandingContext, TemporalPeriod, TimeRange } from "@trackunit/react-core-contexts-api";
1
+ import { AssetSortingContextValue, ConfirmationDialogContextValue, CurrentUserContextInterface, FilterBarValues, IAnalyticsContextAsync, ICurrentUserPreferenceContext, IEnvironmentContext, INavigationContext, ITokenContext, IUserSubscriptionContext, LoadingState, ModalDialogContextValue, OemBrandingContext, TemporalPeriod, TimeRange } from "@trackunit/react-core-contexts-api";
2
2
  import { AssetInfo } from "./AssetRuntime";
3
3
  import { CustomerInfo } from "./CustomerRuntime";
4
4
  import { EventInfo } from "./EventRuntime";
@@ -20,13 +20,50 @@ export interface HostConnectorApi extends IAnalyticsContextAsync<Record<string,
20
20
  timeRange: TimeRange | null;
21
21
  temporalPeriod: TemporalPeriod | null;
22
22
  }>;
23
+ /**
24
+ * Gets the data of the widget.
25
+ */
23
26
  getWidgetData(): Promise<Record<string, unknown>>;
27
+ /**
28
+ * Sets the data of the widget.
29
+ * Dataversion is used to make it easy for you to see what dataVersion is saved in the widget.
30
+ * Use it to upgrade the widget data to a new version when loading the widget.
31
+ *
32
+ * @param data the data to set
33
+ * @param dataVersion the data version to set
34
+ * @param title the title to set
35
+ */
24
36
  setWidgetData(data: Record<string, unknown>, dataVersion: number, title?: string): Promise<void>;
37
+ /**
38
+ * Gets the data version of the widget.
39
+ * Dataversion is used to make it easy for you to see what dataVersion is saved in the widget.
40
+ * Use it to upgrade the widget data to a new version when loading the widget.
41
+ */
25
42
  getWidgetDataVersion(): Promise<number>;
43
+ /**
44
+ * Gets the title of the widget.
45
+ */
26
46
  getWidgetTitle(): Promise<string>;
47
+ /**
48
+ * Sets the title of the widget.
49
+ */
27
50
  setWidgetTitle(title: string): Promise<void>;
51
+ /**
52
+ * Opens the edit mode of the widget.
53
+ */
28
54
  openEditMode(): Promise<void>;
55
+ /**
56
+ * Closes the edit mode of the widget.
57
+ */
29
58
  closeEditMode(): Promise<void>;
59
+ /**
60
+ * Sets the loading state of the widget.
61
+ */
62
+ setLoadingState(loadingState: LoadingState): Promise<void>;
63
+ /**
64
+ * Gets the poll interval of the widget.
65
+ */
66
+ getWidgetPollInterval(): Promise<number>;
30
67
  /**
31
68
  * @deprecated Use { getAssetsFilterBarValues } instead.
32
69
  * @returns { Promise<FilterBarValues | null> } empty object!
@@ -58,5 +95,17 @@ export interface HostConnectorApi extends IAnalyticsContextAsync<Record<string,
58
95
  getCustomerInfo(): Promise<CustomerInfo>;
59
96
  getEventInfo(): Promise<EventInfo>;
60
97
  getThemeCssProperties(): Promise<ThemeCssProperties | null>;
61
- requestTrackunitRestApi: <T, E>(path: string, method: string, requestParams?: RequestParams, body?: unknown, bodyType?: BodyType, secureByDefault?: boolean) => Promise<HttpResponse<T, E>>;
98
+ /**
99
+ * Requests the rest api.
100
+ *
101
+ * @deprecated Use the Public Graphql instead.
102
+ * @param path the path of the rest api
103
+ * @param method the method of the rest api
104
+ * @param requestParams the request params of the rest api
105
+ * @param body the body of the rest api
106
+ * @param bodyType the body type of the rest api
107
+ * @param secureByDefault
108
+ * @returns { Promise<HttpResponse> } the response from the rest api
109
+ */
110
+ requestTrackunitRestApi: <TData, TError>(path: string, method: string, requestParams?: RequestParams, body?: unknown, bodyType?: BodyType, secureByDefault?: boolean) => Promise<HttpResponse<TData, TError>>;
62
111
  }
@@ -0,0 +1,12 @@
1
+ import { LoadingState } from "@trackunit/react-core-contexts-api";
2
+ export interface WidgetConfigRuntimeApi {
3
+ getData: () => Promise<Record<string, unknown>>;
4
+ setData: (data: Record<string, unknown>, dataVersion: number, title?: string) => Promise<void>;
5
+ getDataVersion: () => Promise<number>;
6
+ openEditMode: () => Promise<void>;
7
+ closeEditMode: () => Promise<void>;
8
+ getTitle: () => Promise<string>;
9
+ setTitle: (title: string) => Promise<void>;
10
+ setLoadingState: (loadingState: LoadingState) => Promise<void>;
11
+ getPollInterval: () => Promise<number>;
12
+ }
package/src/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export * from "./AssetRuntime";
2
2
  export * from "./ChildConnector";
3
3
  export * from "./CurrentUserRuntime";
4
- export * from "./CustomFieldRuntime";
5
4
  export * from "./CustomerRuntime";
5
+ export * from "./CustomFieldRuntime";
6
6
  export * from "./EventRuntime";
7
7
  export * from "./HostConnector";
8
8
  export * from "./NavigationRuntime";
@@ -10,3 +10,4 @@ export * from "./RestRuntime";
10
10
  export * from "./SiteRuntime";
11
11
  export * from "./ThemeCssProperties";
12
12
  export * from "./ToastRuntime";
13
+ export * from "./WidgetConfigRuntime";