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

@easypost/api

Package Overview
Dependencies
Maintainers
3
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@easypost/api - npm Package Compare versions

Comparing version 3.0.9 to 3.0.10

.nyc_output/22210a1871412ef3d51ec5ce227b724a.json

3

easypost.js

@@ -1,3 +0,2 @@

!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=26)}([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(25),s=n(i),f=r(24),c=n(f);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,t){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(r,n){var o,u;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o=n?n+"/"+r:this._url+"/"+r,t.next=4,e.get(o);case 4:return u=t.sent,t.abrupt("return",this.create(u.body));case 8:return t.prev=8,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 11:case"end":return t.stop()}},t,this,[[0,8]])}));return t}(),t.all=function(){function t(){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(){var r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments[1];return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o=o||this._url,t.next=4,e.get(o,{query:n});case 4:return r=t.sent,t.abrupt("return",this.unwrapAll(r.body).map(this.create.bind(this)));case 8:return t.prev=8,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 11:case"end":return t.stop()}},t,this,[[0,8]])}));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 c.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,f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"post";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,"get"!==f){t.next=11;break}return t.next=8,e[f](i,{query:n});case 8:s=t.sent,t.next=20;break;case 11:if(!n){t.next=17;break}return t.next=14,e[f](i,{body:n});case 14:s=t.sent,t.next=20;break;case 17:return t.next=19,e[f](i);case 19:s=t.sent;case 20:return this.mapProps(s.body),t.abrupt("return",this);case 24:throw t.prev=24,t.t0=t.catch(3),t.t0;case 27:case"end":return t.stop()}},t,this,[[3,24]])}));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._url||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._url||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),f=r(0),c=n(f);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,c.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},f=r(1),c=n(f),l=r(0),p=n(l),d=r(2),h=n(d),y=r(11),b=n(y),m=r(8),_=n(m),g=r(10),v=n(g),w=r(4),O=n(w);t.default=function(e){var t,r,n=(0,h.default)(e),f=(0,b.default)(e),l=(0,_.default)(e),d=(0,v.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},void 0,"get"));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",void 0,void 0,"get"));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:c.default.string,object:c.default.string,reference:c.default.string,mode:c.default.string,created_at:c.default.oneOfType([c.default.object,c.default.string]),updated_at:c.default.oneOfType([c.default.object,c.default.string]),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)]),parcel:c.default.oneOfType([c.default.string,c.default.shape(f.propTypes)]),customs_info:c.default.oneOfType([c.default.string,c.default.shape(l.propTypes)]),carrier_accounts:c.default.arrayOf(c.default.string),carrier_account:c.default.string,scan_form:c.default.oneOfType([c.default.string,c.default.object]),forms:c.default.array,insurance:c.default.oneOfType([c.default.string,c.default.shape(d.propTypes)]),rates:c.default.arrayOf(c.default.object),selected_rate:c.default.object,postage_label:c.default.object,messages:c.default.array,options:c.default.object,is_return:c.default.bool,tracking_code:c.default.string,service:c.default.string,services:c.default.arrayOf(c.default.string),usps_zone:c.default.string,status:c.default.string,tracker:c.default.oneOfType([c.default.string,c.default.shape(y.propTypes)]),fees:c.default.array,refund_status:c.default.string,batch_id:c.default.string,batch_status:c.default.string,batch_message:c.default.string},t.jsonIdKeys=["to_address","from_address","return_address","buyer_address","parcel","customs_info","carrier_accounts","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),f=r(0),c=n(f);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,c.default)(e)),t._name="Tracker",t._url="trackers",t.key="tracker",t.propTypes={id:s.default.string,object:s.default.string,reference: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}),t.DEFAULT_LABEL_FORMAT=void 0;var i=r(1),s=n(i),f=r(0),c=n(f),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.prototype.buy=function(){return this.verifyParameters({this:["id","shipments"]}),this.rpc("buy")},t}((0,c.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.number,shipments:s.default.array,status:s.default.object,label_url:s.default.string,scan_form:s.default.object,pickup:s.default.object,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,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),f=n(s),c=r(0),l=n(c);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:f.default.string,object:f.default.string,type:f.default.string,fields:f.default.object,clone:f.default.bool,description:f.default.string,reference:f.default.string,readable:f.default.string,credentials:f.default.object,test_credentials:f.default.object,created_at:f.default.oneOfType([f.default.object,f.default.string]),updated_at:f.default.oneOfType([f.default.object,f.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),f=r(0),c=n(f),l=r(9),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,c.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.oneOfType([s.default.object,s.default.string]),updated_at:s.default.oneOfType([s.default.object,s.default.string]),customs_certify:s.default.bool,customs_signer:s.default.string,contents_type:s.default.string,contents_explanation: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),f=r(0),c=n(f);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,c.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.oneOfType([s.default.object,s.default.string]),updated_at:s.default.oneOfType([s.default.object,s.default.string]),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),f=r(0),c=n(f),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,c.default)(e)),t._name="Insurance",t._url="insurances",t.key="insurance",t.propTypes={id:s.default.string,object:s.default.string,reference:s.default.string,mode:s.default.string,created_at:s.default.oneOfType([s.default.object,s.default.string]),updated_at:s.default.oneOfType([s.default.object,s.default.string]),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),f=r(0),c=n(f);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,c.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.oneOfType([s.default.object,s.default.string]),updated_at: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}),t.NAME=t.createMessage=void 0;var i=r(5),s=n(i),f=t.createMessage=function(e,t){return"Status "+e+" returned from API request to "+t},c=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=f(r.status||r.code,n),i=u(this,e.call(this,a));return i.error=r,i.name=c,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},f=r(1),c=n(f),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:c.default.string,keys:c.default.array,children:c.default.array},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),f=n(s),c=r(0),l=n(c);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:f.default.string,object:f.default.string,type:f.default.string,readable:f.default.string,logo:f.default.string,fields:f.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),f=n(s),c=r(2),l=n(c),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.prototype.getRates=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.rpc("rates",void 0,void 0,"get"));case 1: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:f.default.string,reference:f.default.string,object:f.default.string,mode:f.default.string,created_at:f.default.oneOfType([f.default.object,f.default.string]),updated_at:f.default.oneOfType([f.default.object,f.default.string]),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)]),shipments:f.default.arrayOf(f.default.shape(s.propTypes)),rates:f.default.arrayOf(f.default.object),messages:f.default.arrayOf(f.default.object),is_return:f.default.bool,carrier_accounts:f.default.arrayOf(f.default.oneOfType([f.default.string,f.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){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),f=n(s),c=r(0),l=n(c),p=r(3),d=n(p),h=r(6),y=n(h),b=r(2),m=n(b),_=r(7),g=n(_);t.default=function(e){var t,r,n=(0,d.default)(e),s=(0,m.default)(e),c=(0,y.default)(e),p=(0,g.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.key="pickup",t.propTypes={id:f.default.string,object:f.default.string,reference:f.default.string,mode:f.default.string,created_at:f.default.oneOfType([f.default.object,f.default.string]),updated_at:f.default.oneOfType([f.default.object,f.default.string]),min_datetime:f.default.oneOfType([f.default.object,f.default.string]),max_datetime:f.default.oneOfType([f.default.object,f.default.string]),is_account_address:f.default.bool,instructions:f.default.string,messages:f.default.object,confirmation:f.default.string,address:f.default.oneOfType([f.default.string,f.default.shape(s.propTypes)]),shipment:f.default.oneOfType([f.default.string,f.default.shape(n.propTypes)]),batch:f.default.oneOfType([f.default.string,f.default.shape(c.propTypes)]),carrier_accounts:f.default.arrayOf(f.default.oneOfType([f.default.string,f.default.shape(p.proptypes)])),pickup_rates:f.default.object},t.jsonIdKeys=["address","shipment","batch"],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),f=n(s),c=r(0),l=n(c);t.default=function(e){var t,r;return r=t=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(this,t);var n=a(this,e.call(this,r));return r.type&&(n._url=n.constructor.constructUrl(r.type)),n}return i(t,e),t.constructUrl=function(e){return"reports/"+e},t.all=function(){function t(e){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.all.call(this,n,this.constructUrl(r)));case 1:case"end":return t.stop()}},t,this)}));return t}(),t.wrapJSON=function(e){return e},t.unwrapAll=function(e){return e.reports},t.delete=function(){return this.notImplemented("delete")},t}((0,l.default)(e)),t._url="reports",t.propTypes={id:f.default.string,object:f.default.string,type:f.default.string,mode:f.default.string,status:f.default.string,start_date:f.default.string,end_date:f.default.string,include_children:f.default.bool,url:f.default.string,url_expires_at:f.default.oneOfType([f.default.object,f.default.string]),send_email:f.default.bool,created_at:f.default.oneOfType([f.default.object,f.default.string]),updated_at:f.default.oneOfType([f.default.object,f.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),f=r(0),c=n(f),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,c.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.oneOfType([s.default.object,s.default.string]),updated_at: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),f=r(0),c=n(f);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,c.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),f=r(0),c=n(f);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,c.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.oneOfType([s.default.object,s.default.string])},r}},function(e,t){e.exports={name:"@easypost/api",description:"EasyPost Node Client Library",version:"3.0.8",author:"Easypost Engineering <support@easypost.com>",homepage:"https://easypost.com",bin:{easypost:"./repl.js"},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",repl:"./repl.js --local"},dependencies:{"babel-polyfill":"^6.23.0",proptypes:"^0.14.3","regenerator-runtime":"^0.10.1","source-map-support":"^0.4.6",superagent:"^3.5.2",yargs:"^7.1.0"},devDependencies:{"babel-core":"^6.24.1","babel-eslint":"^7.2.3","babel-loader":"^7.0.0","babel-plugin-istanbul":"^4.1.1","babel-preset-es2015":"^6.24.1","babel-preset-es2017":"^6.24.1","babel-preset-stage-2":"^6.24.1","babel-register":"^6.24.1",chai:"^3.5.0","chai-as-promised":"^6.0.0","cross-env":"^4.0.0",eslint:"^3.19.0","eslint-config-airbnb":"^14.1.0","eslint-import-resolver-webpack":"^0.8.1","eslint-plugin-import":"^2.2.0","json-loader":"^0.5.4",mocha:"^3.3.0",nyc:"^10.2.0","progress-bar-webpack-plugin":"^1.9.3",sinon:"^2.1.0","sinon-chai":"^2.9.0",vows:"~0.8.1",webpack:"^2.4.1","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),f=t.NAME="NotImplementedError",c=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=f,i.status=c,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),f=t.createMessage=function(e){return"Failed validating "+e+". View `e.errors` for details."},c=t.NAME="ValidationError",l=t.STATUS=422,p=function(e){function t(r,n){o(this,t);var a=f(n),i=u(this,e.call(this,a));return i.name=c,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(23),f=n(s),c=r(22),l=n(c),p=r(21),d=n(p),h=r(2),y=n(h),b=r(13),m=n(b),_=r(6),g=n(_),v=r(7),w=n(v),O=r(14),j=n(O),T=r(8),E=n(T),P=r(9),x=n(P),k=r(10),S=n(k),R=r(15),M=n(R),A=r(11),I=n(A),C=r(16),U=n(C),N=r(17),L=n(N),q=r(18),D=n(q),F=r(3),J=n(F),H=r(4),K=n(H),B=r(19),z=n(B),G=r(20),V=n(G),Y=r(12),W=n(Y),X=t.MS_SECOND=1e3,Q=t.DEFAULT_TIMEOUT=120*X,Z=t.DEFAULT_BASE_URL="https://api.easypost.com/v2/",$=t.UA_INFO={client_version:d.default.version,lang:"nodejs",lang_version:process.version,publisher:"easypost",platform:l.default.platform()},ee=t.EASYPOST_UA_HEADER="X-EasyPost-Client-User-Agent",te=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[ee]=JSON.stringify($),a),re=t.METHODS={GET:"get",POST:"post",PUT:"put",PATCH:"patch",DELETE:"del"},ne=t.RESOURCES={Address:y.default,ApiKey:m.default,Batch:g.default,CarrierAccount:w.default,CarrierType:j.default,CustomsInfo:E.default,CustomsItem:x.default,Insurance:S.default,Order:M.default,Parcel:I.default,Pickup:U.default,Report:L.default,ScanForm:D.default,Shipment:J.default,Tracker:K.default,User:z.default,Webhook:V.default},oe=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||Q,this.baseUrl=n.baseUrl||Z,this.agent=f.default,Object.keys(ne).forEach(function(e){r[e]=ne[e](r)})}return e.buildHeaders=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=i({},te,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(){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]:re.GET,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f=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(f)).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 W.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,re.GET,t,r)},e.prototype.post=function(e,t,r){return this.request(e,re.POST,t,r)},e.prototype.put=function(e,t,r){return this.request(e,re.PUT,t,r)},e.prototype.patch=function(e,t,r){return this.request(e,re.PATCH,t,r)},e.prototype.del=function(e,t,r){return this.request(e,re.DELETE,t,r)},e}();t.default=oe}]));
!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,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},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=24)}([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)}if(!a.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}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(26),s=n(i),f=r(25),c=n(f);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,t){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(r,n){var o,u;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o=n?n+"/"+r:this._url+"/"+r,t.next=4,e.get(o);case 4:return u=t.sent,t.abrupt("return",this.create(u.body));case 8:return t.prev=8,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 11:case"end":return t.stop()}},t,this,[[0,8]])}));return t}(),t.all=function(){function t(){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(){var r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments[1];return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o=o||this._url,t.next=4,e.get(o,{query:n});case 4:return r=t.sent,t.abrupt("return",this.unwrapAll(r.body).map(this.create.bind(this)));case 8:return t.prev=8,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 11:case"end":return t.stop()}},t,this,[[0,8]])}));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 c.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,f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"post";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,"get"!==f){t.next=11;break}return t.next=8,e[f](i,{query:n});case 8:s=t.sent,t.next=20;break;case 11:if(!n){t.next=17;break}return t.next=14,e[f](i,{body:n});case 14:s=t.sent,t.next=20;break;case 17:return t.next=19,e[f](i);case 19:s=t.sent;case 20:return this.mapProps(s.body),t.abrupt("return",this);case 24:throw t.prev=24,t.t0=t.catch(3),t.t0;case 27:case"end":return t.stop()}},t,this,[[3,24]])}));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._url||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._url||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,r,n=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.id){e.next=8;break}return e.next=3,this.constructor.retrieve(this.id);case 3:t=e.sent,r=t.toJSON(),Object.keys(r).forEach(function(e){n[e]=r[e]}),e.next=9;break;case 8:throw new Error("Cannot retrieve an object without an id.");case 9: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),f=r(0),c=n(f);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,c.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)}if(!a.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}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},f=r(1),c=n(f),l=r(0),p=n(l),d=r(2),h=n(d),y=r(11),b=n(y),m=r(8),_=n(m),g=r(10),v=n(g),w=r(4),O=n(w);t.default=function(e){var t,r,n=(0,h.default)(e),f=(0,b.default)(e),l=(0,_.default)(e),d=(0,v.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"===(void 0===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},void 0,"get"));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",void 0,void 0,"get"));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||[];if(e){var n=e.map(function(e){return e.toLowerCase()});r=r.filter(function(e){return n.includes(e.carrier.toLowerCase())})}if(t){var o=t.map(function(e){return e.toLowerCase()});r=r.filter(function(e){return o.includes(e.service.toLowerCase())})}return 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:c.default.string,object:c.default.string,reference:c.default.string,mode:c.default.string,created_at:c.default.oneOfType([c.default.object,c.default.string]),updated_at:c.default.oneOfType([c.default.object,c.default.string]),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)]),parcel:c.default.oneOfType([c.default.string,c.default.shape(f.propTypes)]),customs_info:c.default.oneOfType([c.default.string,c.default.shape(l.propTypes)]),carrier_accounts:c.default.arrayOf(c.default.string),carrier_account:c.default.string,scan_form:c.default.oneOfType([c.default.string,c.default.object]),forms:c.default.array,insurance:c.default.oneOfType([c.default.string,c.default.shape(d.propTypes)]),rates:c.default.arrayOf(c.default.object),selected_rate:c.default.object,postage_label:c.default.object,messages:c.default.array,options:c.default.object,is_return:c.default.bool,tracking_code:c.default.string,service:c.default.string,services:c.default.arrayOf(c.default.string),usps_zone:c.default.string,status:c.default.string,tracker:c.default.oneOfType([c.default.string,c.default.shape(y.propTypes)]),fees:c.default.array,refund_status:c.default.string,batch_id:c.default.string,batch_status:c.default.string,batch_message:c.default.string},t.jsonIdKeys=["to_address","from_address","return_address","buyer_address","parcel","customs_info","carrier_accounts","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),f=r(0),c=n(f);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,c.default)(e)),t._name="Tracker",t._url="trackers",t.key="tracker",t.propTypes={id:s.default.string,object:s.default.string,reference: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,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t){n(this,e),Error.captureStackTrace(this,this.constructor),Object.defineProperty(this,"message",{value:t})};t.default=o},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),f=r(0),c=n(f),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.prototype.buy=function(){return this.verifyParameters({this:["id","shipments"]}),this.rpc("buy")},t}((0,c.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.number,shipments:s.default.array,status:s.default.object,label_url:s.default.string,scan_form:s.default.object,pickup:s.default.object,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,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)}if(!a.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}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),f=n(s),c=r(0),l=n(c);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:f.default.string,object:f.default.string,type:f.default.string,fields:f.default.object,clone:f.default.bool,description:f.default.string,reference:f.default.string,readable:f.default.string,credentials:f.default.object,test_credentials:f.default.object,created_at:f.default.oneOfType([f.default.object,f.default.string]),updated_at:f.default.oneOfType([f.default.object,f.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),f=r(0),c=n(f),l=r(9),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,c.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.oneOfType([s.default.object,s.default.string]),updated_at:s.default.oneOfType([s.default.object,s.default.string]),customs_certify:s.default.bool,customs_signer:s.default.string,contents_type:s.default.string,contents_explanation: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){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)}if(!a.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}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},f=r(1),c=n(f),l=r(0),p=n(l);t.default=function(e){var t,r;return r=t=function(e){function t(r){u(this,t);var n=r.value;return n&&"string"!=typeof n&&(n=n.toString()),a(this,e.call(this,s({},r,{value:n})))}return i(t,e),t.all=function(){return this.notImplemented("all")},t.delete=function(){return this.notImplemented("delete")},t.prototype.save=function(){function t(){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.value&&"string"!=typeof this.value&&(this.value=this.value.toString()),t.abrupt("return",e.prototype.save.call(this));case 2:case"end":return t.stop()}},t,this)}));return t}(),t}((0,p.default)(e)),t._name="CustomsItem",t._url="customs_items",t.key="customs_item",t.propTypes={id:c.default.string,object:c.default.string,mode:c.default.string,created_at:c.default.oneOfType([c.default.object,c.default.string]),updated_at:c.default.oneOfType([c.default.object,c.default.string]),description:c.default.string,quantity:c.default.number,value:c.default.string,weight:c.default.number,hs_tariff_number:c.default.string,code:c.default.string,origin_country:c.default.string,currency:c.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),f=r(0),c=n(f),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,c.default)(e)),t._name="Insurance",t._url="insurances",t.key="insurance",t.propTypes={id:s.default.string,object:s.default.string,reference:s.default.string,mode:s.default.string,created_at:s.default.oneOfType([s.default.object,s.default.string]),updated_at:s.default.oneOfType([s.default.object,s.default.string]),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),f=r(0),c=n(f);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,c.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.oneOfType([s.default.object,s.default.string]),updated_at:s.default.oneOfType([s.default.object,s.default.string])},r}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 u(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 a=r(5),i=function(e){return e&&e.__esModule?e:{default:e}}(a),s=t.createMessage=function(e,t){return"Status "+e+" returned from API request to "+t},f=t.NAME="RequestError",c=function(e){function t(r,u){if(n(this,t),!r)throw new Error("No error passed to RequestError");if("string"!=typeof u)throw new Error("No url passed to RequestError");var a=s(r.status||r.code,u),i=o(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 u(t,e),t}(i.default);t.default=c},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)}if(!a.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}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},f=r(1),c=n(f),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.reduce(function(e,r){return e.concat(t.convertKeyMap(r))},[]))),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:c.default.string,keys:c.default.array,children:c.default.array},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)}if(!a.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}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),f=n(s),c=r(0),l=n(c);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:f.default.string,object:f.default.string,type:f.default.string,readable:f.default.string,logo:f.default.string,fields:f.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)}if(!a.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}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),f=n(s),c=r(2),l=n(c),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.prototype.getRates=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.rpc("rates",void 0,void 0,"get"));case 1: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:f.default.string,reference:f.default.string,object:f.default.string,mode:f.default.string,created_at:f.default.oneOfType([f.default.object,f.default.string]),updated_at:f.default.oneOfType([f.default.object,f.default.string]),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)]),shipments:f.default.arrayOf(f.default.shape(s.propTypes)),rates:f.default.arrayOf(f.default.object),messages:f.default.arrayOf(f.default.object),is_return:f.default.bool,carrier_accounts:f.default.arrayOf(f.default.oneOfType([f.default.string,f.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){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)}if(!a.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}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),f=n(s),c=r(0),l=n(c),p=r(3),d=n(p),h=r(6),y=n(h),b=r(2),m=n(b),_=r(7),g=n(_);t.default=function(e){var t,r,n=(0,d.default)(e),s=(0,m.default)(e),c=(0,y.default)(e),p=(0,g.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.key="pickup",t.propTypes={id:f.default.string,object:f.default.string,reference:f.default.string,mode:f.default.string,created_at:f.default.oneOfType([f.default.object,f.default.string]),updated_at:f.default.oneOfType([f.default.object,f.default.string]),min_datetime:f.default.oneOfType([f.default.object,f.default.string]),max_datetime:f.default.oneOfType([f.default.object,f.default.string]),is_account_address:f.default.bool,instructions:f.default.string,messages:f.default.object,confirmation:f.default.string,address:f.default.oneOfType([f.default.string,f.default.shape(s.propTypes)]),shipment:f.default.oneOfType([f.default.string,f.default.shape(n.propTypes)]),batch:f.default.oneOfType([f.default.string,f.default.shape(c.propTypes)]),carrier_accounts:f.default.arrayOf(f.default.oneOfType([f.default.string,f.default.shape(p.proptypes)])),pickup_rates:f.default.object},t.jsonIdKeys=["address","shipment","batch"],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)}if(!a.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}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),f=n(s),c=r(0),l=n(c);t.default=function(e){var t,r;return r=t=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(this,t);var n=a(this,e.call(this,r));return r.type&&(n._url=n.constructor.constructUrl(r.type)),n}return i(t,e),t.constructUrl=function(e){return"reports/"+e},t.all=function(){function t(e){return r.apply(this,arguments)}var r=o(regeneratorRuntime.mark(function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.all.call(this,n,this.constructUrl(r)));case 1:case"end":return t.stop()}},t,this)}));return t}(),t.wrapJSON=function(e){return e},t.unwrapAll=function(e){return e.reports},t.delete=function(){return this.notImplemented("delete")},t}((0,l.default)(e)),t._url="reports",t.propTypes={id:f.default.string,object:f.default.string,type:f.default.string,mode:f.default.string,status:f.default.string,start_date:f.default.string,end_date:f.default.string,include_children:f.default.bool,url:f.default.string,url_expires_at:f.default.oneOfType([f.default.object,f.default.string]),send_email:f.default.bool,created_at:f.default.oneOfType([f.default.object,f.default.string]),updated_at:f.default.oneOfType([f.default.object,f.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),f=r(0),c=n(f),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,c.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.oneOfType([s.default.object,s.default.string]),updated_at: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),f=r(0),c=n(f);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,c.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),f=r(0),c=n(f);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,c.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.oneOfType([s.default.object,s.default.string])},r}},function(e,t){e.exports={name:"@easypost/api",description:"EasyPost Node Client Library",version:"3.0.10",author:"Easypost Engineering <support@easypost.com>",homepage:"https://easypost.com",bin:{easypost:"./repl.js"},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",repl:"./repl.js --local"},dependencies:{"babel-polyfill":"^6.23.0",proptypes:"^0.14.3","regenerator-runtime":"^0.10.1","source-map-support":"^0.4.6",superagent:"^3.5.2",yargs:"^7.1.0"},devDependencies:{"babel-core":"^6.24.1","babel-eslint":"^7.2.3","babel-loader":"^7.0.0","babel-plugin-istanbul":"^4.1.1","babel-preset-es2015":"^6.24.1","babel-preset-es2017":"^6.24.1","babel-preset-stage-2":"^6.24.1","babel-register":"^6.24.1",chai:"^3.5.0","chai-as-promised":"^6.0.0","cross-env":"^4.0.0",eslint:"^3.19.0","eslint-config-airbnb":"^14.1.0","eslint-import-resolver-webpack":"^0.8.1","eslint-plugin-import":"^2.2.0","json-loader":"^0.5.4",mocha:"^3.3.0",nyc:"^10.2.0","progress-bar-webpack-plugin":"^1.9.3",sinon:"^2.1.0","sinon-chai":"^2.9.0",vows:"~0.8.1",webpack:"^2.4.1","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){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)}if(!a.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}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(23),f=n(s),c=r(22),l=n(c),p=r(21),d=n(p),h=r(2),y=n(h),b=r(13),m=n(b),_=r(6),g=n(_),v=r(7),w=n(v),O=r(14),j=n(O),T=r(8),E=n(T),P=r(9),x=n(P),k=r(10),S=n(k),R=r(15),M=n(R),A=r(11),I=n(A),C=r(16),U=n(C),N=r(17),L=n(N),q=r(18),D=n(q),F=r(3),J=n(F),H=r(4),K=n(H),B=r(19),z=n(B),G=r(20),V=n(G),W=r(12),Y=n(W),X=t.MS_SECOND=1e3,Q=t.DEFAULT_TIMEOUT=120*X,Z=t.DEFAULT_BASE_URL="https://api.easypost.com/v2/",$=t.UA_INFO={client_version:d.default.version,lang:"nodejs",lang_version:process.version,publisher:"easypost",platform:l.default.platform()},ee=t.EASYPOST_UA_HEADER="X-EasyPost-Client-User-Agent",te=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[ee]=JSON.stringify($),a),re=t.METHODS={GET:"get",POST:"post",PUT:"put",PATCH:"patch",DELETE:"del"},ne=t.RESOURCES={Address:y.default,ApiKey:m.default,Batch:g.default,CarrierAccount:w.default,CarrierType:j.default,CustomsInfo:E.default,CustomsItem:x.default,Insurance:S.default,Order:M.default,Parcel:I.default,Pickup:U.default,Report:L.default,ScanForm:D.default,Shipment:J.default,Tracker:K.default,User:z.default,Webhook:V.default},oe=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||Q,this.baseUrl=n.baseUrl||Z,this.agent=f.default,Object.keys(ne).forEach(function(e){r[e]=ne[e](r)})}return e.buildHeaders=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=i({},te,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(){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]:re.GET,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f=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(f)).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 Y.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,re.GET,t,r)},e.prototype.post=function(e,t,r){return this.request(e,re.POST,t,r)},e.prototype.put=function(e,t,r){return this.request(e,re.PUT,t,r)},e.prototype.patch=function(e,t,r){return this.request(e,re.PATCH,t,r)},e.prototype.del=function(e,t,r){return this.request(e,re.DELETE,t,r)},e}();t.default=oe},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 u(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 a=r(5),i=function(e){return e&&e.__esModule?e:{default:e}}(a),s=t.NAME="NotImplementedError",f=t.STATUS=405,c=t.createMessage=function(e,t){return"Method "+e+" not implemented for api endpoint "+t},l=function(e){function t(r,u){n(this,t);var a=c(r,u),i=o(this,e.call(this,a));return i.name=s,i.status=f,i}return u(t,e),t}(i.default);t.default=l},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 u(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 a=r(5),i=function(e){return e&&e.__esModule?e:{default:e}}(a),s=t.createMessage=function(e){return"Failed validating "+e+". View `e.errors` for details."},f=t.NAME="ValidationError",c=t.STATUS=422,l=function(e){function t(r,u){n(this,t);var a=s(u),i=o(this,e.call(this,a));return i.name=f,i.errors=r,i.status=c,i}return u(t,e),t}(i.default);t.default=l}]));
//# sourceMappingURL=easypost.js.map
{
"name": "@easypost/api",
"description": "EasyPost Node Client Library",
"version": "3.0.9",
"version": "3.0.10",
"author": "Easypost Engineering <support@easypost.com>",

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

@@ -33,3 +33,3 @@ import T from 'proptypes';

if (data.children && data.children.length) {
res = res.concat(data.children.map(d => this.convertKeyMap(d)));
res = res.concat(data.children.reduce((arr, d) => arr.concat(this.convertKeyMap(d)), []));
}

@@ -36,0 +36,0 @@

@@ -18,3 +18,3 @@ import T from 'proptypes';

quantity: T.number,
value: T.number,
value: T.string, // decimal, so use as a string instead of a number
weight: T.number,

@@ -34,3 +34,21 @@ hs_tariff_number: T.string,

}
constructor(data) {
let value = data.value;
if (value && typeof value !== 'string') {
value = value.toString();
}
super({ ...data, value });
}
async save() {
if (this.value && typeof this.value !== 'string') {
this.value = this.value.toString();
}
return super.save();
}
}
);

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