Skip to content

Commit 108676f

Browse files
authored
Merge pull request #10 from shotstack/updates-nov-2021
Add merge, probe, transformations, repeat and query strings
2 parents dad7fb8 + d9e54cc commit 108676f

14 files changed

Lines changed: 978 additions & 37 deletions

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "shotstack-sdk",
3-
"version": "0.0.23",
3+
"version": "0.0.24",
44
"description": "Official Node SDK for the Shotstack Cloud Video Editing API",
55
"license": "MIT",
66
"main": "src/index.js",

‎src/api/EditApi.js‎

Lines changed: 72 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
(function(root, factory) {
1717
if (typeof define === 'function' && define.amd) {
1818
// AMD. Register as an anonymous module.
19-
define(['ApiClient', 'model/Edit', 'model/QueuedResponse', 'model/RenderResponse'], factory);
19+
define(['ApiClient', 'model/Edit', 'model/ProbeResponse', 'model/QueuedResponse', 'model/RenderResponse'], factory);
2020
} else if (typeof module === 'object' && module.exports) {
2121
// CommonJS-like environments that support module.exports, like Node.
22-
module.exports = factory(require('../ApiClient'), require('../model/Edit'), require('../model/QueuedResponse'), require('../model/RenderResponse'));
22+
module.exports = factory(require('../ApiClient'), require('../model/Edit'), require('../model/ProbeResponse'), require('../model/QueuedResponse'), require('../model/RenderResponse'));
2323
} else {
2424
// Browser globals (root is window)
2525
if (!root.ShotstackSdk) {
2626
root.ShotstackSdk = {};
2727
}
28-
root.ShotstackSdk.EditApi = factory(root.ShotstackSdk.ApiClient, root.ShotstackSdk.Edit, root.ShotstackSdk.QueuedResponse, root.ShotstackSdk.RenderResponse);
28+
root.ShotstackSdk.EditApi = factory(root.ShotstackSdk.ApiClient, root.ShotstackSdk.Edit, root.ShotstackSdk.ProbeResponse, root.ShotstackSdk.QueuedResponse, root.ShotstackSdk.RenderResponse);
2929
}
30-
}(this, function(ApiClient, Edit, QueuedResponse, RenderResponse) {
30+
}(this, function(ApiClient, Edit, ProbeResponse, QueuedResponse, RenderResponse) {
3131
'use strict';
3232

3333
/**
@@ -50,11 +50,15 @@
5050

5151
/**
5252
* Get Render Status
53-
* Get the rendering status, temporary asset url and details of a render by ID. **base URL:** https://api.shotstack.io/{version}
53+
* Get the rendering status, temporary asset url and details of a render by ID. **Base URL:** https://api.shotstack.io/{version}
5454
* @param {String} id The id of the timeline render task in UUID format
55+
* @param {Object} opts Optional parameters
56+
* @param {Boolean} opts.data Include the data parameter in the response. The data parameter includes the original timeline, output and other settings sent to the API.<br><br><b>Note:</b> the default is currently `true`, this is deprecated and the default will soon be `false`. If you rely on the data being returned in the response you should explicitly set the parameter to `true`.
57+
* @param {Boolean} opts.merged Used when data is set to true, it will show the [merge fields](#tocs_mergefield) merged in to the data response.
5558
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RenderResponse} and HTTP response
5659
*/
57-
this.getRenderWithHttpInfo = function(id) {
60+
this.getRenderWithHttpInfo = function(id, opts) {
61+
opts = opts || {};
5862
var postBody = null;
5963
// verify the required parameter 'id' is set
6064
if (id === undefined || id === null) {
@@ -65,6 +69,8 @@
6569
'id': id
6670
};
6771
var queryParams = {
72+
'data': opts['data'],
73+
'merged': opts['merged'],
6874
};
6975
var collectionQueryParams = {
7076
};
@@ -86,12 +92,15 @@
8692

8793
/**
8894
* Get Render Status
89-
* Get the rendering status, temporary asset url and details of a render by ID. **base URL:** https://api.shotstack.io/{version}
95+
* Get the rendering status, temporary asset url and details of a render by ID. **Base URL:** https://api.shotstack.io/{version}
9096
* @param {String} id The id of the timeline render task in UUID format
97+
* @param {Object} opts Optional parameters
98+
* @param {Boolean} opts.data Include the data parameter in the response. The data parameter includes the original timeline, output and other settings sent to the API.<br><br><b>Note:</b> the default is currently `true`, this is deprecated and the default will soon be `false`. If you rely on the data being returned in the response you should explicitly set the parameter to `true`.
99+
* @param {Boolean} opts.merged Used when data is set to true, it will show the [merge fields](#tocs_mergefield) merged in to the data response.
91100
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RenderResponse}
92101
*/
93-
this.getRender = function(id) {
94-
return this.getRenderWithHttpInfo(id)
102+
this.getRender = function(id, opts) {
103+
return this.getRenderWithHttpInfo(id, opts)
95104
.then(function(response_and_data) {
96105
return response_and_data.data;
97106
});
@@ -100,8 +109,8 @@
100109

101110
/**
102111
* Render Asset
103-
* Queue and render the contents of a timeline as a video, image or audio file.
104-
* @param {module:model/Edit} edit The video, image or audio edit specified using JSON. **base URL:** https://api.shotstack.io/{version}
112+
* Queue and render the contents of a timeline as a video, image or audio file. **Base URL:** https://api.shotstack.io/{version}
113+
* @param {module:model/Edit} edit The video, image or audio edit specified using JSON.
105114
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/QueuedResponse} and HTTP response
106115
*/
107116
this.postRenderWithHttpInfo = function(edit) {
@@ -135,8 +144,8 @@
135144

136145
/**
137146
* Render Asset
138-
* Queue and render the contents of a timeline as a video, image or audio file.
139-
* @param {module:model/Edit} edit The video, image or audio edit specified using JSON. **base URL:** https://api.shotstack.io/{version}
147+
* Queue and render the contents of a timeline as a video, image or audio file. **Base URL:** https://api.shotstack.io/{version}
148+
* @param {module:model/Edit} edit The video, image or audio edit specified using JSON.
140149
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/QueuedResponse}
141150
*/
142151
this.postRender = function(edit) {
@@ -145,6 +154,56 @@
145154
return response_and_data.data;
146155
});
147156
}
157+
158+
159+
/**
160+
* Inspect Media
161+
* 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}
162+
* @param {String} url The URL of the media to inspect, must be **URL encoded**.
163+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ProbeResponse} and HTTP response
164+
*/
165+
this.probeWithHttpInfo = function(url) {
166+
var postBody = null;
167+
// verify the required parameter 'url' is set
168+
if (url === undefined || url === null) {
169+
throw new Error("Missing the required parameter 'url' when calling probe");
170+
}
171+
172+
var pathParams = {
173+
'url': url
174+
};
175+
var queryParams = {
176+
};
177+
var collectionQueryParams = {
178+
};
179+
var headerParams = {
180+
};
181+
var formParams = {
182+
};
183+
184+
var authNames = ['DeveloperKey'];
185+
var contentTypes = [];
186+
var accepts = ['application/json'];
187+
var returnType = ProbeResponse;
188+
return this.apiClient.callApi(
189+
'/probe/{url}', 'GET',
190+
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
191+
authNames, contentTypes, accepts, returnType, null
192+
);
193+
}
194+
195+
/**
196+
* Inspect Media
197+
* 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}
198+
* @param {String} url The URL of the media to inspect, must be **URL encoded**.
199+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ProbeResponse}
200+
*/
201+
this.probe = function(url) {
202+
return this.probeWithHttpInfo(url)
203+
.then(function(response_and_data) {
204+
return response_and_data.data;
205+
});
206+
}
148207
};
149208

150209
return exports;

‎src/api/ServeApi.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
/**
5252
* Delete Asset
53-
* Delete an asset by its asset id. If a render creates multiple assets, such as thumbnail and poster images, each asset must be deleted individually by the asset id. **base URL:** https://api.shotstack.io/serve/{version}
53+
* Delete an asset by its asset id. If a render creates multiple assets, such as thumbnail and poster images, each asset must be deleted individually by the asset id. **Base URL:** https://api.shotstack.io/serve/{version}
5454
* @param {String} id The id of the asset in UUID format
5555
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
5656
*/
@@ -86,7 +86,7 @@
8686

8787
/**
8888
* Delete Asset
89-
* Delete an asset by its asset id. If a render creates multiple assets, such as thumbnail and poster images, each asset must be deleted individually by the asset id. **base URL:** https://api.shotstack.io/serve/{version}
89+
* Delete an asset by its asset id. If a render creates multiple assets, such as thumbnail and poster images, each asset must be deleted individually by the asset id. **Base URL:** https://api.shotstack.io/serve/{version}
9090
* @param {String} id The id of the asset in UUID format
9191
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
9292
*/
@@ -100,7 +100,7 @@
100100

101101
/**
102102
* Get Asset
103-
* The Serve API is used to interact with, and delete hosted assets including videos, images, audio files, thumbnails and poster images. Use this endpoint to fetch an asset by asset id. Note that an asset id is unique for each asset and different from the render id. **base URL:** https://api.shotstack.io/serve/{version}
103+
* The Serve API is used to interact with, and delete hosted assets including videos, images, audio files, thumbnails and poster images. Use this endpoint to fetch an asset by asset id. Note that an asset id is unique for each asset and different from the render id. **Base URL:** https://api.shotstack.io/serve/{version}
104104
* @param {String} id The id of the asset in UUID format
105105
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AssetResponse} and HTTP response
106106
*/
@@ -136,7 +136,7 @@
136136

137137
/**
138138
* Get Asset
139-
* The Serve API is used to interact with, and delete hosted assets including videos, images, audio files, thumbnails and poster images. Use this endpoint to fetch an asset by asset id. Note that an asset id is unique for each asset and different from the render id. **base URL:** https://api.shotstack.io/serve/{version}
139+
* The Serve API is used to interact with, and delete hosted assets including videos, images, audio files, thumbnails and poster images. Use this endpoint to fetch an asset by asset id. Note that an asset id is unique for each asset and different from the render id. **Base URL:** https://api.shotstack.io/serve/{version}
140140
* @param {String} id The id of the asset in UUID format
141141
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AssetResponse}
142142
*/
@@ -150,7 +150,7 @@
150150

151151
/**
152152
* Get Asset by Render ID
153-
* A render may generate more than one file, such as a video, thumbnail and poster image. When the assets are created the only known id is the render id returned by the original [render request](#render-video), status request or webhook. This endpoint lets you look up one or more assets by the render id. **base URL:** https://api.shotstack.io/serve/{version}
153+
* A render may generate more than one file, such as a video, thumbnail and poster image. When the assets are created the only known id is the render id returned by the original [render request](#render-video), status request or webhook. This endpoint lets you look up one or more assets by the render id. **Base URL:** https://api.shotstack.io/serve/{version}
154154
* @param {String} id The render id associated with the asset in UUID format
155155
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AssetRenderResponse} and HTTP response
156156
*/
@@ -186,7 +186,7 @@
186186

187187
/**
188188
* Get Asset by Render ID
189-
* A render may generate more than one file, such as a video, thumbnail and poster image. When the assets are created the only known id is the render id returned by the original [render request](#render-video), status request or webhook. This endpoint lets you look up one or more assets by the render id. **base URL:** https://api.shotstack.io/serve/{version}
189+
* A render may generate more than one file, such as a video, thumbnail and poster image. When the assets are created the only known id is the render id returned by the original [render request](#render-video), status request or webhook. This endpoint lets you look up one or more assets by the render id. **Base URL:** https://api.shotstack.io/serve/{version}
190190
* @param {String} id The render id associated with the asset in UUID format
191191
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AssetRenderResponse}
192192
*/

0 commit comments

Comments
 (0)