-
Notifications
You must be signed in to change notification settings - Fork 319
Feature: Add support for restoring asset(s) by asset id #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, I left two comments, please take a look.
Also, if I see correctly, some specs are failing in some of the node versions, please take a look at those too.
@@ -1102,6 +1102,10 @@ declare module 'cloudinary' { | |||
|
|||
function restore(public_ids: string[], callback?: ResponseCallback): Promise<any>; | |||
|
|||
function restore_by_asset_ids(asset_ids: string[] | string, options?: AdminAndResourceOptions, callback?: ResponseCallback): Promise<ResourceApiResponse>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I see correctly, the implementation of restore_by_asset_ids
doesn't support passing a single value, we're only passing the first argument as a payload when doing the request to Admin API.
Currently Admin API only supports a list of values under asset_ids
which means that, either this type definition needs to change to string[]
or we should wrap the first argument in array if it's not already an array, in the restore_by_asset_ids
implementation.
@@ -29,7 +29,7 @@ | |||
"jsdoc": "^4.0.4", | |||
"jsdom": "^9.12.0", | |||
"jsdom-global": "2.1.1", | |||
"mocha": "^6.2.3", | |||
"mocha": "^7.2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this intentional?
Brief Summary of Changes
This PR adds support for restoring one or more assets by asset_id, via the following endpoint: POST /resources/restore/:asset_ids
Documentation reference: https://cloudinary.com/documentation/admin_api#restore_resources_by_asset_id
What Does This PR Address?
Are Tests Included?