een-api-toolkit 0.3.82 → 0.3.91

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 (52) hide show
  1. package/.claude/agents/api-coverage-agent.md +264 -0
  2. package/.claude/agents/een-devices-agent.md +21 -0
  3. package/.claude/agents/een-ptz-agent.md +235 -0
  4. package/CHANGELOG.md +56 -60
  5. package/README.md +24 -1
  6. package/dist/index.cjs +3 -3
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.ts +400 -0
  9. package/dist/index.js +1079 -951
  10. package/dist/index.js.map +1 -1
  11. package/docs/AI-CONTEXT.md +3 -1
  12. package/docs/ai-reference/AI-AUTH.md +1 -1
  13. package/docs/ai-reference/AI-AUTOMATIONS.md +1 -1
  14. package/docs/ai-reference/AI-DEVICES.md +1 -1
  15. package/docs/ai-reference/AI-EVENT-DATA-SCHEMAS.md +1 -1
  16. package/docs/ai-reference/AI-EVENTS.md +1 -1
  17. package/docs/ai-reference/AI-GROUPING.md +1 -1
  18. package/docs/ai-reference/AI-JOBS.md +1 -1
  19. package/docs/ai-reference/AI-MEDIA.md +1 -1
  20. package/docs/ai-reference/AI-PTZ.md +158 -0
  21. package/docs/ai-reference/AI-SETUP.md +1 -1
  22. package/docs/ai-reference/AI-USERS.md +1 -1
  23. package/examples/vue-ptz/.env.example +4 -0
  24. package/examples/vue-ptz/README.md +221 -0
  25. package/examples/vue-ptz/e2e/app.spec.ts +58 -0
  26. package/examples/vue-ptz/e2e/auth.spec.ts +296 -0
  27. package/examples/vue-ptz/index.html +13 -0
  28. package/examples/vue-ptz/package-lock.json +1729 -0
  29. package/examples/vue-ptz/package.json +29 -0
  30. package/examples/vue-ptz/playwright.config.ts +49 -0
  31. package/examples/vue-ptz/screenshot-ptz.png +0 -0
  32. package/examples/vue-ptz/src/App.vue +154 -0
  33. package/examples/vue-ptz/src/components/ApiLog.vue +387 -0
  34. package/examples/vue-ptz/src/components/CameraSelector.vue +155 -0
  35. package/examples/vue-ptz/src/components/DirectionPad.vue +350 -0
  36. package/examples/vue-ptz/src/components/LiveVideoPlayer.vue +248 -0
  37. package/examples/vue-ptz/src/components/PositionDisplay.vue +206 -0
  38. package/examples/vue-ptz/src/components/PositionInput.vue +190 -0
  39. package/examples/vue-ptz/src/components/PresetManager.vue +538 -0
  40. package/examples/vue-ptz/src/composables/useApiLog.ts +89 -0
  41. package/examples/vue-ptz/src/main.ts +22 -0
  42. package/examples/vue-ptz/src/router/index.ts +61 -0
  43. package/examples/vue-ptz/src/views/Callback.vue +76 -0
  44. package/examples/vue-ptz/src/views/Home.vue +199 -0
  45. package/examples/vue-ptz/src/views/Login.vue +32 -0
  46. package/examples/vue-ptz/src/views/Logout.vue +59 -0
  47. package/examples/vue-ptz/src/views/PtzControl.vue +173 -0
  48. package/examples/vue-ptz/src/vite-env.d.ts +12 -0
  49. package/examples/vue-ptz/tsconfig.json +21 -0
  50. package/examples/vue-ptz/tsconfig.node.json +11 -0
  51. package/examples/vue-ptz/vite.config.ts +12 -0
  52. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,105 +2,101 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## [0.3.82] - 2026-02-14
5
+ ## [0.3.91] - 2026-02-21
6
6
 
7
7
  ### Release Summary
8
8
 
9
- #### PR #110: fix: Security hardening - hostname validation and CI/CD pipeline
9
+ #### PR #118: Release v0.3.85 - API coverage docs and workflow security fix
10
10
  ## Summary
11
11
 
12
- Release v0.3.79 - Security hardening fixes for three vulnerabilities identified in code review:
13
-
14
- - **Hostname validation bypass**: Added DNS hostname character regex (`/^[a-z0-9]([a-z0-9.-]*[a-z0-9])?$/`) before `endsWith()` check in `isAllowedEenHostname()` to prevent bypass attacks like `evil.com/.eagleeyenetworks.com`
15
- - **CI/CD branch restriction**: Added `head_branch == 'production'` check to npm-publish workflow to prevent publishing from non-production branches
16
- - **Script injection prevention**: Moved `${{ }}` interpolation from shell `run:` blocks to `env:` blocks in test-release workflow at 3 locations
12
+ - Add EEN API v3.0 coverage documentation (4 documents comparing 211 API endpoints against 51 implemented, 24.2% coverage)
13
+ - Add `api-coverage-agent` for on-demand regeneration of coverage docs
14
+ - Update README with agent list and coverage section
15
+ - Fix workflow_dispatch restriction to production branch (security)
17
16
 
18
17
  ## Commits
19
18
 
20
- - `d4e8a06` fix: harden hostname validation and CI/CD security
21
- - `c870348` Update src/utils/hostname.ts
22
- - `5a76991` Merge pull request #109
19
+ - `baa7e1b` feat: add EEN API coverage documentation and agent
20
+ - `eea17e8` docs: add missing agents to README agent list
21
+ - `bb47cc2` docs: rename een-api-coverage-agent to api-coverage-agent
22
+ - `c794fba` fix: restrict workflow_dispatch to production branch to prevent supply chain attack
23
+ - `6e782e2` fix: restrict npm-publish workflow_dispatch to production branch
23
24
 
24
- ## Test Results
25
+ ## Test Results (from PR #117)
25
26
 
26
- - **Lint**: 0 errors (1 pre-existing warning)
27
+ - **Lint**: Passed
27
28
  - **Unit tests**: 644 passed
28
- - **Build**: Success
29
- - **E2E tests**: 225 passed across all 11 example apps
30
- - **Security review**: No HIGH-confidence vulnerabilities found
31
-
32
- ## Files Changed
33
-
34
- - `src/utils/hostname.ts` - Added hostname character validation regex
35
- - `src/__tests__/auth.store.test.ts` - Added 5 test cases for malicious hostname bypass
36
- - `.github/workflows/npm-publish.yml` - Added production branch restriction
37
- - `.github/workflows/test-release.yml` - Fixed script injection at 3 locations
29
+ - **Build**: Succeeded
30
+ - **E2E tests**: 236 passed across all 11 example apps
31
+ - **Security review**: No vulnerabilities
32
+ - **Code review**: Approved by Claude Sonnet 4.5
38
33
 
39
34
  ## Version
40
35
 
41
- `0.3.79`
36
+ v0.3.85
42
37
 
43
38
  🤖 Generated with [Claude Code](https://claude.com/claude-code)
44
39
 
45
- #### PR #112: fix: revert broken head_branch check and update agents/skill
40
+ #### PR #128: Release v0.3.89: PTZ camera control API and vue-ptz example
46
41
  ## Summary
47
42
 
48
- Release v0.3.80 with two key changes:
43
+ This release adds PTZ (Pan/Tilt/Zoom) camera control support to the toolkit:
49
44
 
50
- 1. **Fix broken publish workflow** — The `head_branch == 'production'` check added in v0.3.79 caused all automated npm publish runs to be skipped. GitHub's `workflow_run.head_branch` refers to the PR source branch (e.g. `develop`), not the target. The upstream `test-release.yml` already restricts to PRs merged to production.
45
+ - **PTZ API functions**: `getPtzPosition()`, `movePtz()`, `getPtzSettings()`, `updatePtzSettings()` with full TypeScript types
46
+ - **PTZ types**: `PtzPosition`, `PtzMove` (discriminated union: position/direction/centerOn), `PtzSettings`, `PtzPreset`, `PtzSettingsUpdate`
47
+ - **vue-ptz example app**: Complete PTZ control application with live video, direction pad, click-to-center, position display, preset management, and API call logging
48
+ - **Camera capabilities**: Added `capabilities` field to `Camera` type for PTZ detection via `include: ['capabilities']`
49
+ - **Documentation**: AI-PTZ.md reference doc, een-ptz-agent, updated AI-CONTEXT.md and CLAUDE.md
50
+ - **E2E tests**: Conditional PTZ API tests that exercise position read, direction move, and preset loading when a PTZ camera is available
51
51
 
52
- 2. **Add confidential data scan to PR-and-check skill** — New step that scans changed `.md` files for secrets, credentials, or confidential data before PR creation. Critical safeguard for a public npm package.
53
-
54
- 3. **Agent documentation improvements** Updated Playwright selectors (getByPlaceholder), SSE API patterns (nested deliveryConfig/filters), LivePlayer camera switching (:key trick), and setup agent scope (delegation to specialized agents).
52
+ ### Additional changes
53
+ - Dependabot: CodeQL action bump to 4.32.3
54
+ - CI: Use floating v1 tag for claude-code-action instead of SHA pin
55
55
 
56
56
  ## Commits
57
57
 
58
- - `1bb7297` fix: revert broken head_branch check in npm-publish workflow
59
- - `6afd34a` chore: add confidential data scan to PR-and-check skill and update agents
60
- - `c5ff7eb` Merge pull request #111
58
+ - `c552fd0` feat: add PTZ camera control API and vue-ptz example app
59
+ - `6a12649` fix: use single getCameras call with include and pagination for PTZ discovery
60
+ - `2b04b26` fix: address review findings in vue-ptz example app
61
+ - `92a18e4` fix: address remaining review findings
62
+ - `4d01c2c` fix: use floating v1 tag for claude-code-action instead of SHA pin
63
+ - `3f197ba` chore(deps): bump github/codeql-action from 4.32.2 to 4.32.3
61
64
 
62
65
  ## Test Results
63
66
 
64
- - **Lint**: 0 errors (1 pre-existing warning)
65
- - **Unit tests**: 644 passed
66
- - **Build**: Success
67
- - **E2E tests**: 3/11 passed before flaky auth timeout in vue-cameras (camera-settings.spec.ts:328, unrelated to changes)
68
- - **Security review**: No vulnerabilities found
69
- - **Confidential data scan**: No secrets in 224 .md files
70
-
71
- ## Version
67
+ | Check | Result |
68
+ |-------|--------|
69
+ | Lint | Pass (0 errors) |
70
+ | Unit tests | 681 passed (24 suites) |
71
+ | Build | Pass |
72
+ | E2E (12 apps) | All passed |
73
+ | Security review | No vulnerabilities found |
74
+ | Confidential data scan | Clean |
72
75
 
73
- `0.3.80`
74
-
75
- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
76
-
77
- #### PR #113: fix: address three security review findings
78
- ## Summary
79
- - **HIGH**: Validate hostname before persisting OAuth token — `setBaseUrl()` now returns boolean; `handleAuthCallback()` checks it before calling `setToken()`, preventing token persistence when hostname is rejected
80
- - **MEDIUM**: Pin external proxy repo clone in CI workflows (`validate-pr`, `test-release`) to commit SHA `4e8f45f` to prevent supply chain attacks
81
- - **LOW**: Remove unnecessary `id-token: write` permission from `claude-code-review` workflow
82
-
83
- ## Test plan
84
- - [x] 644/644 unit tests pass
85
- - [x] 225/225 E2E tests pass across all 11 example apps
86
- - [x] Lint clean, build succeeds
87
- - [ ] Validate-PR workflow passes on this PR
76
+ **Version**: 0.3.89
88
77
 
89
78
  🤖 Generated with [Claude Code](https://claude.com/claude-code)
90
79
 
91
80
 
92
81
  ### Detailed Changes
93
82
 
83
+ #### Features
84
+ - feat: add PTZ camera control API and vue-ptz example app
85
+
94
86
  #### Bug Fixes
95
- - fix: restore id-token:write permission required by claude-code-action
96
- - fix: address three security review findings
87
+ - fix: address remaining PR #128 review findings
88
+ - fix: address PR #128 review findings
89
+ - fix: address remaining review findings
90
+ - fix: address review findings in vue-ptz example app
91
+ - fix: use single getCameras call with include and pagination for PTZ discovery
92
+ - fix: use floating v1 tag for claude-code-action instead of SHA pin
97
93
 
98
94
  #### Other Changes
99
- - chore: document pinned OAuth proxy commit SHA in CI workflows
95
+ - chore(deps): bump github/codeql-action from 4.32.2 to 4.32.3
100
96
 
101
97
  ### Links
102
98
  - [npm package](https://www.npmjs.com/package/een-api-toolkit)
103
- - [Full Changelog](https://github.com/klaushofrichter/een-api-toolkit/compare/v0.3.81...v0.3.82)
99
+ - [Full Changelog](https://github.com/klaushofrichter/een-api-toolkit/compare/v0.3.85...v0.3.91)
104
100
 
105
101
  ---
106
- *Released: 2026-02-14 19:46:06 CST*
102
+ *Released: 2026-02-21 17:41:30 CST*
package/README.md CHANGED
@@ -182,7 +182,7 @@ The toolkit includes specialized [Claude Code](https://docs.anthropic.com/en/doc
182
182
 
183
183
  > **Note:** These agents use Claude Code's specific format. To use with other AI assistants (Gemini CLI, Copilot, etc.), the agent specs would need conversion.
184
184
 
185
- **Available agents:**
185
+ **Available agents (installed via `npx een-setup-agents`):**
186
186
  - `een-setup-agent` - Project scaffolding, Pinia setup, Vite configuration
187
187
  - `een-auth-agent` - OAuth flows, route guards, token management
188
188
  - `een-users-agent` - User listing and profile APIs
@@ -190,6 +190,10 @@ The toolkit includes specialized [Claude Code](https://docs.anthropic.com/en/doc
190
190
  - `een-media-agent` - Live video, previews, HLS playback
191
191
  - `een-events-agent` - Events, alerts, metrics, SSE subscriptions
192
192
  - `een-grouping-agent` - Layouts CRUD operations, camera pane management
193
+ - `een-automations-agent` - Alert rules, action rules, event conditions
194
+ - `een-jobs-agent` - Jobs, exports, files, downloads
195
+
196
+ The `setup-agents` script (`scripts/setup-agents.ts`) installs only agents matching the `een-*-agent.md` pattern. Other agents in `.claude/agents/` (such as `api-coverage-agent`, `docs-accuracy-reviewer`, `test-runner`) are for this repository only and are not distributed to consuming projects.
193
197
 
194
198
  **Installation:**
195
199
  ```bash
@@ -311,6 +315,25 @@ The `sync-secrets.sh` script manages secrets from a single source (root `.env` f
311
315
 
312
316
  > **Note:** Example `.env` files are gitignored. Run `sync-secrets.sh` after cloning to set up local development.
313
317
 
318
+ ## EEN API Coverage
319
+
320
+ This toolkit implements a subset of the [Eagle Eye Networks REST API v3.0](https://developer.eagleeyenetworks.com/reference/using-the-api). Coverage documentation is maintained in `docs/`:
321
+
322
+ | Document | Description |
323
+ |----------|-------------|
324
+ | **[All EEN API Endpoints](./docs/een-api-all-endpoints.md)** | Complete reference of all 211 EEN API v3.0 endpoints |
325
+ | **[Implemented Endpoints](./docs/een-api-implemented.md)** | Endpoints implemented by the toolkit with function names and source files |
326
+ | **[Missing Endpoints](./docs/een-api-missing.md)** | Endpoints not yet implemented, with per-category coverage percentages |
327
+ | **[Coverage Table (HTML)](./docs/een-api-coverage.html)** | Interactive table with filtering, sorting, and summary statistics |
328
+
329
+ **Fully implemented sections:** Layouts, Feeds, Jobs, Event Types, Event Metrics, Alerts
330
+
331
+ **Partially implemented:** Users, Cameras, Bridges, Media, Events, Event Subscriptions, Automations, Exports, Files, Downloads
332
+
333
+ **Not yet implemented:** PTZ, Speakers, Switches, Multi Cameras, Locations, Floors, Video Search, LPR, Roles, Accounts, and others
334
+
335
+ To regenerate these documents after adding new API endpoints, use the `api-coverage-agent`.
336
+
314
337
  ## External Resources
315
338
 
316
339
  - [EEN Developer Portal](https://developer.eagleeyenetworks.com/)