een-api-toolkit 0.3.85 → 0.3.97

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 (51) hide show
  1. package/.claude/agents/api-coverage-agent.md +71 -29
  2. package/.claude/agents/een-devices-agent.md +21 -0
  3. package/.claude/agents/een-ptz-agent.md +245 -0
  4. package/CHANGELOG.md +60 -40
  5. package/dist/index.cjs +3 -3
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.ts +412 -0
  8. package/dist/index.js +1079 -951
  9. package/dist/index.js.map +1 -1
  10. package/docs/AI-CONTEXT.md +3 -1
  11. package/docs/ai-reference/AI-AUTH.md +1 -1
  12. package/docs/ai-reference/AI-AUTOMATIONS.md +1 -1
  13. package/docs/ai-reference/AI-DEVICES.md +12 -1
  14. package/docs/ai-reference/AI-EVENT-DATA-SCHEMAS.md +1 -1
  15. package/docs/ai-reference/AI-EVENTS.md +1 -1
  16. package/docs/ai-reference/AI-GROUPING.md +1 -1
  17. package/docs/ai-reference/AI-JOBS.md +1 -1
  18. package/docs/ai-reference/AI-MEDIA.md +1 -1
  19. package/docs/ai-reference/AI-PTZ.md +174 -0
  20. package/docs/ai-reference/AI-SETUP.md +1 -1
  21. package/docs/ai-reference/AI-USERS.md +1 -1
  22. package/examples/vue-ptz/.env.example +4 -0
  23. package/examples/vue-ptz/README.md +221 -0
  24. package/examples/vue-ptz/e2e/app.spec.ts +58 -0
  25. package/examples/vue-ptz/e2e/auth.spec.ts +296 -0
  26. package/examples/vue-ptz/index.html +13 -0
  27. package/examples/vue-ptz/package-lock.json +1729 -0
  28. package/examples/vue-ptz/package.json +29 -0
  29. package/examples/vue-ptz/playwright.config.ts +49 -0
  30. package/examples/vue-ptz/screenshot-ptz.png +0 -0
  31. package/examples/vue-ptz/src/App.vue +154 -0
  32. package/examples/vue-ptz/src/components/ApiLog.vue +387 -0
  33. package/examples/vue-ptz/src/components/CameraSelector.vue +155 -0
  34. package/examples/vue-ptz/src/components/DirectionPad.vue +350 -0
  35. package/examples/vue-ptz/src/components/LiveVideoPlayer.vue +248 -0
  36. package/examples/vue-ptz/src/components/PositionDisplay.vue +206 -0
  37. package/examples/vue-ptz/src/components/PositionInput.vue +190 -0
  38. package/examples/vue-ptz/src/components/PresetManager.vue +538 -0
  39. package/examples/vue-ptz/src/composables/useApiLog.ts +89 -0
  40. package/examples/vue-ptz/src/main.ts +22 -0
  41. package/examples/vue-ptz/src/router/index.ts +61 -0
  42. package/examples/vue-ptz/src/views/Callback.vue +76 -0
  43. package/examples/vue-ptz/src/views/Home.vue +199 -0
  44. package/examples/vue-ptz/src/views/Login.vue +32 -0
  45. package/examples/vue-ptz/src/views/Logout.vue +59 -0
  46. package/examples/vue-ptz/src/views/PtzControl.vue +173 -0
  47. package/examples/vue-ptz/src/vite-env.d.ts +12 -0
  48. package/examples/vue-ptz/tsconfig.json +21 -0
  49. package/examples/vue-ptz/tsconfig.node.json +11 -0
  50. package/examples/vue-ptz/vite.config.ts +12 -0
  51. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -605,6 +605,25 @@ export declare interface Camera {
605
605
  rtspConnectionSettings?: CameraRtspConnectionSettings;
606
606
  /** Physical position of the camera */
607
607
  devicePosition?: CameraDevicePosition;
608
+ /** Capabilities of the camera (returned when `include: ['capabilities']` is requested) */
609
+ capabilities?: {
610
+ ptz?: {
611
+ /** Whether this camera supports PTZ controls */
612
+ capable?: boolean;
613
+ /** Whether this is a fisheye camera (not a true PTZ camera) */
614
+ fisheye?: boolean;
615
+ /** Whether the camera supports pan/tilt movements */
616
+ panTilt?: boolean;
617
+ /** Whether the camera supports zoom */
618
+ zoom?: boolean;
619
+ /** Whether the camera supports absolute position moves */
620
+ positionMove?: boolean;
621
+ /** Whether the camera supports directional moves */
622
+ directionMove?: boolean;
623
+ /** Whether the camera supports center-on moves */
624
+ centerOnMove?: boolean;
625
+ };
626
+ };
608
627
  /** List of enabled analytics on this camera */
609
628
  enabledAnalytics?: string[];
610
629
  /** Recording mode settings */
@@ -3861,6 +3880,62 @@ export declare function getNotification(notificationId: string): Promise<Result<
3861
3880
  */
3862
3881
  export declare function getProxyUrl(): string | undefined;
3863
3882
 
3883
+ /**
3884
+ * Get the current PTZ position of a camera.
3885
+ *
3886
+ * @remarks
3887
+ * Fetches the current pan, tilt, and zoom coordinates from
3888
+ * `/api/v3.0/cameras/{cameraId}/ptz/position`.
3889
+ *
3890
+ * For more details, see the
3891
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/getptzposition).
3892
+ *
3893
+ * @param cameraId - The unique identifier of the PTZ camera
3894
+ * @returns A Result containing the current PTZ position or an error
3895
+ *
3896
+ * @example
3897
+ * ```typescript
3898
+ * import { getPtzPosition } from 'een-api-toolkit'
3899
+ *
3900
+ * const { data, error } = await getPtzPosition('camera-123')
3901
+ * if (data) {
3902
+ * console.log(`Pan: ${data.x}, Tilt: ${data.y}, Zoom: ${data.z}`)
3903
+ * }
3904
+ * ```
3905
+ *
3906
+ * @category PTZ
3907
+ */
3908
+ export declare function getPtzPosition(cameraId: string): Promise<Result<PtzPositionResponse>>;
3909
+
3910
+ /**
3911
+ * Get PTZ settings for a camera, including presets and automation mode.
3912
+ *
3913
+ * @remarks
3914
+ * Fetches PTZ configuration from `/api/v3.0/cameras/{cameraId}/ptz/settings`.
3915
+ * Returns presets, home preset, automation mode, and auto-start delay.
3916
+ *
3917
+ * For more details, see the
3918
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/getptzsettings).
3919
+ *
3920
+ * @param cameraId - The unique identifier of the PTZ camera
3921
+ * @returns A Result containing the PTZ settings or an error
3922
+ *
3923
+ * @example
3924
+ * ```typescript
3925
+ * import { getPtzSettings } from 'een-api-toolkit'
3926
+ *
3927
+ * const { data, error } = await getPtzSettings('camera-123')
3928
+ * if (data) {
3929
+ * console.log('Mode:', data.mode)
3930
+ * console.log('Presets:', data.presets.length)
3931
+ * console.log('Home:', data.homePreset)
3932
+ * }
3933
+ * ```
3934
+ *
3935
+ * @category PTZ
3936
+ */
3937
+ export declare function getPtzSettings(cameraId: string): Promise<Result<PtzSettings>>;
3938
+
3864
3939
  /**
3865
3940
  * Get a recorded image from a camera.
3866
3941
  *
@@ -6259,6 +6334,39 @@ export declare type MetricActorType = 'bridge' | 'camera' | 'speaker' | 'account
6259
6334
  */
6260
6335
  export declare type MetricDataPoint = [number, number];
6261
6336
 
6337
+ /**
6338
+ * Move a PTZ camera to a new position.
6339
+ *
6340
+ * @remarks
6341
+ * Sends a movement command to a PTZ camera via
6342
+ * `PUT /api/v3.0/cameras/{cameraId}/ptz/position`.
6343
+ * Supports three move types: absolute position, relative direction, and center-on.
6344
+ *
6345
+ * For more details, see the
6346
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/updateptzposition).
6347
+ *
6348
+ * @param cameraId - The unique identifier of the PTZ camera
6349
+ * @param move - The movement command (position, direction, or centerOn)
6350
+ * @returns A Result containing void on success or an error
6351
+ *
6352
+ * @example
6353
+ * ```typescript
6354
+ * import { movePtz } from 'een-api-toolkit'
6355
+ *
6356
+ * // Move to absolute position
6357
+ * await movePtz('camera-123', { moveType: 'position', x: 0.5, y: -0.3, z: 2.0 })
6358
+ *
6359
+ * // Move in a direction
6360
+ * await movePtz('camera-123', { moveType: 'direction', direction: ['left'], stepSize: 'medium' })
6361
+ *
6362
+ * // Center on a point in the frame
6363
+ * await movePtz('camera-123', { moveType: 'centerOn', relativeX: 0.75, relativeY: 0.5 })
6364
+ * ```
6365
+ *
6366
+ * @category PTZ
6367
+ */
6368
+ export declare function movePtz(cameraId: string, move: PtzMove): Promise<Result<void>>;
6369
+
6262
6370
  /**
6263
6371
  * Notification entity from EEN API v3.0.
6264
6372
  *
@@ -6432,6 +6540,276 @@ export declare interface PlaySpeakerAudioClipSettings {
6432
6540
  volume?: number;
6433
6541
  }
6434
6542
 
6543
+ /**
6544
+ * Center the camera on a point in the current frame.
6545
+ *
6546
+ * @remarks
6547
+ * Uses relative coordinates within the current video frame
6548
+ * to center the camera on a specific point. Useful for click-to-center
6549
+ * functionality in video players.
6550
+ * Both `relativeX` and `relativeY` must be in the range 0.0 to 1.0,
6551
+ * where (0.0, 0.0) is the top-left corner and (1.0, 1.0) is the bottom-right.
6552
+ *
6553
+ * @example
6554
+ * ```typescript
6555
+ * // Center on the middle-right area of the frame
6556
+ * const move: PtzCenterOnMove = {
6557
+ * moveType: 'centerOn',
6558
+ * relativeX: 0.75,
6559
+ * relativeY: 0.5
6560
+ * }
6561
+ * ```
6562
+ *
6563
+ * @category PTZ
6564
+ */
6565
+ export declare interface PtzCenterOnMove {
6566
+ /** Must be 'centerOn' */
6567
+ moveType: 'centerOn';
6568
+ /** Horizontal position in frame (0.0 = left, 1.0 = right) */
6569
+ relativeX: number;
6570
+ /** Vertical position in frame (0.0 = top, 1.0 = bottom) */
6571
+ relativeY: number;
6572
+ }
6573
+
6574
+ /**
6575
+ * Directional movement options for PTZ cameras.
6576
+ *
6577
+ * @category PTZ
6578
+ */
6579
+ export declare type PtzDirection = 'up' | 'down' | 'left' | 'right' | 'in' | 'out';
6580
+
6581
+ /**
6582
+ * Move in a relative direction with optional step size.
6583
+ *
6584
+ * @remarks
6585
+ * Moves the camera in one or more directions relative to its current position.
6586
+ * Multiple directions can be combined (e.g., up + left for diagonal movement).
6587
+ *
6588
+ * @example
6589
+ * ```typescript
6590
+ * const move: PtzDirectionMove = {
6591
+ * moveType: 'direction',
6592
+ * direction: ['up', 'left'],
6593
+ * stepSize: 'medium'
6594
+ * }
6595
+ * ```
6596
+ *
6597
+ * @category PTZ
6598
+ */
6599
+ export declare interface PtzDirectionMove {
6600
+ /** Must be 'direction' */
6601
+ moveType: 'direction';
6602
+ /** One or more directions to move */
6603
+ direction: PtzDirection[];
6604
+ /** Size of each movement step (default: medium) */
6605
+ stepSize?: PtzStepSize;
6606
+ }
6607
+
6608
+ /**
6609
+ * PTZ automation mode.
6610
+ *
6611
+ * @remarks
6612
+ * - `homeReturn` - Camera returns to the home preset after a period of inactivity
6613
+ * - `tour` - Camera cycles through presets automatically
6614
+ * - `manualOnly` - No automatic movement; camera stays where positioned
6615
+ *
6616
+ * @category PTZ
6617
+ */
6618
+ export declare type PtzMode = 'homeReturn' | 'tour' | 'manualOnly';
6619
+
6620
+ /**
6621
+ * Discriminated union of all PTZ move types.
6622
+ *
6623
+ * @remarks
6624
+ * Use the `moveType` field to discriminate between the three movement types.
6625
+ *
6626
+ * @example
6627
+ * ```typescript
6628
+ * import { movePtz, type PtzMove } from 'een-api-toolkit'
6629
+ *
6630
+ * // Position move
6631
+ * await movePtz('camera-id', { moveType: 'position', x: 0.5, y: 0.0, z: 1.0 })
6632
+ *
6633
+ * // Direction move
6634
+ * await movePtz('camera-id', { moveType: 'direction', direction: ['left'], stepSize: 'small' })
6635
+ *
6636
+ * // Center-on move
6637
+ * await movePtz('camera-id', { moveType: 'centerOn', relativeX: 0.5, relativeY: 0.5 })
6638
+ * ```
6639
+ *
6640
+ * @category PTZ
6641
+ */
6642
+ export declare type PtzMove = PtzPositionMove | PtzDirectionMove | PtzCenterOnMove;
6643
+
6644
+ /**
6645
+ * Types of PTZ movement commands.
6646
+ *
6647
+ * @remarks
6648
+ * - `position` - Move to absolute coordinates (x, y, z)
6649
+ * - `direction` - Move in relative directions (up, down, left, right, in, out)
6650
+ * - `centerOn` - Center the camera view on a point in the current frame
6651
+ *
6652
+ * @category PTZ
6653
+ */
6654
+ export declare type PtzMoveType = 'position' | 'direction' | 'centerOn';
6655
+
6656
+ /**
6657
+ * Pan/Tilt/Zoom position coordinates for movement commands.
6658
+ *
6659
+ * @remarks
6660
+ * Used when specifying target positions in movement commands.
6661
+ * Values are optional since you may want to move only one axis at a time.
6662
+ *
6663
+ * @category PTZ
6664
+ */
6665
+ export declare interface PtzPosition {
6666
+ /** Pan position (horizontal rotation) */
6667
+ x?: number;
6668
+ /** Tilt position (vertical rotation) */
6669
+ y?: number;
6670
+ /** Zoom level */
6671
+ z?: number;
6672
+ }
6673
+
6674
+ /**
6675
+ * Move to absolute PTZ coordinates.
6676
+ *
6677
+ * @remarks
6678
+ * Moves the camera to specific x, y, z position values.
6679
+ * At least one coordinate (x, y, or z) should be provided for a meaningful move.
6680
+ *
6681
+ * @example
6682
+ * ```typescript
6683
+ * const move: PtzPositionMove = {
6684
+ * moveType: 'position',
6685
+ * x: 0.5,
6686
+ * y: -0.3,
6687
+ * z: 2.0
6688
+ * }
6689
+ * ```
6690
+ *
6691
+ * @category PTZ
6692
+ */
6693
+ export declare interface PtzPositionMove {
6694
+ /** Must be 'position' */
6695
+ moveType: 'position';
6696
+ /** Target pan position */
6697
+ x?: number;
6698
+ /** Target tilt position */
6699
+ y?: number;
6700
+ /** Target zoom level */
6701
+ z?: number;
6702
+ }
6703
+
6704
+ /**
6705
+ * PTZ position as returned by the API (all fields present).
6706
+ *
6707
+ * @remarks
6708
+ * When reading the current camera position via `getPtzPosition()`, the API
6709
+ * always returns all three coordinates. This type extends `PtzPosition` with
6710
+ * required fields for type safety at response sites.
6711
+ *
6712
+ * @category PTZ
6713
+ */
6714
+ export declare interface PtzPositionResponse {
6715
+ /** Pan position (horizontal rotation) */
6716
+ x: number;
6717
+ /** Tilt position (vertical rotation) */
6718
+ y: number;
6719
+ /** Zoom level */
6720
+ z: number;
6721
+ }
6722
+
6723
+ /**
6724
+ * A saved PTZ preset position.
6725
+ *
6726
+ * @remarks
6727
+ * Presets allow quick navigation to saved camera positions.
6728
+ *
6729
+ * @category PTZ
6730
+ */
6731
+ export declare interface PtzPreset {
6732
+ /** Human-readable name for this preset */
6733
+ name: string;
6734
+ /** The saved position coordinates (always has x, y, z from the API) */
6735
+ position: PtzPositionResponse;
6736
+ /** Time the camera stays at this preset (in seconds) during tour mode */
6737
+ timeAtPreset: number;
6738
+ }
6739
+
6740
+ /**
6741
+ * PTZ camera settings including presets and automation mode.
6742
+ *
6743
+ * @remarks
6744
+ * Contains the full PTZ configuration for a camera: saved presets,
6745
+ * the designated home preset, automation mode, and auto-start delay.
6746
+ *
6747
+ * @example
6748
+ * ```typescript
6749
+ * import { getPtzSettings } from 'een-api-toolkit'
6750
+ *
6751
+ * const { data, error } = await getPtzSettings('camera-id')
6752
+ * if (data) {
6753
+ * console.log('Mode:', data.mode)
6754
+ * console.log('Presets:', data.presets.map(p => p.name))
6755
+ * console.log('Home preset:', data.homePreset)
6756
+ * }
6757
+ * ```
6758
+ *
6759
+ * @category PTZ
6760
+ */
6761
+ export declare interface PtzSettings {
6762
+ /** Array of saved preset positions */
6763
+ presets: PtzPreset[];
6764
+ /** Name of the home preset, or null if none is set */
6765
+ homePreset: string | null;
6766
+ /** Automation mode controlling automatic camera movement */
6767
+ mode: PtzMode;
6768
+ /** Seconds of inactivity before automatic movement begins */
6769
+ autoStartDelay: number;
6770
+ }
6771
+
6772
+ /**
6773
+ * Parameters for updating PTZ settings (all fields optional).
6774
+ *
6775
+ * @remarks
6776
+ * Used with `updatePtzSettings()` to partially update PTZ configuration.
6777
+ * Only provided fields are updated; omitted fields retain their current values.
6778
+ *
6779
+ * @example
6780
+ * ```typescript
6781
+ * import { updatePtzSettings } from 'een-api-toolkit'
6782
+ *
6783
+ * // Change mode only
6784
+ * await updatePtzSettings('camera-id', { mode: 'tour' })
6785
+ *
6786
+ * // Update presets and home preset
6787
+ * await updatePtzSettings('camera-id', {
6788
+ * presets: [{ name: 'Entrance', position: { x: 0, y: 0, z: 1 }, timeAtPreset: 10 }],
6789
+ * homePreset: 'Entrance'
6790
+ * })
6791
+ * ```
6792
+ *
6793
+ * @category PTZ
6794
+ */
6795
+ export declare interface PtzSettingsUpdate {
6796
+ /** Updated array of preset positions */
6797
+ presets?: PtzPreset[];
6798
+ /** Updated home preset name */
6799
+ homePreset?: string | null;
6800
+ /** Updated automation mode */
6801
+ mode?: PtzMode;
6802
+ /** Updated auto-start delay in seconds */
6803
+ autoStartDelay?: number;
6804
+ }
6805
+
6806
+ /**
6807
+ * Step size for directional movements.
6808
+ *
6809
+ * @category PTZ
6810
+ */
6811
+ export declare type PtzStepSize = 'small' | 'medium' | 'large';
6812
+
6435
6813
  /**
6436
6814
  * Result of getting a recorded image.
6437
6815
  *
@@ -6815,6 +7193,40 @@ export declare interface UpdateLayoutParams {
6815
7193
  panes?: LayoutPane[];
6816
7194
  }
6817
7195
 
7196
+ /**
7197
+ * Update PTZ settings for a camera (partial update).
7198
+ *
7199
+ * @remarks
7200
+ * Updates PTZ configuration via `PATCH /api/v3.0/cameras/{cameraId}/ptz/settings`.
7201
+ * Only provided fields are updated; omitted fields retain their current values.
7202
+ *
7203
+ * For more details, see the
7204
+ * [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/updateptzsettings).
7205
+ *
7206
+ * @param cameraId - The unique identifier of the PTZ camera
7207
+ * @param settings - The settings fields to update
7208
+ * @returns A Result containing void on success or an error
7209
+ *
7210
+ * @example
7211
+ * ```typescript
7212
+ * import { updatePtzSettings } from 'een-api-toolkit'
7213
+ *
7214
+ * // Change mode to tour
7215
+ * await updatePtzSettings('camera-123', { mode: 'tour' })
7216
+ *
7217
+ * // Add a preset and set it as home
7218
+ * await updatePtzSettings('camera-123', {
7219
+ * presets: [
7220
+ * { name: 'Entrance', position: { x: 0, y: 0, z: 1 }, timeAtPreset: 10 }
7221
+ * ],
7222
+ * homePreset: 'Entrance'
7223
+ * })
7224
+ * ```
7225
+ *
7226
+ * @category PTZ
7227
+ */
7228
+ export declare function updatePtzSettings(cameraId: string, settings: PtzSettingsUpdate): Promise<Result<void>>;
7229
+
6818
7230
  /**
6819
7231
  * Pinia store for authentication state management
6820
7232
  */