From c0b9bf68d407d9f47b2f9357de0e466651a4ce46 Mon Sep 17 00:00:00 2001 From: taevas Date: Mon, 15 Jul 2019 11:55:01 +0800 Subject: [PATCH] 3.3.11 --- dist/upyun.common.js | 12 ++++++---- dist/upyun.esm.js | 47 +++++++++++++++++++++---------------- dist/upyun.js | 55 +++++++++++++++++++++++++------------------- dist/upyun.min.js | 4 ++-- package.json | 2 +- 5 files changed, 69 insertions(+), 51 deletions(-) diff --git a/dist/upyun.common.js b/dist/upyun.common.js index 063ab59..fffb18e 100644 --- a/dist/upyun.common.js +++ b/dist/upyun.common.js @@ -1,5 +1,5 @@ /** - * UPYUN js-sdk 3.3.10 + * UPYUN js-sdk 3.3.11 * (c) 2019 * @license MIT */ @@ -138,6 +138,9 @@ function formUpload(remoteUrl, localFile, _ref) { var authorization = _ref.authorization, policy = _ref.policy; + var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, + filename = _ref2.filename; + return new Promise(function (resolve, reject) { var data = new FormData(); data.append('authorization', authorization); @@ -145,7 +148,7 @@ function formUpload(remoteUrl, localFile, _ref) { // NOTE when type of localFile is buffer/string, // force set filename=file, FormData will treat it as a file // real filename will be set by save-key in policy - var filename = localFile.name || localFile.path ? path.basename(localFile.name || localFile.path) : 'file'; + filename = filename || localFile.name || localFile.path ? path.basename(filename || localFile.name || localFile.path) : 'file'; data.append('file', localFile, { filename: filename @@ -181,7 +184,7 @@ function formUpload(remoteUrl, localFile, _ref) { } var name = "upyun"; -var version = "3.3.10"; +var version = "3.3.11"; var description = "UPYUN js sdk"; var main = "dist/upyun.common.js"; var module$1 = "dist/upyun.esm.js"; @@ -978,6 +981,7 @@ var Upyun = function () { var _this4 = this; var orignParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var params = {}; var _iteratorNormalCompletion3 = true; @@ -1015,7 +1019,7 @@ var Upyun = function () { result = isPromise(result) ? result : Promise.resolve(result); return result.then(function (bodySign) { - return formUpload(_this4.endpoint + '/' + params['service'], localFile, bodySign); + return formUpload(_this4.endpoint + '/' + params['service'], localFile, bodySign, opts); }); } }, { diff --git a/dist/upyun.esm.js b/dist/upyun.esm.js index 64f4cd9..4ecb235 100644 --- a/dist/upyun.esm.js +++ b/dist/upyun.esm.js @@ -1,9 +1,10 @@ /** - * UPYUN js-sdk 3.3.10 + * UPYUN js-sdk 3.3.11 * (c) 2019 * @license MIT */ import axios from 'axios'; +import path from 'path'; // NOTE: choose node.js first // process is defined in client test @@ -1447,13 +1448,13 @@ var createReq = function (endpoint, service, getHeaderSign) { req.interceptors.request.use(function (config) { var method = config.method.toUpperCase(); - var path = url.resolve('/', config.url || ''); + var path$$1 = url.resolve('/', config.url || ''); - if (path.indexOf(config.baseURL) === 0) { - path = path.substring(config.baseURL.length); + if (path$$1.indexOf(config.baseURL) === 0) { + path$$1 = path$$1.substring(config.baseURL.length); } config.url = encodeURI(config.url); - var headerSign = getHeaderSign(service, method, path, config.headers['Content-MD5']); + var headerSign = getHeaderSign(service, method, path$$1, config.headers['Content-MD5']); headerSign = isPromise_1(headerSign) ? headerSign : Promise.resolve(headerSign); return headerSign.then(function (headers) { @@ -1501,16 +1502,21 @@ function formUpload(remoteUrl, localFile, _ref) { var authorization = _ref.authorization, policy = _ref.policy; + var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, + filename = _ref2.filename; + var data = new FormData(); data.append('authorization', authorization); data.append('policy', policy); if (typeof localFile === 'string') { localFile = new Blob([localFile], { type: 'text/plain' }); } - data.append('file', localFile); - return axios.post(remoteUrl, data).then(function (_ref2) { - var status = _ref2.status, - data = _ref2.data; + + filename = filename ? path.basename(filename) : filename; + data.append('file', localFile, filename); + return axios.post(remoteUrl, data).then(function (_ref3) { + var status = _ref3.status, + data = _ref3.data; if (status === 200) { return Promise.resolve(data); @@ -1737,7 +1743,7 @@ var base64 = createCommonjsModule(function (module, exports) { }); var name = "upyun"; -var version = "3.3.10"; +var version = "3.3.11"; var description = "UPYUN js sdk"; var main = "dist/upyun.common.js"; var module$1 = "dist/upyun.esm.js"; @@ -2097,14 +2103,14 @@ var md5 = createCommonjsModule(function (module) { * @param {string} path - storage path on upyun server, e.g: /your/dir/example.txt * @param {string} contentMd5 - md5 of the file that will be uploaded */ -function getHeaderSign(service, method, path) { +function getHeaderSign(service, method, path$$1) { var contentMd5 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; var date = new Date().toGMTString(); - path = '/' + service.serviceName + path; + path$$1 = '/' + service.serviceName + path$$1; var sign = genSign(service, { method: method, - path: path, + path: path$$1, date: date, contentMd5: contentMd5 }); @@ -2121,10 +2127,10 @@ function getHeaderSign(service, method, path) { */ function genSign(service, options) { var method = options.method, - path = options.path; + path$$1 = options.path; - var data = [method, encodeURI(path)]; + var data = [method, encodeURI(path$$1)]; // optional params ['date', 'policy', 'contentMd5'].forEach(function (item) { @@ -2350,9 +2356,9 @@ var Upyun = function () { }, { key: 'usage', value: function usage() { - var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/'; + var path$$1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/'; - return this.req.get(path + '?usage').then(function (_ref) { + return this.req.get(path$$1 + '?usage').then(function (_ref) { var data = _ref.data; return Promise.resolve(data); @@ -2361,7 +2367,7 @@ var Upyun = function () { }, { key: 'listDir', value: function listDir() { - var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/'; + var path$$1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/'; var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref2$limit = _ref2.limit, @@ -2386,7 +2392,7 @@ var Upyun = function () { requestHeaders['x-list-iter'] = iter; } - return this.req.get(path, { + return this.req.get(path$$1, { headers: requestHeaders }).then(function (_ref3) { var data = _ref3.data, @@ -2852,6 +2858,7 @@ var Upyun = function () { var _this4 = this; var orignParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var params = {}; var _iteratorNormalCompletion3 = true; @@ -2889,7 +2896,7 @@ var Upyun = function () { result = isPromise_1(result) ? result : Promise.resolve(result); return result.then(function (bodySign) { - return formUpload(_this4.endpoint + '/' + params['service'], localFile, bodySign); + return formUpload(_this4.endpoint + '/' + params['service'], localFile, bodySign, opts); }); } }, { diff --git a/dist/upyun.js b/dist/upyun.js index edf33a2..39f0c85 100644 --- a/dist/upyun.js +++ b/dist/upyun.js @@ -1,15 +1,16 @@ /** - * UPYUN js-sdk 3.3.10 + * UPYUN js-sdk 3.3.11 * (c) 2019 * @license MIT */ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('axios')) : - typeof define === 'function' && define.amd ? define(['axios'], factory) : - (global.upyun = factory(global.axios)); -}(this, (function (axios) { 'use strict'; + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('axios'), require('path')) : + typeof define === 'function' && define.amd ? define(['axios', 'path'], factory) : + (global.upyun = factory(global.axios,global.path)); +}(this, (function (axios,path) { 'use strict'; axios = 'default' in axios ? axios['default'] : axios; +path = 'default' in path ? path['default'] : path; // NOTE: choose node.js first // process is defined in client test @@ -1453,13 +1454,13 @@ var createReq = function (endpoint, service, getHeaderSign) { req.interceptors.request.use(function (config) { var method = config.method.toUpperCase(); - var path = url.resolve('/', config.url || ''); + var path$$1 = url.resolve('/', config.url || ''); - if (path.indexOf(config.baseURL) === 0) { - path = path.substring(config.baseURL.length); + if (path$$1.indexOf(config.baseURL) === 0) { + path$$1 = path$$1.substring(config.baseURL.length); } config.url = encodeURI(config.url); - var headerSign = getHeaderSign(service, method, path, config.headers['Content-MD5']); + var headerSign = getHeaderSign(service, method, path$$1, config.headers['Content-MD5']); headerSign = isPromise_1(headerSign) ? headerSign : Promise.resolve(headerSign); return headerSign.then(function (headers) { @@ -1507,16 +1508,21 @@ function formUpload(remoteUrl, localFile, _ref) { var authorization = _ref.authorization, policy = _ref.policy; + var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, + filename = _ref2.filename; + var data = new FormData(); data.append('authorization', authorization); data.append('policy', policy); if (typeof localFile === 'string') { localFile = new Blob([localFile], { type: 'text/plain' }); } - data.append('file', localFile); - return axios.post(remoteUrl, data).then(function (_ref2) { - var status = _ref2.status, - data = _ref2.data; + + filename = filename ? path.basename(filename) : filename; + data.append('file', localFile, filename); + return axios.post(remoteUrl, data).then(function (_ref3) { + var status = _ref3.status, + data = _ref3.data; if (status === 200) { return Promise.resolve(data); @@ -1743,7 +1749,7 @@ var base64 = createCommonjsModule(function (module, exports) { }); var name = "upyun"; -var version = "3.3.10"; +var version = "3.3.11"; var description = "UPYUN js sdk"; var main = "dist/upyun.common.js"; var module$1 = "dist/upyun.esm.js"; @@ -2103,14 +2109,14 @@ var md5 = createCommonjsModule(function (module) { * @param {string} path - storage path on upyun server, e.g: /your/dir/example.txt * @param {string} contentMd5 - md5 of the file that will be uploaded */ -function getHeaderSign(service, method, path) { +function getHeaderSign(service, method, path$$1) { var contentMd5 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; var date = new Date().toGMTString(); - path = '/' + service.serviceName + path; + path$$1 = '/' + service.serviceName + path$$1; var sign = genSign(service, { method: method, - path: path, + path: path$$1, date: date, contentMd5: contentMd5 }); @@ -2127,10 +2133,10 @@ function getHeaderSign(service, method, path) { */ function genSign(service, options) { var method = options.method, - path = options.path; + path$$1 = options.path; - var data = [method, encodeURI(path)]; + var data = [method, encodeURI(path$$1)]; // optional params ['date', 'policy', 'contentMd5'].forEach(function (item) { @@ -2356,9 +2362,9 @@ var Upyun = function () { }, { key: 'usage', value: function usage() { - var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/'; + var path$$1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/'; - return this.req.get(path + '?usage').then(function (_ref) { + return this.req.get(path$$1 + '?usage').then(function (_ref) { var data = _ref.data; return Promise.resolve(data); @@ -2367,7 +2373,7 @@ var Upyun = function () { }, { key: 'listDir', value: function listDir() { - var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/'; + var path$$1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/'; var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref2$limit = _ref2.limit, @@ -2392,7 +2398,7 @@ var Upyun = function () { requestHeaders['x-list-iter'] = iter; } - return this.req.get(path, { + return this.req.get(path$$1, { headers: requestHeaders }).then(function (_ref3) { var data = _ref3.data, @@ -2858,6 +2864,7 @@ var Upyun = function () { var _this4 = this; var orignParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; var params = {}; var _iteratorNormalCompletion3 = true; @@ -2895,7 +2902,7 @@ var Upyun = function () { result = isPromise_1(result) ? result : Promise.resolve(result); return result.then(function (bodySign) { - return formUpload(_this4.endpoint + '/' + params['service'], localFile, bodySign); + return formUpload(_this4.endpoint + '/' + params['service'], localFile, bodySign, opts); }); } }, { diff --git a/dist/upyun.min.js b/dist/upyun.min.js index 96a5593..1b7094f 100644 --- a/dist/upyun.min.js +++ b/dist/upyun.min.js @@ -1,6 +1,6 @@ /** - * UPYUN js-sdk 3.3.10 + * UPYUN js-sdk 3.3.11 * (c) 2019 * @license MIT */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("axios")):"function"==typeof define&&define.amd?define(["axios"],e):t.upyun=e(t.axios)}(this,function(f){"use strict";f="default"in f?f.default:f;var s="undefined"!=typeof window&&("undefined"==typeof process||"browser"===process.title),u=1048576,p=function(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then};var E="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(t,e){return t(e={exports:{}},e.exports),e.exports}var N=t(function(T,U){!function(t){var e=U&&!U.nodeType&&U,r=T&&!T.nodeType&&T,n="object"==typeof E&&E;n.global!==n&&n.window!==n&&n.self!==n||(t=n);var o,i,m=2147483647,g=36,b=1,x=26,a=38,s=700,w=72,A=128,C="-",u=/^xn--/,h=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=g-b,k=Math.floor,S=String.fromCharCode;function j(t){throw RangeError(c[t])}function p(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function v(t,e){var r=t.split("@"),n="";return 1>>10&1023|55296),t=56320|1023&t),e+=S(t)}).join("")}function q(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function I(t,e,r){var n=0;for(t=r?k(t/s):t>>1,t+=k(t/e);f*x>>1k((m-v)/a))&&j("overflow"),v+=u*a,!(u<(h=s<=y?b:y+x<=s?x:s-y));s+=g)a>k(m/(l=g-h))&&j("overflow"),a*=l;y=I(v-i,e=f.length+1,0==i),k(v/e)>m-d&&j("overflow"),d+=k(v/e),v%=e,f.splice(v++,0,d)}return P(f)}function y(t){var e,r,n,o,i,a,s,u,h,l,c,f,p,v,d,y=[];for(f=(t=O(t)).length,e=A,i=w,a=r=0;ak((m-r)/(p=n+1))&&j("overflow"),r+=(s-e)*p,e=s,a=0;am&&j("overflow"),c==e){for(u=r,h=g;!(u<(l=h<=i?b:i+x<=h?x:h-i));h+=g)d=u-l,v=g-l,y.push(S(q(l+d%v,0))),u=k(d/v);y.push(S(q(u,0))),i=I(r,p,n==o),r=0,++n}++r,++e}return y.join("")}if(o={version:"1.3.2",ucs2:{decode:O,encode:P},decode:d,encode:y,toASCII:function(t){return v(t,function(t){return h.test(t)?"xn--"+y(t):t})},toUnicode:function(t){return v(t,function(t){return u.test(t)?d(t.slice(4).toLowerCase()):t})}},e&&r)if(T.exports==e)r.exports=o;else for(i in o)o.hasOwnProperty(i)&&(e[i]=o[i]);else t.punycode=o}(E)}),B={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};function r(t,e,r,n){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var i=/\+/g;t=t.split(e);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var s,u,h=t.length;0",'"',"`"," ","\r","\n","\t"]),F=["'"].concat(v),_=["%","/","?",";","#"].concat(F),L=["/","?","#"],D=/^[+a-z0-9A-Z_-]{0,63}$/,H=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Z={javascript:!0,"javascript:":!0},G={javascript:!0,"javascript:":!0},J={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function d(t,e,r){if(t&&B.isObject(t)&&t instanceof O)return t;var n=new O;return n.parse(t,e,r),n}O.prototype.parse=function(t,e,r){if(!B.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),o=-1!==n&&n>16)+(e>>16)+(r>>16)<<16|65535&r}function A(t,e){return t<>>32-e}function u(t,e){t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e;for(var r,n,o,i,a,s=[80],u=1732584193,h=-271733879,l=-1732584194,c=271733878,f=-1009589776,p=0;p>5]|=(t.charCodeAt(n/8)&r)<<32-s-n%32;return e}return i||(i="="),s||(s=8),function(t){for(var e="",r=0;r<4*t.length;r+=3)for(var n=(t[r>>2]>>8*(3-r%4)&255)<<16|(t[r+1>>2]>>8*(3-(r+1)%4)&255)<<8|t[r+2>>2]>>8*(3-(r+2)%4)&255,o=0;o<4;o++)8*r+6*o>32*t.length?e+=i:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n>>6*(3-o)&63);return e}(function(t,e){var r=h(t);16>18&63)+l.charAt(o>>12&63)+l.charAt(o>>6&63)+l.charAt(63&o);return 2==i?(e=t.charCodeAt(s)<<8,r=t.charCodeAt(++s),a+=l.charAt((o=e+r)>>10)+l.charAt(o>>4&63)+l.charAt(o<<2&63)+"="):1==i&&(o=t.charCodeAt(s),a+=l.charAt(o>>2)+l.charAt(o<<4&63)+"=="),a},decode:function(t){var e=(t=String(t).replace(s,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),e%4!=1&&!/[^+a-zA-Z0-9/]/.test(t)||h("Invalid character: the string to be decoded is not correctly encoded.");for(var r,n,o=0,i="",a=-1;++a>(-2*o&6)));return i},version:"0.1.0"};if(e&&!e.nodeType)if(r)r.exports=i;else for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a]);else t.base64=i}(E)}),w="3.3.10",C=t(function(t){var i,r;i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(t,e){return t<>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&r.rotl(t,8)|4278255360&r.rotl(t,24);for(var e=0;e>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r>>6*(3-o)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],r=0,n=0;r>>6-2*n);return e}},t.exports=r}),k={utf8:{stringToBytes:function(t){return k.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(k.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r>>24)|4278255360&(r[u]<<24|r[u]>>>8);r[n>>>5]|=128<>>9<<4)]=n;var h=w._ff,l=w._gg,c=w._hh,f=w._ii;for(u=0;u>>0,i=i+v>>>0,a=a+d>>>0,s=s+y>>>0}return m.endian([o,i,a,s])})._ff=function(t,e,r,n,o,i,a){var s=t+(e&r|~e&n)+(o>>>0)+a;return(s<>>32-i)+e},w._gg=function(t,e,r,n,o,i,a){var s=t+(e&n|r&~n)+(o>>>0)+a;return(s<>>32-i)+e},w._hh=function(t,e,r,n,o,i,a){var s=t+(e^r^n)+(o>>>0)+a;return(s<>>32-i)+e},w._ii=function(t,e,r,n,o,i,a){var s=t+(r^(e|~n))+(o>>>0)+a;return(s<>>32-i)+e},w._blocksize=16,w._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var r=m.wordsToBytes(w(t,e));return e&&e.asBytes?r:e&&e.asString?x.bytesToString(r):m.bytesToHex(r)}});function q(t,e){var r=e.method,n=e.path,o=[r,encodeURI(n)];["date","policy","contentMd5"].forEach(function(t){e[t]&&o.push(e[t])});var i=b(t.password,o.join("&"));return"UPYUN "+t.operatorName+":"+i}function I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var T={genSign:q,getHeaderSign:function(t,e,r){var n=3= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=g-b,k=Math.floor,S=String.fromCharCode;function j(e){throw RangeError(c[e])}function p(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function v(e,t){var r=e.split("@"),n="";return 1>>10&1023|55296),e=56320|1023&e),t+=S(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function I(e,t,r){var n=0;for(e=r?k(e/s):e>>1,e+=k(e/t);f*x>>1k((m-v)/a))&&j("overflow"),v+=u*a,!(u<(h=s<=y?b:y+x<=s?x:s-y));s+=g)a>k(m/(l=g-h))&&j("overflow"),a*=l;y=I(v-i,t=f.length+1,0==i),k(v/t)>m-d&&j("overflow"),d+=k(v/t),v%=t,f.splice(v++,0,d)}return q(f)}function y(e){var t,r,n,o,i,a,s,u,h,l,c,f,p,v,d,y=[];for(f=(e=O(e)).length,t=A,i=w,a=r=0;ak((m-r)/(p=n+1))&&j("overflow"),r+=(s-t)*p,t=s,a=0;am&&j("overflow"),c==t){for(u=r,h=g;!(u<(l=h<=i?b:i+x<=h?x:h-i));h+=g)d=u-l,v=g-l,y.push(S(P(l+d%v,0))),u=k(d/v);y.push(S(P(u,0))),i=I(r,p,n==o),r=0,++n}++r,++t}return y.join("")}if(o={version:"1.3.2",ucs2:{decode:O,encode:q},decode:d,encode:y,toASCII:function(e){return v(e,function(e){return h.test(e)?"xn--"+y(e):e})},toUnicode:function(e){return v(e,function(e){return u.test(e)?d(e.slice(4).toLowerCase()):e})}},t&&r)if(T.exports==t)r.exports=o;else for(i in o)o.hasOwnProperty(i)&&(t[i]=o[i]);else e.punycode=o}(E)}),B={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};function r(e,t,r,n){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var i=/\+/g;e=e.split(t);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var s,u,h=e.length;0",'"',"`"," ","\r","\n","\t"]),F=["'"].concat(f),_=["%","/","?",";","#"].concat(F),L=["/","?","#"],D=/^[+a-z0-9A-Z_-]{0,63}$/,H=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Z={javascript:!0,"javascript:":!0},G={javascript:!0,"javascript:":!0},J={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function y(e,t,r){if(e&&B.isObject(e)&&e instanceof O)return e;var n=new O;return n.parse(e,t,r),n}O.prototype.parse=function(e,t,r){if(!B.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),o=-1!==n&&n>16)+(t>>16)+(r>>16)<<16|65535&r}function A(e,t){return e<>>32-t}function u(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var r,n,o,i,a,s=[80],u=1732584193,h=-271733879,l=-1732584194,c=271733878,f=-1009589776,p=0;p>5]|=(e.charCodeAt(n/8)&r)<<32-s-n%32;return t}return i||(i="="),s||(s=8),function(e){for(var t="",r=0;r<4*e.length;r+=3)for(var n=(e[r>>2]>>8*(3-r%4)&255)<<16|(e[r+1>>2]>>8*(3-(r+1)%4)&255)<<8|e[r+2>>2]>>8*(3-(r+2)%4)&255,o=0;o<4;o++)8*r+6*o>32*e.length?t+=i:t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n>>6*(3-o)&63);return t}(function(e,t){var r=h(e);16>18&63)+l.charAt(o>>12&63)+l.charAt(o>>6&63)+l.charAt(63&o);return 2==i?(t=e.charCodeAt(s)<<8,r=e.charCodeAt(++s),a+=l.charAt((o=t+r)>>10)+l.charAt(o>>4&63)+l.charAt(o<<2&63)+"="):1==i&&(o=e.charCodeAt(s),a+=l.charAt(o>>2)+l.charAt(o<<4&63)+"=="),a},decode:function(e){var t=(e=String(e).replace(s,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),t%4!=1&&!/[^+a-zA-Z0-9/]/.test(e)||h("Invalid character: the string to be decoded is not correctly encoded.");for(var r,n,o=0,i="",a=-1;++a>(-2*o&6)));return i},version:"0.1.0"};if(t&&!t.nodeType)if(r)r.exports=i;else for(var a in i)i.hasOwnProperty(a)&&(t[a]=i[a]);else e.base64=i}(E)}),C="3.3.11",k=e(function(e){var i,r;i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],r=0,n=0;r>>6-2*n);return t}},e.exports=r}),S={utf8:{stringToBytes:function(e){return S.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(S.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r>>24)|4278255360&(r[u]<<24|r[u]>>>8);r[n>>>5]|=128<>>9<<4)]=n;var h=w._ff,l=w._gg,c=w._hh,f=w._ii;for(u=0;u>>0,i=i+v>>>0,a=a+d>>>0,s=s+y>>>0}return m.endian([o,i,a,s])})._ff=function(e,t,r,n,o,i,a){var s=e+(t&r|~t&n)+(o>>>0)+a;return(s<>>32-i)+t},w._gg=function(e,t,r,n,o,i,a){var s=e+(t&n|r&~n)+(o>>>0)+a;return(s<>>32-i)+t},w._hh=function(e,t,r,n,o,i,a){var s=e+(t^r^n)+(o>>>0)+a;return(s<>>32-i)+t},w._ii=function(e,t,r,n,o,i,a){var s=e+(r^(t|~n))+(o>>>0)+a;return(s<>>32-i)+t},w._blocksize=16,w._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=m.wordsToBytes(w(e,t));return t&&t.asBytes?r:t&&t.asString?x.bytesToString(r):m.bytesToHex(r)}});function I(e,t){var r=t.method,n=t.path,o=[r,encodeURI(n)];["date","policy","contentMd5"].forEach(function(e){t[e]&&o.push(t[e])});var i=x(e.password,o.join("&"));return"UPYUN "+e.operatorName+":"+i}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var U={genSign:I,getHeaderSign:function(e,t,r){var n=3