@wave-av/sdk 2.0.0 → 2.0.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.
- package/dist/audience.d.ts +104 -0
- package/dist/audience.d.ts.map +1 -0
- package/dist/camera-control.d.ts +54 -0
- package/dist/camera-control.d.ts.map +1 -0
- package/dist/captions.d.ts +362 -0
- package/dist/captions.d.ts.map +1 -0
- package/dist/chapters.d.ts +315 -0
- package/dist/chapters.d.ts.map +1 -0
- package/dist/client.d.ts +191 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/clips.d.ts +258 -0
- package/dist/clips.d.ts.map +1 -0
- package/dist/cloud-switcher.d.ts +65 -0
- package/dist/cloud-switcher.d.ts.map +1 -0
- package/dist/collab-types.d.ts +204 -0
- package/dist/collab-types.d.ts.map +1 -0
- package/dist/collab.d.ts +226 -0
- package/dist/collab.d.ts.map +1 -0
- package/dist/connect.d.ts +88 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/creator.d.ts +109 -0
- package/dist/creator.d.ts.map +1 -0
- package/dist/desktop.d.ts +95 -0
- package/dist/desktop.d.ts.map +1 -0
- package/dist/distribution.d.ts +92 -0
- package/dist/distribution.d.ts.map +1 -0
- package/dist/drm.d.ts +87 -0
- package/dist/drm.d.ts.map +1 -0
- package/dist/edge.d.ts +112 -0
- package/dist/edge.d.ts.map +1 -0
- package/dist/editor-types.d.ts +236 -0
- package/dist/editor-types.d.ts.map +1 -0
- package/dist/editor.d.ts +206 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/fleet.d.ts +207 -0
- package/dist/fleet.d.ts.map +1 -0
- package/dist/ghost.d.ts +213 -0
- package/dist/ghost.d.ts.map +1 -0
- package/dist/index.d.ts +144 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/marketplace.d.ts +90 -0
- package/dist/marketplace.d.ts.map +1 -0
- package/dist/mesh.d.ts +237 -0
- package/dist/mesh.d.ts.map +1 -0
- package/dist/notifications.d.ts +82 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/phone.d.ts +369 -0
- package/dist/phone.d.ts.map +1 -0
- package/dist/pipeline.d.ts +409 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/podcast.d.ts +113 -0
- package/dist/podcast.d.ts.map +1 -0
- package/dist/prism.d.ts +132 -0
- package/dist/prism.d.ts.map +1 -0
- package/dist/prompter.d.ts +184 -0
- package/dist/prompter.d.ts.map +1 -0
- package/dist/pulse.d.ts +156 -0
- package/dist/pulse.d.ts.map +1 -0
- package/dist/qr.d.ts +82 -0
- package/dist/qr.d.ts.map +1 -0
- package/dist/replay.d.ts +52 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/scene-types.d.ts +190 -0
- package/dist/scene-types.d.ts.map +1 -0
- package/dist/scene.d.ts +213 -0
- package/dist/scene.d.ts.map +1 -0
- package/dist/search-types.d.ts +210 -0
- package/dist/search-types.d.ts.map +1 -0
- package/dist/search.d.ts +250 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/sentiment.d.ts +378 -0
- package/dist/sentiment.d.ts.map +1 -0
- package/dist/signage.d.ts +101 -0
- package/dist/signage.d.ts.map +1 -0
- package/dist/slides.d.ts +68 -0
- package/dist/slides.d.ts.map +1 -0
- package/dist/studio-ai-types.d.ts +198 -0
- package/dist/studio-ai-types.d.ts.map +1 -0
- package/dist/studio-ai.d.ts +218 -0
- package/dist/studio-ai.d.ts.map +1 -0
- package/dist/studio-types.d.ts +267 -0
- package/dist/studio-types.d.ts.map +1 -0
- package/dist/studio.d.ts +234 -0
- package/dist/studio.d.ts.map +1 -0
- package/dist/telemetry.d.ts +76 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/transcribe-types.d.ts +153 -0
- package/dist/transcribe-types.d.ts.map +1 -0
- package/dist/transcribe.d.ts +218 -0
- package/dist/transcribe.d.ts.map +1 -0
- package/dist/usb.d.ts +64 -0
- package/dist/usb.d.ts.map +1 -0
- package/dist/vault.d.ts +121 -0
- package/dist/vault.d.ts.map +1 -0
- package/dist/voice.d.ts +307 -0
- package/dist/voice.d.ts.map +1 -0
- package/dist/zoom.d.ts +91 -0
- package/dist/zoom.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Pipeline API
|
|
3
|
+
*
|
|
4
|
+
* Manage live streams across protocols (WebRTC, SRT, RTMP, HLS, NDI, OMT).
|
|
5
|
+
* The Pipeline is WAVE's core streaming engine for ingesting, transcoding,
|
|
6
|
+
* and delivering live video at scale.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This is a client SDK. All authorization checks are performed server-side.
|
|
9
|
+
* The API will return 403 Forbidden if the user lacks required permissions.
|
|
10
|
+
*/
|
|
11
|
+
import type { WaveClient, PaginationParams, PaginatedResponse, Timestamps, Metadata } from "./client";
|
|
12
|
+
/**
|
|
13
|
+
* Stream lifecycle status
|
|
14
|
+
*/
|
|
15
|
+
export type StreamStatus = "idle" | "connecting" | "live" | "reconnecting" | "ending" | "ended" | "failed";
|
|
16
|
+
/**
|
|
17
|
+
* Supported streaming protocols
|
|
18
|
+
*/
|
|
19
|
+
export type StreamProtocol = "webrtc" | "srt" | "rtmp" | "hls" | "ndi" | "omt";
|
|
20
|
+
/**
|
|
21
|
+
* Stream quality presets
|
|
22
|
+
*/
|
|
23
|
+
export type StreamQuality = "source" | "4k" | "1080p" | "720p" | "480p" | "360p";
|
|
24
|
+
/**
|
|
25
|
+
* Live stream object
|
|
26
|
+
*/
|
|
27
|
+
export interface Stream extends Timestamps {
|
|
28
|
+
/** Unique stream identifier */
|
|
29
|
+
id: string;
|
|
30
|
+
/** Organization that owns the stream */
|
|
31
|
+
organization_id: string;
|
|
32
|
+
/** Human-readable stream title */
|
|
33
|
+
title: string;
|
|
34
|
+
/** Optional description */
|
|
35
|
+
description?: string;
|
|
36
|
+
/** Current lifecycle status */
|
|
37
|
+
status: StreamStatus;
|
|
38
|
+
/** Ingest protocol */
|
|
39
|
+
protocol: StreamProtocol;
|
|
40
|
+
/** URL to push media to */
|
|
41
|
+
ingest_url?: string;
|
|
42
|
+
/** URL for viewers to watch */
|
|
43
|
+
playback_url?: string;
|
|
44
|
+
/** Secret key for stream authentication */
|
|
45
|
+
stream_key?: string;
|
|
46
|
+
/** Video resolution (e.g., "1920x1080") */
|
|
47
|
+
resolution?: string;
|
|
48
|
+
/** Video frame rate in fps */
|
|
49
|
+
frame_rate?: number;
|
|
50
|
+
/** Video bitrate in kilobits per second */
|
|
51
|
+
bitrate_kbps?: number;
|
|
52
|
+
/** Current number of connected viewers */
|
|
53
|
+
viewer_count: number;
|
|
54
|
+
/** Whether recording is enabled */
|
|
55
|
+
recording_enabled: boolean;
|
|
56
|
+
/** Whether DVR (rewind during live) is enabled */
|
|
57
|
+
dvr_enabled: boolean;
|
|
58
|
+
/** Whether low-latency mode is active */
|
|
59
|
+
low_latency: boolean;
|
|
60
|
+
/** Maximum allowed stream duration in seconds */
|
|
61
|
+
max_duration_seconds?: number;
|
|
62
|
+
/** ISO 8601 timestamp when the stream went live */
|
|
63
|
+
started_at?: string;
|
|
64
|
+
/** ISO 8601 timestamp when the stream ended */
|
|
65
|
+
ended_at?: string;
|
|
66
|
+
/** Categorization tags */
|
|
67
|
+
tags?: string[];
|
|
68
|
+
/** Arbitrary key-value metadata */
|
|
69
|
+
metadata?: Metadata;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Request body to create a new stream
|
|
73
|
+
*/
|
|
74
|
+
export interface CreateStreamRequest {
|
|
75
|
+
/** Human-readable stream title */
|
|
76
|
+
title: string;
|
|
77
|
+
/** Optional description */
|
|
78
|
+
description?: string;
|
|
79
|
+
/** Ingest protocol (default: webrtc) */
|
|
80
|
+
protocol?: StreamProtocol;
|
|
81
|
+
/** Quality preset for transcoding */
|
|
82
|
+
quality?: StreamQuality;
|
|
83
|
+
/** Enable recording of the stream */
|
|
84
|
+
recording_enabled?: boolean;
|
|
85
|
+
/** Enable DVR (rewind during live) */
|
|
86
|
+
dvr_enabled?: boolean;
|
|
87
|
+
/** Enable low-latency mode */
|
|
88
|
+
low_latency?: boolean;
|
|
89
|
+
/** Maximum allowed duration in seconds */
|
|
90
|
+
max_duration_seconds?: number;
|
|
91
|
+
/** Preferred ingest region (e.g., "us-east-1") */
|
|
92
|
+
region?: string;
|
|
93
|
+
/** Categorization tags */
|
|
94
|
+
tags?: string[];
|
|
95
|
+
/** Arbitrary key-value metadata */
|
|
96
|
+
metadata?: Metadata;
|
|
97
|
+
/** Webhook URL for stream lifecycle events */
|
|
98
|
+
webhook_url?: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Request body to update an existing stream
|
|
102
|
+
*/
|
|
103
|
+
export interface UpdateStreamRequest {
|
|
104
|
+
/** Updated title */
|
|
105
|
+
title?: string;
|
|
106
|
+
/** Updated description */
|
|
107
|
+
description?: string;
|
|
108
|
+
/** Toggle recording */
|
|
109
|
+
recording_enabled?: boolean;
|
|
110
|
+
/** Toggle DVR */
|
|
111
|
+
dvr_enabled?: boolean;
|
|
112
|
+
/** Toggle low-latency mode */
|
|
113
|
+
low_latency?: boolean;
|
|
114
|
+
/** Update metadata */
|
|
115
|
+
metadata?: Metadata;
|
|
116
|
+
/** Update tags */
|
|
117
|
+
tags?: string[];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Query parameters for listing streams
|
|
121
|
+
*/
|
|
122
|
+
export interface ListStreamsParams extends PaginationParams {
|
|
123
|
+
/** Filter by stream status */
|
|
124
|
+
status?: StreamStatus;
|
|
125
|
+
/** Filter by ingest protocol */
|
|
126
|
+
protocol?: StreamProtocol;
|
|
127
|
+
/** Filter streams created after this ISO 8601 timestamp */
|
|
128
|
+
created_after?: string;
|
|
129
|
+
/** Filter streams created before this ISO 8601 timestamp */
|
|
130
|
+
created_before?: string;
|
|
131
|
+
/** Field to order results by */
|
|
132
|
+
order_by?: "created_at" | "started_at" | "viewer_count" | "title";
|
|
133
|
+
/** Sort direction */
|
|
134
|
+
order?: "asc" | "desc";
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Real-time health metrics for a live stream
|
|
138
|
+
*/
|
|
139
|
+
export interface StreamHealth {
|
|
140
|
+
/** Stream this health report belongs to */
|
|
141
|
+
stream_id: string;
|
|
142
|
+
/** Overall health assessment */
|
|
143
|
+
status: "healthy" | "degraded" | "critical";
|
|
144
|
+
/** Current video bitrate in kbps */
|
|
145
|
+
bitrate_kbps: number;
|
|
146
|
+
/** Current frame rate in fps */
|
|
147
|
+
frame_rate: number;
|
|
148
|
+
/** Number of dropped frames since stream start */
|
|
149
|
+
dropped_frames: number;
|
|
150
|
+
/** End-to-end latency in milliseconds */
|
|
151
|
+
latency_ms: number;
|
|
152
|
+
/** Current viewer count */
|
|
153
|
+
viewer_count: number;
|
|
154
|
+
/** Seconds since the stream went live */
|
|
155
|
+
uptime_seconds: number;
|
|
156
|
+
/** ISO 8601 timestamp of the last received keyframe */
|
|
157
|
+
last_keyframe_at?: string;
|
|
158
|
+
/** Encoder software/hardware info reported by the source */
|
|
159
|
+
encoder_info?: string;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* A recording created from a live stream
|
|
163
|
+
*/
|
|
164
|
+
export interface StreamRecording extends Timestamps {
|
|
165
|
+
/** Unique recording identifier */
|
|
166
|
+
id: string;
|
|
167
|
+
/** Stream this recording was captured from */
|
|
168
|
+
stream_id: string;
|
|
169
|
+
/** Recording pipeline status */
|
|
170
|
+
status: "recording" | "processing" | "ready" | "failed";
|
|
171
|
+
/** Duration in seconds */
|
|
172
|
+
duration?: number;
|
|
173
|
+
/** File size in bytes */
|
|
174
|
+
file_size?: number;
|
|
175
|
+
/** URL to download the recording file */
|
|
176
|
+
download_url?: string;
|
|
177
|
+
/** URL for playback */
|
|
178
|
+
playback_url?: string;
|
|
179
|
+
/** Container format (e.g., "mp4", "ts") */
|
|
180
|
+
format?: string;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Ingest endpoint details for a stream
|
|
184
|
+
*/
|
|
185
|
+
export interface IngestEndpoint {
|
|
186
|
+
/** Protocol for this endpoint */
|
|
187
|
+
protocol: StreamProtocol;
|
|
188
|
+
/** Primary ingest URL */
|
|
189
|
+
url: string;
|
|
190
|
+
/** Stream key for authentication */
|
|
191
|
+
stream_key: string;
|
|
192
|
+
/** Region where this endpoint is located */
|
|
193
|
+
region: string;
|
|
194
|
+
/** Backup ingest URL for failover */
|
|
195
|
+
backup_url?: string;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* A single viewer session on a stream
|
|
199
|
+
*/
|
|
200
|
+
export interface ViewerSession {
|
|
201
|
+
/** Unique session identifier */
|
|
202
|
+
id: string;
|
|
203
|
+
/** Stream being watched */
|
|
204
|
+
stream_id: string;
|
|
205
|
+
/** Viewer's user or anonymous identifier */
|
|
206
|
+
viewer_id: string;
|
|
207
|
+
/** Playback protocol the viewer is using */
|
|
208
|
+
protocol: StreamProtocol;
|
|
209
|
+
/** Quality level the viewer is receiving */
|
|
210
|
+
quality: StreamQuality;
|
|
211
|
+
/** ISO 8601 timestamp when the viewer joined */
|
|
212
|
+
started_at: string;
|
|
213
|
+
/** Duration the viewer has been watching in seconds */
|
|
214
|
+
duration: number;
|
|
215
|
+
/** Viewer's geographic region */
|
|
216
|
+
region?: string;
|
|
217
|
+
/** Device type (e.g., "desktop", "mobile", "tv") */
|
|
218
|
+
device_type?: string;
|
|
219
|
+
/** Number of buffering events during this session */
|
|
220
|
+
buffering_events: number;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* A stream lifecycle or health event
|
|
224
|
+
*/
|
|
225
|
+
export interface StreamEvent {
|
|
226
|
+
/** Event type */
|
|
227
|
+
type: "stream.started" | "stream.ended" | "viewer.joined" | "viewer.left" | "health.degraded" | "recording.ready";
|
|
228
|
+
/** Stream this event relates to */
|
|
229
|
+
stream_id: string;
|
|
230
|
+
/** ISO 8601 timestamp when the event occurred */
|
|
231
|
+
timestamp: string;
|
|
232
|
+
/** Event-specific payload */
|
|
233
|
+
data?: Record<string, unknown>;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Pipeline API client
|
|
237
|
+
*
|
|
238
|
+
* All operations require appropriate permissions. Authorization is enforced
|
|
239
|
+
* server-side - the API returns 403 if the authenticated user lacks access.
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```typescript
|
|
243
|
+
* import { WaveClient } from '@wave/sdk';
|
|
244
|
+
* import { PipelineAPI } from '@wave/sdk/pipeline';
|
|
245
|
+
*
|
|
246
|
+
* const client = new WaveClient({ apiKey: 'your-api-key' });
|
|
247
|
+
* const pipeline = new PipelineAPI(client);
|
|
248
|
+
*
|
|
249
|
+
* // Create a stream
|
|
250
|
+
* const stream = await pipeline.create({
|
|
251
|
+
* title: 'My Live Stream',
|
|
252
|
+
* protocol: 'webrtc',
|
|
253
|
+
* recording_enabled: true,
|
|
254
|
+
* });
|
|
255
|
+
*
|
|
256
|
+
* // Start and wait for live
|
|
257
|
+
* await pipeline.start(stream.id);
|
|
258
|
+
* const live = await pipeline.waitForLive(stream.id);
|
|
259
|
+
* console.log('Stream is live:', live.playback_url);
|
|
260
|
+
*
|
|
261
|
+
* // Monitor health
|
|
262
|
+
* const health = await pipeline.getHealth(stream.id);
|
|
263
|
+
* console.log('Stream health:', health.status);
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
export declare class PipelineAPI {
|
|
267
|
+
private readonly client;
|
|
268
|
+
private readonly basePath;
|
|
269
|
+
constructor(client: WaveClient);
|
|
270
|
+
/**
|
|
271
|
+
* Create a new stream
|
|
272
|
+
*
|
|
273
|
+
* Requires: streams:create permission
|
|
274
|
+
*/
|
|
275
|
+
create(request: CreateStreamRequest): Promise<Stream>;
|
|
276
|
+
/**
|
|
277
|
+
* Get a stream by ID
|
|
278
|
+
*
|
|
279
|
+
* Requires: streams:read permission
|
|
280
|
+
*/
|
|
281
|
+
get(streamId: string): Promise<Stream>;
|
|
282
|
+
/**
|
|
283
|
+
* Update a stream
|
|
284
|
+
*
|
|
285
|
+
* Requires: streams:update permission
|
|
286
|
+
*/
|
|
287
|
+
update(streamId: string, request: UpdateStreamRequest): Promise<Stream>;
|
|
288
|
+
/**
|
|
289
|
+
* Remove a stream
|
|
290
|
+
*
|
|
291
|
+
* Requires: streams:remove permission (server-side RBAC enforced)
|
|
292
|
+
*/
|
|
293
|
+
remove(streamId: string): Promise<void>;
|
|
294
|
+
/**
|
|
295
|
+
* List streams with optional filters
|
|
296
|
+
*
|
|
297
|
+
* Requires: streams:read permission
|
|
298
|
+
*/
|
|
299
|
+
list(params?: ListStreamsParams): Promise<PaginatedResponse<Stream>>;
|
|
300
|
+
/**
|
|
301
|
+
* Start a stream
|
|
302
|
+
*
|
|
303
|
+
* Transitions the stream from idle to connecting. The stream will move
|
|
304
|
+
* to "live" once media is received on the ingest endpoint.
|
|
305
|
+
*
|
|
306
|
+
* Requires: streams:start permission
|
|
307
|
+
*/
|
|
308
|
+
start(streamId: string): Promise<Stream>;
|
|
309
|
+
/**
|
|
310
|
+
* Stop a stream
|
|
311
|
+
*
|
|
312
|
+
* Gracefully ends the stream. Any active recording will be finalized.
|
|
313
|
+
*
|
|
314
|
+
* Requires: streams:stop permission
|
|
315
|
+
*/
|
|
316
|
+
stop(streamId: string): Promise<Stream>;
|
|
317
|
+
/**
|
|
318
|
+
* Switch the ingest protocol for a live stream
|
|
319
|
+
*
|
|
320
|
+
* Performs a zero-downtime protocol switch. The stream will briefly
|
|
321
|
+
* enter "reconnecting" status during the transition.
|
|
322
|
+
*
|
|
323
|
+
* Requires: streams:update permission
|
|
324
|
+
*/
|
|
325
|
+
switchProtocol(streamId: string, protocol: StreamProtocol): Promise<Stream>;
|
|
326
|
+
/**
|
|
327
|
+
* Get real-time health metrics for a stream
|
|
328
|
+
*
|
|
329
|
+
* Returns current bitrate, frame rate, latency, and overall health status.
|
|
330
|
+
*
|
|
331
|
+
* Requires: streams:read permission
|
|
332
|
+
*/
|
|
333
|
+
getHealth(streamId: string): Promise<StreamHealth>;
|
|
334
|
+
/**
|
|
335
|
+
* Get ingest endpoints for a stream
|
|
336
|
+
*
|
|
337
|
+
* Returns primary and backup URLs for each configured protocol.
|
|
338
|
+
*
|
|
339
|
+
* Requires: streams:read permission
|
|
340
|
+
*/
|
|
341
|
+
getIngestEndpoints(streamId: string): Promise<IngestEndpoint[]>;
|
|
342
|
+
/**
|
|
343
|
+
* Start recording a live stream
|
|
344
|
+
*
|
|
345
|
+
* Begins capturing the stream to a file. The stream must be in "live" status.
|
|
346
|
+
*
|
|
347
|
+
* Requires: streams:record permission
|
|
348
|
+
*/
|
|
349
|
+
startRecording(streamId: string): Promise<StreamRecording>;
|
|
350
|
+
/**
|
|
351
|
+
* Stop recording a live stream
|
|
352
|
+
*
|
|
353
|
+
* Finalizes the current recording. The recording enters "processing" status
|
|
354
|
+
* while it is being packaged.
|
|
355
|
+
*
|
|
356
|
+
* Requires: streams:record permission
|
|
357
|
+
*/
|
|
358
|
+
stopRecording(streamId: string): Promise<StreamRecording>;
|
|
359
|
+
/**
|
|
360
|
+
* List recordings for a stream
|
|
361
|
+
*
|
|
362
|
+
* Requires: streams:read permission
|
|
363
|
+
*/
|
|
364
|
+
listRecordings(streamId: string, params?: PaginationParams): Promise<PaginatedResponse<StreamRecording>>;
|
|
365
|
+
/**
|
|
366
|
+
* Get a specific recording
|
|
367
|
+
*
|
|
368
|
+
* Requires: streams:read permission
|
|
369
|
+
*/
|
|
370
|
+
getRecording(streamId: string, recordingId: string): Promise<StreamRecording>;
|
|
371
|
+
/**
|
|
372
|
+
* List active viewer sessions for a stream
|
|
373
|
+
*
|
|
374
|
+
* Requires: streams:read permission
|
|
375
|
+
*/
|
|
376
|
+
listViewers(streamId: string, params?: PaginationParams): Promise<PaginatedResponse<ViewerSession>>;
|
|
377
|
+
/**
|
|
378
|
+
* Get current and peak viewer count for a stream
|
|
379
|
+
*
|
|
380
|
+
* Requires: streams:read permission
|
|
381
|
+
*/
|
|
382
|
+
getViewerCount(streamId: string): Promise<{
|
|
383
|
+
count: number;
|
|
384
|
+
peak: number;
|
|
385
|
+
}>;
|
|
386
|
+
/**
|
|
387
|
+
* Wait for a stream to reach "live" status
|
|
388
|
+
*
|
|
389
|
+
* Polls the stream until it transitions to "live" or a terminal state.
|
|
390
|
+
* Useful after calling `start()` to wait for the encoder to connect.
|
|
391
|
+
*
|
|
392
|
+
* @param streamId - Stream to monitor
|
|
393
|
+
* @param options - Polling configuration
|
|
394
|
+
* @param options.pollInterval - Milliseconds between polls (default: 2000)
|
|
395
|
+
* @param options.timeout - Maximum wait time in milliseconds (default: 120000)
|
|
396
|
+
* @param options.onProgress - Called on each poll with the current stream state
|
|
397
|
+
* @returns The stream once it reaches "live" status
|
|
398
|
+
* @throws Error if the stream enters "failed" or "ended" status, or if the timeout is exceeded
|
|
399
|
+
*/
|
|
400
|
+
waitForLive(streamId: string, options?: {
|
|
401
|
+
pollInterval?: number;
|
|
402
|
+
timeout?: number;
|
|
403
|
+
onProgress?: (stream: Stream) => void;
|
|
404
|
+
}): Promise<Stream>;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Create a Pipeline API instance
|
|
408
|
+
*/
|
|
409
|
+
export declare function createPipelineAPI(client: WaveClient): PipelineAPI;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACT,MAAM,UAAU,CAAC;AAMlB;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,YAAY,GACZ,MAAM,GACN,cAAc,GACd,QAAQ,GACR,OAAO,GACP,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,MAAM,cAAc,GAA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,OAAO,CAAC,eAAe,CAAC;IAI/D;;;;OAIG;IACG,cAAc,CAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;IAO9C;;;;OAIG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAUnF;;;;OAIG;IACG,WAAW,CACf,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;IAO5C;;;;OAIG;IACG,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAUhF;;;;;;;;;;;;;OAaG;IACG,WAAW,CACf,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QACR,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;KACvC,GACA,OAAO,CAAC,MAAM,CAAC;CA6BnB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,WAAW,CAEjE"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Podcast API
|
|
3
|
+
*
|
|
4
|
+
* Podcast production, episode management, and distribution.
|
|
5
|
+
*/
|
|
6
|
+
import type { WaveClient, PaginationParams, PaginatedResponse, Timestamps } from "./client";
|
|
7
|
+
export type EpisodeStatus = "draft" | "processing" | "published" | "scheduled" | "failed";
|
|
8
|
+
export type DistributionTarget = "spotify" | "apple" | "google" | "amazon" | "overcast";
|
|
9
|
+
export interface Podcast extends Timestamps {
|
|
10
|
+
id: string;
|
|
11
|
+
organization_id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
cover_art_url?: string;
|
|
15
|
+
rss_url?: string;
|
|
16
|
+
category: string;
|
|
17
|
+
language: string;
|
|
18
|
+
explicit: boolean;
|
|
19
|
+
author: string;
|
|
20
|
+
email?: string;
|
|
21
|
+
website?: string;
|
|
22
|
+
subscriber_count: number;
|
|
23
|
+
episode_count: number;
|
|
24
|
+
}
|
|
25
|
+
export interface Episode extends Timestamps {
|
|
26
|
+
id: string;
|
|
27
|
+
podcast_id: string;
|
|
28
|
+
title: string;
|
|
29
|
+
description: string;
|
|
30
|
+
status: EpisodeStatus;
|
|
31
|
+
audio_url?: string;
|
|
32
|
+
duration_seconds: number;
|
|
33
|
+
file_size_bytes: number;
|
|
34
|
+
season_number?: number;
|
|
35
|
+
episode_number?: number;
|
|
36
|
+
published_at?: string;
|
|
37
|
+
scheduled_at?: string;
|
|
38
|
+
tags?: string[];
|
|
39
|
+
}
|
|
40
|
+
export interface PodcastAnalytics {
|
|
41
|
+
podcast_id: string;
|
|
42
|
+
total_downloads: number;
|
|
43
|
+
unique_listeners: number;
|
|
44
|
+
average_listen_duration: number;
|
|
45
|
+
top_episodes: {
|
|
46
|
+
episode_id: string;
|
|
47
|
+
downloads: number;
|
|
48
|
+
}[];
|
|
49
|
+
listener_geography: {
|
|
50
|
+
country: string;
|
|
51
|
+
count: number;
|
|
52
|
+
}[];
|
|
53
|
+
}
|
|
54
|
+
export interface PodcastDistribution {
|
|
55
|
+
target: DistributionTarget;
|
|
56
|
+
status: "connected" | "pending" | "error";
|
|
57
|
+
url?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface CreatePodcastRequest {
|
|
60
|
+
title: string;
|
|
61
|
+
description: string;
|
|
62
|
+
category: string;
|
|
63
|
+
language?: string;
|
|
64
|
+
explicit?: boolean;
|
|
65
|
+
author?: string;
|
|
66
|
+
email?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface CreateEpisodeRequest {
|
|
69
|
+
podcast_id: string;
|
|
70
|
+
title: string;
|
|
71
|
+
description: string;
|
|
72
|
+
audio_url?: string;
|
|
73
|
+
season_number?: number;
|
|
74
|
+
episode_number?: number;
|
|
75
|
+
tags?: string[];
|
|
76
|
+
scheduled_at?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Podcast production, episode management, RSS feeds, and distribution.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* const podcast = await wave.podcast.create({ title: "My Show", description: "...", category: "Tech" });
|
|
84
|
+
* await wave.podcast.createEpisode({ podcast_id: podcast.id, title: "Ep 1", description: "..." });
|
|
85
|
+
* await wave.podcast.distribute(podcast.id, ["spotify", "apple"]);
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare class PodcastAPI {
|
|
89
|
+
private readonly client;
|
|
90
|
+
private readonly basePath;
|
|
91
|
+
constructor(client: WaveClient);
|
|
92
|
+
create(request: CreatePodcastRequest): Promise<Podcast>;
|
|
93
|
+
get(podcastId: string): Promise<Podcast>;
|
|
94
|
+
update(podcastId: string, updates: Partial<CreatePodcastRequest>): Promise<Podcast>;
|
|
95
|
+
remove(podcastId: string): Promise<void>;
|
|
96
|
+
list(params?: PaginationParams): Promise<PaginatedResponse<Podcast>>;
|
|
97
|
+
createEpisode(request: CreateEpisodeRequest): Promise<Episode>;
|
|
98
|
+
getEpisode(episodeId: string): Promise<Episode>;
|
|
99
|
+
updateEpisode(episodeId: string, updates: Partial<CreateEpisodeRequest>): Promise<Episode>;
|
|
100
|
+
removeEpisode(episodeId: string): Promise<void>;
|
|
101
|
+
publishEpisode(episodeId: string): Promise<Episode>;
|
|
102
|
+
listEpisodes(podcastId: string, params?: PaginationParams): Promise<PaginatedResponse<Episode>>;
|
|
103
|
+
getRSSFeed(podcastId: string): Promise<{
|
|
104
|
+
url: string;
|
|
105
|
+
xml: string;
|
|
106
|
+
}>;
|
|
107
|
+
getAnalytics(podcastId: string, params?: {
|
|
108
|
+
period?: string;
|
|
109
|
+
}): Promise<PodcastAnalytics>;
|
|
110
|
+
distribute(podcastId: string, targets: DistributionTarget[]): Promise<PodcastDistribution[]>;
|
|
111
|
+
getDistributionStatus(podcastId: string): Promise<PodcastDistribution[]>;
|
|
112
|
+
}
|
|
113
|
+
export declare function createPodcastAPI(client: WaveClient): PodcastAPI;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"podcast.d.ts","sourceRoot":"","sources":["../src/podcast.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE5F,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,YAAY,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;AAC1F,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAExF,MAAM,WAAW,OAAQ,SAAQ,UAAU;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB;AACD,MAAM,WAAW,OAAQ,SAAQ,UAAU;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,UAA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E,MAAM,EACjB,MAAM,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAKhC,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAGpE,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAKxF,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,kBAAkB,EAAE,GAC5B,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAK3B,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAG/E;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAE/D"}
|
package/dist/prism.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Prism API
|
|
3
|
+
*
|
|
4
|
+
* Virtual Device Bridge - present network AV sources (NDI, ONVIF, VISCA, Dante)
|
|
5
|
+
* as standard USB UVC/UAC devices to conferencing apps.
|
|
6
|
+
*/
|
|
7
|
+
import type { WaveClient, PaginationParams, PaginatedResponse, Timestamps } from "./client";
|
|
8
|
+
export type VirtualDeviceType = "camera" | "microphone";
|
|
9
|
+
export type DeviceStatus = "created" | "starting" | "running" | "stopping" | "stopped" | "error";
|
|
10
|
+
export type SourceProtocol = "ndi" | "onvif" | "srt" | "rtmp" | "webrtc" | "dante" | "cloudflare" | "livekit";
|
|
11
|
+
export type PTZProtocol = "ndi" | "onvif" | "visca" | "pelcod" | "cgi" | "livekit";
|
|
12
|
+
export interface VirtualDevice extends Timestamps {
|
|
13
|
+
id: string;
|
|
14
|
+
organization_id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
type: VirtualDeviceType;
|
|
17
|
+
status: DeviceStatus;
|
|
18
|
+
source_protocol: SourceProtocol;
|
|
19
|
+
source_endpoint: string;
|
|
20
|
+
node_id: string;
|
|
21
|
+
resolution?: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
frame_rate?: number;
|
|
26
|
+
health_score: number;
|
|
27
|
+
ptz_enabled: boolean;
|
|
28
|
+
ptz_protocol?: PTZProtocol;
|
|
29
|
+
}
|
|
30
|
+
export interface PresetMapping extends Timestamps {
|
|
31
|
+
id: string;
|
|
32
|
+
device_id: string;
|
|
33
|
+
slot_number: number;
|
|
34
|
+
preset_name: string;
|
|
35
|
+
preset_token: string;
|
|
36
|
+
protocol: PTZProtocol;
|
|
37
|
+
transition_speed: number;
|
|
38
|
+
}
|
|
39
|
+
export interface DeviceHealth {
|
|
40
|
+
device_id: string;
|
|
41
|
+
status: "healthy" | "degraded" | "critical" | "offline";
|
|
42
|
+
latency_ms: number;
|
|
43
|
+
dropped_frames: number;
|
|
44
|
+
fps: number;
|
|
45
|
+
cpu_usage: number;
|
|
46
|
+
source_connected: boolean;
|
|
47
|
+
driver_connected: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface DiscoveredSource {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
protocol: string;
|
|
53
|
+
address: string;
|
|
54
|
+
supports_ptz: boolean;
|
|
55
|
+
capabilities: string[];
|
|
56
|
+
discovered_at: string;
|
|
57
|
+
}
|
|
58
|
+
export interface CreateDeviceRequest {
|
|
59
|
+
name: string;
|
|
60
|
+
type: VirtualDeviceType;
|
|
61
|
+
source_protocol: SourceProtocol;
|
|
62
|
+
source_endpoint: string;
|
|
63
|
+
node_id: string;
|
|
64
|
+
resolution?: {
|
|
65
|
+
width: number;
|
|
66
|
+
height: number;
|
|
67
|
+
};
|
|
68
|
+
frame_rate?: number;
|
|
69
|
+
ptz_enabled?: boolean;
|
|
70
|
+
ptz_protocol?: PTZProtocol;
|
|
71
|
+
metadata?: Record<string, unknown>;
|
|
72
|
+
}
|
|
73
|
+
export interface UpdateDeviceRequest {
|
|
74
|
+
name?: string;
|
|
75
|
+
source_endpoint?: string;
|
|
76
|
+
resolution?: {
|
|
77
|
+
width: number;
|
|
78
|
+
height: number;
|
|
79
|
+
};
|
|
80
|
+
frame_rate?: number;
|
|
81
|
+
metadata?: Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
export interface SetPresetRequest {
|
|
84
|
+
slot_number: number;
|
|
85
|
+
preset_name: string;
|
|
86
|
+
preset_token: string;
|
|
87
|
+
protocol: PTZProtocol;
|
|
88
|
+
transition_speed?: number;
|
|
89
|
+
}
|
|
90
|
+
export interface ListDevicesParams extends PaginationParams {
|
|
91
|
+
type?: VirtualDeviceType;
|
|
92
|
+
status?: DeviceStatus;
|
|
93
|
+
node_id?: string;
|
|
94
|
+
source_protocol?: SourceProtocol;
|
|
95
|
+
order_by?: string;
|
|
96
|
+
order?: "asc" | "desc";
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Virtual Device Bridge - present network AV sources (NDI, ONVIF, VISCA, Dante)
|
|
100
|
+
* as standard USB UVC/UAC devices to conferencing apps (Zoom, Teams, Meet).
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* const device = await wave.prism.createDevice({ name: 'PTZ Cam', type: 'camera', source_protocol: 'ndi', source_endpoint: 'NDI-1', node_id: 'node_abc' });
|
|
105
|
+
* await wave.prism.startDevice(device.id);
|
|
106
|
+
* await wave.prism.setPreset(device.id, { slot_number: 1, preset_name: 'Wide', preset_token: 'p1', protocol: 'ndi' });
|
|
107
|
+
* const sources = await wave.prism.discoverSources({ protocols: ['ndi', 'onvif'] });
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export declare class PrismAPI {
|
|
111
|
+
private readonly client;
|
|
112
|
+
private readonly basePath;
|
|
113
|
+
constructor(client: WaveClient);
|
|
114
|
+
createDevice(request: CreateDeviceRequest): Promise<VirtualDevice>;
|
|
115
|
+
getDevice(deviceId: string): Promise<VirtualDevice>;
|
|
116
|
+
updateDevice(deviceId: string, request: UpdateDeviceRequest): Promise<VirtualDevice>;
|
|
117
|
+
removeDevice(deviceId: string): Promise<void>;
|
|
118
|
+
listDevices(params?: ListDevicesParams): Promise<PaginatedResponse<VirtualDevice>>;
|
|
119
|
+
startDevice(deviceId: string): Promise<VirtualDevice>;
|
|
120
|
+
stopDevice(deviceId: string): Promise<VirtualDevice>;
|
|
121
|
+
getHealth(deviceId: string): Promise<DeviceHealth>;
|
|
122
|
+
discoverSources(options?: {
|
|
123
|
+
protocols?: string[];
|
|
124
|
+
subnet?: string;
|
|
125
|
+
timeout?: number;
|
|
126
|
+
}): Promise<DiscoveredSource[]>;
|
|
127
|
+
getPresets(deviceId: string): Promise<PresetMapping[]>;
|
|
128
|
+
setPreset(deviceId: string, request: SetPresetRequest): Promise<PresetMapping>;
|
|
129
|
+
removePreset(deviceId: string, slotNumber: number): Promise<void>;
|
|
130
|
+
recallPreset(deviceId: string, slotNumber: number): Promise<void>;
|
|
131
|
+
}
|
|
132
|
+
export declare function createPrismAPI(client: WaveClient): PrismAPI;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prism.d.ts","sourceRoot":"","sources":["../src/prism.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAM5F,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,YAAY,CAAC;AACxD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;AACjG,MAAM,MAAM,cAAc,GACtB,KAAK,GACL,OAAO,GACP,KAAK,GACL,MAAM,GACN,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