een-api-toolkit 0.3.28 → 0.3.35
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/.claude/agents/docs-accuracy-reviewer.md +15 -3
- package/.claude/agents/een-auth-agent.md +131 -0
- package/.claude/agents/een-devices-agent.md +48 -13
- package/.claude/agents/een-events-agent.md +98 -0
- package/.claude/agents/een-grouping-agent.md +394 -0
- package/.claude/agents/een-media-agent.md +25 -5
- package/CHANGELOG.md +99 -10
- package/README.md +5 -3
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +561 -0
- package/dist/index.js +388 -218
- package/dist/index.js.map +1 -1
- package/docs/AI-CONTEXT.md +13 -1
- package/docs/ai-reference/AI-AUTH.md +1 -1
- package/docs/ai-reference/AI-DEVICES.md +1 -1
- package/docs/ai-reference/AI-EVENTS.md +1 -1
- package/docs/ai-reference/AI-GROUPING.md +411 -0
- package/docs/ai-reference/AI-MEDIA.md +1 -1
- package/docs/ai-reference/AI-SETUP.md +1 -1
- package/docs/ai-reference/AI-USERS.md +1 -1
- package/examples/vue-alerts-metrics/README.md +2 -0
- package/examples/vue-alerts-metrics/alert-metrics-screenshot.png +0 -0
- package/examples/vue-alerts-metrics/e2e/auth.spec.ts +1 -1
- package/examples/vue-alerts-metrics/package-lock.json +17 -14
- package/examples/vue-alerts-metrics/package.json +1 -1
- package/examples/vue-bridges/package-lock.json +21 -15
- package/examples/vue-bridges/package.json +1 -1
- package/examples/vue-cameras/package-lock.json +21 -15
- package/examples/vue-cameras/package.json +1 -1
- package/examples/vue-event-subscriptions/README.md +2 -0
- package/examples/vue-event-subscriptions/event-subscriptions-screenshot.png +0 -0
- package/examples/vue-event-subscriptions/package-lock.json +17 -14
- package/examples/vue-event-subscriptions/package.json +1 -1
- package/examples/vue-events/events-screenshot.png +0 -0
- package/examples/vue-events/package-lock.json +17 -14
- package/examples/vue-events/package.json +1 -1
- package/examples/vue-feeds/package-lock.json +21 -15
- package/examples/vue-feeds/package.json +1 -1
- package/examples/vue-layouts/.env.example +12 -0
- package/examples/vue-layouts/README.md +320 -0
- package/examples/vue-layouts/e2e/app.spec.ts +76 -0
- package/examples/vue-layouts/e2e/auth.spec.ts +264 -0
- package/examples/vue-layouts/index.html +13 -0
- package/examples/vue-layouts/layouts-screenshot.png +0 -0
- package/examples/vue-layouts/package-lock.json +1722 -0
- package/examples/vue-layouts/package.json +28 -0
- package/examples/vue-layouts/playwright.config.ts +47 -0
- package/examples/vue-layouts/src/App.vue +124 -0
- package/examples/vue-layouts/src/components/LayoutModal.vue +456 -0
- package/examples/vue-layouts/src/main.ts +25 -0
- package/examples/vue-layouts/src/router/index.ts +62 -0
- package/examples/vue-layouts/src/views/Callback.vue +76 -0
- package/examples/vue-layouts/src/views/Home.vue +188 -0
- package/examples/vue-layouts/src/views/Layouts.vue +355 -0
- package/examples/vue-layouts/src/views/Login.vue +33 -0
- package/examples/vue-layouts/src/views/Logout.vue +59 -0
- package/examples/vue-layouts/src/vite-env.d.ts +12 -0
- package/examples/vue-layouts/tsconfig.json +21 -0
- package/examples/vue-layouts/tsconfig.node.json +10 -0
- package/examples/vue-layouts/vite.config.ts +12 -0
- package/examples/vue-media/media-screenshot.png +0 -0
- package/examples/vue-media/package-lock.json +19 -14
- package/examples/vue-media/package.json +1 -1
- package/examples/vue-users/package-lock.json +21 -16
- package/examples/vue-users/package.json +2 -2
- package/package.json +2 -2
- package/scripts/setup-agents.ts +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -384,6 +384,13 @@ export declare interface Camera {
|
|
|
384
384
|
updatedAt?: string;
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
+
/**
|
|
388
|
+
* Camera aspect ratio values for layout settings.
|
|
389
|
+
*
|
|
390
|
+
* @category Layouts
|
|
391
|
+
*/
|
|
392
|
+
export declare type CameraAspectRatio = '16x9' | '4x3';
|
|
393
|
+
|
|
387
394
|
/**
|
|
388
395
|
* Device information for a camera.
|
|
389
396
|
*
|
|
@@ -495,6 +502,25 @@ export declare interface CameraShareDetails {
|
|
|
495
502
|
*/
|
|
496
503
|
export declare type CameraStatus = 'online' | 'offline' | 'deviceOffline' | 'bridgeOffline' | 'invalidCredentials' | 'error' | 'streaming' | 'registered' | 'attaching' | 'initializing';
|
|
497
504
|
|
|
505
|
+
/**
|
|
506
|
+
* Camera status counts for layout resource summaries.
|
|
507
|
+
*
|
|
508
|
+
* @remarks
|
|
509
|
+
* Used in resourceStatusCounts to show aggregated camera statuses.
|
|
510
|
+
*
|
|
511
|
+
* @category Layouts
|
|
512
|
+
*/
|
|
513
|
+
export declare interface CameraStatusCounts {
|
|
514
|
+
/** Number of online cameras */
|
|
515
|
+
online?: number;
|
|
516
|
+
/** Number of offline cameras */
|
|
517
|
+
offline?: number;
|
|
518
|
+
/** Number of cameras in error state */
|
|
519
|
+
error?: number;
|
|
520
|
+
/** Number of cameras with other statuses */
|
|
521
|
+
other?: number;
|
|
522
|
+
}
|
|
523
|
+
|
|
498
524
|
/**
|
|
499
525
|
* Stream URLs for camera media.
|
|
500
526
|
*
|
|
@@ -649,6 +675,83 @@ export declare interface CreateEventSubscriptionParams {
|
|
|
649
675
|
filters: FilterCreate[];
|
|
650
676
|
}
|
|
651
677
|
|
|
678
|
+
/**
|
|
679
|
+
* Create a new layout.
|
|
680
|
+
*
|
|
681
|
+
* @remarks
|
|
682
|
+
* Creates a layout via `POST /api/v3.0/layouts`. Name and settings are required.
|
|
683
|
+
* Panes can be added during creation or later via `updateLayout()`.
|
|
684
|
+
*
|
|
685
|
+
* For more details, see the
|
|
686
|
+
* [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/createlayout).
|
|
687
|
+
*
|
|
688
|
+
* @param params - The layout configuration
|
|
689
|
+
* @returns A Result containing the created layout or an error
|
|
690
|
+
*
|
|
691
|
+
* @example
|
|
692
|
+
* ```typescript
|
|
693
|
+
* import { createLayout } from 'een-api-toolkit'
|
|
694
|
+
*
|
|
695
|
+
* const { data, error } = await createLayout({
|
|
696
|
+
* name: 'Main Lobby View',
|
|
697
|
+
* settings: {
|
|
698
|
+
* showCameraBorder: true,
|
|
699
|
+
* showCameraName: true,
|
|
700
|
+
* cameraAspectRatio: '16x9',
|
|
701
|
+
* paneColumns: 3
|
|
702
|
+
* },
|
|
703
|
+
* panes: [
|
|
704
|
+
* { id: 1, name: 'Entrance', type: 'preview', size: 1, cameraId: 'cam-123' },
|
|
705
|
+
* { id: 2, name: 'Lobby', type: 'preview', size: 2, cameraId: 'cam-456' }
|
|
706
|
+
* ]
|
|
707
|
+
* })
|
|
708
|
+
*
|
|
709
|
+
* if (data) {
|
|
710
|
+
* console.log(`Created layout: ${data.id}`)
|
|
711
|
+
* }
|
|
712
|
+
* ```
|
|
713
|
+
*
|
|
714
|
+
* @category Layouts
|
|
715
|
+
*/
|
|
716
|
+
export declare function createLayout(params: CreateLayoutParams): Promise<Result<Layout>>;
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Parameters for creating a new layout.
|
|
720
|
+
*
|
|
721
|
+
* @remarks
|
|
722
|
+
* Name and settings are required. Panes can be added during creation
|
|
723
|
+
* or later via update.
|
|
724
|
+
*
|
|
725
|
+
* @example
|
|
726
|
+
* ```typescript
|
|
727
|
+
* import { createLayout } from 'een-api-toolkit'
|
|
728
|
+
*
|
|
729
|
+
* const { data, error } = await createLayout({
|
|
730
|
+
* name: 'Main Lobby View',
|
|
731
|
+
* settings: {
|
|
732
|
+
* showCameraBorder: true,
|
|
733
|
+
* showCameraName: true,
|
|
734
|
+
* cameraAspectRatio: '16x9',
|
|
735
|
+
* paneColumns: 3
|
|
736
|
+
* },
|
|
737
|
+
* panes: [
|
|
738
|
+
* { id: 1, name: 'Entrance', type: 'preview', size: 1, cameraId: 'cam-123' },
|
|
739
|
+
* { id: 2, name: 'Lobby', type: 'preview', size: 2, cameraId: 'cam-456' }
|
|
740
|
+
* ]
|
|
741
|
+
* })
|
|
742
|
+
* ```
|
|
743
|
+
*
|
|
744
|
+
* @category Layouts
|
|
745
|
+
*/
|
|
746
|
+
export declare interface CreateLayoutParams {
|
|
747
|
+
/** Display name for the layout (required) */
|
|
748
|
+
name: string;
|
|
749
|
+
/** Display settings for the layout (required) */
|
|
750
|
+
settings: LayoutSettings;
|
|
751
|
+
/** Initial panes to add to the layout (optional) */
|
|
752
|
+
panes?: LayoutPane[];
|
|
753
|
+
}
|
|
754
|
+
|
|
652
755
|
/**
|
|
653
756
|
* Delete an event subscription.
|
|
654
757
|
*
|
|
@@ -678,6 +781,40 @@ export declare interface CreateEventSubscriptionParams {
|
|
|
678
781
|
*/
|
|
679
782
|
export declare function deleteEventSubscription(subscriptionId: string): Promise<Result<void>>;
|
|
680
783
|
|
|
784
|
+
/**
|
|
785
|
+
* Delete a layout.
|
|
786
|
+
*
|
|
787
|
+
* @remarks
|
|
788
|
+
* Deletes a layout via `DELETE /api/v3.0/layouts/{layoutId}`.
|
|
789
|
+
* Returns void on success (204 No Content).
|
|
790
|
+
*
|
|
791
|
+
* For more details, see the
|
|
792
|
+
* [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/deletelayout).
|
|
793
|
+
*
|
|
794
|
+
* @param layoutId - The unique identifier of the layout to delete
|
|
795
|
+
* @returns A Result containing void on success or an error
|
|
796
|
+
*
|
|
797
|
+
* @example
|
|
798
|
+
* ```typescript
|
|
799
|
+
* import { deleteLayout } from 'een-api-toolkit'
|
|
800
|
+
*
|
|
801
|
+
* const { error } = await deleteLayout('layout-123')
|
|
802
|
+
*
|
|
803
|
+
* if (error) {
|
|
804
|
+
* if (error.code === 'NOT_FOUND') {
|
|
805
|
+
* console.log('Layout already deleted')
|
|
806
|
+
* } else {
|
|
807
|
+
* console.error('Delete failed:', error.message)
|
|
808
|
+
* }
|
|
809
|
+
* } else {
|
|
810
|
+
* console.log('Layout deleted successfully')
|
|
811
|
+
* }
|
|
812
|
+
* ```
|
|
813
|
+
*
|
|
814
|
+
* @category Layouts
|
|
815
|
+
*/
|
|
816
|
+
export declare function deleteLayout(layoutId: string): Promise<Result<void>>;
|
|
817
|
+
|
|
681
818
|
/**
|
|
682
819
|
* Delivery configuration (union type).
|
|
683
820
|
*
|
|
@@ -1732,6 +1869,118 @@ export declare interface GetEventParams {
|
|
|
1732
1869
|
*/
|
|
1733
1870
|
export declare function getEventSubscription(subscriptionId: string): Promise<Result<EventSubscription>>;
|
|
1734
1871
|
|
|
1872
|
+
/**
|
|
1873
|
+
* Get a specific layout by ID.
|
|
1874
|
+
*
|
|
1875
|
+
* @remarks
|
|
1876
|
+
* Fetches a single layout from `/api/v3.0/layouts/{layoutId}`. Use the `include`
|
|
1877
|
+
* parameter to request additional fields.
|
|
1878
|
+
*
|
|
1879
|
+
* For more details, see the
|
|
1880
|
+
* [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/getlayout).
|
|
1881
|
+
*
|
|
1882
|
+
* @param layoutId - The unique identifier of the layout to fetch
|
|
1883
|
+
* @param params - Optional parameters (e.g., include additional fields)
|
|
1884
|
+
* @returns A Result containing the layout or an error
|
|
1885
|
+
*
|
|
1886
|
+
* @example
|
|
1887
|
+
* ```typescript
|
|
1888
|
+
* import { getLayout } from 'een-api-toolkit'
|
|
1889
|
+
*
|
|
1890
|
+
* const { data, error } = await getLayout('layout-123')
|
|
1891
|
+
*
|
|
1892
|
+
* if (error) {
|
|
1893
|
+
* if (error.code === 'NOT_FOUND') {
|
|
1894
|
+
* console.log('Layout not found')
|
|
1895
|
+
* }
|
|
1896
|
+
* return
|
|
1897
|
+
* }
|
|
1898
|
+
*
|
|
1899
|
+
* console.log(`Layout: ${data.name} (${data.panes.length} panes)`)
|
|
1900
|
+
*
|
|
1901
|
+
* // With additional fields
|
|
1902
|
+
* const { data: layoutWithDetails } = await getLayout('layout-123', {
|
|
1903
|
+
* include: ['effectivePermissions', 'resourceStatusCounts']
|
|
1904
|
+
* })
|
|
1905
|
+
* ```
|
|
1906
|
+
*
|
|
1907
|
+
* @category Layouts
|
|
1908
|
+
*/
|
|
1909
|
+
export declare function getLayout(layoutId: string, params?: GetLayoutParams): Promise<Result<Layout>>;
|
|
1910
|
+
|
|
1911
|
+
/**
|
|
1912
|
+
* Valid include options for getting a single layout.
|
|
1913
|
+
*
|
|
1914
|
+
* @category Layouts
|
|
1915
|
+
*/
|
|
1916
|
+
export declare type GetLayoutInclude = 'effectivePermissions' | 'resourceCounts' | 'resourceStatusCounts';
|
|
1917
|
+
|
|
1918
|
+
/**
|
|
1919
|
+
* Parameters for getting a single layout.
|
|
1920
|
+
*
|
|
1921
|
+
* @remarks
|
|
1922
|
+
* Controls which additional fields to include in the response.
|
|
1923
|
+
*
|
|
1924
|
+
* @example
|
|
1925
|
+
* ```typescript
|
|
1926
|
+
* import { getLayout } from 'een-api-toolkit'
|
|
1927
|
+
*
|
|
1928
|
+
* const { data } = await getLayout('layout-123', {
|
|
1929
|
+
* include: ['effectivePermissions', 'resourceStatusCounts']
|
|
1930
|
+
* })
|
|
1931
|
+
* ```
|
|
1932
|
+
*
|
|
1933
|
+
* @category Layouts
|
|
1934
|
+
*/
|
|
1935
|
+
export declare interface GetLayoutParams {
|
|
1936
|
+
/** Additional fields to include in the response */
|
|
1937
|
+
include?: GetLayoutInclude[];
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
/**
|
|
1941
|
+
* List layouts with optional pagination and filtering.
|
|
1942
|
+
*
|
|
1943
|
+
* @remarks
|
|
1944
|
+
* Fetches a paginated list of layouts from `/api/v3.0/layouts`. Supports
|
|
1945
|
+
* filtering options for name, search, and more.
|
|
1946
|
+
*
|
|
1947
|
+
* For more details, see the
|
|
1948
|
+
* [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listlayouts).
|
|
1949
|
+
*
|
|
1950
|
+
* @param params - Optional pagination and filtering parameters
|
|
1951
|
+
* @returns A Result containing a paginated list of layouts or an error
|
|
1952
|
+
*
|
|
1953
|
+
* @example
|
|
1954
|
+
* ```typescript
|
|
1955
|
+
* import { getLayouts } from 'een-api-toolkit'
|
|
1956
|
+
*
|
|
1957
|
+
* // Basic usage
|
|
1958
|
+
* const { data, error } = await getLayouts()
|
|
1959
|
+
* if (data) {
|
|
1960
|
+
* console.log(`Found ${data.results.length} layouts`)
|
|
1961
|
+
* }
|
|
1962
|
+
*
|
|
1963
|
+
* // With filters
|
|
1964
|
+
* const { data } = await getLayouts({
|
|
1965
|
+
* pageSize: 50,
|
|
1966
|
+
* include: ['resourceCounts', 'effectivePermissions']
|
|
1967
|
+
* })
|
|
1968
|
+
*
|
|
1969
|
+
* // Fetch all layouts
|
|
1970
|
+
* let allLayouts: Layout[] = []
|
|
1971
|
+
* let pageToken: string | undefined
|
|
1972
|
+
* do {
|
|
1973
|
+
* const { data, error } = await getLayouts({ pageSize: 100, pageToken })
|
|
1974
|
+
* if (error) break
|
|
1975
|
+
* allLayouts.push(...data.results)
|
|
1976
|
+
* pageToken = data.nextPageToken
|
|
1977
|
+
* } while (pageToken)
|
|
1978
|
+
* ```
|
|
1979
|
+
*
|
|
1980
|
+
* @category Layouts
|
|
1981
|
+
*/
|
|
1982
|
+
export declare function getLayouts(params?: ListLayoutsParams): Promise<Result<PaginatedResult<Layout>>>;
|
|
1983
|
+
|
|
1735
1984
|
/**
|
|
1736
1985
|
* Get a live image from a camera.
|
|
1737
1986
|
*
|
|
@@ -2196,6 +2445,145 @@ export declare function initEenToolkit(options?: EenToolkitConfig): void;
|
|
|
2196
2445
|
*/
|
|
2197
2446
|
export declare function initMediaSession(): Promise<Result<MediaSessionResult>>;
|
|
2198
2447
|
|
|
2448
|
+
/**
|
|
2449
|
+
* Layout entity from EEN API v3.0.
|
|
2450
|
+
*
|
|
2451
|
+
* @remarks
|
|
2452
|
+
* Represents a layout (grouping of cameras) in the Eagle Eye Networks platform.
|
|
2453
|
+
* Layouts organize multiple camera views into a grid for monitoring.
|
|
2454
|
+
*
|
|
2455
|
+
* For more details on layout management, see the
|
|
2456
|
+
* [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listlayouts).
|
|
2457
|
+
*
|
|
2458
|
+
* @example
|
|
2459
|
+
* ```typescript
|
|
2460
|
+
* import { getLayouts, type Layout } from 'een-api-toolkit'
|
|
2461
|
+
*
|
|
2462
|
+
* const { data, error } = await getLayouts()
|
|
2463
|
+
* if (data) {
|
|
2464
|
+
* data.results.forEach((layout: Layout) => {
|
|
2465
|
+
* console.log(`${layout.name}: ${layout.panes.length} cameras`)
|
|
2466
|
+
* })
|
|
2467
|
+
* }
|
|
2468
|
+
* ```
|
|
2469
|
+
*
|
|
2470
|
+
* @category Layouts
|
|
2471
|
+
*/
|
|
2472
|
+
export declare interface Layout {
|
|
2473
|
+
/** Unique identifier for the layout */
|
|
2474
|
+
id: string;
|
|
2475
|
+
/** Display name of the layout */
|
|
2476
|
+
name: string;
|
|
2477
|
+
/** ID of the account this layout belongs to */
|
|
2478
|
+
accountId: string;
|
|
2479
|
+
/** Array of panes (camera positions) in the layout */
|
|
2480
|
+
panes: LayoutPane[];
|
|
2481
|
+
/** Display settings for the layout */
|
|
2482
|
+
settings: LayoutSettings;
|
|
2483
|
+
/** Permissions the current user has on this layout (optional, via include) */
|
|
2484
|
+
effectivePermissions?: LayoutPermissions;
|
|
2485
|
+
/** Count of resources in the layout (optional, via include) */
|
|
2486
|
+
resourceCounts?: {
|
|
2487
|
+
cameras?: number;
|
|
2488
|
+
};
|
|
2489
|
+
/** Status counts of cameras in the layout (optional, via include) */
|
|
2490
|
+
resourceStatusCounts?: {
|
|
2491
|
+
cameras?: CameraStatusCounts;
|
|
2492
|
+
};
|
|
2493
|
+
/** Search relevance score when using q parameter */
|
|
2494
|
+
qRelevance?: number;
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
/**
|
|
2498
|
+
* A single pane within a layout.
|
|
2499
|
+
*
|
|
2500
|
+
* @remarks
|
|
2501
|
+
* Represents one camera view position in the layout grid.
|
|
2502
|
+
*
|
|
2503
|
+
* @category Layouts
|
|
2504
|
+
*/
|
|
2505
|
+
export declare interface LayoutPane {
|
|
2506
|
+
/**
|
|
2507
|
+
* Unique identifier for the pane within the layout.
|
|
2508
|
+
*
|
|
2509
|
+
* @remarks
|
|
2510
|
+
* - Must be unique within the same layout (no duplicate IDs)
|
|
2511
|
+
* - IDs are client-managed; you assign them when creating/updating panes
|
|
2512
|
+
* - Can be reused after a pane is deleted from the layout
|
|
2513
|
+
* - Typically assigned sequentially (0, 1, 2, ...) but any unique number works
|
|
2514
|
+
*/
|
|
2515
|
+
id: number;
|
|
2516
|
+
/** Display name for the pane */
|
|
2517
|
+
name: string;
|
|
2518
|
+
/** Type of preview to display */
|
|
2519
|
+
type: LayoutPaneType;
|
|
2520
|
+
/** Size of the pane in the grid (1-3) */
|
|
2521
|
+
size: LayoutPaneSize;
|
|
2522
|
+
/** ID of the camera to display in this pane */
|
|
2523
|
+
cameraId: string;
|
|
2524
|
+
/** ID of composite preview if using compositePreview type */
|
|
2525
|
+
compositeId?: string | null;
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
/**
|
|
2529
|
+
* Layout pane size values.
|
|
2530
|
+
*
|
|
2531
|
+
* @remarks
|
|
2532
|
+
* Controls how much space the pane takes in the grid.
|
|
2533
|
+
* - 1: Normal size (1x1)
|
|
2534
|
+
* - 2: Medium size (2x2)
|
|
2535
|
+
* - 3: Large size (3x3)
|
|
2536
|
+
*
|
|
2537
|
+
* @category Layouts
|
|
2538
|
+
*/
|
|
2539
|
+
export declare type LayoutPaneSize = 1 | 2 | 3;
|
|
2540
|
+
|
|
2541
|
+
/**
|
|
2542
|
+
* Layout pane type values.
|
|
2543
|
+
*
|
|
2544
|
+
* @remarks
|
|
2545
|
+
* Defines how the pane displays camera content.
|
|
2546
|
+
*
|
|
2547
|
+
* @category Layouts
|
|
2548
|
+
*/
|
|
2549
|
+
export declare type LayoutPaneType = 'preview' | 'compositePreview';
|
|
2550
|
+
|
|
2551
|
+
/**
|
|
2552
|
+
* Permissions for layout operations.
|
|
2553
|
+
*
|
|
2554
|
+
* @remarks
|
|
2555
|
+
* Indicates what actions the current user can perform on a layout.
|
|
2556
|
+
*
|
|
2557
|
+
* @category Layouts
|
|
2558
|
+
*/
|
|
2559
|
+
export declare interface LayoutPermissions {
|
|
2560
|
+
/** Whether the user can read the layout */
|
|
2561
|
+
read?: boolean;
|
|
2562
|
+
/** Whether the user can edit the layout */
|
|
2563
|
+
edit?: boolean;
|
|
2564
|
+
/** Whether the user can delete the layout */
|
|
2565
|
+
delete?: boolean;
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
/**
|
|
2569
|
+
* Layout display settings.
|
|
2570
|
+
*
|
|
2571
|
+
* @remarks
|
|
2572
|
+
* Controls how cameras are displayed within the layout.
|
|
2573
|
+
*
|
|
2574
|
+
* @category Layouts
|
|
2575
|
+
*/
|
|
2576
|
+
export declare interface LayoutSettings {
|
|
2577
|
+
/** Whether to show borders around camera panes */
|
|
2578
|
+
showCameraBorder: boolean;
|
|
2579
|
+
/** Whether to show camera names as overlays */
|
|
2580
|
+
showCameraName: boolean;
|
|
2581
|
+
/** Aspect ratio for camera displays */
|
|
2582
|
+
cameraAspectRatio: CameraAspectRatio;
|
|
2583
|
+
/** Number of columns in the layout grid (1-6) */
|
|
2584
|
+
paneColumns: number;
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2199
2587
|
/**
|
|
2200
2588
|
* List alerts with optional filters and pagination.
|
|
2201
2589
|
*
|
|
@@ -2962,6 +3350,79 @@ export declare interface ListFeedsResult {
|
|
|
2962
3350
|
totalSize?: number;
|
|
2963
3351
|
}
|
|
2964
3352
|
|
|
3353
|
+
/**
|
|
3354
|
+
* Valid include options for listing layouts.
|
|
3355
|
+
*
|
|
3356
|
+
* @category Layouts
|
|
3357
|
+
*/
|
|
3358
|
+
export declare type ListLayoutsInclude = 'effectivePermissions' | 'resourceCounts' | 'resourceStatusCounts' | 'qRelevance';
|
|
3359
|
+
|
|
3360
|
+
/**
|
|
3361
|
+
* Parameters for listing layouts.
|
|
3362
|
+
*
|
|
3363
|
+
* @remarks
|
|
3364
|
+
* Supports extensive filtering options matching the EEN API v3.0.
|
|
3365
|
+
* All array parameters are sent as comma-separated values.
|
|
3366
|
+
*
|
|
3367
|
+
* For more details, see the
|
|
3368
|
+
* [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/listlayouts).
|
|
3369
|
+
*
|
|
3370
|
+
* @example
|
|
3371
|
+
* ```typescript
|
|
3372
|
+
* import { getLayouts } from 'een-api-toolkit'
|
|
3373
|
+
*
|
|
3374
|
+
* // Get layouts with pagination
|
|
3375
|
+
* const { data } = await getLayouts({
|
|
3376
|
+
* pageSize: 50,
|
|
3377
|
+
* include: ['resourceCounts', 'effectivePermissions']
|
|
3378
|
+
* })
|
|
3379
|
+
*
|
|
3380
|
+
* // Search layouts by name
|
|
3381
|
+
* const { data: searchResults } = await getLayouts({
|
|
3382
|
+
* q: 'lobby',
|
|
3383
|
+
* qRelevance__gte: 0.5
|
|
3384
|
+
* })
|
|
3385
|
+
*
|
|
3386
|
+
* // Filter by name
|
|
3387
|
+
* const { data: filtered } = await getLayouts({
|
|
3388
|
+
* name__contains: 'entrance'
|
|
3389
|
+
* })
|
|
3390
|
+
* ```
|
|
3391
|
+
*
|
|
3392
|
+
* @category Layouts
|
|
3393
|
+
*/
|
|
3394
|
+
export declare interface ListLayoutsParams {
|
|
3395
|
+
/** Number of results per page (default: 100, max: 1000) */
|
|
3396
|
+
pageSize?: number;
|
|
3397
|
+
/** Token for fetching a specific page */
|
|
3398
|
+
pageToken?: string;
|
|
3399
|
+
/** Additional fields to include in the response */
|
|
3400
|
+
include?: ListLayoutsInclude[];
|
|
3401
|
+
/** Fields to sort by (prefix with - for descending, + for ascending) */
|
|
3402
|
+
sort?: ListLayoutsSort[];
|
|
3403
|
+
/** Filter by exact name */
|
|
3404
|
+
name?: string;
|
|
3405
|
+
/** Filter by names (any match) */
|
|
3406
|
+
name__in?: string[];
|
|
3407
|
+
/** Filter by name containing substring (case-insensitive) */
|
|
3408
|
+
name__contains?: string;
|
|
3409
|
+
/** Filter by layout IDs */
|
|
3410
|
+
id__in?: string[];
|
|
3411
|
+
/** Filter by bridge ID of cameras in layout panes */
|
|
3412
|
+
'layoutPanes.cameras.bridgeId'?: string;
|
|
3413
|
+
/** Full-text search query */
|
|
3414
|
+
q?: string;
|
|
3415
|
+
/** Minimum search relevance score (0.0 to 1.0) */
|
|
3416
|
+
qRelevance__gte?: number;
|
|
3417
|
+
}
|
|
3418
|
+
|
|
3419
|
+
/**
|
|
3420
|
+
* Valid sort options for listing layouts.
|
|
3421
|
+
*
|
|
3422
|
+
* @category Layouts
|
|
3423
|
+
*/
|
|
3424
|
+
export declare type ListLayoutsSort = '+name' | '-name' | '+rotationOrder' | '+qRelevance' | '-qRelevance';
|
|
3425
|
+
|
|
2965
3426
|
/**
|
|
2966
3427
|
* List media intervals (recording periods) for a device.
|
|
2967
3428
|
*
|
|
@@ -3723,6 +4184,106 @@ export declare interface TokenResponse {
|
|
|
3723
4184
|
sessionId: string;
|
|
3724
4185
|
}
|
|
3725
4186
|
|
|
4187
|
+
/**
|
|
4188
|
+
* Update an existing layout.
|
|
4189
|
+
*
|
|
4190
|
+
* @remarks
|
|
4191
|
+
* Updates a layout via `PATCH /api/v3.0/layouts/{layoutId}`. Only provided
|
|
4192
|
+
* fields will be updated. Returns void on success (204 No Content).
|
|
4193
|
+
*
|
|
4194
|
+
* For more details, see the
|
|
4195
|
+
* [EEN API Documentation](https://developer.eagleeyenetworks.com/reference/updatelayout).
|
|
4196
|
+
*
|
|
4197
|
+
* @param layoutId - The unique identifier of the layout to update
|
|
4198
|
+
* @param params - The fields to update
|
|
4199
|
+
* @returns A Result containing void on success or an error
|
|
4200
|
+
*
|
|
4201
|
+
* @example
|
|
4202
|
+
* ```typescript
|
|
4203
|
+
* import { updateLayout } from 'een-api-toolkit'
|
|
4204
|
+
*
|
|
4205
|
+
* // Update name only
|
|
4206
|
+
* const { error } = await updateLayout('layout-123', {
|
|
4207
|
+
* name: 'Updated Layout Name'
|
|
4208
|
+
* })
|
|
4209
|
+
*
|
|
4210
|
+
* // Update settings
|
|
4211
|
+
* const { error } = await updateLayout('layout-123', {
|
|
4212
|
+
* settings: {
|
|
4213
|
+
* paneColumns: 4,
|
|
4214
|
+
* showCameraName: false
|
|
4215
|
+
* }
|
|
4216
|
+
* })
|
|
4217
|
+
*
|
|
4218
|
+
* // Replace panes
|
|
4219
|
+
* const { error } = await updateLayout('layout-123', {
|
|
4220
|
+
* panes: [
|
|
4221
|
+
* { id: 1, name: 'New Pane', type: 'preview', size: 1, cameraId: 'cam-789' }
|
|
4222
|
+
* ]
|
|
4223
|
+
* })
|
|
4224
|
+
*
|
|
4225
|
+
* if (error) {
|
|
4226
|
+
* console.error('Update failed:', error.message)
|
|
4227
|
+
* }
|
|
4228
|
+
* ```
|
|
4229
|
+
*
|
|
4230
|
+
* @category Layouts
|
|
4231
|
+
*/
|
|
4232
|
+
export declare function updateLayout(layoutId: string, params: UpdateLayoutParams): Promise<Result<void>>;
|
|
4233
|
+
|
|
4234
|
+
/**
|
|
4235
|
+
* Parameters for updating an existing layout.
|
|
4236
|
+
*
|
|
4237
|
+
* @remarks
|
|
4238
|
+
* All fields are optional. Only provided fields will be updated.
|
|
4239
|
+
* For settings, you can provide partial updates.
|
|
4240
|
+
*
|
|
4241
|
+
* @example
|
|
4242
|
+
* ```typescript
|
|
4243
|
+
* import { updateLayout } from 'een-api-toolkit'
|
|
4244
|
+
*
|
|
4245
|
+
* // Update name only
|
|
4246
|
+
* const { error } = await updateLayout('layout-123', {
|
|
4247
|
+
* name: 'Updated Layout Name'
|
|
4248
|
+
* })
|
|
4249
|
+
*
|
|
4250
|
+
* // Update settings
|
|
4251
|
+
* const { error } = await updateLayout('layout-123', {
|
|
4252
|
+
* settings: {
|
|
4253
|
+
* paneColumns: 4,
|
|
4254
|
+
* showCameraName: false
|
|
4255
|
+
* }
|
|
4256
|
+
* })
|
|
4257
|
+
*
|
|
4258
|
+
* // Replace panes
|
|
4259
|
+
* const { error } = await updateLayout('layout-123', {
|
|
4260
|
+
* panes: [
|
|
4261
|
+
* { id: 1, name: 'New Pane', type: 'preview', size: 1, cameraId: 'cam-789' }
|
|
4262
|
+
* ]
|
|
4263
|
+
* })
|
|
4264
|
+
* ```
|
|
4265
|
+
*
|
|
4266
|
+
* @category Layouts
|
|
4267
|
+
*/
|
|
4268
|
+
export declare interface UpdateLayoutParams {
|
|
4269
|
+
/** New display name for the layout */
|
|
4270
|
+
name?: string;
|
|
4271
|
+
/**
|
|
4272
|
+
* Updated display settings.
|
|
4273
|
+
*
|
|
4274
|
+
* @remarks
|
|
4275
|
+
* The EEN API supports partial PATCH updates for settings. You only need to
|
|
4276
|
+
* include the fields you want to change; other fields retain their current values.
|
|
4277
|
+
*
|
|
4278
|
+
* @example
|
|
4279
|
+
* // Only update paneColumns, keeping other settings unchanged
|
|
4280
|
+
* { settings: { paneColumns: 4 } }
|
|
4281
|
+
*/
|
|
4282
|
+
settings?: Partial<LayoutSettings>;
|
|
4283
|
+
/** New panes array (replaces existing panes entirely) */
|
|
4284
|
+
panes?: LayoutPane[];
|
|
4285
|
+
}
|
|
4286
|
+
|
|
3726
4287
|
/**
|
|
3727
4288
|
* Pinia store for authentication state management
|
|
3728
4289
|
*/
|