@wave-av/sdk 2.0.3 → 2.0.5
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/CHANGELOG.md +9 -50
- package/dist/audience.d.ts +105 -0
- package/dist/audience.d.ts.map +1 -0
- package/dist/billing-types.d.ts +39 -0
- package/dist/billing-types.d.ts.map +1 -0
- package/dist/billing-types.js +18 -0
- package/dist/billing-types.mjs +0 -0
- package/dist/billing.d.ts +69 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +139 -0
- package/dist/billing.mjs +9 -0
- package/dist/camera-control.d.ts +55 -0
- package/dist/camera-control.d.ts.map +1 -0
- package/dist/captions-types.d.ts +119 -0
- package/dist/captions-types.d.ts.map +1 -0
- package/dist/captions.d.ts +218 -0
- package/dist/captions.d.ts.map +1 -0
- package/dist/chapters-types.d.ts +87 -0
- package/dist/chapters-types.d.ts.map +1 -0
- package/dist/chapters.d.ts +207 -0
- package/dist/chapters.d.ts.map +1 -0
- package/dist/chunk-I3V47I4W.mjs +114 -0
- package/dist/client-types.d.ts +59 -0
- package/dist/client-types.d.ts.map +1 -0
- package/dist/client.d.ts +119 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/clips-types.d.ts +31 -0
- package/dist/clips-types.d.ts.map +1 -0
- package/dist/clips.d.ts +230 -0
- package/dist/clips.d.ts.map +1 -0
- package/dist/cloud-switcher.d.ts +66 -0
- package/dist/cloud-switcher.d.ts.map +1 -0
- package/dist/collab-types.d.ts +205 -0
- package/dist/collab-types.d.ts.map +1 -0
- package/dist/collab.d.ts +227 -0
- package/dist/collab.d.ts.map +1 -0
- package/dist/connect.d.ts +89 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/creator.d.ts +110 -0
- package/dist/creator.d.ts.map +1 -0
- package/dist/desktop.d.ts +96 -0
- package/dist/desktop.d.ts.map +1 -0
- package/dist/distribution.d.ts +93 -0
- package/dist/distribution.d.ts.map +1 -0
- package/dist/drm.d.ts +88 -0
- package/dist/drm.d.ts.map +1 -0
- package/dist/edge.d.ts +113 -0
- package/dist/edge.d.ts.map +1 -0
- package/dist/editor-types.d.ts +237 -0
- package/dist/editor-types.d.ts.map +1 -0
- package/dist/editor.d.ts +207 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/fleet.d.ts +208 -0
- package/dist/fleet.d.ts.map +1 -0
- package/dist/ghost.d.ts +214 -0
- package/dist/ghost.d.ts.map +1 -0
- package/dist/index.d.ts +131 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +114 -0
- package/dist/index.mjs +49 -43
- package/dist/marketplace.d.ts +91 -0
- package/dist/marketplace.d.ts.map +1 -0
- package/dist/mesh.d.ts +238 -0
- package/dist/mesh.d.ts.map +1 -0
- package/dist/notifications.d.ts +83 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/phone-types.d.ts +111 -0
- package/dist/phone-types.d.ts.map +1 -0
- package/dist/phone.d.ts +235 -0
- package/dist/phone.d.ts.map +1 -0
- package/dist/pipeline-types.d.ts +188 -0
- package/dist/pipeline-types.d.ts.map +1 -0
- package/dist/pipeline.d.ts +224 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/podcast.d.ts +114 -0
- package/dist/podcast.d.ts.map +1 -0
- package/dist/prism.d.ts +133 -0
- package/dist/prism.d.ts.map +1 -0
- package/dist/prompter.d.ts +185 -0
- package/dist/prompter.d.ts.map +1 -0
- package/dist/pulse.d.ts +157 -0
- package/dist/pulse.d.ts.map +1 -0
- package/dist/qr.d.ts +83 -0
- package/dist/qr.d.ts.map +1 -0
- package/dist/replay.d.ts +53 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/scene-types.d.ts +191 -0
- package/dist/scene-types.d.ts.map +1 -0
- package/dist/scene.d.ts +214 -0
- package/dist/scene.d.ts.map +1 -0
- package/dist/search-types.d.ts +211 -0
- package/dist/search-types.d.ts.map +1 -0
- package/dist/search.d.ts +251 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/sentiment-types.d.ts +108 -0
- package/dist/sentiment-types.d.ts.map +1 -0
- package/dist/sentiment.d.ts +247 -0
- package/dist/sentiment.d.ts.map +1 -0
- package/dist/signage.d.ts +102 -0
- package/dist/signage.d.ts.map +1 -0
- package/dist/slides.d.ts +69 -0
- package/dist/slides.d.ts.map +1 -0
- package/dist/studio-ai-types.d.ts +199 -0
- package/dist/studio-ai-types.d.ts.map +1 -0
- package/dist/studio-ai.d.ts +219 -0
- package/dist/studio-ai.d.ts.map +1 -0
- package/dist/studio-types.d.ts +268 -0
- package/dist/studio-types.d.ts.map +1 -0
- package/dist/studio.d.ts +235 -0
- package/dist/studio.d.ts.map +1 -0
- package/dist/telemetry.d.ts +77 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/transcribe-types.d.ts +154 -0
- package/dist/transcribe-types.d.ts.map +1 -0
- package/dist/transcribe.d.ts +219 -0
- package/dist/transcribe.d.ts.map +1 -0
- package/dist/usb.d.ts +65 -0
- package/dist/usb.d.ts.map +1 -0
- package/dist/vault.d.ts +122 -0
- package/dist/vault.d.ts.map +1 -0
- package/dist/voice-types.d.ts +107 -0
- package/dist/voice-types.d.ts.map +1 -0
- package/dist/voice.d.ts +178 -0
- package/dist/voice.d.ts.map +1 -0
- package/dist/zoom.d.ts +92 -0
- package/dist/zoom.d.ts.map +1 -0
- package/package.json +86 -86
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Studio API
|
|
3
|
+
*
|
|
4
|
+
* Multi-camera broadcast production system for creating, managing, and
|
|
5
|
+
* controlling live productions with sources, scenes, graphics, and audio mixing.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This is a client SDK. All authorization checks are performed server-side.
|
|
8
|
+
* The API will return 403 Forbidden if the user lacks required permissions.
|
|
9
|
+
*/
|
|
10
|
+
import type { PaginationParams, Timestamps, Metadata } from "./client";
|
|
11
|
+
/**
|
|
12
|
+
* Production lifecycle status
|
|
13
|
+
*/
|
|
14
|
+
export type ProductionStatus = "idle" | "rehearsal" | "live" | "ending" | "ended";
|
|
15
|
+
/**
|
|
16
|
+
* Input source type for a production
|
|
17
|
+
*/
|
|
18
|
+
export type SourceType = "camera" | "ndi" | "screen_share" | "rtmp_input" | "srt_input" | "media_file" | "browser" | "color_bars";
|
|
19
|
+
/**
|
|
20
|
+
* Video transition type between sources or scenes
|
|
21
|
+
*/
|
|
22
|
+
export type TransitionType = "cut" | "dissolve" | "wipe" | "fade" | "stinger";
|
|
23
|
+
/**
|
|
24
|
+
* Scene layout preset
|
|
25
|
+
*/
|
|
26
|
+
export type LayoutType = "fullscreen" | "split_2" | "split_3" | "split_4" | "pip" | "side_by_side" | "grid_2x2" | "grid_3x3" | "custom";
|
|
27
|
+
/**
|
|
28
|
+
* Transition configuration for scene or source changes
|
|
29
|
+
*/
|
|
30
|
+
export interface TransitionConfig {
|
|
31
|
+
/** Transition effect type */
|
|
32
|
+
type: TransitionType;
|
|
33
|
+
/** Duration in milliseconds */
|
|
34
|
+
duration_ms: number;
|
|
35
|
+
/** Direction for directional transitions (e.g., wipe) */
|
|
36
|
+
direction?: "left" | "right" | "up" | "down";
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Position and crop settings for a source within a scene
|
|
40
|
+
*/
|
|
41
|
+
export interface SceneSource {
|
|
42
|
+
/** Reference to the source */
|
|
43
|
+
source_id: string;
|
|
44
|
+
/** Position and dimensions within the scene canvas */
|
|
45
|
+
position: {
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
z_index: number;
|
|
51
|
+
};
|
|
52
|
+
/** Crop region (normalized 0-1 values) */
|
|
53
|
+
crop?: {
|
|
54
|
+
top: number;
|
|
55
|
+
right: number;
|
|
56
|
+
bottom: number;
|
|
57
|
+
left: number;
|
|
58
|
+
};
|
|
59
|
+
/** Whether audio from this source is enabled */
|
|
60
|
+
audio_enabled?: boolean;
|
|
61
|
+
/** Audio volume (0-1) */
|
|
62
|
+
volume?: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Production scene with layout and source arrangement
|
|
66
|
+
*/
|
|
67
|
+
export interface Scene extends Timestamps {
|
|
68
|
+
id: string;
|
|
69
|
+
production_id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
/** Layout preset for this scene */
|
|
72
|
+
layout: LayoutType;
|
|
73
|
+
/** Sources arranged within this scene */
|
|
74
|
+
sources: SceneSource[];
|
|
75
|
+
/** Transition to use when activating this scene */
|
|
76
|
+
transition_in?: TransitionConfig;
|
|
77
|
+
/** Whether this scene is currently active */
|
|
78
|
+
is_active: boolean;
|
|
79
|
+
/** Display order */
|
|
80
|
+
sort_order: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Input source connected to a production
|
|
84
|
+
*/
|
|
85
|
+
export interface Source extends Timestamps {
|
|
86
|
+
id: string;
|
|
87
|
+
production_id: string;
|
|
88
|
+
name: string;
|
|
89
|
+
/** Input source type */
|
|
90
|
+
type: SourceType;
|
|
91
|
+
/** Source URL or connection string */
|
|
92
|
+
url?: string;
|
|
93
|
+
/** Connection status */
|
|
94
|
+
status: "connected" | "disconnected" | "error";
|
|
95
|
+
/** Tally indicator (program = live, preview = next, off = inactive) */
|
|
96
|
+
tally: "program" | "preview" | "off";
|
|
97
|
+
/** Current audio level in dBFS */
|
|
98
|
+
audio_level?: number;
|
|
99
|
+
/** Audio volume (0-1) */
|
|
100
|
+
volume?: number;
|
|
101
|
+
/** Whether the source audio is muted */
|
|
102
|
+
muted?: boolean;
|
|
103
|
+
/** Whether PTZ (pan-tilt-zoom) control is enabled */
|
|
104
|
+
ptz_enabled?: boolean;
|
|
105
|
+
/** Position information for PTZ cameras */
|
|
106
|
+
position?: {
|
|
107
|
+
pan: number;
|
|
108
|
+
tilt: number;
|
|
109
|
+
zoom: number;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Live production session
|
|
114
|
+
*/
|
|
115
|
+
export interface Production extends Timestamps {
|
|
116
|
+
id: string;
|
|
117
|
+
organization_id: string;
|
|
118
|
+
title: string;
|
|
119
|
+
description?: string;
|
|
120
|
+
/** Current production lifecycle status */
|
|
121
|
+
status: ProductionStatus;
|
|
122
|
+
/** Source currently on program (live) output */
|
|
123
|
+
program_source_id?: string;
|
|
124
|
+
/** Source currently on preview output */
|
|
125
|
+
preview_source_id?: string;
|
|
126
|
+
/** Currently active scene */
|
|
127
|
+
active_scene_id?: string;
|
|
128
|
+
/** Whether recording is enabled */
|
|
129
|
+
recording_enabled: boolean;
|
|
130
|
+
/** Whether live streaming output is enabled */
|
|
131
|
+
streaming_enabled: boolean;
|
|
132
|
+
/** Current number of viewers */
|
|
133
|
+
viewer_count: number;
|
|
134
|
+
/** When the production went live */
|
|
135
|
+
started_at?: string;
|
|
136
|
+
/** When the production ended */
|
|
137
|
+
ended_at?: string;
|
|
138
|
+
/** Tags for organization and search */
|
|
139
|
+
tags?: string[];
|
|
140
|
+
/** Custom metadata */
|
|
141
|
+
metadata?: Metadata;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Graphic overlay element
|
|
145
|
+
*/
|
|
146
|
+
export interface Graphic extends Timestamps {
|
|
147
|
+
id: string;
|
|
148
|
+
production_id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
/** Graphic overlay type */
|
|
151
|
+
type: "lower_third" | "full_screen" | "logo" | "ticker" | "scoreboard" | "custom";
|
|
152
|
+
/** Graphic content (template data, text, image URL, etc.) */
|
|
153
|
+
content: Record<string, unknown>;
|
|
154
|
+
/** Position on the canvas */
|
|
155
|
+
position?: {
|
|
156
|
+
x: number;
|
|
157
|
+
y: number;
|
|
158
|
+
width: number;
|
|
159
|
+
height: number;
|
|
160
|
+
};
|
|
161
|
+
/** Whether the graphic is currently visible on output */
|
|
162
|
+
visible: boolean;
|
|
163
|
+
/** Render layer (higher = on top) */
|
|
164
|
+
layer: number;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Audio mix channel for a source
|
|
168
|
+
*/
|
|
169
|
+
export interface AudioMixChannel {
|
|
170
|
+
/** Source this channel controls */
|
|
171
|
+
source_id: string;
|
|
172
|
+
/** Volume level (0-1) */
|
|
173
|
+
volume: number;
|
|
174
|
+
/** Whether the channel is muted */
|
|
175
|
+
muted: boolean;
|
|
176
|
+
/** Whether the channel is soloed */
|
|
177
|
+
solo: boolean;
|
|
178
|
+
/** Stereo pan (-1 left to 1 right) */
|
|
179
|
+
pan: number;
|
|
180
|
+
/** Whether EQ is enabled */
|
|
181
|
+
eq_enabled: boolean;
|
|
182
|
+
/** Whether the compressor is enabled */
|
|
183
|
+
compressor_enabled: boolean;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Create production request
|
|
187
|
+
*/
|
|
188
|
+
export interface CreateProductionRequest {
|
|
189
|
+
title: string;
|
|
190
|
+
description?: string;
|
|
191
|
+
/** Enable recording when going live */
|
|
192
|
+
recording_enabled?: boolean;
|
|
193
|
+
/** Enable live streaming output */
|
|
194
|
+
streaming_enabled?: boolean;
|
|
195
|
+
/** Default layout for new scenes */
|
|
196
|
+
default_layout?: LayoutType;
|
|
197
|
+
/** Tags for organization and search */
|
|
198
|
+
tags?: string[];
|
|
199
|
+
/** Custom metadata */
|
|
200
|
+
metadata?: Metadata;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Update production request
|
|
204
|
+
*/
|
|
205
|
+
export interface UpdateProductionRequest {
|
|
206
|
+
title?: string;
|
|
207
|
+
description?: string;
|
|
208
|
+
/** Enable or disable recording */
|
|
209
|
+
recording_enabled?: boolean;
|
|
210
|
+
/** Enable or disable live streaming output */
|
|
211
|
+
streaming_enabled?: boolean;
|
|
212
|
+
/** Custom metadata */
|
|
213
|
+
metadata?: Metadata;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* List productions filters
|
|
217
|
+
*/
|
|
218
|
+
export interface ListProductionsParams extends PaginationParams {
|
|
219
|
+
/** Filter by production status */
|
|
220
|
+
status?: ProductionStatus;
|
|
221
|
+
/** Filter productions created after this date (ISO 8601) */
|
|
222
|
+
created_after?: string;
|
|
223
|
+
/** Filter productions created before this date (ISO 8601) */
|
|
224
|
+
created_before?: string;
|
|
225
|
+
/** Field to order results by */
|
|
226
|
+
order_by?: "created_at" | "updated_at" | "title" | "started_at";
|
|
227
|
+
/** Sort direction */
|
|
228
|
+
order?: "asc" | "desc";
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Studio API client for multi-camera broadcast production
|
|
232
|
+
*
|
|
233
|
+
* All operations require appropriate permissions. Authorization is enforced
|
|
234
|
+
* server-side - the API returns 403 if the authenticated user lacks access.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```typescript
|
|
238
|
+
* import { WaveClient } from '@wave/sdk';
|
|
239
|
+
* import { StudioAPI } from '@wave/sdk/studio';
|
|
240
|
+
*
|
|
241
|
+
* const client = new WaveClient({ apiKey: 'your-api-key' });
|
|
242
|
+
* const studio = new StudioAPI(client);
|
|
243
|
+
*
|
|
244
|
+
* // Create a production
|
|
245
|
+
* const production = await studio.create({
|
|
246
|
+
* title: 'Live Show',
|
|
247
|
+
* recording_enabled: true,
|
|
248
|
+
* streaming_enabled: true,
|
|
249
|
+
* });
|
|
250
|
+
*
|
|
251
|
+
* // Add a camera source
|
|
252
|
+
* const camera = await studio.addSource(production.id, {
|
|
253
|
+
* name: 'Camera 1',
|
|
254
|
+
* type: 'camera',
|
|
255
|
+
* url: 'rtmp://ingest.wave.online/live/cam1',
|
|
256
|
+
* });
|
|
257
|
+
*
|
|
258
|
+
* // Go live
|
|
259
|
+
* await studio.start(production.id);
|
|
260
|
+
*
|
|
261
|
+
* // Switch program source with a dissolve
|
|
262
|
+
* await studio.setProgram(production.id, camera.id, {
|
|
263
|
+
* type: 'dissolve',
|
|
264
|
+
* duration_ms: 500,
|
|
265
|
+
* });
|
|
266
|
+
* ```
|
|
267
|
+
*/
|
|
268
|
+
//# sourceMappingURL=studio-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"studio-types.d.ts","sourceRoot":"","sources":["../src/studio-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACT,MAAM,UAAU,CAAC;AAOlB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElF;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,KAAK,GACL,cAAc,GACd,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,SAAS,GACT,YAAY,CAAC;AAEjB;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,YAAY,GACZ,SAAS,GACT,SAAS,GACT,SAAS,GACT,KAAK,GACL,cAAc,GACd,UAAU,GACV,UAAU,GACV,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6BAA6B;IAC7B,IAAI,EAAE,cAAc,CAAC;IACrB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,QAAQ,EAAE;QACR,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAA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AAE,QAAQ,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,kCAAkC;IAClC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,YAAY,GAAG,YAAY,GAAG,OAAO,GAAG,YAAY,CAAC;IAChE,qBAAqB;IACrB,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG"}
|
package/dist/studio.d.ts
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Studio API
|
|
3
|
+
*
|
|
4
|
+
* Multi-camera broadcast production system for creating, managing, and
|
|
5
|
+
* controlling live productions with sources, scenes, graphics, and audio mixing.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This is a client SDK. All authorization checks are performed server-side.
|
|
8
|
+
* The API will return 403 Forbidden if the user lacks required permissions.
|
|
9
|
+
*/
|
|
10
|
+
import type { WaveClient, PaginatedResponse } from "./client";
|
|
11
|
+
export * from './studio-types';
|
|
12
|
+
import type { AudioMixChannel, CreateProductionRequest, Graphic, LayoutType, ListProductionsParams, Production, Scene, SceneSource, Source, SourceType, TransitionConfig, UpdateProductionRequest } from './studio-types';
|
|
13
|
+
export declare class StudioAPI {
|
|
14
|
+
private readonly client;
|
|
15
|
+
private readonly basePath;
|
|
16
|
+
constructor(client: WaveClient);
|
|
17
|
+
/**
|
|
18
|
+
* Create a new production
|
|
19
|
+
*
|
|
20
|
+
* Requires: productions:create permission
|
|
21
|
+
*/
|
|
22
|
+
create(request: CreateProductionRequest): Promise<Production>;
|
|
23
|
+
/**
|
|
24
|
+
* Get a production by ID
|
|
25
|
+
*
|
|
26
|
+
* Requires: productions:read permission
|
|
27
|
+
*/
|
|
28
|
+
get(productionId: string): Promise<Production>;
|
|
29
|
+
/**
|
|
30
|
+
* Update a production
|
|
31
|
+
*
|
|
32
|
+
* Requires: productions:update permission
|
|
33
|
+
*/
|
|
34
|
+
update(productionId: string, request: UpdateProductionRequest): Promise<Production>;
|
|
35
|
+
/**
|
|
36
|
+
* Remove a production
|
|
37
|
+
*
|
|
38
|
+
* Requires: productions:remove permission (server-side RBAC enforced)
|
|
39
|
+
*/
|
|
40
|
+
remove(productionId: string): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* List productions with optional filters
|
|
43
|
+
*
|
|
44
|
+
* Requires: productions:read permission
|
|
45
|
+
*/
|
|
46
|
+
list(params?: ListProductionsParams): Promise<PaginatedResponse<Production>>;
|
|
47
|
+
/**
|
|
48
|
+
* Start a production (go live)
|
|
49
|
+
*
|
|
50
|
+
* Transitions the production from 'idle' or 'rehearsal' to 'live'.
|
|
51
|
+
*
|
|
52
|
+
* Requires: productions:control permission
|
|
53
|
+
*/
|
|
54
|
+
start(productionId: string): Promise<Production>;
|
|
55
|
+
/**
|
|
56
|
+
* Stop a production (end broadcast)
|
|
57
|
+
*
|
|
58
|
+
* Transitions the production to 'ending' and then 'ended'.
|
|
59
|
+
*
|
|
60
|
+
* Requires: productions:control permission
|
|
61
|
+
*/
|
|
62
|
+
stop(productionId: string): Promise<Production>;
|
|
63
|
+
/**
|
|
64
|
+
* Start a rehearsal session
|
|
65
|
+
*
|
|
66
|
+
* Allows testing sources, scenes, and transitions without going live.
|
|
67
|
+
* Transitions the production from 'idle' to 'rehearsal'.
|
|
68
|
+
*
|
|
69
|
+
* Requires: productions:control permission
|
|
70
|
+
*/
|
|
71
|
+
startRehearsal(productionId: string): Promise<Production>;
|
|
72
|
+
/**
|
|
73
|
+
* Add an input source to a production
|
|
74
|
+
*
|
|
75
|
+
* Requires: productions:sources:create permission
|
|
76
|
+
*/
|
|
77
|
+
addSource(productionId: string, source: {
|
|
78
|
+
name: string;
|
|
79
|
+
type: SourceType;
|
|
80
|
+
url?: string;
|
|
81
|
+
ptz_enabled?: boolean;
|
|
82
|
+
}): Promise<Source>;
|
|
83
|
+
/**
|
|
84
|
+
* Remove a source from a production
|
|
85
|
+
*
|
|
86
|
+
* Requires: productions:sources:remove permission
|
|
87
|
+
*/
|
|
88
|
+
removeSource(productionId: string, sourceId: string): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* List all sources for a production
|
|
91
|
+
*
|
|
92
|
+
* Requires: productions:sources:read permission
|
|
93
|
+
*/
|
|
94
|
+
listSources(productionId: string): Promise<Source[]>;
|
|
95
|
+
/**
|
|
96
|
+
* Get a specific source by ID
|
|
97
|
+
*
|
|
98
|
+
* Requires: productions:sources:read permission
|
|
99
|
+
*/
|
|
100
|
+
getSource(productionId: string, sourceId: string): Promise<Source>;
|
|
101
|
+
/**
|
|
102
|
+
* Create a new scene in a production
|
|
103
|
+
*
|
|
104
|
+
* Requires: productions:scenes:create permission
|
|
105
|
+
*/
|
|
106
|
+
createScene(productionId: string, scene: {
|
|
107
|
+
name: string;
|
|
108
|
+
layout: LayoutType;
|
|
109
|
+
sources?: SceneSource[];
|
|
110
|
+
transition_in?: TransitionConfig;
|
|
111
|
+
}): Promise<Scene>;
|
|
112
|
+
/**
|
|
113
|
+
* Update an existing scene
|
|
114
|
+
*
|
|
115
|
+
* Requires: productions:scenes:update permission
|
|
116
|
+
*/
|
|
117
|
+
updateScene(productionId: string, sceneId: string, updates: Partial<{
|
|
118
|
+
name: string;
|
|
119
|
+
layout: LayoutType;
|
|
120
|
+
sources: SceneSource[];
|
|
121
|
+
transition_in: TransitionConfig;
|
|
122
|
+
sort_order: number;
|
|
123
|
+
}>): Promise<Scene>;
|
|
124
|
+
/**
|
|
125
|
+
* Remove a scene from a production
|
|
126
|
+
*
|
|
127
|
+
* Requires: productions:scenes:remove permission
|
|
128
|
+
*/
|
|
129
|
+
removeScene(productionId: string, sceneId: string): Promise<void>;
|
|
130
|
+
/**
|
|
131
|
+
* List all scenes for a production
|
|
132
|
+
*
|
|
133
|
+
* Requires: productions:scenes:read permission
|
|
134
|
+
*/
|
|
135
|
+
listScenes(productionId: string): Promise<Scene[]>;
|
|
136
|
+
/**
|
|
137
|
+
* Activate a scene with an optional transition
|
|
138
|
+
*
|
|
139
|
+
* Sets the scene as the active scene for the production output.
|
|
140
|
+
*
|
|
141
|
+
* Requires: productions:scenes:control permission
|
|
142
|
+
*/
|
|
143
|
+
activateScene(productionId: string, sceneId: string, transition?: TransitionConfig): Promise<Scene>;
|
|
144
|
+
/**
|
|
145
|
+
* Set the program (live) source with an optional transition
|
|
146
|
+
*
|
|
147
|
+
* Switches the currently live output to the specified source.
|
|
148
|
+
*
|
|
149
|
+
* Requires: productions:control permission
|
|
150
|
+
*/
|
|
151
|
+
setProgram(productionId: string, sourceId: string, transition?: TransitionConfig): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Set the preview source
|
|
154
|
+
*
|
|
155
|
+
* Loads a source into the preview output for inspection before going live.
|
|
156
|
+
*
|
|
157
|
+
* Requires: productions:control permission
|
|
158
|
+
*/
|
|
159
|
+
setPreview(productionId: string, sourceId: string): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Execute a transition between preview and program
|
|
162
|
+
*
|
|
163
|
+
* Swaps the current preview source into program using the specified transition.
|
|
164
|
+
*
|
|
165
|
+
* Requires: productions:control permission
|
|
166
|
+
*/
|
|
167
|
+
transition(productionId: string, config: TransitionConfig): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Add a graphic overlay to a production
|
|
170
|
+
*
|
|
171
|
+
* Requires: productions:graphics:create permission
|
|
172
|
+
*/
|
|
173
|
+
addGraphic(productionId: string, graphic: {
|
|
174
|
+
name: string;
|
|
175
|
+
type: Graphic["type"];
|
|
176
|
+
content: Record<string, unknown>;
|
|
177
|
+
position?: Graphic["position"];
|
|
178
|
+
layer?: number;
|
|
179
|
+
}): Promise<Graphic>;
|
|
180
|
+
/**
|
|
181
|
+
* Update an existing graphic
|
|
182
|
+
*
|
|
183
|
+
* Requires: productions:graphics:update permission
|
|
184
|
+
*/
|
|
185
|
+
updateGraphic(productionId: string, graphicId: string, updates: Partial<{
|
|
186
|
+
name: string;
|
|
187
|
+
type: Graphic["type"];
|
|
188
|
+
content: Record<string, unknown>;
|
|
189
|
+
position: Graphic["position"];
|
|
190
|
+
layer: number;
|
|
191
|
+
}>): Promise<Graphic>;
|
|
192
|
+
/**
|
|
193
|
+
* Remove a graphic from a production
|
|
194
|
+
*
|
|
195
|
+
* Requires: productions:graphics:remove permission
|
|
196
|
+
*/
|
|
197
|
+
removeGraphic(productionId: string, graphicId: string): Promise<void>;
|
|
198
|
+
/**
|
|
199
|
+
* Show a graphic on the production output
|
|
200
|
+
*
|
|
201
|
+
* Makes the graphic visible on the live output.
|
|
202
|
+
*
|
|
203
|
+
* Requires: productions:graphics:control permission
|
|
204
|
+
*/
|
|
205
|
+
showGraphic(productionId: string, graphicId: string): Promise<void>;
|
|
206
|
+
/**
|
|
207
|
+
* Hide a graphic from the production output
|
|
208
|
+
*
|
|
209
|
+
* Removes the graphic from the live output without deleting it.
|
|
210
|
+
*
|
|
211
|
+
* Requires: productions:graphics:control permission
|
|
212
|
+
*/
|
|
213
|
+
hideGraphic(productionId: string, graphicId: string): Promise<void>;
|
|
214
|
+
/**
|
|
215
|
+
* Get the current audio mix for a production
|
|
216
|
+
*
|
|
217
|
+
* Returns volume, mute, solo, pan, and processing settings for all channels.
|
|
218
|
+
*
|
|
219
|
+
* Requires: productions:audio:read permission
|
|
220
|
+
*/
|
|
221
|
+
getAudioMix(productionId: string): Promise<AudioMixChannel[]>;
|
|
222
|
+
/**
|
|
223
|
+
* Set the audio mix for a production
|
|
224
|
+
*
|
|
225
|
+
* Updates volume, mute, solo, pan, and processing settings for channels.
|
|
226
|
+
*
|
|
227
|
+
* Requires: productions:audio:control permission
|
|
228
|
+
*/
|
|
229
|
+
setAudioMix(productionId: string, channels: AudioMixChannel[]): Promise<AudioMixChannel[]>;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Create a Studio API instance
|
|
233
|
+
*/
|
|
234
|
+
export declare function createStudioAPI(client: WaveClient): StudioAPI;
|
|
235
|
+
//# sourceMappingURL=studio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"studio.d.ts","sourceRoot":"","sources":["../src/studio.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB,cAAc,gBAAgB,CAAC;AAC/B,OAAO,KAAK,EACV,eAAe,EACf,uBAAuB,EACvB,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,UAAU,EACV,KAAK,EACL,WAAW,EACX,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,gBAAgB,CAAC;AAExB,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;gBAElC,MAAM,EAAE,UAAU;IAK9B;;;;OAIG;IACG,MAAM,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC;IAInE;;;;OAIG;IACG,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIpD;;;;OAIG;IACG,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC;IAIzF;;;;OAIG;IACG,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD;;;;OAIG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAkBlF;;;;;;OAMG;IACG,KAAK,CAAC,Y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,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QAC9B,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,GACD,OAAO,CAAC,OAAO,CAAC;IAOnB;;;;OAIG;IACG,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E;;;;;;OAMG;IACG,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzE;;;;;;OAMG;IACG,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzE;;;;;;OAMG;IACG,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAInE;;;;;;OAMG;IACG,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAKjG;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAE7D"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Optional Telemetry Module
|
|
3
|
+
*
|
|
4
|
+
* Opt-in OpenTelemetry integration for observability of SDK calls.
|
|
5
|
+
* Disabled by default. Zero overhead when not enabled.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { Wave } from '@wave/sdk';
|
|
10
|
+
*
|
|
11
|
+
* const wave = new Wave({
|
|
12
|
+
* apiKey: process.env.WAVE_API_KEY!,
|
|
13
|
+
* telemetry: { enabled: true, serviceName: 'my-app' },
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Telemetry configuration options.
|
|
19
|
+
* Telemetry is opt-in only and disabled by default.
|
|
20
|
+
*/
|
|
21
|
+
export interface TelemetryConfig {
|
|
22
|
+
/** Enable telemetry span collection. Default: false */
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
/** Service name reported in spans. Default: '@wave/sdk' */
|
|
25
|
+
serviceName?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Attributes recorded on telemetry spans.
|
|
29
|
+
* Never includes PII, API keys, or request/response bodies.
|
|
30
|
+
*/
|
|
31
|
+
export interface TelemetrySpanAttributes {
|
|
32
|
+
/** The SDK method name (e.g., 'clips.list') */
|
|
33
|
+
'wave.sdk.method'?: string;
|
|
34
|
+
/** HTTP status code of the response */
|
|
35
|
+
'wave.sdk.status_code'?: number;
|
|
36
|
+
/** Error type (class name only, never the message) */
|
|
37
|
+
'wave.sdk.error_type'?: string;
|
|
38
|
+
/** Duration of the call in milliseconds */
|
|
39
|
+
'wave.sdk.duration_ms'?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Initialize telemetry. Call once during SDK client construction.
|
|
43
|
+
* If @opentelemetry/api is not installed, telemetry silently remains disabled.
|
|
44
|
+
*/
|
|
45
|
+
export declare function initTelemetry(config: TelemetryConfig): void;
|
|
46
|
+
/**
|
|
47
|
+
* Reset telemetry state. Useful for testing or teardown.
|
|
48
|
+
*/
|
|
49
|
+
export declare function resetTelemetry(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Check if telemetry is currently enabled.
|
|
52
|
+
*/
|
|
53
|
+
export declare function isTelemetryEnabled(): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Wrap an async operation with an OpenTelemetry span.
|
|
56
|
+
*
|
|
57
|
+
* When telemetry is disabled, this calls `fn` directly with zero overhead
|
|
58
|
+
* (no span creation, no timing, no try/catch wrapper).
|
|
59
|
+
*
|
|
60
|
+
* Recorded attributes (never PII):
|
|
61
|
+
* - `wave.sdk.method`: operation name
|
|
62
|
+
* - `wave.sdk.duration_ms`: call duration
|
|
63
|
+
* - `wave.sdk.status_code`: HTTP status (if provided in attributes)
|
|
64
|
+
* - `wave.sdk.error_type`: error class name on failure
|
|
65
|
+
*
|
|
66
|
+
* @param operationName - Name of the SDK operation (e.g., 'clips.list')
|
|
67
|
+
* @param fn - The async function to execute
|
|
68
|
+
* @param attributes - Optional span attributes (status code, etc.)
|
|
69
|
+
* @returns The result of `fn`
|
|
70
|
+
*/
|
|
71
|
+
export declare function withTelemetry<T>(operationName: string, fn: () => Promise<T>, attributes?: Record<string, string | number | boolean>): Promise<T>;
|
|
72
|
+
/**
|
|
73
|
+
* Synchronous version of withTelemetry for non-async operations.
|
|
74
|
+
* Same zero-overhead behavior when disabled.
|
|
75
|
+
*/
|
|
76
|
+
export declare function withTelemetrySync<T>(operationName: string, fn: () => T, attributes?: Record<string, string | number | boolean>): T;
|
|
77
|
+
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,+CAA+C;IAC/C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sDAAsD;IACtD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,2CAA2C;IAC3C,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AA8BD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAoB3D;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAGrC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,aAAa,CAAC,CAAC,EACnC,aAAa,EAAE,MAAM,EACrB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GACrD,OAAO,CAAC,CAAC,CAAC,CAwCZ;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,aAAa,EAAE,MAAM,EACrB,EAAE,EAAE,MAAM,CAAC,EACX,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GACrD,CAAC,CAqCH"}
|