@evercam/api 1.0.0-6fbecaded → 1.0.0-779bcb558

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.
@@ -28,6 +28,19 @@ export declare enum KitAlarm {
28
28
  UnknownCamera = "unknown_camera",
29
29
  NotRecordingCamera = "not_recording_camera"
30
30
  }
31
+ export declare enum KitMetricId {
32
+ Battery = "battery"
33
+ }
34
+ export declare enum KitMetricPeriod {
35
+ Last5Minutes = "now-5m",
36
+ Last15Minutes = "now-15m",
37
+ Last30Minutes = "now-30m",
38
+ Last1Hour = "now-1h",
39
+ Last3Hours = "now-3h",
40
+ Last6Hours = "now-6h",
41
+ Last12Hours = "now-12h",
42
+ Last24Hours = "now-24h"
43
+ }
31
44
  export declare enum GrafanaMetricId {
32
45
  SbcCpuLoad = "SbcCpuLoad",
33
46
  SbcSystemLoad5MnAvg = "SbcSystemLoad5MnAvg",
@@ -74,7 +87,7 @@ export declare enum GrafanaMetricId {
74
87
  ExNvrMemoryUsage = "ExNvrMemoryUsage",
75
88
  ExNvrLogs = "ExNvrLogs"
76
89
  }
77
- export declare enum GrafanaChartType {
90
+ export declare enum KitChartType {
78
91
  Stat = "stat",
79
92
  Gauge = "gauge",
80
93
  Graph = "graph",
@@ -101,7 +114,7 @@ export type GrafanaPanel = {
101
114
  name: keyof GrafanaMetricId;
102
115
  title: string;
103
116
  description: string;
104
- type: GrafanaChartType;
117
+ type: KitChartType;
105
118
  datasource: GrafanaDataSource;
106
119
  targets: GrafanaTarget[];
107
120
  maxDataPoints?: number;
@@ -198,17 +211,27 @@ export type GrafanaFrame = {
198
211
  nanos?: Array<number[] | null>;
199
212
  };
200
213
  };
214
+ export type KitMetricData = {
215
+ type: KitChartType;
216
+ chartProps?: Record<string, unknown>;
217
+ };
201
218
  export type GrafanaQueryResult = {
202
219
  status: number;
203
220
  frames: GrafanaFrame[];
204
221
  };
205
- export type GrafanaMetricResponse = {
222
+ export type GrafanaMetricData = KitMetricData & {
206
223
  results: {
207
224
  [key: string]: GrafanaQueryResult;
208
225
  };
209
- type: GrafanaChartType;
210
226
  };
211
- export type GrafanaKitMetrics = Record<keyof typeof GrafanaMetricId, GrafanaMetricResponse>;
227
+ export type EvercamMetricData = KitMetricData & {
228
+ stats: EvercamStats[];
229
+ };
230
+ export type GrafanaKitMetrics = Record<keyof typeof GrafanaMetricId, GrafanaMetricData>;
231
+ export type EvercamStats = {
232
+ [k: string]: number | string;
233
+ timestamp: string;
234
+ };
212
235
  export type KitQueryParams = PaginationParams & {
213
236
  name: string;
214
237
  serial: string;
@@ -1,4 +1,4 @@
1
- import { MilesightCameraNetworkConfiguration, MilesightCameraOsdConfiguration, MilesightCameraSdCardInfo, MilesightCameraSystemSettings, MilesightCameraTimeInfo, MilesightCameraVideoConfig, TaskStatus, DateTime_Z_micros, GrafanaChartType } from "@/types";
1
+ import { MilesightCameraNetworkConfiguration, MilesightCameraOsdConfiguration, MilesightCameraSdCardInfo, MilesightCameraSystemSettings, MilesightCameraTimeInfo, MilesightCameraVideoConfig, TaskStatus, DateTime_Z_micros, KitMetricData } from "@/types";
2
2
  export declare enum ExNvrHealthCheckTaskId {
3
3
  ExNvrLogin = "exNvrLogin",
4
4
  ExNvrConfigCheck = "exNvrGetDeviceInfo",
@@ -113,8 +113,7 @@ export declare enum ExNvrMetricId {
113
113
  RamUsage = "ram_usage",
114
114
  SwapUsage = "swap_usage"
115
115
  }
116
- export type ExNvrMetric = {
116
+ export type ExNvrMetric = KitMetricData & {
117
117
  metricId: ExNvrMetricId;
118
- type: GrafanaChartType;
119
118
  value: number;
120
119
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evercam/api",
3
- "version": "1.0.0-6fbecaded",
3
+ "version": "1.0.0-779bcb558",
4
4
  "description": "Evercam API client",
5
5
  "repository": {
6
6
  "type": "git",