@oursprivacy/platform-sdk 1.44.3 → 1.45.0
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 +16 -0
- package/README.md +3 -5
- package/package.json +4 -1
- package/resources/destinations.d.mts +7 -7
- package/resources/destinations.d.mts.map +1 -1
- package/resources/destinations.d.ts +7 -7
- package/resources/destinations.d.ts.map +1 -1
- package/resources/videos.d.mts +129 -41
- package/resources/videos.d.mts.map +1 -1
- package/resources/videos.d.ts +129 -41
- package/resources/videos.d.ts.map +1 -1
- package/resources/videos.js +90 -14
- package/resources/videos.js.map +1 -1
- package/resources/videos.mjs +90 -14
- package/resources/videos.mjs.map +1 -1
- package/src/resources/destinations.ts +7 -0
- package/src/resources/videos.ts +164 -67
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/videos.ts
CHANGED
|
@@ -10,6 +10,14 @@ export class Videos extends APIResource {
|
|
|
10
10
|
/**
|
|
11
11
|
* List videos for the account, newest first. Supports cursor pagination and an
|
|
12
12
|
* optional case-insensitive title filter. Requires scope: media:list
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* // Automatically fetches more pages as needed.
|
|
17
|
+
* for await (const videoListResponse of client.videos.list()) {
|
|
18
|
+
* // ...
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
13
21
|
*/
|
|
14
22
|
list(
|
|
15
23
|
query: VideoListParams | null | undefined = {},
|
|
@@ -23,6 +31,13 @@ export class Videos extends APIResource {
|
|
|
23
31
|
* or WebM file. Upload the file directly using the returned URL and matching
|
|
24
32
|
* content type, then poll the video to observe processing progress. Requires
|
|
25
33
|
* scope: media:create
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const video = await client.videos.create({
|
|
38
|
+
* mimeType: 'MP4',
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
26
41
|
*/
|
|
27
42
|
create(body: VideoCreateParams, options?: RequestOptions): APIPromise<VideoCreateResponse> {
|
|
28
43
|
return this._client.post('/rest/v1/videos', { body, ...options });
|
|
@@ -32,6 +47,11 @@ export class Videos extends APIResource {
|
|
|
32
47
|
* Fetch a video and its current playback asset availability. The processed video,
|
|
33
48
|
* poster, and transcript are prepared asynchronously after upload. Requires scope:
|
|
34
49
|
* media:find
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const video = await client.videos.retrieve('id');
|
|
54
|
+
* ```
|
|
35
55
|
*/
|
|
36
56
|
retrieve(id: string, options?: RequestOptions): APIPromise<VideoRetrieveResponse> {
|
|
37
57
|
return this._client.get(path`/rest/v1/videos/${id}`, options);
|
|
@@ -40,6 +60,11 @@ export class Videos extends APIResource {
|
|
|
40
60
|
/**
|
|
41
61
|
* Partially update video metadata. Only fields included in the body change; send
|
|
42
62
|
* `null` to clear a nullable field. Requires scope: media:update
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const video = await client.videos.update('id');
|
|
67
|
+
* ```
|
|
43
68
|
*/
|
|
44
69
|
update(id: string, body: VideoUpdateParams, options?: RequestOptions): APIPromise<VideoUpdateResponse> {
|
|
45
70
|
return this._client.patch(path`/rest/v1/videos/${id}`, { body, ...options });
|
|
@@ -47,38 +72,42 @@ export class Videos extends APIResource {
|
|
|
47
72
|
|
|
48
73
|
/**
|
|
49
74
|
* Delete a video and its related assets. Requires scope: media:delete
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const video = await client.videos.delete('id');
|
|
79
|
+
* ```
|
|
50
80
|
*/
|
|
51
81
|
delete(id: string, options?: RequestOptions): APIPromise<VideoDeleteResponse> {
|
|
52
82
|
return this._client.delete(path`/rest/v1/videos/${id}`, options);
|
|
53
83
|
}
|
|
54
84
|
|
|
55
85
|
/**
|
|
56
|
-
* Return
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
*
|
|
67
|
-
* for one video. Daily windows support up to 90 days; hourly windows support up to
|
|
68
|
-
* 14 days. Requires scope: report:video-analytics
|
|
86
|
+
* Return a temporary upload target for replacing this video’s original MP4 or WebM
|
|
87
|
+
* source. Upload the file directly using the returned URL and matching content
|
|
88
|
+
* type, then poll the video to observe processing progress. Requires scope:
|
|
89
|
+
* media:update
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const response = await client.videos.upload('id', {
|
|
94
|
+
* mimeType: 'MP4',
|
|
95
|
+
* });
|
|
96
|
+
* ```
|
|
69
97
|
*/
|
|
70
|
-
|
|
71
|
-
id
|
|
72
|
-
query: VideoAnalyticsTimeseriesParams,
|
|
73
|
-
options?: RequestOptions,
|
|
74
|
-
): APIPromise<VideoAnalyticsTimeseriesResponse> {
|
|
75
|
-
return this._client.get(path`/rest/v1/videos/${id}/analytics`, { query, ...options });
|
|
98
|
+
upload(id: string, body: VideoUploadParams, options?: RequestOptions): APIPromise<VideoUploadResponse> {
|
|
99
|
+
return this._client.post(path`/rest/v1/videos/${id}/upload`, { body, ...options });
|
|
76
100
|
}
|
|
77
101
|
|
|
78
102
|
/**
|
|
79
103
|
* Read the current WebVTT transcript. Transcript text is available wherever the
|
|
80
104
|
* video is embedded, so do not include PHI or other confidential information.
|
|
81
105
|
* Requires scope: media:find
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* const response = await client.videos.transcript('id');
|
|
110
|
+
* ```
|
|
82
111
|
*/
|
|
83
112
|
transcript(id: string, options?: RequestOptions): APIPromise<VideoTranscriptResponse> {
|
|
84
113
|
return this._client.get(path`/rest/v1/videos/${id}/transcript`, options);
|
|
@@ -88,6 +117,14 @@ export class Videos extends APIResource {
|
|
|
88
117
|
* Replace the transcript with VTT or SRT text. SRT is normalized to WebVTT.
|
|
89
118
|
* Transcript text is available wherever the video is embedded, so do not include
|
|
90
119
|
* PHI or other confidential information. Requires scope: media:update
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const response = await client.videos.updateTranscript(
|
|
124
|
+
* 'id',
|
|
125
|
+
* { content: 'x', format: 'SRT' },
|
|
126
|
+
* );
|
|
127
|
+
* ```
|
|
91
128
|
*/
|
|
92
129
|
updateTranscript(
|
|
93
130
|
id: string,
|
|
@@ -96,6 +133,46 @@ export class Videos extends APIResource {
|
|
|
96
133
|
): APIPromise<VideoUpdateTranscriptResponse> {
|
|
97
134
|
return this._client.put(path`/rest/v1/videos/${id}/transcript`, { body, ...options });
|
|
98
135
|
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Return per-video starts, unique viewers, completion rate, and average watch time
|
|
139
|
+
* for a date window. Optionally filter to one video with `videoId`; omit it to
|
|
140
|
+
* include all account videos. This derived report uses `limit` and `offset`
|
|
141
|
+
* pagination; `total` is the number of rows returned through the current offset,
|
|
142
|
+
* not a total match count. Requires scope: report:video-analytics
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```ts
|
|
146
|
+
* const response = await client.videos.analytics({
|
|
147
|
+
* from: '7321-69-10',
|
|
148
|
+
* to: '7321-69-10',
|
|
149
|
+
* });
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
analytics(query: VideoAnalyticsParams, options?: RequestOptions): APIPromise<VideoAnalyticsResponse> {
|
|
153
|
+
return this._client.get('/rest/v1/videos/analytics', { query, ...options });
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Return daily or hourly starts, unique viewers, completions, and completion rate
|
|
158
|
+
* for one video. Daily windows support up to 90 days; hourly windows support up to
|
|
159
|
+
* 14 days. Requires scope: report:video-analytics
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```ts
|
|
163
|
+
* const response = await client.videos.analyticsTimeseries(
|
|
164
|
+
* 'id',
|
|
165
|
+
* { from: '7321-69-10', to: '7321-69-10' },
|
|
166
|
+
* );
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
analyticsTimeseries(
|
|
170
|
+
id: string,
|
|
171
|
+
query: VideoAnalyticsTimeseriesParams,
|
|
172
|
+
options?: RequestOptions,
|
|
173
|
+
): APIPromise<VideoAnalyticsTimeseriesResponse> {
|
|
174
|
+
return this._client.get(path`/rest/v1/videos/${id}/analytics`, { query, ...options });
|
|
175
|
+
}
|
|
99
176
|
}
|
|
100
177
|
|
|
101
178
|
export type VideoListResponsesCursor = Cursor<VideoListResponse>;
|
|
@@ -230,6 +307,44 @@ export interface VideoDeleteResponse {
|
|
|
230
307
|
deleted: true;
|
|
231
308
|
}
|
|
232
309
|
|
|
310
|
+
export interface VideoUploadResponse {
|
|
311
|
+
mimeType: 'MP4' | 'WEBM';
|
|
312
|
+
|
|
313
|
+
url: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export interface VideoTranscriptResponse {
|
|
317
|
+
content?: string | null;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export interface VideoUpdateTranscriptResponse {
|
|
321
|
+
id: string;
|
|
322
|
+
|
|
323
|
+
accountId: string;
|
|
324
|
+
|
|
325
|
+
createdAt: string;
|
|
326
|
+
|
|
327
|
+
type: 'Video';
|
|
328
|
+
|
|
329
|
+
captionsUpdatedAt?: string | null;
|
|
330
|
+
|
|
331
|
+
captionsUpdatedByName?: string | null;
|
|
332
|
+
|
|
333
|
+
description?: string | null;
|
|
334
|
+
|
|
335
|
+
duration?: number | null;
|
|
336
|
+
|
|
337
|
+
hasVideoUpload?: boolean | null;
|
|
338
|
+
|
|
339
|
+
height?: number | null;
|
|
340
|
+
|
|
341
|
+
name?: string | null;
|
|
342
|
+
|
|
343
|
+
updatedAt?: string | null;
|
|
344
|
+
|
|
345
|
+
width?: number | null;
|
|
346
|
+
}
|
|
347
|
+
|
|
233
348
|
export interface VideoAnalyticsResponse {
|
|
234
349
|
hasMore: boolean;
|
|
235
350
|
|
|
@@ -276,38 +391,6 @@ export namespace VideoAnalyticsTimeseriesResponse {
|
|
|
276
391
|
}
|
|
277
392
|
}
|
|
278
393
|
|
|
279
|
-
export interface VideoTranscriptResponse {
|
|
280
|
-
content?: string | null;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
export interface VideoUpdateTranscriptResponse {
|
|
284
|
-
id: string;
|
|
285
|
-
|
|
286
|
-
accountId: string;
|
|
287
|
-
|
|
288
|
-
createdAt: string;
|
|
289
|
-
|
|
290
|
-
type: 'Video';
|
|
291
|
-
|
|
292
|
-
captionsUpdatedAt?: string | null;
|
|
293
|
-
|
|
294
|
-
captionsUpdatedByName?: string | null;
|
|
295
|
-
|
|
296
|
-
description?: string | null;
|
|
297
|
-
|
|
298
|
-
duration?: number | null;
|
|
299
|
-
|
|
300
|
-
hasVideoUpload?: boolean | null;
|
|
301
|
-
|
|
302
|
-
height?: number | null;
|
|
303
|
-
|
|
304
|
-
name?: string | null;
|
|
305
|
-
|
|
306
|
-
updatedAt?: string | null;
|
|
307
|
-
|
|
308
|
-
width?: number | null;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
394
|
export interface VideoListParams extends CursorParams {
|
|
312
395
|
/**
|
|
313
396
|
* Case-insensitive substring match on the video title.
|
|
@@ -343,6 +426,26 @@ export interface VideoUpdateParams {
|
|
|
343
426
|
width?: number | null;
|
|
344
427
|
}
|
|
345
428
|
|
|
429
|
+
export interface VideoUploadParams {
|
|
430
|
+
/**
|
|
431
|
+
* Content type for the replacement original video: `MP4` or `WEBM`.
|
|
432
|
+
*/
|
|
433
|
+
mimeType: 'MP4' | 'WEBM';
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export interface VideoUpdateTranscriptParams {
|
|
437
|
+
/**
|
|
438
|
+
* Transcript text, limited to 1 MB.
|
|
439
|
+
*/
|
|
440
|
+
content: string;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Transcript source format. SRT content is normalized to WebVTT before it is
|
|
444
|
+
* saved.
|
|
445
|
+
*/
|
|
446
|
+
format: 'SRT' | 'VTT';
|
|
447
|
+
}
|
|
448
|
+
|
|
346
449
|
export interface VideoAnalyticsParams {
|
|
347
450
|
/**
|
|
348
451
|
* Inclusive UTC start day in `YYYY-MM-DD` format.
|
|
@@ -364,6 +467,11 @@ export interface VideoAnalyticsParams {
|
|
|
364
467
|
* exception.
|
|
365
468
|
*/
|
|
366
469
|
offset?: number | null;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Filter analytics to one video by its ID. Omit to include all account videos.
|
|
473
|
+
*/
|
|
474
|
+
videoId?: string;
|
|
367
475
|
}
|
|
368
476
|
|
|
369
477
|
export interface VideoAnalyticsTimeseriesParams {
|
|
@@ -383,19 +491,6 @@ export interface VideoAnalyticsTimeseriesParams {
|
|
|
383
491
|
granularity?: 'DAILY' | 'HOURLY';
|
|
384
492
|
}
|
|
385
493
|
|
|
386
|
-
export interface VideoUpdateTranscriptParams {
|
|
387
|
-
/**
|
|
388
|
-
* Transcript text, limited to 1 MB.
|
|
389
|
-
*/
|
|
390
|
-
content: string;
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* Transcript source format. SRT content is normalized to WebVTT before it is
|
|
394
|
-
* saved.
|
|
395
|
-
*/
|
|
396
|
-
format: 'SRT' | 'VTT';
|
|
397
|
-
}
|
|
398
|
-
|
|
399
494
|
export declare namespace Videos {
|
|
400
495
|
export {
|
|
401
496
|
type VideoListResponse as VideoListResponse,
|
|
@@ -403,16 +498,18 @@ export declare namespace Videos {
|
|
|
403
498
|
type VideoRetrieveResponse as VideoRetrieveResponse,
|
|
404
499
|
type VideoUpdateResponse as VideoUpdateResponse,
|
|
405
500
|
type VideoDeleteResponse as VideoDeleteResponse,
|
|
406
|
-
type
|
|
407
|
-
type VideoAnalyticsTimeseriesResponse as VideoAnalyticsTimeseriesResponse,
|
|
501
|
+
type VideoUploadResponse as VideoUploadResponse,
|
|
408
502
|
type VideoTranscriptResponse as VideoTranscriptResponse,
|
|
409
503
|
type VideoUpdateTranscriptResponse as VideoUpdateTranscriptResponse,
|
|
504
|
+
type VideoAnalyticsResponse as VideoAnalyticsResponse,
|
|
505
|
+
type VideoAnalyticsTimeseriesResponse as VideoAnalyticsTimeseriesResponse,
|
|
410
506
|
type VideoListResponsesCursor as VideoListResponsesCursor,
|
|
411
507
|
type VideoListParams as VideoListParams,
|
|
412
508
|
type VideoCreateParams as VideoCreateParams,
|
|
413
509
|
type VideoUpdateParams as VideoUpdateParams,
|
|
510
|
+
type VideoUploadParams as VideoUploadParams,
|
|
511
|
+
type VideoUpdateTranscriptParams as VideoUpdateTranscriptParams,
|
|
414
512
|
type VideoAnalyticsParams as VideoAnalyticsParams,
|
|
415
513
|
type VideoAnalyticsTimeseriesParams as VideoAnalyticsTimeseriesParams,
|
|
416
|
-
type VideoUpdateTranscriptParams as VideoUpdateTranscriptParams,
|
|
417
514
|
};
|
|
418
515
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.45.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.45.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.45.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.45.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|