signalk-onvif-camera 1.1.0 → 1.1.2
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/README.md +93 -91
- package/dist/index.js +8 -4
- package/dist/lib/config/defaults.js +0 -1
- package/dist/lib/modules/device.js +0 -1
- package/dist/lib/modules/http-auth.js +0 -1
- package/dist/lib/modules/service-device.js +0 -1
- package/dist/lib/modules/service-events.js +0 -1
- package/dist/lib/modules/service-media.js +0 -1
- package/dist/lib/modules/service-ptz.js +0 -1
- package/dist/lib/modules/soap.js +0 -1
- package/dist/lib/node-onvif.js +0 -1
- package/dist/lib/types.js +0 -1
- package/dist/lib/utils/validation.js +0 -1
- package/package.json +58 -59
- package/public/index.html +175 -175
- package/dist/index.d.ts +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/config/defaults.d.ts +0 -4
- package/dist/lib/config/defaults.js.map +0 -1
- package/dist/lib/modules/device.d.ts +0 -1
- package/dist/lib/modules/device.js.map +0 -1
- package/dist/lib/modules/http-auth.d.ts +0 -1
- package/dist/lib/modules/http-auth.js.map +0 -1
- package/dist/lib/modules/service-device.d.ts +0 -1
- package/dist/lib/modules/service-device.js.map +0 -1
- package/dist/lib/modules/service-events.d.ts +0 -1
- package/dist/lib/modules/service-events.js.map +0 -1
- package/dist/lib/modules/service-media.d.ts +0 -1
- package/dist/lib/modules/service-media.js.map +0 -1
- package/dist/lib/modules/service-ptz.d.ts +0 -1
- package/dist/lib/modules/service-ptz.js.map +0 -1
- package/dist/lib/modules/soap.d.ts +0 -1
- package/dist/lib/modules/soap.js.map +0 -1
- package/dist/lib/node-onvif.d.ts +0 -1
- package/dist/lib/node-onvif.js.map +0 -1
- package/dist/lib/types.d.ts +0 -180
- package/dist/lib/types.js.map +0 -1
- package/dist/lib/utils/validation.d.ts +0 -4
- package/dist/lib/utils/validation.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,91 +1,93 @@
|
|
|
1
|
-
# signalk-onvif-camera
|
|
2
|
-
|
|
3
|
-
ONVIF Camera interface for Signal K. For IP cameras that support ONVIF control, fixed and PTZ.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Install via the Signal K Appstore, or manually:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install signalk-onvif-camera
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Plugin Configuration
|
|
14
|
-
|
|
15
|
-

|
|
16
|
-
|
|
17
|
-
- Enter ONVIF profile username and password
|
|
18
|
-
- Add camera IP addresses to the list
|
|
19
|
-
|
|
20
|
-
## ONVIF Camera Setup
|
|
21
|
-
|
|
22
|
-
Example of HikVision IP camera ONVIF configuration:
|
|
23
|
-
|
|
24
|
-

|
|
25
|
-
|
|
26
|
-
- Add an ONVIF user to your IP camera if applicable
|
|
27
|
-
|
|
28
|
-
## Webapp
|
|
29
|
-
|
|
30
|
-

|
|
31
|
-
|
|
32
|
-
Access the webapp from the Signal K Webapps menu by selecting "Signalk-onvif-camera".
|
|
33
|
-
|
|
34
|
-
## Camera Service
|
|
35
|
-
|
|
36
|
-

|
|
37
|
-
|
|
38
|
-
- ONVIF cameras are discovered on the local network
|
|
39
|
-
- Select a device from the dropdown menu
|
|
40
|
-
- Press "Connect" to connect to the camera
|
|
41
|
-
|
|
42
|
-
## Camera Controls
|
|
43
|
-
|
|
44
|
-

|
|
45
|
-
|
|
46
|
-
- PTZ controls: pan, tilt, and home button
|
|
47
|
-
- Zoom in/out
|
|
48
|
-
- Adjustable control speed
|
|
49
|
-
- Disconnect
|
|
50
|
-
- Hide/show controls
|
|
51
|
-
|
|
52
|
-
## Development
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npm install
|
|
56
|
-
npm run build # Build frontend (cleans public/ first)
|
|
57
|
-
npm run dev # Vite dev server
|
|
58
|
-
npm test # Run tests with coverage
|
|
59
|
-
npm run lint # Lint with ESLint
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Version control
|
|
63
|
-
|
|
64
|
-
- v0.0.1, 1st version for testing
|
|
65
|
-
- v0.0.2, license added
|
|
66
|
-
- v0.1.0, 1st release
|
|
67
|
-
- v0.1.1, ONVIF LAN selection
|
|
68
|
-
- v0.1.2, Webpack bundled
|
|
69
|
-
- v0.1.3, Webapp icon added
|
|
70
|
-
- v0.1.4, updated to npm packages
|
|
71
|
-
- v0.2.0, hide controls
|
|
72
|
-
- v0.2.1, version update
|
|
73
|
-
- v0.3.0, ws error handling
|
|
74
|
-
- v0.3.1, icon loading error
|
|
75
|
-
- v0.4.0, code refactoring
|
|
76
|
-
- v0.5.0, improvements to streaming and viewing
|
|
77
|
-
- v0.6.0, replace devcert with selfsigned
|
|
78
|
-
- v0.6.1, extra console logs removed
|
|
79
|
-
- v0.7.0, certs stored to permanent location
|
|
80
|
-
- v0.7.1, fix WebSocket connection issues
|
|
81
|
-
- v0.8.0, webpack changed to vite
|
|
82
|
-
- v1.0.0: WebSocket noServer mode, build pipeline cleanup
|
|
83
|
-
- v1.1.0: migrated TypeScript, hardened ONVIF discovery, auth, snapshot/MJPEG streaming, reconnect and shutdown behavior
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
1
|
+
# signalk-onvif-camera
|
|
2
|
+
|
|
3
|
+
ONVIF Camera interface for Signal K. For IP cameras that support ONVIF control, fixed and PTZ.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install via the Signal K Appstore, or manually:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install signalk-onvif-camera
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Plugin Configuration
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
- Enter ONVIF profile username and password
|
|
18
|
+
- Add camera IP addresses to the list
|
|
19
|
+
|
|
20
|
+
## ONVIF Camera Setup
|
|
21
|
+
|
|
22
|
+
Example of HikVision IP camera ONVIF configuration:
|
|
23
|
+
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
- Add an ONVIF user to your IP camera if applicable
|
|
27
|
+
|
|
28
|
+
## Webapp
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
Access the webapp from the Signal K Webapps menu by selecting "Signalk-onvif-camera".
|
|
33
|
+
|
|
34
|
+
## Camera Service
|
|
35
|
+
|
|
36
|
+

|
|
37
|
+
|
|
38
|
+
- ONVIF cameras are discovered on the local network
|
|
39
|
+
- Select a device from the dropdown menu
|
|
40
|
+
- Press "Connect" to connect to the camera
|
|
41
|
+
|
|
42
|
+
## Camera Controls
|
|
43
|
+
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
- PTZ controls: pan, tilt, and home button
|
|
47
|
+
- Zoom in/out
|
|
48
|
+
- Adjustable control speed
|
|
49
|
+
- Disconnect
|
|
50
|
+
- Hide/show controls
|
|
51
|
+
|
|
52
|
+
## Development
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm install
|
|
56
|
+
npm run build # Build frontend (cleans public/ first)
|
|
57
|
+
npm run dev # Vite dev server
|
|
58
|
+
npm test # Run tests with coverage
|
|
59
|
+
npm run lint # Lint with ESLint
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Version control
|
|
63
|
+
|
|
64
|
+
- v0.0.1, 1st version for testing
|
|
65
|
+
- v0.0.2, license added
|
|
66
|
+
- v0.1.0, 1st release
|
|
67
|
+
- v0.1.1, ONVIF LAN selection
|
|
68
|
+
- v0.1.2, Webpack bundled
|
|
69
|
+
- v0.1.3, Webapp icon added
|
|
70
|
+
- v0.1.4, updated to npm packages
|
|
71
|
+
- v0.2.0, hide controls
|
|
72
|
+
- v0.2.1, version update
|
|
73
|
+
- v0.3.0, ws error handling
|
|
74
|
+
- v0.3.1, icon loading error
|
|
75
|
+
- v0.4.0, code refactoring
|
|
76
|
+
- v0.5.0, improvements to streaming and viewing
|
|
77
|
+
- v0.6.0, replace devcert with selfsigned
|
|
78
|
+
- v0.6.1, extra console logs removed
|
|
79
|
+
- v0.7.0, certs stored to permanent location
|
|
80
|
+
- v0.7.1, fix WebSocket connection issues
|
|
81
|
+
- v0.8.0, webpack changed to vite
|
|
82
|
+
- v1.0.0: WebSocket noServer mode, build pipeline cleanup
|
|
83
|
+
- v1.1.0: migrated TypeScript, hardened ONVIF discovery, auth, snapshot/MJPEG streaming, reconnect and shutdown behavior
|
|
84
|
+
- v1.1.1: clean-up build output
|
|
85
|
+
- v1.1.2: small fixes
|
|
86
|
+
|
|
87
|
+
## Credits
|
|
88
|
+
|
|
89
|
+
https://github.com/futomi/node-onvif
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,11 @@ const WebSocket = require('ws');
|
|
|
28
28
|
const fs = require('fs');
|
|
29
29
|
const path = require('path');
|
|
30
30
|
const { validateDeviceAddress, validatePTZCommand } = require('./lib/utils/validation');
|
|
31
|
+
function hasUpgradeListenerServer(server) {
|
|
32
|
+
return Boolean(server
|
|
33
|
+
&& typeof server.on === 'function'
|
|
34
|
+
&& typeof server.removeListener === 'function');
|
|
35
|
+
}
|
|
31
36
|
function isRecord(value) {
|
|
32
37
|
return typeof value === 'object' && value !== null;
|
|
33
38
|
}
|
|
@@ -182,11 +187,11 @@ module.exports = function createPlugin(app) {
|
|
|
182
187
|
wsServer.close();
|
|
183
188
|
wsServer = null;
|
|
184
189
|
}
|
|
185
|
-
if (upgradeHandler && app.server) {
|
|
190
|
+
if (upgradeHandler && hasUpgradeListenerServer(app.server)) {
|
|
186
191
|
app.server.removeListener('upgrade', upgradeHandler);
|
|
187
192
|
upgradeHandler = null;
|
|
188
193
|
}
|
|
189
|
-
if (app.server) {
|
|
194
|
+
if (hasUpgradeListenerServer(app.server)) {
|
|
190
195
|
// Use noServer mode so we don't interfere with SignalK's own
|
|
191
196
|
// WebSocket server on the same HTTP server. With the default
|
|
192
197
|
// { server } option the ws library adds its own 'upgrade'
|
|
@@ -410,7 +415,7 @@ module.exports = function createPlugin(app) {
|
|
|
410
415
|
});
|
|
411
416
|
mjpegStreams.clear();
|
|
412
417
|
closeActiveWsConnections();
|
|
413
|
-
if (upgradeHandler && app.server) {
|
|
418
|
+
if (upgradeHandler && hasUpgradeListenerServer(app.server)) {
|
|
414
419
|
app.server.removeListener('upgrade', upgradeHandler);
|
|
415
420
|
upgradeHandler = null;
|
|
416
421
|
}
|
|
@@ -1485,4 +1490,3 @@ module.exports = function createPlugin(app) {
|
|
|
1485
1490
|
}
|
|
1486
1491
|
return plugin;
|
|
1487
1492
|
};
|
|
1488
|
-
//# sourceMappingURL=index.js.map
|
package/dist/lib/modules/soap.js
CHANGED
package/dist/lib/node-onvif.js
CHANGED
package/dist/lib/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,59 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "signalk-onvif-camera",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Signal K Onvif Camera Interface",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"test": "jest --
|
|
17
|
-
"
|
|
18
|
-
"lint": "eslint .",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"signalk-
|
|
33
|
-
"signalk-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"@types/
|
|
48
|
-
"@types/
|
|
49
|
-
"@
|
|
50
|
-
"@typescript-eslint/
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"jest": "^29.
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "signalk-onvif-camera",
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"description": "Signal K Onvif Camera Interface",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/",
|
|
8
|
+
"public/",
|
|
9
|
+
"doc/"
|
|
10
|
+
],
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=18.0.0"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"test": "jest --coverage",
|
|
16
|
+
"test:watch": "jest --watch",
|
|
17
|
+
"lint": "eslint .",
|
|
18
|
+
"lint:fix": "eslint . --ext .js,.ts --fix",
|
|
19
|
+
"typecheck": "tsc --noEmit",
|
|
20
|
+
"prepublishOnly": "npm run lint && npm run typecheck && npm test && npm run build",
|
|
21
|
+
"clean": "node -e \"require('fs').rmSync('./dist',{recursive:true,force:true});require('fs').rmSync('./public',{recursive:true,force:true})\"",
|
|
22
|
+
"dev": "vite",
|
|
23
|
+
"build": "npm run clean && tsc -p tsconfig.build.json && vite build",
|
|
24
|
+
"preview": "vite preview"
|
|
25
|
+
},
|
|
26
|
+
"signalk": {
|
|
27
|
+
"appIcon": "./icons/icon-72x72.png",
|
|
28
|
+
"displayName": "Signalk-onvif-camera"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"signalk-node-server-plugin",
|
|
32
|
+
"signalk-webapp",
|
|
33
|
+
"signalk-category-utility"
|
|
34
|
+
],
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/KEGustafsson/signalk-onvif-camera"
|
|
38
|
+
},
|
|
39
|
+
"author": "Karl-Erik Gustafsson",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"ws": "^8.0.0",
|
|
43
|
+
"xml2js": "^0.6.2"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/jest": "^30.0.0",
|
|
47
|
+
"@types/jquery": "^4.0.0",
|
|
48
|
+
"@types/node": "^25.5.0",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^8.57.1",
|
|
50
|
+
"@typescript-eslint/parser": "^8.57.1",
|
|
51
|
+
"bootstrap": "^3.4.1",
|
|
52
|
+
"eslint": "^8.57.0",
|
|
53
|
+
"jest": "^29.7.0",
|
|
54
|
+
"ts-jest": "^29.4.6",
|
|
55
|
+
"typescript": "^5.9.3",
|
|
56
|
+
"vite": "^6.0.5"
|
|
57
|
+
}
|
|
58
|
+
}
|