From 25afd04dfde279c0bc146847aac87318bbcc3597 Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Mon, 16 Sep 2024 14:20:31 +0000 Subject: [PATCH] Add discarded videos feature --- CHANGELOG.md | 3 + README.md | 4 + docs/api/LiveStreamsApi.md | 2 +- docs/api/PlayerThemesApi.md | 2 +- docs/api/UploadTokensApi.md | 2 +- docs/api/VideosApi.md | 84 ++++- docs/model/DiscardedVideoUpdatePayload.md | 11 + docs/model/LiveStream.md | 4 +- docs/model/PlayerSessionEvent.md | 2 +- docs/model/PlayerTheme.md | 4 +- docs/model/UploadToken.md | 4 +- docs/model/Video.md | 11 +- docs/model/VideoCreationPayload.md | 2 +- docs/model/VideoUpdatePayload.md | 2 +- docs/model/Watermark.md | 2 +- docs/model/Webhook.md | 2 +- package.json | 8 +- src/HttpClient.ts | 2 +- src/ObjectSerializer.ts | 2 + src/api/LiveStreamsApi.ts | 4 +- src/api/PlayerThemesApi.ts | 4 +- src/api/UploadTokensApi.ts | 4 +- src/api/VideosApi.ts | 312 +++++++++++++++++- src/model/DiscardedVideoUpdatePayload.ts | 34 ++ src/model/LiveStream.ts | 4 +- src/model/PlayerSessionEvent.ts | 2 +- src/model/PlayerTheme.ts | 4 +- src/model/UploadToken.ts | 4 +- src/model/Video.ts | 38 ++- src/model/VideoCreationPayload.ts | 2 +- src/model/VideoUpdatePayload.ts | 2 +- src/model/Watermark.ts | 2 +- src/model/Webhook.ts | 2 +- .../getMetricsOverTime/responses200.json | 6 +- .../livestreams/create/responses200.json | 4 +- .../livestreams/get/responses200.json | 4 +- .../livestreams/list/responses200.json | 8 +- .../livestreams/update/responses200.json | 4 +- .../createToken/responses200.json | 4 +- .../uploadtokens/getToken/responses200.json | 2 +- .../uploadtokens/list/responses200.json | 6 +- test/payloads/videos/create/responses201.json | 3 +- test/payloads/videos/create/responses400.json | 2 +- test/payloads/videos/get/responses200.json | 5 +- .../videos/getDiscarded/responses200.json | 25 ++ .../videos/getDiscarded/responses404.json | 6 + .../videos/getDiscarded/responses429.json | 5 + test/payloads/videos/list/responses200.json | 15 +- .../videos/listDiscarded/responses200.json | 91 +++++ .../videos/listDiscarded/responses400.json | 22 ++ .../videos/listDiscarded/responses429.json | 5 + .../videos/pickThumbnail/responses200.json | 3 +- test/payloads/videos/update/responses200.json | 5 +- .../videos/updateDiscarded/responses200.json | 25 ++ .../videos/updateDiscarded/responses400.json | 7 + .../videos/updateDiscarded/responses404.json | 6 + .../videos/updateDiscarded/responses429.json | 5 + test/payloads/videos/upload/responses201.json | 3 +- .../videos/uploadThumbnail/responses200.json | 5 +- .../uploadWithUploadToken/responses201.json | 3 +- .../watermarks/list/responses200.json | 4 +- .../watermarks/upload/responses200.json | 2 +- .../webhooks/create/responses201.json | 2 +- test/payloads/webhooks/get/responses200.json | 2 +- test/payloads/webhooks/list/responses200.json | 4 +- tsconfig.json | 3 +- 66 files changed, 774 insertions(+), 93 deletions(-) create mode 100644 docs/model/DiscardedVideoUpdatePayload.md create mode 100644 src/model/DiscardedVideoUpdatePayload.ts create mode 100644 test/payloads/videos/getDiscarded/responses200.json create mode 100644 test/payloads/videos/getDiscarded/responses404.json create mode 100644 test/payloads/videos/getDiscarded/responses429.json create mode 100644 test/payloads/videos/listDiscarded/responses200.json create mode 100644 test/payloads/videos/listDiscarded/responses400.json create mode 100644 test/payloads/videos/listDiscarded/responses429.json create mode 100644 test/payloads/videos/updateDiscarded/responses200.json create mode 100644 test/payloads/videos/updateDiscarded/responses400.json create mode 100644 test/payloads/videos/updateDiscarded/responses404.json create mode 100644 test/payloads/videos/updateDiscarded/responses429.json diff --git a/CHANGELOG.md b/CHANGELOG.md index eec6941..783e16a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [2.6.2] - 2024-09-16 +- Add discarded video endpoints + ## [2.6.1] - 2024-09-05 - Add sort parameters in analytics endpoints diff --git a/README.md b/README.md index 39531fc..8e591aa 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,10 @@ Method | Description | HTTP request [**list()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#list) | List all video objects | **GET** `/videos` [**uploadThumbnail()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#uploadThumbnail) | Upload a thumbnail | **POST** `/videos/{videoId}/thumbnail` [**pickThumbnail()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#pickThumbnail) | Set a thumbnail | **PATCH** `/videos/{videoId}/thumbnail` +[**getDiscarded()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#getDiscarded) | Retrieve a discarded video object | **GET** `/discarded/videos/{videoId}` [**getStatus()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#getStatus) | Retrieve video status and details | **GET** `/videos/{videoId}/status` +[**listDiscarded()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#listDiscarded) | List all discarded video objects | **GET** `/discarded/videos` +[**updateDiscarded()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#updateDiscarded) | Update a discarded video object | **PATCH** `/discarded/videos/{videoId}` #### WatermarksApi @@ -231,6 +234,7 @@ Method | Description | HTTP request - [CaptionsUpdatePayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/CaptionsUpdatePayload.md) - [Chapter](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/Chapter.md) - [ChaptersListResponse](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/ChaptersListResponse.md) + - [DiscardedVideoUpdatePayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/DiscardedVideoUpdatePayload.md) - [FilterBy](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy.md) - [FilterBy1](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy1.md) - [FilterBy2](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy2.md) diff --git a/docs/api/LiveStreamsApi.md b/docs/api/LiveStreamsApi.md index 8e5f267..a1beeea 100644 --- a/docs/api/LiveStreamsApi.md +++ b/docs/api/LiveStreamsApi.md @@ -115,7 +115,7 @@ Get the list of livestreams on the workspace. | ------------- | ------------- | ------------- | ------------- | | **streamKey** | **string**| no| The unique stream key that allows you to stream videos. | | **name** | **string**| no| You can filter live streams by their name or a part of their name. | - | **sortBy** | **'name' \| 'createdAt' \| 'updatedAt'**| no| Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ISO-8601 time format. | + | **sortBy** | **'name' \| 'createdAt' \| 'updatedAt'**| no| Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. | | **sortOrder** | **'asc' \| 'desc'**| no| Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. | | **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 | | **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. | diff --git a/docs/api/PlayerThemesApi.md b/docs/api/PlayerThemesApi.md index a26d8fa..b072207 100644 --- a/docs/api/PlayerThemesApi.md +++ b/docs/api/PlayerThemesApi.md @@ -114,7 +114,7 @@ Retrieve a list of all the player themes you created, as well as details about e | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **sortBy** | **'name' \| 'createdAt' \| 'updatedAt'**| no| createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format. | + | **sortBy** | **'name' \| 'createdAt' \| 'updatedAt'**| no| createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format. | | **sortOrder** | **'asc' \| 'desc'**| no| Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. | | **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 | | **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. | diff --git a/docs/api/UploadTokensApi.md b/docs/api/UploadTokensApi.md index d0ef30b..2dd7d83 100644 --- a/docs/api/UploadTokensApi.md +++ b/docs/api/UploadTokensApi.md @@ -86,7 +86,7 @@ Retrieve a list of all currently active delegated tokens. | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **sortBy** | **'createdAt' \| 'ttl'**| no| Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ISO-8601 format. | + | **sortBy** | **'createdAt' \| 'ttl'**| no| Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ATOM UTC format. | | **sortOrder** | **'asc' \| 'desc'**| no| Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-A. | | **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 | | **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. | diff --git a/docs/api/VideosApi.md b/docs/api/VideosApi.md index bd16adf..9bb5771 100644 --- a/docs/api/VideosApi.md +++ b/docs/api/VideosApi.md @@ -13,7 +13,10 @@ All URIs are relative to *https://ws.api.video* | [**list()**](VideosApi.md#list) | List all video objects | **GET** /videos | | [**uploadThumbnail()**](VideosApi.md#uploadThumbnail) | Upload a thumbnail | **POST** /videos/{videoId}/thumbnail | | [**pickThumbnail()**](VideosApi.md#pickThumbnail) | Set a thumbnail | **PATCH** /videos/{videoId}/thumbnail | +| [**getDiscarded()**](VideosApi.md#getDiscarded) | Retrieve a discarded video object | **GET** /discarded/videos/{videoId} | | [**getStatus()**](VideosApi.md#getStatus) | Retrieve video status and details | **GET** /videos/{videoId}/status | +| [**listDiscarded()**](VideosApi.md#listDiscarded) | List all discarded video objects | **GET** /discarded/videos | +| [**updateDiscarded()**](VideosApi.md#updateDiscarded) | Update a discarded video object | **PATCH** /discarded/videos/{videoId} | @@ -217,7 +220,7 @@ Promise<[**Video**](../model/Video.md)>. ## **`delete()` - Delete a video object** -If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. +If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. By default, deleted videos cannot be recovered. If you have the Video Restore feature enabled, this operation will discard the video instead of permanently deleting it. Make sure you subscribe to the Video Restore feature if you want to be able to restore deleted videos! The Video Restore feature retains videos for 90 days, after which the videos are permanently deleted ### Parameters @@ -247,7 +250,7 @@ This method returns a list of your videos (with all their details). With no para | ------------- | ------------- | ------------- | ------------- | | **title** | **string**| no| The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. | | **tags** | **Array<string>**| no| A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. | - | **metadata** | **{ [key: string]: string; }**| no| Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. | + | **metadata** | **{ [key: string]: string; }**| no| Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. | | **description** | **string**| no| Retrieve video objects by `description`. | | **liveStreamId** | **string**| no| Retrieve video objects that were recorded from a live stream by `liveStreamId`. | | **sortBy** | **'title' \| 'createdAt' \| 'publishedAt' \| 'updatedAt'**| no| Use this parameter to sort videos by the their created time, published time, updated time, or by title. | @@ -331,6 +334,28 @@ Promise<[**Video**](../model/Video.md)>. +--- + + +## **`getDiscarded()` - Retrieve a discarded video object** + + +This call provides the same information provided on video creation. For private videos, it will generate a unique token url. Use this to retrieve any details you need about a video, or set up a private viewing URL. + +### Parameters + +| Name | Type | Required | Description | +| ------------- | ------------- | ------------- | ------------- | + | **videoId** | **string**| **yes**| The unique identifier for the video you want details about. | + + +### Return type + +Promise<[**Video**](../model/Video.md)>. + + + + --- @@ -353,5 +378,60 @@ Promise<[**VideoStatus**](../model/VideoStatus.md)>. +--- + + +## **`listDiscarded()` - List all discarded video objects** + + +This method returns a list of your discarded videos (with all their details). With no parameters added, the API returns the first page of all discarded videos. You can filter discarded videos using the parameters described below. + +### Parameters + +| Name | Type | Required | Description | +| ------------- | ------------- | ------------- | ------------- | + | **title** | **string**| no| The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. | + | **tags** | **Array<string>**| no| A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. | + | **metadata** | **{ [key: string]: string; }**| no| Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. | + | **description** | **string**| no| Retrieve video objects by `description`. | + | **liveStreamId** | **string**| no| Retrieve video objects that were recorded from a live stream by `liveStreamId`. | + | **sortBy** | **'title' \| 'createdAt' \| 'publishedAt' \| 'updatedAt'**| no| Use this parameter to sort videos by the their created time, published time, updated time, or by title. | + | **sortOrder** | **'asc' \| 'desc'**| no| Use this parameter to sort results. `asc` is ascending and sorts from A to Z. `desc` is descending and sorts from Z to A. | + | **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 | + | **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. | + + +### Return type + +Promise<[**VideosListResponse**](../model/VideosListResponse.md)>. + + + + +--- + + +## **`updateDiscarded()` - Update a discarded video object** + + +Use this endpoint to restore a discarded video when you have the Video Restore feature enabled. + + + +### Parameters + +| Name | Type | Required | Description | +| ------------- | ------------- | ------------- | ------------- | + | **videoId** | **string**| **yes**| The video ID for the video you want to restore. | + | **discardedVideoUpdatePayload** | [**DiscardedVideoUpdatePayload**](../model/DiscardedVideoUpdatePayload.md)| **yes**| | + + +### Return type + +Promise<[**Video**](../model/Video.md)>. + + + + --- diff --git a/docs/model/DiscardedVideoUpdatePayload.md b/docs/model/DiscardedVideoUpdatePayload.md new file mode 100644 index 0000000..67a75d6 --- /dev/null +++ b/docs/model/DiscardedVideoUpdatePayload.md @@ -0,0 +1,11 @@ + +# DiscardedVideoUpdatePayload + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**discarded** | **boolean** | Use this parameter to restore a discarded video when you have the Video Restore feature enabled. This parameter only accepts `false` as a value! | [optional] + + + diff --git a/docs/model/LiveStream.md b/docs/model/LiveStream.md index 6a763e4..542d84c 100644 --- a/docs/model/LiveStream.md +++ b/docs/model/LiveStream.md @@ -13,8 +13,8 @@ Name | Type | Description | Notes **playerId** | **string** | The unique identifier for the player. | [optional] **broadcasting** | **boolean** | Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not. | [optional] **restreams** | [**Array<RestreamsResponseObject>**](RestreamsResponseObject.md) | Returns the list of restream destinations. | -**createdAt** | **Date** | When the player was created, presented in ISO-8601 format. | [optional] -**updatedAt** | **Date** | When the player was last updated, presented in ISO-8601 format. | [optional] +**createdAt** | **Date** | When the player was created, presented in ATOM UTC format. | [optional] +**updatedAt** | **Date** | When the player was last updated, presented in ATOM UTC format. | [optional] diff --git a/docs/model/PlayerSessionEvent.md b/docs/model/PlayerSessionEvent.md index 6518f86..24f008a 100644 --- a/docs/model/PlayerSessionEvent.md +++ b/docs/model/PlayerSessionEvent.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **string** | Possible values are: ready, play, pause, resume, seek.backward, seek.forward, end | [optional] -**emittedAt** | **Date** | When an event occurred, presented in ISO-8601 format. | [optional] +**emittedAt** | **Date** | When an event occurred, presented in ATOM UTC format. | [optional] **at** | **number** | | [optional] **from** | **number** | | [optional] **to** | **number** | | [optional] diff --git a/docs/model/PlayerTheme.md b/docs/model/PlayerTheme.md index 3ea4259..df71d85 100644 --- a/docs/model/PlayerTheme.md +++ b/docs/model/PlayerTheme.md @@ -22,8 +22,8 @@ Name | Type | Description | Notes **hideTitle** | **boolean** | enable/disable title. Default: false | [optional] **forceLoop** | **boolean** | enable/disable looping. Default: false | [optional] **playerId** | **string** | | -**createdAt** | **Date** | When the player was created, presented in ISO-8601 format. | [optional] -**updatedAt** | **Date** | When the player was last updated, presented in ISO-8601 format. | [optional] +**createdAt** | **Date** | When the player was created, presented in ATOM UTC format. | [optional] +**updatedAt** | **Date** | When the player was last updated, presented in ATOM UTC format. | [optional] **assets** | [**PlayerThemeAssets**](PlayerThemeAssets.md) | | [optional] diff --git a/docs/model/UploadToken.md b/docs/model/UploadToken.md index 8645bdf..1f86d3c 100644 --- a/docs/model/UploadToken.md +++ b/docs/model/UploadToken.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **token** | **string** | The unique identifier for the token you will use to authenticate an upload. | [optional] **ttl** | **number** | Time-to-live - how long the upload token is valid for. | [optional] -**createdAt** | **Date** | When the token was created, displayed in ISO-8601 format. | [optional] -**expiresAt** | **Date** | When the token expires, displayed in ISO-8601 format. | [optional] +**createdAt** | **Date** | When the token was created, displayed in ATOM UTC format. | [optional] +**expiresAt** | **Date** | When the token expires, displayed in ATOM UTC format. | [optional] diff --git a/docs/model/Video.md b/docs/model/Video.md index 7409649..33d40b7 100644 --- a/docs/model/Video.md +++ b/docs/model/Video.md @@ -6,13 +6,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **videoId** | **string** | The unique identifier of the video object. | -**createdAt** | **Date** | When a video was created, presented in ISO-8601 format. | [optional] +**createdAt** | **Date** | When a video was created, presented in ATOM UTC format. | [optional] **title** | **string** | The title of the video content. | [optional] **description** | **string** | A description for the video content. | [optional] -**publishedAt** | **Date** | The date and time the API created the video. Date and time are provided using ISO-8601 UTC format. | [optional] -**updatedAt** | **Date** | The date and time the video was updated. Date and time are provided using ISO-8601 UTC format. | [optional] +**publishedAt** | **Date** | The date and time the API created the video. Date and time are provided using ATOM UTC format. | [optional] +**updatedAt** | **Date** | The date and time the video was updated. Date and time are provided using ATOM UTC format. | [optional] +**discardedAt** | **Date** | The date and time the video was discarded. The API populates this field only if you have the Video Restore feature enabled and discard a video. Date and time are provided using ATOM UTC format. | [optional] +**deletesAt** | **Date** | The date and time the video will be permanently deleted. The API populates this field only if you have the Video Restore feature enabled and discard a video. Discarded videos are pemanently deleted after 90 days. Date and time are provided using ATOM UTC format. | [optional] +**discarded** | **boolean** | Returns `true` for videos you discarded when you have the Video Restore feature enabled. Returns `false` for every other video. | [optional] **tags** | **Array<string>** | One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. | [optional] -**metadata** | [**Array<Metadata>**](Metadata.md) | Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. | [optional] +**metadata** | [**Array<Metadata>**](Metadata.md) | Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. | [optional] **source** | [**VideoSource**](VideoSource.md) | | [optional] **assets** | [**VideoAssets**](VideoAssets.md) | | [optional] **playerId** | **string** | The id of the player that will be applied on the video. | [optional] diff --git a/docs/model/VideoCreationPayload.md b/docs/model/VideoCreationPayload.md index d6c4d3d..66a5253 100644 --- a/docs/model/VideoCreationPayload.md +++ b/docs/model/VideoCreationPayload.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **mp4Support** | **boolean** | Enables mp4 version in addition to streamed version. | [optional] **playerId** | **string** | The unique identification number for your video player. | [optional] **tags** | **Array<string>** | A list of tags you want to use to describe your video. | [optional] -**metadata** | [**Array<Metadata>**](Metadata.md) | A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. Read more on [dynamic metadata](https://api.video/blog/endpoints/dynamic-metadata/). | [optional] +**metadata** | [**Array<Metadata>**](Metadata.md) | A list of key value pairs that you use to provide metadata for your video. | [optional] **clip** | [**VideoClip**](VideoClip.md) | | [optional] **watermark** | [**VideoWatermark**](VideoWatermark.md) | | [optional] diff --git a/docs/model/VideoUpdatePayload.md b/docs/model/VideoUpdatePayload.md index 41a4822..ac0c9fe 100644 --- a/docs/model/VideoUpdatePayload.md +++ b/docs/model/VideoUpdatePayload.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **panoramic** | **boolean** | Whether the video is a 360 degree or immersive video. | [optional] **mp4Support** | **boolean** | Whether the player supports the mp4 format. | [optional] **tags** | **Array<string>** | A list of terms or words you want to tag the video with. Make sure the list includes all the tags you want as whatever you send in this list will overwrite the existing list for the video. | [optional] -**metadata** | [**Array<Metadata>**](Metadata.md) | A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. | [optional] +**metadata** | [**Array<Metadata>**](Metadata.md) | A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. | [optional] diff --git a/docs/model/Watermark.md b/docs/model/Watermark.md index cd72bf1..573c4c1 100644 --- a/docs/model/Watermark.md +++ b/docs/model/Watermark.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **watermarkId** | **string** | The unique identifier of the watermark. | [optional] -**createdAt** | **Date** | When the watermark was created, presented in ISO-8601 format. | [optional] +**createdAt** | **Date** | When the watermark was created, presented in ATOM UTC format. | [optional] diff --git a/docs/model/Webhook.md b/docs/model/Webhook.md index f37efa8..81817df 100644 --- a/docs/model/Webhook.md +++ b/docs/model/Webhook.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **webhookId** | **string** | Unique identifier of the webhook | [optional] -**createdAt** | **Date** | When an webhook was created, presented in ISO-8601 format. | [optional] +**createdAt** | **Date** | When an webhook was created, presented in ATOM UTC format. | [optional] **events** | **Array<string>** | A list of events that will trigger the webhook. | [optional] **url** | **string** | URL of the webhook | [optional] diff --git a/package.json b/package.json index 08ef359..0468b83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@api.video/nodejs-client", - "version": "2.6.1", + "version": "2.6.2", "description": "api.video nodejs API client", "keywords": [ "api.video", @@ -24,7 +24,8 @@ "lib/", "dist/", "doc/", - "test/sandbox.spec.ts" + "test/sandbox.spec.ts", + "tsconfig.json" ], "scripts": { "build": "tsc", @@ -32,7 +33,8 @@ "clean": "rm -rf dist && rm -rf lib", "test": "jest", "eslint": "eslint 'src/**/*.ts' 'test/**/*.ts'", - "prettier": "prettier --ignore-path .gitignore --write \"**/*.ts\" && npx eslint src/ test/ --fix" + "prettier": "prettier --ignore-path .gitignore --write \"**/*.ts\" && npx eslint src/ test/ --fix", + "postinstall": "if [ ! -d \"lib\" ]; then npm run build; fi" }, "dependencies": { "axios": "^1.4.0", diff --git a/src/HttpClient.ts b/src/HttpClient.ts index 70d0d7e..2a2f620 100644 --- a/src/HttpClient.ts +++ b/src/HttpClient.ts @@ -59,7 +59,7 @@ export default class HttpClient { this.chunkSize = params.chunkSize; this.headers = new AxiosHeaders({ Accept: 'application/json, */*;q=0.8', - 'AV-Origin-Client': 'nodejs:2.6.1', + 'AV-Origin-Client': 'nodejs:2.6.2', Authorization: this.apiKey ? `Basic ${encode(`${this.apiKey}:`)}` : '', ...(params.applicationName && params.applicationVersion ? { diff --git a/src/ObjectSerializer.ts b/src/ObjectSerializer.ts index aaa30ec..f0b667a 100644 --- a/src/ObjectSerializer.ts +++ b/src/ObjectSerializer.ts @@ -32,6 +32,7 @@ import CaptionsListResponse from './model/CaptionsListResponse'; import CaptionsUpdatePayload from './model/CaptionsUpdatePayload'; import Chapter from './model/Chapter'; import ChaptersListResponse from './model/ChaptersListResponse'; +import DiscardedVideoUpdatePayload from './model/DiscardedVideoUpdatePayload'; import FilterBy from './model/FilterBy'; import FilterBy1 from './model/FilterBy1'; import FilterBy2 from './model/FilterBy2'; @@ -146,6 +147,7 @@ const typeMap: { [index: string]: any } = { CaptionsUpdatePayload: CaptionsUpdatePayload, Chapter: Chapter, ChaptersListResponse: ChaptersListResponse, + DiscardedVideoUpdatePayload: DiscardedVideoUpdatePayload, FilterBy: FilterBy, FilterBy1: FilterBy1, FilterBy2: FilterBy2, diff --git a/src/api/LiveStreamsApi.ts b/src/api/LiveStreamsApi.ts index 0ca6ff5..5135472 100644 --- a/src/api/LiveStreamsApi.ts +++ b/src/api/LiveStreamsApi.ts @@ -283,7 +283,7 @@ export default class LiveStreamsApi { * @param {Object} searchParams * @param { string } searchParams.streamKey The unique stream key that allows you to stream videos. * @param { string } searchParams.name You can filter live streams by their name or a part of their name. - * @param { 'name' | 'createdAt' | 'updatedAt' } searchParams.sortBy Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ISO-8601 time format. + * @param { 'name' | 'createdAt' | 'updatedAt' } searchParams.sortBy Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. * @param { 'asc' | 'desc' } searchParams.sortOrder Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. @@ -307,7 +307,7 @@ export default class LiveStreamsApi { * @param {Object} searchParams * @param { string } searchParams.streamKey The unique stream key that allows you to stream videos. * @param { string } searchParams.name You can filter live streams by their name or a part of their name. - * @param { 'name' | 'createdAt' | 'updatedAt' } searchParams.sortBy Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ISO-8601 time format. + * @param { 'name' | 'createdAt' | 'updatedAt' } searchParams.sortBy Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. * @param { 'asc' | 'desc' } searchParams.sortOrder Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. diff --git a/src/api/PlayerThemesApi.ts b/src/api/PlayerThemesApi.ts index 0693573..c18f638 100644 --- a/src/api/PlayerThemesApi.ts +++ b/src/api/PlayerThemesApi.ts @@ -272,7 +272,7 @@ export default class PlayerThemesApi { * Retrieve a list of all the player themes you created, as well as details about each one. * List all player themes * @param {Object} searchParams - * @param { 'name' | 'createdAt' | 'updatedAt' } searchParams.sortBy createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format. + * @param { 'name' | 'createdAt' | 'updatedAt' } searchParams.sortBy createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format. * @param { 'asc' | 'desc' } searchParams.sortOrder Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. @@ -292,7 +292,7 @@ export default class PlayerThemesApi { * Retrieve a list of all the player themes you created, as well as details about each one. * List all player themes * @param {Object} searchParams - * @param { 'name' | 'createdAt' | 'updatedAt' } searchParams.sortBy createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format. + * @param { 'name' | 'createdAt' | 'updatedAt' } searchParams.sortBy createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format. * @param { 'asc' | 'desc' } searchParams.sortOrder Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. diff --git a/src/api/UploadTokensApi.ts b/src/api/UploadTokensApi.ts index ee8e6cf..2074541 100644 --- a/src/api/UploadTokensApi.ts +++ b/src/api/UploadTokensApi.ts @@ -195,7 +195,7 @@ export default class UploadTokensApi { * Retrieve a list of all currently active delegated tokens. * List all active upload tokens * @param {Object} searchParams - * @param { 'createdAt' | 'ttl' } searchParams.sortBy Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ISO-8601 format. + * @param { 'createdAt' | 'ttl' } searchParams.sortBy Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ATOM UTC format. * @param { 'asc' | 'desc' } searchParams.sortOrder Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-A. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. @@ -215,7 +215,7 @@ export default class UploadTokensApi { * Retrieve a list of all currently active delegated tokens. * List all active upload tokens * @param {Object} searchParams - * @param { 'createdAt' | 'ttl' } searchParams.sortBy Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ISO-8601 format. + * @param { 'createdAt' | 'ttl' } searchParams.sortBy Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ATOM UTC format. * @param { 'asc' | 'desc' } searchParams.sortOrder Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-A. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. diff --git a/src/api/VideosApi.ts b/src/api/VideosApi.ts index 4de5ecf..158e226 100644 --- a/src/api/VideosApi.ts +++ b/src/api/VideosApi.ts @@ -16,6 +16,7 @@ import FormData from 'form-data'; import ObjectSerializer from '../ObjectSerializer'; import HttpClient, { QueryOptions, ApiResponseHeaders } from '../HttpClient'; import ProgressiveSession from '../model/ProgressiveSession'; +import DiscardedVideoUpdatePayload from '../model/DiscardedVideoUpdatePayload'; import Video from '../model/Video'; import VideoCreationPayload from '../model/VideoCreationPayload'; import VideoStatus from '../model/VideoStatus'; @@ -839,7 +840,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo } /** - * If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. + * If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. By default, deleted videos cannot be recovered. If you have the Video Restore feature enabled, this operation will discard the video instead of permanently deleting it. Make sure you subscribe to the Video Restore feature if you want to be able to restore deleted videos! The Video Restore feature retains videos for 90 days, after which the videos are permanently deleted * Delete a video object * @param videoId The video ID for the video you want to delete. */ @@ -848,7 +849,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo } /** - * If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. + * If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. By default, deleted videos cannot be recovered. If you have the Video Restore feature enabled, this operation will discard the video instead of permanently deleting it. Make sure you subscribe to the Video Restore feature if you want to be able to restore deleted videos! The Video Restore feature retains videos for 90 days, after which the videos are permanently deleted * Delete a video object * @param videoId The video ID for the video you want to delete. */ @@ -890,7 +891,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo * @param {Object} searchParams * @param { string } searchParams.title The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. * @param { Array<string> } searchParams.tags A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. - * @param { { [key: string]: string; } } searchParams.metadata Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. + * @param { { [key: string]: string; } } searchParams.metadata Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. * @param { string } searchParams.description Retrieve video objects by `description`. * @param { string } searchParams.liveStreamId Retrieve video objects that were recorded from a live stream by `liveStreamId`. * @param { 'title' | 'createdAt' | 'publishedAt' | 'updatedAt' } searchParams.sortBy Use this parameter to sort videos by the their created time, published time, updated time, or by title. @@ -920,7 +921,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo * @param {Object} searchParams * @param { string } searchParams.title The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. * @param { Array<string> } searchParams.tags A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. - * @param { { [key: string]: string; } } searchParams.metadata Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. + * @param { { [key: string]: string; } } searchParams.metadata Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. * @param { string } searchParams.description Retrieve video objects by `description`. * @param { string } searchParams.liveStreamId Retrieve video objects that were recorded from a live stream by `liveStreamId`. * @param { 'title' | 'createdAt' | 'publishedAt' | 'updatedAt' } searchParams.sortBy Use this parameter to sort videos by the their created time, published time, updated time, or by title. @@ -1248,6 +1249,54 @@ There may be a short delay for the thumbnail to update. }); } + /** + * This call provides the same information provided on video creation. For private videos, it will generate a unique token url. Use this to retrieve any details you need about a video, or set up a private viewing URL. + * Retrieve a discarded video object + * @param videoId The unique identifier for the video you want details about. + */ + public async getDiscarded(videoId: string): Promise