urlbox-next
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -11,4 +11,3 @@ 'use strict'; | ||
var DEFAULT_PREFIX = "https://api.urlbox.io/v1/"; | ||
var DEFAULT_OPTIONS = { | ||
format: "png" | ||
var DEFAULT_OPTIONS = {// format: "png" | ||
}; | ||
@@ -15,0 +14,0 @@ function index (key, secret, prefix) { |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("qs"),e=require("crypto-js/hmac-sha1"),t={format:"png"},n=function(r,t){return e(r,t)},o=function(e){return r.stringify(e,{encoder:function(r){return encodeURIComponent(r).replace(/[!'()*]/g,(function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()}))},filter:function(r,e){if("format"!==r&&"token"!==r&&"key"!==r&&e)return e},arrayFormat:"repeat"})},u=function(r){if(!r)throw new Error("no options object passed");if(null!=r.url&&"string"!=typeof r.url)throw new Error("url should be of type string (something like google.com)");if(null===r.url||null===r.html)throw new Error("url or html option is required");return Object.assign({},t,r)};exports.default=function(r,e,t){if(void 0===t&&(t="https://api.urlbox.io/v1/"),!r)throw new Error("Please provide your urlbox API key");if(!e)throw new Error("Please provide your urlbox secret key");return{buildUrl:function(i){i=u(i);var l=o(i);if(e){var a=n(l,e);return""+t+r+"/"+a+"/"+(i.format||"png")+"?"+l}return""+t+r+"/"+(i.format||"png")+"?"+l},buildUrls:function(i){i=u(i);var l=o(i),a=n(l,e);return{unauthenticated:""+t+r+"/"+(i.format||"png")+"?"+l,authenticated:""+t+r+"/"+a+"/"+(i.format||"png")+"?"+l,postJSON:"curl "+t+'render \n -H "Authorization: Bearer '+e+'" \n -H "Content-Type: application/json" \n'+JSON.stringify(i,null,2),postForm:"curl "+t+"render"}}}}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("qs"),e=require("crypto-js/hmac-sha1"),t={},n=function(r,t){return e(r,t)},o=function(e){return r.stringify(e,{encoder:function(r){return encodeURIComponent(r).replace(/[!'()*]/g,(function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()}))},filter:function(r,e){if("format"!==r&&"token"!==r&&"key"!==r&&e)return e},arrayFormat:"repeat"})},u=function(r){if(!r)throw new Error("no options object passed");if(null!=r.url&&"string"!=typeof r.url)throw new Error("url should be of type string (something like google.com)");if(null===r.url||null===r.html)throw new Error("url or html option is required");return Object.assign({},t,r)};exports.default=function(r,e,t){if(void 0===t&&(t="https://api.urlbox.io/v1/"),!r)throw new Error("Please provide your urlbox API key");if(!e)throw new Error("Please provide your urlbox secret key");return{buildUrl:function(i){i=u(i);var l=o(i);if(e){var a=n(l,e);return""+t+r+"/"+a+"/"+(i.format||"png")+"?"+l}return""+t+r+"/"+(i.format||"png")+"?"+l},buildUrls:function(i){i=u(i);var l=o(i),a=n(l,e);return{unauthenticated:""+t+r+"/"+(i.format||"png")+"?"+l,authenticated:""+t+r+"/"+a+"/"+(i.format||"png")+"?"+l,postJSON:"curl "+t+'render \n -H "Authorization: Bearer '+e+'" \n -H "Content-Type: application/json" \n'+JSON.stringify(i,null,2),postForm:"curl "+t+"render"}}}}; | ||
//# sourceMappingURL=urlbox-next.cjs.production.min.js.map |
@@ -7,4 +7,3 @@ var qs = /*#__PURE__*/require("qs"); | ||
var DEFAULT_PREFIX = "https://api.urlbox.io/v1/"; | ||
var DEFAULT_OPTIONS = { | ||
format: "png" | ||
var DEFAULT_OPTIONS = {// format: "png" | ||
}; | ||
@@ -11,0 +10,0 @@ function index (key, secret, prefix) { |
{ | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"license": "MIT", | ||
@@ -4,0 +4,0 @@ "main": "dist/index.js", |
@@ -9,3 +9,3 @@ "use strict"; | ||
const DEFAULT_OPTIONS = { | ||
format: "png" | ||
// format: "png" | ||
}; | ||
@@ -12,0 +12,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
34141
283