Skip to content

Commit 8e4610a

Browse files
Add missing types to create/delete_folder and private_download_url (#473)
1 parent aea22ff commit 8e4610a

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

types/cloudinary_ts_spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as cloudinary from 'cloudinary';
2+
import * as Http from "http";
23

34
// $ExpectType void
45
cloudinary.v2.config({
@@ -994,3 +995,23 @@ cloudinary.v2.provisioning.account.user_group_users(
994995
(res) => {
995996

996997
});
998+
999+
1000+
// $ExpectType string
1001+
cloudinary.v2.utils.private_download_url('foo', 'foo', {
1002+
attachment: true,
1003+
expires_at: 111
1004+
});
1005+
1006+
1007+
// $ExpectType Promise<any>
1008+
cloudinary.v2.api.create_folder('foo',{
1009+
attachment: true,
1010+
expires_at: 111
1011+
});
1012+
1013+
1014+
// $ExpectType Promise<any>
1015+
cloudinary.v2.api.delete_folder('foo',{
1016+
agent: new Http.Agent()
1017+
});

types/index.d.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,7 @@ declare module 'cloudinary' {
108108
| "make_transparent"
109109
| "shadow"
110110
| "viesus_correct"
111-
| "contrast"
112-
| "vibrance"
113111
| "fill_light"
114-
| "auto_color"
115-
| "auto_contrast"
116-
| "auto_brightness"
117112
| "gamma"
118113
| "improve";
119114

@@ -148,7 +143,6 @@ declare module 'cloudinary' {
148143
| "clip_evenodd"
149144
| "cutter"
150145
| "force_strip"
151-
| "force_strip"
152146
| "getinfo"
153147
| "ignore_aspect_ratio"
154148
| "immutable_cache"
@@ -158,7 +152,6 @@ declare module 'cloudinary' {
158152
| "lossy"
159153
| "preserve_transparency"
160154
| "png8"
161-
| "png8"
162155
| "png32"
163156
| "progressive"
164157
| "rasterize"
@@ -730,6 +723,13 @@ declare module 'cloudinary' {
730723
function generate_auth_token(options?: AuthTokenApiOptions): string;
731724

732725
function webhook_signature(data?: string, timestamp?: number, options?: ConfigOptions): string;
726+
727+
function private_download_url(publicID: string, format:string, options: Partial<{
728+
resource_type: ResourceType;
729+
type: DeliveryType;
730+
expires_at: number;
731+
attachment: boolean;
732+
}>): string;
733733
}
734734

735735
/****************************** Admin API V2 Methods *************************************/
@@ -905,6 +905,10 @@ declare module 'cloudinary' {
905905

906906
function usage(options?: AdminApiOptions): Promise<any>;
907907

908+
function create_folder(path:string, options?: AdminApiOptions, callback?: ResponseCallback): Promise<any>;
909+
910+
function delete_folder(path:string, options?: AdminApiOptions, callback?: ResponseCallback): Promise<any>;
911+
908912
/****************************** Structured Metadata API V2 Methods *************************************/
909913

910914
function add_metadata_field(field: MetadataFieldApiOptions, options?: AdminApiOptions, callback?: ResponseCallback): Promise<MetadataFieldApiResponse>;

0 commit comments

Comments
 (0)