From 4fa54f38ca965241b458458619cd8d93ca9a42b6 Mon Sep 17 00:00:00 2001 From: Patrick Tolosa Date: Wed, 17 Feb 2021 14:47:29 +0200 Subject: [PATCH] Add missing types to create/delete_folder and private_download_url --- types/cloudinary_ts_spec.ts | 21 +++++++++++++++++++++ types/index.d.ts | 18 +++++++++++------- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/types/cloudinary_ts_spec.ts b/types/cloudinary_ts_spec.ts index ee353e6b..eb8aa8d3 100644 --- a/types/cloudinary_ts_spec.ts +++ b/types/cloudinary_ts_spec.ts @@ -1,4 +1,5 @@ import * as cloudinary from 'cloudinary'; +import * as Http from "http"; // $ExpectType void cloudinary.v2.config({ @@ -994,3 +995,23 @@ cloudinary.v2.provisioning.account.user_group_users( (res) => { }); + + +// $ExpectType string +cloudinary.v2.utils.private_download_url('foo', 'foo', { + attachment: true, + expires_at: 111 +}); + + +// $ExpectType Promise +cloudinary.v2.api.create_folder('foo',{ + attachment: true, + expires_at: 111 +}); + + +// $ExpectType Promise +cloudinary.v2.api.delete_folder('foo',{ + agent: new Http.Agent() +}); diff --git a/types/index.d.ts b/types/index.d.ts index 4e429b62..c1a099fa 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -108,12 +108,7 @@ declare module 'cloudinary' { | "make_transparent" | "shadow" | "viesus_correct" - | "contrast" - | "vibrance" | "fill_light" - | "auto_color" - | "auto_contrast" - | "auto_brightness" | "gamma" | "improve"; @@ -148,7 +143,6 @@ declare module 'cloudinary' { | "clip_evenodd" | "cutter" | "force_strip" - | "force_strip" | "getinfo" | "ignore_aspect_ratio" | "immutable_cache" @@ -158,7 +152,6 @@ declare module 'cloudinary' { | "lossy" | "preserve_transparency" | "png8" - | "png8" | "png32" | "progressive" | "rasterize" @@ -730,6 +723,13 @@ declare module 'cloudinary' { function generate_auth_token(options?: AuthTokenApiOptions): string; function webhook_signature(data?: string, timestamp?: number, options?: ConfigOptions): string; + + function private_download_url(publicID: string, format:string, options: Partial<{ + resource_type: ResourceType; + type: DeliveryType; + expires_at: number; + attachment: boolean; + }>): string; } /****************************** Admin API V2 Methods *************************************/ @@ -905,6 +905,10 @@ declare module 'cloudinary' { function usage(options?: AdminApiOptions): Promise; + function create_folder(path:string, options?: AdminApiOptions, callback?: ResponseCallback): Promise; + + function delete_folder(path:string, options?: AdminApiOptions, callback?: ResponseCallback): Promise; + /****************************** Structured Metadata API V2 Methods *************************************/ function add_metadata_field(field: MetadataFieldApiOptions, options?: AdminApiOptions, callback?: ResponseCallback): Promise;