Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qiniu

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qiniu - npm Package Compare versions

Comparing version 6.1.11 to 6.1.12

examples/pfopDemo.js

6

CHANGELOG.md
## CHANGE LOG
### v6.1.12
2016-10-10
- 增加多机房接口调用支持
### v6.1.11

@@ -4,0 +10,0 @@

6

index.js

@@ -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')
};

5

package.json
{
"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--) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc