backblaze-b2
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -0,1 +1,11 @@ | ||
### v1.7.0 (June 5, 2021) - The Maintenance release | ||
Fixes | ||
- Update dependencies | ||
Features | ||
- Add optional contentLength param to uploadPart (#92 - thanks @Klowner) | ||
### v1.6.0 (January 1, 2020) - The List Parts release | ||
@@ -2,0 +12,0 @@ |
@@ -87,3 +87,3 @@ const _ = require('lodash'); | ||
Authorization: args.uploadAuthToken, | ||
'Content-Length': args.data.byteLength || args.data.length, | ||
'Content-Length': args.contentLength || args.data.byteLength || args.data.length, | ||
'X-Bz-Part-Number': args.partNumber, | ||
@@ -90,0 +90,0 @@ 'X-Bz-Content-Sha1': args.hash || (args.data ? sha1(args.data) : null) |
@@ -1,3 +0,1 @@ | ||
/* global Buffer */ | ||
// use: let deferred = new Deferred(); | ||
@@ -4,0 +2,0 @@ /** Backwards compatible Promise.defer() function */ |
{ | ||
"name": "backblaze-b2", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "Node.js Library for the Backblaze B2 Storage Service", | ||
@@ -32,10 +32,10 @@ "main": "index.js", | ||
"devDependencies": { | ||
"eslint": "^5.12.1", | ||
"eslint": "^7.28.0", | ||
"expect.js": "^0.3.1", | ||
"mocha": "^5.2.0" | ||
"mocha": "^8.4.0" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.18.0", | ||
"axios-retry": "^3.1.2", | ||
"lodash": "^4.17.11" | ||
"axios": "^0.21.1", | ||
"axios-retry": "^3.1.9", | ||
"lodash": "^4.17.21" | ||
}, | ||
@@ -42,0 +42,0 @@ "engines": { |
@@ -33,3 +33,3 @@ # Backblaze B2 Node.js Library | ||
try { | ||
await b2.authorize(); // must authorize first | ||
await b2.authorize(); // must authorize first (authorization lasts 24 hrs) | ||
let response = await b2.getBucket({ bucketName: 'my-bucket' }); | ||
@@ -95,3 +95,3 @@ console.log(response.data); | ||
// authorize with provided credentials | ||
// authorize with provided credentials (authorization expires after 24 hours) | ||
b2.authorize({ | ||
@@ -151,3 +151,3 @@ // ...common arguments (optional) | ||
// valid characters should be a-z, A-Z and '-', all other characters will cause an error to be thrown | ||
key1: 'value' | ||
key1: 'value', | ||
key2: 'value' | ||
@@ -252,3 +252,4 @@ }, | ||
hash: 'sha1-hash', // optional data hash, will use sha1(data) if not provided | ||
onUploadProgress: (event) => {} || null // progress monitoring | ||
onUploadProgress: (event) => {} || null, // progress monitoring | ||
contentLength: 0, // optional data length, will default to data.byteLength or data.length if not provided | ||
// ...common arguments (optional) | ||
@@ -316,3 +317,3 @@ }); // returns promise | ||
If you are unsure whether you should use multipart upload, refer to the `recommendedPartSize` | ||
valud returned by a call to `authorize()`. | ||
value returned by a call to `authorize()`. | ||
@@ -319,0 +320,0 @@ ```javascript |
@@ -1,3 +0,1 @@ | ||
/* global describe, beforeEach, it */ | ||
var expect = require('expect.js'); | ||
@@ -4,0 +2,0 @@ |
@@ -1,3 +0,1 @@ | ||
/* global describe, beforeEach, it */ | ||
const expect = require('expect.js'); | ||
@@ -4,0 +2,0 @@ |
@@ -1,3 +0,1 @@ | ||
/* global describe, beforeEach, it */ | ||
var expect = require('expect.js'); | ||
@@ -298,2 +296,17 @@ | ||
}); | ||
describe('with contentLength specified', function() { | ||
beforeEach(function(done) { | ||
options.data = 'more than 3'; | ||
options.contentLength = 3; | ||
file.uploadPart(b2, options).then(function() { | ||
done(); | ||
}); | ||
}); | ||
it('should override Content-Length header', function() { | ||
expect(requestOptions.headers['Content-Length']).to.equal(3); | ||
}); | ||
}); | ||
}); | ||
@@ -300,0 +313,0 @@ |
@@ -1,3 +0,1 @@ | ||
/* global describe, beforeEach, it */ | ||
const expect = require('expect.js'); | ||
@@ -4,0 +2,0 @@ |
@@ -1,3 +0,1 @@ | ||
/* global describe, beforeEach, it */ | ||
var expect = require('expect.js'); | ||
@@ -4,0 +2,0 @@ |
@@ -1,3 +0,1 @@ | ||
/* global describe, beforeEach, it */ | ||
var expect = require('expect.js'); | ||
@@ -4,0 +2,0 @@ |
@@ -1,3 +0,1 @@ | ||
/* global describe, beforeEach, it */ | ||
var expect = require('expect.js'); | ||
@@ -4,0 +2,0 @@ |
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
116429
2508
376
+ Addedaxios@0.21.4(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
- Removedaxios@0.18.1(transitive)
- Removedfollow-redirects@1.5.10(transitive)
- Removedis-buffer@2.0.5(transitive)
Updatedaxios@^0.21.1
Updatedaxios-retry@^3.1.9
Updatedlodash@^4.17.21