@apiverve/zipcodes 1.2.3 → 1.2.5

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Zip Codes Lookup API
2
2
 
3
- Zip Codes Lookup finds all postal codes within a US city or resolves a five-digit ZIP code to its city and state. Paid plans add geographic coordinates.
3
+ Zip Codes Lookup finds all postal codes within a US city or resolves a five-digit ZIP code to its city and state. Paid plans add the IANA time zone, geographic coordinates and the distance from the ZIP to a second ZIP.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@apiverve/zipcodes.svg)](https://www.npmjs.com/package/@apiverve/zipcodes)
6
6
 
@@ -57,7 +57,8 @@ Using the API is simple. All you have to do is make a request. The API will retu
57
57
 
58
58
  ```javascript
59
59
  var query = {
60
- zip: "64082"
60
+ zip: "64082",
61
+ distanceTo: "64106"
61
62
  };
62
63
 
63
64
  api.execute(query, function (error, data) {
@@ -77,7 +78,8 @@ You can also use promises to make requests. The API returns a promise that you c
77
78
 
78
79
  ```javascript
79
80
  var query = {
80
- zip: "64082"
81
+ zip: "64082",
82
+ distanceTo: "64106"
81
83
  };
82
84
 
83
85
  api.execute(query)
@@ -98,7 +100,8 @@ You can also use async/await to make requests. The API returns a promise that yo
98
100
  ```javascript
99
101
  async function makeRequest() {
100
102
  var query = {
101
- zip: "64082"
103
+ zip: "64082",
104
+ distanceTo: "64106"
102
105
  };
103
106
 
104
107
  try {
@@ -124,7 +127,15 @@ async function makeRequest() {
124
127
  "latitude": "38.850243",
125
128
  "longitude": "-94.39570",
126
129
  "city": "Lees Summit",
127
- "state": "Missouri"
130
+ "state": "Missouri",
131
+ "timezone": "America/Chicago",
132
+ "distance": {
133
+ "zipcode": "64106",
134
+ "city": "Kansas City",
135
+ "state_abbr": "MO",
136
+ "miles": 19.94,
137
+ "kilometers": 32.09
138
+ }
128
139
  }
129
140
  }
130
141
  ```
package/index.d.ts CHANGED
@@ -31,6 +31,16 @@ declare module '@apiverve/zipcodes' {
31
31
  longitude: null | string;
32
32
  city: null | string;
33
33
  state: null | string;
34
+ timezone: null | string;
35
+ distance: Distance;
36
+ }
37
+
38
+ interface Distance {
39
+ zipcode: null | string;
40
+ city: null | string;
41
+ stateAbbr: null | string;
42
+ miles: number | null;
43
+ kilometers: number | null;
34
44
  }
35
45
 
36
46
  export default class zipcodesWrapper {
package/index.js CHANGED
@@ -30,7 +30,7 @@ class zipcodesWrapper {
30
30
  this.baseURL = 'https://api.apiverve.com/v1/zipcodes';
31
31
 
32
32
  // Validation rules for parameters (generated from schema)
33
- this.validationRules = {"zip":{"type":"string","required":true,"minLength":5,"maxLength":5}};
33
+ this.validationRules = {"zip":{"type":"string","required":true,"minLength":5,"maxLength":5},"distanceTo":{"type":"string","required":false,"minLength":5,"maxLength":5}};
34
34
  }
35
35
 
36
36
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apiverve/zipcodes",
3
- "version": "1.2.3",
4
- "description": "Zip Codes Lookup finds all postal codes within a US city or resolves a five-digit ZIP code to its city and state. Paid plans add geographic coordinates.",
3
+ "version": "1.2.5",
4
+ "description": "Zip Codes Lookup finds all postal codes within a US city or resolves a five-digit ZIP code to its city and state. Paid plans add the IANA time zone, geographic coordinates and the distance from the ZIP to a second ZIP.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "sideEffects": false,