@trackunit/iris-app-runtime-core-api 1.7.50 → 1.7.52
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 +5 -3
- package/src/ExportDataRuntime.d.ts +51 -0
- package/src/HostConnector.d.ts +8 -1
- package/src/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/iris-app-runtime-core-api",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.52",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"jest-fetch-mock": "^3.0.3",
|
|
11
|
-
"@trackunit/react-core-contexts-api": "1.8.
|
|
12
|
-
"@trackunit/react-test-setup": "1.4.
|
|
11
|
+
"@trackunit/react-core-contexts-api": "1.8.52",
|
|
12
|
+
"@trackunit/react-test-setup": "1.4.47",
|
|
13
|
+
"@graphql-typed-document-node/core": "^3.2.0",
|
|
14
|
+
"@trackunit/shared-utils": "1.9.47"
|
|
13
15
|
},
|
|
14
16
|
"module": "./index.esm.js",
|
|
15
17
|
"main": "./index.cjs.js",
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { TypedDocumentNode } from "@graphql-typed-document-node/core";
|
|
2
|
+
import { DateTimeFormatType } from "@trackunit/shared-utils";
|
|
3
|
+
type ValuePathType = {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
};
|
|
6
|
+
export interface BaseExportable {
|
|
7
|
+
/**
|
|
8
|
+
* The accessor to use for the value or array of accessors to use for the value.
|
|
9
|
+
* If not provided, the value will not be accessed.
|
|
10
|
+
*/
|
|
11
|
+
accessor: string | Array<string>;
|
|
12
|
+
/**
|
|
13
|
+
* The translation map to use for the value.
|
|
14
|
+
* If not provided, the value will not be translated.
|
|
15
|
+
*/
|
|
16
|
+
translationMap?: ValuePathType | null;
|
|
17
|
+
/**
|
|
18
|
+
* The transformer to use for the value.
|
|
19
|
+
* If not provided, the value will not be transformed.
|
|
20
|
+
*/
|
|
21
|
+
transformer?: {
|
|
22
|
+
type: "customFields";
|
|
23
|
+
id: string;
|
|
24
|
+
} | {
|
|
25
|
+
type: "date";
|
|
26
|
+
format: DateTimeFormatType;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The prefix to add to the value only if the value is not empty
|
|
30
|
+
*/
|
|
31
|
+
prefix?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The postfix to add to the value only if the value is not empty
|
|
34
|
+
*/
|
|
35
|
+
postfix?: string;
|
|
36
|
+
}
|
|
37
|
+
export type ExportableColumn = BaseExportable & {
|
|
38
|
+
id: string;
|
|
39
|
+
header: string;
|
|
40
|
+
};
|
|
41
|
+
export interface ExportDataProps<TData, TVariables> {
|
|
42
|
+
document: TypedDocumentNode<TData, TVariables>;
|
|
43
|
+
variables: TVariables;
|
|
44
|
+
columns: Array<ExportableColumn>;
|
|
45
|
+
name: string;
|
|
46
|
+
headers?: Record<string, string>;
|
|
47
|
+
}
|
|
48
|
+
export interface ExportDataRuntimeApi {
|
|
49
|
+
exportData: <TData, TVariables>(props: ExportDataProps<TData, TVariables>) => Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
package/src/HostConnector.d.ts
CHANGED
|
@@ -2,11 +2,12 @@ import { AssetSortingContextValue, ConfirmationDialogContextValue, CurrentUserCo
|
|
|
2
2
|
import { AssetInfo } from "./AssetRuntime";
|
|
3
3
|
import { CustomerInfo } from "./CustomerRuntime";
|
|
4
4
|
import { EventInfo } from "./EventRuntime";
|
|
5
|
+
import { ExportDataRuntimeApi } from "./ExportDataRuntime";
|
|
5
6
|
import { BodyType, HttpResponse, RequestParams } from "./RestRuntime";
|
|
6
7
|
import { SiteInfo } from "./SiteRuntime";
|
|
7
8
|
import { ThemeCssProperties } from "./ThemeCssProperties";
|
|
8
9
|
import { PublicToast } from "./ToastRuntime";
|
|
9
|
-
export interface HostConnectorApi extends IAnalyticsContextAsync<Record<string, never>>, INavigationContext, OemBrandingContext, ICurrentUserPreferenceContext, ConfirmationDialogContextValue, ModalDialogContextValue {
|
|
10
|
+
export interface HostConnectorApi extends IAnalyticsContextAsync<Record<string, never>>, ExportDataRuntimeApi, INavigationContext, OemBrandingContext, ICurrentUserPreferenceContext, ConfirmationDialogContextValue, ModalDialogContextValue {
|
|
10
11
|
getAssetSortingState(): Promise<AssetSortingContextValue["sortingState"]>;
|
|
11
12
|
setAssetSortingState(...args: Parameters<AssetSortingContextValue["setSortBy"]>): Promise<void>;
|
|
12
13
|
getEnvironmentContext(): Promise<IEnvironmentContext>;
|
|
@@ -87,6 +88,12 @@ export interface HostConnectorApi extends IAnalyticsContextAsync<Record<string,
|
|
|
87
88
|
* @param toast the toast to add
|
|
88
89
|
*/
|
|
89
90
|
addToast(toast: PublicToast): Promise<void | "primaryAction" | "secondaryAction">;
|
|
91
|
+
/**
|
|
92
|
+
* Removes a toast from the host pages toast stack.
|
|
93
|
+
*
|
|
94
|
+
* @param id the id of the toast to remove
|
|
95
|
+
*/
|
|
96
|
+
removeToast(id: string): Promise<void>;
|
|
90
97
|
getAppName(): string | undefined;
|
|
91
98
|
getOrgName(): string | undefined;
|
|
92
99
|
getExtensionName(): string | undefined;
|
package/src/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./CurrentUserRuntime";
|
|
|
4
4
|
export * from "./CustomerRuntime";
|
|
5
5
|
export * from "./CustomFieldRuntime";
|
|
6
6
|
export * from "./EventRuntime";
|
|
7
|
+
export * from "./ExportDataRuntime";
|
|
7
8
|
export * from "./HostConnector";
|
|
8
9
|
export * from "./NavigationRuntime";
|
|
9
10
|
export * from "./RestRuntime";
|