Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-easypost

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-easypost - npm Package Compare versions

Comparing version 3.0.0-rc.13 to 3.0.0-rc.14

2

easypost.js
!function(e,t){for(var r in t)e[r]=t[r]}(exports,function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,t,r){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=29)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,u){try{var a=t[o](u),i=a.value}catch(e){return void r(e)}return a.done?void e(i):Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)})}return n("next")})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(28),s=n(i),c=r(27),f=n(c);t.default=function(e){var t,r;return r=t=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(this,t),this._validationErrors=null,this.mapProps(e)}return t.retrieve=function(){function t(e){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(r){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.get(this.url+"/"+r);case 3:return n=t.sent,t.abrupt("return",this.create(n.body));case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 10:case"end":return t.stop()}},t,this,[[0,7]])}));return t}(),t.all=function(){function t(e){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(){var r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.get(""+this.url,{query:n});case 3:return r=t.sent,t.abrupt("return",this.unwrapAll(r.body).map(this.create.bind(this)));case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 10:case"end":return t.stop()}},t,this,[[0,7]])}));return t}(),t.delete=function(){function t(e){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(r){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}throw new Error("No id was passed into "+this._name+" delete()");case 2:return t.prev=2,t.next=5,e.del(this.url+"/"+r);case 5:return t.abrupt("return",t.sent);case 8:return t.prev=8,t.t0=t.catch(2),t.abrupt("return",Promise.reject(t.t0));case 11:case"end":return t.stop()}},t,this,[[2,8]])}));return t}(),t.notImplemented=function(e){return Promise.reject(new f.default(e,this.url))},t.wrapJSON=function(e){var t;return t={},t[this.key]=e,t},t.create=function(e){return new this(e)},t.unwrapAll=function(e){return Array.isArray(e)?e:e[this.url]},t.prototype.validateProperties=function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._validationErrors=null;var r=this.toJSON(),n=Object.keys(this.constructor.propTypes).reduce(function(t,n){var o=e.constructor.propTypes[n](r,n,""+e.constructor._name,"prop",n);return o?(t=t||{},t[n]=o.toString(),t):t},!1);if(this._validationErrors=n||null,n&&t)throw new s.default(n,this.constructor._name);return n},t.prototype.mapProps=function(e){var t=this;Object.keys(e).forEach(function(r){t[r]=e[r]})},t.prototype.verifyParameters=function(){for(var e=this,t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o.this&&o.this.forEach(function(t){if(!e[t])throw new Error("Object requires "+t+" to be set.")}),o.args&&o.args.forEach(function(e,t){if(!r[t])throw new Error("Missing parameter: "+e)})},t.prototype.rpc=function(){function t(e,t,n){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(r,n,o){var u,a,i,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(u=r?"/"+r:"",a=o||this.constructor.url,i=a+"/"+this.id+u,t.prev=3,s=void 0,!n){t.next=11;break}return t.next=8,e.post(i,{body:n});case 8:s=t.sent,t.next=14;break;case 11:return t.next=13,e.post(i);case 13:s=t.sent;case 14:return this.mapProps(s.body),t.abrupt("return",this);case 18:throw t.prev=18,t.t0=t.catch(3),t.t0;case 21:case"end":return t.stop()}},t,this,[[3,18]])}));return t}(),t.prototype.save=function(){function t(){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(){var r,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,this.validateProperties(),t.next=7;break;case 4:return t.prev=4,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 7:if(t.prev=7,r=this.constructor.wrapJSON(this.toJSON()),n=void 0,!this.id){t.next=16;break}return t.next=13,e.put(this.constructor.url+"/"+this.id,{body:r});case 13:n=t.sent,t.next=19;break;case 16:return t.next=18,e.post(this.constructor.url,{body:r});case 18:n=t.sent;case 19:return this.mapProps(n.body),t.abrupt("return",this);case 23:throw t.prev=23,t.t1=t.catch(7),t.t1;case 26:case"end":return t.stop()}},t,this,[[0,4],[7,23]])}));return t}(),t.prototype.retrieve=function(){function e(){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.id){e.next=4;break}return e.delegateYield(regeneratorRuntime.mark(function e(){var r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.constructor.retrieve(t.id);case 2:r=e.sent,n=r.toJSON(),Object.keys(n).forEach(function(e){t[e]=n[e]});case 5:case"end":return e.stop()}},e,t)})(),"t0",2);case 2:e.next=5;break;case 4:throw new Error("Cannot retrieve an object without an id.");case 5:case"end":return e.stop()}},e,this)}));return e}(),t.prototype.toJSON=function(){var e=this,t=this.constructor.jsonIdKeys;return Object.keys(this.constructor.propTypes).reduce(function(r,n){return e[n]?t.includes(n)&&"object"!==a(e[n])?(r[n]={id:e[n]},r):t.includes(n)&&e[n].id?(r[n]={id:e[n].id},r):e[n].toJSON?(r[n]=e[n].toJSON(),r):(r[n]=e[n],r):r},{})},t}(),t.url=null,t._name=null,t.key=null,t.propTypes={},t.jsonIdKeys=[],r}},function(e,t){e.exports=require("proptypes")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c);t.default=function(e){var t,r;return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t.all=function(){return this.notImplemented("all")},t.delete=function(){return this.notImplemented("delete")},t.wrapJSON=function(e){var t=["verify","verify_strict"];return Object.keys(e).reduce(function(r,n){return t.includes(n)?(r[n]=e[n],r):(r.address[n]=e[n],r)},{address:{}})},t}((0,f.default)(e)),t._name="Address",t.url="addresses",t.key="address",t.propTypes={id:s.default.string,object:s.default.string,mode:s.default.string,street1:s.default.string,street2:s.default.string,city:s.default.string,state:s.default.string,zip:s.default.string,country:s.default.string,residential:s.default.bool,carrier_facility:s.default.string,name:s.default.string,company:s.default.string,phone:s.default.string,email:s.default.string,federal_tax_id:s.default.string,state_tax_id:s.default.string,verify:s.default.array,verify_strict:s.default.array,verifications:s.default.object},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,u){try{var a=t[o](u),i=a.value}catch(e){return void r(e)}return a.done?void e(i):Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)})}return n("next")})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=r(1),f=n(c),l=r(0),p=n(l),d=r(2),h=n(d),y=r(10),b=n(y),m=r(7),_=n(m),v=r(9),g=n(v),w=r(4),O=n(w);t.default=function(e){var t,r,n=(0,h.default)(e),c=(0,b.default)(e),l=(0,_.default)(e),d=(0,g.default)(e),y=(0,O.default)(e);return r=t=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return i(t,e),t.delete=function(){return this.notImplemented("delete")},t.prototype.buy=function(){function e(e,r){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(t,r){var n,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyParameters({this:["id"],args:["rate"]},t),n=t,"object"===("undefined"==typeof t?"undefined":s(t))&&(n=t.id),o={rate:{id:n}},r&&(o.insurance=r),e.abrupt("return",this.rpc("buy",o));case 6:case"end":return e.stop()}},e,this)}));return e}(),t.prototype.convertLabelFormat=function(){function e(e){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyParameters({this:["id"],args:["format"]},t),e.abrupt("return",this.rpc("label",{file_format:t}));case 2:case"end":return e.stop()}},e,this)}));return e}(),t.prototype.regenerateRates=function(){function e(){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyParameters({this:["id"]}),e.abrupt("return",this.rpc("rates"));case 2:case"end":return e.stop()}},e,this)}));return e}(),t.prototype.insure=function(){function e(e){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyParameters({this:["id"],args:["amount"]},t),e.abrupt("return",this.rpc("insure",{amount:t}));case 2:case"end":return e.stop()}},e,this)}));return e}(),t.prototype.refund=function(){function e(){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyParameters({this:["id"]}),e.abrupt("return",this.rpc("refund"));case 2:case"end":return e.stop()}},e,this)}));return e}(),t.prototype.return=function(){function e(){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyParameters({this:["id","to_address","from_address"]}),t=this.toJSON(),t.is_return=!0,e.abrupt("return",this.rpc("",t));case 4:case"end":return e.stop()}},e,this)}));return e}(),t.prototype.lowestRate=function(e,t){var r=this.rates||[];return e&&!function(){var t=e.map(function(e){return e.toLowerCase()});r=r.filter(function(e){return t.includes(e.carrier.toLowerCase())})}(),t&&!function(){var e=t.map(function(e){return e.toLowerCase()});r=r.filter(function(t){return e.includes(t.service.toLowerCase())})}(),r.reduce(function(e,t){return parseFloat(t.rate)<parseFloat(e.rate)?t:e},r[0])},t}((0,p.default)(e)),t._name="Shipment",t.url="shipments",t.key="shipment",t.propTypes={id:f.default.string,object:f.default.string,mode:f.default.string,created_at:f.default.object,updated_at:f.default.object,to_address:f.default.oneOfType([f.default.string,f.default.shape(n.propTypes)]),from_address:f.default.oneOfType([f.default.string,f.default.shape(n.propTypes)]),return_address:f.default.oneOfType([f.default.string,f.default.shape(n.propTypes)]),buyer_address:f.default.oneOfType([f.default.string,f.default.shape(n.propTypes)]),parcel:f.default.oneOfType([f.default.string,f.default.shape(c.propTypes)]),customs_info:f.default.oneOfType([f.default.string,f.default.shape(l.propTypes)]),scan_form:f.default.oneOfType([f.default.string,f.default.object]),forms:f.default.array,insurance:f.default.oneOfType([f.default.string,f.default.shape(d.propTypes)]),rates:f.default.array,selected_rate:f.default.object,postage_label:f.default.object,messages:f.default.array,options:f.default.object,is_return:f.default.bool,tracking_code:f.default.string,usps_zone:f.default.string,status:f.default.string,tracker:f.default.oneOfType([f.default.string,f.default.shape(y.propTypes)]),fees:f.default.array,refund_status:f.default.string,batch_id:f.default.string,batch_status:f.default.string,batch_message:f.default.string},t.jsonIdKeys=["to_address","from_address","return_address","buyer_address","parcel","customs_info","insurance","tracker"],r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c);t.default=function(e){var t,r;return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t.delete=function(){return this.notImplemented("delete")},t}((0,f.default)(e)),t._name="Tracker",t.url="trackers",t.key="tracker",t.propTypes={id:s.default.string,object:s.default.string,mode:s.default.string,tracking_code:s.default.string,status:s.default.string,signed_by:s.default.string,weight:s.default.number,est_delivery_date:s.default.object,shipment_id:s.default.string,carrier:s.default.string,tracking_details:s.default.object,carrier_detail:s.default.object,public_url:s.default.string,fees:s.default.array,created_at:s.default.oneOfType([s.default.object,s.default.string]),updated_at:s.default.oneOfType([s.default.object,s.default.string])},r}},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function e(t){r(this,e),Error.captureStackTrace(this,this.constructor),Object.defineProperty(this,"message",{value:t})};t.default=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c);t.default=function(e){var t,r;return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t.wrapJSON=function(e){return e},t.unwrapAll=function(e){return e.reports},t}((0,f.default)(e)),t.url="reports/",t.propTypes={id:s.default.string,object:s.default.string,mode:s.default.string,status:s.default.string,start_date:s.default.string,end_date:s.default.string,include_children:s.default.bool,url:s.default.string,url_expires_at:s.default.object,send_email:s.default.bool,created_at:s.default.object,updated_at:s.default.object},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c),l=r(8),p=n(l);t.default=function(e){var t,r,n=(0,p.default)(e);return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t.all=function(){return e.notImplemented.call(this,"all")},t.delete=function(){return this.notImplemented("delete")},t}((0,f.default)(e)),t._name="CustomsInfo",t.url="customs_infos",t.key="customs_info",t.propTypes={id:s.default.string,object:s.default.string,mode:s.default.string,created_at:s.default.object,updated_at:s.default.object,customs_certify:s.default.bool,customs_signer:s.default.string,contents_type:s.default.string,restriction_type:s.default.string,eel_pfc:s.default.string,customs_items:s.default.arrayOf(s.default.shape(n.propTypes))},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c);t.default=function(e){var t,r;return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t.all=function(){return this.notImplemented("all")},t.delete=function(){return this.notImplemented("delete")},t}((0,f.default)(e)),t._name="CustomsItem",t.url="customs_items",t.key="customs_item",t.propTypes={id:s.default.string,object:s.default.string,mode:s.default.string,created_at:s.default.object,updated_at:s.default.object,description:s.default.string,quantity:s.default.number,value:s.default.number,weight:s.default.number,hs_tariff_number:s.default.string,code:s.default.string,origin_country:s.default.string,currency:s.default.string},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c),l=r(2),p=n(l),d=r(4),h=n(d);t.default=function(e){var t,r,n=(0,p.default)(e),i=(0,h.default)(e);return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t.delete=function(){return this.notImplemented("delete")},t}((0,f.default)(e)),t._name="Insurance",t.url="insurances",t.key="insurance",t.propTypes={id:s.default.string,object:s.default.string,mode:s.default.string,created_at:s.default.object,updated_at:s.default.object,amount:s.default.string,provider:s.default.string,provider_id:s.default.string,shipment_id:s.default.string,tracking_code:s.default.string,status:s.default.string,tracker:s.default.oneOfType([s.default.string,s.default.shape(i.propTypes)]),to_address:s.default.oneOfType([s.default.string,s.default.shape(n.propTypes)]),from_address:s.default.oneOfType([s.default.string,s.default.shape(n.propTypes)]),fee:s.default.object,messages:s.default.array},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c);t.default=function(e){var t,r;return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t.all=function(){return this.notImplemented("all")},t.delete=function(){return this.notImplemented("delete")},t}((0,f.default)(e)),t._name="Parcel",t.url="parcels",t.key="parcel",t.propTypes={id:s.default.string,object:s.default.string,mode:s.default.string,length:s.default.number,width:s.default.number,height:s.default.number,predefined_package:s.default.string,weight:s.default.number,created_at:s.default.object,updated_at:s.default.object},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.NAME=t.createMessage=void 0;var i=r(5),s=n(i),c=t.createMessage=function(e,t){return"Status "+e+" returned from API request to "+t},f=t.NAME="RequestError",l=function(e){function t(r,n){if(o(this,t),!r)throw new Error("No error passed to RequestError");if("string"!=typeof n)throw new Error("No url passed to RequestError");var a=c(r.status||r.code,n),i=u(this,e.call(this,a));return i.error=r,i.name=f,i.status=r.status||r.code,r.body&&(i.detail=r.body.error.message,i.errors=r.body.error.errors),i}return a(t,e),t}(s.default);t.default=l},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,u){try{var a=t[o](u),i=a.value}catch(e){return void r(e)}return a.done?void e(i):Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)})}return n("next")})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=r(1),f=n(c),l=r(0),p=n(l);t.default=function(e){var t,r;return r=t=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return i(t,e),t.delete=function(){return this.notImplemented("delete")},t.retrieve=function(){return this.notImplemented("retrieve")},t.prototype.save=function(){function e(){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.constructor.notImplemented("save"));case 1:case"end":return e.stop()}},e,this)}));return e}(),t.convertKeyMap=function(e){var t=this;if(!e.keys)return[];var r=e.keys.map(function(t){return s({},t,{user_id:e.id})});return e.children&&e.children.length&&(r=r.concat(e.children.map(function(e){return t.convertKeyMap(e)}))),r},t.unwrapAll=function(e){return this.convertKeyMap(e)},t.prototype.enable=function(){return this.verifyParameters({this:["id"]}),this.rpc("enable",void 0,this.constructor.url)},t.prototype.disable=function(){return this.verifyParameters({this:["id"]}),this.rpc("disable",void 0,this.constructor.url)},t}((0,p.default)(e)),t._name="ApiKey",t.url="api_keys",t.propTypes={id:f.default.string,keys:f.default.array,children:f.default.array},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_LABEL_FORMAT=void 0;var i=r(1),s=n(i),c=r(0),f=n(c),l=t.DEFAULT_LABEL_FORMAT="pdf";t.default=function(e){var t,r;return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t.all=function(){return this.notImplemented("all")},t.delete=function(){return this.notImplemented("delete")},t.prototype.addShipment=function(e){return this.verifyParameters({this:["id"],args:["shipmentId"]},e),this.rpc("add_shipments",{shipments:[{id:e}]})},t.prototype.addShipments=function(e){return this.verifyParameters({this:["id"],args:["shipmentIds"]},e),this.rpc("add_shipments",{shipments:e.map(function(e){return{id:e}})})},t.prototype.removeShipment=function(e){return this.verifyParameters({this:["id"],args:["shipmentId"]},e),this.rpc("remove_shipments",{shipments:[{id:e}]})},t.prototype.removeShipments=function(e){return this.verifyParameters({this:["id"],args:["shipmentIds"]},e),this.rpc("remove_shipments",{shipments:e.map(function(e){return{id:e}})})},t.prototype.generateLabel=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l;return this.verifyParameters({this:["id"],args:["fileFormat"]},e),this.rpc("label",{file_format:e})},t.prototype.createScanForm=function(){return this.verifyParameters({this:["id"]}),this.rpc("scan_form")},t}((0,f.default)(e)),t._name="Batch",t.url="batches",t.key="batch",t.propTypes={id:s.default.string,reference:s.default.string,object:s.default.string,mode:s.default.string,state:s.default.string,num_shipments:s.default.integer,shipments:s.default.object,status:s.default.object,label_url:s.default.string,scan_form:s.default.object,pickup:s.default.object,created_at:s.default.object,updated_at:s.default.object},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,u){try{var a=t[o](u),i=a.value}catch(e){return void r(e)}return a.done?void e(i):Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)})}return n("next")})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),c=n(s),f=r(0),l=n(f);t.default=function(e){var t,r;return r=t=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return i(t,e),t.retrieve=function(){return e.notImplemented.call(this,"retrieve")},t.prototype.save=function(){function e(){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.constructor.notImplemented("save"));case 1:case"end":return e.stop()}},e,this)}));return e}(),t}((0,l.default)(e)),t._name="CarrierAccount",t.url="carrier_accounts",t.key="carrier_account",t.propTypes={id:c.default.string,object:c.default.string,type:c.default.string,fields:c.default.object,clone:c.default.bool,description:c.default.string,reference:c.default.string,readable:c.default.string,credentials:c.default.object,test_credentials:c.default.object,created_at:c.default.oneOfType([c.default.object,c.default.string]),updated_at:c.default.oneOfType([c.default.object,c.default.string])},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,u){try{var a=t[o](u),i=a.value}catch(e){return void r(e)}return a.done?void e(i):Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)})}return n("next")})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{
constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),c=n(s),f=r(0),l=n(f);t.default=function(e){var t,r;return r=t=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return i(t,e),t.retrieve=function(){return e.notImplemented.call(this,"retrieve")},t.delete=function(){return this.notImplemented("delete")},t.prototype.save=function(){function e(){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.constructor.notImplemented("save"));case 1:case"end":return e.stop()}},e,this)}));return e}(),t}((0,l.default)(e)),t._name="CarrierType",t.url="carrier_types",t.propTypes={id:c.default.string,object:c.default.string,type:c.default.string,readable:c.default.string,logo:c.default.string,fields:c.default.object},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,u){try{var a=t[o](u),i=a.value}catch(e){return void r(e)}return a.done?void e(i):Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)})}return n("next")})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),c=n(s),f=r(2),l=n(f),p=r(3),d=n(p),h=r(0),y=n(h);t.default=function(e){var t,r,n=(0,l.default)(e),s=(0,d.default)(e);return r=t=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return i(t,e),t.delete=function(){return this.notImplemented("delete")},t.prototype.buy=function(){function e(e,r){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyParameters({this:["id"],args:["carrier","service"]},t,r),e.abrupt("return",this.rpc("buy",{carrier:t,service:r}));case 2:case"end":return e.stop()}},e,this)}));return e}(),t}((0,y.default)(e)),t._name="Order",t.url="orders",t.key="order",t.propTypes={id:c.default.string,reference:c.default.string,object:c.default.string,mode:c.default.string,created_at:c.default.object,updated_at:c.default.object,to_address:c.default.oneOfType([c.default.string,c.default.shape(n.propTypes)]),from_address:c.default.oneOfType([c.default.string,c.default.shape(n.propTypes)]),return_address:c.default.oneOfType([c.default.string,c.default.shape(n.propTypes)]),buyer_address:c.default.oneOfType([c.default.string,c.default.shape(n.propTypes)]),shipments:c.default.arrayOf(s.propTypes),rates:c.default.arrayOf(c.default.object),messages:c.default.arrayOf(c.default.object),is_return:c.default.bool,carrier_accounts:c.default.arrayOf(c.default.oneOfType([c.default.string,c.default.object]))},t.jsonIdKeys=["to_address","from_address","return_address","buyer_address"],r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(6),s=n(i);t.default=function(e){var t,r,n=(0,s.default)(e);return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t}(n),t._name="PaymentLogReport",t.url=n.url+"payment_log",r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,u){try{var a=t[o](u),i=a.value}catch(e){return void r(e)}return a.done?void e(i):Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)})}return n("next")})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),c=n(s),f=r(0),l=n(f),p=r(3),d=n(p),h=r(2),y=n(h);t.default=function(e){var t,r,n=(0,d.default)(e),s=(0,y.default)(e);return r=t=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return i(t,e),t.all=function(){return this.notImplemented("all")},t.delete=function(){return this.notImplemented("delete")},t.prototype.buy=function(){function e(e,r){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyParameters({this:["id"],args:["carrier","service"]},t,r),e.abrupt("return",this.rpc("buy",{carrier:t,service:r}));case 2:case"end":return e.stop()}},e,this)}));return e}(),t.prototype.cancel=function(){function e(){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyParameters({this:["id"]}),e.abrupt("return",this.rpc("cancel"));case 2:case"end":return e.stop()}},e,this)}));return e}(),t}((0,l.default)(e)),t._name="Pickup",t.url="pickups",t.propTypes={id:c.default.string,object:c.default.string,mode:c.default.string,created_at:c.default.object,updated_at:c.default.object,min_datetime:c.default.object,max_datetime:c.default.object,is_account_address:c.default.bool,instructions:c.default.string,messages:c.default.object,confirmation:c.default.string,address:c.default.oneOfType([c.default.string,c.default.shape(s.propTypes)]),shipment:c.default.oneOfType([c.default.string,c.default.shape(n.propTypes)]),carrier_accounts:c.default.object,pickup_rates:c.default.object},t.jsonIdKeys=["address","shipment"],r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c),l=r(2),p=n(l);t.default=function(e){var t,r,n=(0,p.default)(e);return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t.delete=function(){return this.notImplemented("delete")},t.wrapJSON=function(e){return e},t.prototype.toJSON=function(){return this.shipments?{shipments:this.shipments}:e.prototype.toJSON.call(this)},t}((0,f.default)(e)),t._name="ScanForm",t.url="scan_forms",t.propTypes={id:s.default.string,object:s.default.string,status:s.default.string,message:s.default.string,address:s.default.oneOfType([s.default.string,s.default.shape(n.propTypes)]),tracking_codes:s.default.arrayOf(s.default.string),form_url:s.default.string,form_file_type:s.default.string,batch_id:s.default.string,created_at:s.default.object,updated_at:s.default.object},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(6),s=n(i);t.default=function(e){var t,r,n=(0,s.default)(e);return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t}(n),t._name="ShipmentReport",t.url=n.url+"shipment",r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(6),s=n(i);t.default=function(e){var t,r,n=(0,s.default)(e);return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t}(n),t._name="TrackerReport",t.url=n.url+"tracker",r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c);t.default=function(e){var t,r;return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t.all=function(){return this.notImplemented("all")},t}((0,f.default)(e)),t._name="User",t.url="users",t.key="user",t.propTypes={id:s.default.string,object:s.default.string,parent_id:s.default.string,name:s.default.string,email:s.default.string,phone_number:s.default.string,children:s.default.array,balance:s.default.oneOfType([s.default.object,s.default.string]),price_per_shipment:s.default.oneOfType([s.default.object,s.default.string]),recharge_amount:s.default.oneOfType([s.default.object,s.default.string]),secondary_recharge_amount:s.default.oneOfType([s.default.object,s.default.string]),recharge_threshold:s.default.oneOfType([s.default.object,s.default.string])},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c);t.default=function(e){var t,r;return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t}((0,f.default)(e)),t._name="Webhook",t.url="webhooks",t.key="webhook",t.propTypes={id:s.default.string,object:s.default.string,mode:s.default.string,url:s.default.string,disabled_at:s.default.object},r}},function(e,t){e.exports={name:"node-easypost",description:"EasyPost Node Client Library",version:"3.0.0-rc.12",author:"Easypost Engineering <support@easypost.com>",homepage:"https://easypost.com",repository:{type:"git",url:"git://github.com/easypost/easypost-node.git"},main:"index.js",engines:{node:">= v0.10.0"},scripts:{test:"eslint src && mocha --require ./test/common.js --compilers js:babel-register --recursive ./test","test:coverage":"cross-env NODE_ENV=test nyc mocha --recursive ./test",build:"webpack --config webpack.config.js",lint:"eslint src",watch:"webpack --watch --config webpack.config.js"},dependencies:{proptypes:"0.14.3","regenerator-runtime":"^0.10.1",superagent:"3.1.0"},devDependencies:{"babel-core":"6.18.2","babel-eslint":"7.1.1","babel-loader":"6.2.8","babel-plugin-istanbul":"3.0.0","babel-polyfill":"6.16.0","babel-preset-es2015":"6.18.0","babel-preset-es2017":"6.16.0","babel-preset-stage-2":"6.18.0","babel-register":"6.18.0",chai:"3.5.0","chai-as-promised":"6.0.0","cross-env":"3.1.3",eslint:"3.11.1","eslint-config-airbnb":"13.0.0","eslint-import-resolver-webpack":"0.7.0","eslint-plugin-import":"2.2.0","json-loader":"0.5.4",mocha:"3.2.0",nyc:"10.0.0","progress-bar-webpack-plugin":"1.9.0",sinon:"1.17.6","sinon-chai":"2.8.0","source-map-support":"0.4.6",vows:"~0.7.0",webpack:"2.1.0-beta.27","webpack-node-externals":"1.5.4"}}},function(e,t){e.exports=require("os")},function(e,t){e.exports=require("superagent")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.createMessage=t.STATUS=t.NAME=void 0;var i=r(5),s=n(i),c=t.NAME="NotImplementedError",f=t.STATUS=405,l=t.createMessage=function(e,t){return"Method "+e+" not implemented for api endpoint "+t},p=function(e){function t(r,n){o(this,t);var a=l(r,n),i=u(this,e.call(this,a));return i.name=c,i.status=f,i}return a(t,e),t}(s.default);t.default=p},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.STATUS=t.NAME=t.createMessage=void 0;var i=r(5),s=n(i),c=t.createMessage=function(e){return"Failed validating "+e+". View `e.errors` for details."},f=t.NAME="ValidationError",l=t.STATUS=422,p=function(e){function t(r,n){o(this,t);var a=c(n),i=u(this,e.call(this,a));return i.name=f,i.errors=r,i.status=l,i}return a(t,e),t}(s.default);t.default=p},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,u){try{var a=t[o](u),i=a.value}catch(e){return void r(e)}return a.done?void e(i):Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)})}return n("next")})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.RESOURCES=t.METHODS=t.DEFAULT_HEADERS=t.EASYPOST_UA_HEADER=t.UA_INFO=t.DEFAULT_BASE_URL=t.DEFAULT_TIMEOUT=t.MS_SECOND=void 0;var a,i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=r(26),c=n(s),f=r(25),l=n(f),p=r(24),d=n(p),h=r(2),y=n(h),b=r(12),m=n(b),_=r(13),v=n(_),g=r(14),w=n(g),O=r(15),j=n(O),T=r(7),E=n(T),P=r(8),x=n(P),k=r(9),S=n(k),R=r(16),M=n(R),A=r(10),C=n(A),I=r(17),N=n(I),U=r(18),L=n(U),D=r(19),F=n(D),q=r(3),J=n(q),H=r(20),K=n(H),B=r(4),z=n(B),G=r(21),V=n(G),Y=r(22),W=n(Y),X=r(23),Q=n(X),Z=r(11),$=n(Z),ee=t.MS_SECOND=1e3,te=t.DEFAULT_TIMEOUT=120*ee,re=t.DEFAULT_BASE_URL="https://api.easypost.com/v2/",ne=t.UA_INFO={client_version:d.default.version,lang:"nodejs",lang_version:process.version,publisher:"easypost",platform:l.default.platform()},oe=t.EASYPOST_UA_HEADER="X-EasyPost-Client-User-Agent",ue=t.DEFAULT_HEADERS=(a={"Accept-Encoding":"gzip,deflate,sdch,br","Content-Type":"application/x-www-form-urlencoded","User-Agent":"EasyPost/v2 NodejsClient/"+d.default.version},a[oe]=JSON.stringify(ne),a),ae=t.METHODS={GET:"get",POST:"post",PUT:"put",PATCH:"patch",DELETE:"del"},ie=t.RESOURCES={Address:y.default,ApiKey:m.default,Batch:v.default,CarrierAccount:w.default,CarrierType:j.default,CustomsInfo:E.default,CustomsItem:x.default,Insurance:S.default,Order:M.default,Parcel:C.default,PaymentLogReport:N.default,Pickup:L.default,ScanForm:F.default,Shipment:J.default,ShipmentReport:K.default,Tracker:z.default,TrackerReport:V.default,User:W.default,Webhook:Q.default},se=function(){function e(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(u(this,e),!t)throw new Error("No API key supplied. Pass in an API key as the first argument.");this.key=t,this.timeout=n.timeout||te,this.baseUrl=n.baseUrl||re,this.agent=c.default,Object.keys(ie).forEach(function(e){r[e]=ie[e](r)})}return e.buildHeaders=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=i({},ue,e);return"undefined"==typeof window?t:(delete t["User-Agent"],delete t["Accept-Encoding"],t)},e.prototype.buildPath=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return 0===e.indexOf("http")?e:this.baseUrl+e},e.prototype.request=function(){function t(e,t,n,o){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(){var r,n,o,u,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ae.GET,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=s.query,n=s.body,o=this.agent[i](this.buildPath(a)).accept("json").set("Content-Type","application/json").set(e.buildHeaders(c)).auth(this.key+":"),n&&o.send(n),r&&o.query(r),t.prev=4,t.next=7,o;case 7:return u=t.sent,t.abrupt("return",u);case 11:if(t.prev=11,t.t0=t.catch(4),!t.t0.response||!t.t0.response.body){t.next=15;break}throw new $.default(t.t0.response.body,a);case 15:throw t.t0;case 16:case"end":return t.stop()}},t,this,[[4,11]])}));return t}(),e.prototype.get=function(e,t,r){return this.request(e,ae.GET,t,r)},e.prototype.post=function(e,t,r){return this.request(e,ae.POST,t,r)},e.prototype.put=function(e,t,r){return this.request(e,ae.PUT,t,r)},e.prototype.patch=function(e,t,r){return this.request(e,ae.PATCH,t,r)},e.prototype.del=function(e,t,r){return this.request(e,ae.DELETE,t,r)},e}();t.default=se}]));
constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),c=n(s),f=r(0),l=n(f);t.default=function(e){var t,r;return r=t=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return i(t,e),t.retrieve=function(){return e.notImplemented.call(this,"retrieve")},t.delete=function(){return this.notImplemented("delete")},t.prototype.save=function(){function e(){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.constructor.notImplemented("save"));case 1:case"end":return e.stop()}},e,this)}));return e}(),t}((0,l.default)(e)),t._name="CarrierType",t.url="carrier_types",t.propTypes={id:c.default.string,object:c.default.string,type:c.default.string,readable:c.default.string,logo:c.default.string,fields:c.default.object},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,u){try{var a=t[o](u),i=a.value}catch(e){return void r(e)}return a.done?void e(i):Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)})}return n("next")})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),c=n(s),f=r(2),l=n(f),p=r(3),d=n(p),h=r(0),y=n(h);t.default=function(e){var t,r,n=(0,l.default)(e),s=(0,d.default)(e);return r=t=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return i(t,e),t.delete=function(){return this.notImplemented("delete")},t.prototype.buy=function(){function e(e,r){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyParameters({this:["id"],args:["carrier","service"]},t,r),e.abrupt("return",this.rpc("buy",{carrier:t,service:r}));case 2:case"end":return e.stop()}},e,this)}));return e}(),t}((0,y.default)(e)),t._name="Order",t.url="orders",t.key="order",t.propTypes={id:c.default.string,reference:c.default.string,object:c.default.string,mode:c.default.string,created_at:c.default.object,updated_at:c.default.object,to_address:c.default.oneOfType([c.default.string,c.default.shape(n.propTypes)]),from_address:c.default.oneOfType([c.default.string,c.default.shape(n.propTypes)]),return_address:c.default.oneOfType([c.default.string,c.default.shape(n.propTypes)]),buyer_address:c.default.oneOfType([c.default.string,c.default.shape(n.propTypes)]),shipments:c.default.arrayOf(s.propTypes),rates:c.default.arrayOf(c.default.object),messages:c.default.arrayOf(c.default.object),is_return:c.default.bool,carrier_accounts:c.default.arrayOf(c.default.oneOfType([c.default.string,c.default.object]))},t.jsonIdKeys=["to_address","from_address","return_address","buyer_address"],r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(6),s=n(i);t.default=function(e){var t,r,n=(0,s.default)(e);return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t}(n),t._name="PaymentLogReport",t.url=n.url+"payment_log",r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,u){try{var a=t[o](u),i=a.value}catch(e){return void r(e)}return a.done?void e(i):Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)})}return n("next")})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),c=n(s),f=r(0),l=n(f),p=r(3),d=n(p),h=r(2),y=n(h);t.default=function(e){var t,r,n=(0,d.default)(e),s=(0,y.default)(e);return r=t=function(e){function t(){return u(this,t),a(this,e.apply(this,arguments))}return i(t,e),t.all=function(){return this.notImplemented("all")},t.delete=function(){return this.notImplemented("delete")},t.prototype.buy=function(){function e(e,r){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyParameters({this:["id"],args:["carrier","service"]},t,r),e.abrupt("return",this.rpc("buy",{carrier:t,service:r}));case 2:case"end":return e.stop()}},e,this)}));return e}(),t.prototype.cancel=function(){function e(){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyParameters({this:["id"]}),e.abrupt("return",this.rpc("cancel"));case 2:case"end":return e.stop()}},e,this)}));return e}(),t}((0,l.default)(e)),t._name="Pickup",t.url="pickups",t.propTypes={id:c.default.string,object:c.default.string,mode:c.default.string,created_at:c.default.object,updated_at:c.default.object,min_datetime:c.default.object,max_datetime:c.default.object,is_account_address:c.default.bool,instructions:c.default.string,messages:c.default.object,confirmation:c.default.string,address:c.default.oneOfType([c.default.string,c.default.shape(s.propTypes)]),shipment:c.default.oneOfType([c.default.string,c.default.shape(n.propTypes)]),carrier_accounts:c.default.object,pickup_rates:c.default.object},t.jsonIdKeys=["address","shipment"],r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c),l=r(2),p=n(l);t.default=function(e){var t,r,n=(0,p.default)(e);return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t.delete=function(){return this.notImplemented("delete")},t.wrapJSON=function(e){return e},t.prototype.toJSON=function(){return this.shipments?{shipments:this.shipments.map(function(e){return"string"==typeof e?{id:e}:{id:e.id}})}:e.prototype.toJSON.call(this)},t}((0,f.default)(e)),t._name="ScanForm",t.url="scan_forms",t.propTypes={id:s.default.string,object:s.default.string,status:s.default.string,message:s.default.string,address:s.default.oneOfType([s.default.string,s.default.shape(n.propTypes)]),tracking_codes:s.default.arrayOf(s.default.string),form_url:s.default.string,form_file_type:s.default.string,batch_id:s.default.string,created_at:s.default.object,updated_at:s.default.object},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(6),s=n(i);t.default=function(e){var t,r,n=(0,s.default)(e);return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t}(n),t._name="ShipmentReport",t.url=n.url+"shipment",r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(6),s=n(i);t.default=function(e){var t,r,n=(0,s.default)(e);return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t}(n),t._name="TrackerReport",t.url=n.url+"tracker",r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c);t.default=function(e){var t,r;return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t.all=function(){return this.notImplemented("all")},t}((0,f.default)(e)),t._name="User",t.url="users",t.key="user",t.propTypes={id:s.default.string,object:s.default.string,parent_id:s.default.string,name:s.default.string,email:s.default.string,phone_number:s.default.string,children:s.default.array,balance:s.default.oneOfType([s.default.object,s.default.string]),price_per_shipment:s.default.oneOfType([s.default.object,s.default.string]),recharge_amount:s.default.oneOfType([s.default.object,s.default.string]),secondary_recharge_amount:s.default.oneOfType([s.default.object,s.default.string]),recharge_threshold:s.default.oneOfType([s.default.object,s.default.string])},r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=n(i),c=r(0),f=n(c);t.default=function(e){var t,r;return r=t=function(e){function t(){return o(this,t),u(this,e.apply(this,arguments))}return a(t,e),t}((0,f.default)(e)),t._name="Webhook",t.url="webhooks",t.key="webhook",t.propTypes={id:s.default.string,object:s.default.string,mode:s.default.string,url:s.default.string,disabled_at:s.default.object},r}},function(e,t){e.exports={name:"node-easypost",description:"EasyPost Node Client Library",version:"3.0.0-rc.14",author:"Easypost Engineering <support@easypost.com>",homepage:"https://easypost.com",repository:{type:"git",url:"git://github.com/easypost/easypost-node.git"},main:"index.js",engines:{node:">= v0.10.0"},scripts:{test:"eslint src && mocha --require ./test/common.js --compilers js:babel-register --recursive ./test","test:coverage":"cross-env NODE_ENV=test nyc mocha --recursive ./test",build:"webpack --config webpack.config.js",lint:"eslint src",watch:"webpack --watch --config webpack.config.js"},dependencies:{proptypes:"0.14.3","regenerator-runtime":"^0.10.1",superagent:"3.1.0"},devDependencies:{"babel-core":"6.18.2","babel-eslint":"7.1.1","babel-loader":"6.2.8","babel-plugin-istanbul":"3.0.0","babel-polyfill":"6.16.0","babel-preset-es2015":"6.18.0","babel-preset-es2017":"6.16.0","babel-preset-stage-2":"6.18.0","babel-register":"6.18.0",chai:"3.5.0","chai-as-promised":"6.0.0","cross-env":"3.1.3",eslint:"3.11.1","eslint-config-airbnb":"13.0.0","eslint-import-resolver-webpack":"0.7.0","eslint-plugin-import":"2.2.0","json-loader":"0.5.4",mocha:"3.2.0",nyc:"10.0.0","progress-bar-webpack-plugin":"1.9.0",sinon:"1.17.6","sinon-chai":"2.8.0","source-map-support":"0.4.6",vows:"~0.7.0",webpack:"2.1.0-beta.27","webpack-node-externals":"1.5.4"}}},function(e,t){e.exports=require("os")},function(e,t){e.exports=require("superagent")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.createMessage=t.STATUS=t.NAME=void 0;var i=r(5),s=n(i),c=t.NAME="NotImplementedError",f=t.STATUS=405,l=t.createMessage=function(e,t){return"Method "+e+" not implemented for api endpoint "+t},p=function(e){function t(r,n){o(this,t);var a=l(r,n),i=u(this,e.call(this,a));return i.name=c,i.status=f,i}return a(t,e),t}(s.default);t.default=p},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.STATUS=t.NAME=t.createMessage=void 0;var i=r(5),s=n(i),c=t.createMessage=function(e){return"Failed validating "+e+". View `e.errors` for details."},f=t.NAME="ValidationError",l=t.STATUS=422,p=function(e){function t(r,n){o(this,t);var a=c(n),i=u(this,e.call(this,a));return i.name=f,i.errors=r,i.status=l,i}return a(t,e),t}(s.default);t.default=p},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,u){try{var a=t[o](u),i=a.value}catch(e){return void r(e)}return a.done?void e(i):Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)})}return n("next")})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.RESOURCES=t.METHODS=t.DEFAULT_HEADERS=t.EASYPOST_UA_HEADER=t.UA_INFO=t.DEFAULT_BASE_URL=t.DEFAULT_TIMEOUT=t.MS_SECOND=void 0;var a,i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=r(26),c=n(s),f=r(25),l=n(f),p=r(24),d=n(p),h=r(2),y=n(h),b=r(12),m=n(b),_=r(13),v=n(_),g=r(14),w=n(g),O=r(15),j=n(O),T=r(7),E=n(T),P=r(8),x=n(P),k=r(9),S=n(k),R=r(16),M=n(R),A=r(10),C=n(A),I=r(17),N=n(I),U=r(18),L=n(U),D=r(19),F=n(D),q=r(3),J=n(q),H=r(20),K=n(H),B=r(4),z=n(B),G=r(21),V=n(G),Y=r(22),W=n(Y),X=r(23),Q=n(X),Z=r(11),$=n(Z),ee=t.MS_SECOND=1e3,te=t.DEFAULT_TIMEOUT=120*ee,re=t.DEFAULT_BASE_URL="https://api.easypost.com/v2/",ne=t.UA_INFO={client_version:d.default.version,lang:"nodejs",lang_version:process.version,publisher:"easypost",platform:l.default.platform()},oe=t.EASYPOST_UA_HEADER="X-EasyPost-Client-User-Agent",ue=t.DEFAULT_HEADERS=(a={"Accept-Encoding":"gzip,deflate,sdch,br","Content-Type":"application/x-www-form-urlencoded","User-Agent":"EasyPost/v2 NodejsClient/"+d.default.version},a[oe]=JSON.stringify(ne),a),ae=t.METHODS={GET:"get",POST:"post",PUT:"put",PATCH:"patch",DELETE:"del"},ie=t.RESOURCES={Address:y.default,ApiKey:m.default,Batch:v.default,CarrierAccount:w.default,CarrierType:j.default,CustomsInfo:E.default,CustomsItem:x.default,Insurance:S.default,Order:M.default,Parcel:C.default,PaymentLogReport:N.default,Pickup:L.default,ScanForm:F.default,Shipment:J.default,ShipmentReport:K.default,Tracker:z.default,TrackerReport:V.default,User:W.default,Webhook:Q.default},se=function(){function e(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(u(this,e),!t)throw new Error("No API key supplied. Pass in an API key as the first argument.");this.key=t,this.timeout=n.timeout||te,this.baseUrl=n.baseUrl||re,this.agent=c.default,Object.keys(ie).forEach(function(e){r[e]=ie[e](r)})}return e.buildHeaders=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=i({},ue,e);return"undefined"==typeof window?t:(delete t["User-Agent"],delete t["Accept-Encoding"],t)},e.prototype.buildPath=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return 0===e.indexOf("http")?e:this.baseUrl+e},e.prototype.request=function(){function t(e,t,n,o){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(){var r,n,o,u,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ae.GET,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=s.query,n=s.body,o=this.agent[i](this.buildPath(a)).accept("json").set("Content-Type","application/json").set(e.buildHeaders(c)).auth(this.key+":"),n&&o.send(n),r&&o.query(r),t.prev=4,t.next=7,o;case 7:return u=t.sent,t.abrupt("return",u);case 11:if(t.prev=11,t.t0=t.catch(4),!t.t0.response||!t.t0.response.body){t.next=15;break}throw new $.default(t.t0.response.body,a);case 15:throw t.t0;case 16:case"end":return t.stop()}},t,this,[[4,11]])}));return t}(),e.prototype.get=function(e,t,r){return this.request(e,ae.GET,t,r)},e.prototype.post=function(e,t,r){return this.request(e,ae.POST,t,r)},e.prototype.put=function(e,t,r){return this.request(e,ae.PUT,t,r)},e.prototype.patch=function(e,t,r){return this.request(e,ae.PATCH,t,r)},e.prototype.del=function(e,t,r){return this.request(e,ae.DELETE,t,r)},e}();t.default=se}]));
//# sourceMappingURL=easypost.js.map
{
"name": "node-easypost",
"description": "EasyPost Node Client Library",
"version": "3.0.0-rc.13",
"version": "3.0.0-rc.14",
"author": "Easypost Engineering <support@easypost.com>",

@@ -6,0 +6,0 @@ "homepage": "https://easypost.com",

@@ -35,3 +35,14 @@ import T from 'proptypes';

toJSON() {
if (this.shipments) return { shipments: this.shipments };
if (this.shipments) {
return {
shipments: this.shipments.map((s) => {
if (typeof s === 'string') {
return { id: s };
}
return { id: s.id };
}),
};
}
return super.toJSON();

@@ -38,0 +49,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc