@@ -14,6 +14,7 @@ const Cache = require('./cache');
1414const utils = require ( "./utils" ) ;
1515const UploadStream = require ( './upload_stream' ) ;
1616const config = require ( "./config" ) ;
17+ const ensureOption = require ( './utils/ensureOption' ) . defaults ( config ( ) ) ;
1718
1819const {
1920 build_upload_params,
@@ -167,6 +168,33 @@ exports.create_zip = function create_zip(callback, options = {}) {
167168 return exports . create_archive ( callback , options , "zip" ) ;
168169} ;
169170
171+
172+ exports . create_slideshow = function create_slideshow ( options , callback ) {
173+ options . resource_type = ensureOption ( options , "resource_type" , "video" ) ;
174+ return call_api ( "create_slideshow" , callback , options , function ( ) {
175+ // Generate a transformation from the manifest_transformation key, which should be a valid transformation
176+ const manifest_transformation = utils . generate_transformation_string ( extend ( { } , options . manifest_transformation ) ) ;
177+
178+ // Try to use {options.transformation} to generate a transformation (Example: options.transformation.width, options.transformation.height)
179+ const transformation = utils . generate_transformation_string ( extend ( { } , ensureOption ( options , 'transformation' , { } ) ) ) ;
180+
181+ return [
182+ {
183+ timestamp : utils . timestamp ( ) ,
184+ manifest_transformation : manifest_transformation ,
185+ upload_preset : options . upload_preset ,
186+ overwrite : options . overwrite ,
187+ public_id : options . public_id ,
188+ notification_url : options . notification_url ,
189+ manifest_json : options . manifest_json ,
190+ tags : options . tags ,
191+ transformation : transformation
192+ }
193+ ] ;
194+ } ) ;
195+ } ;
196+
197+
170198exports . destroy = function destroy ( public_id , callback , options = { } ) {
171199 return call_api ( "destroy" , callback , options , function ( ) {
172200 return [
0 commit comments