een-api-toolkit 0.3.28 → 0.3.30
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/een-devices-agent.md +38 -6
- package/CHANGELOG.md +5 -11
- package/docs/AI-CONTEXT.md +1 -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-MEDIA.md +1 -1
- package/docs/ai-reference/AI-SETUP.md +1 -1
- package/docs/ai-reference/AI-USERS.md +1 -1
- package/package.json +1 -1
|
@@ -119,15 +119,28 @@ interface ListCamerasParams {
|
|
|
119
119
|
## Key Functions
|
|
120
120
|
|
|
121
121
|
### getCameras()
|
|
122
|
-
List cameras with optional filters
|
|
122
|
+
List cameras with optional filters.
|
|
123
|
+
|
|
124
|
+
**IMPORTANT:** The `status` field is NOT included by default. You must use `include: ['status']` to receive it:
|
|
125
|
+
|
|
123
126
|
```typescript
|
|
124
127
|
import { getCameras, type Camera, type ListCamerasParams } from 'een-api-toolkit'
|
|
125
128
|
|
|
126
129
|
const cameras = ref<Camera[]>([])
|
|
127
130
|
|
|
128
|
-
// Get all
|
|
131
|
+
// Get all cameras WITH status - include: ['status'] is required!
|
|
132
|
+
async function fetchCameras() {
|
|
133
|
+
const result = await getCameras({
|
|
134
|
+
include: ['status'], // Required to get camera.status
|
|
135
|
+
pageSize: 100
|
|
136
|
+
})
|
|
137
|
+
// Now camera.status will be populated
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Get all online cameras (still need include for display)
|
|
129
141
|
async function fetchOnlineCameras() {
|
|
130
142
|
const result = await getCameras({
|
|
143
|
+
include: ['status'], // Required to display status in UI
|
|
131
144
|
status__in: ['online', 'streaming', 'recording'],
|
|
132
145
|
pageSize: 100
|
|
133
146
|
})
|
|
@@ -231,17 +244,33 @@ async function fetchBridge(bridgeId: string) {
|
|
|
231
244
|
|
|
232
245
|
```vue
|
|
233
246
|
<script setup lang="ts">
|
|
234
|
-
import { ref, onMounted } from 'vue'
|
|
235
|
-
import { getCameras, type Camera, type ListCamerasParams } from 'een-api-toolkit'
|
|
247
|
+
import { ref, onMounted, computed } from 'vue'
|
|
248
|
+
import { getCameras, type Camera, type CameraStatus, type ListCamerasParams } from 'een-api-toolkit'
|
|
236
249
|
|
|
237
250
|
const cameras = ref<Camera[]>([])
|
|
238
251
|
const loading = ref(false)
|
|
239
252
|
const statusFilter = ref<string[]>(['online', 'streaming', 'recording'])
|
|
240
253
|
|
|
254
|
+
// Helper: status can be a string OR an object with connectionStatus
|
|
255
|
+
function getStatusString(status?: CameraStatus | { connectionStatus?: CameraStatus }): string | undefined {
|
|
256
|
+
if (!status) return undefined
|
|
257
|
+
if (typeof status === 'string') return status
|
|
258
|
+
return status.connectionStatus
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// Computed property to pre-process cameras with status string (avoids calling helper multiple times in template)
|
|
262
|
+
const camerasWithStatus = computed(() =>
|
|
263
|
+
cameras.value.map(camera => ({
|
|
264
|
+
...camera,
|
|
265
|
+
statusString: getStatusString(camera.status),
|
|
266
|
+
}))
|
|
267
|
+
)
|
|
268
|
+
|
|
241
269
|
async function fetchCameras() {
|
|
242
270
|
loading.value = true
|
|
243
271
|
|
|
244
272
|
const params: ListCamerasParams = {
|
|
273
|
+
include: ['status'], // Required to receive status field
|
|
245
274
|
pageSize: 100
|
|
246
275
|
}
|
|
247
276
|
|
|
@@ -275,10 +304,13 @@ onMounted(fetchCameras)
|
|
|
275
304
|
|
|
276
305
|
<div v-if="loading">Loading cameras...</div>
|
|
277
306
|
|
|
307
|
+
<!-- Use computed property for better performance (status string computed once per camera) -->
|
|
278
308
|
<div class="camera-grid" v-else>
|
|
279
|
-
<div v-for="camera in
|
|
309
|
+
<div v-for="camera in camerasWithStatus" :key="camera.id" class="camera-card">
|
|
280
310
|
<h3>{{ camera.name }}</h3>
|
|
281
|
-
<span :class="camera.
|
|
311
|
+
<span :class="camera.statusString">
|
|
312
|
+
{{ camera.statusString || 'unknown' }}
|
|
313
|
+
</span>
|
|
282
314
|
</div>
|
|
283
315
|
</div>
|
|
284
316
|
</div>
|
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [0.3.
|
|
5
|
+
## [0.3.30] - 2026-01-23
|
|
6
6
|
|
|
7
7
|
### Release Summary
|
|
8
8
|
|
|
@@ -10,19 +10,13 @@ No PR descriptions available for this release.
|
|
|
10
10
|
|
|
11
11
|
### Detailed Changes
|
|
12
12
|
|
|
13
|
-
#### Bug Fixes
|
|
14
|
-
- fix: Suppress eslint console.log warning in debug utility
|
|
15
|
-
|
|
16
13
|
#### Other Changes
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
- docs: Add Claude Code agent setup instructions to Live Viewer prompt
|
|
20
|
-
- docs: Add Claude Code agents documentation to User Guide and README
|
|
21
|
-
- docs: Improve agent documentation based on usage experience
|
|
14
|
+
- refactor: Use computed property for camera status in devices agent
|
|
15
|
+
- docs: Document status field requirements in devices agent
|
|
22
16
|
|
|
23
17
|
### Links
|
|
24
18
|
- [npm package](https://www.npmjs.com/package/een-api-toolkit)
|
|
25
|
-
- [Full Changelog](https://github.com/klaushofrichter/een-api-toolkit/compare/v0.3.
|
|
19
|
+
- [Full Changelog](https://github.com/klaushofrichter/een-api-toolkit/compare/v0.3.28...v0.3.30)
|
|
26
20
|
|
|
27
21
|
---
|
|
28
|
-
*Released: 2026-01-23
|
|
22
|
+
*Released: 2026-01-23 17:42:54 CST*
|
package/docs/AI-CONTEXT.md
CHANGED