Comparing version 6.1.11 to 6.1.12
## CHANGE LOG | ||
### v6.1.12 | ||
2016-10-10 | ||
- 增加多机房接口调用支持 | ||
### v6.1.11 | ||
@@ -4,0 +10,0 @@ |
@@ -5,2 +5,5 @@ | ||
module.exports = { | ||
auth: { | ||
digest: require(libpath + '/auth' + '/digest.js') | ||
}, | ||
io: require(libpath + '/io.js'), | ||
@@ -12,3 +15,4 @@ rs: require(libpath + '/rs.js'), | ||
rpc: require(libpath + '/rpc.js'), | ||
util: require(libpath + '/util.js') | ||
util: require(libpath + '/util.js'), | ||
zone: require(libpath + '/zone.js') | ||
}; |
{ | ||
"name": "qiniu", | ||
"version": "6.1.11", | ||
"version": "6.1.12", | ||
"description": "Node wrapper for Qiniu Resource (Cloud) Storage API", | ||
@@ -61,3 +61,4 @@ "main": "index.js", | ||
"crc32": "0.2.2", | ||
"urllib": "0.5.1" | ||
"urllib": "0.5.1", | ||
"sync-request":"3.0.1" | ||
}, | ||
@@ -64,0 +65,0 @@ "devDependencies": { |
@@ -14,3 +14,2 @@ var fs = require('fs'); | ||
exports.USER_AGENT = ua(); | ||
exports.UP_HOST = 'http://upload.qiniu.com'; | ||
@@ -21,1 +20,7 @@ exports.RS_HOST = 'http://rs.qbox.me'; | ||
exports.RPC_TIMEOUT = 3600000; // default rpc timeout: one hour | ||
exports.UC_HOST = 'http://uc.qbox.me'; | ||
exports.UP_HTTPS_HOST = 'https://up-z1.qbox.me'; | ||
exports.SCHEME = 'http'; // 上传使用的协议 | ||
exports.AUTOZONE = true; // 自动获取不同机房空间的上传域名 | ||
exports.BUCKET = null ; // 上传空间 | ||
exports.EXPIRE = 0; |
@@ -10,2 +10,4 @@ var conf = require('./conf'); | ||
var formstream = require('formstream'); | ||
var urllib = require('urllib'); | ||
var zone = require('./zone'); | ||
@@ -37,3 +39,3 @@ exports.UNDEFINED_KEY = '?' | ||
function putReadable (uptoken, key, rs, extra, onret) { | ||
if(!extra) { | ||
if (!extra) { | ||
extra = new PutExtra(); | ||
@@ -45,3 +47,3 @@ } | ||
if(!key) { | ||
if (!key) { | ||
key = exports.UNDEFINED_KEY; | ||
@@ -53,4 +55,6 @@ } | ||
}); | ||
var form = getMultipart(uptoken, key, rs, extra); | ||
// 设置上传域名 | ||
zone.up_host(uptoken, conf); | ||
@@ -60,2 +64,3 @@ return rpc.postMultipart(conf.UP_HOST, form, onret); | ||
function put(uptoken, key, body, extra, onret) { | ||
@@ -66,3 +71,3 @@ var rs = new Readable(); | ||
if(!extra) { | ||
if (!extra) { | ||
extra = new PutExtra(); | ||
@@ -73,2 +78,4 @@ } | ||
extra.crc32 = '' + parseInt(bodyCrc32, 16); | ||
} else if (extra.checkCrc == 2 && extra.crc32) { | ||
extra.crc32 = '' + extra.crc32 | ||
} | ||
@@ -87,3 +94,3 @@ return putReadable(uptoken, key, rs, extra, onret) | ||
form.field('token', uptoken); | ||
if(key != exports.UNDEFINED_KEY) { | ||
if (key != exports.UNDEFINED_KEY) { | ||
form.field('key', key); | ||
@@ -93,2 +100,6 @@ } | ||
if (extra.crc32) { | ||
form.field('crc32', extra.crc32); | ||
} | ||
for (var k in extra.params) { | ||
@@ -105,3 +116,3 @@ form.field(k, extra.params[k]); | ||
if(!extra) { | ||
if (!extra) { | ||
extra = new PutExtra(); | ||
@@ -112,4 +123,6 @@ } | ||
extra.crc32 = '' + parseInt(fileCrc32, 16); | ||
} else if (extra.checkCrc == 2 && extra.crc32) { | ||
extra.crc32 = '' + extra.crc32 | ||
} | ||
if(!extra.mimeType) { | ||
if (!extra.mimeType) { | ||
extra.mimeType = mime.lookup(loadFile); | ||
@@ -116,0 +129,0 @@ } |
@@ -54,6 +54,6 @@ var url = require('url'); | ||
Client.prototype.forceMove = function(bucketSrc, keySrc, bucketDest, keyDest, force, onret) { | ||
var encodedEntryURISrc = getEncodedEntryUri(bucketSrc, keySrc); | ||
var encodedEntryURIDest = getEncodedEntryUri(bucketDest, keyDest); | ||
var uri = conf.RS_HOST + '/move/' + encodedEntryURISrc + '/' + encodedEntryURIDest +'/force/'+force; | ||
var uri = conf.RS_HOST + '/move/' + encodedEntryURISrc + '/' + encodedEntryURIDest +'/force/'+force; | ||
@@ -74,7 +74,7 @@ var digest = util.generateAccessToken(uri, null); | ||
Client.prototype.forceCopy = function(bucketSrc, keySrc, bucketDest, keyDest, force, onret) { | ||
var encodedEntryURISrc = getEncodedEntryUri(bucketSrc, keySrc); | ||
var encodedEntryURIDest = getEncodedEntryUri(bucketDest, keyDest); | ||
var uri = conf.RS_HOST + '/copy/' + encodedEntryURISrc + '/' + encodedEntryURIDest +'/force/'+force; | ||
var digest = util.generateAccessToken(uri, null); | ||
@@ -122,3 +122,3 @@ rpc.postWithoutForm(uri, digest, onret); | ||
EntryPathPair.prototype.toStr = function(op, force) { | ||
if(typeof(force)=='undefined'){ | ||
if (typeof(force)=='undefined'){ | ||
@@ -157,3 +157,3 @@ return 'op=/' + op + '/' + this.src.encode() + '/' + this.dest.encode() + '&'; | ||
Client.prototype.forceBatchMove = function(entries, force, onret) { | ||
fileHandleForce('move', entries, force, onret); | ||
@@ -168,5 +168,5 @@ | ||
Client.prototype.forceBatchCopy = function(entries, force, onret) { | ||
fileHandleForce('copy', entries, force, onret); | ||
} | ||
@@ -264,2 +264,3 @@ | ||
this.callbackBodyType = putPolicyObj.callbackBodyType || null; | ||
this.callbackFetchKey = putPolicyObj.callbackFetchKey || null; | ||
@@ -277,2 +278,5 @@ this.persistentOps = putPolicyObj.persistentOps || null; | ||
this.mimeLimit = putPolicyObj.mimeLimit || null; | ||
this.deleteAfterDays = putPolicyObj.deleteAfterDays || null; | ||
} | ||
@@ -294,3 +298,3 @@ | ||
var flags = {}; | ||
var attrs = ['scope', 'insertOnly', 'saveKey', 'endUser', 'returnUrl', 'returnBody', 'callbackUrl', 'callbackHost', 'callbackBody', 'callbackBodyType', 'callbackFetchKey', 'persistentOps', 'persistentNotifyUrl', 'persistentPipeline', 'fsizeLimit','fsizeMin', 'detectMime', 'mimeLimit']; | ||
var attrs = ['scope', 'insertOnly', 'saveKey', 'endUser', 'returnUrl', 'returnBody', 'callbackUrl', 'callbackHost', 'callbackBody', 'callbackBodyType', 'callbackFetchKey', 'persistentOps', 'persistentNotifyUrl', 'persistentPipeline', 'fsizeLimit','fsizeMin', 'detectMime', 'mimeLimit', 'deleteAfterDays']; | ||
@@ -297,0 +301,0 @@ for (var i = attrs.length - 1; i >= 0; i--) { |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
36956
18
773
5
13
+ Addedsync-request@3.0.1
+ Addedasap@2.0.6(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcaseless@0.11.0(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhttp-basic@2.5.1(transitive)
+ Addedhttp-response-object@1.1.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedpromise@7.3.1(transitive)
+ Addedqs@6.13.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedsync-request@3.0.1(transitive)
+ Addedthen-request@2.2.0(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addedutil-deprecate@1.0.2(transitive)