Skip to content

Commit b3e1df2

Browse files
authored
Merge pull request #1 from shotstack/v0.2.6.beta
Sync API changes with SDK
2 parents a146bc9 + a094121 commit b3e1df2

114 files changed

Lines changed: 2040 additions & 307 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎package.json‎

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,44 @@
11
{
2-
"name": "shotstack-sdk-typescript",
3-
"version": "0.2.6.beta",
4-
"description": "NodeJS client for shotstack-sdk-typescript",
5-
"repository": {
6-
"type": "git",
7-
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
8-
},
9-
"main": "dist/index.js",
10-
"types": "dist/index.d.ts",
11-
"scripts": {
12-
"clean": "rm -Rf dist/",
13-
"build": "tsc",
14-
"test": "npm run clean && npm run build"
15-
},
16-
"author": "OpenAPI-Generator Contributors",
17-
"license": "Unlicense",
18-
"dependencies": {
19-
"bluebird": "^3.5.0",
20-
"request": "^2.81.0",
21-
"rewire": "^3.0.2"
22-
},
23-
"devDependencies": {
24-
"@types/bluebird": "^3.5.33",
25-
"@types/node": "^12",
26-
"@types/request": "^2.48.8",
27-
"typescript": "^4.0"
2+
"name": "shotstack-sdk-typescript",
3+
"version": "0.2.6.beta",
4+
"description": "Official Typescript SDK for the Shotstack Cloud Video Editing API",
5+
"author": "Shotstack",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/shotstack/shotstack-sdk-typescript"
9+
},
10+
"keywords": [
11+
"video",
12+
"ffmpeg",
13+
"video-editing",
14+
"video-editing-api",
15+
"video-editor",
16+
"video-api",
17+
"cloud-video",
18+
"video-processing"
19+
],
20+
"license": "MIT",
21+
"main": "./dist/index.js",
22+
"type": "module",
23+
"module": "./dist/index.js",
24+
"exports": {
25+
".": {
26+
"import": "./dist/index.js",
27+
"types": "./dist/index.d.js"
2828
}
29+
},
30+
"typings": "./dist/index.d.ts",
31+
"scripts": {
32+
"clean": "rm -Rf dist/",
33+
"build": "tsc",
34+
"prepare": "npm run build"
35+
},
36+
"dependencies": {
37+
"es6-promise": "^4.2.4",
38+
"url-parse": "^1.4.3"
39+
},
40+
"devDependencies": {
41+
"typescript": "^4.0",
42+
"@types/url-parse": "1.4.4"
43+
}
2944
}

‎src/api/createApi.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* Shotstack
3-
* Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are three API\'s, one for editing and generating assets (Edit API), one for managing hosted assets (Serve API) and one for ingesting and transforming source assets (Ingest API). Each API has it\'s own base URL and collection of endpoints. Each API uses the same set of API keys. **[Edit API](#shotstack-edit)** - [https://api.shotstack.io/edit/{version}](#)<br> Edit videos, images and audio assets in the cloud using a simple JSON schema and templates. **[Serve API](#shotstack-serve)** - [https://api.shotstack.io/serve/{version}](#)<br> Inspect and manage the hosting of assets generated by the Edit and Ingest APIs. **[Ingest API](#shotstack-ingest)** - [https://api.shotstack.io/ingest/{version}](#)<br> Ingest (upload, store and transform) source footage, images, audio and fonts to be used by the Edit API. **[Create API](#shotstack-create)** - [https://api.shotstack.io/create/{version}](#)<br> Generate images, videos, voice overs and text using built in and third party generative AI providers.
3+
* Official Typescript SDK for the Shotstack Cloud Video Editing API
44
*
5-
* The version of the OpenAPI document: v1
5+
* OpenAPI spec version: v1
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -92,7 +92,7 @@ export class CreateApi {
9292
}
9393

9494
/**
95-
* Get the generated assets status, url and details by ID. **Base URL:** https://api.shotstack.io/create/{version}
95+
* Get the generated assets status, url and details by ID. **Base URL:** <a href=\"#\">https://api.shotstack.io/create/{version}</a>
9696
* @summary Get Generated Asset
9797
* @param id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format.
9898
*/
@@ -164,7 +164,7 @@ export class CreateApi {
164164
});
165165
}
166166
/**
167-
* Generate an asset using a Shotstack or third party provider. Chose the provider, type of asset and provide prompts, inputs and options to generate the asset. Once generated the asset can be used with the [Edit](#tocs_edit) API or downloaded. **Base URL:** https://api.shotstack.io/create/{version}
167+
* Generate an asset using a Shotstack or third party provider. Chose the provider, type of asset and provide prompts, inputs and options to generate the asset. Once generated the asset can be used with the [Edit](#tocs_edit) API or downloaded. **Base URL:** <a href=\"#\">https://api.shotstack.io/create/{version}</a>
168168
* @summary Generate Asset
169169
* @param generatedAsset Generate an asset using the specified provider, type and options.
170170
*/

‎src/api/editApi.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* Shotstack
3-
* Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are three API\'s, one for editing and generating assets (Edit API), one for managing hosted assets (Serve API) and one for ingesting and transforming source assets (Ingest API). Each API has it\'s own base URL and collection of endpoints. Each API uses the same set of API keys. **[Edit API](#shotstack-edit)** - [https://api.shotstack.io/edit/{version}](#)<br> Edit videos, images and audio assets in the cloud using a simple JSON schema and templates. **[Serve API](#shotstack-serve)** - [https://api.shotstack.io/serve/{version}](#)<br> Inspect and manage the hosting of assets generated by the Edit and Ingest APIs. **[Ingest API](#shotstack-ingest)** - [https://api.shotstack.io/ingest/{version}](#)<br> Ingest (upload, store and transform) source footage, images, audio and fonts to be used by the Edit API. **[Create API](#shotstack-create)** - [https://api.shotstack.io/create/{version}](#)<br> Generate images, videos, voice overs and text using built in and third party generative AI providers.
3+
* Official Typescript SDK for the Shotstack Cloud Video Editing API
44
*
5-
* The version of the OpenAPI document: v1
5+
* OpenAPI spec version: v1
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -98,7 +98,7 @@ export class EditApi {
9898
}
9999

100100
/**
101-
* Delete a template by its template id. **Base URL:** https://api.shotstack.io/{version}
101+
* Delete a template by its template id. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
102102
* @summary Delete Template
103103
* @param id The id of the template in UUID format
104104
*/
@@ -162,7 +162,7 @@ export class EditApi {
162162
});
163163
}
164164
/**
165-
* Get the rendering status, temporary asset url and details of a render by ID. **Base URL:** https://api.shotstack.io/{version}
165+
* Get the rendering status, temporary asset url and details of a render by ID. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
166166
* @summary Get Render Status
167167
* @param id The id of the timeline render task in UUID format
168168
* @param data Include the data parameter in the response. The data parameter includes the original timeline, output and other settings sent to the API.&lt;br&gt;&lt;br&gt;&lt;b&gt;Note:&lt;/b&gt; the default is currently &#x60;true&#x60;, this is deprecated and the default will soon be &#x60;false&#x60;. If you rely on the data being returned in the response you should explicitly set the parameter to &#x60;true&#x60;.
@@ -244,7 +244,7 @@ export class EditApi {
244244
});
245245
}
246246
/**
247-
* Retrieve a template by template id. **Base URL:** https://api.shotstack.io/{version}
247+
* Retrieve a template by template id. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
248248
* @summary Retrieve Template
249249
* @param id The id of the template in UUID format
250250
*/
@@ -316,7 +316,7 @@ export class EditApi {
316316
});
317317
}
318318
/**
319-
* Retrieve a list of templates stored against a users account and stage. **Base URL:** https://api.shotstack.io/{version}
319+
* Retrieve a list of templates stored against a users account and stage. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
320320
* @summary List Templates
321321
*/
322322
public async getTemplates (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: TemplateListResponse; }> {
@@ -381,7 +381,7 @@ export class EditApi {
381381
});
382382
}
383383
/**
384-
* Queue and render the contents of an [Edit](#tocs_edit) as a video, image or audio file. **Base URL:** https://api.shotstack.io/{version}
384+
* Queue and render the contents of an [Edit](#tocs_edit) as a video, image or audio file. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
385385
* @summary Render Asset
386386
* @param edit The video, image or audio edit specified using JSON.
387387
*/
@@ -453,7 +453,7 @@ export class EditApi {
453453
});
454454
}
455455
/**
456-
* Save an [Edit](#tocs_edit) as a re-usable template. Templates can be retrieved and modified in your application before being rendered. [Merge fields](#tocs_mergefield) can be also used to merge data in to a template and [render](#render-template) it in a single request. **Base URL:** https://api.shotstack.io/{version}
456+
* Save an [Edit](#tocs_edit) as a re-usable template. Templates can be retrieved and modified in your application before being rendered. [Merge fields](#tocs_mergefield) can be also used to merge data in to a template and [render](#render-template) it in a single request. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
457457
* @summary Create Template
458458
* @param template Create a template with a name and [Edit](#tocs_edit).
459459
*/
@@ -525,7 +525,7 @@ export class EditApi {
525525
});
526526
}
527527
/**
528-
* Render an asset from a template id and optional merge fields. Merge fields can be used to replace placeholder variables within the [Edit](#tocs_edit). **Base URL:** https://api.shotstack.io/{version}
528+
* Render an asset from a template id and optional merge fields. Merge fields can be used to replace placeholder variables within the [Edit](#tocs_edit). **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
529529
* @summary Render Template
530530
* @param templateRender Render a template by template id.
531531
*/
@@ -597,7 +597,7 @@ export class EditApi {
597597
});
598598
}
599599
/**
600-
* Inspects any media asset (image, video, audio) on the internet using a hosted version of [FFprobe](https://ffmpeg.org/ffprobe.html). The probe endpoint returns useful information about an asset such as width, height, duration, rotation, framerate, etc... **Base URL:** https://api.shotstack.io/{version}
600+
* Inspects any media asset (image, video, audio) on the internet using a hosted version of [FFprobe](https://ffmpeg.org/ffprobe.html). The probe endpoint returns useful information about an asset such as width, height, duration, rotation, framerate, etc... **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
601601
* @summary Inspect Media
602602
* @param url The URL of the media to inspect, must be **URL encoded**.
603603
*/
@@ -669,7 +669,7 @@ export class EditApi {
669669
});
670670
}
671671
/**
672-
* Update an existing template by template id. **Base URL:** https://api.shotstack.io/{version}
672+
* Update an existing template by template id. **Base URL:** <a href=\"#\">https://api.shotstack.io/edit/{version}</a>
673673
* @summary Update Template
674674
* @param id The id of the template in UUID format
675675
* @param template Update an individual templates name and [Edit](#tocs_edit). Both template name and template must be provided. If the template parameter is omitted a blank template will be saved.

‎src/api/ingestApi.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* Shotstack
3-
* Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are three API\'s, one for editing and generating assets (Edit API), one for managing hosted assets (Serve API) and one for ingesting and transforming source assets (Ingest API). Each API has it\'s own base URL and collection of endpoints. Each API uses the same set of API keys. **[Edit API](#shotstack-edit)** - [https://api.shotstack.io/edit/{version}](#)<br> Edit videos, images and audio assets in the cloud using a simple JSON schema and templates. **[Serve API](#shotstack-serve)** - [https://api.shotstack.io/serve/{version}](#)<br> Inspect and manage the hosting of assets generated by the Edit and Ingest APIs. **[Ingest API](#shotstack-ingest)** - [https://api.shotstack.io/ingest/{version}](#)<br> Ingest (upload, store and transform) source footage, images, audio and fonts to be used by the Edit API. **[Create API](#shotstack-create)** - [https://api.shotstack.io/create/{version}](#)<br> Generate images, videos, voice overs and text using built in and third party generative AI providers.
3+
* Official Typescript SDK for the Shotstack Cloud Video Editing API
44
*
5-
* The version of the OpenAPI document: v1
5+
* OpenAPI spec version: v1
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -95,7 +95,7 @@ export class IngestApi {
9595
}
9696

9797
/**
98-
* Delete an ingested source file by its id. **Base URL:** https://api.shotstack.io/ingest/{version}
98+
* Delete an ingested source file by its id. **Base URL:** <a href=\"#\">https://api.shotstack.io/ingest/{version}</a>
9999
* @summary Delete Source
100100
* @param id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format.
101101
*/
@@ -159,7 +159,7 @@ export class IngestApi {
159159
});
160160
}
161161
/**
162-
* Fetch a source file details and status by its id. **Base URL:** https://api.shotstack.io/ingest/{version}
162+
* Fetch a source file details and status by its id. **Base URL:** <a href=\"#\">https://api.shotstack.io/ingest/{version}</a>
163163
* @summary Get Source
164164
* @param id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format.
165165
*/
@@ -231,7 +231,7 @@ export class IngestApi {
231231
});
232232
}
233233
/**
234-
* Retrieve a list of ingested source files stored against a users account and stage. **Base URL:** https://api.shotstack.io/ingest/{version}
234+
* Retrieve a list of ingested source files stored against a users account and stage. **Base URL:** <a href=\"#\">https://api.shotstack.io/ingest/{version}</a>
235235
* @summary List Sources
236236
*/
237237
public async getSources (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SourceListResponse; }> {
@@ -296,7 +296,7 @@ export class IngestApi {
296296
});
297297
}
298298
/**
299-
* Request a signed URL to upload a file to. The response returns a signed URL that you use to upload the file to. The signed URL looks similar to: https://shotstack-ingest-api-stage-sources.s3.ap-southeast-2.amazonaws.com/5ca6hu7s9k/zzytey4v-32km-kq1z-aftr-3kcuqi0brad2/source?AWSAccessKeyId=ASIAWJV7UWDMGTZLHTXP&Expires=1677209777&Signature=PKR4dGDDdOuMTAQmDASzLGmLOeo%3D&x-amz-acl=public-read&x-amz-security-token=IQoJb3JpZ2luX2VjEGMaDmFwLX......56osBGByztm7WZdbmXzO09KR In a separate API call, use this signed URL to send a PUT request with the binary file. Using cURL you can use a command like: `curl -X PUT -T video.mp4 {data.attributes.url}` Where **video.mp4** is the file you want to upload and **{data.attributes.url}** is the signed URL returned in the response. The request must be a PUT type. The SDK does not currently support the PUT request. You can use the SDK to make the request for the signed URL and then use cURL to make the PUT request. **Base URL:** https://api.shotstack.io/ingest/{version}
299+
* Request a signed URL to upload a file to. The response returns a signed URL that you use to upload the file to. The signed URL looks similar to: https://shotstack-ingest-api-stage-sources.s3.ap-southeast-2.amazonaws.com/5ca6hu7s9k/zzytey4v-32km-kq1z-aftr-3kcuqi0brad2/source?AWSAccessKeyId=ASIAWJV7UWDMGTZLHTXP&Expires=1677209777&Signature=PKR4dGDDdOuMTAQmDASzLGmLOeo%3D&x-amz-acl=public-read&x-amz-security-token=IQoJb3JpZ2luX2VjEGMaDmFwLX......56osBGByztm7WZdbmXzO09KR In a separate API call, use this signed URL to send a PUT request with the binary file. Using cURL you can use a command like: `curl -X PUT -T video.mp4 {data.attributes.url}` Where **video.mp4** is the file you want to upload and **{data.attributes.url}** is the signed URL returned in the response. The request must be a PUT type. The SDK does not currently support the PUT request. You can use the SDK to make the request for the signed URL and then use cURL to make the PUT request. **Base URL:** <a href=\"#\">https://api.shotstack.io/ingest/{version}</a>
300300
* @summary Direct Upload
301301
*/
302302
public async getUploadSignedUrl (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: UploadResponse; }> {
@@ -361,7 +361,7 @@ export class IngestApi {
361361
});
362362
}
363363
/**
364-
* Queue a source file to be fetched from a URL and stored by Shotstack. Source files can be videos, images, audio files and fonts. Once ingested, new [output renditions](#tocs_outputs) can be created from the source file. **Base URL:** https://api.shotstack.io/ingest/{version}
364+
* Queue a source file to be fetched from a URL and stored by Shotstack. Source files can be videos, images, audio files and fonts. Once ingested, new [output renditions](#tocs_outputs) can be created from the source file. **Base URL:** <a href=\"#\">https://api.shotstack.io/ingest/{version}</a>
365365
* @summary Fetch Source
366366
* @param source Ingest a video, image, audio or font file from the provided URL. Optionally provide a list of output renditions.
367367
*/

0 commit comments

Comments
 (0)