Skip to content

Commit c6021bf

Browse files
Merge pull request #226 from apivideo/add-video-tags-endpoint
Add video tags endpoint
2 parents 5e74aa0 + 2a79cdb commit c6021bf

19 files changed

+363
-14
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog
22
All changes to this project will be documented in this file.
33

4+
## [2.6.3] - 2024-09-30
5+
- Add /tags API endpoint
6+
47
## [2.6.2] - 2024-09-16
58
- Add discarded video endpoints
69

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- [ChaptersApi](#chaptersapi)
2121
- [LiveStreamsApi](#livestreamsapi)
2222
- [PlayerThemesApi](#playerthemesapi)
23+
- [TagsApi](#tagsapi)
2324
- [UploadTokensApi](#uploadtokensapi)
2425
- [VideosApi](#videosapi)
2526
- [WatermarksApi](#watermarksapi)
@@ -161,6 +162,13 @@ Method | Description | HTTP request
161162
[**deleteLogo()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/PlayerThemesApi.md#deleteLogo) | Delete logo | **DELETE** `/players/{playerId}/logo`
162163

163164

165+
#### TagsApi
166+
167+
Method | Description | HTTP request
168+
------------- | ------------- | -------------
169+
[**list()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/TagsApi.md#list) | List all video tags | **GET** `/tags`
170+
171+
164172
#### UploadTokensApi
165173

166174
Method | Description | HTTP request
@@ -239,6 +247,8 @@ Method | Description | HTTP request
239247
- [FilterBy1](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy1.md)
240248
- [FilterBy2](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy2.md)
241249
- [Link](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/Link.md)
250+
- [ListTagsResponse](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/ListTagsResponse.md)
251+
- [ListTagsResponseData](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/ListTagsResponseData.md)
242252
- [LiveStream](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/LiveStream.md)
243253
- [LiveStreamAssets](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/LiveStreamAssets.md)
244254
- [LiveStreamCreationPayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/LiveStreamCreationPayload.md)

docs/api/TagsApi.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# TagsApi
2+
3+
All URIs are relative to *https://ws.api.video*
4+
5+
| Method | Description | HTTP request |
6+
| ------------- | ------------- | ------------- |
7+
| [**list()**](TagsApi.md#list) | List all video tags | **GET** /tags |
8+
9+
10+
<a name="list"></a>
11+
## **`list()` - List all video tags**
12+
13+
14+
This endpoint enables you to search for video tags in a project and see how many videos are tagged with them. If you do not define any query parameters, the endpoint lists all video tags and the numbers of times they are used in a project.
15+
16+
### Parameters
17+
18+
| Name | Type | Required | Description |
19+
| ------------- | ------------- | ------------- | ------------- |
20+
| **value** | **string**| no| Use this parameter to search for specific video tags. The API filters results even on partial values, and ignores accents, uppercase, and lowercase. |
21+
| **sortBy** | **&#39;value&#39; \| &#39;videoCount&#39;**| no| Use this parameter to choose which field the API will use to sort the response data. The default is &#x60;value&#x60;. These are the available fields to sort by: - &#x60;value&#x60;: Sorts the results based on tag values in alphabetic order. - &#x60;videoCount&#x60;: Sorts the results based on the number of times a video tag is used. |
22+
| **sortOrder** | **&#39;asc&#39; \| &#39;desc&#39;**| no| Use this parameter to sort results. &#x60;asc&#x60; is ascending and sorts from A to Z. &#x60;desc&#x60; is descending and sorts from Z to A. |
23+
| **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 |
24+
| **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. |
25+
26+
27+
### Return type
28+
29+
Promise<[**ListTagsResponse**](../model/ListTagsResponse.md)>.
30+
31+
32+
33+
34+
---
35+

docs/model/ListTagsResponse.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# ListTagsResponse
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**data** | [**Array&lt;ListTagsResponseData&gt;**](ListTagsResponseData.md) | | [optional]
9+
**pagination** | [**Pagination**](Pagination.md) | | [optional]
10+
11+
12+

docs/model/ListTagsResponseData.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# ListTagsResponseData
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**value** | **string** | Returns the value of a video tag used in your project. | [optional]
9+
**videoCount** | **number** | Returns the number of times a video tag is used. | [optional]
10+
11+
12+

docs/model/Webhook.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55

66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8-
**webhookId** | **string** | Unique identifier of the webhook | [optional]
9-
**createdAt** | **Date** | When an webhook was created, presented in ATOM UTC format. | [optional]
10-
**events** | **Array&lt;string&gt;** | A list of events that will trigger the webhook. | [optional]
11-
**url** | **string** | URL of the webhook | [optional]
8+
**webhookId** | **string** | A unique identifier of the webhook you subscribed to. | [optional]
9+
**createdAt** | **Date** | The time and date when you created this webhook subscription, in ATOM UTC format. | [optional]
10+
**events** | **Array&lt;string&gt;** | A list of events that you subscribed to. When these events occur, the API triggers a webhook call to the URL you provided. | [optional]
11+
**url** | **string** | The URL where the API sends the webhook. | [optional]
12+
**signatureSecret** | **string** | A secret key for the webhook you subscribed to. You can use it to verify the origin of the webhook call that you receive. | [optional]
1213

1314

1415

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@api.video/nodejs-client",
3-
"version": "2.6.2",
3+
"version": "2.6.3",
44
"description": "api.video nodejs API client",
55
"keywords": [
66
"api.video",

src/HttpClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default class HttpClient {
5959
this.chunkSize = params.chunkSize;
6060
this.headers = new AxiosHeaders({
6161
Accept: 'application/json, */*;q=0.8',
62-
'AV-Origin-Client': 'nodejs:2.6.2',
62+
'AV-Origin-Client': 'nodejs:2.6.3',
6363
Authorization: this.apiKey ? `Basic ${encode(`${this.apiKey}:`)}` : '',
6464
...(params.applicationName && params.applicationVersion
6565
? {

src/ObjectSerializer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ import FilterBy from './model/FilterBy';
3737
import FilterBy1 from './model/FilterBy1';
3838
import FilterBy2 from './model/FilterBy2';
3939
import Link from './model/Link';
40+
import ListTagsResponse from './model/ListTagsResponse';
41+
import ListTagsResponseData from './model/ListTagsResponseData';
4042
import LiveStream from './model/LiveStream';
4143
import LiveStreamAssets from './model/LiveStreamAssets';
4244
import LiveStreamCreationPayload from './model/LiveStreamCreationPayload';
@@ -152,6 +154,8 @@ const typeMap: { [index: string]: any } = {
152154
FilterBy1: FilterBy1,
153155
FilterBy2: FilterBy2,
154156
Link: Link,
157+
ListTagsResponse: ListTagsResponse,
158+
ListTagsResponseData: ListTagsResponseData,
155159
LiveStream: LiveStream,
156160
LiveStreamAssets: LiveStreamAssets,
157161
LiveStreamCreationPayload: LiveStreamCreationPayload,

src/api/TagsApi.ts

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
/**
2+
* @api.video/nodejs-client
3+
* api.video is an API that encodes on the go to facilitate immediate playback, enhancing viewer streaming experiences across multiple devices and platforms. You can stream live or on-demand online videos within minutes.
4+
*
5+
* The version of the OpenAPI document: 1
6+
*
7+
*
8+
* NOTE: This class is auto generated.
9+
* Do not edit the class manually.
10+
*/
11+
12+
import { URLSearchParams } from 'url';
13+
import ObjectSerializer from '../ObjectSerializer';
14+
import HttpClient, { QueryOptions, ApiResponseHeaders } from '../HttpClient';
15+
import ListTagsResponse from '../model/ListTagsResponse';
16+
17+
/**
18+
* no description
19+
*/
20+
export default class TagsApi {
21+
private httpClient: HttpClient;
22+
23+
constructor(httpClient: HttpClient) {
24+
this.httpClient = httpClient;
25+
}
26+
27+
/**
28+
* This endpoint enables you to search for video tags in a project and see how many videos are tagged with them. If you do not define any query parameters, the endpoint lists all video tags and the numbers of times they are used in a project.
29+
* List all video tags
30+
* @param {Object} searchParams
31+
* @param { string } searchParams.value Use this parameter to search for specific video tags. The API filters results even on partial values, and ignores accents, uppercase, and lowercase.
32+
* @param { &#39;value&#39; | &#39;videoCount&#39; } searchParams.sortBy Use this parameter to choose which field the API will use to sort the response data. The default is &#x60;value&#x60;. These are the available fields to sort by: - &#x60;value&#x60;: Sorts the results based on tag values in alphabetic order. - &#x60;videoCount&#x60;: Sorts the results based on the number of times a video tag is used.
33+
* @param { &#39;asc&#39; | &#39;desc&#39; } searchParams.sortOrder Use this parameter to sort results. &#x60;asc&#x60; is ascending and sorts from A to Z. &#x60;desc&#x60; is descending and sorts from Z to A.
34+
* @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1
35+
* @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25.
36+
*/
37+
public async list(args: {
38+
value?: string;
39+
sortBy?: 'value' | 'videoCount';
40+
sortOrder?: 'asc' | 'desc';
41+
currentPage?: number;
42+
pageSize?: number;
43+
}): Promise<ListTagsResponse> {
44+
return this.listWithResponseHeaders(args).then((res) => res.body);
45+
}
46+
47+
/**
48+
* This endpoint enables you to search for video tags in a project and see how many videos are tagged with them. If you do not define any query parameters, the endpoint lists all video tags and the numbers of times they are used in a project.
49+
* List all video tags
50+
* @param {Object} searchParams
51+
* @param { string } searchParams.value Use this parameter to search for specific video tags. The API filters results even on partial values, and ignores accents, uppercase, and lowercase.
52+
* @param { &#39;value&#39; | &#39;videoCount&#39; } searchParams.sortBy Use this parameter to choose which field the API will use to sort the response data. The default is &#x60;value&#x60;. These are the available fields to sort by: - &#x60;value&#x60;: Sorts the results based on tag values in alphabetic order. - &#x60;videoCount&#x60;: Sorts the results based on the number of times a video tag is used.
53+
* @param { &#39;asc&#39; | &#39;desc&#39; } searchParams.sortOrder Use this parameter to sort results. &#x60;asc&#x60; is ascending and sorts from A to Z. &#x60;desc&#x60; is descending and sorts from Z to A.
54+
* @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1
55+
* @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25.
56+
*/
57+
public async listWithResponseHeaders({
58+
value,
59+
sortBy,
60+
sortOrder,
61+
currentPage,
62+
pageSize,
63+
}: {
64+
value?: string;
65+
sortBy?: 'value' | 'videoCount';
66+
sortOrder?: 'asc' | 'desc';
67+
currentPage?: number;
68+
pageSize?: number;
69+
}): Promise<{ headers: ApiResponseHeaders; body: ListTagsResponse }> {
70+
const queryParams: QueryOptions = {};
71+
queryParams.headers = {};
72+
// Path Params
73+
const localVarPath = '/tags'.substring(1);
74+
75+
// Query Params
76+
const urlSearchParams = new URLSearchParams();
77+
78+
if (value !== undefined) {
79+
urlSearchParams.append(
80+
'value',
81+
ObjectSerializer.serialize(value, 'string', '')
82+
);
83+
}
84+
if (sortBy !== undefined) {
85+
urlSearchParams.append(
86+
'sortBy',
87+
ObjectSerializer.serialize(sortBy, "'value' | 'videoCount'", '')
88+
);
89+
}
90+
if (sortOrder !== undefined) {
91+
urlSearchParams.append(
92+
'sortOrder',
93+
ObjectSerializer.serialize(sortOrder, "'asc' | 'desc'", '')
94+
);
95+
}
96+
if (currentPage !== undefined) {
97+
urlSearchParams.append(
98+
'currentPage',
99+
ObjectSerializer.serialize(currentPage, 'number', '')
100+
);
101+
}
102+
if (pageSize !== undefined) {
103+
urlSearchParams.append(
104+
'pageSize',
105+
ObjectSerializer.serialize(pageSize, 'number', '')
106+
);
107+
}
108+
109+
queryParams.searchParams = urlSearchParams;
110+
111+
queryParams.method = 'GET';
112+
113+
return this.httpClient.call(localVarPath, queryParams).then((response) => {
114+
return {
115+
headers: response.headers,
116+
body: ObjectSerializer.deserialize(
117+
ObjectSerializer.parse(
118+
response.body,
119+
response.headers['content-type']
120+
),
121+
'ListTagsResponse',
122+
''
123+
) as ListTagsResponse,
124+
};
125+
});
126+
}
127+
}

0 commit comments

Comments
 (0)