@portalshq/capability-queue-broadcast 0.1.5 → 0.1.7
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 +6 -3
- package/dist/client.d.ts +2 -1
- package/dist/client.js +8 -2
- package/package.json +9 -5
package/README.md
CHANGED
|
@@ -103,14 +103,17 @@ webhooks, storage, and relays remain outside this capability.
|
|
|
103
103
|
|
|
104
104
|
## Generated API
|
|
105
105
|
|
|
106
|
-
`src/generated/api.ts` is generated from the
|
|
107
|
-
`openapi.json` contract using Orval:
|
|
106
|
+
`src/generated/api.ts` is generated from the checked-in
|
|
107
|
+
`openapi/streamer.json` contract snapshot using Orval:
|
|
108
108
|
|
|
109
109
|
```bash
|
|
110
110
|
npm run generate -w @portalshq/capability-queue-broadcast
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
Refresh `openapi/streamer.json` from the Streamer repository when updating the
|
|
114
|
+
client, and commit the snapshot with the generated changes. This makes release
|
|
115
|
+
tests independent of a sibling checkout. The current snapshot comes from
|
|
116
|
+
Streamer commit `90b9102` (`openapi.json`). The
|
|
114
117
|
hand-written `QueueBroadcastClient` owns authentication, error mapping,
|
|
115
118
|
endpoint validation, and polling semantics.
|
|
116
119
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CaptionTrack, type HlsPlaybackSession } from "@portalshq/capability-video-delivery";
|
|
2
2
|
import type { ChatMessage } from "@portalshq/capability-realtime-fanout";
|
|
3
3
|
import type { HealthResponse, JobResponse, JobResponseMediaType, JobResponseStatus, QueuePairResponse, QueueSlotResponse } from "./generated/api.js";
|
|
4
4
|
export type QueueMediaType = JobResponseMediaType;
|
|
@@ -165,6 +165,7 @@ export declare class QueueBroadcastClient {
|
|
|
165
165
|
watchJob(jobId: string, options?: WatchJobOptions): AsyncGenerator<QueueBroadcastJob>;
|
|
166
166
|
getPlayback(options?: {
|
|
167
167
|
signal?: AbortSignal;
|
|
168
|
+
captionTracks?: readonly CaptionTrack[];
|
|
168
169
|
}): Promise<HlsPlaybackSession>;
|
|
169
170
|
health(options?: {
|
|
170
171
|
signal?: AbortSignal;
|
package/dist/client.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { normalizeCaptionTracks } from "@portalshq/capability-video-delivery";
|
|
1
2
|
/** Error returned by the queue control plane, including its HTTP status. */
|
|
2
3
|
export class QueueBroadcastError extends Error {
|
|
3
4
|
status;
|
|
@@ -240,12 +241,17 @@ export class QueueBroadcastClient {
|
|
|
240
241
|
}
|
|
241
242
|
}
|
|
242
243
|
async getPlayback(options = {}) {
|
|
243
|
-
const
|
|
244
|
+
const { captionTracks, ...requestOptions } = options;
|
|
245
|
+
const stream = await this.request("/v1/stream", requestOptions);
|
|
244
246
|
const hls = new URL(stream.hls);
|
|
245
247
|
if (hls.protocol !== "http:" && hls.protocol !== "https:") {
|
|
246
248
|
throw new QueueBroadcastError("queue server returned a non-http HLS URL", 502);
|
|
247
249
|
}
|
|
248
|
-
return {
|
|
250
|
+
return {
|
|
251
|
+
sessionId: this.endpoint,
|
|
252
|
+
playbackManifestUrl: hls.toString(),
|
|
253
|
+
...(captionTracks === undefined ? {} : { captionTracks: normalizeCaptionTracks(captionTracks) }),
|
|
254
|
+
};
|
|
249
255
|
}
|
|
250
256
|
async health(options = {}) {
|
|
251
257
|
return this.request("/health", options, false);
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portalshq/capability-queue-broadcast",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
|
-
"url": "git+https://github.com/portalshq/portals-cloud.git"
|
|
6
|
+
"url": "git+https://github.com/portalshq/portals-cloud.git",
|
|
7
|
+
"directory": "packages/queue-broadcast"
|
|
7
8
|
},
|
|
8
9
|
"description": "Server-only client for isolated Queue Broadcast Server instances.",
|
|
9
10
|
"type": "module",
|
|
@@ -14,7 +15,6 @@
|
|
|
14
15
|
],
|
|
15
16
|
"scripts": {
|
|
16
17
|
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
17
|
-
"publish": "node ../../scripts/publish-workspace.mjs",
|
|
18
18
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
19
19
|
"test": "vitest run",
|
|
20
20
|
"test:coverage": "vitest run --coverage",
|
|
@@ -22,13 +22,17 @@
|
|
|
22
22
|
"generate:check": "npm run generate && npm run typecheck"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@portalshq/capability-realtime-fanout": "^0.1.
|
|
26
|
-
"@portalshq/capability-video-delivery": "^0.1.
|
|
25
|
+
"@portalshq/capability-realtime-fanout": "^0.1.6",
|
|
26
|
+
"@portalshq/capability-video-delivery": "^0.1.6"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^20.0.0",
|
|
30
30
|
"@vitest/coverage-v8": "^3.2.7",
|
|
31
31
|
"typescript": "^5.5.0",
|
|
32
32
|
"vitest": "^3.2.7"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public",
|
|
36
|
+
"registry": "https://registry.npmjs.org/"
|
|
33
37
|
}
|
|
34
38
|
}
|