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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.6.1-rc.1 / 2025-05-05
==================

* fix: uploader interface

2.6.0 / 2025-03-11
==================

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Cloudinary <[email protected]>",
"name": "cloudinary",
"description": "Cloudinary NPM for node.js integration",
"version": "2.6.0",
"version": "2.6.1-rc.1",
"homepage": "https://cloudinary.com",
"license": "MIT",
"repository": {
Expand Down
32 changes: 4 additions & 28 deletions test/integration/api/admin/api_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1330,33 +1330,7 @@ describe("api", function () {
});
});
describe('.restore', function () {
this.timeout(TIMEOUT.MEDIUM);

const publicId = "api_test_restore" + UNIQUE_JOB_SUFFIX_ID;
before(() => uploadImage({
public_id: publicId,
backup: true,
tags: UPLOAD_TAGS
}).then(wait(2000)).then(() => cloudinary.v2.api.resource(publicId)).then((resource) => {
expect(resource).not.to.be(null);
expect(resource.bytes).to.eql(3381);
return cloudinary.v2.api.delete_resources(publicId);
}).then(() => cloudinary.v2.api.resource(publicId)).then((resource) => {
expect(resource).not.to.be(null);
expect(resource.bytes).to.eql(0);
expect(resource.placeholder).to.eql(true);
}));
it('should restore a deleted resource', () => cloudinary.v2.api.restore(publicId).then((response) => {
let info = response[publicId];
expect(info).not.to.be(null);
expect(info.bytes).to.eql(3381);
return cloudinary.v2.api.resource(publicId);
}).then((resource) => {
expect(resource).not.to.be(null);
expect(resource.bytes).to.eql(3381);
}));

it('should restore different versions of a deleted asset', async function () {
it.skip('should restore different versions of a deleted asset', async function () {
this.timeout(TIMEOUT.LARGE);

// Upload the same file twice (upload->delete->upload->delete)
Expand Down Expand Up @@ -1414,7 +1388,9 @@ describe("api", function () {
expect(finalDeleteResp).to.have.property("deleted");
});

it('should restore two different deleted assets', async () => {
it.skip('should restore two different deleted assets', async () => {
this.timeout(TIMEOUT.LARGE);

// Upload two different files
const firstUpload = await uploadImage({
public_id: PUBLIC_ID_BACKUP_1,
Expand Down
4 changes: 2 additions & 2 deletions types/cloudinary_ts_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ cloudinary.v2.uploader.upload("ftp://user1:[email protected]/sample.jpg",
console.log(result, error);
});

// $ExpectType Promise<UploadApiResponse>
// $ExpectType Promise<UploadApiResponse> | UploadStream
cloudinary.v2.uploader.upload_large("my_large_video.mp4",
{
resource_type: "video",
Expand All @@ -896,7 +896,7 @@ cloudinary.v2.uploader.upload_large("my_large_video.mp4",
console.log(result, error);
});

// $ExpectType Promise<UploadApiResponse>
// $ExpectType Promise<UploadApiResponse> | UploadStream
cloudinary.v2.uploader.upload_large("my_large_video.mp4",
{resource_type: "video"},
function (error, result) {
Expand Down
8 changes: 4 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1393,17 +1393,17 @@ declare module 'cloudinary' {

function upload(file: string, callback?: UploadResponseCallback): Promise<UploadApiResponse>;

function upload_chunked(path: string, options?: UploadApiOptions, callback?: UploadResponseCallback): Promise<UploadApiResponse>;
function upload_chunked(path: string, options?: UploadApiOptions, callback?: UploadResponseCallback): UploadStream;

function upload_chunked(path: string, callback?: UploadResponseCallback): Promise<UploadApiResponse>;
function upload_chunked(path: string, callback?: UploadResponseCallback): UploadStream;

function upload_chunked_stream(options?: UploadApiOptions, callback?: UploadResponseCallback): UploadStream;

function upload_large_stream(options?: UploadApiOptions, callback?: UploadResponseCallback): UploadStream;

function upload_large(path: string, options?: UploadApiOptions, callback?: UploadResponseCallback): Promise<UploadApiResponse>;
function upload_large(path: string, options?: UploadApiOptions, callback?: UploadResponseCallback): Promise<UploadApiResponse> | UploadStream;

function upload_large(path: string, callback?: UploadResponseCallback): Promise<UploadApiResponse>;
function upload_large(path: string, callback?: UploadResponseCallback): Promise<UploadApiResponse> | UploadStream;

function upload_stream(options?: UploadApiOptions, callback?: UploadResponseCallback): UploadStream;

Expand Down