Skip to content

Commit

Permalink
Merge pull request #231 from apivideo/add-summary-feature-docs
Browse files Browse the repository at this point in the history
Add summary feature
  • Loading branch information
olivier-lando authored Oct 21, 2024
2 parents fb634b2 + 86dcd1f commit 93d196b
Show file tree
Hide file tree
Showing 33 changed files with 1,168 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All changes to this project will be documented in this file.

## [2.6.6] - 2024-10-21
- Add summary feature

## [2.6.5] - 2024-10-17
- Fix postinstall script

Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [ChaptersApi](#chaptersapi)
- [LiveStreamsApi](#livestreamsapi)
- [PlayerThemesApi](#playerthemesapi)
- [SummariesApi](#summariesapi)
- [TagsApi](#tagsapi)
- [UploadTokensApi](#uploadtokensapi)
- [VideosApi](#videosapi)
Expand Down Expand Up @@ -162,6 +163,17 @@ Method | Description | HTTP request
[**deleteLogo()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/PlayerThemesApi.md#deleteLogo) | Delete logo | **DELETE** `/players/{playerId}/logo`


#### SummariesApi

Method | Description | HTTP request
------------- | ------------- | -------------
[**create()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/SummariesApi.md#create) | Generate video summary | **POST** `/summaries`
[**update()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/SummariesApi.md#update) | Update summary details | **PATCH** `/summaries/{summaryId}/source`
[**delete()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/SummariesApi.md#delete) | Delete video summary | **DELETE** `/summaries/{summaryId}`
[**list()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/SummariesApi.md#list) | List summaries | **GET** `/summaries`
[**getSummarySource()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/SummariesApi.md#getSummarySource) | Get summary details | **GET** `/summaries/{summaryId}/source`


#### TagsApi

Method | Description | HTTP request
Expand Down Expand Up @@ -242,6 +254,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)
- [ConflictError](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/ConflictError.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)
Expand Down Expand Up @@ -269,6 +282,11 @@ Method | Description | HTTP request
- [RefreshTokenPayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/RefreshTokenPayload.md)
- [RestreamsRequestObject](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/RestreamsRequestObject.md)
- [RestreamsResponseObject](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/RestreamsResponseObject.md)
- [SummariesListResponse](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/SummariesListResponse.md)
- [Summary](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/Summary.md)
- [SummaryCreationPayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/SummaryCreationPayload.md)
- [SummarySource](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/SummarySource.md)
- [SummaryUpdatePayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/SummaryUpdatePayload.md)
- [TokenCreationPayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/TokenCreationPayload.md)
- [TokenListResponse](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/TokenListResponse.md)
- [TooManyRequests](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/TooManyRequests.md)
Expand Down
130 changes: 130 additions & 0 deletions docs/api/SummariesApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# SummariesApi

All URIs are relative to *https://ws.api.video*

| Method | Description | HTTP request |
| ------------- | ------------- | ------------- |
| [**create()**](SummariesApi.md#create) | Generate video summary | **POST** /summaries |
| [**update()**](SummariesApi.md#update) | Update summary details | **PATCH** /summaries/{summaryId}/source |
| [**delete()**](SummariesApi.md#delete) | Delete video summary | **DELETE** /summaries/{summaryId} |
| [**list()**](SummariesApi.md#list) | List summaries | **GET** /summaries |
| [**getSummarySource()**](SummariesApi.md#getSummarySource) | Get summary details | **GET** /summaries/{summaryId}/source |


<a name="create"></a>
## **`create()` - Generate video summary**


Generate a title, abstract, and key takeaways for a video.

### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **summaryCreationPayload** | [**SummaryCreationPayload**](../model/SummaryCreationPayload.md)| **yes**| |


### Return type

Promise<[**Summary**](../model/Summary.md)>.




---

<a name="update"></a>
## **`update()` - Update summary details**


Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`.

### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **summaryId** | **string**| **yes**| The unique identifier of the summary source you want to update. |
| **summaryUpdatePayload** | [**SummaryUpdatePayload**](../model/SummaryUpdatePayload.md)| **yes**| |


### Return type

Promise<[**SummarySource**](../model/SummarySource.md)>.




---

<a name="delete"></a>
## **`delete()` - Delete video summary**


Delete a summary tied to a video.

### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **summaryId** | **string**| **yes**| The unique identifier of the summary you want to delete. |


### Return type

Promise<[**void**](../model/.md)>.




---

<a name="list"></a>
## **`list()` - List summaries**


List all summarries for your videos in a project.

### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **videoId** | **string**| no| Use this parameter to filter for a summary that belongs to a specific video. |
| **origin** | **&#39;auto&#39; \| &#39;api&#39;**| no| Use this parameter to filter for summaries based on the way they were created: automatically or manually via the API. |
| **sourceStatus** | **&#39;missing&#39; \| &#39;waiting&#39; \| &#39;failed&#39; \| &#39;completed&#39; \| &#39;unprocessable&#39;**| no| Use this parameter to filter for summaries based on the current status of the summary source. These are the available statuses: &#x60;missing&#x60;: the input for a summary is not present. &#x60;waiting&#x60; : the input video is being processed and a summary will be generated. &#x60;failed&#x60;: a technical issue prevented summary generation. &#x60;completed&#x60;: the summary is generated. &#x60;unprocessable&#x60;: the API rules the source video to be unsuitable for summary generation. An example for this is an input video that has no audio. |
| **sortBy** | **&#39;createdAt&#39; \| &#39;updatedAt&#39; \| &#39;videoId&#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;createdAt&#x60;: Sorts the results based on date and timestamps when summaries were created. - &#x60;updatedAt&#x60;: Sorts the results based on date and timestamps when summaries were last updated. - &#x60;videoId&#x60;: Sorts the results based on video IDs. |
| **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. |
| **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<[**SummariesListResponse**](../model/SummariesListResponse.md)>.




---

<a name="getSummarySource"></a>
## **`getSummarySource()` - Get summary details**


Get all details for a summary.

### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **summaryId** | **string**| **yes**| The unique identifier of the summary source you want to retrieve. |


### Return type

Promise<[**SummarySource**](../model/SummarySource.md)>.




---

15 changes: 15 additions & 0 deletions docs/model/ConflictError.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# ConflictError

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **string** | A link to the error documentation. | [optional]
**title** | **string** | A description of the error that occurred. | [optional]
**name** | **string** | The name of the parameter that caused the error. | [optional]
**status** | **number** | The HTTP status code. | [optional]
**detail** | **string** | A solution for the error. | [optional]



8 changes: 4 additions & 4 deletions docs/model/NotFound.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **string** | | [optional]
**title** | **string** | | [optional]
**name** | **string** | | [optional]
**status** | **number** | | [optional]
**type** | **string** | A link to the error documentation. | [optional]
**title** | **string** | A description of the error that occurred. | [optional]
**name** | **string** | The name of the parameter that caused the error. | [optional]
**status** | **number** | The HTTP status code. | [optional]



12 changes: 12 additions & 0 deletions docs/model/SummariesListResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# SummariesListResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**data** | [**Array&lt;Summary&gt;**](Summary.md) | An array of summary objects. |
**pagination** | [**Pagination**](Pagination.md) | |



37 changes: 37 additions & 0 deletions docs/model/Summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

# Summary

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**summaryId** | **string** | The unique identifier of the summary object. | [optional]
**createdAt** | **Date** | Returns the date and time when the summary was created in ATOM date-time format. | [optional]
**updatedAt** | **Date** | Returns the date and time when the summary was last updated in ATOM date-time format. | [optional]
**videoId** | **string** | The unique identifier of the video object. | [optional]
**origin** | [**SummaryOriginEnum**](#SummaryOriginEnum) | Returns the origin of how the summary was created. - &#x60;api&#x60; means that no summary was generated automatically. You can add summary manually using the &#x60;PATCH /summaries/{summaryId}/source&#x60; endpoint operation. Until this happens, &#x60;sourceStatus&#x60; returns &#x60;missing&#x60;. - &#x60;auto&#x60; means that the API generated the summary automatically. | [optional]
**sourceStatus** | [**SummarySourceStatusEnum**](#SummarySourceStatusEnum) | Returns the current status of summary generation. &#x60;missing&#x60;: the input for a summary is not present. &#x60;waiting&#x60; : the input video is being processed and a summary will be generated. &#x60;failed&#x60;: a technical issue prevented summary generation. &#x60;completed&#x60;: the summary is generated. &#x60;unprocessable&#x60;: the API rules the source video to be unsuitable for summary generation. An example for this is an input video that has no audio. | [optional]



## Enum: SummaryOriginEnum

Name | Value
---- | -----
Api | &#39;api&#39;
Auto | &#39;auto&#39;



## Enum: SummarySourceStatusEnum

Name | Value
---- | -----
Missing | &#39;missing&#39;
Waiting | &#39;waiting&#39;
Failed | &#39;failed&#39;
Completed | &#39;completed&#39;
Unprocessable | &#39;unprocessable&#39;



20 changes: 20 additions & 0 deletions docs/model/SummaryCreationPayload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# SummaryCreationPayload

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**videoId** | **string** | Create a summary of a video using the video ID. |
**origin** | [**SummaryCreationPayloadOriginEnum**](#SummaryCreationPayloadOriginEnum) | Use this parameter to define how the API generates the summary. The only allowed value is &#x60;auto&#x60;, which means that the API generates a summary automatically. If you do not set this parameter, **the API will not generate a summary automatically**. In this case, &#x60;sourceStatus&#x60; will return &#x60;missing&#x60;, and you have to manually add a summary using the &#x60;PATCH /summaries/{summaryId}/source&#x60; endpoint operation. | [optional]



## Enum: SummaryCreationPayloadOriginEnum

Name | Value
---- | -----
Auto | &#39;auto&#39;



13 changes: 13 additions & 0 deletions docs/model/SummarySource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# SummarySource

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | **string** | A video title, based on the contents of the video. | [optional]
**_abstract** | **string** | A short outline of the contents of the video. The length of an &#x60;abstract&#x60; depends on the amount of content in a video that can be transcribed. The API condenses the contents into minimum 20, maximum 300 words. | [optional]
**takeaways** | **Array&lt;string&gt;** | A list of 3 key points from the video, in chronological order. | [optional]



13 changes: 13 additions & 0 deletions docs/model/SummaryUpdatePayload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# SummaryUpdatePayload

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | **string** | A video title, based on the contents of the video. | [optional]
**_abstract** | **string** | A short outline of the contents of the video. | [optional]
**takeaways** | **Array&lt;string&gt;** | A list of 3 key points from the video, in chronological order. | [optional]



1 change: 1 addition & 0 deletions docs/model/VideoCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Name | Type | Description | Notes
**watermark** | [**VideoWatermark**](VideoWatermark.md) | | [optional]
**language** | [**VideoCreationPayloadLanguageEnum**](#VideoCreationPayloadLanguageEnum) | Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. &#x60;language&#x60; is a permanent attribute of the video. You can update it to another language using the [&#x60;PATCH /videos/{videoId}&#x60;](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. | [optional]
**transcript** | **boolean** | Use this parameter to enable transcription. - When &#x60;true&#x60;, the API generates a transcript for the video. - The default value is &#x60;false&#x60;. - If you define a video language using the &#x60;language&#x60; parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. | [optional]
**transcriptSummary** | **boolean** | Use this parameter to enable summarization. We recommend using this parameter together with &#x60;transcript: true&#x60;. - When &#x60;true&#x60;, the API generates a summary for the video, based on the transcription. - The default value is &#x60;false&#x60;. - If you define a video language using the &#x60;language&#x60; parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. | [optional]



Expand Down
1 change: 1 addition & 0 deletions docs/model/VideoUpdatePayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Name | Type | Description | Notes
**metadata** | [**Array&lt;Metadata&gt;**](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]
**language** | [**VideoUpdatePayloadLanguageEnum**](#VideoUpdatePayloadLanguageEnum) | Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. &#x60;language&#x60; is a permanent attribute of the video. You can update it to another language using the [&#x60;PATCH /videos/{videoId}&#x60;](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. | [optional]
**transcript** | **boolean** | Use this parameter to enable transcription. - When &#x60;true&#x60;, the API generates a transcript for the video. - The default value is &#x60;false&#x60;. - If you define a video language using the &#x60;language&#x60; parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. | [optional]
**transcriptSummary** | **boolean** | Use this parameter to enable summarization. - When &#x60;true&#x60;, the API generates a summary for the video, based on the transcription. - The default value is &#x60;false&#x60;. - If you define a video language using the &#x60;language&#x60; parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. | [optional]



Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@api.video/nodejs-client",
"version": "2.6.5",
"version": "2.6.6",
"description": "api.video nodejs API client",
"keywords": [
"api.video",
Expand Down
2 changes: 1 addition & 1 deletion src/HttpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.5',
'AV-Origin-Client': 'nodejs:2.6.6',
Authorization: this.apiKey ? `Basic ${encode(`${this.apiKey}:`)}` : '',
...(params.applicationName && params.applicationVersion
? {
Expand Down
Loading

0 comments on commit 93d196b

Please sign in to comment.