react-aiops 0.1.9 → 0.1.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/dist/AIOPsDashboard.d.ts +32 -11
- package/dist/AIOPsDashboard.d.ts.map +1 -1
- package/dist/data/CredentialsModal.d.ts.map +1 -1
- package/dist/data/DataProvider.d.ts +37 -15
- package/dist/data/DataProvider.d.ts.map +1 -1
- package/dist/data/index.d.ts +2 -2
- package/dist/data/index.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +724 -665
- package/package.json +1 -1
package/dist/AIOPsDashboard.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DataBindings } from './data/DataProvider';
|
|
3
3
|
import { ComponentStatus } from './types';
|
|
4
4
|
import { ServiceDialogMetric, ServiceDialogAlert } from './components/ServiceDialog';
|
|
5
5
|
/**
|
|
@@ -47,10 +47,37 @@ export interface AIOPsDashboardProps {
|
|
|
47
47
|
*/
|
|
48
48
|
dataEndpoint?: string;
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
50
|
+
* Maps **service name → prop name → PromQL query**.
|
|
51
|
+
*
|
|
52
|
+
* Each binding is either a bare query string (uses the global
|
|
53
|
+
* `dataTransform`) or `{ query, transform }` for per-binding control.
|
|
54
|
+
*
|
|
55
|
+
* The package automatically injects resolved values as props into
|
|
56
|
+
* the matching child service component (matched by `name`).
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* dataBindings={{
|
|
61
|
+
* "Service Alpha": {
|
|
62
|
+
* cpuLoad: 'cpu_usage{instance="srv-01"}',
|
|
63
|
+
* status: {
|
|
64
|
+
* query: 'up{instance="srv-01"}',
|
|
65
|
+
* transform: (v) => (v > 0 ? "online" : "offline"),
|
|
66
|
+
* },
|
|
67
|
+
* },
|
|
68
|
+
* }}
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
dataBindings?: DataBindings;
|
|
72
|
+
/**
|
|
73
|
+
* Global transform applied to every raw endpoint response before it is
|
|
74
|
+
* injected as a prop. Individual bindings can override this with their
|
|
75
|
+
* own `transform`.
|
|
76
|
+
*
|
|
77
|
+
* Defaults to a Prometheus-aware extractor that returns the scalar
|
|
78
|
+
* value from instant-vector or scalar responses.
|
|
52
79
|
*/
|
|
53
|
-
|
|
80
|
+
dataTransform?: (raw: unknown) => unknown;
|
|
54
81
|
/** Override the default 60 s polling interval (in milliseconds). */
|
|
55
82
|
dataRefreshInterval?: number;
|
|
56
83
|
/**
|
|
@@ -60,11 +87,5 @@ export interface AIOPsDashboardProps {
|
|
|
60
87
|
*/
|
|
61
88
|
children: React.ReactNode;
|
|
62
89
|
}
|
|
63
|
-
|
|
64
|
-
* Full AIOps infrastructure dashboard.
|
|
65
|
-
*
|
|
66
|
-
* Renders a branded header, a 3D carousel of services, and a
|
|
67
|
-
* controls footer. All interaction state is self-contained.
|
|
68
|
-
*/
|
|
69
|
-
export default function AIOPsDashboard({ brandName, brandTag, services, backgroundImage, logoUrl, carouselSpeed: carouselSpeedProp, fontFamily, dataEndpoint, dataQueries, dataRefreshInterval, children, }: AIOPsDashboardProps): import("react/jsx-runtime").JSX.Element;
|
|
90
|
+
export default function AIOPsDashboard(props: AIOPsDashboardProps): import("react/jsx-runtime").JSX.Element;
|
|
70
91
|
//# sourceMappingURL=AIOPsDashboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIOPsDashboard.d.ts","sourceRoot":"","sources":["../src/AIOPsDashboard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"AIOPsDashboard.d.ts","sourceRoot":"","sources":["../src/AIOPsDashboard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;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B,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAMD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAmBhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialsModal.d.ts","sourceRoot":"","sources":["../../src/data/CredentialsModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,UAAU,qBAAqB;IAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"CredentialsModal.d.ts","sourceRoot":"","sources":["../../src/data/CredentialsModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,UAAU,qBAAqB;IAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,2CAkH3E"}
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
/**
|
|
3
|
+
* A single data binding: either a bare PromQL query string (uses the global
|
|
4
|
+
* transform) or an object with a per-binding `transform` override.
|
|
5
|
+
*/
|
|
6
|
+
export type DataBinding = string | {
|
|
7
|
+
query: string;
|
|
8
|
+
transform?: (raw: unknown) => unknown;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Maps **service name → prop name → PromQL binding**.
|
|
12
|
+
*
|
|
13
|
+
* The service name must match the `name` prop on the corresponding child
|
|
14
|
+
* component. Prop names are the component props you want overridden with
|
|
15
|
+
* live data (e.g. `cpuLoad`, `status`).
|
|
16
|
+
*/
|
|
17
|
+
export type DataBindings = Record<string, Record<string, DataBinding>>;
|
|
11
18
|
export interface Credentials {
|
|
12
19
|
accessKey: string;
|
|
13
20
|
secretKey: string;
|
|
14
21
|
}
|
|
15
22
|
export interface DataContextValue {
|
|
16
|
-
/**
|
|
23
|
+
/** Raw endpoint responses keyed by PromQL query string. */
|
|
17
24
|
data: Record<string, unknown>;
|
|
18
25
|
/** Whether a refresh cycle is currently in-flight. */
|
|
19
26
|
isRefreshing: boolean;
|
|
@@ -26,15 +33,30 @@ export interface DataContextValue {
|
|
|
26
33
|
/** Programmatically set credentials (used by the modal). */
|
|
27
34
|
setCredentials: (creds: Credentials) => void;
|
|
28
35
|
}
|
|
29
|
-
/** Access the full data-provider state.
|
|
36
|
+
/** Access the full data-provider state. Throws when called outside a live-data dashboard. */
|
|
30
37
|
export declare function useAIOpsData(): DataContextValue;
|
|
31
|
-
/**
|
|
32
|
-
export declare function
|
|
38
|
+
/** Non-throwing variant — returns `null` when no DataProvider is present. */
|
|
39
|
+
export declare function useAIOpsDataOptional(): DataContextValue | null;
|
|
40
|
+
/** Returns the raw endpoint response for a specific PromQL query string. */
|
|
41
|
+
export declare function useQueryResult(queryString: string): unknown;
|
|
42
|
+
/** Collect every unique PromQL expression from a bindings map. */
|
|
43
|
+
export declare function extractUniqueQueries(bindings: DataBindings): string[];
|
|
44
|
+
/**
|
|
45
|
+
* Default transform that handles the two most common Prometheus response
|
|
46
|
+
* shapes (instant-vector and scalar). Returns a number when possible,
|
|
47
|
+
* otherwise returns the raw value.
|
|
48
|
+
*/
|
|
49
|
+
export declare function defaultDataTransform(response: unknown): unknown;
|
|
50
|
+
export interface DataProviderConfig {
|
|
51
|
+
endpoint: string;
|
|
52
|
+
queries: string[];
|
|
53
|
+
/** Polling interval in ms. Defaults to 60 000 (1 minute). */
|
|
54
|
+
refreshInterval?: number;
|
|
55
|
+
}
|
|
33
56
|
interface DataProviderProps {
|
|
34
57
|
config: DataProviderConfig;
|
|
35
58
|
children: React.ReactNode;
|
|
36
|
-
onRefreshStatusChange?: (error: string | null) => void;
|
|
37
59
|
}
|
|
38
|
-
export default function DataProvider({ config, children
|
|
60
|
+
export default function DataProvider({ config, children }: DataProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
39
61
|
export {};
|
|
40
62
|
//# sourceMappingURL=DataProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataProvider.d.ts","sourceRoot":"","sources":["../../src/data/DataProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8E,MAAM,OAAO,CAAC;AAOnG,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"DataProvider.d.ts","sourceRoot":"","sources":["../../src/data/DataProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8E,MAAM,OAAO,CAAC;AAOnG;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAA;CAAE,CAAC;AAE5F;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAEvE,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC7B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,sDAAsD;IACtD,YAAY,EAAE,OAAO,CAAC;IACtB,wEAAwE;IACxE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,0EAA0E;IAC1E,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B,sDAAsD;IACtD,cAAc,EAAE,OAAO,CAAC;IACxB,4DAA4D;IAC5D,cAAc,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CAChD;AAQD,6FAA6F;AAC7F,wBAAgB,YAAY,IAAI,gBAAgB,CAK/C;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,IAAI,gBAAgB,GAAG,IAAI,CAE9D;AAED,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAG3D;AAMD,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,EAAE,CAQrE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAyB/D;AAMD,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,UAAU,iBAAiB;IACvB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CA0F3E"}
|
package/dist/data/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as DataProvider } from './DataProvider';
|
|
2
|
-
export { useAIOpsData, useQueryResult } from './DataProvider';
|
|
3
|
-
export type {
|
|
2
|
+
export { useAIOpsData, useAIOpsDataOptional, useQueryResult, extractUniqueQueries, defaultDataTransform, } from './DataProvider';
|
|
3
|
+
export type { DataBinding, DataBindings, DataProviderConfig, Credentials, DataContextValue, } from './DataProvider';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/data/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EACH,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,GACvB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACR,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,gBAAgB,GACnB,MAAM,gBAAgB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export * from './services';
|
|
|
5
5
|
export * from './types';
|
|
6
6
|
export { STATUS_CFG, HOLO_CYAN, HOLO_BLUE, HOLO_SURFACE, HOLO_GLASS, makeFaceStyles } from './theme';
|
|
7
7
|
export type { ComponentStatus, StatusCfg, FaceName, Base3DProps } from './theme';
|
|
8
|
-
export { DataProvider, useAIOpsData, useQueryResult } from './data';
|
|
9
|
-
export type {
|
|
8
|
+
export { DataProvider, useAIOpsData, useAIOpsDataOptional, useQueryResult, defaultDataTransform, } from './data';
|
|
9
|
+
export type { DataBinding, DataBindings, DataProviderConfig, Credentials, DataContextValue } from './data';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzE,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACrG,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACjF,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzE,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACrG,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACjF,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,oBAAoB,GACvB,MAAM,QAAQ,CAAC;AAChB,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC"}
|