@devicechain/dashboards 0.24.0-rc.1 → 0.25.0-rc.2
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 +5 -1
- package/dist/hub.d.ts +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +137 -6
- package/dist/index.js.map +2 -2
- package/dist/recorded.d.ts +1 -0
- package/dist/time-range.d.ts +40 -0
- package/dist/types.d.ts +2 -1
- package/dist/widget-descriptor.d.ts +1 -0
- package/package.json +3 -3
package/dist/recorded.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ export declare class RecordedDataSource implements WidgetDataSource {
|
|
|
86
86
|
subscribeWidget(datasource: DatasourceSelector, sink: WidgetStreamSink): () => void;
|
|
87
87
|
subscribeMembers(datasource: DatasourceSelector, sink: MemberSink): () => void;
|
|
88
88
|
declaredMetrics(kind: string): Promise<readonly string[] | null>;
|
|
89
|
+
declaredMetricsForDevice(deviceToken: string): Promise<readonly string[] | null>;
|
|
89
90
|
readMemberSeeds(deviceTokens: readonly string[], _plan: MemberSeedPlan, onSeed: (deviceToken: string, seed: MemberSeed | null) => void): Promise<void>;
|
|
90
91
|
subscribeAlarms(subscription: AlarmSubscription, sink: AlarmStreamSink): () => void;
|
|
91
92
|
subscribeCommands(_subscription: CommandSubscription, sink: CommandStreamSink): () => void;
|
package/dist/time-range.d.ts
CHANGED
|
@@ -20,14 +20,33 @@ export declare const DEFAULT_TIME_RANGE_SECONDS: number;
|
|
|
20
20
|
export declare const MIN_TIME_RANGE_SECONDS = 60;
|
|
21
21
|
export declare const MAX_TIME_RANGE_SECONDS: number;
|
|
22
22
|
export declare function isValidSpanSeconds(v: unknown): v is number;
|
|
23
|
+
export interface AbsoluteRange {
|
|
24
|
+
fromMs: number;
|
|
25
|
+
toMs: number;
|
|
26
|
+
}
|
|
23
27
|
export interface TimeRangeState {
|
|
24
28
|
spanSeconds: number;
|
|
25
29
|
paused: boolean;
|
|
26
30
|
pausedAt?: number;
|
|
31
|
+
absolute?: AbsoluteRange;
|
|
27
32
|
}
|
|
33
|
+
export declare const MIN_ABSOLUTE_SPAN_SECONDS = 60;
|
|
34
|
+
export declare const MAX_ABSOLUTE_SPAN_SECONDS: number;
|
|
35
|
+
export declare const EARLIEST_ABSOLUTE_MS: number;
|
|
36
|
+
export declare const ABSOLUTE_FUTURE_SKEW_MS: number;
|
|
37
|
+
export type AbsoluteRangeProblem = 'unparseable' | 'order' | 'tooShort' | 'tooLong' | 'future' | 'tooEarly';
|
|
38
|
+
export declare function absoluteRangeProblem(fromMs: number, toMs: number, now: number): AbsoluteRangeProblem | undefined;
|
|
39
|
+
export declare function isAbsolute(state: TimeRangeState): boolean;
|
|
40
|
+
export declare function absoluteRange(fromMs: number, toMs: number, now?: number): {
|
|
41
|
+
state: TimeRangeState;
|
|
42
|
+
} | {
|
|
43
|
+
problem: AbsoluteRangeProblem;
|
|
44
|
+
};
|
|
45
|
+
export declare function leaveAbsolute(state: TimeRangeState): TimeRangeState;
|
|
28
46
|
export declare function initialTimeRange(defaultSeconds: number | undefined, link?: {
|
|
29
47
|
spanSeconds?: number;
|
|
30
48
|
paused?: boolean;
|
|
49
|
+
absolute?: AbsoluteRange;
|
|
31
50
|
}, now?: number): TimeRangeState;
|
|
32
51
|
export declare function pauseRange(state: TimeRangeState, now: number): TimeRangeState;
|
|
33
52
|
export declare function resumeRange(state: TimeRangeState): TimeRangeState;
|
|
@@ -43,10 +62,31 @@ export declare function bucketSecondsFor(spanSeconds: number): number;
|
|
|
43
62
|
export declare function seedBucketCount(spanSeconds: number): number;
|
|
44
63
|
export declare function parseRangeParam(value: string | null | undefined): number | undefined;
|
|
45
64
|
export declare function parsePausedParam(value: string | null | undefined): boolean;
|
|
65
|
+
export declare function parseInstantParam(value: string | null | undefined): number | undefined;
|
|
66
|
+
export interface AbsoluteLinkRejection {
|
|
67
|
+
reason: AbsoluteRangeProblem | 'incomplete';
|
|
68
|
+
from: string;
|
|
69
|
+
to: string;
|
|
70
|
+
}
|
|
71
|
+
export declare function parseAbsoluteParams(from: string | null | undefined, to: string | null | undefined, now?: number): {
|
|
72
|
+
absolute?: AbsoluteRange;
|
|
73
|
+
rejected?: AbsoluteLinkRejection;
|
|
74
|
+
};
|
|
75
|
+
export declare function absoluteToParams(a: AbsoluteRange): {
|
|
76
|
+
from: string;
|
|
77
|
+
to: string;
|
|
78
|
+
};
|
|
79
|
+
export interface TimeRangeLink {
|
|
80
|
+
spanSeconds?: number;
|
|
81
|
+
paused?: boolean;
|
|
82
|
+
absolute?: AbsoluteRange;
|
|
83
|
+
rejected?: AbsoluteLinkRejection;
|
|
84
|
+
}
|
|
46
85
|
export declare function timeRangeFromSearch(search: string): {
|
|
47
86
|
spanSeconds?: number;
|
|
48
87
|
paused?: boolean;
|
|
49
88
|
};
|
|
89
|
+
export declare function timeRangeLinkFromSearch(search: string, now?: number): TimeRangeLink;
|
|
50
90
|
export declare function presetIdOf(spanSeconds: number): TimeRangePresetId | undefined;
|
|
51
91
|
export declare function spanLabel(spanSeconds: number): string;
|
|
52
92
|
export declare function setBoardTimeRange(def: DashboardDefinition, defaultSeconds: number | undefined): DashboardDefinition;
|
package/dist/types.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface UnboundSelector {
|
|
|
49
49
|
location?: LocationSelection;
|
|
50
50
|
}
|
|
51
51
|
export type DatasourceSelector = DeviceSelector | AnchorSelector | DevicesSelector | RelatedTraversalSelector | SlotSelector | UnboundSelector;
|
|
52
|
-
export declare const WIDGET_TYPES: readonly ['timeseries-chart', 'latest-card', 'gauge', 'table', 'label', 'image', 'alarm-table', 'alarm-count', 'alarm-severity', 'command-button', 'entity-selector', 'map', 'linear-gauge', 'level-gauge', 'battery', 'status-light', 'signal-bars', 'compass', 'progress-ring', 'command-slider', 'command-toggle', 'stat-card', 'bar-chart', 'pie-chart', 'fleet-table', 'fleet-count', 'device-status', 'online-doughnut'];
|
|
52
|
+
export declare const WIDGET_TYPES: readonly ['timeseries-chart', 'latest-card', 'gauge', 'table', 'label', 'image', 'alarm-table', 'alarm-count', 'alarm-severity', 'command-button', 'entity-selector', 'map', 'linear-gauge', 'level-gauge', 'battery', 'status-light', 'signal-bars', 'compass', 'progress-ring', 'command-slider', 'command-toggle', 'stat-card', 'bar-chart', 'pie-chart', 'fleet-table', 'fleet-count', 'device-status', 'online-doughnut', 'history-table'];
|
|
53
53
|
export type WidgetType = (typeof WIDGET_TYPES)[number];
|
|
54
54
|
export declare const PLACEMENT_ANCHORS: readonly ['top-left', 'top', 'top-right', 'left', 'center', 'right', 'bottom-left', 'bottom', 'bottom-right'];
|
|
55
55
|
export type PlacementAnchor = (typeof PLACEMENT_ANCHORS)[number];
|
|
@@ -263,6 +263,7 @@ export interface MeasurementSample {
|
|
|
263
263
|
name: string;
|
|
264
264
|
value: number | null;
|
|
265
265
|
classifier: string | null;
|
|
266
|
+
bucketSeconds?: number;
|
|
266
267
|
}
|
|
267
268
|
export interface AlarmRow {
|
|
268
269
|
token: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devicechain/dashboards",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0-rc.2",
|
|
4
4
|
"description": "DeviceChain dashboard runtime — the DashboardHub (telemetry subscription multiplexing over the client wire, plus the alarm, command and location channels) and the dashboard-definition, selector, slot, and binding-manifest types.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"devicechain",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"@graphql-typed-document-node/core": "^3.2.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@devicechain/client": "0.
|
|
49
|
+
"@devicechain/client": "0.25.0-rc.2",
|
|
50
50
|
"graphql": "^16.0.0 || ^17.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@devicechain/client": "0.
|
|
53
|
+
"@devicechain/client": "0.25.0-rc.2",
|
|
54
54
|
"@types/node": "^26.6.5",
|
|
55
55
|
"graphql": "^17.0.2",
|
|
56
56
|
"typescript": "~7.0.2",
|