een-api-toolkit 0.3.14 → 0.3.16

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +10 -40
  2. package/README.md +1 -0
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.ts +825 -0
  6. package/dist/index.js +489 -254
  7. package/dist/index.js.map +1 -1
  8. package/docs/AI-CONTEXT.md +314 -2
  9. package/examples/vue-alerts-metrics/README.md +136 -0
  10. package/examples/vue-alerts-metrics/e2e/app.spec.ts +74 -0
  11. package/examples/vue-alerts-metrics/e2e/auth.spec.ts +561 -0
  12. package/examples/vue-alerts-metrics/index.html +13 -0
  13. package/examples/vue-alerts-metrics/package-lock.json +1756 -0
  14. package/examples/vue-alerts-metrics/package.json +31 -0
  15. package/examples/vue-alerts-metrics/playwright.config.ts +46 -0
  16. package/examples/vue-alerts-metrics/src/App.vue +108 -0
  17. package/examples/vue-alerts-metrics/src/components/AlertsList.vue +881 -0
  18. package/examples/vue-alerts-metrics/src/components/CameraSelector.vue +106 -0
  19. package/examples/vue-alerts-metrics/src/components/MetricsChart.vue +336 -0
  20. package/examples/vue-alerts-metrics/src/components/NotificationsList.vue +825 -0
  21. package/examples/vue-alerts-metrics/src/components/TimeRangeSelector.vue +259 -0
  22. package/examples/vue-alerts-metrics/src/composables/useHlsPlayer.ts +285 -0
  23. package/examples/vue-alerts-metrics/src/main.ts +23 -0
  24. package/examples/vue-alerts-metrics/src/router/index.ts +61 -0
  25. package/examples/vue-alerts-metrics/src/views/Callback.vue +76 -0
  26. package/examples/vue-alerts-metrics/src/views/Dashboard.vue +174 -0
  27. package/examples/vue-alerts-metrics/src/views/Home.vue +216 -0
  28. package/examples/vue-alerts-metrics/src/views/Login.vue +33 -0
  29. package/examples/vue-alerts-metrics/src/views/Logout.vue +66 -0
  30. package/examples/vue-alerts-metrics/src/vite-env.d.ts +12 -0
  31. package/examples/vue-alerts-metrics/tsconfig.json +21 -0
  32. package/examples/vue-alerts-metrics/tsconfig.node.json +10 -0
  33. package/examples/vue-alerts-metrics/vite.config.ts +12 -0
  34. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -13,6 +13,140 @@ import { StoreDefinition } from 'pinia';
13
13
  */
14
14
  export declare type ActorType = 'bridge' | 'camera' | 'speaker' | 'account' | 'user' | 'layout' | 'job' | 'measurement' | 'sensor' | 'gateway';
15
15
 
16
+ /**
17
+ * Alert entity from EEN API v3.0.
18
+ *
19
+ * @remarks
20
+ * Represents an alert in the Eagle Eye Networks platform. Alerts are generated
21
+ * when events match configured rules and can trigger various actions like
22
+ * notifications.
23
+ *
24
+ * For more details on alerts, see the
25
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listalerts).
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * import { listAlerts, type Alert } from 'een-api-toolkit'
30
+ *
31
+ * const { data, error } = await listAlerts({
32
+ * actorId__in: ['100d4c41'],
33
+ * timestamp__gte: new Date(Date.now() - 3600000).toISOString()
34
+ * })
35
+ * if (data) {
36
+ * data.results.forEach((alert: Alert) => {
37
+ * console.log(`${alert.alertType} at ${alert.timestamp}`)
38
+ * })
39
+ * }
40
+ * ```
41
+ *
42
+ * @category Alerts
43
+ */
44
+ export declare interface Alert {
45
+ /** Unique identifier for the alert */
46
+ id: string;
47
+ /** ISO 8601 timestamp when the alert was triggered */
48
+ timestamp: string;
49
+ /** ISO 8601 timestamp when the alert was created in the system */
50
+ createTimestamp: string;
51
+ /** ID of the entity that created the alert */
52
+ creatorId: string;
53
+ /** Type of alert (e.g., "een.motionDetectionAlert.v1") */
54
+ alertType: string;
55
+ /** Human-readable name of the alert */
56
+ alertName?: string;
57
+ /** Category of the alert */
58
+ category?: string;
59
+ /** ID of the service rule that triggered this alert */
60
+ serviceRuleId?: string;
61
+ /** Event type that triggered this alert */
62
+ eventType?: string;
63
+ /** ID of the actor (device/entity) that generated the alert */
64
+ actorId: string;
65
+ /** Type of actor that generated the alert */
66
+ actorType: string;
67
+ /** Account ID of the actor */
68
+ actorAccountId: string;
69
+ /** Human-readable name of the actor */
70
+ actorName?: string;
71
+ /** ID of the rule that triggered this alert */
72
+ ruleId?: string;
73
+ /** ID of the event that triggered this alert */
74
+ eventId?: string;
75
+ /** ID of the location associated with this alert */
76
+ locationId?: string;
77
+ /** Human-readable name of the location */
78
+ locationName?: string;
79
+ /** Priority level (0-20, where higher is more important) */
80
+ priority?: number;
81
+ /** List of data schema types included in this alert */
82
+ dataSchemas?: string[];
83
+ /** Alert data objects (varies by alert type) */
84
+ data?: Record<string, unknown>;
85
+ /** Actions executed for this alert */
86
+ actions?: Record<string, AlertAction>;
87
+ /** Human-readable description of the alert */
88
+ description?: string;
89
+ }
90
+
91
+ /**
92
+ * Action taken for an alert.
93
+ *
94
+ * @remarks
95
+ * Represents an action that was triggered by an alert, such as sending an email
96
+ * notification or executing a webhook.
97
+ *
98
+ * @category Alerts
99
+ */
100
+ export declare interface AlertAction {
101
+ /** Name of the action */
102
+ name: string;
103
+ /** Type of action (e.g., "email", "webhook", "push") */
104
+ type: string;
105
+ /** Whether the action executed successfully */
106
+ success: boolean;
107
+ /** ISO 8601 timestamp when the action was executed */
108
+ timestamp: string;
109
+ /** Current status of the action */
110
+ status?: AlertActionStatus;
111
+ }
112
+
113
+ /**
114
+ * Status of an alert action.
115
+ *
116
+ * @category Alerts
117
+ */
118
+ export declare type AlertActionStatus = 'fired' | 'success' | 'partialSuccess' | 'silenced' | 'failed' | 'internalError';
119
+
120
+ /**
121
+ * Fields that can be included in alert responses.
122
+ *
123
+ * @category Alerts
124
+ */
125
+ export declare type AlertInclude = 'data' | 'actions' | 'dataSchemas' | 'description';
126
+
127
+ /**
128
+ * Sort options for alert listing.
129
+ *
130
+ * @category Alerts
131
+ */
132
+ export declare type AlertSort = '+timestamp' | '-timestamp';
133
+
134
+ /**
135
+ * Alert type definition from EEN API v3.0.
136
+ *
137
+ * @remarks
138
+ * Describes a type of alert available in the system. Used to understand
139
+ * what alert types can be filtered for when listing alerts.
140
+ *
141
+ * @category Alerts
142
+ */
143
+ export declare interface AlertType {
144
+ /** Alert type identifier (e.g., "een.motionDetectionAlert.v1") */
145
+ type: string;
146
+ /** Human-readable description of the alert type */
147
+ description: string;
148
+ }
149
+
16
150
  /**
17
151
  * Bridge entity from EEN API v3.0.
18
152
  *
@@ -558,6 +692,52 @@ export declare interface EventFieldValues {
558
692
  type: string[];
559
693
  }
560
694
 
695
+ /**
696
+ * Event metric entity from EEN API v3.0.
697
+ *
698
+ * @remarks
699
+ * Represents a time-series metric for events in the Eagle Eye Networks platform.
700
+ * Event metrics provide aggregated counts over time, useful for visualizing
701
+ * event frequency in charts and dashboards.
702
+ *
703
+ * For more details on event metrics, see the
704
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listmetrics).
705
+ *
706
+ * @example
707
+ * ```typescript
708
+ * import { getEventMetrics, type EventMetric } from 'een-api-toolkit'
709
+ *
710
+ * const { data, error } = await getEventMetrics({
711
+ * actor: 'camera:100d4c41',
712
+ * eventType: 'een.motionDetectionEvent.v1'
713
+ * })
714
+ * if (data) {
715
+ * data.forEach((metric: EventMetric) => {
716
+ * console.log(`${metric.eventType}: ${metric.dataPoints.length} data points`)
717
+ * metric.dataPoints.forEach(([timestamp, count]) => {
718
+ * console.log(` ${new Date(timestamp).toISOString()}: ${count}`)
719
+ * })
720
+ * })
721
+ * }
722
+ * ```
723
+ *
724
+ * @category Event Metrics
725
+ */
726
+ export declare interface EventMetric {
727
+ /** Event type identifier (e.g., "een.motionDetectionEvent.v1") */
728
+ eventType: string;
729
+ /** ID of the actor (device/entity) for this metric */
730
+ actorId: string;
731
+ /** Type of actor for this metric */
732
+ actorType: MetricActorType;
733
+ /** Metric target (typically "count") */
734
+ target: string;
735
+ /** Array of [timestamp_ms, value] data points */
736
+ dataPoints: MetricDataPoint[];
737
+ /** Additional properties that may be included */
738
+ [key: string]: unknown;
739
+ }
740
+
561
741
  /**
562
742
  * Event type definition from EEN API v3.0.
563
743
  *
@@ -688,11 +868,96 @@ export declare type FeedMediaType = 'video' | 'audio' | 'image' | 'halfDuplex' |
688
868
  */
689
869
  export declare type FeedStreamType = 'main' | 'preview' | 'talkdown';
690
870
 
871
+ /**
872
+ * Convert ISO 8601 timestamp from Z format to +00:00 format.
873
+ *
874
+ * @remarks
875
+ * The EEN API requires timestamps in +00:00 format, not Z format.
876
+ * This function converts timestamps like `2024-01-01T00:00:00.000Z`
877
+ * to `2024-01-01T00:00:00.000+00:00`.
878
+ *
879
+ * @param timestamp - ISO 8601 timestamp string
880
+ * @returns Timestamp in +00:00 format
881
+ *
882
+ * @example
883
+ * ```typescript
884
+ * formatTimestamp('2024-01-01T00:00:00.000Z')
885
+ * // Returns: '2024-01-01T00:00:00.000+00:00'
886
+ *
887
+ * formatTimestamp(new Date().toISOString())
888
+ * // Returns: timestamp with +00:00 suffix
889
+ * ```
890
+ *
891
+ * @category Utilities
892
+ */
893
+ export declare function formatTimestamp(timestamp: string): string;
894
+
691
895
  /**
692
896
  * Exchange authorization code for access token
693
897
  */
694
898
  export declare function getAccessToken(code: string): Promise<Result<TokenResponse>>;
695
899
 
900
+ /**
901
+ * Get a specific alert by ID.
902
+ *
903
+ * @remarks
904
+ * Fetches a single alert from `/api/v3.0/alerts/{alertId}`. Use the `include`
905
+ * parameter to request additional fields.
906
+ *
907
+ * For more details, see the
908
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/getalert).
909
+ *
910
+ * @param alertId - The unique identifier of the alert to fetch
911
+ * @param params - Optional parameters (e.g., include additional fields)
912
+ * @returns A Result containing the alert or an error
913
+ *
914
+ * @example
915
+ * ```typescript
916
+ * import { getAlert } from 'een-api-toolkit'
917
+ *
918
+ * const { data, error } = await getAlert('alert-123')
919
+ *
920
+ * if (error) {
921
+ * if (error.code === 'NOT_FOUND') {
922
+ * console.log('Alert not found')
923
+ * }
924
+ * return
925
+ * }
926
+ *
927
+ * console.log(`Alert: ${data.alertType} at ${data.timestamp}`)
928
+ *
929
+ * // With additional fields
930
+ * const { data: alertWithData } = await getAlert('alert-123', {
931
+ * include: ['data', 'actions', 'description']
932
+ * })
933
+ * ```
934
+ *
935
+ * @category Alerts
936
+ */
937
+ export declare function getAlert(alertId: string, params?: GetAlertParams): Promise<Result<Alert>>;
938
+
939
+ /**
940
+ * Parameters for getting a single alert by ID.
941
+ *
942
+ * @remarks
943
+ * Supports including additional fields in the response.
944
+ *
945
+ * @example
946
+ * ```typescript
947
+ * import { getAlert } from 'een-api-toolkit'
948
+ *
949
+ * const { data } = await getAlert('alert-123', {
950
+ * include: ['data', 'actions', 'description']
951
+ * })
952
+ * ```
953
+ *
954
+ * @category Alerts
955
+ */
956
+ export declare interface GetAlertParams {
957
+ /** Fields to include in response */
958
+ include?: AlertInclude[];
959
+ }
960
+
696
961
  /**
697
962
  * Generate the OAuth authorization URL
698
963
  */
@@ -1005,6 +1270,99 @@ export declare function getCurrentUser(): Promise<Result<UserProfile>>;
1005
1270
  */
1006
1271
  export declare function getEvent(eventId: string, params?: GetEventParams): Promise<Result<Event_2>>;
1007
1272
 
1273
+ /**
1274
+ * Get event metrics (time-series data) for a specific actor and event type.
1275
+ *
1276
+ * @remarks
1277
+ * Fetches time-series metric data from `/api/v3.0/eventMetrics`. The `actor` and
1278
+ * `eventType` parameters are required. Returns an array of EventMetric objects
1279
+ * containing data points over time.
1280
+ *
1281
+ * For more details, see the
1282
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listmetrics).
1283
+ *
1284
+ * @param params - Required and optional filtering parameters
1285
+ * @returns A Result containing an array of event metrics or an error
1286
+ *
1287
+ * @example
1288
+ * ```typescript
1289
+ * import { getEventMetrics } from 'een-api-toolkit'
1290
+ *
1291
+ * // Get motion event metrics for a camera (last 7 days by default)
1292
+ * const { data, error } = await getEventMetrics({
1293
+ * actor: 'camera:100d4c41',
1294
+ * eventType: 'een.motionDetectionEvent.v1'
1295
+ * })
1296
+ *
1297
+ * if (data) {
1298
+ * data.forEach(metric => {
1299
+ * console.log(`${metric.eventType}: ${metric.dataPoints.length} data points`)
1300
+ * metric.dataPoints.forEach(([timestamp, count]) => {
1301
+ * console.log(` ${new Date(timestamp).toISOString()}: ${count}`)
1302
+ * })
1303
+ * })
1304
+ * }
1305
+ *
1306
+ * // With custom time range and aggregation
1307
+ * const { data: hourlyData } = await getEventMetrics({
1308
+ * actor: 'camera:100d4c41',
1309
+ * eventType: 'een.motionDetectionEvent.v1',
1310
+ * timestamp__gte: new Date(Date.now() - 86400000).toISOString(),
1311
+ * timestamp__lte: new Date().toISOString(),
1312
+ * aggregateByMinutes: 60
1313
+ * })
1314
+ * ```
1315
+ *
1316
+ * @category Event Metrics
1317
+ */
1318
+ export declare function getEventMetrics(params: GetEventMetricsParams): Promise<Result<EventMetric[]>>;
1319
+
1320
+ /**
1321
+ * Parameters for fetching event metrics.
1322
+ *
1323
+ * @remarks
1324
+ * Supports filtering metrics by actor, event type, and time range. The `actor`
1325
+ * and `eventType` parameters are required. If timestamps are not provided,
1326
+ * defaults to the last 7 days.
1327
+ *
1328
+ * For more details, see the
1329
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listmetrics).
1330
+ *
1331
+ * @example
1332
+ * ```typescript
1333
+ * import { getEventMetrics } from 'een-api-toolkit'
1334
+ *
1335
+ * // Get motion event metrics for a camera over the last 24 hours
1336
+ * const { data } = await getEventMetrics({
1337
+ * actor: 'camera:100d4c41',
1338
+ * eventType: 'een.motionDetectionEvent.v1',
1339
+ * timestamp__gte: new Date(Date.now() - 86400000).toISOString(),
1340
+ * timestamp__lte: new Date().toISOString(),
1341
+ * aggregateByMinutes: 60 // Hourly buckets
1342
+ * })
1343
+ *
1344
+ * // With default time range (last 7 days) and aggregation (60 minutes)
1345
+ * const { data: weekData } = await getEventMetrics({
1346
+ * actor: 'camera:100d4c41',
1347
+ * eventType: 'een.motionDetectionEvent.v1'
1348
+ * })
1349
+ * ```
1350
+ *
1351
+ * @category Event Metrics
1352
+ */
1353
+ export declare interface GetEventMetricsParams {
1354
+ /** Actor to get metrics for (format: "type:id", e.g., "camera:100d4c41") */
1355
+ actor: string;
1356
+ /** Event type to get metrics for (e.g., "een.motionDetectionEvent.v1") */
1357
+ eventType: string;
1358
+ /** ISO 8601 timestamp - metrics starting at or after this time (defaults to 7 days ago) */
1359
+ timestamp__gte?: string;
1360
+ /** ISO 8601 timestamp - metrics ending before this time (defaults to now) */
1361
+ timestamp__lte?: string;
1362
+ /** Aggregation bucket size in minutes (default: 60) */
1363
+ aggregateByMinutes?: number;
1364
+ }
1365
+
1008
1366
  /**
1009
1367
  * Parameters for getting a single event by ID.
1010
1368
  *
@@ -1150,6 +1508,39 @@ export declare interface GetLiveImageParams {
1150
1508
  */
1151
1509
  export declare function getMediaSession(): Promise<Result<MediaSessionResponse>>;
1152
1510
 
1511
+ /**
1512
+ * Get a specific notification by ID.
1513
+ *
1514
+ * @remarks
1515
+ * Fetches a single notification from `/api/v3.0/notifications/{notificationId}`.
1516
+ *
1517
+ * For more details, see the
1518
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/getnotification).
1519
+ *
1520
+ * @param notificationId - The unique identifier of the notification to fetch
1521
+ * @returns A Result containing the notification or an error
1522
+ *
1523
+ * @example
1524
+ * ```typescript
1525
+ * import { getNotification } from 'een-api-toolkit'
1526
+ *
1527
+ * const { data, error } = await getNotification('notification-123')
1528
+ *
1529
+ * if (error) {
1530
+ * if (error.code === 'NOT_FOUND') {
1531
+ * console.log('Notification not found')
1532
+ * }
1533
+ * return
1534
+ * }
1535
+ *
1536
+ * console.log(`Notification: ${data.category} - ${data.description}`)
1537
+ * console.log(`Read: ${data.read}`)
1538
+ * ```
1539
+ *
1540
+ * @category Notifications
1541
+ */
1542
+ export declare function getNotification(notificationId: string): Promise<Result<Notification_2>>;
1543
+
1153
1544
  /**
1154
1545
  * Get the proxy URL
1155
1546
  */
@@ -1458,6 +1849,196 @@ export declare function initEenToolkit(options?: EenToolkitConfig): void;
1458
1849
  */
1459
1850
  export declare function initMediaSession(): Promise<Result<MediaSessionResult>>;
1460
1851
 
1852
+ /**
1853
+ * List alerts with optional filters and pagination.
1854
+ *
1855
+ * @remarks
1856
+ * Fetches a paginated list of alerts from `/api/v3.0/alerts`. Supports various
1857
+ * filters including time range, actor, alert type, priority, and more.
1858
+ *
1859
+ * For more details, see the
1860
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listalerts).
1861
+ *
1862
+ * @param params - Optional filtering and pagination parameters
1863
+ * @returns A Result containing a paginated list of alerts or an error
1864
+ *
1865
+ * @example
1866
+ * ```typescript
1867
+ * import { listAlerts } from 'een-api-toolkit'
1868
+ *
1869
+ * // Get recent alerts from a specific camera
1870
+ * const { data, error } = await listAlerts({
1871
+ * actorId__in: ['100d4c41'],
1872
+ * timestamp__gte: new Date(Date.now() - 3600000).toISOString(),
1873
+ * pageSize: 50,
1874
+ * include: ['data', 'actions']
1875
+ * })
1876
+ *
1877
+ * if (data) {
1878
+ * console.log(`Found ${data.results.length} alerts`)
1879
+ * data.results.forEach(alert => {
1880
+ * console.log(`${alert.alertType} at ${alert.timestamp}`)
1881
+ * })
1882
+ * }
1883
+ *
1884
+ * // Fetch all alerts with pagination
1885
+ * let allAlerts: Alert[] = []
1886
+ * let pageToken: string | undefined
1887
+ * do {
1888
+ * const { data, error } = await listAlerts({
1889
+ * timestamp__gte: new Date(Date.now() - 86400000).toISOString(),
1890
+ * pageSize: 100,
1891
+ * pageToken
1892
+ * })
1893
+ * if (error) break
1894
+ * allAlerts.push(...data.results)
1895
+ * pageToken = data.nextPageToken
1896
+ * } while (pageToken)
1897
+ * ```
1898
+ *
1899
+ * @category Alerts
1900
+ */
1901
+ export declare function listAlerts(params?: ListAlertsParams): Promise<Result<PaginatedResult<Alert>>>;
1902
+
1903
+ /**
1904
+ * Parameters for listing alerts.
1905
+ *
1906
+ * @remarks
1907
+ * Supports filtering alerts by various criteria including time range, actor,
1908
+ * alert type, and more. Supports pagination and sorting.
1909
+ *
1910
+ * For more details, see the
1911
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listalerts).
1912
+ *
1913
+ * @example
1914
+ * ```typescript
1915
+ * import { listAlerts } from 'een-api-toolkit'
1916
+ *
1917
+ * // Get recent alerts from a specific camera
1918
+ * const { data } = await listAlerts({
1919
+ * actorId__in: ['100d4c41'],
1920
+ * timestamp__gte: new Date(Date.now() - 3600000).toISOString(),
1921
+ * pageSize: 50,
1922
+ * include: ['data', 'actions'],
1923
+ * sort: ['-timestamp']
1924
+ * })
1925
+ *
1926
+ * // Fetch next page
1927
+ * if (data?.nextPageToken) {
1928
+ * const { data: page2 } = await listAlerts({
1929
+ * actorId__in: ['100d4c41'],
1930
+ * timestamp__gte: new Date(Date.now() - 3600000).toISOString(),
1931
+ * pageToken: data.nextPageToken
1932
+ * })
1933
+ * }
1934
+ * ```
1935
+ *
1936
+ * @category Alerts
1937
+ */
1938
+ export declare interface ListAlertsParams {
1939
+ /** Number of results per page (default: 100) */
1940
+ pageSize?: number;
1941
+ /** Token for fetching a specific page */
1942
+ pageToken?: string;
1943
+ /** ISO 8601 timestamp - alerts at or before this time */
1944
+ timestamp__lte?: string;
1945
+ /** ISO 8601 timestamp - alerts at or after this time */
1946
+ timestamp__gte?: string;
1947
+ /** Filter by creator ID */
1948
+ creatorId?: string;
1949
+ /** Filter by alert types (e.g., ["een.motionDetectionAlert.v1"]) */
1950
+ alertType__in?: string[];
1951
+ /** Filter by actor IDs */
1952
+ actorId__in?: string[];
1953
+ /** Filter by actor types */
1954
+ actorType__in?: string[];
1955
+ /** Filter by actor account ID */
1956
+ actorAccountId?: string;
1957
+ /** Filter by rule ID */
1958
+ ruleId?: string;
1959
+ /** Filter by rule IDs */
1960
+ ruleId__in?: string[];
1961
+ /** Filter by event ID */
1962
+ eventId?: string;
1963
+ /** Filter by location IDs */
1964
+ locationId__in?: string[];
1965
+ /** Minimum priority level (inclusive) */
1966
+ priority__gte?: number;
1967
+ /** Maximum priority level (inclusive) */
1968
+ priority__lte?: number;
1969
+ /** Include alerts that are invalid */
1970
+ showInvalidAlerts?: boolean;
1971
+ /** Filter by alert action IDs */
1972
+ alertActionId__in?: string[];
1973
+ /** Filter by alert action statuses */
1974
+ alertActionStatus__in?: AlertActionStatus[];
1975
+ /** Fields to include in response */
1976
+ include?: AlertInclude[];
1977
+ /** Sort order for results */
1978
+ sort?: AlertSort[];
1979
+ /** Language code for localized descriptions */
1980
+ language?: string;
1981
+ }
1982
+
1983
+ /**
1984
+ * List all available alert types.
1985
+ *
1986
+ * @remarks
1987
+ * Fetches a paginated list of alert types from `/api/v3.0/alertTypes`. Alert types
1988
+ * describe the different kinds of alerts that can be generated in the system.
1989
+ *
1990
+ * For more details, see the
1991
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listalerttypes).
1992
+ *
1993
+ * @param params - Optional pagination parameters
1994
+ * @returns A Result containing a paginated list of alert types or an error
1995
+ *
1996
+ * @example
1997
+ * ```typescript
1998
+ * import { listAlertTypes } from 'een-api-toolkit'
1999
+ *
2000
+ * const { data, error } = await listAlertTypes()
2001
+ * if (data) {
2002
+ * data.results.forEach(alertType => {
2003
+ * console.log(`${alertType.type}: ${alertType.description}`)
2004
+ * })
2005
+ * }
2006
+ *
2007
+ * // With pagination
2008
+ * const { data: pagedTypes } = await listAlertTypes({ pageSize: 20 })
2009
+ * ```
2010
+ *
2011
+ * @category Alerts
2012
+ */
2013
+ export declare function listAlertTypes(params?: ListAlertTypesParams): Promise<Result<PaginatedResult<AlertType>>>;
2014
+
2015
+ /**
2016
+ * Parameters for listing alert types.
2017
+ *
2018
+ * @remarks
2019
+ * Supports pagination for listing all available alert types.
2020
+ *
2021
+ * @example
2022
+ * ```typescript
2023
+ * import { listAlertTypes } from 'een-api-toolkit'
2024
+ *
2025
+ * const { data } = await listAlertTypes({ pageSize: 50 })
2026
+ * if (data) {
2027
+ * data.results.forEach(alertType => {
2028
+ * console.log(`${alertType.type}: ${alertType.description}`)
2029
+ * })
2030
+ * }
2031
+ * ```
2032
+ *
2033
+ * @category Alerts
2034
+ */
2035
+ export declare interface ListAlertTypesParams {
2036
+ /** Number of results per page */
2037
+ pageSize?: number;
2038
+ /** Token for fetching a specific page */
2039
+ pageToken?: string;
2040
+ }
2041
+
1461
2042
  /**
1462
2043
  * Parameters for listing bridges.
1463
2044
  *
@@ -2059,6 +2640,137 @@ export declare interface ListMediaParams {
2059
2640
  pageSize?: number;
2060
2641
  }
2061
2642
 
2643
+ /**
2644
+ * List notifications with optional filters and pagination.
2645
+ *
2646
+ * @remarks
2647
+ * Fetches a paginated list of notifications from `/api/v3.0/notifications`. Supports
2648
+ * various filters including time range, actor, alert type, category, and more.
2649
+ *
2650
+ * For more details, see the
2651
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listnotifications).
2652
+ *
2653
+ * @param params - Optional filtering and pagination parameters
2654
+ * @returns A Result containing a paginated list of notifications or an error
2655
+ *
2656
+ * @example
2657
+ * ```typescript
2658
+ * import { listNotifications } from 'een-api-toolkit'
2659
+ *
2660
+ * // Get recent notifications for a specific camera
2661
+ * const { data, error } = await listNotifications({
2662
+ * actorId: '100d4c41',
2663
+ * timestamp__gte: new Date(Date.now() - 3600000).toISOString(),
2664
+ * pageSize: 50
2665
+ * })
2666
+ *
2667
+ * if (data) {
2668
+ * console.log(`Found ${data.results.length} notifications`)
2669
+ * data.results.forEach(notification => {
2670
+ * console.log(`${notification.category}: ${notification.description}`)
2671
+ * })
2672
+ * }
2673
+ *
2674
+ * // Get unread notifications
2675
+ * const { data: unread } = await listNotifications({
2676
+ * read: false,
2677
+ * category: 'video'
2678
+ * })
2679
+ *
2680
+ * // Fetch all notifications with pagination
2681
+ * let allNotifications: Notification[] = []
2682
+ * let pageToken: string | undefined
2683
+ * do {
2684
+ * const { data, error } = await listNotifications({
2685
+ * timestamp__gte: new Date(Date.now() - 86400000).toISOString(),
2686
+ * pageSize: 100,
2687
+ * pageToken
2688
+ * })
2689
+ * if (error) break
2690
+ * allNotifications.push(...data.results)
2691
+ * pageToken = data.nextPageToken
2692
+ * } while (pageToken)
2693
+ * ```
2694
+ *
2695
+ * @category Notifications
2696
+ */
2697
+ export declare function listNotifications(params?: ListNotificationsParams): Promise<Result<PaginatedResult<Notification_2>>>;
2698
+
2699
+ /**
2700
+ * Parameters for listing notifications.
2701
+ *
2702
+ * @remarks
2703
+ * Supports filtering notifications by various criteria including time range,
2704
+ * actor, alert type, category, and more. Supports pagination and sorting.
2705
+ *
2706
+ * For more details, see the
2707
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listnotifications).
2708
+ *
2709
+ * @example
2710
+ * ```typescript
2711
+ * import { listNotifications } from 'een-api-toolkit'
2712
+ *
2713
+ * // Get recent notifications for a specific camera
2714
+ * const { data } = await listNotifications({
2715
+ * actorId: '100d4c41',
2716
+ * timestamp__gte: new Date(Date.now() - 3600000).toISOString(),
2717
+ * pageSize: 50,
2718
+ * sort: ['-timestamp']
2719
+ * })
2720
+ *
2721
+ * // Get unread notifications
2722
+ * const { data: unread } = await listNotifications({
2723
+ * read: false,
2724
+ * category: 'video'
2725
+ * })
2726
+ *
2727
+ * // Fetch next page
2728
+ * if (data?.nextPageToken) {
2729
+ * const { data: page2 } = await listNotifications({
2730
+ * actorId: '100d4c41',
2731
+ * timestamp__gte: new Date(Date.now() - 3600000).toISOString(),
2732
+ * pageToken: data.nextPageToken
2733
+ * })
2734
+ * }
2735
+ * ```
2736
+ *
2737
+ * @category Notifications
2738
+ */
2739
+ export declare interface ListNotificationsParams {
2740
+ /** Number of results per page (default: 100) */
2741
+ pageSize?: number;
2742
+ /** Token for fetching a specific page */
2743
+ pageToken?: string;
2744
+ /** ISO 8601 timestamp - notifications at or before this time */
2745
+ timestamp__lte?: string;
2746
+ /** ISO 8601 timestamp - notifications at or after this time */
2747
+ timestamp__gte?: string;
2748
+ /** Filter by alert ID */
2749
+ alertId?: string;
2750
+ /** Filter by alert type */
2751
+ alertType?: string;
2752
+ /** Filter by actor ID */
2753
+ actorId?: string;
2754
+ /** Filter by actor type */
2755
+ actorType?: string;
2756
+ /** Filter by actor account ID */
2757
+ actorAccountId?: string;
2758
+ /** Filter by notification category */
2759
+ category?: NotificationCategory;
2760
+ /** Filter by user ID */
2761
+ userId?: string;
2762
+ /** Filter by read status */
2763
+ read?: boolean;
2764
+ /** Filter by delivery status */
2765
+ status?: NotificationStatus;
2766
+ /** Include legacy v1 notifications */
2767
+ includeV1Notifications?: boolean;
2768
+ /** Sort order for results */
2769
+ sort?: ('+timestamp' | '-timestamp')[];
2770
+ /** Language code for localized descriptions */
2771
+ language?: string;
2772
+ }
2773
+
2062
2774
  /**
2063
2775
  * Parameters for listing users.
2064
2776
  *
@@ -2195,6 +2907,119 @@ export declare type MediaStreamType = 'preview' | 'main';
2195
2907
  */
2196
2908
  export declare type MediaType = 'video' | 'image';
2197
2909
 
2910
+ /**
2911
+ * Actor types for event metrics in the EEN API v3.0.
2912
+ *
2913
+ * @remarks
2914
+ * Represents the type of entity that generated or is associated with a metric.
2915
+ * Common actor types include cameras, bridges, and users.
2916
+ *
2917
+ * @category Event Metrics
2918
+ */
2919
+ export declare type MetricActorType = 'bridge' | 'camera' | 'speaker' | 'account' | 'user' | 'layout' | 'job';
2920
+
2921
+ /**
2922
+ * A single metric data point as [timestamp_ms, value].
2923
+ *
2924
+ * @remarks
2925
+ * Event metrics return time-series data as arrays of [timestamp, value] pairs.
2926
+ * The timestamp is in milliseconds since Unix epoch, and the value represents
2927
+ * the count or measurement at that point in time.
2928
+ *
2929
+ * @example
2930
+ * ```typescript
2931
+ * // Data point: January 1, 2024 at midnight with a count of 5
2932
+ * const dataPoint: MetricDataPoint = [1704067200000, 5]
2933
+ * ```
2934
+ *
2935
+ * @category Event Metrics
2936
+ */
2937
+ export declare type MetricDataPoint = [number, number];
2938
+
2939
+ /**
2940
+ * Notification entity from EEN API v3.0.
2941
+ *
2942
+ * @remarks
2943
+ * Represents a notification in the Eagle Eye Networks platform. Notifications
2944
+ * are sent to users based on alerts and system events through various channels
2945
+ * like email, push notifications, etc.
2946
+ *
2947
+ * For more details on notifications, see the
2948
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listnotifications).
2949
+ *
2950
+ * @example
2951
+ * ```typescript
2952
+ * import { listNotifications, type Notification } from 'een-api-toolkit'
2953
+ *
2954
+ * const { data, error } = await listNotifications({
2955
+ * actorId: '100d4c41',
2956
+ * timestamp__gte: new Date(Date.now() - 3600000).toISOString()
2957
+ * })
2958
+ * if (data) {
2959
+ * data.results.forEach((notification: Notification) => {
2960
+ * console.log(`${notification.category}: ${notification.description}`)
2961
+ * })
2962
+ * }
2963
+ * ```
2964
+ *
2965
+ * @category Notifications
2966
+ */
2967
+ declare interface Notification_2 {
2968
+ /** Unique identifier for the notification */
2969
+ id: string;
2970
+ /** ISO 8601 timestamp of the notification event */
2971
+ timestamp: string;
2972
+ /** ISO 8601 timestamp when the notification was created in the system */
2973
+ createTimestamp: string;
2974
+ /** ISO 8601 timestamp when the notification was sent */
2975
+ sentTimestamp?: string;
2976
+ /** ID of the alert that triggered this notification (null if not alert-based) */
2977
+ alertId?: string | null;
2978
+ /** Type of alert that triggered this notification */
2979
+ alertType?: string;
2980
+ /** ID of the actor (device/entity) associated with this notification */
2981
+ actorId: string;
2982
+ /** Human-readable name of the actor */
2983
+ actorName?: string;
2984
+ /** Type of actor associated with this notification */
2985
+ actorType: string;
2986
+ /** Account ID of the actor */
2987
+ actorAccountId: string;
2988
+ /** ID of the user this notification was sent to */
2989
+ userId: string;
2990
+ /** ID of the account this notification belongs to */
2991
+ accountId: string;
2992
+ /** Whether the notification has been read by the user */
2993
+ read: boolean;
2994
+ /** Current delivery status of the notification */
2995
+ status: NotificationStatus;
2996
+ /** Category of the notification */
2997
+ category: NotificationCategory;
2998
+ /** Human-readable description of the notification */
2999
+ description?: string;
3000
+ /** Actions that were taken for this notification */
3001
+ notificationActions: string[];
3002
+ /** List of data schema types included in this notification */
3003
+ dataSchemas: string[];
3004
+ /** Notification data objects (varies by notification type) */
3005
+ data: Record<string, unknown>;
3006
+ }
3007
+ export { Notification_2 as Notification }
3008
+
3009
+ /**
3010
+ * Categories of notifications in the EEN platform.
3011
+ *
3012
+ * @category Notifications
3013
+ */
3014
+ export declare type NotificationCategory = 'health' | 'video' | 'operational' | 'audit' | 'job' | 'security' | 'sharing';
3015
+
3016
+ /**
3017
+ * Status of a notification delivery.
3018
+ *
3019
+ * @category Notifications
3020
+ */
3021
+ export declare type NotificationStatus = 'pending' | 'bounced' | 'dropped' | 'deferred' | 'delivered' | 'sent' | 'outsideUsersSchedule' | 'notificationsDisabled' | 'noNotificationActions' | 'sendingFailed' | 'throttled' | 'unableToGetSettings';
3022
+
2198
3023
  /**
2199
3024
  * Paginated response from list operations.
2200
3025
  *