diff --git a/demo/demo.js b/demo/demo.js index 0772f94..02cdf01 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -1262,6 +1262,50 @@ function sliceCopyFile() { }); } +/* 移动对象*/ +function moveObject() { + // COS 没有对象重命名或移动的接口,移动对象可以通过复制/删除对象实现 + var source = 'source.txt'; + var target = 'target.txt'; + var copySource = config.Bucket + '.cos.' + config.Region + '.myqcloud.com/' + camSafeUrlEncode(source).replace(/%2F/g, '/'); + cos.putObject({ + Bucket: config.Bucket, + Region: config.Region, + Key: source, + Body: 'hello!', + }, function (err, data) { + if (err) return logger.log(err); + cos.putObjectCopy({ + Bucket: config.Bucket, + Region: config.Region, + Key: target, + CopySource: copySource, + }, function (err, data) { + if (err) return logger.log(err); + cos.deleteObject({ + Bucket: config.Bucket, + Region: config.Region, + Key: source, + }, function (err, data) { + logger.log(err || data); + }); + }); + }); +} + +/* 创建文件夹 */ +function createFolder() { + cos.getBucket({ + Bucket: config.Bucket, + Region: config.Region, + Key: 'folder/', // 对象存储没有实际的文件夹,可以创建一个路径以 / 结尾的空对象表示,能在部分场景中满足文件夹使用需要 + Body: '', + }, function(err, data) { + logger.log(err || data); + }); +} + +/* 上传本地文件夹 */ function uploadFolder() { // var input = document.createElement('input'); @@ -1299,6 +1343,7 @@ function uploadFolder() { input.click(); } +/* 列出文件夹下的文件 */ function listFolder() { var _listFolder = function(params, callback) { var Contents = []; @@ -1337,6 +1382,7 @@ function listFolder() { }); } +/* 删除指定文件夹下的所有对象(删除存储桶里指定前缀所有对象) */ function deleteFolder() { var _deleteFolder = function(params, callback) { var deletedList = []; @@ -1592,6 +1638,8 @@ function CIExample4(){ 'sliceCopyFile', 'uploadFiles', 'uploadFolder', + 'moveObject', + 'createFolder', 'listFolder', 'deleteFolder', 'cancelTask', @@ -1611,6 +1659,7 @@ function CIExample4(){ uploadFiles: '批量上传文件', selectFileToUpload: '上传本地文件', uploadFolder: '上传文件夹', + request: '通用请求接口', listFolder: '列出文件夹', deleteFolder: '删除文件夹', CIExample1: '上传时使用图片处理', diff --git a/dist/cos-js-sdk-v5.js b/dist/cos-js-sdk-v5.js index 5feb943..e7a3ce8 100644 --- a/dist/cos-js-sdk-v5.js +++ b/dist/cos-js-sdk-v5.js @@ -2222,7 +2222,7 @@ base.init(COS, task); advance.init(COS, task); COS.getAuthorization = util.getAuth; -COS.version = '1.2.9'; +COS.version = '1.2.10'; module.exports = COS; @@ -2276,62 +2276,62 @@ module.exports = COS; }; } - /** - * @method hex - * @memberof md5 - * @description Output hash as hex string - * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash - * @returns {String} Hex string - * @example - * md5.hex('The quick brown fox jumps over the lazy dog'); - * // equal to - * md5('The quick brown fox jumps over the lazy dog'); + /** + * @method hex + * @memberof md5 + * @description Output hash as hex string + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {String} Hex string + * @example + * md5.hex('The quick brown fox jumps over the lazy dog'); + * // equal to + * md5('The quick brown fox jumps over the lazy dog'); */ - /** - * @method digest - * @memberof md5 - * @description Output hash as bytes array - * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash - * @returns {Array} Bytes array - * @example - * md5.digest('The quick brown fox jumps over the lazy dog'); + /** + * @method digest + * @memberof md5 + * @description Output hash as bytes array + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {Array} Bytes array + * @example + * md5.digest('The quick brown fox jumps over the lazy dog'); */ - /** - * @method array - * @memberof md5 - * @description Output hash as bytes array - * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash - * @returns {Array} Bytes array - * @example - * md5.array('The quick brown fox jumps over the lazy dog'); + /** + * @method array + * @memberof md5 + * @description Output hash as bytes array + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {Array} Bytes array + * @example + * md5.array('The quick brown fox jumps over the lazy dog'); */ - /** - * @method arrayBuffer - * @memberof md5 - * @description Output hash as ArrayBuffer - * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash - * @returns {ArrayBuffer} ArrayBuffer - * @example - * md5.arrayBuffer('The quick brown fox jumps over the lazy dog'); + /** + * @method arrayBuffer + * @memberof md5 + * @description Output hash as ArrayBuffer + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {ArrayBuffer} ArrayBuffer + * @example + * md5.arrayBuffer('The quick brown fox jumps over the lazy dog'); */ - /** - * @method buffer - * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. - * @memberof md5 - * @description Output hash as ArrayBuffer - * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash - * @returns {ArrayBuffer} ArrayBuffer - * @example - * md5.buffer('The quick brown fox jumps over the lazy dog'); + /** + * @method buffer + * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. + * @memberof md5 + * @description Output hash as ArrayBuffer + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {ArrayBuffer} ArrayBuffer + * @example + * md5.buffer('The quick brown fox jumps over the lazy dog'); */ - /** - * @method base64 - * @memberof md5 - * @description Output hash as base64 string - * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash - * @returns {String} base64 string - * @example - * md5.base64('The quick brown fox jumps over the lazy dog'); + /** + * @method base64 + * @memberof md5 + * @description Output hash as base64 string + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {String} base64 string + * @example + * md5.base64('The quick brown fox jumps over the lazy dog'); */ var createOutputMethod = function (outputType) { return function (message, isBinStr) { @@ -2339,25 +2339,25 @@ module.exports = COS; }; }; - /** - * @method create - * @memberof md5 - * @description Create Md5 object - * @returns {Md5} Md5 object. - * @example - * var hash = md5.create(); + /** + * @method create + * @memberof md5 + * @description Create Md5 object + * @returns {Md5} Md5 object. + * @example + * var hash = md5.create(); */ - /** - * @method update - * @memberof md5 - * @description Create and update Md5 object - * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash - * @returns {Md5} Md5 object. - * @example - * var hash = md5.update('The quick brown fox jumps over the lazy dog'); - * // equal to - * var hash = md5.create(); - * hash.update('The quick brown fox jumps over the lazy dog'); + /** + * @method update + * @memberof md5 + * @description Create and update Md5 object + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {Md5} Md5 object. + * @example + * var hash = md5.update('The quick brown fox jumps over the lazy dog'); + * // equal to + * var hash = md5.create(); + * hash.update('The quick brown fox jumps over the lazy dog'); */ var createMethod = function () { var method = createOutputMethod('hex'); @@ -2399,11 +2399,11 @@ module.exports = COS; return nodeMethod; }; - /** - * Md5 class - * @class Md5 - * @description This is internal class. - * @see {@link md5.create} + /** + * Md5 class + * @class Md5 + * @description This is internal class. + * @see {@link md5.create} */ function Md5(sharedMemory) { if (sharedMemory) { @@ -2424,14 +2424,14 @@ module.exports = COS; this.first = true; } - /** - * @method update - * @memberof Md5 - * @instance - * @description Update hash - * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash - * @returns {Md5} Md5 object. - * @see {@link md5.update} + /** + * @method update + * @memberof Md5 + * @instance + * @description Update hash + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {Md5} Md5 object. + * @see {@link md5.update} */ Md5.prototype.update = function (message, isBinStr) { if (this.finalized) { @@ -2706,15 +2706,15 @@ module.exports = COS; } }; - /** - * @method hex - * @memberof Md5 - * @instance - * @description Output hash as hex string - * @returns {String} Hex string - * @see {@link md5.hex} - * @example - * hash.hex(); + /** + * @method hex + * @memberof Md5 + * @instance + * @description Output hash as hex string + * @returns {String} Hex string + * @see {@link md5.hex} + * @example + * hash.hex(); */ Md5.prototype.hex = function () { this.finalize(); @@ -2727,27 +2727,27 @@ module.exports = COS; return HEX_CHARS[h0 >> 4 & 0x0F] + HEX_CHARS[h0 & 0x0F] + HEX_CHARS[h0 >> 12 & 0x0F] + HEX_CHARS[h0 >> 8 & 0x0F] + HEX_CHARS[h0 >> 20 & 0x0F] + HEX_CHARS[h0 >> 16 & 0x0F] + HEX_CHARS[h0 >> 28 & 0x0F] + HEX_CHARS[h0 >> 24 & 0x0F] + HEX_CHARS[h1 >> 4 & 0x0F] + HEX_CHARS[h1 & 0x0F] + HEX_CHARS[h1 >> 12 & 0x0F] + HEX_CHARS[h1 >> 8 & 0x0F] + HEX_CHARS[h1 >> 20 & 0x0F] + HEX_CHARS[h1 >> 16 & 0x0F] + HEX_CHARS[h1 >> 28 & 0x0F] + HEX_CHARS[h1 >> 24 & 0x0F] + HEX_CHARS[h2 >> 4 & 0x0F] + HEX_CHARS[h2 & 0x0F] + HEX_CHARS[h2 >> 12 & 0x0F] + HEX_CHARS[h2 >> 8 & 0x0F] + HEX_CHARS[h2 >> 20 & 0x0F] + HEX_CHARS[h2 >> 16 & 0x0F] + HEX_CHARS[h2 >> 28 & 0x0F] + HEX_CHARS[h2 >> 24 & 0x0F] + HEX_CHARS[h3 >> 4 & 0x0F] + HEX_CHARS[h3 & 0x0F] + HEX_CHARS[h3 >> 12 & 0x0F] + HEX_CHARS[h3 >> 8 & 0x0F] + HEX_CHARS[h3 >> 20 & 0x0F] + HEX_CHARS[h3 >> 16 & 0x0F] + HEX_CHARS[h3 >> 28 & 0x0F] + HEX_CHARS[h3 >> 24 & 0x0F]; }; - /** - * @method toString - * @memberof Md5 - * @instance - * @description Output hash as hex string - * @returns {String} Hex string - * @see {@link md5.hex} - * @example - * hash.toString(); + /** + * @method toString + * @memberof Md5 + * @instance + * @description Output hash as hex string + * @returns {String} Hex string + * @see {@link md5.hex} + * @example + * hash.toString(); */ Md5.prototype.toString = Md5.prototype.hex; - /** - * @method digest - * @memberof Md5 - * @instance - * @description Output hash as bytes array - * @returns {Array} Bytes array - * @see {@link md5.digest} - * @example - * hash.digest(); + /** + * @method digest + * @memberof Md5 + * @instance + * @description Output hash as bytes array + * @returns {Array} Bytes array + * @see {@link md5.digest} + * @example + * hash.digest(); */ Md5.prototype.digest = function (format) { if (format === 'hex') return this.hex(); @@ -2761,27 +2761,27 @@ module.exports = COS; return res; }; - /** - * @method array - * @memberof Md5 - * @instance - * @description Output hash as bytes array - * @returns {Array} Bytes array - * @see {@link md5.array} - * @example - * hash.array(); + /** + * @method array + * @memberof Md5 + * @instance + * @description Output hash as bytes array + * @returns {Array} Bytes array + * @see {@link md5.array} + * @example + * hash.array(); */ Md5.prototype.array = Md5.prototype.digest; - /** - * @method arrayBuffer - * @memberof Md5 - * @instance - * @description Output hash as ArrayBuffer - * @returns {ArrayBuffer} ArrayBuffer - * @see {@link md5.arrayBuffer} - * @example - * hash.arrayBuffer(); + /** + * @method arrayBuffer + * @memberof Md5 + * @instance + * @description Output hash as ArrayBuffer + * @returns {ArrayBuffer} ArrayBuffer + * @see {@link md5.arrayBuffer} + * @example + * hash.arrayBuffer(); */ Md5.prototype.arrayBuffer = function () { this.finalize(); @@ -2795,28 +2795,28 @@ module.exports = COS; return buffer; }; - /** - * @method buffer - * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. - * @memberof Md5 - * @instance - * @description Output hash as ArrayBuffer - * @returns {ArrayBuffer} ArrayBuffer - * @see {@link md5.buffer} - * @example - * hash.buffer(); + /** + * @method buffer + * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. + * @memberof Md5 + * @instance + * @description Output hash as ArrayBuffer + * @returns {ArrayBuffer} ArrayBuffer + * @see {@link md5.buffer} + * @example + * hash.buffer(); */ Md5.prototype.buffer = Md5.prototype.arrayBuffer; - /** - * @method base64 - * @memberof Md5 - * @instance - * @description Output hash as base64 string - * @returns {String} base64 string - * @see {@link md5.base64} - * @example - * hash.base64(); + /** + * @method base64 + * @memberof Md5 + * @instance + * @description Output hash as base64 string + * @returns {String} base64 string + * @see {@link md5.base64} + * @example + * hash.base64(); */ Md5.prototype.base64 = function () { var v1, @@ -2840,22 +2840,22 @@ module.exports = COS; if (COMMON_JS) { module.exports = exports; } else { - /** - * @method md5 - * @description Md5 hash function, export to global in browsers. - * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash - * @returns {String} md5 hashes - * @example - * md5(''); // d41d8cd98f00b204e9800998ecf8427e - * md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6 - * md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0 - * - * // It also supports UTF-8 encoding - * md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07 - * - * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` - * md5([]); // d41d8cd98f00b204e9800998ecf8427e - * md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e + /** + * @method md5 + * @description Md5 hash function, export to global in browsers. + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {String} md5 hashes + * @example + * md5(''); // d41d8cd98f00b204e9800998ecf8427e + * md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6 + * md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0 + * + * // It also supports UTF-8 encoding + * md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07 + * + * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` + * md5([]); // d41d8cd98f00b204e9800998ecf8427e + * md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e */ root.md5 = exports; if (AMD) { @@ -3098,11 +3098,11 @@ module.exports = __webpack_amd_options__; /* 10 */ /***/ (function(module, exports, __webpack_require__) { -/* - CryptoJS v3.1.2 - code.google.com/p/crypto-js - (c) 2009-2013 by Jeff Mott. All rights reserved. - code.google.com/p/crypto-js/wiki/License +/* + CryptoJS v3.1.2 + code.google.com/p/crypto-js + (c) 2009-2013 by Jeff Mott. All rights reserved. + code.google.com/p/crypto-js/wiki/License */ var CryptoJS = CryptoJS || function (g, l) { var e = {}, @@ -3235,22 +3235,22 @@ var CryptoJS = CryptoJS || function (g, l) { var WordArray = C_lib.WordArray; var C_enc = C.enc; - /** - * Base64 encoding strategy. + /** + * Base64 encoding strategy. */ var Base64 = C_enc.Base64 = { - /** - * Converts a word array to a Base64 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Base64 string. - * - * @static - * - * @example - * - * var base64String = CryptoJS.enc.Base64.stringify(wordArray); + /** + * Converts a word array to a Base64 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Base64 string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64.stringify(wordArray); */ stringify: function (wordArray) { // Shortcuts @@ -3286,18 +3286,18 @@ var CryptoJS = CryptoJS || function (g, l) { return base64Chars.join(''); }, - /** - * Converts a Base64 string to a word array. - * - * @param {string} base64Str The Base64 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Base64.parse(base64String); + /** + * Converts a Base64 string to a word array. + * + * @param {string} base64Str The Base64 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64.parse(base64String); */ parse: function (base64Str) { // Shortcuts @@ -3342,24 +3342,24 @@ if (true) { /* 11 */ /***/ (function(module, exports, __webpack_require__) { -/* Copyright 2015 William Summers, MetaTribal LLC - * adapted from https://developer.mozilla.org/en-US/docs/JXON - * - * Licensed under the MIT License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://opensource.org/licenses/MIT - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +/* Copyright 2015 William Summers, MetaTribal LLC + * adapted from https://developer.mozilla.org/en-US/docs/JXON + * + * Licensed under the MIT License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -/** - * @author William Summers - * https://github.com/metatribal/xmlToJSON +/** + * @author William Summers + * https://github.com/metatribal/xmlToJSON */ var DOMParser = __webpack_require__(12).DOMParser; @@ -4828,11 +4828,11 @@ var util = __webpack_require__(0); // Bucket 相关 -/** - * 获取用户的 bucket 列表 - * @param {Object} params 回调函数,必须,下面为参数列表 - * 无特殊参数 - * @param {Function} callback 回调函数,必须 +/** + * 获取用户的 bucket 列表 + * @param {Object} params 回调函数,必须,下面为参数列表 + * 无特殊参数 + * @param {Function} callback 回调函数,必须 */ function getService(params, callback) { @@ -4877,19 +4877,19 @@ function getService(params, callback) { }); } -/** - * 创建 Bucket,并初始化访问权限 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.ACL 用户自定义文件权限,可以设置:private,public-read;默认值:private,非必须 - * @param {String} params.GrantRead 赋予被授权者读的权限,格式x-cos-grant-read: uin=" ",uin=" ",非必须 - * @param {String} params.GrantWrite 赋予被授权者写的权限,格式x-cos-grant-write: uin=" ",uin=" ",非必须 - * @param {String} params.GrantFullControl 赋予被授权者读写权限,格式x-cos-grant-full-control: uin=" ",uin=" ",非必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 - * @return {String} data.Location 操作地址 +/** + * 创建 Bucket,并初始化访问权限 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.ACL 用户自定义文件权限,可以设置:private,public-read;默认值:private,非必须 + * @param {String} params.GrantRead 赋予被授权者读的权限,格式x-cos-grant-read: uin=" ",uin=" ",非必须 + * @param {String} params.GrantWrite 赋予被授权者写的权限,格式x-cos-grant-write: uin=" ",uin=" ",非必须 + * @param {String} params.GrantFullControl 赋予被授权者读写权限,格式x-cos-grant-full-control: uin=" ",uin=" ",非必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 + * @return {String} data.Location 操作地址 */ function putBucket(params, callback) { @@ -4927,16 +4927,16 @@ function putBucket(params, callback) { }); } -/** - * 查看是否存在该Bucket,是否有权限访问 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 - * @return {Boolean} data.BucketExist Bucket是否存在 - * @return {Boolean} data.BucketAuth 是否有 Bucket 的访问权限 +/** + * 查看是否存在该Bucket,是否有权限访问 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 + * @return {Boolean} data.BucketExist Bucket是否存在 + * @return {Boolean} data.BucketAuth 是否有 Bucket 的访问权限 */ function headBucket(params, callback) { submitRequest.call(this, { @@ -4948,20 +4948,20 @@ function headBucket(params, callback) { }, callback); } -/** - * 获取 Bucket 下的 object 列表 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Prefix 前缀匹配,用来规定返回的文件前缀地址,非必须 - * @param {String} params.Delimiter 定界符为一个符号,如果有Prefix,则将Prefix到delimiter之间的相同路径归为一类,非必须 - * @param {String} params.Marker 默认以UTF-8二进制顺序列出条目,所有列出条目从marker开始,非必须 - * @param {String} params.MaxKeys 单次返回最大的条目数量,默认1000,非必须 - * @param {String} params.EncodingType 规定返回值的编码方式,非必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 - * @return {Object} data.ListBucketResult 返回的 object 列表信息 +/** + * 获取 Bucket 下的 object 列表 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Prefix 前缀匹配,用来规定返回的文件前缀地址,非必须 + * @param {String} params.Delimiter 定界符为一个符号,如果有Prefix,则将Prefix到delimiter之间的相同路径归为一类,非必须 + * @param {String} params.Marker 默认以UTF-8二进制顺序列出条目,所有列出条目从marker开始,非必须 + * @param {String} params.MaxKeys 单次返回最大的条目数量,默认1000,非必须 + * @param {String} params.EncodingType 规定返回值的编码方式,非必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 + * @return {Object} data.ListBucketResult 返回的 object 列表信息 */ function getBucket(params, callback) { var reqParams = {}; @@ -5000,15 +5000,15 @@ function getBucket(params, callback) { }); } -/** - * 删除 Bucket - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 - * @return {String} data.Location 操作地址 +/** + * 删除 Bucket + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 + * @return {String} data.Location 操作地址 */ function deleteBucket(params, callback) { submitRequest.call(this, { @@ -5030,18 +5030,18 @@ function deleteBucket(params, callback) { }); } -/** - * 设置 Bucket 的 权限列表 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.ACL 用户自定义文件权限,可以设置:private,public-read;默认值:private,非必须 - * @param {String} params.GrantRead 赋予被授权者读的权限,格式x-cos-grant-read: uin=" ",uin=" ",非必须 - * @param {String} params.GrantWrite 赋予被授权者写的权限,格式x-cos-grant-write: uin=" ",uin=" ",非必须 - * @param {String} params.GrantFullControl 赋予被授权者读写权限,格式x-cos-grant-full-control: uin=" ",uin=" ",非必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 +/** + * 设置 Bucket 的 权限列表 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.ACL 用户自定义文件权限,可以设置:private,public-read;默认值:private,非必须 + * @param {String} params.GrantRead 赋予被授权者读的权限,格式x-cos-grant-read: uin=" ",uin=" ",非必须 + * @param {String} params.GrantWrite 赋予被授权者写的权限,格式x-cos-grant-write: uin=" ",uin=" ",非必须 + * @param {String} params.GrantFullControl 赋予被授权者读写权限,格式x-cos-grant-full-control: uin=" ",uin=" ",非必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 */ function putBucketAcl(params, callback) { var headers = params.Headers; @@ -5084,15 +5084,15 @@ function putBucketAcl(params, callback) { }); } -/** - * 获取 Bucket 的 权限列表 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 - * @return {Object} data.AccessControlPolicy 访问权限信息 +/** + * 获取 Bucket 的 权限列表 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 + * @return {Object} data.AccessControlPolicy 访问权限信息 */ function getBucketAcl(params, callback) { @@ -5123,16 +5123,16 @@ function getBucketAcl(params, callback) { }); } -/** - * 设置 Bucket 的 跨域设置 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Object} params.CORSConfiguration 相关的跨域设置,必须 - * @param {Array} params.CORSConfiguration.CORSRules 对应的跨域规则 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 +/** + * 设置 Bucket 的 跨域设置 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Object} params.CORSConfiguration 相关的跨域设置,必须 + * @param {Array} params.CORSConfiguration.CORSRules 对应的跨域规则 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 */ function putBucketCors(params, callback) { @@ -5171,15 +5171,15 @@ function putBucketCors(params, callback) { }); } -/** - * 获取 Bucket 的 跨域设置 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 - * @return {Object} data.CORSRules Bucket的跨域设置 +/** + * 获取 Bucket 的 跨域设置 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 + * @return {Object} data.CORSRules Bucket的跨域设置 */ function getBucketCors(params, callback) { submitRequest.call(this, { @@ -5224,14 +5224,14 @@ function getBucketCors(params, callback) { }); } -/** - * 删除 Bucket 的 跨域设置 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 +/** + * 删除 Bucket 的 跨域设置 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 */ function deleteBucketCors(params, callback) { submitRequest.call(this, { @@ -5254,14 +5254,14 @@ function deleteBucketCors(params, callback) { }); } -/** - * 获取 Bucket 的 地域信息 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据,包含地域信息 LocationConstraint +/** + * 获取 Bucket 的 地域信息 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据,包含地域信息 LocationConstraint */ function getBucketLocation(params, callback) { submitRequest.call(this, { @@ -5308,14 +5308,14 @@ function putBucketPolicy(params, callback) { }); } -/** - * 获取 Bucket 的读取权限策略 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 获取 Bucket 的读取权限策略 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function getBucketPolicy(params, callback) { submitRequest.call(this, { @@ -5351,14 +5351,14 @@ function getBucketPolicy(params, callback) { }); } -/** - * 删除 Bucket 的 跨域设置 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 +/** + * 删除 Bucket 的 跨域设置 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 */ function deleteBucketPolicy(params, callback) { submitRequest.call(this, { @@ -5381,15 +5381,15 @@ function deleteBucketPolicy(params, callback) { }); } -/** - * 设置 Bucket 的标签 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Array} params.TagSet 标签设置,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 设置 Bucket 的标签 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Array} params.TagSet 标签设置,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function putBucketTagging(params, callback) { @@ -5423,14 +5423,14 @@ function putBucketTagging(params, callback) { }); } -/** - * 获取 Bucket 的标签设置 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 获取 Bucket 的标签设置 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function getBucketTagging(params, callback) { @@ -5468,14 +5468,14 @@ function getBucketTagging(params, callback) { }); } -/** - * 删除 Bucket 的 标签设置 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 +/** + * 删除 Bucket 的 标签设置 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 */ function deleteBucketTagging(params, callback) { submitRequest.call(this, { @@ -5719,19 +5719,19 @@ function deleteBucketReplication(params, callback) { }); } -/** - * 设置 Bucket 静态网站配置信息 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Object} params.WebsiteConfiguration 地域名称,必须 - * @param {Object} WebsiteConfiguration.IndexDocument 索引文档,必须 - * @param {Object} WebsiteConfiguration.ErrorDocument 错误文档,非必须 - * @param {Object} WebsiteConfiguration.RedirectAllRequestsTo 重定向所有请求,非必须 - * @param {Array} params.RoutingRules 重定向规则,非必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 设置 Bucket 静态网站配置信息 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Object} params.WebsiteConfiguration 地域名称,必须 + * @param {Object} WebsiteConfiguration.IndexDocument 索引文档,必须 + * @param {Object} WebsiteConfiguration.ErrorDocument 错误文档,非必须 + * @param {Object} WebsiteConfiguration.RedirectAllRequestsTo 重定向所有请求,非必须 + * @param {Array} params.RoutingRules 重定向规则,非必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function putBucketWebsite(params, callback) { @@ -5773,14 +5773,14 @@ function putBucketWebsite(params, callback) { }); } -/** - * 获取 Bucket 的静态网站配置信息 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 获取 Bucket 的静态网站配置信息 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function getBucketWebsite(params, callback) { @@ -5822,14 +5822,14 @@ function getBucketWebsite(params, callback) { }); } -/** - * 删除 Bucket 的静态网站配置 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 删除 Bucket 的静态网站配置 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function deleteBucketWebsite(params, callback) { @@ -5853,19 +5853,19 @@ function deleteBucketWebsite(params, callback) { }); } -/** - * 设置 Bucket 的防盗链白名单或者黑名单 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Object} params.RefererConfiguration 地域名称,必须 - * @param {String} RefererConfiguration.Status 是否开启防盗链,枚举值:Enabled、Disabled - * @param {String} RefererConfiguration.RefererType 防盗链类型,枚举值:Black-List、White-List,必须 - * @param {Array} RefererConfiguration.DomianList.Domain 生效域名,必须 - * @param {String} RefererConfiguration.EmptyReferConfiguration ,非必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 设置 Bucket 的防盗链白名单或者黑名单 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Object} params.RefererConfiguration 地域名称,必须 + * @param {String} RefererConfiguration.Status 是否开启防盗链,枚举值:Enabled、Disabled + * @param {String} RefererConfiguration.RefererType 防盗链类型,枚举值:Black-List、White-List,必须 + * @param {Array} RefererConfiguration.DomianList.Domain 生效域名,必须 + * @param {String} RefererConfiguration.EmptyReferConfiguration ,非必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function putBucketReferer(params, callback) { @@ -5906,14 +5906,14 @@ function putBucketReferer(params, callback) { }); } -/** - * 获取 Bucket 的防盗链白名单或者黑名单 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 获取 Bucket 的防盗链白名单或者黑名单 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function getBucketReferer(params, callback) { @@ -5955,14 +5955,14 @@ function getBucketReferer(params, callback) { }); } -/** - * 设置 Bucket 自定义域名 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 设置 Bucket 自定义域名 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function putBucketDomain(params, callback) { @@ -5996,14 +5996,14 @@ function putBucketDomain(params, callback) { }); } -/** - * 获取 Bucket 的自定义域名 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 获取 Bucket 的自定义域名 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function getBucketDomain(params, callback) { @@ -6030,14 +6030,14 @@ function getBucketDomain(params, callback) { }); } -/** - * 删除 Bucket 自定义域名 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 删除 Bucket 自定义域名 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function deleteBucketDomain(params, callback) { @@ -6061,14 +6061,14 @@ function deleteBucketDomain(params, callback) { }); } -/** - * 设置 Bucket 的回源 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 设置 Bucket 的回源 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function putBucketOrigin(params, callback) { var OriginConfiguration = params['OriginConfiguration'] || {}; @@ -6101,14 +6101,14 @@ function putBucketOrigin(params, callback) { }); } -/** - * 获取 Bucket 的回源 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 获取 Bucket 的回源 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function getBucketOrigin(params, callback) { @@ -6135,14 +6135,14 @@ function getBucketOrigin(params, callback) { }); } -/** - * 删除 Bucket 的回源 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 删除 Bucket 的回源 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function deleteBucketOrigin(params, callback) { @@ -6166,15 +6166,15 @@ function deleteBucketOrigin(params, callback) { }); } -/** - * 设置 Bucket 的日志记录 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {(Object|String)} params.BucketLoggingStatus 说明日志记录配置的状态,如果无子节点信息则意为关闭日志记录,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 设置 Bucket 的日志记录 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {(Object|String)} params.BucketLoggingStatus 说明日志记录配置的状态,如果无子节点信息则意为关闭日志记录,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function putBucketLogging(params, callback) { var xml = util.json2xml({ @@ -6206,14 +6206,14 @@ function putBucketLogging(params, callback) { }); } -/** - * 获取 Bucket 的日志记录 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 获取 Bucket 的日志记录 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function getBucketLogging(params, callback) { submitRequest.call(this, { @@ -6233,16 +6233,16 @@ function getBucketLogging(params, callback) { }); } -/** - * 创建/编辑 Bucket 的清单任务 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Id 清单任务的名称,必须 - * @param {Object} params.InventoryConfiguration 包含清单的配置参数,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 创建/编辑 Bucket 的清单任务 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Id 清单任务的名称,必须 + * @param {Object} params.InventoryConfiguration 包含清单的配置参数,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function putBucketInventory(params, callback) { var InventoryConfiguration = util.clone(params['InventoryConfiguration']); @@ -6294,15 +6294,15 @@ function putBucketInventory(params, callback) { }); } -/** - * 获取 Bucket 的清单任务信息 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Id 清单任务的名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 获取 Bucket 的清单任务信息 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Id 清单任务的名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function getBucketInventory(params, callback) { submitRequest.call(this, { @@ -6342,15 +6342,15 @@ function getBucketInventory(params, callback) { }); } -/** - * 获取 Bucket 的清单任务信息 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.ContinuationToken 当 COS 响应体中 IsTruncated 为 true,且 NextContinuationToken 节点中存在参数值时,您可以将这个参数作为 continuation-token 参数值,以获取下一页的清单任务信息,非必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 获取 Bucket 的清单任务信息 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.ContinuationToken 当 COS 响应体中 IsTruncated 为 true,且 NextContinuationToken 节点中存在参数值时,您可以将这个参数作为 continuation-token 参数值,以获取下一页的清单任务信息,非必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function listBucketInventory(params, callback) { submitRequest.call(this, { @@ -6395,15 +6395,15 @@ function listBucketInventory(params, callback) { }); } -/** - * 删除 Bucket 的清单任务 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Id 清单任务的名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回数据 +/** + * 删除 Bucket 的清单任务 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Id 清单任务的名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回数据 */ function deleteBucketInventory(params, callback) { submitRequest.call(this, { @@ -6558,17 +6558,17 @@ function deleteBucketEncryption(params, callback) { // Object 相关 -/** - * 取回对应Object的元数据,Head的权限与Get的权限一致 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key 文件名称,必须 - * @param {String} params.IfModifiedSince 当Object在指定时间后被修改,则返回对应Object元信息,否则返回304,非必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 为指定 object 的元数据,如果设置了 IfModifiedSince ,且文件未修改,则返回一个对象,NotModified 属性为 true - * @return {Boolean} data.NotModified 是否在 IfModifiedSince 时间点之后未修改该 object,则为 true +/** + * 取回对应Object的元数据,Head的权限与Get的权限一致 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key 文件名称,必须 + * @param {String} params.IfModifiedSince 当Object在指定时间后被修改,则返回对应Object元信息,否则返回304,非必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 为指定 object 的元数据,如果设置了 IfModifiedSince ,且文件未修改,则返回一个对象,NotModified 属性为 true + * @return {Boolean} data.NotModified 是否在 IfModifiedSince 时间点之后未修改该 object,则为 true */ function headObject(params, callback) { submitRequest.call(this, { @@ -6635,26 +6635,26 @@ function listObjectVersions(params, callback) { }); } -/** - * 下载 object - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key 文件名称,必须 - * @param {WriteStream} params.Output 文件写入流,非必须 - * @param {String} params.IfModifiedSince 当Object在指定时间后被修改,则返回对应Object元信息,否则返回304,非必须 - * @param {String} params.IfUnmodifiedSince 如果文件修改时间早于或等于指定时间,才返回文件内容。否则返回 412 (precondition failed),非必须 - * @param {String} params.IfMatch 当 ETag 与指定的内容一致,才返回文件。否则返回 412 (precondition failed),非必须 - * @param {String} params.IfNoneMatch 当 ETag 与指定的内容不一致,才返回文件。否则返回304 (not modified),非必须 - * @param {String} params.ResponseContentType 设置返回头部中的 Content-Type 参数,非必须 - * @param {String} params.ResponseContentLanguage 设置返回头部中的 Content-Language 参数,非必须 - * @param {String} params.ResponseExpires 设置返回头部中的 Content-Expires 参数,非必须 - * @param {String} params.ResponseCacheControl 设置返回头部中的 Cache-Control 参数,非必须 - * @param {String} params.ResponseContentDisposition 设置返回头部中的 Content-Disposition 参数,非必须 - * @param {String} params.ResponseContentEncoding 设置返回头部中的 Content-Encoding 参数,非必须 - * @param {Function} callback 回调函数,必须 - * @param {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @param {Object} data 为对应的 object 数据,包括 body 和 headers +/** + * 下载 object + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key 文件名称,必须 + * @param {WriteStream} params.Output 文件写入流,非必须 + * @param {String} params.IfModifiedSince 当Object在指定时间后被修改,则返回对应Object元信息,否则返回304,非必须 + * @param {String} params.IfUnmodifiedSince 如果文件修改时间早于或等于指定时间,才返回文件内容。否则返回 412 (precondition failed),非必须 + * @param {String} params.IfMatch 当 ETag 与指定的内容一致,才返回文件。否则返回 412 (precondition failed),非必须 + * @param {String} params.IfNoneMatch 当 ETag 与指定的内容不一致,才返回文件。否则返回304 (not modified),非必须 + * @param {String} params.ResponseContentType 设置返回头部中的 Content-Type 参数,非必须 + * @param {String} params.ResponseContentLanguage 设置返回头部中的 Content-Language 参数,非必须 + * @param {String} params.ResponseExpires 设置返回头部中的 Content-Expires 参数,非必须 + * @param {String} params.ResponseCacheControl 设置返回头部中的 Cache-Control 参数,非必须 + * @param {String} params.ResponseContentDisposition 设置返回头部中的 Content-Disposition 参数,非必须 + * @param {String} params.ResponseContentEncoding 设置返回头部中的 Content-Encoding 参数,非必须 + * @param {Function} callback 回调函数,必须 + * @param {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @param {Object} data 为对应的 object 数据,包括 body 和 headers */ function getObject(params, callback) { var reqParams = params.Query || {}; @@ -6702,34 +6702,34 @@ function getObject(params, callback) { }); } -/** - * 上传 object - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key 文件名称,必须 - * @param {File || Blob || String} params.Body 上传文件对象或字符串,必须 - * @param {String} params.CacheControl RFC 2616 中定义的缓存策略,将作为 Object 元数据保存,非必须 - * @param {String} params.ContentDisposition RFC 2616 中定义的文件名称,将作为 Object 元数据保存,非必须 - * @param {String} params.ContentEncoding RFC 2616 中定义的编码格式,将作为 Object 元数据保存,非必须 - * @param {String} params.ContentLength RFC 2616 中定义的 HTTP 请求内容长度(字节),必须 - * @param {String} params.ContentType RFC 2616 中定义的内容类型(MIME),将作为 Object 元数据保存,非必须 - * @param {String} params.Expect 当使用 Expect: 100-continue 时,在收到服务端确认后,才会发送请求内容,非必须 - * @param {String} params.Expires RFC 2616 中定义的过期时间,将作为 Object 元数据保存,非必须 - * @param {String} params.ACL 允许用户自定义文件权限,有效值:private | public-read,非必须 - * @param {String} params.GrantRead 赋予被授权者读取对象的权限,格式:id="[OwnerUin]",可使用半角逗号(,)分隔多组被授权者,非必须 - * @param {String} params.GrantReadAcp 赋予被授权者读取对象的访问控制列表(ACL)的权限,格式:id="[OwnerUin]",可使用半角逗号(,)分隔多组被授权者,非必须 - * @param {String} params.GrantWriteAcp 赋予被授权者写入对象的访问控制列表(ACL)的权限,格式:id="[OwnerUin]",可使用半角逗号(,)分隔多组被授权者,非必须 - * @param {String} params.GrantFullControl 赋予被授权者操作对象的所有权限,格式:id="[OwnerUin]",可使用半角逗号(,)分隔多组被授权者,非必须 - * @param {String} params.StorageClass 设置对象的存储级别,枚举值:STANDARD、STANDARD_IA、ARCHIVE,默认值:STANDARD,非必须 - * @param {String} params.x-cos-meta-* 允许用户自定义的头部信息,将作为对象的元数据保存。大小限制2KB,非必须 - * @param {String} params.ContentSha1 RFC 3174 中定义的 160-bit 内容 SHA-1 算法校验,非必须 - * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: "AES256",非必须 - * @param {Function} params.onProgress 上传进度回调函数 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 为对应的 object 数据 - * @return {String} data.ETag 为对应上传文件的 ETag 值 +/** + * 上传 object + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key 文件名称,必须 + * @param {File || Blob || String} params.Body 上传文件对象或字符串,必须 + * @param {String} params.CacheControl RFC 2616 中定义的缓存策略,将作为 Object 元数据保存,非必须 + * @param {String} params.ContentDisposition RFC 2616 中定义的文件名称,将作为 Object 元数据保存,非必须 + * @param {String} params.ContentEncoding RFC 2616 中定义的编码格式,将作为 Object 元数据保存,非必须 + * @param {String} params.ContentLength RFC 2616 中定义的 HTTP 请求内容长度(字节),必须 + * @param {String} params.ContentType RFC 2616 中定义的内容类型(MIME),将作为 Object 元数据保存,非必须 + * @param {String} params.Expect 当使用 Expect: 100-continue 时,在收到服务端确认后,才会发送请求内容,非必须 + * @param {String} params.Expires RFC 2616 中定义的过期时间,将作为 Object 元数据保存,非必须 + * @param {String} params.ACL 允许用户自定义文件权限,有效值:private | public-read,非必须 + * @param {String} params.GrantRead 赋予被授权者读取对象的权限,格式:id="[OwnerUin]",可使用半角逗号(,)分隔多组被授权者,非必须 + * @param {String} params.GrantReadAcp 赋予被授权者读取对象的访问控制列表(ACL)的权限,格式:id="[OwnerUin]",可使用半角逗号(,)分隔多组被授权者,非必须 + * @param {String} params.GrantWriteAcp 赋予被授权者写入对象的访问控制列表(ACL)的权限,格式:id="[OwnerUin]",可使用半角逗号(,)分隔多组被授权者,非必须 + * @param {String} params.GrantFullControl 赋予被授权者操作对象的所有权限,格式:id="[OwnerUin]",可使用半角逗号(,)分隔多组被授权者,非必须 + * @param {String} params.StorageClass 设置对象的存储级别,枚举值:STANDARD、STANDARD_IA、ARCHIVE,默认值:STANDARD,非必须 + * @param {String} params.x-cos-meta-* 允许用户自定义的头部信息,将作为对象的元数据保存。大小限制2KB,非必须 + * @param {String} params.ContentSha1 RFC 3174 中定义的 160-bit 内容 SHA-1 算法校验,非必须 + * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: "AES256",非必须 + * @param {Function} params.onProgress 上传进度回调函数 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 为对应的 object 数据 + * @return {String} data.ETag 为对应上传文件的 ETag 值 */ function putObject(params, callback) { var self = this; @@ -6781,15 +6781,15 @@ function putObject(params, callback) { }, params.onHashProgress); } -/** - * 删除 object - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key object名称,必须 - * @param {Function} callback 回调函数,必须 - * @param {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @param {Object} data 删除操作成功之后返回的数据 +/** + * 删除 object + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key object名称,必须 + * @param {Function} callback 回调函数,必须 + * @param {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @param {Object} data 删除操作成功之后返回的数据 */ function deleteObject(params, callback) { submitRequest.call(this, { @@ -6816,16 +6816,16 @@ function deleteObject(params, callback) { }); } -/** - * 获取 object 的 权限列表 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key object名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 - * @return {Object} data.AccessControlPolicy 权限列表 +/** + * 获取 object 的 权限列表 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key object名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 + * @return {Object} data.AccessControlPolicy 权限列表 */ function getObjectAcl(params, callback) { @@ -6858,15 +6858,15 @@ function getObjectAcl(params, callback) { }); } -/** - * 设置 object 的 权限列表 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key object名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 +/** + * 设置 object 的 权限列表 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key object名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 */ function putObjectAcl(params, callback) { var headers = params.Headers; @@ -6910,15 +6910,15 @@ function putObjectAcl(params, callback) { }); } -/** - * Options Object请求实现跨域访问的预请求。即发出一个 OPTIONS 请求给服务器以确认是否可以进行跨域操作。 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key object名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 +/** + * Options Object请求实现跨域访问的预请求。即发出一个 OPTIONS 请求给服务器以确认是否可以进行跨域操作。 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key object名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 */ function optionsObject(params, callback) { @@ -6958,32 +6958,32 @@ function optionsObject(params, callback) { }); } -/** - * @param {Object} 参数列表 - * @param {String} Bucket Bucket 名称 - * @param {String} Region 地域名称 - * @param {String} Key 文件名称 - * @param {String} CopySource 源文件URL绝对路径,可以通过versionid子资源指定历史版本 - * @param {String} ACL 允许用户自定义文件权限。有效值:private,public-read默认值:private。 - * @param {String} GrantRead 赋予被授权者读的权限,格式 x-cos-grant-read: uin=" ",uin=" ",当需要给子账户授权时,uin="RootAcountID/SubAccountID",当需要给根账户授权时,uin="RootAcountID"。 - * @param {String} GrantWrite 赋予被授权者写的权限,格式 x-cos-grant-write: uin=" ",uin=" ",当需要给子账户授权时,uin="RootAcountID/SubAccountID",当需要给根账户授权时,uin="RootAcountID"。 - * @param {String} GrantFullControl 赋予被授权者读写权限,格式 x-cos-grant-full-control: uin=" ",uin=" ",当需要给子账户授权时,uin="RootAcountID/SubAccountID",当需要给根账户授权时,uin="RootAcountID"。 - * @param {String} MetadataDirective 是否拷贝元数据,枚举值:Copy, Replaced,默认值Copy。假如标记为Copy,忽略Header中的用户元数据信息直接复制;假如标记为Replaced,按Header信息修改元数据。当目标路径和原路径一致,即用户试图修改元数据时,必须为Replaced - * @param {String} CopySourceIfModifiedSince 当Object在指定时间后被修改,则执行操作,否则返回412。可与x-cos-copy-source-If-None-Match一起使用,与其他条件联合使用返回冲突。 - * @param {String} CopySourceIfUnmodifiedSince 当Object在指定时间后未被修改,则执行操作,否则返回412。可与x-cos-copy-source-If-Match一起使用,与其他条件联合使用返回冲突。 - * @param {String} CopySourceIfMatch 当Object的ETag和给定一致时,则执行操作,否则返回412。可与x-cos-copy-source-If-Unmodified-Since一起使用,与其他条件联合使用返回冲突。 - * @param {String} CopySourceIfNoneMatch 当Object的ETag和给定不一致时,则执行操作,否则返回412。可与x-cos-copy-source-If-Modified-Since一起使用,与其他条件联合使用返回冲突。 - * @param {String} StorageClass 存储级别,枚举值:存储级别,枚举值:Standard, Standard_IA,Archive;默认值:Standard - * @param {String} CacheControl 指定所有缓存机制在整个请求/响应链中必须服从的指令。 - * @param {String} ContentDisposition MIME 协议的扩展,MIME 协议指示 MIME 用户代理如何显示附加的文件 - * @param {String} ContentEncoding HTTP 中用来对「采用何种编码格式传输正文」进行协定的一对头部字段 - * @param {String} ContentLength 设置响应消息的实体内容的大小,单位为字节 - * @param {String} ContentType RFC 2616 中定义的 HTTP 请求内容类型(MIME),例如text/plain - * @param {String} Expect 请求的特定的服务器行为 - * @param {String} Expires 响应过期的日期和时间 - * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: "AES256",非必须 - * @param {String} ContentLanguage 指定内容语言 - * @param {String} x-cos-meta-* 允许用户自定义的头部信息,将作为 Object 元数据返回。大小限制2K。 +/** + * @param {Object} 参数列表 + * @param {String} Bucket Bucket 名称 + * @param {String} Region 地域名称 + * @param {String} Key 文件名称 + * @param {String} CopySource 源文件URL绝对路径,可以通过versionid子资源指定历史版本 + * @param {String} ACL 允许用户自定义文件权限。有效值:private,public-read默认值:private。 + * @param {String} GrantRead 赋予被授权者读的权限,格式 x-cos-grant-read: uin=" ",uin=" ",当需要给子账户授权时,uin="RootAcountID/SubAccountID",当需要给根账户授权时,uin="RootAcountID"。 + * @param {String} GrantWrite 赋予被授权者写的权限,格式 x-cos-grant-write: uin=" ",uin=" ",当需要给子账户授权时,uin="RootAcountID/SubAccountID",当需要给根账户授权时,uin="RootAcountID"。 + * @param {String} GrantFullControl 赋予被授权者读写权限,格式 x-cos-grant-full-control: uin=" ",uin=" ",当需要给子账户授权时,uin="RootAcountID/SubAccountID",当需要给根账户授权时,uin="RootAcountID"。 + * @param {String} MetadataDirective 是否拷贝元数据,枚举值:Copy, Replaced,默认值Copy。假如标记为Copy,忽略Header中的用户元数据信息直接复制;假如标记为Replaced,按Header信息修改元数据。当目标路径和原路径一致,即用户试图修改元数据时,必须为Replaced + * @param {String} CopySourceIfModifiedSince 当Object在指定时间后被修改,则执行操作,否则返回412。可与x-cos-copy-source-If-None-Match一起使用,与其他条件联合使用返回冲突。 + * @param {String} CopySourceIfUnmodifiedSince 当Object在指定时间后未被修改,则执行操作,否则返回412。可与x-cos-copy-source-If-Match一起使用,与其他条件联合使用返回冲突。 + * @param {String} CopySourceIfMatch 当Object的ETag和给定一致时,则执行操作,否则返回412。可与x-cos-copy-source-If-Unmodified-Since一起使用,与其他条件联合使用返回冲突。 + * @param {String} CopySourceIfNoneMatch 当Object的ETag和给定不一致时,则执行操作,否则返回412。可与x-cos-copy-source-If-Modified-Since一起使用,与其他条件联合使用返回冲突。 + * @param {String} StorageClass 存储级别,枚举值:存储级别,枚举值:Standard, Standard_IA,Archive;默认值:Standard + * @param {String} CacheControl 指定所有缓存机制在整个请求/响应链中必须服从的指令。 + * @param {String} ContentDisposition MIME 协议的扩展,MIME 协议指示 MIME 用户代理如何显示附加的文件 + * @param {String} ContentEncoding HTTP 中用来对「采用何种编码格式传输正文」进行协定的一对头部字段 + * @param {String} ContentLength 设置响应消息的实体内容的大小,单位为字节 + * @param {String} ContentType RFC 2616 中定义的 HTTP 请求内容类型(MIME),例如text/plain + * @param {String} Expect 请求的特定的服务器行为 + * @param {String} Expires 响应过期的日期和时间 + * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: "AES256",非必须 + * @param {String} ContentLanguage 指定内容语言 + * @param {String} x-cos-meta-* 允许用户自定义的头部信息,将作为 Object 元数据返回。大小限制2K。 */ function putObjectCopy(params, callback) { @@ -7162,15 +7162,15 @@ function restoreObject(params, callback) { }, callback); } -/** - * 设置 Object 的标签 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Object名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Array} params.TagSet 标签设置,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/42998 - * @return {Object} data 返回数据 +/** + * 设置 Object 的标签 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Object名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Array} params.TagSet 标签设置,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/42998 + * @return {Object} data 返回数据 */ function putObjectTagging(params, callback) { @@ -7206,14 +7206,14 @@ function putObjectTagging(params, callback) { }); } -/** - * 获取 Object 的标签设置 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/42998 - * @return {Object} data 返回数据 +/** + * 获取 Object 的标签设置 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/42998 + * @return {Object} data 返回数据 */ function getObjectTagging(params, callback) { @@ -7253,14 +7253,14 @@ function getObjectTagging(params, callback) { }); } -/** - * 删除 Object 的 标签设置 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Object名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/42998 - * @return {Object} data 返回的数据 +/** + * 删除 Object 的 标签设置 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Object名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/42998 + * @return {Object} data 返回的数据 */ function deleteObjectTagging(params, callback) { submitRequest.call(this, { @@ -7285,15 +7285,15 @@ function deleteObjectTagging(params, callback) { }); } -/** - * 使用 SQL 语句从指定对象(CSV 格式或者 JSON 格式)中检索内容 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Object名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {Object} params.SelectRequest 地域名称,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/42998 - * @return {Object} data 返回的数据 +/** + * 使用 SQL 语句从指定对象(CSV 格式或者 JSON 格式)中检索内容 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Object名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {Object} params.SelectRequest 地域名称,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/42998 + * @return {Object} data 返回的数据 */ function selectObjectContent(params, callback) { var SelectType = params['SelectType']; @@ -7340,27 +7340,27 @@ function selectObjectContent(params, callback) { // 分块上传 -/** - * 初始化分块上传 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key object名称,必须 - * @param {String} params.UploadId object名称,必须 - * @param {String} params.CacheControl RFC 2616 中定义的缓存策略,将作为 Object 元数据保存,非必须 - * @param {String} params.ContentDisposition RFC 2616 中定义的文件名称,将作为 Object 元数据保存 ,非必须 - * @param {String} params.ContentEncoding RFC 2616 中定义的编码格式,将作为 Object 元数据保存,非必须 - * @param {String} params.ContentType RFC 2616 中定义的内容类型(MIME),将作为 Object 元数据保存,非必须 - * @param {String} params.Expires RFC 2616 中定义的过期时间,将作为 Object 元数据保存,非必须 - * @param {String} params.ACL 允许用户自定义文件权限,非必须 - * @param {String} params.GrantRead 赋予被授权者读的权限 ,非必须 - * @param {String} params.GrantWrite 赋予被授权者写的权限 ,非必须 - * @param {String} params.GrantFullControl 赋予被授权者读写权限 ,非必须 - * @param {String} params.StorageClass 设置Object的存储级别,枚举值:Standard,Standard_IA,Archive,非必须 - * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: "AES256",非必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 +/** + * 初始化分块上传 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key object名称,必须 + * @param {String} params.UploadId object名称,必须 + * @param {String} params.CacheControl RFC 2616 中定义的缓存策略,将作为 Object 元数据保存,非必须 + * @param {String} params.ContentDisposition RFC 2616 中定义的文件名称,将作为 Object 元数据保存 ,非必须 + * @param {String} params.ContentEncoding RFC 2616 中定义的编码格式,将作为 Object 元数据保存,非必须 + * @param {String} params.ContentType RFC 2616 中定义的内容类型(MIME),将作为 Object 元数据保存,非必须 + * @param {String} params.Expires RFC 2616 中定义的过期时间,将作为 Object 元数据保存,非必须 + * @param {String} params.ACL 允许用户自定义文件权限,非必须 + * @param {String} params.GrantRead 赋予被授权者读的权限 ,非必须 + * @param {String} params.GrantWrite 赋予被授权者写的权限 ,非必须 + * @param {String} params.GrantFullControl 赋予被授权者读写权限 ,非必须 + * @param {String} params.StorageClass 设置Object的存储级别,枚举值:Standard,Standard_IA,Archive,非必须 + * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: "AES256",非必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 */ function multipartInit(params, callback) { @@ -7397,21 +7397,21 @@ function multipartInit(params, callback) { }, params.onHashProgress); } -/** - * 分块上传 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key object名称,必须 - * @param {File || Blob || String} params.Body 上传文件对象或字符串 - * @param {String} params.ContentLength RFC 2616 中定义的 HTTP 请求内容长度(字节),非必须 - * @param {String} params.Expect 当使用 Expect: 100-continue 时,在收到服务端确认后,才会发送请求内容,非必须 - * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: "AES256",非必须 - * @param {String} params.ContentSha1 RFC 3174 中定义的 160-bit 内容 SHA-1 算法校验值,非必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 - * @return {Object} data.ETag 返回的文件分块 sha1 值 +/** + * 分块上传 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key object名称,必须 + * @param {File || Blob || String} params.Body 上传文件对象或字符串 + * @param {String} params.ContentLength RFC 2616 中定义的 HTTP 请求内容长度(字节),非必须 + * @param {String} params.Expect 当使用 Expect: 100-continue 时,在收到服务端确认后,才会发送请求内容,非必须 + * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: "AES256",非必须 + * @param {String} params.ContentSha1 RFC 3174 中定义的 160-bit 内容 SHA-1 算法校验值,非必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 + * @return {Object} data.ETag 返回的文件分块 sha1 值 */ function multipartUpload(params, callback) { @@ -7445,19 +7445,19 @@ function multipartUpload(params, callback) { }); } -/** - * 完成分块上传 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key object名称,必须 - * @param {Array} params.Parts 分块信息列表,必须 - * @param {String} params.Parts[i].PartNumber 块编号,必须 - * @param {String} params.Parts[i].ETag 分块的 sha1 校验值 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 - * @return {Object} data.CompleteMultipartUpload 完成分块上传后的文件信息,包括Location, Bucket, Key 和 ETag +/** + * 完成分块上传 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key object名称,必须 + * @param {Array} params.Parts 分块信息列表,必须 + * @param {String} params.Parts[i].PartNumber 块编号,必须 + * @param {String} params.Parts[i].ETag 分块的 sha1 校验值 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 + * @return {Object} data.CompleteMultipartUpload 完成分块上传后的文件信息,包括Location, Bucket, Key 和 ETag */ function multipartComplete(params, callback) { var self = this; @@ -7528,21 +7528,21 @@ function multipartComplete(params, callback) { }); } -/** - * 分块上传任务列表查询 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Delimiter 定界符为一个符号,如果有Prefix,则将Prefix到delimiter之间的相同路径归为一类,定义为Common Prefix,然后列出所有Common Prefix。如果没有Prefix,则从路径起点开始,非必须 - * @param {String} params.EncodingType 规定返回值的编码方式,非必须 - * @param {String} params.Prefix 前缀匹配,用来规定返回的文件前缀地址,非必须 - * @param {String} params.MaxUploads 单次返回最大的条目数量,默认1000,非必须 - * @param {String} params.KeyMarker 与upload-id-marker一起使用
当upload-id-marker未被指定时,ObjectName字母顺序大于key-marker的条目将被列出
当upload-id-marker被指定时,ObjectName字母顺序大于key-marker的条目被列出,ObjectName字母顺序等于key-marker同时UploadId大于upload-id-marker的条目将被列出,非必须 - * @param {String} params.UploadIdMarker 与key-marker一起使用
当key-marker未被指定时,upload-id-marker将被忽略
当key-marker被指定时,ObjectName字母顺序大于key-marker的条目被列出,ObjectName字母顺序等于key-marker同时UploadId大于upload-id-marker的条目将被列出,非必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 - * @return {Object} data.ListMultipartUploadsResult 分块上传任务信息 +/** + * 分块上传任务列表查询 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Delimiter 定界符为一个符号,如果有Prefix,则将Prefix到delimiter之间的相同路径归为一类,定义为Common Prefix,然后列出所有Common Prefix。如果没有Prefix,则从路径起点开始,非必须 + * @param {String} params.EncodingType 规定返回值的编码方式,非必须 + * @param {String} params.Prefix 前缀匹配,用来规定返回的文件前缀地址,非必须 + * @param {String} params.MaxUploads 单次返回最大的条目数量,默认1000,非必须 + * @param {String} params.KeyMarker 与upload-id-marker一起使用
当upload-id-marker未被指定时,ObjectName字母顺序大于key-marker的条目将被列出
当upload-id-marker被指定时,ObjectName字母顺序大于key-marker的条目被列出,ObjectName字母顺序等于key-marker同时UploadId大于upload-id-marker的条目将被列出,非必须 + * @param {String} params.UploadIdMarker 与key-marker一起使用
当key-marker未被指定时,upload-id-marker将被忽略
当key-marker被指定时,ObjectName字母顺序大于key-marker的条目被列出,ObjectName字母顺序等于key-marker同时UploadId大于upload-id-marker的条目将被列出,非必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 + * @return {Object} data.ListMultipartUploadsResult 分块上传任务信息 */ function multipartList(params, callback) { var reqParams = {}; @@ -7584,20 +7584,20 @@ function multipartList(params, callback) { }); } -/** - * 上传的分块列表查询 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key object名称,必须 - * @param {String} params.UploadId 标示本次分块上传的ID,必须 - * @param {String} params.EncodingType 规定返回值的编码方式,非必须 - * @param {String} params.MaxParts 单次返回最大的条目数量,默认1000,非必须 - * @param {String} params.PartNumberMarker 默认以UTF-8二进制顺序列出条目,所有列出条目从marker开始,非必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 - * @return {Object} data.ListMultipartUploadsResult 分块信息 +/** + * 上传的分块列表查询 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key object名称,必须 + * @param {String} params.UploadId 标示本次分块上传的ID,必须 + * @param {String} params.EncodingType 规定返回值的编码方式,非必须 + * @param {String} params.MaxParts 单次返回最大的条目数量,默认1000,非必须 + * @param {String} params.PartNumberMarker 默认以UTF-8二进制顺序列出条目,所有列出条目从marker开始,非必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 + * @return {Object} data.ListMultipartUploadsResult 分块信息 */ function multipartListPart(params, callback) { var reqParams = {}; @@ -7631,16 +7631,16 @@ function multipartListPart(params, callback) { }); } -/** - * 抛弃分块上传 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key object名称,必须 - * @param {String} params.UploadId 标示本次分块上传的ID,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 +/** + * 抛弃分块上传 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key object名称,必须 + * @param {String} params.UploadId 标示本次分块上传的ID,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 */ function multipartAbort(params, callback) { var reqParams = {}; @@ -7663,16 +7663,16 @@ function multipartAbort(params, callback) { }); } -/** - * 抛弃分块上传 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key object名称,必须 - * @param {String} params.UploadId 标示本次分块上传的ID,必须 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 +/** + * 抛弃分块上传 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key object名称,必须 + * @param {String} params.UploadId 标示本次分块上传的ID,必须 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 */ function request(params, callback) { submitRequest.call(this, { @@ -7694,13 +7694,13 @@ function request(params, callback) { }); } -/** - * 获取签名 - * @param {Object} params 参数对象,必须 - * @param {String} params.Method 请求方法,必须 - * @param {String} params.Key object名称,必须 - * @param {String} params.Expires 名超时时间,单位秒,可选 - * @return {String} data 返回签名字符串 +/** + * 获取签名 + * @param {Object} params 参数对象,必须 + * @param {String} params.Method 请求方法,必须 + * @param {String} params.Key object名称,必须 + * @param {String} params.Expires 名超时时间,单位秒,可选 + * @return {String} data 返回签名字符串 */ function getAuth(params) { var self = this; @@ -7717,17 +7717,17 @@ function getAuth(params) { }); } -/** - * 获取文件下载链接 - * @param {Object} params 参数对象,必须 - * @param {String} params.Bucket Bucket名称,必须 - * @param {String} params.Region 地域名称,必须 - * @param {String} params.Key object名称,必须 - * @param {String} params.Method 请求的方法,可选 - * @param {String} params.Expires 签名超时时间,单位秒,可选 - * @param {Function} callback 回调函数,必须 - * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 - * @return {Object} data 返回的数据 +/** + * 获取文件下载链接 + * @param {Object} params 参数对象,必须 + * @param {String} params.Bucket Bucket名称,必须 + * @param {String} params.Region 地域名称,必须 + * @param {String} params.Key object名称,必须 + * @param {String} params.Method 请求的方法,可选 + * @param {String} params.Expires 签名超时时间,单位秒,可选 + * @param {Function} callback 回调函数,必须 + * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 + * @return {Object} data 返回的数据 */ function getObjectUrl(params, callback) { var self = this; @@ -7789,8 +7789,8 @@ function getObjectUrl(params, callback) { return syncUrl; } -/** - * 私有方法 +/** + * 私有方法 */ function decodeAcl(AccessControlPolicy) { var result = { @@ -9039,14 +9039,14 @@ function wholeMultipartListPart(params, callback) { } // 上传文件分块,包括 -/* - UploadId (上传任务编号) - AsyncLimit (并发量), - SliceList (上传的分块数组), - FilePath (本地文件的位置), - SliceSize (文件分块大小) - FileSize (文件大小) - onProgress (上传成功之后的回调函数) +/* + UploadId (上传任务编号) + AsyncLimit (并发量), + SliceList (上传的分块数组), + FilePath (本地文件的位置), + SliceSize (文件分块大小) + FileSize (文件大小) + onProgress (上传成功之后的回调函数) */ function uploadSliceList(params, cb) { var self = this; @@ -9199,10 +9199,10 @@ function uploadSliceComplete(params, callback) { } // 抛弃分块上传任务 -/* - AsyncLimit (抛弃上传任务的并发量), - UploadId (上传任务的编号,当 Level 为 task 时候需要) - Level (抛弃分块上传任务的级别,task : 抛弃指定的上传任务,file : 抛弃指定的文件对应的上传任务,其他值 :抛弃指定Bucket 的全部上传任务) +/* + AsyncLimit (抛弃上传任务的并发量), + UploadId (上传任务的编号,当 Level 为 task 时候需要) + Level (抛弃分块上传任务的级别,task : 抛弃指定的上传任务,file : 抛弃指定的文件对应的上传任务,其他值 :抛弃指定Bucket 的全部上传任务) */ function abortUploadTask(params, callback) { var Bucket = params.Bucket; @@ -9536,8 +9536,8 @@ function sliceCopyFile(params, callback) { } TargetHeader['x-cos-storage-class'] = params.Headers['x-cos-storage-class'] || SourceHeaders['x-cos-storage-class']; TargetHeader = util.clearKey(TargetHeader); - /** - * 对于归档存储的对象,如果未恢复副本,则不允许 Copy + /** + * 对于归档存储的对象,如果未恢复副本,则不允许 Copy */ if (SourceHeaders['x-cos-storage-class'] === 'ARCHIVE' || SourceHeaders['x-cos-storage-class'] === 'DEEP_ARCHIVE') { var restoreHeader = SourceHeaders['x-cos-restore']; @@ -9546,9 +9546,9 @@ function sliceCopyFile(params, callback) { return; } } - /** - * 去除一些无用的头部,规避 multipartInit 出错 - * 这些头部通常是在 putObjectCopy 时才使用 + /** + * 去除一些无用的头部,规避 multipartInit 出错 + * 这些头部通常是在 putObjectCopy 时才使用 */ delete TargetHeader['x-cos-copy-source']; delete TargetHeader['x-cos-metadata-directive']; diff --git a/dist/cos-js-sdk-v5.min.js b/dist/cos-js-sdk-v5.min.js index 6e30874..36fdc95 100644 --- a/dist/cos-js-sdk-v5.min.js +++ b/dist/cos-js-sdk-v5.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.COS=t():e.COS=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=4)}([function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function o(e){return d(e,function(e){return"object"==typeof e&&null!==e?o(e):e})}function i(e,t,n){return e&&t in e?e[t]:n}function a(e,t){return l(t,function(n,r){e[r]=t[r]}),e}function s(e){return e instanceof Array}function c(e,t){for(var n=!1,r=0;rt?1:-1})},f=function(e){var t,n,o,i=[],a=d(e);for(t=0;tparseInt(t[n])?1:-1;return 0};return function(t){var n=(t.match(/Chrome\/([.\d]+)/)||[])[1],r=(t.match(/QBCore\/([.\d]+)/)||[])[1],o=(t.match(/QQBrowser\/([.\d]+)/)||[])[1];return n&&e(n,"53.0.2785.116")<0&&r&&e(r,"3.53.991.400")<0&&o&&e(o,"9.0.2524.400")<=0||!1}(navigator&&navigator.userAgent)}(),T=function(e,t,n,r,o){var i;if(e.slice?i=e.slice(t,n):e.mozSlice?i=e.mozSlice(t,n):e.webkitSlice&&(i=e.webkitSlice(t,n)),r&&A){var a=new FileReader;a.onload=function(e){i=null,o(new Blob([a.result]))},a.readAsArrayBuffer(i)}else o(i)},B=function(e,t,n,r){n=n||S,e?"string"==typeof t?n(U.md5(t,!0)):Blob&&t instanceof Blob?U.getFileMd5(t,function(e,t){n(t)},r):n():n()},E=function(e,t,n){var r=e.size,o=0,i=h.getCtx(),a=function(s){if(s>=r){var c=i.digest("hex");return void t(null,c)}var u=Math.min(r,s+1048576);U.fileSlice(e,s,u,!1,function(e){b(e,function(t){e=null,i=i.update(t,!0),o+=t.length,t=null,n&&n({loaded:o,total:r,percent:Math.round(o/r*1e4)/1e4}),a(s+1048576)})})};a(0)},x=function(e){var t,n,r,o="";for(t=0,n=e.length/2;t-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(!n)return"Bucket";if(!r)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e){if(!n)return"Bucket";if(!r)return"Region";if(!o)return"Key"}return!1},I=function(e,t){if(t=a({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var n=t.Headers||{};if(t&&"object"==typeof t){!function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(n[e]=t[e])}();var r={"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-traffic-limit":"TrafficLimit","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext"};U.each(r,function(e,r){void 0!==t[e]&&(n[r]=t[e])}),t.Headers=R(n)}}return t},D=function(e,t){return function(n,r){var o=this;"function"==typeof n&&(r=n,n={}),n=I(e,n);var i=function(e){return e&&e.headers&&(e.headers["x-cos-request-id"]&&(e.RequestId=e.headers["x-cos-request-id"]),e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},a=function(e,t){r&&r(i(e),i(t))},s=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=_(e,n);if(t)return"missing param "+t;if(n.Region){if(n.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(n.Region))return"Region format error.";o.options.CompatibilityMode||-1!==n.Region.indexOf("-")||"yfb"===n.Region||"default"===n.Region||"accelerate"===n.Region||console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(n.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(n.Bucket))if(n.AppId)n.Bucket=n.Bucket+"-"+n.AppId;else{if(!o.options.AppId)return'Bucket should format as "test-1250000000".';n.Bucket=n.Bucket+"-"+o.options.AppId}n.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete n.AppId)}!o.options.UseRawKey&&n.Key&&"/"===n.Key.substr(0,1)&&(n.Key=n.Key.substr(1))}}(),c="getAuth"===e||"getObjectUrl"===e;if(Promise&&!c&&!r)return new Promise(function(e,i){if(r=function(t,n){t?i(t):e(n)},s)return a(U.error(new Error(s)));t.call(o,n,a)});if(s)return a(U.error(new Error(s)));var u=t.call(o,n,a);return c?u:void 0}},O=function(e,t){function n(){if(o=0,t&&"function"==typeof t){r=Date.now();var n,i=Math.max(0,Math.round((s-a)/((r-c)/1e3)*100)/100)||0;n=0===s&&0===e?1:Math.floor(s/e*100)/100||0,c=r,a=s;try{t({loaded:s,total:e,speed:i,percent:n})}catch(e){}}}var r,o,i=this,a=0,s=0,c=Date.now();return function(t,r){if(t&&(s=t.loaded,e=t.total),r)clearTimeout(o),n();else{if(o)return;o=setTimeout(n,i.options.ProgressInterval)}}},N=function(e,t,n){var r;if("string"==typeof t.Body?t.Body=new Blob([t.Body],{type:"text/plain"}):t.Body instanceof ArrayBuffer&&(t.Body=new Blob([t.Body])),!t.Body||!(t.Body instanceof Blob||"[object File]"===t.Body.toString()||"[object Blob]"===t.Body.toString()))return void n(U.error(new Error("params body format error, Only allow File|Blob|String.")));r=t.Body.size,t.ContentLength=r,n(null,r)},P=function(e){return Date.now()+(e||0)},M=function(e,t){var n=e;return e.message=e.message||null,"string"==typeof t?(e.error=t,e.message=t):"object"==typeof t&&null!==t&&(a(e,t),(t.code||t.name)&&(e.code=t.code||t.name),t.message&&(e.message=t.message),t.stack&&(e.stack=t.stack)),"function"==typeof Object.defineProperty&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=t&&t.name||e.name||e.code||"Error",e.code||(e.code=e.name),e.error||(e.error=o(n)),e},U={noop:S,formatParams:I,apiWrapper:D,xml2json:g,json2xml:m,md5:h,clearKey:R,fileSlice:T,getBodyMd5:B,getFileMd5:E,binaryBase64:x,extend:a,isArray:s,isInArray:c,makeArray:u,each:l,map:d,filter:f,clone:o,attr:i,uuid:w,camSafeUrlEncode:r,throttleOnProgress:O,getFileSize:N,getSkewTime:P,error:M,getAuth:y,parseSelectPayload:k,isBrowser:!0};e.exports=U},function(e,t){function n(e,t){for(var n in e)t[n]=e[n]}function r(e,t){function r(){}var o=e.prototype;if(Object.create){var i=Object.create(t.prototype);o.__proto__=i}o instanceof t||(r.prototype=t.prototype,r=new r,n(o,r),e.prototype=o=r),o.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),o.constructor=e)}function o(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,oe[e]),this.message=oe[e],Error.captureStackTrace&&Error.captureStackTrace(this,o);return n.code=e,t&&(this.message=this.message+": "+t),n}function i(){}function a(e,t){this._node=e,this._refresh=t,s(this)}function s(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var r=e._refresh(e._node);K(e,"length",r.length),n(r,e),e._inc=t}}function c(){}function u(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function l(e,t,n,r){if(r?t[u(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var o=e.ownerDocument;o&&(r&&C(o,e,r),y(o,e,n))}}function d(e,t,n){var r=u(t,n);if(!(r>=0))throw o(ae,new Error(e.tagName+"@"+n));for(var i=t.length-1;r"==e&&">"||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function g(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(g(e,t))return!0}while(e=e.nextSibling)}function m(){}function y(e,t,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function C(e,t,n,r){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function v(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var o=t.firstChild,i=0;o;)r[i++]=o,o=o.nextSibling;r.length=i}}}function k(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,v(e.ownerDocument,e),t}function S(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===te){var o=t.firstChild;if(null==o)return t;var i=t.lastChild}else o=i=t;var a=n?n.previousSibling:e.lastChild;o.previousSibling=a,i.nextSibling=n,a?a.nextSibling=o:e.firstChild=o,null==n?e.lastChild=i:n.previousSibling=i;do{o.parentNode=e}while(o!==i&&(o=o.nextSibling));return v(e.ownerDocument||e,e),t.nodeType==te&&(t.firstChild=t.lastChild=null),t}function R(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t);var r=e.lastChild}var r=e.lastChild;return t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,v(e.ownerDocument,e,t),t}function b(){this._nsMap={}}function A(){}function T(){}function B(){}function E(){}function x(){}function w(){}function _(){}function I(){}function D(){}function O(){}function N(){}function P(){}function M(e,t){var n=[],r=9==this.nodeType?this.documentElement:this,o=r.prefix,i=r.namespaceURI;if(i&&null==o){var o=r.lookupPrefix(i);if(null==o)var a=[{namespace:i,prefix:null}]}return H(this,n,e,t,a),n.join("")}function U(e,t,n){var r=e.prefix||"",o=e.namespaceURI;if(!r&&!o)return!1;if("xml"===r&&"http://www.w3.org/XML/1998/namespace"===o||"http://www.w3.org/2000/xmlns/"==o)return!1;for(var i=n.length;i--;){var a=n[i];if(a.prefix==r)return a.namespace!=o}return!0}function H(e,t,n,r,o){if(r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case G:o||(o=[]);var i=(o.length,e.attributes),a=i.length,s=e.firstChild,c=e.tagName;n=z===e.namespaceURI||n,t.push("<",c);for(var u=0;u"),n&&/^script$/i.test(c))for(;s;)s.data?t.push(s.data):H(s,t,n,r,o),s=s.nextSibling;else for(;s;)H(s,t,n,r,o),s=s.nextSibling;t.push("")}else t.push("/>");return;case Z:case te:for(var s=e.firstChild;s;)H(s,t,n,r,o),s=s.nextSibling;return;case V:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,p),'"');case X:return t.push(e.data.replace(/[<&]/g,p));case W:return t.push("");case Y:return t.push("\x3c!--",e.data,"--\x3e");case ee:var g=e.publicId,m=e.systemId;if(t.push("');else if(m&&"."!=m)t.push(' SYSTEM "',m,'">');else{var y=e.internalSubset;y&&t.push(" [",y,"]"),t.push(">")}return;case J:return t.push("");case Q:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function L(e,t,n){var r;switch(t.nodeType){case G:r=t.cloneNode(!1),r.ownerDocument=e;case te:break;case V:n=!0}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var o=t.firstChild;o;)r.appendChild(L(e,o,n)),o=o.nextSibling;return r}function F(e,t,n){var r=new t.constructor;for(var o in t){var a=t[o];"object"!=typeof a&&a!=r[o]&&(r[o]=a)}switch(t.childNodes&&(r.childNodes=new i),r.ownerDocument=e,r.nodeType){case G:var s=t.attributes,u=r.attributes=new c,l=s.length;u._ownerElement=r;for(var d=0;d0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(n[r]==e)return r;t=t.nodeType==V?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==V?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},n(q,h),n(q,h.prototype),m.prototype={nodeName:"#document",nodeType:Z,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==te){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return null==this.documentElement&&e.nodeType==G&&(this.documentElement=e),S(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),k(this,e)},importNode:function(e,t){return L(this,e,t)},getElementById:function(e){var t=null;return g(this.documentElement,function(n){if(n.nodeType==G&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new b;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new i,(t.attributes=new c)._ownerElement=t,t},createDocumentFragment:function(){var e=new O;return e.ownerDocument=this,e.childNodes=new i,e},createTextNode:function(e){var t=new B;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new E;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new x;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new N;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new A;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new D;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new b,r=t.split(":"),o=n.attributes=new c;return n.childNodes=new i,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,o._ownerElement=n,n},createAttributeNS:function(e,t){var n=new A,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},r(m,h),b.prototype={nodeType:G,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===te?this.insertBefore(e,null):R(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new a(this,function(t){var n=[];return g(t,function(r){r===t||r.nodeType!=G||"*"!==e&&r.tagName!=e||n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new a(this,function(n){var r=[];return g(n,function(o){o===n||o.nodeType!==G||"*"!==e&&o.namespaceURI!==e||"*"!==t&&o.localName!=t||r.push(o)}),r})}},m.prototype.getElementsByTagName=b.prototype.getElementsByTagName,m.prototype.getElementsByTagNameNS=b.prototype.getElementsByTagNameNS,r(b,h),A.prototype.nodeType=V,r(A,h),T.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(oe[ie])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},r(T,h),B.prototype={nodeName:"#text",nodeType:X,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},r(B,T),E.prototype={nodeName:"#comment",nodeType:Y},r(E,T),x.prototype={nodeName:"#cdata-section",nodeType:W},r(x,T),w.prototype.nodeType=ee,r(w,h),_.prototype.nodeType=ne,r(_,h),I.prototype.nodeType=$,r(I,h),D.prototype.nodeType=Q,r(D,h),O.prototype.nodeName="#document-fragment",O.prototype.nodeType=te,r(O,h),N.prototype.nodeType=J,r(N,h),P.prototype.serializeToString=function(e,t,n){return M.call(e,t,n)},h.prototype.toString=M;try{Object.defineProperty&&(Object.defineProperty(a.prototype,"length",{get:function(){return s(this),this.$$length}}),Object.defineProperty(h.prototype,"textContent",{get:function(){return j(this)},set:function(e){switch(this.nodeType){case G:case te:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),K=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DOMImplementation=f,t.XMLSerializer=P},function(e,t){var n=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){"task-list-update"===e&&console.warn('warning: Event "'+e+'" has been deprecated. Please use "list-update" instead.'),n(e).push(t)},e.off=function(e,t){for(var r=n(e),o=r.length-1;o>=0;o--)t===r[o]&&r.splice(o,1)},e.emit=function(e,t){for(var r=n(e).map(function(e){return e}),o=0;o=0;n--){var o=r[n][2];(!o||o+2592e3=0;o--){var i=r[o];i[0]===e&&i[1]===t&&r.splice(o,1)}r.unshift([e,t,Math.round(Date.now()/1e3)]),r.length>n&&r.splice(n),u()}},removeUploadId:function(e){c.call(this),delete l.using[e];for(var t=r.length-1;t>=0;t--)r[t][1]===e&&r.splice(t,1);u()}};e.exports=l},function(e,t,n){var r=n(5);e.exports=r},function(e,t,n){"use strict";var r=n(0),o=n(2),i=n(15),a=n(16),s=n(18),c={AppId:"",SecretId:"",SecretKey:"",SecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,UseRawKey:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadQueueSize:1e4,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1},u=function(e){this.options=r.extend(r.clone(c),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),o.init(this),i.init(this)};a.init(u,i),s.init(u,i),u.getAuthorization=r.getAuth,u.version="1.2.9",e.exports=u},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(9),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t,n){return new Md5(!0).update(t,n)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.getCtx=e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t>6,s[r++]=128|63&n):n<55296||n>=57344?(s[r++]=224|n>>12,s[r++]=128|n>>6&63,s[r++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),s[r++]=240|n>>18,s[r++]=128|n>>12&63,s[r++]=128|n>>6&63,s[r++]=128|63&n);else for(r=this.start;o>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(a[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=64?(this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,r,o,i,a=this.blocks;this.first?(e=a[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,r=(-1732584194^2004318071&e)+a[1]-117830708,r=(r<<12|r>>>20)+e<<0,n=(-271733879^r&(-271733879^e))+a[2]-1126478375,n=(n<<17|n>>>15)+r<<0,t=(e^n&(r^e))+a[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,r=this.h3,e+=(r^t&(n^r))+a[0]-680876936,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+a[1]-389564586,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+a[2]+606105819,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+a[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(r^t&(n^r))+a[4]-176418897,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+a[5]+1200080426,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+a[6]-1473231341,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+a[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+a[8]+1770035416,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+a[9]-1958414417,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+a[10]-42063,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+a[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+a[12]+1804603682,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+a[13]-40341101,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+a[14]-1502002290,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+a[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^r&(t^n))+a[1]-165796510,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+a[6]-1069501632,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+a[11]+643717713,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+a[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+a[5]-701558691,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+a[10]+38016083,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+a[15]-660478335,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+a[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+a[9]+568446438,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+a[14]-1019803690,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+a[3]-187363961,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+a[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+a[13]-1444681467,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+a[2]-51403784,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+a[7]+1735328473,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+a[12]-1926607734,t=(t<<20|t>>>12)+n<<0,o=t^n,e+=(o^r)+a[5]-378558,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+a[8]-2022574463,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+a[11]+1839030562,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+a[14]-35309556,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+a[1]-1530992060,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+a[4]+1272893353,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+a[7]-155497632,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+a[10]-1094730640,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+a[13]+681279174,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+a[0]-358537222,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+a[3]-722521979,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+a[6]+76029189,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+a[9]-640364487,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+a[12]-421815835,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+a[15]+530742520,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+a[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~r))+a[0]-198630844,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+a[7]+1126891415,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+a[14]-1416354905,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+a[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+a[12]+1700485571,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+a[3]-1894986606,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+a[10]-1051523,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+a[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+a[8]+1873313359,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+a[15]-30611744,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+a[6]-1560198380,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+a[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+a[4]-145523070,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+a[11]-1120210379,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+a[2]+718787259,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+a[9]-343485551,t=(t<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=r+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(e){if("hex"===e)return this.hex();this.finalize();var t=this.h0,n=this.h1,r=this.h2,o=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,r="",o=this.array(),i=0;i<15;)e=o[i++],t=o[i++],n=o[i++],r+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=o[i],r+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}()}).call(exports,__webpack_require__(7),__webpack_require__(8))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function a(){g&&h&&(g=!1,h.length?p=h.concat(p):m=-1,p.length&&s())}function s(){if(!g){var e=o(a);g=!0;for(var t=p.length;t;){for(h=p,p=[];++m1)for(var n=1;n>>2]|=(n[o>>>2]>>>24-o%4*8&255)<<24-(r+o)%4*8;else if(65535>>2]=n[o>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new a.init(n,t/2)}},u=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new a.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,o=n.sigBytes,i=this.blockSize,s=o/(4*i),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*i,o=e.min(4*t,o),t){for(var c=0;cu;u++){if(16>u)i[u]=0|e[t+u];else{var l=i[u-3]^i[u-8]^i[u-14]^i[u-16];i[u]=l<<1|l>>>31}l=(r<<5|r>>>27)+c+i[u],l=20>u?l+(1518500249+(o&a|~o&s)):40>u?l+(1859775393+(o^a^s)):60>u?l+((o&a|o&s|a&s)-1894007588):l+((o^a^s)-899497514),c=s,s=a,a=o<<30|o>>>2,o=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=o._createHelper(t),e.HmacSHA1=o._createHmacHelper(t)}(),function(){var e=r,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,o=4*r;n.sigBytes>o&&(n=e.finalize(n)),n.clamp();for(var i=this._oKey=n.clone(),a=this._iKey=n.clone(),s=i.words,c=a.words,u=0;u>>2]>>>24-i%4*8&255,s=t[i+1>>>2]>>>24-(i+1)%4*8&255,c=t[i+2>>>2]>>>24-(i+2)%4*8&255,u=a<<16|s<<8|c,l=0;l<4&&i+.75*l>>6*(3-l)&63));var d=r.charAt(64);if(d)for(;o.length%4;)o.push(d);return o.join("")},parse:function(e){var t=e.length,r=this._map,o=r.charAt(64);if(o){var i=e.indexOf(o);-1!=i&&(t=i)}for(var a=[],s=0,c=0;c>>6-c%4*2;a[s>>>2]|=(u|l)<<24-s%4*8,s++}return n.create(a,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.exports=r},function(e,t,n){var r=n(12).DOMParser,o=function(){this.version="1.3.5";var e={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},t=new RegExp(/(?!xmlns)^.*:/);new RegExp(/^\s+|\s+$/g);return this.grokType=function(e){return/^\s*$/.test(e)?null:/^(?:true|false)$/i.test(e)?"true"===e.toLowerCase():isFinite(e)?parseFloat(e):e},this.parseString=function(e,t){if(e){var n=this.stringToXML(e);return n.getElementsByTagName("parsererror").length?null:this.parseXML(n,t)}return null},this.parseXML=function(n,r){for(var i in r)e[i]=r[i];var a={},s=0,c="";if(n.childNodes.length)for(var u,l,d,f=0;f=t+n||t?new java.lang.String(e,t,n)+"":e}function u(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}r.prototype.parseFromString=function(e,t){var n=this.options,r=new l,a=n.domBuilder||new i,s=n.errorHandler,c=n.locator,u=n.xmlns||{},d={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return c&&a.setDocumentLocator(c),r.errorHandler=o(s,a,c),r.domBuilder=n.domBuilder||a,/\/x?html?$/.test(t)&&(d.nbsp="\xa0",d.copy="\xa9",u[""]="http://www.w3.org/1999/xhtml"),u.xml=u.xml||"http://www.w3.org/XML/1998/namespace",e?r.parse(e,u,d):r.errorHandler.error("invalid doc source"),a.doc},i.prototype={startDocument:function(){this.doc=(new d).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var o=this.doc,i=o.createElementNS(e,n||t),s=r.length;u(this,i),this.currentElement=i,this.locator&&a(this.locator,i);for(var c=0;c65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function p(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?h(parseInt(t.substr(1).replace("x","0x"))):(u.error("entity not found:"+e),e)}function g(t){if(t>b){var n=e.substring(b,t).replace(/&#?\w+;/g,p);k&&m(b),r.characters(n,0,t-b),b=t}}function m(t,n){for(;t>=C&&(n=v.exec(e));)y=n.index,C=y+n[0].length,k.lineNumber++;k.columnNumber=t-y+1}for(var y=0,C=0,v=/.*(?:\r\n?|\n)|.*$/g,k=r.locator,S=[{currentNSMap:t}],R={},b=0;;){try{var A=e.indexOf("<",b);if(A<0){if(!e.substr(b).match(/^\s*$/)){var T=r.doc,B=T.createTextNode(e.substr(b));T.appendChild(B),r.currentElement=B}return}switch(A>b&&g(A),e.charAt(A+1)){case"/":var E=e.indexOf(">",A+3),x=e.substring(A+2,E),w=S.pop();E<0?(x=e.substring(A+2).replace(/[\s<].*/,""),u.error("end tag name: "+x+" is not complete:"+w.tagName),E=A+1+x.length):x.match(/\sb?b=E:g(Math.max(A,b)+1)}}function o(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function i(e,t,n,r,o,i){for(var a,s,c=++t,u=C;;){var l=e.charAt(c);switch(l){case"=":if(u===v)a=e.slice(t,c),u=S;else{if(u!==k)throw new Error("attribute equal must after attrName");u=S}break;case"'":case'"':if(u===S||u===v){if(u===v&&(i.warning('attribute value must after "="'),a=e.slice(t,c)),t=c+1,!((c=e.indexOf(l,t))>0))throw new Error("attribute value no end '"+l+"' match");s=e.slice(t,c).replace(/&#?\w+;/g,o),n.add(a,s,t-1),u=b}else{if(u!=R)throw new Error('attribute value must after "="');s=e.slice(t,c).replace(/&#?\w+;/g,o),n.add(a,s,t),i.warning('attribute "'+a+'" missed start quot('+l+")!!"),t=c+1,u=b}break;case"/":switch(u){case C:n.setTagName(e.slice(t,c));case b:case A:case T:u=T,n.closed=!0;case R:case v:case k:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),u==C&&n.setTagName(e.slice(t,c)),c;case">":switch(u){case C:n.setTagName(e.slice(t,c));case b:case A:case T:break;case R:case v:s=e.slice(t,c),"/"===s.slice(-1)&&(n.closed=!0,s=s.slice(0,-1));case k:u===k&&(s=a),u==R?(i.warning('attribute "'+s+'" missed quot(")!!'),n.add(a,s.replace(/&#?\w+;/g,o),t)):("http://www.w3.org/1999/xhtml"===r[""]&&s.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+s+'" missed value!! "'+s+'" instead!!'),n.add(s,s,t));break;case S:throw new Error("attribute value missed!!")}return c;case"\x80":l=" ";default:if(l<=" ")switch(u){case C:n.setTagName(e.slice(t,c)),u=A;break;case v:a=e.slice(t,c),u=k;break;case R:var s=e.slice(t,c).replace(/&#?\w+;/g,o);i.warning('attribute "'+s+'" missed quot(")!!'),n.add(a,s,t);case b:u=A}else switch(u){case k:n.tagName;"http://www.w3.org/1999/xhtml"===r[""]&&a.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),n.add(a,a,t),t=c,u=v;break;case b:i.warning('attribute space is required"'+a+'"!!');case A:u=v,t=c;break;case S:u=R,t=c;break;case T:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function a(e,t,n){for(var r=e.tagName,o=null,i=e.length;i--;){var a=e[i],s=a.qName,c=a.value,l=s.indexOf(":");if(l>0)var d=a.prefix=s.slice(0,l),f=s.slice(l+1),h="xmlns"===d&&f;else f=s,d=null,h="xmlns"===s&&"";a.localName=f,!1!==h&&(null==o&&(o={},u(n,n={})),n[h]=o[h]=c,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(h,c))}for(var i=e.length;i--;){a=e[i];var d=a.prefix;d&&("xml"===d&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==d&&(a.uri=n[d||""]))}var l=r.indexOf(":");l>0?(d=e.prefix=r.slice(0,l),f=e.localName=r.slice(l+1)):(d=null,f=e.localName=r);var p=e.uri=n[d||""];if(t.startElement(p,f,r,e),!e.closed)return e.currentNSMap=n,e.localNSMap=o,!0;if(t.endElement(p,f,r),o)for(d in o)t.endPrefixMapping(d)}function s(e,t,n,r,o){if(/^(?:script|textarea)$/i.test(n)){var i=e.indexOf("",t),a=e.substring(t+1,i);if(/[&<]/.test(a))return/^script$/i.test(n)?(o.characters(a,0,a.length),i):(a=a.replace(/&#?\w+;/g,r),o.characters(a,0,a.length),i)}return t+1}function c(e,t,n,r){var o=r[n];return null==o&&(o=e.lastIndexOf(""),ot?(n.comment(e,t+4,o-t-4),o+3):(r.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){var o=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,o-t-9),n.endCDATA(),o+3}var i=p(e,t),a=i.length;if(a>1&&/!doctype/i.test(i[0][0])){var s=i[1][0],c=a>3&&/^public$/i.test(i[2][0])&&i[3][0],u=a>4&&i[4][0],l=i[a-1];return n.startDTD(s,c&&c.replace(/^(['"])(.*?)\1$/,"$2"),u&&u.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),l.index+l[0].length}}return-1}function d(e,t,n){var r=e.indexOf("?>",t);if(r){var o=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(o){o[0].length;return n.processingInstruction(o[1],o[2]),r+2}return-1}return-1}function f(e){}function h(e,t){return e.__proto__=t,e}function p(e,t){var n,r=[],o=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(o.lastIndex=t,o.exec(e);n=o.exec(e);)if(r.push(n),n[1])return r}var g=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,m=new RegExp("[\\-\\.0-9"+g.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),y=new RegExp("^"+g.source+m.source+"*(?::"+g.source+m.source+"*)?$"),C=0,v=1,k=2,S=3,R=4,b=5,A=6,T=7;n.prototype={parse:function(e,t,n){var o=this.domBuilder;o.startDocument(),u(t,t={}),r(e,t,n,o,this.errorHandler),o.endDocument()}},f.prototype={setTagName:function(e){if(!y.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,n){if(!y.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},h({},h.prototype)instanceof h||(h=function(e,t){function n(){}n.prototype=t,n=new n;for(t in e)n[t]=e[t];return n}),t.XMLReader=n},function(e,t){function n(e){return(""+e).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(o,"")}var r=new RegExp("^([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd])|^((x|X)(m|M)(l|L))|([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd-.0-9\xb7\u0300-\u036f\u203f\u2040])","g"),o=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,i=function(e){var t=[];if(e instanceof Object)for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},a=function(e,t){var o=function(e,n,o,i,a){var s=void 0!==t.indent?t.indent:"\t",c=t.prettyPrint?"\n"+new Array(i).join(s):"";t.removeIllegalNameCharacters&&(e=e.replace(r,"_"));var u=[c,"<",e,o||""];return n&&n.length>0?(u.push(">"),u.push(n),a&&u.push(c),u.push("")):u.push("/>"),u.join("")};return function e(r,a,s){var c=typeof r;switch((Array.isArray?Array.isArray(r):r instanceof Array)?c="array":r instanceof Date&&(c="date"),c){case"array":var u=[];return r.map(function(t){u.push(e(t,1,s+1))}),t.prettyPrint&&u.push("\n"),u.join("");case"date":return r.toJSON?r.toJSON():r+"";case"object":var l=[];for(var d in r)if(r.hasOwnProperty(d))if(r[d]instanceof Array)for(var f=0;f0&&l.push("\n"),l.join("");case"function":return r();default:return t.escape?n(r):""+r}}(e,0,0)},s=function(e){var t=['"),t.join("")};e.exports=function(e,t){if(t||(t={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),"string"==typeof e)try{e=JSON.parse(e.toString())}catch(e){return!1}var n="",r="";return t&&("object"==typeof t?(t.xmlHeader&&(n=s(!!t.xmlHeader.standalone)),void 0!==t.docType&&(r="")):n=s()),t=t||{},[n,t.prettyPrint&&r?"\n":"",r,a(e,t)].join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")}},function(e,t,n){var r=n(3),o=n(0),i={},a=function(e,t){i[t]=e[t],e[t]=function(e,n){e.SkipTask?i[t].call(this,e,n):this._addTask(t,e,n)}},s=function(e){var t=[],n={},a=0,s=0,c=function(e){var t={id:e.id,Bucket:e.Bucket,Region:e.Region,Key:e.Key,FilePath:e.FilePath,state:e.state,loaded:e.loaded,size:e.size,speed:e.speed,percent:e.percent,hashPercent:e.hashPercent,error:e.error};return e.FilePath&&(t.FilePath=e.FilePath),e._custom&&(t._custom=e._custom),t},u=function(){var n,r=function(){n=0,e.emit("task-list-update",{list:o.map(t,c)}),e.emit("list-update",{list:o.map(t,c)})};return function(){n||(n=setTimeout(r))}}(),l=function(){if(!(t.length<=e.options.UploadQueueSize)){for(var r=0;re.options.UploadQueueSize;){var o="waiting"===t[r].state||"checking"===t[r].state||"uploading"===t[r].state;t[r]&&o?r++:(n[t[r].id]&&delete n[t[r].id],t.splice(r,1),s--)}u()}},d=function(){if(!(a>=e.options.FileParallelLimit)){for(;t[s]&&"waiting"!==t[s].state;)s++;if(!(s>=t.length)){var n=t[s];s++,a++,n.state="checking",n.params.onTaskStart&&n.params.onTaskStart(c(n)),!n.params.UploadData&&(n.params.UploadData={});var r=o.formatParams(n.api,n.params);i[n.api].call(e,r,function(t,r){e._isRunningTask(n.id)&&("checking"!==n.state&&"uploading"!==n.state||(n.state=t?"error":"success",t&&(n.error=t),a--,u(),d(),n.callback&&n.callback(t,r),"success"===n.state&&(n.params&&(delete n.params.UploadData,delete n.params.Body,delete n.params),delete n.callback)),l())}),u(),setTimeout(d)}}},f=function(t,o){var i=n[t];if(i){var s=i&&"waiting"===i.state,c=i&&("checking"===i.state||"uploading"===i.state);if("canceled"===o&&"canceled"!==i.state||"paused"===o&&s||"paused"===o&&c){if("paused"===o&&i.params.Body&&"function"==typeof i.params.Body.pipe)return void console.error("stream not support pause");i.state=o,e.emit("inner-kill-task",{TaskId:t,toState:o});try{var f=i&&i.params&&i.params.UploadData.UploadId}catch(e){}"canceled"===o&&f&&r.removeUsing(f),u(),c&&(a--,d()),"canceled"===o&&(i.params&&(delete i.params.UploadData,delete i.params.Body,delete i.params),delete i.callback)}l()}};e._addTasks=function(t){o.each(t,function(t){e._addTask(t.api,t.params,t.callback,!0)}),u()};var h=!0;e._addTask=function(r,i,a,s){i=o.formatParams(r,i);var c=o.uuid();i.TaskId=c,i.onTaskReady&&i.onTaskReady(c),i.TaskReady&&(i.TaskReady(c),h&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),h=!1);var f={params:i,callback:a,api:r,index:t.length,id:c,Bucket:i.Bucket,Region:i.Region,Key:i.Key,FilePath:i.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:i._custom},p=i.onHashProgress;i.onHashProgress=function(t){e._isRunningTask(f.id)&&(f.hashPercent=t.percent,p&&p(t),u())};var g=i.onProgress;return i.onProgress=function(t){e._isRunningTask(f.id)&&("checking"===f.state&&(f.state="uploading"),f.loaded=t.loaded,f.speed=t.speed,f.percent=t.percent,g&&g(t),u())},o.getFileSize(r,i,function(e,r){if(e)return a(o.error(e));n[c]=f,t.push(f),f.size=r,!s&&u(),d(),l()}),c},e._isRunningTask=function(e){var t=n[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return o.map(t,c)},e.cancelTask=function(e){f(e,"canceled")},e.pauseTask=function(e){f(e,"paused")},e.restartTask=function(e){var t=n[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",u(),s=Math.min(s,t.index),d())},e.isUploadRunning=function(){return a||s/gi,"<$1Rule>"),r=r.replace(/<(\/?)Tags>/gi,"<$1Tag>");var o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=_e.binaryBase64(_e.md5(r)),Be.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"replication",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function B(e,t){Be.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var r={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=_e.makeArray(n.ReplicationConfiguration.Rule),delete n.ReplicationConfiguration.Rule),t(e,n)})}function E(e,t){Be.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function x(e,t){if(!e.WebsiteConfiguration)return void t(_e.error(new Error("missing param WebsiteConfiguration")));var n=_e.clone(e.WebsiteConfiguration||{}),r=n.RoutingRules||n.RoutingRule||[];r=_e.isArray(r)?r:[r],delete n.RoutingRule,delete n.RoutingRules,r.length&&(n.RoutingRules={RoutingRule:r});var o=_e.json2xml({WebsiteConfiguration:n}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(o)),Be.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"website",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function w(e,t){Be.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var r={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else t(e);else{var o=n.WebsiteConfiguration||{};if(o.RoutingRules){var i=_e.clone(o.RoutingRules.RoutingRule||[]);i=_e.makeArray(i),o.RoutingRules=i}t(null,{WebsiteConfiguration:o,statusCode:n.statusCode,headers:n.headers})}})}function _(e,t){Be.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function I(e,t){if(!e.RefererConfiguration)return void t(_e.error(new Error("missing param RefererConfiguration")));var n=_e.clone(e.RefererConfiguration||{}),r=n.DomainList||{},o=r.Domains||r.Domain||[];o=_e.isArray(o)?o:[o],o.length&&(n.DomainList={Domain:o});var i=_e.json2xml({RefererConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=_e.binaryBase64(_e.md5(i)),Be.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"referer",headers:a},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function D(e,t){Be.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var r={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else t(e);else{var o=n.RefererConfiguration||{};if(o.DomainList){var i=_e.clone(o.DomainList.Domain||[]);i=_e.makeArray(i),o.DomainList={Domains:i}}t(null,{RefererConfiguration:o,statusCode:n.statusCode,headers:n.headers})}})}function O(e,t){var n=e.DomainConfiguration||{},r=n.DomainRule||e.DomainRule||[];r=_e.clone(r);var o=_e.json2xml({DomainConfiguration:{DomainRule:r}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(o)),Be.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"domain",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function N(e,t){Be.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){if(e)return t(e);var r=[];try{r=n.DomainConfiguration.DomainRule||[]}catch(e){}r=_e.clone(_e.isArray(r)?r:[r]),t(null,{DomainRule:r,statusCode:n.statusCode,headers:n.headers})})}function P(e,t){Be.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function M(e,t){var n=e.OriginConfiguration||{},r=n.OriginRule||e.OriginRule||[];r=_e.clone(r);var o=_e.json2xml({OriginConfiguration:{OriginRule:r}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(o)),Be.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"origin",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function U(e,t){Be.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){if(e)return t(e);var r=[];try{r=n.OriginConfiguration.OriginRule||[]}catch(e){}r=_e.clone(_e.isArray(r)?r:[r]),t(null,{OriginRule:r,statusCode:n.statusCode,headers:n.headers})})}function H(e,t){Be.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function L(e,t){var n=_e.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=_e.binaryBase64(_e.md5(n)),Be.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:r},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function F(e,t){Be.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging"},function(e,n){if(e)return t(e);t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})})}function K(e,t){var n=_e.clone(e.InventoryConfiguration);if(n.OptionalFields){var r=n.OptionalFields||[];n.OptionalFields={Field:r}}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var o=n.Destination.COSBucketDestination.Encryption;Object.keys(o).indexOf("SSECOS")>-1&&(o["SSE-COS"]=o.SSECOS,delete o.SSECOS)}var i=_e.json2xml({InventoryConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=_e.binaryBase64(_e.md5(i)),Be.call(this,{Action:"name/cos:PutBucketInventory",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"inventory",qs:{id:e.Id},headers:a},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function j(e,t){Be.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){if(e)return t(e);var r=n.InventoryConfiguration;if(r&&r.OptionalFields&&r.OptionalFields.Field){var o=r.OptionalFields.Field;_e.isArray(o)||(o=[o]),r.OptionalFields=o}if(r.Destination&&r.Destination.COSBucketDestination&&r.Destination.COSBucketDestination.Encryption){var i=r.Destination.COSBucketDestination.Encryption;Object.keys(i).indexOf("SSE-COS")>-1&&(i.SSECOS=i["SSE-COS"],delete i["SSE-COS"])}t(null,{InventoryConfiguration:r,statusCode:n.statusCode,headers:n.headers})})}function z(e,t){Be.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken}},function(e,n){if(e)return t(e);var r=n.ListInventoryConfigurationResult,o=r.InventoryConfiguration||[];o=_e.isArray(o)?o:[o],delete r.InventoryConfiguration,_e.each(o,function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;_e.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var n=e.Destination.COSBucketDestination.Encryption;Object.keys(n).indexOf("SSE-COS")>-1&&(n.SSECOS=n["SSE-COS"],delete n["SSE-COS"])}}),r.InventoryConfigurations=o,_e.extend(r,{statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function q(e,t){Be.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function G(e,t){if(!e.AccelerateConfiguration)return void t(_e.error(new Error("missing param AccelerateConfiguration")));var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},r=_e.json2xml(n),o={};o["Content-Type"]="application/xml",o["Content-MD5"]=_e.binaryBase64(_e.md5(r)),Be.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"accelerate",headers:o},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function V(e,t){Be.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate"},function(e,n){e||!n.AccelerateConfiguration&&(n.AccelerateConfiguration={}),t(e,n)})}function X(e,t){var n=e.ServerSideEncryptionConfiguration||{},r=n.Rule||n.Rules||[],o=_e.json2xml({ServerSideEncryptionConfiguration:{Rule:r}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(o)),Be.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"encryption",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function W(e,t){Be.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchEncryptionConfiguration"===e.code){var r={EncryptionConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else t(e);else{var o=_e.makeArray(n.EncryptionConfiguration&&n.EncryptionConfiguration.Rule||[]);n.EncryptionConfiguration={Rules:o},t(e,n)}})}function Q(e,t){Be.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function $(e,t){Be.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(n,r){if(n){var o=n.statusCode;return e.Headers["If-Modified-Since"]&&o&&304===o?t(null,{NotModified:!0,statusCode:o}):t(n)}r.ETag=_e.attr(r.headers,"etag",""),t(null,r)})}function J(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,Be.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions"},function(e,n){if(e)return t(e);var r=n.ListVersionsResult||{},o=r.DeleteMarker||[];o=_e.isArray(o)?o:[o];var i=r.Version||[];i=_e.isArray(i)?i:[i];var a=_e.clone(r);delete a.DeleteMarker,delete a.Version,_e.extend(a,{DeleteMarkers:o,Versions:i,statusCode:n.statusCode,headers:n.headers}),t(null,a)})}function Y(e,t){var n=e.Query||{},r=e.QueryString||"",o=_e.throttleOnProgress.call(this,0,e.onProgress);n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,Be.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,DataType:e.DataType,headers:e.Headers,qs:n,qsStr:r,rawBody:!0,onDownloadProgress:o},function(n,r){if(o(null,!0),n){var i=n.statusCode;return e.Headers["If-Modified-Since"]&&i&&304===i?t(null,{NotModified:!0}):t(n)}t(null,{Body:r.body,ETag:_e.attr(r.headers,"etag",""),statusCode:r.statusCode,headers:r.headers})})}function Z(e,t){var n=this,r=e.ContentLength,o=_e.throttleOnProgress.call(n,r,e.onProgress),i=e.Headers;i["Cache-Control"]||i["cache-control"]||(i["Cache-Control"]=""),i["Content-Type"]||i["content-type"]||(i["Content-Type"]=e.Body&&e.Body.type||"");var a=e.UploadAddMetaMd5||n.options.UploadAddMetaMd5||n.options.UploadCheckContentMd5;_e.getBodyMd5(a,e.Body,function(a){a&&(n.options.UploadCheckContentMd5&&(i["Content-MD5"]=_e.binaryBase64(a)),(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5)&&(i["x-cos-meta-md5"]=a)),void 0!==e.ContentLength&&(i["Content-Length"]=e.ContentLength),o(null,!0),Be.call(n,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:o},function(i,a){if(i)return o(null,!0),t(i);o({loaded:r,total:r},!0);var s=be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key});s=s.substr(s.indexOf("://")+3),a.Location=s,a.ETag=_e.attr(a.headers,"etag",""),t(null,a)})},e.onHashProgress)}function ee(e,t){Be.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId},function(e,n){if(e){var r=e.statusCode;return r&&404===r?t(null,{BucketNotFound:!0,statusCode:r}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})})}function te(e,t){Be.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"acl"},function(e,n){if(e)return t(e);var r=n.AccessControlPolicy||{},o=r.Owner||{},i=r.AccessControlList&&r.AccessControlList.Grant||[];i=_e.isArray(i)?i:[i];var a=Se(r);delete a.GrantWrite,n.headers&&n.headers["x-cos-acl"]&&(a.ACL=n.headers["x-cos-acl"]),a=_e.extend(a,{Owner:o,Grants:i,statusCode:n.statusCode,headers:n.headers}),t(null,a)})}function ne(e,t){var n=e.Headers,r="";if(e.AccessControlPolicy){var o=_e.clone(e.AccessControlPolicy||{}),i=o.Grants||o.Grant;i=_e.isArray(i)?i:[i],delete o.Grant,delete o.Grants,o.AccessControlList={Grant:i},r=_e.json2xml({AccessControlPolicy:o}),n["Content-Type"]="application/xml",n["Content-MD5"]=_e.binaryBase64(_e.md5(r))}_e.each(n,function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=Re(n[t]))}),Be.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:r},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function re(e,t){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,Be.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n},function(e,n){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var r=n.headers||{};t(null,{AccessControlAllowOrigin:r["access-control-allow-origin"],AccessControlAllowMethods:r["access-control-allow-methods"],AccessControlAllowHeaders:r["access-control-allow-headers"],AccessControlExposeHeaders:r["access-control-expose-headers"],AccessControlMaxAge:r["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})})}function oe(e,t){var n=this,r=e.Headers;r["Cache-Control"]||r["cache-control"]||(r["Cache-Control"]="");var o=e.CopySource||"",i=o.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!i)return void t(_e.error(new Error("CopySource format error")));var a=i[1],s=i[3],c=decodeURIComponent(i[4]);Be.call(this,{Scope:[{action:"name/cos:GetObject",bucket:a,region:s,prefix:c},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(r,o){if(r)return t(r);var i=_e.clone(o.CopyObjectResult||{}),a=be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});_e.extend(i,{Location:a,statusCode:o.statusCode,headers:o.headers}),t(null,i)})}function ie(e,t){var n=e.CopySource||"",r=n.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!r)return void t(_e.error(new Error("CopySource format error")));var o=r[1],i=r[3],a=decodeURIComponent(r[4]);Be.call(this,{Scope:[{action:"name/cos:GetObject",bucket:o,region:i,prefix:a},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers},function(e,n){if(e)return t(e);var r=_e.clone(n.CopyPartResult||{});_e.extend(r,{statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function ae(e,t){var n=e.Objects||[],r=e.Quiet;n=_e.isArray(n)?n:[n];var o=_e.json2xml({Delete:{Object:n,Quiet:r||!1}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(o));var a=_e.map(n,function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}});Be.call(this,{Scope:a,method:"POST",Bucket:e.Bucket,Region:e.Region,body:o,action:"delete",headers:i},function(e,n){if(e)return t(e);var r=n.DeleteResult||{},o=r.Deleted||[],i=r.Error||[];o=_e.isArray(o)?o:[o],i=_e.isArray(i)?i:[i];var a=_e.clone(r);_e.extend(a,{Error:i,Deleted:o,statusCode:n.statusCode,headers:n.headers}),t(null,a)})}function se(e,t){var n=e.Headers;if(!e.RestoreRequest)return void t(_e.error(new Error("missing param RestoreRequest")));var r=e.RestoreRequest||{},o=_e.json2xml({RestoreRequest:r});n["Content-Type"]="application/xml",n["Content-MD5"]=_e.binaryBase64(_e.md5(o)),Be.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:o,action:"restore",headers:n},t)}function ce(e,t){var n=e.Tagging||{},r=n.TagSet||n.Tags||e.Tags||[];r=_e.clone(_e.isArray(r)?r:[r]);var o=_e.json2xml({Tagging:{TagSet:{Tag:r}}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(o)),Be.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:o,action:"tagging",headers:i,VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function ue(e,t){Be.call(this,{Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var r={Tags:[],statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else{var o=[];try{o=n.Tagging.TagSet.Tag||[]}catch(e){}o=_e.clone(_e.isArray(o)?o:[o]),t(null,{Tags:o,statusCode:n.statusCode,headers:n.headers})}})}function le(e,t){Be.call(this,{Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function de(e,t){if(!e.SelectType)return t(_e.error(new Error("missing param SelectType")));var n=e.SelectRequest||{},r=_e.json2xml({SelectRequest:n}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=_e.binaryBase64(_e.md5(r)),Be.call(this,{Action:"name/cos:GetObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"select",qs:{"select-type":e.SelectType},VersionId:e.VersionId,body:r,DataType:"arraybuffer",rawBody:!0},function(e,n){if(e&&204===e.statusCode)return t(null,{statusCode:e.statusCode});if(e)return t(e);var r=_e.parseSelectPayload(n.body);t(null,{statusCode:n.statusCode,headers:n.headers,Body:r.body,Payload:r.payload})})}function fe(e,t){var n=this,r=e.Headers;r["Cache-Control"]||r["cache-control"]||(r["Cache-Control"]=""),r["Content-Type"]||r["content-type"]||(r["Content-Type"]=e.Body&&e.Body.type||""),_e.getBodyMd5(e.Body&&(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5),e.Body,function(r){r&&(e.Headers["x-cos-meta-md5"]=r),Be.call(n,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query},function(e,n){return e?t(e):(n=_e.clone(n||{}))&&n.InitiateMultipartUploadResult?t(null,_e.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n)})},e.onHashProgress)}function he(e,t){var n=this;_e.getFileSize("multipartUpload",e,function(){_e.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(r){r&&(e.Headers["Content-MD5"]=_e.binaryBase64(r)),Be.call(n,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null},function(e,n){if(e)return t(e);t(null,{ETag:_e.attr(n.headers,"etag",""),statusCode:n.statusCode,headers:n.headers})})})})}function pe(e,t){for(var n=this,r=e.UploadId,o=e.Parts,i=0,a=o.length;i-1?n.Authorization:"sign="+encodeURIComponent(n.Authorization)),n.SecurityToken&&(i+="&x-cos-security-token="+n.SecurityToken),n.ClientIP&&(i+="&clientIP="+n.ClientIP),n.ClientUA&&(i+="&clientUA="+n.ClientUA),n.Token&&(i+="&token="+n.Token),o&&(i+="&"+o),setTimeout(function(){t(null,{Url:i})})}});return a?(i+="?"+a.Authorization+(a.SecurityToken?"&x-cos-security-token="+a.SecurityToken:""),o&&(i+="&"+o)):o&&(i+="?"+o),i}function Se(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},r=e&&e.AccessControlList||{},o=r.Grant;o&&(o=_e.isArray(o)?o:[o]);var i={READ:0,WRITE:0,FULL_CONTROL:0};return o&&o.length&&_e.each(o,function(r){"qcs::cam::anyone:anyone"===r.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===r.Grantee.URI?i[r.Permission]=1:r.Grantee.ID!==e.Owner.ID&&t[n[r.Permission]].push('id="'+r.Grantee.ID+'"')}),i.FULL_CONTROL||i.WRITE&&i.READ?t.ACL="public-read-write":i.READ?t.ACL="public-read":t.ACL="private",_e.each(n,function(e){t[e]=Re(t[e].join(","))}),t}function Re(e){var t,n,r=e.split(","),o={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(o="{Bucket}."+o)),o=o.replace(/\{\{AppId\}\}/gi,r).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,i).replace(/\{\{.*?\}\}/gi,""),o=o.replace(/\{AppId\}/gi,r).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,i).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(o)||(o=s+"//"+o),"/"===o.slice(-1)&&(o=o.slice(0,-1));var c=o;return e.ForcePathStyle&&(c+="/"+t),c+="/",a&&(c+=_e.camSafeUrlEncode(a).replace(/%2F/g,"/")),e.isLocation&&(c=c.replace(/^https?:\/\//,"")),c}function Ae(e,t){var n=_e.clone(e.Headers);_e.each(n,function(e,t){(""===e||["content-type","cache-control","expires"].indexOf(t.toLowerCase())>-1)&&delete n[t]});var r=!1,o=function(e,n){r||(r=!0,n&&n.XCosSecurityToken&&!n.SecurityToken&&(n=_e.clone(n),n.SecurityToken=n.XCosSecurityToken,delete n.XCosSecurityToken),t&&t(e,n))},i=this,a=e.Bucket||"",s=e.Region||"",c=e.Key||"";i.options.ForcePathStyle&&a&&(c=a+"/"+c);var u="/"+c,l={},d=e.Scope;if(!d){var f=e.Action||"",h=e.ResourceKey||e.Key||"";d=e.Scope||[{action:f,bucket:a,region:s,prefix:h}]}var p=_e.md5(JSON.stringify(d));i._StsCache=i._StsCache||[],function(){var e,t;for(e=i._StsCache.length-1;e>=0;e--){t=i._StsCache[e];var n=Math.round(_e.getSkewTime(i.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n=t.ExpiredTime)i._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===p){l=t;break}}}();var g=function(){var t=l.StartTime&&l.ExpiredTime?l.StartTime+";"+l.ExpiredTime:"",r=_e.getAuth({SecretId:l.TmpSecretId,SecretKey:l.TmpSecretKey,Method:e.Method,Pathname:u,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:i.options.UseRawKey,SystemClockOffset:i.options.SystemClockOffset,KeyTime:t}),a={Authorization:r,SecurityToken:l.SecurityToken||l.XCosSecurityToken||"",Token:l.Token||"",ClientIP:l.ClientIP||"",ClientUA:l.ClientUA||""};o(null,a)},m=function(e){if(e.Authorization){var t=!1,n=e.Authorization;if(n)if(n.indexOf(" ")>-1)t=!1;else if(n.indexOf("q-sign-algorithm=")>-1&&n.indexOf("q-ak=")>-1&&n.indexOf("q-sign-time=")>-1&&n.indexOf("q-key-time=")>-1&&n.indexOf("q-url-param-list=")>-1)t=!0;else try{n=atob(n),n.indexOf("a=")>-1&&n.indexOf("k=")>-1&&n.indexOf("t=")>-1&&n.indexOf("r=")>-1&&n.indexOf("b=")>-1&&(t=!0)}catch(e){}if(!t)return _e.error(new Error("getAuthorization callback params format error"))}else{if(!e.TmpSecretId)return _e.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!e.TmpSecretKey)return _e.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!e.SecurityToken&&!e.XCosSecurityToken)return _e.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!e.ExpiredTime)return _e.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(e.ExpiredTime&&10!==e.ExpiredTime.toString().length)return _e.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(e.StartTime&&10!==e.StartTime.toString().length)return _e.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(l.ExpiredTime&&l.ExpiredTime-_e.getSkewTime(i.options.SystemClockOffset)/1e3>60)g();else if(i.options.getAuthorization)i.options.getAuthorization.call(i,{Bucket:a,Region:s,Method:e.Method,Key:c,Pathname:u,Query:e.Query,Headers:n,Scope:d,SystemClockOffset:i.options.SystemClockOffset},function(e){"string"==typeof e&&(e={Authorization:e});var t=m(e);if(t)return o(t);e.Authorization?o(null,e):(l=e||{},l.Scope=d,l.ScopeKey=p,i._StsCache.push(l),g())});else{if(!i.options.getSTS)return function(){var t=_e.getAuth({SecretId:e.SecretId||i.options.SecretId,SecretKey:e.SecretKey||i.options.SecretKey,Method:e.Method,Pathname:u,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:i.options.UseRawKey,SystemClockOffset:i.options.SystemClockOffset}),r={Authorization:t,SecurityToken:i.options.SecurityToken||i.options.XCosSecurityToken};return o(null,r),r}();i.options.getSTS.call(i,{Bucket:a,Region:s},function(e){l=e||{},l.Scope=d,l.ScopeKey=p,l.TmpSecretId||(l.TmpSecretId=l.SecretId),l.TmpSecretKey||(l.TmpSecretKey=l.SecretKey);var t=m(l);if(t)return o(t);i._StsCache.push(l),g()})}return""}function Te(e){var t=!1,n=!1,r=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var o=e.error.Code,i=e.error.Message;("RequestTimeTooSkewed"===o||"AccessDenied"===o&&"Request has expired"===i)&&(n=!0)}catch(e){}if(e)if(n&&r){var a=Date.parse(r);this.options.CorrectClockSkew&&Math.abs(_e.getSkewTime(this.options.SystemClockOffset)-a)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=a-Date.now(),t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0);return t}function Be(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=_e.clearKey(e.qs),e.headers&&(e.headers=_e.clearKey(e.headers)),e.qs&&(e.qs=_e.clearKey(e.qs));var r=_e.clone(e.qs);e.action&&(r[e.action]="");var o=function(i){var a=n.options.SystemClockOffset;Ae.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:r,Headers:e.headers,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope},function(r,s){if(r)return void t(r);e.AuthData=s,Ee.call(n,e,function(r,s){r&&i<2&&(a!==n.options.SystemClockOffset||Te.call(n,r))?(e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,delete e.headers["x-cos-security-token"]),o(i+1)):t(r,s)})})};o(1)}function Ee(e,t){var n=this,r=e.TaskId;if(!r||n._isRunningTask(r)){var o=e.Bucket,i=e.Region,a=e.Key,s=e.method||"GET",c=e.url,u=e.body,l=e.rawBody;n.options.UseAccelerate&&(i="accelerate"),c=c||be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:o,region:i,object:a}),e.action&&(c=c+"?"+e.action),e.qsStr&&(c=c.indexOf("?")>-1?c+"&"+e.qsStr:c+"?"+e.qsStr);var d={method:s,url:c,headers:e.headers,qs:e.qs,body:u};if(d.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(d.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(d.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(d.headers.clientUA=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(d.headers["x-cos-security-token"]=e.AuthData.SecurityToken),d.headers&&(d.headers=_e.clearKey(d.headers)),d=_e.clearKey(d),e.onProgress&&"function"==typeof e.onProgress){var f=u&&(u.size||u.length)||0;d.onProgress=function(t){if(!r||n._isRunningTask(r)){var o=t?t.loaded:0;e.onProgress({loaded:o,total:f})}}}e.onDownloadProgress&&(d.onDownloadProgress=e.onDownloadProgress),e.DataType&&(d.dataType=e.DataType),this.options.Timeout&&(d.timeout=this.options.Timeout),n.options.ForcePathStyle&&(d.pathStyle=n.options.ForcePathStyle),n.emit("before-send",d);var h=(n.options.Request||we)(d,function(e){if("abort"!==e.error){n.emit("after-receive",e);var o,i={statusCode:e.statusCode,statusMessage:e.statusMessage,headers:e.headers},a=e.error,s=e.body,c=function(e,a){if(r&&n.off("inner-kill-task",p),!o){o=!0;var s={};i&&i.statusCode&&(s.statusCode=i.statusCode),i&&i.headers&&(s.headers=i.headers),e?(e=_e.extend(e||{},s),t(e,null)):(a=_e.extend(a||{},s),t(null,a)),h=null}};if(a)return c(_e.error(a));var u=i.statusCode,d=2===Math.floor(u/100);if(l&&d)return c(null,{body:s});var f;try{f=s&&s.indexOf("<")>-1&&s.indexOf(">")>-1&&_e.xml2json(s)||{}}catch(e){f={}}var g=f&&f.Error;d?c(null,f):g?c(_e.error(new Error(g.Message),{code:g.Code,error:g})):u?c(_e.error(new Error(i.statusMessage),{code:""+u})):u&&c(_e.error(new Error("statusCode error")))}}),p=function(e){e.TaskId===r&&(h&&h.abort&&h.abort(),n.off("inner-kill-task",p))};r&&n.on("inner-kill-task",p)}}function xe(e,t,n){_e.each(["Cors","Acl"],function(r){if(e.slice(-r.length)===r){var o=e.slice(0,-r.length)+r.toUpperCase(),i=_e.apiWrapper(e,t),a=!1;n[o]=function(){!a&&console.warn("warning: cos."+o+" has been deprecated. Please Use cos."+e+" instead."),a=!0,i.apply(this,arguments)}}})}var we=n(17),_e=n(0),Ie={getService:r,putBucket:o,headBucket:i,getBucket:a,deleteBucket:s,putBucketAcl:c,getBucketAcl:u,putBucketCors:l,getBucketCors:d,deleteBucketCors:f,getBucketLocation:h,getBucketPolicy:g,putBucketPolicy:p,deleteBucketPolicy:m,putBucketTagging:y,getBucketTagging:C,deleteBucketTagging:v,putBucketLifecycle:k,getBucketLifecycle:S,deleteBucketLifecycle:R,putBucketVersioning:b,getBucketVersioning:A,putBucketReplication:T,getBucketReplication:B,deleteBucketReplication:E,putBucketWebsite:x,getBucketWebsite:w,deleteBucketWebsite:_,putBucketReferer:I,getBucketReferer:D,putBucketDomain:O,getBucketDomain:N,deleteBucketDomain:P,putBucketOrigin:M,getBucketOrigin:U,deleteBucketOrigin:H,putBucketLogging:L,getBucketLogging:F,putBucketInventory:K,getBucketInventory:j,listBucketInventory:z,deleteBucketInventory:q,putBucketAccelerate:G,getBucketAccelerate:V,putBucketEncryption:X,getBucketEncryption:W,deleteBucketEncryption:Q,getObject:Y,headObject:$,listObjectVersions:J,putObject:Z,deleteObject:ee,getObjectAcl:te,putObjectAcl:ne,optionsObject:re,putObjectCopy:oe,deleteMultipleObject:ae,restoreObject:se,putObjectTagging:ce,getObjectTagging:ue,deleteObjectTagging:le,selectObjectContent:de,uploadPartCopy:ie,multipartInit:fe,multipartUpload:he,multipartComplete:pe,multipartList:ge,multipartListPart:me,multipartAbort:ye,request:Ce,getObjectUrl:ke,getAuth:ve};e.exports.init=function(e,t){t.transferToTaskMethod(Ie,"putObject"),_e.each(Ie,function(t,n){e.prototype[n]=_e.apiWrapper(n,t),xe(n,t,e.prototype)})}},function(e,t){var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},r=function(e,t,r,o){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(o){var i=encodeURIComponent(n(o))+r;return Array.isArray(e[o])?e[o].map(function(e){return i+encodeURIComponent(n(e))}).join(t):i+encodeURIComponent(n(e[o]))}).filter(Boolean).join(t):o?encodeURIComponent(n(o))+r+encodeURIComponent(n(e)):""},o=function(e,t,n){var r={};return t.getAllResponseHeaders().trim().split("\n").forEach(function(e){if(e){var t=e.indexOf(":"),n=e.substr(0,t).trim().toLowerCase(),o=e.substr(t+1).trim();r[n]=o}}),{error:e,statusCode:t.status,statusMessage:t.statusText,headers:r,body:n}},i=function(e,t){return t||"text"!==t?e.response:e.responseText},a=function(e,t){var n=(e.method||"GET").toUpperCase(),a=e.url;if(e.qs){var s=r(e.qs);s&&(a+=(-1===a.indexOf("?")?"?":"&")+s)}var c=new XMLHttpRequest;c.open(n,a,!0),c.responseType=e.dataType||"text";var u=e.headers;if(u)for(var l in u)u.hasOwnProperty(l)&&"content-length"!==l.toLowerCase()&&"user-agent"!==l.toLowerCase()&&"origin"!==l.toLowerCase()&&"host"!==l.toLowerCase()&&c.setRequestHeader(l,u[l]);return e.onProgress&&c.upload&&(c.upload.onprogress=e.onProgress),e.onDownloadProgress&&(c.onprogress=e.onDownloadProgress),c.onload=function(){t(o(null,c,i(c,e.dataType)))},c.onerror=function(n){var r=i(c,e.dataType);if(r)t(o(null,c,r));else{var a=c.statusText;a||0!==c.status||(a=new Error("CORS blocked or network error")),t(o(a,c,r))}},c.send(e.body||""),c};e.exports=a},function(e,t,n){function r(e,t){var n,r,i=this,a=new y,c=e.TaskId,l=e.Bucket,d=e.Region,f=e.Key,h=e.Body,p=e.ChunkSize||e.SliceSize||i.options.ChunkSize,m=e.AsyncLimit,v=e.StorageClass,k=e.ServerSideEncryption,S=e.onHashProgress;a.on("error",function(e){if(i._isRunningTask(c))return t(e)}),a.on("upload_complete",function(e){t(null,e)}),a.on("upload_slice_complete",function(t){var o={};C.each(e.Headers,function(e,t){var n=t.toLowerCase();0!==n.indexOf("x-cos-meta-")&&"pic-operations"!==n||(o[t]=e)}),u.call(i,{Bucket:l,Region:d,Key:f,UploadId:t.UploadId,SliceList:t.SliceList,Headers:o},function(e,o){if(i._isRunningTask(c)){if(g.removeUsing(t.UploadId),e)return r(null,!0),a.emit("error",e);g.removeUploadId.call(i,t.UploadId),r({loaded:n,total:n},!0),a.emit("upload_complete",o)}})}),a.on("get_upload_data_finish",function(t){var o=g.getFileId(h,e.ChunkSize,l,f);o&&g.saveUploadId.call(i,o,t.UploadId,i.options.UploadIdCacheLimit),g.setUsing(t.UploadId),r(null,!0),s.call(i,{TaskId:c,Bucket:l,Region:d,Key:f,Body:h,FileSize:n,SliceSize:p,AsyncLimit:m,ServerSideEncryption:k,UploadData:t,onProgress:r},function(e,t){if(i._isRunningTask(c))return e?(r(null,!0),a.emit("error",e)):void a.emit("upload_slice_complete",t)})}),a.on("get_file_size_finish",function(){if(r=C.throttleOnProgress.call(i,n,e.onProgress),e.UploadData.UploadId)a.emit("get_upload_data_finish",e.UploadData);else{var t=C.extend({TaskId:c,Bucket:l,Region:d,Key:f,Headers:e.Headers,StorageClass:v,Body:h,FileSize:n,SliceSize:p,onHashProgress:S},e);o.call(i,t,function(t,n){if(i._isRunningTask(c)){if(t)return a.emit("error",t);e.UploadData.UploadId=n.UploadId,e.UploadData.PartList=n.PartList,a.emit("get_upload_data_finish",e.UploadData)}})}}),n=e.ContentLength,delete e.ContentLength,!e.Headers&&(e.Headers={}),C.each(e.Headers,function(t,n){"content-length"===n.toLowerCase()&&delete e.Headers[n]}),function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],r=1048576,o=0;oh)return t(null,!1);if(n>1){if(Math.max(e[0].Size,e[1].Size)!==f)return t(null,!1)}var r=function(o){if(o=c.length)return void b.emit("has_and_check_upload_id",t);var i=c[e];return C.isInArray(t,i)?g.using[i]?void l(e+1):void a.call(u,{Bucket:r,Region:o,Key:s,UploadId:i},function(t,r){u._isRunningTask(n)&&(t?(g.removeUploadId.call(u,i),l(e+1)):b.emit("upload_id_available",{UploadId:i,PartList:r.PartList}))}):(g.removeUploadId.call(u,i),void l(e+1))};l(0)}),b.on("get_remote_upload_id_list",function(){i.call(u,{Bucket:r,Region:o,Key:s},function(t,o){if(u._isRunningTask(n)){if(t)return b.emit("error",t);var i=C.filter(o.UploadList,function(e){return e.Key===s&&(!c||e.StorageClass.toUpperCase()===c.toUpperCase())}).reverse().map(function(e){return e.UploadId||e.UploadID});if(i.length)b.emit("seek_local_avail_upload_id",i);else{var a,l=g.getFileId(e.Body,e.ChunkSize,r,s);l&&(a=g.getUploadIdList.call(u,l))&&C.each(a,function(e){g.removeUploadId.call(u,e)}),b.emit("no_available_upload_id")}}})}),b.emit("get_remote_upload_id_list")}function i(e,t){var n=this,r=[],o={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key},i=function(){n.multipartList(o,function(e,n){if(e)return t(e);r.push.apply(r,n.Upload||[]),"true"===n.IsTruncated?(o.KeyMarker=n.NextKeyMarker,o.UploadIdMarker=n.NextUploadIdMarker,i()):t(null,{UploadList:r})})};i()}function a(e,t){var n=this,r=[],o={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId},i=function(){n.multipartListPart(o,function(e,n){if(e)return t(e);r.push.apply(r,n.Part||[]),"true"===n.IsTruncated?(o.PartNumberMarker=n.NextPartNumberMarker,i()):t(null,{PartList:r})})};i()}function s(e,t){var n=this,r=e.TaskId,o=e.Bucket,i=e.Region,a=e.Key,s=e.UploadData,u=e.FileSize,l=e.SliceSize,d=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),f=e.Body,h=Math.ceil(u/l),p=0,g=e.ServerSideEncryption,y=C.filter(s.PartList,function(e){return e.Uploaded&&(p+=e.PartNumber>=h?u%l||l:l),!e.Uploaded}),v=e.onProgress;m.eachLimit(y,d,function(e,t){if(n._isRunningTask(r)){var d=e.PartNumber,h=Math.min(u,e.PartNumber*l)-(e.PartNumber-1)*l,m=0;c.call(n,{TaskId:r,Bucket:o,Region:i,Key:a,SliceSize:l,FileSize:u,PartNumber:d,ServerSideEncryption:g,Body:f,UploadData:s,onProgress:function(e){p+=e.loaded-m,m=e.loaded,v({loaded:p,total:u})}},function(o,i){n._isRunningTask(r)&&(o||i.ETag||(o='get ETag error, please add "ETag" to CORS ExposeHeader setting.'),o?p-=m:(p+=h-m,e.ETag=i.ETag),v({loaded:p,total:u}),t(o||null,i))})}},function(e){if(n._isRunningTask(r))return e?t(e):void t(null,{UploadId:s.UploadId,SliceList:s.PartList})})}function c(e,t){var n=this,r=e.TaskId,o=e.Bucket,i=e.Region,a=e.Key,s=e.FileSize,c=e.Body,u=1*e.PartNumber,l=e.SliceSize,d=e.ServerSideEncryption,f=e.UploadData,h=n.options.ChunkRetryTimes+1,p=l*(u-1),g=l,y=p+l;y>s&&(y=s,g=y-p);var v=f.PartList[u-1];m.retry(h,function(t){n._isRunningTask(r)&&C.fileSlice(c,p,y,!0,function(s){n.multipartUpload({TaskId:r,Bucket:o,Region:i,Key:a,ContentLength:g,PartNumber:u,UploadId:f.UploadId,ServerSideEncryption:d,Body:s,onProgress:e.onProgress},function(e,o){if(n._isRunningTask(r))return e?t(e):(v.Uploaded=!0,t(null,o))})})},function(e,o){if(n._isRunningTask(r))return t(e,o)})}function u(e,t){var n=e.Bucket,r=e.Region,o=e.Key,i=e.UploadId,a=e.SliceList,s=this,c=this.options.ChunkRetryTimes+1,u=e.Headers,l=a.map(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});m.retry(c,function(e){s.multipartComplete({Bucket:n,Region:r,Key:o,UploadId:i,Parts:l,Headers:u},e)},function(e,n){t(e,n)})}function l(e,t){var n=e.Bucket,r=e.Region,o=e.Key,a=e.UploadId,s=e.Level||"task",c=e.AsyncLimit,u=this,l=new y;if(l.on("error",function(e){return t(e)}),l.on("get_abort_array",function(i){d.call(u,{Bucket:n,Region:r,Key:o,Headers:e.Headers,AsyncLimit:c,AbortArray:i},t)}),"bucket"===s)i.call(u,{Bucket:n,Region:r},function(e,n){if(e)return t(e);l.emit("get_abort_array",n.UploadList||[])});else if("file"===s){if(!o)return t(C.error(new Error("abort_upload_task_no_key")));i.call(u,{Bucket:n,Region:r,Key:o},function(e,n){if(e)return t(e);l.emit("get_abort_array",n.UploadList||[])})}else{if("task"!==s)return t(C.error(new Error("abort_unknown_level")));if(!a)return t(C.error(new Error("abort_upload_task_no_id")));if(!o)return t(C.error(new Error("abort_upload_task_no_key")));l.emit("get_abort_array",[{Key:o,UploadId:a}])}}function d(e,t){var n=e.Bucket,r=e.Region,o=e.Key,i=e.AbortArray,a=e.AsyncLimit||1,s=this,c=0,u=new Array(i.length);m.eachLimit(i,a,function(t,i){var a=c;if(o&&o!==t.Key)return u[a]={error:{KeyNotMatch:!0}},void i(null);var l=t.UploadId||t.UploadID;s.multipartAbort({Bucket:n,Region:r,Key:t.Key,Headers:e.Headers,UploadId:l},function(e){var o={Bucket:n,Region:r,Key:t.Key,UploadId:l};u[a]={error:e,task:o},i(null)}),c++},function(e){if(e)return t(e);for(var n=[],r=[],o=0,i=u.length;or?"sliceUploadFile":"putObject";d.push({api:v,params:e,callback:y})}()}),n._addTasks(d)}function h(e,t){var n=new y,r=this,o=e.Bucket,i=e.Region,a=e.Key,s=e.CopySource,c=s.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^/]+\/(.+)$/);if(!c)return void t(C.error(new Error("CopySource format error")));var u=c[1],l=c[3],d=decodeURIComponent(c[4]),f=void 0===e.CopySliceSize?r.options.CopySliceSize:e.CopySliceSize;f=Math.max(0,f);var h,g,v=e.CopyChunkSize||this.options.CopyChunkSize,k=this.options.CopyChunkParallelLimit,S=0;n.on("copy_slice_complete",function(n){var s={};C.each(e.Headers,function(e,t){0===t.toLowerCase().indexOf("x-cos-meta-")&&(s[t]=e)});var c=C.map(n.PartList,function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});r.multipartComplete({Bucket:o,Region:i,Key:a,UploadId:n.UploadId,Parts:c},function(e,n){if(e)return g(null,!0),t(e);g({loaded:h,total:h},!0),t(null,n)})}),n.on("get_copy_data_finish",function(e){m.eachLimit(e.PartList,k,function(t,n){var c=t.PartNumber,u=t.CopySourceRange,l=t.end-t.start;p.call(r,{Bucket:o,Region:i,Key:a,CopySource:s,UploadId:e.UploadId,PartNumber:c,CopySourceRange:u},function(e,r){if(e)return n(e);S+=l,g({loaded:S,total:h}),t.ETag=r.ETag,n(e||null,r)})},function(r){if(r)return g(null,!0),t(r);n.emit("copy_slice_complete",e)})}),n.on("get_file_size_finish",function(s){!function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],n=1048576,o=0;o"x-cos-meta-".length&&(s[t]=e)}),n.emit("get_file_size_finish",s)}})}function p(e,t){var n=e.TaskId,r=e.Bucket,o=e.Region,i=e.Key,a=e.CopySource,s=e.UploadId,c=1*e.PartNumber,u=e.CopySourceRange,l=this.options.ChunkRetryTimes+1,d=this;m.retry(l,function(e){d.uploadPartCopy({TaskId:n,Bucket:r,Region:o,Key:i,CopySource:a,UploadId:s,PartNumber:c,CopySourceRange:u},function(t,n){e(t||null,n)})},function(e,n){return t(e,n)})}var g=n(3),m=n(19),y=n(2).EventProxy,C=n(0),v={sliceUploadFile:r,abortUploadTask:l,uploadFiles:f,sliceCopyFile:h};e.exports.init=function(e,t){t.transferToTaskMethod(v,"sliceUploadFile"),C.each(v,function(t,n){e.prototype[n]=C.apiWrapper(n,t)})}},function(e,t){var n=function(e,t,n,r){if(r=r||function(){},!e.length||t<=0)return r();var o=0,i=0,a=0;!function s(){if(o>=e.length)return r();for(;a=e.length?r():s())})}()},r=function(e,t,n){var r=function(o){t(function(t,i){t&&ot?1:-1})},f=function(e){var t,n,o,i=[],a=d(e);for(t=0;tparseInt(t[n])?1:-1;return 0};return function(t){var n=(t.match(/Chrome\/([.\d]+)/)||[])[1],r=(t.match(/QBCore\/([.\d]+)/)||[])[1],o=(t.match(/QQBrowser\/([.\d]+)/)||[])[1];return n&&e(n,"53.0.2785.116")<0&&r&&e(r,"3.53.991.400")<0&&o&&e(o,"9.0.2524.400")<=0||!1}(navigator&&navigator.userAgent)}(),T=function(e,t,n,r,o){var i;if(e.slice?i=e.slice(t,n):e.mozSlice?i=e.mozSlice(t,n):e.webkitSlice&&(i=e.webkitSlice(t,n)),r&&A){var a=new FileReader;a.onload=function(e){i=null,o(new Blob([a.result]))},a.readAsArrayBuffer(i)}else o(i)},B=function(e,t,n,r){n=n||S,e?"string"==typeof t?n(U.md5(t,!0)):Blob&&t instanceof Blob?U.getFileMd5(t,function(e,t){n(t)},r):n():n()},E=function(e,t,n){var r=e.size,o=0,i=h.getCtx(),a=function(s){if(s>=r){var c=i.digest("hex");return void t(null,c)}var u=Math.min(r,s+1048576);U.fileSlice(e,s,u,!1,function(e){b(e,function(t){e=null,i=i.update(t,!0),o+=t.length,t=null,n&&n({loaded:o,total:r,percent:Math.round(o/r*1e4)/1e4}),a(s+1048576)})})};a(0)},x=function(e){var t,n,r,o="";for(t=0,n=e.length/2;t-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(!n)return"Bucket";if(!r)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e){if(!n)return"Bucket";if(!r)return"Region";if(!o)return"Key"}return!1},I=function(e,t){if(t=a({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var n=t.Headers||{};if(t&&"object"==typeof t){!function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(n[e]=t[e])}();var r={"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-traffic-limit":"TrafficLimit","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext"};U.each(r,function(e,r){void 0!==t[e]&&(n[r]=t[e])}),t.Headers=R(n)}}return t},D=function(e,t){return function(n,r){var o=this;"function"==typeof n&&(r=n,n={}),n=I(e,n);var i=function(e){return e&&e.headers&&(e.headers["x-cos-request-id"]&&(e.RequestId=e.headers["x-cos-request-id"]),e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},a=function(e,t){r&&r(i(e),i(t))},s=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=_(e,n);if(t)return"missing param "+t;if(n.Region){if(n.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(n.Region))return"Region format error.";o.options.CompatibilityMode||-1!==n.Region.indexOf("-")||"yfb"===n.Region||"default"===n.Region||"accelerate"===n.Region||console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(n.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(n.Bucket))if(n.AppId)n.Bucket=n.Bucket+"-"+n.AppId;else{if(!o.options.AppId)return'Bucket should format as "test-1250000000".';n.Bucket=n.Bucket+"-"+o.options.AppId}n.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete n.AppId)}!o.options.UseRawKey&&n.Key&&"/"===n.Key.substr(0,1)&&(n.Key=n.Key.substr(1))}}(),c="getAuth"===e||"getObjectUrl"===e;if(Promise&&!c&&!r)return new Promise(function(e,i){if(r=function(t,n){t?i(t):e(n)},s)return a(U.error(new Error(s)));t.call(o,n,a)});if(s)return a(U.error(new Error(s)));var u=t.call(o,n,a);return c?u:void 0}},O=function(e,t){function n(){if(o=0,t&&"function"==typeof t){r=Date.now();var n,i=Math.max(0,Math.round((s-a)/((r-c)/1e3)*100)/100)||0;n=0===s&&0===e?1:Math.floor(s/e*100)/100||0,c=r,a=s;try{t({loaded:s,total:e,speed:i,percent:n})}catch(e){}}}var r,o,i=this,a=0,s=0,c=Date.now();return function(t,r){if(t&&(s=t.loaded,e=t.total),r)clearTimeout(o),n();else{if(o)return;o=setTimeout(n,i.options.ProgressInterval)}}},N=function(e,t,n){var r;if("string"==typeof t.Body?t.Body=new Blob([t.Body],{type:"text/plain"}):t.Body instanceof ArrayBuffer&&(t.Body=new Blob([t.Body])),!t.Body||!(t.Body instanceof Blob||"[object File]"===t.Body.toString()||"[object Blob]"===t.Body.toString()))return void n(U.error(new Error("params body format error, Only allow File|Blob|String.")));r=t.Body.size,t.ContentLength=r,n(null,r)},P=function(e){return Date.now()+(e||0)},M=function(e,t){var n=e;return e.message=e.message||null,"string"==typeof t?(e.error=t,e.message=t):"object"==typeof t&&null!==t&&(a(e,t),(t.code||t.name)&&(e.code=t.code||t.name),t.message&&(e.message=t.message),t.stack&&(e.stack=t.stack)),"function"==typeof Object.defineProperty&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=t&&t.name||e.name||e.code||"Error",e.code||(e.code=e.name),e.error||(e.error=o(n)),e},U={noop:S,formatParams:I,apiWrapper:D,xml2json:g,json2xml:m,md5:h,clearKey:R,fileSlice:T,getBodyMd5:B,getFileMd5:E,binaryBase64:x,extend:a,isArray:s,isInArray:c,makeArray:u,each:l,map:d,filter:f,clone:o,attr:i,uuid:w,camSafeUrlEncode:r,throttleOnProgress:O,getFileSize:N,getSkewTime:P,error:M,getAuth:y,parseSelectPayload:k,isBrowser:!0};e.exports=U},function(e,t){function n(e,t){for(var n in e)t[n]=e[n]}function r(e,t){function r(){}var o=e.prototype;if(Object.create){var i=Object.create(t.prototype);o.__proto__=i}o instanceof t||(r.prototype=t.prototype,r=new r,n(o,r),e.prototype=o=r),o.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),o.constructor=e)}function o(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,oe[e]),this.message=oe[e],Error.captureStackTrace&&Error.captureStackTrace(this,o);return n.code=e,t&&(this.message=this.message+": "+t),n}function i(){}function a(e,t){this._node=e,this._refresh=t,s(this)}function s(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var r=e._refresh(e._node);K(e,"length",r.length),n(r,e),e._inc=t}}function c(){}function u(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function l(e,t,n,r){if(r?t[u(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var o=e.ownerDocument;o&&(r&&C(o,e,r),y(o,e,n))}}function d(e,t,n){var r=u(t,n);if(!(r>=0))throw o(ae,new Error(e.tagName+"@"+n));for(var i=t.length-1;r"==e&&">"||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function g(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(g(e,t))return!0}while(e=e.nextSibling)}function m(){}function y(e,t,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function C(e,t,n,r){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function v(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var o=t.firstChild,i=0;o;)r[i++]=o,o=o.nextSibling;r.length=i}}}function k(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,v(e.ownerDocument,e),t}function S(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===te){var o=t.firstChild;if(null==o)return t;var i=t.lastChild}else o=i=t;var a=n?n.previousSibling:e.lastChild;o.previousSibling=a,i.nextSibling=n,a?a.nextSibling=o:e.firstChild=o,null==n?e.lastChild=i:n.previousSibling=i;do{o.parentNode=e}while(o!==i&&(o=o.nextSibling));return v(e.ownerDocument||e,e),t.nodeType==te&&(t.firstChild=t.lastChild=null),t}function R(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t);var r=e.lastChild}var r=e.lastChild;return t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,v(e.ownerDocument,e,t),t}function b(){this._nsMap={}}function A(){}function T(){}function B(){}function E(){}function x(){}function w(){}function _(){}function I(){}function D(){}function O(){}function N(){}function P(){}function M(e,t){var n=[],r=9==this.nodeType?this.documentElement:this,o=r.prefix,i=r.namespaceURI;if(i&&null==o){var o=r.lookupPrefix(i);if(null==o)var a=[{namespace:i,prefix:null}]}return H(this,n,e,t,a),n.join("")}function U(e,t,n){var r=e.prefix||"",o=e.namespaceURI;if(!r&&!o)return!1;if("xml"===r&&"http://www.w3.org/XML/1998/namespace"===o||"http://www.w3.org/2000/xmlns/"==o)return!1;for(var i=n.length;i--;){var a=n[i];if(a.prefix==r)return a.namespace!=o}return!0}function H(e,t,n,r,o){if(r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case G:o||(o=[]);var i=(o.length,e.attributes),a=i.length,s=e.firstChild,c=e.tagName;n=z===e.namespaceURI||n,t.push("<",c);for(var u=0;u"),n&&/^script$/i.test(c))for(;s;)s.data?t.push(s.data):H(s,t,n,r,o),s=s.nextSibling;else for(;s;)H(s,t,n,r,o),s=s.nextSibling;t.push("")}else t.push("/>");return;case Z:case te:for(var s=e.firstChild;s;)H(s,t,n,r,o),s=s.nextSibling;return;case V:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,p),'"');case X:return t.push(e.data.replace(/[<&]/g,p));case W:return t.push("");case Y:return t.push("\x3c!--",e.data,"--\x3e");case ee:var g=e.publicId,m=e.systemId;if(t.push("');else if(m&&"."!=m)t.push(' SYSTEM "',m,'">');else{var y=e.internalSubset;y&&t.push(" [",y,"]"),t.push(">")}return;case J:return t.push("");case Q:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function L(e,t,n){var r;switch(t.nodeType){case G:r=t.cloneNode(!1),r.ownerDocument=e;case te:break;case V:n=!0}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var o=t.firstChild;o;)r.appendChild(L(e,o,n)),o=o.nextSibling;return r}function F(e,t,n){var r=new t.constructor;for(var o in t){var a=t[o];"object"!=typeof a&&a!=r[o]&&(r[o]=a)}switch(t.childNodes&&(r.childNodes=new i),r.ownerDocument=e,r.nodeType){case G:var s=t.attributes,u=r.attributes=new c,l=s.length;u._ownerElement=r;for(var d=0;d0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(n[r]==e)return r;t=t.nodeType==V?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==V?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},n(q,h),n(q,h.prototype),m.prototype={nodeName:"#document",nodeType:Z,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==te){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return null==this.documentElement&&e.nodeType==G&&(this.documentElement=e),S(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),k(this,e)},importNode:function(e,t){return L(this,e,t)},getElementById:function(e){var t=null;return g(this.documentElement,function(n){if(n.nodeType==G&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new b;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new i,(t.attributes=new c)._ownerElement=t,t},createDocumentFragment:function(){var e=new O;return e.ownerDocument=this,e.childNodes=new i,e},createTextNode:function(e){var t=new B;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new E;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new x;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new N;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new A;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new D;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new b,r=t.split(":"),o=n.attributes=new c;return n.childNodes=new i,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,o._ownerElement=n,n},createAttributeNS:function(e,t){var n=new A,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},r(m,h),b.prototype={nodeType:G,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===te?this.insertBefore(e,null):R(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new a(this,function(t){var n=[];return g(t,function(r){r===t||r.nodeType!=G||"*"!==e&&r.tagName!=e||n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new a(this,function(n){var r=[];return g(n,function(o){o===n||o.nodeType!==G||"*"!==e&&o.namespaceURI!==e||"*"!==t&&o.localName!=t||r.push(o)}),r})}},m.prototype.getElementsByTagName=b.prototype.getElementsByTagName,m.prototype.getElementsByTagNameNS=b.prototype.getElementsByTagNameNS,r(b,h),A.prototype.nodeType=V,r(A,h),T.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(oe[ie])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},r(T,h),B.prototype={nodeName:"#text",nodeType:X,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},r(B,T),E.prototype={nodeName:"#comment",nodeType:Y},r(E,T),x.prototype={nodeName:"#cdata-section",nodeType:W},r(x,T),w.prototype.nodeType=ee,r(w,h),_.prototype.nodeType=ne,r(_,h),I.prototype.nodeType=$,r(I,h),D.prototype.nodeType=Q,r(D,h),O.prototype.nodeName="#document-fragment",O.prototype.nodeType=te,r(O,h),N.prototype.nodeType=J,r(N,h),P.prototype.serializeToString=function(e,t,n){return M.call(e,t,n)},h.prototype.toString=M;try{Object.defineProperty&&(Object.defineProperty(a.prototype,"length",{get:function(){return s(this),this.$$length}}),Object.defineProperty(h.prototype,"textContent",{get:function(){return j(this)},set:function(e){switch(this.nodeType){case G:case te:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),K=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DOMImplementation=f,t.XMLSerializer=P},function(e,t){var n=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){"task-list-update"===e&&console.warn('warning: Event "'+e+'" has been deprecated. Please use "list-update" instead.'),n(e).push(t)},e.off=function(e,t){for(var r=n(e),o=r.length-1;o>=0;o--)t===r[o]&&r.splice(o,1)},e.emit=function(e,t){for(var r=n(e).map(function(e){return e}),o=0;o=0;n--){var o=r[n][2];(!o||o+2592e3=0;o--){var i=r[o];i[0]===e&&i[1]===t&&r.splice(o,1)}r.unshift([e,t,Math.round(Date.now()/1e3)]),r.length>n&&r.splice(n),u()}},removeUploadId:function(e){c.call(this),delete l.using[e];for(var t=r.length-1;t>=0;t--)r[t][1]===e&&r.splice(t,1);u()}};e.exports=l},function(e,t,n){var r=n(5);e.exports=r},function(e,t,n){"use strict";var r=n(0),o=n(2),i=n(15),a=n(16),s=n(18),c={AppId:"",SecretId:"",SecretKey:"",SecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,UseRawKey:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadQueueSize:1e4,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1},u=function(e){this.options=r.extend(r.clone(c),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),o.init(this),i.init(this)};a.init(u,i),s.init(u,i),u.getAuthorization=r.getAuth,u.version="1.2.10",e.exports=u},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(9),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t,n){return new Md5(!0).update(t,n)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.getCtx=e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t>6,s[r++]=128|63&n):n<55296||n>=57344?(s[r++]=224|n>>12,s[r++]=128|n>>6&63,s[r++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),s[r++]=240|n>>18,s[r++]=128|n>>12&63,s[r++]=128|n>>6&63,s[r++]=128|63&n);else for(r=this.start;o>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(a[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=64?(this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,r,o,i,a=this.blocks;this.first?(e=a[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,r=(-1732584194^2004318071&e)+a[1]-117830708,r=(r<<12|r>>>20)+e<<0,n=(-271733879^r&(-271733879^e))+a[2]-1126478375,n=(n<<17|n>>>15)+r<<0,t=(e^n&(r^e))+a[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,r=this.h3,e+=(r^t&(n^r))+a[0]-680876936,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+a[1]-389564586,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+a[2]+606105819,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+a[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(r^t&(n^r))+a[4]-176418897,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+a[5]+1200080426,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+a[6]-1473231341,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+a[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+a[8]+1770035416,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+a[9]-1958414417,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+a[10]-42063,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+a[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+a[12]+1804603682,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+a[13]-40341101,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+a[14]-1502002290,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+a[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^r&(t^n))+a[1]-165796510,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+a[6]-1069501632,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+a[11]+643717713,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+a[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+a[5]-701558691,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+a[10]+38016083,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+a[15]-660478335,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+a[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+a[9]+568446438,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+a[14]-1019803690,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+a[3]-187363961,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+a[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+a[13]-1444681467,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+a[2]-51403784,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+a[7]+1735328473,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+a[12]-1926607734,t=(t<<20|t>>>12)+n<<0,o=t^n,e+=(o^r)+a[5]-378558,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+a[8]-2022574463,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+a[11]+1839030562,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+a[14]-35309556,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+a[1]-1530992060,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+a[4]+1272893353,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+a[7]-155497632,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+a[10]-1094730640,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+a[13]+681279174,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+a[0]-358537222,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+a[3]-722521979,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+a[6]+76029189,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+a[9]-640364487,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+a[12]-421815835,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+a[15]+530742520,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+a[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~r))+a[0]-198630844,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+a[7]+1126891415,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+a[14]-1416354905,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+a[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+a[12]+1700485571,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+a[3]-1894986606,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+a[10]-1051523,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+a[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+a[8]+1873313359,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+a[15]-30611744,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+a[6]-1560198380,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+a[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+a[4]-145523070,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+a[11]-1120210379,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+a[2]+718787259,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+a[9]-343485551,t=(t<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=r+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(e){if("hex"===e)return this.hex();this.finalize();var t=this.h0,n=this.h1,r=this.h2,o=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,r="",o=this.array(),i=0;i<15;)e=o[i++],t=o[i++],n=o[i++],r+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=o[i],r+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}()}).call(exports,__webpack_require__(7),__webpack_require__(8))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function a(){g&&h&&(g=!1,h.length?p=h.concat(p):m=-1,p.length&&s())}function s(){if(!g){var e=o(a);g=!0;for(var t=p.length;t;){for(h=p,p=[];++m1)for(var n=1;n>>2]|=(n[o>>>2]>>>24-o%4*8&255)<<24-(r+o)%4*8;else if(65535>>2]=n[o>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r>>2]>>>24-r%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new a.init(n,t/2)}},u=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new a.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,o=n.sigBytes,i=this.blockSize,s=o/(4*i),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*i,o=e.min(4*t,o),t){for(var c=0;cu;u++){if(16>u)i[u]=0|e[t+u];else{var l=i[u-3]^i[u-8]^i[u-14]^i[u-16];i[u]=l<<1|l>>>31}l=(r<<5|r>>>27)+c+i[u],l=20>u?l+(1518500249+(o&a|~o&s)):40>u?l+(1859775393+(o^a^s)):60>u?l+((o&a|o&s|a&s)-1894007588):l+((o^a^s)-899497514),c=s,s=a,a=o<<30|o>>>2,o=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=o._createHelper(t),e.HmacSHA1=o._createHmacHelper(t)}(),function(){var e=r,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,o=4*r;n.sigBytes>o&&(n=e.finalize(n)),n.clamp();for(var i=this._oKey=n.clone(),a=this._iKey=n.clone(),s=i.words,c=a.words,u=0;u>>2]>>>24-i%4*8&255,s=t[i+1>>>2]>>>24-(i+1)%4*8&255,c=t[i+2>>>2]>>>24-(i+2)%4*8&255,u=a<<16|s<<8|c,l=0;l<4&&i+.75*l>>6*(3-l)&63));var d=r.charAt(64);if(d)for(;o.length%4;)o.push(d);return o.join("")},parse:function(e){var t=e.length,r=this._map,o=r.charAt(64);if(o){var i=e.indexOf(o);-1!=i&&(t=i)}for(var a=[],s=0,c=0;c>>6-c%4*2;a[s>>>2]|=(u|l)<<24-s%4*8,s++}return n.create(a,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.exports=r},function(e,t,n){var r=n(12).DOMParser,o=function(){this.version="1.3.5";var e={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},t=new RegExp(/(?!xmlns)^.*:/);new RegExp(/^\s+|\s+$/g);return this.grokType=function(e){return/^\s*$/.test(e)?null:/^(?:true|false)$/i.test(e)?"true"===e.toLowerCase():isFinite(e)?parseFloat(e):e},this.parseString=function(e,t){if(e){var n=this.stringToXML(e);return n.getElementsByTagName("parsererror").length?null:this.parseXML(n,t)}return null},this.parseXML=function(n,r){for(var i in r)e[i]=r[i];var a={},s=0,c="";if(n.childNodes.length)for(var u,l,d,f=0;f=t+n||t?new java.lang.String(e,t,n)+"":e}function u(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}r.prototype.parseFromString=function(e,t){var n=this.options,r=new l,a=n.domBuilder||new i,s=n.errorHandler,c=n.locator,u=n.xmlns||{},d={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return c&&a.setDocumentLocator(c),r.errorHandler=o(s,a,c),r.domBuilder=n.domBuilder||a,/\/x?html?$/.test(t)&&(d.nbsp="\xa0",d.copy="\xa9",u[""]="http://www.w3.org/1999/xhtml"),u.xml=u.xml||"http://www.w3.org/XML/1998/namespace",e?r.parse(e,u,d):r.errorHandler.error("invalid doc source"),a.doc},i.prototype={startDocument:function(){this.doc=(new d).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var o=this.doc,i=o.createElementNS(e,n||t),s=r.length;u(this,i),this.currentElement=i,this.locator&&a(this.locator,i);for(var c=0;c65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function p(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?h(parseInt(t.substr(1).replace("x","0x"))):(u.error("entity not found:"+e),e)}function g(t){if(t>b){var n=e.substring(b,t).replace(/&#?\w+;/g,p);k&&m(b),r.characters(n,0,t-b),b=t}}function m(t,n){for(;t>=C&&(n=v.exec(e));)y=n.index,C=y+n[0].length,k.lineNumber++;k.columnNumber=t-y+1}for(var y=0,C=0,v=/.*(?:\r\n?|\n)|.*$/g,k=r.locator,S=[{currentNSMap:t}],R={},b=0;;){try{var A=e.indexOf("<",b);if(A<0){if(!e.substr(b).match(/^\s*$/)){var T=r.doc,B=T.createTextNode(e.substr(b));T.appendChild(B),r.currentElement=B}return}switch(A>b&&g(A),e.charAt(A+1)){case"/":var E=e.indexOf(">",A+3),x=e.substring(A+2,E),w=S.pop();E<0?(x=e.substring(A+2).replace(/[\s<].*/,""),u.error("end tag name: "+x+" is not complete:"+w.tagName),E=A+1+x.length):x.match(/\sb?b=E:g(Math.max(A,b)+1)}}function o(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function i(e,t,n,r,o,i){for(var a,s,c=++t,u=C;;){var l=e.charAt(c);switch(l){case"=":if(u===v)a=e.slice(t,c),u=S;else{if(u!==k)throw new Error("attribute equal must after attrName");u=S}break;case"'":case'"':if(u===S||u===v){if(u===v&&(i.warning('attribute value must after "="'),a=e.slice(t,c)),t=c+1,!((c=e.indexOf(l,t))>0))throw new Error("attribute value no end '"+l+"' match");s=e.slice(t,c).replace(/&#?\w+;/g,o),n.add(a,s,t-1),u=b}else{if(u!=R)throw new Error('attribute value must after "="');s=e.slice(t,c).replace(/&#?\w+;/g,o),n.add(a,s,t),i.warning('attribute "'+a+'" missed start quot('+l+")!!"),t=c+1,u=b}break;case"/":switch(u){case C:n.setTagName(e.slice(t,c));case b:case A:case T:u=T,n.closed=!0;case R:case v:case k:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),u==C&&n.setTagName(e.slice(t,c)),c;case">":switch(u){case C:n.setTagName(e.slice(t,c));case b:case A:case T:break;case R:case v:s=e.slice(t,c),"/"===s.slice(-1)&&(n.closed=!0,s=s.slice(0,-1));case k:u===k&&(s=a),u==R?(i.warning('attribute "'+s+'" missed quot(")!!'),n.add(a,s.replace(/&#?\w+;/g,o),t)):("http://www.w3.org/1999/xhtml"===r[""]&&s.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+s+'" missed value!! "'+s+'" instead!!'),n.add(s,s,t));break;case S:throw new Error("attribute value missed!!")}return c;case"\x80":l=" ";default:if(l<=" ")switch(u){case C:n.setTagName(e.slice(t,c)),u=A;break;case v:a=e.slice(t,c),u=k;break;case R:var s=e.slice(t,c).replace(/&#?\w+;/g,o);i.warning('attribute "'+s+'" missed quot(")!!'),n.add(a,s,t);case b:u=A}else switch(u){case k:n.tagName;"http://www.w3.org/1999/xhtml"===r[""]&&a.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),n.add(a,a,t),t=c,u=v;break;case b:i.warning('attribute space is required"'+a+'"!!');case A:u=v,t=c;break;case S:u=R,t=c;break;case T:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function a(e,t,n){for(var r=e.tagName,o=null,i=e.length;i--;){var a=e[i],s=a.qName,c=a.value,l=s.indexOf(":");if(l>0)var d=a.prefix=s.slice(0,l),f=s.slice(l+1),h="xmlns"===d&&f;else f=s,d=null,h="xmlns"===s&&"";a.localName=f,!1!==h&&(null==o&&(o={},u(n,n={})),n[h]=o[h]=c,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(h,c))}for(var i=e.length;i--;){a=e[i];var d=a.prefix;d&&("xml"===d&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==d&&(a.uri=n[d||""]))}var l=r.indexOf(":");l>0?(d=e.prefix=r.slice(0,l),f=e.localName=r.slice(l+1)):(d=null,f=e.localName=r);var p=e.uri=n[d||""];if(t.startElement(p,f,r,e),!e.closed)return e.currentNSMap=n,e.localNSMap=o,!0;if(t.endElement(p,f,r),o)for(d in o)t.endPrefixMapping(d)}function s(e,t,n,r,o){if(/^(?:script|textarea)$/i.test(n)){var i=e.indexOf("",t),a=e.substring(t+1,i);if(/[&<]/.test(a))return/^script$/i.test(n)?(o.characters(a,0,a.length),i):(a=a.replace(/&#?\w+;/g,r),o.characters(a,0,a.length),i)}return t+1}function c(e,t,n,r){var o=r[n];return null==o&&(o=e.lastIndexOf(""),ot?(n.comment(e,t+4,o-t-4),o+3):(r.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){var o=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,o-t-9),n.endCDATA(),o+3}var i=p(e,t),a=i.length;if(a>1&&/!doctype/i.test(i[0][0])){var s=i[1][0],c=a>3&&/^public$/i.test(i[2][0])&&i[3][0],u=a>4&&i[4][0],l=i[a-1];return n.startDTD(s,c&&c.replace(/^(['"])(.*?)\1$/,"$2"),u&&u.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),l.index+l[0].length}}return-1}function d(e,t,n){var r=e.indexOf("?>",t);if(r){var o=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(o){o[0].length;return n.processingInstruction(o[1],o[2]),r+2}return-1}return-1}function f(e){}function h(e,t){return e.__proto__=t,e}function p(e,t){var n,r=[],o=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(o.lastIndex=t,o.exec(e);n=o.exec(e);)if(r.push(n),n[1])return r}var g=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,m=new RegExp("[\\-\\.0-9"+g.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),y=new RegExp("^"+g.source+m.source+"*(?::"+g.source+m.source+"*)?$"),C=0,v=1,k=2,S=3,R=4,b=5,A=6,T=7;n.prototype={parse:function(e,t,n){var o=this.domBuilder;o.startDocument(),u(t,t={}),r(e,t,n,o,this.errorHandler),o.endDocument()}},f.prototype={setTagName:function(e){if(!y.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,n){if(!y.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},h({},h.prototype)instanceof h||(h=function(e,t){function n(){}n.prototype=t,n=new n;for(t in e)n[t]=e[t];return n}),t.XMLReader=n},function(e,t){function n(e){return(""+e).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(o,"")}var r=new RegExp("^([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd])|^((x|X)(m|M)(l|L))|([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd-.0-9\xb7\u0300-\u036f\u203f\u2040])","g"),o=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,i=function(e){var t=[];if(e instanceof Object)for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},a=function(e,t){var o=function(e,n,o,i,a){var s=void 0!==t.indent?t.indent:"\t",c=t.prettyPrint?"\n"+new Array(i).join(s):"";t.removeIllegalNameCharacters&&(e=e.replace(r,"_"));var u=[c,"<",e,o||""];return n&&n.length>0?(u.push(">"),u.push(n),a&&u.push(c),u.push("")):u.push("/>"),u.join("")};return function e(r,a,s){var c=typeof r;switch((Array.isArray?Array.isArray(r):r instanceof Array)?c="array":r instanceof Date&&(c="date"),c){case"array":var u=[];return r.map(function(t){u.push(e(t,1,s+1))}),t.prettyPrint&&u.push("\n"),u.join("");case"date":return r.toJSON?r.toJSON():r+"";case"object":var l=[];for(var d in r)if(r.hasOwnProperty(d))if(r[d]instanceof Array)for(var f=0;f0&&l.push("\n"),l.join("");case"function":return r();default:return t.escape?n(r):""+r}}(e,0,0)},s=function(e){var t=['"),t.join("")};e.exports=function(e,t){if(t||(t={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),"string"==typeof e)try{e=JSON.parse(e.toString())}catch(e){return!1}var n="",r="";return t&&("object"==typeof t?(t.xmlHeader&&(n=s(!!t.xmlHeader.standalone)),void 0!==t.docType&&(r="")):n=s()),t=t||{},[n,t.prettyPrint&&r?"\n":"",r,a(e,t)].join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")}},function(e,t,n){var r=n(3),o=n(0),i={},a=function(e,t){i[t]=e[t],e[t]=function(e,n){e.SkipTask?i[t].call(this,e,n):this._addTask(t,e,n)}},s=function(e){var t=[],n={},a=0,s=0,c=function(e){var t={id:e.id,Bucket:e.Bucket,Region:e.Region,Key:e.Key,FilePath:e.FilePath,state:e.state,loaded:e.loaded,size:e.size,speed:e.speed,percent:e.percent,hashPercent:e.hashPercent,error:e.error};return e.FilePath&&(t.FilePath=e.FilePath),e._custom&&(t._custom=e._custom),t},u=function(){var n,r=function(){n=0,e.emit("task-list-update",{list:o.map(t,c)}),e.emit("list-update",{list:o.map(t,c)})};return function(){n||(n=setTimeout(r))}}(),l=function(){if(!(t.length<=e.options.UploadQueueSize)){for(var r=0;re.options.UploadQueueSize;){var o="waiting"===t[r].state||"checking"===t[r].state||"uploading"===t[r].state;t[r]&&o?r++:(n[t[r].id]&&delete n[t[r].id],t.splice(r,1),s--)}u()}},d=function(){if(!(a>=e.options.FileParallelLimit)){for(;t[s]&&"waiting"!==t[s].state;)s++;if(!(s>=t.length)){var n=t[s];s++,a++,n.state="checking",n.params.onTaskStart&&n.params.onTaskStart(c(n)),!n.params.UploadData&&(n.params.UploadData={});var r=o.formatParams(n.api,n.params);i[n.api].call(e,r,function(t,r){e._isRunningTask(n.id)&&("checking"!==n.state&&"uploading"!==n.state||(n.state=t?"error":"success",t&&(n.error=t),a--,u(),d(),n.callback&&n.callback(t,r),"success"===n.state&&(n.params&&(delete n.params.UploadData,delete n.params.Body,delete n.params),delete n.callback)),l())}),u(),setTimeout(d)}}},f=function(t,o){var i=n[t];if(i){var s=i&&"waiting"===i.state,c=i&&("checking"===i.state||"uploading"===i.state);if("canceled"===o&&"canceled"!==i.state||"paused"===o&&s||"paused"===o&&c){if("paused"===o&&i.params.Body&&"function"==typeof i.params.Body.pipe)return void console.error("stream not support pause");i.state=o,e.emit("inner-kill-task",{TaskId:t,toState:o});try{var f=i&&i.params&&i.params.UploadData.UploadId}catch(e){}"canceled"===o&&f&&r.removeUsing(f),u(),c&&(a--,d()),"canceled"===o&&(i.params&&(delete i.params.UploadData,delete i.params.Body,delete i.params),delete i.callback)}l()}};e._addTasks=function(t){o.each(t,function(t){e._addTask(t.api,t.params,t.callback,!0)}),u()};var h=!0;e._addTask=function(r,i,a,s){i=o.formatParams(r,i);var c=o.uuid();i.TaskId=c,i.onTaskReady&&i.onTaskReady(c),i.TaskReady&&(i.TaskReady(c),h&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),h=!1);var f={params:i,callback:a,api:r,index:t.length,id:c,Bucket:i.Bucket,Region:i.Region,Key:i.Key,FilePath:i.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:i._custom},p=i.onHashProgress;i.onHashProgress=function(t){e._isRunningTask(f.id)&&(f.hashPercent=t.percent,p&&p(t),u())};var g=i.onProgress;return i.onProgress=function(t){e._isRunningTask(f.id)&&("checking"===f.state&&(f.state="uploading"),f.loaded=t.loaded,f.speed=t.speed,f.percent=t.percent,g&&g(t),u())},o.getFileSize(r,i,function(e,r){if(e)return a(o.error(e));n[c]=f,t.push(f),f.size=r,!s&&u(),d(),l()}),c},e._isRunningTask=function(e){var t=n[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return o.map(t,c)},e.cancelTask=function(e){f(e,"canceled")},e.pauseTask=function(e){f(e,"paused")},e.restartTask=function(e){var t=n[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",u(),s=Math.min(s,t.index),d())},e.isUploadRunning=function(){return a||s/gi,"<$1Rule>"),r=r.replace(/<(\/?)Tags>/gi,"<$1Tag>");var o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=_e.binaryBase64(_e.md5(r)),Be.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"replication",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function B(e,t){Be.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var r={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=_e.makeArray(n.ReplicationConfiguration.Rule),delete n.ReplicationConfiguration.Rule),t(e,n)})}function E(e,t){Be.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function x(e,t){if(!e.WebsiteConfiguration)return void t(_e.error(new Error("missing param WebsiteConfiguration")));var n=_e.clone(e.WebsiteConfiguration||{}),r=n.RoutingRules||n.RoutingRule||[];r=_e.isArray(r)?r:[r],delete n.RoutingRule,delete n.RoutingRules,r.length&&(n.RoutingRules={RoutingRule:r});var o=_e.json2xml({WebsiteConfiguration:n}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(o)),Be.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"website",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function w(e,t){Be.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var r={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else t(e);else{var o=n.WebsiteConfiguration||{};if(o.RoutingRules){var i=_e.clone(o.RoutingRules.RoutingRule||[]);i=_e.makeArray(i),o.RoutingRules=i}t(null,{WebsiteConfiguration:o,statusCode:n.statusCode,headers:n.headers})}})}function _(e,t){Be.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function I(e,t){if(!e.RefererConfiguration)return void t(_e.error(new Error("missing param RefererConfiguration")));var n=_e.clone(e.RefererConfiguration||{}),r=n.DomainList||{},o=r.Domains||r.Domain||[];o=_e.isArray(o)?o:[o],o.length&&(n.DomainList={Domain:o});var i=_e.json2xml({RefererConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=_e.binaryBase64(_e.md5(i)),Be.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"referer",headers:a},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function D(e,t){Be.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var r={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else t(e);else{var o=n.RefererConfiguration||{};if(o.DomainList){var i=_e.clone(o.DomainList.Domain||[]);i=_e.makeArray(i),o.DomainList={Domains:i}}t(null,{RefererConfiguration:o,statusCode:n.statusCode,headers:n.headers})}})}function O(e,t){var n=e.DomainConfiguration||{},r=n.DomainRule||e.DomainRule||[];r=_e.clone(r);var o=_e.json2xml({DomainConfiguration:{DomainRule:r}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(o)),Be.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"domain",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function N(e,t){Be.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){if(e)return t(e);var r=[];try{r=n.DomainConfiguration.DomainRule||[]}catch(e){}r=_e.clone(_e.isArray(r)?r:[r]),t(null,{DomainRule:r,statusCode:n.statusCode,headers:n.headers})})}function P(e,t){Be.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function M(e,t){var n=e.OriginConfiguration||{},r=n.OriginRule||e.OriginRule||[];r=_e.clone(r);var o=_e.json2xml({OriginConfiguration:{OriginRule:r}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(o)),Be.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"origin",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function U(e,t){Be.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){if(e)return t(e);var r=[];try{r=n.OriginConfiguration.OriginRule||[]}catch(e){}r=_e.clone(_e.isArray(r)?r:[r]),t(null,{OriginRule:r,statusCode:n.statusCode,headers:n.headers})})}function H(e,t){Be.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function L(e,t){var n=_e.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=_e.binaryBase64(_e.md5(n)),Be.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:r},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function F(e,t){Be.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging"},function(e,n){if(e)return t(e);t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})})}function K(e,t){var n=_e.clone(e.InventoryConfiguration);if(n.OptionalFields){var r=n.OptionalFields||[];n.OptionalFields={Field:r}}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var o=n.Destination.COSBucketDestination.Encryption;Object.keys(o).indexOf("SSECOS")>-1&&(o["SSE-COS"]=o.SSECOS,delete o.SSECOS)}var i=_e.json2xml({InventoryConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=_e.binaryBase64(_e.md5(i)),Be.call(this,{Action:"name/cos:PutBucketInventory",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"inventory",qs:{id:e.Id},headers:a},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function j(e,t){Be.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){if(e)return t(e);var r=n.InventoryConfiguration;if(r&&r.OptionalFields&&r.OptionalFields.Field){var o=r.OptionalFields.Field;_e.isArray(o)||(o=[o]),r.OptionalFields=o}if(r.Destination&&r.Destination.COSBucketDestination&&r.Destination.COSBucketDestination.Encryption){var i=r.Destination.COSBucketDestination.Encryption;Object.keys(i).indexOf("SSE-COS")>-1&&(i.SSECOS=i["SSE-COS"],delete i["SSE-COS"])}t(null,{InventoryConfiguration:r,statusCode:n.statusCode,headers:n.headers})})}function z(e,t){Be.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken}},function(e,n){if(e)return t(e);var r=n.ListInventoryConfigurationResult,o=r.InventoryConfiguration||[];o=_e.isArray(o)?o:[o],delete r.InventoryConfiguration,_e.each(o,function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;_e.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var n=e.Destination.COSBucketDestination.Encryption;Object.keys(n).indexOf("SSE-COS")>-1&&(n.SSECOS=n["SSE-COS"],delete n["SSE-COS"])}}),r.InventoryConfigurations=o,_e.extend(r,{statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function q(e,t){Be.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function G(e,t){if(!e.AccelerateConfiguration)return void t(_e.error(new Error("missing param AccelerateConfiguration")));var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},r=_e.json2xml(n),o={};o["Content-Type"]="application/xml",o["Content-MD5"]=_e.binaryBase64(_e.md5(r)),Be.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"accelerate",headers:o},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function V(e,t){Be.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate"},function(e,n){e||!n.AccelerateConfiguration&&(n.AccelerateConfiguration={}),t(e,n)})}function X(e,t){var n=e.ServerSideEncryptionConfiguration||{},r=n.Rule||n.Rules||[],o=_e.json2xml({ServerSideEncryptionConfiguration:{Rule:r}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(o)),Be.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"encryption",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function W(e,t){Be.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchEncryptionConfiguration"===e.code){var r={EncryptionConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else t(e);else{var o=_e.makeArray(n.EncryptionConfiguration&&n.EncryptionConfiguration.Rule||[]);n.EncryptionConfiguration={Rules:o},t(e,n)}})}function Q(e,t){Be.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function $(e,t){Be.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(n,r){if(n){var o=n.statusCode;return e.Headers["If-Modified-Since"]&&o&&304===o?t(null,{NotModified:!0,statusCode:o}):t(n)}r.ETag=_e.attr(r.headers,"etag",""),t(null,r)})}function J(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,Be.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions"},function(e,n){if(e)return t(e);var r=n.ListVersionsResult||{},o=r.DeleteMarker||[];o=_e.isArray(o)?o:[o];var i=r.Version||[];i=_e.isArray(i)?i:[i];var a=_e.clone(r);delete a.DeleteMarker,delete a.Version,_e.extend(a,{DeleteMarkers:o,Versions:i,statusCode:n.statusCode,headers:n.headers}),t(null,a)})}function Y(e,t){var n=e.Query||{},r=e.QueryString||"",o=_e.throttleOnProgress.call(this,0,e.onProgress);n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,Be.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,DataType:e.DataType,headers:e.Headers,qs:n,qsStr:r,rawBody:!0,onDownloadProgress:o},function(n,r){if(o(null,!0),n){var i=n.statusCode;return e.Headers["If-Modified-Since"]&&i&&304===i?t(null,{NotModified:!0}):t(n)}t(null,{Body:r.body,ETag:_e.attr(r.headers,"etag",""),statusCode:r.statusCode,headers:r.headers})})}function Z(e,t){var n=this,r=e.ContentLength,o=_e.throttleOnProgress.call(n,r,e.onProgress),i=e.Headers;i["Cache-Control"]||i["cache-control"]||(i["Cache-Control"]=""),i["Content-Type"]||i["content-type"]||(i["Content-Type"]=e.Body&&e.Body.type||"");var a=e.UploadAddMetaMd5||n.options.UploadAddMetaMd5||n.options.UploadCheckContentMd5;_e.getBodyMd5(a,e.Body,function(a){a&&(n.options.UploadCheckContentMd5&&(i["Content-MD5"]=_e.binaryBase64(a)),(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5)&&(i["x-cos-meta-md5"]=a)),void 0!==e.ContentLength&&(i["Content-Length"]=e.ContentLength),o(null,!0),Be.call(n,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:o},function(i,a){if(i)return o(null,!0),t(i);o({loaded:r,total:r},!0);var s=be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key});s=s.substr(s.indexOf("://")+3),a.Location=s,a.ETag=_e.attr(a.headers,"etag",""),t(null,a)})},e.onHashProgress)}function ee(e,t){Be.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId},function(e,n){if(e){var r=e.statusCode;return r&&404===r?t(null,{BucketNotFound:!0,statusCode:r}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})})}function te(e,t){Be.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"acl"},function(e,n){if(e)return t(e);var r=n.AccessControlPolicy||{},o=r.Owner||{},i=r.AccessControlList&&r.AccessControlList.Grant||[];i=_e.isArray(i)?i:[i];var a=Se(r);delete a.GrantWrite,n.headers&&n.headers["x-cos-acl"]&&(a.ACL=n.headers["x-cos-acl"]),a=_e.extend(a,{Owner:o,Grants:i,statusCode:n.statusCode,headers:n.headers}),t(null,a)})}function ne(e,t){var n=e.Headers,r="";if(e.AccessControlPolicy){var o=_e.clone(e.AccessControlPolicy||{}),i=o.Grants||o.Grant;i=_e.isArray(i)?i:[i],delete o.Grant,delete o.Grants,o.AccessControlList={Grant:i},r=_e.json2xml({AccessControlPolicy:o}),n["Content-Type"]="application/xml",n["Content-MD5"]=_e.binaryBase64(_e.md5(r))}_e.each(n,function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=Re(n[t]))}),Be.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:r},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function re(e,t){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,Be.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n},function(e,n){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var r=n.headers||{};t(null,{AccessControlAllowOrigin:r["access-control-allow-origin"],AccessControlAllowMethods:r["access-control-allow-methods"],AccessControlAllowHeaders:r["access-control-allow-headers"],AccessControlExposeHeaders:r["access-control-expose-headers"],AccessControlMaxAge:r["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})})}function oe(e,t){var n=this,r=e.Headers;r["Cache-Control"]||r["cache-control"]||(r["Cache-Control"]="");var o=e.CopySource||"",i=o.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);if(!i)return void t(_e.error(new Error("CopySource format error")));var a=i[1],s=i[3],c=decodeURIComponent(i[4]);Be.call(this,{Scope:[{action:"name/cos:GetObject",bucket:a,region:s,prefix:c},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(r,o){if(r)return t(r);var i=_e.clone(o.CopyObjectResult||{}),a=be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});_e.extend(i,{Location:a,statusCode:o.statusCode,headers:o.headers}),t(null,i)})}function ie(e,t){var n=e.CopySource||"",r=n.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);if(!r)return void t(_e.error(new Error("CopySource format error")));var o=r[1],i=r[3],a=decodeURIComponent(r[4]);Be.call(this,{Scope:[{action:"name/cos:GetObject",bucket:o,region:i,prefix:a},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers},function(e,n){if(e)return t(e);var r=_e.clone(n.CopyPartResult||{});_e.extend(r,{statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function ae(e,t){var n=e.Objects||[],r=e.Quiet;n=_e.isArray(n)?n:[n];var o=_e.json2xml({Delete:{Object:n,Quiet:r||!1}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(o));var a=_e.map(n,function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}});Be.call(this,{Scope:a,method:"POST",Bucket:e.Bucket,Region:e.Region,body:o,action:"delete",headers:i},function(e,n){if(e)return t(e);var r=n.DeleteResult||{},o=r.Deleted||[],i=r.Error||[];o=_e.isArray(o)?o:[o],i=_e.isArray(i)?i:[i];var a=_e.clone(r);_e.extend(a,{Error:i,Deleted:o,statusCode:n.statusCode,headers:n.headers}),t(null,a)})}function se(e,t){var n=e.Headers;if(!e.RestoreRequest)return void t(_e.error(new Error("missing param RestoreRequest")));var r=e.RestoreRequest||{},o=_e.json2xml({RestoreRequest:r});n["Content-Type"]="application/xml",n["Content-MD5"]=_e.binaryBase64(_e.md5(o)),Be.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:o,action:"restore",headers:n},t)}function ce(e,t){var n=e.Tagging||{},r=n.TagSet||n.Tags||e.Tags||[];r=_e.clone(_e.isArray(r)?r:[r]);var o=_e.json2xml({Tagging:{TagSet:{Tag:r}}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(o)),Be.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:o,action:"tagging",headers:i,VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function ue(e,t){Be.call(this,{Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var r={Tags:[],statusCode:e.statusCode};e.headers&&(r.headers=e.headers),t(null,r)}else{var o=[];try{o=n.Tagging.TagSet.Tag||[]}catch(e){}o=_e.clone(_e.isArray(o)?o:[o]),t(null,{Tags:o,statusCode:n.statusCode,headers:n.headers})}})}function le(e,t){Be.call(this,{Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function de(e,t){if(!e.SelectType)return t(_e.error(new Error("missing param SelectType")));var n=e.SelectRequest||{},r=_e.json2xml({SelectRequest:n}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=_e.binaryBase64(_e.md5(r)),Be.call(this,{Action:"name/cos:GetObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"select",qs:{"select-type":e.SelectType},VersionId:e.VersionId,body:r,DataType:"arraybuffer",rawBody:!0},function(e,n){if(e&&204===e.statusCode)return t(null,{statusCode:e.statusCode});if(e)return t(e);var r=_e.parseSelectPayload(n.body);t(null,{statusCode:n.statusCode,headers:n.headers,Body:r.body,Payload:r.payload})})}function fe(e,t){var n=this,r=e.Headers;r["Cache-Control"]||r["cache-control"]||(r["Cache-Control"]=""),r["Content-Type"]||r["content-type"]||(r["Content-Type"]=e.Body&&e.Body.type||""),_e.getBodyMd5(e.Body&&(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5),e.Body,function(r){r&&(e.Headers["x-cos-meta-md5"]=r),Be.call(n,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query},function(e,n){return e?t(e):(n=_e.clone(n||{}))&&n.InitiateMultipartUploadResult?t(null,_e.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n)})},e.onHashProgress)}function he(e,t){var n=this;_e.getFileSize("multipartUpload",e,function(){_e.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(r){r&&(e.Headers["Content-MD5"]=_e.binaryBase64(r)),Be.call(n,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null},function(e,n){if(e)return t(e);t(null,{ETag:_e.attr(n.headers,"etag",""),statusCode:n.statusCode,headers:n.headers})})})})}function pe(e,t){for(var n=this,r=e.UploadId,o=e.Parts,i=0,a=o.length;i-1?n.Authorization:"sign="+encodeURIComponent(n.Authorization)),n.SecurityToken&&(i+="&x-cos-security-token="+n.SecurityToken),n.ClientIP&&(i+="&clientIP="+n.ClientIP),n.ClientUA&&(i+="&clientUA="+n.ClientUA),n.Token&&(i+="&token="+n.Token),o&&(i+="&"+o),setTimeout(function(){t(null,{Url:i})})}});return a?(i+="?"+a.Authorization+(a.SecurityToken?"&x-cos-security-token="+a.SecurityToken:""),o&&(i+="&"+o)):o&&(i+="?"+o),i}function Se(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},r=e&&e.AccessControlList||{},o=r.Grant;o&&(o=_e.isArray(o)?o:[o]);var i={READ:0,WRITE:0,FULL_CONTROL:0};return o&&o.length&&_e.each(o,function(r){"qcs::cam::anyone:anyone"===r.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===r.Grantee.URI?i[r.Permission]=1:r.Grantee.ID!==e.Owner.ID&&t[n[r.Permission]].push('id="'+r.Grantee.ID+'"')}),i.FULL_CONTROL||i.WRITE&&i.READ?t.ACL="public-read-write":i.READ?t.ACL="public-read":t.ACL="private",_e.each(n,function(e){t[e]=Re(t[e].join(","))}),t}function Re(e){var t,n,r=e.split(","),o={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(o="{Bucket}."+o)),o=o.replace(/\{\{AppId\}\}/gi,r).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,i).replace(/\{\{.*?\}\}/gi,""),o=o.replace(/\{AppId\}/gi,r).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,i).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(o)||(o=s+"//"+o),"/"===o.slice(-1)&&(o=o.slice(0,-1));var c=o;return e.ForcePathStyle&&(c+="/"+t),c+="/",a&&(c+=_e.camSafeUrlEncode(a).replace(/%2F/g,"/")),e.isLocation&&(c=c.replace(/^https?:\/\//,"")),c}function Ae(e,t){var n=_e.clone(e.Headers);_e.each(n,function(e,t){(""===e||["content-type","cache-control","expires"].indexOf(t.toLowerCase())>-1)&&delete n[t]});var r=!1,o=function(e,n){r||(r=!0,n&&n.XCosSecurityToken&&!n.SecurityToken&&(n=_e.clone(n),n.SecurityToken=n.XCosSecurityToken,delete n.XCosSecurityToken),t&&t(e,n))},i=this,a=e.Bucket||"",s=e.Region||"",c=e.Key||"";i.options.ForcePathStyle&&a&&(c=a+"/"+c);var u="/"+c,l={},d=e.Scope;if(!d){var f=e.Action||"",h=e.ResourceKey||e.Key||"";d=e.Scope||[{action:f,bucket:a,region:s,prefix:h}]}var p=_e.md5(JSON.stringify(d));i._StsCache=i._StsCache||[],function(){var e,t;for(e=i._StsCache.length-1;e>=0;e--){t=i._StsCache[e];var n=Math.round(_e.getSkewTime(i.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n=t.ExpiredTime)i._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===p){l=t;break}}}();var g=function(){var t=l.StartTime&&l.ExpiredTime?l.StartTime+";"+l.ExpiredTime:"",r=_e.getAuth({SecretId:l.TmpSecretId,SecretKey:l.TmpSecretKey,Method:e.Method,Pathname:u,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:i.options.UseRawKey,SystemClockOffset:i.options.SystemClockOffset,KeyTime:t}),a={Authorization:r,SecurityToken:l.SecurityToken||l.XCosSecurityToken||"",Token:l.Token||"",ClientIP:l.ClientIP||"",ClientUA:l.ClientUA||""};o(null,a)},m=function(e){if(e.Authorization){var t=!1,n=e.Authorization;if(n)if(n.indexOf(" ")>-1)t=!1;else if(n.indexOf("q-sign-algorithm=")>-1&&n.indexOf("q-ak=")>-1&&n.indexOf("q-sign-time=")>-1&&n.indexOf("q-key-time=")>-1&&n.indexOf("q-url-param-list=")>-1)t=!0;else try{n=atob(n),n.indexOf("a=")>-1&&n.indexOf("k=")>-1&&n.indexOf("t=")>-1&&n.indexOf("r=")>-1&&n.indexOf("b=")>-1&&(t=!0)}catch(e){}if(!t)return _e.error(new Error("getAuthorization callback params format error"))}else{if(!e.TmpSecretId)return _e.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!e.TmpSecretKey)return _e.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!e.SecurityToken&&!e.XCosSecurityToken)return _e.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!e.ExpiredTime)return _e.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(e.ExpiredTime&&10!==e.ExpiredTime.toString().length)return _e.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(e.StartTime&&10!==e.StartTime.toString().length)return _e.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(l.ExpiredTime&&l.ExpiredTime-_e.getSkewTime(i.options.SystemClockOffset)/1e3>60)g();else if(i.options.getAuthorization)i.options.getAuthorization.call(i,{Bucket:a,Region:s,Method:e.Method,Key:c,Pathname:u,Query:e.Query,Headers:n,Scope:d,SystemClockOffset:i.options.SystemClockOffset},function(e){"string"==typeof e&&(e={Authorization:e});var t=m(e);if(t)return o(t);e.Authorization?o(null,e):(l=e||{},l.Scope=d,l.ScopeKey=p,i._StsCache.push(l),g())});else{if(!i.options.getSTS)return function(){var t=_e.getAuth({SecretId:e.SecretId||i.options.SecretId,SecretKey:e.SecretKey||i.options.SecretKey,Method:e.Method,Pathname:u,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:i.options.UseRawKey,SystemClockOffset:i.options.SystemClockOffset}),r={Authorization:t,SecurityToken:i.options.SecurityToken||i.options.XCosSecurityToken};return o(null,r),r}();i.options.getSTS.call(i,{Bucket:a,Region:s},function(e){l=e||{},l.Scope=d,l.ScopeKey=p,l.TmpSecretId||(l.TmpSecretId=l.SecretId),l.TmpSecretKey||(l.TmpSecretKey=l.SecretKey);var t=m(l);if(t)return o(t);i._StsCache.push(l),g()})}return""}function Te(e){var t=!1,n=!1,r=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var o=e.error.Code,i=e.error.Message;("RequestTimeTooSkewed"===o||"AccessDenied"===o&&"Request has expired"===i)&&(n=!0)}catch(e){}if(e)if(n&&r){var a=Date.parse(r);this.options.CorrectClockSkew&&Math.abs(_e.getSkewTime(this.options.SystemClockOffset)-a)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=a-Date.now(),t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0);return t}function Be(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=_e.clearKey(e.qs),e.headers&&(e.headers=_e.clearKey(e.headers)),e.qs&&(e.qs=_e.clearKey(e.qs));var r=_e.clone(e.qs);e.action&&(r[e.action]="");var o=function(i){var a=n.options.SystemClockOffset;Ae.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:r,Headers:e.headers,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope},function(r,s){if(r)return void t(r);e.AuthData=s,Ee.call(n,e,function(r,s){r&&i<2&&(a!==n.options.SystemClockOffset||Te.call(n,r))?(e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,delete e.headers["x-cos-security-token"]),o(i+1)):t(r,s)})})};o(1)}function Ee(e,t){var n=this,r=e.TaskId;if(!r||n._isRunningTask(r)){var o=e.Bucket,i=e.Region,a=e.Key,s=e.method||"GET",c=e.url,u=e.body,l=e.rawBody;n.options.UseAccelerate&&(i="accelerate"),c=c||be({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:o,region:i,object:a}),e.action&&(c=c+"?"+e.action),e.qsStr&&(c=c.indexOf("?")>-1?c+"&"+e.qsStr:c+"?"+e.qsStr);var d={method:s,url:c,headers:e.headers,qs:e.qs,body:u};if(d.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(d.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(d.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(d.headers.clientUA=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(d.headers["x-cos-security-token"]=e.AuthData.SecurityToken),d.headers&&(d.headers=_e.clearKey(d.headers)),d=_e.clearKey(d),e.onProgress&&"function"==typeof e.onProgress){var f=u&&(u.size||u.length)||0;d.onProgress=function(t){if(!r||n._isRunningTask(r)){var o=t?t.loaded:0;e.onProgress({loaded:o,total:f})}}}e.onDownloadProgress&&(d.onDownloadProgress=e.onDownloadProgress),e.DataType&&(d.dataType=e.DataType),this.options.Timeout&&(d.timeout=this.options.Timeout),n.options.ForcePathStyle&&(d.pathStyle=n.options.ForcePathStyle),n.emit("before-send",d);var h=(n.options.Request||we)(d,function(e){if("abort"!==e.error){n.emit("after-receive",e);var o,i={statusCode:e.statusCode,statusMessage:e.statusMessage,headers:e.headers},a=e.error,s=e.body,c=function(e,a){if(r&&n.off("inner-kill-task",p),!o){o=!0;var s={};i&&i.statusCode&&(s.statusCode=i.statusCode),i&&i.headers&&(s.headers=i.headers),e?(e=_e.extend(e||{},s),t(e,null)):(a=_e.extend(a||{},s),t(null,a)),h=null}};if(a)return c(_e.error(a));var u=i.statusCode,d=2===Math.floor(u/100);if(l&&d)return c(null,{body:s});var f;try{f=s&&s.indexOf("<")>-1&&s.indexOf(">")>-1&&_e.xml2json(s)||{}}catch(e){f={}}var g=f&&f.Error;d?c(null,f):g?c(_e.error(new Error(g.Message),{code:g.Code,error:g})):u?c(_e.error(new Error(i.statusMessage),{code:""+u})):u&&c(_e.error(new Error("statusCode error")))}}),p=function(e){e.TaskId===r&&(h&&h.abort&&h.abort(),n.off("inner-kill-task",p))};r&&n.on("inner-kill-task",p)}}function xe(e,t,n){_e.each(["Cors","Acl"],function(r){if(e.slice(-r.length)===r){var o=e.slice(0,-r.length)+r.toUpperCase(),i=_e.apiWrapper(e,t),a=!1;n[o]=function(){!a&&console.warn("warning: cos."+o+" has been deprecated. Please Use cos."+e+" instead."),a=!0,i.apply(this,arguments)}}})}var we=n(17),_e=n(0),Ie={getService:r,putBucket:o,headBucket:i,getBucket:a,deleteBucket:s,putBucketAcl:c,getBucketAcl:u,putBucketCors:l,getBucketCors:d,deleteBucketCors:f,getBucketLocation:h,getBucketPolicy:g,putBucketPolicy:p,deleteBucketPolicy:m,putBucketTagging:y,getBucketTagging:C,deleteBucketTagging:v,putBucketLifecycle:k,getBucketLifecycle:S,deleteBucketLifecycle:R,putBucketVersioning:b,getBucketVersioning:A,putBucketReplication:T,getBucketReplication:B,deleteBucketReplication:E,putBucketWebsite:x,getBucketWebsite:w,deleteBucketWebsite:_,putBucketReferer:I,getBucketReferer:D,putBucketDomain:O,getBucketDomain:N,deleteBucketDomain:P,putBucketOrigin:M,getBucketOrigin:U,deleteBucketOrigin:H,putBucketLogging:L,getBucketLogging:F,putBucketInventory:K,getBucketInventory:j,listBucketInventory:z,deleteBucketInventory:q,putBucketAccelerate:G,getBucketAccelerate:V,putBucketEncryption:X,getBucketEncryption:W,deleteBucketEncryption:Q,getObject:Y,headObject:$,listObjectVersions:J,putObject:Z,deleteObject:ee,getObjectAcl:te,putObjectAcl:ne,optionsObject:re,putObjectCopy:oe,deleteMultipleObject:ae,restoreObject:se,putObjectTagging:ce,getObjectTagging:ue,deleteObjectTagging:le,selectObjectContent:de,uploadPartCopy:ie,multipartInit:fe,multipartUpload:he,multipartComplete:pe,multipartList:ge,multipartListPart:me,multipartAbort:ye,request:Ce,getObjectUrl:ke,getAuth:ve};e.exports.init=function(e,t){t.transferToTaskMethod(Ie,"putObject"),_e.each(Ie,function(t,n){e.prototype[n]=_e.apiWrapper(n,t),xe(n,t,e.prototype)})}},function(e,t){var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},r=function(e,t,r,o){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(o){var i=encodeURIComponent(n(o))+r;return Array.isArray(e[o])?e[o].map(function(e){return i+encodeURIComponent(n(e))}).join(t):i+encodeURIComponent(n(e[o]))}).filter(Boolean).join(t):o?encodeURIComponent(n(o))+r+encodeURIComponent(n(e)):""},o=function(e,t,n){var r={};return t.getAllResponseHeaders().trim().split("\n").forEach(function(e){if(e){var t=e.indexOf(":"),n=e.substr(0,t).trim().toLowerCase(),o=e.substr(t+1).trim();r[n]=o}}),{error:e,statusCode:t.status,statusMessage:t.statusText,headers:r,body:n}},i=function(e,t){return t||"text"!==t?e.response:e.responseText},a=function(e,t){var n=(e.method||"GET").toUpperCase(),a=e.url;if(e.qs){var s=r(e.qs);s&&(a+=(-1===a.indexOf("?")?"?":"&")+s)}var c=new XMLHttpRequest;c.open(n,a,!0),c.responseType=e.dataType||"text";var u=e.headers;if(u)for(var l in u)u.hasOwnProperty(l)&&"content-length"!==l.toLowerCase()&&"user-agent"!==l.toLowerCase()&&"origin"!==l.toLowerCase()&&"host"!==l.toLowerCase()&&c.setRequestHeader(l,u[l]);return e.onProgress&&c.upload&&(c.upload.onprogress=e.onProgress),e.onDownloadProgress&&(c.onprogress=e.onDownloadProgress),c.onload=function(){t(o(null,c,i(c,e.dataType)))},c.onerror=function(n){var r=i(c,e.dataType);if(r)t(o(null,c,r));else{var a=c.statusText;a||0!==c.status||(a=new Error("CORS blocked or network error")),t(o(a,c,r))}},c.send(e.body||""),c};e.exports=a},function(e,t,n){function r(e,t){var n,r,i=this,a=new y,c=e.TaskId,l=e.Bucket,d=e.Region,f=e.Key,h=e.Body,p=e.ChunkSize||e.SliceSize||i.options.ChunkSize,m=e.AsyncLimit,v=e.StorageClass,k=e.ServerSideEncryption,S=e.onHashProgress;a.on("error",function(e){if(i._isRunningTask(c))return t(e)}),a.on("upload_complete",function(e){t(null,e)}),a.on("upload_slice_complete",function(t){var o={};C.each(e.Headers,function(e,t){var n=t.toLowerCase();0!==n.indexOf("x-cos-meta-")&&"pic-operations"!==n||(o[t]=e)}),u.call(i,{Bucket:l,Region:d,Key:f,UploadId:t.UploadId,SliceList:t.SliceList,Headers:o},function(e,o){if(i._isRunningTask(c)){if(g.removeUsing(t.UploadId),e)return r(null,!0),a.emit("error",e);g.removeUploadId.call(i,t.UploadId),r({loaded:n,total:n},!0),a.emit("upload_complete",o)}})}),a.on("get_upload_data_finish",function(t){var o=g.getFileId(h,e.ChunkSize,l,f);o&&g.saveUploadId.call(i,o,t.UploadId,i.options.UploadIdCacheLimit),g.setUsing(t.UploadId),r(null,!0),s.call(i,{TaskId:c,Bucket:l,Region:d,Key:f,Body:h,FileSize:n,SliceSize:p,AsyncLimit:m,ServerSideEncryption:k,UploadData:t,onProgress:r},function(e,t){if(i._isRunningTask(c))return e?(r(null,!0),a.emit("error",e)):void a.emit("upload_slice_complete",t)})}),a.on("get_file_size_finish",function(){if(r=C.throttleOnProgress.call(i,n,e.onProgress),e.UploadData.UploadId)a.emit("get_upload_data_finish",e.UploadData);else{var t=C.extend({TaskId:c,Bucket:l,Region:d,Key:f,Headers:e.Headers,StorageClass:v,Body:h,FileSize:n,SliceSize:p,onHashProgress:S},e);o.call(i,t,function(t,n){if(i._isRunningTask(c)){if(t)return a.emit("error",t);e.UploadData.UploadId=n.UploadId,e.UploadData.PartList=n.PartList,a.emit("get_upload_data_finish",e.UploadData)}})}}),n=e.ContentLength,delete e.ContentLength,!e.Headers&&(e.Headers={}),C.each(e.Headers,function(t,n){"content-length"===n.toLowerCase()&&delete e.Headers[n]}),function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],r=1048576,o=0;oh)return t(null,!1);if(n>1){if(Math.max(e[0].Size,e[1].Size)!==f)return t(null,!1)}var r=function(o){if(o=c.length)return void b.emit("has_and_check_upload_id",t);var i=c[e];return C.isInArray(t,i)?g.using[i]?void l(e+1):void a.call(u,{Bucket:r,Region:o,Key:s,UploadId:i},function(t,r){u._isRunningTask(n)&&(t?(g.removeUploadId.call(u,i),l(e+1)):b.emit("upload_id_available",{UploadId:i,PartList:r.PartList}))}):(g.removeUploadId.call(u,i),void l(e+1))};l(0)}),b.on("get_remote_upload_id_list",function(){i.call(u,{Bucket:r,Region:o,Key:s},function(t,o){if(u._isRunningTask(n)){if(t)return b.emit("error",t);var i=C.filter(o.UploadList,function(e){return e.Key===s&&(!c||e.StorageClass.toUpperCase()===c.toUpperCase())}).reverse().map(function(e){return e.UploadId||e.UploadID});if(i.length)b.emit("seek_local_avail_upload_id",i);else{var a,l=g.getFileId(e.Body,e.ChunkSize,r,s);l&&(a=g.getUploadIdList.call(u,l))&&C.each(a,function(e){g.removeUploadId.call(u,e)}),b.emit("no_available_upload_id")}}})}),b.emit("get_remote_upload_id_list")}function i(e,t){var n=this,r=[],o={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key},i=function(){n.multipartList(o,function(e,n){if(e)return t(e);r.push.apply(r,n.Upload||[]),"true"===n.IsTruncated?(o.KeyMarker=n.NextKeyMarker,o.UploadIdMarker=n.NextUploadIdMarker,i()):t(null,{UploadList:r})})};i()}function a(e,t){var n=this,r=[],o={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId},i=function(){n.multipartListPart(o,function(e,n){if(e)return t(e);r.push.apply(r,n.Part||[]),"true"===n.IsTruncated?(o.PartNumberMarker=n.NextPartNumberMarker,i()):t(null,{PartList:r})})};i()}function s(e,t){var n=this,r=e.TaskId,o=e.Bucket,i=e.Region,a=e.Key,s=e.UploadData,u=e.FileSize,l=e.SliceSize,d=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),f=e.Body,h=Math.ceil(u/l),p=0,g=e.ServerSideEncryption,y=C.filter(s.PartList,function(e){return e.Uploaded&&(p+=e.PartNumber>=h?u%l||l:l),!e.Uploaded}),v=e.onProgress;m.eachLimit(y,d,function(e,t){if(n._isRunningTask(r)){var d=e.PartNumber,h=Math.min(u,e.PartNumber*l)-(e.PartNumber-1)*l,m=0;c.call(n,{TaskId:r,Bucket:o,Region:i,Key:a,SliceSize:l,FileSize:u,PartNumber:d,ServerSideEncryption:g,Body:f,UploadData:s,onProgress:function(e){p+=e.loaded-m,m=e.loaded,v({loaded:p,total:u})}},function(o,i){n._isRunningTask(r)&&(o||i.ETag||(o='get ETag error, please add "ETag" to CORS ExposeHeader setting.'),o?p-=m:(p+=h-m,e.ETag=i.ETag),v({loaded:p,total:u}),t(o||null,i))})}},function(e){if(n._isRunningTask(r))return e?t(e):void t(null,{UploadId:s.UploadId,SliceList:s.PartList})})}function c(e,t){var n=this,r=e.TaskId,o=e.Bucket,i=e.Region,a=e.Key,s=e.FileSize,c=e.Body,u=1*e.PartNumber,l=e.SliceSize,d=e.ServerSideEncryption,f=e.UploadData,h=n.options.ChunkRetryTimes+1,p=l*(u-1),g=l,y=p+l;y>s&&(y=s,g=y-p);var v=f.PartList[u-1];m.retry(h,function(t){n._isRunningTask(r)&&C.fileSlice(c,p,y,!0,function(s){n.multipartUpload({TaskId:r,Bucket:o,Region:i,Key:a,ContentLength:g,PartNumber:u,UploadId:f.UploadId,ServerSideEncryption:d,Body:s,onProgress:e.onProgress},function(e,o){if(n._isRunningTask(r))return e?t(e):(v.Uploaded=!0,t(null,o))})})},function(e,o){if(n._isRunningTask(r))return t(e,o)})}function u(e,t){var n=e.Bucket,r=e.Region,o=e.Key,i=e.UploadId,a=e.SliceList,s=this,c=this.options.ChunkRetryTimes+1,u=e.Headers,l=a.map(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});m.retry(c,function(e){s.multipartComplete({Bucket:n,Region:r,Key:o,UploadId:i,Parts:l,Headers:u},e)},function(e,n){t(e,n)})}function l(e,t){var n=e.Bucket,r=e.Region,o=e.Key,a=e.UploadId,s=e.Level||"task",c=e.AsyncLimit,u=this,l=new y;if(l.on("error",function(e){return t(e)}),l.on("get_abort_array",function(i){d.call(u,{Bucket:n,Region:r,Key:o,Headers:e.Headers,AsyncLimit:c,AbortArray:i},t)}),"bucket"===s)i.call(u,{Bucket:n,Region:r},function(e,n){if(e)return t(e);l.emit("get_abort_array",n.UploadList||[])});else if("file"===s){if(!o)return t(C.error(new Error("abort_upload_task_no_key")));i.call(u,{Bucket:n,Region:r,Key:o},function(e,n){if(e)return t(e);l.emit("get_abort_array",n.UploadList||[])})}else{if("task"!==s)return t(C.error(new Error("abort_unknown_level")));if(!a)return t(C.error(new Error("abort_upload_task_no_id")));if(!o)return t(C.error(new Error("abort_upload_task_no_key")));l.emit("get_abort_array",[{Key:o,UploadId:a}])}}function d(e,t){var n=e.Bucket,r=e.Region,o=e.Key,i=e.AbortArray,a=e.AsyncLimit||1,s=this,c=0,u=new Array(i.length);m.eachLimit(i,a,function(t,i){var a=c;if(o&&o!==t.Key)return u[a]={error:{KeyNotMatch:!0}},void i(null);var l=t.UploadId||t.UploadID;s.multipartAbort({Bucket:n,Region:r,Key:t.Key,Headers:e.Headers,UploadId:l},function(e){var o={Bucket:n,Region:r,Key:t.Key,UploadId:l};u[a]={error:e,task:o},i(null)}),c++},function(e){if(e)return t(e);for(var n=[],r=[],o=0,i=u.length;or?"sliceUploadFile":"putObject";d.push({api:v,params:e,callback:y})}()}),n._addTasks(d)}function h(e,t){var n=new y,r=this,o=e.Bucket,i=e.Region,a=e.Key,s=e.CopySource,c=s.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);if(!c)return void t(C.error(new Error("CopySource format error")));var u=c[1],l=c[3],d=decodeURIComponent(c[4]),f=void 0===e.CopySliceSize?r.options.CopySliceSize:e.CopySliceSize;f=Math.max(0,f);var h,g,v=e.CopyChunkSize||this.options.CopyChunkSize,k=this.options.CopyChunkParallelLimit,S=0;n.on("copy_slice_complete",function(n){var s={};C.each(e.Headers,function(e,t){0===t.toLowerCase().indexOf("x-cos-meta-")&&(s[t]=e)});var c=C.map(n.PartList,function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});r.multipartComplete({Bucket:o,Region:i,Key:a,UploadId:n.UploadId,Parts:c},function(e,n){if(e)return g(null,!0),t(e);g({loaded:h,total:h},!0),t(null,n)})}),n.on("get_copy_data_finish",function(e){m.eachLimit(e.PartList,k,function(t,n){var c=t.PartNumber,u=t.CopySourceRange,l=t.end-t.start;p.call(r,{Bucket:o,Region:i,Key:a,CopySource:s,UploadId:e.UploadId,PartNumber:c,CopySourceRange:u},function(e,r){if(e)return n(e);S+=l,g({loaded:S,total:h}),t.ETag=r.ETag,n(e||null,r)})},function(r){if(r)return g(null,!0),t(r);n.emit("copy_slice_complete",e)})}),n.on("get_file_size_finish",function(s){!function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],n=1048576,o=0;o"x-cos-meta-".length&&(s[t]=e)}),n.emit("get_file_size_finish",s)}})}function p(e,t){var n=e.TaskId,r=e.Bucket,o=e.Region,i=e.Key,a=e.CopySource,s=e.UploadId,c=1*e.PartNumber,u=e.CopySourceRange,l=this.options.ChunkRetryTimes+1,d=this;m.retry(l,function(e){d.uploadPartCopy({TaskId:n,Bucket:r,Region:o,Key:i,CopySource:a,UploadId:s,PartNumber:c,CopySourceRange:u},function(t,n){e(t||null,n)})},function(e,n){return t(e,n)})}var g=n(3),m=n(19),y=n(2).EventProxy,C=n(0),v={sliceUploadFile:r,abortUploadTask:l,uploadFiles:f,sliceCopyFile:h};e.exports.init=function(e,t){t.transferToTaskMethod(v,"sliceUploadFile"),C.each(v,function(t,n){e.prototype[n]=C.apiWrapper(n,t)})}},function(e,t){var n=function(e,t,n,r){if(r=r||function(){},!e.length||t<=0)return r();var o=0,i=0,a=0;!function s(){if(o>=e.length)return r();for(;a=e.length?r():s())})}()},r=function(e,t,n){var r=function(o){t(function(t,i){t&&o