@xiboplayer/xmds 0.2.0 → 0.3.1

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 (3) hide show
  1. package/README.md +28 -32
  2. package/package.json +2 -2
  3. package/src/index.js +2 -0
package/README.md CHANGED
@@ -1,16 +1,15 @@
1
- # @xiboplayer/xmds Documentation
1
+ # @xiboplayer/xmds
2
2
 
3
- **XMDS (XML-based Media Distribution Service) SOAP client.**
3
+ **XMDS SOAP + REST client for Xibo CMS communication.**
4
4
 
5
5
  ## Overview
6
6
 
7
- SOAP client for Xibo CMS communication:
7
+ Dual-transport client supporting both Xibo communication protocols:
8
8
 
9
- - Display registration
10
- - Content synchronization
11
- - File downloads
12
- - Proof of play submission
13
- - Log reporting
9
+ - **XMDS SOAP** (v3-v7) — standard Xibo player protocol with XML encoding
10
+ - **REST API** — lighter JSON transport (~30% smaller payloads) with ETag caching
11
+
12
+ Both transports expose the same API. The REST client is preferred when available.
14
13
 
15
14
  ## Installation
16
15
 
@@ -21,40 +20,37 @@ npm install @xiboplayer/xmds
21
20
  ## Usage
22
21
 
23
22
  ```javascript
24
- import { XMDSClient } from '@xiboplayer/xmds';
23
+ import { RestClient } from '@xiboplayer/xmds';
25
24
 
26
- const client = new XMDSClient({
27
- cmsUrl: 'https://cms.example.com',
28
- serverKey: 'abc123',
29
- hardwareKey: 'def456'
25
+ const client = new RestClient({
26
+ cmsUrl: 'https://your-cms.example.com',
27
+ serverKey: 'your-key',
28
+ hardwareKey: 'display-id',
30
29
  });
31
30
 
32
- // Register display
33
- await client.registerDisplay();
34
-
35
- // Get required files
31
+ const result = await client.registerDisplay();
36
32
  const files = await client.requiredFiles();
37
-
38
- // Download file
39
- const blob = await client.getFile(fileId, fileType);
33
+ const schedule = await client.schedule();
40
34
  ```
41
35
 
42
- ## SOAP Methods
36
+ ## Methods
43
37
 
44
- - `RegisterDisplay` - Register/verify display
45
- - `RequiredFiles` - Get content to download
46
- - `GetFile` - Download media file
47
- - `SubmitStats` - Send proof of play
48
- - `SubmitLog` - Report errors
38
+ | Method | Description |
39
+ |--------|-------------|
40
+ | `registerDisplay()` | Register/authorize the display with the CMS |
41
+ | `requiredFiles()` | Get list of required media files and layouts |
42
+ | `schedule()` | Get the current schedule XML |
43
+ | `getResource(regionId, mediaId)` | Get rendered widget HTML |
44
+ | `notifyStatus(status)` | Report display status to CMS |
45
+ | `mediaInventory(inventory)` | Report cached media inventory |
46
+ | `submitStats(stats)` | Submit proof of play statistics |
47
+ | `submitScreenShot(base64)` | Upload a screenshot to the CMS |
48
+ | `submitLog(logs)` | Submit display logs |
49
49
 
50
50
  ## Dependencies
51
51
 
52
- - `@xiboplayer/utils` - Logger
53
-
54
- ## Related Packages
55
-
56
- - [@xiboplayer/core](../../core/docs/) - Player core
52
+ - `@xiboplayer/utils` logger, events, fetchWithRetry
57
53
 
58
54
  ---
59
55
 
60
- **Package Version**: 1.0.0
56
+ **Part of the [XiboPlayer SDK](https://github.com/xibo-players/xiboplayer)** | [MCP Server](https://github.com/xibo-players/xiboplayer/tree/main/mcp-server) for AI-assisted development
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiboplayer/xmds",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "XMDS SOAP client for Xibo CMS communication",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -9,7 +9,7 @@
9
9
  "./xmds": "./src/xmds.js"
10
10
  },
11
11
  "dependencies": {
12
- "@xiboplayer/utils": "0.2.0"
12
+ "@xiboplayer/utils": "0.3.1"
13
13
  },
14
14
  "devDependencies": {
15
15
  "vitest": "^2.0.0"
package/src/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  // @xiboplayer/xmds - XMDS clients (REST and SOAP)
2
+ import pkg from '../package.json' with { type: 'json' };
3
+ export const VERSION = pkg.version;
2
4
  export { RestClient } from './rest-client.js';
3
5
  export { XmdsClient } from './xmds-client.js';
4
6
  export { parseScheduleResponse } from './schedule-parser.js';