dropbox-client
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -1,6 +0,7 @@ | ||
[HEAD] | ||
[3.0.2] | ||
> Apr 28, 2016 | ||
- Update http-client dep | ||
[HEAD]: https://github.com/mjackson/dropbox-client/compare/v3.0.1...HEAD | ||
[3.0.2]: https://github.com/mjackson/dropbox-client/compare/v3.0.1...v3.0.2 | ||
@@ -7,0 +8,0 @@ [3.0.1] |
{ | ||
"name": "dropbox-client", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Dropbox API client", | ||
@@ -14,3 +14,3 @@ "author": "Michael Jackson", | ||
"lint": "eslint modules", | ||
"test": "npm run lint && mocha -r babel-register modules/**/*-test.js", | ||
"test": "npm run lint && mocha -r babel-register -r modules/__tests__/globals modules/**/*-test.js", | ||
"build": "node ./scripts/build.js", | ||
@@ -17,0 +17,0 @@ "build-cjs": "rimraf lib && babel ./modules -d lib --ignore '__tests__'", |
@@ -78,3 +78,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var _DropboxRPC = __webpack_require__(5); | ||
var _DropboxRPC = __webpack_require__(7); | ||
@@ -136,3 +136,3 @@ Object.defineProperty(exports, 'copy', { | ||
var _DropboxContent = __webpack_require__(6); | ||
var _DropboxContent = __webpack_require__(8); | ||
@@ -321,3 +321,3 @@ Object.defineProperty(exports, 'download', { | ||
var _queryString = __webpack_require__(2); | ||
var _queryString = __webpack_require__(5); | ||
@@ -346,3 +346,5 @@ var stringifyQuery = function stringifyQuery(query) { | ||
return fetch(input, options).then(function (response) { | ||
return options.responseHandlers ? enhanceResponse(response, options.responseHandlers) : response; | ||
var responseHandlers = options.responseHandlers; | ||
return responseHandlers && responseHandlers.length ? enhanceResponse(response, responseHandlers) : response; | ||
}); | ||
@@ -356,3 +358,2 @@ }; | ||
var emptyStack = function emptyStack(fetch, input, options) { | ||
@@ -570,3 +571,87 @@ return fetch(input, options); | ||
'use strict'; | ||
var strictUriEncode = __webpack_require__(6); | ||
exports.extract = function (str) { | ||
return str.split('?')[1] || ''; | ||
}; | ||
exports.parse = function (str) { | ||
if (typeof str !== 'string') { | ||
return {}; | ||
} | ||
str = str.trim().replace(/^(\?|#|&)/, ''); | ||
if (!str) { | ||
return {}; | ||
} | ||
return str.split('&').reduce(function (ret, param) { | ||
var parts = param.replace(/\+/g, ' ').split('='); | ||
// Firefox (pre 40) decodes `%3D` to `=` | ||
// https://github.com/sindresorhus/query-string/pull/37 | ||
var key = parts.shift(); | ||
var val = parts.length > 0 ? parts.join('=') : undefined; | ||
key = decodeURIComponent(key); | ||
// missing `=` should be `null`: | ||
// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters | ||
val = val === undefined ? null : decodeURIComponent(val); | ||
if (!ret.hasOwnProperty(key)) { | ||
ret[key] = val; | ||
} else if (Array.isArray(ret[key])) { | ||
ret[key].push(val); | ||
} else { | ||
ret[key] = [ret[key], val]; | ||
} | ||
return ret; | ||
}, {}); | ||
}; | ||
exports.stringify = function (obj) { | ||
return obj ? Object.keys(obj).sort().map(function (key) { | ||
var val = obj[key]; | ||
if (val === undefined) { | ||
return ''; | ||
} | ||
if (val === null) { | ||
return key; | ||
} | ||
if (Array.isArray(val)) { | ||
return val.slice().sort().map(function (val2) { | ||
return strictUriEncode(key) + '=' + strictUriEncode(val2); | ||
}).join('&'); | ||
} | ||
return strictUriEncode(key) + '=' + strictUriEncode(val); | ||
}).filter(function (x) { | ||
return x.length > 0; | ||
}).join('&') : ''; | ||
}; | ||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
module.exports = function (str) { | ||
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { | ||
return '%' + c.charCodeAt(0).toString(16).toUpperCase(); | ||
}); | ||
}; | ||
/***/ }, | ||
/* 7 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -647,3 +732,3 @@ value: true | ||
/***/ }, | ||
/* 6 */ | ||
/* 8 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -650,0 +735,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DropboxClient=t():e.DropboxClient=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);Object.defineProperty(t,"generateAuthorizeURL",{enumerable:!0,get:function(){return r.generateAuthorizeURL}}),Object.defineProperty(t,"getBearerToken",{enumerable:!0,get:function(){return r.getBearerToken}});var o=n(5);Object.defineProperty(t,"copy",{enumerable:!0,get:function(){return o.copy}}),Object.defineProperty(t,"createFolder",{enumerable:!0,get:function(){return o.createFolder}}),Object.defineProperty(t,"getMetadata",{enumerable:!0,get:function(){return o.getMetadata}}),Object.defineProperty(t,"listFolder",{enumerable:!0,get:function(){return o.listFolder}}),Object.defineProperty(t,"listFolderContinue",{enumerable:!0,get:function(){return o.listFolderContinue}}),Object.defineProperty(t,"getAccount",{enumerable:!0,get:function(){return o.getAccount}}),Object.defineProperty(t,"getAccountBatch",{enumerable:!0,get:function(){return o.getAccountBatch}}),Object.defineProperty(t,"getCurrentAccount",{enumerable:!0,get:function(){return o.getCurrentAccount}}),Object.defineProperty(t,"getSpaceUsage",{enumerable:!0,get:function(){return o.getSpaceUsage}});var u=n(4);Object.defineProperty(t,"download",{enumerable:!0,get:function(){return u.download}}),Object.defineProperty(t,"getPreview",{enumerable:!0,get:function(){return u.getPreview}}),Object.defineProperty(t,"getThumbnail",{enumerable:!0,get:function(){return u.getThumbnail}}),Object.defineProperty(t,"upload",{enumerable:!0,get:function(){return u.upload}}),Object.defineProperty(t,"getFile",{enumerable:!0,get:function(){return u.download}}),Object.defineProperty(t,"putFile",{enumerable:!0,get:function(){return u.upload}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.requestInfo=t.parseJSON=t.parseText=t.handleResponse=t.params=t.json=t.body=t.query=t.base=t.accept=t.auth=t.header=t.method=t.init=t.createFetch=t.createStack=t.fetch=t.enhanceFetch=void 0;var r=n(2),o=function(e){return"string"==typeof e?e:(0,r.stringify)(e)},u=function(e){return"string"==typeof e?e:JSON.stringify(e)},i=function(e,t){return t.reduce(function(e,t){return e.then(t)},Promise.resolve(e))},c=t.enhanceFetch=function(e){return function(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return e(t,n).then(function(e){return n.responseHandlers?i(e,n.responseHandlers):e})}},a=c(fetch);t.fetch=a;var f=function(e,t,n){return e(t,n)},s=t.createStack=function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return 0===t.length?f:t.reduceRight(function(e,t){return function(n,r,o){return t(function(t,r){return e(n,t,r)},r,o)}})},d=(t.createFetch=function(){if(0===arguments.length)return a;var e=s.apply(void 0,arguments);return c(function(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return e(n.fetch||fetch,t,n)})},t.init=function(e,t){return function(n,r){var o=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return o[e]=t,n(r,o)}}),l=(t.method=function(e){return d("method",e)},function(e,t,n){(e.headers||(e.headers={}))[t]=n}),p=t.header=function(e,t){return function(n,r){var o=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return l(o,e,t),n(r,o)}},g=(t.auth=function(e){return p("Authorization",e)},t.accept=function(e){return p("Accept",e)},t.base=function(e){return function(t,n,r){return t(e+(n||""),r)}},t.query=function(e){var t=o(e);return function(e,n,r){return e(n+(-1===n.indexOf("?")?"?":"&")+t,r)}}),h=t.body=function(e,t){return function(n,r){var o=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return o.body=e,null!=e.length&&l(o,"Content-Length",e.length),t&&l(o,"Content-Type",t),n(r,o)}},v=(t.json=function(e){return h(u(e),"application/json")},t.params=function(e){var t=o(e);return function(e,n){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],o=(r.method||"GET").toUpperCase(),u="GET"===o||"HEAD"===o?g(t):h(t,"application/x-www-form-urlencoded");return u(e,n,r)}},t.handleResponse=function(e){return function(t,n){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return(r.responseHandlers||(r.responseHandlers=[])).push(e),t(n,r)}});t.parseText=function(){var e=arguments.length<=0||void 0===arguments[0]?"textString":arguments[0];return v(function(t){return t.text().then(function(n){return t[e]=n,t})})},t.parseJSON=function(){var e=arguments.length<=0||void 0===arguments[0]?"jsonData":arguments[0];return v(function(t){return t.json().then(function(n){return t[e]=n,t},function(e){throw new Error("Error parsing JSON: "+e.stack)})})},t.requestInfo=function(){return function(e,t,n){return e(t,n).then(function(e){return e.requestInput=t,e.requestOptions=n,e},function(){var e=arguments.length<=0||void 0===arguments[0]?new Error:arguments[0];throw e.requestInput=t,e.requestOptions=n,e})}}},function(e,t,n){"use strict";var r=n(6);t.extract=function(e){return e.split("?")[1]||""},t.parse=function(e){return"string"!=typeof e?{}:(e=e.trim().replace(/^(\?|#|&)/,""),e?e.split("&").reduce(function(e,t){var n=t.replace(/\+/g," ").split("="),r=n.shift(),o=n.length>0?n.join("="):void 0;return r=decodeURIComponent(r),o=void 0===o?null:decodeURIComponent(o),e.hasOwnProperty(r)?Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]:e[r]=o,e},{}):{})},t.stringify=function(e){return e?Object.keys(e).sort().map(function(t){var n=e[t];return void 0===n?"":null===n?t:Array.isArray(n)?n.slice().sort().map(function(e){return r(t)+"="+r(e)}).join("&"):r(t)+"="+r(n)}).filter(function(e){return e.length>0}).join("&"):""}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBearerToken=t.generateAuthorizeURL=void 0;var r=n(2),o=n(1),u=(t.generateAuthorizeURL=function(e,t,n){var o=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];return"https://www.dropbox.com/1/oauth2/authorize?"+(0,r.stringify)({response_type:"code",client_id:e,redirect_uri:t,state:n,force_reapprove:o})},function(e){var t=e.jsonData;if(t.error)throw new Error(t.error+": "+t.error_description);return t}),i=function(e){return e.access_token},c=(0,o.createStack)((0,o.parseJSON)(),(0,o.handleResponse)(u),(0,o.handleResponse)(i));t.getBearerToken=function(e,t,n,r){return(0,o.createFetch)((0,o.method)("POST"),(0,o.params)({client_id:e,client_secret:t,grant_type:"authorization_code",redirect_uri:r,code:n}),c)("https://api.dropboxapi.com/1/oauth2/token")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.upload=t.getThumbnail=t.getPreview=t.download=void 0;var r=n(1),o=function(e){return(0,r.auth)("Bearer "+e)},u=function(e){return(0,r.base)("https://content.dropboxapi.com/"+e)},i=function(e){return(0,r.header)("Dropbox-API-Arg",JSON.stringify(e))},c=function(){var e=arguments.length<=0||void 0===arguments[0]?"apiResult":arguments[0];return(0,r.handleResponse)(function(t){var n=t.headers.get("Dropbox-API-Result");return n&&(t[e]=JSON.parse(n)),t})},a=(0,r.createStack)(c(),(0,r.handleResponse)(function(e){return{metadata:e.apiResult,content:e.body}})),f=function(e,t,n){return(0,r.createFetch)((0,r.method)("POST"),o(e),u(2),i(n),a)(t)},s=function(e,t,n,c,a){return(0,r.createFetch)((0,r.method)("POST"),o(e),u(2),i(a),(0,r.body)(t,n))(c)};t.download=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return f(e,"/files/download",t)},t.getPreview=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return f(e,"/files/get_preview",t)},t.getThumbnail=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return f(e,"/files/get_thumbnail",t)},t.upload=function(e,t){var n=arguments.length<=2||void 0===arguments[2]?"application/octet-stream":arguments[2],r=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];return s(e,t,n,"/files/upload",r)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSpaceUsage=t.getCurrentAccount=t.getAccountBatch=t.getAccount=t.listFolderContinue=t.listFolder=t.getMetadata=t.createFolder=t.copy=void 0;var r=n(1),o=function(e){return(0,r.auth)("Bearer "+e)},u=function(e){return(0,r.base)("https://api.dropboxapi.com/"+e)},i=(0,r.createStack)((0,r.parseJSON)(),(0,r.handleResponse)(function(e){var t=e.jsonData;if(t.error_summary)throw new Error(t.error_summary);return t})),c=function(e,t){return(0,r.createFetch)((0,r.method)("POST"),o(e),u(2),i)(t)},a=function(e,t,n){return(0,r.createFetch)((0,r.method)("POST"),o(e),u(2),(0,r.json)(n),i)(t)};t.copy=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/files/copy",t)},t.createFolder=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/files/create_folder",t)},t.getMetadata=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/files/get_metadata",t)},t.listFolder=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/files/list_folder",t)},t.listFolderContinue=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/files/list_folder/continue",t)},t.getAccount=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/users/get_account",t)},t.getAccountBatch=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/users/get_account_batch",t)},t.getCurrentAccount=function(e){return c(e,"/users/get_current_account")},t.getSpaceUsage=function(e){return c(e,"/users/get_space_usage")}},function(e,t){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DropboxClient=t():e.DropboxClient=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"generateAuthorizeURL",{enumerable:!0,get:function(){return r.generateAuthorizeURL}}),Object.defineProperty(t,"getBearerToken",{enumerable:!0,get:function(){return r.getBearerToken}});var o=n(4);Object.defineProperty(t,"copy",{enumerable:!0,get:function(){return o.copy}}),Object.defineProperty(t,"createFolder",{enumerable:!0,get:function(){return o.createFolder}}),Object.defineProperty(t,"getMetadata",{enumerable:!0,get:function(){return o.getMetadata}}),Object.defineProperty(t,"listFolder",{enumerable:!0,get:function(){return o.listFolder}}),Object.defineProperty(t,"listFolderContinue",{enumerable:!0,get:function(){return o.listFolderContinue}}),Object.defineProperty(t,"getAccount",{enumerable:!0,get:function(){return o.getAccount}}),Object.defineProperty(t,"getAccountBatch",{enumerable:!0,get:function(){return o.getAccountBatch}}),Object.defineProperty(t,"getCurrentAccount",{enumerable:!0,get:function(){return o.getCurrentAccount}}),Object.defineProperty(t,"getSpaceUsage",{enumerable:!0,get:function(){return o.getSpaceUsage}});var u=n(3);Object.defineProperty(t,"download",{enumerable:!0,get:function(){return u.download}}),Object.defineProperty(t,"getPreview",{enumerable:!0,get:function(){return u.getPreview}}),Object.defineProperty(t,"getThumbnail",{enumerable:!0,get:function(){return u.getThumbnail}}),Object.defineProperty(t,"upload",{enumerable:!0,get:function(){return u.upload}}),Object.defineProperty(t,"getFile",{enumerable:!0,get:function(){return u.download}}),Object.defineProperty(t,"putFile",{enumerable:!0,get:function(){return u.upload}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.requestInfo=t.parseJSON=t.parseText=t.handleResponse=t.params=t.json=t.body=t.query=t.base=t.accept=t.auth=t.header=t.method=t.init=t.createFetch=t.createStack=t.fetch=t.enhanceFetch=void 0;var r=n(7),o=function(e){return"string"==typeof e?e:(0,r.stringify)(e)},u=function(e){return"string"==typeof e?e:JSON.stringify(e)},i=function(e,t){return t.reduce(function(e,t){return e.then(t)},Promise.resolve(e))},c=t.enhanceFetch=function(e){return function(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return e(t,n).then(function(e){var t=n.responseHandlers;return t&&t.length?i(e,t):e})}},a=c(fetch);t.fetch=a;var f=function(e,t,n){return e(t,n)},s=t.createStack=function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return 0===t.length?f:t.reduceRight(function(e,t){return function(n,r,o){return t(function(t,r){return e(n,t,r)},r,o)}})},d=(t.createFetch=function(){if(0===arguments.length)return a;var e=s.apply(void 0,arguments);return c(function(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return e(n.fetch||fetch,t,n)})},t.init=function(e,t){return function(n,r){var o=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return o[e]=t,n(r,o)}}),l=(t.method=function(e){return d("method",e)},function(e,t,n){(e.headers||(e.headers={}))[t]=n}),p=t.header=function(e,t){return function(n,r){var o=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return l(o,e,t),n(r,o)}},g=(t.auth=function(e){return p("Authorization",e)},t.accept=function(e){return p("Accept",e)},t.base=function(e){return function(t,n,r){return t(e+(n||""),r)}},t.query=function(e){var t=o(e);return function(e,n,r){return e(n+(-1===n.indexOf("?")?"?":"&")+t,r)}}),h=t.body=function(e,t){return function(n,r){var o=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return o.body=e,null!=e.length&&l(o,"Content-Length",e.length),t&&l(o,"Content-Type",t),n(r,o)}},v=(t.json=function(e){return h(u(e),"application/json")},t.params=function(e){var t=o(e);return function(e,n){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],o=(r.method||"GET").toUpperCase(),u="GET"===o||"HEAD"===o?g(t):h(t,"application/x-www-form-urlencoded");return u(e,n,r)}},t.handleResponse=function(e){return function(t,n){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return(r.responseHandlers||(r.responseHandlers=[])).push(e),t(n,r)}});t.parseText=function(){var e=arguments.length<=0||void 0===arguments[0]?"textString":arguments[0];return v(function(t){return t.text().then(function(n){return t[e]=n,t})})},t.parseJSON=function(){var e=arguments.length<=0||void 0===arguments[0]?"jsonData":arguments[0];return v(function(t){return t.json().then(function(n){return t[e]=n,t},function(e){throw new Error("Error parsing JSON: "+e.stack)})})},t.requestInfo=function(){return function(e,t,n){return e(t,n).then(function(e){return e.requestInput=t,e.requestOptions=n,e},function(){var e=arguments.length<=0||void 0===arguments[0]?new Error:arguments[0];throw e.requestInput=t,e.requestOptions=n,e})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBearerToken=t.generateAuthorizeURL=void 0;var r=n(5),o=n(1),u=(t.generateAuthorizeURL=function(e,t,n){var o=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];return"https://www.dropbox.com/1/oauth2/authorize?"+(0,r.stringify)({response_type:"code",client_id:e,redirect_uri:t,state:n,force_reapprove:o})},function(e){var t=e.jsonData;if(t.error)throw new Error(t.error+": "+t.error_description);return t}),i=function(e){return e.access_token},c=(0,o.createStack)((0,o.parseJSON)(),(0,o.handleResponse)(u),(0,o.handleResponse)(i));t.getBearerToken=function(e,t,n,r){return(0,o.createFetch)((0,o.method)("POST"),(0,o.params)({client_id:e,client_secret:t,grant_type:"authorization_code",redirect_uri:r,code:n}),c)("https://api.dropboxapi.com/1/oauth2/token")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.upload=t.getThumbnail=t.getPreview=t.download=void 0;var r=n(1),o=function(e){return(0,r.auth)("Bearer "+e)},u=function(e){return(0,r.base)("https://content.dropboxapi.com/"+e)},i=function(e){return(0,r.header)("Dropbox-API-Arg",JSON.stringify(e))},c=function(){var e=arguments.length<=0||void 0===arguments[0]?"apiResult":arguments[0];return(0,r.handleResponse)(function(t){var n=t.headers.get("Dropbox-API-Result");return n&&(t[e]=JSON.parse(n)),t})},a=(0,r.createStack)(c(),(0,r.handleResponse)(function(e){return{metadata:e.apiResult,content:e.body}})),f=function(e,t,n){return(0,r.createFetch)((0,r.method)("POST"),o(e),u(2),i(n),a)(t)},s=function(e,t,n,c,a){return(0,r.createFetch)((0,r.method)("POST"),o(e),u(2),i(a),(0,r.body)(t,n))(c)};t.download=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return f(e,"/files/download",t)},t.getPreview=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return f(e,"/files/get_preview",t)},t.getThumbnail=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return f(e,"/files/get_thumbnail",t)},t.upload=function(e,t){var n=arguments.length<=2||void 0===arguments[2]?"application/octet-stream":arguments[2],r=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];return s(e,t,n,"/files/upload",r)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSpaceUsage=t.getCurrentAccount=t.getAccountBatch=t.getAccount=t.listFolderContinue=t.listFolder=t.getMetadata=t.createFolder=t.copy=void 0;var r=n(1),o=function(e){return(0,r.auth)("Bearer "+e)},u=function(e){return(0,r.base)("https://api.dropboxapi.com/"+e)},i=(0,r.createStack)((0,r.parseJSON)(),(0,r.handleResponse)(function(e){var t=e.jsonData;if(t.error_summary)throw new Error(t.error_summary);return t})),c=function(e,t){return(0,r.createFetch)((0,r.method)("POST"),o(e),u(2),i)(t)},a=function(e,t,n){return(0,r.createFetch)((0,r.method)("POST"),o(e),u(2),(0,r.json)(n),i)(t)};t.copy=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/files/copy",t)},t.createFolder=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/files/create_folder",t)},t.getMetadata=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/files/get_metadata",t)},t.listFolder=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/files/list_folder",t)},t.listFolderContinue=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/files/list_folder/continue",t)},t.getAccount=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/users/get_account",t)},t.getAccountBatch=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a(e,"/users/get_account_batch",t)},t.getCurrentAccount=function(e){return c(e,"/users/get_current_account")},t.getSpaceUsage=function(e){return c(e,"/users/get_space_usage")}},function(e,t,n){"use strict";var r=n(6);t.extract=function(e){return e.split("?")[1]||""},t.parse=function(e){return"string"!=typeof e?{}:(e=e.trim().replace(/^(\?|#|&)/,""),e?e.split("&").reduce(function(e,t){var n=t.replace(/\+/g," ").split("="),r=n.shift(),o=n.length>0?n.join("="):void 0;return r=decodeURIComponent(r),o=void 0===o?null:decodeURIComponent(o),e.hasOwnProperty(r)?Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]:e[r]=o,e},{}):{})},t.stringify=function(e){return e?Object.keys(e).sort().map(function(t){var n=e[t];return void 0===n?"":null===n?t:Array.isArray(n)?n.slice().sort().map(function(e){return r(t)+"="+r(e)}).join("&"):r(t)+"="+r(n)}).filter(function(e){return e.length>0}).join("&"):""}},function(e,t){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},function(e,t,n){"use strict";var r=n(8);t.extract=function(e){return e.split("?")[1]||""},t.parse=function(e){return"string"!=typeof e?{}:(e=e.trim().replace(/^(\?|#|&)/,""),e?e.split("&").reduce(function(e,t){var n=t.replace(/\+/g," ").split("="),r=n.shift(),o=n.length>0?n.join("="):void 0;return r=decodeURIComponent(r),o=void 0===o?null:decodeURIComponent(o),e.hasOwnProperty(r)?Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]:e[r]=o,e},{}):{})},t.stringify=function(e){return e?Object.keys(e).sort().map(function(t){var n=e[t];return void 0===n?"":null===n?t:Array.isArray(n)?n.slice().sort().map(function(e){return r(t)+"="+r(e)}).join("&"):r(t)+"="+r(n)}).filter(function(e){return e.length>0}).join("&"):""}},function(e,t){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}}])}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47657
895