een-api-toolkit 0.3.51 → 0.3.55

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/index.d.ts CHANGED
@@ -1133,6 +1133,52 @@ export declare interface CreateLayoutParams {
1133
1133
  panes?: LayoutPane[];
1134
1134
  }
1135
1135
 
1136
+ /**
1137
+ * Event type to data schemas mapping for EEN API v3.0.
1138
+ *
1139
+ * @remarks
1140
+ * This module provides a mapping between Eagle Eye Networks event types and their
1141
+ * associated data schemas. This mapping is used to dynamically build the `include`
1142
+ * parameter when fetching events from the EEN API.
1143
+ *
1144
+ * When fetching events using the `listEvents` API, you can request additional
1145
+ * event-specific data by using the `include` parameter. Each event type supports
1146
+ * a specific set of data schemas.
1147
+ *
1148
+ * The `include` parameter values must be prefixed with `data.`. For example:
1149
+ * - Schema name: `een.objectDetection.v1`
1150
+ * - Include value: `data.een.objectDetection.v1`
1151
+ *
1152
+ * @example
1153
+ * ```typescript
1154
+ * import { getIncludeParameterForEventTypes, EVENT_TYPE_DATA_SCHEMAS } from 'een-api-toolkit'
1155
+ *
1156
+ * // Get include values for selected event types
1157
+ * const selectedTypes = ['een.personDetectionEvent.v1', 'een.vehicleDetectionEvent.v1']
1158
+ * const includeValues = getIncludeParameterForEventTypes(selectedTypes)
1159
+ *
1160
+ * // Use in API call
1161
+ * const result = await listEvents({
1162
+ * actor: `camera:${cameraId}`,
1163
+ * type__in: selectedTypes,
1164
+ * startTimestamp__gte: startTime,
1165
+ * include: includeValues
1166
+ * })
1167
+ * ```
1168
+ *
1169
+ * @category Events
1170
+ */
1171
+ /**
1172
+ * Data schema identifier used in the EEN API.
1173
+ *
1174
+ * @remarks
1175
+ * These are the schema names as they appear in the event's `dataSchemas` array.
1176
+ * When using in the `include` parameter, prefix with `data.`.
1177
+ *
1178
+ * @category Events
1179
+ */
1180
+ export declare type DataSchema = 'een.objectDetection.v1' | 'een.objectClassification.v1' | 'een.objectRegionMapping.v1' | 'een.fullFrameImageUrl.v1' | 'een.croppedFrameImageUrl.v1' | 'een.fullFrameImageUrlWithOverlay.v1' | 'een.displayOverlay.boundingBox.v1' | 'een.personAttributes.v1' | 'een.vehicleAttributes.v1' | 'een.animalAttributes.v1' | 'een.weaponAttributes.v1' | 'een.geoLocation.v1' | 'een.entryDirection.v1' | 'een.motionRegion.v1' | 'een.loiterArea.v1' | 'een.lineCrossLine.v1' | 'een.intrusionArea.v1' | 'een.monitoredArea.v1' | 'een.thermalMonitoredArea.v1' | 'een.countedLineCross.v1' | 'een.eevaAttributes.v1' | 'een.customLabels.v1' | 'een.humanValidationDetails.v1' | 'een.lprDetection.v1' | 'een.lprAccessType.v1' | 'een.userData.v1' | 'een.userTags.v1' | 'een.vehicleListInfo.v1' | 'een.vspInsightsSummary.v1' | 'een.dotNumberRecognition.v1' | 'een.truckNumberRecognition.v1' | 'een.trailerNumberRecognition.v1' | 'een.recognizedText.v1' | 'een.audioDetection.v1' | 'een.posTransactionStart.v1' | 'een.posTransactionEnd.v1' | 'een.posTransactionItem.v1' | 'een.posTransactionPayment.v1' | 'een.posTransactionCartChangeTrail.v1' | 'een.posTransactionCardLoadSummary.v1' | 'een.posTransactionFlag.v1' | 'een.posTransactionLabel.v1' | 'een.rawData.v1' | 'een.displayLocationSummary.v1' | 'een.deviceCloudStatusUpdate.v1' | 'een.deviceCloudPreviousStatus.v1' | 'een.deviceCloudConnectionStatusUpdate.v1' | 'een.deviceCloudConnectionPreviousStatus.v1' | 'een.deviceCommonStatusUpdate.v1' | 'een.deviceErrorStatusUpdate.v1' | 'een.deviceIO.v1' | 'een.deviceOperationDetails.v1' | 'een.deviceOperationSubStep.v1' | 'een.deviceOperationUpdate.v1' | 'een.ptzPositionUpdate.v1' | 'een.measurementStringValueUpdate.v1' | 'een.batteryLevelUpdate.v1' | 'een.measurementThresholdStatus.v1' | 'een.measurementValueUpdate.v1' | 'een.thermalCameraValueUpdate.v1' | 'een.resourceDetails.v1' | 'een.jobDetails.v1' | 'een.ownerDetails.v1';
1181
+
1136
1182
  /**
1137
1183
  * Delete an event subscription.
1138
1184
  *
@@ -1682,6 +1728,26 @@ declare interface Event_2 {
1682
1728
  }
1683
1729
  export { Event_2 as Event }
1684
1730
 
1731
+ /**
1732
+ * Mapping of event types to their supported data schemas.
1733
+ *
1734
+ * @remarks
1735
+ * This is a complete mapping derived from the EEN API v3.0 specification.
1736
+ * When an event type has no associated data schemas, it maps to an empty array.
1737
+ *
1738
+ * @example
1739
+ * ```typescript
1740
+ * import { EVENT_TYPE_DATA_SCHEMAS } from 'een-api-toolkit'
1741
+ *
1742
+ * // Get schemas for a specific event type
1743
+ * const schemas = EVENT_TYPE_DATA_SCHEMAS['een.personDetectionEvent.v1']
1744
+ * // ['een.objectDetection.v1', 'een.personAttributes.v1', ...]
1745
+ * ```
1746
+ *
1747
+ * @category Events
1748
+ */
1749
+ export declare const EVENT_TYPE_DATA_SCHEMAS: Readonly<Record<KnownEventType, readonly DataSchema[]>>;
1750
+
1685
1751
  /**
1686
1752
  * Event Alert Condition Rule entity from EEN API v3.0.
1687
1753
  *
@@ -1985,6 +2051,29 @@ export declare interface EventTypeFilter {
1985
2051
  id: string;
1986
2052
  }
1987
2053
 
2054
+ /**
2055
+ * Check if an event type has any associated data schemas.
2056
+ *
2057
+ * @remarks
2058
+ * Returns true if the event type has at least one associated data schema.
2059
+ * Useful for determining whether to include the `include` parameter in API calls.
2060
+ *
2061
+ * @param eventType - The event type identifier
2062
+ * @returns True if the event type has data schemas, false otherwise
2063
+ *
2064
+ * @example
2065
+ * ```typescript
2066
+ * import { eventTypeHasDataSchemas } from 'een-api-toolkit'
2067
+ *
2068
+ * if (eventTypeHasDataSchemas('een.personDetectionEvent.v1')) {
2069
+ * // Include data schemas in the API call
2070
+ * }
2071
+ * ```
2072
+ *
2073
+ * @category Events
2074
+ */
2075
+ export declare function eventTypeHasDataSchemas(eventType: string): boolean;
2076
+
1988
2077
  /**
1989
2078
  * Response from creating an export job.
1990
2079
  *
@@ -2360,6 +2449,47 @@ export declare interface GetAlertParams {
2360
2449
  include?: AlertInclude[];
2361
2450
  }
2362
2451
 
2452
+ /**
2453
+ * Get all unique data schemas across all event types.
2454
+ *
2455
+ * @remarks
2456
+ * Returns a deduplicated array of all data schema names defined in the mapping.
2457
+ * Useful for understanding the complete set of available data schemas.
2458
+ *
2459
+ * @returns Array of all unique data schema names
2460
+ *
2461
+ * @example
2462
+ * ```typescript
2463
+ * import { getAllDataSchemas } from 'een-api-toolkit'
2464
+ *
2465
+ * const allSchemas = getAllDataSchemas()
2466
+ * // ['een.objectDetection.v1', 'een.fullFrameImageUrl.v1', ...]
2467
+ * ```
2468
+ *
2469
+ * @category Events
2470
+ */
2471
+ export declare function getAllDataSchemas(): string[];
2472
+
2473
+ /**
2474
+ * Get all known event types.
2475
+ *
2476
+ * @remarks
2477
+ * Returns an array of all event type identifiers defined in the mapping.
2478
+ *
2479
+ * @returns Array of all known event type identifiers
2480
+ *
2481
+ * @example
2482
+ * ```typescript
2483
+ * import { getAllKnownEventTypes } from 'een-api-toolkit'
2484
+ *
2485
+ * const allTypes = getAllKnownEventTypes()
2486
+ * // ['een.motionDetectionEvent.v1', 'een.personDetectionEvent.v1', ...]
2487
+ * ```
2488
+ *
2489
+ * @category Events
2490
+ */
2491
+ export declare function getAllKnownEventTypes(): string[];
2492
+
2363
2493
  /**
2364
2494
  * Generate the OAuth authorization URL
2365
2495
  */
@@ -2633,6 +2763,28 @@ export declare function getConfig(): EenToolkitConfig;
2633
2763
  */
2634
2764
  export declare function getCurrentUser(): Promise<Result<UserProfile>>;
2635
2765
 
2766
+ /**
2767
+ * Get the data schemas supported by a specific event type.
2768
+ *
2769
+ * @remarks
2770
+ * Returns an array of data schema names for the given event type.
2771
+ * If the event type is not recognized, returns an empty array.
2772
+ *
2773
+ * @param eventType - The event type identifier (e.g., "een.personDetectionEvent.v1")
2774
+ * @returns Array of data schema names (without "data." prefix)
2775
+ *
2776
+ * @example
2777
+ * ```typescript
2778
+ * import { getDataSchemasForEventType } from 'een-api-toolkit'
2779
+ *
2780
+ * const schemas = getDataSchemasForEventType('een.personDetectionEvent.v1')
2781
+ * // ['een.objectDetection.v1', 'een.personAttributes.v1', ...]
2782
+ * ```
2783
+ *
2784
+ * @category Events
2785
+ */
2786
+ export declare function getDataSchemasForEventType(eventType: string): readonly string[];
2787
+
2636
2788
  /**
2637
2789
  * Get a specific download by ID.
2638
2790
  *
@@ -2931,6 +3083,28 @@ export declare interface GetEventParams {
2931
3083
  */
2932
3084
  export declare function getEventSubscription(subscriptionId: string): Promise<Result<EventSubscription>>;
2933
3085
 
3086
+ /**
3087
+ * Get all known event types that have the specified data schema.
3088
+ *
3089
+ * @remarks
3090
+ * Returns an array of event types that include the specified data schema.
3091
+ * Useful for finding which event types support a particular data feature.
3092
+ *
3093
+ * @param schema - The data schema name (without "data." prefix)
3094
+ * @returns Array of event type identifiers that support the schema
3095
+ *
3096
+ * @example
3097
+ * ```typescript
3098
+ * import { getEventTypesForDataSchema } from 'een-api-toolkit'
3099
+ *
3100
+ * const eventTypes = getEventTypesForDataSchema('een.objectDetection.v1')
3101
+ * // ['een.motionDetectionEvent.v1', 'een.personDetectionEvent.v1', ...]
3102
+ * ```
3103
+ *
3104
+ * @category Events
3105
+ */
3106
+ export declare function getEventTypesForDataSchema(schema: string): string[];
3107
+
2934
3108
  /**
2935
3109
  * Get a specific file by ID.
2936
3110
  *
@@ -2982,6 +3156,36 @@ export declare interface GetFileParams {
2982
3156
  include?: FileIncludeField[];
2983
3157
  }
2984
3158
 
3159
+ /**
3160
+ * Get the include parameter values for multiple event types.
3161
+ *
3162
+ * @remarks
3163
+ * Combines all data schemas from the specified event types, removes duplicates,
3164
+ * and returns them with the required "data." prefix for use in the `include` parameter.
3165
+ *
3166
+ * @param eventTypes - Array of event type identifiers
3167
+ * @returns Array of include parameter values (with "data." prefix), deduplicated
3168
+ *
3169
+ * @example
3170
+ * ```typescript
3171
+ * import { getIncludeParameterForEventTypes, listEvents } from 'een-api-toolkit'
3172
+ *
3173
+ * const selectedTypes = ['een.personDetectionEvent.v1', 'een.vehicleDetectionEvent.v1']
3174
+ * const includeValues = getIncludeParameterForEventTypes(selectedTypes)
3175
+ *
3176
+ * // Use in API call
3177
+ * const result = await listEvents({
3178
+ * actor: `camera:${cameraId}`,
3179
+ * type__in: selectedTypes,
3180
+ * startTimestamp__gte: startTime,
3181
+ * include: includeValues
3182
+ * })
3183
+ * ```
3184
+ *
3185
+ * @category Events
3186
+ */
3187
+ export declare function getIncludeParameterForEventTypes(eventTypes: string[]): string[];
3188
+
2985
3189
  /**
2986
3190
  * Get a specific job by ID.
2987
3191
  *
@@ -3804,6 +4008,16 @@ declare interface JobResultInterval {
3804
4008
  */
3805
4009
  export declare type JobState = 'pending' | 'started' | 'success' | 'failure' | 'revoked';
3806
4010
 
4011
+ /**
4012
+ * Known EEN event type identifier.
4013
+ *
4014
+ * @remarks
4015
+ * These are the event types defined in the EEN API v3.0 specification.
4016
+ *
4017
+ * @category Events
4018
+ */
4019
+ export declare type KnownEventType = 'een.motionDetectionEvent.v1' | 'een.motionInRegionDetectionEvent.v1' | 'een.personDetectionEvent.v1' | 'een.personMotionDetectionEvent.v1' | 'een.animalDetectionEvent.v1' | 'een.faceDetectionEvent.v1' | 'een.vehicleDetectionEvent.v1' | 'een.vehicleMotionDetectionEvent.v1' | 'een.gunDetectionEvent.v1' | 'een.weaponDetectionEvent.v1' | 'een.fallDetectionEvent.v1' | 'een.fireDetectionEvent.v1' | 'een.spillDetectionEvent.v1' | 'een.crowdFormationDetectionEvent.v1' | 'een.tamperDetectionEvent.v1' | 'een.loiterDetectionEvent.v1' | 'een.objectLineCrossEvent.v1' | 'een.objectLineCrossCountEvent.v1' | 'een.countedObjectLineCrossEvent.v1' | 'een.objectIntrusionEvent.v1' | 'een.objectRemovalEvent.v1' | 'een.personTailgateEvent.v1' | 'een.ppeViolationEvent.v1' | 'een.sceneLabelEvent.v1' | 'een.eevaQueryEvent.v1' | 'een.lprPlateReadEvent.v1' | 'een.fleetCodeRecognitionEvent.v1' | 'een.gunShotAudioDetectionEvent.v1' | 'een.t3AlarmAudioDetectionEvent.v1' | 'een.t4AlarmAudioDetectionEvent.v1' | 'een.posTransactionEvent.v1' | 'een.deviceCloudStatusUpdateEvent.v1' | 'een.deviceCloudConnectionStatusUpdateEvent.v1' | 'een.edgeReportedDeviceStatusEvent.v1' | 'een.deviceIOEvent.v1' | 'een.deviceOperationEvent.v1' | 'een.ptzPositionUpdateEvent.v1' | 'een.doorStatusEvent.v1' | 'een.batteryLevelUpdateEvent.v1' | 'een.measurementThresholdStatusEvent.v1' | 'een.thermalCameraThresholdStatusEvent.v1' | 'een.layoutCreationEvent.v1' | 'een.layoutUpdateEvent.v1' | 'een.layoutDeletionEvent.v1' | 'een.deviceCreationEvent.v1' | 'een.deviceUpdateEvent.v1' | 'een.deviceDeletionEvent.v1' | 'een.userCreationEvent.v1' | 'een.userUpdateEvent.v1' | 'een.userDeletionEvent.v1' | 'een.accountCreationEvent.v1' | 'een.accountUpdateEvent.v1' | 'een.accountDeletionEvent.v1' | 'een.jobCreationEvent.v1' | 'een.jobUpdateEvent.v1' | 'een.jobDeletionEvent.v1' | 'een.panicButtonEvent.v1' | 'een.evacuateProtocolEvent.v1' | 'een.holdProtocolEvent.v1' | 'een.lockdownProtocolEvent.v1' | 'een.secureProtocolEvent.v1' | 'een.shelterProtocolEvent.v1' | 'een.violenceDetectionEvent.v1' | 'een.fightDetectionEvent.v1' | 'een.handsUpDetectionEvent.v1' | 'een.vapeDetectionEvent.v1';
4020
+
3807
4021
  /**
3808
4022
  * Layout entity from EEN API v3.0.
3809
4023
  *