@apiverve/vindecoder 1.2.2 → 1.2.4

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
@@ -59,7 +59,8 @@ Using the API is simple. All you have to do is make a request. The API will retu
59
59
  var query = {
60
60
  vin: "1HGCM82633A004352",
61
61
  recalls: true,
62
- safetyRating: true
62
+ safetyRating: true,
63
+ fuelEconomy: true
63
64
  };
64
65
 
65
66
  api.execute(query, function (error, data) {
@@ -81,7 +82,8 @@ You can also use promises to make requests. The API returns a promise that you c
81
82
  var query = {
82
83
  vin: "1HGCM82633A004352",
83
84
  recalls: true,
84
- safetyRating: true
85
+ safetyRating: true,
86
+ fuelEconomy: true
85
87
  };
86
88
 
87
89
  api.execute(query)
@@ -104,7 +106,8 @@ async function makeRequest() {
104
106
  var query = {
105
107
  vin: "1HGCM82633A004352",
106
108
  recalls: true,
107
- safetyRating: true
109
+ safetyRating: true,
110
+ fuelEconomy: true
108
111
  };
109
112
 
110
113
  try {
@@ -313,6 +316,54 @@ async function makeRequest() {
313
316
  "forwardCollisionWarning": "notAvailable",
314
317
  "laneDepartureWarning": "notAvailable"
315
318
  }
319
+ },
320
+ "fuelEconomy": {
321
+ "unit": "MPG",
322
+ "city": {
323
+ "min": 19,
324
+ "max": 19,
325
+ "value": 19
326
+ },
327
+ "highway": {
328
+ "min": 27,
329
+ "max": 27,
330
+ "value": 27
331
+ },
332
+ "combined": {
333
+ "min": 22,
334
+ "max": 22,
335
+ "value": 22
336
+ },
337
+ "exact": true,
338
+ "variantsMatched": 1,
339
+ "electricRangeMiles": null,
340
+ "co2GramsPerMile": {
341
+ "min": 404,
342
+ "max": 404,
343
+ "value": 404
344
+ },
345
+ "annualFuelCostUsd": {
346
+ "min": 3050,
347
+ "max": 3050,
348
+ "value": 3050
349
+ },
350
+ "variants": [
351
+ {
352
+ "epaId": 18657,
353
+ "model": "Accord",
354
+ "vehicleClass": "Midsize Cars",
355
+ "powertrain": "Gasoline",
356
+ "fuelType": "Regular",
357
+ "displacementL": 3,
358
+ "cylinders": 6,
359
+ "drive": "Front-Wheel Drive",
360
+ "transmission": "Automatic 5-spd",
361
+ "cityMpg": 19,
362
+ "highwayMpg": 27,
363
+ "combinedMpg": 22,
364
+ "electricRangeMiles": null
365
+ }
366
+ ]
316
367
  }
317
368
  }
318
369
  }
package/index.d.ts CHANGED
@@ -45,6 +45,7 @@ declare module '@apiverve/vindecoder' {
45
45
  validation: Validation;
46
46
  recalls: Recalls;
47
47
  safetyRating: SafetyRating;
48
+ fuelEconomy: FuelEconomy;
48
49
  }
49
50
 
50
51
  interface Engine {
@@ -84,6 +85,41 @@ declare module '@apiverve/vindecoder' {
84
85
  frontAirBagLocations: null | string;
85
86
  }
86
87
 
88
+ interface FuelEconomy {
89
+ unit: null | string;
90
+ city: AnnualFuelCostUsd;
91
+ highway: AnnualFuelCostUsd;
92
+ combined: AnnualFuelCostUsd;
93
+ exact: boolean | null;
94
+ variantsMatched: number | null;
95
+ electricRangeMiles: null;
96
+ co2GramsPerMile: AnnualFuelCostUsd;
97
+ annualFuelCostUsd: AnnualFuelCostUsd;
98
+ variants: Variant[];
99
+ }
100
+
101
+ interface AnnualFuelCostUsd {
102
+ min: number | null;
103
+ max: number | null;
104
+ value: number | null;
105
+ }
106
+
107
+ interface Variant {
108
+ epaID: number | null;
109
+ model: null | string;
110
+ vehicleClass: null | string;
111
+ powertrain: null | string;
112
+ fuelType: null | string;
113
+ displacementL: number | null;
114
+ cylinders: number | null;
115
+ drive: null | string;
116
+ transmission: null | string;
117
+ cityMpg: number | null;
118
+ highwayMpg: number | null;
119
+ combinedMpg: number | null;
120
+ electricRangeMiles: null;
121
+ }
122
+
87
123
  interface Plant {
88
124
  state: null | string;
89
125
  country: null | string;
package/index.js CHANGED
@@ -30,7 +30,7 @@ class vindecoderWrapper {
30
30
  this.baseURL = 'https://api.apiverve.com/v1/vindecoder';
31
31
 
32
32
  // Validation rules for parameters (generated from schema)
33
- this.validationRules = {"vin":{"type":"string","required":true,"minLength":1,"maxLength":17},"recalls":{"type":"boolean","required":false},"safetyRating":{"type":"boolean","required":false}};
33
+ this.validationRules = {"vin":{"type":"string","required":true,"minLength":1,"maxLength":17},"recalls":{"type":"boolean","required":false},"safetyRating":{"type":"boolean","required":false},"fuelEconomy":{"type":"boolean","required":false}};
34
34
  }
35
35
 
36
36
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apiverve/vindecoder",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "VIN Decoder turns a 17-character Vehicle Identification Number into the vehicle it identifies. Returns make, model, year, trim, body class and manufacturer, plus engine specifications, plant of manufacture, and the safety equipment fitted to that specific build. Optionally adds every safety recall issued for that vehicle and its NHTSA 5-star crash-test rating.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",