tciv-client 0.0.1 → 0.0.3
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 +44 -40
- package/dist/cli.d.ts +8 -8
- package/dist/cli.js +21 -21
- package/dist/client.d.ts +5 -5
- package/dist/client.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/scanner.d.ts +3 -3
- package/dist/scanner.js +3 -3
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,10 @@ Zero runtime dependencies · Native `fetch` (Node 18+) · Tested on **TCIV-2+**
|
|
|
9
9
|
|
|
10
10
|
> **Trademark Notice:** This project is **not affiliated with, endorsed by, or sponsored by Zenitel AS.** "Zenitel" and "TCIV" are trademarks of their respective owners. This library is an independent tool for authorized administrators to manage their own intercom systems.
|
|
11
11
|
|
|
12
|
+
## Intended Use
|
|
13
|
+
|
|
14
|
+
This library is intended for **system integrators and IT administrators** managing TCIV-series intercoms they own or are authorized to administer. All operations require valid device credentials.
|
|
15
|
+
|
|
12
16
|
## Table of Contents
|
|
13
17
|
|
|
14
18
|
- [Install](#install)
|
|
@@ -38,9 +42,9 @@ Zero runtime dependencies · Native `fetch` (Node 18+) · Tested on **TCIV-2+**
|
|
|
38
42
|
- [Provisioning](#full-device-provisioning-1)
|
|
39
43
|
- [Audio Settings](#audio-settings)
|
|
40
44
|
- [Reboot](#reboot)
|
|
41
|
-
- [
|
|
45
|
+
- [Device Discovery](#scannetwork)
|
|
42
46
|
- [Supported Hardware](#supported-hardware)
|
|
43
|
-
- [
|
|
47
|
+
- [HTTP API Reference](#http-api-reference)
|
|
44
48
|
|
|
45
49
|
---
|
|
46
50
|
|
|
@@ -53,9 +57,9 @@ npm install tciv-client
|
|
|
53
57
|
## Quick Start
|
|
54
58
|
|
|
55
59
|
```typescript
|
|
56
|
-
import {
|
|
60
|
+
import { TcivClient } from 'tciv-client';
|
|
57
61
|
|
|
58
|
-
const z = new
|
|
62
|
+
const z = new TcivClient({ host: '192.168.1.143' });
|
|
59
63
|
|
|
60
64
|
// Check if device is reachable
|
|
61
65
|
await z.isReachable(); // true
|
|
@@ -79,7 +83,7 @@ await z.setAudioSettings({ speaker: { gain: 3 } });
|
|
|
79
83
|
|
|
80
84
|
## CLI
|
|
81
85
|
|
|
82
|
-
The `
|
|
86
|
+
The `tciv` CLI is included for hardware testing and debugging.
|
|
83
87
|
|
|
84
88
|
```bash
|
|
85
89
|
npx tciv <command> [options]
|
|
@@ -88,9 +92,9 @@ npx tciv <command> [options]
|
|
|
88
92
|
### Device Discovery
|
|
89
93
|
|
|
90
94
|
```bash
|
|
91
|
-
|
|
95
|
+
tciv scan
|
|
92
96
|
|
|
93
|
-
# 🔍 Scanning
|
|
97
|
+
# 🔍 Scanning for TCIV devices...
|
|
94
98
|
#
|
|
95
99
|
# 🟢 192.168.1.143
|
|
96
100
|
# MAC: 00:13:cb:28:35:ca
|
|
@@ -106,7 +110,7 @@ zenitel scan
|
|
|
106
110
|
### Device Information
|
|
107
111
|
|
|
108
112
|
```bash
|
|
109
|
-
|
|
113
|
+
tciv info -h 192.168.1.143
|
|
110
114
|
|
|
111
115
|
# 📋 Device info:
|
|
112
116
|
# Model: TCIV-2+
|
|
@@ -124,19 +128,19 @@ zenitel info -h 192.168.1.143
|
|
|
124
128
|
### Call Status & Relays
|
|
125
129
|
|
|
126
130
|
```bash
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
tciv status -h 192.168.1.143 # Full status
|
|
132
|
+
tciv relay -h 192.168.1.143 # Open door (relay1, 3s)
|
|
133
|
+
tciv relay -h 192.168.1.143 --id gpio2 --timer 5 # GPIO output
|
|
134
|
+
tciv relay -h 192.168.1.143 --off # Deactivate
|
|
135
|
+
tciv call 122 -h 192.168.1.143 # Place SIP call
|
|
136
|
+
tciv stop -h 192.168.1.143 # Hang up
|
|
133
137
|
```
|
|
134
138
|
|
|
135
139
|
### SIP Configuration
|
|
136
140
|
|
|
137
141
|
```bash
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
tciv sip get -h 192.168.1.143 # Read SIP config
|
|
143
|
+
tciv sip set -h 192.168.1.143 \
|
|
140
144
|
--domain my-trunk.sip.twilio.com \
|
|
141
145
|
--number station01
|
|
142
146
|
```
|
|
@@ -144,16 +148,16 @@ zenitel sip set -h 192.168.1.143 \
|
|
|
144
148
|
### Webcall API Management
|
|
145
149
|
|
|
146
150
|
```bash
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
151
|
+
tciv webcall -h 192.168.1.143 # Check status
|
|
152
|
+
tciv webcall enable -h 192.168.1.143 # Enable HTTP API
|
|
153
|
+
tciv webcall disable -h 192.168.1.143 # Disable
|
|
150
154
|
```
|
|
151
155
|
|
|
152
156
|
### Audio Settings
|
|
153
157
|
|
|
154
158
|
```bash
|
|
155
159
|
# Read current audio config
|
|
156
|
-
|
|
160
|
+
tciv audio -h 192.168.1.143
|
|
157
161
|
|
|
158
162
|
# 🎵 Audio settings for 192.168.1.143:
|
|
159
163
|
#
|
|
@@ -167,26 +171,26 @@ zenitel audio -h 192.168.1.143
|
|
|
167
171
|
# Mode: Voice
|
|
168
172
|
|
|
169
173
|
# Adjust speaker and mic
|
|
170
|
-
|
|
174
|
+
tciv audio set -h 192.168.1.143 --speaker 3 --mic 3
|
|
171
175
|
|
|
172
176
|
# Toggle DSP features
|
|
173
|
-
|
|
177
|
+
tciv audio set -h 192.168.1.143 --aec-on --drc-on --anc-off
|
|
174
178
|
|
|
175
179
|
# Backup raw audio config as JSON
|
|
176
|
-
|
|
180
|
+
tciv audio backup -h 192.168.1.143 -o audio-backup.json
|
|
177
181
|
```
|
|
178
182
|
|
|
179
183
|
### Config Backup & Restore
|
|
180
184
|
|
|
181
185
|
```bash
|
|
182
|
-
|
|
183
|
-
|
|
186
|
+
tciv backup -h 192.168.1.143 -o backup.tar.gz
|
|
187
|
+
tciv restore backup.tar.gz -h 192.168.1.143
|
|
184
188
|
```
|
|
185
189
|
|
|
186
190
|
### Video
|
|
187
191
|
|
|
188
192
|
```bash
|
|
189
|
-
|
|
193
|
+
tciv video -h 192.168.1.143
|
|
190
194
|
# 📷 Video URLs:
|
|
191
195
|
# MJPG: http://192.168.1.143/mjpg/video.mjpg
|
|
192
196
|
# RTSP: rtsp://192.168.1.143:554/1/RTSP
|
|
@@ -195,18 +199,18 @@ zenitel video -h 192.168.1.143
|
|
|
195
199
|
### Call Button (DAK) Configuration
|
|
196
200
|
|
|
197
201
|
```bash
|
|
198
|
-
|
|
199
|
-
|
|
202
|
+
tciv dak get -h 192.168.1.143
|
|
203
|
+
tciv dak set --number portia-ae3c -h 192.168.1.143
|
|
200
204
|
```
|
|
201
205
|
|
|
202
206
|
> Downloads config → modifies XML → re-uploads → reboots. Zero external dependencies.
|
|
203
207
|
|
|
204
208
|
### Full Device Provisioning
|
|
205
209
|
|
|
206
|
-
One command to configure a factory-reset
|
|
210
|
+
One command to configure a factory-reset intercom:
|
|
207
211
|
|
|
208
212
|
```bash
|
|
209
|
-
|
|
213
|
+
tciv provision -h 192.168.1.143 \
|
|
210
214
|
--domain testing-mo16m3gw.sip.twilio.com \
|
|
211
215
|
--sip-user zenitel01 \
|
|
212
216
|
--sip-pass 'your-sip-password' \
|
|
@@ -218,7 +222,7 @@ zenitel provision -h 192.168.1.143 \
|
|
|
218
222
|
### Device Reboot
|
|
219
223
|
|
|
220
224
|
```bash
|
|
221
|
-
|
|
225
|
+
tciv reboot -h 192.168.1.143
|
|
222
226
|
```
|
|
223
227
|
|
|
224
228
|
### CLI Options
|
|
@@ -227,7 +231,7 @@ zenitel reboot -h 192.168.1.143
|
|
|
227
231
|
|------|-------|-------------|---------|
|
|
228
232
|
| `--host` | `-h` | Device IP address | required |
|
|
229
233
|
| `--user` | `-u` | Web UI username | `admin` |
|
|
230
|
-
| `--pass` | `-p` | Web UI password | `alphaadmin` |
|
|
234
|
+
| `--pass` | `-p` | Web UI password | `alphaadmin` (change on first login) |
|
|
231
235
|
| `--id` | | Relay ID (`relay1`, `gpio1`–`gpio6`) | `relay1` |
|
|
232
236
|
| `--timer` | | Relay timer (seconds) | `3` |
|
|
233
237
|
| `--timeout` | | Scan timeout (ms) | `5000` |
|
|
@@ -245,12 +249,12 @@ zenitel reboot -h 192.168.1.143
|
|
|
245
249
|
|
|
246
250
|
## API
|
|
247
251
|
|
|
248
|
-
### `
|
|
252
|
+
### `TcivClient`
|
|
249
253
|
|
|
250
254
|
```typescript
|
|
251
|
-
import {
|
|
255
|
+
import { TcivClient } from 'tciv-client';
|
|
252
256
|
|
|
253
|
-
const z = new
|
|
257
|
+
const z = new TcivClient({
|
|
254
258
|
host: '192.168.1.143',
|
|
255
259
|
user: 'admin', // default
|
|
256
260
|
password: 'alphaadmin', // default
|
|
@@ -358,7 +362,7 @@ await z.provisionDevice({
|
|
|
358
362
|
|
|
359
363
|
Read and write the full audio configuration — speaker/mic gain, echo cancellation, noise suppression, compression, and automatic volume control.
|
|
360
364
|
|
|
361
|
-
> The
|
|
365
|
+
> The config endpoint requires the **complete** JSON payload. `setAudioSettings()` handles this automatically — it reads, merges your changes, and writes back.
|
|
362
366
|
|
|
363
367
|
```typescript
|
|
364
368
|
const audio = await z.getAudioSettings();
|
|
@@ -408,7 +412,7 @@ const devices = await scanNetwork({ timeout: 5000 });
|
|
|
408
412
|
| Strategy | Method | Speed |
|
|
409
413
|
|----------|--------|-------|
|
|
410
414
|
| `arp-oui` | ARP table + MAC prefix `00:13:CB` | Fast |
|
|
411
|
-
| `http-probe` | Probe every IP for `
|
|
415
|
+
| `http-probe` | Probe every IP for `tciv-fingerprint` | Thorough |
|
|
412
416
|
|
|
413
417
|
---
|
|
414
418
|
|
|
@@ -420,7 +424,9 @@ const devices = await scanNetwork({ timeout: 5000 });
|
|
|
420
424
|
| TCIV-3+ | ✅ | ✅ | ✅ | ✅ | Expected |
|
|
421
425
|
| TCIS-2 | — | ✅ | ✅ | ✅ | Expected |
|
|
422
426
|
|
|
423
|
-
##
|
|
427
|
+
## HTTP API Reference
|
|
428
|
+
|
|
429
|
+
All endpoints require valid administrator credentials via HTTP Basic Auth.
|
|
424
430
|
|
|
425
431
|
| Endpoint | Method | Purpose |
|
|
426
432
|
|----------|--------|---------|
|
|
@@ -436,8 +442,6 @@ const devices = await scanNetwork({ timeout: 5000 });
|
|
|
436
442
|
| `/goform/zForm_system_prefs` | POST | Reboot device |
|
|
437
443
|
| `/mjpg/video.mjpg` | GET | Live MJPG stream |
|
|
438
444
|
|
|
439
|
-
Auth: **HTTP Basic** on all endpoints.
|
|
440
|
-
|
|
441
445
|
## License
|
|
442
446
|
|
|
443
447
|
Apache-2.0
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* tciv — CLI for TCIV-series intercom administration
|
|
4
4
|
*
|
|
5
5
|
* Usage:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
6
|
+
* tciv scan Discover TCIV devices on the network
|
|
7
|
+
* tciv info -h 192.168.1.143 Get device info
|
|
8
|
+
* tciv relay -h 192.168.1.143 Activate relay1 for 3 seconds
|
|
9
|
+
* tciv relay -h ... --id gpio1 --timer 5
|
|
10
|
+
* tciv call 122 -h 192.168.1.143 Place a call
|
|
11
|
+
* tciv stop -h 192.168.1.143 Stop current call
|
|
12
|
+
* tciv status -h 192.168.1.143 Get relay + call status
|
|
13
13
|
*/
|
|
14
14
|
export {};
|
package/dist/cli.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* tciv — CLI for TCIV-series intercom administration
|
|
4
4
|
*
|
|
5
5
|
* Usage:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
6
|
+
* tciv scan Discover TCIV devices on the network
|
|
7
|
+
* tciv info -h 192.168.1.143 Get device info
|
|
8
|
+
* tciv relay -h 192.168.1.143 Activate relay1 for 3 seconds
|
|
9
|
+
* tciv relay -h ... --id gpio1 --timer 5
|
|
10
|
+
* tciv call 122 -h 192.168.1.143 Place a call
|
|
11
|
+
* tciv stop -h 192.168.1.143 Stop current call
|
|
12
|
+
* tciv status -h 192.168.1.143 Get relay + call status
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
14
|
+
import { TcivClient } from './client.js';
|
|
15
15
|
import { scanNetwork } from './scanner.js';
|
|
16
16
|
const args = process.argv.slice(2);
|
|
17
17
|
const command = args[0];
|
|
@@ -32,7 +32,7 @@ function getClient() {
|
|
|
32
32
|
console.error('Error: --host (-h) is required');
|
|
33
33
|
process.exit(1);
|
|
34
34
|
}
|
|
35
|
-
return new
|
|
35
|
+
return new TcivClient({
|
|
36
36
|
host,
|
|
37
37
|
user: flag('user', 'u') ?? 'admin',
|
|
38
38
|
password: flag('pass', 'p') ?? 'alphaadmin',
|
|
@@ -41,12 +41,12 @@ function getClient() {
|
|
|
41
41
|
async function main() {
|
|
42
42
|
switch (command) {
|
|
43
43
|
case 'scan': {
|
|
44
|
-
console.log('🔍 Scanning network for
|
|
44
|
+
console.log('🔍 Scanning network for TCIV devices...\n');
|
|
45
45
|
const devices = await scanNetwork({
|
|
46
46
|
timeout: Number(flag('timeout') ?? 5000),
|
|
47
47
|
});
|
|
48
48
|
if (devices.length === 0) {
|
|
49
|
-
console.log('No
|
|
49
|
+
console.log('No TCIV devices found.');
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
52
|
for (const dev of devices) {
|
|
@@ -109,7 +109,7 @@ async function main() {
|
|
|
109
109
|
const client = getClient();
|
|
110
110
|
const number = args[1];
|
|
111
111
|
if (!number) {
|
|
112
|
-
console.error('Usage:
|
|
112
|
+
console.error('Usage: tciv call <number> -h <host>');
|
|
113
113
|
process.exit(1);
|
|
114
114
|
}
|
|
115
115
|
console.log(`📞 Calling ${number}...`);
|
|
@@ -187,7 +187,7 @@ async function main() {
|
|
|
187
187
|
else {
|
|
188
188
|
const info = await client.getDeviceInfo();
|
|
189
189
|
console.log(`Webcall: ${info.webcallEnabled ? '✅ Enabled' : '❌ Disabled'}`);
|
|
190
|
-
console.log('\nUsage:
|
|
190
|
+
console.log('\nUsage: tciv webcall enable|disable -h <host>');
|
|
191
191
|
}
|
|
192
192
|
break;
|
|
193
193
|
}
|
|
@@ -206,7 +206,7 @@ async function main() {
|
|
|
206
206
|
const { readFileSync } = await import('node:fs');
|
|
207
207
|
const inFile = args[1];
|
|
208
208
|
if (!inFile) {
|
|
209
|
-
console.error('Usage:
|
|
209
|
+
console.error('Usage: tciv restore <file.tar.gz> -h <host>');
|
|
210
210
|
process.exit(1);
|
|
211
211
|
}
|
|
212
212
|
console.log(`📤 Uploading config from ${inFile}...`);
|
|
@@ -235,7 +235,7 @@ async function main() {
|
|
|
235
235
|
if (subCmd === 'set') {
|
|
236
236
|
const number = flag('number') || args[2];
|
|
237
237
|
if (!number) {
|
|
238
|
-
console.error('Usage:
|
|
238
|
+
console.error('Usage: tciv dak set --number <sip-number> -h <host>');
|
|
239
239
|
process.exit(1);
|
|
240
240
|
}
|
|
241
241
|
const domain = flag('domain');
|
|
@@ -266,7 +266,7 @@ async function main() {
|
|
|
266
266
|
const sipAuthPassword = flag('sip-pass');
|
|
267
267
|
const agentNumber = flag('number') || flag('agent');
|
|
268
268
|
if (!sipDomain || !sipAuthUser || !sipAuthPassword || !agentNumber) {
|
|
269
|
-
console.error(`Usage:
|
|
269
|
+
console.error(`Usage: tciv provision -h <host> \\
|
|
270
270
|
--domain <sip-domain> \\
|
|
271
271
|
--sip-user <auth-username> \\
|
|
272
272
|
--sip-pass <auth-password> \\
|
|
@@ -323,7 +323,7 @@ Optional:
|
|
|
323
323
|
if (hasFlag('avc-off'))
|
|
324
324
|
partial.avc = { enabled: false };
|
|
325
325
|
if (Object.keys(partial).length === 0) {
|
|
326
|
-
console.error(`Usage:
|
|
326
|
+
console.error(`Usage: tciv audio set -h <host> [options]
|
|
327
327
|
|
|
328
328
|
--speaker <dB> Speaker gain (-10 to +13)
|
|
329
329
|
--mic <dB> Mic gain (-10 to +10)
|
|
@@ -375,10 +375,10 @@ Optional:
|
|
|
375
375
|
break;
|
|
376
376
|
}
|
|
377
377
|
default:
|
|
378
|
-
console.log(`
|
|
378
|
+
console.log(`tciv — TCIV intercom CLI
|
|
379
379
|
|
|
380
380
|
Commands:
|
|
381
|
-
scan Discover devices on the network
|
|
381
|
+
scan Discover devices on the local network
|
|
382
382
|
info -h <host> Device information
|
|
383
383
|
relay -h <host> Activate relay (--id relay1 --timer 3)
|
|
384
384
|
relay -h <host> --off Deactivate relay
|
|
@@ -398,7 +398,7 @@ Commands:
|
|
|
398
398
|
video -h <host> Show video stream URLs
|
|
399
399
|
|
|
400
400
|
Options:
|
|
401
|
-
-h, --host IP address of the
|
|
401
|
+
-h, --host IP address of the intercom
|
|
402
402
|
-u, --user Username (default: admin)
|
|
403
403
|
-p, --pass Password (default: alphaadmin)
|
|
404
404
|
--id Relay ID (relay1, gpio1-gpio6)
|
package/dist/client.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* TcivClient — HTTP client for TCIV-series intercom systems
|
|
3
3
|
*
|
|
4
|
-
* All methods use the goform endpoints documented in the
|
|
4
|
+
* All methods use the goform endpoints documented in the manufacturer wiki
|
|
5
5
|
* and confirmed against a real TCIV-2+ (FW 9.2.3.0) at 192.168.1.143.
|
|
6
6
|
*
|
|
7
7
|
* Auth: HTTP Basic Auth (admin/alphaadmin by default).
|
|
8
8
|
* All goform endpoints use POST with form-urlencoded bodies.
|
|
9
9
|
*/
|
|
10
|
-
import type {
|
|
11
|
-
export declare class
|
|
10
|
+
import type { TcivClientOptions, DeviceInfo, RelayOptions, RelayStatus, CallStatus, SIPConfig, ProvisionConfig, AudioSettings } from './types.js';
|
|
11
|
+
export declare class TcivClient {
|
|
12
12
|
private opts;
|
|
13
13
|
private readonly baseUrl;
|
|
14
14
|
private readonly authHeader;
|
|
15
15
|
private readonly timeout;
|
|
16
|
-
constructor(opts:
|
|
16
|
+
constructor(opts: TcivClientOptions);
|
|
17
17
|
/** Check if the Zenitel is reachable */
|
|
18
18
|
isReachable(): Promise<boolean>;
|
|
19
19
|
/** Scrape station info + header for full device data */
|
package/dist/client.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* TcivClient — HTTP client for TCIV-series intercom systems
|
|
3
3
|
*
|
|
4
|
-
* All methods use the goform endpoints documented in the
|
|
4
|
+
* All methods use the goform endpoints documented in the manufacturer wiki
|
|
5
5
|
* and confirmed against a real TCIV-2+ (FW 9.2.3.0) at 192.168.1.143.
|
|
6
6
|
*
|
|
7
7
|
* Auth: HTTP Basic Auth (admin/alphaadmin by default).
|
|
8
8
|
* All goform endpoints use POST with form-urlencoded bodies.
|
|
9
9
|
*/
|
|
10
|
-
export class
|
|
10
|
+
export class TcivClient {
|
|
11
11
|
opts;
|
|
12
12
|
baseUrl;
|
|
13
13
|
authHeader;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { TcivClient } from './client.js';
|
|
2
2
|
export { scanNetwork } from './scanner.js';
|
|
3
|
-
export type {
|
|
3
|
+
export type { TcivClientOptions, TcivDevice, ScanOptions, DeviceInfo, RelayOptions, RelayStatus, CallStatus, SIPConfig, ProvisionConfig, AudioSettings, AudioOutputDevice, AudioInputDevice, AECSettings, ANCSettings, FESSSettings, DRCSettings, AVCSettings, } from './types.js';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { TcivClient } from './client.js';
|
|
2
2
|
export { scanNetwork } from './scanner.js';
|
package/dist/scanner.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Device discovery — Discover TCIV intercoms on the local network for authorized administrators
|
|
3
3
|
*
|
|
4
4
|
* Strategy A: ARP table + OUI filter (MAC prefix 00:13:cb = Zenitel)
|
|
5
5
|
* Strategy B: HTTP probe with fingerprinting (zenitel.js in HTML)
|
|
6
6
|
*
|
|
7
7
|
* Both strategies run in parallel and results are merged by IP.
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
10
|
-
export declare function scanNetwork(opts?: ScanOptions): Promise<
|
|
9
|
+
import type { TcivDevice, ScanOptions } from './types.js';
|
|
10
|
+
export declare function scanNetwork(opts?: ScanOptions): Promise<TcivDevice[]>;
|
package/dist/scanner.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Device discovery — Discover TCIV intercoms on the local network for authorized administrators
|
|
3
3
|
*
|
|
4
4
|
* Strategy A: ARP table + OUI filter (MAC prefix 00:13:cb = Zenitel)
|
|
5
5
|
* Strategy B: HTTP probe with fingerprinting (zenitel.js in HTML)
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { execFile } from 'node:child_process';
|
|
10
10
|
import { platform } from 'node:os';
|
|
11
11
|
import { networkInterfaces } from 'node:os';
|
|
12
|
-
import {
|
|
12
|
+
import { TcivClient } from './client.js';
|
|
13
13
|
const ZENITEL_OUI = '00:13:cb';
|
|
14
14
|
// ── Public API ────────────────────────────────────────────────────────────
|
|
15
15
|
export async function scanNetwork(opts) {
|
|
@@ -42,7 +42,7 @@ async function arpOuiScan() {
|
|
|
42
42
|
const zenitels = entries.filter((e) => e.mac.toLowerCase().startsWith(ZENITEL_OUI));
|
|
43
43
|
// For each candidate, try to get device info
|
|
44
44
|
const results = await Promise.all(zenitels.map(async (entry) => {
|
|
45
|
-
const client = new
|
|
45
|
+
const client = new TcivClient({ host: entry.ip, timeout: 3000 });
|
|
46
46
|
try {
|
|
47
47
|
const info = await client.getDeviceInfo();
|
|
48
48
|
return {
|
package/dist/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* All interfaces for the Zenitel HTTP scraper, scanner, and CLI.
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface TcivClientOptions {
|
|
7
7
|
/** IP or hostname of the Zenitel intercom (e.g. "192.168.1.143") */
|
|
8
8
|
host: string;
|
|
9
9
|
/** Web UI username. Default: "admin" */
|
|
@@ -15,7 +15,7 @@ export interface ZenitelClientOptions {
|
|
|
15
15
|
/** HTTP request timeout in ms. Default: 5000 */
|
|
16
16
|
timeout?: number;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface TcivDevice {
|
|
19
19
|
ip: string;
|
|
20
20
|
mac: string;
|
|
21
21
|
model?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tciv-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "HTTP client for TCIV-series intercom systems (TCIV-2+, TCIV-3). Control relays, SIP configuration, DAK provisioning, webcall, audio settings, and camera feeds.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|