UNPKG

smartystreets-javascript-sdk

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