Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions types/cloudinary_ts_spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as cloudinary from 'cloudinary';
import * as Http from "http";
import {MetadataFieldApiResponse, ResponseCallback, UploadApiOptions} from "cloudinary";

// $ExpectType ConfigOptions
cloudinary.v2.config();
Expand Down Expand Up @@ -623,6 +624,13 @@ const datasource_changes = {
],
};

cloudinary.v2.uploader.update_metadata({ metadata_color: "red", metadata_shape: "" }, ["test_id_1", "test_id_2"])
.then((res)=> {console.log(res)})
.catch((err)=> {console.log(err)});

cloudinary.v2.uploader.update_metadata('countryFieldId=[\"id_us\",\"id_uk\",\"id_france"]', [ 'dog', 'lion' ],
function(error, result) { console.log(result, error) });

cloudinary.v2.api.update_metadata_field_datasource('EXTERNAL_ID_GET_LIST1', datasource_changes)
.then((res)=> {console.log(res)})
.catch((err)=> {console.log(err)});
Expand Down
6 changes: 6 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,12 @@ declare module 'cloudinary' {
function upload_tag_params(options?: UploadApiOptions, callback?: UploadResponseCallback): Promise<any>;

function upload_url(options?: ConfigOptions): Promise<any>;

/****************************** Structured Metadata API V2 Methods *************************************/

function update_metadata(metadata: string | object, public_ids: string[], options?:UploadApiOptions, callback?: ResponseCallback): Promise<MetadataFieldApiResponse>;

function update_metadata(metadata: string| object, public_ids: string[], callback?: ResponseCallback): Promise<MetadataFieldApiResponse>;
}

/****************************** Search API *************************************/
Expand Down