|
| 1 | +asyncapi: '3.1.0' |
| 2 | + |
| 3 | +info: |
| 4 | + title: Sofie Package Manager API |
| 5 | + version: 1.0.0 |
| 6 | + description: > |
| 7 | + WebSocket API between **Sofie Core** and the **Package Manager**. |
| 8 | +
|
| 9 | + ## Overview |
| 10 | +
|
| 11 | + This document describes the full message contract for the Package Manager API. |
| 12 | + The Package Manager (PM) connects to Sofie Core over a persistent WebSocket |
| 13 | + connection. Once connected, both sides exchange messages on named logical channels. |
| 14 | +
|
| 15 | + ## Authentication / identification |
| 16 | +
|
| 17 | + Each Package Manager instance identifies itself at connection time via query |
| 18 | + parameters on the WebSocket handshake URL: |
| 19 | +
|
| 20 | + | Query param | Type | Description | |
| 21 | + |---------------|--------|--------------------------------------------------| |
| 22 | + | `clientId` | string | Stable identifier for this PM instance | |
| 23 | + | `expectationManagerId` | string | The Expectation Manager this PM hosts | |
| 24 | +
|
| 25 | + No token-based authentication is defined here — network-level controls |
| 26 | + (firewall, VPN, mutual TLS) are assumed. |
| 27 | +
|
| 28 | + ## Channel overview |
| 29 | +
|
| 30 | + | Channel address | Direction | Pattern | Description | |
| 31 | + |--------------------------|-------------|-------------------|-----------------------------------------| |
| 32 | + | `expectations` | Core → PM | Event (CRUD) | Expectation lifecycle deltas | |
| 33 | + | `packageContainers` | Core → PM | Event (CRUD) | PackageContainer config deltas | |
| 34 | + | `workStatuses` | PM → Core | Event (CRUD) | ExpectationStatus lifecycle deltas | |
| 35 | + | `containerStatuses` | PM → Core | Event (update/rm) | PackageContainer health status | |
| 36 | + | `containerPackageStatuses` | PM → Core | Event (update/rm) | Per-package transfer status | |
| 37 | + | `packageInfo` | PM → Core | Event (fire-forget)| Scan/probe results and removals | |
| 38 | + | `rpc/core-to-pm` | Bidirectional | JSON-RPC 2.0 | Core calls RPC methods on PM (7 methods)| |
| 39 | + | `rpc/pm-to-core` | Bidirectional | JSON-RPC 2.0 | PM calls RPC methods on Core (1 method) | |
| 40 | +
|
| 41 | + ## Design constraints |
| 42 | +
|
| 43 | + - There is **no** `ExpectedPackageId` in the protocol. All statuses and |
| 44 | + package-info entries are keyed by `ExpectationId`. Core maps back to its |
| 45 | + own expected packages internally. |
| 46 | + - There is **no** `requiredForPlayout` field. Urgency is expressed via the |
| 47 | + numeric `priority` field. |
| 48 | + - JSON-RPC 2.0 is used for request-reply RPC calls. The `id` field on the |
| 49 | + JSON-RPC envelope correlates requests to responses. |
| 50 | +
|
| 51 | + license: |
| 52 | + name: MIT |
| 53 | + url: https://opensource.org/licenses/MIT |
| 54 | + |
| 55 | +servers: |
| 56 | + coreWebSocket: |
| 57 | + host: '{coreHost}:{corePort}' |
| 58 | + pathname: /package-manager |
| 59 | + protocol: wss |
| 60 | + description: > |
| 61 | + Sofie Core WebSocket endpoint for the Package Manager API. |
| 62 | + The Package Manager connects here. Both parties then exchange messages |
| 63 | + across the channels defined below. |
| 64 | + variables: |
| 65 | + coreHost: |
| 66 | + description: Hostname or IP address of the Sofie Core server. |
| 67 | + default: localhost |
| 68 | + corePort: |
| 69 | + description: WebSocket port for the Package Manager API. |
| 70 | + default: '3000' |
| 71 | + |
| 72 | +# --------------------------------------------------------------------------- |
| 73 | +# Channels |
| 74 | +# --------------------------------------------------------------------------- |
| 75 | +channels: |
| 76 | + # Core → PM event channels |
| 77 | + expectations: |
| 78 | + $ref: './channels/from-core.yaml#/expectations' |
| 79 | + packageContainers: |
| 80 | + $ref: './channels/from-core.yaml#/packageContainers' |
| 81 | + |
| 82 | + # PM → Core event channels |
| 83 | + workStatuses: |
| 84 | + $ref: './channels/from-pm.yaml#/workStatuses' |
| 85 | + containerStatuses: |
| 86 | + $ref: './channels/from-pm.yaml#/containerStatuses' |
| 87 | + containerPackageStatuses: |
| 88 | + $ref: './channels/from-pm.yaml#/containerPackageStatuses' |
| 89 | + packageInfo: |
| 90 | + $ref: './channels/from-pm.yaml#/packageInfo' |
| 91 | + |
| 92 | + # JSON-RPC channels |
| 93 | + rpcCoreTopm: |
| 94 | + $ref: './channels/rpc-core-to-pm.yaml#/rpcCoreTopm' |
| 95 | + rpcPmToCore: |
| 96 | + $ref: './channels/rpc-pm-to-core.yaml#/rpcPmToCore' |
| 97 | + |
| 98 | +# --------------------------------------------------------------------------- |
| 99 | +# Operations — from Core's perspective |
| 100 | +# --------------------------------------------------------------------------- |
| 101 | +operations: |
| 102 | + # Core → PM sends |
| 103 | + sendExpectationAdded: |
| 104 | + $ref: './operations/from-core.yaml#/sendExpectationAdded' |
| 105 | + sendExpectationUpdated: |
| 106 | + $ref: './operations/from-core.yaml#/sendExpectationUpdated' |
| 107 | + sendExpectationRemoved: |
| 108 | + $ref: './operations/from-core.yaml#/sendExpectationRemoved' |
| 109 | + sendPackageContainerAdded: |
| 110 | + $ref: './operations/from-core.yaml#/sendPackageContainerAdded' |
| 111 | + sendPackageContainerUpdated: |
| 112 | + $ref: './operations/from-core.yaml#/sendPackageContainerUpdated' |
| 113 | + sendPackageContainerRemoved: |
| 114 | + $ref: './operations/from-core.yaml#/sendPackageContainerRemoved' |
| 115 | + |
| 116 | + # Core receives from PM |
| 117 | + receiveExpectationStatusAdded: |
| 118 | + $ref: './operations/from-core.yaml#/receiveExpectationStatusAdded' |
| 119 | + receiveExpectationStatusUpdated: |
| 120 | + $ref: './operations/from-core.yaml#/receiveExpectationStatusUpdated' |
| 121 | + receiveExpectationStatusRemoved: |
| 122 | + $ref: './operations/from-core.yaml#/receiveExpectationStatusRemoved' |
| 123 | + receiveContainerStatusUpdated: |
| 124 | + $ref: './operations/from-core.yaml#/receiveContainerStatusUpdated' |
| 125 | + receiveContainerStatusRemoved: |
| 126 | + $ref: './operations/from-core.yaml#/receiveContainerStatusRemoved' |
| 127 | + receiveContainerPackageStatusUpdated: |
| 128 | + $ref: './operations/from-core.yaml#/receiveContainerPackageStatusUpdated' |
| 129 | + receiveContainerPackageStatusRemoved: |
| 130 | + $ref: './operations/from-core.yaml#/receiveContainerPackageStatusRemoved' |
| 131 | + receivePackageInfoUpdated: |
| 132 | + $ref: './operations/from-core.yaml#/receivePackageInfoUpdated' |
| 133 | + receivePackageInfoRemoved: |
| 134 | + $ref: './operations/from-core.yaml#/receivePackageInfoRemoved' |
| 135 | + |
| 136 | + # Core RPC (send requests, receive responses) |
| 137 | + sendRpcCoreTopm: |
| 138 | + $ref: './operations/from-core.yaml#/sendRpcCoreTopm' |
| 139 | + receiveRpcCoreTopmResponse: |
| 140 | + $ref: './operations/from-core.yaml#/receiveRpcCoreTopmResponse' |
| 141 | + |
| 142 | + # Core answers PM's RPC calls |
| 143 | + receiveRpcPmToCoreRequest: |
| 144 | + $ref: './operations/from-core.yaml#/receiveRpcPmToCoreRequest' |
| 145 | + sendRpcPmToCoreResponse: |
| 146 | + $ref: './operations/from-core.yaml#/sendRpcPmToCoreResponse' |
| 147 | + |
| 148 | +# --------------------------------------------------------------------------- |
| 149 | +# Components — inline references for tooling convenience. |
| 150 | +# Full schemas live under ./components/schemas/*.yaml |
| 151 | +# --------------------------------------------------------------------------- |
| 152 | +components: |
| 153 | + schemas: |
| 154 | + # IDs |
| 155 | + ExpectationId: |
| 156 | + $ref: './components/schemas/ids.yaml#/ExpectationId' |
| 157 | + ExpectationManagerId: |
| 158 | + $ref: './components/schemas/ids.yaml#/ExpectationManagerId' |
| 159 | + PackageContainerId: |
| 160 | + $ref: './components/schemas/ids.yaml#/PackageContainerId' |
| 161 | + AccessorId: |
| 162 | + $ref: './components/schemas/ids.yaml#/AccessorId' |
| 163 | + WorkerAgentId: |
| 164 | + $ref: './components/schemas/ids.yaml#/WorkerAgentId' |
| 165 | + WorkInProgressId: |
| 166 | + $ref: './components/schemas/ids.yaml#/WorkInProgressId' |
| 167 | + WorkInProgressLocalId: |
| 168 | + $ref: './components/schemas/ids.yaml#/WorkInProgressLocalId' |
| 169 | + MonitorId: |
| 170 | + $ref: './components/schemas/ids.yaml#/MonitorId' |
| 171 | + AppContainerId: |
| 172 | + $ref: './components/schemas/ids.yaml#/AppContainerId' |
| 173 | + AppId: |
| 174 | + $ref: './components/schemas/ids.yaml#/AppId' |
| 175 | + |
| 176 | + # Common |
| 177 | + WorkStatusState: |
| 178 | + $ref: './components/schemas/common.yaml#/WorkStatusState' |
| 179 | + StatusCode: |
| 180 | + $ref: './components/schemas/common.yaml#/StatusCode' |
| 181 | + Reason: |
| 182 | + $ref: './components/schemas/common.yaml#/Reason' |
| 183 | + Priority: |
| 184 | + $ref: './components/schemas/common.yaml#/Priority' |
| 185 | + |
| 186 | + # JSON-RPC |
| 187 | + JsonRpcRequest: |
| 188 | + $ref: './components/schemas/jsonrpc.yaml#/JsonRpcRequest' |
| 189 | + JsonRpcResponse: |
| 190 | + $ref: './components/schemas/jsonrpc.yaml#/JsonRpcResponse' |
| 191 | + JsonRpcError: |
| 192 | + $ref: './components/schemas/jsonrpc.yaml#/JsonRpcError' |
| 193 | + |
| 194 | + # Domain |
| 195 | + Expectation: |
| 196 | + $ref: './components/schemas/expectations/index.yaml#/Expectation' |
| 197 | + PackageContainer: |
| 198 | + $ref: './components/schemas/package-containers.yaml#/PackageContainer' |
| 199 | + PackageContainerExpectation: |
| 200 | + $ref: './components/schemas/package-containers.yaml#/PackageContainerExpectation' |
| 201 | + ExpectationStatus: |
| 202 | + $ref: './components/schemas/statuses.yaml#/ExpectationStatus' |
| 203 | + PackageContainerStatus: |
| 204 | + $ref: './components/schemas/statuses.yaml#/PackageContainerStatus' |
| 205 | + PackageContainerPackageStatus: |
| 206 | + $ref: './components/schemas/statuses.yaml#/PackageContainerPackageStatus' |
| 207 | + ExpectationManagerStatusReport: |
| 208 | + $ref: './components/schemas/statuses.yaml#/ExpectationManagerStatusReport' |
| 209 | + PackageInfoEntry: |
| 210 | + $ref: './components/schemas/statuses.yaml#/PackageInfoEntry' |
0 commit comments