|
2 | 2 |
|
3 | 3 | **English** | [한국어](tsapi-v1.ko.md) |
4 | 4 |
|
5 | | -> **See also:** [Migration Guide](MIGRATION.md) |
| 5 | +> **See also:** [Migration Guide](MIGRATION.md) · [Changelog](CHANGELOG.md) |
6 | 6 |
|
7 | 7 | ## Table of Contents |
8 | 8 |
|
@@ -463,7 +463,7 @@ Retrieves server and product information. |
463 | 463 |
|
464 | 464 | | Endpoint | Auth | Description | |
465 | 465 | |----------|:----:|-------------| |
466 | | -| `GET /api/v1/info?apiVersion` | - | API version query (e.g., "TS-API@1.0.0") | |
| 466 | +| `GET /api/v1/info?apiVersion` | - | API version query (e.g., "TS-API@1.0.1") | |
467 | 467 | | `GET /api/v1/info?siteName` | - | Site name query | |
468 | 468 | | `GET /api/v1/info?timezone` | - | Server timezone query (name, bias) | |
469 | 469 | | `GET /api/v1/info?product` | - | Product info query (name, version) | |
@@ -498,7 +498,7 @@ curl "http://localhost/api/v1/info?all" -H "Authorization: Bearer eyJhbGc..." |
498 | 498 | **Response**: |
499 | 499 | ```json |
500 | 500 | { |
501 | | - "apiVersion": "TS-API@1.0.0", |
| 501 | + "apiVersion": "TS-API@1.0.1", |
502 | 502 | "siteName": "Main Office", |
503 | 503 | "timezone": {"name": "Asia/Seoul", "bias": "+09:00"}, |
504 | 504 | "product": {"name": "TS-NVR", "version": "2.14.1"}, |
@@ -2106,7 +2106,7 @@ sequenceDiagram |
2106 | 2106 |
|
2107 | 2107 | Note over Client,Server: 2. Receiving Real-time Events |
2108 | 2108 | loop On event |
2109 | | - Server-->>Client: {"topic":"LPR","plateNo":"12가3456",...} |
| 2109 | + Server-->>Client: {"topic":"LPR","channel":1,"plates":[{"plateNo":"12가3456",...}]} |
2110 | 2110 | end |
2111 | 2111 |
|
2112 | 2112 | Note over Client,Server: 3. Subscribe to Additional Topic |
@@ -2286,7 +2286,8 @@ ws.onmessage = (event) => { |
2286 | 2286 |
|
2287 | 2287 | switch(data.topic) { |
2288 | 2288 | case 'LPR': |
2289 | | - console.log('Plate:', data.plateNo, 'Score:', data.score); |
| 2289 | + // v1.0.1: data.plates (array), v1.0.0: data (single object) — handle both |
| 2290 | + (data.plates || [data]).forEach(p => console.log('Plate:', p.plateNo, 'Score:', p.score)); |
2290 | 2291 | break; |
2291 | 2292 | case 'channelStatus': |
2292 | 2293 | console.log('Channel', data.chid, 'Status:', data.status); |
@@ -2455,7 +2456,8 @@ ws.onmessage = (event) => { |
2455 | 2456 | // Handle event data |
2456 | 2457 | switch (data.topic) { |
2457 | 2458 | case 'LPR': |
2458 | | - console.log('Plate:', data.plateNo); |
| 2459 | + // v1.0.1: data.plates (array), v1.0.0: data (single object) — handle both |
| 2460 | + (data.plates || [data]).forEach(p => console.log('Plate:', p.plateNo)); |
2459 | 2461 | break; |
2460 | 2462 | case 'channelStatus': |
2461 | 2463 | console.log('Channel', data.chid, 'Status:', data.status); |
|
0 commit comments