@ixon-cdk/types 1.2.0-next.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/README.md +3 -0
- package/dist/component-devkit/src/types/src/index.d.ts +7 -0
- package/dist/types/backend-component/backend-component-call.d.ts +18 -0
- package/dist/types/backend-component/backend-component-client.d.ts +12 -0
- package/dist/types/backend-component/backend-component-result.d.ts +6 -0
- package/dist/types/backend-component/index.d.ts +3 -0
- package/dist/types/component-context/app-data.d.ts +32 -0
- package/dist/types/component-context/index.d.ts +181 -0
- package/dist/types/component-context/input.d.ts +19 -0
- package/dist/types/component-context/tooltip.d.ts +14 -0
- package/dist/types/ixapi/index.d.ts +12 -0
- package/dist/types/logging-data/index.d.ts +8 -0
- package/dist/types/logging-data/logging-data-blob.d.ts +9 -0
- package/dist/types/logging-data/logging-data-client.d.ts +30 -0
- package/dist/types/logging-data/logging-data-metric.d.ts +17 -0
- package/dist/types/logging-data/logging-data-query-options.d.ts +29 -0
- package/dist/types/logging-data/logging-data-query-ref.d.ts +8 -0
- package/dist/types/logging-data/logging-data-query.d.ts +103 -0
- package/dist/types/logging-data/logging-data-time-range.d.ts +7 -0
- package/dist/types/logging-data/logging-data-value.d.ts +9 -0
- package/dist/types/resource-data/index.d.ts +4 -0
- package/dist/types/resource-data/resource-data-client.d.ts +57 -0
- package/dist/types/resource-data/resource-data-query.d.ts +36 -0
- package/dist/types/resource-data/resource-data-result.d.ts +6 -0
- package/dist/types/resource-data/resource-data.d.ts +142 -0
- package/dist/types/vpn-client/index.d.ts +19 -0
- package/package.json +11 -0
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from '../../../../types/component-context';
|
|
2
|
+
export * from '../../../../types/backend-component';
|
|
3
|
+
export * from '../../../../types/component-context';
|
|
4
|
+
export * from '../../../../types/ixapi';
|
|
5
|
+
export * from '../../../../types/logging-data';
|
|
6
|
+
export * from '../../../../types/resource-data';
|
|
7
|
+
export * from '../../../../types/vpn-client';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @module BackendComponentCall */
|
|
2
|
+
export interface BackendComponentCall {
|
|
3
|
+
/**
|
|
4
|
+
* String reference unique to the query call made by the client
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
7
|
+
_clientRef?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The name of the function you want to call
|
|
10
|
+
*/
|
|
11
|
+
functionName: string;
|
|
12
|
+
/**
|
|
13
|
+
* Arguments you want to pass to the function
|
|
14
|
+
*/
|
|
15
|
+
functionArguments?: {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @module BackendComponentClient */
|
|
2
|
+
import type { BackendComponentResult } from './backend-component-result';
|
|
3
|
+
export interface BackendComponentClient {
|
|
4
|
+
destroy(): void;
|
|
5
|
+
/**
|
|
6
|
+
* @param {string} functionName The name of the Custom Backend Component function you want to call
|
|
7
|
+
* @param {{ [key: string]: any }} functionArguments The arguments you want to pass to the Custom Backend Component function
|
|
8
|
+
*/
|
|
9
|
+
call(functionName: string, functionArguments?: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}): Promise<BackendComponentResult>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ComponentContextAppData {
|
|
2
|
+
accessToken: {
|
|
3
|
+
publicId: string | null;
|
|
4
|
+
/**
|
|
5
|
+
* Used as a bearer token for authenticating API-requests
|
|
6
|
+
*/
|
|
7
|
+
secretId: string | null;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The API ID of the application the component is used in
|
|
11
|
+
*/
|
|
12
|
+
apiAppId: string;
|
|
13
|
+
/**
|
|
14
|
+
* The version of the IXON API used.
|
|
15
|
+
*/
|
|
16
|
+
apiVersion: string;
|
|
17
|
+
company: {
|
|
18
|
+
publicId: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The language of the platform.
|
|
22
|
+
*/
|
|
23
|
+
language: string;
|
|
24
|
+
/**
|
|
25
|
+
* The locale of the platform as an [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag)
|
|
26
|
+
*/
|
|
27
|
+
locale: string;
|
|
28
|
+
/**
|
|
29
|
+
* The time zone of the platform.
|
|
30
|
+
*/
|
|
31
|
+
timeZone: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/** @module ComponentContext */
|
|
2
|
+
import type { BackendComponentClient } from '../backend-component';
|
|
3
|
+
import type { LoggingDataClient, LoggingDataTimeRange } from '../logging-data';
|
|
4
|
+
import type { ResourceDataClient } from '../resource-data';
|
|
5
|
+
import type { VpnClientStatus } from '../vpn-client';
|
|
6
|
+
import type { ComponentContextAppData } from './app-data';
|
|
7
|
+
import type { Tooltip, TooltipOptions } from './tooltip';
|
|
8
|
+
export type { ComponentContextAppData } from './app-data';
|
|
9
|
+
export type { Tooltip, TooltipOptions } from './tooltip';
|
|
10
|
+
export * from './input';
|
|
11
|
+
/**
|
|
12
|
+
* The Component Context provides access to the component's inputs, the page's time range, to the LoggingDataClient and ResourceDataClient and to other application data.
|
|
13
|
+
*/
|
|
14
|
+
export interface ComponentContext<ComponentContextInputs extends object = {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}> {
|
|
17
|
+
/**
|
|
18
|
+
* Application data.
|
|
19
|
+
*/
|
|
20
|
+
appData: ComponentContextAppData;
|
|
21
|
+
/**
|
|
22
|
+
* The component's base URL. This can be used to compose an absolute URL to a static component asset.
|
|
23
|
+
*
|
|
24
|
+
* For example:
|
|
25
|
+
*
|
|
26
|
+
* ```
|
|
27
|
+
* new URL('./static/image.png', context.componentBaseUrl).href;
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @experimental
|
|
31
|
+
*/
|
|
32
|
+
componentBaseUrl: string;
|
|
33
|
+
/**
|
|
34
|
+
* True if `destroy` is called and has destroyed all clients.
|
|
35
|
+
*/
|
|
36
|
+
destroyed: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 'edit' when the component is used in the Studio, else 'view'.
|
|
39
|
+
*/
|
|
40
|
+
mode: 'edit' | 'view';
|
|
41
|
+
/**
|
|
42
|
+
* Values for the inputs declared in the components
|
|
43
|
+
* [manifest file](https://developer.ixon.cloud/docs/manifest-file)
|
|
44
|
+
*/
|
|
45
|
+
inputs: ComponentContextInputs;
|
|
46
|
+
/**
|
|
47
|
+
* Values for the inputs declared in the components
|
|
48
|
+
* [manifest file](https://developer.ixon.cloud/docs/manifest-file) as a Javascript Map.
|
|
49
|
+
*/
|
|
50
|
+
inputMap: Map<string, any>;
|
|
51
|
+
/**
|
|
52
|
+
* Snapshot of the current time range
|
|
53
|
+
*/
|
|
54
|
+
timeRange: LoggingDataTimeRange;
|
|
55
|
+
/**
|
|
56
|
+
* If the time range is adjustable.
|
|
57
|
+
*/
|
|
58
|
+
timeRangeIsAdjustable: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Snapshot of the current VPN client status.
|
|
61
|
+
*/
|
|
62
|
+
vpnClientStatus: VpnClientStatus | null;
|
|
63
|
+
/**
|
|
64
|
+
* Called when the time range is changed
|
|
65
|
+
*/
|
|
66
|
+
ontimerangechange: ((newTimeRange: LoggingDataTimeRange) => any) | null;
|
|
67
|
+
/**
|
|
68
|
+
* Called when the VPN client status changes
|
|
69
|
+
*/
|
|
70
|
+
onvpnclientstatuschange: ((newStatus: VpnClientStatus | null) => any) | null;
|
|
71
|
+
/**
|
|
72
|
+
* Creates a client to call backend components.
|
|
73
|
+
*
|
|
74
|
+
* Every time this method is called, a new client is created.
|
|
75
|
+
*
|
|
76
|
+
* @experimental This feature is in development. It might not be supported in your environment
|
|
77
|
+
* and might also be removed without prior notice.
|
|
78
|
+
* @ignore
|
|
79
|
+
*/
|
|
80
|
+
createBackendComponentClient(): BackendComponentClient;
|
|
81
|
+
/**
|
|
82
|
+
* Creates a client to retrieve logging data.
|
|
83
|
+
*
|
|
84
|
+
* Every time this method is called, a new client is created.
|
|
85
|
+
*/
|
|
86
|
+
createLoggingDataClient(): LoggingDataClient;
|
|
87
|
+
/**
|
|
88
|
+
* Creates a client to retrieve resource data.
|
|
89
|
+
*
|
|
90
|
+
* Every time this method is called, a new client is created.
|
|
91
|
+
*/
|
|
92
|
+
createResourceDataClient(): ResourceDataClient;
|
|
93
|
+
/**
|
|
94
|
+
* Attaches a tooltip on the target element.
|
|
95
|
+
*
|
|
96
|
+
* @param target the target element
|
|
97
|
+
* @param options configures the tooltip message and other (optional) properties
|
|
98
|
+
* @returns returns the tooltip instance
|
|
99
|
+
*
|
|
100
|
+
* @experimental
|
|
101
|
+
*/
|
|
102
|
+
createTooltip(target: HTMLElement, options: TooltipOptions): Tooltip;
|
|
103
|
+
/**
|
|
104
|
+
* Destroy the clients associated to this context and destroy the context.
|
|
105
|
+
*/
|
|
106
|
+
destroy(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Get the endpoint for a resource, the rel.
|
|
109
|
+
*
|
|
110
|
+
* @param rel The name of the resource, see [the reference](https://developer.ixon.cloud/reference)
|
|
111
|
+
* for all resource relations.
|
|
112
|
+
* @param params Extra query parameters, see [the reference](https://developer.ixon.cloud/reference)
|
|
113
|
+
* for all the URL and query paramaters that can be used for a specific resource.
|
|
114
|
+
*/
|
|
115
|
+
getApiUrl(rel: string, params?: {
|
|
116
|
+
[param: string]: string;
|
|
117
|
+
}): string;
|
|
118
|
+
/**
|
|
119
|
+
* Use this method to navigate to a specific page in the portal, for example the VNC-viewer.
|
|
120
|
+
* Don't use this method to navigate to navigate outside the Portal.
|
|
121
|
+
*
|
|
122
|
+
* @param url The URL to navigate to, don't include the host.
|
|
123
|
+
*/
|
|
124
|
+
navigateByUrl(url: string): void;
|
|
125
|
+
/**
|
|
126
|
+
* Save a file.
|
|
127
|
+
*
|
|
128
|
+
* @param data the file data to save
|
|
129
|
+
* @param fileName the name of the file
|
|
130
|
+
*/
|
|
131
|
+
saveAsFile(data: string | Blob, fileName: string): void;
|
|
132
|
+
/**
|
|
133
|
+
* Set a new time range. Check `timeRangeIsAdjustable` to verify the time range is adjustable
|
|
134
|
+
*
|
|
135
|
+
* @param timeRange The time range to change to
|
|
136
|
+
*/
|
|
137
|
+
setTimeRange(timeRange: LoggingDataTimeRange): void;
|
|
138
|
+
/**
|
|
139
|
+
* Open a dialog with VPN status details for an agent.
|
|
140
|
+
*
|
|
141
|
+
* @param agentId The agent to show VPN status info for
|
|
142
|
+
*/
|
|
143
|
+
showVpnStatusDetails(agentId: string): void;
|
|
144
|
+
/**
|
|
145
|
+
* Tests whether the currently logged in user has VPN access to the Agent with the given {@code agentId}.
|
|
146
|
+
* @param agentId the Agent ID
|
|
147
|
+
* @returns true if the user has access, false otherwise
|
|
148
|
+
*/
|
|
149
|
+
testVpnAccess(agentId: string): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Connects or disconnects the VPN-client
|
|
152
|
+
*
|
|
153
|
+
* @param agentId The public ID of the agent to connect to or disconnect from.
|
|
154
|
+
*/
|
|
155
|
+
toggleVpn(agentId: string): void;
|
|
156
|
+
/**
|
|
157
|
+
* Translate a key to the users language.
|
|
158
|
+
*
|
|
159
|
+
* @param key
|
|
160
|
+
* @param interpolateParams
|
|
161
|
+
*/
|
|
162
|
+
translate(key: string | Array<string>, interpolateParams?: Object): string | any;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* A ComponentContext factory is injected into each component. Through this factory, a ComponentContext instance can be constructed.
|
|
166
|
+
*/
|
|
167
|
+
export type ComponentContextFactory = <T extends object = {
|
|
168
|
+
[key: string]: any;
|
|
169
|
+
}>(options?: ComponentContextOptions) => ComponentContext<T>;
|
|
170
|
+
export interface ComponentContextOptions {
|
|
171
|
+
/**
|
|
172
|
+
* Migrate the inputs from an earlier version to the current version of the component.
|
|
173
|
+
*
|
|
174
|
+
* @param inputs the inputs of this component for an earlier version of the component
|
|
175
|
+
* @param version the version of the component for which the inputs were for, or null if the version is unknown
|
|
176
|
+
* @returns the inputs for the current version of the component
|
|
177
|
+
*/
|
|
178
|
+
migrateInputs?: (inputs: any, version: string | null) => {
|
|
179
|
+
[key: string]: any;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ComponentContextAggregatedMetricInput {
|
|
2
|
+
aggregator: string;
|
|
3
|
+
decimals: number | null;
|
|
4
|
+
factor: number | null;
|
|
5
|
+
selector: string;
|
|
6
|
+
transform: null;
|
|
7
|
+
unit: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface ComponentContextLiveMetricInput {
|
|
10
|
+
decimals: number | null;
|
|
11
|
+
factor: number | null;
|
|
12
|
+
selector: string;
|
|
13
|
+
unit: string | null;
|
|
14
|
+
}
|
|
15
|
+
export type ComponentContextInput = ComponentContextInputGroup | string | number | ComponentContextAggregatedMetricInput | ComponentContextLiveMetricInput | null;
|
|
16
|
+
export type ComponentContextInputGroup = ComponentContextInputs;
|
|
17
|
+
export type ComponentContextInputs = {
|
|
18
|
+
[key: string]: ComponentContextInput | ComponentContextInputGroup;
|
|
19
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @module Tooltip */
|
|
2
|
+
export interface Tooltip {
|
|
3
|
+
destroy(): void;
|
|
4
|
+
disable(): void;
|
|
5
|
+
enable(): void;
|
|
6
|
+
setMessage(message: string): void;
|
|
7
|
+
}
|
|
8
|
+
export interface TooltipOptions {
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
hideDelay?: number;
|
|
11
|
+
message: string;
|
|
12
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
13
|
+
showDelay?: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface IxApiError {
|
|
2
|
+
listIndex?: number;
|
|
3
|
+
message: string;
|
|
4
|
+
propertyName?: string;
|
|
5
|
+
}
|
|
6
|
+
export type IxApiErrorResponse = IxApiResponse<IxApiError[]>;
|
|
7
|
+
export interface IxApiResponse<T> {
|
|
8
|
+
data: T;
|
|
9
|
+
moreAfter?: string | null;
|
|
10
|
+
status?: 'success' | 'error';
|
|
11
|
+
type?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './logging-data-blob';
|
|
2
|
+
export * from './logging-data-client';
|
|
3
|
+
export * from './logging-data-metric';
|
|
4
|
+
export * from './logging-data-query-options';
|
|
5
|
+
export * from './logging-data-query';
|
|
6
|
+
export * from './logging-data-query';
|
|
7
|
+
export * from './logging-data-time-range';
|
|
8
|
+
export * from './logging-data-value';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @module LoggingDataBlob */
|
|
2
|
+
import type { LoggingDataQueryRef } from './logging-data-query-ref';
|
|
3
|
+
/** The result of a single export request. */
|
|
4
|
+
export interface LoggingDataBlob {
|
|
5
|
+
/** Indicates the queries that are included in the blob. */
|
|
6
|
+
queryRefs: LoggingDataQueryRef[];
|
|
7
|
+
/** Contents of the export response. */
|
|
8
|
+
blob: Blob;
|
|
9
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** @module LoggingDataClient */
|
|
2
|
+
import type { LoggingDataBlob } from './logging-data-blob';
|
|
3
|
+
import type { LoggingDataMetric } from './logging-data-metric';
|
|
4
|
+
import type { LoggingDataQuery } from './logging-data-query';
|
|
5
|
+
import type { LoggingDataQueryOptions } from './logging-data-query-options';
|
|
6
|
+
export interface LoggingDataClient {
|
|
7
|
+
/**
|
|
8
|
+
* Destroy the client. Always call this when the client is not used anymore. When the context is
|
|
9
|
+
* destroyed, this is called automatically
|
|
10
|
+
*/
|
|
11
|
+
destroy(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Starts a query for logging data. This method can be used for historic and live data depending
|
|
14
|
+
* on the selector.
|
|
15
|
+
*
|
|
16
|
+
* @returns {function()} Returns a deregistration function for the listener.
|
|
17
|
+
*/
|
|
18
|
+
query(query: LoggingDataQuery, listener: (result: LoggingDataMetric[]) => any): () => void;
|
|
19
|
+
query(queries: LoggingDataQuery[], listener: (results: LoggingDataMetric[][]) => any): () => void;
|
|
20
|
+
query<T extends LoggingDataQueryOptions>(queryOptions: T,
|
|
21
|
+
/**
|
|
22
|
+
* Depending on the `format` in the query options, the query listener result has a specific type.
|
|
23
|
+
*
|
|
24
|
+
* - If `format` is `'csv'`, the result type is `LoggingDataBlob`
|
|
25
|
+
* - Otherwise, the result type is `LoggingDataMetric[][]`
|
|
26
|
+
*/
|
|
27
|
+
listener: (results: T extends {
|
|
28
|
+
format: 'csv';
|
|
29
|
+
} ? LoggingDataBlob : LoggingDataMetric[][]) => void): () => void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @module LoggingDataMetric */
|
|
2
|
+
import type { LoggingDataQueryRef } from './logging-data-query-ref';
|
|
3
|
+
import type { LoggingDataValue } from './logging-data-value';
|
|
4
|
+
export interface LoggingDataMetric {
|
|
5
|
+
/**
|
|
6
|
+
* The ref provided in the query, else this is generated
|
|
7
|
+
*/
|
|
8
|
+
queryRef: LoggingDataQueryRef;
|
|
9
|
+
/**
|
|
10
|
+
* The time the value was logged
|
|
11
|
+
*/
|
|
12
|
+
time: number;
|
|
13
|
+
/**
|
|
14
|
+
* The queries result value
|
|
15
|
+
*/
|
|
16
|
+
value: LoggingDataValue;
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** @module LoggingDataQueryOptions */
|
|
2
|
+
import type { LoggingDataQuery } from './logging-data-query';
|
|
3
|
+
export interface LoggingDataQueryOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Specifies the delimiter used to separate columns in the returned CSV data.
|
|
6
|
+
*
|
|
7
|
+
* Only applicable for format `'csv'`
|
|
8
|
+
*
|
|
9
|
+
* Defaults to `'comma'`
|
|
10
|
+
* */
|
|
11
|
+
csvDelimiter?: 'comma' | 'tab' | 'semicolon';
|
|
12
|
+
queries: LoggingDataQuery[];
|
|
13
|
+
/**
|
|
14
|
+
* Specifies the format of the returned metrics.
|
|
15
|
+
* - If `format` is `'metrics'`, the listener is called with `LoggingDataMetric[][]`.
|
|
16
|
+
* - If `format` is `'csv'`, the listener is called at most once with `LoggingDataBlob`.
|
|
17
|
+
*
|
|
18
|
+
* Defaults to `'metrics'`
|
|
19
|
+
*/
|
|
20
|
+
format?: 'csv' | 'metrics';
|
|
21
|
+
/**
|
|
22
|
+
* Specifies whether the query listener should be automatically removed after it gets invoked.
|
|
23
|
+
*
|
|
24
|
+
* Not applicable for format `'csv'`, because this format implies the automatic listener removal after invocation behaviour.
|
|
25
|
+
*
|
|
26
|
+
* Defaults to `false`
|
|
27
|
+
*/
|
|
28
|
+
once?: boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/** @module LoggingDataQuery */
|
|
2
|
+
export interface LoggingDataQuery {
|
|
3
|
+
/**
|
|
4
|
+
* String reference unique to the query call made by the client
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
7
|
+
_clientRef?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Timestamp for when the query was dispatched by the client
|
|
10
|
+
* @ignore
|
|
11
|
+
*/
|
|
12
|
+
_timeStamp?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Number of decimals to be returned
|
|
15
|
+
*/
|
|
16
|
+
decimals?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Whether or not you want to query for extra data-points, one before the start date and one beyond the end date (if they exist).
|
|
19
|
+
*/
|
|
20
|
+
extendedBoundary?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The factor to multiply the value by
|
|
23
|
+
*/
|
|
24
|
+
factor?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Used to override the global time-range for this specific query
|
|
27
|
+
*
|
|
28
|
+
* For example 2019-01-01T00:00:00Z
|
|
29
|
+
*/
|
|
30
|
+
from?: string;
|
|
31
|
+
/**
|
|
32
|
+
* How many values should be fetched. The postAggr is applied to reduce the set of points to the limit.
|
|
33
|
+
*/
|
|
34
|
+
limit?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Starting point for returned values
|
|
37
|
+
*
|
|
38
|
+
* Must be null if postAggr is set
|
|
39
|
+
*/
|
|
40
|
+
offset?: number;
|
|
41
|
+
/**
|
|
42
|
+
* The order to order datapoints by
|
|
43
|
+
*/
|
|
44
|
+
order?: 'asc' | 'desc';
|
|
45
|
+
/**
|
|
46
|
+
* Aggregrator for aggregation after data storage
|
|
47
|
+
*
|
|
48
|
+
* Must be null if offset is set
|
|
49
|
+
*/
|
|
50
|
+
postAggr?: Aggregrator;
|
|
51
|
+
/**
|
|
52
|
+
* Apply a transform. Only applies when postAggr is `'last'`.
|
|
53
|
+
*
|
|
54
|
+
* `'difference'` takes the difference between the last value in a bucket and the bucket before it.
|
|
55
|
+
*/
|
|
56
|
+
postTransform?: Transform | null;
|
|
57
|
+
/**
|
|
58
|
+
* When omitted, the pre-aggregator is determined automatically based on a couple of factors, but
|
|
59
|
+
* in most cases it defaults to "raw".
|
|
60
|
+
*/
|
|
61
|
+
preAggr?: Aggregrator;
|
|
62
|
+
/**
|
|
63
|
+
* Reference to identify the value by. If this is not set, a unique reference is generated.
|
|
64
|
+
*/
|
|
65
|
+
ref?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The selector for getting data from a specific tag or variable. Can be used instead of tag or
|
|
68
|
+
* variable field
|
|
69
|
+
*
|
|
70
|
+
* Formatted as <dataSource>.<logType>.<logName> where <dataSource> is the name of the datas source,
|
|
71
|
+
* <logType> is 'tag' or 'variable' and <logName> is the slug of the tag or variable.
|
|
72
|
+
*/
|
|
73
|
+
selector?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Number of seconds between subsequent data-points
|
|
76
|
+
*/
|
|
77
|
+
step?: number;
|
|
78
|
+
/**
|
|
79
|
+
* The tag to fetch the data from. Must be null if variable is set
|
|
80
|
+
*/
|
|
81
|
+
tag?: {
|
|
82
|
+
publicId: string;
|
|
83
|
+
} | null;
|
|
84
|
+
/**
|
|
85
|
+
* Used to override the global time-range for this specific query
|
|
86
|
+
*
|
|
87
|
+
* For example 2019-01-01T23:59:59Z
|
|
88
|
+
*/
|
|
89
|
+
to?: string;
|
|
90
|
+
/**
|
|
91
|
+
* The unit of the value
|
|
92
|
+
*/
|
|
93
|
+
unit?: string;
|
|
94
|
+
/**
|
|
95
|
+
* The variable to fetch the data from. Must be null if tag is set
|
|
96
|
+
*/
|
|
97
|
+
variable?: {
|
|
98
|
+
publicId: string;
|
|
99
|
+
} | null;
|
|
100
|
+
}
|
|
101
|
+
type Aggregrator = 'count' | 'distinct' | 'integral' | 'mean' | 'median' | 'mode' | 'spread' | 'stddev' | 'sum' | 'first' | 'last' | 'max' | 'min' | 'raw';
|
|
102
|
+
type Transform = 'difference';
|
|
103
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @module LoggingDataValue */
|
|
2
|
+
export interface LoggingDataValue {
|
|
3
|
+
setDecimals(newDecimals: number): void;
|
|
4
|
+
/** @deprecated */
|
|
5
|
+
setFactor(newFactor: number): void;
|
|
6
|
+
setUnit(newUnit: string): void;
|
|
7
|
+
getValue(): boolean | number | string | null;
|
|
8
|
+
toString(): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** @module ResourceDataClient */
|
|
2
|
+
import type { ResourceDataQuery, ResourceDataQuerySelector, ResourceDataTemplateQuery } from './resource-data-query';
|
|
3
|
+
import type { ResourceDataResult } from './resource-data-result';
|
|
4
|
+
import type { ResourceData } from './resource-data';
|
|
5
|
+
interface ResultDataMap {
|
|
6
|
+
Agent: ResourceData.Agent;
|
|
7
|
+
Asset: ResourceData.Asset;
|
|
8
|
+
Branding: ResourceData.Branding;
|
|
9
|
+
CustomPropertyList: ResourceData.CustomProperty[];
|
|
10
|
+
GroupList: ResourceData.Group[];
|
|
11
|
+
MyUser: ResourceData.MyUser;
|
|
12
|
+
PagePage: ResourceData.PagePage;
|
|
13
|
+
PageVersion: ResourceData.PageVersion;
|
|
14
|
+
}
|
|
15
|
+
export interface ResourceDataClient {
|
|
16
|
+
destroy(): void;
|
|
17
|
+
/**
|
|
18
|
+
* @returns {function()} Returns a deregistration function for the listener.
|
|
19
|
+
*/
|
|
20
|
+
query<T extends ResourceDataQuerySelector>(query: ResourceDataQuery<T> | [ResourceDataQuery<T>], listener: (results: [ResourceDataResult<ResultDataMap[T]>]) => any): () => void;
|
|
21
|
+
query<T1 extends ResourceDataQuerySelector, T2 extends ResourceDataQuerySelector>(query: [ResourceDataQuery<T1>, ResourceDataQuery<T2>], listener: (results: [ResourceDataResult<ResultDataMap[T1]>, ResourceDataResult<ResultDataMap[T2]>]) => any): () => void;
|
|
22
|
+
query<T1 extends ResourceDataQuerySelector, T2 extends ResourceDataQuerySelector, T3 extends ResourceDataQuerySelector>(query: [ResourceDataQuery<T1>, ResourceDataQuery<T2>, ResourceDataQuery<T3>], listener: (results: [
|
|
23
|
+
ResourceDataResult<ResultDataMap[T1]>,
|
|
24
|
+
ResourceDataResult<ResultDataMap[T2]>,
|
|
25
|
+
ResourceDataResult<ResultDataMap[T3]>
|
|
26
|
+
]) => any): () => void;
|
|
27
|
+
query<T1 extends ResourceDataQuerySelector, T2 extends ResourceDataQuerySelector, T3 extends ResourceDataQuerySelector, T4 extends ResourceDataQuerySelector>(query: [ResourceDataQuery<T1>, ResourceDataQuery<T2>, ResourceDataQuery<T3>], listener: (results: [
|
|
28
|
+
ResourceDataResult<ResultDataMap[T1]>,
|
|
29
|
+
ResourceDataResult<ResultDataMap[T2]>,
|
|
30
|
+
ResourceDataResult<ResultDataMap[T3]>,
|
|
31
|
+
ResourceDataResult<ResultDataMap[T4]>
|
|
32
|
+
]) => any): () => void;
|
|
33
|
+
query<T1 extends ResourceDataQuerySelector, T2 extends ResourceDataQuerySelector, T3 extends ResourceDataQuerySelector, T4 extends ResourceDataQuerySelector>(query: [ResourceDataQuery<T1>, ResourceDataQuery<T2>, ResourceDataQuery<T3>, ResourceDataQuery<T4>], listener: (results: [
|
|
34
|
+
ResourceDataResult<ResultDataMap[T1]>,
|
|
35
|
+
ResourceDataResult<ResultDataMap[T2]>,
|
|
36
|
+
ResourceDataResult<ResultDataMap[T3]>,
|
|
37
|
+
ResourceDataResult<ResultDataMap[T4]>
|
|
38
|
+
]) => any): () => void;
|
|
39
|
+
query<T1 extends ResourceDataQuerySelector, T2 extends ResourceDataQuerySelector, T3 extends ResourceDataQuerySelector, T4 extends ResourceDataQuerySelector, T5 extends ResourceDataQuerySelector>(query: [
|
|
40
|
+
ResourceDataQuery<T1>,
|
|
41
|
+
ResourceDataQuery<T2>,
|
|
42
|
+
ResourceDataQuery<T3>,
|
|
43
|
+
ResourceDataQuery<T4>,
|
|
44
|
+
ResourceDataQuery<T5>
|
|
45
|
+
], listener: (results: [
|
|
46
|
+
ResourceDataResult<ResultDataMap[T1]>,
|
|
47
|
+
ResourceDataResult<ResultDataMap[T2]>,
|
|
48
|
+
ResourceDataResult<ResultDataMap[T3]>,
|
|
49
|
+
ResourceDataResult<ResultDataMap[T4]>,
|
|
50
|
+
ResourceDataResult<ResultDataMap[T5]>
|
|
51
|
+
]) => any): () => void;
|
|
52
|
+
/**
|
|
53
|
+
* @returns {function()} Returns a deregistration function for the listener.
|
|
54
|
+
*/
|
|
55
|
+
render(templates: ResourceDataTemplateQuery[], listener: (results: string[]) => void): () => void;
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** @module ResourceDataQuery */
|
|
2
|
+
export type ResourceDataQuerySelector = 'Agent' | 'Asset' | 'Branding' | 'CustomPropertyList' | 'GroupList' | 'MyUser' | 'PagePage' | 'PageVersion';
|
|
3
|
+
export interface ResourceDataQuery<T = ResourceDataQuerySelector> {
|
|
4
|
+
/**
|
|
5
|
+
* String reference unique to the query call made by the client
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
8
|
+
_clientRef?: string | string[];
|
|
9
|
+
/**
|
|
10
|
+
* List of fields to get from the resource, see the
|
|
11
|
+
* [developer documentation](https://developer.ixon.cloud/docs/using-the-resourcedataclient) for
|
|
12
|
+
* supported fields.
|
|
13
|
+
*/
|
|
14
|
+
fields: string[];
|
|
15
|
+
/**
|
|
16
|
+
* The name of the resource, see the
|
|
17
|
+
* [developer documentation](https://developer.ixon.cloud/docs/using-the-resourcedataclient) for
|
|
18
|
+
* supported resources
|
|
19
|
+
*/
|
|
20
|
+
selector: T;
|
|
21
|
+
}
|
|
22
|
+
export interface ResourceDataTemplateQuery {
|
|
23
|
+
/**
|
|
24
|
+
* String reference unique to the query call made by the client
|
|
25
|
+
* @ignore
|
|
26
|
+
*/
|
|
27
|
+
_clientRef?: string | string[];
|
|
28
|
+
/**
|
|
29
|
+
* Template to be interpolated. The format should be [Mustache](https://mustache.github.io), see the
|
|
30
|
+
* [developer documentation](https://developer.ixon.cloud/docs/using-the-resourcedataclient) for
|
|
31
|
+
* supported fields. Only 'agent' is supported at the moment.
|
|
32
|
+
*
|
|
33
|
+
* If omitted, an empty object is returned
|
|
34
|
+
*/
|
|
35
|
+
template: string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
interface AgentResourceData {
|
|
2
|
+
activeVpnSession?: {
|
|
3
|
+
rscServer?: {
|
|
4
|
+
name?: string;
|
|
5
|
+
publicId: string;
|
|
6
|
+
} | null;
|
|
7
|
+
vpnAddress?: string;
|
|
8
|
+
} | null;
|
|
9
|
+
connectedUsers?: {
|
|
10
|
+
name?: string;
|
|
11
|
+
publicId: string;
|
|
12
|
+
}[];
|
|
13
|
+
custom?: Record<string, any>;
|
|
14
|
+
dataSources?: {
|
|
15
|
+
name?: string | null;
|
|
16
|
+
publicId: string;
|
|
17
|
+
slug?: string | null;
|
|
18
|
+
}[];
|
|
19
|
+
description?: string | null;
|
|
20
|
+
lastSeenAgentUserAgent?: {
|
|
21
|
+
firmwareVersion?: string | null;
|
|
22
|
+
hardware?: string | null;
|
|
23
|
+
hardwareVersion?: string | null;
|
|
24
|
+
publicId: string;
|
|
25
|
+
} | null;
|
|
26
|
+
location?: {
|
|
27
|
+
name?: string | null;
|
|
28
|
+
} | null;
|
|
29
|
+
loggingMdrServer?: {
|
|
30
|
+
name?: string;
|
|
31
|
+
publicId: string;
|
|
32
|
+
} | null;
|
|
33
|
+
loggingMqttChangedOn?: string | null;
|
|
34
|
+
macAddress?: string | null;
|
|
35
|
+
mdrServer?: {
|
|
36
|
+
name?: string;
|
|
37
|
+
publicId: string;
|
|
38
|
+
} | null;
|
|
39
|
+
memberships?: {
|
|
40
|
+
group?: {
|
|
41
|
+
publicId: string;
|
|
42
|
+
};
|
|
43
|
+
publicId: string;
|
|
44
|
+
}[];
|
|
45
|
+
mqttChangedOn?: string | null;
|
|
46
|
+
name?: string;
|
|
47
|
+
publicId: string;
|
|
48
|
+
rateLimiting?: {
|
|
49
|
+
configMqttCommandCounter?: number;
|
|
50
|
+
configMqttCommandLastHit?: string;
|
|
51
|
+
configMqttCommandLimit?: 'soft' | 'hard' | 'lock' | null;
|
|
52
|
+
configMqttDataCounter?: number;
|
|
53
|
+
configMqttDataLastHit?: string;
|
|
54
|
+
configMqttDataLimit?: 'soft' | 'hard' | 'lock' | null;
|
|
55
|
+
configOpenvpnCounter?: number;
|
|
56
|
+
configOpenvpnLastHit?: string;
|
|
57
|
+
configOpenvpnLimit?: 'soft' | 'hard' | 'lock' | null;
|
|
58
|
+
};
|
|
59
|
+
serialNumber?: string | null;
|
|
60
|
+
servers?: {
|
|
61
|
+
custom?: Record<string, any>;
|
|
62
|
+
name?: string;
|
|
63
|
+
publicId: string;
|
|
64
|
+
serviceGroup?: string | null;
|
|
65
|
+
type?: 'http' | 'rdp' | 'vnc' | 'websocket';
|
|
66
|
+
visibleInMobileApp?: boolean;
|
|
67
|
+
}[];
|
|
68
|
+
type?: {
|
|
69
|
+
name?: string;
|
|
70
|
+
publicId: string;
|
|
71
|
+
};
|
|
72
|
+
vpnVisibleInMobileApp?: boolean;
|
|
73
|
+
}
|
|
74
|
+
interface AssetResourceData {
|
|
75
|
+
custom?: Record<string, any>;
|
|
76
|
+
description?: string | null;
|
|
77
|
+
memberships?: {
|
|
78
|
+
group?: {
|
|
79
|
+
publicId: string;
|
|
80
|
+
};
|
|
81
|
+
publicId: string;
|
|
82
|
+
}[];
|
|
83
|
+
name?: string;
|
|
84
|
+
publicId: string;
|
|
85
|
+
resourceVariant?: {
|
|
86
|
+
publicId: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
interface BrandingResourceData {
|
|
90
|
+
logo?: string | null;
|
|
91
|
+
publicId: string;
|
|
92
|
+
theme?: {
|
|
93
|
+
logoHasBackgroundColor?: boolean;
|
|
94
|
+
} | null;
|
|
95
|
+
}
|
|
96
|
+
interface CustomPropertyResourceData {
|
|
97
|
+
flags?: string[];
|
|
98
|
+
name?: string;
|
|
99
|
+
publicId: string;
|
|
100
|
+
resourceType?: string;
|
|
101
|
+
resourceVariant?: string | null;
|
|
102
|
+
scopeType?: 'glb' | 'app' | 'sct' | 'usr' | 'com';
|
|
103
|
+
slug?: string;
|
|
104
|
+
}
|
|
105
|
+
interface GroupResourceData {
|
|
106
|
+
name?: string | null;
|
|
107
|
+
publicId: string;
|
|
108
|
+
type?: {
|
|
109
|
+
name?: string;
|
|
110
|
+
order?: number;
|
|
111
|
+
publicId: string;
|
|
112
|
+
} | null;
|
|
113
|
+
}
|
|
114
|
+
interface MyUserResourceData {
|
|
115
|
+
custom?: Record<string, any>;
|
|
116
|
+
name?: string;
|
|
117
|
+
publicId: string;
|
|
118
|
+
unreadMessagesCount?: number;
|
|
119
|
+
}
|
|
120
|
+
interface PagePageResourceData {
|
|
121
|
+
order?: number | null;
|
|
122
|
+
publicId: string;
|
|
123
|
+
}
|
|
124
|
+
interface PageVersionResourceData {
|
|
125
|
+
pagePages?: {
|
|
126
|
+
order?: number | null;
|
|
127
|
+
publicId: string;
|
|
128
|
+
}[];
|
|
129
|
+
publicId: string;
|
|
130
|
+
title?: string | null;
|
|
131
|
+
}
|
|
132
|
+
export declare namespace ResourceData {
|
|
133
|
+
type Agent = AgentResourceData;
|
|
134
|
+
type Asset = AssetResourceData;
|
|
135
|
+
type Branding = BrandingResourceData;
|
|
136
|
+
type CustomProperty = CustomPropertyResourceData;
|
|
137
|
+
type Group = GroupResourceData;
|
|
138
|
+
type MyUser = MyUserResourceData;
|
|
139
|
+
type PagePage = PagePageResourceData;
|
|
140
|
+
type PageVersion = PageVersionResourceData;
|
|
141
|
+
}
|
|
142
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface VpnClientStatus {
|
|
2
|
+
activeRequest: VpnClientStatusActiveRequest | '';
|
|
3
|
+
status: 'idle' | 'connecting' | 'connected';
|
|
4
|
+
}
|
|
5
|
+
export interface VpnClientStatusActiveRequest {
|
|
6
|
+
agentId: string;
|
|
7
|
+
companyId: string;
|
|
8
|
+
controllerId: string;
|
|
9
|
+
steps: VpnClientStatusActiveRequestStep[];
|
|
10
|
+
}
|
|
11
|
+
export interface VpnClientStatusActiveRequestStep {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
status: VpnClientStatusActiveRequestStatus;
|
|
15
|
+
}
|
|
16
|
+
export interface VpnClientStatusActiveRequestStatus {
|
|
17
|
+
code: string;
|
|
18
|
+
message: string;
|
|
19
|
+
}
|