@wave-av/sdk 2.0.1 → 2.0.3

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 (260) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +27 -23
  3. package/dist/audience.js +93 -0
  4. package/dist/audience.mjs +9 -0
  5. package/dist/camera-control.js +95 -0
  6. package/dist/camera-control.mjs +71 -0
  7. package/dist/captions-types.js +18 -0
  8. package/dist/captions-types.mjs +0 -0
  9. package/dist/captions.js +266 -0
  10. package/dist/captions.mjs +9 -0
  11. package/dist/chapters-types.js +18 -0
  12. package/dist/chapters-types.mjs +0 -0
  13. package/dist/chapters.js +280 -0
  14. package/dist/chapters.mjs +9 -0
  15. package/dist/chunk-362MRITF.mjs +46 -0
  16. package/dist/chunk-3ZLK4J3V.mjs +69 -0
  17. package/dist/chunk-4DG4OBRD.mjs +52 -0
  18. package/dist/chunk-4G7FMCMJ.mjs +68 -0
  19. package/dist/chunk-4KD5F6E3.mjs +0 -0
  20. package/dist/chunk-7M6XVUUK.mjs +241 -0
  21. package/dist/chunk-A344OOT7.mjs +243 -0
  22. package/dist/chunk-AI64YR5W.mjs +173 -0
  23. package/dist/chunk-C2GQ756E.mjs +57 -0
  24. package/dist/chunk-CO2VB72Z.mjs +255 -0
  25. package/dist/chunk-DWXWAILB.mjs +44 -0
  26. package/dist/chunk-FLEFYLDM.mjs +71 -0
  27. package/dist/chunk-H2YYTNUH.mjs +266 -0
  28. package/dist/chunk-IGDBED5P.mjs +246 -0
  29. package/dist/chunk-IL2SGWBC.mjs +0 -0
  30. package/dist/chunk-IVFZ5X4W.mjs +68 -0
  31. package/dist/chunk-JC32PG3T.mjs +114 -0
  32. package/dist/chunk-K5X42NLD.mjs +54 -0
  33. package/dist/chunk-KCEPNS2U.mjs +276 -0
  34. package/dist/chunk-LVOVF6XC.mjs +54 -0
  35. package/dist/chunk-M4Z33V3N.mjs +247 -0
  36. package/dist/chunk-M6FKIX75.mjs +0 -0
  37. package/dist/chunk-M744Z327.mjs +244 -0
  38. package/dist/chunk-MRFDPPFK.mjs +61 -0
  39. package/dist/chunk-MXU3Q23F.mjs +68 -0
  40. package/dist/chunk-NCVUZ746.mjs +60 -0
  41. package/dist/chunk-NLQVD2LF.mjs +210 -0
  42. package/dist/chunk-O6DOGYP5.mjs +238 -0
  43. package/dist/chunk-S25NY5GE.mjs +124 -0
  44. package/dist/chunk-TFHXBICQ.mjs +305 -0
  45. package/dist/chunk-TXWOA2VR.mjs +57 -0
  46. package/dist/chunk-UCDSNV22.mjs +63 -0
  47. package/dist/chunk-V5DWA5P4.mjs +279 -0
  48. package/dist/chunk-VLQQDYGP.mjs +173 -0
  49. package/dist/chunk-VPKZUXZW.mjs +53 -0
  50. package/dist/chunk-WS3PEFYJ.mjs +60 -0
  51. package/dist/chunk-XGAYMWRH.mjs +74 -0
  52. package/dist/chunk-XMM5J57W.mjs +0 -0
  53. package/dist/chunk-XWABBOSX.mjs +278 -0
  54. package/dist/chunk-Y6FXYEAI.mjs +10 -0
  55. package/dist/chunk-YBLXHI3M.mjs +257 -0
  56. package/dist/chunk-YEK26SSO.mjs +100 -0
  57. package/dist/chunk-YLCQKCZL.mjs +0 -0
  58. package/dist/chunk-YRKO4XI7.mjs +0 -0
  59. package/dist/chunk-ZJO7AP4Q.mjs +0 -0
  60. package/dist/client-types.js +18 -0
  61. package/dist/client-types.mjs +0 -0
  62. package/dist/client.js +311 -0
  63. package/dist/client.mjs +14 -0
  64. package/dist/clips-types.js +18 -0
  65. package/dist/clips-types.mjs +0 -0
  66. package/dist/clips.js +198 -0
  67. package/dist/clips.mjs +9 -0
  68. package/dist/cloud-switcher.js +80 -0
  69. package/dist/cloud-switcher.mjs +56 -0
  70. package/dist/collab-types.js +18 -0
  71. package/dist/collab-types.mjs +1 -0
  72. package/dist/collab.js +304 -0
  73. package/dist/collab.mjs +10 -0
  74. package/dist/connect.js +85 -0
  75. package/dist/connect.mjs +9 -0
  76. package/dist/creator.js +79 -0
  77. package/dist/creator.mjs +9 -0
  78. package/dist/desktop.js +77 -0
  79. package/dist/desktop.mjs +9 -0
  80. package/dist/distribution.js +88 -0
  81. package/dist/distribution.mjs +9 -0
  82. package/dist/drm.js +85 -0
  83. package/dist/drm.mjs +9 -0
  84. package/dist/edge.js +93 -0
  85. package/dist/edge.mjs +9 -0
  86. package/dist/editor-types.js +18 -0
  87. package/dist/editor-types.mjs +1 -0
  88. package/dist/editor.js +330 -0
  89. package/dist/editor.mjs +10 -0
  90. package/dist/fleet.js +149 -0
  91. package/dist/fleet.mjs +9 -0
  92. package/dist/ghost.js +139 -0
  93. package/dist/ghost.mjs +9 -0
  94. package/dist/index.js +0 -250
  95. package/dist/index.mjs +161 -5445
  96. package/dist/marketplace.js +82 -0
  97. package/dist/marketplace.mjs +9 -0
  98. package/dist/mesh.js +198 -0
  99. package/dist/mesh.mjs +9 -0
  100. package/dist/notifications.js +79 -0
  101. package/dist/notifications.mjs +9 -0
  102. package/dist/phone-types.js +18 -0
  103. package/dist/phone-types.mjs +0 -0
  104. package/dist/phone.js +269 -0
  105. package/dist/phone.mjs +9 -0
  106. package/dist/pipeline-types.js +18 -0
  107. package/dist/pipeline-types.mjs +0 -0
  108. package/dist/pipeline.js +263 -0
  109. package/dist/pipeline.mjs +9 -0
  110. package/dist/podcast.js +94 -0
  111. package/dist/podcast.mjs +9 -0
  112. package/dist/prism.js +82 -0
  113. package/dist/prism.mjs +9 -0
  114. package/dist/prompter.js +99 -0
  115. package/dist/prompter.mjs +76 -0
  116. package/dist/pulse.js +99 -0
  117. package/dist/pulse.mjs +9 -0
  118. package/dist/qr.js +71 -0
  119. package/dist/qr.mjs +9 -0
  120. package/dist/replay.js +62 -0
  121. package/dist/replay.mjs +38 -0
  122. package/dist/scene-types.js +18 -0
  123. package/dist/scene-types.mjs +1 -0
  124. package/dist/scene.js +271 -0
  125. package/dist/scene.mjs +10 -0
  126. package/dist/search-types.js +18 -0
  127. package/dist/search-types.mjs +1 -0
  128. package/dist/search.js +268 -0
  129. package/dist/search.mjs +10 -0
  130. package/dist/sentiment-types.js +18 -0
  131. package/dist/sentiment-types.mjs +0 -0
  132. package/dist/sentiment.js +235 -0
  133. package/dist/sentiment.mjs +9 -0
  134. package/dist/signage.js +93 -0
  135. package/dist/signage.mjs +9 -0
  136. package/dist/slides.js +78 -0
  137. package/dist/slides.mjs +9 -0
  138. package/dist/studio-ai-types.js +18 -0
  139. package/dist/studio-ai-types.mjs +1 -0
  140. package/dist/studio-ai.js +301 -0
  141. package/dist/studio-ai.mjs +10 -0
  142. package/dist/studio-types.js +18 -0
  143. package/dist/studio-types.mjs +1 -0
  144. package/dist/studio.js +303 -0
  145. package/dist/studio.mjs +10 -0
  146. package/dist/telemetry.js +124 -0
  147. package/dist/telemetry.mjs +15 -0
  148. package/dist/transcribe-types.js +18 -0
  149. package/dist/transcribe-types.mjs +1 -0
  150. package/dist/transcribe.js +282 -0
  151. package/dist/transcribe.mjs +10 -0
  152. package/dist/usb.js +69 -0
  153. package/dist/usb.mjs +9 -0
  154. package/dist/vault.js +96 -0
  155. package/dist/vault.mjs +9 -0
  156. package/dist/voice-types.js +18 -0
  157. package/dist/voice-types.mjs +0 -0
  158. package/dist/voice.js +272 -0
  159. package/dist/voice.mjs +9 -0
  160. package/dist/zoom.js +86 -0
  161. package/dist/zoom.mjs +9 -0
  162. package/package.json +5 -5
  163. package/dist/audience.d.ts +0 -104
  164. package/dist/audience.d.ts.map +0 -1
  165. package/dist/camera-control.d.ts +0 -54
  166. package/dist/camera-control.d.ts.map +0 -1
  167. package/dist/captions.d.ts +0 -362
  168. package/dist/captions.d.ts.map +0 -1
  169. package/dist/chapters.d.ts +0 -315
  170. package/dist/chapters.d.ts.map +0 -1
  171. package/dist/client.d.ts +0 -191
  172. package/dist/client.d.ts.map +0 -1
  173. package/dist/clips.d.ts +0 -258
  174. package/dist/clips.d.ts.map +0 -1
  175. package/dist/cloud-switcher.d.ts +0 -65
  176. package/dist/cloud-switcher.d.ts.map +0 -1
  177. package/dist/collab-types.d.ts +0 -204
  178. package/dist/collab-types.d.ts.map +0 -1
  179. package/dist/collab.d.ts +0 -226
  180. package/dist/collab.d.ts.map +0 -1
  181. package/dist/connect.d.ts +0 -88
  182. package/dist/connect.d.ts.map +0 -1
  183. package/dist/creator.d.ts +0 -109
  184. package/dist/creator.d.ts.map +0 -1
  185. package/dist/desktop.d.ts +0 -95
  186. package/dist/desktop.d.ts.map +0 -1
  187. package/dist/distribution.d.ts +0 -92
  188. package/dist/distribution.d.ts.map +0 -1
  189. package/dist/drm.d.ts +0 -87
  190. package/dist/drm.d.ts.map +0 -1
  191. package/dist/edge.d.ts +0 -112
  192. package/dist/edge.d.ts.map +0 -1
  193. package/dist/editor-types.d.ts +0 -236
  194. package/dist/editor-types.d.ts.map +0 -1
  195. package/dist/editor.d.ts +0 -206
  196. package/dist/editor.d.ts.map +0 -1
  197. package/dist/fleet.d.ts +0 -207
  198. package/dist/fleet.d.ts.map +0 -1
  199. package/dist/ghost.d.ts +0 -213
  200. package/dist/ghost.d.ts.map +0 -1
  201. package/dist/index.d.ts +0 -144
  202. package/dist/index.d.ts.map +0 -1
  203. package/dist/marketplace.d.ts +0 -90
  204. package/dist/marketplace.d.ts.map +0 -1
  205. package/dist/mesh.d.ts +0 -237
  206. package/dist/mesh.d.ts.map +0 -1
  207. package/dist/notifications.d.ts +0 -82
  208. package/dist/notifications.d.ts.map +0 -1
  209. package/dist/phone.d.ts +0 -369
  210. package/dist/phone.d.ts.map +0 -1
  211. package/dist/pipeline.d.ts +0 -409
  212. package/dist/pipeline.d.ts.map +0 -1
  213. package/dist/podcast.d.ts +0 -113
  214. package/dist/podcast.d.ts.map +0 -1
  215. package/dist/prism.d.ts +0 -132
  216. package/dist/prism.d.ts.map +0 -1
  217. package/dist/prompter.d.ts +0 -184
  218. package/dist/prompter.d.ts.map +0 -1
  219. package/dist/pulse.d.ts +0 -156
  220. package/dist/pulse.d.ts.map +0 -1
  221. package/dist/qr.d.ts +0 -82
  222. package/dist/qr.d.ts.map +0 -1
  223. package/dist/replay.d.ts +0 -52
  224. package/dist/replay.d.ts.map +0 -1
  225. package/dist/scene-types.d.ts +0 -190
  226. package/dist/scene-types.d.ts.map +0 -1
  227. package/dist/scene.d.ts +0 -213
  228. package/dist/scene.d.ts.map +0 -1
  229. package/dist/search-types.d.ts +0 -210
  230. package/dist/search-types.d.ts.map +0 -1
  231. package/dist/search.d.ts +0 -250
  232. package/dist/search.d.ts.map +0 -1
  233. package/dist/sentiment.d.ts +0 -378
  234. package/dist/sentiment.d.ts.map +0 -1
  235. package/dist/signage.d.ts +0 -101
  236. package/dist/signage.d.ts.map +0 -1
  237. package/dist/slides.d.ts +0 -68
  238. package/dist/slides.d.ts.map +0 -1
  239. package/dist/studio-ai-types.d.ts +0 -198
  240. package/dist/studio-ai-types.d.ts.map +0 -1
  241. package/dist/studio-ai.d.ts +0 -218
  242. package/dist/studio-ai.d.ts.map +0 -1
  243. package/dist/studio-types.d.ts +0 -267
  244. package/dist/studio-types.d.ts.map +0 -1
  245. package/dist/studio.d.ts +0 -234
  246. package/dist/studio.d.ts.map +0 -1
  247. package/dist/telemetry.d.ts +0 -76
  248. package/dist/telemetry.d.ts.map +0 -1
  249. package/dist/transcribe-types.d.ts +0 -153
  250. package/dist/transcribe-types.d.ts.map +0 -1
  251. package/dist/transcribe.d.ts +0 -218
  252. package/dist/transcribe.d.ts.map +0 -1
  253. package/dist/usb.d.ts +0 -64
  254. package/dist/usb.d.ts.map +0 -1
  255. package/dist/vault.d.ts +0 -121
  256. package/dist/vault.d.ts.map +0 -1
  257. package/dist/voice.d.ts +0 -307
  258. package/dist/voice.d.ts.map +0 -1
  259. package/dist/zoom.d.ts +0 -91
  260. package/dist/zoom.d.ts.map +0 -1
@@ -0,0 +1,238 @@
1
+ // src/pipeline.ts
2
+ var PipelineAPI = class {
3
+ client;
4
+ basePath = "/v1/streams";
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ // ==========================================================================
9
+ // Stream CRUD
10
+ // ==========================================================================
11
+ /**
12
+ * Create a new stream
13
+ *
14
+ * Requires: streams:create permission
15
+ */
16
+ async create(request) {
17
+ return this.client.post(this.basePath, request);
18
+ }
19
+ /**
20
+ * Get a stream by ID
21
+ *
22
+ * Requires: streams:read permission
23
+ */
24
+ async get(streamId) {
25
+ return this.client.get(`${this.basePath}/${streamId}`);
26
+ }
27
+ /**
28
+ * Update a stream
29
+ *
30
+ * Requires: streams:update permission
31
+ */
32
+ async update(streamId, request) {
33
+ return this.client.patch(`${this.basePath}/${streamId}`, request);
34
+ }
35
+ /**
36
+ * Remove a stream
37
+ *
38
+ * Requires: streams:remove permission (server-side RBAC enforced)
39
+ */
40
+ async remove(streamId) {
41
+ await this.client.delete(`${this.basePath}/${streamId}`);
42
+ }
43
+ /**
44
+ * List streams with optional filters
45
+ *
46
+ * Requires: streams:read permission
47
+ */
48
+ async list(params) {
49
+ const queryParams = {
50
+ limit: params?.limit,
51
+ offset: params?.offset,
52
+ cursor: params?.cursor,
53
+ status: params?.status,
54
+ protocol: params?.protocol,
55
+ created_after: params?.created_after,
56
+ created_before: params?.created_before,
57
+ order_by: params?.order_by,
58
+ order: params?.order
59
+ };
60
+ return this.client.get(this.basePath, {
61
+ params: queryParams
62
+ });
63
+ }
64
+ // ==========================================================================
65
+ // Stream Lifecycle
66
+ // ==========================================================================
67
+ /**
68
+ * Start a stream
69
+ *
70
+ * Transitions the stream from idle to connecting. The stream will move
71
+ * to "live" once media is received on the ingest endpoint.
72
+ *
73
+ * Requires: streams:start permission
74
+ */
75
+ async start(streamId) {
76
+ return this.client.post(`${this.basePath}/${streamId}/start`);
77
+ }
78
+ /**
79
+ * Stop a stream
80
+ *
81
+ * Gracefully ends the stream. Any active recording will be finalized.
82
+ *
83
+ * Requires: streams:stop permission
84
+ */
85
+ async stop(streamId) {
86
+ return this.client.post(`${this.basePath}/${streamId}/stop`);
87
+ }
88
+ /**
89
+ * Switch the ingest protocol for a live stream
90
+ *
91
+ * Performs a zero-downtime protocol switch. The stream will briefly
92
+ * enter "reconnecting" status during the transition.
93
+ *
94
+ * Requires: streams:update permission
95
+ */
96
+ async switchProtocol(streamId, protocol) {
97
+ return this.client.post(`${this.basePath}/${streamId}/switch-protocol`, { protocol });
98
+ }
99
+ // ==========================================================================
100
+ // Health & Monitoring
101
+ // ==========================================================================
102
+ /**
103
+ * Get real-time health metrics for a stream
104
+ *
105
+ * Returns current bitrate, frame rate, latency, and overall health status.
106
+ *
107
+ * Requires: streams:read permission
108
+ */
109
+ async getHealth(streamId) {
110
+ return this.client.get(`${this.basePath}/${streamId}/health`);
111
+ }
112
+ /**
113
+ * Get ingest endpoints for a stream
114
+ *
115
+ * Returns primary and backup URLs for each configured protocol.
116
+ *
117
+ * Requires: streams:read permission
118
+ */
119
+ async getIngestEndpoints(streamId) {
120
+ return this.client.get(`${this.basePath}/${streamId}/ingest-endpoints`);
121
+ }
122
+ // ==========================================================================
123
+ // Recording
124
+ // ==========================================================================
125
+ /**
126
+ * Start recording a live stream
127
+ *
128
+ * Begins capturing the stream to a file. The stream must be in "live" status.
129
+ *
130
+ * Requires: streams:record permission
131
+ */
132
+ async startRecording(streamId) {
133
+ return this.client.post(`${this.basePath}/${streamId}/recordings/start`);
134
+ }
135
+ /**
136
+ * Stop recording a live stream
137
+ *
138
+ * Finalizes the current recording. The recording enters "processing" status
139
+ * while it is being packaged.
140
+ *
141
+ * Requires: streams:record permission
142
+ */
143
+ async stopRecording(streamId) {
144
+ return this.client.post(`${this.basePath}/${streamId}/recordings/stop`);
145
+ }
146
+ /**
147
+ * List recordings for a stream
148
+ *
149
+ * Requires: streams:read permission
150
+ */
151
+ async listRecordings(streamId, params) {
152
+ return this.client.get(
153
+ `${this.basePath}/${streamId}/recordings`,
154
+ { params }
155
+ );
156
+ }
157
+ /**
158
+ * Get a specific recording
159
+ *
160
+ * Requires: streams:read permission
161
+ */
162
+ async getRecording(streamId, recordingId) {
163
+ return this.client.get(
164
+ `${this.basePath}/${streamId}/recordings/${recordingId}`
165
+ );
166
+ }
167
+ // ==========================================================================
168
+ // Viewers
169
+ // ==========================================================================
170
+ /**
171
+ * List active viewer sessions for a stream
172
+ *
173
+ * Requires: streams:read permission
174
+ */
175
+ async listViewers(streamId, params) {
176
+ return this.client.get(
177
+ `${this.basePath}/${streamId}/viewers`,
178
+ { params }
179
+ );
180
+ }
181
+ /**
182
+ * Get current and peak viewer count for a stream
183
+ *
184
+ * Requires: streams:read permission
185
+ */
186
+ async getViewerCount(streamId) {
187
+ return this.client.get(
188
+ `${this.basePath}/${streamId}/viewers/count`
189
+ );
190
+ }
191
+ // ==========================================================================
192
+ // Polling Helpers
193
+ // ==========================================================================
194
+ /**
195
+ * Wait for a stream to reach "live" status
196
+ *
197
+ * Polls the stream until it transitions to "live" or a terminal state.
198
+ * Useful after calling `start()` to wait for the encoder to connect.
199
+ *
200
+ * @param streamId - Stream to monitor
201
+ * @param options - Polling configuration
202
+ * @param options.pollInterval - Milliseconds between polls (default: 2000)
203
+ * @param options.timeout - Maximum wait time in milliseconds (default: 120000)
204
+ * @param options.onProgress - Called on each poll with the current stream state
205
+ * @returns The stream once it reaches "live" status
206
+ * @throws Error if the stream enters "failed" or "ended" status, or if the timeout is exceeded
207
+ */
208
+ async waitForLive(streamId, options) {
209
+ const pollInterval = options?.pollInterval || 2e3;
210
+ const timeout = options?.timeout || 12e4;
211
+ const startTime = Date.now();
212
+ while (Date.now() - startTime < timeout) {
213
+ const stream = await this.get(streamId);
214
+ if (options?.onProgress) {
215
+ options.onProgress(stream);
216
+ }
217
+ if (stream.status === "live") {
218
+ return stream;
219
+ }
220
+ if (stream.status === "failed") {
221
+ throw new Error(`Stream failed to go live: ${stream.id}`);
222
+ }
223
+ if (stream.status === "ended") {
224
+ throw new Error(`Stream ended before going live: ${stream.id}`);
225
+ }
226
+ await new Promise((resolve) => setTimeout(resolve, pollInterval));
227
+ }
228
+ throw new Error(`Stream did not go live within ${timeout}ms`);
229
+ }
230
+ };
231
+ function createPipelineAPI(client) {
232
+ return new PipelineAPI(client);
233
+ }
234
+
235
+ export {
236
+ PipelineAPI,
237
+ createPipelineAPI
238
+ };
@@ -0,0 +1,124 @@
1
+ // src/fleet.ts
2
+ var FleetAPI = class {
3
+ client;
4
+ basePath = "/v1/fleet/nodes";
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * List fleet nodes with optional filters
10
+ *
11
+ * Requires: fleet:read permission
12
+ */
13
+ async list(params) {
14
+ const queryParams = {
15
+ limit: params?.limit,
16
+ offset: params?.offset,
17
+ cursor: params?.cursor,
18
+ status: params?.status,
19
+ health: params?.health,
20
+ os: params?.os,
21
+ order_by: params?.order_by,
22
+ order: params?.order
23
+ };
24
+ return this.client.get(this.basePath, {
25
+ params: queryParams
26
+ });
27
+ }
28
+ /**
29
+ * Get a node by ID
30
+ *
31
+ * Requires: fleet:read permission
32
+ */
33
+ async get(nodeId) {
34
+ return this.client.get(`${this.basePath}/${nodeId}`);
35
+ }
36
+ /**
37
+ * Register a new node
38
+ *
39
+ * Requires: fleet:create permission
40
+ */
41
+ async register(request) {
42
+ return this.client.post(this.basePath, request);
43
+ }
44
+ /**
45
+ * Update a node
46
+ *
47
+ * Requires: fleet:update permission
48
+ */
49
+ async update(nodeId, request) {
50
+ return this.client.patch(`${this.basePath}/${nodeId}`, request);
51
+ }
52
+ /**
53
+ * Deregister (remove) a node
54
+ *
55
+ * Requires: fleet:remove permission (server-side RBAC enforced)
56
+ */
57
+ async deregister(nodeId) {
58
+ await this.client.delete(`${this.basePath}/${nodeId}`);
59
+ }
60
+ /**
61
+ * Get current health status of a node
62
+ *
63
+ * Requires: fleet:read permission
64
+ */
65
+ async getHealth(nodeId) {
66
+ return this.client.get(
67
+ `${this.basePath}/${nodeId}/health`
68
+ );
69
+ }
70
+ /**
71
+ * List devices attached to a node
72
+ *
73
+ * Requires: fleet:read permission
74
+ */
75
+ async listDevices(nodeId) {
76
+ return this.client.get(`${this.basePath}/${nodeId}/devices`);
77
+ }
78
+ /**
79
+ * Send a command to a node
80
+ *
81
+ * Requires: fleet:command permission
82
+ */
83
+ async sendCommand(nodeId, command) {
84
+ return this.client.post(
85
+ `${this.basePath}/${nodeId}/commands`,
86
+ command
87
+ );
88
+ }
89
+ /**
90
+ * Get current resource metrics for a node
91
+ *
92
+ * Requires: fleet:read permission
93
+ */
94
+ async getMetrics(nodeId) {
95
+ return this.client.get(`${this.basePath}/${nodeId}/metrics`);
96
+ }
97
+ /**
98
+ * Wait for a node to come online
99
+ */
100
+ async waitForOnline(nodeId, options) {
101
+ const pollInterval = options?.pollInterval || 5e3;
102
+ const timeout = options?.timeout || 12e4;
103
+ const startTime = Date.now();
104
+ while (Date.now() - startTime < timeout) {
105
+ const node = await this.get(nodeId);
106
+ if (options?.onProgress) {
107
+ options.onProgress(node);
108
+ }
109
+ if (node.status === "online") {
110
+ return node;
111
+ }
112
+ await new Promise((resolve) => setTimeout(resolve, pollInterval));
113
+ }
114
+ throw new Error(`Node ${nodeId} did not come online within ${timeout}ms`);
115
+ }
116
+ };
117
+ function createFleetAPI(client) {
118
+ return new FleetAPI(client);
119
+ }
120
+
121
+ export {
122
+ FleetAPI,
123
+ createFleetAPI
124
+ };
@@ -0,0 +1,305 @@
1
+ // src/editor.ts
2
+ var EditorAPI = class {
3
+ client;
4
+ basePath = "/v1/editor/projects";
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * Create a new editor project
10
+ *
11
+ * Requires: editor:create permission
12
+ */
13
+ async createProject(request) {
14
+ return this.client.post(this.basePath, request);
15
+ }
16
+ /**
17
+ * Get a project by ID
18
+ *
19
+ * Requires: editor:read permission
20
+ */
21
+ async getProject(projectId) {
22
+ return this.client.get(`${this.basePath}/${projectId}`);
23
+ }
24
+ /**
25
+ * Update a project
26
+ *
27
+ * Requires: editor:update permission
28
+ */
29
+ async updateProject(projectId, request) {
30
+ return this.client.patch(`${this.basePath}/${projectId}`, request);
31
+ }
32
+ /**
33
+ * Remove a project
34
+ *
35
+ * Requires: editor:remove permission (server-side RBAC enforced)
36
+ */
37
+ async removeProject(projectId) {
38
+ await this.client.delete(`${this.basePath}/${projectId}`);
39
+ }
40
+ /**
41
+ * List projects
42
+ *
43
+ * Requires: editor:read permission
44
+ */
45
+ async listProjects(params) {
46
+ return this.client.get(this.basePath, {
47
+ params
48
+ });
49
+ }
50
+ /**
51
+ * Duplicate a project
52
+ *
53
+ * Requires: editor:create permission
54
+ */
55
+ async duplicateProject(projectId, name) {
56
+ return this.client.post(`${this.basePath}/${projectId}/duplicate`, {
57
+ name
58
+ });
59
+ }
60
+ /**
61
+ * Add a track to a project
62
+ *
63
+ * Requires: editor:update permission
64
+ */
65
+ async addTrack(projectId, track) {
66
+ return this.client.post(`${this.basePath}/${projectId}/tracks`, track);
67
+ }
68
+ /**
69
+ * Update a track
70
+ *
71
+ * Requires: editor:update permission
72
+ */
73
+ async updateTrack(projectId, trackId, updates) {
74
+ return this.client.patch(
75
+ `${this.basePath}/${projectId}/tracks/${trackId}`,
76
+ updates
77
+ );
78
+ }
79
+ /**
80
+ * Remove a track
81
+ *
82
+ * Requires: editor:update permission (server-side RBAC enforced)
83
+ */
84
+ async removeTrack(projectId, trackId) {
85
+ await this.client.delete(
86
+ `${this.basePath}/${projectId}/tracks/${trackId}`,
87
+ { method: "DELETE" }
88
+ );
89
+ }
90
+ /**
91
+ * Add an element to a track
92
+ *
93
+ * Requires: editor:update permission
94
+ */
95
+ async addElement(projectId, element) {
96
+ return this.client.post(
97
+ `${this.basePath}/${projectId}/elements`,
98
+ element
99
+ );
100
+ }
101
+ /**
102
+ * Update an element
103
+ *
104
+ * Requires: editor:update permission
105
+ */
106
+ async updateElement(projectId, elementId, updates) {
107
+ return this.client.patch(
108
+ `${this.basePath}/${projectId}/elements/${elementId}`,
109
+ updates
110
+ );
111
+ }
112
+ /**
113
+ * Remove an element
114
+ *
115
+ * Requires: editor:update permission (server-side RBAC enforced)
116
+ */
117
+ async removeElement(projectId, elementId) {
118
+ await this.client.delete(
119
+ `${this.basePath}/${projectId}/elements/${elementId}`,
120
+ { method: "DELETE" }
121
+ );
122
+ }
123
+ /**
124
+ * Move an element to a different position
125
+ *
126
+ * Requires: editor:update permission
127
+ */
128
+ async moveElement(projectId, elementId, options) {
129
+ return this.client.post(
130
+ `${this.basePath}/${projectId}/elements/${elementId}/move`,
131
+ options
132
+ );
133
+ }
134
+ /**
135
+ * Trim an element
136
+ *
137
+ * Requires: editor:update permission
138
+ */
139
+ async trimElement(projectId, elementId, options) {
140
+ return this.client.post(
141
+ `${this.basePath}/${projectId}/elements/${elementId}/trim`,
142
+ options
143
+ );
144
+ }
145
+ /**
146
+ * Add a transition between elements
147
+ *
148
+ * Requires: editor:update permission
149
+ */
150
+ async addTransition(projectId, transition) {
151
+ return this.client.post(
152
+ `${this.basePath}/${projectId}/transitions`,
153
+ transition
154
+ );
155
+ }
156
+ /**
157
+ * Update a transition
158
+ *
159
+ * Requires: editor:update permission
160
+ */
161
+ async updateTransition(projectId, transitionId, updates) {
162
+ return this.client.patch(
163
+ `${this.basePath}/${projectId}/transitions/${transitionId}`,
164
+ updates
165
+ );
166
+ }
167
+ /**
168
+ * Remove a transition
169
+ *
170
+ * Requires: editor:update permission (server-side RBAC enforced)
171
+ */
172
+ async removeTransition(projectId, transitionId) {
173
+ await this.client.delete(
174
+ `${this.basePath}/${projectId}/transitions/${transitionId}`,
175
+ { method: "DELETE" }
176
+ );
177
+ }
178
+ /**
179
+ * Add an effect to an element
180
+ *
181
+ * Requires: editor:update permission
182
+ */
183
+ async addEffect(projectId, effect) {
184
+ return this.client.post(
185
+ `${this.basePath}/${projectId}/effects`,
186
+ effect
187
+ );
188
+ }
189
+ /**
190
+ * Update an effect
191
+ *
192
+ * Requires: editor:update permission
193
+ */
194
+ async updateEffect(projectId, effectId, updates) {
195
+ return this.client.patch(
196
+ `${this.basePath}/${projectId}/effects/${effectId}`,
197
+ updates
198
+ );
199
+ }
200
+ /**
201
+ * Remove an effect
202
+ *
203
+ * Requires: editor:update permission (server-side RBAC enforced)
204
+ */
205
+ async removeEffect(projectId, effectId) {
206
+ await this.client.delete(
207
+ `${this.basePath}/${projectId}/effects/${effectId}`,
208
+ { method: "DELETE" }
209
+ );
210
+ }
211
+ /**
212
+ * Start rendering a project
213
+ *
214
+ * Requires: editor:render permission
215
+ */
216
+ async render(projectId, options) {
217
+ return this.client.post(
218
+ `${this.basePath}/${projectId}/render`,
219
+ options
220
+ );
221
+ }
222
+ /**
223
+ * Get render job status
224
+ *
225
+ * Requires: editor:read permission
226
+ */
227
+ async getRenderJob(projectId, jobId) {
228
+ return this.client.get(
229
+ `${this.basePath}/${projectId}/render/${jobId}`
230
+ );
231
+ }
232
+ /**
233
+ * List render jobs for a project
234
+ *
235
+ * Requires: editor:read permission
236
+ */
237
+ async listRenderJobs(projectId, params) {
238
+ return this.client.get(
239
+ `${this.basePath}/${projectId}/render`,
240
+ { params }
241
+ );
242
+ }
243
+ /**
244
+ * Cancel a render job
245
+ *
246
+ * Requires: editor:render permission
247
+ */
248
+ async cancelRenderJob(projectId, jobId) {
249
+ return this.client.post(
250
+ `${this.basePath}/${projectId}/render/${jobId}/cancel`
251
+ );
252
+ }
253
+ /**
254
+ * Wait for render to complete
255
+ */
256
+ async waitForRender(projectId, jobId, options) {
257
+ const pollInterval = options?.pollInterval || 3e3;
258
+ const timeout = options?.timeout || 18e5;
259
+ const startTime = Date.now();
260
+ while (Date.now() - startTime < timeout) {
261
+ const job = await this.getRenderJob(projectId, jobId);
262
+ if (options?.onProgress) {
263
+ options.onProgress(job);
264
+ }
265
+ if (job.status === "ready") {
266
+ return job;
267
+ }
268
+ if (job.status === "failed") {
269
+ throw new Error(`Render failed: ${job.error || "Unknown error"}`);
270
+ }
271
+ await new Promise((resolve) => setTimeout(resolve, pollInterval));
272
+ }
273
+ throw new Error(`Render timed out after ${timeout}ms`);
274
+ }
275
+ /**
276
+ * Generate a preview frame
277
+ *
278
+ * Requires: editor:read permission
279
+ */
280
+ async getPreviewFrame(projectId, time, options) {
281
+ return this.client.get(`${this.basePath}/${projectId}/preview`, {
282
+ params: { time, ...options }
283
+ });
284
+ }
285
+ /**
286
+ * Generate a preview video segment
287
+ *
288
+ * Requires: editor:read permission
289
+ */
290
+ async getPreviewSegment(projectId, startTime, endTime, options) {
291
+ return this.client.post(`${this.basePath}/${projectId}/preview/segment`, {
292
+ start_time: startTime,
293
+ end_time: endTime,
294
+ ...options
295
+ });
296
+ }
297
+ };
298
+ function createEditorAPI(client) {
299
+ return new EditorAPI(client);
300
+ }
301
+
302
+ export {
303
+ EditorAPI,
304
+ createEditorAPI
305
+ };
@@ -0,0 +1,57 @@
1
+ // src/marketplace.ts
2
+ var MarketplaceAPI = class {
3
+ client;
4
+ basePath = "/v1/marketplace";
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ async list(params) {
9
+ return this.client.get(this.basePath, {
10
+ params
11
+ });
12
+ }
13
+ async get(itemId) {
14
+ return this.client.get(`${this.basePath}/${itemId}`);
15
+ }
16
+ async install(itemId) {
17
+ return this.client.post(`${this.basePath}/${itemId}/install`);
18
+ }
19
+ async uninstall(itemId) {
20
+ await this.client.delete(`${this.basePath}/${itemId}/install`);
21
+ }
22
+ async listInstalled(params) {
23
+ return this.client.get(`${this.basePath}/installed`, {
24
+ params
25
+ });
26
+ }
27
+ async publish(request) {
28
+ return this.client.post(this.basePath, request);
29
+ }
30
+ async update(itemId, updates) {
31
+ return this.client.patch(`${this.basePath}/${itemId}`, updates);
32
+ }
33
+ async deprecate(itemId) {
34
+ await this.client.post(`${this.basePath}/${itemId}/deprecate`);
35
+ }
36
+ async getReviews(itemId, params) {
37
+ return this.client.get(`${this.basePath}/${itemId}/reviews`, {
38
+ params
39
+ });
40
+ }
41
+ async addReview(itemId, review) {
42
+ return this.client.post(`${this.basePath}/${itemId}/reviews`, review);
43
+ }
44
+ async search(query, params) {
45
+ return this.client.get(`${this.basePath}/search`, {
46
+ params: { q: query, ...params }
47
+ });
48
+ }
49
+ };
50
+ function createMarketplaceAPI(client) {
51
+ return new MarketplaceAPI(client);
52
+ }
53
+
54
+ export {
55
+ MarketplaceAPI,
56
+ createMarketplaceAPI
57
+ };