UNPKG

smartystreets-javascript-sdk

Version:
2 lines (1 loc) 1.64 kB
"use strict";var e,r,n=require("../Errors.cjs"),s=require("../Request.cjs"),o=require("../util/buildInputData.cjs"),a=require("../util/apiToSDKKeyMap.cjs");exports.__require=function(){if(r)return e;r=1;const t=n.__require(),i=s.__require(),d=o.__require(),{usEnrichment:u}=a.__require();return e=class{constructor(e){this.sender=e}sendPrincipal(e){if(void 0===e)throw new t.UndefinedLookupError;let r=new i;return r.parameters=d(e,u),r.baseUrlParam=e.smartyKey+"/property/principal",new Promise(((n,s)=>{this.sender.send(r).then((r=>{r.error&&s(r.error),e.response=r.payload,n(e)})).catch(s)}))}sendFinancial(e){if(void 0===e)throw new t.UndefinedLookupError;let r=new i;return r.parameters=d(e,u),r.baseUrlParam=e.smartyKey+"/property/financial",new Promise(((n,s)=>{this.sender.send(r).then((r=>{r.error&&s(r.error),e.response=r.payload,n(e)})).catch(s)}))}sendGeo(e){if(void 0===e)throw new t.UndefinedLookupError;let r=new i;return r.parameters=d(e,u),r.baseUrlParam=e.smartyKey+"/geo-reference",new Promise(((n,s)=>{this.sender.send(r).then((r=>{r.error&&s(r.error),e.response=r.payload,n(e)})).catch(s)}))}sendSecondary(e){if(void 0===e)throw new t.UndefinedLookupError;let r=new i;return r.parameters=d(e,u),r.baseUrlParam=e.smartyKey+"/secondary",new Promise(((n,s)=>{this.sender.send(r).then((r=>{r.error&&s(r.error),e.response=r.payload,n(e)})).catch(s)}))}sendSecondaryCount(e){if(void 0===e)throw new t.UndefinedLookupError;let r=new i;return r.parameters=d(e,u),r.baseUrlParam=e.smartyKey+"/secondary/count",new Promise(((n,s)=>{this.sender.send(r).then((r=>{r.error&&s(r.error),e.response=r.payload,n(e)})).catch(s)}))}}};