Comparing version 7.3.2 to 7.3.3
## CHANGE LOG | ||
## 7.3.3 | ||
修复上传策略中forceSaveKey指定无效 | ||
## 7.3.2 | ||
@@ -4,0 +7,0 @@ 修复crc32指定值无效 |
{ | ||
"name": "qiniu", | ||
"version": "7.3.2", | ||
"version": "7.3.3", | ||
"description": "Node wrapper for Qiniu Resource (Cloud) Storage API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,3 +9,3 @@ const os = require('os'); | ||
return 'QiniuNodejs/' + pkg.version + ' (' + os.type() + '; ' + os.platform() + | ||
'; ' + os.arch() + '; )'; | ||
'; ' + os.arch() + '; )'; | ||
}; | ||
@@ -20,3 +20,3 @@ | ||
exports.FormMimeRaw = 'application/octet-stream'; | ||
exports.RS_HOST = 'http://rs.qiniu.com'; | ||
exports.RS_HOST = 'rs.qiniu.com'; | ||
exports.RPC_TIMEOUT = 120000; // 120s | ||
@@ -29,3 +29,3 @@ exports.UC_HOST = 'uc.qbox.me'; | ||
exports.Config = function Config (options) { | ||
exports.Config = function Config(options) { | ||
options = options || {}; | ||
@@ -57,27 +57,27 @@ // use http or https protocol | ||
switch (zoneTag) { | ||
case 'z1': | ||
this.rsHost = 'rs-z1.qiniu.com'; | ||
this.rsfHost = 'rsf-z1.qiniu.com'; | ||
this.apiHost = 'api-z1.qiniu.com'; | ||
break; | ||
case 'z2': | ||
this.rsHost = 'rs-z2.qiniu.com'; | ||
this.rsfHost = 'rsf-z2.qiniu.com'; | ||
this.apiHost = 'api-z2.qiniu.com'; | ||
break; | ||
case 'na0': | ||
this.rsHost = 'rs-na0.qiniu.com'; | ||
this.rsfHost = 'rsf-na0.qiniu.com'; | ||
this.apiHost = 'api-na0.qiniu.com'; | ||
break; | ||
case 'as0': | ||
this.rsHost = 'rs-as0.qiniu.com'; | ||
this.rsfHost = 'rsf-as0.qiniu.com'; | ||
this.apiHost = 'api-as0.qiniu.com'; | ||
break; | ||
default: | ||
this.rsHost = 'rs.qiniu.com'; | ||
this.rsfHost = 'rsf.qiniu.com'; | ||
this.apiHost = 'api.qiniu.com'; | ||
break; | ||
case 'z1': | ||
this.rsHost = 'rs-z1.qiniu.com'; | ||
this.rsfHost = 'rsf-z1.qiniu.com'; | ||
this.apiHost = 'api-z1.qiniu.com'; | ||
break; | ||
case 'z2': | ||
this.rsHost = 'rs-z2.qiniu.com'; | ||
this.rsfHost = 'rsf-z2.qiniu.com'; | ||
this.apiHost = 'api-z2.qiniu.com'; | ||
break; | ||
case 'na0': | ||
this.rsHost = 'rs-na0.qiniu.com'; | ||
this.rsfHost = 'rsf-na0.qiniu.com'; | ||
this.apiHost = 'api-na0.qiniu.com'; | ||
break; | ||
case 'as0': | ||
this.rsHost = 'rs-as0.qiniu.com'; | ||
this.rsfHost = 'rsf-as0.qiniu.com'; | ||
this.apiHost = 'api-as0.qiniu.com'; | ||
break; | ||
default: | ||
this.rsHost = 'rs.qiniu.com'; | ||
this.rsfHost = 'rsf.qiniu.com'; | ||
this.apiHost = 'api.qiniu.com'; | ||
break; | ||
} | ||
@@ -84,0 +84,0 @@ } |
@@ -11,3 +11,3 @@ const querystring = require('querystring'); | ||
function BucketManager (mac, config) { | ||
function BucketManager(mac, config) { | ||
this.mac = mac || new digest.Mac(); | ||
@@ -32,3 +32,3 @@ this.config = config || new conf.Config(); | ||
function statReq (mac, config, bucket, key, callbackFunc) { | ||
function statReq(mac, config, bucket, key, callbackFunc) { | ||
var scheme = config.useHttpsDomain ? 'https://' : 'http://'; | ||
@@ -58,3 +58,3 @@ var statOp = exports.statOp(bucket, key); | ||
function changeMimeReq (mac, config, bucket, key, newMime, callbackFunc) { | ||
function changeMimeReq(mac, config, bucket, key, newMime, callbackFunc) { | ||
var scheme = config.useHttpsDomain ? 'https://' : 'http://'; | ||
@@ -84,3 +84,3 @@ var changeMimeOp = exports.changeMimeOp(bucket, key, newMime); | ||
function changeHeadersReq (mac, config, bucket, key, headers, callbackFunc) { | ||
function changeHeadersReq(mac, config, bucket, key, headers, callbackFunc) { | ||
var scheme = config.useHttpsDomain ? 'https://' : 'http://'; | ||
@@ -114,3 +114,3 @@ var changeHeadersOp = exports.changeHeadersOp(bucket, key, headers); | ||
function moveReq (mac, config, srcBucket, srcKey, destBucket, destKey, | ||
function moveReq(mac, config, srcBucket, srcKey, destBucket, destKey, | ||
options, callbackFunc) { | ||
@@ -145,3 +145,3 @@ var scheme = config.useHttpsDomain ? 'https://' : 'http://'; | ||
function copyReq (mac, config, srcBucket, srcKey, destBucket, destKey, | ||
function copyReq(mac, config, srcBucket, srcKey, destBucket, destKey, | ||
options, callbackFunc) { | ||
@@ -171,3 +171,3 @@ options = options || {}; | ||
function deleteReq (mac, config, bucket, key, callbackFunc) { | ||
function deleteReq(mac, config, bucket, key, callbackFunc) { | ||
var scheme = config.useHttpsDomain ? 'https://' : 'http://'; | ||
@@ -197,3 +197,3 @@ var deleteOp = exports.deleteOp(bucket, key); | ||
function deleteAfterDaysReq (mac, config, bucket, key, days, callbackFunc) { | ||
function deleteAfterDaysReq(mac, config, bucket, key, days, callbackFunc) { | ||
var scheme = config.useHttpsDomain ? 'https://' : 'http://'; | ||
@@ -222,3 +222,3 @@ var deleteAfterDaysOp = exports.deleteAfterDaysOp(bucket, key, days); | ||
function fetchReq (mac, config, resUrl, bucket, key, callbackFunc) { | ||
function fetchReq(mac, config, resUrl, bucket, key, callbackFunc) { | ||
var scheme = config.useHttpsDomain ? 'https://' : 'http://'; | ||
@@ -248,3 +248,3 @@ var encodedEntryURI = util.encodedEntry(bucket, key); | ||
function prefetchReq (mac, config, bucket, key, callbackFunc) { | ||
function prefetchReq(mac, config, bucket, key, callbackFunc) { | ||
var scheme = config.useHttpsDomain ? 'https://' : 'http://'; | ||
@@ -274,3 +274,3 @@ var encodedEntryURI = util.encodedEntry(bucket, key); | ||
function changeTypeReq (mac, config, bucket, key, newType, callbackFunc) { | ||
function changeTypeReq(mac, config, bucket, key, newType, callbackFunc) { | ||
var scheme = config.useHttpsDomain ? 'https://' : 'http://'; | ||
@@ -332,3 +332,3 @@ var changeTypeOp = exports.changeTypeOp(bucket, key, newType); | ||
function listPrefixReq (mac, config, bucket, options, callbackFunc) { | ||
function listPrefixReq(mac, config, bucket, options, callbackFunc) { | ||
options = options || {}; | ||
@@ -391,3 +391,3 @@ // 必须参数 | ||
function listPrefixReqV2 (mac, config, bucket, options, callbackFunc) { | ||
function listPrefixReqV2(mac, config, bucket, options, callbackFunc) { | ||
options = options || {}; | ||
@@ -433,3 +433,4 @@ // 必须参数 | ||
BucketManager.prototype.batch = function (operations, callbackFunc) { | ||
var requestURI = conf.RS_HOST + '/batch'; | ||
var scheme = this.config.useHttpsDomain ? 'https://' : 'http://'; | ||
var requestURI = scheme + conf.RS_HOST + '/batch'; | ||
var reqParams = { | ||
@@ -557,3 +558,3 @@ op: operations | ||
function updateStatusReq (mac, config, bucket, key, status, callbackFunc) { | ||
function updateStatusReq(mac, config, bucket, key, status, callbackFunc) { | ||
var scheme = config.useHttpsDomain ? 'https://' : 'http://'; | ||
@@ -600,3 +601,3 @@ var changeStatusOp = exports.changeStatusOp(bucket, key, status); | ||
function PutBucketLifecycleRule (mac, config, bucket, options, callbackFunc) { | ||
function PutBucketLifecycleRule(mac, config, bucket, options, callbackFunc) { | ||
options = options || {}; | ||
@@ -710,3 +711,3 @@ var reqParams = { | ||
function PutBucketEvent (mac, config, options, bucket, callbackFunc) { | ||
function PutBucketEvent(mac, config, options, bucket, callbackFunc) { | ||
options = options || {}; | ||
@@ -756,3 +757,3 @@ var reqParams = { // 必填参数 | ||
function UpdateBucketEvent (mac, config, options, bucket, callbackFunc) { | ||
function UpdateBucketEvent(mac, config, options, bucket, callbackFunc) { | ||
options = options || {}; | ||
@@ -827,3 +828,3 @@ var reqParams = { | ||
function PutReferAntiLeech (mac, config, bucket, options, callbackFunc) { | ||
function PutReferAntiLeech(mac, config, bucket, options, callbackFunc) { | ||
options = options || {}; | ||
@@ -870,3 +871,3 @@ var reqParams = { | ||
function PutCorsRules (mac, config, bucket, body, callbackFunc) { | ||
function PutCorsRules(mac, config, bucket, body, callbackFunc) { | ||
var reqBody = JSON.stringify(body); | ||
@@ -884,3 +885,3 @@ var scheme = config.useHttpsDomain ? 'https://' : 'http://'; | ||
function GetCorsRules (mac, config, bucket, callbackFunc) { | ||
function GetCorsRules(mac, config, bucket, callbackFunc) { | ||
var scheme = config.useHttpsDomain ? 'https://' : 'http://'; | ||
@@ -1000,3 +1001,3 @@ var requestURI = scheme + conf.UC_HOST + '/corsRules/get/' + bucket; | ||
var scheme = this.config.useHttpsDomain ? 'https://' : 'http://'; | ||
var requestURI = scheme + conf.RS_QBOX + "/restoreAr/"+util.urlsafeBase64Encode(entry)+"/freezeAfterDays/"+freezeAfterDays; | ||
var requestURI = scheme + conf.RS_HOST + "/restoreAr/" + util.urlsafeBase64Encode(entry) + "/freezeAfterDays/" + freezeAfterDays; | ||
var digest = util.generateAccessToken(this.mac, requestURI, null); | ||
@@ -1008,3 +1009,3 @@ rpc.postWithoutForm(requestURI, digest, callbackFunc); | ||
// @link https://developer.qiniu.com/kodo/manual/1206/put-policy | ||
function PutPolicy (options) { | ||
function PutPolicy(options) { | ||
if (typeof options !== 'object') { | ||
@@ -1020,2 +1021,3 @@ throw new Error('invalid putpolicy options'); | ||
this.saveKey = options.saveKey || null; | ||
this.forceSaveKey = options.forceSaveKey || null; | ||
this.endUser = options.endUser || null; | ||
@@ -1047,4 +1049,4 @@ | ||
var flags = {}; | ||
var attrs = ['scope', 'isPrefixalScope', 'insertOnly', 'saveKey', 'endUser', | ||
'returnUrl', 'returnBody', 'callbackUrl', 'callbackHost', | ||
var attrs = ['scope', 'isPrefixalScope', 'insertOnly', 'saveKey', 'forceSaveKey', | ||
'endUser', 'returnUrl', 'returnBody', 'callbackUrl', 'callbackHost', | ||
'callbackBody', 'callbackBodyType', 'callbackFetchKey', 'persistentOps', | ||
@@ -1051,0 +1053,0 @@ 'persistentNotifyUrl', 'persistentPipeline', 'fsizeLimit', 'fsizeMin', |
@@ -6,3 +6,5 @@ # Qiniu Cloud SDK for Node.js | ||
[![Build Status](https://api.travis-ci.org/qiniu/nodejs-sdk.svg?branch=master)](https://travis-ci.org/qiniu/nodejs-sdk) | ||
[![GitHub release](https://img.shields.io/github/v/tag/qiniu/nodejs-sdk.svg?label=release)](https://github.com/qiniu/nodejs-sdk/releases) | ||
[![Code Climate](https://codeclimate.com/github/qiniu/nodejs-sdk.svg)](https://codeclimate.com/github/qiniu/nodejs-sdk) | ||
[![Coverage Status](https://codecov.io/gh/qiniu/nodejs-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/qiniu/nodejs-sdk) | ||
[![Latest Stable Version](https://img.shields.io/npm/v/qiniu.svg)](https://www.npmjs.com/package/qiniu) | ||
@@ -9,0 +11,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
115880
2847
57