backblaze-b2
Advanced tools
Comparing version 0.9.11 to 0.9.12
@@ -0,1 +1,12 @@ | ||
### v0.9.12 (March 4, 2017) - The options release | ||
Fixes | ||
- Added prefix and delimiter support to file list API call [link](https://github.com/yakovkhalinsky/backblaze-b2/pull/20) | ||
- Promise Progress Notifications | ||
[link](https://github.com/yakovkhalinsky/backblaze-b2/pull/21) | ||
Thanks to the contributors for this release | ||
- [crazyscience](https://github.com/crazyscience) | ||
### v0.9.11 (March 16, 2016) - The file encoding release | ||
@@ -100,2 +111,1 @@ | ||
- Initial mocha test setup | ||
@@ -8,2 +8,3 @@ var sha1 = require('node-sha1'); | ||
var conf = require('../../conf'); | ||
var progress = require('request-progress'); | ||
@@ -37,3 +38,6 @@ exports.uploadFile = function(b2, args) { | ||
var maxFileCount = args.maxFileCount; | ||
var prefix = args.prefix; | ||
var delimiter = args.delimiter; | ||
var options = { | ||
@@ -46,3 +50,6 @@ url: getListFilesUrl(b2), | ||
startFileName: startFileName ? startFileName : '', | ||
maxFileCount: maxFileCount ? maxFileCount : 100 | ||
maxFileCount: maxFileCount ? maxFileCount : 100, | ||
prefix: prefix ? prefix : '', | ||
delimiter: delimiter ? delimiter : null | ||
}) | ||
@@ -112,3 +119,6 @@ }; | ||
var requestInstance = request.getInstance(); | ||
requestInstance(options, utils.getProcessFileSuccess(deferred, processDownloadResponse)); | ||
progress(requestInstance(options, utils.getProcessFileSuccess(deferred, processDownloadResponse))) | ||
.on('progress', function (state) { | ||
deferred.notify(state); | ||
}); | ||
@@ -131,3 +141,6 @@ return deferred.promise; | ||
var requestInstance = request.getInstance(); | ||
requestInstance(options, utils.getProcessFileSuccess(deferred, processDownloadResponse)); | ||
progress(requestInstance(options, utils.getProcessFileSuccess(deferred, processDownloadResponse))) | ||
.on('progress', function (state) { | ||
deferred.notify(state); | ||
}); | ||
@@ -134,0 +147,0 @@ return deferred.promise; |
var q = require('q'); | ||
var progress = require('request-progress'); | ||
var utils = require('./utils'); | ||
var REQUEST; | ||
@@ -15,3 +17,6 @@ | ||
var requestInstance = exports.getInstance(); | ||
requestInstance(options, utils.processResponseGeneric(deferred)); | ||
progress(requestInstance(options, utils.processResponseGeneric(deferred))) | ||
.on('progress', function (state) { | ||
deferred.notify(state); | ||
}); | ||
@@ -18,0 +23,0 @@ return deferred.promise; |
{ | ||
"name": "backblaze-b2", | ||
"version": "0.9.11", | ||
"version": "0.9.12", | ||
"description": "Node.js Library for the Backblaze B2 Storage Service", | ||
@@ -39,4 +39,5 @@ "main": "index.js", | ||
"q": "^1.4.1", | ||
"request": "^2.67.0" | ||
"request": "^2.67.0", | ||
"request-progress": "^3.0.0" | ||
} | ||
} |
@@ -87,3 +87,5 @@ ### Backblaze B2 Node.js Library | ||
startFileName: 'startFileName', | ||
maxFileCount: 100 | ||
maxFileCount: 100, | ||
delimiter: '', | ||
prefix: '' | ||
}); // returns promise | ||
@@ -90,0 +92,0 @@ |
@@ -27,2 +27,7 @@ var expect = require('expect.js'); | ||
cb(errorMessage, false, JSON.stringify(response)); | ||
var bogusRequestObject = function() { | ||
// Fake event subscribe that supports method chaining | ||
this.on = function() {return this;}; | ||
}; | ||
return new bogusRequestObject(); | ||
}; | ||
@@ -29,0 +34,0 @@ |
@@ -29,2 +29,8 @@ var expect = require('expect.js'); | ||
cb(errorMessage, false, JSON.stringify(response)); | ||
// Well, we can't return undefined, now can we? | ||
var bogusRequestObject = function() { | ||
// Fake event subscribe that supports method chaining | ||
this.on = function() {return this;}; | ||
}; | ||
return new bogusRequestObject(); | ||
}; | ||
@@ -209,3 +215,3 @@ | ||
}, | ||
body: '{"bucketId":"123abc","startFileName":"unicorns.png","maxFileCount":200}' | ||
body: '{"bucketId":"123abc","startFileName":"unicorns.png","maxFileCount":200,"prefix":"","delimiter":null}' | ||
}); | ||
@@ -408,2 +414,8 @@ expect(actualResponse).to.eql(response); | ||
cb(errorMessage, response, 'file contents'); | ||
// Well, we can't return undefined, now can we? | ||
var bogusRequestObject = function() { | ||
// Fake event subscribe that supports method chaining | ||
this.on = function() {return this;}; | ||
}; | ||
return new bogusRequestObject(); | ||
}; | ||
@@ -471,2 +483,8 @@ | ||
cb(errorMessage, response, 'file contents'); | ||
// Well, we can't return undefined, now can we? | ||
var bogusRequestObject = function() { | ||
// Fake event subscribe that supports method chaining | ||
this.on = function() {return this;}; | ||
}; | ||
return new bogusRequestObject(); | ||
}; | ||
@@ -473,0 +491,0 @@ |
@@ -14,2 +14,8 @@ var expect = require('expect.js'); | ||
cb(false, false, JSON.stringify(options)); | ||
// Well, we can't return undefined, now can we? | ||
var bogusRequestObject = function() { | ||
// Fake event subscribe that supports method chaining | ||
this.on = function() {return this;}; | ||
}; | ||
return new bogusRequestObject(); | ||
}; | ||
@@ -16,0 +22,0 @@ options = { unicorn: 'rainbows' }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67698
1579
123
4
+ Addedrequest-progress@^3.0.0
+ Addedrequest-progress@3.0.0(transitive)
+ Addedthrottleit@1.0.1(transitive)