smartystreets-javascript-sdk 5.2.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/AgentSender.cjs +1 -0
- package/dist/cjs/BaseUrlSender.cjs +1 -0
- package/dist/cjs/Batch.cjs +1 -0
- package/dist/cjs/ClientBuilder.cjs +1 -0
- package/dist/cjs/CustomHeaderSender.cjs +1 -0
- package/dist/cjs/Errors.cjs +1 -0
- package/dist/cjs/HttpSender.cjs +1 -0
- package/dist/cjs/InputData.cjs +1 -0
- package/dist/cjs/LicenseSender.cjs +1 -0
- package/dist/cjs/Request.cjs +1 -0
- package/dist/cjs/Response.cjs +1 -0
- package/dist/cjs/RetrySender.cjs +1 -0
- package/dist/cjs/SharedCredentials.cjs +1 -0
- package/dist/cjs/SigningSender.cjs +1 -0
- package/dist/cjs/StaticCredentials.cjs +1 -0
- package/dist/cjs/StatusCodeSender.cjs +1 -0
- package/dist/cjs/_virtual/Batch.cjs +1 -0
- package/dist/cjs/_virtual/Candidate.cjs +1 -0
- package/dist/cjs/_virtual/Candidate2.cjs +1 -0
- package/dist/cjs/_virtual/ClientBuilder.cjs +1 -0
- package/dist/cjs/_virtual/Errors.cjs +1 -0
- package/dist/cjs/_virtual/Lookup.cjs +1 -0
- package/dist/cjs/_virtual/Lookup2.cjs +1 -0
- package/dist/cjs/_virtual/Lookup3.cjs +1 -0
- package/dist/cjs/_virtual/Lookup4.cjs +1 -0
- package/dist/cjs/_virtual/Lookup5.cjs +1 -0
- package/dist/cjs/_virtual/Lookup6.cjs +1 -0
- package/dist/cjs/_virtual/Lookup7.cjs +1 -0
- package/dist/cjs/_virtual/Lookup8.cjs +1 -0
- package/dist/cjs/_virtual/Response.cjs +1 -0
- package/dist/cjs/_virtual/Result.cjs +1 -0
- package/dist/cjs/_virtual/Result2.cjs +1 -0
- package/dist/cjs/_virtual/SharedCredentials.cjs +1 -0
- package/dist/cjs/_virtual/StaticCredentials.cjs +1 -0
- package/dist/cjs/_virtual/Suggestion.cjs +1 -0
- package/dist/cjs/_virtual/Suggestion2.cjs +1 -0
- package/dist/cjs/_virtual/_axios.cjs +1 -0
- package/dist/cjs/_virtual/_commonjsHelpers.cjs +1 -0
- package/dist/cjs/_virtual/buildClients.cjs +1 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/international_address_autocomplete/Client.cjs +1 -0
- package/dist/cjs/international_address_autocomplete/Lookup.cjs +1 -0
- package/dist/cjs/international_address_autocomplete/Suggestion.cjs +1 -0
- package/dist/cjs/international_street/Candidate.cjs +1 -0
- package/dist/cjs/international_street/Client.cjs +1 -0
- package/dist/cjs/international_street/Lookup.cjs +1 -0
- package/dist/cjs/package.json.cjs +1 -0
- package/dist/cjs/us_autocomplete_pro/Client.cjs +1 -0
- package/dist/cjs/us_autocomplete_pro/Lookup.cjs +1 -0
- package/dist/cjs/us_autocomplete_pro/Suggestion.cjs +1 -0
- package/dist/cjs/us_enrichment/Client.cjs +1 -0
- package/dist/cjs/us_enrichment/Lookup.cjs +1 -0
- package/dist/cjs/us_enrichment/Response.cjs +1 -0
- package/dist/cjs/us_extract/Address.cjs +1 -0
- package/dist/cjs/us_extract/Client.cjs +1 -0
- package/dist/cjs/us_extract/Lookup.cjs +1 -0
- package/dist/cjs/us_extract/Result.cjs +1 -0
- package/dist/cjs/us_reverse_geo/Client.cjs +1 -0
- package/dist/cjs/us_reverse_geo/Lookup.cjs +1 -0
- package/dist/cjs/us_reverse_geo/Response.cjs +1 -0
- package/dist/cjs/us_reverse_geo/Result.cjs +1 -0
- package/dist/cjs/us_street/Candidate.cjs +1 -0
- package/dist/cjs/us_street/Client.cjs +1 -0
- package/dist/cjs/us_street/Lookup.cjs +1 -0
- package/dist/cjs/us_zipcode/Client.cjs +1 -0
- package/dist/cjs/us_zipcode/Lookup.cjs +1 -0
- package/dist/cjs/us_zipcode/Result.cjs +1 -0
- package/dist/cjs/util/Sleeper.cjs +1 -0
- package/dist/cjs/util/apiToSDKKeyMap.cjs +1 -0
- package/dist/cjs/util/buildClients.cjs +1 -0
- package/dist/cjs/util/buildInputData.cjs +1 -0
- package/dist/cjs/util/buildSmartyResponse.cjs +1 -0
- package/dist/cjs/util/sendBatch.cjs +1 -0
- package/dist/esm/AgentSender.mjs +1 -0
- package/dist/esm/BaseUrlSender.mjs +1 -0
- package/dist/esm/Batch.mjs +1 -0
- package/dist/esm/ClientBuilder.mjs +1 -0
- package/dist/esm/CustomHeaderSender.mjs +1 -0
- package/dist/esm/Errors.mjs +1 -0
- package/dist/esm/HttpSender.mjs +1 -0
- package/dist/esm/InputData.mjs +1 -0
- package/dist/esm/LicenseSender.mjs +1 -0
- package/dist/esm/Request.mjs +1 -0
- package/dist/esm/Response.mjs +1 -0
- package/dist/esm/RetrySender.mjs +1 -0
- package/dist/esm/SharedCredentials.mjs +1 -0
- package/dist/esm/SigningSender.mjs +1 -0
- package/dist/esm/StaticCredentials.mjs +1 -0
- package/dist/esm/StatusCodeSender.mjs +1 -0
- package/dist/esm/_virtual/Batch.mjs +1 -0
- package/dist/esm/_virtual/Candidate.mjs +1 -0
- package/dist/esm/_virtual/Candidate2.mjs +1 -0
- package/dist/esm/_virtual/ClientBuilder.mjs +1 -0
- package/dist/esm/_virtual/Errors.mjs +1 -0
- package/dist/esm/_virtual/Lookup.mjs +1 -0
- package/dist/esm/_virtual/Lookup2.mjs +1 -0
- package/dist/esm/_virtual/Lookup3.mjs +1 -0
- package/dist/esm/_virtual/Lookup4.mjs +1 -0
- package/dist/esm/_virtual/Lookup5.mjs +1 -0
- package/dist/esm/_virtual/Lookup6.mjs +1 -0
- package/dist/esm/_virtual/Lookup7.mjs +1 -0
- package/dist/esm/_virtual/Lookup8.mjs +1 -0
- package/dist/esm/_virtual/Response.mjs +1 -0
- package/dist/esm/_virtual/Result.mjs +1 -0
- package/dist/esm/_virtual/Result2.mjs +1 -0
- package/dist/esm/_virtual/SharedCredentials.mjs +1 -0
- package/dist/esm/_virtual/StaticCredentials.mjs +1 -0
- package/dist/esm/_virtual/Suggestion.mjs +1 -0
- package/dist/esm/_virtual/Suggestion2.mjs +1 -0
- package/dist/esm/_virtual/_axios.mjs +1 -0
- package/dist/esm/_virtual/_commonjsHelpers.mjs +1 -0
- package/dist/esm/_virtual/buildClients.mjs +1 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/international_address_autocomplete/Client.mjs +1 -0
- package/dist/esm/international_address_autocomplete/Lookup.mjs +1 -0
- package/dist/esm/international_address_autocomplete/Suggestion.mjs +1 -0
- package/dist/esm/international_street/Candidate.mjs +1 -0
- package/dist/esm/international_street/Client.mjs +1 -0
- package/dist/esm/international_street/Lookup.mjs +1 -0
- package/dist/esm/package.json.mjs +1 -0
- package/dist/esm/us_autocomplete_pro/Client.mjs +1 -0
- package/dist/esm/us_autocomplete_pro/Lookup.mjs +1 -0
- package/dist/esm/us_autocomplete_pro/Suggestion.mjs +1 -0
- package/dist/esm/us_enrichment/Client.mjs +1 -0
- package/dist/esm/us_enrichment/Lookup.mjs +1 -0
- package/dist/esm/us_enrichment/Response.mjs +1 -0
- package/dist/esm/us_extract/Address.mjs +1 -0
- package/dist/esm/us_extract/Client.mjs +1 -0
- package/dist/esm/us_extract/Lookup.mjs +1 -0
- package/dist/esm/us_extract/Result.mjs +1 -0
- package/dist/esm/us_reverse_geo/Client.mjs +1 -0
- package/dist/esm/us_reverse_geo/Lookup.mjs +1 -0
- package/dist/esm/us_reverse_geo/Response.mjs +1 -0
- package/dist/esm/us_reverse_geo/Result.mjs +1 -0
- package/dist/esm/us_street/Candidate.mjs +1 -0
- package/dist/esm/us_street/Client.mjs +1 -0
- package/dist/esm/us_street/Lookup.mjs +1 -0
- package/dist/esm/us_zipcode/Client.mjs +1 -0
- package/dist/esm/us_zipcode/Lookup.mjs +1 -0
- package/dist/esm/us_zipcode/Result.mjs +1 -0
- package/dist/esm/util/Sleeper.mjs +1 -0
- package/dist/esm/util/apiToSDKKeyMap.mjs +1 -0
- package/dist/esm/util/buildClients.mjs +1 -0
- package/dist/esm/util/buildInputData.mjs +1 -0
- package/dist/esm/util/buildSmartyResponse.mjs +1 -0
- package/dist/esm/util/sendBatch.mjs +1 -0
- package/package.json +26 -6
- package/.github/workflows/node-tests.yml +0 -27
- package/CHANGELOG.md +0 -5
- package/Makefile +0 -28
- package/examples/international_address_autocomplete.js +0 -58
- package/examples/international_street.js +0 -56
- package/examples/us_autocomplete_pro.js +0 -63
- package/examples/us_enrichment.js +0 -36
- package/examples/us_extract.js +0 -40
- package/examples/us_reverse_geo.js +0 -40
- package/examples/us_street.js +0 -73
- package/examples/us_zipcode.js +0 -57
- package/index.js +0 -41
- package/js-sdk-demo.cast +0 -95
- package/src/AgentSender.js +0 -16
- package/src/BaseUrlSender.js +0 -18
- package/src/Batch.js +0 -49
- package/src/ClientBuilder.js +0 -212
- package/src/CustomHeaderSender.js +0 -20
- package/src/Errors.js +0 -100
- package/src/HttpSender.js +0 -66
- package/src/InputData.js +0 -21
- package/src/LicenseSender.js +0 -20
- package/src/Request.js +0 -12
- package/src/Response.js +0 -10
- package/src/RetrySender.js +0 -50
- package/src/SharedCredentials.js +0 -13
- package/src/SigningSender.js +0 -26
- package/src/StaticCredentials.js +0 -13
- package/src/StatusCodeSender.js +0 -35
- package/src/international_address_autocomplete/Client.js +0 -41
- package/src/international_address_autocomplete/Lookup.js +0 -14
- package/src/international_address_autocomplete/Suggestion.js +0 -14
- package/src/international_street/Candidate.js +0 -153
- package/src/international_street/Client.js +0 -42
- package/src/international_street/Lookup.js +0 -85
- package/src/us_autocomplete_pro/Client.js +0 -41
- package/src/us_autocomplete_pro/Lookup.js +0 -29
- package/src/us_autocomplete_pro/Suggestion.js +0 -19
- package/src/us_enrichment/Client.js +0 -112
- package/src/us_enrichment/Lookup.js +0 -13
- package/src/us_enrichment/Response.js +0 -559
- package/src/us_extract/Address.js +0 -17
- package/src/us_extract/Client.js +0 -35
- package/src/us_extract/Lookup.js +0 -24
- package/src/us_extract/Result.js +0 -21
- package/src/us_reverse_geo/Client.js +0 -40
- package/src/us_reverse_geo/Lookup.js +0 -17
- package/src/us_reverse_geo/Response.js +0 -17
- package/src/us_reverse_geo/Result.js +0 -36
- package/src/us_street/Candidate.js +0 -89
- package/src/us_street/Client.js +0 -43
- package/src/us_street/Lookup.js +0 -25
- package/src/us_zipcode/Client.js +0 -39
- package/src/us_zipcode/Lookup.js +0 -16
- package/src/us_zipcode/Result.js +0 -45
- package/src/util/Sleeper.js +0 -8
- package/src/util/apiToSDKKeyMap.js +0 -75
- package/src/util/buildClients.js +0 -48
- package/src/util/buildInputData.js +0 -11
- package/src/util/buildSmartyResponse.js +0 -10
- package/src/util/sendBatch.js +0 -39
- package/tests/fixtures/MockSleeper.js +0 -10
- package/tests/fixtures/mock_senders.js +0 -43
- package/tests/international_address_autocomplete/test_Client.js +0 -86
- package/tests/international_address_autocomplete/test_Lookup.js +0 -55
- package/tests/international_street/test_Candidate.js +0 -268
- package/tests/international_street/test_Client.js +0 -70
- package/tests/international_street/test_Lookup.js +0 -108
- package/tests/test_AgentSender.js +0 -25
- package/tests/test_BaseUrlSender.js +0 -31
- package/tests/test_Batch.js +0 -73
- package/tests/test_CustomHeaderSender.js +0 -31
- package/tests/test_ExtractExample.js +0 -167
- package/tests/test_HttpSender.js +0 -93
- package/tests/test_LicenseSender.js +0 -40
- package/tests/test_RetrySender.js +0 -98
- package/tests/test_SigningSender.js +0 -56
- package/tests/test_StatusCodeSender.js +0 -95
- package/tests/us_autocomplete_pro/test_Client.js +0 -116
- package/tests/us_autocomplete_pro/test_Lookup.js +0 -11
- package/tests/us_autocomplete_pro/test_Suggestion.js +0 -24
- package/tests/us_enrichment/test_Client.js +0 -455
- package/tests/us_enrichment/test_Lookup.js +0 -22
- package/tests/us_enrichment/test_Response.js +0 -739
- package/tests/us_extract/test_Address.js +0 -67
- package/tests/us_extract/test_Client.js +0 -148
- package/tests/us_extract/test_Lookup.js +0 -19
- package/tests/us_extract/test_Result.js +0 -39
- package/tests/us_reverse_geo/test_Client.js +0 -48
- package/tests/us_reverse_geo/test_Lookup.js +0 -14
- package/tests/us_reverse_geo/test_Response.js +0 -44
- package/tests/us_street/test_Candidate.js +0 -133
- package/tests/us_street/test_Client.js +0 -150
- package/tests/us_street/test_Lookup.js +0 -29
- package/tests/us_zipcode/test_Client.js +0 -150
- package/tests/us_zipcode/test_Result.js +0 -81
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as o from"axios";import{getAugmentedNamespace as m}from"./_commonjsHelpers.mjs";var r=m(o);export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})})),r}export{t as getAugmentedNamespace,e as getDefaultExportFromCjs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getDefaultExportFromCjs as r}from"./_commonjsHelpers.mjs";import{__require as m}from"../util/buildClients.mjs";var e=r(m());export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"./_virtual/Batch.mjs";import r from"./_virtual/ClientBuilder.mjs";import t from"./_virtual/buildClients.mjs";import i from"./_virtual/SharedCredentials.mjs";import m from"./_virtual/StaticCredentials.mjs";import u from"./_virtual/Errors.mjs";import e from"./_virtual/Lookup.mjs";import s from"./_virtual/Candidate.mjs";import a from"./_virtual/Lookup2.mjs";import p from"./_virtual/Result.mjs";import l from"./_virtual/Lookup3.mjs";import n from"./_virtual/Suggestion.mjs";import v from"./_virtual/Lookup4.mjs";import d from"./_virtual/Result2.mjs";import f from"./_virtual/Lookup5.mjs";import j from"./_virtual/Candidate2.mjs";import _ from"./_virtual/Lookup6.mjs";import k from"./_virtual/Lookup7.mjs";import L from"./_virtual/Suggestion2.mjs";import C from"./_virtual/Lookup8.mjs";import c from"./_virtual/Response.mjs";const S={Batch:o,ClientBuilder:r,buildClient:t,SharedCredentials:i,StaticCredentials:m,Errors:u},g={Lookup:e,Candidate:s},R={Lookup:a,Result:p},h={Lookup:l,Suggestion:n},B={Lookup:v,Result:d},E={Lookup:f,Candidate:j},A={Lookup:_},b={Lookup:k,Suggestion:L},x={Lookup:C,Response:c};var G={core:S,usStreet:g,usZipcode:R,usAutocompletePro:h,usExtract:B,internationalStreet:E,usReverseGeo:A,internationalAddressAutocomplete:b,usEnrichment:x};export{S as core,G as default,b as internationalAddressAutocomplete,E as internationalStreet,h as usAutocompletePro,x as usEnrichment,B as usExtract,A as usReverseGeo,g as usStreet,R as usZipcode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as r}from"../Errors.mjs";import{__require as e}from"../Request.mjs";import{__require as s}from"./Suggestion.mjs";import{__require as t}from"../util/buildInputData.mjs";import{__require as a}from"../util/apiToSDKKeyMap.mjs";var o,i;function n(){if(i)return o;i=1;const n=r(),d=e(),u=s(),m=t(),p=a().internationalAddressAutocomplete;return o=class{constructor(r){this.sender=r}send(r){if(void 0===r)throw new n.UndefinedLookupError;let e=new d;return e.parameters=m(r,p),r.addressId&&(e.baseUrlParam=r.addressId),new Promise(((s,t)=>{this.sender.send(e).then((e=>{var a;e.error&&t(e.error),r.result=(a=e.payload)&&null===a.candidates?[]:a.candidates.map((r=>new u(r))),s(r)})).catch(t)}))}}}export{n as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s,t;function e(){if(t)return s;t=1;return s=class{constructor({search:s,addressId:t,country:e,maxResults:r=5,includeOnlyLocality:i,includeOnlyPostalCode:l}={}){this.result=[],this.search=s,this.addressId=t,this.country=e,this.maxResults=r,this.includeOnlyLocality=i,this.includeOnlyPostalCode=l}}}export{e as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,s;function e(){if(s)return t;s=1;return t=class{constructor(t){this.street=t.street,this.locality=t.locality,this.administrativeArea=t.administrative_area,this.postalCode=t.postal_code,this.countryIso3=t.country_iso3,this.entries=t.entries,this.addressText=t.address_text,this.addressId=t.address_id}}}export{e as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s,n;function e(){if(n)return s;n=1;return s=class{constructor(s){this.organization=s.organization,this.address1=s.address1,this.address2=s.address2,this.address3=s.address3,this.address4=s.address4,this.address5=s.address5,this.address6=s.address6,this.address7=s.address7,this.address8=s.address8,this.address9=s.address9,this.address10=s.address10,this.address11=s.address11,this.address12=s.address12,this.components={},void 0!==s.components&&(this.components.countryIso3=s.components.country_iso_3,this.components.superAdministrativeArea=s.components.super_administrative_area,this.components.administrativeArea=s.components.administrative_area,this.components.administrativeAreaShort=s.components.administrative_area_short,this.components.administrativeAreaLong=s.components.administrative_area_long,this.components.subAdministrativeArea=s.components.sub_administrative_area,this.components.dependentLocality=s.components.dependent_locality,this.components.dependentLocalityName=s.components.dependent_locality_name,this.components.doubleDependentLocality=s.components.double_dependent_locality,this.components.locality=s.components.locality,this.components.postalCode=s.components.postal_code,this.components.postalCodeShort=s.components.postal_code_short,this.components.postalCodeExtra=s.components.postal_code_extra,this.components.premise=s.components.premise,this.components.premiseExtra=s.components.premise_extra,this.components.premisePrefixNumber=s.components.premise_prefix_number,this.components.premiseNumber=s.components.premise_number,this.components.premiseType=s.components.premise_type,this.components.thoroughfare=s.components.thoroughfare,this.components.thoroughfarePredirection=s.components.thoroughfare_predirection,this.components.thoroughfarePostdirection=s.components.thoroughfare_postdirection,this.components.thoroughfareName=s.components.thoroughfare_name,this.components.thoroughfareTrailingType=s.components.thoroughfare_trailing_type,this.components.thoroughfareType=s.components.thoroughfare_type,this.components.dependentThoroughfare=s.components.dependent_thoroughfare,this.components.dependentThoroughfarePredirection=s.components.dependent_thoroughfare_predirection,this.components.dependentThoroughfarePostdirection=s.components.dependent_thoroughfare_postdirection,this.components.dependentThoroughfareName=s.components.dependent_thoroughfare_name,this.components.dependentThoroughfareTrailingType=s.components.dependent_thoroughfare_trailing_type,this.components.dependentThoroughfareType=s.components.dependent_thoroughfare_type,this.components.building=s.components.building,this.components.buildingLeadingType=s.components.building_leading_type,this.components.buildingName=s.components.building_name,this.components.buildingTrailingType=s.components.building_trailing_type,this.components.subBuildingType=s.components.sub_building_type,this.components.subBuildingNumber=s.components.sub_building_number,this.components.subBuildingName=s.components.sub_building_name,this.components.subBuilding=s.components.sub_building,this.components.levelType=s.components.level_type,this.components.levelNumber=s.components.level_number,this.components.postBox=s.components.post_box,this.components.postBoxType=s.components.post_box_type,this.components.postBoxNumber=s.components.post_box_number),this.analysis={},void 0!==s.analysis&&(this.analysis.verificationStatus=s.analysis.verification_status,this.analysis.addressPrecision=s.analysis.address_precision,this.analysis.maxAddressPrecision=s.analysis.max_address_precision,this.analysis.changes={},void 0!==s.analysis.changes&&(this.analysis.changes.organization=s.analysis.changes.organization,this.analysis.changes.address1=s.analysis.changes.address1,this.analysis.changes.address2=s.analysis.changes.address2,this.analysis.changes.address3=s.analysis.changes.address3,this.analysis.changes.address4=s.analysis.changes.address4,this.analysis.changes.address5=s.analysis.changes.address5,this.analysis.changes.address6=s.analysis.changes.address6,this.analysis.changes.address7=s.analysis.changes.address7,this.analysis.changes.address8=s.analysis.changes.address8,this.analysis.changes.address9=s.analysis.changes.address9,this.analysis.changes.address10=s.analysis.changes.address10,this.analysis.changes.address11=s.analysis.changes.address11,this.analysis.changes.address12=s.analysis.changes.address12,this.analysis.changes.components={},void 0!==s.analysis.changes.components&&(this.analysis.changes.components.countryIso3=s.analysis.changes.components.country_iso_3,this.analysis.changes.components.superAdministrativeArea=s.analysis.changes.components.super_administrative_area,this.analysis.changes.components.administrativeArea=s.analysis.changes.components.administrative_area,this.analysis.changes.components.administrativeAreaShort=s.analysis.changes.components.administrative_area_short,this.analysis.changes.components.administrativeAreaLong=s.analysis.changes.components.administrative_area_long,this.analysis.changes.components.subAdministrativeArea=s.analysis.changes.components.sub_administrative_area,this.analysis.changes.components.dependentLocality=s.analysis.changes.components.dependent_locality,this.analysis.changes.components.dependentLocalityName=s.analysis.changes.components.dependent_locality_name,this.analysis.changes.components.doubleDependentLocality=s.analysis.changes.components.double_dependent_locality,this.analysis.changes.components.locality=s.analysis.changes.components.locality,this.analysis.changes.components.postalCode=s.analysis.changes.components.postal_code,this.analysis.changes.components.postalCodeShort=s.analysis.changes.components.postal_code_short,this.analysis.changes.components.postalCodeExtra=s.analysis.changes.components.postal_code_extra,this.analysis.changes.components.premise=s.analysis.changes.components.premise,this.analysis.changes.components.premiseExtra=s.analysis.changes.components.premise_extra,this.analysis.changes.components.premisePrefixNumber=s.analysis.changes.components.premise_prefix_number,this.analysis.changes.components.premiseNumber=s.analysis.changes.components.premise_number,this.analysis.changes.components.premiseType=s.analysis.changes.components.premise_type,this.analysis.changes.components.thoroughfare=s.analysis.changes.components.thoroughfare,this.analysis.changes.components.thoroughfarePredirection=s.analysis.changes.components.thoroughfare_predirection,this.analysis.changes.components.thoroughfarePostdirection=s.analysis.changes.components.thoroughfare_postdirection,this.analysis.changes.components.thoroughfareName=s.analysis.changes.components.thoroughfare_name,this.analysis.changes.components.thoroughfareTrailingType=s.analysis.changes.components.thoroughfare_trailing_type,this.analysis.changes.components.thoroughfareType=s.analysis.changes.components.thoroughfare_type,this.analysis.changes.components.dependentThoroughfare=s.analysis.changes.components.dependent_thoroughfare,this.analysis.changes.components.dependentThoroughfarePredirection=s.analysis.changes.components.dependent_thoroughfare_predirection,this.analysis.changes.components.dependentThoroughfarePostdirection=s.analysis.changes.components.dependent_thoroughfare_postdirection,this.analysis.changes.components.dependentThoroughfareName=s.analysis.changes.components.dependent_thoroughfare_name,this.analysis.changes.components.dependentThoroughfareTrailingType=s.analysis.changes.components.dependent_thoroughfare_trailing_type,this.analysis.changes.components.dependentThoroughfareType=s.analysis.changes.components.dependent_thoroughfare_type,this.analysis.changes.components.building=s.analysis.changes.components.building,this.analysis.changes.components.buildingLeadingType=s.analysis.changes.components.building_leading_type,this.analysis.changes.components.buildingName=s.analysis.changes.components.building_name,this.analysis.changes.components.buildingTrailingType=s.analysis.changes.components.building_trailing_type,this.analysis.changes.components.subBuildingType=s.analysis.changes.components.sub_building_type,this.analysis.changes.components.subBuildingNumber=s.analysis.changes.components.sub_building_number,this.analysis.changes.components.subBuildingName=s.analysis.changes.components.sub_building_name,this.analysis.changes.components.subBuilding=s.analysis.changes.components.sub_building,this.analysis.changes.components.levelType=s.analysis.changes.components.level_type,this.analysis.changes.components.levelNumber=s.analysis.changes.components.level_number,this.analysis.changes.components.postBox=s.analysis.changes.components.post_box,this.analysis.changes.components.postBoxType=s.analysis.changes.components.post_box_type,this.analysis.changes.components.postBoxNumber=s.analysis.changes.components.post_box_number))),this.metadata={},void 0!==s.metadata&&(this.metadata.latitude=s.metadata.latitude,this.metadata.longitude=s.metadata.longitude,this.metadata.geocodePrecision=s.metadata.geocode_precision,this.metadata.maxGeocodePrecision=s.metadata.max_geocode_precision,this.metadata.addressFormat=s.metadata.address_format)}}}export{e as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as r}from"../Request.mjs";import{__require as e}from"../Errors.mjs";import{__require as t}from"./Candidate.mjs";import{__require as o}from"../util/buildInputData.mjs";import{__require as i}from"../util/apiToSDKKeyMap.mjs";var s,n;function a(){if(n)return s;n=1;const a=r(),u=e(),m=t(),p=o(),_=i().internationalStreet;return s=class{constructor(r){this.sender=r}send(r){if(void 0===r)throw new u.UndefinedLookupError;let e=new a;return e.parameters=p(r,_),new Promise(((t,o)=>{this.sender.send(e).then((e=>{e.error&&o(e.error),t(function(r,e){return r.payload.map((r=>{e.result.push(new m(r))})),e}(e,r))})).catch(o)}))}}}export{a as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as e}from"../Errors.mjs";var t,i;function r(){if(i)return t;i=1;const r=e().UnprocessableEntityError,o="Country field is required.",s="Either freeform or address1 is required.",n="Insufficient information: One or more required fields were not set on the lookup.",a="Invalid input: geocode can only be set to 'true' (default is 'false'.",u="Invalid input: language can only be set to 'latin' or 'native'. When not set, the the output language will match the language of the input values.";function h(e){if(!e)return!0;return e.replace(/\s/g,"").length<1}function d(e){return!h(e)}return t=class{constructor(e,t){this.result=[],this.country=e,this.freeform=t,this.address1=void 0,this.address2=void 0,this.address3=void 0,this.address4=void 0,this.organization=void 0,this.locality=void 0,this.administrativeArea=void 0,this.postalCode=void 0,this.geocode=void 0,this.language=void 0,this.inputId=void 0,this.ensureEnoughInfo=this.ensureEnoughInfo.bind(this),this.ensureValidData=this.ensureValidData.bind(this)}ensureEnoughInfo(){if(h(this.country))throw new r(o);if(d(this.freeform))return!0;if(h(this.address1))throw new r(s);if(d(this.postalCode))return!0;if(h(this.locality)||h(this.administrativeArea))throw new r(n);return!0}ensureValidData(){if((()=>d(this.geocode)&&"true"!==this.geocode.toLowerCase())())throw new r(a);if((()=>{let e=e=>this.language.toLowerCase()===e;return d(this.language)&&!(e("latin")||e("native"))})())throw new r(u);return!0}}}export{r as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s="smartystreets-javascript-sdk",e="6.0.0",t="Quick and easy Smarty address validation.",i=["smarty","smartystreets","address","validation","verification","verify","validate","street-address","geocoding","addresses","zipcode","autocomplete","autosuggest","suggestions","international","http","sdk"],r=["dist","README.md","LICENSE"],a="dist/cjs/index.cjs",o="dist/esm/index.mjs",d={".":{import:"./dist/esm/index.mjs",default:"./dist/cjs/index.cjs"}},l={build:"rollup --config",test:"mocha 'tests/**/*.{mjs,js}'"},n="Smarty SDK Team <support@smarty.com> (https://www.smarty.com)",p="Apache-2.0",m={type:"git",url:"github:smartystreets/smartystreets-javascript-sdk"},u={"@babel/preset-env":"^7.25.8","@rollup/plugin-commonjs":"^28.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.3.0","@rollup/plugin-terser":"^0.4.4",chai:"^4.3.6",mocha:"^10.2.0",rollup:"^4.22.5","rollup-plugin-delete":"^2.1.0"},c={axios:"^1.7.7","axios-retry":"^4.5.0"},y={name:s,version:e,description:t,keywords:i,files:r,main:a,module:o,exports:d,scripts:l,author:n,license:p,repository:m,devDependencies:u,dependencies:c};export{n as author,y as default,c as dependencies,t as description,u as devDependencies,d as exports,r as files,i as keywords,p as license,a as main,o as module,s as name,m as repository,l as scripts,e as version};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as r}from"../Errors.mjs";import{__require as e}from"../Request.mjs";import{__require as s}from"./Suggestion.mjs";import{__require as o}from"../util/buildInputData.mjs";import{__require as t}from"../util/apiToSDKKeyMap.mjs";var i,u;function n(){if(u)return i;u=1;const n=r(),a=e(),m=s(),p=o(),_=t().usAutocompletePro;return i=class{constructor(r){this.sender=r}send(r){if(void 0===r)throw new n.UndefinedLookupError;let e=new a;return e.parameters=p(r,_),new Promise(((s,o)=>{this.sender.send(e).then((e=>{var t;e.error&&o(e.error),r.result=null===(t=e.payload).suggestions?[]:t.suggestions.map((r=>new m(r))),s(r)})).catch(o)}))}}}export{n as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t;function i(){if(t)return e;t=1;return e=class{constructor(e){this.result=[],this.search=e,this.selected=void 0,this.maxResults=void 0,this.includeOnlyCities=[],this.includeOnlyStates=[],this.includeOnlyZIPCodes=[],this.excludeStates=[],this.preferCities=[],this.preferStates=[],this.preferZIPCodes=[],this.preferRatio=void 0,this.preferGeolocation=void 0,this.source=void 0}}}export{i as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,e;function s(){if(e)return t;e=1;return t=class{constructor(t){this.streetLine=t.street_line,this.secondary=t.secondary,this.city=t.city,this.state=t.state,this.zipcode=t.zipcode,this.entries=t.entries,t.source&&(this.source=t.source)}}}export{s as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,s;function e(){if(s)return t;s=1;return t=class{constructor(t,s,e,r,i){this.smartyKey=t,this.include=s,this.exclude=e,this.dataset=r,this.dataSubset=i,this.response={}}}}export{e as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,e;function s(){if(e)return t;e=1;return t={Response:class{constructor(t){this.smartyKey=t.smarty_key,this.dataSetName=t.data_set_name,this.dataSubsetName=t.data_subset_name,this.attributes={},t.attributes&&(this.attributes.firstFloorSqft=t.attributes["1st_floor_sqft"],this.attributes.secondFlootSqft=t.attributes["2nd_floor_sqft"],this.attributes.acres=t.attributes.acres,this.attributes.addressInfoPrivacy=t.attributes.address_info_privacy,this.attributes.airConditioner=t.attributes.air_conditioner,this.attributes.arborPergola=t.attributes.arbor_pergola,this.attributes.assessedImprovementPercent=t.attributes.assessed_improvement_percent,this.attributes.assessedImprovementValue=t.attributes.assessed_improvement_value,this.attributes.assessedLandValue=t.attributes.assessed_land_value,this.attributes.assessedValue=t.attributes.assessed_value,this.attributes.assessorLastUpdate=t.attributes.assessor_last_update,this.attributes.assessorTaxrollUpdate=t.attributes.assessor_taxroll_update,this.attributes.atticArea=t.attributes.attic_area,this.attributes.atticFlag=t.attributes.attic_flag,this.attributes.balcony=t.attributes.balcony,this.attributes.balconyArea=t.attributes.balcony_area,this.attributes.basementSqft=t.attributes.basement_sqft,this.attributes.basementSqftFinished=t.attributes.basement_sqft_finished,this.attributes.basementsqftUnfinished=t.attributes.basement_sqft_unfinished,this.attributes.bathHouse=t.attributes.bath_house,this.attributes.bathHouseSqft=t.attributes.bath_house_sqft,this.attributes.bathroomsPartial=t.attributes.bathrooms_partial,this.attributes.bathroomsTotal=t.attributes.bathrooms_total,this.attributes.bedrooms=t.attributes.bedrooms,this.attributes.block1=t.attributes.block_1,this.attributes.block2=t.attributes.block_2,this.attributes.boatAccess=t.attributes.boat_access,this.attributes.boatHouse=t.attributes.boat_house,this.attributes.boatHouseSqft=t.attributes.boat_house_sqft,this.attributes.boatLift=t.attributes.boat_lift,this.attributes.bonusRoom=t.attributes.bonus_room,this.attributes.breakfastNook=t.attributes.breakfast_nook,this.attributes.breezeway=t.attributes.breezeway,this.attributes.buildingDefinitionCode=t.attributes.building_definition,this.attributes.buildingSqft=t.attributes.building_sqft,this.attributes.cabin=t.attributes.cabin,this.attributes.cabinSqft=t.attributes.cabin_sqft,this.attributes.canopy=t.attributes.canopy,this.attributes.canopySqft=t.attributes.canopy_sqft,this.attributes.carport=t.attributes.carport,this.attributes.carportSqft=t.attributes.carport_sqft,this.attributes.cbsaCode=t.attributes.cbsa_code,this.attributes.cbsaName=t.attributes.cbsa_name,this.attributes.cellar=t.attributes.cellar,this.attributes.censusBlock=t.attributes.census_block,this.attributes.censusTract=t.attributes.census_tract,this.attributes.censusBlockGroup=t.attributes.census_block_group,this.attributes.censusFipsPlaceCode=t.attributes.census_fips_place_code,this.attributes.censusTract=t.attributes.census_tract,this.attributes.centralVacuum=t.attributes.central_vacuum,this.attributes.codeTitleCompany=t.attributes.code_title_company,this.attributes.combinedStatisticalArea=t.attributes.combined_statistical_area,this.attributes.communityRec=t.attributes.community_rec,this.attributes.companyFlag=t.attributes.company_flag,this.attributes.congressionalDistrict=t.attributes.congressional_district,this.attributes.constructionType=t.attributes.construction_type,this.attributes.contactCity=t.attributes.contact_city,this.attributes.contactCrrt=t.attributes.contact_crrt,this.attributes.contactFullAddress=t.attributes.contact_full_address,this.attributes.contactHouseNumber=t.attributes.contact_house_number,this.attributes.contactMailInfoFormat=t.attributes.contact_main_info_format,this.attributes.contactMailInfoPrivacy=t.attributes.contact_mail_info_privacy,this.attributes.contactMailingCounty=t.attributes.contact_mailing_county,this.attributes.contactMailingFips=t.attributes.contact_mailing_fips,this.attributes.contactPostDirection=t.attributes.contact_post_direction,this.attributes.contactPreDirection=t.attributes.contact_pre_direction,this.attributes.contactState=t.attributes.contact_state,this.attributes.contactStreetName=t.attributes.contact_street_name,this.attributes.contactSuffix=t.attributes.contact_suffix,this.attributes.contactUnitDesignator=t.attributes.contact_unit_designator,this.attributes.contactValue=t.attributes.contact_value,this.attributes.contactZip=t.attributes.contact_zip,this.attributes.contactZip4=t.attributes.contact_zip4,this.attributes.courtyard=t.attributes.courtyard,this.attributes.courtyardArea=t.attributes.courtyard_area,this.attributes.deck=t.attributes.deck,this.attributes.deckArea=t.attributes.deck_area,this.attributes.deedDocumentPage=t.attributes.deed_document_page,this.attributes.deedDocumentBook=t.attributes.deed_document_book,this.attributes.deedDocumentNumber=t.attributes.deed_document_number,this.attributes.deedOwnerFirstName=t.attributes.deed_owner_first_name,this.attributes.deedOwnerFirstName2=t.attributes.deed_owner_first_name2,this.attributes.deedOwnerFirstName3=t.attributes.deed_owner_first_name3,this.attributes.deedOwnerFirstName4=t.attributes.deed_owner_first_name4,this.attributes.deedOwnerFullName=t.attributes.deed_owner_full_name,this.attributes.deedOwnerFullName2=t.attributes.deed_owner_full_name2,this.attributes.deedOwnerFullName3=t.attributes.deed_owner_full_name3,this.attributes.deedOwnerFullName4=t.attributes.deed_owner_full_name4,this.attributes.deedOwnerLastName=t.attributes.deed_owner_last_name,this.attributes.deedOwnerLastName2=t.attributes.deed_owner_last_name2,this.attributes.deedOwnerLastName3=t.attributes.deed_owner_last_name3,this.attributes.deedOwnerLastName4=t.attributes.deed_owner_last_name4,this.attributes.deedOwnerMiddleName=t.attributes.deed_owner_middle_name,this.attributes.deedOwnerMiddleName2=t.attributes.deed_owner_middle_name2,this.attributes.deedOwnerMiddleName3=t.attributes.deed_owner_middle_name3,this.attributes.deedOwnerMiddleName4=t.attributes.deed_owner_middle_name4,this.attributes.deedOwnerSuffix=t.attributes.deed_owner_suffix,this.attributes.deedOwnerSuffix2=t.attributes.deed_owner_suffix2,this.attributes.deedOwnerSuffix3=t.attributes.deed_owner_suffix3,this.attributes.deedOwnerSuffix4=t.attributes.deed_owner_suffix4,this.attributes.deedSaleDate=t.attributes.deed_sale_date,this.attributes.deedSalePrice=t.attributes.deed_sale_price,this.attributes.deedTransactionId=t.attributes.deed_transaction_id,this.attributes.depthLinearFootage=t.attributes.depth_linear_footage,this.attributes.disabledTaxExemption=t.attributes.disabled_tax_exemption,this.attributes.drivewaySqft=t.attributes.driveway_sqft,this.attributes.drivewayType=t.attributes.driveway_type,this.attributes.effectiveYearBuilt=t.attributes.effective_year_built,this.attributes.elevationFeet=t.attributes.elevation_feet,this.attributes.elevator=t.attributes.elevator,this.attributes.equestrianArena=t.attributes.equestrian_arena,this.attributes.escalator=t.attributes.escalator,this.attributes.exerciseRoom=t.attributes.exercise_room,this.attributes.exteriorWalls=t.attributes.exterior_walls,this.attributes.familyRoom=t.attributes.family_room,this.attributes.fence=t.attributes.fence,this.attributes.fenceArea=t.attributes.fence_area,this.attributes.fipsCode=t.attributes.fips_code,this.attributes.fireResistanceCode=t.attributes.fire_resistance_code,this.attributes.fireSprinklersFlag=t.attributes.fire_sprinkler_flag,this.attributes.fireplace=t.attributes.fireplace,this.attributes.fireplaceNumber=t.attributes.fireplace_number,this.attributes.firstName=t.attributes.first_name,this.attributes.firstName2=t.attributes.first_name2,this.attributes.firstName3=t.attributes.first_name3,this.attributes.firstName4=t.attributes.first_name4,this.attributes.flooring=t.attributes.flooring,this.attributes.foundation=t.attributes.foundation,this.attributes.gameRoom=t.attributes.game_room,this.attributes.garage=t.attributes.garage,this.attributes.garageSqft=t.attributes.garage_sqft,this.attributes.gazebo=t.attributes.gazebo,this.attributes.gazeboSqft=t.attributes.gazebo_sqft,this.attributes.golfCourse=t.attributes.golf_course,this.attributes.grainery=t.attributes.grainery,this.attributes.grainerySqft=t.attributes.grainery_sqft,this.attributes.greatRoom=t.attributes.great_room,this.attributes.greenhouse=t.attributes.greenhouse,this.attributes.greenhouseSqft=t.attributes.greenhouse_sqft,this.attributes.grossSqft=t.attributes.gross_sqft,this.attributes.guesthouse=t.attributes.guesthouse,this.attributes.guesthouseSqft=t.attributes.guesthouse_sqft,this.attributes.handicapAccessibility=t.attributes.handicap_accessibility,this.attributes.heat=t.attributes.heat,this.attributes.heatFuelType=t.attributes.heat_fuel_type,this.attributes.hobbyRoom=t.attributes.hobby_room,this.attributes.homeownerTaxExemption=t.attributes.homeowner_tax_exemption,this.attributes.instrumentDate=t.attributes.instrument_date,this.attributes.intercomSystem=t.attributes.intercom_system,this.attributes.interestRateType2=t.attributes.interest_rate_type_2,this.attributes.interiorStructure=t.attributes.interior_structure,this.attributes.kennel=t.attributes.kennel,this.attributes.kennelSqft=t.attributes.kennel_sqft,this.attributes.landUseCode=t.attributes.land_use_code,this.attributes.landUseGroup=t.attributes.land_use_group,this.attributes.landUseStandard=t.attributes.land_use_standard,this.attributes.lastName=t.attributes.last_name,this.attributes.lastName2=t.attributes.last_name_2,this.attributes.lastName3=t.attributes.last_name_3,this.attributes.lastName4=t.attributes.last_name_4,this.attributes.latitude=t.attributes.latitude,this.attributes.laundry=t.attributes.laundry,this.attributes.leanTo=t.attributes.lean_to,this.attributes.leanToSqft=t.attributes.lean_to_sqft,this.attributes.legalDescription=t.attributes.legal_description,this.attributes.legalUnit=t.attributes.legal_unit,this.attributes.lenderAddress=t.attributes.lender_address,this.attributes.lenderAddress2=t.attributes.lender_address_2,this.attributes.lenderCity=t.attributes.lender_city,this.attributes.lenderCity2=t.attributes.lender_city_2,this.attributes.lenderCode=t.attributes.lender_code,this.attributes.lenderCode2=t.attributes.lender_code_2,this.attributes.lenderFirstName=t.attributes.lender_first_name,this.attributes.lenderFirstName2=t.attributes.lender_first_name_2,this.attributes.lenderLastName=t.attributes.lender_last_name,this.attributes.lenderLastName2=t.attributes.lender_last_name_2,this.attributes.lenderName=t.attributes.lender_name,this.attributes.lenderName2=t.attributes.lender_name_2,this.attributes.lenderSellerCarryBack=t.attributes.lender_seller_carry_back,this.attributes.lenderSellerCarryBack2=t.attributes.lender_seller_carry_back_2,this.attributes.lenderState=t.attributes.lender_state,this.attributes.lenderState2=t.attributes.lender_state_2,this.attributes.lenderZip=t.attributes.lender_zip,this.attributes.lenderZip2=t.attributes.lender_zip_2,this.attributes.lenderZipExtended=t.attributes.lender_zip_extended,this.attributes.lenderZipExtended2=t.attributes.lender_zip_extended_2,this.attributes.loadingPlatform=t.attributes.loading_platform,this.attributes.loadingPlatformSqft=t.attributes.loading_platform_sqft,this.attributes.longitude=t.attributes.longitude,this.attributes.lot1=t.attributes.lot_1,this.attributes.lot2=t.attributes.lot_2,this.attributes.lot3=t.attributes.lot_3,this.attributes.lotSqft=t.attributes.lot_sqft,this.attributes.marketImprovementPercent=t.attributes.market_improvement_percent,this.attributes.marketImprovementValue=t.attributes.market_improvement_value,this.attributes.marketLandValue=t.attributes.market_land_value,this.attributes.marketValueYear=t.attributes.market_value_year,this.attributes.matchType=t.attributes.match_type,this.attributes.mediaRoom=t.attributes.media_room,this.attributes.metroDivision=t.attributes.metro_division,this.attributes.middleName=t.attributes.middle_name,this.attributes.middleName2=t.attributes.middle_name_2,this.attributes.middleName3=t.attributes.middle_name_3,this.attributes.middleName4=t.attributes.middle_name_4,this.attributes.milkhouse=t.attributes.milkhouse,this.attributes.milkhouseSqft=t.attributes.milkhouse_sqft,this.attributes.minorCivilDivisionCode=t.attributes.minor_civil_division_code,this.attributes.minorCivilDivisionName=t.attributes.minor_civil_division_name,this.attributes.mobileHomeHookup=t.attributes.mobile_home_hookup,this.attributes.mortgageAmount=t.attributes.mortgage_amount,this.attributes.mortgageAmount2=t.attributes.mortgage_amount_2,this.attributes.mortgageDueDate=t.attributes.mortgage_due_date,this.attributes.mortgageDueDate2=t.attributes.mortgage_due_date_2,this.attributes.mortgageInterestRate=t.attributes.mortgage_interest_rate,this.attributes.mortgageInterestRateType=t.attributes.mortgage_interest_rate_type,this.attributes.mortgageLenderCode=t.attributes.mortgage_lender_code,this.attributes.mortgageRate2=t.attributes.mortgage_rate_2,this.attributes.mortgageRecordingDate=t.attributes.mortgage_recording_date,this.attributes.mortgageRecordingDate2=t.attributes.mortgage_recording_date_2,this.attributes.mortgageTerm=t.attributes.mortgage_term,this.attributes.mortgageTerm2=t.attributes.mortgage_term_2,this.attributes.mortgageTermType=t.attributes.mortgage_term_type,this.attributes.mortgageTermType2=t.attributes.mortgage_term_type_2,this.attributes.mortgageType=t.attributes.mortgage_type,this.attributes.mortgageType2=t.attributes.mortgage_type_2,this.attributes.msaCode=t.attributes.msa_code,this.attributes.msaName=t.attributes.msa_name,this.attributes.mudRoom=t.attributes.mud_room,this.attributes.multiParcelFlag=t.attributes.multi_parcel_flag,this.attributes.nameTitleCompany=t.attributes.name_title_company,this.attributes.neighborhoodCode=t.attributes.neighborhood_code,this.attributes.numberOfBuildings=t.attributes.number_of_buildings,this.attributes.office=t.attributes.office,this.attributes.officeSqft=t.attributes.office_sqft,this.attributes.otherTaxExemption=t.attributes.other_tax_exemption,this.attributes.outdoorKitchenFireplace=t.attributes.outdoor_kitchen_fireplace,this.attributes.overheadDoor=t.attributes.overhead_door,this.attributes.ownerFullName=t.attributes.owner_full_name,this.attributes.ownerFullName2=t.attributes.owner_full_name_2,this.attributes.ownerFullName3=t.attributes.owner_full_name_3,this.attributes.ownerFullName4=t.attributes.owner_full_name_4,this.attributes.ownerOccupancyStatus=t.attributes.owner_occupancy_status,this.attributes.ownershipTransferDate=t.attributes.ownership_transfer_date,this.attributes.ownershipTransferDocNumber=t.attributes.ownership_transfer_doc_number,this.attributes.ownershipTransferTransactionId=t.attributes.ownership_transfer_transaction_id,this.attributes.ownershipType=t.attributes.ownership_type,this.attributes.ownershipType2=t.attributes.ownership_type_2,this.attributes.ownershipVestingRelationCode=t.attributes.ownership_vesting_relation_code,this.attributes.parcelAccountNumber=t.attributes.parcel_account_number,this.attributes.parcelMapBook=t.attributes.parcel_map_book,this.attributes.parcelMapPage=t.attributes.parcel_map_page,this.attributes.parcelNumberAlternate=t.attributes.parcel_number_alternate,this.attributes.parcelNumberFormatted=t.attributes.parcel_number_formatted,this.attributes.parcelNumberPrevious=t.attributes.parcel_number_previous,this.attributes.parcelNumberYearAdded=t.attributes.parcel_number_year_added,this.attributes.parcelNumberYearChange=t.attributes.parcel_number_year_change,this.attributes.parcelRawNumber=t.attributes.parcel_raw_number,this.attributes.parcelShellRecord=t.attributes.parcel_shell_record,this.attributes.parkingSpaces=t.attributes.parking_spaces,this.attributes.patioArea=t.attributes.patio_area,this.attributes.phaseName=t.attributes.phase_name,this.attributes.plumbingFixturesCount=t.attributes.plumbing_fixtures_count,this.attributes.poleStruct=t.attributes.pole_struct,this.attributes.poleStructSqft=t.attributes.pole_struct_sqft,this.attributes.pond=t.attributes.pond,this.attributes.pool=t.attributes.pool,this.attributes.poolArea=t.attributes.pool_area,this.attributes.poolhouse=t.attributes.poolhouse,this.attributes.poolhouseSqft=t.attributes.poolhouse_sqft,this.attributes.porch=t.attributes.porch,this.attributes.porchArea=t.attributes.porch_area,this.attributes.poultryHouse=t.attributes.poultry_house,this.attributes.poultryHouseSqft=t.attributes.poultry_house_sqft,this.attributes.previousAssessedValue=t.attributes.previous_assessed_value,this.attributes.priorSaleAmount=t.attributes.prior_sale_amount,this.attributes.priorSaleDate=t.attributes.prior_sale_date,this.attributes.propertyAddressCarrierRouteCode=t.attributes.property_address_carrier_route_code,this.attributes.propertyAddressCity=t.attributes.property_address_city,this.attributes.propertyAddressFull=t.attributes.property_address_full,this.attributes.propertyAddressHouseNumber=t.attributes.property_address_house_number,this.attributes.propertyAddressPostDirection=t.attributes.property_address_post_direction,this.attributes.propertyAddressPreDirection=t.attributes.property_address_pre_direction,this.attributes.propertyAddressState=t.attributes.property_address_state,this.attributes.propertyAddressStreetName=t.attributes.property_address_street_name,this.attributes.propertyAddressStreetSuffix=t.attributes.property_address_street_suffix,this.attributes.propertyAddressUnitDesignator=t.attributes.property_address_unit_designator,this.attributes.propertyAddressUnitValue=t.attributes.property_address_unit_value,this.attributes.propertyAddressZip4=t.attributes.property_address_zip_4,this.attributes.propertyAddressZipcode=t.attributes.property_address_zipcode,this.attributes.publicationDate=t.attributes.publication_date,this.attributes.quarter=t.attributes.quarter,this.attributes.quarterQuarter=t.attributes.quarter_quarter,this.attributes.quonset=t.attributes.quonset,this.attributes.quonsetSqft=t.attributes.quonset_sqft,this.attributes.range=t.attributes.range,this.attributes.recordingDate=t.attributes.recording_date,this.attributes.roofCover=t.attributes.roof_cover,this.attributes.roofFrame=t.attributes.roof_frame,this.attributes.rooms=t.attributes.rooms,this.attributes.rvParking=t.attributes.rv_parking,this.attributes.safeRoom=t.attributes.safe_room,this.attributes.saleAmount=t.attributes.sale_amount,this.attributes.saleDate=t.attributes.sale_date,this.attributes.sauna=t.attributes.sauna,this.attributes.section=t.attributes.section,this.attributes.securityAlarm=t.attributes.security_alarm,this.attributes.seniorTaxExemption=t.attributes.senior_tax_exemption,this.attributes.sewerType=t.attributes.sewer_type,this.attributes.shed=t.attributes.shed,this.attributes.shedSqft=t.attributes.shed_sqft,this.attributes.silo=t.attributes.silo,this.attributes.siloSqft=t.attributes.silo_sqft,this.attributes.sittingRoom=t.attributes.sitting_room,this.attributes.situsCounty=t.attributes.situs_county,this.attributes.situsState=t.attributes.situs_state,this.attributes.soundSystem=t.attributes.sound_system,this.attributes.sportsCourt=t.attributes.sports_court,this.attributes.sprinklers=t.attributes.sprinklers,this.attributes.stable=t.attributes.stable,this.attributes.stableSqft=t.attributes.stable_sqft,this.attributes.storageBuilding=t.attributes.storage_building,this.attributes.storageBuildingSqft=t.attributes.storage_buildling_sqft,this.attributes.storiesNumber=t.attributes.stories_number,this.attributes.stormShelter=t.attributes.storm_shelter,this.attributes.stormShutter=t.attributes.storm_shutter,this.attributes.structureStyle=t.attributes.structure_style,this.attributes.study=t.attributes.study,this.attributes.subdivision=t.attributes.subdivision,this.attributes.suffix=t.attributes.suffix,this.attributes.suffix2=t.attributes.suffix_2,this.attributes.suffix3=t.attributes.suffix_3,this.attributes.suffix4=t.attributes.suffix_4,this.attributes.sunroom=t.attributes.sunroom,this.attributes.taxAssessYear=t.attributes.tax_assess_year,this.attributes.taxBilledAmount=t.attributes.tax_billed_amount,this.attributes.taxDelinquentYear=t.attributes.tax_delinquent_year,this.attributes.taxFiscalYear=t.attributes.tax_fiscal_year,this.attributes.taxJurisdiction=t.attributes.tax_jurisdiction,this.attributes.taxRateArea=t.attributes.tax_rate_area,this.attributes.tennisCourt=t.attributes.tennis_court,this.attributes.topographyCode=t.attributes.topography_code,this.attributes.totalMarketValue=t.attributes.total_market_value,this.attributes.township=t.attributes.township,this.attributes.tractNumber=t.attributes.tract_number,this.attributes.transferAmount=t.attributes.transfer_amount,this.attributes.trustDescription=t.attributes.trust_description,this.attributes.unitCount=t.attributes.unit_count,this.attributes.upperFloorsSqft=t.attributes.upper_floors_sqft,this.attributes.utility=t.attributes.utility,this.attributes.utilityBuilding=t.attributes.utility_building,this.attributes.utilityBuildingSqft=t.attributes.utility_building_sqft,this.attributes.utilitySqft=t.attributes.utility_sqft,this.attributes.veteranTaxExemption=t.attributes.veteran_tax_exemption,this.attributes.viewDescription=t.attributes.view_description,this.attributes.waterFeature=t.attributes.water_feature,this.attributes.waterServiceType=t.attributes.water_service_type,this.attributes.wetBar=t.attributes.wet_bar,this.attributes.widowTaxExemption=t.attributes.widow_tax_exemption,this.attributes.widthLinearFootage=t.attributes.width_linear_footage,this.attributes.wineCellar=t.attributes.wine_cellar,this.attributes.yearBuilt=t.attributes.year_built,this.attributes.zoning=t.attributes.zoning)}},FinancialResponse:class{constructor(t){this.smartyKey=t.smarty_key,this.dataSetName=t.data_set_name,this.dataSubsetName=t.data_subset_name,this.attributes={},t.attributes&&(this.attributes.assessedImprovementPercent=t.attributes.assessed_improvement_percent,this.attributes.assessedImprovementValue=t.attributes.assessed_improvement_value,this.attributes.assessedLandValue=t.attributes.assessed_land_value,this.attributes.assessedValue=t.attributes.assessed_value,this.attributes.assessorLastUpdate=t.attributes.assessor_last_update,this.attributes.assessorTaxrollUpdate=t.attributes.assessor_taxroll_update,this.attributes.contactCity=t.attributes.contact_city,this.attributes.contactCrrt=t.attributes.contact_crrt,this.attributes.contactFullAddress=t.attributes.contact_full_address,this.attributes.contactHouseNumber=t.attributes.contact_house_number,this.attributes.contactMailInfoFormat=t.attributes.contact_main_info_format,this.attributes.contactMailInfoPrivacy=t.attributes.contact_mail_info_privacy,this.attributes.contactMailingCounty=t.attributes.contact_mailing_county,this.attributes.contactMailingFips=t.attributes.contact_mailing_fips,this.attributes.contactPostDirection=t.attributes.contact_post_direction,this.attributes.contactPreDirection=t.attributes.contact_pre_direction,this.attributes.contactState=t.attributes.contact_state,this.attributes.contactStreetName=t.attributes.contact_street_name,this.attributes.contactSuffix=t.attributes.contact_suffix,this.attributes.contactUnitDesignator=t.attributes.contact_unit_designator,this.attributes.contactValue=t.attributes.contact_value,this.attributes.contactZip=t.attributes.contact_zip,this.attributes.contactZip4=t.attributes.contact_zip4,this.attributes.deedDocumentPage=t.attributes.deed_document_page,this.attributes.deedDocumentBook=t.attributes.deed_document_book,this.attributes.deedDocumentNumber=t.attributes.deed_document_number,this.attributes.deedOwnerFirstName=t.attributes.deed_owner_first_name,this.attributes.deedOwnerFirstName2=t.attributes.deed_owner_first_name2,this.attributes.deedOwnerFirstName3=t.attributes.deed_owner_first_name3,this.attributes.deedOwnerFirstName4=t.attributes.deed_owner_first_name4,this.attributes.deedOwnerFullName=t.attributes.deed_owner_full_name,this.attributes.deedOwnerFullName2=t.attributes.deed_owner_full_name2,this.attributes.deedOwnerFullName3=t.attributes.deed_owner_full_name3,this.attributes.deedOwnerFullName4=t.attributes.deed_owner_full_name4,this.attributes.deedOwnerLastName=t.attributes.deed_owner_last_name,this.attributes.deedOwnerLastName2=t.attributes.deed_owner_last_name2,this.attributes.deedOwnerLastName3=t.attributes.deed_owner_last_name3,this.attributes.deedOwnerLastName4=t.attributes.deed_owner_last_name4,this.attributes.deedOwnerMiddleName=t.attributes.deed_owner_middle_name,this.attributes.deedOwnerMiddleName2=t.attributes.deed_owner_middle_name2,this.attributes.deedOwnerMiddleName3=t.attributes.deed_owner_middle_name3,this.attributes.deedOwnerMiddleName4=t.attributes.deed_owner_middle_name4,this.attributes.deedOwnerSuffix=t.attributes.deed_owner_suffix,this.attributes.deedOwnerSuffix2=t.attributes.deed_owner_suffix2,this.attributes.deedOwnerSuffix3=t.attributes.deed_owner_suffix3,this.attributes.deedOwnerSuffix4=t.attributes.deed_owner_suffix4,this.attributes.deedSaleDate=t.attributes.deed_sale_date,this.attributes.deedSalePrice=t.attributes.deed_sale_price,this.attributes.deedTransactionId=t.attributes.deed_transaction_id,this.attributes.disabledTaxExemption=t.attributes.disabled_tax_exemption,this.attributes.financialHistory=t.attributes.financial_history?t.attributes.financial_history.map((t=>({codeTitleCompany:t.code_title_company,instrumentDate:t.instrument_date,interestRateType2:t.interest_rate_type_2,lenderAddress:t.lender_address,lenderAddress2:t.lender_address_2,lenderCity:t.lender_city,lenderCity2:t.lender_city_2,lenderCode:t.lender_code,lenderCode2:t.lender_code_2,lenderFirstName:t.lender_first_name,lenderFirstName2:t.lender_first_name_2,lenderLastName:t.lender_last_name,lenderLastName2:t.lender_last_name_2,lenderName:t.lender_name,lenderName2:t.lender_name_2,lenderSellerCarryBack:t.lender_seller_carry_back,lenderSellerCarryBack2:t.lender_seller_carry_back_2,lenderState:t.lender_state,lenderState2:t.lender_state_2,lenderZip:t.lender_zip,lenderZip2:t.lender_zip_2,lenderZipExtended:t.lender_zip_extended,lenderZipExtended2:t.lender_zip_extended_2,mortgageAmount:t.mortgage_amount,mortgageAmount2:t.mortgage_amount_2,mortgageDueDate:t.mortgage_due_date,mortgageDueDate2:t.mortgage_due_date_2,mortgageInterestRate:t.mortgage_interest_rate,mortgageInterestRateType:t.mortgage_interest_rate_type,mortgageLenderCode:t.mortgage_lender_code,mortgageRate:t.mortgage_rate,mortgageRate2:t.mortgage_rate_2,mortgageRecordingDate:t.mortgage_recording_date,mortgageRecordingDate2:t.mortgage_recording_date_2,mortgageTerm:t.mortgage_term,mortgageTerm2:t.mortgage_term_2,mortgageTermType:t.mortgage_term_type,mortgageTermType2:t.mortgage_term_type_2,mortgageType:t.mortgage_type,mortgageType2:t.mortgage_type_2,multiParcelFlag:t.multi_parcel_flag,nameTitleCompany:t.name_title_company,recordingDate:t.recording_date,transferAmount:t.transfer_amount}))):[],this.attributes.homeownerTaxExemption=t.attributes.homeowner_tax_exemption,this.attributes.marketImprovementPercent=t.attributes.market_improvement_percent,this.attributes.marketImprovementValue=t.attributes.market_improvement_value,this.attributes.marketLandValue=t.attributes.market_land_value,this.attributes.marketValueYear=t.attributes.market_value_year,this.attributes.matchType=t.attributes.match_type,this.attributes.otherTaxExemption=t.attributes.other_tax_exemption,this.attributes.ownershipTransferDate=t.attributes.ownership_transfer_date,this.attributes.ownershipTransferDocNumber=t.attributes.ownership_transfer_doc_number,this.attributes.ownershipTransferTransactionId=t.attributes.ownership_transfer_transaction_id,this.attributes.ownershipType=t.attributes.ownership_type,this.attributes.ownershipType2=t.attributes.ownership_type_2,this.attributes.previousAssessedValue=t.attributes.previous_assessed_value,this.attributes.priorSaleAmount=t.attributes.prior_sale_amount,this.attributes.priorSaleDate=t.attributes.prior_sale_date,this.attributes.saleAmount=t.attributes.sale_amount,this.attributes.saleDate=t.attributes.sale_date,this.attributes.seniorTaxExemption=t.attributes.senior_tax_exemption,this.attributes.taxAssessYear=t.attributes.tax_assess_year,this.attributes.taxBilledAmount=t.attributes.tax_billed_amount,this.attributes.taxDelinquentYear=t.attributes.tax_delinquent_year,this.attributes.taxFiscalYear=t.attributes.tax_fiscal_year,this.attributes.taxRateArea=t.attributes.tax_rate_area,this.attributes.totalMarketValue=t.attributes.total_market_value,this.attributes.trustDescription=t.attributes.trust_description,this.attributes.veteranTaxExemption=t.attributes.veteran_tax_exemption,this.attributes.widow_tax_exemption=t.attributes.widow_tax_exemption)}},GeoResponse:class{constructor(t){this.smartyKey=t.smarty_key,this.dataSetName=t.data_set_name,this.attributes={},t.attributes&&(this.attributes.censusBlock={},t.attributes.census_block&&(this.attributes.censusBlock.accuracy=t.attributes.census_block.accuracy,this.attributes.censusBlock.geoid=t.attributes.census_block.geoid),this.attributes.censusCountyDivision={},t.attributes.census_county_division&&(this.attributes.censusCountyDivision.accuracy=t.attributes.census_county_division.accuracy,this.attributes.censusCountyDivision.code=t.attributes.census_county_division.code,this.attributes.censusCountyDivision.name=t.attributes.census_county_division.name),this.attributes.censusTract={},t.attributes.census_tract&&(this.attributes.censusTract.code=t.attributes.census_tract.code),this.attributes.coreBasedStatArea={},t.attributes.core_based_stat_area&&(this.attributes.coreBasedStatArea.code=t.attributes.core_based_stat_area.code,this.attributes.coreBasedStatArea.name=t.attributes.core_based_stat_area.name),this.attributes.place={},t.attributes.place&&(this.attributes.place.accuracy=t.attributes.place.accuracy,this.attributes.place.code=t.attributes.place.code,this.attributes.place.name=t.attributes.place.name,this.attributes.place.type=t.attributes.place.type))}}}}export{s as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as t}from"../us_street/Candidate.mjs";var e,i;function r(){if(i)return e;i=1;const r=t();return e=class{constructor(t){this.text=t.text,this.verified=t.verified,this.line=t.line,this.start=t.start,this.end=t.end,this.candidates=t.api_output.map((t=>new r(t)))}}}export{r as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as r}from"../Errors.mjs";import{__require as e}from"../Request.mjs";import{__require as t}from"./Result.mjs";import{__require as s}from"../util/buildInputData.mjs";import{__require as o}from"../util/apiToSDKKeyMap.mjs";var i,n;function u(){if(n)return i;n=1;const u=r(),a=e(),m=t(),p=s(),_=o().usExtract;return i=class{constructor(r){this.sender=r}send(r){if(void 0===r)throw new u.UndefinedLookupError;let e=new a(r.text,{"Content-Type":"text/plain; charset=utf-8"});return e.parameters=p(r,_),new Promise(((t,s)=>{this.sender.send(e).then((e=>{e.error&&s(e.error),r.result=new m(e.payload),t(r)})).catch(s)}))}}}export{u as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s,e;function r(){if(e)return s;e=1;return s=class{constructor(s){this.result={meta:{},addresses:[]},this.text=s,this.html=void 0,this.aggressive=void 0,this.addressesHaveLineBreaks=void 0,this.addressesPerLine=void 0}}}export{r as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as e}from"./Address.mjs";var r,s;function t(){if(s)return r;s=1;const t=e();return r=class{constructor({meta:e,addresses:r}){this.meta={lines:e.lines,unicode:e.unicode,addressCount:e.address_count,verifiedCount:e.verified_count,bytes:e.bytes,characterCount:e.character_count},this.addresses=r.map((e=>new t(e)))}}}export{t as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as r}from"../Request.mjs";import{__require as e}from"./Response.mjs";import{__require as s}from"../util/buildInputData.mjs";import{__require as o}from"../util/apiToSDKKeyMap.mjs";import{__require as t}from"../Errors.mjs";var i,n;function u(){if(n)return i;n=1;const u=r(),a=e(),m=s(),p=o().usReverseGeo,{UndefinedLookupError:_}=t();return i=class{constructor(r){this.sender=r}send(r){if(void 0===r)throw new _;let e=new u;return e.parameters=m(r,p),new Promise(((s,o)=>{this.sender.send(e).then((e=>{e.error&&o(e.error),s(function(r,e){return e.response=new a(r.payload),e}(e,r))})).catch(o)}))}}}export{u as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as e}from"./Response.mjs";var t,r;function s(){if(r)return t;r=1;const s=e();return t=class{constructor(e,t,r=""){this.latitude=e.toFixed(8),this.longitude=t.toFixed(8),this.source=r,this.response=new s}}}export{s as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as r}from"./Result.mjs";var s,t;function e(){if(t)return s;t=1;const e=r();return s=class{constructor(r){this.results=[],r&&r.results.map((r=>{this.results.push(new e(r))}))}}}export{e as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t;function s(){if(t)return e;t=1;return e=class{constructor(e){if(this.distance=e.distance,this.address={},e.address&&(this.address.street=e.address.street,this.address.city=e.address.city,this.address.state_abbreviation=e.address.state_abbreviation,this.address.zipcode=e.address.zipcode,this.address.source=e.address.source),this.coordinate={},e.coordinate)if(this.coordinate.latitude=e.coordinate.latitude,this.coordinate.longitude=e.coordinate.longitude,this.coordinate.accuracy=e.coordinate.accuracy,1===e.coordinate.license)this.coordinate.license="SmartyStreets Proprietary";else this.coordinate.license="SmartyStreets"}}}export{s as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,a;function e(){if(a)return t;a=1;return t=class{constructor(t){if(this.inputIndex=t.input_index,this.candidateIndex=t.candidate_index,this.addressee=t.addressee,this.deliveryLine1=t.delivery_line_1,this.deliveryLine2=t.delivery_line_2,this.lastLine=t.last_line,this.deliveryPointBarcode=t.delivery_point_barcode,this.smartyKey=t.smarty_key,this.components={},void 0!==t.components&&(this.components.urbanization=t.components.urbanization,this.components.primaryNumber=t.components.primary_number,this.components.streetName=t.components.street_name,this.components.streetPredirection=t.components.street_predirection,this.components.streetPostdirection=t.components.street_postdirection,this.components.streetSuffix=t.components.street_suffix,this.components.secondaryNumber=t.components.secondary_number,this.components.secondaryDesignator=t.components.secondary_designator,this.components.extraSecondaryNumber=t.components.extra_secondary_number,this.components.extraSecondaryDesignator=t.components.extra_secondary_designator,this.components.pmbDesignator=t.components.pmb_designator,this.components.pmbNumber=t.components.pmb_number,this.components.cityName=t.components.city_name,this.components.defaultCityName=t.components.default_city_name,this.components.state=t.components.state_abbreviation,this.components.zipCode=t.components.zipcode,this.components.plus4Code=t.components.plus4_code,this.components.deliveryPoint=t.components.delivery_point,this.components.deliveryPointCheckDigit=t.components.delivery_point_check_digit),this.metadata={},void 0!==t.metadata){if(this.metadata.recordType=t.metadata.record_type,this.metadata.zipType=t.metadata.zip_type,this.metadata.countyFips=t.metadata.county_fips,this.metadata.countyName=t.metadata.county_name,this.metadata.carrierRoute=t.metadata.carrier_route,this.metadata.congressionalDistrict=t.metadata.congressional_district,this.metadata.buildingDefaultIndicator=t.metadata.building_default_indicator,this.metadata.rdi=t.metadata.rdi,this.metadata.elotSequence=t.metadata.elot_sequence,this.metadata.elotSort=t.metadata.elot_sort,this.metadata.latitude=t.metadata.latitude,this.metadata.longitude=t.metadata.longitude,1===t.metadata.coordinate_license)this.metadata.coordinateLicense="SmartyStreets Proprietary";else this.metadata.coordinateLicense="SmartyStreets";this.metadata.precision=t.metadata.precision,this.metadata.timeZone=t.metadata.time_zone,this.metadata.utcOffset=t.metadata.utc_offset,this.metadata.obeysDst=t.metadata.dst,this.metadata.isEwsMatch=t.metadata.ews_match}this.analysis={},void 0!==t.analysis&&(this.analysis.dpvMatchCode=t.analysis.dpv_match_code,this.analysis.dpvFootnotes=t.analysis.dpv_footnotes,this.analysis.cmra=t.analysis.dpv_cmra,this.analysis.vacant=t.analysis.dpv_vacant,this.analysis.noStat=t.analysis.dpv_no_stat,this.analysis.active=t.analysis.active,this.analysis.isEwsMatch=t.analysis.ews_match,this.analysis.footnotes=t.analysis.footnotes,this.analysis.lacsLinkCode=t.analysis.lacslink_code,this.analysis.lacsLinkIndicator=t.analysis.lacslink_indicator,this.analysis.isSuiteLinkMatch=t.analysis.suitelink_match,this.analysis.enhancedMatch=t.analysis.enhanced_match)}}}export{e as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as r}from"./Candidate.mjs";import{__require as e}from"./Lookup.mjs";import{__require as t}from"../Batch.mjs";import{__require as s}from"../Errors.mjs";import{__require as o}from"../util/sendBatch.mjs";import{__require as i}from"../util/apiToSDKKeyMap.mjs";var a,n;function m(){if(n)return a;n=1;const m=r(),u=e(),d=t(),_=s().UndefinedLookupError,c=o(),f=i().usStreet;return a=class{constructor(r){this.sender=r}send(r){const e=r instanceof u;if(!e&&!(r instanceof d))throw new _;let t;return e?(null==r.maxCandidates&&"enhanced"==r.match&&(r.maxCandidates=5),t=new d,t.add(r)):t=r,c(t,this.sender,m,f)}}}export{m as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,s;function i(){if(s)return t;s=1;return t=class{constructor(t,s,i,e,r,h,a,n,o,u,c,d,f){this.street=t,this.street2=s,this.secondary=i,this.city=e,this.state=r,this.zipCode=h,this.lastLine=a,this.addressee=n,this.urbanization=o,this.match=u,this.maxCandidates=c,this.inputId=d,this.format=f,this.result=[]}}}export{i as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as r}from"./Lookup.mjs";import{__require as e}from"./Result.mjs";import{__require as o}from"../Batch.mjs";import{__require as s}from"../Errors.mjs";import{__require as t}from"../util/sendBatch.mjs";import{__require as i}from"../util/apiToSDKKeyMap.mjs";var n,m;function u(){if(m)return n;m=1;const u=r(),a=e(),_=o(),f=s().UndefinedLookupError,p=t(),c=i().usZipcode;return n=class{constructor(r){this.sender=r}send(r){const e=r instanceof u;if(!e&&!(r instanceof _))throw new f;let o;return e?(o=new _,o.add(r)):o=r,p(o,this.sender,a,c)}}}export{u as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,i;function r(){if(i)return t;i=1;return t=class{constructor(t,i,r,s){this.city=t,this.state=i,this.zipCode=r,this.inputId=s,this.result=[]}}}export{r as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,e;function i(){if(e)return t;e=1;return t=class{constructor(t){this.inputIndex=t.input_index,this.status=t.status,this.reason=t.reason,this.valid=void 0===this.status&&void 0===this.reason,this.cities=t.city_states?t.city_states.map((t=>({city:t.city,stateAbbreviation:t.state_abbreviation,state:t.state,mailableCity:t.mailable_city}))):[],this.zipcodes=t.zipcodes?t.zipcodes.map((t=>({zipcode:t.zipcode,zipcodeType:t.zipcode_type,defaultCity:t.default_city,countyFips:t.county_fips,countyName:t.county_name,latitude:t.latitude,longitude:t.longitude,precision:t.precision,stateAbbreviation:t.state_abbreviation,state:t.state,alternateCounties:t.alternate_counties?t.alternate_counties.map((t=>({countyFips:t.county_fips,countyName:t.county_name,stateAbbreviation:t.state_abbreviation,state:t.state}))):[]}))):[]}}}export{i as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,r;function t(){if(r)return e;r=1;return e=class{constructor(){}sleep(e){return new Promise((r=>setTimeout(r,1e3*e)))}}}export{t as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t;function a(){return t?e:(t=1,e={usStreet:{street:"street",street2:"street2",secondary:"secondary",city:"city",state:"state",zipcode:"zipCode",lastline:"lastLine",addressee:"addressee",urbanization:"urbanization",match:"match",format:"format",candidates:"maxCandidates"},usAutocompletePro:{search:"search",selected:"selected",max_results:"maxResults",include_only_cities:"includeOnlyCities",include_only_states:"includeOnlyStates",include_only_zip_codes:"includeOnlyZIPCodes",exclude_states:"excludeStates",prefer_cities:"preferCities",prefer_states:"preferStates",prefer_zip_codes:"preferZIPCodes",prefer_ratio:"preferRatio",prefer_geolocation:"preferGeolocation",source:"source"},usZipcode:{city:"city",state:"state",zipcode:"zipCode"},internationalStreet:{country:"country",freeform:"freeform",address1:"address1",address2:"address2",address3:"address3",address4:"address4",organization:"organization",locality:"locality",administrative_area:"administrativeArea",postal_code:"postalCode",geocode:"geocode",language:"language"},internationalAddressAutocomplete:{search:"search",country:"country",max_results:"maxResults",include_only_administrative_area:"includeOnlyAdministrativeArea",include_only_locality:"includeOnlyLocality",include_only_postal_code:"includeOnlyPostalCode"},usReverseGeo:{latitude:"latitude",longitude:"longitude",source:"source"},usExtract:{html:"html",aggressive:"aggressive",addr_line_breaks:"addressesHaveLineBreaks",addr_per_line:"addressesPerLine"},usEnrichment:{include:"include",exclude:"exclude",dataset:"dataset",data_subset:"dataSubset"}})}export{a as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as t}from"../ClientBuilder.mjs";var e,n;function r(){if(n)return e;n=1;const r=t();function i(t){return new r(t)}return e={usStreet:function(t){return i(t).buildUsStreetApiClient()},usAutocompletePro:function(t){return i(t).buildUsAutocompleteProClient()},usExtract:function(t){return i(t).buildUsExtractClient()},usZipcode:function(t){return i(t).buildUsZipcodeClient()},internationalStreet:function(t){return i(t).buildInternationalStreetClient()},usReverseGeo:function(t){return i(t).buildUsReverseGeoClient()},internationalAddressAutocomplete:function(t){return i(t).buildInternationalAddressAutocompleteClient()},usEnrichment:function(t){return i(t).buildUsEnrichmentClient()}}}export{r as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as r}from"../InputData.mjs";var t,e;function n(){if(e)return t;e=1;const n=r();return t=(r,t)=>{let e=new n(r);for(let r in t)e.add(r,t[r]);return e.data}}export{n as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as r}from"../Response.mjs";var e,n;function t(){if(n)return e;n=1;const t=r();return e={buildSmartyResponse:function(r,e){return r?new t(r.status,r.data,r.error,r.headers):new t(void 0,void 0,e)}}}export{t as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as r}from"../Request.mjs";import{__require as e}from"../Errors.mjs";import{__require as t}from"./buildInputData.mjs";var n,o;function u(){if(o)return n;o=1;const u=r(),a=e(),s=t();return n=(r,e,t,n)=>{if(r.isEmpty())throw new a.BatchEmptyError;let o=new u;return 1===r.length()?o.parameters=i(r)[0]:o.payload=i(r),new Promise(((n,u)=>{e.send(o).then((e=>{e.error&&u(e.error),n(function(r,e){return e.payload.map((e=>{let n=new t(e);r.getByIndex(n.inputIndex).result.push(n)})),r}(r,e))})).catch(u)}));function i(r){return r.lookups.map((r=>s(r,n)))}}}export{u as __require};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smartystreets-javascript-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Quick and easy Smarty address validation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"smarty",
|
|
@@ -21,9 +21,22 @@
|
|
|
21
21
|
"http",
|
|
22
22
|
"sdk"
|
|
23
23
|
],
|
|
24
|
-
"
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
29
|
+
"main": "dist/cjs/index.cjs",
|
|
30
|
+
"module": "dist/esm/index.mjs",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"import": "./dist/esm/index.mjs",
|
|
34
|
+
"default": "./dist/cjs/index.cjs"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
25
37
|
"scripts": {
|
|
26
|
-
"
|
|
38
|
+
"build": "rollup --config",
|
|
39
|
+
"test": "mocha 'tests/**/*.{mjs,js}'"
|
|
27
40
|
},
|
|
28
41
|
"author": "Smarty SDK Team <support@smarty.com> (https://www.smarty.com)",
|
|
29
42
|
"license": "Apache-2.0",
|
|
@@ -32,11 +45,18 @@
|
|
|
32
45
|
"url": "github:smartystreets/smartystreets-javascript-sdk"
|
|
33
46
|
},
|
|
34
47
|
"devDependencies": {
|
|
48
|
+
"@babel/preset-env": "^7.25.8",
|
|
49
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
|
50
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
51
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
52
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
35
53
|
"chai": "^4.3.6",
|
|
36
|
-
"mocha": "^10.2.0"
|
|
54
|
+
"mocha": "^10.2.0",
|
|
55
|
+
"rollup": "^4.22.5",
|
|
56
|
+
"rollup-plugin-delete": "^2.1.0"
|
|
37
57
|
},
|
|
38
58
|
"dependencies": {
|
|
39
|
-
"axios": "^1.7.
|
|
40
|
-
"axios-retry": "4.
|
|
59
|
+
"axios": "^1.7.7",
|
|
60
|
+
"axios-retry": "^4.5.0"
|
|
41
61
|
}
|
|
42
62
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
name: Node Tests
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ master ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ master ]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
|
|
14
|
-
strategy:
|
|
15
|
-
matrix:
|
|
16
|
-
node-version: [14.x, 16.x, 18.x, 20.x]
|
|
17
|
-
|
|
18
|
-
steps:
|
|
19
|
-
- uses: actions/checkout@v2
|
|
20
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
21
|
-
uses: actions/setup-node@v1
|
|
22
|
-
with:
|
|
23
|
-
node-version: ${{ matrix.node-version }}
|
|
24
|
-
- run: npm ci
|
|
25
|
-
- run: npm test
|
|
26
|
-
env:
|
|
27
|
-
CI: true
|
package/CHANGELOG.md
DELETED
package/Makefile
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/make -f
|
|
2
|
-
|
|
3
|
-
VERSION := $(shell tagit -m --dry-run)
|
|
4
|
-
VERSION_FILE1 := package.json
|
|
5
|
-
VERSION_FILE2 := package-lock.json
|
|
6
|
-
|
|
7
|
-
test: node_modules
|
|
8
|
-
npm run test
|
|
9
|
-
|
|
10
|
-
node_modules:
|
|
11
|
-
npm install
|
|
12
|
-
|
|
13
|
-
publish: test version upload unversion
|
|
14
|
-
tagit -m
|
|
15
|
-
git push origin --tags
|
|
16
|
-
|
|
17
|
-
upload:
|
|
18
|
-
npm publish
|
|
19
|
-
|
|
20
|
-
version:
|
|
21
|
-
sed -i.bak -e 's/^ "version": "0\.0\.0",/ "version": "$(VERSION)",/g' "$(VERSION_FILE1)" && rm -f "$(VERSION_FILE1).bak"
|
|
22
|
-
sed -i.bak -e 's/^ "version": "0\.0\.0",/ "version": "$(VERSION)",/g' "$(VERSION_FILE2)" && rm -f "$(VERSION_FILE2).bak"
|
|
23
|
-
|
|
24
|
-
unversion:
|
|
25
|
-
git checkout "$(VERSION_FILE1)" "$(VERSION_FILE2)"
|
|
26
|
-
|
|
27
|
-
# node_modules is a real directory target
|
|
28
|
-
.PHONY: test publish upload version unversion
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
const SmartySDK = require("smartystreets-javascript-sdk");
|
|
2
|
-
const SmartyCore = SmartySDK.core;
|
|
3
|
-
const Lookup = SmartySDK.internationalAddressAutocomplete.Lookup;
|
|
4
|
-
|
|
5
|
-
// for Server-to-server requests, use this code:
|
|
6
|
-
// let authId = process.env.SMARTY_AUTH_ID;
|
|
7
|
-
// let authToken = process.env.SMARTY_AUTH_TOKEN;
|
|
8
|
-
// const credentials = new SmartyCore.StaticCredentials(authId, authToken);
|
|
9
|
-
|
|
10
|
-
// for client-side requests (browser/mobile), use this code:
|
|
11
|
-
const key = process.env.SMARTY_EMBEDDED_KEY;
|
|
12
|
-
const credentials = new SmartyCore.SharedCredentials(key);
|
|
13
|
-
|
|
14
|
-
// The appropriate license values to be used for your subscriptions
|
|
15
|
-
// can be found on the Subscription page of the account dashboard.
|
|
16
|
-
// https://www.smarty.com/docs/cloud/licensing
|
|
17
|
-
const clientBuilder = new SmartyCore.ClientBuilder(credentials).withLicenses(["international-autocomplete-v2-cloud"])
|
|
18
|
-
// .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
|
|
19
|
-
|
|
20
|
-
const client = clientBuilder.buildInternationalAddressAutocompleteClient();
|
|
21
|
-
|
|
22
|
-
// Documentation for input fields can be found at:
|
|
23
|
-
// www.smarty.com/docs/cloud/international-address-autocomplete-api#pro-http-request-input-fields
|
|
24
|
-
const country = "CAN";
|
|
25
|
-
|
|
26
|
-
const summaryLookup = new Lookup({search: "123 Anson", country});
|
|
27
|
-
await handleRequest(summaryLookup, "Response of summary results");
|
|
28
|
-
|
|
29
|
-
const detailedLookup = new Lookup({addressId: summaryLookup.result[0].addressId, country});
|
|
30
|
-
await handleRequest(detailedLookup, "Response using an address ID to get detailed results");
|
|
31
|
-
|
|
32
|
-
function logSuggestions(response, message) {
|
|
33
|
-
console.log("*** " + message + " ***");
|
|
34
|
-
|
|
35
|
-
response.result.forEach(suggestion => {
|
|
36
|
-
if (suggestion.addressText) {
|
|
37
|
-
console.log("Entries: ", suggestion.entries);
|
|
38
|
-
console.log("Address Text: ", suggestion.addressText);
|
|
39
|
-
console.log("Address ID: ", suggestion.addressId);
|
|
40
|
-
} else {
|
|
41
|
-
console.log("Street: ", suggestion.street);
|
|
42
|
-
console.log("Locality: ", suggestion.locality);
|
|
43
|
-
console.log("Administrative Area: ", suggestion.administrativeArea);
|
|
44
|
-
console.log("Postal Code: ", suggestion.postalCode);
|
|
45
|
-
console.log("Country: ", suggestion.countryIso3);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
console.log("\n");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async function handleRequest(lookup, lookupType) {
|
|
52
|
-
try {
|
|
53
|
-
const results = await client.send(lookup);
|
|
54
|
-
logSuggestions(results, lookupType);
|
|
55
|
-
} catch(err) {
|
|
56
|
-
console.log(err)
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const SmartySDK = require("smartystreets-javascript-sdk");
|
|
2
|
-
const SmartyCore = SmartySDK.core;
|
|
3
|
-
const Lookup = SmartySDK.internationalStreet.Lookup;
|
|
4
|
-
|
|
5
|
-
// for Server-to-server requests, use this code:
|
|
6
|
-
// let authId = process.env.SMARTY_AUTH_ID;
|
|
7
|
-
// let authToken = process.env.SMARTY_AUTH_TOKEN;
|
|
8
|
-
// const credentials = new SmartyCore.StaticCredentials(authId, authToken);
|
|
9
|
-
|
|
10
|
-
// for client-side requests (browser/mobile), use this code:
|
|
11
|
-
let key = process.env.SMARTY_EMBEDDED_KEY;
|
|
12
|
-
const credentials = new SmartyCore.SharedCredentials(key);
|
|
13
|
-
|
|
14
|
-
// The appropriate license values to be used for your subscriptions
|
|
15
|
-
// can be found on the Subscription page of the account dashboard.
|
|
16
|
-
// https://www.smarty.com/docs/cloud/licensing
|
|
17
|
-
let clientBuilder = new SmartyCore.ClientBuilder(credentials).withLicenses(["international-global-plus-cloud"]);
|
|
18
|
-
// .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
|
|
19
|
-
|
|
20
|
-
let client = clientBuilder.buildInternationalStreetClient();
|
|
21
|
-
|
|
22
|
-
// Documentation for input fields can be found at:
|
|
23
|
-
// https://www.smarty.com/docs/cloud/international-street-api#http-input-fields
|
|
24
|
-
|
|
25
|
-
let lookup1 = new Lookup("CA", "262 Browndale Cr, Richmond Hill, ON");
|
|
26
|
-
|
|
27
|
-
let lookup2 = new Lookup();
|
|
28
|
-
lookup2.inputId = "ID-8675309";
|
|
29
|
-
lookup2.geocode = false;
|
|
30
|
-
lookup2.organization = "John Doe";
|
|
31
|
-
lookup2.address1 = "Rua Padre Antonio D'Angelo 121";
|
|
32
|
-
lookup2.address2 = "Casa Verde";
|
|
33
|
-
lookup2.locality = "Sao Paulo";
|
|
34
|
-
lookup2.administrativeArea = "SP";
|
|
35
|
-
lookup2.country = "Brazil";
|
|
36
|
-
lookup2.postalCode = "02516-050";
|
|
37
|
-
|
|
38
|
-
await handleRequest(lookup1)
|
|
39
|
-
await handleRequest(lookup2)
|
|
40
|
-
|
|
41
|
-
function displayResult(result) {
|
|
42
|
-
console.log(result.result[0].components);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function handleError(error) {
|
|
46
|
-
console.log("ERROR:", error);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async function handleRequest(lookup) {
|
|
50
|
-
try {
|
|
51
|
-
const result = await client.send(lookup);
|
|
52
|
-
displayResult(result);
|
|
53
|
-
} catch(err) {
|
|
54
|
-
handleError(err);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const SmartySDK = require("smartystreets-javascript-sdk");
|
|
2
|
-
const SmartyCore = SmartySDK.core;
|
|
3
|
-
const Lookup = SmartySDK.usAutocompletePro.Lookup;
|
|
4
|
-
|
|
5
|
-
// for Server-to-server requests, use this code:
|
|
6
|
-
// let authId = process.env.SMARTY_AUTH_ID;
|
|
7
|
-
// let authToken = process.env.SMARTY_AUTH_TOKEN;
|
|
8
|
-
// const credentials = new SmartyCore.StaticCredentials(authId, authToken);
|
|
9
|
-
|
|
10
|
-
// for client-side requests (browser/mobile), use this code:
|
|
11
|
-
let key = process.env.SMARTY_EMBEDDED_KEY;
|
|
12
|
-
const credentials = new SmartyCore.SharedCredentials(key);
|
|
13
|
-
|
|
14
|
-
// The appropriate license values to be used for your subscriptions
|
|
15
|
-
// can be found on the Subscription page of the account dashboard.
|
|
16
|
-
// https://www.smarty.com/docs/cloud/licensing
|
|
17
|
-
let clientBuilder = new SmartyCore.ClientBuilder(credentials).withLicenses(["us-autocomplete-pro-cloud"]);
|
|
18
|
-
// .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
|
|
19
|
-
|
|
20
|
-
let client = clientBuilder.buildUsAutocompleteProClient();
|
|
21
|
-
|
|
22
|
-
// Documentation for input fields can be found at:
|
|
23
|
-
// https://www.smarty.com/docs/cloud/us-autocomplete-api#pro-http-request-input-fields
|
|
24
|
-
|
|
25
|
-
// *** Simple Lookup ***
|
|
26
|
-
let lookup = new Lookup("4770 Lincoln");
|
|
27
|
-
|
|
28
|
-
await handleRequest(lookup, "Simple Lookup");
|
|
29
|
-
|
|
30
|
-
// *** Using Filter and Prefer ***
|
|
31
|
-
lookup = new Lookup("4770 Lincoln");
|
|
32
|
-
|
|
33
|
-
lookup.maxResults = 10;
|
|
34
|
-
lookup.includeOnlyCities = ["Chicago,La Grange,IL", "Blaine,WA"];
|
|
35
|
-
lookup.preferStates = ["IL"];
|
|
36
|
-
lookup.preferRatio = 33;
|
|
37
|
-
lookup.source = "all";
|
|
38
|
-
|
|
39
|
-
await handleRequest(lookup, "Using Filter and Prefer");
|
|
40
|
-
|
|
41
|
-
// *** Using 'selected' to Expand Secondaries ***
|
|
42
|
-
lookup = new Lookup("4770 Lincoln");
|
|
43
|
-
|
|
44
|
-
lookup.selected = "4770 N Lincoln Ave Ste 2 (3) Chicago, IL 60625";
|
|
45
|
-
|
|
46
|
-
await handleRequest(lookup, "Using 'selected' to Expand Secondaries")
|
|
47
|
-
|
|
48
|
-
// ************************************************
|
|
49
|
-
|
|
50
|
-
function logSuggestions(response, message) {
|
|
51
|
-
console.log(message);
|
|
52
|
-
console.log(response.result);
|
|
53
|
-
console.log("*********************");
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
async function handleRequest(lookup, lookupType) {
|
|
57
|
-
try {
|
|
58
|
-
const results = await client.send(lookup);
|
|
59
|
-
logSuggestions(results, lookupType);
|
|
60
|
-
} catch(err) {
|
|
61
|
-
console.log(err)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const SmartySDK = require("smartystreets-javascript-sdk");
|
|
2
|
-
const SmartyCore = SmartySDK.core;
|
|
3
|
-
const Lookup = SmartySDK.usEnrichment.Lookup;
|
|
4
|
-
|
|
5
|
-
// for Server-to-server requests, use this code:
|
|
6
|
-
// let authId = process.env.SMARTY_AUTH_ID;
|
|
7
|
-
// let authToken = process.env.SMARTY_AUTH_TOKEN;
|
|
8
|
-
// const credentials = new SmartyCore.StaticCredentials(authId, authToken);
|
|
9
|
-
|
|
10
|
-
// for client-side requests (browser/mobile), use this code:
|
|
11
|
-
let key = process.env.SMARTY_EMBEDDED_KEY;
|
|
12
|
-
const credentials = new SmartyCore.SharedCredentials(key);
|
|
13
|
-
|
|
14
|
-
// The appropriate license values to be used for your subscriptions
|
|
15
|
-
// can be found on the Subscription page of the account dashboard.
|
|
16
|
-
// https://www.smarty.com/docs/cloud/licensing
|
|
17
|
-
let clientBuilder = new SmartyCore.ClientBuilder(credentials).withLicenses(["us-property-data-principal-cloud"]);
|
|
18
|
-
// .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
|
|
19
|
-
|
|
20
|
-
let client = clientBuilder.buildUsEnrichmentClient();
|
|
21
|
-
|
|
22
|
-
// Documentation for input fields can be found at:
|
|
23
|
-
// https://www.smarty.com/docs/us-street-api#input-fields
|
|
24
|
-
|
|
25
|
-
let lookup = new Lookup("334968275");
|
|
26
|
-
|
|
27
|
-
handleResponse(lookup).then();
|
|
28
|
-
|
|
29
|
-
async function handleResponse(lookup) {
|
|
30
|
-
try {
|
|
31
|
-
const result = await client.sendPrincipal(lookup);
|
|
32
|
-
console.log(result.response);
|
|
33
|
-
} catch (err) {
|
|
34
|
-
console.log(err);
|
|
35
|
-
}
|
|
36
|
-
}
|