diff --git a/lib/uploader.js b/lib/uploader.js index 7f224ff9..32deabef 100644 --- a/lib/uploader.js +++ b/lib/uploader.js @@ -176,32 +176,6 @@ exports.create_zip = function create_zip(callback, options = {}) { }; -exports.create_slideshow = function create_slideshow(options, callback) { - options.resource_type = ensureOption(options, "resource_type", "video"); - return call_api("create_slideshow", callback, options, function () { - // Generate a transformation from the manifest_transformation key, which should be a valid transformation - const manifest_transformation = utils.generate_transformation_string(extend({}, options.manifest_transformation)); - - // Try to use {options.transformation} to generate a transformation (Example: options.transformation.width, options.transformation.height) - const transformation = utils.generate_transformation_string(extend({}, ensureOption(options, 'transformation', {}))); - - return [ - { - timestamp: utils.timestamp(), - manifest_transformation: manifest_transformation, - upload_preset: options.upload_preset, - overwrite: options.overwrite, - public_id: options.public_id, - notification_url: options.notification_url, - manifest_json: options.manifest_json, - tags: options.tags, - transformation: transformation - } - ]; - }); -}; - - exports.destroy = function destroy(public_id, callback, options = {}) { return call_api("destroy", callback, options, function () { return [ diff --git a/lib/v2/uploader.js b/lib/v2/uploader.js index 5c1bd6d1..35d2cc3b 100644 --- a/lib/v2/uploader.js +++ b/lib/v2/uploader.js @@ -33,6 +33,5 @@ exports.upload_tag_params = uploader.upload_tag_params; exports.upload_url = uploader.upload_url; exports.image_upload_tag = uploader.image_upload_tag; exports.unsigned_image_upload_tag = uploader.unsigned_image_upload_tag; -exports.create_slideshow = uploader.create_slideshow; exports.download_generated_sprite = uploader.download_generated_sprite; exports.download_multi = uploader.download_multi; diff --git a/test/integration/api/uploader/slideshow_spec.js b/test/integration/api/uploader/slideshow_spec.js deleted file mode 100644 index d7bd60cd..00000000 --- a/test/integration/api/uploader/slideshow_spec.js +++ /dev/null @@ -1,114 +0,0 @@ -const cloudinary = require("../../../../cloudinary"); -const describe = require('../../../testUtils/suite'); -const TEST_ID = Date.now(); - -const createTestConfig = require('../../../testUtils/createTestConfig'); - -const testConstants = require('../../../testUtils/testConstants'); -const allSettled = require("../../../testUtils/helpers/allSettled"); -const UPLOADER_V2 = cloudinary.v2.uploader; - -const { - TIMEOUT, - TAGS -} = testConstants; - -const { - TEST_TAG -} = TAGS; - -const { URL: NodeURL, URLSearchParams: NodeURLSearchParams } = require('url'); -let cleanupJsdom; - -describe("create slideshow tests", function () { - this.timeout(TIMEOUT.LONG); - before(function () { - cleanupJsdom = require('jsdom-global')(); - global.URL = NodeURL; - global.URLSearchParams = NodeURLSearchParams; - }); - after(function () { - var config = cloudinary.config(true); - if (!(config.api_key && config.api_secret)) { - expect().fail("Missing key and secret. Please set CLOUDINARY_URL."); - } - return allSettled([ - !cloudinary.config().keep_test_products ? cloudinary.v2.api.delete_resources_by_tag(TEST_TAG) : void 0, - !cloudinary.config().keep_test_products ? cloudinary.v2.api.delete_resources_by_tag(TEST_TAG, - { - resource_type: "video" - }) : void 0 - ]).finally(function () { - if (typeof cleanupJsdom === 'function') cleanupJsdom(); - global.URL = NodeURL; - global.URLSearchParams = NodeURLSearchParams; - }); - }); - beforeEach(function () { - cloudinary.config(true); - cloudinary.config(createTestConfig()); - }); - - - it("should successfully create slideshow", async function () { - // this.timeout(TIMEOUT.LONG); - const slideshowManifest - = 'w_352;h_240;du_5;fps_30;vars_(slides_((media_s64:aHR0cHM6Ly9y' + - 'ZXMuY2xvdWRpbmFyeS5jb20vZGVtby9pbWFnZS91cGxvYWQvY291cGxl);(media_s64:aH' + - 'R0cHM6Ly9yZXMuY2xvdWRpbmFyeS5jb20vZGVtby9pbWFnZS91cGxvYWQvc2FtcGxl)))'; - - const slideshowManifestJson = { - "w": 848, - "h": 480, - "du": 6, - "fps": 30, - "vars": { - "sdur": 500, - "tdur": 500, - "slides": [ - { - "media": "i:protests9" - }, { - "media": "i:protests8" - }, - { - "media": "i:protests7" - }, - { - "media": "i:protests6" - }, - { - "media": "i:protests2" - }, - { - "media": "i:protests1" - } - ] - } - } - - - const res = await UPLOADER_V2.create_slideshow({ - manifest_transformation: { - custom_function: { - function_type: 'render', - source: slideshowManifest - } - }, - transformation: { - width: 100, - height: 100, - crop: 'scale' - }, - // manifest_json: slideshowManifestJson, - tags: [TEST_TAG], - overwrite: true, - public_id: TEST_ID, - notification_url: 'https://example.com' - }); - - expect(res.status).to.be('processing'); - expect(res.public_id).to.be(TEST_ID.toString()); // TestID is int, Server returns a string and not an int. - expect(res.batch_id.length).to.be.above(5); // some long string - }) -}) diff --git a/types/cloudinary_ts_spec.ts b/types/cloudinary_ts_spec.ts index d046009d..59826c74 100644 --- a/types/cloudinary_ts_spec.ts +++ b/types/cloudinary_ts_spec.ts @@ -1240,14 +1240,3 @@ cloudinary.v2.api.config(); // $ExpectType Promise cloudinary.v2.api.config({ settings: true }); - -// $ExpectType Promise -cloudinary.v2.uploader.create_slideshow({ - manifest_json: { - foo: 'bar' // This is a typescript Record - }, // In practice only one of the two are allowed - manifest_transformation: { - width: 100 - }, - height: 100 -}); diff --git a/types/index.d.ts b/types/index.d.ts index 1164bce7..432c6e42 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1426,11 +1426,6 @@ declare module 'cloudinary' { function upload_url(options?: ConfigOptions): Promise; - function create_slideshow(options?: ConfigOptions & { - manifest_transformation?: TransformationOptions, - manifest_json?: Record - }, callback?: UploadResponseCallback): Promise; - /****************************** Structured Metadata API V2 Methods *************************************/ function update_metadata(metadata: string | Record, public_ids: string[], options?: UploadApiOptions, callback?: ResponseCallback): Promise;