diff --git a/CHANGELOG.md b/CHANGELOG.md index 367bcbda2..8aabecb47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [1.1.12](https://github.com/ShaggyTech/nhtsa-api-wrapper/compare/v1.1.11...v1.1.12) (2021-06-07) + + +### Bug Fixes + +* upgrade cross-fetch from 3.0.6 to 3.1.0 ([3d9329b](https://github.com/ShaggyTech/nhtsa-api-wrapper/commit/3d9329b287de6350625f9a2d72901b4c50dc54c4)) +* upgrade cross-fetch from 3.0.6 to 3.1.2 ([f6596ba](https://github.com/ShaggyTech/nhtsa-api-wrapper/commit/f6596bafacc9e6f669aa81463cf3cda2299a7616)) +* upgrade cross-fetch from 3.0.6 to 3.1.2 ([021162a](https://github.com/ShaggyTech/nhtsa-api-wrapper/commit/021162acc3a63cd1bf79f4552846553ccaeafd15)) + ## [1.1.11](https://github.com/ShaggyTech/nhtsa-api-wrapper/compare/v1.1.10...v1.1.11) (2020-12-19) diff --git a/dist/browser/iife.js b/dist/browser/iife.js index cdfd68263..2a48a5342 100644 --- a/dist/browser/iife.js +++ b/dist/browser/iife.js @@ -1,2 +1,2 @@ -var NHTSA=function(e,r){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(r),n=Object.freeze({__proto__:null});function s(e,r,t,o){return new(t||(t=Promise))((function(n,s){function i(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){e.done?n(e.value):new t((function(r){r(e.value)})).then(i,a)}c((o=o.apply(e,r||[])).next())}))}function i(e){const r=Object.prototype.toString.call(e).toLowerCase();return r.slice(8,r.length-1)}const a={A:1,B:2,C:3,D:4,E:5,F:6,G:7,H:8,J:1,K:2,L:3,M:4,N:5,P:7,R:9,S:2,T:3,U:4,V:5,W:6,X:7,Y:8,Z:9},c=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];const u={apiResponseFormat:"json",baseUrl:"https://vpic.nhtsa.dot.gov/api/vehicles",options:{}};class d{constructor(e){let r;r=e&&"object"===i(e)?Object.assign(Object.assign(Object.assign({},u),e),{options:Object.assign(Object.assign({},u.options),e.options)}):Object.assign({},u),this.apiResponseFormat="json",this.baseUrl=r.baseUrl,this.options=r.options}buildQueryString(e,r=!1){return s(this,void 0,void 0,(function*(){return e=e&&"object"===i(e)?Object.assign(Object.assign({},e),{format:this.apiResponseFormat}):{format:this.apiResponseFormat},yield function(e={},r=!1){if("object"!==i(e))return Promise.reject(new Error("queryString(params) - expected params in the form of an object, got: "+e));const t=Object.entries(e),o=t.length;if(o<1)return Promise.resolve("");let n=!1;const s=t.map(([e,t],s)=>{let a="",c="";const u=i(t);if(t&&"number"===u&&(t=t.toString()),(t||r)&&("string"===u||"number"===u))return n||(a="?",n=!0),s{if(!(null==e?void 0:e.status)||e.status>=400)throw new Error(`Bad response from server, code: ${null==e?void 0:e.status}, text: ${null==e?void 0:e.statusText}, headers: ${null==e?void 0:e.headers}`);return e}).catch(e=>Promise.reject(new Error("Fetch.get() http error: "+e))),c=yield a.json().then(e=>e),u=Object.assign(Object.assign({},c),{FetchResponse:{headers:a.headers,ok:a.ok,redirected:a.redirected,status:a.status,statusText:a.statusText,url:a.url}});return Promise.resolve(u)}))}}class l extends d{constructor(e){super(e)}DecodeVin(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVin",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVin, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVin, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVin, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class m extends d{constructor(e){super(e)}DecodeVinExtended(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVinExtended",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVinExtended, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVinExtended, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVinExtended, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class g extends d{constructor(e){super(e)}DecodeVinValues(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVinValues",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVinValues, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVinValues, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"string"!==s&&"number"!==s)return Promise.reject(new Error(`DecodeVinValues, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class h extends d{constructor(e){super(e)}DecodeVINValuesBatch(e){return s(this,void 0,void 0,(function*(){const r="DecodeVINValuesBatch",t=i(e);if("string"!==t)return Promise.reject(new Error(`DecodeVINValuesBatch, "inputString" argument is required and must be of type string, got: <${t}> ${e}`));const o=`${this.baseUrl}/${r}/`,n=encodeURI(`DATA=${e}&format=json`);return yield this.get(o,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:n}).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class $ extends d{constructor(e){super(e)}DecodeVinValuesExtended(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVinValuesExtended",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVinValuesExtended, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVinValuesExtended, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVinValuesExtended, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class p extends d{constructor(e){super(e)}DecodeWMI(e){return s(this,void 0,void 0,(function*(){const r="DecodeWMI",t=i(e);if("string"!==t)return Promise.reject(new Error(`DecodeWMI, "WMI" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class y extends d{constructor(e){super(e)}GetAllMakes(){return s(this,void 0,void 0,(function*(){const e=yield this.buildQueryString().catch(e=>Promise.reject(new Error("GetAllMakes, Error building query string: "+e))),r=`${this.baseUrl}/GetAllMakes${e}`;return yield this.get(r).then(e=>e).catch(e=>Promise.reject(new Error("GetAllMakes, Fetch.get() error: "+e)))}))}}class b extends d{constructor(e){super(e)}GetAllManufacturers(e={}){return s(this,void 0,void 0,(function*(){const r="GetAllManufacturers",t=i(e);if("object"!==t)return Promise.reject(new Error(`GetAllManufacturers, "params" argument must be of type object, got: <${t}> ${e}`));const o=i(e.manufacturerType);if(e.manufacturerType&&"string"!==o)return Promise.reject(new Error(`GetAllManufacturers, "params.manufacturerType" argument must be of type string, got: <${o}> ${e.manufacturerType}`));const n=i(e.page);if(e.page&&"number"!==n)return Promise.reject(new Error(`GetAllManufacturers, "params.page" argument must be of type number, got: <${n}> ${e.page}`));const s=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),a=`${this.baseUrl}/${r}${s}`;return yield this.get(a).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class f extends d{constructor(e){super(e)}GetCanadianVehicleSpecifications(e){return s(this,void 0,void 0,(function*(){const r="GetCanadianVehicleSpecifications",t=i(e);if("object"!==t)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params" argument must be of type object, got: <${t}> ${e}`));const o=i(e.year);if("number"!==o)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.year" argument is required and must be of type number, got: <${o}> ${e.year}`));const n=i(e.make);if(e.make&&"string"!==n)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.make" argument must be of type string, got: <${n}> ${e.make}`));const s=i(e.model);if(e.model&&"string"!==s)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.model" argument must be of type string, got: <${s}> ${e.model}`));const a=i(e.units);if(e.units&&"string"!==a)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.units" argument must be of type string, got: <${a}> ${e.units}`));const c=e.make||"",u=e.model||"",d=e.units||"",l={year:e.year,make:c,model:u,units:d},m=yield this.buildQueryString(l,!0).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),g=`${this.baseUrl}/${r}${m}`;return yield this.get(g).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class E extends d{constructor(e){super(e)}GetEquipmentPlantCodes(e){return s(this,void 0,void 0,(function*(){const r="GetEquipmentPlantCodes",t=i(e);if("object"!==t)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params" argument must be of type object, got: <${t}> ${e}`));const o=i(e.year);if("number"!==o)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.year" argument is required and must be of type number, got: <${o}> ${e.year}`));const n=i(e.equipmentType);if("number"!==n)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.equipmentType" argument is required and must be of type number, got: <${n}> ${e.equipmentType}`));const s=i(e.reportType);if("string"!==s)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.reportType" argument is required and must be of type string, got: <${s}> ${e.reportType}`));const a=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),c=`${this.baseUrl}/${r}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class j extends d{constructor(e){super(e)}GetMakeForManufacturer(e){return s(this,void 0,void 0,(function*(){const r="GetMakeForManufacturer",t=i(e);if("string"!==t&&"number"!==t)return Promise.reject(new Error(`GetMakeForManufacturer, "manufacturer" argument is required and must be of type string or number, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class M extends d{constructor(e){super(e)}GetMakesForManufacturerAndYear(e,r){return s(this,void 0,void 0,(function*(){const t="GetMakesForManufacturerAndYear",o=i(e);if("string"!==o&&"number"!==o)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "manufacturer" argument is required and must be of type string or number, got: <${o}> ${e}`));const n=i(r);if("object"!==n)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params" argument is required and must be of type object, got: <${n}> ${r}`));const s=i(r.year);if("number"!==s)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params.year" argument is required and must be of type number, got: <${s}> ${r.year}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class G extends d{constructor(e){super(e)}GetMakesForVehicleType(e){return s(this,void 0,void 0,(function*(){const r="GetMakesForVehicleType",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetMakesForVehicleType, "typeName" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class P extends d{constructor(e){super(e)}GetManufacturerDetails(e){return s(this,void 0,void 0,(function*(){const r="GetManufacturerDetails",t=i(e);if("string"!==t&&"number"!==t)return Promise.reject(new Error(`GetManufacturerDetails, "manufacturer" argument is required and must be of type string or number, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class V extends d{constructor(e){super(e)}GetModelsForMake(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMake",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetModelsForMake, "makeName" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class w extends d{constructor(e){super(e)}GetModelsForMakeId(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMakeId",t=i(e);if("number"!==t)return Promise.reject(new Error(`GetModelsForMakeId, "makeId" argument is required and must be of type number, got: <${t}> ${e}`));const o=yield this.buildQueryString({}).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class F extends d{constructor(e){super(e)}GetModelsForMakeIdYear(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMakeIdYear",t=null==e?void 0:e.makeId,o=null==e?void 0:e.modelYear,n=null==e?void 0:e.vehicleType,s=i(e);if("object"!==s)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params" argument must be of type object, got: <${s}> ${e}`));const a=i(t);if("number"!==a)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.makeId" argument is required and must be of type number, got: <${a}> ${t}`));if(!o&&!n)return Promise.reject(new Error(`GetModelsForMakeIdYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${o} | ${n}`));const c=i(o);if(o&&"number"!==c)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.modelYear" must be of type number, got: <${c}> ${o}`));const u=i(n);if(n&&"string"!==u)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.vehicleType" must be of type string, got: <${u}> ${n}`));let d=`${r}/makeId/${t}/`;d+=o&&n?`modelYear/${o}/vehicleType/${n}`:o?"modelYear/"+o:"vehicleType/"+n;const l=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),m=`${this.baseUrl}/${d}${l}`;return yield this.get(m).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class v extends d{constructor(e){super(e)}GetModelsForMakeYear(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMakeYear",t=null==e?void 0:e.make,o=null==e?void 0:e.modelYear,n=null==e?void 0:e.vehicleType,s=i(e);if("object"!==s)return Promise.reject(new Error(`GetModelsForMakeYear, "params" argument must be of type object, got: <${s}> ${e}`));const a=i(t);if("string"!==a)return Promise.reject(new Error(`GetModelsForMakeYear, "params.make" argument is required and must be of type string, got: <${a}> ${t}`));if(!o&&!n)return Promise.reject(new Error(`GetModelsForMakeYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${o} | ${n}`));const c=i(o);if(o&&"number"!==c)return Promise.reject(new Error(`GetModelsForMakeYear, "params.modelYear" must be of type number, got: <${c}> ${o}`));const u=i(n);if(n&&"string"!==u)return Promise.reject(new Error(`GetModelsForMakeYear, "params.vehicleType" must be of type string, got: <${u}> ${n}`));let d=`${r}/make/${e.make}/`;d+=o&&n?`modelYear/${o}/vehicleType/${n}`:o?"modelYear/"+o:"vehicleType/"+n;const l=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),m=`${this.baseUrl}/${d}${l}`;return yield this.get(m).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class k extends d{constructor(e){super(e)}GetParts(e){return s(this,void 0,void 0,(function*(){const r="GetParts",t=null==e?void 0:e.type,o=null==e?void 0:e.fromDate,n=null==e?void 0:e.toDate,s=null==e?void 0:e.page,a=i(e);if(e&&"object"!==a)return Promise.reject(new Error(`${r}, "params" argument must be of type object, got: <${a}> ${e}`));const c=i(t);if(t&&"number"!==c)return Promise.reject(new Error(`${r}, "params.type" argument must be of type number, got: <${c}> ${t}`));const u=i(o);if(o&&"string"!==u)return Promise.reject(new Error(`${r}, "params.fromDate" argument must be of type string, got: <${u}> ${o}`));const d=i(n);if(n&&"string"!==d)return Promise.reject(new Error(`${r}, "params.toDate" argument must be of type string, got: <${d}> ${n}`));const l=i(s);if(s&&"number"!==l)return Promise.reject(new Error(`${r}, "params.page" argument must be of type number, got: <${l}> ${s}`));const m=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),g=`${this.baseUrl}/${r}${m}`;return yield this.get(g).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class q extends d{constructor(e){super(e)}GetVehicleTypesForMake(e){return s(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMake",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetVehicleTypesForMake, "makeName" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class D extends d{constructor(e){super(e)}GetVehicleTypesForMakeId(e){return s(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMakeId",t=i(e);if("number"!==t)return Promise.reject(new Error(`GetVehicleTypesForMakeId, "makeId" argument is required and must be of type number, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class Y extends d{constructor(e){super(e)}GetVehicleVariableList(){return s(this,void 0,void 0,(function*(){const e="GetVehicleVariableList",r=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),t=`${this.baseUrl}/${e}${r}`;return yield this.get(t).then(e=>e).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}class I extends d{constructor(e){super(e)}GetVehicleVariableValuesList(e){return s(this,void 0,void 0,(function*(){const r="GetVehicleVariableValuesList",t=i(e);if("string"!==t&&"number"!==t)return Promise.reject(new Error(`GetVehicleVariableValuesList, "variableValue" argument is required and must be of type string or number, got: <${t}> ${e}`));"string"===t&&(e=encodeURI(e));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class x extends d{constructor(e){super(e)}GetWMIsForManufacturer(e){return s(this,void 0,void 0,(function*(){const r="GetWMIsForManufacturer",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetWMIsForManufacturer, "manufacturer" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class T extends d{constructor(e){super(e),this.DecodeVin=l.prototype.DecodeVin,this.DecodeVinExtended=m.prototype.DecodeVinExtended,this.DecodeVinValues=g.prototype.DecodeVinValues,this.DecodeVINValuesBatch=h.prototype.DecodeVINValuesBatch,this.DecodeVinValuesExtended=$.prototype.DecodeVinValuesExtended,this.DecodeWMI=p.prototype.DecodeWMI,this.GetAllMakes=y.prototype.GetAllMakes,this.GetAllManufacturers=b.prototype.GetAllManufacturers,this.GetCanadianVehicleSpecifications=f.prototype.GetCanadianVehicleSpecifications,this.GetEquipmentPlantCodes=E.prototype.GetEquipmentPlantCodes,this.GetMakeForManufacturer=j.prototype.GetMakeForManufacturer,this.GetMakesForManufacturerAndYear=M.prototype.GetMakesForManufacturerAndYear,this.GetMakesForVehicleType=G.prototype.GetMakesForVehicleType,this.GetManufacturerDetails=P.prototype.GetManufacturerDetails,this.GetModelsForMake=V.prototype.GetModelsForMake,this.GetModelsForMakeId=w.prototype.GetModelsForMakeId,this.GetModelsForMakeIdYear=F.prototype.GetModelsForMakeIdYear,this.GetModelsForMakeYear=v.prototype.GetModelsForMakeYear,this.GetParts=k.prototype.GetParts,this.GetVehicleTypesForMake=q.prototype.GetVehicleTypesForMake,this.GetVehicleTypesForMakeId=D.prototype.GetVehicleTypesForMakeId,this.GetVehicleVariableList=Y.prototype.GetVehicleVariableList,this.GetVehicleVariableValuesList=I.prototype.GetVehicleVariableValuesList,this.GetWMIsForManufacturer=x.prototype.GetWMIsForManufacturer}}const S=new T;return e.ActionTypes=n,e.Client=S,e.DecodeVINValuesBatch=h,e.DecodeVin=l,e.DecodeVinExtended=m,e.DecodeVinValues=g,e.DecodeVinValuesExtended=$,e.DecodeWMI=p,e.Fetch=d,e.GetAllMakes=y,e.GetAllManufacturers=b,e.GetCanadianVehicleSpecifications=f,e.GetEquipmentPlantCodes=E,e.GetMakeForManufacturer=j,e.GetMakesForManufacturerAndYear=M,e.GetMakesForVehicleType=G,e.GetManufacturerDetails=P,e.GetModelsForMake=V,e.GetModelsForMakeId=w,e.GetModelsForMakeIdYear=F,e.GetModelsForMakeYear=v,e.GetParts=k,e.GetVehicleTypesForMake=q,e.GetVehicleTypesForMakeId=D,e.GetVehicleVariableList=Y,e.GetVehicleVariableValuesList=I,e.GetWMIsForManufacturer=x,e.NHTSA=T,e.isValidVin=function(e){if("string"!=typeof e||17!=e.length)return!1;const r=(e=e.toUpperCase()).split(""),t=r[8];if(isNaN(parseInt(t))&&"X"!==t)return!1;const o="X"===t?10:parseInt(t);return r.map((e,r)=>{let t;t=isNaN(parseInt(e))?a[e]:parseInt(e);return t*c[r]}).reduce((e,r)=>e+r,0)%11===o},e}({},fetch); +var NHTSA=function(e,r){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(r),n=Object.freeze({__proto__:null});function s(e,r,t,o){return new(t||(t=Promise))((function(n,s){function i(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var r;e.done?n(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(i,a)}c((o=o.apply(e,r||[])).next())}))}function i(e){const r=Object.prototype.toString.call(e).toLowerCase();return r.slice(8,r.length-1)}const a={A:1,B:2,C:3,D:4,E:5,F:6,G:7,H:8,J:1,K:2,L:3,M:4,N:5,P:7,R:9,S:2,T:3,U:4,V:5,W:6,X:7,Y:8,Z:9},c=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];const u={apiResponseFormat:"json",baseUrl:"https://vpic.nhtsa.dot.gov/api/vehicles",options:{}};class d{constructor(e){let r;r=e&&"object"===i(e)?Object.assign(Object.assign(Object.assign({},u),e),{options:Object.assign(Object.assign({},u.options),e.options)}):Object.assign({},u),this.apiResponseFormat="json",this.baseUrl=r.baseUrl,this.options=r.options}buildQueryString(e,r=!1){return s(this,void 0,void 0,(function*(){return e=e&&"object"===i(e)?Object.assign(Object.assign({},e),{format:this.apiResponseFormat}):{format:this.apiResponseFormat},yield function(e={},r=!1){if("object"!==i(e))return Promise.reject(new Error("queryString(params) - expected params in the form of an object, got: "+e));const t=Object.entries(e),o=t.length;if(o<1)return Promise.resolve("");let n=!1;const s=t.map(([e,t],s)=>{let a="",c="";const u=i(t);if(t&&"number"===u&&(t=t.toString()),(t||r)&&("string"===u||"number"===u))return n||(a="?",n=!0),s{if(!(null==e?void 0:e.status)||e.status>=400)throw new Error(`Bad response from server, code: ${null==e?void 0:e.status}, text: ${null==e?void 0:e.statusText}, headers: ${null==e?void 0:e.headers}`);return e}).catch(e=>Promise.reject(new Error("Fetch.get() http error: "+e))),c=yield a.json().then(e=>e),u=Object.assign(Object.assign({},c),{FetchResponse:{headers:a.headers,ok:a.ok,redirected:a.redirected,status:a.status,statusText:a.statusText,url:a.url}});return Promise.resolve(u)}))}}class l extends d{constructor(e){super(e)}DecodeVin(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVin",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVin, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVin, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVin, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class m extends d{constructor(e){super(e)}DecodeVinExtended(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVinExtended",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVinExtended, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVinExtended, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVinExtended, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class g extends d{constructor(e){super(e)}DecodeVinValues(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVinValues",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVinValues, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVinValues, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"string"!==s&&"number"!==s)return Promise.reject(new Error(`DecodeVinValues, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class h extends d{constructor(e){super(e)}DecodeVINValuesBatch(e){return s(this,void 0,void 0,(function*(){const r="DecodeVINValuesBatch",t=i(e);if("string"!==t)return Promise.reject(new Error(`DecodeVINValuesBatch, "inputString" argument is required and must be of type string, got: <${t}> ${e}`));const o=`${this.baseUrl}/${r}/`,n=encodeURI(`DATA=${e}&format=json`);return yield this.get(o,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:n}).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class $ extends d{constructor(e){super(e)}DecodeVinValuesExtended(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVinValuesExtended",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVinValuesExtended, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVinValuesExtended, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVinValuesExtended, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class p extends d{constructor(e){super(e)}DecodeWMI(e){return s(this,void 0,void 0,(function*(){const r="DecodeWMI",t=i(e);if("string"!==t)return Promise.reject(new Error(`DecodeWMI, "WMI" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class y extends d{constructor(e){super(e)}GetAllMakes(){return s(this,void 0,void 0,(function*(){const e=yield this.buildQueryString().catch(e=>Promise.reject(new Error("GetAllMakes, Error building query string: "+e))),r=`${this.baseUrl}/GetAllMakes${e}`;return yield this.get(r).then(e=>e).catch(e=>Promise.reject(new Error("GetAllMakes, Fetch.get() error: "+e)))}))}}class b extends d{constructor(e){super(e)}GetAllManufacturers(e={}){return s(this,void 0,void 0,(function*(){const r="GetAllManufacturers",t=i(e);if("object"!==t)return Promise.reject(new Error(`GetAllManufacturers, "params" argument must be of type object, got: <${t}> ${e}`));const o=i(e.manufacturerType);if(e.manufacturerType&&"string"!==o)return Promise.reject(new Error(`GetAllManufacturers, "params.manufacturerType" argument must be of type string, got: <${o}> ${e.manufacturerType}`));const n=i(e.page);if(e.page&&"number"!==n)return Promise.reject(new Error(`GetAllManufacturers, "params.page" argument must be of type number, got: <${n}> ${e.page}`));const s=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),a=`${this.baseUrl}/${r}${s}`;return yield this.get(a).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class f extends d{constructor(e){super(e)}GetCanadianVehicleSpecifications(e){return s(this,void 0,void 0,(function*(){const r="GetCanadianVehicleSpecifications",t=i(e);if("object"!==t)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params" argument must be of type object, got: <${t}> ${e}`));const o=i(e.year);if("number"!==o)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.year" argument is required and must be of type number, got: <${o}> ${e.year}`));const n=i(e.make);if(e.make&&"string"!==n)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.make" argument must be of type string, got: <${n}> ${e.make}`));const s=i(e.model);if(e.model&&"string"!==s)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.model" argument must be of type string, got: <${s}> ${e.model}`));const a=i(e.units);if(e.units&&"string"!==a)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.units" argument must be of type string, got: <${a}> ${e.units}`));const c=e.make||"",u=e.model||"",d=e.units||"",l={year:e.year,make:c,model:u,units:d},m=yield this.buildQueryString(l,!0).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),g=`${this.baseUrl}/${r}${m}`;return yield this.get(g).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class E extends d{constructor(e){super(e)}GetEquipmentPlantCodes(e){return s(this,void 0,void 0,(function*(){const r="GetEquipmentPlantCodes",t=i(e);if("object"!==t)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params" argument must be of type object, got: <${t}> ${e}`));const o=i(e.year);if("number"!==o)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.year" argument is required and must be of type number, got: <${o}> ${e.year}`));const n=i(e.equipmentType);if("number"!==n)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.equipmentType" argument is required and must be of type number, got: <${n}> ${e.equipmentType}`));const s=i(e.reportType);if("string"!==s)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.reportType" argument is required and must be of type string, got: <${s}> ${e.reportType}`));const a=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),c=`${this.baseUrl}/${r}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class j extends d{constructor(e){super(e)}GetMakeForManufacturer(e){return s(this,void 0,void 0,(function*(){const r="GetMakeForManufacturer",t=i(e);if("string"!==t&&"number"!==t)return Promise.reject(new Error(`GetMakeForManufacturer, "manufacturer" argument is required and must be of type string or number, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class M extends d{constructor(e){super(e)}GetMakesForManufacturerAndYear(e,r){return s(this,void 0,void 0,(function*(){const t="GetMakesForManufacturerAndYear",o=i(e);if("string"!==o&&"number"!==o)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "manufacturer" argument is required and must be of type string or number, got: <${o}> ${e}`));const n=i(r);if("object"!==n)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params" argument is required and must be of type object, got: <${n}> ${r}`));const s=i(r.year);if("number"!==s)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params.year" argument is required and must be of type number, got: <${s}> ${r.year}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class G extends d{constructor(e){super(e)}GetMakesForVehicleType(e){return s(this,void 0,void 0,(function*(){const r="GetMakesForVehicleType",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetMakesForVehicleType, "typeName" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class P extends d{constructor(e){super(e)}GetManufacturerDetails(e){return s(this,void 0,void 0,(function*(){const r="GetManufacturerDetails",t=i(e);if("string"!==t&&"number"!==t)return Promise.reject(new Error(`GetManufacturerDetails, "manufacturer" argument is required and must be of type string or number, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class V extends d{constructor(e){super(e)}GetModelsForMake(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMake",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetModelsForMake, "makeName" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class w extends d{constructor(e){super(e)}GetModelsForMakeId(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMakeId",t=i(e);if("number"!==t)return Promise.reject(new Error(`GetModelsForMakeId, "makeId" argument is required and must be of type number, got: <${t}> ${e}`));const o=yield this.buildQueryString({}).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class F extends d{constructor(e){super(e)}GetModelsForMakeIdYear(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMakeIdYear",t=null==e?void 0:e.makeId,o=null==e?void 0:e.modelYear,n=null==e?void 0:e.vehicleType,s=i(e);if("object"!==s)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params" argument must be of type object, got: <${s}> ${e}`));const a=i(t);if("number"!==a)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.makeId" argument is required and must be of type number, got: <${a}> ${t}`));if(!o&&!n)return Promise.reject(new Error(`GetModelsForMakeIdYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${o} | ${n}`));const c=i(o);if(o&&"number"!==c)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.modelYear" must be of type number, got: <${c}> ${o}`));const u=i(n);if(n&&"string"!==u)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.vehicleType" must be of type string, got: <${u}> ${n}`));let d=`${r}/makeId/${t}/`;d+=o&&n?`modelYear/${o}/vehicleType/${n}`:o?"modelYear/"+o:"vehicleType/"+n;const l=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),m=`${this.baseUrl}/${d}${l}`;return yield this.get(m).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class v extends d{constructor(e){super(e)}GetModelsForMakeYear(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMakeYear",t=null==e?void 0:e.make,o=null==e?void 0:e.modelYear,n=null==e?void 0:e.vehicleType,s=i(e);if("object"!==s)return Promise.reject(new Error(`GetModelsForMakeYear, "params" argument must be of type object, got: <${s}> ${e}`));const a=i(t);if("string"!==a)return Promise.reject(new Error(`GetModelsForMakeYear, "params.make" argument is required and must be of type string, got: <${a}> ${t}`));if(!o&&!n)return Promise.reject(new Error(`GetModelsForMakeYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${o} | ${n}`));const c=i(o);if(o&&"number"!==c)return Promise.reject(new Error(`GetModelsForMakeYear, "params.modelYear" must be of type number, got: <${c}> ${o}`));const u=i(n);if(n&&"string"!==u)return Promise.reject(new Error(`GetModelsForMakeYear, "params.vehicleType" must be of type string, got: <${u}> ${n}`));let d=`${r}/make/${e.make}/`;d+=o&&n?`modelYear/${o}/vehicleType/${n}`:o?"modelYear/"+o:"vehicleType/"+n;const l=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),m=`${this.baseUrl}/${d}${l}`;return yield this.get(m).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class k extends d{constructor(e){super(e)}GetParts(e){return s(this,void 0,void 0,(function*(){const r="GetParts",t=null==e?void 0:e.type,o=null==e?void 0:e.fromDate,n=null==e?void 0:e.toDate,s=null==e?void 0:e.page,a=i(e);if(e&&"object"!==a)return Promise.reject(new Error(`${r}, "params" argument must be of type object, got: <${a}> ${e}`));const c=i(t);if(t&&"number"!==c)return Promise.reject(new Error(`${r}, "params.type" argument must be of type number, got: <${c}> ${t}`));const u=i(o);if(o&&"string"!==u)return Promise.reject(new Error(`${r}, "params.fromDate" argument must be of type string, got: <${u}> ${o}`));const d=i(n);if(n&&"string"!==d)return Promise.reject(new Error(`${r}, "params.toDate" argument must be of type string, got: <${d}> ${n}`));const l=i(s);if(s&&"number"!==l)return Promise.reject(new Error(`${r}, "params.page" argument must be of type number, got: <${l}> ${s}`));const m=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),g=`${this.baseUrl}/${r}${m}`;return yield this.get(g).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class q extends d{constructor(e){super(e)}GetVehicleTypesForMake(e){return s(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMake",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetVehicleTypesForMake, "makeName" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class D extends d{constructor(e){super(e)}GetVehicleTypesForMakeId(e){return s(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMakeId",t=i(e);if("number"!==t)return Promise.reject(new Error(`GetVehicleTypesForMakeId, "makeId" argument is required and must be of type number, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class Y extends d{constructor(e){super(e)}GetVehicleVariableList(){return s(this,void 0,void 0,(function*(){const e="GetVehicleVariableList",r=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),t=`${this.baseUrl}/${e}${r}`;return yield this.get(t).then(e=>e).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}class I extends d{constructor(e){super(e)}GetVehicleVariableValuesList(e){return s(this,void 0,void 0,(function*(){const r="GetVehicleVariableValuesList",t=i(e);if("string"!==t&&"number"!==t)return Promise.reject(new Error(`GetVehicleVariableValuesList, "variableValue" argument is required and must be of type string or number, got: <${t}> ${e}`));"string"===t&&(e=encodeURI(e));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class x extends d{constructor(e){super(e)}GetWMIsForManufacturer(e){return s(this,void 0,void 0,(function*(){const r="GetWMIsForManufacturer",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetWMIsForManufacturer, "manufacturer" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class T extends d{constructor(e){super(e),this.DecodeVin=l.prototype.DecodeVin,this.DecodeVinExtended=m.prototype.DecodeVinExtended,this.DecodeVinValues=g.prototype.DecodeVinValues,this.DecodeVINValuesBatch=h.prototype.DecodeVINValuesBatch,this.DecodeVinValuesExtended=$.prototype.DecodeVinValuesExtended,this.DecodeWMI=p.prototype.DecodeWMI,this.GetAllMakes=y.prototype.GetAllMakes,this.GetAllManufacturers=b.prototype.GetAllManufacturers,this.GetCanadianVehicleSpecifications=f.prototype.GetCanadianVehicleSpecifications,this.GetEquipmentPlantCodes=E.prototype.GetEquipmentPlantCodes,this.GetMakeForManufacturer=j.prototype.GetMakeForManufacturer,this.GetMakesForManufacturerAndYear=M.prototype.GetMakesForManufacturerAndYear,this.GetMakesForVehicleType=G.prototype.GetMakesForVehicleType,this.GetManufacturerDetails=P.prototype.GetManufacturerDetails,this.GetModelsForMake=V.prototype.GetModelsForMake,this.GetModelsForMakeId=w.prototype.GetModelsForMakeId,this.GetModelsForMakeIdYear=F.prototype.GetModelsForMakeIdYear,this.GetModelsForMakeYear=v.prototype.GetModelsForMakeYear,this.GetParts=k.prototype.GetParts,this.GetVehicleTypesForMake=q.prototype.GetVehicleTypesForMake,this.GetVehicleTypesForMakeId=D.prototype.GetVehicleTypesForMakeId,this.GetVehicleVariableList=Y.prototype.GetVehicleVariableList,this.GetVehicleVariableValuesList=I.prototype.GetVehicleVariableValuesList,this.GetWMIsForManufacturer=x.prototype.GetWMIsForManufacturer}}const S=new T;return e.ActionTypes=n,e.Client=S,e.DecodeVINValuesBatch=h,e.DecodeVin=l,e.DecodeVinExtended=m,e.DecodeVinValues=g,e.DecodeVinValuesExtended=$,e.DecodeWMI=p,e.Fetch=d,e.GetAllMakes=y,e.GetAllManufacturers=b,e.GetCanadianVehicleSpecifications=f,e.GetEquipmentPlantCodes=E,e.GetMakeForManufacturer=j,e.GetMakesForManufacturerAndYear=M,e.GetMakesForVehicleType=G,e.GetManufacturerDetails=P,e.GetModelsForMake=V,e.GetModelsForMakeId=w,e.GetModelsForMakeIdYear=F,e.GetModelsForMakeYear=v,e.GetParts=k,e.GetVehicleTypesForMake=q,e.GetVehicleTypesForMakeId=D,e.GetVehicleVariableList=Y,e.GetVehicleVariableValuesList=I,e.GetWMIsForManufacturer=x,e.NHTSA=T,e.isValidVin=function(e){if("string"!=typeof e||17!=e.length)return!1;const r=(e=e.toUpperCase()).split(""),t=r[8];if(isNaN(parseInt(t))&&"X"!==t)return!1;const o="X"===t?10:parseInt(t);return r.map((e,r)=>{let t;t=isNaN(parseInt(e))?a[e]:parseInt(e);return t*c[r]}).reduce((e,r)=>e+r,0)%11===o},e}({},fetch); //# sourceMappingURL=iife.js.map diff --git a/dist/browser/iife.js.gz b/dist/browser/iife.js.gz index 2f2f48d74..43ad1285f 100644 Binary files a/dist/browser/iife.js.gz and b/dist/browser/iife.js.gz differ diff --git a/dist/browser/iife.js.map b/dist/browser/iife.js.map index 55bdcdf2e..037a2515f 100644 --- a/dist/browser/iife.js.map +++ b/dist/browser/iife.js.map @@ -1 +1 @@ -{"version":3,"file":"iife.js","sources":["../../src/utils/getTypeof.ts","../../src/utils/isValidVin.ts","../../src/api/Fetch.ts","../../src/utils/makeQueryString.ts","../../src/api/actions/DecodeVin.ts","../../src/api/actions/DecodeVinExtended.ts","../../src/api/actions/DecodeVinValues.ts","../../src/api/actions/DecodeVINValuesBatch.ts","../../src/api/actions/DecodeVinValuesExtended.ts","../../src/api/actions/DecodeWMI.ts","../../src/api/actions/GetAllMakes.ts","../../src/api/actions/GetAllManufacturers.ts","../../src/api/actions/GetCanadianVehicleSpecifications.ts","../../src/api/actions/GetEquipmentPlantCodes.ts","../../src/api/actions/GetMakeForManufacturer.ts","../../src/api/actions/GetMakesForManufacturerAndYear.ts","../../src/api/actions/GetMakesForVehicleType.ts","../../src/api/actions/GetManufacturerDetails.ts","../../src/api/actions/GetModelsForMake.ts","../../src/api/actions/GetModelsForMakeId.ts","../../src/api/actions/GetModelsForMakeIdYear.ts","../../src/api/actions/GetModelsForMakeYear.ts","../../src/api/actions/GetParts.ts","../../src/api/actions/GetVehicleTypesForMake.ts","../../src/api/actions/GetVehicleTypesForMakeId.ts","../../src/api/actions/GetVehicleVariableList.ts","../../src/api/actions/GetVehicleVariableValuesList.ts","../../src/api/actions/GetWMIsForManufacturer.ts","../../src/api/NHTSA.ts","../../src/api/Client.ts"],"sourcesContent":["/**\r\n * @module utils/getTypeof\r\n * @category Utils\r\n */\r\n\r\n/**\r\n * Gets type of `value` using `Object.prototype.toString.call(value)`.\r\n *\r\n * @param {any} value - Any kind of value (string, object, array, function, etc).\r\n *\r\n * @returns {string} - Type of value, normalized to a lowercase string.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\r\nexport function getTypeof(value: any): string {\r\n const toString: string = Object.prototype.toString\r\n .call(value)\r\n .toLowerCase(); /* ex: => '[object string]' or '[object array], etc. */\r\n return toString.slice(8, toString.length - 1);\r\n}\r\n","/**\r\n * @module utils/isValidVin\r\n * @category Utils\r\n */\r\n\r\n/*\r\n * There will need to be some way to translate vin digits that are alphabetic\r\n * into their number value in the VIN algorithm transliteration table.\r\n * Later, during the creation of the checksum variable, those digits will be\r\n * multiplied against their corresponding weight (by index) in the WEIGHTS_ARRAY.\r\n * This transliteration table is a key part of the VIN validation algorithm.\r\n */\r\nconst TRANSLITERATION_TABLE: Record = {\r\n A: 1,\r\n B: 2,\r\n C: 3,\r\n D: 4,\r\n E: 5,\r\n F: 6,\r\n G: 7,\r\n H: 8,\r\n J: 1,\r\n K: 2,\r\n L: 3,\r\n M: 4,\r\n N: 5,\r\n P: 7,\r\n R: 9,\r\n S: 2,\r\n T: 3,\r\n U: 4,\r\n V: 5,\r\n W: 6,\r\n X: 7,\r\n Y: 8,\r\n Z: 9,\r\n};\r\n\r\n/*\r\n * Later, during the creation of the 'checksum' variable, these weights will be\r\n * multiplied by the value of their mirrored index vin digits.\r\n * The array index of each weight corresponds to the same index of each\r\n * digit in the 'vin'.\r\n */\r\nconst WEIGHTS_ARRAY: number[] = [\r\n 8,\r\n 7,\r\n 6,\r\n 5,\r\n 4,\r\n 3,\r\n 2,\r\n 10,\r\n 0,\r\n 9,\r\n 8,\r\n 7,\r\n 6,\r\n 5,\r\n 4,\r\n 3,\r\n 2,\r\n];\r\n\r\n/**\r\n * Provides **offline** validation of Vehicle Identification Numbers (VINs) using the\r\n * [VIN Check Algorithm](https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit).\r\n *\r\n * @param {string} vin - Vehicle Identification Number.\r\n * @returns {boolean} True for a valid VIN, false for an invalid VIN.\r\n *\r\n * @example When loaded from the browser via html script tags\r\n * // \r\n * const isValid = NHTSA.isValidVin('3VWD07AJ5EM388202')\r\n * console.log(isValid) // true\r\n *\r\n * @example When loaded as a module\r\n * import { isValidVin } from '@shaggytools/nhtsa-api-wrapper'\r\n * const isValid = isValidVin('3VWD07AJ5EM388202')\r\n * console.log(isValid) // true\r\n *\r\n */\r\nexport function isValidVin(vin: string): boolean {\r\n /* A valid VIN must be a string and is always exactly 17 digits */\r\n if (typeof vin !== 'string' || vin.length != 17) {\r\n return false;\r\n }\r\n\r\n /* Normalize the vin to all uppercase letters */\r\n vin = vin.toUpperCase();\r\n\r\n /* split the vin digits into an array */\r\n const vinArray: string[] = vin.split('');\r\n\r\n /* checkDigit will be tested against the checkSum later */\r\n const checkDigit: string = vinArray[8];\r\n\r\n /*\r\n * In a valid VIN, the checkDigit can either be:\r\n * a number, 0-9 inclusive OR the character 'X'\r\n */\r\n if (isNaN(parseInt(checkDigit)) && checkDigit !== 'X') {\r\n return false;\r\n }\r\n\r\n /*\r\n * The checkValue must be a digit and 'X' is the only valid alphabetic check value.\r\n * As per the algorithm, a checkDigit of 'X' is equal to a checkValue of `10` and needs\r\n * to be converted as such.\r\n */\r\n const checkValue: number = checkDigit === 'X' ? 10 : parseInt(checkDigit);\r\n\r\n /*\r\n * Maps the vinArray and converts any values (digits) that are alphabetic,\r\n * into numbers, using the TRANSLITERATION_TABLE.\r\n * Then these numbers are multiplied against their corresponding weight\r\n * in the WEIGHTS_ARRAY, matched by index position.\r\n * All 17 of those digitValues are then added together and divided by 11.\r\n * The remainder, or % modulo, of that division will be the final 'checksum'.\r\n */\r\n const checksum: number =\r\n vinArray\r\n .map((digit: string, index: number) => {\r\n let digitValue: number;\r\n /* Use the transliteration table to convert any Not a Number(NaN) values to numbers */\r\n isNaN(parseInt(digit))\r\n ? (digitValue = TRANSLITERATION_TABLE[digit])\r\n : (digitValue = parseInt(digit));\r\n\r\n /* Convert the digitValue to a weighted number corresponding to it's position, by index, in the weightsArray. */\r\n const weight: number = WEIGHTS_ARRAY[index];\r\n\r\n /* The final step for each digit is to multiply the digit by it's corresponding weight */\r\n return digitValue * weight;\r\n })\r\n /* Finally, get the sum of all digits and divide by 11, the remainder of that operation is the checksum */\r\n .reduce((acc, currValue) => acc + currValue, 0) % 11;\r\n\r\n /*\r\n * The checksum is compared against the checkValue we set earlier (the 9th digit of the VIN)\r\n * As per the algorithm, if they are equal to each other, then the VIN must be valid and\r\n * we return true, otherwise the VIN is invalid and we return false.\r\n */\r\n return checksum === checkValue;\r\n}\r\n","/**\r\n * @module api/Fetch\r\n * @category API\r\n * @description API Fetch Logic.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [Fetch](module-api_Fetch.Fetch.html)\r\n * > - Constant: [BASE_URL](#~BASE_URL)\r\n * > - Constant: [DEFAULT_CONFIG](#~DEFAULT_CONFIG)\r\n * >\r\n * > **Types**\r\n * > - Type: [ApiResponse](#ApiResponse)\r\n * > - Type: [FetchConfig](#FetchConfig)\r\n * > - Type: [FetchRequestOptions](#FetchRequestOptions)\r\n * > - Type: [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body)\r\n * > - Type: [FetchResponse](#FetchResponse)\r\n * > - Type: [NhtsaResponse](#NhtsaResponse)\r\n */\r\n\r\n/* Module Dependencies */\r\nimport fetch from 'cross-fetch';\r\n/* Utilities */\r\nimport { getTypeof, makeQueryString } from '../utils';\r\n/* Types */\r\nimport { QueryStringParameters } from '../utils/types';\r\n\r\n/*****************\r\n * CONSTANTS\r\n ****************/\r\n\r\n/**\r\n * @constant {string} BASE_URL Default Fetch base URL string\r\n * @default 'https://vpic.nhtsa.dot.gov/api/vehicles'\r\n */\r\nexport const BASE_URL = 'https://vpic.nhtsa.dot.gov/api/vehicles';\r\n\r\n/**\r\n * @constant {module:api/Fetch.FetchConfig} DEFAULT_CONFIG Default Fetch configuration options\r\n * @property {string} apiResponseFormat=json\r\n * @property {string} baseUrl=BASE_URL Default: [BASE_URL](module-api_Fetch.html#~BASE_URL)\r\n * @property {FetchRequestOptions} options={method:\"GET\"}\r\n */\r\nexport const DEFAULT_CONFIG: FetchConfig = {\r\n apiResponseFormat: 'json',\r\n baseUrl: BASE_URL,\r\n options: {},\r\n};\r\n\r\n/*****************\r\n * Fetch Class\r\n ****************/\r\n\r\n/**\r\n * Class wrapper containing API wrapper HTTP Fetch logic.\r\n *\r\n * > **Static Methods**:\r\n * > - [buildQueryString](#buildQueryString)\r\n * > - [get](#get)\r\n *\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n * @category API\r\n */\r\nexport class Fetch {\r\n apiResponseFormat: string;\r\n baseUrl?: string;\r\n options?: FetchRequestOptions;\r\n\r\n constructor(userConfig?: FetchConfig) {\r\n let finalConfig: FetchConfig;\r\n\r\n /* userConfig takes precedence over DEFAULT_CONFIG */\r\n if (userConfig && getTypeof(userConfig) === 'object') {\r\n finalConfig = {\r\n ...DEFAULT_CONFIG,\r\n ...userConfig,\r\n options: { ...DEFAULT_CONFIG.options, ...userConfig.options },\r\n };\r\n } else {\r\n finalConfig = { ...DEFAULT_CONFIG };\r\n }\r\n\r\n /** @private */\r\n this.apiResponseFormat = 'json';\r\n /** @private */\r\n this.baseUrl = finalConfig.baseUrl;\r\n /** @private */\r\n this.options = finalConfig.options;\r\n }\r\n\r\n /**\r\n * Builds a query string from QueryStringParameters.\r\n *\r\n * @param {QueryStringParameters} params - Object containing Key:Value pairs to build the URL query string with.\r\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\r\n * - Given params of `{paramName: \"\"}` , setting this to true will use 'paramName=' in the final query string.\r\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\r\n * @returns {(Promise)} A formatted NHSTA.dot.gov Vehicles API query string.\r\n */\r\n async buildQueryString(\r\n params?: QueryStringParameters,\r\n allowEmptyStringValues = false\r\n ): Promise {\r\n /*\r\n * Make sure we're always using 'format=json' in the url Query parameters\r\n * If the user provides a 'format' key in the params, during class instantiation we want to override it to 'json'\r\n * This package may provide support for the other formats (CSV and XML) if requested.\r\n */\r\n if (!params || getTypeof(params) !== 'object') {\r\n params = {\r\n format: this.apiResponseFormat,\r\n };\r\n } else {\r\n params = { ...params, format: this.apiResponseFormat };\r\n }\r\n\r\n /* Return the completed query string */\r\n return await makeQueryString(params, allowEmptyStringValues);\r\n }\r\n\r\n /**\r\n * Uses the `cross-fetch` npm package to send HTTP requests and retrieve data from an API.\r\n * - In browser environments, [whatwg-fetch](https://github.com/github/fetch/) window.fetch is used.\r\n * - In node environments, [node-fetch](https://github.com/bitinn/node-fetch/) NPM package is used.\r\n *\r\n * @param {string} url - URL to fetch data from.\r\n * @param {FetchRequestOptions} [options] - [Fetch options](https://github.github.io/fetch/#options).\r\n * @returns {(Promise)} Response from the API.\r\n */\r\n async get(\r\n url: string,\r\n options: FetchRequestOptions = {}\r\n ): Promise {\r\n /* Runtime typechecking */\r\n const typeofUrl = getTypeof(url);\r\n if (typeofUrl !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `Fetch.get(url) - url argument must be of type string, got: ${typeofUrl}`\r\n )\r\n );\r\n }\r\n const typeofOptions = getTypeof(options);\r\n if (typeofOptions !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `Fetch.get(url, options) - options argument must be of type object, got: ${typeofOptions}`\r\n )\r\n );\r\n }\r\n\r\n /* Combine user provided 'options' and class property 'this.options', user options overwrite class options */\r\n const combinedOptions = { ...this.options, ...options };\r\n\r\n /* Use the cross-fetch package to perform an HTTP request */\r\n const response: Response = await fetch(url, combinedOptions)\r\n .then((result) => {\r\n if (!result?.status || result.status >= 400) {\r\n throw new Error(\r\n `Bad response from server, code: ${result?.status}, text: ${result?.statusText}, headers: ${result?.headers}`\r\n );\r\n } else return result;\r\n })\r\n .catch((err) =>\r\n Promise.reject(new Error(`Fetch.get() http error: ${err}`))\r\n );\r\n\r\n /* Convert the NHTSA API data to JSON */\r\n const NhtsaResponse: NhtsaResponse = await response\r\n .json()\r\n .then((json: NhtsaResponse): NhtsaResponse => json);\r\n\r\n /* Add the fetch response information to the returned NHSTA API data */\r\n const finalResult: ApiResponse = {\r\n ...NhtsaResponse,\r\n FetchResponse: {\r\n headers: response.headers,\r\n ok: response.ok,\r\n redirected: response.redirected,\r\n status: response.status,\r\n statusText: response.statusText,\r\n url: response.url,\r\n },\r\n };\r\n\r\n /* Return the completed ApiResponse */\r\n return Promise.resolve(finalResult);\r\n }\r\n}\r\n\r\n/*****************\r\n * Types\r\n ****************/\r\n\r\n/**\r\n * Various fetch request body types.\r\n *\r\n * @typedef FetchRequestBodyTypes\r\n * @type {URLSearchParams | FormData | Blob | ArrayBuffer | DataView}\r\n *\r\n * @memberof module:api/Fetch\r\n */\r\nexport type FetchRequestBodyTypes =\r\n | URLSearchParams\r\n | FormData\r\n | Blob\r\n | ArrayBuffer\r\n | DataView;\r\n\r\n/**\r\n * Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias FetchRequestOptions\r\n */\r\nexport type FetchRequestOptions = {\r\n /**HTTP request method - Default: \"GET\". */\r\n method?: string;\r\n /** HTTP request body - [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body). */\r\n body?: string | FetchRequestBodyTypes;\r\n /** [Object, Headers](https://github.github.io/fetch/#Headers) - Default: {}. */\r\n headers?: Record | Headers;\r\n /**\r\n * Default: \"omit\" - Authentication credentials mode.\r\n * - \"omit\" - don't include authentication credentials (e.g. Cookies) in the request.\r\n * - \"same-origin\" - include credentials in requests to the same site\r\n * - \"include\" - include credentials in requests to all sites.\r\n */\r\n credentials?: 'omit' | 'same-origin' | 'include';\r\n};\r\n\r\n/**\r\n * Used when instantiating a Fetch class or related subclass.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias FetchConfig\r\n */\r\nexport type FetchConfig = {\r\n /** Requested response format from the NHSTA API (hardcoded to 'json' for now). */\r\n apiResponseFormat?: string;\r\n /** Base of the URL to build fetch URLs from. */\r\n baseUrl?: string;\r\n /** Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}. */\r\n options?: FetchRequestOptions;\r\n};\r\n\r\n/**\r\n * [Fetch API Response](https://github.github.io/fetch/#Response) properties.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias FetchResponse\r\n */\r\nexport type FetchResponse = {\r\n /** The [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object associated with the response. */\r\n headers: Headers;\r\n /** A boolean indicating whether the response was successful (status in the range 200–299) or not. */\r\n ok: boolean;\r\n /** Indicates whether or not the response is the result of a redirect (that is, its URL list has more than one entry). */\r\n redirected: boolean;\r\n /** The status code of the response. (This will be 200 for a success). */\r\n status: number;\r\n /** The status message corresponding to the status code. (e.g., OK for 200). */\r\n statusText: string;\r\n /** The URL of the response. */\r\n url: string;\r\n};\r\n\r\n/**\r\n * Response data returned from the NHSTA API.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias NhtsaResponse\r\n */\r\nexport type NhtsaResponse = {\r\n /** The number of items returned in the Results object. */\r\n Count: number;\r\n /** A message describing the Results. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, etc) used in the request URL. */\r\n SearchCriteria: string;\r\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\r\n Results: Array;\r\n};\r\n\r\n/**\r\n * Complete response returned by {@link module:api/Fetch.Fetch#get}.\r\n *\r\n * @see {@link module:api/Fetch.NhtsaResponse}\r\n * @see {@link module:api/Fetch.FetchResponse}\r\n * @memberof module:api/Fetch\r\n * @alias ApiResponse\r\n */\r\nexport type ApiResponse = {\r\n /** The number of items returned in the Results object. */\r\n Count: number;\r\n /** A message describing the Results. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, etc) used in the request URL. */\r\n SearchCriteria: string;\r\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) Properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","import { getTypeof } from './getTypeof';\n\n/**\n * @module utils/makeQueryString\n * @category Utils\n */\n\n/**\n * Utility method to generate a query string compatible with the NHSTA API, for use in an API URL string.\n *\n * @async\n *\n * @param {object} params - Object of Type [QueryStringParameters](module-utils_makeQueryString.html#.QueryStringParameters).\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\n * - Given params of `{ paramName: \"\" }` , setting this to true will use 'paramName=' in the final query string.\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\n *\n * @returns {Promise} A query string of search parameters for use in a final Fetch.get URL.\n *\n * @example When loaded from the browser via html script tags\n * // \n * const qs = await NHTSA.makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example When loaded as a module\n * import { makeQueryString } from '@shaggytools/nhtsa-api-wrapper'\n * const qs = await makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example Single Param:\n * const qs = await makeQueryString({\n * modelYear: 2019\n * }).catch(error => error)\n * console.log(qs) // \"?modelYear=2019\"\n *\n * @example Multiple Params:\n * const qs = await makeQueryString({\n * whatever: 'some value',\n * modelYear: 2006,\n * page: \"2\"\n * }).catch(error => error)\n *\n * console.log(qs) // \"?whatever=some%20value&modelYear=2006&page=2\"\n *\n * @example Empty Params Object:\n * const qs = await makeQueryString({}).catch(error => error)\n *\n * console.log(qs) // \"\"\n *\n * @example Using allowEmptyStringValues option:\n * const qs = await makeQueryString({\n * year: 2016,\n * vehicleType: '',\n * make: 'Audi'\n * }, true).catch(error => error)\n *\n * console.log(qs) // \"?year=2016&vehicleType=&make=Audi\"\n *\n */\nexport function makeQueryString(\n params: QueryStringParameters = {},\n allowEmptyStringValues = false\n): Promise {\n /* Beginning of error message string */\n const errorBase =\n 'queryString(params) - expected params in the form of an object, got:';\n\n /* Runtime type guard params argument, must be of type object */\n if (getTypeof(params) !== 'object') {\n return Promise.reject(new Error(`${errorBase} ${params}`));\n }\n\n /* Setup QueryString for Array mapping */\n const entries = Object.entries(params);\n const paramsLength = entries.length;\n\n /* Return an empty string if params are an empty object */\n if (paramsLength < 1) return Promise.resolve('');\n\n /* Used to check if we've already prepended a valid query param */\n let isPrepended = false;\n\n /* Map [key]:value entries to \"key=value\" strings in an array */\n const queryStringArray = entries.map(([key, value], index) => {\n let prepend = '';\n let append = '';\n\n const typeofValue = getTypeof(value);\n\n /* Convert any number values to a string */\n if (value && typeofValue === 'number') {\n value = value.toString();\n }\n\n /* Skip any invalid values, only string and number value types are valid */\n if (\n (value || allowEmptyStringValues) &&\n (typeofValue === 'string' || typeofValue === 'number')\n ) {\n /* if this is the first param we need to prepend the '?' char */\n if (!isPrepended) {\n prepend = '?';\n isPrepended = true;\n }\n /* if there is another param coming after this one we need to append the '&' char */\n if (index < paramsLength - 1) {\n append = '&';\n }\n\n /* Add the completed partial query string to queryStringArray */\n return `${prepend}${key}=${value}${append}`;\n }\n return;\n });\n\n /* Join and return the completed query string after URI encoding */\n return Promise.resolve(encodeURI(queryStringArray.join('')));\n}\n\n/**\n * Object containing Key:Value pairs to build the URL query string with.\n * - Parameter values may be either strings or numbers.\n *\n * @memberof module:utils/makeQueryString\n * @alias QueryStringParameters\n * @example\n * {\n * modelYear: 2009,\n * whatever: 'something'\n * }\n *\n */\nexport type QueryStringParameters = {\n [propName: string]: string | number | undefined;\n};\n","/**\r\n * @module api/actions/DecodeVin\r\n * @category Actions\r\n * @description DecodeVin NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVin](module-api_actions_DecodeVin.DecodeVin.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinResponse](#DecodeVinResponse)\r\n * > - Type: [DecodeVinResults](#DecodeVinResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVin extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The DecodeVin API Action will decode the VIN and the decoded output will be made available in the format of Key-value pairs.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This API also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n * - The 9th digit is not necessary.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVin(\r\n vin: string,\r\n params?: {\r\n modelYear?: number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVin';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVin\r\n * @alias DecodeVinResults\r\n */\r\nexport type DecodeVinResults = {\r\n Value: string | null;\r\n ValueId: string | null;\r\n Variable: string;\r\n VariableId: number;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVin API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVin\r\n * @alias DecodeVinResponse\r\n */\r\nexport type DecodeVinResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVinExtended\r\n * @category Actions\r\n * @description DecodeVinExtended NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinExtended](module-api_actions_DecodeVinExtended.DecodeVinExtended.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinExtendedResponse](#DecodeVinExtendedResponse)\r\n * > - Type: [DecodeVinExtendedResults](#DecodeVinExtendedResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinExtended extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This is exactly like the DecodeVin method but provides additional information on variables\r\n * related to other NHTSA programs like\r\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\r\n * - This will decode the VIN and the decoded output will be made available\r\n * in the format of Key-value pairs.\r\n * - In the returned 'Results` object:\r\n * - The IDs (VariableID and ValueID) represent the unique ID associated with the Variable/Value.\r\n * - In case of text variables, the ValueID is not applicable.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n * - The 9th digit is not necessary.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVinExtended(\r\n vin: string,\r\n params?: {\r\n modelYear?: string | number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinExtended';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinExtendedResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinExtended\r\n * @alias DecodeVinExtendedResults\r\n */\r\nexport type DecodeVinExtendedResults = {\r\n Value: string | null;\r\n ValueId: string | null;\r\n Variable: string;\r\n VariableId: number;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinExtended API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinExtended\r\n * @alias DecodeVinExtendedResponse\r\n */\r\nexport type DecodeVinExtendedResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVinValues\r\n * @category Actions\r\n * @description DecodeVinValues NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinValues](module-api_actions_DecodeVinValues.DecodeVinValues.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinValuesResponse](#DecodeVinValuesResponse)\r\n * > - Type: [DecodeVinValuesResults](#DecodeVinValuesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinValues extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The DecodeVinValues API Action will decode the VIN with the Results returned in a _flat file_ format.\r\n * - The Results will be made available in a flat file format of a single object containing\r\n * 'key: value' results.\r\n * - Providing params.modelYear allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeVinValues(\r\n vin: string,\r\n params?: {\r\n modelYear?: number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinValues';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (\r\n params?.modelYear &&\r\n typeofModelYear !== 'string' &&\r\n typeofModelYear !== 'number'\r\n ) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinValuesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinValues\r\n * @alias DecodeVinValuesResults\r\n */\r\nexport type DecodeVinValuesResults = {\r\n /** Flat file format, single object containing keys and values of type string */\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinValues API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinValues\r\n * @alias DecodeVinValuesResponse\r\n */\r\nexport type DecodeVinValuesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /**\r\n * The search results returned by the NHSTA API request.\r\n * Flat file format, single object containing keys and values of type string\r\n * */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVINValuesBatch\r\n * @category Actions\r\n * @description DecodeVINValuesBatch NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVINValuesBatch](module-api_actions_DecodeVINValuesBatch.DecodeVINValuesBatch.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVINValuesBatchResponse](#DecodeVINValuesBatchResponse)\r\n * > - Type: [DecodeVINValuesBatchResults](#DecodeVINValuesBatchResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVINValuesBatch extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This decodes a batch of VINs that are submitted in a standardized format in a string\r\n * and returns multiple decodes in a flat format.\r\n *\r\n * The `inputString` parameter should be in the following format:\r\n * - `vin , modelYear ; vin , modelYear ; vin , modelYear ...`\r\n *\r\n * \"modelYear\" is optional, the output for each VIN decode is in the same format as produced by the \"Decode VIN (flat format)\" method.\r\n *\r\n * @async\r\n * @param {string} inputString - A string of Vehicle Identification Numbers (full or partial) following the format listed in the description.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVINValuesBatch(\r\n inputString: string\r\n ): Promise {\r\n const action = 'DecodeVINValuesBatch';\r\n\r\n /* Runtime typechecking */\r\n const typeofInputString = getTypeof(inputString);\r\n if (typeofInputString !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"inputString\" argument is required and must be of type string, got: ` +\r\n `<${typeofInputString}> ${inputString}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/`;\r\n\r\n const body = encodeURI(`DATA=${inputString}&format=json`);\r\n\r\n /* Return the result */\r\n return await this.get(url, {\r\n method: 'POST',\r\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\r\n body,\r\n })\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVINValuesBatchResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVINValuesBatch\r\n * @alias DecodeVINValuesBatchResults\r\n */\r\nexport type DecodeVINValuesBatchResults = {\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVINValuesBatch API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVINValuesBatch\r\n * @alias DecodeVINValuesBatchResponse\r\n */\r\nexport type DecodeVINValuesBatchResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVinValuesExtended\r\n * @category Actions\r\n * @description DecodeVinValuesExtended NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinValuesExtended](module-api_actions_DecodeVinValuesExtended.DecodeVinValuesExtended.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinValuesExtendedResponse](#DecodeVinValuesExtendedResponse)\r\n * > - Type: [DecodeVinValuesExtendedResults](#DecodeVinValuesExtendedResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinValuesExtended extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This is exactly like the DecodeVinValues (flat format Results) method but provides additional information\r\n * on variables related to other NHTSA programs like\r\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\r\n * - The Results will be made available in a flat file format of a single object containing\r\n * 'key: value' results.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @reje\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeVinValuesExtended(\r\n vin: string,\r\n params?: {\r\n modelYear?: string | number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinValuesExtended';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinValuesExtendedResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinValuesExtended\r\n * @alias DecodeVinValuesExtendedResults\r\n */\r\nexport type DecodeVinValuesExtendedResults = {\r\n /** Flat file format, single object containing keys and values of type string */\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinValuesExtended API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinValuesExtended\r\n * @alias DecodeVinValuesExtendedResponse\r\n */\r\nexport type DecodeVinValuesExtendedResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /**\r\n * The search results returned by the NHSTA API request.\r\n * Flat file format, single object containing keys and values of type string\r\n * */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeWMI\r\n * @category Actions\r\n * @description DecodeWMI NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeWMI](module-api_actions_DecodeWMI.DecodeWMI.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeWMIResponse](#DecodeWMIResponse)\r\n * > - Type: [DecodeWMIResults](#DecodeWMIResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeWMI extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides information on the World Manufacturer Identifier for a specific WMI code.\r\n * - `WMI` may be put in as either 3 characters representing VIN position 1-3 or 6 characters\r\n * representing VIN positions 1-3 & 12-14. Example \"JTD\", \"1T9131\".\r\n *\r\n * @async\r\n * @param {string} WMI - World Manufacturer Identifier.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeWMI(WMI: string): Promise {\r\n const action = 'DecodeWMI';\r\n\r\n /* Runtime typechecking */\r\n const typeofWMI = getTypeof(WMI);\r\n if (typeofWMI !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"WMI\" argument is required and must be of type string, got: ` +\r\n `<${typeofWMI}> ${WMI}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${WMI}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeWMIResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeWMI\r\n * @alias DecodeWMIResults\r\n */\r\nexport type DecodeWMIResults = {\r\n CommonName: string;\r\n CreatedOn: string;\r\n DateAvailableToPublic: string;\r\n Make: string;\r\n ManufacturerName: string;\r\n ParentCompanyName: string;\r\n URL: string;\r\n UpdatedOn: string;\r\n VehicleType: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeWMI API Action.\r\n *\r\n * @memberof module:api/actions/DecodeWMI\r\n * @alias DecodeWMIResponse\r\n */\r\nexport type DecodeWMIResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetAllMakes\r\n * @category Actions\r\n * @description GetAllMakes NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetAllMakes](module-api_actions_GetAllMakes.GetAllMakes.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetAllMakesResponse](#GetAllMakesResponse)\r\n * > - Type: [GetAllMakesResults](#GetAllMakesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetAllMakes extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Makes available in the vPIC Dataset.\r\n *\r\n * @async\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetAllMakes(): Promise {\r\n const action = 'GetAllMakes';\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetAllMakesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetAllMakes\r\n * @alias GetAllMakesResults\r\n */\r\nexport type GetAllMakesResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetAllMakes API Action.\r\n *\r\n * @memberof module:api/actions/GetAllMakes\r\n * @alias GetAllMakesResponse\r\n */\r\nexport type GetAllMakesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetAllManufacturers\r\n * @category Actions\r\n * @description GetAllManufacturers NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetAllManufacturers](module-api_actions_GetAllManufacturers.GetAllManufacturers.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetAllManufacturersResponse](#GetAllManufacturersResponse)\r\n * > - Type: [GetAllManufacturersResults](#GetAllManufacturersResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetAllManufacturers extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Manufacturers available in vPIC Dataset.\r\n * - `params.manufacturerType` allows the user to filter the list based on manufacturer type,\r\n * ('Incomplete Vehicles', 'Completed Vehicle Manufacturer', 'Incomplete Vehicle Manufacturer',\r\n * 'Intermediate Manufacturer', 'Final-Stage Manufacturer', 'Alterer', or any partial match of those strings).\r\n * - You can get a list of all manufacturer types with the following API Action:\r\n * `GetVehicleVariableValuesList('manufacturer type')`\r\n * - Results are provided in pages of 100 items.\r\n * - Provide a number value for `params.page` to specify 1st (default), 2nd, 3rd, Nth, etc page.\r\n *\r\n * @async\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string} [params.manufacturerType] - See method description.\r\n * @param {number} [params.page] - Specify the page number (results returned 100 at a time).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetAllManufacturers(\r\n params: {\r\n manufacturerType?: string;\r\n page?: number;\r\n } = {}\r\n ): Promise {\r\n const action = 'GetAllManufacturers';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofManufacturerType = getTypeof(params.manufacturerType);\r\n if (params.manufacturerType && typeofManufacturerType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.manufacturerType\" argument must be of type string, got: ` +\r\n `<${typeofManufacturerType}> ${params.manufacturerType}`\r\n )\r\n );\r\n }\r\n\r\n const typeofPage = getTypeof(params.page);\r\n if (params.page && typeofPage !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.page\" argument must be of type number, got: ` +\r\n `<${typeofPage}> ${params.page}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetAllManufacturersResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetAllManufacturers\r\n * @alias GetAllManufacturersResults\r\n */\r\nexport type GetAllManufacturersResults = {\r\n Country: string;\r\n Mfr_CommonName: string;\r\n Mfr_ID: number;\r\n Mfr_Name: string;\r\n VehicleTypes: Array<{ isPrimary?: boolean; name?: string }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetAllManufacturers API Action.\r\n *\r\n * @memberof module:api/actions/GetAllManufacturers\r\n * @alias GetAllManufacturersResponse\r\n */\r\nexport type GetAllManufacturersResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetCanadianVehicleSpecifications\r\n * @category Actions\r\n * @description GetCanadianVehicleSpecifications NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetCanadianVehicleSpecifications](module-api_actions_GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetCanadianVehicleSpecificationsResponse](#GetCanadianVehicleSpecificationsResponse)\r\n * > - Type: [GetCanadianVehicleSpecificationsResults](#GetCanadianVehicleSpecificationsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetCanadianVehicleSpecifications extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The Canadian Vehicle Specifications (CVS) consists of a database of original vehicle dimensions,\r\n * used primarily in collision investigation and reconstruction, combined with a search engine.\r\n *\r\n * The database is compiled annually by the Collision Investigation and Research Division of Transport Canada.\r\n * Visit official [Canadian Vehicle Specifications](http://www.carsp.ca/research/resources/safety-sources/canadian-vehicle-specifications/)\r\n * page for more details.\r\n *\r\n * This API action will return a 404 html error if any of the query parameters in params\r\n * are missing from the query string. This is the only API action with this behaviour. Therefore,\r\n * parameters are inserted into the query string as empty strings if not provided by the user.\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle (required) - Number, >= 1971.\r\n * @param {string} [params.make] - Vehicle's make, like \"Honda\", \"Toyota\", etc...\r\n * @param {string} [params.model] - Vehicle's model, like \"Pilot\", \"Focus\". Can also include some other elements like Body Type, Engine Model/size, etc...\r\n * @param {string} [params.units] - \"Metric\" (default), or \"US\" for United States customary units.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetCanadianVehicleSpecifications(params: {\r\n year: number;\r\n make?: string;\r\n model?: string;\r\n units?: string;\r\n }): Promise {\r\n const action = 'GetCanadianVehicleSpecifications';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n const typeofMake = getTypeof(params.make);\r\n if (params.make && typeofMake !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.make\" argument must be of type string, got: ` +\r\n `<${typeofMake}> ${params.make}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModel = getTypeof(params.model);\r\n if (params.model && typeofModel !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.model\" argument must be of type string, got: ` +\r\n `<${typeofModel}> ${params.model}`\r\n )\r\n );\r\n }\r\n\r\n const typeofUnits = getTypeof(params.units);\r\n if (params.units && typeofUnits !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.units\" argument must be of type string, got: ` +\r\n `<${typeofUnits}> ${params.units}`\r\n )\r\n );\r\n }\r\n\r\n /* Set default query parameters to empty strings if not provided by the user */\r\n const make = params.make || '';\r\n const model = params.model || '';\r\n const units = params.units || '';\r\n\r\n const params_ = {\r\n year: params.year,\r\n make,\r\n model,\r\n units,\r\n };\r\n\r\n /*\r\n * Build the 'default' query string to be appended to the URL.\r\n *\r\n * Additionally, sets the allowEmptyStringValues option (2nd argument) to true because\r\n * this API action will return a 404 error if any of the query parameters are missing from the query string.\r\n * This is the only API action with this behaviour (\"year\" is the only param the user must provide).\r\n */\r\n const queryString = await this.buildQueryString(\r\n params_,\r\n true\r\n ).catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetCanadianVehicleSpecificationsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\r\n * @alias GetCanadianVehicleSpecificationsResults\r\n */\r\nexport type GetCanadianVehicleSpecificationsResults = {\r\n Specs: Array<{\r\n Name: string;\r\n Value: string;\r\n }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetCanadianVehicleSpecifications API Action.\r\n *\r\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\r\n * @alias GetCanadianVehicleSpecificationsResponse\r\n */\r\nexport type GetCanadianVehicleSpecificationsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetEquipmentPlantCodes\r\n * @category Actions\r\n * @description GetEquipmentPlantCodes NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetEquipmentPlantCodes](module-api_actions_GetEquipmentPlantCodes.GetEquipmentPlantCodes.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetEquipmentPlantCodesResponse](#GetEquipmentPlantCodesResponse)\r\n * > - Type: [GetEquipmentPlantCodesResults](#GetEquipmentPlantCodesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetEquipmentPlantCodes extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * Returns assigned Equipment Plant Codes. Can be filtered by Year, Equipment Type and Report Type.\r\n *\r\n * `params.year`:\r\n * - Only years >= 2016 are supported\r\n *\r\n * `params.equipmentType`:\r\n * - 1 (Tires)\r\n * - 3 (Brake Hoses)\r\n * - 13 (Glazing)\r\n * - 16 (Retread)\r\n *\r\n * `params.reportType`:\r\n * - 'New' (The Equipment Plant Code was assigned during the selected year).\r\n * - 'Updated' (The Equipment Plant data was modified during the selected year).\r\n * - 'Closed' (The Equipment Plant is no longer Active).\r\n * - 'All' (All Equipment Plant Codes regardless of year, including their status (active or closed)).\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\r\n * @param {number} params.equipmentType - Number equal to 1, 3, 13, or 16.\r\n * @param {string} params.reportType - 'New', 'Updated', 'Closed', or 'All'.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetEquipmentPlantCodes(params: {\r\n year: number;\r\n equipmentType: 1 | 3 | 13 | 16;\r\n reportType: 'New' | 'Updated' | 'Closed' | 'All';\r\n }): Promise {\r\n const action = 'GetEquipmentPlantCodes';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n const typeofEquipmentType = getTypeof(params.equipmentType);\r\n if (typeofEquipmentType !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.equipmentType\" argument is required and must be of type number, got: ` +\r\n `<${typeofEquipmentType}> ${params.equipmentType}`\r\n )\r\n );\r\n }\r\n\r\n const typeofReportType = getTypeof(params.reportType);\r\n if (typeofReportType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.reportType\" argument is required and must be of type string, got: ` +\r\n `<${typeofReportType}> ${params.reportType}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetEquipmentPlantCodesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetEquipmentPlantCodes\r\n * @alias GetEquipmentPlantCodesResults\r\n */\r\nexport type GetEquipmentPlantCodesResults = {\r\n Address: string;\r\n City: string;\r\n Country: string;\r\n DOTCode: string;\r\n Name: string;\r\n OldDotCode: string;\r\n PostalCode: string;\r\n StateProvince: string;\r\n Status: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetEquipmentPlantCodes API Action.\r\n *\r\n * @memberof module:api/actions/GetEquipmentPlantCodes\r\n * @alias GetEquipmentPlantCodesResponse\r\n */\r\nexport type GetEquipmentPlantCodesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetMakeForManufacturer\r\n * @category Actions\r\n * @description GetMakeForManufacturer NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakeForManufacturer](module-api_actions_GetMakeForManufacturer.GetMakeForManufacturer.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakeForManufacturerResponse](#GetMakeForManufacturerResponse)\r\n * > - Type: [GetMakeForManufacturerResults](#GetMakeForManufacturerResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakeForManufacturer extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified manufacturer that is requested.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\r\n * (it accepts a partial manufacturer name as an input).\r\n * - `manufacturer` name can be a partial name, or a full name for more specificity\r\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\r\n * - Multiple results are returned in case of multiple matches.\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetMakeForManufacturer(\r\n manufacturer: string | number\r\n ): Promise {\r\n const action = 'GetMakeForManufacturer';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakeForManufacturerResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakeForManufacturer\r\n * @alias GetMakeForManufacturerResults\r\n */\r\nexport type GetMakeForManufacturerResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Mfr_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakeForManufacturer API Action.\r\n *\r\n * @memberof module:api/actions/GetMakeForManufacturer\r\n * @alias GetMakeForManufacturerResponse\r\n */\r\nexport type GetMakeForManufacturerResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetMakesForManufacturerAndYear\r\n * @category Actions\r\n * @description GetMakesForManufacturerAndYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakesForManufacturerAndYear](module-api_actions_GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakesForManufacturerAndYearResponse](#GetMakesForManufacturerAndYearResponse)\r\n * > - Type: [GetMakesForManufacturerAndYearResults](#GetMakesForManufacturerAndYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakesForManufacturerAndYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified manufacturer,\r\n * and whose Year From and Year To range cover the specified year.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\r\n * (it accepts a partial manufacturer name as an input).\r\n * - Multiple results are returned in case of multiple matches.\r\n * - Manufacturer can be idenfitied by Id, a partial name, or a full name\r\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\r\n *\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetMakesForManufacturerAndYear(\r\n manufacturer: string | number,\r\n params: {\r\n year: number;\r\n }\r\n ): Promise {\r\n const action = 'GetMakesForManufacturerAndYear';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument is required and must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakesForManufacturerAndYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\r\n * @alias GetMakesForManufacturerAndYearResults\r\n */\r\nexport type GetMakesForManufacturerAndYearResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n MfrId: number;\r\n MfrName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakesForManufacturerAndYear API Action.\r\n *\r\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\r\n * @alias GetMakesForManufacturerAndYearResponse\r\n */\r\nexport type GetMakesForManufacturerAndYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetMakesForVehicleType\r\n * @category Actions\r\n * @description GetMakesForVehicleType NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakesForVehicleType](module-api_actions_GetMakesForVehicleType.GetMakesForVehicleType.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakesForVehicleTypeResponse](#GetMakesForVehicleTypeResponse)\r\n * > - Type: [GetMakesForVehicleTypeResults](#GetMakesForVehicleTypeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakesForVehicleType extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified vehicle type (`typeName`),\r\n * whose name is LIKE the vehicle type name in vPIC Dataset.\r\n * - Vehicle `typeName` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n * @param {string} typeName - A partial or full vehicle type name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetMakesForVehicleType(\r\n typeName: string\r\n ): Promise {\r\n const action = 'GetMakesForVehicleType';\r\n\r\n /* Runtime typechecking */\r\n const typeofTypeName = getTypeof(typeName);\r\n if (typeofTypeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"typeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofTypeName}> ${typeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${typeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakesForVehicleTypeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakesForVehicleType\r\n * @alias GetMakesForVehicleTypeResults\r\n */\r\nexport type GetMakesForVehicleTypeResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakesForVehicleType API Action.\r\n *\r\n * @memberof module:api/actions/GetMakesForVehicleType\r\n * @alias GetMakesForVehicleTypeResponse\r\n */\r\nexport type GetMakesForVehicleTypeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetManufacturerDetails\r\n * @category Actions\r\n * @description GetManufacturerDetails NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetManufacturerDetails](module-api_actions_GetManufacturerDetails.GetManufacturerDetails.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetManufacturerDetailsResponse](#GetManufacturerDetailsResponse)\r\n * > - Type: [GetManufacturerDetailsResults](#GetManufacturerDetailsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetManufacturerDetails extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides the details for a specific manufacturer that is requested.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name,\r\n * (it accepts a partial manufacturer name as an input).\r\n * - Multiple results are returned in case of multiple matches.\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetManufacturerDetails(\r\n manufacturer: string | number\r\n ): Promise {\r\n const action = 'GetManufacturerDetails';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetManufacturerDetailsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetManufacturerDetails\r\n * @alias GetManufacturerDetailsResults\r\n */\r\nexport type GetManufacturerDetailsResults = {\r\n Address: string;\r\n Address2: string;\r\n City: string;\r\n ContactEmail: string;\r\n ContactFax: string;\r\n ContactPhone: string;\r\n Country: string;\r\n DBAs: string;\r\n EquipmentItems: Array>;\r\n LastUpdated: string;\r\n ManufacturerTypes: Array<{\r\n Name: string;\r\n }>;\r\n Mfr_CommonName: string;\r\n Mfr_ID: number;\r\n Mfr_Name: string;\r\n OtherManufacturerDetails: string;\r\n PostalCode: string;\r\n PrimaryProduct: string;\r\n PrincipalFirstName: string;\r\n PrincipalLastName: string;\r\n PrincipalPosition: string;\r\n StateProvince: string;\r\n SubmittedName: string;\r\n SubmittedOn: string;\r\n SubmittedPosition: string;\r\n VehicleTypes: Array<{\r\n GVWRFrom: string;\r\n GVWRTo: string;\r\n IsPrimary: boolean;\r\n Name: string;\r\n }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetManufacturerDetails API Action.\r\n *\r\n * @memberof module:api/actions/GetManufacturerDetails\r\n * @alias GetManufacturerDetailsResponse\r\n */\r\nexport type GetManufacturerDetailsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMake\r\n * @category Actions\r\n * @description GetModelsForMake NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMake](module-api_actions_GetModelsForMake.GetModelsForMake.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeResponse](#GetModelsForMakeResponse)\r\n * > - Type: [GetModelsForMakeResults](#GetModelsForMakeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMake extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified `makeName`\r\n * whose Name is LIKE the Make in vPIC Dataset.\r\n * - `makeName` can be a partial, or a full for more specificity\r\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\r\n *\r\n * @async\r\n * @param {string} makeName - Vehicle make name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMake(makeName: string): Promise {\r\n const action = 'GetModelsForMake';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeName = getTypeof(makeName);\r\n if (typeofMakeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofMakeName}> ${makeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMake\r\n * @alias GetModelsForMakeResults\r\n */\r\nexport type GetModelsForMakeResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMake API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMake\r\n * @alias GetModelsForMakeResponse\r\n */\r\nexport type GetModelsForMakeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMakeId\r\n * @category Actions\r\n * @description GetModelsForMakeId NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeId](module-api_actions_GetModelsForMakeId.GetModelsForMakeId.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeIdResponse](#GetModelsForMakeIdResponse)\r\n * > - Type: [GetModelsForMakeIdResults](#GetModelsForMakeIdResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeId extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Make\r\n * whose Id is equal to the `makeId` in the vPIC Dataset.\r\n *\r\n * @async\r\n * @param {number} makeID - Vehicle make ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeId(\r\n makeID: number\r\n ): Promise {\r\n const action = 'GetModelsForMakeId';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeId = getTypeof(makeID);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeID}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString({}).catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeId\r\n * @alias GetModelsForMakeIdResults\r\n */\r\nexport type GetModelsForMakeIdResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeId API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeId\r\n * @alias GetModelsForMakeIdResponse\r\n */\r\nexport type GetModelsForMakeIdResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMakeIdYear\r\n * @category Actions\r\n * @description GetModelsForMakeIdYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeIdYear](module-api_actions_GetModelsForMakeIdYear.GetModelsForMakeIdYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeIdYearResponse](#GetModelsForMakeIdYearResponse)\r\n * > - Type: [GetModelsForMakeIdYearResults](#GetModelsForMakeIdYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeIdYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Model Year\r\n * and Make whose name is LIKE the Make in the vPIC Dataset.\r\n * - `params.makeId` is a number and is a required query parameter.\r\n *\r\n * A minimum of one of the following are required (or a combination of both):\r\n * - `params.modelYear` is a number (greater than 1995)\r\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.makeId - Make ID to search.\r\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\r\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeIdYear(params: {\r\n makeId: number;\r\n modelYear?: number;\r\n vehicleType?: string;\r\n }): Promise {\r\n const action = 'GetModelsForMakeIdYear';\r\n\r\n const makeId: number = params?.makeId;\r\n const modelYear: number | undefined = params?.modelYear;\r\n const vehicleType: string | undefined = params?.vehicleType;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n /* Required makeId param of type number */\r\n const typeofMakeId = getTypeof(makeId);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeId}`\r\n )\r\n );\r\n }\r\n /* At least one of modelYear or vehicleType params is required */\r\n if (!modelYear && !vehicleType) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\r\n `${modelYear} | ${vehicleType}`\r\n )\r\n );\r\n }\r\n /* valid modelYear param of type number */\r\n const typeofModelYear = getTypeof(modelYear);\r\n if (modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" must be of type number, got: ` +\r\n `<${typeofModelYear}> ${modelYear}`\r\n )\r\n );\r\n }\r\n /* valid vehicleType param of type string */\r\n const typeofVehicleType = getTypeof(vehicleType);\r\n if (vehicleType && typeofVehicleType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\r\n `<${typeofVehicleType}> ${vehicleType}`\r\n )\r\n );\r\n }\r\n\r\n /* Beginning of the the actionUrl */\r\n let actionUrl = `${action}/makeId/${makeId}/`;\r\n\r\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\r\n if (modelYear && vehicleType) {\r\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\r\n } else if (modelYear) {\r\n actionUrl += `modelYear/${modelYear}`;\r\n } else {\r\n actionUrl += `vehicleType/${vehicleType}`;\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeIdYear\r\n * @alias GetModelsForMakeIdYearResults\r\n */\r\nexport type GetModelsForMakeIdYearResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeIdYear API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeIdYear\r\n * @alias GetModelsForMakeIdYearResponse\r\n */\r\nexport type GetModelsForMakeIdYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMakeYear\r\n * @category Actions\r\n * @description GetModelsForMakeYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeYear](module-api_actions_GetModelsForMakeYear.GetModelsForMakeYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeYearResponse](#GetModelsForMakeYearResponse)\r\n * > - Type: [GetModelsForMakeYearResults](#GetModelsForMakeYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Model Year\r\n * and Make whose name is LIKE the Make in the vPIC Dataset.\r\n * - `params.make` is required. It can be a partial, or a full name for more specificity\r\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\r\n *\r\n * A minimum of one of the following are required (or a combination of both):\r\n * - `params.modelYear` is a number (greater than 1995)\r\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n *\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {string} params.make - Make name to search.\r\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\r\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\r\n *\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeYear(params: {\r\n make: string;\r\n modelYear?: number;\r\n vehicleType?: string;\r\n }): Promise {\r\n const action = 'GetModelsForMakeYear';\r\n\r\n const make: string = params?.make;\r\n const modelYear: number | undefined = params?.modelYear;\r\n const vehicleType: string | undefined = params?.vehicleType;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n /* Required make param of type string */\r\n const typeofMake = getTypeof(make);\r\n if (typeofMake !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.make\" argument is required and must be of type string, got: ` +\r\n `<${typeofMake}> ${make}`\r\n )\r\n );\r\n }\r\n /* At least one of modelYear or vehicleType params is required */\r\n if (!modelYear && !vehicleType) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\r\n `${modelYear} | ${vehicleType}`\r\n )\r\n );\r\n }\r\n /* valid modelYear param of type number */\r\n const typeofModelYear = getTypeof(modelYear);\r\n if (modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" must be of type number, got: ` +\r\n `<${typeofModelYear}> ${modelYear}`\r\n )\r\n );\r\n }\r\n /* valid vehicleType param of type string */\r\n const typeofVehicleType = getTypeof(vehicleType);\r\n if (vehicleType && typeofVehicleType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\r\n `<${typeofVehicleType}> ${vehicleType}`\r\n )\r\n );\r\n }\r\n\r\n /* Beginning of the the actionUrl */\r\n let actionUrl = `${action}/make/${params.make}/`;\r\n\r\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\r\n if (modelYear && vehicleType) {\r\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\r\n } else if (modelYear) {\r\n actionUrl += `modelYear/${modelYear}`;\r\n } else {\r\n actionUrl += `vehicleType/${vehicleType}`;\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeYear\r\n * @alias GetModelsForMakeYearResults\r\n */\r\nexport type GetModelsForMakeYearResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeYear API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeYear\r\n * @alias GetModelsForMakeYearResponse\r\n */\r\nexport type GetModelsForMakeYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetParts\r\n * @category Actions\r\n * @description GetParts NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetParts](module-api_actions_GetParts.GetParts.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetPartsResponse](#GetPartsResponse)\r\n * > - Type: [GetPartsResults](#GetPartsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetParts extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of ORGs with letter date in the given range of the dates\r\n * and with specified Type (`params.type`) of ORG.\r\n * - Up to 1000 results will be returned at a time.\r\n * - Get the next page by incrementing the `params.page` query parameter.\r\n * - All query `params` are optional.\r\n *\r\n * @async\r\n * @param {object} [params] - Query Search Parameters to append to the URL.\r\n * @param {number} [params.type] - Specified type of ORG to search.\r\n * @param {string} [params.fromDate] - Start date of search query.\r\n * @param {string} [params.toDate] - End date of search query.\r\n * @param {number} [params.page] - Which page number of results to request (100 results per page).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetParts(params?: {\r\n type?: number;\r\n fromDate?: string;\r\n toDate?: string;\r\n page?: number;\r\n }): Promise {\r\n const action = 'GetParts';\r\n\r\n const type: number | undefined = params?.type;\r\n const fromDate: string | undefined = params?.fromDate;\r\n const toDate: string | undefined = params?.toDate;\r\n const page: number | undefined = params?.page;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: <${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.type of type number */\r\n const typeofType = getTypeof(type);\r\n if (type && typeofType !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.type\" argument must be of type number, got: <${typeofType}> ${type}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.fromDate of type string */\r\n const typeofFromDate = getTypeof(fromDate);\r\n if (fromDate && typeofFromDate !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.fromDate\" argument must be of type string, got: <${typeofFromDate}> ${fromDate}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.toDate of type number */\r\n const typeofToDate = getTypeof(toDate);\r\n if (toDate && typeofToDate !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.toDate\" argument must be of type string, got: <${typeofToDate}> ${toDate}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.page of type number */\r\n const typeofPage = getTypeof(page);\r\n if (page && typeofPage !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.page\" argument must be of type number, got: <${typeofPage}> ${page}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetPartsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetParts\r\n * @alias GetPartsResults\r\n */\r\nexport type GetPartsResults = {\r\n CoverLetterURL: string;\r\n LetterDate: string;\r\n ManufacturerId: number;\r\n ManufacturerName: string;\r\n ModelYearFrom: string;\r\n ModelYearTo: string;\r\n Name: string;\r\n Type: string;\r\n URL: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetParts API Action.\r\n *\r\n * @memberof module:api/actions/GetParts\r\n * @alias GetPartsResponse\r\n */\r\nexport type GetPartsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleTypesForMake\r\n * @category Actions\r\n * @description GetVehicleTypesForMake NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleTypesForMake](module-api_actions_GetVehicleTypesForMake.GetVehicleTypesForMake.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleTypesForMakeResponse](#GetVehicleTypesForMakeResponse)\r\n * > - Type: [GetVehicleTypesForMakeResults](#GetVehicleTypesForMakeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleTypesForMake extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make,\r\n * whose name is LIKE the make name in the vPIC Dataset.\r\n * - `makeName` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\r\n *\r\n * @async\r\n * @param {string} makeName - Name of the vehicle make to search.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleTypesForMake(\r\n makeName: string\r\n ): Promise {\r\n const action = 'GetVehicleTypesForMake';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeName = getTypeof(makeName);\r\n if (typeofMakeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofMakeName}> ${makeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMake\r\n * @alias GetVehicleTypesForMakeResults\r\n */\r\nexport type GetVehicleTypesForMakeResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleTypesForMake API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMake\r\n * @alias GetVehicleTypesForMakeResponse\r\n */\r\nexport type GetVehicleTypesForMakeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleTypesForMakeId\r\n * @category Actions\r\n * @description GetVehicleTypesForMakeId NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleTypesForMakeId](module-api_actions_GetVehicleTypesForMakeId.GetVehicleTypesForMakeId.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleTypesForMakeIdResponse](#GetVehicleTypesForMakeIdResponse)\r\n * > - Type: [GetVehicleTypesForMakeIdResults](#GetVehicleTypesForMakeIdResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleTypesForMakeId extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make and\r\n * whose ID equals the make ID in the vPIC Dataset.\r\n *\r\n * @async\r\n * @param {number} makeID - Vehicle make ID.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleTypesForMakeId(\r\n makeID: number\r\n ): Promise {\r\n const action = 'GetVehicleTypesForMakeId';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeId = getTypeof(makeID);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeID}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeIdResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMakeId\r\n * @alias GetVehicleTypesForMakeIdResults\r\n */\r\nexport type GetVehicleTypesForMakeIdResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleTypesForMakeId API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMakeId\r\n * @alias GetVehicleTypesForMakeIdResponse\r\n */\r\nexport type GetVehicleTypesForMakeIdResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleVariableList\r\n * @category Actions\r\n * @description GetVehicleVariableList NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleVariableList](module-api_actions_GetVehicleVariableList.GetVehicleVariableList.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleVariableListResponse](#GetVehicleVariableListResponse)\r\n * > - Type: [GetVehicleVariableListResults](#GetVehicleVariableListResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleVariableList extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Vehicle related variables that are in the vPIC dataset.\r\n * - Information on the name, description and the type of the variable is provided.\r\n *\r\n * @async\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetVehicleVariableList(): Promise {\r\n const action = 'GetVehicleVariableList';\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleVariableListResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableList\r\n * @alias GetVehicleVariableListResults\r\n */\r\nexport type GetVehicleVariableListResults = {\r\n DataType: string;\r\n Description: string;\r\n ID: number;\r\n Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleVariableList API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableList\r\n * @alias GetVehicleVariableListResponse\r\n */\r\nexport type GetVehicleVariableListResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleVariableValuesList\r\n * @category Actions\r\n * @description GetVehicleVariableValuesList NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleVariableValuesList](module-api_actions_GetVehicleVariableValuesList.GetVehicleVariableValuesList.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleVariableValuesListResponse](#GetVehicleVariableValuesListResponse)\r\n * > - Type: [GetVehicleVariableValuesListResults](#GetVehicleVariableValuesListResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleVariableValuesList extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the accepted values for a given variable that are stored in the vPIC dataset.\r\n *\r\n * This applies to only \"Look up\" type of variables.\r\n * - `variableValue` can either be a:\r\n * - Variable Name (\"battery type\" in first example, please use full name, not just part of it),\r\n * - or Variable ID (number).\r\n *\r\n * @async\r\n * @param {string|number} variableValue - The variable you want to get a values list of.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleVariableValuesList(\r\n variableValue: string | number\r\n ): Promise {\r\n const action = 'GetVehicleVariableValuesList';\r\n\r\n /* Runtime typechecking */\r\n const typeofVariableValue = getTypeof(variableValue);\r\n if (typeofVariableValue !== 'string' && typeofVariableValue !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"variableValue\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofVariableValue}> ${variableValue}`\r\n )\r\n );\r\n }\r\n /* Encode to a valid URI string (space chars, etc.) if variableValue is a string*/\r\n if (typeofVariableValue === 'string') {\r\n variableValue = encodeURI(variableValue as string);\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${variableValue}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleVariableValuesListResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableValuesList\r\n * @alias GetVehicleVariableValuesListResults\r\n */\r\nexport type GetVehicleVariableValuesListResults = {\r\n ElementName: string;\r\n Id: number;\r\n Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleVariableValuesList API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableValuesList\r\n * @alias GetVehicleVariableValuesListResponse\r\n */\r\nexport type GetVehicleVariableValuesListResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetWMIsForManufacturer\r\n * @category Actions\r\n * @description GetWMIsForManufacturer NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetWMIsForManufacturer](module-api_actions_GetWMIsForManufacturer.GetWMIsForManufacturer.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetWMIsForManufacturerResponse](#GetWMIsForManufacturerResponse)\r\n * > - Type: [GetWMIsForManufacturerResults](#GetWMIsForManufacturerResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetWMIsForManufacturer extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * Provides information on the World Manufacturer Identifier (WMI) for a specified `manufacturer`.\r\n * - Only WMIs registered in vPICList are displayed.\r\n * - `manufacturer` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetWMIsForManufacturer(\r\n manufacturer: string\r\n ): Promise {\r\n const action = 'GetWMIsForManufacturer';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetWMIsForManufacturerResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetWMIsForManufacturer\r\n * @alias GetWMIsForManufacturerResults\r\n */\r\nexport type GetWMIsForManufacturerResults = {\r\n Country: string;\r\n CreatedOn: string;\r\n DateAvailableToPublic: string;\r\n Id: number;\r\n Name: string;\r\n UpdatedOn: string;\r\n VehicleType: string;\r\n WMI: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetWMIsForManufacturer API Action.\r\n *\r\n * @memberof module:api/actions/GetWMIsForManufacturer\r\n * @alias GetWMIsForManufacturerResponse\r\n */\r\nexport type GetWMIsForManufacturerResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/NHTSA\r\n * @category API\r\n * @description Module exporting the main (NHSTA) class for API Actions.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [NHTSA](NHTSA.html#NHTSA) - Class that implements all NHTSA API Actions\r\n */\r\n\r\nimport { Fetch /* Class */, FetchConfig /* Type */ } from './Fetch';\r\n\r\n/* Import implemented API Action classes */\r\nimport {\r\n DecodeVin,\r\n DecodeVinExtended,\r\n DecodeVinValues,\r\n DecodeVINValuesBatch,\r\n DecodeVinValuesExtended,\r\n DecodeWMI,\r\n GetAllMakes,\r\n GetAllManufacturers,\r\n GetCanadianVehicleSpecifications,\r\n GetEquipmentPlantCodes,\r\n GetMakeForManufacturer,\r\n GetMakesForManufacturerAndYear,\r\n GetMakesForVehicleType,\r\n GetManufacturerDetails,\r\n GetModelsForMake,\r\n GetModelsForMakeId,\r\n GetModelsForMakeIdYear,\r\n GetModelsForMakeYear,\r\n GetParts,\r\n GetVehicleTypesForMake,\r\n GetVehicleTypesForMakeId,\r\n GetVehicleVariableList,\r\n GetVehicleVariableValuesList,\r\n GetWMIsForManufacturer,\r\n} from './actions';\r\n\r\n/**\r\n * @class NHTSA\r\n * @augments module:api/Fetch.Fetch\r\n * @category API\r\n *\r\n * @param {FetchConfig} [userConfig] - Configuration options to construct the class with.\r\n *\r\n * @implements {module:api/actions/DecodeVin.DecodeVin}\r\n * @implements {module:api/actions/DecodeVinExtended.DecodeVinExtended}\r\n * @implements {module:api/actions/DecodeVinValues.DecodeVinValues}\r\n * @implements {module:api/actions/DecodeVinValuesExtended.DecodeVinValuesExtended}\r\n * @implements {module:api/actions/DecodeWMI.DecodeWMI}\r\n * @implements {module:api/actions/GetAllMakes.GetAllMakes}\r\n * @implements {module:api/actions/GetAllManufacturers.GetAllManufacturers}\r\n * @implements {module:api/actions/GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications}\r\n * @implements {module:api/actions/GetEquipmentPlantCodes.GetEquipmentPlantCodes}\r\n * @implements {module:api/actions/GetMakeForManufacturer.GetMakeForManufacturer}\r\n * @implements {module:api/actions/GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear}\r\n * @implements {module:api/actions/GetMakesForVehicleType.GetMakesForVehicleType}\r\n * @implements {module:api/actions/GetManufacturerDetails.GetManufacturerDetails}\r\n * @implements {module:api/actions/GetModelsForMake.GetModelsForMake}\r\n * @implements {module:api/actions/GetModelsForMakeId.GetModelsForMakeId}\r\n * @implements {module:api/actions/GetModelsForMakeIdYear.GetModelsForMakeIdYear}\r\n * @implements {module:api/actions/GetModelsForMakeYear.GetModelsForMakeYear}\r\n * @implements {module:api/actions/GetParts.GetParts}\r\n * @implements {module:api/actions/GetVehicleTypesForMake.GetVehicleTypesForMake}\r\n * @implements {module:api/actions/GetVehicleTypesForMakeId.GetVehicleTypesForMakeId}\r\n * @implements {module:api/actions/GetVehicleVariableList.GetVehicleVariableList}\r\n * @implements {module:api/actions/GetVehicleVariableValuesList.GetVehicleVariableValuesList}\r\n * @implements {module:api/actions/GetWMIsForManufacturer.GetWMIsForManufacturer}\r\n *\r\n * @example Node bundle\r\n * const { NHTSA } = require('@shaggytools/nhtsa-api-wrapper');\r\n *\r\n * const Wrapper = new NHTSA();\r\n *\r\n * // Decode a VIN and return a response of type ApiResponse\r\n * const response = Wrapper.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\r\n *\r\n * // or get details about a specific manufacturer, plus 23 other available Actions.\r\n * const hondaDetails = Wrapper.GetManufacturerDetails('Honda').catch(error => error)\r\n *\r\n * @example Browser bundle\r\n * // Change to specific version number \"x.x.xx\",\r\n * // or remove completely for the most recently published version\r\n * /dist/bundle.min.js\"\r\n * >\r\n *\r\n * \r\n *\r\n * @example Module - Node lazy loading\r\n * const { NHTSA } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\r\n * .catch(err => err);\r\n *\r\n * const ApiClient = new NHTSA();\r\n *\r\n * const results = await ApiClient.DecodeVin('3VWD07AJ5EM388202')\r\n * .catch(err => err)\r\n *\r\n * @example Module - Browser lazy loading\r\n * \r\n */\r\nclass NHTSA\r\n extends Fetch\r\n implements\r\n DecodeVin,\r\n DecodeVinExtended,\r\n DecodeVinValues,\r\n DecodeVINValuesBatch,\r\n DecodeVinValuesExtended,\r\n DecodeWMI,\r\n GetAllMakes,\r\n GetAllManufacturers,\r\n GetCanadianVehicleSpecifications,\r\n GetEquipmentPlantCodes,\r\n GetMakeForManufacturer,\r\n GetMakesForManufacturerAndYear,\r\n GetMakesForVehicleType,\r\n GetManufacturerDetails,\r\n GetModelsForMake,\r\n GetModelsForMakeId,\r\n GetModelsForMakeIdYear,\r\n GetModelsForMakeYear,\r\n GetParts,\r\n GetVehicleTypesForMake,\r\n GetVehicleTypesForMakeId,\r\n GetVehicleVariableList,\r\n GetVehicleVariableValuesList,\r\n GetWMIsForManufacturer {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n DecodeVin = DecodeVin.prototype.DecodeVin;\r\n\r\n DecodeVinExtended = DecodeVinExtended.prototype.DecodeVinExtended;\r\n\r\n DecodeVinValues = DecodeVinValues.prototype.DecodeVinValues;\r\n\r\n DecodeVINValuesBatch = DecodeVINValuesBatch.prototype.DecodeVINValuesBatch;\r\n\r\n DecodeVinValuesExtended =\r\n DecodeVinValuesExtended.prototype.DecodeVinValuesExtended;\r\n\r\n DecodeWMI = DecodeWMI.prototype.DecodeWMI;\r\n\r\n GetAllMakes = GetAllMakes.prototype.GetAllMakes;\r\n\r\n GetAllManufacturers = GetAllManufacturers.prototype.GetAllManufacturers;\r\n\r\n GetCanadianVehicleSpecifications =\r\n GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications;\r\n\r\n GetEquipmentPlantCodes =\r\n GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes;\r\n\r\n GetMakeForManufacturer =\r\n GetMakeForManufacturer.prototype.GetMakeForManufacturer;\r\n\r\n GetMakesForManufacturerAndYear =\r\n GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear;\r\n\r\n GetMakesForVehicleType =\r\n GetMakesForVehicleType.prototype.GetMakesForVehicleType;\r\n\r\n GetManufacturerDetails =\r\n GetManufacturerDetails.prototype.GetManufacturerDetails;\r\n\r\n GetModelsForMake = GetModelsForMake.prototype.GetModelsForMake;\r\n\r\n GetModelsForMakeId = GetModelsForMakeId.prototype.GetModelsForMakeId;\r\n\r\n GetModelsForMakeIdYear =\r\n GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear;\r\n\r\n GetModelsForMakeYear = GetModelsForMakeYear.prototype.GetModelsForMakeYear;\r\n\r\n GetParts = GetParts.prototype.GetParts;\r\n\r\n GetVehicleTypesForMake =\r\n GetVehicleTypesForMake.prototype.GetVehicleTypesForMake;\r\n\r\n GetVehicleTypesForMakeId =\r\n GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId;\r\n\r\n GetVehicleVariableList =\r\n GetVehicleVariableList.prototype.GetVehicleVariableList;\r\n\r\n GetVehicleVariableValuesList =\r\n GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList;\r\n\r\n GetWMIsForManufacturer =\r\n GetWMIsForManufacturer.prototype.GetWMIsForManufacturer;\r\n}\r\n\r\nexport { NHTSA };\r\n","/**\n * @module api/Client\n * @category API\n * @description Module exporting an instance of the NHSTA class.\n *\n * > - For more information, see the documentation for the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n */\n\nimport { NHTSA } from './NHTSA';\n\n/**\n * A new instance of the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n *\n * @type {NHTSA}\n *\n * @example Node bundle\n * const { Client } = require('@shaggytools/nhtsa-api-wrapper');\n *\n * // Decode a VIN and return get a response of type ApiResponse\n * const response = Client.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\n *\n * // or get details about a specific manufacturer, plus 23 other available Actions.\n * const audiDetails = Client.GetManufacturerDetails('Audi').catch(error => error)\n *\n * @example Browser bundle\n * // Change to specific version number \"x.x.xx\",\n * // or remove completely for the most recently published version\n * /dist/bundle.min.js\"\n * >\n *\n * \n *\n * @example Module - Node lazy loading\n * const { Client } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\n * .catch(err => err);\n *\n * const results = await Client.DecodeVin('3VWD07AJ5EM388202')\n * .catch(err => err)\n *\n * @example Module - Browser lazy loading\n * \n *\n */\nconst Client: NHTSA = new NHTSA();\n\nexport { Client };\n"],"names":["getTypeof","value","toString","Object","prototype","call","toLowerCase","slice","length","TRANSLITERATION_TABLE","A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z","WEIGHTS_ARRAY","DEFAULT_CONFIG","apiResponseFormat","baseUrl","options","Fetch","[object Object]","userConfig","finalConfig","this","params","allowEmptyStringValues","format","Promise","reject","Error","entries","paramsLength","resolve","isPrepended","queryStringArray","map","key","index","prepend","append","typeofValue","encodeURI","join","makeQueryString","url","typeofUrl","typeofOptions","combinedOptions","response","fetch","then","result","status","statusText","headers","catch","err","NhtsaResponse","json","finalResult","FetchResponse","ok","redirected","DecodeVin","super","vin","action","typeofParams","typeofVin","typeofModelYear","modelYear","queryString","buildQueryString","get","DecodeVinExtended","DecodeVinValues","DecodeVINValuesBatch","inputString","typeofInputString","body","method","content-type","DecodeVinValuesExtended","DecodeWMI","WMI","typeofWMI","GetAllMakes","GetAllManufacturers","typeofManufacturerType","manufacturerType","typeofPage","page","GetCanadianVehicleSpecifications","typeofYear","year","typeofMake","make","typeofModel","model","typeofUnits","units","params_","GetEquipmentPlantCodes","typeofEquipmentType","equipmentType","typeofReportType","reportType","GetMakeForManufacturer","manufacturer","typeofManufacturer","GetMakesForManufacturerAndYear","GetMakesForVehicleType","typeName","typeofTypeName","GetManufacturerDetails","GetModelsForMake","makeName","typeofMakeName","GetModelsForMakeId","makeID","typeofMakeId","GetModelsForMakeIdYear","makeId","vehicleType","typeofVehicleType","actionUrl","GetModelsForMakeYear","GetParts","type","fromDate","toDate","typeofType","typeofFromDate","typeofToDate","GetVehicleTypesForMake","GetVehicleTypesForMakeId","GetVehicleVariableList","GetVehicleVariableValuesList","variableValue","typeofVariableValue","GetWMIsForManufacturer","NHTSA","Client","vinArray","toUpperCase","split","checkDigit","isNaN","parseInt","checkValue","digit","digitValue","reduce","acc","currValue"],"mappings":"2aAagBA,EAAUC,GACxB,MAAMC,EAAmBC,OAAOC,UAAUF,SACvCG,KAAKJ,GACLK,cACH,OAAOJ,EAASK,MAAM,EAAGL,EAASM,OAAS,GCL7C,MAAMC,EAAgD,CACpDC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,GASCC,EAA0B,CAC9B,EACA,EACA,EACA,EACA,EACA,EAC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AuBrH,UAAUqH,uBAEnC/E,4BACEoF,EAAuB1H,UAAU0H,uBAEnCpF,oCACEuF,EAA+B7H,UAAU6H,+BAE3CvF,4BACEwF,EAAuB9H,UAAU8H,uBAEnCxF,4BACE2F,EAAuBjI,UAAUiI,uBAEnC3F,sBAAmB4F,EAAiBlI,UAAUkI,iBAE9C5F,wBAAqB+F,EAAmBrI,UAAUqI,mBAElD/F,4BACEkG,EAAuBxI,UAAUwI,uBAEnClG,0BAAuBuG,EAAqB7I,UAAU6I,qBAEtDvG,cAAWwG,EAAS9I,UAAU8I,SAE9BxG,4BACE+G,EAAuBrJ,UAAUqJ,uBAEnC/G,8BACEgH,EAAyBtJ,UAAUsJ,yBAErChH,4BACEiH,EAAuBvJ,UAAUuJ,uBAEnCjH,kCACEkH,EAA6BxJ,UAAUwJ,6BAEzClH,4BACEqH,EAAuB3J,UAAU2J,8BCvJ/BE,EAAgB,IAAID,iqB5ByBC5E,GAEzB,GAAmB,iBAARA,GAAkC,IAAdA,EAAI5E,OACjC,OAAO,EAOT,MAAM0J,GAHN9E,EAAMA,EAAI+E,eAGqBC,MAAM,IAG/BC,EAAqBH,EAAS,GAMpC,GAAII,MAAMC,SAASF,KAA+B,MAAfA,EACjC,OAAO,EAQT,MAAMG,EAAoC,MAAfH,EAAqB,GAAKE,SAASF,GAiC9D,OAtBEH,EACG5G,IAAI,CAACmH,EAAejH,KACnB,IAAIkH,EAGCA,EADLJ,MAAMC,SAASE,IACGhK,EAAsBgK,GACtBF,SAASE,GAM3B,OAAOC,EAHgBzI,EAAcuB,KAMtCmH,OAAO,CAACC,EAAKC,IAAcD,EAAMC,EAAW,GAAK,KAOlCL"} \ No newline at end of file +{"version":3,"file":"iife.js","sources":["../../src/utils/getTypeof.ts","../../src/utils/isValidVin.ts","../../src/api/Fetch.ts","../../src/utils/makeQueryString.ts","../../src/api/actions/DecodeVin.ts","../../src/api/actions/DecodeVinExtended.ts","../../src/api/actions/DecodeVinValues.ts","../../src/api/actions/DecodeVINValuesBatch.ts","../../src/api/actions/DecodeVinValuesExtended.ts","../../src/api/actions/DecodeWMI.ts","../../src/api/actions/GetAllMakes.ts","../../src/api/actions/GetAllManufacturers.ts","../../src/api/actions/GetCanadianVehicleSpecifications.ts","../../src/api/actions/GetEquipmentPlantCodes.ts","../../src/api/actions/GetMakeForManufacturer.ts","../../src/api/actions/GetMakesForManufacturerAndYear.ts","../../src/api/actions/GetMakesForVehicleType.ts","../../src/api/actions/GetManufacturerDetails.ts","../../src/api/actions/GetModelsForMake.ts","../../src/api/actions/GetModelsForMakeId.ts","../../src/api/actions/GetModelsForMakeIdYear.ts","../../src/api/actions/GetModelsForMakeYear.ts","../../src/api/actions/GetParts.ts","../../src/api/actions/GetVehicleTypesForMake.ts","../../src/api/actions/GetVehicleTypesForMakeId.ts","../../src/api/actions/GetVehicleVariableList.ts","../../src/api/actions/GetVehicleVariableValuesList.ts","../../src/api/actions/GetWMIsForManufacturer.ts","../../src/api/NHTSA.ts","../../src/api/Client.ts"],"sourcesContent":["/**\n * @module utils/getTypeof\n * @category Utils\n */\n\n/**\n * Gets type of `value` using `Object.prototype.toString.call(value)`.\n *\n * @param {any} value - Any kind of value (string, object, array, function, etc).\n *\n * @returns {string} - Type of value, normalized to a lowercase string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTypeof(value: any): string {\n const toString: string = Object.prototype.toString\n .call(value)\n .toLowerCase(); /* ex: => '[object string]' or '[object array], etc. */\n return toString.slice(8, toString.length - 1);\n}\n","/**\n * @module utils/isValidVin\n * @category Utils\n */\n\n/*\n * There will need to be some way to translate vin digits that are alphabetic\n * into their number value in the VIN algorithm transliteration table.\n * Later, during the creation of the checksum variable, those digits will be\n * multiplied against their corresponding weight (by index) in the WEIGHTS_ARRAY.\n * This transliteration table is a key part of the VIN validation algorithm.\n */\nconst TRANSLITERATION_TABLE: Record = {\n A: 1,\n B: 2,\n C: 3,\n D: 4,\n E: 5,\n F: 6,\n G: 7,\n H: 8,\n J: 1,\n K: 2,\n L: 3,\n M: 4,\n N: 5,\n P: 7,\n R: 9,\n S: 2,\n T: 3,\n U: 4,\n V: 5,\n W: 6,\n X: 7,\n Y: 8,\n Z: 9,\n};\n\n/*\n * Later, during the creation of the 'checksum' variable, these weights will be\n * multiplied by the value of their mirrored index vin digits.\n * The array index of each weight corresponds to the same index of each\n * digit in the 'vin'.\n */\nconst WEIGHTS_ARRAY: number[] = [\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n 10,\n 0,\n 9,\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n];\n\n/**\n * Provides **offline** validation of Vehicle Identification Numbers (VINs) using the\n * [VIN Check Algorithm](https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit).\n *\n * @param {string} vin - Vehicle Identification Number.\n * @returns {boolean} True for a valid VIN, false for an invalid VIN.\n *\n * @example When loaded from the browser via html script tags\n * // \n * const isValid = NHTSA.isValidVin('3VWD07AJ5EM388202')\n * console.log(isValid) // true\n *\n * @example When loaded as a module\n * import { isValidVin } from '@shaggytools/nhtsa-api-wrapper'\n * const isValid = isValidVin('3VWD07AJ5EM388202')\n * console.log(isValid) // true\n *\n */\nexport function isValidVin(vin: string): boolean {\n /* A valid VIN must be a string and is always exactly 17 digits */\n if (typeof vin !== 'string' || vin.length != 17) {\n return false;\n }\n\n /* Normalize the vin to all uppercase letters */\n vin = vin.toUpperCase();\n\n /* split the vin digits into an array */\n const vinArray: string[] = vin.split('');\n\n /* checkDigit will be tested against the checkSum later */\n const checkDigit: string = vinArray[8];\n\n /*\n * In a valid VIN, the checkDigit can either be:\n * a number, 0-9 inclusive OR the character 'X'\n */\n if (isNaN(parseInt(checkDigit)) && checkDigit !== 'X') {\n return false;\n }\n\n /*\n * The checkValue must be a digit and 'X' is the only valid alphabetic check value.\n * As per the algorithm, a checkDigit of 'X' is equal to a checkValue of `10` and needs\n * to be converted as such.\n */\n const checkValue: number = checkDigit === 'X' ? 10 : parseInt(checkDigit);\n\n /*\n * Maps the vinArray and converts any values (digits) that are alphabetic,\n * into numbers, using the TRANSLITERATION_TABLE.\n * Then these numbers are multiplied against their corresponding weight\n * in the WEIGHTS_ARRAY, matched by index position.\n * All 17 of those digitValues are then added together and divided by 11.\n * The remainder, or % modulo, of that division will be the final 'checksum'.\n */\n const checksum: number =\n vinArray\n .map((digit: string, index: number) => {\n let digitValue: number;\n /* Use the transliteration table to convert any Not a Number(NaN) values to numbers */\n isNaN(parseInt(digit))\n ? (digitValue = TRANSLITERATION_TABLE[digit])\n : (digitValue = parseInt(digit));\n\n /* Convert the digitValue to a weighted number corresponding to it's position, by index, in the weightsArray. */\n const weight: number = WEIGHTS_ARRAY[index];\n\n /* The final step for each digit is to multiply the digit by it's corresponding weight */\n return digitValue * weight;\n })\n /* Finally, get the sum of all digits and divide by 11, the remainder of that operation is the checksum */\n .reduce((acc, currValue) => acc + currValue, 0) % 11;\n\n /*\n * The checksum is compared against the checkValue we set earlier (the 9th digit of the VIN)\n * As per the algorithm, if they are equal to each other, then the VIN must be valid and\n * we return true, otherwise the VIN is invalid and we return false.\n */\n return checksum === checkValue;\n}\n","/**\n * @module api/Fetch\n * @category API\n * @description API Fetch Logic.\n *\n * > **Module Exports**:\n * > - Class: [Fetch](module-api_Fetch.Fetch.html)\n * > - Constant: [BASE_URL](#~BASE_URL)\n * > - Constant: [DEFAULT_CONFIG](#~DEFAULT_CONFIG)\n * >\n * > **Types**\n * > - Type: [ApiResponse](#ApiResponse)\n * > - Type: [FetchConfig](#FetchConfig)\n * > - Type: [FetchRequestOptions](#FetchRequestOptions)\n * > - Type: [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body)\n * > - Type: [FetchResponse](#FetchResponse)\n * > - Type: [NhtsaResponse](#NhtsaResponse)\n */\n\n/* Module Dependencies */\nimport fetch from 'cross-fetch';\n/* Utilities */\nimport { getTypeof, makeQueryString } from '../utils';\n/* Types */\nimport { QueryStringParameters } from '../utils/types';\n\n/*****************\n * CONSTANTS\n ****************/\n\n/**\n * @constant {string} BASE_URL Default Fetch base URL string\n * @default 'https://vpic.nhtsa.dot.gov/api/vehicles'\n */\nexport const BASE_URL = 'https://vpic.nhtsa.dot.gov/api/vehicles';\n\n/**\n * @constant {module:api/Fetch.FetchConfig} DEFAULT_CONFIG Default Fetch configuration options\n * @property {string} apiResponseFormat=json\n * @property {string} baseUrl=BASE_URL Default: [BASE_URL](module-api_Fetch.html#~BASE_URL)\n * @property {FetchRequestOptions} options={method:\"GET\"}\n */\nexport const DEFAULT_CONFIG: FetchConfig = {\n apiResponseFormat: 'json',\n baseUrl: BASE_URL,\n options: {},\n};\n\n/*****************\n * Fetch Class\n ****************/\n\n/**\n * Class wrapper containing API wrapper HTTP Fetch logic.\n *\n * > **Static Methods**:\n * > - [buildQueryString](#buildQueryString)\n * > - [get](#get)\n *\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n * @category API\n */\nexport class Fetch {\n apiResponseFormat: string;\n baseUrl?: string;\n options?: FetchRequestOptions;\n\n constructor(userConfig?: FetchConfig) {\n let finalConfig: FetchConfig;\n\n /* userConfig takes precedence over DEFAULT_CONFIG */\n if (userConfig && getTypeof(userConfig) === 'object') {\n finalConfig = {\n ...DEFAULT_CONFIG,\n ...userConfig,\n options: { ...DEFAULT_CONFIG.options, ...userConfig.options },\n };\n } else {\n finalConfig = { ...DEFAULT_CONFIG };\n }\n\n /** @private */\n this.apiResponseFormat = 'json';\n /** @private */\n this.baseUrl = finalConfig.baseUrl;\n /** @private */\n this.options = finalConfig.options;\n }\n\n /**\n * Builds a query string from QueryStringParameters.\n *\n * @param {QueryStringParameters} params - Object containing Key:Value pairs to build the URL query string with.\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\n * - Given params of `{paramName: \"\"}` , setting this to true will use 'paramName=' in the final query string.\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\n * @returns {(Promise)} A formatted NHSTA.dot.gov Vehicles API query string.\n */\n async buildQueryString(\n params?: QueryStringParameters,\n allowEmptyStringValues = false\n ): Promise {\n /*\n * Make sure we're always using 'format=json' in the url Query parameters\n * If the user provides a 'format' key in the params, during class instantiation we want to override it to 'json'\n * This package may provide support for the other formats (CSV and XML) if requested.\n */\n if (!params || getTypeof(params) !== 'object') {\n params = {\n format: this.apiResponseFormat,\n };\n } else {\n params = { ...params, format: this.apiResponseFormat };\n }\n\n /* Return the completed query string */\n return await makeQueryString(params, allowEmptyStringValues);\n }\n\n /**\n * Uses the `cross-fetch` npm package to send HTTP requests and retrieve data from an API.\n * - In browser environments, [whatwg-fetch](https://github.com/github/fetch/) window.fetch is used.\n * - In node environments, [node-fetch](https://github.com/bitinn/node-fetch/) NPM package is used.\n *\n * @param {string} url - URL to fetch data from.\n * @param {FetchRequestOptions} [options] - [Fetch options](https://github.github.io/fetch/#options).\n * @returns {(Promise)} Response from the API.\n */\n async get(\n url: string,\n options: FetchRequestOptions = {}\n ): Promise {\n /* Runtime typechecking */\n const typeofUrl = getTypeof(url);\n if (typeofUrl !== 'string') {\n return Promise.reject(\n new Error(\n `Fetch.get(url) - url argument must be of type string, got: ${typeofUrl}`\n )\n );\n }\n const typeofOptions = getTypeof(options);\n if (typeofOptions !== 'object') {\n return Promise.reject(\n new Error(\n `Fetch.get(url, options) - options argument must be of type object, got: ${typeofOptions}`\n )\n );\n }\n\n /* Combine user provided 'options' and class property 'this.options', user options overwrite class options */\n const combinedOptions = { ...this.options, ...options };\n\n /* Use the cross-fetch package to perform an HTTP request */\n const response: Response = await fetch(url, combinedOptions)\n .then((result) => {\n if (!result?.status || result.status >= 400) {\n throw new Error(\n `Bad response from server, code: ${result?.status}, text: ${result?.statusText}, headers: ${result?.headers}`\n );\n } else return result;\n })\n .catch((err) =>\n Promise.reject(new Error(`Fetch.get() http error: ${err}`))\n );\n\n /* Convert the NHTSA API data to JSON */\n const NhtsaResponse: NhtsaResponse = await response\n .json()\n .then((json: NhtsaResponse): NhtsaResponse => json);\n\n /* Add the fetch response information to the returned NHSTA API data */\n const finalResult: ApiResponse = {\n ...NhtsaResponse,\n FetchResponse: {\n headers: response.headers,\n ok: response.ok,\n redirected: response.redirected,\n status: response.status,\n statusText: response.statusText,\n url: response.url,\n },\n };\n\n /* Return the completed ApiResponse */\n return Promise.resolve(finalResult);\n }\n}\n\n/*****************\n * Types\n ****************/\n\n/**\n * Various fetch request body types.\n *\n * @typedef FetchRequestBodyTypes\n * @type {URLSearchParams | FormData | Blob | ArrayBuffer | DataView}\n *\n * @memberof module:api/Fetch\n */\nexport type FetchRequestBodyTypes =\n | URLSearchParams\n | FormData\n | Blob\n | ArrayBuffer\n | DataView;\n\n/**\n * Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}.\n *\n * @memberof module:api/Fetch\n * @alias FetchRequestOptions\n */\nexport type FetchRequestOptions = {\n /**HTTP request method - Default: \"GET\". */\n method?: string;\n /** HTTP request body - [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body). */\n body?: string | FetchRequestBodyTypes;\n /** [Object, Headers](https://github.github.io/fetch/#Headers) - Default: {}. */\n headers?: Record | Headers;\n /**\n * Default: \"omit\" - Authentication credentials mode.\n * - \"omit\" - don't include authentication credentials (e.g. Cookies) in the request.\n * - \"same-origin\" - include credentials in requests to the same site\n * - \"include\" - include credentials in requests to all sites.\n */\n credentials?: 'omit' | 'same-origin' | 'include';\n};\n\n/**\n * Used when instantiating a Fetch class or related subclass.\n *\n * @memberof module:api/Fetch\n * @alias FetchConfig\n */\nexport type FetchConfig = {\n /** Requested response format from the NHSTA API (hardcoded to 'json' for now). */\n apiResponseFormat?: string;\n /** Base of the URL to build fetch URLs from. */\n baseUrl?: string;\n /** Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}. */\n options?: FetchRequestOptions;\n};\n\n/**\n * [Fetch API Response](https://github.github.io/fetch/#Response) properties.\n *\n * @memberof module:api/Fetch\n * @alias FetchResponse\n */\nexport type FetchResponse = {\n /** The [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object associated with the response. */\n headers: Headers;\n /** A boolean indicating whether the response was successful (status in the range 200–299) or not. */\n ok: boolean;\n /** Indicates whether or not the response is the result of a redirect (that is, its URL list has more than one entry). */\n redirected: boolean;\n /** The status code of the response. (This will be 200 for a success). */\n status: number;\n /** The status message corresponding to the status code. (e.g., OK for 200). */\n statusText: string;\n /** The URL of the response. */\n url: string;\n};\n\n/**\n * Response data returned from the NHSTA API.\n *\n * @memberof module:api/Fetch\n * @alias NhtsaResponse\n */\nexport type NhtsaResponse = {\n /** The number of items returned in the Results object. */\n Count: number;\n /** A message describing the Results. */\n Message: string;\n /** Search terms (VIN, WMI, etc) used in the request URL. */\n SearchCriteria: string;\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\n Results: Array;\n};\n\n/**\n * Complete response returned by {@link module:api/Fetch.Fetch#get}.\n *\n * @see {@link module:api/Fetch.NhtsaResponse}\n * @see {@link module:api/Fetch.FetchResponse}\n * @memberof module:api/Fetch\n * @alias ApiResponse\n */\nexport type ApiResponse = {\n /** The number of items returned in the Results object. */\n Count: number;\n /** A message describing the Results. */\n Message: string;\n /** Search terms (VIN, WMI, etc) used in the request URL. */\n SearchCriteria: string;\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) Properties. */\n FetchResponse: FetchResponse;\n};\n","import { getTypeof } from './getTypeof';\n\n/**\n * @module utils/makeQueryString\n * @category Utils\n */\n\n/**\n * Utility method to generate a query string compatible with the NHSTA API, for use in an API URL string.\n *\n * @async\n *\n * @param {object} params - Object of Type [QueryStringParameters](module-utils_makeQueryString.html#.QueryStringParameters).\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\n * - Given params of `{ paramName: \"\" }` , setting this to true will use 'paramName=' in the final query string.\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\n *\n * @returns {Promise} A query string of search parameters for use in a final Fetch.get URL.\n *\n * @example When loaded from the browser via html script tags\n * // \n * const qs = await NHTSA.makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example When loaded as a module\n * import { makeQueryString } from '@shaggytools/nhtsa-api-wrapper'\n * const qs = await makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example Single Param:\n * const qs = await makeQueryString({\n * modelYear: 2019\n * }).catch(error => error)\n * console.log(qs) // \"?modelYear=2019\"\n *\n * @example Multiple Params:\n * const qs = await makeQueryString({\n * whatever: 'some value',\n * modelYear: 2006,\n * page: \"2\"\n * }).catch(error => error)\n *\n * console.log(qs) // \"?whatever=some%20value&modelYear=2006&page=2\"\n *\n * @example Empty Params Object:\n * const qs = await makeQueryString({}).catch(error => error)\n *\n * console.log(qs) // \"\"\n *\n * @example Using allowEmptyStringValues option:\n * const qs = await makeQueryString({\n * year: 2016,\n * vehicleType: '',\n * make: 'Audi'\n * }, true).catch(error => error)\n *\n * console.log(qs) // \"?year=2016&vehicleType=&make=Audi\"\n *\n */\nexport function makeQueryString(\n params: QueryStringParameters = {},\n allowEmptyStringValues = false\n): Promise {\n /* Beginning of error message string */\n const errorBase =\n 'queryString(params) - expected params in the form of an object, got:';\n\n /* Runtime type guard params argument, must be of type object */\n if (getTypeof(params) !== 'object') {\n return Promise.reject(new Error(`${errorBase} ${params}`));\n }\n\n /* Setup QueryString for Array mapping */\n const entries = Object.entries(params);\n const paramsLength = entries.length;\n\n /* Return an empty string if params are an empty object */\n if (paramsLength < 1) return Promise.resolve('');\n\n /* Used to check if we've already prepended a valid query param */\n let isPrepended = false;\n\n /* Map [key]:value entries to \"key=value\" strings in an array */\n const queryStringArray = entries.map(([key, value], index) => {\n let prepend = '';\n let append = '';\n\n const typeofValue = getTypeof(value);\n\n /* Convert any number values to a string */\n if (value && typeofValue === 'number') {\n value = value.toString();\n }\n\n /* Skip any invalid values, only string and number value types are valid */\n if (\n (value || allowEmptyStringValues) &&\n (typeofValue === 'string' || typeofValue === 'number')\n ) {\n /* if this is the first param we need to prepend the '?' char */\n if (!isPrepended) {\n prepend = '?';\n isPrepended = true;\n }\n /* if there is another param coming after this one we need to append the '&' char */\n if (index < paramsLength - 1) {\n append = '&';\n }\n\n /* Add the completed partial query string to queryStringArray */\n return `${prepend}${key}=${value}${append}`;\n }\n return;\n });\n\n /* Join and return the completed query string after URI encoding */\n return Promise.resolve(encodeURI(queryStringArray.join('')));\n}\n\n/**\n * Object containing Key:Value pairs to build the URL query string with.\n * - Parameter values may be either strings or numbers.\n *\n * @memberof module:utils/makeQueryString\n * @alias QueryStringParameters\n * @example\n * {\n * modelYear: 2009,\n * whatever: 'something'\n * }\n *\n */\nexport type QueryStringParameters = {\n [propName: string]: string | number | undefined;\n};\n","/**\n * @module api/actions/DecodeVin\n * @category Actions\n * @description DecodeVin NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVin](module-api_actions_DecodeVin.DecodeVin.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinResponse](#DecodeVinResponse)\n * > - Type: [DecodeVinResults](#DecodeVinResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVin extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * The DecodeVin API Action will decode the VIN and the decoded output will be made available in the format of Key-value pairs.\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This API also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n * - The 9th digit is not necessary.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {number} [params.modelYear] - Optional Model Year search parameter.\n * @returns {(Promise)} - Api Response object.\n */\n async DecodeVin(\n vin: string,\n params?: {\n modelYear?: number;\n }\n ): Promise {\n const action = 'DecodeVin';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (params?.modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVin\n * @alias DecodeVinResults\n */\nexport type DecodeVinResults = {\n Value: string | null;\n ValueId: string | null;\n Variable: string;\n VariableId: number;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVin API Action.\n *\n * @memberof module:api/actions/DecodeVin\n * @alias DecodeVinResponse\n */\nexport type DecodeVinResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/DecodeVinExtended\n * @category Actions\n * @description DecodeVinExtended NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVinExtended](module-api_actions_DecodeVinExtended.DecodeVinExtended.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinExtendedResponse](#DecodeVinExtendedResponse)\n * > - Type: [DecodeVinExtendedResults](#DecodeVinExtendedResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVinExtended extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This is exactly like the DecodeVin method but provides additional information on variables\n * related to other NHTSA programs like\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\n * - This will decode the VIN and the decoded output will be made available\n * in the format of Key-value pairs.\n * - In the returned 'Results` object:\n * - The IDs (VariableID and ValueID) represent the unique ID associated with the Variable/Value.\n * - In case of text variables, the ValueID is not applicable.\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n * - The 9th digit is not necessary.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\n * @returns {(Promise)} - Api Response object.\n */\n async DecodeVinExtended(\n vin: string,\n params?: {\n modelYear?: string | number;\n }\n ): Promise {\n const action = 'DecodeVinExtended';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (params?.modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinExtendedResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVinExtended\n * @alias DecodeVinExtendedResults\n */\nexport type DecodeVinExtendedResults = {\n Value: string | null;\n ValueId: string | null;\n Variable: string;\n VariableId: number;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVinExtended API Action.\n *\n * @memberof module:api/actions/DecodeVinExtended\n * @alias DecodeVinExtendedResponse\n */\nexport type DecodeVinExtendedResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/DecodeVinValues\n * @category Actions\n * @description DecodeVinValues NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVinValues](module-api_actions_DecodeVinValues.DecodeVinValues.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinValuesResponse](#DecodeVinValuesResponse)\n * > - Type: [DecodeVinValuesResults](#DecodeVinValuesResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVinValues extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * The DecodeVinValues API Action will decode the VIN with the Results returned in a _flat file_ format.\n * - The Results will be made available in a flat file format of a single object containing\n * 'key: value' results.\n * - Providing params.modelYear allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\n * @returns {(Promise)} Api Response object.\n */\n async DecodeVinValues(\n vin: string,\n params?: {\n modelYear?: number;\n }\n ): Promise {\n const action = 'DecodeVinValues';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (\n params?.modelYear &&\n typeofModelYear !== 'string' &&\n typeofModelYear !== 'number'\n ) {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinValuesResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVinValues\n * @alias DecodeVinValuesResults\n */\nexport type DecodeVinValuesResults = {\n /** Flat file format, single object containing keys and values of type string */\n ABS: string;\n ActiveSafetySysNote: string;\n AdaptiveCruiseControl: string;\n AdaptiveDrivingBeam: string;\n AdaptiveHeadlights: string;\n AdditionalErrorText: string;\n AirBagLocCurtain: string;\n AirBagLocFront: string;\n AirBagLocKnee: string;\n AirBagLocSeatCushion: string;\n AirBagLocSide: string;\n AutoReverseSystem: string;\n AutomaticPedestrianAlertingSound: string;\n AxleConfiguration: string;\n Axles: string;\n BasePrice: string;\n BatteryA: string;\n BatteryA_to: string;\n BatteryCells: string;\n BatteryInfo: string;\n BatteryKWh: string;\n BatteryKWh_to: string;\n BatteryModules: string;\n BatteryPacks: string;\n BatteryType: string;\n BatteryV: string;\n BatteryV_to: string;\n BedLengthIN: string;\n BedType: string;\n BlindSpotMon: string;\n BodyCabType: string;\n BodyClass: string;\n BrakeSystemDesc: string;\n BrakeSystemType: string;\n BusFloorConfigType: string;\n BusLength: string;\n BusType: string;\n CAN_AACN: string;\n CIB: string;\n CashForClunkers: string;\n ChargerLevel: string;\n ChargerPowerKW: string;\n CoolingType: string;\n CurbWeightLB: string;\n CustomMotorcycleType: string;\n DaytimeRunningLight: string;\n DestinationMarket: string;\n DisplacementCC: string;\n DisplacementCI: string;\n DisplacementL: string;\n Doors: string;\n DriveType: string;\n DriverAssist: string;\n DynamicBrakeSupport: string;\n EDR: string;\n ESC: string;\n EVDriveUnit: string;\n ElectrificationLevel: string;\n EngineConfiguration: string;\n EngineCycles: string;\n EngineCylinders: string;\n EngineHP: string;\n EngineHP_to: string;\n EngineKW: string;\n EngineManufacturer: string;\n EngineModel: string;\n EntertainmentSystem: string;\n ErrorCode: string;\n ErrorText: string;\n ForwardCollisionWarning: string;\n FuelInjectionType: string;\n FuelTypePrimary: string;\n FuelTypeSecondary: string;\n GCWR: string;\n GCWR_to: string;\n GVWR: string;\n GVWR_to: string;\n KeylessIgnition: string;\n LaneDepartureWarning: string;\n LaneKeepSystem: string;\n LowerBeamHeadlampLightSource: string;\n Make: string;\n Manufacturer: string;\n ManufacturerId: string;\n Model: string;\n ModelYear: string;\n MotorcycleChassisType: string;\n MotorcycleSuspensionType: string;\n NCSABodyType: string;\n NCSAMake: string;\n NCSAMapExcApprovedBy: string;\n NCSAMapExcApprovedOn: string;\n NCSAMappingException: string;\n NCSAModel: string;\n NCSANote: string;\n Note: string;\n OtherBusInfo: string;\n OtherEngineInfo: string;\n OtherMotorcycleInfo: string;\n OtherRestraintSystemInfo: string;\n OtherTrailerInfo: string;\n ParkAssist: string;\n PedestrianAutomaticEmergencyBraking: string;\n PlantCity: string;\n PlantCompanyName: string;\n PlantCountry: string;\n PlantState: string;\n PossibleValues: string;\n Pretensioner: string;\n RearCrossTrafficAlert: string;\n RearVisibilitySystem: string;\n SAEAutomationLevel: string;\n SAEAutomationLevel_to: string;\n SeatBeltsAll: string;\n SeatRows: string;\n Seats: string;\n SemiautomaticHeadlampBeamSwitching: string;\n Series: string;\n Series2: string;\n SteeringLocation: string;\n SuggestedVIN: string;\n TPMS: string;\n TopSpeedMPH: string;\n TrackWidth: string;\n TractionControl: string;\n TrailerBodyType: string;\n TrailerLength: string;\n TrailerType: string;\n TransmissionSpeeds: string;\n TransmissionStyle: string;\n Trim: string;\n Trim2: string;\n Turbo: string;\n VIN: string;\n ValveTrainDesign: string;\n VehicleType: string;\n WheelBaseLong: string;\n WheelBaseShort: string;\n WheelBaseType: string;\n WheelSizeFront: string;\n WheelSizeRear: string;\n Wheels: string;\n Windows: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVinValues API Action.\n *\n * @memberof module:api/actions/DecodeVinValues\n * @alias DecodeVinValuesResponse\n */\nexport type DecodeVinValuesResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /**\n * The search results returned by the NHSTA API request.\n * Flat file format, single object containing keys and values of type string\n * */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/DecodeVINValuesBatch\n * @category Actions\n * @description DecodeVINValuesBatch NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVINValuesBatch](module-api_actions_DecodeVINValuesBatch.DecodeVINValuesBatch.html)\n * >\n * > **Types**\n * > - Type: [DecodeVINValuesBatchResponse](#DecodeVINValuesBatchResponse)\n * > - Type: [DecodeVINValuesBatchResults](#DecodeVINValuesBatchResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVINValuesBatch extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This decodes a batch of VINs that are submitted in a standardized format in a string\n * and returns multiple decodes in a flat format.\n *\n * The `inputString` parameter should be in the following format:\n * - `vin , modelYear ; vin , modelYear ; vin , modelYear ...`\n *\n * \"modelYear\" is optional, the output for each VIN decode is in the same format as produced by the \"Decode VIN (flat format)\" method.\n *\n * @async\n * @param {string} inputString - A string of Vehicle Identification Numbers (full or partial) following the format listed in the description.\n * @returns {(Promise)} - Api Response object.\n */\n async DecodeVINValuesBatch(\n inputString: string\n ): Promise {\n const action = 'DecodeVINValuesBatch';\n\n /* Runtime typechecking */\n const typeofInputString = getTypeof(inputString);\n if (typeofInputString !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"inputString\" argument is required and must be of type string, got: ` +\n `<${typeofInputString}> ${inputString}`\n )\n );\n }\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/`;\n\n const body = encodeURI(`DATA=${inputString}&format=json`);\n\n /* Return the result */\n return await this.get(url, {\n method: 'POST',\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\n body,\n })\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVINValuesBatchResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVINValuesBatch\n * @alias DecodeVINValuesBatchResults\n */\nexport type DecodeVINValuesBatchResults = {\n ABS: string;\n ActiveSafetySysNote: string;\n AdaptiveCruiseControl: string;\n AdaptiveDrivingBeam: string;\n AdaptiveHeadlights: string;\n AdditionalErrorText: string;\n AirBagLocCurtain: string;\n AirBagLocFront: string;\n AirBagLocKnee: string;\n AirBagLocSeatCushion: string;\n AirBagLocSide: string;\n AutoReverseSystem: string;\n AutomaticPedestrianAlertingSound: string;\n AxleConfiguration: string;\n Axles: string;\n BasePrice: string;\n BatteryA: string;\n BatteryA_to: string;\n BatteryCells: string;\n BatteryInfo: string;\n BatteryKWh: string;\n BatteryKWh_to: string;\n BatteryModules: string;\n BatteryPacks: string;\n BatteryType: string;\n BatteryV: string;\n BatteryV_to: string;\n BedLengthIN: string;\n BedType: string;\n BlindSpotMon: string;\n BodyCabType: string;\n BodyClass: string;\n BrakeSystemDesc: string;\n BrakeSystemType: string;\n BusFloorConfigType: string;\n BusLength: string;\n BusType: string;\n CAN_AACN: string;\n CIB: string;\n CashForClunkers: string;\n ChargerLevel: string;\n ChargerPowerKW: string;\n CoolingType: string;\n CurbWeightLB: string;\n CustomMotorcycleType: string;\n DaytimeRunningLight: string;\n DestinationMarket: string;\n DisplacementCC: string;\n DisplacementCI: string;\n DisplacementL: string;\n Doors: string;\n DriveType: string;\n DriverAssist: string;\n DynamicBrakeSupport: string;\n EDR: string;\n ESC: string;\n EVDriveUnit: string;\n ElectrificationLevel: string;\n EngineConfiguration: string;\n EngineCycles: string;\n EngineCylinders: string;\n EngineHP: string;\n EngineHP_to: string;\n EngineKW: string;\n EngineManufacturer: string;\n EngineModel: string;\n EntertainmentSystem: string;\n ErrorCode: string;\n ErrorText: string;\n ForwardCollisionWarning: string;\n FuelInjectionType: string;\n FuelTypePrimary: string;\n FuelTypeSecondary: string;\n GCWR: string;\n GCWR_to: string;\n GVWR: string;\n GVWR_to: string;\n KeylessIgnition: string;\n LaneDepartureWarning: string;\n LaneKeepSystem: string;\n LowerBeamHeadlampLightSource: string;\n Make: string;\n Manufacturer: string;\n ManufacturerId: string;\n Model: string;\n ModelYear: string;\n MotorcycleChassisType: string;\n MotorcycleSuspensionType: string;\n NCSABodyType: string;\n NCSAMake: string;\n NCSAMapExcApprovedBy: string;\n NCSAMapExcApprovedOn: string;\n NCSAMappingException: string;\n NCSAModel: string;\n NCSANote: string;\n Note: string;\n OtherBusInfo: string;\n OtherEngineInfo: string;\n OtherMotorcycleInfo: string;\n OtherRestraintSystemInfo: string;\n OtherTrailerInfo: string;\n ParkAssist: string;\n PedestrianAutomaticEmergencyBraking: string;\n PlantCity: string;\n PlantCompanyName: string;\n PlantCountry: string;\n PlantState: string;\n PossibleValues: string;\n Pretensioner: string;\n RearCrossTrafficAlert: string;\n RearVisibilitySystem: string;\n SAEAutomationLevel: string;\n SAEAutomationLevel_to: string;\n SeatBeltsAll: string;\n SeatRows: string;\n Seats: string;\n SemiautomaticHeadlampBeamSwitching: string;\n Series: string;\n Series2: string;\n SteeringLocation: string;\n SuggestedVIN: string;\n TPMS: string;\n TopSpeedMPH: string;\n TrackWidth: string;\n TractionControl: string;\n TrailerBodyType: string;\n TrailerLength: string;\n TrailerType: string;\n TransmissionSpeeds: string;\n TransmissionStyle: string;\n Trim: string;\n Trim2: string;\n Turbo: string;\n VIN: string;\n ValveTrainDesign: string;\n VehicleType: string;\n WheelBaseLong: string;\n WheelBaseShort: string;\n WheelBaseType: string;\n WheelSizeFront: string;\n WheelSizeRear: string;\n Wheels: string;\n Windows: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVINValuesBatch API Action.\n *\n * @memberof module:api/actions/DecodeVINValuesBatch\n * @alias DecodeVINValuesBatchResponse\n */\nexport type DecodeVINValuesBatchResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/DecodeVinValuesExtended\n * @category Actions\n * @description DecodeVinValuesExtended NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVinValuesExtended](module-api_actions_DecodeVinValuesExtended.DecodeVinValuesExtended.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinValuesExtendedResponse](#DecodeVinValuesExtendedResponse)\n * > - Type: [DecodeVinValuesExtendedResults](#DecodeVinValuesExtendedResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVinValuesExtended extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This is exactly like the DecodeVinValues (flat format Results) method but provides additional information\n * on variables related to other NHTSA programs like\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\n * - The Results will be made available in a flat file format of a single object containing\n * 'key: value' results.\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\n * @reje\n * @returns {(Promise)} Api Response object.\n */\n async DecodeVinValuesExtended(\n vin: string,\n params?: {\n modelYear?: string | number;\n }\n ): Promise {\n const action = 'DecodeVinValuesExtended';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (params?.modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinValuesExtendedResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVinValuesExtended\n * @alias DecodeVinValuesExtendedResults\n */\nexport type DecodeVinValuesExtendedResults = {\n /** Flat file format, single object containing keys and values of type string */\n ABS: string;\n ActiveSafetySysNote: string;\n AdaptiveCruiseControl: string;\n AdaptiveDrivingBeam: string;\n AdaptiveHeadlights: string;\n AdditionalErrorText: string;\n AirBagLocCurtain: string;\n AirBagLocFront: string;\n AirBagLocKnee: string;\n AirBagLocSeatCushion: string;\n AirBagLocSide: string;\n AutoReverseSystem: string;\n AutomaticPedestrianAlertingSound: string;\n AxleConfiguration: string;\n Axles: string;\n BasePrice: string;\n BatteryA: string;\n BatteryA_to: string;\n BatteryCells: string;\n BatteryInfo: string;\n BatteryKWh: string;\n BatteryKWh_to: string;\n BatteryModules: string;\n BatteryPacks: string;\n BatteryType: string;\n BatteryV: string;\n BatteryV_to: string;\n BedLengthIN: string;\n BedType: string;\n BlindSpotMon: string;\n BodyCabType: string;\n BodyClass: string;\n BrakeSystemDesc: string;\n BrakeSystemType: string;\n BusFloorConfigType: string;\n BusLength: string;\n BusType: string;\n CAN_AACN: string;\n CIB: string;\n CashForClunkers: string;\n ChargerLevel: string;\n ChargerPowerKW: string;\n CoolingType: string;\n CurbWeightLB: string;\n CustomMotorcycleType: string;\n DaytimeRunningLight: string;\n DestinationMarket: string;\n DisplacementCC: string;\n DisplacementCI: string;\n DisplacementL: string;\n Doors: string;\n DriveType: string;\n DriverAssist: string;\n DynamicBrakeSupport: string;\n EDR: string;\n ESC: string;\n EVDriveUnit: string;\n ElectrificationLevel: string;\n EngineConfiguration: string;\n EngineCycles: string;\n EngineCylinders: string;\n EngineHP: string;\n EngineHP_to: string;\n EngineKW: string;\n EngineManufacturer: string;\n EngineModel: string;\n EntertainmentSystem: string;\n ErrorCode: string;\n ErrorText: string;\n ForwardCollisionWarning: string;\n FuelInjectionType: string;\n FuelTypePrimary: string;\n FuelTypeSecondary: string;\n GCWR: string;\n GCWR_to: string;\n GVWR: string;\n GVWR_to: string;\n KeylessIgnition: string;\n LaneDepartureWarning: string;\n LaneKeepSystem: string;\n LowerBeamHeadlampLightSource: string;\n Make: string;\n Manufacturer: string;\n ManufacturerId: string;\n Model: string;\n ModelYear: string;\n MotorcycleChassisType: string;\n MotorcycleSuspensionType: string;\n NCSABodyType: string;\n NCSAMake: string;\n NCSAMapExcApprovedBy: string;\n NCSAMapExcApprovedOn: string;\n NCSAMappingException: string;\n NCSAModel: string;\n NCSANote: string;\n Note: string;\n OtherBusInfo: string;\n OtherEngineInfo: string;\n OtherMotorcycleInfo: string;\n OtherRestraintSystemInfo: string;\n OtherTrailerInfo: string;\n ParkAssist: string;\n PedestrianAutomaticEmergencyBraking: string;\n PlantCity: string;\n PlantCompanyName: string;\n PlantCountry: string;\n PlantState: string;\n PossibleValues: string;\n Pretensioner: string;\n RearCrossTrafficAlert: string;\n RearVisibilitySystem: string;\n SAEAutomationLevel: string;\n SAEAutomationLevel_to: string;\n SeatBeltsAll: string;\n SeatRows: string;\n Seats: string;\n SemiautomaticHeadlampBeamSwitching: string;\n Series: string;\n Series2: string;\n SteeringLocation: string;\n SuggestedVIN: string;\n TPMS: string;\n TopSpeedMPH: string;\n TrackWidth: string;\n TractionControl: string;\n TrailerBodyType: string;\n TrailerLength: string;\n TrailerType: string;\n TransmissionSpeeds: string;\n TransmissionStyle: string;\n Trim: string;\n Trim2: string;\n Turbo: string;\n VIN: string;\n ValveTrainDesign: string;\n VehicleType: string;\n WheelBaseLong: string;\n WheelBaseShort: string;\n WheelBaseType: string;\n WheelSizeFront: string;\n WheelSizeRear: string;\n Wheels: string;\n Windows: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVinValuesExtended API Action.\n *\n * @memberof module:api/actions/DecodeVinValuesExtended\n * @alias DecodeVinValuesExtendedResponse\n */\nexport type DecodeVinValuesExtendedResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /**\n * The search results returned by the NHSTA API request.\n * Flat file format, single object containing keys and values of type string\n * */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/DecodeWMI\n * @category Actions\n * @description DecodeWMI NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeWMI](module-api_actions_DecodeWMI.DecodeWMI.html)\n * >\n * > **Types**\n * > - Type: [DecodeWMIResponse](#DecodeWMIResponse)\n * > - Type: [DecodeWMIResults](#DecodeWMIResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeWMI extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides information on the World Manufacturer Identifier for a specific WMI code.\n * - `WMI` may be put in as either 3 characters representing VIN position 1-3 or 6 characters\n * representing VIN positions 1-3 & 12-14. Example \"JTD\", \"1T9131\".\n *\n * @async\n * @param {string} WMI - World Manufacturer Identifier.\n * @returns {(Promise)} Api Response object.\n */\n async DecodeWMI(WMI: string): Promise {\n const action = 'DecodeWMI';\n\n /* Runtime typechecking */\n const typeofWMI = getTypeof(WMI);\n if (typeofWMI !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"WMI\" argument is required and must be of type string, got: ` +\n `<${typeofWMI}> ${WMI}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${WMI}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeWMIResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeWMI\n * @alias DecodeWMIResults\n */\nexport type DecodeWMIResults = {\n CommonName: string;\n CreatedOn: string;\n DateAvailableToPublic: string;\n Make: string;\n ManufacturerName: string;\n ParentCompanyName: string;\n URL: string;\n UpdatedOn: string;\n VehicleType: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeWMI API Action.\n *\n * @memberof module:api/actions/DecodeWMI\n * @alias DecodeWMIResponse\n */\nexport type DecodeWMIResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetAllMakes\n * @category Actions\n * @description GetAllMakes NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetAllMakes](module-api_actions_GetAllMakes.GetAllMakes.html)\n * >\n * > **Types**\n * > - Type: [GetAllMakesResponse](#GetAllMakesResponse)\n * > - Type: [GetAllMakesResults](#GetAllMakesResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetAllMakes extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the Makes available in the vPIC Dataset.\n *\n * @async\n * @returns {(Promise)} Api Response object.\n */\n public async GetAllMakes(): Promise {\n const action = 'GetAllMakes';\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetAllMakesResponse}.Results' array.\n *\n * @memberof module:api/actions/GetAllMakes\n * @alias GetAllMakesResults\n */\nexport type GetAllMakesResults = {\n Make_ID: number;\n Make_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetAllMakes API Action.\n *\n * @memberof module:api/actions/GetAllMakes\n * @alias GetAllMakesResponse\n */\nexport type GetAllMakesResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetAllManufacturers\n * @category Actions\n * @description GetAllManufacturers NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetAllManufacturers](module-api_actions_GetAllManufacturers.GetAllManufacturers.html)\n * >\n * > **Types**\n * > - Type: [GetAllManufacturersResponse](#GetAllManufacturersResponse)\n * > - Type: [GetAllManufacturersResults](#GetAllManufacturersResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetAllManufacturers extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the Manufacturers available in vPIC Dataset.\n * - `params.manufacturerType` allows the user to filter the list based on manufacturer type,\n * ('Incomplete Vehicles', 'Completed Vehicle Manufacturer', 'Incomplete Vehicle Manufacturer',\n * 'Intermediate Manufacturer', 'Final-Stage Manufacturer', 'Alterer', or any partial match of those strings).\n * - You can get a list of all manufacturer types with the following API Action:\n * `GetVehicleVariableValuesList('manufacturer type')`\n * - Results are provided in pages of 100 items.\n * - Provide a number value for `params.page` to specify 1st (default), 2nd, 3rd, Nth, etc page.\n *\n * @async\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string} [params.manufacturerType] - See method description.\n * @param {number} [params.page] - Specify the page number (results returned 100 at a time).\n * @returns {(Promise)} Api Response object.\n */\n async GetAllManufacturers(\n params: {\n manufacturerType?: string;\n page?: number;\n } = {}\n ): Promise {\n const action = 'GetAllManufacturers';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofManufacturerType = getTypeof(params.manufacturerType);\n if (params.manufacturerType && typeofManufacturerType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.manufacturerType\" argument must be of type string, got: ` +\n `<${typeofManufacturerType}> ${params.manufacturerType}`\n )\n );\n }\n\n const typeofPage = getTypeof(params.page);\n if (params.page && typeofPage !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.page\" argument must be of type number, got: ` +\n `<${typeofPage}> ${params.page}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetAllManufacturersResponse}.Results' array.\n *\n * @memberof module:api/actions/GetAllManufacturers\n * @alias GetAllManufacturersResults\n */\nexport type GetAllManufacturersResults = {\n Country: string;\n Mfr_CommonName: string;\n Mfr_ID: number;\n Mfr_Name: string;\n VehicleTypes: Array<{ isPrimary?: boolean; name?: string }>;\n};\n\n/**\n * Type representing the complete response returned by the GetAllManufacturers API Action.\n *\n * @memberof module:api/actions/GetAllManufacturers\n * @alias GetAllManufacturersResponse\n */\nexport type GetAllManufacturersResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetCanadianVehicleSpecifications\n * @category Actions\n * @description GetCanadianVehicleSpecifications NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetCanadianVehicleSpecifications](module-api_actions_GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications.html)\n * >\n * > **Types**\n * > - Type: [GetCanadianVehicleSpecificationsResponse](#GetCanadianVehicleSpecificationsResponse)\n * > - Type: [GetCanadianVehicleSpecificationsResults](#GetCanadianVehicleSpecificationsResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetCanadianVehicleSpecifications extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * The Canadian Vehicle Specifications (CVS) consists of a database of original vehicle dimensions,\n * used primarily in collision investigation and reconstruction, combined with a search engine.\n *\n * The database is compiled annually by the Collision Investigation and Research Division of Transport Canada.\n * Visit official [Canadian Vehicle Specifications](http://www.carsp.ca/research/resources/safety-sources/canadian-vehicle-specifications/)\n * page for more details.\n *\n * This API action will return a 404 html error if any of the query parameters in params\n * are missing from the query string. This is the only API action with this behaviour. Therefore,\n * parameters are inserted into the query string as empty strings if not provided by the user.\n *\n * @async\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.year - Model year of the vehicle (required) - Number, >= 1971.\n * @param {string} [params.make] - Vehicle's make, like \"Honda\", \"Toyota\", etc...\n * @param {string} [params.model] - Vehicle's model, like \"Pilot\", \"Focus\". Can also include some other elements like Body Type, Engine Model/size, etc...\n * @param {string} [params.units] - \"Metric\" (default), or \"US\" for United States customary units.\n * @returns {(Promise)} Api Response object.\n */\n async GetCanadianVehicleSpecifications(params: {\n year: number;\n make?: string;\n model?: string;\n units?: string;\n }): Promise {\n const action = 'GetCanadianVehicleSpecifications';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofYear = getTypeof(params.year);\n if (typeofYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\n `<${typeofYear}> ${params.year}`\n )\n );\n }\n\n const typeofMake = getTypeof(params.make);\n if (params.make && typeofMake !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.make\" argument must be of type string, got: ` +\n `<${typeofMake}> ${params.make}`\n )\n );\n }\n\n const typeofModel = getTypeof(params.model);\n if (params.model && typeofModel !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.model\" argument must be of type string, got: ` +\n `<${typeofModel}> ${params.model}`\n )\n );\n }\n\n const typeofUnits = getTypeof(params.units);\n if (params.units && typeofUnits !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.units\" argument must be of type string, got: ` +\n `<${typeofUnits}> ${params.units}`\n )\n );\n }\n\n /* Set default query parameters to empty strings if not provided by the user */\n const make = params.make || '';\n const model = params.model || '';\n const units = params.units || '';\n\n const params_ = {\n year: params.year,\n make,\n model,\n units,\n };\n\n /*\n * Build the 'default' query string to be appended to the URL.\n *\n * Additionally, sets the allowEmptyStringValues option (2nd argument) to true because\n * this API action will return a 404 error if any of the query parameters are missing from the query string.\n * This is the only API action with this behaviour (\"year\" is the only param the user must provide).\n */\n const queryString = await this.buildQueryString(\n params_,\n true\n ).catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetCanadianVehicleSpecificationsResponse}.Results' array.\n *\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\n * @alias GetCanadianVehicleSpecificationsResults\n */\nexport type GetCanadianVehicleSpecificationsResults = {\n Specs: Array<{\n Name: string;\n Value: string;\n }>;\n};\n\n/**\n * Type representing the complete response returned by the GetCanadianVehicleSpecifications API Action.\n *\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\n * @alias GetCanadianVehicleSpecificationsResponse\n */\nexport type GetCanadianVehicleSpecificationsResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetEquipmentPlantCodes\n * @category Actions\n * @description GetEquipmentPlantCodes NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetEquipmentPlantCodes](module-api_actions_GetEquipmentPlantCodes.GetEquipmentPlantCodes.html)\n * >\n * > **Types**\n * > - Type: [GetEquipmentPlantCodesResponse](#GetEquipmentPlantCodesResponse)\n * > - Type: [GetEquipmentPlantCodesResults](#GetEquipmentPlantCodesResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetEquipmentPlantCodes extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * Returns assigned Equipment Plant Codes. Can be filtered by Year, Equipment Type and Report Type.\n *\n * `params.year`:\n * - Only years >= 2016 are supported\n *\n * `params.equipmentType`:\n * - 1 (Tires)\n * - 3 (Brake Hoses)\n * - 13 (Glazing)\n * - 16 (Retread)\n *\n * `params.reportType`:\n * - 'New' (The Equipment Plant Code was assigned during the selected year).\n * - 'Updated' (The Equipment Plant data was modified during the selected year).\n * - 'Closed' (The Equipment Plant is no longer Active).\n * - 'All' (All Equipment Plant Codes regardless of year, including their status (active or closed)).\n *\n * @async\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\n * @param {number} params.equipmentType - Number equal to 1, 3, 13, or 16.\n * @param {string} params.reportType - 'New', 'Updated', 'Closed', or 'All'.\n * @returns {(Promise)} Api Response object.\n */\n public async GetEquipmentPlantCodes(params: {\n year: number;\n equipmentType: 1 | 3 | 13 | 16;\n reportType: 'New' | 'Updated' | 'Closed' | 'All';\n }): Promise {\n const action = 'GetEquipmentPlantCodes';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofYear = getTypeof(params.year);\n if (typeofYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\n `<${typeofYear}> ${params.year}`\n )\n );\n }\n\n const typeofEquipmentType = getTypeof(params.equipmentType);\n if (typeofEquipmentType !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.equipmentType\" argument is required and must be of type number, got: ` +\n `<${typeofEquipmentType}> ${params.equipmentType}`\n )\n );\n }\n\n const typeofReportType = getTypeof(params.reportType);\n if (typeofReportType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.reportType\" argument is required and must be of type string, got: ` +\n `<${typeofReportType}> ${params.reportType}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetEquipmentPlantCodesResponse}.Results' array.\n *\n * @memberof module:api/actions/GetEquipmentPlantCodes\n * @alias GetEquipmentPlantCodesResults\n */\nexport type GetEquipmentPlantCodesResults = {\n Address: string;\n City: string;\n Country: string;\n DOTCode: string;\n Name: string;\n OldDotCode: string;\n PostalCode: string;\n StateProvince: string;\n Status: string;\n};\n\n/**\n * Type representing the complete response returned by the GetEquipmentPlantCodes API Action.\n *\n * @memberof module:api/actions/GetEquipmentPlantCodes\n * @alias GetEquipmentPlantCodesResponse\n */\nexport type GetEquipmentPlantCodesResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetMakeForManufacturer\n * @category Actions\n * @description GetMakeForManufacturer NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetMakeForManufacturer](module-api_actions_GetMakeForManufacturer.GetMakeForManufacturer.html)\n * >\n * > **Types**\n * > - Type: [GetMakeForManufacturerResponse](#GetMakeForManufacturerResponse)\n * > - Type: [GetMakeForManufacturerResults](#GetMakeForManufacturerResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetMakeForManufacturer extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Makes in the vPIC dataset for a specified manufacturer that is requested.\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\n * (it accepts a partial manufacturer name as an input).\n * - `manufacturer` name can be a partial name, or a full name for more specificity\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\n * - Multiple results are returned in case of multiple matches.\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\n * @returns {(Promise)} Api Response object.\n */\n async GetMakeForManufacturer(\n manufacturer: string | number\n ): Promise {\n const action = 'GetMakeForManufacturer';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetMakeForManufacturerResponse}.Results' array.\n *\n * @memberof module:api/actions/GetMakeForManufacturer\n * @alias GetMakeForManufacturerResults\n */\nexport type GetMakeForManufacturerResults = {\n Make_ID: number;\n Make_Name: string;\n Mfr_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetMakeForManufacturer API Action.\n *\n * @memberof module:api/actions/GetMakeForManufacturer\n * @alias GetMakeForManufacturerResponse\n */\nexport type GetMakeForManufacturerResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetMakesForManufacturerAndYear\n * @category Actions\n * @description GetMakesForManufacturerAndYear NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetMakesForManufacturerAndYear](module-api_actions_GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear.html)\n * >\n * > **Types**\n * > - Type: [GetMakesForManufacturerAndYearResponse](#GetMakesForManufacturerAndYearResponse)\n * > - Type: [GetMakesForManufacturerAndYearResults](#GetMakesForManufacturerAndYearResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetMakesForManufacturerAndYear extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Makes in the vPIC dataset for a specified manufacturer,\n * and whose Year From and Year To range cover the specified year.\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\n * (it accepts a partial manufacturer name as an input).\n * - Multiple results are returned in case of multiple matches.\n * - Manufacturer can be idenfitied by Id, a partial name, or a full name\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\n *\n * @returns {(Promise)} Api Response object.\n */\n public async GetMakesForManufacturerAndYear(\n manufacturer: string | number,\n params: {\n year: number;\n }\n ): Promise {\n const action = 'GetMakesForManufacturerAndYear';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument is required and must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofYear = getTypeof(params.year);\n if (typeofYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\n `<${typeofYear}> ${params.year}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetMakesForManufacturerAndYearResponse}.Results' array.\n *\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\n * @alias GetMakesForManufacturerAndYearResults\n */\nexport type GetMakesForManufacturerAndYearResults = {\n MakeId: number;\n MakeName: string;\n MfrId: number;\n MfrName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetMakesForManufacturerAndYear API Action.\n *\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\n * @alias GetMakesForManufacturerAndYearResponse\n */\nexport type GetMakesForManufacturerAndYearResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetMakesForVehicleType\n * @category Actions\n * @description GetMakesForVehicleType NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetMakesForVehicleType](module-api_actions_GetMakesForVehicleType.GetMakesForVehicleType.html)\n * >\n * > **Types**\n * > - Type: [GetMakesForVehicleTypeResponse](#GetMakesForVehicleTypeResponse)\n * > - Type: [GetMakesForVehicleTypeResults](#GetMakesForVehicleTypeResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetMakesForVehicleType extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Makes in the vPIC dataset for a specified vehicle type (`typeName`),\n * whose name is LIKE the vehicle type name in vPIC Dataset.\n * - Vehicle `typeName` can be a partial name, or a full name for more specificity\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\n *\n * @async\n * @param {string} typeName - A partial or full vehicle type name.\n * @returns {(Promise)} Api Response object.\n */\n async GetMakesForVehicleType(\n typeName: string\n ): Promise {\n const action = 'GetMakesForVehicleType';\n\n /* Runtime typechecking */\n const typeofTypeName = getTypeof(typeName);\n if (typeofTypeName !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"typeName\" argument is required and must be of type string, got: ` +\n `<${typeofTypeName}> ${typeName}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${typeName}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetMakesForVehicleTypeResponse}.Results' array.\n *\n * @memberof module:api/actions/GetMakesForVehicleType\n * @alias GetMakesForVehicleTypeResults\n */\nexport type GetMakesForVehicleTypeResults = {\n MakeId: number;\n MakeName: string;\n VehicleTypeId: number;\n VehicleTypeName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetMakesForVehicleType API Action.\n *\n * @memberof module:api/actions/GetMakesForVehicleType\n * @alias GetMakesForVehicleTypeResponse\n */\nexport type GetMakesForVehicleTypeResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetManufacturerDetails\n * @category Actions\n * @description GetManufacturerDetails NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetManufacturerDetails](module-api_actions_GetManufacturerDetails.GetManufacturerDetails.html)\n * >\n * > **Types**\n * > - Type: [GetManufacturerDetailsResponse](#GetManufacturerDetailsResponse)\n * > - Type: [GetManufacturerDetailsResults](#GetManufacturerDetailsResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetManufacturerDetails extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides the details for a specific manufacturer that is requested.\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name,\n * (it accepts a partial manufacturer name as an input).\n * - Multiple results are returned in case of multiple matches.\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\n * @returns {(Promise)} Api Response object.\n */\n public async GetManufacturerDetails(\n manufacturer: string | number\n ): Promise {\n const action = 'GetManufacturerDetails';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetManufacturerDetailsResponse}.Results' array.\n *\n * @memberof module:api/actions/GetManufacturerDetails\n * @alias GetManufacturerDetailsResults\n */\nexport type GetManufacturerDetailsResults = {\n Address: string;\n Address2: string;\n City: string;\n ContactEmail: string;\n ContactFax: string;\n ContactPhone: string;\n Country: string;\n DBAs: string;\n EquipmentItems: Array>;\n LastUpdated: string;\n ManufacturerTypes: Array<{\n Name: string;\n }>;\n Mfr_CommonName: string;\n Mfr_ID: number;\n Mfr_Name: string;\n OtherManufacturerDetails: string;\n PostalCode: string;\n PrimaryProduct: string;\n PrincipalFirstName: string;\n PrincipalLastName: string;\n PrincipalPosition: string;\n StateProvince: string;\n SubmittedName: string;\n SubmittedOn: string;\n SubmittedPosition: string;\n VehicleTypes: Array<{\n GVWRFrom: string;\n GVWRTo: string;\n IsPrimary: boolean;\n Name: string;\n }>;\n};\n\n/**\n * Type representing the complete response returned by the GetManufacturerDetails API Action.\n *\n * @memberof module:api/actions/GetManufacturerDetails\n * @alias GetManufacturerDetailsResponse\n */\nexport type GetManufacturerDetailsResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetModelsForMake\n * @category Actions\n * @description GetModelsForMake NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMake](module-api_actions_GetModelsForMake.GetModelsForMake.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeResponse](#GetModelsForMakeResponse)\n * > - Type: [GetModelsForMakeResults](#GetModelsForMakeResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMake extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified `makeName`\n * whose Name is LIKE the Make in vPIC Dataset.\n * - `makeName` can be a partial, or a full for more specificity\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\n *\n * @async\n * @param {string} makeName - Vehicle make name.\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMake(makeName: string): Promise {\n const action = 'GetModelsForMake';\n\n /* Runtime typechecking */\n const typeofMakeName = getTypeof(makeName);\n if (typeofMakeName !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\n `<${typeofMakeName}> ${makeName}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMake\n * @alias GetModelsForMakeResults\n */\nexport type GetModelsForMakeResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMake API Action.\n *\n * @memberof module:api/actions/GetModelsForMake\n * @alias GetModelsForMakeResponse\n */\nexport type GetModelsForMakeResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetModelsForMakeId\n * @category Actions\n * @description GetModelsForMakeId NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMakeId](module-api_actions_GetModelsForMakeId.GetModelsForMakeId.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeIdResponse](#GetModelsForMakeIdResponse)\n * > - Type: [GetModelsForMakeIdResults](#GetModelsForMakeIdResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMakeId extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified Make\n * whose Id is equal to the `makeId` in the vPIC Dataset.\n *\n * @async\n * @param {number} makeID - Vehicle make ID (number).\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMakeId(\n makeID: number\n ): Promise {\n const action = 'GetModelsForMakeId';\n\n /* Runtime typechecking */\n const typeofMakeId = getTypeof(makeID);\n if (typeofMakeId !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\n `<${typeofMakeId}> ${makeID}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString({}).catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMakeId\n * @alias GetModelsForMakeIdResults\n */\nexport type GetModelsForMakeIdResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMakeId API Action.\n *\n * @memberof module:api/actions/GetModelsForMakeId\n * @alias GetModelsForMakeIdResponse\n */\nexport type GetModelsForMakeIdResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetModelsForMakeIdYear\n * @category Actions\n * @description GetModelsForMakeIdYear NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMakeIdYear](module-api_actions_GetModelsForMakeIdYear.GetModelsForMakeIdYear.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeIdYearResponse](#GetModelsForMakeIdYearResponse)\n * > - Type: [GetModelsForMakeIdYearResults](#GetModelsForMakeIdYearResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMakeIdYear extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified Model Year\n * and Make whose name is LIKE the Make in the vPIC Dataset.\n * - `params.makeId` is a number and is a required query parameter.\n *\n * A minimum of one of the following are required (or a combination of both):\n * - `params.modelYear` is a number (greater than 1995)\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\n *\n * @async\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.makeId - Make ID to search.\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMakeIdYear(params: {\n makeId: number;\n modelYear?: number;\n vehicleType?: string;\n }): Promise {\n const action = 'GetModelsForMakeIdYear';\n\n const makeId: number = params?.makeId;\n const modelYear: number | undefined = params?.modelYear;\n const vehicleType: string | undefined = params?.vehicleType;\n\n /* Valid params object */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n /* Required makeId param of type number */\n const typeofMakeId = getTypeof(makeId);\n if (typeofMakeId !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.makeId\" argument is required and must be of type number, got: ` +\n `<${typeofMakeId}> ${makeId}`\n )\n );\n }\n /* At least one of modelYear or vehicleType params is required */\n if (!modelYear && !vehicleType) {\n return Promise.reject(\n new Error(\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\n `${modelYear} | ${vehicleType}`\n )\n );\n }\n /* valid modelYear param of type number */\n const typeofModelYear = getTypeof(modelYear);\n if (modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" must be of type number, got: ` +\n `<${typeofModelYear}> ${modelYear}`\n )\n );\n }\n /* valid vehicleType param of type string */\n const typeofVehicleType = getTypeof(vehicleType);\n if (vehicleType && typeofVehicleType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\n `<${typeofVehicleType}> ${vehicleType}`\n )\n );\n }\n\n /* Beginning of the the actionUrl */\n let actionUrl = `${action}/makeId/${makeId}/`;\n\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\n if (modelYear && vehicleType) {\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\n } else if (modelYear) {\n actionUrl += `modelYear/${modelYear}`;\n } else {\n actionUrl += `vehicleType/${vehicleType}`;\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdYearResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMakeIdYear\n * @alias GetModelsForMakeIdYearResults\n */\nexport type GetModelsForMakeIdYearResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMakeIdYear API Action.\n *\n * @memberof module:api/actions/GetModelsForMakeIdYear\n * @alias GetModelsForMakeIdYearResponse\n */\nexport type GetModelsForMakeIdYearResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetModelsForMakeYear\n * @category Actions\n * @description GetModelsForMakeYear NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMakeYear](module-api_actions_GetModelsForMakeYear.GetModelsForMakeYear.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeYearResponse](#GetModelsForMakeYearResponse)\n * > - Type: [GetModelsForMakeYearResults](#GetModelsForMakeYearResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMakeYear extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified Model Year\n * and Make whose name is LIKE the Make in the vPIC Dataset.\n * - `params.make` is required. It can be a partial, or a full name for more specificity\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\n *\n * A minimum of one of the following are required (or a combination of both):\n * - `params.modelYear` is a number (greater than 1995)\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\n *\n * @async\n *\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {string} params.make - Make name to search.\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\n *\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMakeYear(params: {\n make: string;\n modelYear?: number;\n vehicleType?: string;\n }): Promise {\n const action = 'GetModelsForMakeYear';\n\n const make: string = params?.make;\n const modelYear: number | undefined = params?.modelYear;\n const vehicleType: string | undefined = params?.vehicleType;\n\n /* Valid params object */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n /* Required make param of type string */\n const typeofMake = getTypeof(make);\n if (typeofMake !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.make\" argument is required and must be of type string, got: ` +\n `<${typeofMake}> ${make}`\n )\n );\n }\n /* At least one of modelYear or vehicleType params is required */\n if (!modelYear && !vehicleType) {\n return Promise.reject(\n new Error(\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\n `${modelYear} | ${vehicleType}`\n )\n );\n }\n /* valid modelYear param of type number */\n const typeofModelYear = getTypeof(modelYear);\n if (modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" must be of type number, got: ` +\n `<${typeofModelYear}> ${modelYear}`\n )\n );\n }\n /* valid vehicleType param of type string */\n const typeofVehicleType = getTypeof(vehicleType);\n if (vehicleType && typeofVehicleType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\n `<${typeofVehicleType}> ${vehicleType}`\n )\n );\n }\n\n /* Beginning of the the actionUrl */\n let actionUrl = `${action}/make/${params.make}/`;\n\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\n if (modelYear && vehicleType) {\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\n } else if (modelYear) {\n actionUrl += `modelYear/${modelYear}`;\n } else {\n actionUrl += `vehicleType/${vehicleType}`;\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeYearResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMakeYear\n * @alias GetModelsForMakeYearResults\n */\nexport type GetModelsForMakeYearResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMakeYear API Action.\n *\n * @memberof module:api/actions/GetModelsForMakeYear\n * @alias GetModelsForMakeYearResponse\n */\nexport type GetModelsForMakeYearResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetParts\n * @category Actions\n * @description GetParts NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetParts](module-api_actions_GetParts.GetParts.html)\n * >\n * > **Types**\n * > - Type: [GetPartsResponse](#GetPartsResponse)\n * > - Type: [GetPartsResults](#GetPartsResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetParts extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of ORGs with letter date in the given range of the dates\n * and with specified Type (`params.type`) of ORG.\n * - Up to 1000 results will be returned at a time.\n * - Get the next page by incrementing the `params.page` query parameter.\n * - All query `params` are optional.\n *\n * @async\n * @param {object} [params] - Query Search Parameters to append to the URL.\n * @param {number} [params.type] - Specified type of ORG to search.\n * @param {string} [params.fromDate] - Start date of search query.\n * @param {string} [params.toDate] - End date of search query.\n * @param {number} [params.page] - Which page number of results to request (100 results per page).\n * @returns {(Promise)} Api Response object.\n */\n async GetParts(params?: {\n type?: number;\n fromDate?: string;\n toDate?: string;\n page?: number;\n }): Promise {\n const action = 'GetParts';\n\n const type: number | undefined = params?.type;\n const fromDate: string | undefined = params?.fromDate;\n const toDate: string | undefined = params?.toDate;\n const page: number | undefined = params?.page;\n\n /* Valid params object */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: <${typeofParams}> ${params}`\n )\n );\n }\n\n /* valid params.type of type number */\n const typeofType = getTypeof(type);\n if (type && typeofType !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.type\" argument must be of type number, got: <${typeofType}> ${type}`\n )\n );\n }\n\n /* valid params.fromDate of type string */\n const typeofFromDate = getTypeof(fromDate);\n if (fromDate && typeofFromDate !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.fromDate\" argument must be of type string, got: <${typeofFromDate}> ${fromDate}`\n )\n );\n }\n\n /* valid params.toDate of type number */\n const typeofToDate = getTypeof(toDate);\n if (toDate && typeofToDate !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.toDate\" argument must be of type string, got: <${typeofToDate}> ${toDate}`\n )\n );\n }\n\n /* valid params.page of type number */\n const typeofPage = getTypeof(page);\n if (page && typeofPage !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.page\" argument must be of type number, got: <${typeofPage}> ${page}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetPartsResponse}.Results' array.\n *\n * @memberof module:api/actions/GetParts\n * @alias GetPartsResults\n */\nexport type GetPartsResults = {\n CoverLetterURL: string;\n LetterDate: string;\n ManufacturerId: number;\n ManufacturerName: string;\n ModelYearFrom: string;\n ModelYearTo: string;\n Name: string;\n Type: string;\n URL: string;\n};\n\n/**\n * Type representing the complete response returned by the GetParts API Action.\n *\n * @memberof module:api/actions/GetParts\n * @alias GetPartsResponse\n */\nexport type GetPartsResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetVehicleTypesForMake\n * @category Actions\n * @description GetVehicleTypesForMake NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleTypesForMake](module-api_actions_GetVehicleTypesForMake.GetVehicleTypesForMake.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleTypesForMakeResponse](#GetVehicleTypesForMakeResponse)\n * > - Type: [GetVehicleTypesForMakeResults](#GetVehicleTypesForMakeResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleTypesForMake extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make,\n * whose name is LIKE the make name in the vPIC Dataset.\n * - `makeName` can be a partial name, or a full name for more specificity\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\n *\n * @async\n * @param {string} makeName - Name of the vehicle make to search.\n * @returns {(Promise)} Api Response object.\n */\n async GetVehicleTypesForMake(\n makeName: string\n ): Promise {\n const action = 'GetVehicleTypesForMake';\n\n /* Runtime typechecking */\n const typeofMakeName = getTypeof(makeName);\n if (typeofMakeName !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\n `<${typeofMakeName}> ${makeName}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleTypesForMake\n * @alias GetVehicleTypesForMakeResults\n */\nexport type GetVehicleTypesForMakeResults = {\n MakeId: number;\n MakeName: string;\n VehicleTypeId: number;\n VehicleTypeName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleTypesForMake API Action.\n *\n * @memberof module:api/actions/GetVehicleTypesForMake\n * @alias GetVehicleTypesForMakeResponse\n */\nexport type GetVehicleTypesForMakeResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetVehicleTypesForMakeId\n * @category Actions\n * @description GetVehicleTypesForMakeId NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleTypesForMakeId](module-api_actions_GetVehicleTypesForMakeId.GetVehicleTypesForMakeId.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleTypesForMakeIdResponse](#GetVehicleTypesForMakeIdResponse)\n * > - Type: [GetVehicleTypesForMakeIdResults](#GetVehicleTypesForMakeIdResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleTypesForMakeId extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make and\n * whose ID equals the make ID in the vPIC Dataset.\n *\n * @async\n * @param {number} makeID - Vehicle make ID.\n * @returns {(Promise)} Api Response object.\n */\n async GetVehicleTypesForMakeId(\n makeID: number\n ): Promise {\n const action = 'GetVehicleTypesForMakeId';\n\n /* Runtime typechecking */\n const typeofMakeId = getTypeof(makeID);\n if (typeofMakeId !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\n `<${typeofMakeId}> ${makeID}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeIdResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleTypesForMakeId\n * @alias GetVehicleTypesForMakeIdResults\n */\nexport type GetVehicleTypesForMakeIdResults = {\n MakeId: number;\n MakeName: string;\n VehicleTypeId: number;\n VehicleTypeName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleTypesForMakeId API Action.\n *\n * @memberof module:api/actions/GetVehicleTypesForMakeId\n * @alias GetVehicleTypesForMakeIdResponse\n */\nexport type GetVehicleTypesForMakeIdResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetVehicleVariableList\n * @category Actions\n * @description GetVehicleVariableList NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleVariableList](module-api_actions_GetVehicleVariableList.GetVehicleVariableList.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleVariableListResponse](#GetVehicleVariableListResponse)\n * > - Type: [GetVehicleVariableListResults](#GetVehicleVariableListResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleVariableList extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the Vehicle related variables that are in the vPIC dataset.\n * - Information on the name, description and the type of the variable is provided.\n *\n * @async\n * @returns {(Promise)} Api Response object.\n */\n public async GetVehicleVariableList(): Promise {\n const action = 'GetVehicleVariableList';\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleVariableListResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleVariableList\n * @alias GetVehicleVariableListResults\n */\nexport type GetVehicleVariableListResults = {\n DataType: string;\n Description: string;\n ID: number;\n Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleVariableList API Action.\n *\n * @memberof module:api/actions/GetVehicleVariableList\n * @alias GetVehicleVariableListResponse\n */\nexport type GetVehicleVariableListResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetVehicleVariableValuesList\n * @category Actions\n * @description GetVehicleVariableValuesList NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleVariableValuesList](module-api_actions_GetVehicleVariableValuesList.GetVehicleVariableValuesList.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleVariableValuesListResponse](#GetVehicleVariableValuesListResponse)\n * > - Type: [GetVehicleVariableValuesListResults](#GetVehicleVariableValuesListResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleVariableValuesList extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the accepted values for a given variable that are stored in the vPIC dataset.\n *\n * This applies to only \"Look up\" type of variables.\n * - `variableValue` can either be a:\n * - Variable Name (\"battery type\" in first example, please use full name, not just part of it),\n * - or Variable ID (number).\n *\n * @async\n * @param {string|number} variableValue - The variable you want to get a values list of.\n * @returns {(Promise)} Api Response object.\n */\n async GetVehicleVariableValuesList(\n variableValue: string | number\n ): Promise {\n const action = 'GetVehicleVariableValuesList';\n\n /* Runtime typechecking */\n const typeofVariableValue = getTypeof(variableValue);\n if (typeofVariableValue !== 'string' && typeofVariableValue !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"variableValue\" argument is required and must be of type string or number, got: ` +\n `<${typeofVariableValue}> ${variableValue}`\n )\n );\n }\n /* Encode to a valid URI string (space chars, etc.) if variableValue is a string*/\n if (typeofVariableValue === 'string') {\n variableValue = encodeURI(variableValue as string);\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${variableValue}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleVariableValuesListResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleVariableValuesList\n * @alias GetVehicleVariableValuesListResults\n */\nexport type GetVehicleVariableValuesListResults = {\n ElementName: string;\n Id: number;\n Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleVariableValuesList API Action.\n *\n * @memberof module:api/actions/GetVehicleVariableValuesList\n * @alias GetVehicleVariableValuesListResponse\n */\nexport type GetVehicleVariableValuesListResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetWMIsForManufacturer\n * @category Actions\n * @description GetWMIsForManufacturer NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetWMIsForManufacturer](module-api_actions_GetWMIsForManufacturer.GetWMIsForManufacturer.html)\n * >\n * > **Types**\n * > - Type: [GetWMIsForManufacturerResponse](#GetWMIsForManufacturerResponse)\n * > - Type: [GetWMIsForManufacturerResults](#GetWMIsForManufacturerResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetWMIsForManufacturer extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * Provides information on the World Manufacturer Identifier (WMI) for a specified `manufacturer`.\n * - Only WMIs registered in vPICList are displayed.\n * - `manufacturer` can be a partial name, or a full name for more specificity\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name.\n * @returns {(Promise)} Api Response object.\n */\n async GetWMIsForManufacturer(\n manufacturer: string\n ): Promise {\n const action = 'GetWMIsForManufacturer';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetWMIsForManufacturerResponse}.Results' array.\n *\n * @memberof module:api/actions/GetWMIsForManufacturer\n * @alias GetWMIsForManufacturerResults\n */\nexport type GetWMIsForManufacturerResults = {\n Country: string;\n CreatedOn: string;\n DateAvailableToPublic: string;\n Id: number;\n Name: string;\n UpdatedOn: string;\n VehicleType: string;\n WMI: string;\n};\n\n/**\n * Type representing the complete response returned by the GetWMIsForManufacturer API Action.\n *\n * @memberof module:api/actions/GetWMIsForManufacturer\n * @alias GetWMIsForManufacturerResponse\n */\nexport type GetWMIsForManufacturerResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/NHTSA\n * @category API\n * @description Module exporting the main (NHSTA) class for API Actions.\n *\n * > **Module Exports**:\n * > - Class: [NHTSA](NHTSA.html#NHTSA) - Class that implements all NHTSA API Actions\n */\n\nimport { Fetch /* Class */, FetchConfig /* Type */ } from './Fetch';\n\n/* Import implemented API Action classes */\nimport {\n DecodeVin,\n DecodeVinExtended,\n DecodeVinValues,\n DecodeVINValuesBatch,\n DecodeVinValuesExtended,\n DecodeWMI,\n GetAllMakes,\n GetAllManufacturers,\n GetCanadianVehicleSpecifications,\n GetEquipmentPlantCodes,\n GetMakeForManufacturer,\n GetMakesForManufacturerAndYear,\n GetMakesForVehicleType,\n GetManufacturerDetails,\n GetModelsForMake,\n GetModelsForMakeId,\n GetModelsForMakeIdYear,\n GetModelsForMakeYear,\n GetParts,\n GetVehicleTypesForMake,\n GetVehicleTypesForMakeId,\n GetVehicleVariableList,\n GetVehicleVariableValuesList,\n GetWMIsForManufacturer,\n} from './actions';\n\n/**\n * @class NHTSA\n * @augments module:api/Fetch.Fetch\n * @category API\n *\n * @param {FetchConfig} [userConfig] - Configuration options to construct the class with.\n *\n * @implements {module:api/actions/DecodeVin.DecodeVin}\n * @implements {module:api/actions/DecodeVinExtended.DecodeVinExtended}\n * @implements {module:api/actions/DecodeVinValues.DecodeVinValues}\n * @implements {module:api/actions/DecodeVinValuesExtended.DecodeVinValuesExtended}\n * @implements {module:api/actions/DecodeWMI.DecodeWMI}\n * @implements {module:api/actions/GetAllMakes.GetAllMakes}\n * @implements {module:api/actions/GetAllManufacturers.GetAllManufacturers}\n * @implements {module:api/actions/GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications}\n * @implements {module:api/actions/GetEquipmentPlantCodes.GetEquipmentPlantCodes}\n * @implements {module:api/actions/GetMakeForManufacturer.GetMakeForManufacturer}\n * @implements {module:api/actions/GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear}\n * @implements {module:api/actions/GetMakesForVehicleType.GetMakesForVehicleType}\n * @implements {module:api/actions/GetManufacturerDetails.GetManufacturerDetails}\n * @implements {module:api/actions/GetModelsForMake.GetModelsForMake}\n * @implements {module:api/actions/GetModelsForMakeId.GetModelsForMakeId}\n * @implements {module:api/actions/GetModelsForMakeIdYear.GetModelsForMakeIdYear}\n * @implements {module:api/actions/GetModelsForMakeYear.GetModelsForMakeYear}\n * @implements {module:api/actions/GetParts.GetParts}\n * @implements {module:api/actions/GetVehicleTypesForMake.GetVehicleTypesForMake}\n * @implements {module:api/actions/GetVehicleTypesForMakeId.GetVehicleTypesForMakeId}\n * @implements {module:api/actions/GetVehicleVariableList.GetVehicleVariableList}\n * @implements {module:api/actions/GetVehicleVariableValuesList.GetVehicleVariableValuesList}\n * @implements {module:api/actions/GetWMIsForManufacturer.GetWMIsForManufacturer}\n *\n * @example Node bundle\n * const { NHTSA } = require('@shaggytools/nhtsa-api-wrapper');\n *\n * const Wrapper = new NHTSA();\n *\n * // Decode a VIN and return a response of type ApiResponse\n * const response = Wrapper.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\n *\n * // or get details about a specific manufacturer, plus 23 other available Actions.\n * const hondaDetails = Wrapper.GetManufacturerDetails('Honda').catch(error => error)\n *\n * @example Browser bundle\n * // Change to specific version number \"x.x.xx\",\n * // or remove completely for the most recently published version\n * /dist/bundle.min.js\"\n * >\n *\n * \n *\n * @example Module - Node lazy loading\n * const { NHTSA } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\n * .catch(err => err);\n *\n * const ApiClient = new NHTSA();\n *\n * const results = await ApiClient.DecodeVin('3VWD07AJ5EM388202')\n * .catch(err => err)\n *\n * @example Module - Browser lazy loading\n * \n */\nclass NHTSA\n extends Fetch\n implements\n DecodeVin,\n DecodeVinExtended,\n DecodeVinValues,\n DecodeVINValuesBatch,\n DecodeVinValuesExtended,\n DecodeWMI,\n GetAllMakes,\n GetAllManufacturers,\n GetCanadianVehicleSpecifications,\n GetEquipmentPlantCodes,\n GetMakeForManufacturer,\n GetMakesForManufacturerAndYear,\n GetMakesForVehicleType,\n GetManufacturerDetails,\n GetModelsForMake,\n GetModelsForMakeId,\n GetModelsForMakeIdYear,\n GetModelsForMakeYear,\n GetParts,\n GetVehicleTypesForMake,\n GetVehicleTypesForMakeId,\n GetVehicleVariableList,\n GetVehicleVariableValuesList,\n GetWMIsForManufacturer {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n DecodeVin = DecodeVin.prototype.DecodeVin;\n\n DecodeVinExtended = DecodeVinExtended.prototype.DecodeVinExtended;\n\n DecodeVinValues = DecodeVinValues.prototype.DecodeVinValues;\n\n DecodeVINValuesBatch = DecodeVINValuesBatch.prototype.DecodeVINValuesBatch;\n\n DecodeVinValuesExtended =\n DecodeVinValuesExtended.prototype.DecodeVinValuesExtended;\n\n DecodeWMI = DecodeWMI.prototype.DecodeWMI;\n\n GetAllMakes = GetAllMakes.prototype.GetAllMakes;\n\n GetAllManufacturers = GetAllManufacturers.prototype.GetAllManufacturers;\n\n GetCanadianVehicleSpecifications =\n GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications;\n\n GetEquipmentPlantCodes =\n GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes;\n\n GetMakeForManufacturer =\n GetMakeForManufacturer.prototype.GetMakeForManufacturer;\n\n GetMakesForManufacturerAndYear =\n GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear;\n\n GetMakesForVehicleType =\n GetMakesForVehicleType.prototype.GetMakesForVehicleType;\n\n GetManufacturerDetails =\n GetManufacturerDetails.prototype.GetManufacturerDetails;\n\n GetModelsForMake = GetModelsForMake.prototype.GetModelsForMake;\n\n GetModelsForMakeId = GetModelsForMakeId.prototype.GetModelsForMakeId;\n\n GetModelsForMakeIdYear =\n GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear;\n\n GetModelsForMakeYear = GetModelsForMakeYear.prototype.GetModelsForMakeYear;\n\n GetParts = GetParts.prototype.GetParts;\n\n GetVehicleTypesForMake =\n GetVehicleTypesForMake.prototype.GetVehicleTypesForMake;\n\n GetVehicleTypesForMakeId =\n GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId;\n\n GetVehicleVariableList =\n GetVehicleVariableList.prototype.GetVehicleVariableList;\n\n GetVehicleVariableValuesList =\n GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList;\n\n GetWMIsForManufacturer =\n GetWMIsForManufacturer.prototype.GetWMIsForManufacturer;\n}\n\nexport { NHTSA };\n","/**\n * @module api/Client\n * @category API\n * @description Module exporting an instance of the NHSTA class.\n *\n * > - For more information, see the documentation for the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n */\n\nimport { NHTSA } from './NHTSA';\n\n/**\n * A new instance of the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n *\n * @type {NHTSA}\n *\n * @example Node bundle\n * const { Client } = require('@shaggytools/nhtsa-api-wrapper');\n *\n * // Decode a VIN and return get a response of type ApiResponse\n * const response = Client.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\n *\n * // or get details about a specific manufacturer, plus 23 other available Actions.\n * const audiDetails = Client.GetManufacturerDetails('Audi').catch(error => error)\n *\n * @example Browser bundle\n * // Change to specific version number \"x.x.xx\",\n * // or remove completely for the most recently published version\n * /dist/bundle.min.js\"\n * >\n *\n * \n *\n * @example Module - Node lazy loading\n * const { Client } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\n * .catch(err => err);\n *\n * const results = await Client.DecodeVin('3VWD07AJ5EM388202')\n * .catch(err => err)\n *\n * @example Module - Browser lazy loading\n * \n *\n */\nconst Client: NHTSA = new NHTSA();\n\nexport { Client };\n"],"names":["getTypeof","value","toString","Object","prototype","call","toLowerCase","slice","length","TRANSLITERATION_TABLE","A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z","WEIGHTS_ARRAY","DEFAULT_CONFIG","apiResponseFormat","baseUrl","options","Fetch","[object Object]","userConfig","finalConfig","this","params","allowEmptyStringValues","format","Promise","reject","Error","entries","paramsLength","resolve","isPrepended","queryStringArray","map","key","index","prepend","append","typeofValue","encodeURI","join","makeQueryString","url","typeofUrl","typeofOptions","combinedOptions","response","fetch","then","result","status","statusText","headers","catch","err","NhtsaResponse","json","finalResult","FetchResponse","ok","redirected","DecodeVin","super","vin","action","typeofParams","typeofVin","typeofModelYear","modelYear","queryString","buildQueryString","get","DecodeVinExtended","DecodeVinValues","DecodeVINValuesBatch","inputString","typeofInputString","body","method","content-type","DecodeVinValuesExtended","DecodeWMI","WMI","typeofWMI","GetAllMakes","GetAllManufacturers","typeofManufacturerType","manufacturerType","typeofPage","page","GetCanadianVehicleSpecifications","typeofYear","year","typeofMake","make","typeofModel","model","typeofUnits","units","params_","GetEquipmentPlantCodes","typeofEquipmentType","equipmentType","typeofReportType","reportType","GetMakeForManufacturer","manufacturer","typeofManufacturer","GetMakesForManufacturerAndYear","GetMakesForVehicleType","typeName","typeofTypeName","GetManufacturerDetails","GetModelsForMake","makeName","typeofMakeName","GetModelsForMakeId","makeID","typeofMakeId","GetModelsForMakeIdYear","makeId","vehicleType","typeofVehicleType","actionUrl","GetModelsForMakeYear","GetParts","type","fromDate","toDate","typeofType","typeofFromDate","typeofToDate","GetVehicleTypesForMake","GetVehicleTypesForMakeId","GetVehicleVariableList","GetVehicleVariableValuesList","variableValue","typeofVariableValue","GetWMIsForManufacturer","NHTSA","Client","vinArray","toUpperCase","split","checkDigit","isNaN","parseInt","checkValue","digit","digitValue","reduce","acc","currVal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,EACjC,OAAO,EAQT,MAAMG,EAAoC,MAAfH,EAAqB,GAAKE,SAASF,GAiC9D,OAtBEH,EACG5G,IAAI,CAACmH,EAAejH,KACnB,IAAIkH,EAGCA,EADLJ,MAAMC,SAASE,IACGhK,EAAsBgK,GACtBF,SAASE,GAM3B,OAAOC,EAHgBzI,EAAcuB,KAMtCmH,OAAO,CAACC,EAAKC,IAAcD,EAAMC,EAAW,GAAK,KAOlCL"} \ No newline at end of file diff --git a/dist/bundle.min.js b/dist/bundle.min.js index bb56d471d..fdb95ebe9 100644 --- a/dist/bundle.min.js +++ b/dist/bundle.min.js @@ -1,2 +1,2 @@ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("cross-fetch")):"function"==typeof define&&define.amd?define(["exports","cross-fetch"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).NHTSA={},e.fetch)}(this,(function(e,r){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(r),n=Object.freeze({__proto__:null});function s(e,r,t,o){return new(t||(t=Promise))((function(n,s){function i(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){e.done?n(e.value):new t((function(r){r(e.value)})).then(i,a)}c((o=o.apply(e,r||[])).next())}))}function i(e){const r=Object.prototype.toString.call(e).toLowerCase();return r.slice(8,r.length-1)}const a={A:1,B:2,C:3,D:4,E:5,F:6,G:7,H:8,J:1,K:2,L:3,M:4,N:5,P:7,R:9,S:2,T:3,U:4,V:5,W:6,X:7,Y:8,Z:9},c=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];const u={apiResponseFormat:"json",baseUrl:"https://vpic.nhtsa.dot.gov/api/vehicles",options:{}};class d{constructor(e){let r;r=e&&"object"===i(e)?Object.assign(Object.assign(Object.assign({},u),e),{options:Object.assign(Object.assign({},u.options),e.options)}):Object.assign({},u),this.apiResponseFormat="json",this.baseUrl=r.baseUrl,this.options=r.options}buildQueryString(e,r=!1){return s(this,void 0,void 0,(function*(){return e=e&&"object"===i(e)?Object.assign(Object.assign({},e),{format:this.apiResponseFormat}):{format:this.apiResponseFormat},yield function(e={},r=!1){if("object"!==i(e))return Promise.reject(new Error("queryString(params) - expected params in the form of an object, got: "+e));const t=Object.entries(e),o=t.length;if(o<1)return Promise.resolve("");let n=!1;const s=t.map(([e,t],s)=>{let a="",c="";const u=i(t);if(t&&"number"===u&&(t=t.toString()),(t||r)&&("string"===u||"number"===u))return n||(a="?",n=!0),s{if(!(null==e?void 0:e.status)||e.status>=400)throw new Error(`Bad response from server, code: ${null==e?void 0:e.status}, text: ${null==e?void 0:e.statusText}, headers: ${null==e?void 0:e.headers}`);return e}).catch(e=>Promise.reject(new Error("Fetch.get() http error: "+e))),c=yield a.json().then(e=>e),u=Object.assign(Object.assign({},c),{FetchResponse:{headers:a.headers,ok:a.ok,redirected:a.redirected,status:a.status,statusText:a.statusText,url:a.url}});return Promise.resolve(u)}))}}class l extends d{constructor(e){super(e)}DecodeVin(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVin",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVin, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVin, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVin, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class m extends d{constructor(e){super(e)}DecodeVinExtended(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVinExtended",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVinExtended, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVinExtended, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVinExtended, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class g extends d{constructor(e){super(e)}DecodeVinValues(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVinValues",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVinValues, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVinValues, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"string"!==s&&"number"!==s)return Promise.reject(new Error(`DecodeVinValues, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class h extends d{constructor(e){super(e)}DecodeVINValuesBatch(e){return s(this,void 0,void 0,(function*(){const r="DecodeVINValuesBatch",t=i(e);if("string"!==t)return Promise.reject(new Error(`DecodeVINValuesBatch, "inputString" argument is required and must be of type string, got: <${t}> ${e}`));const o=`${this.baseUrl}/${r}/`,n=encodeURI(`DATA=${e}&format=json`);return yield this.get(o,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:n}).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class $ extends d{constructor(e){super(e)}DecodeVinValuesExtended(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVinValuesExtended",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVinValuesExtended, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVinValuesExtended, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVinValuesExtended, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class p extends d{constructor(e){super(e)}DecodeWMI(e){return s(this,void 0,void 0,(function*(){const r="DecodeWMI",t=i(e);if("string"!==t)return Promise.reject(new Error(`DecodeWMI, "WMI" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class y extends d{constructor(e){super(e)}GetAllMakes(){return s(this,void 0,void 0,(function*(){const e=yield this.buildQueryString().catch(e=>Promise.reject(new Error("GetAllMakes, Error building query string: "+e))),r=`${this.baseUrl}/GetAllMakes${e}`;return yield this.get(r).then(e=>e).catch(e=>Promise.reject(new Error("GetAllMakes, Fetch.get() error: "+e)))}))}}class f extends d{constructor(e){super(e)}GetAllManufacturers(e={}){return s(this,void 0,void 0,(function*(){const r="GetAllManufacturers",t=i(e);if("object"!==t)return Promise.reject(new Error(`GetAllManufacturers, "params" argument must be of type object, got: <${t}> ${e}`));const o=i(e.manufacturerType);if(e.manufacturerType&&"string"!==o)return Promise.reject(new Error(`GetAllManufacturers, "params.manufacturerType" argument must be of type string, got: <${o}> ${e.manufacturerType}`));const n=i(e.page);if(e.page&&"number"!==n)return Promise.reject(new Error(`GetAllManufacturers, "params.page" argument must be of type number, got: <${n}> ${e.page}`));const s=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),a=`${this.baseUrl}/${r}${s}`;return yield this.get(a).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class b extends d{constructor(e){super(e)}GetCanadianVehicleSpecifications(e){return s(this,void 0,void 0,(function*(){const r="GetCanadianVehicleSpecifications",t=i(e);if("object"!==t)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params" argument must be of type object, got: <${t}> ${e}`));const o=i(e.year);if("number"!==o)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.year" argument is required and must be of type number, got: <${o}> ${e.year}`));const n=i(e.make);if(e.make&&"string"!==n)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.make" argument must be of type string, got: <${n}> ${e.make}`));const s=i(e.model);if(e.model&&"string"!==s)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.model" argument must be of type string, got: <${s}> ${e.model}`));const a=i(e.units);if(e.units&&"string"!==a)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.units" argument must be of type string, got: <${a}> ${e.units}`));const c=e.make||"",u=e.model||"",d=e.units||"",l={year:e.year,make:c,model:u,units:d},m=yield this.buildQueryString(l,!0).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),g=`${this.baseUrl}/${r}${m}`;return yield this.get(g).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class j extends d{constructor(e){super(e)}GetEquipmentPlantCodes(e){return s(this,void 0,void 0,(function*(){const r="GetEquipmentPlantCodes",t=i(e);if("object"!==t)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params" argument must be of type object, got: <${t}> ${e}`));const o=i(e.year);if("number"!==o)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.year" argument is required and must be of type number, got: <${o}> ${e.year}`));const n=i(e.equipmentType);if("number"!==n)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.equipmentType" argument is required and must be of type number, got: <${n}> ${e.equipmentType}`));const s=i(e.reportType);if("string"!==s)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.reportType" argument is required and must be of type string, got: <${s}> ${e.reportType}`));const a=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),c=`${this.baseUrl}/${r}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class E extends d{constructor(e){super(e)}GetMakeForManufacturer(e){return s(this,void 0,void 0,(function*(){const r="GetMakeForManufacturer",t=i(e);if("string"!==t&&"number"!==t)return Promise.reject(new Error(`GetMakeForManufacturer, "manufacturer" argument is required and must be of type string or number, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class M extends d{constructor(e){super(e)}GetMakesForManufacturerAndYear(e,r){return s(this,void 0,void 0,(function*(){const t="GetMakesForManufacturerAndYear",o=i(e);if("string"!==o&&"number"!==o)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "manufacturer" argument is required and must be of type string or number, got: <${o}> ${e}`));const n=i(r);if("object"!==n)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params" argument is required and must be of type object, got: <${n}> ${r}`));const s=i(r.year);if("number"!==s)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params.year" argument is required and must be of type number, got: <${s}> ${r.year}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class G extends d{constructor(e){super(e)}GetMakesForVehicleType(e){return s(this,void 0,void 0,(function*(){const r="GetMakesForVehicleType",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetMakesForVehicleType, "typeName" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class P extends d{constructor(e){super(e)}GetManufacturerDetails(e){return s(this,void 0,void 0,(function*(){const r="GetManufacturerDetails",t=i(e);if("string"!==t&&"number"!==t)return Promise.reject(new Error(`GetManufacturerDetails, "manufacturer" argument is required and must be of type string or number, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class V extends d{constructor(e){super(e)}GetModelsForMake(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMake",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetModelsForMake, "makeName" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class w extends d{constructor(e){super(e)}GetModelsForMakeId(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMakeId",t=i(e);if("number"!==t)return Promise.reject(new Error(`GetModelsForMakeId, "makeId" argument is required and must be of type number, got: <${t}> ${e}`));const o=yield this.buildQueryString({}).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class F extends d{constructor(e){super(e)}GetModelsForMakeIdYear(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMakeIdYear",t=null==e?void 0:e.makeId,o=null==e?void 0:e.modelYear,n=null==e?void 0:e.vehicleType,s=i(e);if("object"!==s)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params" argument must be of type object, got: <${s}> ${e}`));const a=i(t);if("number"!==a)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.makeId" argument is required and must be of type number, got: <${a}> ${t}`));if(!o&&!n)return Promise.reject(new Error(`GetModelsForMakeIdYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${o} | ${n}`));const c=i(o);if(o&&"number"!==c)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.modelYear" must be of type number, got: <${c}> ${o}`));const u=i(n);if(n&&"string"!==u)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.vehicleType" must be of type string, got: <${u}> ${n}`));let d=`${r}/makeId/${t}/`;d+=o&&n?`modelYear/${o}/vehicleType/${n}`:o?"modelYear/"+o:"vehicleType/"+n;const l=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),m=`${this.baseUrl}/${d}${l}`;return yield this.get(m).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class v extends d{constructor(e){super(e)}GetModelsForMakeYear(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMakeYear",t=null==e?void 0:e.make,o=null==e?void 0:e.modelYear,n=null==e?void 0:e.vehicleType,s=i(e);if("object"!==s)return Promise.reject(new Error(`GetModelsForMakeYear, "params" argument must be of type object, got: <${s}> ${e}`));const a=i(t);if("string"!==a)return Promise.reject(new Error(`GetModelsForMakeYear, "params.make" argument is required and must be of type string, got: <${a}> ${t}`));if(!o&&!n)return Promise.reject(new Error(`GetModelsForMakeYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${o} | ${n}`));const c=i(o);if(o&&"number"!==c)return Promise.reject(new Error(`GetModelsForMakeYear, "params.modelYear" must be of type number, got: <${c}> ${o}`));const u=i(n);if(n&&"string"!==u)return Promise.reject(new Error(`GetModelsForMakeYear, "params.vehicleType" must be of type string, got: <${u}> ${n}`));let d=`${r}/make/${e.make}/`;d+=o&&n?`modelYear/${o}/vehicleType/${n}`:o?"modelYear/"+o:"vehicleType/"+n;const l=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),m=`${this.baseUrl}/${d}${l}`;return yield this.get(m).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class k extends d{constructor(e){super(e)}GetParts(e){return s(this,void 0,void 0,(function*(){const r="GetParts",t=null==e?void 0:e.type,o=null==e?void 0:e.fromDate,n=null==e?void 0:e.toDate,s=null==e?void 0:e.page,a=i(e);if(e&&"object"!==a)return Promise.reject(new Error(`${r}, "params" argument must be of type object, got: <${a}> ${e}`));const c=i(t);if(t&&"number"!==c)return Promise.reject(new Error(`${r}, "params.type" argument must be of type number, got: <${c}> ${t}`));const u=i(o);if(o&&"string"!==u)return Promise.reject(new Error(`${r}, "params.fromDate" argument must be of type string, got: <${u}> ${o}`));const d=i(n);if(n&&"string"!==d)return Promise.reject(new Error(`${r}, "params.toDate" argument must be of type string, got: <${d}> ${n}`));const l=i(s);if(s&&"number"!==l)return Promise.reject(new Error(`${r}, "params.page" argument must be of type number, got: <${l}> ${s}`));const m=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),g=`${this.baseUrl}/${r}${m}`;return yield this.get(g).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class q extends d{constructor(e){super(e)}GetVehicleTypesForMake(e){return s(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMake",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetVehicleTypesForMake, "makeName" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class D extends d{constructor(e){super(e)}GetVehicleTypesForMakeId(e){return s(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMakeId",t=i(e);if("number"!==t)return Promise.reject(new Error(`GetVehicleTypesForMakeId, "makeId" argument is required and must be of type number, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class Y extends d{constructor(e){super(e)}GetVehicleVariableList(){return s(this,void 0,void 0,(function*(){const e="GetVehicleVariableList",r=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),t=`${this.baseUrl}/${e}${r}`;return yield this.get(t).then(e=>e).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}class I extends d{constructor(e){super(e)}GetVehicleVariableValuesList(e){return s(this,void 0,void 0,(function*(){const r="GetVehicleVariableValuesList",t=i(e);if("string"!==t&&"number"!==t)return Promise.reject(new Error(`GetVehicleVariableValuesList, "variableValue" argument is required and must be of type string or number, got: <${t}> ${e}`));"string"===t&&(e=encodeURI(e));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class x extends d{constructor(e){super(e)}GetWMIsForManufacturer(e){return s(this,void 0,void 0,(function*(){const r="GetWMIsForManufacturer",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetWMIsForManufacturer, "manufacturer" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class T extends d{constructor(e){super(e),this.DecodeVin=l.prototype.DecodeVin,this.DecodeVinExtended=m.prototype.DecodeVinExtended,this.DecodeVinValues=g.prototype.DecodeVinValues,this.DecodeVINValuesBatch=h.prototype.DecodeVINValuesBatch,this.DecodeVinValuesExtended=$.prototype.DecodeVinValuesExtended,this.DecodeWMI=p.prototype.DecodeWMI,this.GetAllMakes=y.prototype.GetAllMakes,this.GetAllManufacturers=f.prototype.GetAllManufacturers,this.GetCanadianVehicleSpecifications=b.prototype.GetCanadianVehicleSpecifications,this.GetEquipmentPlantCodes=j.prototype.GetEquipmentPlantCodes,this.GetMakeForManufacturer=E.prototype.GetMakeForManufacturer,this.GetMakesForManufacturerAndYear=M.prototype.GetMakesForManufacturerAndYear,this.GetMakesForVehicleType=G.prototype.GetMakesForVehicleType,this.GetManufacturerDetails=P.prototype.GetManufacturerDetails,this.GetModelsForMake=V.prototype.GetModelsForMake,this.GetModelsForMakeId=w.prototype.GetModelsForMakeId,this.GetModelsForMakeIdYear=F.prototype.GetModelsForMakeIdYear,this.GetModelsForMakeYear=v.prototype.GetModelsForMakeYear,this.GetParts=k.prototype.GetParts,this.GetVehicleTypesForMake=q.prototype.GetVehicleTypesForMake,this.GetVehicleTypesForMakeId=D.prototype.GetVehicleTypesForMakeId,this.GetVehicleVariableList=Y.prototype.GetVehicleVariableList,this.GetVehicleVariableValuesList=I.prototype.GetVehicleVariableValuesList,this.GetWMIsForManufacturer=x.prototype.GetWMIsForManufacturer}}const S=new T;e.ActionTypes=n,e.Client=S,e.DecodeVINValuesBatch=h,e.DecodeVin=l,e.DecodeVinExtended=m,e.DecodeVinValues=g,e.DecodeVinValuesExtended=$,e.DecodeWMI=p,e.Fetch=d,e.GetAllMakes=y,e.GetAllManufacturers=f,e.GetCanadianVehicleSpecifications=b,e.GetEquipmentPlantCodes=j,e.GetMakeForManufacturer=E,e.GetMakesForManufacturerAndYear=M,e.GetMakesForVehicleType=G,e.GetManufacturerDetails=P,e.GetModelsForMake=V,e.GetModelsForMakeId=w,e.GetModelsForMakeIdYear=F,e.GetModelsForMakeYear=v,e.GetParts=k,e.GetVehicleTypesForMake=q,e.GetVehicleTypesForMakeId=D,e.GetVehicleVariableList=Y,e.GetVehicleVariableValuesList=I,e.GetWMIsForManufacturer=x,e.NHTSA=T,e.isValidVin=function(e){if("string"!=typeof e||17!=e.length)return!1;const r=(e=e.toUpperCase()).split(""),t=r[8];if(isNaN(parseInt(t))&&"X"!==t)return!1;const o="X"===t?10:parseInt(t);return r.map((e,r)=>{let t;t=isNaN(parseInt(e))?a[e]:parseInt(e);return t*c[r]}).reduce((e,r)=>e+r,0)%11===o}})); +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("cross-fetch")):"function"==typeof define&&define.amd?define(["exports","cross-fetch"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).NHTSA={},e.fetch)}(this,(function(e,r){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(r),n=Object.freeze({__proto__:null});function s(e,r,t,o){return new(t||(t=Promise))((function(n,s){function i(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var r;e.done?n(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(i,a)}c((o=o.apply(e,r||[])).next())}))}function i(e){const r=Object.prototype.toString.call(e).toLowerCase();return r.slice(8,r.length-1)}const a={A:1,B:2,C:3,D:4,E:5,F:6,G:7,H:8,J:1,K:2,L:3,M:4,N:5,P:7,R:9,S:2,T:3,U:4,V:5,W:6,X:7,Y:8,Z:9},c=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];const u={apiResponseFormat:"json",baseUrl:"https://vpic.nhtsa.dot.gov/api/vehicles",options:{}};class d{constructor(e){let r;r=e&&"object"===i(e)?Object.assign(Object.assign(Object.assign({},u),e),{options:Object.assign(Object.assign({},u.options),e.options)}):Object.assign({},u),this.apiResponseFormat="json",this.baseUrl=r.baseUrl,this.options=r.options}buildQueryString(e,r=!1){return s(this,void 0,void 0,(function*(){return e=e&&"object"===i(e)?Object.assign(Object.assign({},e),{format:this.apiResponseFormat}):{format:this.apiResponseFormat},yield function(e={},r=!1){if("object"!==i(e))return Promise.reject(new Error("queryString(params) - expected params in the form of an object, got: "+e));const t=Object.entries(e),o=t.length;if(o<1)return Promise.resolve("");let n=!1;const s=t.map(([e,t],s)=>{let a="",c="";const u=i(t);if(t&&"number"===u&&(t=t.toString()),(t||r)&&("string"===u||"number"===u))return n||(a="?",n=!0),s{if(!(null==e?void 0:e.status)||e.status>=400)throw new Error(`Bad response from server, code: ${null==e?void 0:e.status}, text: ${null==e?void 0:e.statusText}, headers: ${null==e?void 0:e.headers}`);return e}).catch(e=>Promise.reject(new Error("Fetch.get() http error: "+e))),c=yield a.json().then(e=>e),u=Object.assign(Object.assign({},c),{FetchResponse:{headers:a.headers,ok:a.ok,redirected:a.redirected,status:a.status,statusText:a.statusText,url:a.url}});return Promise.resolve(u)}))}}class l extends d{constructor(e){super(e)}DecodeVin(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVin",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVin, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVin, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVin, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class m extends d{constructor(e){super(e)}DecodeVinExtended(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVinExtended",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVinExtended, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVinExtended, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVinExtended, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class g extends d{constructor(e){super(e)}DecodeVinValues(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVinValues",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVinValues, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVinValues, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"string"!==s&&"number"!==s)return Promise.reject(new Error(`DecodeVinValues, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class h extends d{constructor(e){super(e)}DecodeVINValuesBatch(e){return s(this,void 0,void 0,(function*(){const r="DecodeVINValuesBatch",t=i(e);if("string"!==t)return Promise.reject(new Error(`DecodeVINValuesBatch, "inputString" argument is required and must be of type string, got: <${t}> ${e}`));const o=`${this.baseUrl}/${r}/`,n=encodeURI(`DATA=${e}&format=json`);return yield this.get(o,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:n}).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class $ extends d{constructor(e){super(e)}DecodeVinValuesExtended(e,r){return s(this,void 0,void 0,(function*(){const t="DecodeVinValuesExtended",o=i(r);if(r&&"object"!==o)return Promise.reject(new Error(`DecodeVinValuesExtended, "params" argument must be of type object, got: <${o}> ${r}`));const n=i(e);if("string"!==n)return Promise.reject(new Error(`DecodeVinValuesExtended, "vin" argument is required and must be of type string, got: <${n}> ${e}`));const s=i(null==r?void 0:r.modelYear);if((null==r?void 0:r.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVinValuesExtended, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${r.modelYear}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class p extends d{constructor(e){super(e)}DecodeWMI(e){return s(this,void 0,void 0,(function*(){const r="DecodeWMI",t=i(e);if("string"!==t)return Promise.reject(new Error(`DecodeWMI, "WMI" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class y extends d{constructor(e){super(e)}GetAllMakes(){return s(this,void 0,void 0,(function*(){const e=yield this.buildQueryString().catch(e=>Promise.reject(new Error("GetAllMakes, Error building query string: "+e))),r=`${this.baseUrl}/GetAllMakes${e}`;return yield this.get(r).then(e=>e).catch(e=>Promise.reject(new Error("GetAllMakes, Fetch.get() error: "+e)))}))}}class f extends d{constructor(e){super(e)}GetAllManufacturers(e={}){return s(this,void 0,void 0,(function*(){const r="GetAllManufacturers",t=i(e);if("object"!==t)return Promise.reject(new Error(`GetAllManufacturers, "params" argument must be of type object, got: <${t}> ${e}`));const o=i(e.manufacturerType);if(e.manufacturerType&&"string"!==o)return Promise.reject(new Error(`GetAllManufacturers, "params.manufacturerType" argument must be of type string, got: <${o}> ${e.manufacturerType}`));const n=i(e.page);if(e.page&&"number"!==n)return Promise.reject(new Error(`GetAllManufacturers, "params.page" argument must be of type number, got: <${n}> ${e.page}`));const s=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),a=`${this.baseUrl}/${r}${s}`;return yield this.get(a).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class b extends d{constructor(e){super(e)}GetCanadianVehicleSpecifications(e){return s(this,void 0,void 0,(function*(){const r="GetCanadianVehicleSpecifications",t=i(e);if("object"!==t)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params" argument must be of type object, got: <${t}> ${e}`));const o=i(e.year);if("number"!==o)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.year" argument is required and must be of type number, got: <${o}> ${e.year}`));const n=i(e.make);if(e.make&&"string"!==n)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.make" argument must be of type string, got: <${n}> ${e.make}`));const s=i(e.model);if(e.model&&"string"!==s)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.model" argument must be of type string, got: <${s}> ${e.model}`));const a=i(e.units);if(e.units&&"string"!==a)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.units" argument must be of type string, got: <${a}> ${e.units}`));const c=e.make||"",u=e.model||"",d=e.units||"",l={year:e.year,make:c,model:u,units:d},m=yield this.buildQueryString(l,!0).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),g=`${this.baseUrl}/${r}${m}`;return yield this.get(g).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class j extends d{constructor(e){super(e)}GetEquipmentPlantCodes(e){return s(this,void 0,void 0,(function*(){const r="GetEquipmentPlantCodes",t=i(e);if("object"!==t)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params" argument must be of type object, got: <${t}> ${e}`));const o=i(e.year);if("number"!==o)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.year" argument is required and must be of type number, got: <${o}> ${e.year}`));const n=i(e.equipmentType);if("number"!==n)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.equipmentType" argument is required and must be of type number, got: <${n}> ${e.equipmentType}`));const s=i(e.reportType);if("string"!==s)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.reportType" argument is required and must be of type string, got: <${s}> ${e.reportType}`));const a=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),c=`${this.baseUrl}/${r}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class E extends d{constructor(e){super(e)}GetMakeForManufacturer(e){return s(this,void 0,void 0,(function*(){const r="GetMakeForManufacturer",t=i(e);if("string"!==t&&"number"!==t)return Promise.reject(new Error(`GetMakeForManufacturer, "manufacturer" argument is required and must be of type string or number, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class M extends d{constructor(e){super(e)}GetMakesForManufacturerAndYear(e,r){return s(this,void 0,void 0,(function*(){const t="GetMakesForManufacturerAndYear",o=i(e);if("string"!==o&&"number"!==o)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "manufacturer" argument is required and must be of type string or number, got: <${o}> ${e}`));const n=i(r);if("object"!==n)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params" argument is required and must be of type object, got: <${n}> ${r}`));const s=i(r.year);if("number"!==s)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params.year" argument is required and must be of type number, got: <${s}> ${r.year}`));const a=yield this.buildQueryString(r).catch(e=>Promise.reject(new Error(`${t}, Error building query string: ${e}`))),c=`${this.baseUrl}/${t}/${e}${a}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}class G extends d{constructor(e){super(e)}GetMakesForVehicleType(e){return s(this,void 0,void 0,(function*(){const r="GetMakesForVehicleType",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetMakesForVehicleType, "typeName" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class P extends d{constructor(e){super(e)}GetManufacturerDetails(e){return s(this,void 0,void 0,(function*(){const r="GetManufacturerDetails",t=i(e);if("string"!==t&&"number"!==t)return Promise.reject(new Error(`GetManufacturerDetails, "manufacturer" argument is required and must be of type string or number, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class V extends d{constructor(e){super(e)}GetModelsForMake(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMake",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetModelsForMake, "makeName" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class w extends d{constructor(e){super(e)}GetModelsForMakeId(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMakeId",t=i(e);if("number"!==t)return Promise.reject(new Error(`GetModelsForMakeId, "makeId" argument is required and must be of type number, got: <${t}> ${e}`));const o=yield this.buildQueryString({}).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class F extends d{constructor(e){super(e)}GetModelsForMakeIdYear(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMakeIdYear",t=null==e?void 0:e.makeId,o=null==e?void 0:e.modelYear,n=null==e?void 0:e.vehicleType,s=i(e);if("object"!==s)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params" argument must be of type object, got: <${s}> ${e}`));const a=i(t);if("number"!==a)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.makeId" argument is required and must be of type number, got: <${a}> ${t}`));if(!o&&!n)return Promise.reject(new Error(`GetModelsForMakeIdYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${o} | ${n}`));const c=i(o);if(o&&"number"!==c)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.modelYear" must be of type number, got: <${c}> ${o}`));const u=i(n);if(n&&"string"!==u)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.vehicleType" must be of type string, got: <${u}> ${n}`));let d=`${r}/makeId/${t}/`;d+=o&&n?`modelYear/${o}/vehicleType/${n}`:o?"modelYear/"+o:"vehicleType/"+n;const l=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),m=`${this.baseUrl}/${d}${l}`;return yield this.get(m).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class v extends d{constructor(e){super(e)}GetModelsForMakeYear(e){return s(this,void 0,void 0,(function*(){const r="GetModelsForMakeYear",t=null==e?void 0:e.make,o=null==e?void 0:e.modelYear,n=null==e?void 0:e.vehicleType,s=i(e);if("object"!==s)return Promise.reject(new Error(`GetModelsForMakeYear, "params" argument must be of type object, got: <${s}> ${e}`));const a=i(t);if("string"!==a)return Promise.reject(new Error(`GetModelsForMakeYear, "params.make" argument is required and must be of type string, got: <${a}> ${t}`));if(!o&&!n)return Promise.reject(new Error(`GetModelsForMakeYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${o} | ${n}`));const c=i(o);if(o&&"number"!==c)return Promise.reject(new Error(`GetModelsForMakeYear, "params.modelYear" must be of type number, got: <${c}> ${o}`));const u=i(n);if(n&&"string"!==u)return Promise.reject(new Error(`GetModelsForMakeYear, "params.vehicleType" must be of type string, got: <${u}> ${n}`));let d=`${r}/make/${e.make}/`;d+=o&&n?`modelYear/${o}/vehicleType/${n}`:o?"modelYear/"+o:"vehicleType/"+n;const l=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),m=`${this.baseUrl}/${d}${l}`;return yield this.get(m).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class k extends d{constructor(e){super(e)}GetParts(e){return s(this,void 0,void 0,(function*(){const r="GetParts",t=null==e?void 0:e.type,o=null==e?void 0:e.fromDate,n=null==e?void 0:e.toDate,s=null==e?void 0:e.page,a=i(e);if(e&&"object"!==a)return Promise.reject(new Error(`${r}, "params" argument must be of type object, got: <${a}> ${e}`));const c=i(t);if(t&&"number"!==c)return Promise.reject(new Error(`${r}, "params.type" argument must be of type number, got: <${c}> ${t}`));const u=i(o);if(o&&"string"!==u)return Promise.reject(new Error(`${r}, "params.fromDate" argument must be of type string, got: <${u}> ${o}`));const d=i(n);if(n&&"string"!==d)return Promise.reject(new Error(`${r}, "params.toDate" argument must be of type string, got: <${d}> ${n}`));const l=i(s);if(s&&"number"!==l)return Promise.reject(new Error(`${r}, "params.page" argument must be of type number, got: <${l}> ${s}`));const m=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),g=`${this.baseUrl}/${r}${m}`;return yield this.get(g).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class q extends d{constructor(e){super(e)}GetVehicleTypesForMake(e){return s(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMake",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetVehicleTypesForMake, "makeName" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class D extends d{constructor(e){super(e)}GetVehicleTypesForMakeId(e){return s(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMakeId",t=i(e);if("number"!==t)return Promise.reject(new Error(`GetVehicleTypesForMakeId, "makeId" argument is required and must be of type number, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class Y extends d{constructor(e){super(e)}GetVehicleVariableList(){return s(this,void 0,void 0,(function*(){const e="GetVehicleVariableList",r=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),t=`${this.baseUrl}/${e}${r}`;return yield this.get(t).then(e=>e).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}class I extends d{constructor(e){super(e)}GetVehicleVariableValuesList(e){return s(this,void 0,void 0,(function*(){const r="GetVehicleVariableValuesList",t=i(e);if("string"!==t&&"number"!==t)return Promise.reject(new Error(`GetVehicleVariableValuesList, "variableValue" argument is required and must be of type string or number, got: <${t}> ${e}`));"string"===t&&(e=encodeURI(e));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class x extends d{constructor(e){super(e)}GetWMIsForManufacturer(e){return s(this,void 0,void 0,(function*(){const r="GetWMIsForManufacturer",t=i(e);if("string"!==t)return Promise.reject(new Error(`GetWMIsForManufacturer, "manufacturer" argument is required and must be of type string, got: <${t}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class T extends d{constructor(e){super(e),this.DecodeVin=l.prototype.DecodeVin,this.DecodeVinExtended=m.prototype.DecodeVinExtended,this.DecodeVinValues=g.prototype.DecodeVinValues,this.DecodeVINValuesBatch=h.prototype.DecodeVINValuesBatch,this.DecodeVinValuesExtended=$.prototype.DecodeVinValuesExtended,this.DecodeWMI=p.prototype.DecodeWMI,this.GetAllMakes=y.prototype.GetAllMakes,this.GetAllManufacturers=f.prototype.GetAllManufacturers,this.GetCanadianVehicleSpecifications=b.prototype.GetCanadianVehicleSpecifications,this.GetEquipmentPlantCodes=j.prototype.GetEquipmentPlantCodes,this.GetMakeForManufacturer=E.prototype.GetMakeForManufacturer,this.GetMakesForManufacturerAndYear=M.prototype.GetMakesForManufacturerAndYear,this.GetMakesForVehicleType=G.prototype.GetMakesForVehicleType,this.GetManufacturerDetails=P.prototype.GetManufacturerDetails,this.GetModelsForMake=V.prototype.GetModelsForMake,this.GetModelsForMakeId=w.prototype.GetModelsForMakeId,this.GetModelsForMakeIdYear=F.prototype.GetModelsForMakeIdYear,this.GetModelsForMakeYear=v.prototype.GetModelsForMakeYear,this.GetParts=k.prototype.GetParts,this.GetVehicleTypesForMake=q.prototype.GetVehicleTypesForMake,this.GetVehicleTypesForMakeId=D.prototype.GetVehicleTypesForMakeId,this.GetVehicleVariableList=Y.prototype.GetVehicleVariableList,this.GetVehicleVariableValuesList=I.prototype.GetVehicleVariableValuesList,this.GetWMIsForManufacturer=x.prototype.GetWMIsForManufacturer}}const S=new T;e.ActionTypes=n,e.Client=S,e.DecodeVINValuesBatch=h,e.DecodeVin=l,e.DecodeVinExtended=m,e.DecodeVinValues=g,e.DecodeVinValuesExtended=$,e.DecodeWMI=p,e.Fetch=d,e.GetAllMakes=y,e.GetAllManufacturers=f,e.GetCanadianVehicleSpecifications=b,e.GetEquipmentPlantCodes=j,e.GetMakeForManufacturer=E,e.GetMakesForManufacturerAndYear=M,e.GetMakesForVehicleType=G,e.GetManufacturerDetails=P,e.GetModelsForMake=V,e.GetModelsForMakeId=w,e.GetModelsForMakeIdYear=F,e.GetModelsForMakeYear=v,e.GetParts=k,e.GetVehicleTypesForMake=q,e.GetVehicleTypesForMakeId=D,e.GetVehicleVariableList=Y,e.GetVehicleVariableValuesList=I,e.GetWMIsForManufacturer=x,e.NHTSA=T,e.isValidVin=function(e){if("string"!=typeof e||17!=e.length)return!1;const r=(e=e.toUpperCase()).split(""),t=r[8];if(isNaN(parseInt(t))&&"X"!==t)return!1;const o="X"===t?10:parseInt(t);return r.map((e,r)=>{let t;t=isNaN(parseInt(e))?a[e]:parseInt(e);return t*c[r]}).reduce((e,r)=>e+r,0)%11===o}})); //# sourceMappingURL=bundle.min.js.map diff --git a/dist/bundle.min.js.gz b/dist/bundle.min.js.gz index fe7c5137f..f8c3191ae 100644 Binary files a/dist/bundle.min.js.gz and b/dist/bundle.min.js.gz differ diff --git a/dist/bundle.min.js.map b/dist/bundle.min.js.map index 4065090eb..8c170684f 100644 --- a/dist/bundle.min.js.map +++ b/dist/bundle.min.js.map @@ -1 +1 @@ -{"version":3,"file":"bundle.min.js","sources":["../src/utils/getTypeof.ts","../src/utils/isValidVin.ts","../src/api/Fetch.ts","../src/utils/makeQueryString.ts","../src/api/actions/DecodeVin.ts","../src/api/actions/DecodeVinExtended.ts","../src/api/actions/DecodeVinValues.ts","../src/api/actions/DecodeVINValuesBatch.ts","../src/api/actions/DecodeVinValuesExtended.ts","../src/api/actions/DecodeWMI.ts","../src/api/actions/GetAllMakes.ts","../src/api/actions/GetAllManufacturers.ts","../src/api/actions/GetCanadianVehicleSpecifications.ts","../src/api/actions/GetEquipmentPlantCodes.ts","../src/api/actions/GetMakeForManufacturer.ts","../src/api/actions/GetMakesForManufacturerAndYear.ts","../src/api/actions/GetMakesForVehicleType.ts","../src/api/actions/GetManufacturerDetails.ts","../src/api/actions/GetModelsForMake.ts","../src/api/actions/GetModelsForMakeId.ts","../src/api/actions/GetModelsForMakeIdYear.ts","../src/api/actions/GetModelsForMakeYear.ts","../src/api/actions/GetParts.ts","../src/api/actions/GetVehicleTypesForMake.ts","../src/api/actions/GetVehicleTypesForMakeId.ts","../src/api/actions/GetVehicleVariableList.ts","../src/api/actions/GetVehicleVariableValuesList.ts","../src/api/actions/GetWMIsForManufacturer.ts","../src/api/NHTSA.ts","../src/api/Client.ts"],"sourcesContent":["/**\r\n * @module utils/getTypeof\r\n * @category Utils\r\n */\r\n\r\n/**\r\n * Gets type of `value` using `Object.prototype.toString.call(value)`.\r\n *\r\n * @param {any} value - Any kind of value (string, object, array, function, etc).\r\n *\r\n * @returns {string} - Type of value, normalized to a lowercase string.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\r\nexport function getTypeof(value: any): string {\r\n const toString: string = Object.prototype.toString\r\n .call(value)\r\n .toLowerCase(); /* ex: => '[object string]' or '[object array], etc. */\r\n return toString.slice(8, toString.length - 1);\r\n}\r\n","/**\r\n * @module utils/isValidVin\r\n * @category Utils\r\n */\r\n\r\n/*\r\n * There will need to be some way to translate vin digits that are alphabetic\r\n * into their number value in the VIN algorithm transliteration table.\r\n * Later, during the creation of the checksum variable, those digits will be\r\n * multiplied against their corresponding weight (by index) in the WEIGHTS_ARRAY.\r\n * This transliteration table is a key part of the VIN validation algorithm.\r\n */\r\nconst TRANSLITERATION_TABLE: Record = {\r\n A: 1,\r\n B: 2,\r\n C: 3,\r\n D: 4,\r\n E: 5,\r\n F: 6,\r\n G: 7,\r\n H: 8,\r\n J: 1,\r\n K: 2,\r\n L: 3,\r\n M: 4,\r\n N: 5,\r\n P: 7,\r\n R: 9,\r\n S: 2,\r\n T: 3,\r\n U: 4,\r\n V: 5,\r\n W: 6,\r\n X: 7,\r\n Y: 8,\r\n Z: 9,\r\n};\r\n\r\n/*\r\n * Later, during the creation of the 'checksum' variable, these weights will be\r\n * multiplied by the value of their mirrored index vin digits.\r\n * The array index of each weight corresponds to the same index of each\r\n * digit in the 'vin'.\r\n */\r\nconst WEIGHTS_ARRAY: number[] = [\r\n 8,\r\n 7,\r\n 6,\r\n 5,\r\n 4,\r\n 3,\r\n 2,\r\n 10,\r\n 0,\r\n 9,\r\n 8,\r\n 7,\r\n 6,\r\n 5,\r\n 4,\r\n 3,\r\n 2,\r\n];\r\n\r\n/**\r\n * Provides **offline** validation of Vehicle Identification Numbers (VINs) using the\r\n * [VIN Check Algorithm](https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit).\r\n *\r\n * @param {string} vin - Vehicle Identification Number.\r\n * @returns {boolean} True for a valid VIN, false for an invalid VIN.\r\n *\r\n * @example When loaded from the browser via html script tags\r\n * // \r\n * const isValid = NHTSA.isValidVin('3VWD07AJ5EM388202')\r\n * console.log(isValid) // true\r\n *\r\n * @example When loaded as a module\r\n * import { isValidVin } from '@shaggytools/nhtsa-api-wrapper'\r\n * const isValid = isValidVin('3VWD07AJ5EM388202')\r\n * console.log(isValid) // true\r\n *\r\n */\r\nexport function isValidVin(vin: string): boolean {\r\n /* A valid VIN must be a string and is always exactly 17 digits */\r\n if (typeof vin !== 'string' || vin.length != 17) {\r\n return false;\r\n }\r\n\r\n /* Normalize the vin to all uppercase letters */\r\n vin = vin.toUpperCase();\r\n\r\n /* split the vin digits into an array */\r\n const vinArray: string[] = vin.split('');\r\n\r\n /* checkDigit will be tested against the checkSum later */\r\n const checkDigit: string = vinArray[8];\r\n\r\n /*\r\n * In a valid VIN, the checkDigit can either be:\r\n * a number, 0-9 inclusive OR the character 'X'\r\n */\r\n if (isNaN(parseInt(checkDigit)) && checkDigit !== 'X') {\r\n return false;\r\n }\r\n\r\n /*\r\n * The checkValue must be a digit and 'X' is the only valid alphabetic check value.\r\n * As per the algorithm, a checkDigit of 'X' is equal to a checkValue of `10` and needs\r\n * to be converted as such.\r\n */\r\n const checkValue: number = checkDigit === 'X' ? 10 : parseInt(checkDigit);\r\n\r\n /*\r\n * Maps the vinArray and converts any values (digits) that are alphabetic,\r\n * into numbers, using the TRANSLITERATION_TABLE.\r\n * Then these numbers are multiplied against their corresponding weight\r\n * in the WEIGHTS_ARRAY, matched by index position.\r\n * All 17 of those digitValues are then added together and divided by 11.\r\n * The remainder, or % modulo, of that division will be the final 'checksum'.\r\n */\r\n const checksum: number =\r\n vinArray\r\n .map((digit: string, index: number) => {\r\n let digitValue: number;\r\n /* Use the transliteration table to convert any Not a Number(NaN) values to numbers */\r\n isNaN(parseInt(digit))\r\n ? (digitValue = TRANSLITERATION_TABLE[digit])\r\n : (digitValue = parseInt(digit));\r\n\r\n /* Convert the digitValue to a weighted number corresponding to it's position, by index, in the weightsArray. */\r\n const weight: number = WEIGHTS_ARRAY[index];\r\n\r\n /* The final step for each digit is to multiply the digit by it's corresponding weight */\r\n return digitValue * weight;\r\n })\r\n /* Finally, get the sum of all digits and divide by 11, the remainder of that operation is the checksum */\r\n .reduce((acc, currValue) => acc + currValue, 0) % 11;\r\n\r\n /*\r\n * The checksum is compared against the checkValue we set earlier (the 9th digit of the VIN)\r\n * As per the algorithm, if they are equal to each other, then the VIN must be valid and\r\n * we return true, otherwise the VIN is invalid and we return false.\r\n */\r\n return checksum === checkValue;\r\n}\r\n","/**\r\n * @module api/Fetch\r\n * @category API\r\n * @description API Fetch Logic.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [Fetch](module-api_Fetch.Fetch.html)\r\n * > - Constant: [BASE_URL](#~BASE_URL)\r\n * > - Constant: [DEFAULT_CONFIG](#~DEFAULT_CONFIG)\r\n * >\r\n * > **Types**\r\n * > - Type: [ApiResponse](#ApiResponse)\r\n * > - Type: [FetchConfig](#FetchConfig)\r\n * > - Type: [FetchRequestOptions](#FetchRequestOptions)\r\n * > - Type: [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body)\r\n * > - Type: [FetchResponse](#FetchResponse)\r\n * > - Type: [NhtsaResponse](#NhtsaResponse)\r\n */\r\n\r\n/* Module Dependencies */\r\nimport fetch from 'cross-fetch';\r\n/* Utilities */\r\nimport { getTypeof, makeQueryString } from '../utils';\r\n/* Types */\r\nimport { QueryStringParameters } from '../utils/types';\r\n\r\n/*****************\r\n * CONSTANTS\r\n ****************/\r\n\r\n/**\r\n * @constant {string} BASE_URL Default Fetch base URL string\r\n * @default 'https://vpic.nhtsa.dot.gov/api/vehicles'\r\n */\r\nexport const BASE_URL = 'https://vpic.nhtsa.dot.gov/api/vehicles';\r\n\r\n/**\r\n * @constant {module:api/Fetch.FetchConfig} DEFAULT_CONFIG Default Fetch configuration options\r\n * @property {string} apiResponseFormat=json\r\n * @property {string} baseUrl=BASE_URL Default: [BASE_URL](module-api_Fetch.html#~BASE_URL)\r\n * @property {FetchRequestOptions} options={method:\"GET\"}\r\n */\r\nexport const DEFAULT_CONFIG: FetchConfig = {\r\n apiResponseFormat: 'json',\r\n baseUrl: BASE_URL,\r\n options: {},\r\n};\r\n\r\n/*****************\r\n * Fetch Class\r\n ****************/\r\n\r\n/**\r\n * Class wrapper containing API wrapper HTTP Fetch logic.\r\n *\r\n * > **Static Methods**:\r\n * > - [buildQueryString](#buildQueryString)\r\n * > - [get](#get)\r\n *\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n * @category API\r\n */\r\nexport class Fetch {\r\n apiResponseFormat: string;\r\n baseUrl?: string;\r\n options?: FetchRequestOptions;\r\n\r\n constructor(userConfig?: FetchConfig) {\r\n let finalConfig: FetchConfig;\r\n\r\n /* userConfig takes precedence over DEFAULT_CONFIG */\r\n if (userConfig && getTypeof(userConfig) === 'object') {\r\n finalConfig = {\r\n ...DEFAULT_CONFIG,\r\n ...userConfig,\r\n options: { ...DEFAULT_CONFIG.options, ...userConfig.options },\r\n };\r\n } else {\r\n finalConfig = { ...DEFAULT_CONFIG };\r\n }\r\n\r\n /** @private */\r\n this.apiResponseFormat = 'json';\r\n /** @private */\r\n this.baseUrl = finalConfig.baseUrl;\r\n /** @private */\r\n this.options = finalConfig.options;\r\n }\r\n\r\n /**\r\n * Builds a query string from QueryStringParameters.\r\n *\r\n * @param {QueryStringParameters} params - Object containing Key:Value pairs to build the URL query string with.\r\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\r\n * - Given params of `{paramName: \"\"}` , setting this to true will use 'paramName=' in the final query string.\r\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\r\n * @returns {(Promise)} A formatted NHSTA.dot.gov Vehicles API query string.\r\n */\r\n async buildQueryString(\r\n params?: QueryStringParameters,\r\n allowEmptyStringValues = false\r\n ): Promise {\r\n /*\r\n * Make sure we're always using 'format=json' in the url Query parameters\r\n * If the user provides a 'format' key in the params, during class instantiation we want to override it to 'json'\r\n * This package may provide support for the other formats (CSV and XML) if requested.\r\n */\r\n if (!params || getTypeof(params) !== 'object') {\r\n params = {\r\n format: this.apiResponseFormat,\r\n };\r\n } else {\r\n params = { ...params, format: this.apiResponseFormat };\r\n }\r\n\r\n /* Return the completed query string */\r\n return await makeQueryString(params, allowEmptyStringValues);\r\n }\r\n\r\n /**\r\n * Uses the `cross-fetch` npm package to send HTTP requests and retrieve data from an API.\r\n * - In browser environments, [whatwg-fetch](https://github.com/github/fetch/) window.fetch is used.\r\n * - In node environments, [node-fetch](https://github.com/bitinn/node-fetch/) NPM package is used.\r\n *\r\n * @param {string} url - URL to fetch data from.\r\n * @param {FetchRequestOptions} [options] - [Fetch options](https://github.github.io/fetch/#options).\r\n * @returns {(Promise)} Response from the API.\r\n */\r\n async get(\r\n url: string,\r\n options: FetchRequestOptions = {}\r\n ): Promise {\r\n /* Runtime typechecking */\r\n const typeofUrl = getTypeof(url);\r\n if (typeofUrl !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `Fetch.get(url) - url argument must be of type string, got: ${typeofUrl}`\r\n )\r\n );\r\n }\r\n const typeofOptions = getTypeof(options);\r\n if (typeofOptions !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `Fetch.get(url, options) - options argument must be of type object, got: ${typeofOptions}`\r\n )\r\n );\r\n }\r\n\r\n /* Combine user provided 'options' and class property 'this.options', user options overwrite class options */\r\n const combinedOptions = { ...this.options, ...options };\r\n\r\n /* Use the cross-fetch package to perform an HTTP request */\r\n const response: Response = await fetch(url, combinedOptions)\r\n .then((result) => {\r\n if (!result?.status || result.status >= 400) {\r\n throw new Error(\r\n `Bad response from server, code: ${result?.status}, text: ${result?.statusText}, headers: ${result?.headers}`\r\n );\r\n } else return result;\r\n })\r\n .catch((err) =>\r\n Promise.reject(new Error(`Fetch.get() http error: ${err}`))\r\n );\r\n\r\n /* Convert the NHTSA API data to JSON */\r\n const NhtsaResponse: NhtsaResponse = await response\r\n .json()\r\n .then((json: NhtsaResponse): NhtsaResponse => json);\r\n\r\n /* Add the fetch response information to the returned NHSTA API data */\r\n const finalResult: ApiResponse = {\r\n ...NhtsaResponse,\r\n FetchResponse: {\r\n headers: response.headers,\r\n ok: response.ok,\r\n redirected: response.redirected,\r\n status: response.status,\r\n statusText: response.statusText,\r\n url: response.url,\r\n },\r\n };\r\n\r\n /* Return the completed ApiResponse */\r\n return Promise.resolve(finalResult);\r\n }\r\n}\r\n\r\n/*****************\r\n * Types\r\n ****************/\r\n\r\n/**\r\n * Various fetch request body types.\r\n *\r\n * @typedef FetchRequestBodyTypes\r\n * @type {URLSearchParams | FormData | Blob | ArrayBuffer | DataView}\r\n *\r\n * @memberof module:api/Fetch\r\n */\r\nexport type FetchRequestBodyTypes =\r\n | URLSearchParams\r\n | FormData\r\n | Blob\r\n | ArrayBuffer\r\n | DataView;\r\n\r\n/**\r\n * Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias FetchRequestOptions\r\n */\r\nexport type FetchRequestOptions = {\r\n /**HTTP request method - Default: \"GET\". */\r\n method?: string;\r\n /** HTTP request body - [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body). */\r\n body?: string | FetchRequestBodyTypes;\r\n /** [Object, Headers](https://github.github.io/fetch/#Headers) - Default: {}. */\r\n headers?: Record | Headers;\r\n /**\r\n * Default: \"omit\" - Authentication credentials mode.\r\n * - \"omit\" - don't include authentication credentials (e.g. Cookies) in the request.\r\n * - \"same-origin\" - include credentials in requests to the same site\r\n * - \"include\" - include credentials in requests to all sites.\r\n */\r\n credentials?: 'omit' | 'same-origin' | 'include';\r\n};\r\n\r\n/**\r\n * Used when instantiating a Fetch class or related subclass.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias FetchConfig\r\n */\r\nexport type FetchConfig = {\r\n /** Requested response format from the NHSTA API (hardcoded to 'json' for now). */\r\n apiResponseFormat?: string;\r\n /** Base of the URL to build fetch URLs from. */\r\n baseUrl?: string;\r\n /** Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}. */\r\n options?: FetchRequestOptions;\r\n};\r\n\r\n/**\r\n * [Fetch API Response](https://github.github.io/fetch/#Response) properties.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias FetchResponse\r\n */\r\nexport type FetchResponse = {\r\n /** The [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object associated with the response. */\r\n headers: Headers;\r\n /** A boolean indicating whether the response was successful (status in the range 200–299) or not. */\r\n ok: boolean;\r\n /** Indicates whether or not the response is the result of a redirect (that is, its URL list has more than one entry). */\r\n redirected: boolean;\r\n /** The status code of the response. (This will be 200 for a success). */\r\n status: number;\r\n /** The status message corresponding to the status code. (e.g., OK for 200). */\r\n statusText: string;\r\n /** The URL of the response. */\r\n url: string;\r\n};\r\n\r\n/**\r\n * Response data returned from the NHSTA API.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias NhtsaResponse\r\n */\r\nexport type NhtsaResponse = {\r\n /** The number of items returned in the Results object. */\r\n Count: number;\r\n /** A message describing the Results. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, etc) used in the request URL. */\r\n SearchCriteria: string;\r\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\r\n Results: Array;\r\n};\r\n\r\n/**\r\n * Complete response returned by {@link module:api/Fetch.Fetch#get}.\r\n *\r\n * @see {@link module:api/Fetch.NhtsaResponse}\r\n * @see {@link module:api/Fetch.FetchResponse}\r\n * @memberof module:api/Fetch\r\n * @alias ApiResponse\r\n */\r\nexport type ApiResponse = {\r\n /** The number of items returned in the Results object. */\r\n Count: number;\r\n /** A message describing the Results. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, etc) used in the request URL. */\r\n SearchCriteria: string;\r\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) Properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","import { getTypeof } from './getTypeof';\n\n/**\n * @module utils/makeQueryString\n * @category Utils\n */\n\n/**\n * Utility method to generate a query string compatible with the NHSTA API, for use in an API URL string.\n *\n * @async\n *\n * @param {object} params - Object of Type [QueryStringParameters](module-utils_makeQueryString.html#.QueryStringParameters).\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\n * - Given params of `{ paramName: \"\" }` , setting this to true will use 'paramName=' in the final query string.\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\n *\n * @returns {Promise} A query string of search parameters for use in a final Fetch.get URL.\n *\n * @example When loaded from the browser via html script tags\n * // \n * const qs = await NHTSA.makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example When loaded as a module\n * import { makeQueryString } from '@shaggytools/nhtsa-api-wrapper'\n * const qs = await makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example Single Param:\n * const qs = await makeQueryString({\n * modelYear: 2019\n * }).catch(error => error)\n * console.log(qs) // \"?modelYear=2019\"\n *\n * @example Multiple Params:\n * const qs = await makeQueryString({\n * whatever: 'some value',\n * modelYear: 2006,\n * page: \"2\"\n * }).catch(error => error)\n *\n * console.log(qs) // \"?whatever=some%20value&modelYear=2006&page=2\"\n *\n * @example Empty Params Object:\n * const qs = await makeQueryString({}).catch(error => error)\n *\n * console.log(qs) // \"\"\n *\n * @example Using allowEmptyStringValues option:\n * const qs = await makeQueryString({\n * year: 2016,\n * vehicleType: '',\n * make: 'Audi'\n * }, true).catch(error => error)\n *\n * console.log(qs) // \"?year=2016&vehicleType=&make=Audi\"\n *\n */\nexport function makeQueryString(\n params: QueryStringParameters = {},\n allowEmptyStringValues = false\n): Promise {\n /* Beginning of error message string */\n const errorBase =\n 'queryString(params) - expected params in the form of an object, got:';\n\n /* Runtime type guard params argument, must be of type object */\n if (getTypeof(params) !== 'object') {\n return Promise.reject(new Error(`${errorBase} ${params}`));\n }\n\n /* Setup QueryString for Array mapping */\n const entries = Object.entries(params);\n const paramsLength = entries.length;\n\n /* Return an empty string if params are an empty object */\n if (paramsLength < 1) return Promise.resolve('');\n\n /* Used to check if we've already prepended a valid query param */\n let isPrepended = false;\n\n /* Map [key]:value entries to \"key=value\" strings in an array */\n const queryStringArray = entries.map(([key, value], index) => {\n let prepend = '';\n let append = '';\n\n const typeofValue = getTypeof(value);\n\n /* Convert any number values to a string */\n if (value && typeofValue === 'number') {\n value = value.toString();\n }\n\n /* Skip any invalid values, only string and number value types are valid */\n if (\n (value || allowEmptyStringValues) &&\n (typeofValue === 'string' || typeofValue === 'number')\n ) {\n /* if this is the first param we need to prepend the '?' char */\n if (!isPrepended) {\n prepend = '?';\n isPrepended = true;\n }\n /* if there is another param coming after this one we need to append the '&' char */\n if (index < paramsLength - 1) {\n append = '&';\n }\n\n /* Add the completed partial query string to queryStringArray */\n return `${prepend}${key}=${value}${append}`;\n }\n return;\n });\n\n /* Join and return the completed query string after URI encoding */\n return Promise.resolve(encodeURI(queryStringArray.join('')));\n}\n\n/**\n * Object containing Key:Value pairs to build the URL query string with.\n * - Parameter values may be either strings or numbers.\n *\n * @memberof module:utils/makeQueryString\n * @alias QueryStringParameters\n * @example\n * {\n * modelYear: 2009,\n * whatever: 'something'\n * }\n *\n */\nexport type QueryStringParameters = {\n [propName: string]: string | number | undefined;\n};\n","/**\r\n * @module api/actions/DecodeVin\r\n * @category Actions\r\n * @description DecodeVin NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVin](module-api_actions_DecodeVin.DecodeVin.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinResponse](#DecodeVinResponse)\r\n * > - Type: [DecodeVinResults](#DecodeVinResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVin extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The DecodeVin API Action will decode the VIN and the decoded output will be made available in the format of Key-value pairs.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This API also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n * - The 9th digit is not necessary.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVin(\r\n vin: string,\r\n params?: {\r\n modelYear?: number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVin';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVin\r\n * @alias DecodeVinResults\r\n */\r\nexport type DecodeVinResults = {\r\n Value: string | null;\r\n ValueId: string | null;\r\n Variable: string;\r\n VariableId: number;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVin API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVin\r\n * @alias DecodeVinResponse\r\n */\r\nexport type DecodeVinResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVinExtended\r\n * @category Actions\r\n * @description DecodeVinExtended NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinExtended](module-api_actions_DecodeVinExtended.DecodeVinExtended.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinExtendedResponse](#DecodeVinExtendedResponse)\r\n * > - Type: [DecodeVinExtendedResults](#DecodeVinExtendedResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinExtended extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This is exactly like the DecodeVin method but provides additional information on variables\r\n * related to other NHTSA programs like\r\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\r\n * - This will decode the VIN and the decoded output will be made available\r\n * in the format of Key-value pairs.\r\n * - In the returned 'Results` object:\r\n * - The IDs (VariableID and ValueID) represent the unique ID associated with the Variable/Value.\r\n * - In case of text variables, the ValueID is not applicable.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n * - The 9th digit is not necessary.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVinExtended(\r\n vin: string,\r\n params?: {\r\n modelYear?: string | number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinExtended';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinExtendedResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinExtended\r\n * @alias DecodeVinExtendedResults\r\n */\r\nexport type DecodeVinExtendedResults = {\r\n Value: string | null;\r\n ValueId: string | null;\r\n Variable: string;\r\n VariableId: number;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinExtended API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinExtended\r\n * @alias DecodeVinExtendedResponse\r\n */\r\nexport type DecodeVinExtendedResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVinValues\r\n * @category Actions\r\n * @description DecodeVinValues NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinValues](module-api_actions_DecodeVinValues.DecodeVinValues.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinValuesResponse](#DecodeVinValuesResponse)\r\n * > - Type: [DecodeVinValuesResults](#DecodeVinValuesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinValues extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The DecodeVinValues API Action will decode the VIN with the Results returned in a _flat file_ format.\r\n * - The Results will be made available in a flat file format of a single object containing\r\n * 'key: value' results.\r\n * - Providing params.modelYear allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeVinValues(\r\n vin: string,\r\n params?: {\r\n modelYear?: number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinValues';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (\r\n params?.modelYear &&\r\n typeofModelYear !== 'string' &&\r\n typeofModelYear !== 'number'\r\n ) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinValuesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinValues\r\n * @alias DecodeVinValuesResults\r\n */\r\nexport type DecodeVinValuesResults = {\r\n /** Flat file format, single object containing keys and values of type string */\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinValues API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinValues\r\n * @alias DecodeVinValuesResponse\r\n */\r\nexport type DecodeVinValuesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /**\r\n * The search results returned by the NHSTA API request.\r\n * Flat file format, single object containing keys and values of type string\r\n * */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVINValuesBatch\r\n * @category Actions\r\n * @description DecodeVINValuesBatch NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVINValuesBatch](module-api_actions_DecodeVINValuesBatch.DecodeVINValuesBatch.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVINValuesBatchResponse](#DecodeVINValuesBatchResponse)\r\n * > - Type: [DecodeVINValuesBatchResults](#DecodeVINValuesBatchResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVINValuesBatch extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This decodes a batch of VINs that are submitted in a standardized format in a string\r\n * and returns multiple decodes in a flat format.\r\n *\r\n * The `inputString` parameter should be in the following format:\r\n * - `vin , modelYear ; vin , modelYear ; vin , modelYear ...`\r\n *\r\n * \"modelYear\" is optional, the output for each VIN decode is in the same format as produced by the \"Decode VIN (flat format)\" method.\r\n *\r\n * @async\r\n * @param {string} inputString - A string of Vehicle Identification Numbers (full or partial) following the format listed in the description.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVINValuesBatch(\r\n inputString: string\r\n ): Promise {\r\n const action = 'DecodeVINValuesBatch';\r\n\r\n /* Runtime typechecking */\r\n const typeofInputString = getTypeof(inputString);\r\n if (typeofInputString !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"inputString\" argument is required and must be of type string, got: ` +\r\n `<${typeofInputString}> ${inputString}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/`;\r\n\r\n const body = encodeURI(`DATA=${inputString}&format=json`);\r\n\r\n /* Return the result */\r\n return await this.get(url, {\r\n method: 'POST',\r\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\r\n body,\r\n })\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVINValuesBatchResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVINValuesBatch\r\n * @alias DecodeVINValuesBatchResults\r\n */\r\nexport type DecodeVINValuesBatchResults = {\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVINValuesBatch API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVINValuesBatch\r\n * @alias DecodeVINValuesBatchResponse\r\n */\r\nexport type DecodeVINValuesBatchResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVinValuesExtended\r\n * @category Actions\r\n * @description DecodeVinValuesExtended NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinValuesExtended](module-api_actions_DecodeVinValuesExtended.DecodeVinValuesExtended.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinValuesExtendedResponse](#DecodeVinValuesExtendedResponse)\r\n * > - Type: [DecodeVinValuesExtendedResults](#DecodeVinValuesExtendedResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinValuesExtended extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This is exactly like the DecodeVinValues (flat format Results) method but provides additional information\r\n * on variables related to other NHTSA programs like\r\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\r\n * - The Results will be made available in a flat file format of a single object containing\r\n * 'key: value' results.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @reje\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeVinValuesExtended(\r\n vin: string,\r\n params?: {\r\n modelYear?: string | number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinValuesExtended';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinValuesExtendedResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinValuesExtended\r\n * @alias DecodeVinValuesExtendedResults\r\n */\r\nexport type DecodeVinValuesExtendedResults = {\r\n /** Flat file format, single object containing keys and values of type string */\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinValuesExtended API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinValuesExtended\r\n * @alias DecodeVinValuesExtendedResponse\r\n */\r\nexport type DecodeVinValuesExtendedResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /**\r\n * The search results returned by the NHSTA API request.\r\n * Flat file format, single object containing keys and values of type string\r\n * */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeWMI\r\n * @category Actions\r\n * @description DecodeWMI NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeWMI](module-api_actions_DecodeWMI.DecodeWMI.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeWMIResponse](#DecodeWMIResponse)\r\n * > - Type: [DecodeWMIResults](#DecodeWMIResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeWMI extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides information on the World Manufacturer Identifier for a specific WMI code.\r\n * - `WMI` may be put in as either 3 characters representing VIN position 1-3 or 6 characters\r\n * representing VIN positions 1-3 & 12-14. Example \"JTD\", \"1T9131\".\r\n *\r\n * @async\r\n * @param {string} WMI - World Manufacturer Identifier.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeWMI(WMI: string): Promise {\r\n const action = 'DecodeWMI';\r\n\r\n /* Runtime typechecking */\r\n const typeofWMI = getTypeof(WMI);\r\n if (typeofWMI !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"WMI\" argument is required and must be of type string, got: ` +\r\n `<${typeofWMI}> ${WMI}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${WMI}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeWMIResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeWMI\r\n * @alias DecodeWMIResults\r\n */\r\nexport type DecodeWMIResults = {\r\n CommonName: string;\r\n CreatedOn: string;\r\n DateAvailableToPublic: string;\r\n Make: string;\r\n ManufacturerName: string;\r\n ParentCompanyName: string;\r\n URL: string;\r\n UpdatedOn: string;\r\n VehicleType: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeWMI API Action.\r\n *\r\n * @memberof module:api/actions/DecodeWMI\r\n * @alias DecodeWMIResponse\r\n */\r\nexport type DecodeWMIResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetAllMakes\r\n * @category Actions\r\n * @description GetAllMakes NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetAllMakes](module-api_actions_GetAllMakes.GetAllMakes.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetAllMakesResponse](#GetAllMakesResponse)\r\n * > - Type: [GetAllMakesResults](#GetAllMakesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetAllMakes extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Makes available in the vPIC Dataset.\r\n *\r\n * @async\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetAllMakes(): Promise {\r\n const action = 'GetAllMakes';\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetAllMakesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetAllMakes\r\n * @alias GetAllMakesResults\r\n */\r\nexport type GetAllMakesResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetAllMakes API Action.\r\n *\r\n * @memberof module:api/actions/GetAllMakes\r\n * @alias GetAllMakesResponse\r\n */\r\nexport type GetAllMakesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetAllManufacturers\r\n * @category Actions\r\n * @description GetAllManufacturers NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetAllManufacturers](module-api_actions_GetAllManufacturers.GetAllManufacturers.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetAllManufacturersResponse](#GetAllManufacturersResponse)\r\n * > - Type: [GetAllManufacturersResults](#GetAllManufacturersResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetAllManufacturers extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Manufacturers available in vPIC Dataset.\r\n * - `params.manufacturerType` allows the user to filter the list based on manufacturer type,\r\n * ('Incomplete Vehicles', 'Completed Vehicle Manufacturer', 'Incomplete Vehicle Manufacturer',\r\n * 'Intermediate Manufacturer', 'Final-Stage Manufacturer', 'Alterer', or any partial match of those strings).\r\n * - You can get a list of all manufacturer types with the following API Action:\r\n * `GetVehicleVariableValuesList('manufacturer type')`\r\n * - Results are provided in pages of 100 items.\r\n * - Provide a number value for `params.page` to specify 1st (default), 2nd, 3rd, Nth, etc page.\r\n *\r\n * @async\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string} [params.manufacturerType] - See method description.\r\n * @param {number} [params.page] - Specify the page number (results returned 100 at a time).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetAllManufacturers(\r\n params: {\r\n manufacturerType?: string;\r\n page?: number;\r\n } = {}\r\n ): Promise {\r\n const action = 'GetAllManufacturers';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofManufacturerType = getTypeof(params.manufacturerType);\r\n if (params.manufacturerType && typeofManufacturerType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.manufacturerType\" argument must be of type string, got: ` +\r\n `<${typeofManufacturerType}> ${params.manufacturerType}`\r\n )\r\n );\r\n }\r\n\r\n const typeofPage = getTypeof(params.page);\r\n if (params.page && typeofPage !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.page\" argument must be of type number, got: ` +\r\n `<${typeofPage}> ${params.page}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetAllManufacturersResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetAllManufacturers\r\n * @alias GetAllManufacturersResults\r\n */\r\nexport type GetAllManufacturersResults = {\r\n Country: string;\r\n Mfr_CommonName: string;\r\n Mfr_ID: number;\r\n Mfr_Name: string;\r\n VehicleTypes: Array<{ isPrimary?: boolean; name?: string }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetAllManufacturers API Action.\r\n *\r\n * @memberof module:api/actions/GetAllManufacturers\r\n * @alias GetAllManufacturersResponse\r\n */\r\nexport type GetAllManufacturersResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetCanadianVehicleSpecifications\r\n * @category Actions\r\n * @description GetCanadianVehicleSpecifications NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetCanadianVehicleSpecifications](module-api_actions_GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetCanadianVehicleSpecificationsResponse](#GetCanadianVehicleSpecificationsResponse)\r\n * > - Type: [GetCanadianVehicleSpecificationsResults](#GetCanadianVehicleSpecificationsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetCanadianVehicleSpecifications extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The Canadian Vehicle Specifications (CVS) consists of a database of original vehicle dimensions,\r\n * used primarily in collision investigation and reconstruction, combined with a search engine.\r\n *\r\n * The database is compiled annually by the Collision Investigation and Research Division of Transport Canada.\r\n * Visit official [Canadian Vehicle Specifications](http://www.carsp.ca/research/resources/safety-sources/canadian-vehicle-specifications/)\r\n * page for more details.\r\n *\r\n * This API action will return a 404 html error if any of the query parameters in params\r\n * are missing from the query string. This is the only API action with this behaviour. Therefore,\r\n * parameters are inserted into the query string as empty strings if not provided by the user.\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle (required) - Number, >= 1971.\r\n * @param {string} [params.make] - Vehicle's make, like \"Honda\", \"Toyota\", etc...\r\n * @param {string} [params.model] - Vehicle's model, like \"Pilot\", \"Focus\". Can also include some other elements like Body Type, Engine Model/size, etc...\r\n * @param {string} [params.units] - \"Metric\" (default), or \"US\" for United States customary units.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetCanadianVehicleSpecifications(params: {\r\n year: number;\r\n make?: string;\r\n model?: string;\r\n units?: string;\r\n }): Promise {\r\n const action = 'GetCanadianVehicleSpecifications';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n const typeofMake = getTypeof(params.make);\r\n if (params.make && typeofMake !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.make\" argument must be of type string, got: ` +\r\n `<${typeofMake}> ${params.make}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModel = getTypeof(params.model);\r\n if (params.model && typeofModel !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.model\" argument must be of type string, got: ` +\r\n `<${typeofModel}> ${params.model}`\r\n )\r\n );\r\n }\r\n\r\n const typeofUnits = getTypeof(params.units);\r\n if (params.units && typeofUnits !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.units\" argument must be of type string, got: ` +\r\n `<${typeofUnits}> ${params.units}`\r\n )\r\n );\r\n }\r\n\r\n /* Set default query parameters to empty strings if not provided by the user */\r\n const make = params.make || '';\r\n const model = params.model || '';\r\n const units = params.units || '';\r\n\r\n const params_ = {\r\n year: params.year,\r\n make,\r\n model,\r\n units,\r\n };\r\n\r\n /*\r\n * Build the 'default' query string to be appended to the URL.\r\n *\r\n * Additionally, sets the allowEmptyStringValues option (2nd argument) to true because\r\n * this API action will return a 404 error if any of the query parameters are missing from the query string.\r\n * This is the only API action with this behaviour (\"year\" is the only param the user must provide).\r\n */\r\n const queryString = await this.buildQueryString(\r\n params_,\r\n true\r\n ).catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetCanadianVehicleSpecificationsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\r\n * @alias GetCanadianVehicleSpecificationsResults\r\n */\r\nexport type GetCanadianVehicleSpecificationsResults = {\r\n Specs: Array<{\r\n Name: string;\r\n Value: string;\r\n }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetCanadianVehicleSpecifications API Action.\r\n *\r\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\r\n * @alias GetCanadianVehicleSpecificationsResponse\r\n */\r\nexport type GetCanadianVehicleSpecificationsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetEquipmentPlantCodes\r\n * @category Actions\r\n * @description GetEquipmentPlantCodes NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetEquipmentPlantCodes](module-api_actions_GetEquipmentPlantCodes.GetEquipmentPlantCodes.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetEquipmentPlantCodesResponse](#GetEquipmentPlantCodesResponse)\r\n * > - Type: [GetEquipmentPlantCodesResults](#GetEquipmentPlantCodesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetEquipmentPlantCodes extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * Returns assigned Equipment Plant Codes. Can be filtered by Year, Equipment Type and Report Type.\r\n *\r\n * `params.year`:\r\n * - Only years >= 2016 are supported\r\n *\r\n * `params.equipmentType`:\r\n * - 1 (Tires)\r\n * - 3 (Brake Hoses)\r\n * - 13 (Glazing)\r\n * - 16 (Retread)\r\n *\r\n * `params.reportType`:\r\n * - 'New' (The Equipment Plant Code was assigned during the selected year).\r\n * - 'Updated' (The Equipment Plant data was modified during the selected year).\r\n * - 'Closed' (The Equipment Plant is no longer Active).\r\n * - 'All' (All Equipment Plant Codes regardless of year, including their status (active or closed)).\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\r\n * @param {number} params.equipmentType - Number equal to 1, 3, 13, or 16.\r\n * @param {string} params.reportType - 'New', 'Updated', 'Closed', or 'All'.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetEquipmentPlantCodes(params: {\r\n year: number;\r\n equipmentType: 1 | 3 | 13 | 16;\r\n reportType: 'New' | 'Updated' | 'Closed' | 'All';\r\n }): Promise {\r\n const action = 'GetEquipmentPlantCodes';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n const typeofEquipmentType = getTypeof(params.equipmentType);\r\n if (typeofEquipmentType !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.equipmentType\" argument is required and must be of type number, got: ` +\r\n `<${typeofEquipmentType}> ${params.equipmentType}`\r\n )\r\n );\r\n }\r\n\r\n const typeofReportType = getTypeof(params.reportType);\r\n if (typeofReportType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.reportType\" argument is required and must be of type string, got: ` +\r\n `<${typeofReportType}> ${params.reportType}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetEquipmentPlantCodesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetEquipmentPlantCodes\r\n * @alias GetEquipmentPlantCodesResults\r\n */\r\nexport type GetEquipmentPlantCodesResults = {\r\n Address: string;\r\n City: string;\r\n Country: string;\r\n DOTCode: string;\r\n Name: string;\r\n OldDotCode: string;\r\n PostalCode: string;\r\n StateProvince: string;\r\n Status: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetEquipmentPlantCodes API Action.\r\n *\r\n * @memberof module:api/actions/GetEquipmentPlantCodes\r\n * @alias GetEquipmentPlantCodesResponse\r\n */\r\nexport type GetEquipmentPlantCodesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetMakeForManufacturer\r\n * @category Actions\r\n * @description GetMakeForManufacturer NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakeForManufacturer](module-api_actions_GetMakeForManufacturer.GetMakeForManufacturer.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakeForManufacturerResponse](#GetMakeForManufacturerResponse)\r\n * > - Type: [GetMakeForManufacturerResults](#GetMakeForManufacturerResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakeForManufacturer extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified manufacturer that is requested.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\r\n * (it accepts a partial manufacturer name as an input).\r\n * - `manufacturer` name can be a partial name, or a full name for more specificity\r\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\r\n * - Multiple results are returned in case of multiple matches.\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetMakeForManufacturer(\r\n manufacturer: string | number\r\n ): Promise {\r\n const action = 'GetMakeForManufacturer';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakeForManufacturerResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakeForManufacturer\r\n * @alias GetMakeForManufacturerResults\r\n */\r\nexport type GetMakeForManufacturerResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Mfr_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakeForManufacturer API Action.\r\n *\r\n * @memberof module:api/actions/GetMakeForManufacturer\r\n * @alias GetMakeForManufacturerResponse\r\n */\r\nexport type GetMakeForManufacturerResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetMakesForManufacturerAndYear\r\n * @category Actions\r\n * @description GetMakesForManufacturerAndYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakesForManufacturerAndYear](module-api_actions_GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakesForManufacturerAndYearResponse](#GetMakesForManufacturerAndYearResponse)\r\n * > - Type: [GetMakesForManufacturerAndYearResults](#GetMakesForManufacturerAndYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakesForManufacturerAndYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified manufacturer,\r\n * and whose Year From and Year To range cover the specified year.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\r\n * (it accepts a partial manufacturer name as an input).\r\n * - Multiple results are returned in case of multiple matches.\r\n * - Manufacturer can be idenfitied by Id, a partial name, or a full name\r\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\r\n *\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetMakesForManufacturerAndYear(\r\n manufacturer: string | number,\r\n params: {\r\n year: number;\r\n }\r\n ): Promise {\r\n const action = 'GetMakesForManufacturerAndYear';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument is required and must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakesForManufacturerAndYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\r\n * @alias GetMakesForManufacturerAndYearResults\r\n */\r\nexport type GetMakesForManufacturerAndYearResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n MfrId: number;\r\n MfrName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakesForManufacturerAndYear API Action.\r\n *\r\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\r\n * @alias GetMakesForManufacturerAndYearResponse\r\n */\r\nexport type GetMakesForManufacturerAndYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetMakesForVehicleType\r\n * @category Actions\r\n * @description GetMakesForVehicleType NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakesForVehicleType](module-api_actions_GetMakesForVehicleType.GetMakesForVehicleType.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakesForVehicleTypeResponse](#GetMakesForVehicleTypeResponse)\r\n * > - Type: [GetMakesForVehicleTypeResults](#GetMakesForVehicleTypeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakesForVehicleType extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified vehicle type (`typeName`),\r\n * whose name is LIKE the vehicle type name in vPIC Dataset.\r\n * - Vehicle `typeName` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n * @param {string} typeName - A partial or full vehicle type name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetMakesForVehicleType(\r\n typeName: string\r\n ): Promise {\r\n const action = 'GetMakesForVehicleType';\r\n\r\n /* Runtime typechecking */\r\n const typeofTypeName = getTypeof(typeName);\r\n if (typeofTypeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"typeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofTypeName}> ${typeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${typeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakesForVehicleTypeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakesForVehicleType\r\n * @alias GetMakesForVehicleTypeResults\r\n */\r\nexport type GetMakesForVehicleTypeResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakesForVehicleType API Action.\r\n *\r\n * @memberof module:api/actions/GetMakesForVehicleType\r\n * @alias GetMakesForVehicleTypeResponse\r\n */\r\nexport type GetMakesForVehicleTypeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetManufacturerDetails\r\n * @category Actions\r\n * @description GetManufacturerDetails NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetManufacturerDetails](module-api_actions_GetManufacturerDetails.GetManufacturerDetails.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetManufacturerDetailsResponse](#GetManufacturerDetailsResponse)\r\n * > - Type: [GetManufacturerDetailsResults](#GetManufacturerDetailsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetManufacturerDetails extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides the details for a specific manufacturer that is requested.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name,\r\n * (it accepts a partial manufacturer name as an input).\r\n * - Multiple results are returned in case of multiple matches.\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetManufacturerDetails(\r\n manufacturer: string | number\r\n ): Promise {\r\n const action = 'GetManufacturerDetails';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetManufacturerDetailsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetManufacturerDetails\r\n * @alias GetManufacturerDetailsResults\r\n */\r\nexport type GetManufacturerDetailsResults = {\r\n Address: string;\r\n Address2: string;\r\n City: string;\r\n ContactEmail: string;\r\n ContactFax: string;\r\n ContactPhone: string;\r\n Country: string;\r\n DBAs: string;\r\n EquipmentItems: Array>;\r\n LastUpdated: string;\r\n ManufacturerTypes: Array<{\r\n Name: string;\r\n }>;\r\n Mfr_CommonName: string;\r\n Mfr_ID: number;\r\n Mfr_Name: string;\r\n OtherManufacturerDetails: string;\r\n PostalCode: string;\r\n PrimaryProduct: string;\r\n PrincipalFirstName: string;\r\n PrincipalLastName: string;\r\n PrincipalPosition: string;\r\n StateProvince: string;\r\n SubmittedName: string;\r\n SubmittedOn: string;\r\n SubmittedPosition: string;\r\n VehicleTypes: Array<{\r\n GVWRFrom: string;\r\n GVWRTo: string;\r\n IsPrimary: boolean;\r\n Name: string;\r\n }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetManufacturerDetails API Action.\r\n *\r\n * @memberof module:api/actions/GetManufacturerDetails\r\n * @alias GetManufacturerDetailsResponse\r\n */\r\nexport type GetManufacturerDetailsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMake\r\n * @category Actions\r\n * @description GetModelsForMake NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMake](module-api_actions_GetModelsForMake.GetModelsForMake.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeResponse](#GetModelsForMakeResponse)\r\n * > - Type: [GetModelsForMakeResults](#GetModelsForMakeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMake extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified `makeName`\r\n * whose Name is LIKE the Make in vPIC Dataset.\r\n * - `makeName` can be a partial, or a full for more specificity\r\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\r\n *\r\n * @async\r\n * @param {string} makeName - Vehicle make name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMake(makeName: string): Promise {\r\n const action = 'GetModelsForMake';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeName = getTypeof(makeName);\r\n if (typeofMakeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofMakeName}> ${makeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMake\r\n * @alias GetModelsForMakeResults\r\n */\r\nexport type GetModelsForMakeResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMake API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMake\r\n * @alias GetModelsForMakeResponse\r\n */\r\nexport type GetModelsForMakeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMakeId\r\n * @category Actions\r\n * @description GetModelsForMakeId NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeId](module-api_actions_GetModelsForMakeId.GetModelsForMakeId.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeIdResponse](#GetModelsForMakeIdResponse)\r\n * > - Type: [GetModelsForMakeIdResults](#GetModelsForMakeIdResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeId extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Make\r\n * whose Id is equal to the `makeId` in the vPIC Dataset.\r\n *\r\n * @async\r\n * @param {number} makeID - Vehicle make ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeId(\r\n makeID: number\r\n ): Promise {\r\n const action = 'GetModelsForMakeId';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeId = getTypeof(makeID);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeID}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString({}).catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeId\r\n * @alias GetModelsForMakeIdResults\r\n */\r\nexport type GetModelsForMakeIdResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeId API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeId\r\n * @alias GetModelsForMakeIdResponse\r\n */\r\nexport type GetModelsForMakeIdResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMakeIdYear\r\n * @category Actions\r\n * @description GetModelsForMakeIdYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeIdYear](module-api_actions_GetModelsForMakeIdYear.GetModelsForMakeIdYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeIdYearResponse](#GetModelsForMakeIdYearResponse)\r\n * > - Type: [GetModelsForMakeIdYearResults](#GetModelsForMakeIdYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeIdYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Model Year\r\n * and Make whose name is LIKE the Make in the vPIC Dataset.\r\n * - `params.makeId` is a number and is a required query parameter.\r\n *\r\n * A minimum of one of the following are required (or a combination of both):\r\n * - `params.modelYear` is a number (greater than 1995)\r\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.makeId - Make ID to search.\r\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\r\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeIdYear(params: {\r\n makeId: number;\r\n modelYear?: number;\r\n vehicleType?: string;\r\n }): Promise {\r\n const action = 'GetModelsForMakeIdYear';\r\n\r\n const makeId: number = params?.makeId;\r\n const modelYear: number | undefined = params?.modelYear;\r\n const vehicleType: string | undefined = params?.vehicleType;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n /* Required makeId param of type number */\r\n const typeofMakeId = getTypeof(makeId);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeId}`\r\n )\r\n );\r\n }\r\n /* At least one of modelYear or vehicleType params is required */\r\n if (!modelYear && !vehicleType) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\r\n `${modelYear} | ${vehicleType}`\r\n )\r\n );\r\n }\r\n /* valid modelYear param of type number */\r\n const typeofModelYear = getTypeof(modelYear);\r\n if (modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" must be of type number, got: ` +\r\n `<${typeofModelYear}> ${modelYear}`\r\n )\r\n );\r\n }\r\n /* valid vehicleType param of type string */\r\n const typeofVehicleType = getTypeof(vehicleType);\r\n if (vehicleType && typeofVehicleType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\r\n `<${typeofVehicleType}> ${vehicleType}`\r\n )\r\n );\r\n }\r\n\r\n /* Beginning of the the actionUrl */\r\n let actionUrl = `${action}/makeId/${makeId}/`;\r\n\r\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\r\n if (modelYear && vehicleType) {\r\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\r\n } else if (modelYear) {\r\n actionUrl += `modelYear/${modelYear}`;\r\n } else {\r\n actionUrl += `vehicleType/${vehicleType}`;\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeIdYear\r\n * @alias GetModelsForMakeIdYearResults\r\n */\r\nexport type GetModelsForMakeIdYearResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeIdYear API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeIdYear\r\n * @alias GetModelsForMakeIdYearResponse\r\n */\r\nexport type GetModelsForMakeIdYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMakeYear\r\n * @category Actions\r\n * @description GetModelsForMakeYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeYear](module-api_actions_GetModelsForMakeYear.GetModelsForMakeYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeYearResponse](#GetModelsForMakeYearResponse)\r\n * > - Type: [GetModelsForMakeYearResults](#GetModelsForMakeYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Model Year\r\n * and Make whose name is LIKE the Make in the vPIC Dataset.\r\n * - `params.make` is required. It can be a partial, or a full name for more specificity\r\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\r\n *\r\n * A minimum of one of the following are required (or a combination of both):\r\n * - `params.modelYear` is a number (greater than 1995)\r\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n *\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {string} params.make - Make name to search.\r\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\r\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\r\n *\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeYear(params: {\r\n make: string;\r\n modelYear?: number;\r\n vehicleType?: string;\r\n }): Promise {\r\n const action = 'GetModelsForMakeYear';\r\n\r\n const make: string = params?.make;\r\n const modelYear: number | undefined = params?.modelYear;\r\n const vehicleType: string | undefined = params?.vehicleType;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n /* Required make param of type string */\r\n const typeofMake = getTypeof(make);\r\n if (typeofMake !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.make\" argument is required and must be of type string, got: ` +\r\n `<${typeofMake}> ${make}`\r\n )\r\n );\r\n }\r\n /* At least one of modelYear or vehicleType params is required */\r\n if (!modelYear && !vehicleType) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\r\n `${modelYear} | ${vehicleType}`\r\n )\r\n );\r\n }\r\n /* valid modelYear param of type number */\r\n const typeofModelYear = getTypeof(modelYear);\r\n if (modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" must be of type number, got: ` +\r\n `<${typeofModelYear}> ${modelYear}`\r\n )\r\n );\r\n }\r\n /* valid vehicleType param of type string */\r\n const typeofVehicleType = getTypeof(vehicleType);\r\n if (vehicleType && typeofVehicleType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\r\n `<${typeofVehicleType}> ${vehicleType}`\r\n )\r\n );\r\n }\r\n\r\n /* Beginning of the the actionUrl */\r\n let actionUrl = `${action}/make/${params.make}/`;\r\n\r\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\r\n if (modelYear && vehicleType) {\r\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\r\n } else if (modelYear) {\r\n actionUrl += `modelYear/${modelYear}`;\r\n } else {\r\n actionUrl += `vehicleType/${vehicleType}`;\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeYear\r\n * @alias GetModelsForMakeYearResults\r\n */\r\nexport type GetModelsForMakeYearResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeYear API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeYear\r\n * @alias GetModelsForMakeYearResponse\r\n */\r\nexport type GetModelsForMakeYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetParts\r\n * @category Actions\r\n * @description GetParts NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetParts](module-api_actions_GetParts.GetParts.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetPartsResponse](#GetPartsResponse)\r\n * > - Type: [GetPartsResults](#GetPartsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetParts extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of ORGs with letter date in the given range of the dates\r\n * and with specified Type (`params.type`) of ORG.\r\n * - Up to 1000 results will be returned at a time.\r\n * - Get the next page by incrementing the `params.page` query parameter.\r\n * - All query `params` are optional.\r\n *\r\n * @async\r\n * @param {object} [params] - Query Search Parameters to append to the URL.\r\n * @param {number} [params.type] - Specified type of ORG to search.\r\n * @param {string} [params.fromDate] - Start date of search query.\r\n * @param {string} [params.toDate] - End date of search query.\r\n * @param {number} [params.page] - Which page number of results to request (100 results per page).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetParts(params?: {\r\n type?: number;\r\n fromDate?: string;\r\n toDate?: string;\r\n page?: number;\r\n }): Promise {\r\n const action = 'GetParts';\r\n\r\n const type: number | undefined = params?.type;\r\n const fromDate: string | undefined = params?.fromDate;\r\n const toDate: string | undefined = params?.toDate;\r\n const page: number | undefined = params?.page;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: <${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.type of type number */\r\n const typeofType = getTypeof(type);\r\n if (type && typeofType !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.type\" argument must be of type number, got: <${typeofType}> ${type}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.fromDate of type string */\r\n const typeofFromDate = getTypeof(fromDate);\r\n if (fromDate && typeofFromDate !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.fromDate\" argument must be of type string, got: <${typeofFromDate}> ${fromDate}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.toDate of type number */\r\n const typeofToDate = getTypeof(toDate);\r\n if (toDate && typeofToDate !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.toDate\" argument must be of type string, got: <${typeofToDate}> ${toDate}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.page of type number */\r\n const typeofPage = getTypeof(page);\r\n if (page && typeofPage !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.page\" argument must be of type number, got: <${typeofPage}> ${page}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetPartsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetParts\r\n * @alias GetPartsResults\r\n */\r\nexport type GetPartsResults = {\r\n CoverLetterURL: string;\r\n LetterDate: string;\r\n ManufacturerId: number;\r\n ManufacturerName: string;\r\n ModelYearFrom: string;\r\n ModelYearTo: string;\r\n Name: string;\r\n Type: string;\r\n URL: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetParts API Action.\r\n *\r\n * @memberof module:api/actions/GetParts\r\n * @alias GetPartsResponse\r\n */\r\nexport type GetPartsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleTypesForMake\r\n * @category Actions\r\n * @description GetVehicleTypesForMake NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleTypesForMake](module-api_actions_GetVehicleTypesForMake.GetVehicleTypesForMake.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleTypesForMakeResponse](#GetVehicleTypesForMakeResponse)\r\n * > - Type: [GetVehicleTypesForMakeResults](#GetVehicleTypesForMakeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleTypesForMake extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make,\r\n * whose name is LIKE the make name in the vPIC Dataset.\r\n * - `makeName` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\r\n *\r\n * @async\r\n * @param {string} makeName - Name of the vehicle make to search.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleTypesForMake(\r\n makeName: string\r\n ): Promise {\r\n const action = 'GetVehicleTypesForMake';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeName = getTypeof(makeName);\r\n if (typeofMakeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofMakeName}> ${makeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMake\r\n * @alias GetVehicleTypesForMakeResults\r\n */\r\nexport type GetVehicleTypesForMakeResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleTypesForMake API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMake\r\n * @alias GetVehicleTypesForMakeResponse\r\n */\r\nexport type GetVehicleTypesForMakeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleTypesForMakeId\r\n * @category Actions\r\n * @description GetVehicleTypesForMakeId NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleTypesForMakeId](module-api_actions_GetVehicleTypesForMakeId.GetVehicleTypesForMakeId.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleTypesForMakeIdResponse](#GetVehicleTypesForMakeIdResponse)\r\n * > - Type: [GetVehicleTypesForMakeIdResults](#GetVehicleTypesForMakeIdResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleTypesForMakeId extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make and\r\n * whose ID equals the make ID in the vPIC Dataset.\r\n *\r\n * @async\r\n * @param {number} makeID - Vehicle make ID.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleTypesForMakeId(\r\n makeID: number\r\n ): Promise {\r\n const action = 'GetVehicleTypesForMakeId';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeId = getTypeof(makeID);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeID}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeIdResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMakeId\r\n * @alias GetVehicleTypesForMakeIdResults\r\n */\r\nexport type GetVehicleTypesForMakeIdResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleTypesForMakeId API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMakeId\r\n * @alias GetVehicleTypesForMakeIdResponse\r\n */\r\nexport type GetVehicleTypesForMakeIdResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleVariableList\r\n * @category Actions\r\n * @description GetVehicleVariableList NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleVariableList](module-api_actions_GetVehicleVariableList.GetVehicleVariableList.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleVariableListResponse](#GetVehicleVariableListResponse)\r\n * > - Type: [GetVehicleVariableListResults](#GetVehicleVariableListResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleVariableList extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Vehicle related variables that are in the vPIC dataset.\r\n * - Information on the name, description and the type of the variable is provided.\r\n *\r\n * @async\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetVehicleVariableList(): Promise {\r\n const action = 'GetVehicleVariableList';\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleVariableListResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableList\r\n * @alias GetVehicleVariableListResults\r\n */\r\nexport type GetVehicleVariableListResults = {\r\n DataType: string;\r\n Description: string;\r\n ID: number;\r\n Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleVariableList API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableList\r\n * @alias GetVehicleVariableListResponse\r\n */\r\nexport type GetVehicleVariableListResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleVariableValuesList\r\n * @category Actions\r\n * @description GetVehicleVariableValuesList NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleVariableValuesList](module-api_actions_GetVehicleVariableValuesList.GetVehicleVariableValuesList.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleVariableValuesListResponse](#GetVehicleVariableValuesListResponse)\r\n * > - Type: [GetVehicleVariableValuesListResults](#GetVehicleVariableValuesListResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleVariableValuesList extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the accepted values for a given variable that are stored in the vPIC dataset.\r\n *\r\n * This applies to only \"Look up\" type of variables.\r\n * - `variableValue` can either be a:\r\n * - Variable Name (\"battery type\" in first example, please use full name, not just part of it),\r\n * - or Variable ID (number).\r\n *\r\n * @async\r\n * @param {string|number} variableValue - The variable you want to get a values list of.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleVariableValuesList(\r\n variableValue: string | number\r\n ): Promise {\r\n const action = 'GetVehicleVariableValuesList';\r\n\r\n /* Runtime typechecking */\r\n const typeofVariableValue = getTypeof(variableValue);\r\n if (typeofVariableValue !== 'string' && typeofVariableValue !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"variableValue\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofVariableValue}> ${variableValue}`\r\n )\r\n );\r\n }\r\n /* Encode to a valid URI string (space chars, etc.) if variableValue is a string*/\r\n if (typeofVariableValue === 'string') {\r\n variableValue = encodeURI(variableValue as string);\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${variableValue}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleVariableValuesListResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableValuesList\r\n * @alias GetVehicleVariableValuesListResults\r\n */\r\nexport type GetVehicleVariableValuesListResults = {\r\n ElementName: string;\r\n Id: number;\r\n Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleVariableValuesList API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableValuesList\r\n * @alias GetVehicleVariableValuesListResponse\r\n */\r\nexport type GetVehicleVariableValuesListResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetWMIsForManufacturer\r\n * @category Actions\r\n * @description GetWMIsForManufacturer NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetWMIsForManufacturer](module-api_actions_GetWMIsForManufacturer.GetWMIsForManufacturer.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetWMIsForManufacturerResponse](#GetWMIsForManufacturerResponse)\r\n * > - Type: [GetWMIsForManufacturerResults](#GetWMIsForManufacturerResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetWMIsForManufacturer extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * Provides information on the World Manufacturer Identifier (WMI) for a specified `manufacturer`.\r\n * - Only WMIs registered in vPICList are displayed.\r\n * - `manufacturer` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetWMIsForManufacturer(\r\n manufacturer: string\r\n ): Promise {\r\n const action = 'GetWMIsForManufacturer';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetWMIsForManufacturerResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetWMIsForManufacturer\r\n * @alias GetWMIsForManufacturerResults\r\n */\r\nexport type GetWMIsForManufacturerResults = {\r\n Country: string;\r\n CreatedOn: string;\r\n DateAvailableToPublic: string;\r\n Id: number;\r\n Name: string;\r\n UpdatedOn: string;\r\n VehicleType: string;\r\n WMI: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetWMIsForManufacturer API Action.\r\n *\r\n * @memberof module:api/actions/GetWMIsForManufacturer\r\n * @alias GetWMIsForManufacturerResponse\r\n */\r\nexport type GetWMIsForManufacturerResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/NHTSA\r\n * @category API\r\n * @description Module exporting the main (NHSTA) class for API Actions.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [NHTSA](NHTSA.html#NHTSA) - Class that implements all NHTSA API Actions\r\n */\r\n\r\nimport { Fetch /* Class */, FetchConfig /* Type */ } from './Fetch';\r\n\r\n/* Import implemented API Action classes */\r\nimport {\r\n DecodeVin,\r\n DecodeVinExtended,\r\n DecodeVinValues,\r\n DecodeVINValuesBatch,\r\n DecodeVinValuesExtended,\r\n DecodeWMI,\r\n GetAllMakes,\r\n GetAllManufacturers,\r\n GetCanadianVehicleSpecifications,\r\n GetEquipmentPlantCodes,\r\n GetMakeForManufacturer,\r\n GetMakesForManufacturerAndYear,\r\n GetMakesForVehicleType,\r\n GetManufacturerDetails,\r\n GetModelsForMake,\r\n GetModelsForMakeId,\r\n GetModelsForMakeIdYear,\r\n GetModelsForMakeYear,\r\n GetParts,\r\n GetVehicleTypesForMake,\r\n GetVehicleTypesForMakeId,\r\n GetVehicleVariableList,\r\n GetVehicleVariableValuesList,\r\n GetWMIsForManufacturer,\r\n} from './actions';\r\n\r\n/**\r\n * @class NHTSA\r\n * @augments module:api/Fetch.Fetch\r\n * @category API\r\n *\r\n * @param {FetchConfig} [userConfig] - Configuration options to construct the class with.\r\n *\r\n * @implements {module:api/actions/DecodeVin.DecodeVin}\r\n * @implements {module:api/actions/DecodeVinExtended.DecodeVinExtended}\r\n * @implements {module:api/actions/DecodeVinValues.DecodeVinValues}\r\n * @implements {module:api/actions/DecodeVinValuesExtended.DecodeVinValuesExtended}\r\n * @implements {module:api/actions/DecodeWMI.DecodeWMI}\r\n * @implements {module:api/actions/GetAllMakes.GetAllMakes}\r\n * @implements {module:api/actions/GetAllManufacturers.GetAllManufacturers}\r\n * @implements {module:api/actions/GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications}\r\n * @implements {module:api/actions/GetEquipmentPlantCodes.GetEquipmentPlantCodes}\r\n * @implements {module:api/actions/GetMakeForManufacturer.GetMakeForManufacturer}\r\n * @implements {module:api/actions/GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear}\r\n * @implements {module:api/actions/GetMakesForVehicleType.GetMakesForVehicleType}\r\n * @implements {module:api/actions/GetManufacturerDetails.GetManufacturerDetails}\r\n * @implements {module:api/actions/GetModelsForMake.GetModelsForMake}\r\n * @implements {module:api/actions/GetModelsForMakeId.GetModelsForMakeId}\r\n * @implements {module:api/actions/GetModelsForMakeIdYear.GetModelsForMakeIdYear}\r\n * @implements {module:api/actions/GetModelsForMakeYear.GetModelsForMakeYear}\r\n * @implements {module:api/actions/GetParts.GetParts}\r\n * @implements {module:api/actions/GetVehicleTypesForMake.GetVehicleTypesForMake}\r\n * @implements {module:api/actions/GetVehicleTypesForMakeId.GetVehicleTypesForMakeId}\r\n * @implements {module:api/actions/GetVehicleVariableList.GetVehicleVariableList}\r\n * @implements {module:api/actions/GetVehicleVariableValuesList.GetVehicleVariableValuesList}\r\n * @implements {module:api/actions/GetWMIsForManufacturer.GetWMIsForManufacturer}\r\n *\r\n * @example Node bundle\r\n * const { NHTSA } = require('@shaggytools/nhtsa-api-wrapper');\r\n *\r\n * const Wrapper = new NHTSA();\r\n *\r\n * // Decode a VIN and return a response of type ApiResponse\r\n * const response = Wrapper.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\r\n *\r\n * // or get details about a specific manufacturer, plus 23 other available Actions.\r\n * const hondaDetails = Wrapper.GetManufacturerDetails('Honda').catch(error => error)\r\n *\r\n * @example Browser bundle\r\n * // Change to specific version number \"x.x.xx\",\r\n * // or remove completely for the most recently published version\r\n * /dist/bundle.min.js\"\r\n * >\r\n *\r\n * \r\n *\r\n * @example Module - Node lazy loading\r\n * const { NHTSA } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\r\n * .catch(err => err);\r\n *\r\n * const ApiClient = new NHTSA();\r\n *\r\n * const results = await ApiClient.DecodeVin('3VWD07AJ5EM388202')\r\n * .catch(err => err)\r\n *\r\n * @example Module - Browser lazy loading\r\n * \r\n */\r\nclass NHTSA\r\n extends Fetch\r\n implements\r\n DecodeVin,\r\n DecodeVinExtended,\r\n DecodeVinValues,\r\n DecodeVINValuesBatch,\r\n DecodeVinValuesExtended,\r\n DecodeWMI,\r\n GetAllMakes,\r\n GetAllManufacturers,\r\n GetCanadianVehicleSpecifications,\r\n GetEquipmentPlantCodes,\r\n GetMakeForManufacturer,\r\n GetMakesForManufacturerAndYear,\r\n GetMakesForVehicleType,\r\n GetManufacturerDetails,\r\n GetModelsForMake,\r\n GetModelsForMakeId,\r\n GetModelsForMakeIdYear,\r\n GetModelsForMakeYear,\r\n GetParts,\r\n GetVehicleTypesForMake,\r\n GetVehicleTypesForMakeId,\r\n GetVehicleVariableList,\r\n GetVehicleVariableValuesList,\r\n GetWMIsForManufacturer {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n DecodeVin = DecodeVin.prototype.DecodeVin;\r\n\r\n DecodeVinExtended = DecodeVinExtended.prototype.DecodeVinExtended;\r\n\r\n DecodeVinValues = DecodeVinValues.prototype.DecodeVinValues;\r\n\r\n DecodeVINValuesBatch = DecodeVINValuesBatch.prototype.DecodeVINValuesBatch;\r\n\r\n DecodeVinValuesExtended =\r\n DecodeVinValuesExtended.prototype.DecodeVinValuesExtended;\r\n\r\n DecodeWMI = DecodeWMI.prototype.DecodeWMI;\r\n\r\n GetAllMakes = GetAllMakes.prototype.GetAllMakes;\r\n\r\n GetAllManufacturers = GetAllManufacturers.prototype.GetAllManufacturers;\r\n\r\n GetCanadianVehicleSpecifications =\r\n GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications;\r\n\r\n GetEquipmentPlantCodes =\r\n GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes;\r\n\r\n GetMakeForManufacturer =\r\n GetMakeForManufacturer.prototype.GetMakeForManufacturer;\r\n\r\n GetMakesForManufacturerAndYear =\r\n GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear;\r\n\r\n GetMakesForVehicleType =\r\n GetMakesForVehicleType.prototype.GetMakesForVehicleType;\r\n\r\n GetManufacturerDetails =\r\n GetManufacturerDetails.prototype.GetManufacturerDetails;\r\n\r\n GetModelsForMake = GetModelsForMake.prototype.GetModelsForMake;\r\n\r\n GetModelsForMakeId = GetModelsForMakeId.prototype.GetModelsForMakeId;\r\n\r\n GetModelsForMakeIdYear =\r\n GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear;\r\n\r\n GetModelsForMakeYear = GetModelsForMakeYear.prototype.GetModelsForMakeYear;\r\n\r\n GetParts = GetParts.prototype.GetParts;\r\n\r\n GetVehicleTypesForMake =\r\n GetVehicleTypesForMake.prototype.GetVehicleTypesForMake;\r\n\r\n GetVehicleTypesForMakeId =\r\n GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId;\r\n\r\n GetVehicleVariableList =\r\n GetVehicleVariableList.prototype.GetVehicleVariableList;\r\n\r\n GetVehicleVariableValuesList =\r\n GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList;\r\n\r\n GetWMIsForManufacturer =\r\n GetWMIsForManufacturer.prototype.GetWMIsForManufacturer;\r\n}\r\n\r\nexport { NHTSA };\r\n","/**\n * @module api/Client\n * @category API\n * @description Module exporting an instance of the NHSTA class.\n *\n * > - For more information, see the documentation for the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n */\n\nimport { NHTSA } from './NHTSA';\n\n/**\n * A new instance of the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n *\n * @type {NHTSA}\n *\n * @example Node bundle\n * const { Client } = require('@shaggytools/nhtsa-api-wrapper');\n *\n * // Decode a VIN and return get a response of type ApiResponse\n * const response = Client.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\n *\n * // or get details about a specific manufacturer, plus 23 other available Actions.\n * const audiDetails = Client.GetManufacturerDetails('Audi').catch(error => error)\n *\n * @example Browser bundle\n * // Change to specific version number \"x.x.xx\",\n * // or remove completely for the most recently published version\n * /dist/bundle.min.js\"\n * >\n *\n * \n *\n * @example Module - Node lazy loading\n * const { Client } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\n * .catch(err => err);\n *\n * const results = await Client.DecodeVin('3VWD07AJ5EM388202')\n * .catch(err => err)\n *\n * @example Module - Browser lazy loading\n * \n *\n */\nconst Client: NHTSA = new NHTSA();\n\nexport { Client };\n"],"names":["getTypeof","value","toString","Object","prototype","call","toLowerCase","slice","length","TRANSLITERATION_TABLE","A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z","WEIGHTS_ARRAY","DEFAULT_CONFIG","apiResponseFormat","baseUrl","options","Fetch","[object Object]","userConfig","finalConfig","this","params","allowEmptyStringValues","format","Promise","reject","Error","entries","paramsLength","resolve","isPrepended","queryStringArray","map","key","index","prepend","append","typeofValue","encodeURI","join","makeQueryString","url","typeofUrl","typeofOptions","combinedOptions","response","fetch","then","result","status","statusText","headers","catch","err","NhtsaResponse","json","finalResult","FetchResponse","ok","redirected","DecodeVin","super","vin","action","typeofParams","typeofVin","typeofModelYear","modelYear","queryString","buildQueryString","get","DecodeVinExtended","DecodeVinValues","DecodeVINValuesBatch","inputString","typeofInputString","body","method","content-type","DecodeVinValuesExtended","DecodeWMI","WMI","typeofWMI","GetAllMakes","GetAllManufacturers","typeofManufacturerType","manufacturerType","typeofPage","page","GetCanadianVehicleSpecifications","typeofYear","year","typeofMake","make","typeofModel","model","typeofUnits","units","params_","GetEquipmentPlantCodes","typeofEquipmentType","equipmentType","typeofReportType","reportType","GetMakeForManufacturer","manufacturer","typeofManufacturer","GetMakesForManufacturerAndYear","GetMakesForVehicleType","typeName","typeofTypeName","GetManufacturerDetails","GetModelsForMake","makeName","typeofMakeName","GetModelsForMakeId","makeID","typeofMakeId","GetModelsForMakeIdYear","makeId","vehicleType","typeofVehicleType","actionUrl","GetModelsForMakeYear","GetParts","type","fromDate","toDate","typeofType","typeofFromDate","typeofToDate","GetVehicleTypesForMake","GetVehicleTypesForMakeId","GetVehicleVariableList","GetVehicleVariableValuesList","variableValue","typeofVariableValue","GetWMIsForManufacturer","NHTSA","Client","vinArray","toUpperCase","split","checkDigit","isNaN","parseInt","checkValue","digit","digitValue","reduce","acc","currValue"],"mappings":"kqBAagBA,EAAUC,GACxB,MAAMC,EAAmBC,OAAOC,UAAUF,SACvCG,KAAKJ,GACLK,cACH,OAAOJ,EAASK,MAAM,EAAGL,EAASM,OAAS,GCL7C,MAAMC,EAAgD,CACpDC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,GASCC,EAA0B,CAC9B,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GC3BK,MAQMC,EAA8B,CACzCC,kBAAmB,O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,+BAE3CvF,4BACEwF,EAAuB9H,UAAU8H,uBAEnCxF,4BACE2F,EAAuBjI,UAAUiI,uBAEnC3F,sBAAmB4F,EAAiBlI,UAAUkI,iBAE9C5F,wBAAqB+F,EAAmBrI,UAAUqI,mBAElD/F,4BACEkG,EAAuBxI,UAAUwI,uBAEnClG,0BAAuBuG,EAAqB7I,UAAU6I,qBAEtDvG,cAAWwG,EAAS9I,UAAU8I,SAE9BxG,4BACE+G,EAAuBrJ,UAAUqJ,uBAEnC/G,8BACEgH,EAAyBtJ,UAAUsJ,yBAErChH,4BACEiH,EAAuBvJ,UAAUuJ,uBAEnCjH,kCACEkH,EAA6BxJ,UAAUwJ,6BAEzClH,4BACEqH,EAAuB3J,UAAU2J,8BCvJ/BE,EAAgB,IAAID,0pB5ByBC5E,GAEzB,GAAmB,iBAARA,GAAkC,IAAdA,EAAI5E,OACjC,OAAO,EAOT,MAAM0J,GAHN9E,EAAMA,EAAI+E,eAGqBC,MAAM,IAG/BC,EAAqBH,EAAS,GAMpC,GAAII,MAAMC,SAASF,KAA+B,MAAfA,EACjC,OAAO,EAQT,MAAMG,EAAoC,MAAfH,EAAqB,GAAKE,SAASF,GAiC9D,OAtBEH,EACG5G,IAAI,CAACmH,EAAejH,KACnB,IAAIkH,EAGCA,EADLJ,MAAMC,SAASE,IACGhK,EAAsBgK,GACtBF,SAASE,GAM3B,OAAOC,EAHgBzI,EAAcuB,KAMtCmH,OAAO,CAACC,EAAKC,IAAcD,EAAMC,EAAW,GAAK,KAOlCL"} \ No newline at end of file +{"version":3,"file":"bundle.min.js","sources":["../src/utils/getTypeof.ts","../src/utils/isValidVin.ts","../src/api/Fetch.ts","../src/utils/makeQueryString.ts","../src/api/actions/DecodeVin.ts","../src/api/actions/DecodeVinExtended.ts","../src/api/actions/DecodeVinValues.ts","../src/api/actions/DecodeVINValuesBatch.ts","../src/api/actions/DecodeVinValuesExtended.ts","../src/api/actions/DecodeWMI.ts","../src/api/actions/GetAllMakes.ts","../src/api/actions/GetAllManufacturers.ts","../src/api/actions/GetCanadianVehicleSpecifications.ts","../src/api/actions/GetEquipmentPlantCodes.ts","../src/api/actions/GetMakeForManufacturer.ts","../src/api/actions/GetMakesForManufacturerAndYear.ts","../src/api/actions/GetMakesForVehicleType.ts","../src/api/actions/GetManufacturerDetails.ts","../src/api/actions/GetModelsForMake.ts","../src/api/actions/GetModelsForMakeId.ts","../src/api/actions/GetModelsForMakeIdYear.ts","../src/api/actions/GetModelsForMakeYear.ts","../src/api/actions/GetParts.ts","../src/api/actions/GetVehicleTypesForMake.ts","../src/api/actions/GetVehicleTypesForMakeId.ts","../src/api/actions/GetVehicleVariableList.ts","../src/api/actions/GetVehicleVariableValuesList.ts","../src/api/actions/GetWMIsForManufacturer.ts","../src/api/NHTSA.ts","../src/api/Client.ts"],"sourcesContent":["/**\n * @module utils/getTypeof\n * @category Utils\n */\n\n/**\n * Gets type of `value` using `Object.prototype.toString.call(value)`.\n *\n * @param {any} value - Any kind of value (string, object, array, function, etc).\n *\n * @returns {string} - Type of value, normalized to a lowercase string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTypeof(value: any): string {\n const toString: string = Object.prototype.toString\n .call(value)\n .toLowerCase(); /* ex: => '[object string]' or '[object array], etc. */\n return toString.slice(8, toString.length - 1);\n}\n","/**\n * @module utils/isValidVin\n * @category Utils\n */\n\n/*\n * There will need to be some way to translate vin digits that are alphabetic\n * into their number value in the VIN algorithm transliteration table.\n * Later, during the creation of the checksum variable, those digits will be\n * multiplied against their corresponding weight (by index) in the WEIGHTS_ARRAY.\n * This transliteration table is a key part of the VIN validation algorithm.\n */\nconst TRANSLITERATION_TABLE: Record = {\n A: 1,\n B: 2,\n C: 3,\n D: 4,\n E: 5,\n F: 6,\n G: 7,\n H: 8,\n J: 1,\n K: 2,\n L: 3,\n M: 4,\n N: 5,\n P: 7,\n R: 9,\n S: 2,\n T: 3,\n U: 4,\n V: 5,\n W: 6,\n X: 7,\n Y: 8,\n Z: 9,\n};\n\n/*\n * Later, during the creation of the 'checksum' variable, these weights will be\n * multiplied by the value of their mirrored index vin digits.\n * The array index of each weight corresponds to the same index of each\n * digit in the 'vin'.\n */\nconst WEIGHTS_ARRAY: number[] = [\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n 10,\n 0,\n 9,\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n];\n\n/**\n * Provides **offline** validation of Vehicle Identification Numbers (VINs) using the\n * [VIN Check Algorithm](https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit).\n *\n * @param {string} vin - Vehicle Identification Number.\n * @returns {boolean} True for a valid VIN, false for an invalid VIN.\n *\n * @example When loaded from the browser via html script tags\n * // \n * const isValid = NHTSA.isValidVin('3VWD07AJ5EM388202')\n * console.log(isValid) // true\n *\n * @example When loaded as a module\n * import { isValidVin } from '@shaggytools/nhtsa-api-wrapper'\n * const isValid = isValidVin('3VWD07AJ5EM388202')\n * console.log(isValid) // true\n *\n */\nexport function isValidVin(vin: string): boolean {\n /* A valid VIN must be a string and is always exactly 17 digits */\n if (typeof vin !== 'string' || vin.length != 17) {\n return false;\n }\n\n /* Normalize the vin to all uppercase letters */\n vin = vin.toUpperCase();\n\n /* split the vin digits into an array */\n const vinArray: string[] = vin.split('');\n\n /* checkDigit will be tested against the checkSum later */\n const checkDigit: string = vinArray[8];\n\n /*\n * In a valid VIN, the checkDigit can either be:\n * a number, 0-9 inclusive OR the character 'X'\n */\n if (isNaN(parseInt(checkDigit)) && checkDigit !== 'X') {\n return false;\n }\n\n /*\n * The checkValue must be a digit and 'X' is the only valid alphabetic check value.\n * As per the algorithm, a checkDigit of 'X' is equal to a checkValue of `10` and needs\n * to be converted as such.\n */\n const checkValue: number = checkDigit === 'X' ? 10 : parseInt(checkDigit);\n\n /*\n * Maps the vinArray and converts any values (digits) that are alphabetic,\n * into numbers, using the TRANSLITERATION_TABLE.\n * Then these numbers are multiplied against their corresponding weight\n * in the WEIGHTS_ARRAY, matched by index position.\n * All 17 of those digitValues are then added together and divided by 11.\n * The remainder, or % modulo, of that division will be the final 'checksum'.\n */\n const checksum: number =\n vinArray\n .map((digit: string, index: number) => {\n let digitValue: number;\n /* Use the transliteration table to convert any Not a Number(NaN) values to numbers */\n isNaN(parseInt(digit))\n ? (digitValue = TRANSLITERATION_TABLE[digit])\n : (digitValue = parseInt(digit));\n\n /* Convert the digitValue to a weighted number corresponding to it's position, by index, in the weightsArray. */\n const weight: number = WEIGHTS_ARRAY[index];\n\n /* The final step for each digit is to multiply the digit by it's corresponding weight */\n return digitValue * weight;\n })\n /* Finally, get the sum of all digits and divide by 11, the remainder of that operation is the checksum */\n .reduce((acc, currValue) => acc + currValue, 0) % 11;\n\n /*\n * The checksum is compared against the checkValue we set earlier (the 9th digit of the VIN)\n * As per the algorithm, if they are equal to each other, then the VIN must be valid and\n * we return true, otherwise the VIN is invalid and we return false.\n */\n return checksum === checkValue;\n}\n","/**\n * @module api/Fetch\n * @category API\n * @description API Fetch Logic.\n *\n * > **Module Exports**:\n * > - Class: [Fetch](module-api_Fetch.Fetch.html)\n * > - Constant: [BASE_URL](#~BASE_URL)\n * > - Constant: [DEFAULT_CONFIG](#~DEFAULT_CONFIG)\n * >\n * > **Types**\n * > - Type: [ApiResponse](#ApiResponse)\n * > - Type: [FetchConfig](#FetchConfig)\n * > - Type: [FetchRequestOptions](#FetchRequestOptions)\n * > - Type: [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body)\n * > - Type: [FetchResponse](#FetchResponse)\n * > - Type: [NhtsaResponse](#NhtsaResponse)\n */\n\n/* Module Dependencies */\nimport fetch from 'cross-fetch';\n/* Utilities */\nimport { getTypeof, makeQueryString } from '../utils';\n/* Types */\nimport { QueryStringParameters } from '../utils/types';\n\n/*****************\n * CONSTANTS\n ****************/\n\n/**\n * @constant {string} BASE_URL Default Fetch base URL string\n * @default 'https://vpic.nhtsa.dot.gov/api/vehicles'\n */\nexport const BASE_URL = 'https://vpic.nhtsa.dot.gov/api/vehicles';\n\n/**\n * @constant {module:api/Fetch.FetchConfig} DEFAULT_CONFIG Default Fetch configuration options\n * @property {string} apiResponseFormat=json\n * @property {string} baseUrl=BASE_URL Default: [BASE_URL](module-api_Fetch.html#~BASE_URL)\n * @property {FetchRequestOptions} options={method:\"GET\"}\n */\nexport const DEFAULT_CONFIG: FetchConfig = {\n apiResponseFormat: 'json',\n baseUrl: BASE_URL,\n options: {},\n};\n\n/*****************\n * Fetch Class\n ****************/\n\n/**\n * Class wrapper containing API wrapper HTTP Fetch logic.\n *\n * > **Static Methods**:\n * > - [buildQueryString](#buildQueryString)\n * > - [get](#get)\n *\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n * @category API\n */\nexport class Fetch {\n apiResponseFormat: string;\n baseUrl?: string;\n options?: FetchRequestOptions;\n\n constructor(userConfig?: FetchConfig) {\n let finalConfig: FetchConfig;\n\n /* userConfig takes precedence over DEFAULT_CONFIG */\n if (userConfig && getTypeof(userConfig) === 'object') {\n finalConfig = {\n ...DEFAULT_CONFIG,\n ...userConfig,\n options: { ...DEFAULT_CONFIG.options, ...userConfig.options },\n };\n } else {\n finalConfig = { ...DEFAULT_CONFIG };\n }\n\n /** @private */\n this.apiResponseFormat = 'json';\n /** @private */\n this.baseUrl = finalConfig.baseUrl;\n /** @private */\n this.options = finalConfig.options;\n }\n\n /**\n * Builds a query string from QueryStringParameters.\n *\n * @param {QueryStringParameters} params - Object containing Key:Value pairs to build the URL query string with.\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\n * - Given params of `{paramName: \"\"}` , setting this to true will use 'paramName=' in the final query string.\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\n * @returns {(Promise)} A formatted NHSTA.dot.gov Vehicles API query string.\n */\n async buildQueryString(\n params?: QueryStringParameters,\n allowEmptyStringValues = false\n ): Promise {\n /*\n * Make sure we're always using 'format=json' in the url Query parameters\n * If the user provides a 'format' key in the params, during class instantiation we want to override it to 'json'\n * This package may provide support for the other formats (CSV and XML) if requested.\n */\n if (!params || getTypeof(params) !== 'object') {\n params = {\n format: this.apiResponseFormat,\n };\n } else {\n params = { ...params, format: this.apiResponseFormat };\n }\n\n /* Return the completed query string */\n return await makeQueryString(params, allowEmptyStringValues);\n }\n\n /**\n * Uses the `cross-fetch` npm package to send HTTP requests and retrieve data from an API.\n * - In browser environments, [whatwg-fetch](https://github.com/github/fetch/) window.fetch is used.\n * - In node environments, [node-fetch](https://github.com/bitinn/node-fetch/) NPM package is used.\n *\n * @param {string} url - URL to fetch data from.\n * @param {FetchRequestOptions} [options] - [Fetch options](https://github.github.io/fetch/#options).\n * @returns {(Promise)} Response from the API.\n */\n async get(\n url: string,\n options: FetchRequestOptions = {}\n ): Promise {\n /* Runtime typechecking */\n const typeofUrl = getTypeof(url);\n if (typeofUrl !== 'string') {\n return Promise.reject(\n new Error(\n `Fetch.get(url) - url argument must be of type string, got: ${typeofUrl}`\n )\n );\n }\n const typeofOptions = getTypeof(options);\n if (typeofOptions !== 'object') {\n return Promise.reject(\n new Error(\n `Fetch.get(url, options) - options argument must be of type object, got: ${typeofOptions}`\n )\n );\n }\n\n /* Combine user provided 'options' and class property 'this.options', user options overwrite class options */\n const combinedOptions = { ...this.options, ...options };\n\n /* Use the cross-fetch package to perform an HTTP request */\n const response: Response = await fetch(url, combinedOptions)\n .then((result) => {\n if (!result?.status || result.status >= 400) {\n throw new Error(\n `Bad response from server, code: ${result?.status}, text: ${result?.statusText}, headers: ${result?.headers}`\n );\n } else return result;\n })\n .catch((err) =>\n Promise.reject(new Error(`Fetch.get() http error: ${err}`))\n );\n\n /* Convert the NHTSA API data to JSON */\n const NhtsaResponse: NhtsaResponse = await response\n .json()\n .then((json: NhtsaResponse): NhtsaResponse => json);\n\n /* Add the fetch response information to the returned NHSTA API data */\n const finalResult: ApiResponse = {\n ...NhtsaResponse,\n FetchResponse: {\n headers: response.headers,\n ok: response.ok,\n redirected: response.redirected,\n status: response.status,\n statusText: response.statusText,\n url: response.url,\n },\n };\n\n /* Return the completed ApiResponse */\n return Promise.resolve(finalResult);\n }\n}\n\n/*****************\n * Types\n ****************/\n\n/**\n * Various fetch request body types.\n *\n * @typedef FetchRequestBodyTypes\n * @type {URLSearchParams | FormData | Blob | ArrayBuffer | DataView}\n *\n * @memberof module:api/Fetch\n */\nexport type FetchRequestBodyTypes =\n | URLSearchParams\n | FormData\n | Blob\n | ArrayBuffer\n | DataView;\n\n/**\n * Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}.\n *\n * @memberof module:api/Fetch\n * @alias FetchRequestOptions\n */\nexport type FetchRequestOptions = {\n /**HTTP request method - Default: \"GET\". */\n method?: string;\n /** HTTP request body - [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body). */\n body?: string | FetchRequestBodyTypes;\n /** [Object, Headers](https://github.github.io/fetch/#Headers) - Default: {}. */\n headers?: Record | Headers;\n /**\n * Default: \"omit\" - Authentication credentials mode.\n * - \"omit\" - don't include authentication credentials (e.g. Cookies) in the request.\n * - \"same-origin\" - include credentials in requests to the same site\n * - \"include\" - include credentials in requests to all sites.\n */\n credentials?: 'omit' | 'same-origin' | 'include';\n};\n\n/**\n * Used when instantiating a Fetch class or related subclass.\n *\n * @memberof module:api/Fetch\n * @alias FetchConfig\n */\nexport type FetchConfig = {\n /** Requested response format from the NHSTA API (hardcoded to 'json' for now). */\n apiResponseFormat?: string;\n /** Base of the URL to build fetch URLs from. */\n baseUrl?: string;\n /** Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}. */\n options?: FetchRequestOptions;\n};\n\n/**\n * [Fetch API Response](https://github.github.io/fetch/#Response) properties.\n *\n * @memberof module:api/Fetch\n * @alias FetchResponse\n */\nexport type FetchResponse = {\n /** The [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object associated with the response. */\n headers: Headers;\n /** A boolean indicating whether the response was successful (status in the range 200–299) or not. */\n ok: boolean;\n /** Indicates whether or not the response is the result of a redirect (that is, its URL list has more than one entry). */\n redirected: boolean;\n /** The status code of the response. (This will be 200 for a success). */\n status: number;\n /** The status message corresponding to the status code. (e.g., OK for 200). */\n statusText: string;\n /** The URL of the response. */\n url: string;\n};\n\n/**\n * Response data returned from the NHSTA API.\n *\n * @memberof module:api/Fetch\n * @alias NhtsaResponse\n */\nexport type NhtsaResponse = {\n /** The number of items returned in the Results object. */\n Count: number;\n /** A message describing the Results. */\n Message: string;\n /** Search terms (VIN, WMI, etc) used in the request URL. */\n SearchCriteria: string;\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\n Results: Array;\n};\n\n/**\n * Complete response returned by {@link module:api/Fetch.Fetch#get}.\n *\n * @see {@link module:api/Fetch.NhtsaResponse}\n * @see {@link module:api/Fetch.FetchResponse}\n * @memberof module:api/Fetch\n * @alias ApiResponse\n */\nexport type ApiResponse = {\n /** The number of items returned in the Results object. */\n Count: number;\n /** A message describing the Results. */\n Message: string;\n /** Search terms (VIN, WMI, etc) used in the request URL. */\n SearchCriteria: string;\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) Properties. */\n FetchResponse: FetchResponse;\n};\n","import { getTypeof } from './getTypeof';\n\n/**\n * @module utils/makeQueryString\n * @category Utils\n */\n\n/**\n * Utility method to generate a query string compatible with the NHSTA API, for use in an API URL string.\n *\n * @async\n *\n * @param {object} params - Object of Type [QueryStringParameters](module-utils_makeQueryString.html#.QueryStringParameters).\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\n * - Given params of `{ paramName: \"\" }` , setting this to true will use 'paramName=' in the final query string.\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\n *\n * @returns {Promise} A query string of search parameters for use in a final Fetch.get URL.\n *\n * @example When loaded from the browser via html script tags\n * // \n * const qs = await NHTSA.makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example When loaded as a module\n * import { makeQueryString } from '@shaggytools/nhtsa-api-wrapper'\n * const qs = await makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example Single Param:\n * const qs = await makeQueryString({\n * modelYear: 2019\n * }).catch(error => error)\n * console.log(qs) // \"?modelYear=2019\"\n *\n * @example Multiple Params:\n * const qs = await makeQueryString({\n * whatever: 'some value',\n * modelYear: 2006,\n * page: \"2\"\n * }).catch(error => error)\n *\n * console.log(qs) // \"?whatever=some%20value&modelYear=2006&page=2\"\n *\n * @example Empty Params Object:\n * const qs = await makeQueryString({}).catch(error => error)\n *\n * console.log(qs) // \"\"\n *\n * @example Using allowEmptyStringValues option:\n * const qs = await makeQueryString({\n * year: 2016,\n * vehicleType: '',\n * make: 'Audi'\n * }, true).catch(error => error)\n *\n * console.log(qs) // \"?year=2016&vehicleType=&make=Audi\"\n *\n */\nexport function makeQueryString(\n params: QueryStringParameters = {},\n allowEmptyStringValues = false\n): Promise {\n /* Beginning of error message string */\n const errorBase =\n 'queryString(params) - expected params in the form of an object, got:';\n\n /* Runtime type guard params argument, must be of type object */\n if (getTypeof(params) !== 'object') {\n return Promise.reject(new Error(`${errorBase} ${params}`));\n }\n\n /* Setup QueryString for Array mapping */\n const entries = Object.entries(params);\n const paramsLength = entries.length;\n\n /* Return an empty string if params are an empty object */\n if (paramsLength < 1) return Promise.resolve('');\n\n /* Used to check if we've already prepended a valid query param */\n let isPrepended = false;\n\n /* Map [key]:value entries to \"key=value\" strings in an array */\n const queryStringArray = entries.map(([key, value], index) => {\n let prepend = '';\n let append = '';\n\n const typeofValue = getTypeof(value);\n\n /* Convert any number values to a string */\n if (value && typeofValue === 'number') {\n value = value.toString();\n }\n\n /* Skip any invalid values, only string and number value types are valid */\n if (\n (value || allowEmptyStringValues) &&\n (typeofValue === 'string' || typeofValue === 'number')\n ) {\n /* if this is the first param we need to prepend the '?' char */\n if (!isPrepended) {\n prepend = '?';\n isPrepended = true;\n }\n /* if there is another param coming after this one we need to append the '&' char */\n if (index < paramsLength - 1) {\n append = '&';\n }\n\n /* Add the completed partial query string to queryStringArray */\n return `${prepend}${key}=${value}${append}`;\n }\n return;\n });\n\n /* Join and return the completed query string after URI encoding */\n return Promise.resolve(encodeURI(queryStringArray.join('')));\n}\n\n/**\n * Object containing Key:Value pairs to build the URL query string with.\n * - Parameter values may be either strings or numbers.\n *\n * @memberof module:utils/makeQueryString\n * @alias QueryStringParameters\n * @example\n * {\n * modelYear: 2009,\n * whatever: 'something'\n * }\n *\n */\nexport type QueryStringParameters = {\n [propName: string]: string | number | undefined;\n};\n","/**\n * @module api/actions/DecodeVin\n * @category Actions\n * @description DecodeVin NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVin](module-api_actions_DecodeVin.DecodeVin.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinResponse](#DecodeVinResponse)\n * > - Type: [DecodeVinResults](#DecodeVinResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVin extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * The DecodeVin API Action will decode the VIN and the decoded output will be made available in the format of Key-value pairs.\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This API also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n * - The 9th digit is not necessary.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {number} [params.modelYear] - Optional Model Year search parameter.\n * @returns {(Promise)} - Api Response object.\n */\n async DecodeVin(\n vin: string,\n params?: {\n modelYear?: number;\n }\n ): Promise {\n const action = 'DecodeVin';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (params?.modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVin\n * @alias DecodeVinResults\n */\nexport type DecodeVinResults = {\n Value: string | null;\n ValueId: string | null;\n Variable: string;\n VariableId: number;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVin API Action.\n *\n * @memberof module:api/actions/DecodeVin\n * @alias DecodeVinResponse\n */\nexport type DecodeVinResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/DecodeVinExtended\n * @category Actions\n * @description DecodeVinExtended NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVinExtended](module-api_actions_DecodeVinExtended.DecodeVinExtended.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinExtendedResponse](#DecodeVinExtendedResponse)\n * > - Type: [DecodeVinExtendedResults](#DecodeVinExtendedResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVinExtended extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This is exactly like the DecodeVin method but provides additional information on variables\n * related to other NHTSA programs like\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\n * - This will decode the VIN and the decoded output will be made available\n * in the format of Key-value pairs.\n * - In the returned 'Results` object:\n * - The IDs (VariableID and ValueID) represent the unique ID associated with the Variable/Value.\n * - In case of text variables, the ValueID is not applicable.\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n * - The 9th digit is not necessary.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\n * @returns {(Promise)} - Api Response object.\n */\n async DecodeVinExtended(\n vin: string,\n params?: {\n modelYear?: string | number;\n }\n ): Promise {\n const action = 'DecodeVinExtended';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (params?.modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinExtendedResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVinExtended\n * @alias DecodeVinExtendedResults\n */\nexport type DecodeVinExtendedResults = {\n Value: string | null;\n ValueId: string | null;\n Variable: string;\n VariableId: number;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVinExtended API Action.\n *\n * @memberof module:api/actions/DecodeVinExtended\n * @alias DecodeVinExtendedResponse\n */\nexport type DecodeVinExtendedResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/DecodeVinValues\n * @category Actions\n * @description DecodeVinValues NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVinValues](module-api_actions_DecodeVinValues.DecodeVinValues.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinValuesResponse](#DecodeVinValuesResponse)\n * > - Type: [DecodeVinValuesResults](#DecodeVinValuesResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVinValues extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * The DecodeVinValues API Action will decode the VIN with the Results returned in a _flat file_ format.\n * - The Results will be made available in a flat file format of a single object containing\n * 'key: value' results.\n * - Providing params.modelYear allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\n * @returns {(Promise)} Api Response object.\n */\n async DecodeVinValues(\n vin: string,\n params?: {\n modelYear?: number;\n }\n ): Promise {\n const action = 'DecodeVinValues';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (\n params?.modelYear &&\n typeofModelYear !== 'string' &&\n typeofModelYear !== 'number'\n ) {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinValuesResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVinValues\n * @alias DecodeVinValuesResults\n */\nexport type DecodeVinValuesResults = {\n /** Flat file format, single object containing keys and values of type string */\n ABS: string;\n ActiveSafetySysNote: string;\n AdaptiveCruiseControl: string;\n AdaptiveDrivingBeam: string;\n AdaptiveHeadlights: string;\n AdditionalErrorText: string;\n AirBagLocCurtain: string;\n AirBagLocFront: string;\n AirBagLocKnee: string;\n AirBagLocSeatCushion: string;\n AirBagLocSide: string;\n AutoReverseSystem: string;\n AutomaticPedestrianAlertingSound: string;\n AxleConfiguration: string;\n Axles: string;\n BasePrice: string;\n BatteryA: string;\n BatteryA_to: string;\n BatteryCells: string;\n BatteryInfo: string;\n BatteryKWh: string;\n BatteryKWh_to: string;\n BatteryModules: string;\n BatteryPacks: string;\n BatteryType: string;\n BatteryV: string;\n BatteryV_to: string;\n BedLengthIN: string;\n BedType: string;\n BlindSpotMon: string;\n BodyCabType: string;\n BodyClass: string;\n BrakeSystemDesc: string;\n BrakeSystemType: string;\n BusFloorConfigType: string;\n BusLength: string;\n BusType: string;\n CAN_AACN: string;\n CIB: string;\n CashForClunkers: string;\n ChargerLevel: string;\n ChargerPowerKW: string;\n CoolingType: string;\n CurbWeightLB: string;\n CustomMotorcycleType: string;\n DaytimeRunningLight: string;\n DestinationMarket: string;\n DisplacementCC: string;\n DisplacementCI: string;\n DisplacementL: string;\n Doors: string;\n DriveType: string;\n DriverAssist: string;\n DynamicBrakeSupport: string;\n EDR: string;\n ESC: string;\n EVDriveUnit: string;\n ElectrificationLevel: string;\n EngineConfiguration: string;\n EngineCycles: string;\n EngineCylinders: string;\n EngineHP: string;\n EngineHP_to: string;\n EngineKW: string;\n EngineManufacturer: string;\n EngineModel: string;\n EntertainmentSystem: string;\n ErrorCode: string;\n ErrorText: string;\n ForwardCollisionWarning: string;\n FuelInjectionType: string;\n FuelTypePrimary: string;\n FuelTypeSecondary: string;\n GCWR: string;\n GCWR_to: string;\n GVWR: string;\n GVWR_to: string;\n KeylessIgnition: string;\n LaneDepartureWarning: string;\n LaneKeepSystem: string;\n LowerBeamHeadlampLightSource: string;\n Make: string;\n Manufacturer: string;\n ManufacturerId: string;\n Model: string;\n ModelYear: string;\n MotorcycleChassisType: string;\n MotorcycleSuspensionType: string;\n NCSABodyType: string;\n NCSAMake: string;\n NCSAMapExcApprovedBy: string;\n NCSAMapExcApprovedOn: string;\n NCSAMappingException: string;\n NCSAModel: string;\n NCSANote: string;\n Note: string;\n OtherBusInfo: string;\n OtherEngineInfo: string;\n OtherMotorcycleInfo: string;\n OtherRestraintSystemInfo: string;\n OtherTrailerInfo: string;\n ParkAssist: string;\n PedestrianAutomaticEmergencyBraking: string;\n PlantCity: string;\n PlantCompanyName: string;\n PlantCountry: string;\n PlantState: string;\n PossibleValues: string;\n Pretensioner: string;\n RearCrossTrafficAlert: string;\n RearVisibilitySystem: string;\n SAEAutomationLevel: string;\n SAEAutomationLevel_to: string;\n SeatBeltsAll: string;\n SeatRows: string;\n Seats: string;\n SemiautomaticHeadlampBeamSwitching: string;\n Series: string;\n Series2: string;\n SteeringLocation: string;\n SuggestedVIN: string;\n TPMS: string;\n TopSpeedMPH: string;\n TrackWidth: string;\n TractionControl: string;\n TrailerBodyType: string;\n TrailerLength: string;\n TrailerType: string;\n TransmissionSpeeds: string;\n TransmissionStyle: string;\n Trim: string;\n Trim2: string;\n Turbo: string;\n VIN: string;\n ValveTrainDesign: string;\n VehicleType: string;\n WheelBaseLong: string;\n WheelBaseShort: string;\n WheelBaseType: string;\n WheelSizeFront: string;\n WheelSizeRear: string;\n Wheels: string;\n Windows: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVinValues API Action.\n *\n * @memberof module:api/actions/DecodeVinValues\n * @alias DecodeVinValuesResponse\n */\nexport type DecodeVinValuesResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /**\n * The search results returned by the NHSTA API request.\n * Flat file format, single object containing keys and values of type string\n * */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/DecodeVINValuesBatch\n * @category Actions\n * @description DecodeVINValuesBatch NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVINValuesBatch](module-api_actions_DecodeVINValuesBatch.DecodeVINValuesBatch.html)\n * >\n * > **Types**\n * > - Type: [DecodeVINValuesBatchResponse](#DecodeVINValuesBatchResponse)\n * > - Type: [DecodeVINValuesBatchResults](#DecodeVINValuesBatchResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVINValuesBatch extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This decodes a batch of VINs that are submitted in a standardized format in a string\n * and returns multiple decodes in a flat format.\n *\n * The `inputString` parameter should be in the following format:\n * - `vin , modelYear ; vin , modelYear ; vin , modelYear ...`\n *\n * \"modelYear\" is optional, the output for each VIN decode is in the same format as produced by the \"Decode VIN (flat format)\" method.\n *\n * @async\n * @param {string} inputString - A string of Vehicle Identification Numbers (full or partial) following the format listed in the description.\n * @returns {(Promise)} - Api Response object.\n */\n async DecodeVINValuesBatch(\n inputString: string\n ): Promise {\n const action = 'DecodeVINValuesBatch';\n\n /* Runtime typechecking */\n const typeofInputString = getTypeof(inputString);\n if (typeofInputString !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"inputString\" argument is required and must be of type string, got: ` +\n `<${typeofInputString}> ${inputString}`\n )\n );\n }\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/`;\n\n const body = encodeURI(`DATA=${inputString}&format=json`);\n\n /* Return the result */\n return await this.get(url, {\n method: 'POST',\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\n body,\n })\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVINValuesBatchResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVINValuesBatch\n * @alias DecodeVINValuesBatchResults\n */\nexport type DecodeVINValuesBatchResults = {\n ABS: string;\n ActiveSafetySysNote: string;\n AdaptiveCruiseControl: string;\n AdaptiveDrivingBeam: string;\n AdaptiveHeadlights: string;\n AdditionalErrorText: string;\n AirBagLocCurtain: string;\n AirBagLocFront: string;\n AirBagLocKnee: string;\n AirBagLocSeatCushion: string;\n AirBagLocSide: string;\n AutoReverseSystem: string;\n AutomaticPedestrianAlertingSound: string;\n AxleConfiguration: string;\n Axles: string;\n BasePrice: string;\n BatteryA: string;\n BatteryA_to: string;\n BatteryCells: string;\n BatteryInfo: string;\n BatteryKWh: string;\n BatteryKWh_to: string;\n BatteryModules: string;\n BatteryPacks: string;\n BatteryType: string;\n BatteryV: string;\n BatteryV_to: string;\n BedLengthIN: string;\n BedType: string;\n BlindSpotMon: string;\n BodyCabType: string;\n BodyClass: string;\n BrakeSystemDesc: string;\n BrakeSystemType: string;\n BusFloorConfigType: string;\n BusLength: string;\n BusType: string;\n CAN_AACN: string;\n CIB: string;\n CashForClunkers: string;\n ChargerLevel: string;\n ChargerPowerKW: string;\n CoolingType: string;\n CurbWeightLB: string;\n CustomMotorcycleType: string;\n DaytimeRunningLight: string;\n DestinationMarket: string;\n DisplacementCC: string;\n DisplacementCI: string;\n DisplacementL: string;\n Doors: string;\n DriveType: string;\n DriverAssist: string;\n DynamicBrakeSupport: string;\n EDR: string;\n ESC: string;\n EVDriveUnit: string;\n ElectrificationLevel: string;\n EngineConfiguration: string;\n EngineCycles: string;\n EngineCylinders: string;\n EngineHP: string;\n EngineHP_to: string;\n EngineKW: string;\n EngineManufacturer: string;\n EngineModel: string;\n EntertainmentSystem: string;\n ErrorCode: string;\n ErrorText: string;\n ForwardCollisionWarning: string;\n FuelInjectionType: string;\n FuelTypePrimary: string;\n FuelTypeSecondary: string;\n GCWR: string;\n GCWR_to: string;\n GVWR: string;\n GVWR_to: string;\n KeylessIgnition: string;\n LaneDepartureWarning: string;\n LaneKeepSystem: string;\n LowerBeamHeadlampLightSource: string;\n Make: string;\n Manufacturer: string;\n ManufacturerId: string;\n Model: string;\n ModelYear: string;\n MotorcycleChassisType: string;\n MotorcycleSuspensionType: string;\n NCSABodyType: string;\n NCSAMake: string;\n NCSAMapExcApprovedBy: string;\n NCSAMapExcApprovedOn: string;\n NCSAMappingException: string;\n NCSAModel: string;\n NCSANote: string;\n Note: string;\n OtherBusInfo: string;\n OtherEngineInfo: string;\n OtherMotorcycleInfo: string;\n OtherRestraintSystemInfo: string;\n OtherTrailerInfo: string;\n ParkAssist: string;\n PedestrianAutomaticEmergencyBraking: string;\n PlantCity: string;\n PlantCompanyName: string;\n PlantCountry: string;\n PlantState: string;\n PossibleValues: string;\n Pretensioner: string;\n RearCrossTrafficAlert: string;\n RearVisibilitySystem: string;\n SAEAutomationLevel: string;\n SAEAutomationLevel_to: string;\n SeatBeltsAll: string;\n SeatRows: string;\n Seats: string;\n SemiautomaticHeadlampBeamSwitching: string;\n Series: string;\n Series2: string;\n SteeringLocation: string;\n SuggestedVIN: string;\n TPMS: string;\n TopSpeedMPH: string;\n TrackWidth: string;\n TractionControl: string;\n TrailerBodyType: string;\n TrailerLength: string;\n TrailerType: string;\n TransmissionSpeeds: string;\n TransmissionStyle: string;\n Trim: string;\n Trim2: string;\n Turbo: string;\n VIN: string;\n ValveTrainDesign: string;\n VehicleType: string;\n WheelBaseLong: string;\n WheelBaseShort: string;\n WheelBaseType: string;\n WheelSizeFront: string;\n WheelSizeRear: string;\n Wheels: string;\n Windows: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVINValuesBatch API Action.\n *\n * @memberof module:api/actions/DecodeVINValuesBatch\n * @alias DecodeVINValuesBatchResponse\n */\nexport type DecodeVINValuesBatchResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/DecodeVinValuesExtended\n * @category Actions\n * @description DecodeVinValuesExtended NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVinValuesExtended](module-api_actions_DecodeVinValuesExtended.DecodeVinValuesExtended.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinValuesExtendedResponse](#DecodeVinValuesExtendedResponse)\n * > - Type: [DecodeVinValuesExtendedResults](#DecodeVinValuesExtendedResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVinValuesExtended extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This is exactly like the DecodeVinValues (flat format Results) method but provides additional information\n * on variables related to other NHTSA programs like\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\n * - The Results will be made available in a flat file format of a single object containing\n * 'key: value' results.\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\n * @reje\n * @returns {(Promise)} Api Response object.\n */\n async DecodeVinValuesExtended(\n vin: string,\n params?: {\n modelYear?: string | number;\n }\n ): Promise {\n const action = 'DecodeVinValuesExtended';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (params?.modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinValuesExtendedResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVinValuesExtended\n * @alias DecodeVinValuesExtendedResults\n */\nexport type DecodeVinValuesExtendedResults = {\n /** Flat file format, single object containing keys and values of type string */\n ABS: string;\n ActiveSafetySysNote: string;\n AdaptiveCruiseControl: string;\n AdaptiveDrivingBeam: string;\n AdaptiveHeadlights: string;\n AdditionalErrorText: string;\n AirBagLocCurtain: string;\n AirBagLocFront: string;\n AirBagLocKnee: string;\n AirBagLocSeatCushion: string;\n AirBagLocSide: string;\n AutoReverseSystem: string;\n AutomaticPedestrianAlertingSound: string;\n AxleConfiguration: string;\n Axles: string;\n BasePrice: string;\n BatteryA: string;\n BatteryA_to: string;\n BatteryCells: string;\n BatteryInfo: string;\n BatteryKWh: string;\n BatteryKWh_to: string;\n BatteryModules: string;\n BatteryPacks: string;\n BatteryType: string;\n BatteryV: string;\n BatteryV_to: string;\n BedLengthIN: string;\n BedType: string;\n BlindSpotMon: string;\n BodyCabType: string;\n BodyClass: string;\n BrakeSystemDesc: string;\n BrakeSystemType: string;\n BusFloorConfigType: string;\n BusLength: string;\n BusType: string;\n CAN_AACN: string;\n CIB: string;\n CashForClunkers: string;\n ChargerLevel: string;\n ChargerPowerKW: string;\n CoolingType: string;\n CurbWeightLB: string;\n CustomMotorcycleType: string;\n DaytimeRunningLight: string;\n DestinationMarket: string;\n DisplacementCC: string;\n DisplacementCI: string;\n DisplacementL: string;\n Doors: string;\n DriveType: string;\n DriverAssist: string;\n DynamicBrakeSupport: string;\n EDR: string;\n ESC: string;\n EVDriveUnit: string;\n ElectrificationLevel: string;\n EngineConfiguration: string;\n EngineCycles: string;\n EngineCylinders: string;\n EngineHP: string;\n EngineHP_to: string;\n EngineKW: string;\n EngineManufacturer: string;\n EngineModel: string;\n EntertainmentSystem: string;\n ErrorCode: string;\n ErrorText: string;\n ForwardCollisionWarning: string;\n FuelInjectionType: string;\n FuelTypePrimary: string;\n FuelTypeSecondary: string;\n GCWR: string;\n GCWR_to: string;\n GVWR: string;\n GVWR_to: string;\n KeylessIgnition: string;\n LaneDepartureWarning: string;\n LaneKeepSystem: string;\n LowerBeamHeadlampLightSource: string;\n Make: string;\n Manufacturer: string;\n ManufacturerId: string;\n Model: string;\n ModelYear: string;\n MotorcycleChassisType: string;\n MotorcycleSuspensionType: string;\n NCSABodyType: string;\n NCSAMake: string;\n NCSAMapExcApprovedBy: string;\n NCSAMapExcApprovedOn: string;\n NCSAMappingException: string;\n NCSAModel: string;\n NCSANote: string;\n Note: string;\n OtherBusInfo: string;\n OtherEngineInfo: string;\n OtherMotorcycleInfo: string;\n OtherRestraintSystemInfo: string;\n OtherTrailerInfo: string;\n ParkAssist: string;\n PedestrianAutomaticEmergencyBraking: string;\n PlantCity: string;\n PlantCompanyName: string;\n PlantCountry: string;\n PlantState: string;\n PossibleValues: string;\n Pretensioner: string;\n RearCrossTrafficAlert: string;\n RearVisibilitySystem: string;\n SAEAutomationLevel: string;\n SAEAutomationLevel_to: string;\n SeatBeltsAll: string;\n SeatRows: string;\n Seats: string;\n SemiautomaticHeadlampBeamSwitching: string;\n Series: string;\n Series2: string;\n SteeringLocation: string;\n SuggestedVIN: string;\n TPMS: string;\n TopSpeedMPH: string;\n TrackWidth: string;\n TractionControl: string;\n TrailerBodyType: string;\n TrailerLength: string;\n TrailerType: string;\n TransmissionSpeeds: string;\n TransmissionStyle: string;\n Trim: string;\n Trim2: string;\n Turbo: string;\n VIN: string;\n ValveTrainDesign: string;\n VehicleType: string;\n WheelBaseLong: string;\n WheelBaseShort: string;\n WheelBaseType: string;\n WheelSizeFront: string;\n WheelSizeRear: string;\n Wheels: string;\n Windows: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVinValuesExtended API Action.\n *\n * @memberof module:api/actions/DecodeVinValuesExtended\n * @alias DecodeVinValuesExtendedResponse\n */\nexport type DecodeVinValuesExtendedResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /**\n * The search results returned by the NHSTA API request.\n * Flat file format, single object containing keys and values of type string\n * */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/DecodeWMI\n * @category Actions\n * @description DecodeWMI NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeWMI](module-api_actions_DecodeWMI.DecodeWMI.html)\n * >\n * > **Types**\n * > - Type: [DecodeWMIResponse](#DecodeWMIResponse)\n * > - Type: [DecodeWMIResults](#DecodeWMIResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeWMI extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides information on the World Manufacturer Identifier for a specific WMI code.\n * - `WMI` may be put in as either 3 characters representing VIN position 1-3 or 6 characters\n * representing VIN positions 1-3 & 12-14. Example \"JTD\", \"1T9131\".\n *\n * @async\n * @param {string} WMI - World Manufacturer Identifier.\n * @returns {(Promise)} Api Response object.\n */\n async DecodeWMI(WMI: string): Promise {\n const action = 'DecodeWMI';\n\n /* Runtime typechecking */\n const typeofWMI = getTypeof(WMI);\n if (typeofWMI !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"WMI\" argument is required and must be of type string, got: ` +\n `<${typeofWMI}> ${WMI}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${WMI}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeWMIResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeWMI\n * @alias DecodeWMIResults\n */\nexport type DecodeWMIResults = {\n CommonName: string;\n CreatedOn: string;\n DateAvailableToPublic: string;\n Make: string;\n ManufacturerName: string;\n ParentCompanyName: string;\n URL: string;\n UpdatedOn: string;\n VehicleType: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeWMI API Action.\n *\n * @memberof module:api/actions/DecodeWMI\n * @alias DecodeWMIResponse\n */\nexport type DecodeWMIResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetAllMakes\n * @category Actions\n * @description GetAllMakes NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetAllMakes](module-api_actions_GetAllMakes.GetAllMakes.html)\n * >\n * > **Types**\n * > - Type: [GetAllMakesResponse](#GetAllMakesResponse)\n * > - Type: [GetAllMakesResults](#GetAllMakesResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetAllMakes extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the Makes available in the vPIC Dataset.\n *\n * @async\n * @returns {(Promise)} Api Response object.\n */\n public async GetAllMakes(): Promise {\n const action = 'GetAllMakes';\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetAllMakesResponse}.Results' array.\n *\n * @memberof module:api/actions/GetAllMakes\n * @alias GetAllMakesResults\n */\nexport type GetAllMakesResults = {\n Make_ID: number;\n Make_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetAllMakes API Action.\n *\n * @memberof module:api/actions/GetAllMakes\n * @alias GetAllMakesResponse\n */\nexport type GetAllMakesResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetAllManufacturers\n * @category Actions\n * @description GetAllManufacturers NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetAllManufacturers](module-api_actions_GetAllManufacturers.GetAllManufacturers.html)\n * >\n * > **Types**\n * > - Type: [GetAllManufacturersResponse](#GetAllManufacturersResponse)\n * > - Type: [GetAllManufacturersResults](#GetAllManufacturersResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetAllManufacturers extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the Manufacturers available in vPIC Dataset.\n * - `params.manufacturerType` allows the user to filter the list based on manufacturer type,\n * ('Incomplete Vehicles', 'Completed Vehicle Manufacturer', 'Incomplete Vehicle Manufacturer',\n * 'Intermediate Manufacturer', 'Final-Stage Manufacturer', 'Alterer', or any partial match of those strings).\n * - You can get a list of all manufacturer types with the following API Action:\n * `GetVehicleVariableValuesList('manufacturer type')`\n * - Results are provided in pages of 100 items.\n * - Provide a number value for `params.page` to specify 1st (default), 2nd, 3rd, Nth, etc page.\n *\n * @async\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string} [params.manufacturerType] - See method description.\n * @param {number} [params.page] - Specify the page number (results returned 100 at a time).\n * @returns {(Promise)} Api Response object.\n */\n async GetAllManufacturers(\n params: {\n manufacturerType?: string;\n page?: number;\n } = {}\n ): Promise {\n const action = 'GetAllManufacturers';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofManufacturerType = getTypeof(params.manufacturerType);\n if (params.manufacturerType && typeofManufacturerType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.manufacturerType\" argument must be of type string, got: ` +\n `<${typeofManufacturerType}> ${params.manufacturerType}`\n )\n );\n }\n\n const typeofPage = getTypeof(params.page);\n if (params.page && typeofPage !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.page\" argument must be of type number, got: ` +\n `<${typeofPage}> ${params.page}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetAllManufacturersResponse}.Results' array.\n *\n * @memberof module:api/actions/GetAllManufacturers\n * @alias GetAllManufacturersResults\n */\nexport type GetAllManufacturersResults = {\n Country: string;\n Mfr_CommonName: string;\n Mfr_ID: number;\n Mfr_Name: string;\n VehicleTypes: Array<{ isPrimary?: boolean; name?: string }>;\n};\n\n/**\n * Type representing the complete response returned by the GetAllManufacturers API Action.\n *\n * @memberof module:api/actions/GetAllManufacturers\n * @alias GetAllManufacturersResponse\n */\nexport type GetAllManufacturersResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetCanadianVehicleSpecifications\n * @category Actions\n * @description GetCanadianVehicleSpecifications NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetCanadianVehicleSpecifications](module-api_actions_GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications.html)\n * >\n * > **Types**\n * > - Type: [GetCanadianVehicleSpecificationsResponse](#GetCanadianVehicleSpecificationsResponse)\n * > - Type: [GetCanadianVehicleSpecificationsResults](#GetCanadianVehicleSpecificationsResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetCanadianVehicleSpecifications extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * The Canadian Vehicle Specifications (CVS) consists of a database of original vehicle dimensions,\n * used primarily in collision investigation and reconstruction, combined with a search engine.\n *\n * The database is compiled annually by the Collision Investigation and Research Division of Transport Canada.\n * Visit official [Canadian Vehicle Specifications](http://www.carsp.ca/research/resources/safety-sources/canadian-vehicle-specifications/)\n * page for more details.\n *\n * This API action will return a 404 html error if any of the query parameters in params\n * are missing from the query string. This is the only API action with this behaviour. Therefore,\n * parameters are inserted into the query string as empty strings if not provided by the user.\n *\n * @async\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.year - Model year of the vehicle (required) - Number, >= 1971.\n * @param {string} [params.make] - Vehicle's make, like \"Honda\", \"Toyota\", etc...\n * @param {string} [params.model] - Vehicle's model, like \"Pilot\", \"Focus\". Can also include some other elements like Body Type, Engine Model/size, etc...\n * @param {string} [params.units] - \"Metric\" (default), or \"US\" for United States customary units.\n * @returns {(Promise)} Api Response object.\n */\n async GetCanadianVehicleSpecifications(params: {\n year: number;\n make?: string;\n model?: string;\n units?: string;\n }): Promise {\n const action = 'GetCanadianVehicleSpecifications';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofYear = getTypeof(params.year);\n if (typeofYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\n `<${typeofYear}> ${params.year}`\n )\n );\n }\n\n const typeofMake = getTypeof(params.make);\n if (params.make && typeofMake !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.make\" argument must be of type string, got: ` +\n `<${typeofMake}> ${params.make}`\n )\n );\n }\n\n const typeofModel = getTypeof(params.model);\n if (params.model && typeofModel !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.model\" argument must be of type string, got: ` +\n `<${typeofModel}> ${params.model}`\n )\n );\n }\n\n const typeofUnits = getTypeof(params.units);\n if (params.units && typeofUnits !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.units\" argument must be of type string, got: ` +\n `<${typeofUnits}> ${params.units}`\n )\n );\n }\n\n /* Set default query parameters to empty strings if not provided by the user */\n const make = params.make || '';\n const model = params.model || '';\n const units = params.units || '';\n\n const params_ = {\n year: params.year,\n make,\n model,\n units,\n };\n\n /*\n * Build the 'default' query string to be appended to the URL.\n *\n * Additionally, sets the allowEmptyStringValues option (2nd argument) to true because\n * this API action will return a 404 error if any of the query parameters are missing from the query string.\n * This is the only API action with this behaviour (\"year\" is the only param the user must provide).\n */\n const queryString = await this.buildQueryString(\n params_,\n true\n ).catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetCanadianVehicleSpecificationsResponse}.Results' array.\n *\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\n * @alias GetCanadianVehicleSpecificationsResults\n */\nexport type GetCanadianVehicleSpecificationsResults = {\n Specs: Array<{\n Name: string;\n Value: string;\n }>;\n};\n\n/**\n * Type representing the complete response returned by the GetCanadianVehicleSpecifications API Action.\n *\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\n * @alias GetCanadianVehicleSpecificationsResponse\n */\nexport type GetCanadianVehicleSpecificationsResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetEquipmentPlantCodes\n * @category Actions\n * @description GetEquipmentPlantCodes NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetEquipmentPlantCodes](module-api_actions_GetEquipmentPlantCodes.GetEquipmentPlantCodes.html)\n * >\n * > **Types**\n * > - Type: [GetEquipmentPlantCodesResponse](#GetEquipmentPlantCodesResponse)\n * > - Type: [GetEquipmentPlantCodesResults](#GetEquipmentPlantCodesResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetEquipmentPlantCodes extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * Returns assigned Equipment Plant Codes. Can be filtered by Year, Equipment Type and Report Type.\n *\n * `params.year`:\n * - Only years >= 2016 are supported\n *\n * `params.equipmentType`:\n * - 1 (Tires)\n * - 3 (Brake Hoses)\n * - 13 (Glazing)\n * - 16 (Retread)\n *\n * `params.reportType`:\n * - 'New' (The Equipment Plant Code was assigned during the selected year).\n * - 'Updated' (The Equipment Plant data was modified during the selected year).\n * - 'Closed' (The Equipment Plant is no longer Active).\n * - 'All' (All Equipment Plant Codes regardless of year, including their status (active or closed)).\n *\n * @async\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\n * @param {number} params.equipmentType - Number equal to 1, 3, 13, or 16.\n * @param {string} params.reportType - 'New', 'Updated', 'Closed', or 'All'.\n * @returns {(Promise)} Api Response object.\n */\n public async GetEquipmentPlantCodes(params: {\n year: number;\n equipmentType: 1 | 3 | 13 | 16;\n reportType: 'New' | 'Updated' | 'Closed' | 'All';\n }): Promise {\n const action = 'GetEquipmentPlantCodes';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofYear = getTypeof(params.year);\n if (typeofYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\n `<${typeofYear}> ${params.year}`\n )\n );\n }\n\n const typeofEquipmentType = getTypeof(params.equipmentType);\n if (typeofEquipmentType !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.equipmentType\" argument is required and must be of type number, got: ` +\n `<${typeofEquipmentType}> ${params.equipmentType}`\n )\n );\n }\n\n const typeofReportType = getTypeof(params.reportType);\n if (typeofReportType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.reportType\" argument is required and must be of type string, got: ` +\n `<${typeofReportType}> ${params.reportType}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetEquipmentPlantCodesResponse}.Results' array.\n *\n * @memberof module:api/actions/GetEquipmentPlantCodes\n * @alias GetEquipmentPlantCodesResults\n */\nexport type GetEquipmentPlantCodesResults = {\n Address: string;\n City: string;\n Country: string;\n DOTCode: string;\n Name: string;\n OldDotCode: string;\n PostalCode: string;\n StateProvince: string;\n Status: string;\n};\n\n/**\n * Type representing the complete response returned by the GetEquipmentPlantCodes API Action.\n *\n * @memberof module:api/actions/GetEquipmentPlantCodes\n * @alias GetEquipmentPlantCodesResponse\n */\nexport type GetEquipmentPlantCodesResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetMakeForManufacturer\n * @category Actions\n * @description GetMakeForManufacturer NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetMakeForManufacturer](module-api_actions_GetMakeForManufacturer.GetMakeForManufacturer.html)\n * >\n * > **Types**\n * > - Type: [GetMakeForManufacturerResponse](#GetMakeForManufacturerResponse)\n * > - Type: [GetMakeForManufacturerResults](#GetMakeForManufacturerResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetMakeForManufacturer extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Makes in the vPIC dataset for a specified manufacturer that is requested.\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\n * (it accepts a partial manufacturer name as an input).\n * - `manufacturer` name can be a partial name, or a full name for more specificity\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\n * - Multiple results are returned in case of multiple matches.\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\n * @returns {(Promise)} Api Response object.\n */\n async GetMakeForManufacturer(\n manufacturer: string | number\n ): Promise {\n const action = 'GetMakeForManufacturer';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetMakeForManufacturerResponse}.Results' array.\n *\n * @memberof module:api/actions/GetMakeForManufacturer\n * @alias GetMakeForManufacturerResults\n */\nexport type GetMakeForManufacturerResults = {\n Make_ID: number;\n Make_Name: string;\n Mfr_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetMakeForManufacturer API Action.\n *\n * @memberof module:api/actions/GetMakeForManufacturer\n * @alias GetMakeForManufacturerResponse\n */\nexport type GetMakeForManufacturerResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetMakesForManufacturerAndYear\n * @category Actions\n * @description GetMakesForManufacturerAndYear NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetMakesForManufacturerAndYear](module-api_actions_GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear.html)\n * >\n * > **Types**\n * > - Type: [GetMakesForManufacturerAndYearResponse](#GetMakesForManufacturerAndYearResponse)\n * > - Type: [GetMakesForManufacturerAndYearResults](#GetMakesForManufacturerAndYearResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetMakesForManufacturerAndYear extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Makes in the vPIC dataset for a specified manufacturer,\n * and whose Year From and Year To range cover the specified year.\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\n * (it accepts a partial manufacturer name as an input).\n * - Multiple results are returned in case of multiple matches.\n * - Manufacturer can be idenfitied by Id, a partial name, or a full name\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\n *\n * @returns {(Promise)} Api Response object.\n */\n public async GetMakesForManufacturerAndYear(\n manufacturer: string | number,\n params: {\n year: number;\n }\n ): Promise {\n const action = 'GetMakesForManufacturerAndYear';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument is required and must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofYear = getTypeof(params.year);\n if (typeofYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\n `<${typeofYear}> ${params.year}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetMakesForManufacturerAndYearResponse}.Results' array.\n *\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\n * @alias GetMakesForManufacturerAndYearResults\n */\nexport type GetMakesForManufacturerAndYearResults = {\n MakeId: number;\n MakeName: string;\n MfrId: number;\n MfrName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetMakesForManufacturerAndYear API Action.\n *\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\n * @alias GetMakesForManufacturerAndYearResponse\n */\nexport type GetMakesForManufacturerAndYearResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetMakesForVehicleType\n * @category Actions\n * @description GetMakesForVehicleType NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetMakesForVehicleType](module-api_actions_GetMakesForVehicleType.GetMakesForVehicleType.html)\n * >\n * > **Types**\n * > - Type: [GetMakesForVehicleTypeResponse](#GetMakesForVehicleTypeResponse)\n * > - Type: [GetMakesForVehicleTypeResults](#GetMakesForVehicleTypeResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetMakesForVehicleType extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Makes in the vPIC dataset for a specified vehicle type (`typeName`),\n * whose name is LIKE the vehicle type name in vPIC Dataset.\n * - Vehicle `typeName` can be a partial name, or a full name for more specificity\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\n *\n * @async\n * @param {string} typeName - A partial or full vehicle type name.\n * @returns {(Promise)} Api Response object.\n */\n async GetMakesForVehicleType(\n typeName: string\n ): Promise {\n const action = 'GetMakesForVehicleType';\n\n /* Runtime typechecking */\n const typeofTypeName = getTypeof(typeName);\n if (typeofTypeName !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"typeName\" argument is required and must be of type string, got: ` +\n `<${typeofTypeName}> ${typeName}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${typeName}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetMakesForVehicleTypeResponse}.Results' array.\n *\n * @memberof module:api/actions/GetMakesForVehicleType\n * @alias GetMakesForVehicleTypeResults\n */\nexport type GetMakesForVehicleTypeResults = {\n MakeId: number;\n MakeName: string;\n VehicleTypeId: number;\n VehicleTypeName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetMakesForVehicleType API Action.\n *\n * @memberof module:api/actions/GetMakesForVehicleType\n * @alias GetMakesForVehicleTypeResponse\n */\nexport type GetMakesForVehicleTypeResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetManufacturerDetails\n * @category Actions\n * @description GetManufacturerDetails NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetManufacturerDetails](module-api_actions_GetManufacturerDetails.GetManufacturerDetails.html)\n * >\n * > **Types**\n * > - Type: [GetManufacturerDetailsResponse](#GetManufacturerDetailsResponse)\n * > - Type: [GetManufacturerDetailsResults](#GetManufacturerDetailsResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetManufacturerDetails extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides the details for a specific manufacturer that is requested.\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name,\n * (it accepts a partial manufacturer name as an input).\n * - Multiple results are returned in case of multiple matches.\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\n * @returns {(Promise)} Api Response object.\n */\n public async GetManufacturerDetails(\n manufacturer: string | number\n ): Promise {\n const action = 'GetManufacturerDetails';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetManufacturerDetailsResponse}.Results' array.\n *\n * @memberof module:api/actions/GetManufacturerDetails\n * @alias GetManufacturerDetailsResults\n */\nexport type GetManufacturerDetailsResults = {\n Address: string;\n Address2: string;\n City: string;\n ContactEmail: string;\n ContactFax: string;\n ContactPhone: string;\n Country: string;\n DBAs: string;\n EquipmentItems: Array>;\n LastUpdated: string;\n ManufacturerTypes: Array<{\n Name: string;\n }>;\n Mfr_CommonName: string;\n Mfr_ID: number;\n Mfr_Name: string;\n OtherManufacturerDetails: string;\n PostalCode: string;\n PrimaryProduct: string;\n PrincipalFirstName: string;\n PrincipalLastName: string;\n PrincipalPosition: string;\n StateProvince: string;\n SubmittedName: string;\n SubmittedOn: string;\n SubmittedPosition: string;\n VehicleTypes: Array<{\n GVWRFrom: string;\n GVWRTo: string;\n IsPrimary: boolean;\n Name: string;\n }>;\n};\n\n/**\n * Type representing the complete response returned by the GetManufacturerDetails API Action.\n *\n * @memberof module:api/actions/GetManufacturerDetails\n * @alias GetManufacturerDetailsResponse\n */\nexport type GetManufacturerDetailsResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetModelsForMake\n * @category Actions\n * @description GetModelsForMake NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMake](module-api_actions_GetModelsForMake.GetModelsForMake.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeResponse](#GetModelsForMakeResponse)\n * > - Type: [GetModelsForMakeResults](#GetModelsForMakeResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMake extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified `makeName`\n * whose Name is LIKE the Make in vPIC Dataset.\n * - `makeName` can be a partial, or a full for more specificity\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\n *\n * @async\n * @param {string} makeName - Vehicle make name.\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMake(makeName: string): Promise {\n const action = 'GetModelsForMake';\n\n /* Runtime typechecking */\n const typeofMakeName = getTypeof(makeName);\n if (typeofMakeName !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\n `<${typeofMakeName}> ${makeName}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMake\n * @alias GetModelsForMakeResults\n */\nexport type GetModelsForMakeResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMake API Action.\n *\n * @memberof module:api/actions/GetModelsForMake\n * @alias GetModelsForMakeResponse\n */\nexport type GetModelsForMakeResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetModelsForMakeId\n * @category Actions\n * @description GetModelsForMakeId NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMakeId](module-api_actions_GetModelsForMakeId.GetModelsForMakeId.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeIdResponse](#GetModelsForMakeIdResponse)\n * > - Type: [GetModelsForMakeIdResults](#GetModelsForMakeIdResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMakeId extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified Make\n * whose Id is equal to the `makeId` in the vPIC Dataset.\n *\n * @async\n * @param {number} makeID - Vehicle make ID (number).\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMakeId(\n makeID: number\n ): Promise {\n const action = 'GetModelsForMakeId';\n\n /* Runtime typechecking */\n const typeofMakeId = getTypeof(makeID);\n if (typeofMakeId !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\n `<${typeofMakeId}> ${makeID}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString({}).catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMakeId\n * @alias GetModelsForMakeIdResults\n */\nexport type GetModelsForMakeIdResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMakeId API Action.\n *\n * @memberof module:api/actions/GetModelsForMakeId\n * @alias GetModelsForMakeIdResponse\n */\nexport type GetModelsForMakeIdResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetModelsForMakeIdYear\n * @category Actions\n * @description GetModelsForMakeIdYear NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMakeIdYear](module-api_actions_GetModelsForMakeIdYear.GetModelsForMakeIdYear.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeIdYearResponse](#GetModelsForMakeIdYearResponse)\n * > - Type: [GetModelsForMakeIdYearResults](#GetModelsForMakeIdYearResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMakeIdYear extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified Model Year\n * and Make whose name is LIKE the Make in the vPIC Dataset.\n * - `params.makeId` is a number and is a required query parameter.\n *\n * A minimum of one of the following are required (or a combination of both):\n * - `params.modelYear` is a number (greater than 1995)\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\n *\n * @async\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.makeId - Make ID to search.\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMakeIdYear(params: {\n makeId: number;\n modelYear?: number;\n vehicleType?: string;\n }): Promise {\n const action = 'GetModelsForMakeIdYear';\n\n const makeId: number = params?.makeId;\n const modelYear: number | undefined = params?.modelYear;\n const vehicleType: string | undefined = params?.vehicleType;\n\n /* Valid params object */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n /* Required makeId param of type number */\n const typeofMakeId = getTypeof(makeId);\n if (typeofMakeId !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.makeId\" argument is required and must be of type number, got: ` +\n `<${typeofMakeId}> ${makeId}`\n )\n );\n }\n /* At least one of modelYear or vehicleType params is required */\n if (!modelYear && !vehicleType) {\n return Promise.reject(\n new Error(\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\n `${modelYear} | ${vehicleType}`\n )\n );\n }\n /* valid modelYear param of type number */\n const typeofModelYear = getTypeof(modelYear);\n if (modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" must be of type number, got: ` +\n `<${typeofModelYear}> ${modelYear}`\n )\n );\n }\n /* valid vehicleType param of type string */\n const typeofVehicleType = getTypeof(vehicleType);\n if (vehicleType && typeofVehicleType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\n `<${typeofVehicleType}> ${vehicleType}`\n )\n );\n }\n\n /* Beginning of the the actionUrl */\n let actionUrl = `${action}/makeId/${makeId}/`;\n\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\n if (modelYear && vehicleType) {\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\n } else if (modelYear) {\n actionUrl += `modelYear/${modelYear}`;\n } else {\n actionUrl += `vehicleType/${vehicleType}`;\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdYearResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMakeIdYear\n * @alias GetModelsForMakeIdYearResults\n */\nexport type GetModelsForMakeIdYearResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMakeIdYear API Action.\n *\n * @memberof module:api/actions/GetModelsForMakeIdYear\n * @alias GetModelsForMakeIdYearResponse\n */\nexport type GetModelsForMakeIdYearResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetModelsForMakeYear\n * @category Actions\n * @description GetModelsForMakeYear NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMakeYear](module-api_actions_GetModelsForMakeYear.GetModelsForMakeYear.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeYearResponse](#GetModelsForMakeYearResponse)\n * > - Type: [GetModelsForMakeYearResults](#GetModelsForMakeYearResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMakeYear extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified Model Year\n * and Make whose name is LIKE the Make in the vPIC Dataset.\n * - `params.make` is required. It can be a partial, or a full name for more specificity\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\n *\n * A minimum of one of the following are required (or a combination of both):\n * - `params.modelYear` is a number (greater than 1995)\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\n *\n * @async\n *\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {string} params.make - Make name to search.\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\n *\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMakeYear(params: {\n make: string;\n modelYear?: number;\n vehicleType?: string;\n }): Promise {\n const action = 'GetModelsForMakeYear';\n\n const make: string = params?.make;\n const modelYear: number | undefined = params?.modelYear;\n const vehicleType: string | undefined = params?.vehicleType;\n\n /* Valid params object */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n /* Required make param of type string */\n const typeofMake = getTypeof(make);\n if (typeofMake !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.make\" argument is required and must be of type string, got: ` +\n `<${typeofMake}> ${make}`\n )\n );\n }\n /* At least one of modelYear or vehicleType params is required */\n if (!modelYear && !vehicleType) {\n return Promise.reject(\n new Error(\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\n `${modelYear} | ${vehicleType}`\n )\n );\n }\n /* valid modelYear param of type number */\n const typeofModelYear = getTypeof(modelYear);\n if (modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" must be of type number, got: ` +\n `<${typeofModelYear}> ${modelYear}`\n )\n );\n }\n /* valid vehicleType param of type string */\n const typeofVehicleType = getTypeof(vehicleType);\n if (vehicleType && typeofVehicleType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\n `<${typeofVehicleType}> ${vehicleType}`\n )\n );\n }\n\n /* Beginning of the the actionUrl */\n let actionUrl = `${action}/make/${params.make}/`;\n\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\n if (modelYear && vehicleType) {\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\n } else if (modelYear) {\n actionUrl += `modelYear/${modelYear}`;\n } else {\n actionUrl += `vehicleType/${vehicleType}`;\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeYearResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMakeYear\n * @alias GetModelsForMakeYearResults\n */\nexport type GetModelsForMakeYearResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMakeYear API Action.\n *\n * @memberof module:api/actions/GetModelsForMakeYear\n * @alias GetModelsForMakeYearResponse\n */\nexport type GetModelsForMakeYearResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetParts\n * @category Actions\n * @description GetParts NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetParts](module-api_actions_GetParts.GetParts.html)\n * >\n * > **Types**\n * > - Type: [GetPartsResponse](#GetPartsResponse)\n * > - Type: [GetPartsResults](#GetPartsResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetParts extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of ORGs with letter date in the given range of the dates\n * and with specified Type (`params.type`) of ORG.\n * - Up to 1000 results will be returned at a time.\n * - Get the next page by incrementing the `params.page` query parameter.\n * - All query `params` are optional.\n *\n * @async\n * @param {object} [params] - Query Search Parameters to append to the URL.\n * @param {number} [params.type] - Specified type of ORG to search.\n * @param {string} [params.fromDate] - Start date of search query.\n * @param {string} [params.toDate] - End date of search query.\n * @param {number} [params.page] - Which page number of results to request (100 results per page).\n * @returns {(Promise)} Api Response object.\n */\n async GetParts(params?: {\n type?: number;\n fromDate?: string;\n toDate?: string;\n page?: number;\n }): Promise {\n const action = 'GetParts';\n\n const type: number | undefined = params?.type;\n const fromDate: string | undefined = params?.fromDate;\n const toDate: string | undefined = params?.toDate;\n const page: number | undefined = params?.page;\n\n /* Valid params object */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: <${typeofParams}> ${params}`\n )\n );\n }\n\n /* valid params.type of type number */\n const typeofType = getTypeof(type);\n if (type && typeofType !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.type\" argument must be of type number, got: <${typeofType}> ${type}`\n )\n );\n }\n\n /* valid params.fromDate of type string */\n const typeofFromDate = getTypeof(fromDate);\n if (fromDate && typeofFromDate !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.fromDate\" argument must be of type string, got: <${typeofFromDate}> ${fromDate}`\n )\n );\n }\n\n /* valid params.toDate of type number */\n const typeofToDate = getTypeof(toDate);\n if (toDate && typeofToDate !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.toDate\" argument must be of type string, got: <${typeofToDate}> ${toDate}`\n )\n );\n }\n\n /* valid params.page of type number */\n const typeofPage = getTypeof(page);\n if (page && typeofPage !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.page\" argument must be of type number, got: <${typeofPage}> ${page}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetPartsResponse}.Results' array.\n *\n * @memberof module:api/actions/GetParts\n * @alias GetPartsResults\n */\nexport type GetPartsResults = {\n CoverLetterURL: string;\n LetterDate: string;\n ManufacturerId: number;\n ManufacturerName: string;\n ModelYearFrom: string;\n ModelYearTo: string;\n Name: string;\n Type: string;\n URL: string;\n};\n\n/**\n * Type representing the complete response returned by the GetParts API Action.\n *\n * @memberof module:api/actions/GetParts\n * @alias GetPartsResponse\n */\nexport type GetPartsResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetVehicleTypesForMake\n * @category Actions\n * @description GetVehicleTypesForMake NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleTypesForMake](module-api_actions_GetVehicleTypesForMake.GetVehicleTypesForMake.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleTypesForMakeResponse](#GetVehicleTypesForMakeResponse)\n * > - Type: [GetVehicleTypesForMakeResults](#GetVehicleTypesForMakeResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleTypesForMake extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make,\n * whose name is LIKE the make name in the vPIC Dataset.\n * - `makeName` can be a partial name, or a full name for more specificity\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\n *\n * @async\n * @param {string} makeName - Name of the vehicle make to search.\n * @returns {(Promise)} Api Response object.\n */\n async GetVehicleTypesForMake(\n makeName: string\n ): Promise {\n const action = 'GetVehicleTypesForMake';\n\n /* Runtime typechecking */\n const typeofMakeName = getTypeof(makeName);\n if (typeofMakeName !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\n `<${typeofMakeName}> ${makeName}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleTypesForMake\n * @alias GetVehicleTypesForMakeResults\n */\nexport type GetVehicleTypesForMakeResults = {\n MakeId: number;\n MakeName: string;\n VehicleTypeId: number;\n VehicleTypeName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleTypesForMake API Action.\n *\n * @memberof module:api/actions/GetVehicleTypesForMake\n * @alias GetVehicleTypesForMakeResponse\n */\nexport type GetVehicleTypesForMakeResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetVehicleTypesForMakeId\n * @category Actions\n * @description GetVehicleTypesForMakeId NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleTypesForMakeId](module-api_actions_GetVehicleTypesForMakeId.GetVehicleTypesForMakeId.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleTypesForMakeIdResponse](#GetVehicleTypesForMakeIdResponse)\n * > - Type: [GetVehicleTypesForMakeIdResults](#GetVehicleTypesForMakeIdResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleTypesForMakeId extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make and\n * whose ID equals the make ID in the vPIC Dataset.\n *\n * @async\n * @param {number} makeID - Vehicle make ID.\n * @returns {(Promise)} Api Response object.\n */\n async GetVehicleTypesForMakeId(\n makeID: number\n ): Promise {\n const action = 'GetVehicleTypesForMakeId';\n\n /* Runtime typechecking */\n const typeofMakeId = getTypeof(makeID);\n if (typeofMakeId !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\n `<${typeofMakeId}> ${makeID}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeIdResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleTypesForMakeId\n * @alias GetVehicleTypesForMakeIdResults\n */\nexport type GetVehicleTypesForMakeIdResults = {\n MakeId: number;\n MakeName: string;\n VehicleTypeId: number;\n VehicleTypeName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleTypesForMakeId API Action.\n *\n * @memberof module:api/actions/GetVehicleTypesForMakeId\n * @alias GetVehicleTypesForMakeIdResponse\n */\nexport type GetVehicleTypesForMakeIdResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetVehicleVariableList\n * @category Actions\n * @description GetVehicleVariableList NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleVariableList](module-api_actions_GetVehicleVariableList.GetVehicleVariableList.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleVariableListResponse](#GetVehicleVariableListResponse)\n * > - Type: [GetVehicleVariableListResults](#GetVehicleVariableListResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleVariableList extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the Vehicle related variables that are in the vPIC dataset.\n * - Information on the name, description and the type of the variable is provided.\n *\n * @async\n * @returns {(Promise)} Api Response object.\n */\n public async GetVehicleVariableList(): Promise {\n const action = 'GetVehicleVariableList';\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleVariableListResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleVariableList\n * @alias GetVehicleVariableListResults\n */\nexport type GetVehicleVariableListResults = {\n DataType: string;\n Description: string;\n ID: number;\n Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleVariableList API Action.\n *\n * @memberof module:api/actions/GetVehicleVariableList\n * @alias GetVehicleVariableListResponse\n */\nexport type GetVehicleVariableListResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetVehicleVariableValuesList\n * @category Actions\n * @description GetVehicleVariableValuesList NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleVariableValuesList](module-api_actions_GetVehicleVariableValuesList.GetVehicleVariableValuesList.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleVariableValuesListResponse](#GetVehicleVariableValuesListResponse)\n * > - Type: [GetVehicleVariableValuesListResults](#GetVehicleVariableValuesListResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleVariableValuesList extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the accepted values for a given variable that are stored in the vPIC dataset.\n *\n * This applies to only \"Look up\" type of variables.\n * - `variableValue` can either be a:\n * - Variable Name (\"battery type\" in first example, please use full name, not just part of it),\n * - or Variable ID (number).\n *\n * @async\n * @param {string|number} variableValue - The variable you want to get a values list of.\n * @returns {(Promise)} Api Response object.\n */\n async GetVehicleVariableValuesList(\n variableValue: string | number\n ): Promise {\n const action = 'GetVehicleVariableValuesList';\n\n /* Runtime typechecking */\n const typeofVariableValue = getTypeof(variableValue);\n if (typeofVariableValue !== 'string' && typeofVariableValue !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"variableValue\" argument is required and must be of type string or number, got: ` +\n `<${typeofVariableValue}> ${variableValue}`\n )\n );\n }\n /* Encode to a valid URI string (space chars, etc.) if variableValue is a string*/\n if (typeofVariableValue === 'string') {\n variableValue = encodeURI(variableValue as string);\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${variableValue}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleVariableValuesListResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleVariableValuesList\n * @alias GetVehicleVariableValuesListResults\n */\nexport type GetVehicleVariableValuesListResults = {\n ElementName: string;\n Id: number;\n Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleVariableValuesList API Action.\n *\n * @memberof module:api/actions/GetVehicleVariableValuesList\n * @alias GetVehicleVariableValuesListResponse\n */\nexport type GetVehicleVariableValuesListResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/actions/GetWMIsForManufacturer\n * @category Actions\n * @description GetWMIsForManufacturer NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetWMIsForManufacturer](module-api_actions_GetWMIsForManufacturer.GetWMIsForManufacturer.html)\n * >\n * > **Types**\n * > - Type: [GetWMIsForManufacturerResponse](#GetWMIsForManufacturerResponse)\n * > - Type: [GetWMIsForManufacturerResults](#GetWMIsForManufacturerResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetWMIsForManufacturer extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * Provides information on the World Manufacturer Identifier (WMI) for a specified `manufacturer`.\n * - Only WMIs registered in vPICList are displayed.\n * - `manufacturer` can be a partial name, or a full name for more specificity\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name.\n * @returns {(Promise)} Api Response object.\n */\n async GetWMIsForManufacturer(\n manufacturer: string\n ): Promise {\n const action = 'GetWMIsForManufacturer';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetWMIsForManufacturerResponse}.Results' array.\n *\n * @memberof module:api/actions/GetWMIsForManufacturer\n * @alias GetWMIsForManufacturerResults\n */\nexport type GetWMIsForManufacturerResults = {\n Country: string;\n CreatedOn: string;\n DateAvailableToPublic: string;\n Id: number;\n Name: string;\n UpdatedOn: string;\n VehicleType: string;\n WMI: string;\n};\n\n/**\n * Type representing the complete response returned by the GetWMIsForManufacturer API Action.\n *\n * @memberof module:api/actions/GetWMIsForManufacturer\n * @alias GetWMIsForManufacturerResponse\n */\nexport type GetWMIsForManufacturerResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n","/**\n * @module api/NHTSA\n * @category API\n * @description Module exporting the main (NHSTA) class for API Actions.\n *\n * > **Module Exports**:\n * > - Class: [NHTSA](NHTSA.html#NHTSA) - Class that implements all NHTSA API Actions\n */\n\nimport { Fetch /* Class */, FetchConfig /* Type */ } from './Fetch';\n\n/* Import implemented API Action classes */\nimport {\n DecodeVin,\n DecodeVinExtended,\n DecodeVinValues,\n DecodeVINValuesBatch,\n DecodeVinValuesExtended,\n DecodeWMI,\n GetAllMakes,\n GetAllManufacturers,\n GetCanadianVehicleSpecifications,\n GetEquipmentPlantCodes,\n GetMakeForManufacturer,\n GetMakesForManufacturerAndYear,\n GetMakesForVehicleType,\n GetManufacturerDetails,\n GetModelsForMake,\n GetModelsForMakeId,\n GetModelsForMakeIdYear,\n GetModelsForMakeYear,\n GetParts,\n GetVehicleTypesForMake,\n GetVehicleTypesForMakeId,\n GetVehicleVariableList,\n GetVehicleVariableValuesList,\n GetWMIsForManufacturer,\n} from './actions';\n\n/**\n * @class NHTSA\n * @augments module:api/Fetch.Fetch\n * @category API\n *\n * @param {FetchConfig} [userConfig] - Configuration options to construct the class with.\n *\n * @implements {module:api/actions/DecodeVin.DecodeVin}\n * @implements {module:api/actions/DecodeVinExtended.DecodeVinExtended}\n * @implements {module:api/actions/DecodeVinValues.DecodeVinValues}\n * @implements {module:api/actions/DecodeVinValuesExtended.DecodeVinValuesExtended}\n * @implements {module:api/actions/DecodeWMI.DecodeWMI}\n * @implements {module:api/actions/GetAllMakes.GetAllMakes}\n * @implements {module:api/actions/GetAllManufacturers.GetAllManufacturers}\n * @implements {module:api/actions/GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications}\n * @implements {module:api/actions/GetEquipmentPlantCodes.GetEquipmentPlantCodes}\n * @implements {module:api/actions/GetMakeForManufacturer.GetMakeForManufacturer}\n * @implements {module:api/actions/GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear}\n * @implements {module:api/actions/GetMakesForVehicleType.GetMakesForVehicleType}\n * @implements {module:api/actions/GetManufacturerDetails.GetManufacturerDetails}\n * @implements {module:api/actions/GetModelsForMake.GetModelsForMake}\n * @implements {module:api/actions/GetModelsForMakeId.GetModelsForMakeId}\n * @implements {module:api/actions/GetModelsForMakeIdYear.GetModelsForMakeIdYear}\n * @implements {module:api/actions/GetModelsForMakeYear.GetModelsForMakeYear}\n * @implements {module:api/actions/GetParts.GetParts}\n * @implements {module:api/actions/GetVehicleTypesForMake.GetVehicleTypesForMake}\n * @implements {module:api/actions/GetVehicleTypesForMakeId.GetVehicleTypesForMakeId}\n * @implements {module:api/actions/GetVehicleVariableList.GetVehicleVariableList}\n * @implements {module:api/actions/GetVehicleVariableValuesList.GetVehicleVariableValuesList}\n * @implements {module:api/actions/GetWMIsForManufacturer.GetWMIsForManufacturer}\n *\n * @example Node bundle\n * const { NHTSA } = require('@shaggytools/nhtsa-api-wrapper');\n *\n * const Wrapper = new NHTSA();\n *\n * // Decode a VIN and return a response of type ApiResponse\n * const response = Wrapper.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\n *\n * // or get details about a specific manufacturer, plus 23 other available Actions.\n * const hondaDetails = Wrapper.GetManufacturerDetails('Honda').catch(error => error)\n *\n * @example Browser bundle\n * // Change to specific version number \"x.x.xx\",\n * // or remove completely for the most recently published version\n * /dist/bundle.min.js\"\n * >\n *\n * \n *\n * @example Module - Node lazy loading\n * const { NHTSA } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\n * .catch(err => err);\n *\n * const ApiClient = new NHTSA();\n *\n * const results = await ApiClient.DecodeVin('3VWD07AJ5EM388202')\n * .catch(err => err)\n *\n * @example Module - Browser lazy loading\n * \n */\nclass NHTSA\n extends Fetch\n implements\n DecodeVin,\n DecodeVinExtended,\n DecodeVinValues,\n DecodeVINValuesBatch,\n DecodeVinValuesExtended,\n DecodeWMI,\n GetAllMakes,\n GetAllManufacturers,\n GetCanadianVehicleSpecifications,\n GetEquipmentPlantCodes,\n GetMakeForManufacturer,\n GetMakesForManufacturerAndYear,\n GetMakesForVehicleType,\n GetManufacturerDetails,\n GetModelsForMake,\n GetModelsForMakeId,\n GetModelsForMakeIdYear,\n GetModelsForMakeYear,\n GetParts,\n GetVehicleTypesForMake,\n GetVehicleTypesForMakeId,\n GetVehicleVariableList,\n GetVehicleVariableValuesList,\n GetWMIsForManufacturer {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n DecodeVin = DecodeVin.prototype.DecodeVin;\n\n DecodeVinExtended = DecodeVinExtended.prototype.DecodeVinExtended;\n\n DecodeVinValues = DecodeVinValues.prototype.DecodeVinValues;\n\n DecodeVINValuesBatch = DecodeVINValuesBatch.prototype.DecodeVINValuesBatch;\n\n DecodeVinValuesExtended =\n DecodeVinValuesExtended.prototype.DecodeVinValuesExtended;\n\n DecodeWMI = DecodeWMI.prototype.DecodeWMI;\n\n GetAllMakes = GetAllMakes.prototype.GetAllMakes;\n\n GetAllManufacturers = GetAllManufacturers.prototype.GetAllManufacturers;\n\n GetCanadianVehicleSpecifications =\n GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications;\n\n GetEquipmentPlantCodes =\n GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes;\n\n GetMakeForManufacturer =\n GetMakeForManufacturer.prototype.GetMakeForManufacturer;\n\n GetMakesForManufacturerAndYear =\n GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear;\n\n GetMakesForVehicleType =\n GetMakesForVehicleType.prototype.GetMakesForVehicleType;\n\n GetManufacturerDetails =\n GetManufacturerDetails.prototype.GetManufacturerDetails;\n\n GetModelsForMake = GetModelsForMake.prototype.GetModelsForMake;\n\n GetModelsForMakeId = GetModelsForMakeId.prototype.GetModelsForMakeId;\n\n GetModelsForMakeIdYear =\n GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear;\n\n GetModelsForMakeYear = GetModelsForMakeYear.prototype.GetModelsForMakeYear;\n\n GetParts = GetParts.prototype.GetParts;\n\n GetVehicleTypesForMake =\n GetVehicleTypesForMake.prototype.GetVehicleTypesForMake;\n\n GetVehicleTypesForMakeId =\n GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId;\n\n GetVehicleVariableList =\n GetVehicleVariableList.prototype.GetVehicleVariableList;\n\n GetVehicleVariableValuesList =\n GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList;\n\n GetWMIsForManufacturer =\n GetWMIsForManufacturer.prototype.GetWMIsForManufacturer;\n}\n\nexport { NHTSA };\n","/**\n * @module api/Client\n * @category API\n * @description Module exporting an instance of the NHSTA class.\n *\n * > - For more information, see the documentation for the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n */\n\nimport { NHTSA } from './NHTSA';\n\n/**\n * A new instance of the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n *\n * @type {NHTSA}\n *\n * @example Node bundle\n * const { Client } = require('@shaggytools/nhtsa-api-wrapper');\n *\n * // Decode a VIN and return get a response of type ApiResponse\n * const response = Client.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\n *\n * // or get details about a specific manufacturer, plus 23 other available Actions.\n * const audiDetails = Client.GetManufacturerDetails('Audi').catch(error => error)\n *\n * @example Browser bundle\n * // Change to specific version number \"x.x.xx\",\n * // or remove completely for the most recently published version\n * /dist/bundle.min.js\"\n * >\n *\n * \n *\n * @example Module - Node lazy loading\n * const { Client } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\n * .catch(err => err);\n *\n * const results = await Client.DecodeVin('3VWD07AJ5EM388202')\n * .catch(err => err)\n *\n * @example Module - Browser lazy loading\n * \n *\n */\nconst Client: NHTSA = new NHTSA();\n\nexport { Client };\n"],"names":["getTypeof","value","toString","Object","prototype","call","toLowerCase","slice","length","TRANSLITERATION_TABLE","A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z","WEIGHTS_ARRAY","DEFAULT_CONFIG","apiResponseFormat","baseUrl","options","Fetch","[object Object]","userConfig","finalConfig","this","params","allowEmptyStringValues","format","Promise","reject","Error","entries","paramsLength","resolve","isPrepended","queryStringArray","map","key","index","prepend","append","typeofValue","encodeURI","join","makeQueryString","url","typeofUrl","typeofOptions","combinedOptions","response","fetch","then","result","status","statusText","headers","catch","err","NhtsaResponse","json","finalResult","FetchResponse","ok","redirected","DecodeVin","super","vin","action","typeofParams","typeofVin","typeofModelYear","modelYear","queryString","buildQueryString","get","DecodeVinExtended","DecodeVinValues","DecodeVINValuesBatch","inputString","typeofInputString","body","method","content-type","DecodeVinValuesExtended","DecodeWMI","WMI","typeofWMI","GetAllMakes","GetAllManufacturers","typeofManufacturerType","manufacturerType","typeofPage","page","GetCanadianVehicleSpecifications","typeofYear","year","typeofMake","make","typeofModel","model","typeofUnits","units","params_","GetEquipmentPlantCodes","typeofEquipmentType","equipmentType","typeofReportType","reportType","GetMakeForManufacturer","manufacturer","typeofManufacturer","GetMakesForManufacturerAndYear","GetMakesForVehicleType","typeName","typeofTypeName","GetManufacturerDetails","GetModelsForMake","makeName","typeofMakeName","GetModelsForMakeId","makeID","typeofMakeId","GetModelsForMakeIdYear","makeId","vehicleType","typeofVehicleType","actionUrl","GetModelsForMakeYear","GetParts","type","fromDate","toDate","typeofType","typeofFromDate","typeofToDate","GetVehicleTypesForMake","GetVehicleTypesForMakeId","GetVehicleVariableList","GetVehicleVariableValuesList","variableValue","typeofVariableValue","GetWMIsForManufacturer","NHTSA","Client","vinArray","toUpperCase","split","checkDigit","isNaN","parseInt","checkValue","digit","digitValue","reduce","acc","currValue"],"mappings":"+rBAagBA,EAAUC,GACxB,MAAMC,EAAmBC,OAAOC,UAAUF,SACvCG,KAAKJ,GACLK,cACH,OAAOJ,EAASK,MAAM,EAAGL,EAAS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EAGCA,EADLJ,MAAMC,SAASE,IACGhK,EAAsBgK,GACtBF,SAASE,GAM3B,OAAOC,EAHgBzI,EAAcuB,KAMtCmH,OAAO,CAACC,EAAKC,IAAcD,EAAMC,EAAW,GAAK,KAOlCL"} \ No newline at end of file diff --git a/dist/cjs/Client.js b/dist/cjs/Client.js index d798fe3ac..c2bbf9896 100644 --- a/dist/cjs/Client.js +++ b/dist/cjs/Client.js @@ -2,127 +2,33 @@ Object.defineProperty(exports, '__esModule', { value: true }); -var Fetch = require('./Fetch-d7540537.js'); +var NHTSA = require('./NHTSA.js'); +require('./Fetch-d7540537.js'); require('cross-fetch'); -var GetWMIsForManufacturer = require('./GetWMIsForManufacturer-90384d3e.js'); - -/** - * @module api/NHTSA - * @category API - * @description Module exporting the main (NHSTA) class for API Actions. - * - * > **Module Exports**: - * > - Class: [NHTSA](NHTSA.html#NHTSA) - Class that implements all NHTSA API Actions - */ -/** - * @class NHTSA - * @augments module:api/Fetch.Fetch - * @category API - * - * @param {FetchConfig} [userConfig] - Configuration options to construct the class with. - * - * @implements {module:api/actions/DecodeVin.DecodeVin} - * @implements {module:api/actions/DecodeVinExtended.DecodeVinExtended} - * @implements {module:api/actions/DecodeVinValues.DecodeVinValues} - * @implements {module:api/actions/DecodeVinValuesExtended.DecodeVinValuesExtended} - * @implements {module:api/actions/DecodeWMI.DecodeWMI} - * @implements {module:api/actions/GetAllMakes.GetAllMakes} - * @implements {module:api/actions/GetAllManufacturers.GetAllManufacturers} - * @implements {module:api/actions/GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications} - * @implements {module:api/actions/GetEquipmentPlantCodes.GetEquipmentPlantCodes} - * @implements {module:api/actions/GetMakeForManufacturer.GetMakeForManufacturer} - * @implements {module:api/actions/GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear} - * @implements {module:api/actions/GetMakesForVehicleType.GetMakesForVehicleType} - * @implements {module:api/actions/GetManufacturerDetails.GetManufacturerDetails} - * @implements {module:api/actions/GetModelsForMake.GetModelsForMake} - * @implements {module:api/actions/GetModelsForMakeId.GetModelsForMakeId} - * @implements {module:api/actions/GetModelsForMakeIdYear.GetModelsForMakeIdYear} - * @implements {module:api/actions/GetModelsForMakeYear.GetModelsForMakeYear} - * @implements {module:api/actions/GetParts.GetParts} - * @implements {module:api/actions/GetVehicleTypesForMake.GetVehicleTypesForMake} - * @implements {module:api/actions/GetVehicleTypesForMakeId.GetVehicleTypesForMakeId} - * @implements {module:api/actions/GetVehicleVariableList.GetVehicleVariableList} - * @implements {module:api/actions/GetVehicleVariableValuesList.GetVehicleVariableValuesList} - * @implements {module:api/actions/GetWMIsForManufacturer.GetWMIsForManufacturer} - * - * @example Node bundle - * const { NHTSA } = require('@shaggytools/nhtsa-api-wrapper'); - * - * const Wrapper = new NHTSA(); - * - * // Decode a VIN and return a response of type ApiResponse - * const response = Wrapper.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error) - * - * // or get details about a specific manufacturer, plus 23 other available Actions. - * const hondaDetails = Wrapper.GetManufacturerDetails('Honda').catch(error => error) - * - * @example Browser bundle - * // Change to specific version number "x.x.xx", - * // or remove completely for the most recently published version - * - * - * - * - * @example Module - Node lazy loading - * const { NHTSA } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js') - * .catch(err => err); - * - * const ApiClient = new NHTSA(); - * - * const results = await ApiClient.DecodeVin('3VWD07AJ5EM388202') - * .catch(err => err) - * - * @example Module - Browser lazy loading - * - */ -class NHTSA extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - this.DecodeVin = GetWMIsForManufacturer.DecodeVin.prototype.DecodeVin; - this.DecodeVinExtended = GetWMIsForManufacturer.DecodeVinExtended.prototype.DecodeVinExtended; - this.DecodeVinValues = GetWMIsForManufacturer.DecodeVinValues.prototype.DecodeVinValues; - this.DecodeVINValuesBatch = GetWMIsForManufacturer.DecodeVINValuesBatch.prototype.DecodeVINValuesBatch; - this.DecodeVinValuesExtended = GetWMIsForManufacturer.DecodeVinValuesExtended.prototype.DecodeVinValuesExtended; - this.DecodeWMI = GetWMIsForManufacturer.DecodeWMI.prototype.DecodeWMI; - this.GetAllMakes = GetWMIsForManufacturer.GetAllMakes.prototype.GetAllMakes; - this.GetAllManufacturers = GetWMIsForManufacturer.GetAllManufacturers.prototype.GetAllManufacturers; - this.GetCanadianVehicleSpecifications = GetWMIsForManufacturer.GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications; - this.GetEquipmentPlantCodes = GetWMIsForManufacturer.GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes; - this.GetMakeForManufacturer = GetWMIsForManufacturer.GetMakeForManufacturer.prototype.GetMakeForManufacturer; - this.GetMakesForManufacturerAndYear = GetWMIsForManufacturer.GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear; - this.GetMakesForVehicleType = GetWMIsForManufacturer.GetMakesForVehicleType.prototype.GetMakesForVehicleType; - this.GetManufacturerDetails = GetWMIsForManufacturer.GetManufacturerDetails.prototype.GetManufacturerDetails; - this.GetModelsForMake = GetWMIsForManufacturer.GetModelsForMake.prototype.GetModelsForMake; - this.GetModelsForMakeId = GetWMIsForManufacturer.GetModelsForMakeId.prototype.GetModelsForMakeId; - this.GetModelsForMakeIdYear = GetWMIsForManufacturer.GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear; - this.GetModelsForMakeYear = GetWMIsForManufacturer.GetModelsForMakeYear.prototype.GetModelsForMakeYear; - this.GetParts = GetWMIsForManufacturer.GetParts.prototype.GetParts; - this.GetVehicleTypesForMake = GetWMIsForManufacturer.GetVehicleTypesForMake.prototype.GetVehicleTypesForMake; - this.GetVehicleTypesForMakeId = GetWMIsForManufacturer.GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId; - this.GetVehicleVariableList = GetWMIsForManufacturer.GetVehicleVariableList.prototype.GetVehicleVariableList; - this.GetVehicleVariableValuesList = GetWMIsForManufacturer.GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList; - this.GetWMIsForManufacturer = GetWMIsForManufacturer.GetWMIsForManufacturer.prototype.GetWMIsForManufacturer; - } -} +require('./DecodeVin.js'); +require('./DecodeVinExtended.js'); +require('./DecodeVinValues.js'); +require('./DecodeVINValuesBatch.js'); +require('./DecodeVinValuesExtended.js'); +require('./DecodeWMI.js'); +require('./GetAllMakes.js'); +require('./GetAllManufacturers.js'); +require('./GetCanadianVehicleSpecifications.js'); +require('./GetEquipmentPlantCodes.js'); +require('./GetMakeForManufacturer.js'); +require('./GetMakesForManufacturerAndYear.js'); +require('./GetMakesForVehicleType.js'); +require('./GetManufacturerDetails.js'); +require('./GetModelsForMake.js'); +require('./GetModelsForMakeId.js'); +require('./GetModelsForMakeIdYear.js'); +require('./GetModelsForMakeYear.js'); +require('./GetParts.js'); +require('./GetVehicleTypesForMake.js'); +require('./GetVehicleTypesForMakeId.js'); +require('./GetVehicleVariableList.js'); +require('./GetVehicleVariableValuesList.js'); +require('./GetWMIsForManufacturer.js'); /** * @module api/Client @@ -178,7 +84,7 @@ class NHTSA extends Fetch.Fetch { * * */ -const Client = new NHTSA(); +const Client = new NHTSA.NHTSA(); exports.Client = Client; //# sourceMappingURL=Client.js.map diff --git a/dist/cjs/Client.js.map b/dist/cjs/Client.js.map index 844c7966f..a2030ce30 100644 --- a/dist/cjs/Client.js.map +++ b/dist/cjs/Client.js.map @@ -1 +1 @@ -{"version":3,"file":"Client.js","sources":["../../src/api/NHTSA.ts","../../src/api/Client.ts"],"sourcesContent":["/**\r\n * @module api/NHTSA\r\n * @category API\r\n * @description Module exporting the main (NHSTA) class for API Actions.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [NHTSA](NHTSA.html#NHTSA) - Class that implements all NHTSA API Actions\r\n */\r\n\r\nimport { Fetch /* Class */, FetchConfig /* Type */ } from './Fetch';\r\n\r\n/* Import implemented API Action classes */\r\nimport {\r\n DecodeVin,\r\n DecodeVinExtended,\r\n DecodeVinValues,\r\n DecodeVINValuesBatch,\r\n DecodeVinValuesExtended,\r\n DecodeWMI,\r\n GetAllMakes,\r\n GetAllManufacturers,\r\n GetCanadianVehicleSpecifications,\r\n GetEquipmentPlantCodes,\r\n GetMakeForManufacturer,\r\n GetMakesForManufacturerAndYear,\r\n GetMakesForVehicleType,\r\n GetManufacturerDetails,\r\n GetModelsForMake,\r\n GetModelsForMakeId,\r\n GetModelsForMakeIdYear,\r\n GetModelsForMakeYear,\r\n GetParts,\r\n GetVehicleTypesForMake,\r\n GetVehicleTypesForMakeId,\r\n GetVehicleVariableList,\r\n GetVehicleVariableValuesList,\r\n GetWMIsForManufacturer,\r\n} from './actions';\r\n\r\n/**\r\n * @class NHTSA\r\n * @augments module:api/Fetch.Fetch\r\n * @category API\r\n *\r\n * @param {FetchConfig} [userConfig] - Configuration options to construct the class with.\r\n *\r\n * @implements {module:api/actions/DecodeVin.DecodeVin}\r\n * @implements {module:api/actions/DecodeVinExtended.DecodeVinExtended}\r\n * @implements {module:api/actions/DecodeVinValues.DecodeVinValues}\r\n * @implements {module:api/actions/DecodeVinValuesExtended.DecodeVinValuesExtended}\r\n * @implements {module:api/actions/DecodeWMI.DecodeWMI}\r\n * @implements {module:api/actions/GetAllMakes.GetAllMakes}\r\n * @implements {module:api/actions/GetAllManufacturers.GetAllManufacturers}\r\n * @implements {module:api/actions/GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications}\r\n * @implements {module:api/actions/GetEquipmentPlantCodes.GetEquipmentPlantCodes}\r\n * @implements {module:api/actions/GetMakeForManufacturer.GetMakeForManufacturer}\r\n * @implements {module:api/actions/GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear}\r\n * @implements {module:api/actions/GetMakesForVehicleType.GetMakesForVehicleType}\r\n * @implements {module:api/actions/GetManufacturerDetails.GetManufacturerDetails}\r\n * @implements {module:api/actions/GetModelsForMake.GetModelsForMake}\r\n * @implements {module:api/actions/GetModelsForMakeId.GetModelsForMakeId}\r\n * @implements {module:api/actions/GetModelsForMakeIdYear.GetModelsForMakeIdYear}\r\n * @implements {module:api/actions/GetModelsForMakeYear.GetModelsForMakeYear}\r\n * @implements {module:api/actions/GetParts.GetParts}\r\n * @implements {module:api/actions/GetVehicleTypesForMake.GetVehicleTypesForMake}\r\n * @implements {module:api/actions/GetVehicleTypesForMakeId.GetVehicleTypesForMakeId}\r\n * @implements {module:api/actions/GetVehicleVariableList.GetVehicleVariableList}\r\n * @implements {module:api/actions/GetVehicleVariableValuesList.GetVehicleVariableValuesList}\r\n * @implements {module:api/actions/GetWMIsForManufacturer.GetWMIsForManufacturer}\r\n *\r\n * @example Node bundle\r\n * const { NHTSA } = require('@shaggytools/nhtsa-api-wrapper');\r\n *\r\n * const Wrapper = new NHTSA();\r\n *\r\n * // Decode a VIN and return a response of type ApiResponse\r\n * const response = Wrapper.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\r\n *\r\n * // or get details about a specific manufacturer, plus 23 other available Actions.\r\n * const hondaDetails = Wrapper.GetManufacturerDetails('Honda').catch(error => error)\r\n *\r\n * @example Browser bundle\r\n * // Change to specific version number \"x.x.xx\",\r\n * // or remove completely for the most recently published version\r\n * /dist/bundle.min.js\"\r\n * >\r\n *\r\n * \r\n *\r\n * @example Module - Node lazy loading\r\n * const { NHTSA } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\r\n * .catch(err => err);\r\n *\r\n * const ApiClient = new NHTSA();\r\n *\r\n * const results = await ApiClient.DecodeVin('3VWD07AJ5EM388202')\r\n * .catch(err => err)\r\n *\r\n * @example Module - Browser lazy loading\r\n * \r\n */\r\nclass NHTSA\r\n extends Fetch\r\n implements\r\n DecodeVin,\r\n DecodeVinExtended,\r\n DecodeVinValues,\r\n DecodeVINValuesBatch,\r\n DecodeVinValuesExtended,\r\n DecodeWMI,\r\n GetAllMakes,\r\n GetAllManufacturers,\r\n GetCanadianVehicleSpecifications,\r\n GetEquipmentPlantCodes,\r\n GetMakeForManufacturer,\r\n GetMakesForManufacturerAndYear,\r\n GetMakesForVehicleType,\r\n GetManufacturerDetails,\r\n GetModelsForMake,\r\n GetModelsForMakeId,\r\n GetModelsForMakeIdYear,\r\n GetModelsForMakeYear,\r\n GetParts,\r\n GetVehicleTypesForMake,\r\n GetVehicleTypesForMakeId,\r\n GetVehicleVariableList,\r\n GetVehicleVariableValuesList,\r\n GetWMIsForManufacturer {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n DecodeVin = DecodeVin.prototype.DecodeVin;\r\n\r\n DecodeVinExtended = DecodeVinExtended.prototype.DecodeVinExtended;\r\n\r\n DecodeVinValues = DecodeVinValues.prototype.DecodeVinValues;\r\n\r\n DecodeVINValuesBatch = DecodeVINValuesBatch.prototype.DecodeVINValuesBatch;\r\n\r\n DecodeVinValuesExtended =\r\n DecodeVinValuesExtended.prototype.DecodeVinValuesExtended;\r\n\r\n DecodeWMI = DecodeWMI.prototype.DecodeWMI;\r\n\r\n GetAllMakes = GetAllMakes.prototype.GetAllMakes;\r\n\r\n GetAllManufacturers = GetAllManufacturers.prototype.GetAllManufacturers;\r\n\r\n GetCanadianVehicleSpecifications =\r\n GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications;\r\n\r\n GetEquipmentPlantCodes =\r\n GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes;\r\n\r\n GetMakeForManufacturer =\r\n GetMakeForManufacturer.prototype.GetMakeForManufacturer;\r\n\r\n GetMakesForManufacturerAndYear =\r\n GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear;\r\n\r\n GetMakesForVehicleType =\r\n GetMakesForVehicleType.prototype.GetMakesForVehicleType;\r\n\r\n GetManufacturerDetails =\r\n GetManufacturerDetails.prototype.GetManufacturerDetails;\r\n\r\n GetModelsForMake = GetModelsForMake.prototype.GetModelsForMake;\r\n\r\n GetModelsForMakeId = GetModelsForMakeId.prototype.GetModelsForMakeId;\r\n\r\n GetModelsForMakeIdYear =\r\n GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear;\r\n\r\n GetModelsForMakeYear = GetModelsForMakeYear.prototype.GetModelsForMakeYear;\r\n\r\n GetParts = GetParts.prototype.GetParts;\r\n\r\n GetVehicleTypesForMake =\r\n GetVehicleTypesForMake.prototype.GetVehicleTypesForMake;\r\n\r\n GetVehicleTypesForMakeId =\r\n GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId;\r\n\r\n GetVehicleVariableList =\r\n GetVehicleVariableList.prototype.GetVehicleVariableList;\r\n\r\n GetVehicleVariableValuesList =\r\n GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList;\r\n\r\n GetWMIsForManufacturer =\r\n GetWMIsForManufacturer.prototype.GetWMIsForManufacturer;\r\n}\r\n\r\nexport { NHTSA };\r\n","/**\n * @module api/Client\n * @category API\n * @description Module exporting an instance of the NHSTA class.\n *\n * > - For more information, see the documentation for the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n */\n\nimport { NHTSA } from './NHTSA';\n\n/**\n * A new instance of the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n *\n * @type {NHTSA}\n *\n * @example Node bundle\n * const { Client } = require('@shaggytools/nhtsa-api-wrapper');\n *\n * // Decode a VIN and return get a response of type ApiResponse\n * const response = Client.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\n *\n * // or get details about a specific manufacturer, plus 23 other available Actions.\n * const audiDetails = Client.GetManufacturerDetails('Audi').catch(error => error)\n *\n * @example Browser bundle\n * // Change to specific version number \"x.x.xx\",\n * // or remove completely for the most recently published version\n * /dist/bundle.min.js\"\n * >\n *\n * \n *\n * @example Module - Node lazy loading\n * const { Client } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\n * .catch(err => err);\n *\n * const results = await Client.DecodeVin('3VWD07AJ5EM388202')\n * .catch(err => err)\n *\n * @example Module - Browser lazy loading\n * \n *\n */\nconst Client: NHTSA = new NHTSA();\n\nexport { Client };\n"],"names":["Fetch","DecodeVin","DecodeVinExtended","DecodeVinValues","DecodeVINValuesBatch","DecodeVinValuesExtended","DecodeWMI","GetAllMakes","GetAllManufacturers","GetCanadianVehicleSpecifications","GetEquipmentPlantCodes","GetMakeForManufacturer","GetMakesForManufacturerAndYear","GetMakesForVehicleType","GetManufacturerDetails","GetModelsForMake","GetModelsForMakeId","GetModelsForMakeIdYear","GetModelsForMakeYear","GetParts","GetVehicleTypesForMake","GetVehicleTypesForMakeId","GetVehicleVariableList","GetVehicleVariableValuesList","GetWMIsForManufacturer"],"mappings":";;;;;;;;AAAA;;;;;;;;AAuCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,MAAM,KACJ,SAAQA,WAAK;IA0Bb,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;QAEpB,cAAS,GAAGC,gCAAS,CAAC,SAAS,CAAC,SAAS,CAAC;QAE1C,sBAAiB,GAAGC,wCAAiB,CAAC,SAAS,CAAC,iBAAiB,CAAC;QAElE,oBAAe,GAAGC,sCAAe,CAAC,SAAS,CAAC,eAAe,CAAC;QAE5D,yBAAoB,GAAGC,2CAAoB,CAAC,SAAS,CAAC,oBAAoB,CAAC;QAE3E,4BAAuB,GACrBC,8CAAuB,CAAC,SAAS,CAAC,uBAAuB,CAAC;QAE5D,cAAS,GAAGC,gCAAS,CAAC,SAAS,CAAC,SAAS,CAAC;QAE1C,gBAAW,GAAGC,kCAAW,CAAC,SAAS,CAAC,WAAW,CAAC;QAEhD,wBAAmB,GAAGC,0CAAmB,CAAC,SAAS,CAAC,mBAAmB,CAAC;QAExE,qCAAgC,GAC9BC,uDAAgC,CAAC,SAAS,CAAC,gCAAgC,CAAC;QAE9E,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,mCAA8B,GAC5BC,qDAA8B,CAAC,SAAS,CAAC,8BAA8B,CAAC;QAE1E,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,qBAAgB,GAAGC,uCAAgB,CAAC,SAAS,CAAC,gBAAgB,CAAC;QAE/D,uBAAkB,GAAGC,yCAAkB,CAAC,SAAS,CAAC,kBAAkB,CAAC;QAErE,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,yBAAoB,GAAGC,2CAAoB,CAAC,SAAS,CAAC,oBAAoB,CAAC;QAE3E,aAAQ,GAAGC,+BAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC;QAEvC,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,6BAAwB,GACtBC,+CAAwB,CAAC,SAAS,CAAC,wBAAwB,CAAC;QAE9D,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,iCAA4B,GAC1BC,mDAA4B,CAAC,SAAS,CAAC,4BAA4B,CAAC;QAEtE,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;KA5DzD;;;ACpJH;;;;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+CM,MAAM,GAAU,IAAI,KAAK;;;;"} \ No newline at end of file +{"version":3,"file":"Client.js","sources":["../../src/api/Client.ts"],"sourcesContent":["/**\n * @module api/Client\n * @category API\n * @description Module exporting an instance of the NHSTA class.\n *\n * > - For more information, see the documentation for the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n */\n\nimport { NHTSA } from './NHTSA';\n\n/**\n * A new instance of the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n *\n * @type {NHTSA}\n *\n * @example Node bundle\n * const { Client } = require('@shaggytools/nhtsa-api-wrapper');\n *\n * // Decode a VIN and return get a response of type ApiResponse\n * const response = Client.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\n *\n * // or get details about a specific manufacturer, plus 23 other available Actions.\n * const audiDetails = Client.GetManufacturerDetails('Audi').catch(error => error)\n *\n * @example Browser bundle\n * // Change to specific version number \"x.x.xx\",\n * // or remove completely for the most recently published version\n * /dist/bundle.min.js\"\n * >\n *\n * \n *\n * @example Module - Node lazy loading\n * const { Client } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\n * .catch(err => err);\n *\n * const results = await Client.DecodeVin('3VWD07AJ5EM388202')\n * .catch(err => err)\n *\n * @example Module - Browser lazy loading\n * \n *\n */\nconst Client: NHTSA = new NHTSA();\n\nexport { Client };\n"],"names":["NHTSA"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+CM,MAAM,GAAU,IAAIA,WAAK;;;;"} \ No newline at end of file diff --git a/dist/cjs/DecodeVINValuesBatch.js.map b/dist/cjs/DecodeVINValuesBatch.js.map index 84ad639d1..f5083df08 100644 --- a/dist/cjs/DecodeVINValuesBatch.js.map +++ b/dist/cjs/DecodeVINValuesBatch.js.map @@ -1 +1 @@ -{"version":3,"file":"DecodeVINValuesBatch.js","sources":["../../src/api/actions/DecodeVINValuesBatch.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeVINValuesBatch\r\n * @category Actions\r\n * @description DecodeVINValuesBatch NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVINValuesBatch](module-api_actions_DecodeVINValuesBatch.DecodeVINValuesBatch.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVINValuesBatchResponse](#DecodeVINValuesBatchResponse)\r\n * > - Type: [DecodeVINValuesBatchResults](#DecodeVINValuesBatchResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVINValuesBatch extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This decodes a batch of VINs that are submitted in a standardized format in a string\r\n * and returns multiple decodes in a flat format.\r\n *\r\n * The `inputString` parameter should be in the following format:\r\n * - `vin , modelYear ; vin , modelYear ; vin , modelYear ...`\r\n *\r\n * \"modelYear\" is optional, the output for each VIN decode is in the same format as produced by the \"Decode VIN (flat format)\" method.\r\n *\r\n * @async\r\n * @param {string} inputString - A string of Vehicle Identification Numbers (full or partial) following the format listed in the description.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVINValuesBatch(\r\n inputString: string\r\n ): Promise {\r\n const action = 'DecodeVINValuesBatch';\r\n\r\n /* Runtime typechecking */\r\n const typeofInputString = getTypeof(inputString);\r\n if (typeofInputString !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"inputString\" argument is required and must be of type string, got: ` +\r\n `<${typeofInputString}> ${inputString}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/`;\r\n\r\n const body = encodeURI(`DATA=${inputString}&format=json`);\r\n\r\n /* Return the result */\r\n return await this.get(url, {\r\n method: 'POST',\r\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\r\n body,\r\n })\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVINValuesBatchResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVINValuesBatch\r\n * @alias DecodeVINValuesBatchResults\r\n */\r\nexport type DecodeVINValuesBatchResults = {\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVINValuesBatch API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVINValuesBatch\r\n * @alias DecodeVINValuesBatchResponse\r\n */\r\nexport type DecodeVINValuesBatchResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,oBAAqB,SAAQA,WAAK;IAC7C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;IAeK,oBAAoB,CACxB,WAAmB;;YAEnB,MAAM,MAAM,GAAG,sBAAsB,CAAC;;YAGtC,MAAM,iBAAiB,GAAGC,eAAS,CAAC,WAAW,CAAC,CAAC;YACjD,IAAI,iBAAiB,KAAK,QAAQ,EAAE;gBAClC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,wEAAwE;oBAC/E,IAAI,iBAAiB,KAAK,WAAW,EAAE,CAC1C,CACF,CAAC;aACH;;YAGD,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,CAAC;YAEzC,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,WAAW,cAAc,CAAC,CAAC;;YAG1D,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;gBACzB,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,EAAE,cAAc,EAAE,mCAAmC,EAAE;gBAChE,IAAI;aACL,CAAC;iBACC,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"DecodeVINValuesBatch.js","sources":["../../src/api/actions/DecodeVINValuesBatch.ts"],"sourcesContent":["/**\n * @module api/actions/DecodeVINValuesBatch\n * @category Actions\n * @description DecodeVINValuesBatch NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVINValuesBatch](module-api_actions_DecodeVINValuesBatch.DecodeVINValuesBatch.html)\n * >\n * > **Types**\n * > - Type: [DecodeVINValuesBatchResponse](#DecodeVINValuesBatchResponse)\n * > - Type: [DecodeVINValuesBatchResults](#DecodeVINValuesBatchResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVINValuesBatch extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This decodes a batch of VINs that are submitted in a standardized format in a string\n * and returns multiple decodes in a flat format.\n *\n * The `inputString` parameter should be in the following format:\n * - `vin , modelYear ; vin , modelYear ; vin , modelYear ...`\n *\n * \"modelYear\" is optional, the output for each VIN decode is in the same format as produced by the \"Decode VIN (flat format)\" method.\n *\n * @async\n * @param {string} inputString - A string of Vehicle Identification Numbers (full or partial) following the format listed in the description.\n * @returns {(Promise)} - Api Response object.\n */\n async DecodeVINValuesBatch(\n inputString: string\n ): Promise {\n const action = 'DecodeVINValuesBatch';\n\n /* Runtime typechecking */\n const typeofInputString = getTypeof(inputString);\n if (typeofInputString !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"inputString\" argument is required and must be of type string, got: ` +\n `<${typeofInputString}> ${inputString}`\n )\n );\n }\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/`;\n\n const body = encodeURI(`DATA=${inputString}&format=json`);\n\n /* Return the result */\n return await this.get(url, {\n method: 'POST',\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\n body,\n })\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVINValuesBatchResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVINValuesBatch\n * @alias DecodeVINValuesBatchResults\n */\nexport type DecodeVINValuesBatchResults = {\n ABS: string;\n ActiveSafetySysNote: string;\n AdaptiveCruiseControl: string;\n AdaptiveDrivingBeam: string;\n AdaptiveHeadlights: string;\n AdditionalErrorText: string;\n AirBagLocCurtain: string;\n AirBagLocFront: string;\n AirBagLocKnee: string;\n AirBagLocSeatCushion: string;\n AirBagLocSide: string;\n AutoReverseSystem: string;\n AutomaticPedestrianAlertingSound: string;\n AxleConfiguration: string;\n Axles: string;\n BasePrice: string;\n BatteryA: string;\n BatteryA_to: string;\n BatteryCells: string;\n BatteryInfo: string;\n BatteryKWh: string;\n BatteryKWh_to: string;\n BatteryModules: string;\n BatteryPacks: string;\n BatteryType: string;\n BatteryV: string;\n BatteryV_to: string;\n BedLengthIN: string;\n BedType: string;\n BlindSpotMon: string;\n BodyCabType: string;\n BodyClass: string;\n BrakeSystemDesc: string;\n BrakeSystemType: string;\n BusFloorConfigType: string;\n BusLength: string;\n BusType: string;\n CAN_AACN: string;\n CIB: string;\n CashForClunkers: string;\n ChargerLevel: string;\n ChargerPowerKW: string;\n CoolingType: string;\n CurbWeightLB: string;\n CustomMotorcycleType: string;\n DaytimeRunningLight: string;\n DestinationMarket: string;\n DisplacementCC: string;\n DisplacementCI: string;\n DisplacementL: string;\n Doors: string;\n DriveType: string;\n DriverAssist: string;\n DynamicBrakeSupport: string;\n EDR: string;\n ESC: string;\n EVDriveUnit: string;\n ElectrificationLevel: string;\n EngineConfiguration: string;\n EngineCycles: string;\n EngineCylinders: string;\n EngineHP: string;\n EngineHP_to: string;\n EngineKW: string;\n EngineManufacturer: string;\n EngineModel: string;\n EntertainmentSystem: string;\n ErrorCode: string;\n ErrorText: string;\n ForwardCollisionWarning: string;\n FuelInjectionType: string;\n FuelTypePrimary: string;\n FuelTypeSecondary: string;\n GCWR: string;\n GCWR_to: string;\n GVWR: string;\n GVWR_to: string;\n KeylessIgnition: string;\n LaneDepartureWarning: string;\n LaneKeepSystem: string;\n LowerBeamHeadlampLightSource: string;\n Make: string;\n Manufacturer: string;\n ManufacturerId: string;\n Model: string;\n ModelYear: string;\n MotorcycleChassisType: string;\n MotorcycleSuspensionType: string;\n NCSABodyType: string;\n NCSAMake: string;\n NCSAMapExcApprovedBy: string;\n NCSAMapExcApprovedOn: string;\n NCSAMappingException: string;\n NCSAModel: string;\n NCSANote: string;\n Note: string;\n OtherBusInfo: string;\n OtherEngineInfo: string;\n OtherMotorcycleInfo: string;\n OtherRestraintSystemInfo: string;\n OtherTrailerInfo: string;\n ParkAssist: string;\n PedestrianAutomaticEmergencyBraking: string;\n PlantCity: string;\n PlantCompanyName: string;\n PlantCountry: string;\n PlantState: string;\n PossibleValues: string;\n Pretensioner: string;\n RearCrossTrafficAlert: string;\n RearVisibilitySystem: string;\n SAEAutomationLevel: string;\n SAEAutomationLevel_to: string;\n SeatBeltsAll: string;\n SeatRows: string;\n Seats: string;\n SemiautomaticHeadlampBeamSwitching: string;\n Series: string;\n Series2: string;\n SteeringLocation: string;\n SuggestedVIN: string;\n TPMS: string;\n TopSpeedMPH: string;\n TrackWidth: string;\n TractionControl: string;\n TrailerBodyType: string;\n TrailerLength: string;\n TrailerType: string;\n TransmissionSpeeds: string;\n TransmissionStyle: string;\n Trim: string;\n Trim2: string;\n Turbo: string;\n VIN: string;\n ValveTrainDesign: string;\n VehicleType: string;\n WheelBaseLong: string;\n WheelBaseShort: string;\n WheelBaseType: string;\n WheelSizeFront: string;\n WheelSizeRear: string;\n Wheels: string;\n Windows: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVINValuesBatch API Action.\n *\n * @memberof module:api/actions/DecodeVINValuesBatch\n * @alias DecodeVINValuesBatchResponse\n */\nexport type DecodeVINValuesBatchResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,oBAAqB,SAAQA,WAAK;IAC7C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;IAeK,oBAAoB,CACxB,WAAmB;;YAEnB,MAAM,MAAM,GAAG,sBAAsB,CAAC;;YAGtC,MAAM,iBAAiB,GAAGC,eAAS,CAAC,WAAW,CAAC,CAAC;YACjD,IAAI,iBAAiB,KAAK,QAAQ,EAAE;gBAClC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,wEAAwE;oBAC/E,IAAI,iBAAiB,KAAK,WAAW,EAAE,CAC1C,CACF,CAAC;aACH;;YAGD,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,CAAC;YAEzC,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,WAAW,cAAc,CAAC,CAAC;;YAG1D,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;gBACzB,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,EAAE,cAAc,EAAE,mCAAmC,EAAE;gBAChE,IAAI;aACL,CAAC;iBACC,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/DecodeVin.js.map b/dist/cjs/DecodeVin.js.map index 54c7c9244..94bc51626 100644 --- a/dist/cjs/DecodeVin.js.map +++ b/dist/cjs/DecodeVin.js.map @@ -1 +1 @@ -{"version":3,"file":"DecodeVin.js","sources":["../../src/api/actions/DecodeVin.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeVin\r\n * @category Actions\r\n * @description DecodeVin NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVin](module-api_actions_DecodeVin.DecodeVin.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinResponse](#DecodeVinResponse)\r\n * > - Type: [DecodeVinResults](#DecodeVinResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVin extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The DecodeVin API Action will decode the VIN and the decoded output will be made available in the format of Key-value pairs.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This API also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n * - The 9th digit is not necessary.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVin(\r\n vin: string,\r\n params?: {\r\n modelYear?: number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVin';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVin\r\n * @alias DecodeVinResults\r\n */\r\nexport type DecodeVinResults = {\r\n Value: string | null;\r\n ValueId: string | null;\r\n Variable: string;\r\n VariableId: number;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVin API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVin\r\n * @alias DecodeVinResponse\r\n */\r\nexport type DecodeVinResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,SAAU,SAAQA,WAAK;IAClC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;IAkBK,SAAS,CACb,GAAW,EACX,MAEC;;YAED,MAAM,MAAM,GAAG,WAAW,CAAC;;YAG3B,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,MAAM,IAAI,YAAY,KAAK,QAAQ,EAAE;gBACvC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mDAAmD;oBAC1D,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;YAED,MAAM,SAAS,GAAGA,eAAS,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,SAAS,KAAK,QAAQ,EAAE;gBAC1B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,gEAAgE;oBACvE,IAAI,SAAS,KAAK,GAAG,EAAE,CAC1B,CACF,CAAC;aACH;YAED,MAAM,eAAe,GAAGA,eAAS,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAC,CAAC;YACrD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,KAAI,eAAe,KAAK,QAAQ,EAAE;gBACrD,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,uFAAuF;oBAC9F,IAAI,eAAe,KAAK,MAAM,CAAC,SAAS,EAAE,CAC7C,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAChE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,GAAG,GAAG,WAAW,EAAE,CAAC;;YAG7D,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"DecodeVin.js","sources":["../../src/api/actions/DecodeVin.ts"],"sourcesContent":["/**\n * @module api/actions/DecodeVin\n * @category Actions\n * @description DecodeVin NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVin](module-api_actions_DecodeVin.DecodeVin.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinResponse](#DecodeVinResponse)\n * > - Type: [DecodeVinResults](#DecodeVinResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVin extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * The DecodeVin API Action will decode the VIN and the decoded output will be made available in the format of Key-value pairs.\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This API also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n * - The 9th digit is not necessary.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {number} [params.modelYear] - Optional Model Year search parameter.\n * @returns {(Promise)} - Api Response object.\n */\n async DecodeVin(\n vin: string,\n params?: {\n modelYear?: number;\n }\n ): Promise {\n const action = 'DecodeVin';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (params?.modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVin\n * @alias DecodeVinResults\n */\nexport type DecodeVinResults = {\n Value: string | null;\n ValueId: string | null;\n Variable: string;\n VariableId: number;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVin API Action.\n *\n * @memberof module:api/actions/DecodeVin\n * @alias DecodeVinResponse\n */\nexport type DecodeVinResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,SAAU,SAAQA,WAAK;IAClC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;IAkBK,SAAS,CACb,GAAW,EACX,MAEC;;YAED,MAAM,MAAM,GAAG,WAAW,CAAC;;YAG3B,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,MAAM,IAAI,YAAY,KA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,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/DecodeVinExtended.js.map b/dist/cjs/DecodeVinExtended.js.map index 37c62fb42..72e5d7379 100644 --- a/dist/cjs/DecodeVinExtended.js.map +++ b/dist/cjs/DecodeVinExtended.js.map @@ -1 +1 @@ -{"version":3,"file":"DecodeVinExtended.js","sources":["../../src/api/actions/DecodeVinExtended.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeVinExtended\r\n * @category Actions\r\n * @description DecodeVinExtended NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinExtended](module-api_actions_DecodeVinExtended.DecodeVinExtended.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinExtendedResponse](#DecodeVinExtendedResponse)\r\n * > - Type: [DecodeVinExtendedResults](#DecodeVinExtendedResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinExtended extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This is exactly like the DecodeVin method but provides additional information on variables\r\n * related to other NHTSA programs like\r\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\r\n * - This will decode the VIN and the decoded output will be made available\r\n * in the format of Key-value pairs.\r\n * - In the returned 'Results` object:\r\n * - The IDs (VariableID and ValueID) represent the unique ID associated with the Variable/Value.\r\n * - In case of text variables, the ValueID is not applicable.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n * - The 9th digit is not necessary.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVinExtended(\r\n vin: string,\r\n params?: {\r\n modelYear?: string | number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinExtended';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinExtendedResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinExtended\r\n * @alias DecodeVinExtendedResults\r\n */\r\nexport type DecodeVinExtendedResults = {\r\n Value: string | null;\r\n ValueId: string | null;\r\n Variable: string;\r\n VariableId: number;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinExtended API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinExtended\r\n * @alias DecodeVinExtendedResponse\r\n */\r\nexport type DecodeVinExtendedResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,iBAAkB,SAAQA,WAAK;IAC1C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;;;;;;;IAyBK,iBAAiB,CACrB,GAAW,EACX,MAEC;;YAED,MAAM,MAAM,GAAG,mBAAmB,CAAC;;YAGnC,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,MAAM,IAAI,YAAY,KAAK,QAAQ,EAAE;gBACvC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mDAAmD;oBAC1D,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;YAED,MAAM,SAAS,GAAGA,eAAS,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,SAAS,KAAK,QAAQ,EAAE;gBAC1B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,gEAAgE;oBACvE,IAAI,SAAS,KAAK,GAAG,EAAE,CAC1B,CACF,CAAC;aACH;YAED,MAAM,eAAe,GAAGA,eAAS,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAC,CAAC;YACrD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,KAAI,eAAe,KAAK,QAAQ,EAAE;gBACrD,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,uFAAuF;oBAC9F,IAAI,eAAe,KAAK,MAAM,CAAC,SAAS,EAAE,CAC7C,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAChE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,GAAG,GAAG,WAAW,EAAE,CAAC;;YAG7D,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"DecodeVinExtended.js","sources":["../../src/api/actions/DecodeVinExtended.ts"],"sourcesContent":["/**\n * @module api/actions/DecodeVinExtended\n * @category Actions\n * @description DecodeVinExtended NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVinExtended](module-api_actions_DecodeVinExtended.DecodeVinExtended.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinExtendedResponse](#DecodeVinExtendedResponse)\n * > - Type: [DecodeVinExtendedResults](#DecodeVinExtendedResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVinExtended extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This is exactly like the DecodeVin method but provides additional information on variables\n * related to other NHTSA programs like\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\n * - This will decode the VIN and the decoded output will be made available\n * in the format of Key-value pairs.\n * - In the returned 'Results` object:\n * - The IDs (VariableID and ValueID) represent the unique ID associated with the Variable/Value.\n * - In case of text variables, the ValueID is not applicable.\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n * - The 9th digit is not necessary.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\n * @returns {(Promise)} - Api Response object.\n */\n async DecodeVinExtended(\n vin: string,\n params?: {\n modelYear?: string | number;\n }\n ): Promise {\n const action = 'DecodeVinExtended';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (params?.modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinExtendedResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVinExtended\n * @alias DecodeVinExtendedResults\n */\nexport type DecodeVinExtendedResults = {\n Value: string | null;\n ValueId: string | null;\n Variable: string;\n VariableId: number;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVinExtended API Action.\n *\n * @memberof module:api/actions/DecodeVinExtended\n * @alias DecodeVinExtendedResponse\n */\nexport type DecodeVinExtendedResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;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GF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,GAAG,GAAG,WAAW,EAAE,CAAC;;YAG7D,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/DecodeVinValues.js.map b/dist/cjs/DecodeVinValues.js.map index 5dc286ac5..16d7b8998 100644 --- a/dist/cjs/DecodeVinValues.js.map +++ b/dist/cjs/DecodeVinValues.js.map @@ -1 +1 @@ -{"version":3,"file":"DecodeVinValues.js","sources":["../../src/api/actions/DecodeVinValues.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeVinValues\r\n * @category Actions\r\n * @description DecodeVinValues NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinValues](module-api_actions_DecodeVinValues.DecodeVinValues.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinValuesResponse](#DecodeVinValuesResponse)\r\n * > - Type: [DecodeVinValuesResults](#DecodeVinValuesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinValues extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The DecodeVinValues API Action will decode the VIN with the Results returned in a _flat file_ format.\r\n * - The Results will be made available in a flat file format of a single object containing\r\n * 'key: value' results.\r\n * - Providing params.modelYear allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeVinValues(\r\n vin: string,\r\n params?: {\r\n modelYear?: number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinValues';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (\r\n params?.modelYear &&\r\n typeofModelYear !== 'string' &&\r\n typeofModelYear !== 'number'\r\n ) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinValuesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinValues\r\n * @alias DecodeVinValuesResults\r\n */\r\nexport type DecodeVinValuesResults = {\r\n /** Flat file format, single object containing keys and values of type string */\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinValues API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinValues\r\n * @alias DecodeVinValuesResponse\r\n */\r\nexport type DecodeVinValuesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /**\r\n * The search results returned by the NHSTA API request.\r\n * Flat file format, single object containing keys and values of type string\r\n * */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,eAAgB,SAAQA,WAAK;IACxC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;IAmBK,eAAe,CACnB,GAAW,EACX,MAEC;;YAED,MAAM,MAAM,GAAG,iBAAiB,CAAC;;YAGjC,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,MAAM,IAAI,YAAY,KAAK,QAAQ,EAAE;gBACvC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAA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newline at end of file +{"version":3,"file":"DecodeVinValues.js","sources":["../../src/api/actions/DecodeVinValues.ts"],"sourcesContent":["/**\n * @module api/actions/DecodeVinValues\n * @category Actions\n * @description DecodeVinValues NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVinValues](module-api_actions_DecodeVinValues.DecodeVinValues.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinValuesResponse](#DecodeVinValuesResponse)\n * > - Type: [DecodeVinValuesResults](#DecodeVinValuesResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVinValues extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * The DecodeVinValues API Action will decode the VIN with the Results returned in a _flat file_ format.\n * - The Results will be made available in a flat file format of a single object containing\n * 'key: value' results.\n * - Providing params.modelYear allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\n * @returns {(Promise)} Api Response object.\n */\n async DecodeVinValues(\n vin: string,\n params?: {\n modelYear?: number;\n }\n ): Promise {\n const action = 'DecodeVinValues';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (\n params?.modelYear &&\n typeofModelYear !== 'string' &&\n typeofModelYear !== 'number'\n ) {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinValuesResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVinValues\n * @alias DecodeVinValuesResults\n */\nexport type DecodeVinValuesResults = {\n /** Flat file format, single object containing keys and values of type string */\n ABS: string;\n ActiveSafetySysNote: string;\n AdaptiveCruiseControl: string;\n AdaptiveDrivingBeam: string;\n AdaptiveHeadlights: string;\n AdditionalErrorText: string;\n AirBagLocCurtain: string;\n AirBagLocFront: string;\n AirBagLocKnee: string;\n AirBagLocSeatCushion: string;\n AirBagLocSide: string;\n AutoReverseSystem: string;\n AutomaticPedestrianAlertingSound: string;\n AxleConfiguration: string;\n Axles: string;\n BasePrice: string;\n BatteryA: string;\n BatteryA_to: string;\n BatteryCells: string;\n BatteryInfo: string;\n BatteryKWh: string;\n BatteryKWh_to: string;\n BatteryModules: string;\n BatteryPacks: string;\n BatteryType: string;\n BatteryV: string;\n BatteryV_to: string;\n BedLengthIN: string;\n BedType: string;\n BlindSpotMon: string;\n BodyCabType: string;\n BodyClass: string;\n BrakeSystemDesc: string;\n BrakeSystemType: string;\n BusFloorConfigType: string;\n BusLength: string;\n BusType: string;\n CAN_AACN: string;\n CIB: string;\n CashForClunkers: string;\n ChargerLevel: string;\n ChargerPowerKW: string;\n CoolingType: string;\n CurbWeightLB: string;\n CustomMotorcycleType: string;\n DaytimeRunningLight: string;\n DestinationMarket: string;\n DisplacementCC: string;\n DisplacementCI: string;\n DisplacementL: string;\n Doors: string;\n DriveType: string;\n DriverAssist: string;\n DynamicBrakeSupport: string;\n EDR: string;\n ESC: string;\n EVDriveUnit: string;\n ElectrificationLevel: string;\n EngineConfiguration: string;\n EngineCycles: string;\n EngineCylinders: string;\n EngineHP: string;\n EngineHP_to: string;\n EngineKW: string;\n EngineManufacturer: string;\n EngineModel: string;\n EntertainmentSystem: string;\n ErrorCode: string;\n ErrorText: string;\n ForwardCollisionWarning: string;\n FuelInjectionType: string;\n FuelTypePrimary: string;\n FuelTypeSecondary: string;\n GCWR: string;\n GCWR_to: string;\n GVWR: string;\n GVWR_to: string;\n KeylessIgnition: string;\n LaneDepartureWarning: string;\n LaneKeepSystem: string;\n LowerBeamHeadlampLightSource: string;\n Make: string;\n Manufacturer: string;\n ManufacturerId: string;\n Model: string;\n ModelYear: string;\n MotorcycleChassisType: string;\n MotorcycleSuspensionType: string;\n NCSABodyType: string;\n NCSAMake: string;\n NCSAMapExcApprovedBy: string;\n NCSAMapExcApprovedOn: string;\n NCSAMappingException: string;\n NCSAModel: string;\n NCSANote: string;\n Note: string;\n OtherBusInfo: string;\n OtherEngineInfo: string;\n OtherMotorcycleInfo: string;\n OtherRestraintSystemInfo: string;\n OtherTrailerInfo: string;\n ParkAssist: string;\n PedestrianAutomaticEmergencyBraking: string;\n PlantCity: string;\n PlantCompanyName: string;\n PlantCountry: string;\n PlantState: string;\n PossibleValues: string;\n Pretensioner: string;\n RearCrossTrafficAlert: string;\n RearVisibilitySystem: string;\n SAEAutomationLevel: string;\n SAEAutomationLevel_to: string;\n SeatBeltsAll: string;\n SeatRows: string;\n Seats: string;\n SemiautomaticHeadlampBeamSwitching: string;\n Series: string;\n Series2: string;\n SteeringLocation: string;\n SuggestedVIN: string;\n TPMS: string;\n TopSpeedMPH: string;\n TrackWidth: string;\n TractionControl: string;\n TrailerBodyType: string;\n TrailerLength: string;\n TrailerType: string;\n TransmissionSpeeds: string;\n TransmissionStyle: string;\n Trim: string;\n Trim2: string;\n Turbo: string;\n VIN: string;\n ValveTrainDesign: string;\n VehicleType: string;\n WheelBaseLong: string;\n WheelBaseShort: string;\n WheelBaseType: string;\n WheelSizeFront: string;\n WheelSizeRear: string;\n Wheels: string;\n Windows: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVinValues API Action.\n *\n * @memberof module:api/actions/DecodeVinValues\n * @alias DecodeVinValuesResponse\n */\nexport type DecodeVinValuesResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /**\n * The search results returned by the NHSTA API request.\n * Flat file format, single object containing keys and values of type string\n * */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,eAAgB,SAAQA,WAAK;IACxC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;IAmBK,eAAe,CACnB,GAAW,EACX,MAEC;;YAED,MAAM,MAAM,GAAG,iBAAiB,CAAC;;YAGjC,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,MAAM,IAAI,YAAY,KAAK,QAAQ,EAAE;gBACvC,OAAO,OAAO,CAAC,MAAM,CAC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C;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/DecodeVinValuesExtended.js.map b/dist/cjs/DecodeVinValuesExtended.js.map index 0379896d4..c69952f40 100644 --- a/dist/cjs/DecodeVinValuesExtended.js.map +++ b/dist/cjs/DecodeVinValuesExtended.js.map @@ -1 +1 @@ -{"version":3,"file":"DecodeVinValuesExtended.js","sources":["../../src/api/actions/DecodeVinValuesExtended.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeVinValuesExtended\r\n * @category Actions\r\n * @description DecodeVinValuesExtended NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinValuesExtended](module-api_actions_DecodeVinValuesExtended.DecodeVinValuesExtended.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinValuesExtendedResponse](#DecodeVinValuesExtendedResponse)\r\n * > - Type: [DecodeVinValuesExtendedResults](#DecodeVinValuesExtendedResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinValuesExtended extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This is exactly like the DecodeVinValues (flat format Results) method but provides additional information\r\n * on variables related to other NHTSA programs like\r\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\r\n * - The Results will be made available in a flat file format of a single object containing\r\n * 'key: value' results.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @reje\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeVinValuesExtended(\r\n vin: string,\r\n params?: {\r\n modelYear?: string | number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinValuesExtended';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinValuesExtendedResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinValuesExtended\r\n * @alias DecodeVinValuesExtendedResults\r\n */\r\nexport type DecodeVinValuesExtendedResults = {\r\n /** Flat file format, single object containing keys and values of type string */\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinValuesExtended API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinValuesExtended\r\n * @alias DecodeVinValuesExtendedResponse\r\n */\r\nexport type DecodeVinValuesExtendedResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /**\r\n * The search results returned by the NHSTA API request.\r\n * Flat file format, single object containing keys and values of type string\r\n * */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,uBAAwB,SAAQA,WAAK;IAChD,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;;;;IAsBK,uBAAuB,CAC3B,GAAW,EACX,MAEC;;YAED,MAAM,MAAM,GAAG,yBAAyB,CAAC;;YAGzC,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,MAAM,IAAI,YAAY,KAAK,QAAQ,EAAE;gBACvC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mDAAmD;oBAC1D,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;YAED,MAAM,SAAS,GAAGA,eAAS,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,SAAS,KAAK,QAAQ,EAAE;gBAC1B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,gEAAgE;oBACvE,IAAI,SAAS,KAAK,GAAG,EAAE,CAC1B,CACF,CAAC;aACH;YAED,MAAM,eAAe,GAAGA,eAAS,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAC,CAAC;YACrD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,KAAI,eAAe,KAAK,QAAQ,EAAE;gBACrD,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,uFAAuF;oBAC9F,IAAI,eAAe,KAAK,MAAM,CAAC,SAAS,EAAE,CAC7C,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAChE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,GAAG,GAAG,WAAW,EAAE,CAAC;;YAG7D,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"DecodeVinValuesExtended.js","sources":["../../src/api/actions/DecodeVinValuesExtended.ts"],"sourcesContent":["/**\n * @module api/actions/DecodeVinValuesExtended\n * @category Actions\n * @description DecodeVinValuesExtended NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVinValuesExtended](module-api_actions_DecodeVinValuesExtended.DecodeVinValuesExtended.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinValuesExtendedResponse](#DecodeVinValuesExtendedResponse)\n * > - Type: [DecodeVinValuesExtendedResults](#DecodeVinValuesExtendedResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVinValuesExtended extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This is exactly like the DecodeVinValues (flat format Results) method but provides additional information\n * on variables related to other NHTSA programs like\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\n * - The Results will be made available in a flat file format of a single object containing\n * 'key: value' results.\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\n * @reje\n * @returns {(Promise)} Api Response object.\n */\n async DecodeVinValuesExtended(\n vin: string,\n params?: {\n modelYear?: string | number;\n }\n ): Promise {\n const action = 'DecodeVinValuesExtended';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (params?.modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinValuesExtendedResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVinValuesExtended\n * @alias DecodeVinValuesExtendedResults\n */\nexport type DecodeVinValuesExtendedResults = {\n /** Flat file format, single object containing keys and values of type string */\n ABS: string;\n ActiveSafetySysNote: string;\n AdaptiveCruiseControl: string;\n AdaptiveDrivingBeam: string;\n AdaptiveHeadlights: string;\n AdditionalErrorText: string;\n AirBagLocCurtain: string;\n AirBagLocFront: string;\n AirBagLocKnee: string;\n AirBagLocSeatCushion: string;\n AirBagLocSide: string;\n AutoReverseSystem: string;\n AutomaticPedestrianAlertingSound: string;\n AxleConfiguration: string;\n Axles: string;\n BasePrice: string;\n BatteryA: string;\n BatteryA_to: string;\n BatteryCells: string;\n BatteryInfo: string;\n BatteryKWh: string;\n BatteryKWh_to: string;\n BatteryModules: string;\n BatteryPacks: string;\n BatteryType: string;\n BatteryV: string;\n BatteryV_to: string;\n BedLengthIN: string;\n BedType: string;\n BlindSpotMon: string;\n BodyCabType: string;\n BodyClass: string;\n BrakeSystemDesc: string;\n BrakeSystemType: string;\n BusFloorConfigType: string;\n BusLength: string;\n BusType: string;\n CAN_AACN: string;\n CIB: string;\n CashForClunkers: string;\n ChargerLevel: string;\n ChargerPowerKW: string;\n CoolingType: string;\n CurbWeightLB: string;\n CustomMotorcycleType: string;\n DaytimeRunningLight: string;\n DestinationMarket: string;\n DisplacementCC: string;\n DisplacementCI: string;\n DisplacementL: string;\n Doors: string;\n DriveType: string;\n DriverAssist: string;\n DynamicBrakeSupport: string;\n EDR: string;\n ESC: string;\n EVDriveUnit: string;\n ElectrificationLevel: string;\n EngineConfiguration: string;\n EngineCycles: string;\n EngineCylinders: string;\n EngineHP: string;\n EngineHP_to: string;\n EngineKW: string;\n EngineManufacturer: string;\n EngineModel: string;\n EntertainmentSystem: string;\n ErrorCode: string;\n ErrorText: string;\n ForwardCollisionWarning: string;\n FuelInjectionType: string;\n FuelTypePrimary: string;\n FuelTypeSecondary: string;\n GCWR: string;\n GCWR_to: string;\n GVWR: string;\n GVWR_to: string;\n KeylessIgnition: string;\n LaneDepartureWarning: string;\n LaneKeepSystem: string;\n LowerBeamHeadlampLightSource: string;\n Make: string;\n Manufacturer: string;\n ManufacturerId: string;\n Model: string;\n ModelYear: string;\n MotorcycleChassisType: string;\n MotorcycleSuspensionType: string;\n NCSABodyType: string;\n NCSAMake: string;\n NCSAMapExcApprovedBy: string;\n NCSAMapExcApprovedOn: string;\n NCSAMappingException: string;\n NCSAModel: string;\n NCSANote: string;\n Note: string;\n OtherBusInfo: string;\n OtherEngineInfo: string;\n OtherMotorcycleInfo: string;\n OtherRestraintSystemInfo: string;\n OtherTrailerInfo: string;\n ParkAssist: string;\n PedestrianAutomaticEmergencyBraking: string;\n PlantCity: string;\n PlantCompanyName: string;\n PlantCountry: string;\n PlantState: string;\n PossibleValues: string;\n Pretensioner: string;\n RearCrossTrafficAlert: string;\n RearVisibilitySystem: string;\n SAEAutomationLevel: string;\n SAEAutomationLevel_to: string;\n SeatBeltsAll: string;\n SeatRows: string;\n Seats: string;\n SemiautomaticHeadlampBeamSwitching: string;\n Series: string;\n Series2: string;\n SteeringLocation: string;\n SuggestedVIN: string;\n TPMS: string;\n TopSpeedMPH: string;\n TrackWidth: string;\n TractionControl: string;\n TrailerBodyType: string;\n TrailerLength: string;\n TrailerType: string;\n TransmissionSpeeds: string;\n TransmissionStyle: string;\n Trim: string;\n Trim2: string;\n Turbo: string;\n VIN: string;\n ValveTrainDesign: string;\n VehicleType: string;\n WheelBaseLong: string;\n WheelBaseShort: string;\n WheelBaseType: string;\n WheelSizeFront: string;\n WheelSizeRear: string;\n Wheels: string;\n Windows: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVinValuesExtended API Action.\n *\n * @memberof module:api/actions/DecodeVinValuesExtended\n * @alias DecodeVinValuesExtendedResponse\n */\nexport type DecodeVinValuesExtendedResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /**\n * The search results returned by the NHSTA API request.\n * Flat file format, single object containing keys and values of type string\n * */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,uBAAwB,SAAQA,WAAK;IAChD,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;;;;IAsBK,uBAAuB,CAC3B,GAAW,EACX,MAEC;;YAED,MAAM,MAAM,GAAG,yBAAyB,CAAC;;YAGzC,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,MAAM,IAAI,YAAY,KAAK,QAAQ,EAAE;gBACvC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CAC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/DecodeWMI.js.map b/dist/cjs/DecodeWMI.js.map index 93bc9de8a..e1b3397dc 100644 --- a/dist/cjs/DecodeWMI.js.map +++ b/dist/cjs/DecodeWMI.js.map @@ -1 +1 @@ -{"version":3,"file":"DecodeWMI.js","sources":["../../src/api/actions/DecodeWMI.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeWMI\r\n * @category Actions\r\n * @description DecodeWMI NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeWMI](module-api_actions_DecodeWMI.DecodeWMI.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeWMIResponse](#DecodeWMIResponse)\r\n * > - Type: [DecodeWMIResults](#DecodeWMIResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeWMI extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides information on the World Manufacturer Identifier for a specific WMI code.\r\n * - `WMI` may be put in as either 3 characters representing VIN position 1-3 or 6 characters\r\n * representing VIN positions 1-3 & 12-14. Example \"JTD\", \"1T9131\".\r\n *\r\n * @async\r\n * @param {string} WMI - World Manufacturer Identifier.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeWMI(WMI: string): Promise {\r\n const action = 'DecodeWMI';\r\n\r\n /* Runtime typechecking */\r\n const typeofWMI = getTypeof(WMI);\r\n if (typeofWMI !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"WMI\" argument is required and must be of type string, got: ` +\r\n `<${typeofWMI}> ${WMI}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${WMI}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeWMIResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeWMI\r\n * @alias DecodeWMIResults\r\n */\r\nexport type DecodeWMIResults = {\r\n CommonName: string;\r\n CreatedOn: string;\r\n DateAvailableToPublic: string;\r\n Make: string;\r\n ManufacturerName: string;\r\n ParentCompanyName: string;\r\n URL: string;\r\n UpdatedOn: string;\r\n VehicleType: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeWMI API Action.\r\n *\r\n * @memberof module:api/actions/DecodeWMI\r\n * @alias DecodeWMIResponse\r\n */\r\nexport type DecodeWMIResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,SAAU,SAAQA,WAAK;IAClC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;IAWK,SAAS,CAAC,GAAW;;YACzB,MAAM,MAAM,GAAG,WAAW,CAAC;;YAG3B,MAAM,SAAS,GAAGC,eAAS,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,SAAS,KAAK,QAAQ,EAAE;gBAC1B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,gEAAgE;oBACvE,IAAI,SAAS,KAAK,GAAG,EAAE,CAC1B,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,GAAG,GAAG,WAAW,EAAE,CAAC;;YAG7D,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"DecodeWMI.js","sources":["../../src/api/actions/DecodeWMI.ts"],"sourcesContent":["/**\n * @module api/actions/DecodeWMI\n * @category Actions\n * @description DecodeWMI NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeWMI](module-api_actions_DecodeWMI.DecodeWMI.html)\n * >\n * > **Types**\n * > - Type: [DecodeWMIResponse](#DecodeWMIResponse)\n * > - Type: [DecodeWMIResults](#DecodeWMIResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeWMI extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides information on the World Manufacturer Identifier for a specific WMI code.\n * - `WMI` may be put in as either 3 characters representing VIN position 1-3 or 6 characters\n * representing VIN positions 1-3 & 12-14. Example \"JTD\", \"1T9131\".\n *\n * @async\n * @param {string} WMI - World Manufacturer Identifier.\n * @returns {(Promise)} Api Response object.\n */\n async DecodeWMI(WMI: string): Promise {\n const action = 'DecodeWMI';\n\n /* Runtime typechecking */\n const typeofWMI = getTypeof(WMI);\n if (typeofWMI !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"WMI\" argument is required and must be of type string, got: ` +\n `<${typeofWMI}> ${WMI}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${WMI}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeWMIResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeWMI\n * @alias DecodeWMIResults\n */\nexport type DecodeWMIResults = {\n CommonName: string;\n CreatedOn: string;\n DateAvailableToPublic: string;\n Make: string;\n ManufacturerName: string;\n ParentCompanyName: string;\n URL: string;\n UpdatedOn: string;\n VehicleType: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeWMI API Action.\n *\n * @memberof module:api/actions/DecodeWMI\n * @alias DecodeWMIResponse\n */\nexport type DecodeWMIResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,SAAU,SAAQA,WAAK;IAClC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;IAWK,SAAS,CAAC,GAAW;;YACzB,MAAM,MAAM,GAAG,WAAW,CAAC;;YAG3B,MAAM,SAAS,GAAGC,eAAS,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,SAAS,KAAK,QAAQ,EAAE;gBAC1B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,gEAAgE;oBACvE,IAAI,SAAS,KAAK,GAAG,EAAE,CAC1B,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,GAAG,GAAG,WAAW,EAAE,CAAC;;YAG7D,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/Fetch-d7540537.js.map b/dist/cjs/Fetch-d7540537.js.map index 3123270de..f6a6868f0 100644 --- a/dist/cjs/Fetch-d7540537.js.map +++ b/dist/cjs/Fetch-d7540537.js.map @@ -1 +1 @@ -{"version":3,"file":"Fetch-d7540537.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/utils/getTypeof.ts","../../src/utils/makeQueryString.ts","../../src/api/Fetch.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/**\r\n * @module utils/getTypeof\r\n * @category Utils\r\n */\r\n\r\n/**\r\n * Gets type of `value` using `Object.prototype.toString.call(value)`.\r\n *\r\n * @param {any} value - Any kind of value (string, object, array, function, etc).\r\n *\r\n * @returns {string} - Type of value, normalized to a lowercase string.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\r\nexport function getTypeof(value: any): string {\r\n const toString: string = Object.prototype.toString\r\n .call(value)\r\n .toLowerCase(); /* ex: => '[object string]' or '[object array], etc. */\r\n return toString.slice(8, toString.length - 1);\r\n}\r\n","import { getTypeof } from './getTypeof';\n\n/**\n * @module utils/makeQueryString\n * @category Utils\n */\n\n/**\n * Utility method to generate a query string compatible with the NHSTA API, for use in an API URL string.\n *\n * @async\n *\n * @param {object} params - Object of Type [QueryStringParameters](module-utils_makeQueryString.html#.QueryStringParameters).\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\n * - Given params of `{ paramName: \"\" }` , setting this to true will use 'paramName=' in the final query string.\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\n *\n * @returns {Promise} A query string of search parameters for use in a final Fetch.get URL.\n *\n * @example When loaded from the browser via html script tags\n * // \n * const qs = await NHTSA.makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example When loaded as a module\n * import { makeQueryString } from '@shaggytools/nhtsa-api-wrapper'\n * const qs = await makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example Single Param:\n * const qs = await makeQueryString({\n * modelYear: 2019\n * }).catch(error => error)\n * console.log(qs) // \"?modelYear=2019\"\n *\n * @example Multiple Params:\n * const qs = await makeQueryString({\n * whatever: 'some value',\n * modelYear: 2006,\n * page: \"2\"\n * }).catch(error => error)\n *\n * console.log(qs) // \"?whatever=some%20value&modelYear=2006&page=2\"\n *\n * @example Empty Params Object:\n * const qs = await makeQueryString({}).catch(error => error)\n *\n * console.log(qs) // \"\"\n *\n * @example Using allowEmptyStringValues option:\n * const qs = await makeQueryString({\n * year: 2016,\n * vehicleType: '',\n * make: 'Audi'\n * }, true).catch(error => error)\n *\n * console.log(qs) // \"?year=2016&vehicleType=&make=Audi\"\n *\n */\nexport function makeQueryString(\n params: QueryStringParameters = {},\n allowEmptyStringValues = false\n): Promise {\n /* Beginning of error message string */\n const errorBase =\n 'queryString(params) - expected params in the form of an object, got:';\n\n /* Runtime type guard params argument, must be of type object */\n if (getTypeof(params) !== 'object') {\n return Promise.reject(new Error(`${errorBase} ${params}`));\n }\n\n /* Setup QueryString for Array mapping */\n const entries = Object.entries(params);\n const paramsLength = entries.length;\n\n /* Return an empty string if params are an empty object */\n if (paramsLength < 1) return Promise.resolve('');\n\n /* Used to check if we've already prepended a valid query param */\n let isPrepended = false;\n\n /* Map [key]:value entries to \"key=value\" strings in an array */\n const queryStringArray = entries.map(([key, value], index) => {\n let prepend = '';\n let append = '';\n\n const typeofValue = getTypeof(value);\n\n /* Convert any number values to a string */\n if (value && typeofValue === 'number') {\n value = value.toString();\n }\n\n /* Skip any invalid values, only string and number value types are valid */\n if (\n (value || allowEmptyStringValues) &&\n (typeofValue === 'string' || typeofValue === 'number')\n ) {\n /* if this is the first param we need to prepend the '?' char */\n if (!isPrepended) {\n prepend = '?';\n isPrepended = true;\n }\n /* if there is another param coming after this one we need to append the '&' char */\n if (index < paramsLength - 1) {\n append = '&';\n }\n\n /* Add the completed partial query string to queryStringArray */\n return `${prepend}${key}=${value}${append}`;\n }\n return;\n });\n\n /* Join and return the completed query string after URI encoding */\n return Promise.resolve(encodeURI(queryStringArray.join('')));\n}\n\n/**\n * Object containing Key:Value pairs to build the URL query string with.\n * - Parameter values may be either strings or numbers.\n *\n * @memberof module:utils/makeQueryString\n * @alias QueryStringParameters\n * @example\n * {\n * modelYear: 2009,\n * whatever: 'something'\n * }\n *\n */\nexport type QueryStringParameters = {\n [propName: string]: string | number | undefined;\n};\n","/**\r\n * @module api/Fetch\r\n * @category API\r\n * @description API Fetch Logic.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [Fetch](module-api_Fetch.Fetch.html)\r\n * > - Constant: [BASE_URL](#~BASE_URL)\r\n * > - Constant: [DEFAULT_CONFIG](#~DEFAULT_CONFIG)\r\n * >\r\n * > **Types**\r\n * > - Type: [ApiResponse](#ApiResponse)\r\n * > - Type: [FetchConfig](#FetchConfig)\r\n * > - Type: [FetchRequestOptions](#FetchRequestOptions)\r\n * > - Type: [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body)\r\n * > - Type: [FetchResponse](#FetchResponse)\r\n * > - Type: [NhtsaResponse](#NhtsaResponse)\r\n */\r\n\r\n/* Module Dependencies */\r\nimport fetch from 'cross-fetch';\r\n/* Utilities */\r\nimport { getTypeof, makeQueryString } from '../utils';\r\n/* Types */\r\nimport { QueryStringParameters } from '../utils/types';\r\n\r\n/*****************\r\n * CONSTANTS\r\n ****************/\r\n\r\n/**\r\n * @constant {string} BASE_URL Default Fetch base URL string\r\n * @default 'https://vpic.nhtsa.dot.gov/api/vehicles'\r\n */\r\nexport const BASE_URL = 'https://vpic.nhtsa.dot.gov/api/vehicles';\r\n\r\n/**\r\n * @constant {module:api/Fetch.FetchConfig} DEFAULT_CONFIG Default Fetch configuration options\r\n * @property {string} apiResponseFormat=json\r\n * @property {string} baseUrl=BASE_URL Default: [BASE_URL](module-api_Fetch.html#~BASE_URL)\r\n * @property {FetchRequestOptions} options={method:\"GET\"}\r\n */\r\nexport const DEFAULT_CONFIG: FetchConfig = {\r\n apiResponseFormat: 'json',\r\n baseUrl: BASE_URL,\r\n options: {},\r\n};\r\n\r\n/*****************\r\n * Fetch Class\r\n ****************/\r\n\r\n/**\r\n * Class wrapper containing API wrapper HTTP Fetch logic.\r\n *\r\n * > **Static Methods**:\r\n * > - [buildQueryString](#buildQueryString)\r\n * > - [get](#get)\r\n *\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n * @category API\r\n */\r\nexport class Fetch {\r\n apiResponseFormat: string;\r\n baseUrl?: string;\r\n options?: FetchRequestOptions;\r\n\r\n constructor(userConfig?: FetchConfig) {\r\n let finalConfig: FetchConfig;\r\n\r\n /* userConfig takes precedence over DEFAULT_CONFIG */\r\n if (userConfig && getTypeof(userConfig) === 'object') {\r\n finalConfig = {\r\n ...DEFAULT_CONFIG,\r\n ...userConfig,\r\n options: { ...DEFAULT_CONFIG.options, ...userConfig.options },\r\n };\r\n } else {\r\n finalConfig = { ...DEFAULT_CONFIG };\r\n }\r\n\r\n /** @private */\r\n this.apiResponseFormat = 'json';\r\n /** @private */\r\n this.baseUrl = finalConfig.baseUrl;\r\n /** @private */\r\n this.options = finalConfig.options;\r\n }\r\n\r\n /**\r\n * Builds a query string from QueryStringParameters.\r\n *\r\n * @param {QueryStringParameters} params - Object containing Key:Value pairs to build the URL query string with.\r\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\r\n * - Given params of `{paramName: \"\"}` , setting this to true will use 'paramName=' in the final query string.\r\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\r\n * @returns {(Promise)} A formatted NHSTA.dot.gov Vehicles API query string.\r\n */\r\n async buildQueryString(\r\n params?: QueryStringParameters,\r\n allowEmptyStringValues = false\r\n ): Promise {\r\n /*\r\n * Make sure we're always using 'format=json' in the url Query parameters\r\n * If the user provides a 'format' key in the params, during class instantiation we want to override it to 'json'\r\n * This package may provide support for the other formats (CSV and XML) if requested.\r\n */\r\n if (!params || getTypeof(params) !== 'object') {\r\n params = {\r\n format: this.apiResponseFormat,\r\n };\r\n } else {\r\n params = { ...params, format: this.apiResponseFormat };\r\n }\r\n\r\n /* Return the completed query string */\r\n return await makeQueryString(params, allowEmptyStringValues);\r\n }\r\n\r\n /**\r\n * Uses the `cross-fetch` npm package to send HTTP requests and retrieve data from an API.\r\n * - In browser environments, [whatwg-fetch](https://github.com/github/fetch/) window.fetch is used.\r\n * - In node environments, [node-fetch](https://github.com/bitinn/node-fetch/) NPM package is used.\r\n *\r\n * @param {string} url - URL to fetch data from.\r\n * @param {FetchRequestOptions} [options] - [Fetch options](https://github.github.io/fetch/#options).\r\n * @returns {(Promise)} Response from the API.\r\n */\r\n async get(\r\n url: string,\r\n options: FetchRequestOptions = {}\r\n ): Promise {\r\n /* Runtime typechecking */\r\n const typeofUrl = getTypeof(url);\r\n if (typeofUrl !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `Fetch.get(url) - url argument must be of type string, got: ${typeofUrl}`\r\n )\r\n );\r\n }\r\n const typeofOptions = getTypeof(options);\r\n if (typeofOptions !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `Fetch.get(url, options) - options argument must be of type object, got: ${typeofOptions}`\r\n )\r\n );\r\n }\r\n\r\n /* Combine user provided 'options' and class property 'this.options', user options overwrite class options */\r\n const combinedOptions = { ...this.options, ...options };\r\n\r\n /* Use the cross-fetch package to perform an HTTP request */\r\n const response: Response = await fetch(url, combinedOptions)\r\n .then((result) => {\r\n if (!result?.status || result.status >= 400) {\r\n throw new Error(\r\n `Bad response from server, code: ${result?.status}, text: ${result?.statusText}, headers: ${result?.headers}`\r\n );\r\n } else return result;\r\n })\r\n .catch((err) =>\r\n Promise.reject(new Error(`Fetch.get() http error: ${err}`))\r\n );\r\n\r\n /* Convert the NHTSA API data to JSON */\r\n const NhtsaResponse: NhtsaResponse = await response\r\n .json()\r\n .then((json: NhtsaResponse): NhtsaResponse => json);\r\n\r\n /* Add the fetch response information to the returned NHSTA API data */\r\n const finalResult: ApiResponse = {\r\n ...NhtsaResponse,\r\n FetchResponse: {\r\n headers: response.headers,\r\n ok: response.ok,\r\n redirected: response.redirected,\r\n status: response.status,\r\n statusText: response.statusText,\r\n url: response.url,\r\n },\r\n };\r\n\r\n /* Return the completed ApiResponse */\r\n return Promise.resolve(finalResult);\r\n }\r\n}\r\n\r\n/*****************\r\n * Types\r\n ****************/\r\n\r\n/**\r\n * Various fetch request body types.\r\n *\r\n * @typedef FetchRequestBodyTypes\r\n * @type {URLSearchParams | FormData | Blob | ArrayBuffer | DataView}\r\n *\r\n * @memberof module:api/Fetch\r\n */\r\nexport type FetchRequestBodyTypes =\r\n | URLSearchParams\r\n | FormData\r\n | Blob\r\n | ArrayBuffer\r\n | DataView;\r\n\r\n/**\r\n * Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias FetchRequestOptions\r\n */\r\nexport type FetchRequestOptions = {\r\n /**HTTP request method - Default: \"GET\". */\r\n method?: string;\r\n /** HTTP request body - [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body). */\r\n body?: string | FetchRequestBodyTypes;\r\n /** [Object, Headers](https://github.github.io/fetch/#Headers) - Default: {}. */\r\n headers?: Record | Headers;\r\n /**\r\n * Default: \"omit\" - Authentication credentials mode.\r\n * - \"omit\" - don't include authentication credentials (e.g. Cookies) in the request.\r\n * - \"same-origin\" - include credentials in requests to the same site\r\n * - \"include\" - include credentials in requests to all sites.\r\n */\r\n credentials?: 'omit' | 'same-origin' | 'include';\r\n};\r\n\r\n/**\r\n * Used when instantiating a Fetch class or related subclass.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias FetchConfig\r\n */\r\nexport type FetchConfig = {\r\n /** Requested response format from the NHSTA API (hardcoded to 'json' for now). */\r\n apiResponseFormat?: string;\r\n /** Base of the URL to build fetch URLs from. */\r\n baseUrl?: string;\r\n /** Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}. */\r\n options?: FetchRequestOptions;\r\n};\r\n\r\n/**\r\n * [Fetch API Response](https://github.github.io/fetch/#Response) properties.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias FetchResponse\r\n */\r\nexport type FetchResponse = {\r\n /** The [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object associated with the response. */\r\n headers: Headers;\r\n /** A boolean indicating whether the response was successful (status in the range 200–299) or not. */\r\n ok: boolean;\r\n /** Indicates whether or not the response is the result of a redirect (that is, its URL list has more than one entry). */\r\n redirected: boolean;\r\n /** The status code of the response. (This will be 200 for a success). */\r\n status: number;\r\n /** The status message corresponding to the status code. (e.g., OK for 200). */\r\n statusText: string;\r\n /** The URL of the response. */\r\n url: string;\r\n};\r\n\r\n/**\r\n * Response data returned from the NHSTA API.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias NhtsaResponse\r\n */\r\nexport type NhtsaResponse = {\r\n /** The number of items returned in the Results object. */\r\n Count: number;\r\n /** A message describing the Results. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, etc) used in the request URL. */\r\n SearchCriteria: string;\r\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\r\n Results: Array;\r\n};\r\n\r\n/**\r\n * Complete response returned by {@link module:api/Fetch.Fetch#get}.\r\n *\r\n * @see {@link module:api/Fetch.NhtsaResponse}\r\n * @see {@link module:api/Fetch.FetchResponse}\r\n * @memberof module:api/Fetch\r\n * @alias ApiResponse\r\n */\r\nexport type ApiResponse = {\r\n /** The number of items returned in the Results object. */\r\n Count: number;\r\n /** A message describing the Results. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, etc) used in the request URL. */\r\n SearchCriteria: string;\r\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) Properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["fetch"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAqDA;AACO,SAAS,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AAC7D,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM,EAAE;AAC/D,QAAQ,SAAS,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;AACnG,QAAQ,SAAS,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;AACtG,QAAQ,SAAS,IAAI,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI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MAAM;gBACX,IAAI,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE;oBAC3C,MAAM,IAAI,KAAK,CACb,mCAAmC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,WAAW,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,cAAc,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,EAAE,CAC9G,CAAC;iBACH;;oBAAM,OAAO,MAAM,CAAC;aACtB,CAAC;iBACD,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC,CAC5D,CAAC;;YAGJ,MAAM,aAAa,GAAkB,MAAM,QAAQ;iBAChD,IAAI,EAAE;iBACN,IAAI,CAAC,CAAC,IAAmB,KAAoB,IAAI,CAAC,CAAC;;YAGtD,MAAM,WAAW,mCACZ,aAAa,KAChB,aAAa,EAAE;oBACb,OAAO,EAAE,QAAQ,CAAC,OAAO;oBACzB,EAAE,EAAE,QAAQ,CAAC,EAAE;oBACf,UAAU,EAAE,QAAQ,CAAC,UAAU;oBAC/B,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;oBAC/B,GAAG,EAAE,QAAQ,CAAC,GAAG;iBAClB,GACF,CAAC;;YAGF,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;SACrC;KAAA;;;;;;;"} \ No newline at end of file +{"version":3,"file":"Fetch-d7540537.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/utils/getTypeof.ts","../../src/utils/makeQueryString.ts","../../src/api/Fetch.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/**\n * @module utils/getTypeof\n * @category Utils\n */\n\n/**\n * Gets type of `value` using `Object.prototype.toString.call(value)`.\n *\n * @param {any} value - Any kind of value (string, object, array, function, etc).\n *\n * @returns {string} - Type of value, normalized to a lowercase string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTypeof(value: any): string {\n const toString: string = Object.prototype.toString\n .call(value)\n .toLowerCase(); /* ex: => '[object string]' or '[object array], etc. */\n return toString.slice(8, toString.length - 1);\n}\n","import { getTypeof } from './getTypeof';\n\n/**\n * @module utils/makeQueryString\n * @category Utils\n */\n\n/**\n * Utility method to generate a query string compatible with the NHSTA API, for use in an API URL string.\n *\n * @async\n *\n * @param {object} params - Object of Type [QueryStringParameters](module-utils_makeQueryString.html#.QueryStringParameters).\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\n * - Given params of `{ paramName: \"\" }` , setting this to true will use 'paramName=' in the final query string.\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\n *\n * @returns {Promise} A query string of search parameters for use in a final Fetch.get URL.\n *\n * @example When loaded from the browser via html script tags\n * // \n * const qs = await NHTSA.makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example When loaded as a module\n * import { makeQueryString } from '@shaggytools/nhtsa-api-wrapper'\n * const qs = await makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example Single Param:\n * const qs = await makeQueryString({\n * modelYear: 2019\n * }).catch(error => error)\n * console.log(qs) // \"?modelYear=2019\"\n *\n * @example Multiple Params:\n * const qs = await makeQueryString({\n * whatever: 'some value',\n * modelYear: 2006,\n * page: \"2\"\n * }).catch(error => error)\n *\n * console.log(qs) // \"?whatever=some%20value&modelYear=2006&page=2\"\n *\n * @example Empty Params Object:\n * const qs = await makeQueryString({}).catch(error => error)\n *\n * console.log(qs) // \"\"\n *\n * @example Using allowEmptyStringValues option:\n * const qs = await makeQueryString({\n * year: 2016,\n * vehicleType: '',\n * make: 'Audi'\n * }, true).catch(error => error)\n *\n * console.log(qs) // \"?year=2016&vehicleType=&make=Audi\"\n *\n */\nexport function makeQueryString(\n params: QueryStringParameters = {},\n allowEmptyStringValues = false\n): Promise {\n /* Beginning of error message string */\n const errorBase =\n 'queryString(params) - expected params in the form of an object, got:';\n\n /* Runtime type guard params argument, must be of type object */\n if (getTypeof(params) !== 'object') {\n return Promise.reject(new Error(`${errorBase} ${params}`));\n }\n\n /* Setup QueryString for Array mapping */\n const entries = Object.entries(params);\n const paramsLength = entries.length;\n\n /* Return an empty string if params are an empty object */\n if (paramsLength < 1) return Promise.resolve('');\n\n /* Used to check if we've already prepended a valid query param */\n let isPrepended = false;\n\n /* Map [key]:value entries to \"key=value\" strings in an array */\n const queryStringArray = entries.map(([key, value], index) => {\n let prepend = '';\n let append = '';\n\n const typeofValue = getTypeof(value);\n\n /* Convert any number values to a string */\n if (value && typeofValue === 'number') {\n value = value.toString();\n }\n\n /* Skip any invalid values, only string and number value types are valid */\n if (\n (value || allowEmptyStringValues) &&\n (typeofValue === 'string' || typeofValue === 'number')\n ) {\n /* if this is the first param we need to prepend the '?' char */\n if (!isPrepended) {\n prepend = '?';\n isPrepended = true;\n }\n /* if there is another param coming after this one we need to append the '&' char */\n if (index < paramsLength - 1) {\n append = '&';\n }\n\n /* Add the completed partial query string to queryStringArray */\n return `${prepend}${key}=${value}${append}`;\n }\n return;\n });\n\n /* Join and return the completed query string after URI encoding */\n return Promise.resolve(encodeURI(queryStringArray.join('')));\n}\n\n/**\n * Object containing Key:Value pairs to build the URL query string with.\n * - Parameter values may be either strings or numbers.\n *\n * @memberof module:utils/makeQueryString\n * @alias QueryStringParameters\n * @example\n * {\n * modelYear: 2009,\n * whatever: 'something'\n * }\n *\n */\nexport type QueryStringParameters = {\n [propName: string]: string | number | undefined;\n};\n","/**\n * @module api/Fetch\n * @category API\n * @description API Fetch Logic.\n *\n * > **Module Exports**:\n * > - Class: [Fetch](module-api_Fetch.Fetch.html)\n * > - Constant: [BASE_URL](#~BASE_URL)\n * > - Constant: [DEFAULT_CONFIG](#~DEFAULT_CONFIG)\n * >\n * > **Types**\n * > - Type: [ApiResponse](#ApiResponse)\n * > - Type: [FetchConfig](#FetchConfig)\n * > - Type: [FetchRequestOptions](#FetchRequestOptions)\n * > - Type: [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body)\n * > - Type: [FetchResponse](#FetchResponse)\n * > - Type: [NhtsaResponse](#NhtsaResponse)\n */\n\n/* Module Dependencies */\nimport fetch from 'cross-fetch';\n/* Utilities */\nimport { getTypeof, makeQueryString } from '../utils';\n/* Types */\nimport { QueryStringParameters } from '../utils/types';\n\n/*****************\n * CONSTANTS\n ****************/\n\n/**\n * @constant {string} BASE_URL Default Fetch base URL string\n * @default 'https://vpic.nhtsa.dot.gov/api/vehicles'\n */\nexport const BASE_URL = 'https://vpic.nhtsa.dot.gov/api/vehicles';\n\n/**\n * @constant {module:api/Fetch.FetchConfig} DEFAULT_CONFIG Default Fetch configuration options\n * @property {string} apiResponseFormat=json\n * @property {string} baseUrl=BASE_URL Default: [BASE_URL](module-api_Fetch.html#~BASE_URL)\n * @property {FetchRequestOptions} options={method:\"GET\"}\n */\nexport const DEFAULT_CONFIG: FetchConfig = {\n apiResponseFormat: 'json',\n baseUrl: BASE_URL,\n options: {},\n};\n\n/*****************\n * Fetch Class\n ****************/\n\n/**\n * Class wrapper containing API wrapper HTTP Fetch logic.\n *\n * > **Static Methods**:\n * > - [buildQueryString](#buildQueryString)\n * > - [get](#get)\n *\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n * @category API\n */\nexport class Fetch {\n apiResponseFormat: string;\n baseUrl?: string;\n options?: FetchRequestOptions;\n\n constructor(userConfig?: FetchConfig) {\n let finalConfig: FetchConfig;\n\n /* userConfig takes precedence over DEFAULT_CONFIG */\n if (userConfig && getTypeof(userConfig) === 'object') {\n finalConfig = {\n ...DEFAULT_CONFIG,\n ...userConfig,\n options: { ...DEFAULT_CONFIG.options, ...userConfig.options },\n };\n } else {\n finalConfig = { ...DEFAULT_CONFIG };\n }\n\n /** @private */\n this.apiResponseFormat = 'json';\n /** @private */\n this.baseUrl = finalConfig.baseUrl;\n /** @private */\n this.options = finalConfig.options;\n }\n\n /**\n * Builds a query string from QueryStringParameters.\n *\n * @param {QueryStringParameters} params - Object containing Key:Value pairs to build the URL query string with.\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\n * - Given params of `{paramName: \"\"}` , setting this to true will use 'paramName=' in the final query string.\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\n * @returns {(Promise)} A formatted NHSTA.dot.gov Vehicles API query string.\n */\n async buildQueryString(\n params?: QueryStringParameters,\n allowEmptyStringValues = false\n ): Promise {\n /*\n * Make sure we're always using 'format=json' in the url Query parameters\n * If the user provides a 'format' key in the params, during class instantiation we want to override it to 'json'\n * This package may provide support for the other formats (CSV and XML) if requested.\n */\n if (!params || getTypeof(params) !== 'object') {\n params = {\n format: this.apiResponseFormat,\n };\n } else {\n params = { ...params, format: this.apiResponseFormat };\n }\n\n /* Return the completed query string */\n return await makeQueryString(params, allowEmptyStringValues);\n }\n\n /**\n * Uses the `cross-fetch` npm package to send HTTP requests and retrieve data from an API.\n * - In browser environments, [whatwg-fetch](https://github.com/github/fetch/) window.fetch is used.\n * - In node environments, [node-fetch](https://github.com/bitinn/node-fetch/) NPM package is used.\n *\n * @param {string} url - URL to fetch data from.\n * @param {FetchRequestOptions} [options] - [Fetch options](https://github.github.io/fetch/#options).\n * @returns {(Promise)} Response from the API.\n */\n async get(\n url: string,\n options: FetchRequestOptions = {}\n ): Promise {\n /* Runtime typechecking */\n const typeofUrl = getTypeof(url);\n if (typeofUrl !== 'string') {\n return Promise.reject(\n new Error(\n `Fetch.get(url) - url argument must be of type string, got: ${typeofUrl}`\n )\n );\n }\n const typeofOptions = getTypeof(options);\n if (typeofOptions !== 'object') {\n return Promise.reject(\n new Error(\n `Fetch.get(url, options) - options argument must be of type object, got: ${typeofOptions}`\n )\n );\n }\n\n /* Combine user provided 'options' and class property 'this.options', user options overwrite class options */\n const combinedOptions = { ...this.options, ...options };\n\n /* Use the cross-fetch package to perform an HTTP request */\n const response: Response = await fetch(url, combinedOptions)\n .then((result) => {\n if (!result?.status || result.status >= 400) {\n throw new Error(\n `Bad response from server, code: ${result?.status}, text: ${result?.statusText}, headers: ${result?.headers}`\n );\n } else return result;\n })\n .catch((err) =>\n Promise.reject(new Error(`Fetch.get() http error: ${err}`))\n );\n\n /* Convert the NHTSA API data to JSON */\n const NhtsaResponse: NhtsaResponse = await response\n .json()\n .then((json: NhtsaResponse): NhtsaResponse => json);\n\n /* Add the fetch response information to the returned NHSTA API data */\n const finalResult: ApiResponse = {\n ...NhtsaResponse,\n FetchResponse: {\n headers: response.headers,\n ok: response.ok,\n redirected: response.redirected,\n status: response.status,\n statusText: response.statusText,\n url: response.url,\n },\n };\n\n /* Return the completed ApiResponse */\n return Promise.resolve(finalResult);\n }\n}\n\n/*****************\n * Types\n ****************/\n\n/**\n * Various fetch request body types.\n *\n * @typedef FetchRequestBodyTypes\n * @type {URLSearchParams | FormData | Blob | ArrayBuffer | DataView}\n *\n * @memberof module:api/Fetch\n */\nexport type FetchRequestBodyTypes =\n | URLSearchParams\n | FormData\n | Blob\n | ArrayBuffer\n | DataView;\n\n/**\n * Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}.\n *\n * @memberof module:api/Fetch\n * @alias FetchRequestOptions\n */\nexport type FetchRequestOptions = {\n /**HTTP request method - Default: \"GET\". */\n method?: string;\n /** HTTP request body - [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body). */\n body?: string | FetchRequestBodyTypes;\n /** [Object, Headers](https://github.github.io/fetch/#Headers) - Default: {}. */\n headers?: Record | Headers;\n /**\n * Default: \"omit\" - Authentication credentials mode.\n * - \"omit\" - don't include authentication credentials (e.g. Cookies) in the request.\n * - \"same-origin\" - include credentials in requests to the same site\n * - \"include\" - include credentials in requests to all sites.\n */\n credentials?: 'omit' | 'same-origin' | 'include';\n};\n\n/**\n * Used when instantiating a Fetch class or related subclass.\n *\n * @memberof module:api/Fetch\n * @alias FetchConfig\n */\nexport type FetchConfig = {\n /** Requested response format from the NHSTA API (hardcoded to 'json' for now). */\n apiResponseFormat?: string;\n /** Base of the URL to build fetch URLs from. */\n baseUrl?: string;\n /** Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}. */\n options?: FetchRequestOptions;\n};\n\n/**\n * [Fetch API Response](https://github.github.io/fetch/#Response) properties.\n *\n * @memberof module:api/Fetch\n * @alias FetchResponse\n */\nexport type FetchResponse = {\n /** The [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object associated with the response. */\n headers: Headers;\n /** A boolean indicating whether the response was successful (status in the range 200–299) or not. */\n ok: boolean;\n /** Indicates whether or not the response is the result of a redirect (that is, its URL list has more than one entry). */\n redirected: boolean;\n /** The status code of the response. (This will be 200 for a success). */\n status: number;\n /** The status message corresponding to the status code. (e.g., OK for 200). */\n statusText: string;\n /** The URL of the response. */\n url: string;\n};\n\n/**\n * Response data returned from the NHSTA API.\n *\n * @memberof module:api/Fetch\n * @alias NhtsaResponse\n */\nexport type NhtsaResponse = {\n /** The number of items returned in the Results object. */\n Count: number;\n /** A message describing the Results. */\n Message: string;\n /** Search terms (VIN, WMI, etc) used in the request URL. */\n SearchCriteria: string;\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\n Results: Array;\n};\n\n/**\n * Complete response returned by {@link module:api/Fetch.Fetch#get}.\n *\n * @see {@link module:api/Fetch.NhtsaResponse}\n * @see {@link module:api/Fetch.FetchResponse}\n * @memberof module:api/Fetch\n * @alias ApiResponse\n */\nexport type ApiResponse = {\n /** The number of items returned in the Results object. */\n Count: number;\n /** A message describing the Results. */\n Message: string;\n /** Search terms (VIN, WMI, etc) used in the request URL. */\n SearchCriteria: string;\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) Properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["fetch"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAqDA;AACO,SAAS,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AAC7D,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM,EAAE;AAC/D,QAAQ,SAAS,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;AACnG,QAAQ,SAAS,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;AACtG,QAAQ,SAAS,IAAI,CAAC,MAAM,EAAE,EAA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Aa,MAAMA,yBAAK,CAAC,GAAG,EAAE,eAAe,CAAC;iBACzD,IAAI,CAAC,CAAC,MAAM;gBACX,IAAI,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE;oBAC3C,MAAM,IAAI,KAAK,CACb,mCAAmC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,WAAW,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,cAAc,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,EAAE,CAC9G,CAAC;iBACH;;oBAAM,OAAO,MAAM,CAAC;aACtB,CAAC;iBACD,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC,CAC5D,CAAC;;YAGJ,MAAM,aAAa,GAAkB,MAAM,QAAQ;iBAChD,IAAI,EAAE;iBACN,IAAI,CAAC,CAAC,IAAmB,KAAoB,IAAI,CAAC,CAAC;;YAGtD,MAAM,WAAW,mCACZ,aAAa,KAChB,aAAa,EAAE;oBACb,OAAO,EAAE,QAAQ,CAAC,OAAO;oBACzB,EAAE,EAAE,QAAQ,CAAC,EAAE;oBACf,UAAU,EAAE,QAAQ,CAAC,UAAU;oBAC/B,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;oBAC/B,GAAG,EAAE,QAAQ,CAAC,GAAG;iBAClB,GACF,CAAC;;YAGF,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;SACrC;KAAA;;;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetAllMakes.js.map b/dist/cjs/GetAllMakes.js.map index f19358bfc..d8187fa8a 100644 --- a/dist/cjs/GetAllMakes.js.map +++ b/dist/cjs/GetAllMakes.js.map @@ -1 +1 @@ -{"version":3,"file":"GetAllMakes.js","sources":["../../src/api/actions/GetAllMakes.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetAllMakes\r\n * @category Actions\r\n * @description GetAllMakes NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetAllMakes](module-api_actions_GetAllMakes.GetAllMakes.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetAllMakesResponse](#GetAllMakesResponse)\r\n * > - Type: [GetAllMakesResults](#GetAllMakesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetAllMakes extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Makes available in the vPIC Dataset.\r\n *\r\n * @async\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetAllMakes(): Promise {\r\n const action = 'GetAllMakes';\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetAllMakesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetAllMakes\r\n * @alias GetAllMakesResults\r\n */\r\nexport type GetAllMakesResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetAllMakes API Action.\r\n *\r\n * @memberof module:api/actions/GetAllMakes\r\n * @alias GetAllMakesResponse\r\n */\r\nexport type GetAllMakesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAqBA;;;;;;;;MAQa,WAAY,SAAQA,WAAK;IACpC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;IAQY,WAAW;;YACtB,MAAM,MAAM,GAAG,aAAa,CAAC;;YAG7B,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGtD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetAllMakes.js","sources":["../../src/api/actions/GetAllMakes.ts"],"sourcesContent":["/**\n * @module api/actions/GetAllMakes\n * @category Actions\n * @description GetAllMakes NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetAllMakes](module-api_actions_GetAllMakes.GetAllMakes.html)\n * >\n * > **Types**\n * > - Type: [GetAllMakesResponse](#GetAllMakesResponse)\n * > - Type: [GetAllMakesResults](#GetAllMakesResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetAllMakes extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the Makes available in the vPIC Dataset.\n *\n * @async\n * @returns {(Promise)} Api Response object.\n */\n public async GetAllMakes(): Promise {\n const action = 'GetAllMakes';\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetAllMakesResponse}.Results' array.\n *\n * @memberof module:api/actions/GetAllMakes\n * @alias GetAllMakesResults\n */\nexport type GetAllMakesResults = {\n Make_ID: number;\n Make_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetAllMakes API Action.\n *\n * @memberof module:api/actions/GetAllMakes\n * @alias GetAllMakesResponse\n */\nexport type GetAllMakesResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAqBA;;;;;;;;MAQa,WAAY,SAAQA,WAAK;IACpC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;IAQY,WAAW;;YACtB,MAAM,MAAM,GAAG,aAAa,CAAC;;YAG7B,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGtD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetAllManufacturers.js.map b/dist/cjs/GetAllManufacturers.js.map index 09e09a417..16a0e5dbc 100644 --- a/dist/cjs/GetAllManufacturers.js.map +++ b/dist/cjs/GetAllManufacturers.js.map @@ -1 +1 @@ -{"version":3,"file":"GetAllManufacturers.js","sources":["../../src/api/actions/GetAllManufacturers.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetAllManufacturers\r\n * @category Actions\r\n * @description GetAllManufacturers NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetAllManufacturers](module-api_actions_GetAllManufacturers.GetAllManufacturers.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetAllManufacturersResponse](#GetAllManufacturersResponse)\r\n * > - Type: [GetAllManufacturersResults](#GetAllManufacturersResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetAllManufacturers extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Manufacturers available in vPIC Dataset.\r\n * - `params.manufacturerType` allows the user to filter the list based on manufacturer type,\r\n * ('Incomplete Vehicles', 'Completed Vehicle Manufacturer', 'Incomplete Vehicle Manufacturer',\r\n * 'Intermediate Manufacturer', 'Final-Stage Manufacturer', 'Alterer', or any partial match of those strings).\r\n * - You can get a list of all manufacturer types with the following API Action:\r\n * `GetVehicleVariableValuesList('manufacturer type')`\r\n * - Results are provided in pages of 100 items.\r\n * - Provide a number value for `params.page` to specify 1st (default), 2nd, 3rd, Nth, etc page.\r\n *\r\n * @async\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string} [params.manufacturerType] - See method description.\r\n * @param {number} [params.page] - Specify the page number (results returned 100 at a time).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetAllManufacturers(\r\n params: {\r\n manufacturerType?: string;\r\n page?: number;\r\n } = {}\r\n ): Promise {\r\n const action = 'GetAllManufacturers';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofManufacturerType = getTypeof(params.manufacturerType);\r\n if (params.manufacturerType && typeofManufacturerType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.manufacturerType\" argument must be of type string, got: ` +\r\n `<${typeofManufacturerType}> ${params.manufacturerType}`\r\n )\r\n );\r\n }\r\n\r\n const typeofPage = getTypeof(params.page);\r\n if (params.page && typeofPage !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.page\" argument must be of type number, got: ` +\r\n `<${typeofPage}> ${params.page}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetAllManufacturersResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetAllManufacturers\r\n * @alias GetAllManufacturersResults\r\n */\r\nexport type GetAllManufacturersResults = {\r\n Country: string;\r\n Mfr_CommonName: string;\r\n Mfr_ID: number;\r\n Mfr_Name: string;\r\n VehicleTypes: Array<{ isPrimary?: boolean; name?: string }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetAllManufacturers API Action.\r\n *\r\n * @memberof module:api/actions/GetAllManufacturers\r\n * @alias GetAllManufacturersResponse\r\n */\r\nexport type GetAllManufacturersResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,mBAAoB,SAAQA,WAAK;IAC5C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;IAkBK,mBAAmB,CACvB,SAGI,EAAE;;YAEN,MAAM,MAAM,GAAG,qBAAqB,CAAC;;YAGrC,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,YAAY,KAAK,QAAQ,EAAE;gBAC7B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mDAAmD;oBAC1D,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;YAED,MAAM,sBAAsB,GAAGA,eAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAClE,IAAI,MAAM,CAAC,gBAAgB,IAAI,sBAAsB,KAAK,QAAQ,EAAE;gBAClE,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,oEAAoE;oBAC3E,IAAI,sBAAsB,KAAK,MAAM,CAAC,gBAAgB,EAAE,CAC3D,CACF,CAAC;aACH;YAED,MAAM,UAAU,GAAGA,eAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC1C,IAAI,MAAM,CAAC,IAAI,IAAI,UAAU,KAAK,QAAQ,EAAE;gBAC1C,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,wDAAwD;oBAC/D,IAAI,UAAU,KAAK,MAAM,CAAC,IAAI,EAAE,CACnC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAChE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGtD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetAllManufacturers.js","sources":["../../src/api/actions/GetAllManufacturers.ts"],"sourcesContent":["/**\n * @module api/actions/GetAllManufacturers\n * @category Actions\n * @description GetAllManufacturers NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetAllManufacturers](module-api_actions_GetAllManufacturers.GetAllManufacturers.html)\n * >\n * > **Types**\n * > - Type: [GetAllManufacturersResponse](#GetAllManufacturersResponse)\n * > - Type: [GetAllManufacturersResults](#GetAllManufacturersResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetAllManufacturers extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the Manufacturers available in vPIC Dataset.\n * - `params.manufacturerType` allows the user to filter the list based on manufacturer type,\n * ('Incomplete Vehicles', 'Completed Vehicle Manufacturer', 'Incomplete Vehicle Manufacturer',\n * 'Intermediate Manufacturer', 'Final-Stage Manufacturer', 'Alterer', or any partial match of those strings).\n * - You can get a list of all manufacturer types with the following API Action:\n * `GetVehicleVariableValuesList('manufacturer type')`\n * - Results are provided in pages of 100 items.\n * - Provide a number value for `params.page` to specify 1st (default), 2nd, 3rd, Nth, etc page.\n *\n * @async\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string} [params.manufacturerType] - See method description.\n * @param {number} [params.page] - Specify the page number (results returned 100 at a time).\n * @returns {(Promise)} Api Response object.\n */\n async GetAllManufacturers(\n params: {\n manufacturerType?: string;\n page?: number;\n } = {}\n ): Promise {\n const action = 'GetAllManufacturers';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofManufacturerType = getTypeof(params.manufacturerType);\n if (params.manufacturerType && typeofManufacturerType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.manufacturerType\" argument must be of type string, got: ` +\n `<${typeofManufacturerType}> ${params.manufacturerType}`\n )\n );\n }\n\n const typeofPage = getTypeof(params.page);\n if (params.page && typeofPage !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.page\" argument must be of type number, got: ` +\n `<${typeofPage}> ${params.page}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetAllManufacturersResponse}.Results' array.\n *\n * @memberof module:api/actions/GetAllManufacturers\n * @alias GetAllManufacturersResults\n */\nexport type GetAllManufacturersResults = {\n Country: string;\n Mfr_CommonName: string;\n Mfr_ID: number;\n Mfr_Name: string;\n VehicleTypes: Array<{ isPrimary?: boolean; name?: string }>;\n};\n\n/**\n * Type representing the complete response returned by the GetAllManufacturers API Action.\n *\n * @memberof module:api/actions/GetAllManufacturers\n * @alias GetAllManufacturersResponse\n */\nexport type GetAllManufacturersResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,mBAAoB,SAAQA,WAAK;IAC5C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;IAkBK,mBAAmB,CACvB,SAGI,EAAE;;YAEN,MAAM,MAAM,GAAG,qBAAqB,CAAC;;YAGrC,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,YAAY,KAAK,QAAQ,EAAE;gBAC7B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mDAAmD;oBAC1D,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;YAED,MAAM,sBAAsB,GAAGA,eAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAClE,IAAI,MAAM,CAAC,gBAAgB,IAAI,sBAAsB,KAAK,QAAQ,EAAE;gBAClE,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,oEAAoE;oBAC3E,IAAI,sBAAsB,KAAK,MAAM,CAAC,gBAAgB,EAAE,CAC3D,CACF,CAAC;aACH;YAED,MAAM,UAAU,GAAGA,eAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC1C,IAAI,MAAM,CAAC,IAAI,IAAI,UAAU,KAAK,QAAQ,EAAE;gBAC1C,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,wDAAwD;oBAC/D,IAAI,UAAU,KAAK,MAAM,CAAC,IAAI,EAAE,CACnC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAChE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGtD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetCanadianVehicleSpecifications.js.map b/dist/cjs/GetCanadianVehicleSpecifications.js.map index b594569fc..1a4431019 100644 --- a/dist/cjs/GetCanadianVehicleSpecifications.js.map +++ b/dist/cjs/GetCanadianVehicleSpecifications.js.map @@ -1 +1 @@ -{"version":3,"file":"GetCanadianVehicleSpecifications.js","sources":["../../src/api/actions/GetCanadianVehicleSpecifications.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetCanadianVehicleSpecifications\r\n * @category Actions\r\n * @description GetCanadianVehicleSpecifications NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetCanadianVehicleSpecifications](module-api_actions_GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetCanadianVehicleSpecificationsResponse](#GetCanadianVehicleSpecificationsResponse)\r\n * > - Type: [GetCanadianVehicleSpecificationsResults](#GetCanadianVehicleSpecificationsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetCanadianVehicleSpecifications extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The Canadian Vehicle Specifications (CVS) consists of a database of original vehicle dimensions,\r\n * used primarily in collision investigation and reconstruction, combined with a search engine.\r\n *\r\n * The database is compiled annually by the Collision Investigation and Research Division of Transport Canada.\r\n * Visit official [Canadian Vehicle Specifications](http://www.carsp.ca/research/resources/safety-sources/canadian-vehicle-specifications/)\r\n * page for more details.\r\n *\r\n * This API action will return a 404 html error if any of the query parameters in params\r\n * are missing from the query string. This is the only API action with this behaviour. Therefore,\r\n * parameters are inserted into the query string as empty strings if not provided by the user.\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle (required) - Number, >= 1971.\r\n * @param {string} [params.make] - Vehicle's make, like \"Honda\", \"Toyota\", etc...\r\n * @param {string} [params.model] - Vehicle's model, like \"Pilot\", \"Focus\". Can also include some other elements like Body Type, Engine Model/size, etc...\r\n * @param {string} [params.units] - \"Metric\" (default), or \"US\" for United States customary units.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetCanadianVehicleSpecifications(params: {\r\n year: number;\r\n make?: string;\r\n model?: string;\r\n units?: string;\r\n }): Promise {\r\n const action = 'GetCanadianVehicleSpecifications';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n const typeofMake = getTypeof(params.make);\r\n if (params.make && typeofMake !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.make\" argument must be of type string, got: ` +\r\n `<${typeofMake}> ${params.make}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModel = getTypeof(params.model);\r\n if (params.model && typeofModel !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.model\" argument must be of type string, got: ` +\r\n `<${typeofModel}> ${params.model}`\r\n )\r\n );\r\n }\r\n\r\n const typeofUnits = getTypeof(params.units);\r\n if (params.units && typeofUnits !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.units\" argument must be of type string, got: ` +\r\n `<${typeofUnits}> ${params.units}`\r\n )\r\n );\r\n }\r\n\r\n /* Set default query parameters to empty strings if not provided by the user */\r\n const make = params.make || '';\r\n const model = params.model || '';\r\n const units = params.units || '';\r\n\r\n const params_ = {\r\n year: params.year,\r\n make,\r\n model,\r\n units,\r\n };\r\n\r\n /*\r\n * Build the 'default' query string to be appended to the URL.\r\n *\r\n * Additionally, sets the allowEmptyStringValues option (2nd argument) to true because\r\n * this API action will return a 404 error if any of the query parameters are missing from the query string.\r\n * This is the only API action with this behaviour (\"year\" is the only param the user must provide).\r\n */\r\n const queryString = await this.buildQueryString(\r\n params_,\r\n true\r\n ).catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetCanadianVehicleSpecificationsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\r\n * @alias GetCanadianVehicleSpecificationsResults\r\n */\r\nexport type GetCanadianVehicleSpecificationsResults = {\r\n Specs: Array<{\r\n Name: string;\r\n Value: string;\r\n }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetCanadianVehicleSpecifications API Action.\r\n *\r\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\r\n * @alias GetCanadianVehicleSpecificationsResponse\r\n */\r\nexport type GetCanadianVehicleSpecificationsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,gCAAiC,SAAQA,WAAK;IACzD,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;;;;IAsBK,gCAAgC,CAAC,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AAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,yDAAyD;oBAChE,IAAI,WAAW,KAAK,MAAM,CAAC,KAAK,EAAE,CACrC,CACF,CAAC;aACH;;YAGD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;YACjC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;YAEjC,MAAM,OAAO,GAAG;gBACd,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,IAAI;gBACJ,KAAK;gBACL,KAAK;aACN,CAAC;;;;;;;;YASF,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAC7C,OAAO,EACP,IAAI,CACL,CAAC,KAAK,CAAC,CAAC,GAAU,KACjB,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGtD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAU,KAChB,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetCanadianVehicleSpecifications.js","sources":["../../src/api/actions/GetCanadianVehicleSpecifications.ts"],"sourcesContent":["/**\n * @module api/actions/GetCanadianVehicleSpecifications\n * @category Actions\n * @description GetCanadianVehicleSpecifications NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetCanadianVehicleSpecifications](module-api_actions_GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications.html)\n * >\n * > **Types**\n * > - Type: [GetCanadianVehicleSpecificationsResponse](#GetCanadianVehicleSpecificationsResponse)\n * > - Type: [GetCanadianVehicleSpecificationsResults](#GetCanadianVehicleSpecificationsResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetCanadianVehicleSpecifications extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * The Canadian Vehicle Specifications (CVS) consists of a database of original vehicle dimensions,\n * used primarily in collision investigation and reconstruction, combined with a search engine.\n *\n * The database is compiled annually by the Collision Investigation and Research Division of Transport Canada.\n * Visit official [Canadian Vehicle Specifications](http://www.carsp.ca/research/resources/safety-sources/canadian-vehicle-specifications/)\n * page for more details.\n *\n * This API action will return a 404 html error if any of the query parameters in params\n * are missing from the query string. This is the only API action with this behaviour. Therefore,\n * parameters are inserted into the query string as empty strings if not provided by the user.\n *\n * @async\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.year - Model year of the vehicle (required) - Number, >= 1971.\n * @param {string} [params.make] - Vehicle's make, like \"Honda\", \"Toyota\", etc...\n * @param {string} [params.model] - Vehicle's model, like \"Pilot\", \"Focus\". Can also include some other elements like Body Type, Engine Model/size, etc...\n * @param {string} [params.units] - \"Metric\" (default), or \"US\" for United States customary units.\n * @returns {(Promise)} Api Response object.\n */\n async GetCanadianVehicleSpecifications(params: {\n year: number;\n make?: string;\n model?: string;\n units?: string;\n }): Promise {\n const action = 'GetCanadianVehicleSpecifications';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofYear = getTypeof(params.year);\n if (typeofYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\n `<${typeofYear}> ${params.year}`\n )\n );\n }\n\n const typeofMake = getTypeof(params.make);\n if (params.make && typeofMake !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.make\" argument must be of type string, got: ` +\n `<${typeofMake}> ${params.make}`\n )\n );\n }\n\n const typeofModel = getTypeof(params.model);\n if (params.model && typeofModel !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.model\" argument must be of type string, got: ` +\n `<${typeofModel}> ${params.model}`\n )\n );\n }\n\n const typeofUnits = getTypeof(params.units);\n if (params.units && typeofUnits !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.units\" argument must be of type string, got: ` +\n `<${typeofUnits}> ${params.units}`\n )\n );\n }\n\n /* Set default query parameters to empty strings if not provided by the user */\n const make = params.make || '';\n const model = params.model || '';\n const units = params.units || '';\n\n const params_ = {\n year: params.year,\n make,\n model,\n units,\n };\n\n /*\n * Build the 'default' query string to be appended to the URL.\n *\n * Additionally, sets the allowEmptyStringValues option (2nd argument) to true because\n * this API action will return a 404 error if any of the query parameters are missing from the query string.\n * This is the only API action with this behaviour (\"year\" is the only param the user must provide).\n */\n const queryString = await this.buildQueryString(\n params_,\n true\n ).catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetCanadianVehicleSpecificationsResponse}.Results' array.\n *\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\n * @alias GetCanadianVehicleSpecificationsResults\n */\nexport type GetCanadianVehicleSpecificationsResults = {\n Specs: Array<{\n Name: string;\n Value: string;\n }>;\n};\n\n/**\n * Type representing the complete response returned by the GetCanadianVehicleSpecifications API Action.\n *\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\n * @alias GetCanadianVehicleSpecificationsResponse\n */\nexport type GetCanadianVehicleSpecificationsResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,gCAAiC,SAAQA,WAAK;IACzD,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;;;;IAsBK,gCAAgC,CAAC,MAKtC;;YACC,MAAM,MAAM,GAAG,kCAAkC,CAAC;;YAGlD,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,YAAY,KAAK,QAAQ,EAAE;gBAC7B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mDAAmD;oBAC1D,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;YAED,MAAM,UAAU,GAAGA,eAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC1C,IAAI,UAAU,KAAK,QAAQ,EAAE;gBAC3B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,wEAAwE;oBAC/E,IAAI,UAAU,KAAK,MAAM,CAAC,IAAI,EAAE,CACnC,CACF,CAAC;aACH;YAED,MAAM,U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OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGtD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAU,KAChB,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetEquipmentPlantCodes.js.map b/dist/cjs/GetEquipmentPlantCodes.js.map index 80b8d75f2..16926d6cc 100644 --- a/dist/cjs/GetEquipmentPlantCodes.js.map +++ b/dist/cjs/GetEquipmentPlantCodes.js.map @@ -1 +1 @@ -{"version":3,"file":"GetEquipmentPlantCodes.js","sources":["../../src/api/actions/GetEquipmentPlantCodes.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetEquipmentPlantCodes\r\n * @category Actions\r\n * @description GetEquipmentPlantCodes NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetEquipmentPlantCodes](module-api_actions_GetEquipmentPlantCodes.GetEquipmentPlantCodes.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetEquipmentPlantCodesResponse](#GetEquipmentPlantCodesResponse)\r\n * > - Type: [GetEquipmentPlantCodesResults](#GetEquipmentPlantCodesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetEquipmentPlantCodes extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * Returns assigned Equipment Plant Codes. Can be filtered by Year, Equipment Type and Report Type.\r\n *\r\n * `params.year`:\r\n * - Only years >= 2016 are supported\r\n *\r\n * `params.equipmentType`:\r\n * - 1 (Tires)\r\n * - 3 (Brake Hoses)\r\n * - 13 (Glazing)\r\n * - 16 (Retread)\r\n *\r\n * `params.reportType`:\r\n * - 'New' (The Equipment Plant Code was assigned during the selected year).\r\n * - 'Updated' (The Equipment Plant data was modified during the selected year).\r\n * - 'Closed' (The Equipment Plant is no longer Active).\r\n * - 'All' (All Equipment Plant Codes regardless of year, including their status (active or closed)).\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\r\n * @param {number} params.equipmentType - Number equal to 1, 3, 13, or 16.\r\n * @param {string} params.reportType - 'New', 'Updated', 'Closed', or 'All'.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetEquipmentPlantCodes(params: {\r\n year: number;\r\n equipmentType: 1 | 3 | 13 | 16;\r\n reportType: 'New' | 'Updated' | 'Closed' | 'All';\r\n }): Promise {\r\n const action = 'GetEquipmentPlantCodes';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n const typeofEquipmentType = getTypeof(params.equipmentType);\r\n if (typeofEquipmentType !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.equipmentType\" argument is required and must be of type number, got: ` +\r\n `<${typeofEquipmentType}> ${params.equipmentType}`\r\n )\r\n );\r\n }\r\n\r\n const typeofReportType = getTypeof(params.reportType);\r\n if (typeofReportType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.reportType\" argument is required and must be of type string, got: ` +\r\n `<${typeofReportType}> ${params.reportType}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetEquipmentPlantCodesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetEquipmentPlantCodes\r\n * @alias GetEquipmentPlantCodesResults\r\n */\r\nexport type GetEquipmentPlantCodesResults = {\r\n Address: string;\r\n City: string;\r\n Country: string;\r\n DOTCode: string;\r\n Name: string;\r\n OldDotCode: string;\r\n PostalCode: string;\r\n StateProvince: string;\r\n Status: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetEquipmentPlantCodes API Action.\r\n *\r\n * @memberof module:api/actions/GetEquipmentPlantCodes\r\n * @alias GetEquipmentPlantCodesResponse\r\n */\r\nexport type GetEquipmentPlantCodesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;;;;;;;;;IA2BY,sBAAsB,CAAC,MAInC;;YACC,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,YAAY,KAAK,QAAQ,EAAE;gBAC7B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mDAAmD;oBAC1D,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;YAED,MAAM,UAAU,GAAGA,eAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC1C,IAAI,UAAU,KAAK,QAAQ,EAAE;gBAC3B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,wEAAwE;oBAC/E,IAAI,UAAU,KAAK,MAAM,CAAC,IAAI,EAAE,CACnC,CACF,CAAC;aACH;YAED,MAAM,mBAAmB,GAAGA,eAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAC5D,IAAI,mBAAmB,KAAK,QAAQ,EAAE;gBACpC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,iFAAiF;oBACxF,IAAI,mBAAmB,KAAK,MAAM,CAAC,aAAa,EAAE,CACrD,CACF,CAAC;aACH;YAED,MAAM,gBAAgB,GAAGA,eAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACtD,IAAI,gBAAgB,KAAK,QAAQ,EAAE;gBACjC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,8EAA8E;oBACrF,IAAI,gBAAgB,KAAK,MAAM,CAAC,UAAU,EAAE,CAC/C,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAChE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGtD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetEquipmentPlantCodes.js","sources":["../../src/api/actions/GetEquipmentPlantCodes.ts"],"sourcesContent":["/**\n * @module api/actions/GetEquipmentPlantCodes\n * @category Actions\n * @description GetEquipmentPlantCodes NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetEquipmentPlantCodes](module-api_actions_GetEquipmentPlantCodes.GetEquipmentPlantCodes.html)\n * >\n * > **Types**\n * > - Type: [GetEquipmentPlantCodesResponse](#GetEquipmentPlantCodesResponse)\n * > - Type: [GetEquipmentPlantCodesResults](#GetEquipmentPlantCodesResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetEquipmentPlantCodes extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * Returns assigned Equipment Plant Codes. Can be filtered by Year, Equipment Type and Report Type.\n *\n * `params.year`:\n * - Only years >= 2016 are supported\n *\n * `params.equipmentType`:\n * - 1 (Tires)\n * - 3 (Brake Hoses)\n * - 13 (Glazing)\n * - 16 (Retread)\n *\n * `params.reportType`:\n * - 'New' (The Equipment Plant Code was assigned during the selected year).\n * - 'Updated' (The Equipment Plant data was modified during the selected year).\n * - 'Closed' (The Equipment Plant is no longer Active).\n * - 'All' (All Equipment Plant Codes regardless of year, including their status (active or closed)).\n *\n * @async\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\n * @param {number} params.equipmentType - Number equal to 1, 3, 13, or 16.\n * @param {string} params.reportType - 'New', 'Updated', 'Closed', or 'All'.\n * @returns {(Promise)} Api Response object.\n */\n public async GetEquipmentPlantCodes(params: {\n year: number;\n equipmentType: 1 | 3 | 13 | 16;\n reportType: 'New' | 'Updated' | 'Closed' | 'All';\n }): Promise {\n const action = 'GetEquipmentPlantCodes';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofYear = getTypeof(params.year);\n if (typeofYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\n `<${typeofYear}> ${params.year}`\n )\n );\n }\n\n const typeofEquipmentType = getTypeof(params.equipmentType);\n if (typeofEquipmentType !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.equipmentType\" argument is required and must be of type number, got: ` +\n `<${typeofEquipmentType}> ${params.equipmentType}`\n )\n );\n }\n\n const typeofReportType = getTypeof(params.reportType);\n if (typeofReportType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.reportType\" argument is required and must be of type string, got: ` +\n `<${typeofReportType}> ${params.reportType}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetEquipmentPlantCodesResponse}.Results' array.\n *\n * @memberof module:api/actions/GetEquipmentPlantCodes\n * @alias GetEquipmentPlantCodesResults\n */\nexport type GetEquipmentPlantCodesResults = {\n Address: string;\n City: string;\n Country: string;\n DOTCode: string;\n Name: string;\n OldDotCode: string;\n PostalCode: string;\n StateProvince: string;\n Status: string;\n};\n\n/**\n * Type representing the complete response returned by the GetEquipmentPlantCodes API Action.\n *\n * @memberof module:api/actions/GetEquipmentPlantCodes\n * @alias GetEquipmentPlantCodesResponse\n */\nexport type GetEquipmentPlantCodesResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;;;;;;;;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C,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGtD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetMakeForManufacturer.js.map b/dist/cjs/GetMakeForManufacturer.js.map index 715a90797..1f744928a 100644 --- a/dist/cjs/GetMakeForManufacturer.js.map +++ b/dist/cjs/GetMakeForManufacturer.js.map @@ -1 +1 @@ -{"version":3,"file":"GetMakeForManufacturer.js","sources":["../../src/api/actions/GetMakeForManufacturer.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetMakeForManufacturer\r\n * @category Actions\r\n * @description GetMakeForManufacturer NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakeForManufacturer](module-api_actions_GetMakeForManufacturer.GetMakeForManufacturer.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakeForManufacturerResponse](#GetMakeForManufacturerResponse)\r\n * > - Type: [GetMakeForManufacturerResults](#GetMakeForManufacturerResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakeForManufacturer extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified manufacturer that is requested.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\r\n * (it accepts a partial manufacturer name as an input).\r\n * - `manufacturer` name can be a partial name, or a full name for more specificity\r\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\r\n * - Multiple results are returned in case of multiple matches.\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetMakeForManufacturer(\r\n manufacturer: string | number\r\n ): Promise {\r\n const action = 'GetMakeForManufacturer';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakeForManufacturerResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakeForManufacturer\r\n * @alias GetMakeForManufacturerResults\r\n */\r\nexport type GetMakeForManufacturerResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Mfr_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakeForManufacturer API Action.\r\n *\r\n * @memberof module:api/actions/GetMakeForManufacturer\r\n * @alias GetMakeForManufacturerResponse\r\n */\r\nexport type GetMakeForManufacturerResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;IAeK,sBAAsB,CAC1B,YAA6B;;YAE7B,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,kBAAkB,GAAGC,eAAS,CAAC,YAAY,CAAC,CAAC;YACnD,IAAI,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,KAAK,QAAQ,EAAE;gBACtE,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mFAAmF;oBAC1F,IAAI,kBAAkB,KAAK,YAAY,EAAE,CAC5C,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,YAAY,GAAG,WAAW,EAAE,CAAC;;YAGtE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetMakeForManufacturer.js","sources":["../../src/api/actions/GetMakeForManufacturer.ts"],"sourcesContent":["/**\n * @module api/actions/GetMakeForManufacturer\n * @category Actions\n * @description GetMakeForManufacturer NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetMakeForManufacturer](module-api_actions_GetMakeForManufacturer.GetMakeForManufacturer.html)\n * >\n * > **Types**\n * > - Type: [GetMakeForManufacturerResponse](#GetMakeForManufacturerResponse)\n * > - Type: [GetMakeForManufacturerResults](#GetMakeForManufacturerResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetMakeForManufacturer extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Makes in the vPIC dataset for a specified manufacturer that is requested.\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\n * (it accepts a partial manufacturer name as an input).\n * - `manufacturer` name can be a partial name, or a full name for more specificity\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\n * - Multiple results are returned in case of multiple matches.\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\n * @returns {(Promise)} Api Response object.\n */\n async GetMakeForManufacturer(\n manufacturer: string | number\n ): Promise {\n const action = 'GetMakeForManufacturer';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetMakeForManufacturerResponse}.Results' array.\n *\n * @memberof module:api/actions/GetMakeForManufacturer\n * @alias GetMakeForManufacturerResults\n */\nexport type GetMakeForManufacturerResults = {\n Make_ID: number;\n Make_Name: string;\n Mfr_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetMakeForManufacturer API Action.\n *\n * @memberof module:api/actions/GetMakeForManufacturer\n * @alias GetMakeForManufacturerResponse\n */\nexport type GetMakeForManufacturerResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;IAeK,sBAAsB,CAC1B,YAA6B;;YAE7B,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,kBAAkB,GAAGC,eAAS,CAAC,YAAY,CAAC,CAAC;YACnD,IAAI,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,KAAK,QAAQ,EAAE;gBACtE,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mFAAmF;oBAC1F,IAAI,kBAAkB,KAAK,YAAY,EAAE,CAC5C,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,YAAY,GAAG,WAAW,EAAE,CAAC;;YAGtE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetMakesForManufacturerAndYear.js.map b/dist/cjs/GetMakesForManufacturerAndYear.js.map index aba218c34..7f8a404b6 100644 --- a/dist/cjs/GetMakesForManufacturerAndYear.js.map +++ b/dist/cjs/GetMakesForManufacturerAndYear.js.map @@ -1 +1 @@ -{"version":3,"file":"GetMakesForManufacturerAndYear.js","sources":["../../src/api/actions/GetMakesForManufacturerAndYear.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetMakesForManufacturerAndYear\r\n * @category Actions\r\n * @description GetMakesForManufacturerAndYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakesForManufacturerAndYear](module-api_actions_GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakesForManufacturerAndYearResponse](#GetMakesForManufacturerAndYearResponse)\r\n * > - Type: [GetMakesForManufacturerAndYearResults](#GetMakesForManufacturerAndYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakesForManufacturerAndYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified manufacturer,\r\n * and whose Year From and Year To range cover the specified year.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\r\n * (it accepts a partial manufacturer name as an input).\r\n * - Multiple results are returned in case of multiple matches.\r\n * - Manufacturer can be idenfitied by Id, a partial name, or a full name\r\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\r\n *\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetMakesForManufacturerAndYear(\r\n manufacturer: string | number,\r\n params: {\r\n year: number;\r\n }\r\n ): Promise {\r\n const action = 'GetMakesForManufacturerAndYear';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument is required and must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakesForManufacturerAndYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\r\n * @alias GetMakesForManufacturerAndYearResults\r\n */\r\nexport type GetMakesForManufacturerAndYearResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n MfrId: number;\r\n MfrName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakesForManufacturerAndYear API Action.\r\n *\r\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\r\n * @alias GetMakesForManufacturerAndYearResponse\r\n */\r\nexport type GetMakesForManufacturerAndYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,8BAA+B,SAAQA,WAAK;IACvD,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;IAmBY,8BAA8B,CACzC,YAA6B,EAC7B,MAEC;;YAED,MAAM,MAAM,GAAG,gCAAgC,CAAC;;YAGhD,MAAM,kBAAkB,GAAGC,eAAS,CAAC,YAAY,CAAC,CAAC;YACnD,IAAI,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,KAAK,QAAQ,EAAE;gBACtE,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mFAAmF;oBAC1F,IAAI,kBAAkB,KAAK,YAAY,EAAE,CAC5C,CACF,CAAC;aACH;YAED,MAAM,YAAY,GAAGA,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,YAAY,KAAK,QAAQ,EAAE;gBAC7B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mEAAmE;oBAC1E,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;YAED,MAAM,UAAU,GAAGA,eAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC1C,IAAI,UAAU,KAAK,QAAQ,EAAE;gBAC3B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,wEAAwE;oBAC/E,IAAI,UAAU,KAAK,MAAM,CAAC,IAAI,EAAE,CACnC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAChE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,YAAY,GAAG,WAAW,EAAE,CAAC;;YAGtE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetMakesForManufacturerAndYear.js","sources":["../../src/api/actions/GetMakesForManufacturerAndYear.ts"],"sourcesContent":["/**\n * @module api/actions/GetMakesForManufacturerAndYear\n * @category Actions\n * @description GetMakesForManufacturerAndYear NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetMakesForManufacturerAndYear](module-api_actions_GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear.html)\n * >\n * > **Types**\n * > - Type: [GetMakesForManufacturerAndYearResponse](#GetMakesForManufacturerAndYearResponse)\n * > - Type: [GetMakesForManufacturerAndYearResults](#GetMakesForManufacturerAndYearResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetMakesForManufacturerAndYear extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Makes in the vPIC dataset for a specified manufacturer,\n * and whose Year From and Year To range cover the specified year.\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\n * (it accepts a partial manufacturer name as an input).\n * - Multiple results are returned in case of multiple matches.\n * - Manufacturer can be idenfitied by Id, a partial name, or a full name\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\n *\n * @returns {(Promise)} Api Response object.\n */\n public async GetMakesForManufacturerAndYear(\n manufacturer: string | number,\n params: {\n year: number;\n }\n ): Promise {\n const action = 'GetMakesForManufacturerAndYear';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument is required and must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofYear = getTypeof(params.year);\n if (typeofYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\n `<${typeofYear}> ${params.year}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetMakesForManufacturerAndYearResponse}.Results' array.\n *\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\n * @alias GetMakesForManufacturerAndYearResults\n */\nexport type GetMakesForManufacturerAndYearResults = {\n MakeId: number;\n MakeName: string;\n MfrId: number;\n MfrName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetMakesForManufacturerAndYear API Action.\n *\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\n * @alias GetMakesForManufacturerAndYearResponse\n */\nexport type GetMakesForManufacturerAndYearResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,8BAA+B,SAAQA,WAAK;IACvD,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;IAmBY,8BAA8B,CACzC,YAA6B,EAC7B,MAEC;;YAED,MAAM,MAAM,GAAG,gCAAgC,CAAC;;YAGhD,MAAM,kBAAkB,GAAGC,eAAS,CAAC,YAAY,CAAC,CAAC;YACnD,IAAI,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,KAAK,QAAQ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.map b/dist/cjs/GetMakesForVehicleType.js.map index 66708a138..9fa7d5270 100644 --- a/dist/cjs/GetMakesForVehicleType.js.map +++ b/dist/cjs/GetMakesForVehicleType.js.map @@ -1 +1 @@ -{"version":3,"file":"GetMakesForVehicleType.js","sources":["../../src/api/actions/GetMakesForVehicleType.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetMakesForVehicleType\r\n * @category Actions\r\n * @description GetMakesForVehicleType NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakesForVehicleType](module-api_actions_GetMakesForVehicleType.GetMakesForVehicleType.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakesForVehicleTypeResponse](#GetMakesForVehicleTypeResponse)\r\n * > - Type: [GetMakesForVehicleTypeResults](#GetMakesForVehicleTypeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakesForVehicleType extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified vehicle type (`typeName`),\r\n * whose name is LIKE the vehicle type name in vPIC Dataset.\r\n * - Vehicle `typeName` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n * @param {string} typeName - A partial or full vehicle type name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetMakesForVehicleType(\r\n typeName: string\r\n ): Promise {\r\n const action = 'GetMakesForVehicleType';\r\n\r\n /* Runtime typechecking */\r\n const typeofTypeName = getTypeof(typeName);\r\n if (typeofTypeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"typeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofTypeName}> ${typeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${typeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakesForVehicleTypeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakesForVehicleType\r\n * @alias GetMakesForVehicleTypeResults\r\n */\r\nexport type GetMakesForVehicleTypeResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakesForVehicleType API Action.\r\n *\r\n * @memberof module:api/actions/GetMakesForVehicleType\r\n * @alias GetMakesForVehicleTypeResponse\r\n */\r\nexport type GetMakesForVehicleTypeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;IAYK,sBAAsB,CAC1B,QAAgB;;YAEhB,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,cAAc,GAAGC,eAAS,CAAC,QAAQ,CAAC,CAAC;YAC3C,IAAI,cAAc,KAAK,QAAQ,EAAE;gBAC/B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,qEAAqE;oBAC5E,IAAI,cAAc,KAAK,QAAQ,EAAE,CACpC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,KACjE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC;;YAGlE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAU,KAChB,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetMakesForVehicleType.js","sources":["../../src/api/actions/GetMakesForVehicleType.ts"],"sourcesContent":["/**\n * @module api/actions/GetMakesForVehicleType\n * @category Actions\n * @description GetMakesForVehicleType NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetMakesForVehicleType](module-api_actions_GetMakesForVehicleType.GetMakesForVehicleType.html)\n * >\n * > **Types**\n * > - Type: [GetMakesForVehicleTypeResponse](#GetMakesForVehicleTypeResponse)\n * > - Type: [GetMakesForVehicleTypeResults](#GetMakesForVehicleTypeResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetMakesForVehicleType extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Makes in the vPIC dataset for a specified vehicle type (`typeName`),\n * whose name is LIKE the vehicle type name in vPIC Dataset.\n * - Vehicle `typeName` can be a partial name, or a full name for more specificity\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\n *\n * @async\n * @param {string} typeName - A partial or full vehicle type name.\n * @returns {(Promise)} Api Response object.\n */\n async GetMakesForVehicleType(\n typeName: string\n ): Promise {\n const action = 'GetMakesForVehicleType';\n\n /* Runtime typechecking */\n const typeofTypeName = getTypeof(typeName);\n if (typeofTypeName !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"typeName\" argument is required and must be of type string, got: ` +\n `<${typeofTypeName}> ${typeName}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${typeName}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetMakesForVehicleTypeResponse}.Results' array.\n *\n * @memberof module:api/actions/GetMakesForVehicleType\n * @alias GetMakesForVehicleTypeResults\n */\nexport type GetMakesForVehicleTypeResults = {\n MakeId: number;\n MakeName: string;\n VehicleTypeId: number;\n VehicleTypeName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetMakesForVehicleType API Action.\n *\n * @memberof module:api/actions/GetMakesForVehicleType\n * @alias GetMakesForVehicleTypeResponse\n */\nexport type GetMakesForVehicleTypeResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;IAYK,sBAAsB,CAC1B,QAAgB;;YAEhB,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,cAAc,GAAGC,eAAS,CAAC,QAAQ,CAAC,CAAC;YAC3C,IAAI,cAAc,KAAK,QAAQ,EAAE;gBAC/B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,qEAAqE;oBAC5E,IAAI,cAAc,KAAK,QAAQ,EAAE,CACpC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,KACjE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC;;YAGlE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAU,KAChB,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetManufacturerDetails.js.map b/dist/cjs/GetManufacturerDetails.js.map index 633a1c428..d8e33709d 100644 --- a/dist/cjs/GetManufacturerDetails.js.map +++ b/dist/cjs/GetManufacturerDetails.js.map @@ -1 +1 @@ -{"version":3,"file":"GetManufacturerDetails.js","sources":["../../src/api/actions/GetManufacturerDetails.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetManufacturerDetails\r\n * @category Actions\r\n * @description GetManufacturerDetails NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetManufacturerDetails](module-api_actions_GetManufacturerDetails.GetManufacturerDetails.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetManufacturerDetailsResponse](#GetManufacturerDetailsResponse)\r\n * > - Type: [GetManufacturerDetailsResults](#GetManufacturerDetailsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetManufacturerDetails extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides the details for a specific manufacturer that is requested.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name,\r\n * (it accepts a partial manufacturer name as an input).\r\n * - Multiple results are returned in case of multiple matches.\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetManufacturerDetails(\r\n manufacturer: string | number\r\n ): Promise {\r\n const action = 'GetManufacturerDetails';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetManufacturerDetailsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetManufacturerDetails\r\n * @alias GetManufacturerDetailsResults\r\n */\r\nexport type GetManufacturerDetailsResults = {\r\n Address: string;\r\n Address2: string;\r\n City: string;\r\n ContactEmail: string;\r\n ContactFax: string;\r\n ContactPhone: string;\r\n Country: string;\r\n DBAs: string;\r\n EquipmentItems: Array>;\r\n LastUpdated: string;\r\n ManufacturerTypes: Array<{\r\n Name: string;\r\n }>;\r\n Mfr_CommonName: string;\r\n Mfr_ID: number;\r\n Mfr_Name: string;\r\n OtherManufacturerDetails: string;\r\n PostalCode: string;\r\n PrimaryProduct: string;\r\n PrincipalFirstName: string;\r\n PrincipalLastName: string;\r\n PrincipalPosition: string;\r\n StateProvince: string;\r\n SubmittedName: string;\r\n SubmittedOn: string;\r\n SubmittedPosition: string;\r\n VehicleTypes: Array<{\r\n GVWRFrom: string;\r\n GVWRTo: string;\r\n IsPrimary: boolean;\r\n Name: string;\r\n }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetManufacturerDetails API Action.\r\n *\r\n * @memberof module:api/actions/GetManufacturerDetails\r\n * @alias GetManufacturerDetailsResponse\r\n */\r\nexport type GetManufacturerDetailsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;IAaY,sBAAsB,CACjC,YAA6B;;YAE7B,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,kBAAkB,GAAGC,eAAS,CAAC,YAAY,CAAC,CAAC;YACnD,IAAI,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,KAAK,QAAQ,EAAE;gBACtE,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mFAAmF;oBAC1F,IAAI,kBAAkB,KAAK,YAAY,EAAE,CAC5C,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,YAAY,GAAG,WAAW,EAAE,CAAC;;YAGtE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetManufacturerDetails.js","sources":["../../src/api/actions/GetManufacturerDetails.ts"],"sourcesContent":["/**\n * @module api/actions/GetManufacturerDetails\n * @category Actions\n * @description GetManufacturerDetails NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetManufacturerDetails](module-api_actions_GetManufacturerDetails.GetManufacturerDetails.html)\n * >\n * > **Types**\n * > - Type: [GetManufacturerDetailsResponse](#GetManufacturerDetailsResponse)\n * > - Type: [GetManufacturerDetailsResults](#GetManufacturerDetailsResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetManufacturerDetails extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides the details for a specific manufacturer that is requested.\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name,\n * (it accepts a partial manufacturer name as an input).\n * - Multiple results are returned in case of multiple matches.\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\n * @returns {(Promise)} Api Response object.\n */\n public async GetManufacturerDetails(\n manufacturer: string | number\n ): Promise {\n const action = 'GetManufacturerDetails';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetManufacturerDetailsResponse}.Results' array.\n *\n * @memberof module:api/actions/GetManufacturerDetails\n * @alias GetManufacturerDetailsResults\n */\nexport type GetManufacturerDetailsResults = {\n Address: string;\n Address2: string;\n City: string;\n ContactEmail: string;\n ContactFax: string;\n ContactPhone: string;\n Country: string;\n DBAs: string;\n EquipmentItems: Array>;\n LastUpdated: string;\n ManufacturerTypes: Array<{\n Name: string;\n }>;\n Mfr_CommonName: string;\n Mfr_ID: number;\n Mfr_Name: string;\n OtherManufacturerDetails: string;\n PostalCode: string;\n PrimaryProduct: string;\n PrincipalFirstName: string;\n PrincipalLastName: string;\n PrincipalPosition: string;\n StateProvince: string;\n SubmittedName: string;\n SubmittedOn: string;\n SubmittedPosition: string;\n VehicleTypes: Array<{\n GVWRFrom: string;\n GVWRTo: string;\n IsPrimary: boolean;\n Name: string;\n }>;\n};\n\n/**\n * Type representing the complete response returned by the GetManufacturerDetails API Action.\n *\n * @memberof module:api/actions/GetManufacturerDetails\n * @alias GetManufacturerDetailsResponse\n */\nexport type GetManufacturerDetailsResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;IAaY,sBAAsB,CACjC,YAA6B;;YAE7B,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,kBAAkB,GAAGC,eAAS,CAAC,YAAY,CAAC,CAAC;YACnD,IAAI,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,KAAK,QAAQ,EAAE;gBACtE,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mFAAmF;oBAC1F,IAAI,kBAAkB,KAAK,YAAY,EAAE,CAC5C,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,YAAY,GAAG,WAAW,EAAE,CAAC;;YAGtE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetModelsForMake.js.map b/dist/cjs/GetModelsForMake.js.map index 8f0a29f75..1a7574043 100644 --- a/dist/cjs/GetModelsForMake.js.map +++ b/dist/cjs/GetModelsForMake.js.map @@ -1 +1 @@ -{"version":3,"file":"GetModelsForMake.js","sources":["../../src/api/actions/GetModelsForMake.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetModelsForMake\r\n * @category Actions\r\n * @description GetModelsForMake NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMake](module-api_actions_GetModelsForMake.GetModelsForMake.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeResponse](#GetModelsForMakeResponse)\r\n * > - Type: [GetModelsForMakeResults](#GetModelsForMakeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMake extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified `makeName`\r\n * whose Name is LIKE the Make in vPIC Dataset.\r\n * - `makeName` can be a partial, or a full for more specificity\r\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\r\n *\r\n * @async\r\n * @param {string} makeName - Vehicle make name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMake(makeName: string): Promise {\r\n const action = 'GetModelsForMake';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeName = getTypeof(makeName);\r\n if (typeofMakeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofMakeName}> ${makeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMake\r\n * @alias GetModelsForMakeResults\r\n */\r\nexport type GetModelsForMakeResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMake API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMake\r\n * @alias GetModelsForMakeResponse\r\n */\r\nexport type GetModelsForMakeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,gBAAiB,SAAQA,WAAK;IACzC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;IAYK,gBAAgB,CAAC,QAAgB;;YACrC,MAAM,MAAM,GAAG,kBAAkB,CAAC;;YAGlC,MAAM,cAAc,GAAGC,eAAS,CAAC,QAAQ,CAAC,CAAC;YAC3C,IAAI,cAAc,KAAK,QAAQ,EAAE;gBAC/B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,qEAAqE;oBAC5E,IAAI,cAAc,KAAK,QAAQ,EAAE,CACpC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,KACjE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC;;YAGlE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAU,KAChB,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetModelsForMake.js","sources":["../../src/api/actions/GetModelsForMake.ts"],"sourcesContent":["/**\n * @module api/actions/GetModelsForMake\n * @category Actions\n * @description GetModelsForMake NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMake](module-api_actions_GetModelsForMake.GetModelsForMake.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeResponse](#GetModelsForMakeResponse)\n * > - Type: [GetModelsForMakeResults](#GetModelsForMakeResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMake extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified `makeName`\n * whose Name is LIKE the Make in vPIC Dataset.\n * - `makeName` can be a partial, or a full for more specificity\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\n *\n * @async\n * @param {string} makeName - Vehicle make name.\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMake(makeName: string): Promise {\n const action = 'GetModelsForMake';\n\n /* Runtime typechecking */\n const typeofMakeName = getTypeof(makeName);\n if (typeofMakeName !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\n `<${typeofMakeName}> ${makeName}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMake\n * @alias GetModelsForMakeResults\n */\nexport type GetModelsForMakeResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMake API Action.\n *\n * @memberof module:api/actions/GetModelsForMake\n * @alias GetModelsForMakeResponse\n */\nexport type GetModelsForMakeResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,gBAAiB,SAAQA,WAAK;IACzC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;IAYK,gBAAgB,CAAC,QAAgB;;YACrC,MAAM,MAAM,GAAG,kBAAkB,CAAC;;YAGlC,MAAM,cAAc,GAAGC,eAAS,CAAC,QAAQ,CAAC,CAAC;YAC3C,IAAI,cAAc,KAAK,QAAQ,EAAE;gBAC/B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,qEAAqE;oBAC5E,IAAI,cAAc,KAAK,QAAQ,EAAE,CACpC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,KACjE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC;;YAGlE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAU,KAChB,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetModelsForMakeId.js.map b/dist/cjs/GetModelsForMakeId.js.map index c68b97b01..5769d53d6 100644 --- a/dist/cjs/GetModelsForMakeId.js.map +++ b/dist/cjs/GetModelsForMakeId.js.map @@ -1 +1 @@ -{"version":3,"file":"GetModelsForMakeId.js","sources":["../../src/api/actions/GetModelsForMakeId.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetModelsForMakeId\r\n * @category Actions\r\n * @description GetModelsForMakeId NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeId](module-api_actions_GetModelsForMakeId.GetModelsForMakeId.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeIdResponse](#GetModelsForMakeIdResponse)\r\n * > - Type: [GetModelsForMakeIdResults](#GetModelsForMakeIdResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeId extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Make\r\n * whose Id is equal to the `makeId` in the vPIC Dataset.\r\n *\r\n * @async\r\n * @param {number} makeID - Vehicle make ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeId(\r\n makeID: number\r\n ): Promise {\r\n const action = 'GetModelsForMakeId';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeId = getTypeof(makeID);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeID}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString({}).catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeId\r\n * @alias GetModelsForMakeIdResults\r\n */\r\nexport type GetModelsForMakeIdResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeId API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeId\r\n * @alias GetModelsForMakeIdResponse\r\n */\r\nexport type GetModelsForMakeIdResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,kBAAmB,SAAQA,WAAK;IAC3C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;IAUK,kBAAkB,CACtB,MAAc;;YAEd,MAAM,MAAM,GAAG,oBAAoB,CAAC;;YAGpC,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,YAAY,KAAK,QAAQ,EAAE;gBAC7B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mEAAmE;oBAC1E,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAU,KACnE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGhE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAU,KAChB,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetModelsForMakeId.js","sources":["../../src/api/actions/GetModelsForMakeId.ts"],"sourcesContent":["/**\n * @module api/actions/GetModelsForMakeId\n * @category Actions\n * @description GetModelsForMakeId NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMakeId](module-api_actions_GetModelsForMakeId.GetModelsForMakeId.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeIdResponse](#GetModelsForMakeIdResponse)\n * > - Type: [GetModelsForMakeIdResults](#GetModelsForMakeIdResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMakeId extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified Make\n * whose Id is equal to the `makeId` in the vPIC Dataset.\n *\n * @async\n * @param {number} makeID - Vehicle make ID (number).\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMakeId(\n makeID: number\n ): Promise {\n const action = 'GetModelsForMakeId';\n\n /* Runtime typechecking */\n const typeofMakeId = getTypeof(makeID);\n if (typeofMakeId !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\n `<${typeofMakeId}> ${makeID}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString({}).catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMakeId\n * @alias GetModelsForMakeIdResults\n */\nexport type GetModelsForMakeIdResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMakeId API Action.\n *\n * @memberof module:api/actions/GetModelsForMakeId\n * @alias GetModelsForMakeIdResponse\n */\nexport type GetModelsForMakeIdResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,kBAAmB,SAAQA,WAAK;IAC3C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;IAUK,kBAAkB,CACtB,MAAc;;YAEd,MAAM,MAAM,GAAG,oBAAoB,CAAC;;YAGpC,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,YAAY,KAAK,QAAQ,EAAE;gBAC7B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mEAAmE;oBAC1E,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAU,KACnE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGhE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAU,KAChB,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetModelsForMakeIdYear.js.map b/dist/cjs/GetModelsForMakeIdYear.js.map index 2eaf5dc13..42feec26c 100644 --- a/dist/cjs/GetModelsForMakeIdYear.js.map +++ b/dist/cjs/GetModelsForMakeIdYear.js.map @@ -1 +1 @@ -{"version":3,"file":"GetModelsForMakeIdYear.js","sources":["../../src/api/actions/GetModelsForMakeIdYear.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetModelsForMakeIdYear\r\n * @category Actions\r\n * @description GetModelsForMakeIdYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeIdYear](module-api_actions_GetModelsForMakeIdYear.GetModelsForMakeIdYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeIdYearResponse](#GetModelsForMakeIdYearResponse)\r\n * > - Type: [GetModelsForMakeIdYearResults](#GetModelsForMakeIdYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeIdYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Model Year\r\n * and Make whose name is LIKE the Make in the vPIC Dataset.\r\n * - `params.makeId` is a number and is a required query parameter.\r\n *\r\n * A minimum of one of the following are required (or a combination of both):\r\n * - `params.modelYear` is a number (greater than 1995)\r\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.makeId - Make ID to search.\r\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\r\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeIdYear(params: {\r\n makeId: number;\r\n modelYear?: number;\r\n vehicleType?: string;\r\n }): Promise {\r\n const action = 'GetModelsForMakeIdYear';\r\n\r\n const makeId: number = params?.makeId;\r\n const modelYear: number | undefined = params?.modelYear;\r\n const vehicleType: string | undefined = params?.vehicleType;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n /* Required makeId param of type number */\r\n const typeofMakeId = getTypeof(makeId);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeId}`\r\n )\r\n );\r\n }\r\n /* At least one of modelYear or vehicleType params is required */\r\n if (!modelYear && !vehicleType) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\r\n `${modelYear} | ${vehicleType}`\r\n )\r\n );\r\n }\r\n /* valid modelYear param of type number */\r\n const typeofModelYear = getTypeof(modelYear);\r\n if (modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" must be of type number, got: ` +\r\n `<${typeofModelYear}> ${modelYear}`\r\n )\r\n );\r\n }\r\n /* valid vehicleType param of type string */\r\n const typeofVehicleType = getTypeof(vehicleType);\r\n if (vehicleType && typeofVehicleType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\r\n `<${typeofVehicleType}> ${vehicleType}`\r\n )\r\n );\r\n }\r\n\r\n /* Beginning of the the actionUrl */\r\n let actionUrl = `${action}/makeId/${makeId}/`;\r\n\r\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\r\n if (modelYear && vehicleType) {\r\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\r\n } else if (modelYear) {\r\n actionUrl += `modelYear/${modelYear}`;\r\n } else {\r\n actionUrl += `vehicleType/${vehicleType}`;\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeIdYear\r\n * @alias GetModelsForMakeIdYearResults\r\n */\r\nexport type GetModelsForMakeIdYearResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeIdYear API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeIdYear\r\n * @alias GetModelsForMakeIdYearResponse\r\n */\r\nexport type GetModelsForMakeIdYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;IAmBK,sBAAsB,CAAC,MAI5B;;YACC,MAAM,MAAM,GAAG,wBAAwB,CAAC;YAExC,MAAM,MAAM,GAAW,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC;YACtC,MAAM,SAAS,GAAuB,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAC;YACxD,MAAM,WAAW,GAAuB,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAC;;YAG5D,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,YAAY,KAAK,QAAQ,EAAE;gBAC7B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mDAAmD;oBAC1D,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;;YAED,MAAM,YAAY,GAAGA,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,YAAY,KAAK,QAAQ,EAAE;gBAC7B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,0EAA0E;oBACjF,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;;YAED,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW,EAAE;gBAC9B,OAAO,OAAO,CAAC,MA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,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAU,KAChB,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetModelsForMakeIdYear.js","sources":["../../src/api/actions/GetModelsForMakeIdYear.ts"],"sourcesContent":["/**\n * @module api/actions/GetModelsForMakeIdYear\n * @category Actions\n * @description GetModelsForMakeIdYear NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMakeIdYear](module-api_actions_GetModelsForMakeIdYear.GetModelsForMakeIdYear.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeIdYearResponse](#GetModelsForMakeIdYearResponse)\n * > - Type: [GetModelsForMakeIdYearResults](#GetModelsForMakeIdYearResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMakeIdYear extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified Model Year\n * and Make whose name is LIKE the Make in the vPIC Dataset.\n * - `params.makeId` is a number and is a required query parameter.\n *\n * A minimum of one of the following are required (or a combination of both):\n * - `params.modelYear` is a number (greater than 1995)\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\n *\n * @async\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.makeId - Make ID to search.\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMakeIdYear(params: {\n makeId: number;\n modelYear?: number;\n vehicleType?: string;\n }): Promise {\n const action = 'GetModelsForMakeIdYear';\n\n const makeId: number = params?.makeId;\n const modelYear: number | undefined = params?.modelYear;\n const vehicleType: string | undefined = params?.vehicleType;\n\n /* Valid params object */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n /* Required makeId param of type number */\n const typeofMakeId = getTypeof(makeId);\n if (typeofMakeId !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.makeId\" argument is required and must be of type number, got: ` +\n `<${typeofMakeId}> ${makeId}`\n )\n );\n }\n /* At least one of modelYear or vehicleType params is required */\n if (!modelYear && !vehicleType) {\n return Promise.reject(\n new Error(\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\n `${modelYear} | ${vehicleType}`\n )\n );\n }\n /* valid modelYear param of type number */\n const typeofModelYear = getTypeof(modelYear);\n if (modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" must be of type number, got: ` +\n `<${typeofModelYear}> ${modelYear}`\n )\n );\n }\n /* valid vehicleType param of type string */\n const typeofVehicleType = getTypeof(vehicleType);\n if (vehicleType && typeofVehicleType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\n `<${typeofVehicleType}> ${vehicleType}`\n )\n );\n }\n\n /* Beginning of the the actionUrl */\n let actionUrl = `${action}/makeId/${makeId}/`;\n\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\n if (modelYear && vehicleType) {\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\n } else if (modelYear) {\n actionUrl += `modelYear/${modelYear}`;\n } else {\n actionUrl += `vehicleType/${vehicleType}`;\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdYearResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMakeIdYear\n * @alias GetModelsForMakeIdYearResults\n */\nexport type GetModelsForMakeIdYearResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMakeIdYear API Action.\n *\n * @memberof module:api/actions/GetModelsForMakeIdYear\n * @alias GetModelsForMakeIdYearResponse\n */\nexport type GetModelsForMakeIdYearResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;IAmBK,sBAAsB,CAAC,MAI5B;;YACC,MAAM,MAAM,GAAG,wBAAwB,CAAC;YAExC,MAAM,MAAM,GAAW,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC;YACtC,MAAM,SAAS,GAAuB,MA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C1C,CACF,CAAC;aACH;;YAGD,IAAI,SAAS,GAAG,GAAG,MAAM,WAAW,MAAM,GAAG,CAAC;;YAG9C,IAAI,SAAS,IAAI,WAAW,EAAE;gBAC5B,SAAS,IAAI,aAAa,SAAS,gBAAgB,WAAW,EAAE,CAAC;aAClE;iBAAM,IAAI,SAAS,EAAE;gBACpB,SAAS,IAAI,aAAa,SAAS,EAAE,CAAC;aACvC;iBAAM;gBACL,SAAS,IAAI,eAAe,WAAW,EAAE,CAAC;aAC3C;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,KACjE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,SAAS,GAAG,WAAW,EAAE,CAAC;;YAGzD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAU,KAChB,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetModelsForMakeYear.js.map b/dist/cjs/GetModelsForMakeYear.js.map index 26d158112..a6d5a4746 100644 --- a/dist/cjs/GetModelsForMakeYear.js.map +++ b/dist/cjs/GetModelsForMakeYear.js.map @@ -1 +1 @@ -{"version":3,"file":"GetModelsForMakeYear.js","sources":["../../src/api/actions/GetModelsForMakeYear.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetModelsForMakeYear\r\n * @category Actions\r\n * @description GetModelsForMakeYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeYear](module-api_actions_GetModelsForMakeYear.GetModelsForMakeYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeYearResponse](#GetModelsForMakeYearResponse)\r\n * > - Type: [GetModelsForMakeYearResults](#GetModelsForMakeYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Model Year\r\n * and Make whose name is LIKE the Make in the vPIC Dataset.\r\n * - `params.make` is required. It can be a partial, or a full name for more specificity\r\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\r\n *\r\n * A minimum of one of the following are required (or a combination of both):\r\n * - `params.modelYear` is a number (greater than 1995)\r\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n *\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {string} params.make - Make name to search.\r\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\r\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\r\n *\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeYear(params: {\r\n make: string;\r\n modelYear?: number;\r\n vehicleType?: string;\r\n }): Promise {\r\n const action = 'GetModelsForMakeYear';\r\n\r\n const make: string = params?.make;\r\n const modelYear: number | undefined = params?.modelYear;\r\n const vehicleType: string | undefined = params?.vehicleType;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n /* Required make param of type string */\r\n const typeofMake = getTypeof(make);\r\n if (typeofMake !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.make\" argument is required and must be of type string, got: ` +\r\n `<${typeofMake}> ${make}`\r\n )\r\n );\r\n }\r\n /* At least one of modelYear or vehicleType params is required */\r\n if (!modelYear && !vehicleType) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\r\n `${modelYear} | ${vehicleType}`\r\n )\r\n );\r\n }\r\n /* valid modelYear param of type number */\r\n const typeofModelYear = getTypeof(modelYear);\r\n if (modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" must be of type number, got: ` +\r\n `<${typeofModelYear}> ${modelYear}`\r\n )\r\n );\r\n }\r\n /* valid vehicleType param of type string */\r\n const typeofVehicleType = getTypeof(vehicleType);\r\n if (vehicleType && typeofVehicleType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\r\n `<${typeofVehicleType}> ${vehicleType}`\r\n )\r\n );\r\n }\r\n\r\n /* Beginning of the the actionUrl */\r\n let actionUrl = `${action}/make/${params.make}/`;\r\n\r\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\r\n if (modelYear && vehicleType) {\r\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\r\n } else if (modelYear) {\r\n actionUrl += `modelYear/${modelYear}`;\r\n } else {\r\n actionUrl += `vehicleType/${vehicleType}`;\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeYear\r\n * @alias GetModelsForMakeYearResults\r\n */\r\nexport type GetModelsForMakeYearResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeYear API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeYear\r\n * @alias GetModelsForMakeYearResponse\r\n */\r\nexport type GetModelsForMakeYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,oBAAqB,SAAQA,WAAK;IAC7C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;;;;IAsBK,oBAAoB,CAAC,MAI1B;;YACC,MAAM,MAAM,GAAG,sBAAsB,CAAC;YAEtC,MAAM,IAAI,GAAW,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC;YAClC,MAAM,SAAS,GAAuB,MAAM,aAAN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ACF,CAAC;aACH;;YAGD,IAAI,SAAS,GAAG,GAAG,MAAM,SAAS,MAAM,CAAC,IAAI,GAAG,CAAC;;YAGjD,IAAI,SAAS,IAAI,WAAW,EAAE;gBAC5B,SAAS,IAAI,aAAa,SAAS,gBAAgB,WAAW,EAAE,CAAC;aAClE;iBAAM,IAAI,SAAS,EAAE;gBACpB,SAAS,IAAI,aAAa,SAAS,EAAE,CAAC;aACvC;iBAAM;gBACL,SAAS,IAAI,eAAe,WAAW,EAAE,CAAC;aAC3C;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,KACjE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,SAAS,GAAG,WAAW,EAAE,CAAC;;YAGzD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAU,KAChB,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetModelsForMakeYear.js","sources":["../../src/api/actions/GetModelsForMakeYear.ts"],"sourcesContent":["/**\n * @module api/actions/GetModelsForMakeYear\n * @category Actions\n * @description GetModelsForMakeYear NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMakeYear](module-api_actions_GetModelsForMakeYear.GetModelsForMakeYear.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeYearResponse](#GetModelsForMakeYearResponse)\n * > - Type: [GetModelsForMakeYearResults](#GetModelsForMakeYearResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMakeYear extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified Model Year\n * and Make whose name is LIKE the Make in the vPIC Dataset.\n * - `params.make` is required. It can be a partial, or a full name for more specificity\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\n *\n * A minimum of one of the following are required (or a combination of both):\n * - `params.modelYear` is a number (greater than 1995)\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\n *\n * @async\n *\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {string} params.make - Make name to search.\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\n *\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMakeYear(params: {\n make: string;\n modelYear?: number;\n vehicleType?: string;\n }): Promise {\n const action = 'GetModelsForMakeYear';\n\n const make: string = params?.make;\n const modelYear: number | undefined = params?.modelYear;\n const vehicleType: string | undefined = params?.vehicleType;\n\n /* Valid params object */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n /* Required make param of type string */\n const typeofMake = getTypeof(make);\n if (typeofMake !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.make\" argument is required and must be of type string, got: ` +\n `<${typeofMake}> ${make}`\n )\n );\n }\n /* At least one of modelYear or vehicleType params is required */\n if (!modelYear && !vehicleType) {\n return Promise.reject(\n new Error(\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\n `${modelYear} | ${vehicleType}`\n )\n );\n }\n /* valid modelYear param of type number */\n const typeofModelYear = getTypeof(modelYear);\n if (modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" must be of type number, got: ` +\n `<${typeofModelYear}> ${modelYear}`\n )\n );\n }\n /* valid vehicleType param of type string */\n const typeofVehicleType = getTypeof(vehicleType);\n if (vehicleType && typeofVehicleType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\n `<${typeofVehicleType}> ${vehicleType}`\n )\n );\n }\n\n /* Beginning of the the actionUrl */\n let actionUrl = `${action}/make/${params.make}/`;\n\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\n if (modelYear && vehicleType) {\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\n } else if (modelYear) {\n actionUrl += `modelYear/${modelYear}`;\n } else {\n actionUrl += `vehicleType/${vehicleType}`;\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeYearResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMakeYear\n * @alias GetModelsForMakeYearResults\n */\nexport type GetModelsForMakeYearResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMakeYear API Action.\n *\n * @memberof module:api/actions/GetModelsForMakeYear\n * @alias GetModelsForMakeYearResponse\n */\nexport type GetModelsForMakeYearResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,oBAAqB,SAAQA,WAAK;IAC7C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;;;;;IAsBK,oBAAoB,CAAC,MAI1B;;YACC,MAAM,MAAM,GAAG,sBAAsB,CAAC;YAEtC,MAAM,IAAI,GAAW,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC;YAClC,MAAM,SAAS,GAAuB,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAC;YACxD,MAAM,WAAW,GAAuB,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAC;;YAG5D,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,YAAY,KAAK,QAAQ,EAAE;gBAC7B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mDAAmD;oBAC1D,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;;YAED,MAAM,UAAU,GAAGA,eAAS,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,UAAU,KAAK,QAAQ,EAAE;gBAC3B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,wEAAwE;oBAC/E,IAAI,UAAU,KAAK,IAAI,EAAE,CAC5B,CACF,CAAC;aACH;;YAED,IAAI,CAA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AAE,CAAC;;YAGzD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAU,KAChB,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetParts.js.map b/dist/cjs/GetParts.js.map index 85a0ac22e..cb4ee03ec 100644 --- a/dist/cjs/GetParts.js.map +++ b/dist/cjs/GetParts.js.map @@ -1 +1 @@ -{"version":3,"file":"GetParts.js","sources":["../../src/api/actions/GetParts.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetParts\r\n * @category Actions\r\n * @description GetParts NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetParts](module-api_actions_GetParts.GetParts.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetPartsResponse](#GetPartsResponse)\r\n * > - Type: [GetPartsResults](#GetPartsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetParts extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of ORGs with letter date in the given range of the dates\r\n * and with specified Type (`params.type`) of ORG.\r\n * - Up to 1000 results will be returned at a time.\r\n * - Get the next page by incrementing the `params.page` query parameter.\r\n * - All query `params` are optional.\r\n *\r\n * @async\r\n * @param {object} [params] - Query Search Parameters to append to the URL.\r\n * @param {number} [params.type] - Specified type of ORG to search.\r\n * @param {string} [params.fromDate] - Start date of search query.\r\n * @param {string} [params.toDate] - End date of search query.\r\n * @param {number} [params.page] - Which page number of results to request (100 results per page).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetParts(params?: {\r\n type?: number;\r\n fromDate?: string;\r\n toDate?: string;\r\n page?: number;\r\n }): Promise {\r\n const action = 'GetParts';\r\n\r\n const type: number | undefined = params?.type;\r\n const fromDate: string | undefined = params?.fromDate;\r\n const toDate: string | undefined = params?.toDate;\r\n const page: number | undefined = params?.page;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: <${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.type of type number */\r\n const typeofType = getTypeof(type);\r\n if (type && typeofType !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.type\" argument must be of type number, got: <${typeofType}> ${type}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.fromDate of type string */\r\n const typeofFromDate = getTypeof(fromDate);\r\n if (fromDate && typeofFromDate !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.fromDate\" argument must be of type string, got: <${typeofFromDate}> ${fromDate}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.toDate of type number */\r\n const typeofToDate = getTypeof(toDate);\r\n if (toDate && typeofToDate !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.toDate\" argument must be of type string, got: <${typeofToDate}> ${toDate}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.page of type number */\r\n const typeofPage = getTypeof(page);\r\n if (page && typeofPage !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.page\" argument must be of type number, got: <${typeofPage}> ${page}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetPartsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetParts\r\n * @alias GetPartsResults\r\n */\r\nexport type GetPartsResults = {\r\n CoverLetterURL: string;\r\n LetterDate: string;\r\n ManufacturerId: number;\r\n ManufacturerName: string;\r\n ModelYearFrom: string;\r\n ModelYearTo: string;\r\n Name: string;\r\n Type: string;\r\n URL: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetParts API Action.\r\n *\r\n * @memberof module:api/actions/GetParts\r\n * @alias GetPartsResponse\r\n */\r\nexport type GetPartsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,QAAS,SAAQA,WAAK;IACjC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;IAiBK,QAAQ,CAAC,MAKd;;YACC,MAAM,MAAM,GAAG,UAAU,CAAC;YAE1B,MAAM,IAAI,GAAuB,MAAM,aAAN,MAAM,uBAAN,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,IAAI,IAAI,UAAU,KAAK,QAAQ,EAAE;gBACnC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,0DAA0D,UAAU,KAAK,IAAI,EAAE,CACzF,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAChE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGtD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetParts.js","sources":["../../src/api/actions/GetParts.ts"],"sourcesContent":["/**\n * @module api/actions/GetParts\n * @category Actions\n * @description GetParts NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetParts](module-api_actions_GetParts.GetParts.html)\n * >\n * > **Types**\n * > - Type: [GetPartsResponse](#GetPartsResponse)\n * > - Type: [GetPartsResults](#GetPartsResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetParts extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of ORGs with letter date in the given range of the dates\n * and with specified Type (`params.type`) of ORG.\n * - Up to 1000 results will be returned at a time.\n * - Get the next page by incrementing the `params.page` query parameter.\n * - All query `params` are optional.\n *\n * @async\n * @param {object} [params] - Query Search Parameters to append to the URL.\n * @param {number} [params.type] - Specified type of ORG to search.\n * @param {string} [params.fromDate] - Start date of search query.\n * @param {string} [params.toDate] - End date of search query.\n * @param {number} [params.page] - Which page number of results to request (100 results per page).\n * @returns {(Promise)} Api Response object.\n */\n async GetParts(params?: {\n type?: number;\n fromDate?: string;\n toDate?: string;\n page?: number;\n }): Promise {\n const action = 'GetParts';\n\n const type: number | undefined = params?.type;\n const fromDate: string | undefined = params?.fromDate;\n const toDate: string | undefined = params?.toDate;\n const page: number | undefined = params?.page;\n\n /* Valid params object */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: <${typeofParams}> ${params}`\n )\n );\n }\n\n /* valid params.type of type number */\n const typeofType = getTypeof(type);\n if (type && typeofType !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.type\" argument must be of type number, got: <${typeofType}> ${type}`\n )\n );\n }\n\n /* valid params.fromDate of type string */\n const typeofFromDate = getTypeof(fromDate);\n if (fromDate && typeofFromDate !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.fromDate\" argument must be of type string, got: <${typeofFromDate}> ${fromDate}`\n )\n );\n }\n\n /* valid params.toDate of type number */\n const typeofToDate = getTypeof(toDate);\n if (toDate && typeofToDate !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.toDate\" argument must be of type string, got: <${typeofToDate}> ${toDate}`\n )\n );\n }\n\n /* valid params.page of type number */\n const typeofPage = getTypeof(page);\n if (page && typeofPage !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.page\" argument must be of type number, got: <${typeofPage}> ${page}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetPartsResponse}.Results' array.\n *\n * @memberof module:api/actions/GetParts\n * @alias GetPartsResults\n */\nexport type GetPartsResults = {\n CoverLetterURL: string;\n LetterDate: string;\n ManufacturerId: number;\n ManufacturerName: string;\n ModelYearFrom: string;\n ModelYearTo: string;\n Name: string;\n Type: string;\n URL: string;\n};\n\n/**\n * Type representing the complete response returned by the GetParts API Action.\n *\n * @memberof module:api/actions/GetParts\n * @alias GetPartsResponse\n */\nexport type GetPartsResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,QAAS,SAAQA,WAAK;IACjC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;IAiBK,QAAQ,CAAC,MAKd;;YACC,MAAM,MAAM,GAAG,UAAU,CAAC;YAE1B,MAAM,IAAI,GAAuB,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC;YAC9C,MAAM,QAAQ,GAAuB,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC;YACt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DAA0D,UAAU,KAAK,IAAI,EAAE,CACzF,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAChE,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGtD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetVehicleTypesForMake.js.map b/dist/cjs/GetVehicleTypesForMake.js.map index e4c42d646..2a2968311 100644 --- a/dist/cjs/GetVehicleTypesForMake.js.map +++ b/dist/cjs/GetVehicleTypesForMake.js.map @@ -1 +1 @@ -{"version":3,"file":"GetVehicleTypesForMake.js","sources":["../../src/api/actions/GetVehicleTypesForMake.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetVehicleTypesForMake\r\n * @category Actions\r\n * @description GetVehicleTypesForMake NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleTypesForMake](module-api_actions_GetVehicleTypesForMake.GetVehicleTypesForMake.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleTypesForMakeResponse](#GetVehicleTypesForMakeResponse)\r\n * > - Type: [GetVehicleTypesForMakeResults](#GetVehicleTypesForMakeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleTypesForMake extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make,\r\n * whose name is LIKE the make name in the vPIC Dataset.\r\n * - `makeName` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\r\n *\r\n * @async\r\n * @param {string} makeName - Name of the vehicle make to search.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleTypesForMake(\r\n makeName: string\r\n ): Promise {\r\n const action = 'GetVehicleTypesForMake';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeName = getTypeof(makeName);\r\n if (typeofMakeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofMakeName}> ${makeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMake\r\n * @alias GetVehicleTypesForMakeResults\r\n */\r\nexport type GetVehicleTypesForMakeResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleTypesForMake API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMake\r\n * @alias GetVehicleTypesForMakeResponse\r\n */\r\nexport type GetVehicleTypesForMakeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;IAYK,sBAAsB,CAC1B,QAAgB;;YAEhB,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,cAAc,GAAGC,eAAS,CAAC,QAAQ,CAAC,CAAC;YAC3C,IAAI,cAAc,KAAK,QAAQ,EAAE;gBAC/B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,qEAAqE;oBAC5E,IAAI,cAAc,KAAK,QAAQ,EAAE,CACpC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC;;YAGlE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetVehicleTypesForMake.js","sources":["../../src/api/actions/GetVehicleTypesForMake.ts"],"sourcesContent":["/**\n * @module api/actions/GetVehicleTypesForMake\n * @category Actions\n * @description GetVehicleTypesForMake NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleTypesForMake](module-api_actions_GetVehicleTypesForMake.GetVehicleTypesForMake.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleTypesForMakeResponse](#GetVehicleTypesForMakeResponse)\n * > - Type: [GetVehicleTypesForMakeResults](#GetVehicleTypesForMakeResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleTypesForMake extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make,\n * whose name is LIKE the make name in the vPIC Dataset.\n * - `makeName` can be a partial name, or a full name for more specificity\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\n *\n * @async\n * @param {string} makeName - Name of the vehicle make to search.\n * @returns {(Promise)} Api Response object.\n */\n async GetVehicleTypesForMake(\n makeName: string\n ): Promise {\n const action = 'GetVehicleTypesForMake';\n\n /* Runtime typechecking */\n const typeofMakeName = getTypeof(makeName);\n if (typeofMakeName !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\n `<${typeofMakeName}> ${makeName}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleTypesForMake\n * @alias GetVehicleTypesForMakeResults\n */\nexport type GetVehicleTypesForMakeResults = {\n MakeId: number;\n MakeName: string;\n VehicleTypeId: number;\n VehicleTypeName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleTypesForMake API Action.\n *\n * @memberof module:api/actions/GetVehicleTypesForMake\n * @alias GetVehicleTypesForMakeResponse\n */\nexport type GetVehicleTypesForMakeResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;IAYK,sBAAsB,CAC1B,QAAgB;;YAEhB,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,cAAc,GAAGC,eAAS,CAAC,QAAQ,CAAC,CAAC;YAC3C,IAAI,cAAc,KAAK,QAAQ,EAAE;gBAC/B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,qEAAqE;oBAC5E,IAAI,cAAc,KAAK,QAAQ,EAAE,CACpC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC;;YAGlE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetVehicleTypesForMakeId.js.map b/dist/cjs/GetVehicleTypesForMakeId.js.map index b677b71e5..22a95a3ac 100644 --- a/dist/cjs/GetVehicleTypesForMakeId.js.map +++ b/dist/cjs/GetVehicleTypesForMakeId.js.map @@ -1 +1 @@ -{"version":3,"file":"GetVehicleTypesForMakeId.js","sources":["../../src/api/actions/GetVehicleTypesForMakeId.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetVehicleTypesForMakeId\r\n * @category Actions\r\n * @description GetVehicleTypesForMakeId NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleTypesForMakeId](module-api_actions_GetVehicleTypesForMakeId.GetVehicleTypesForMakeId.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleTypesForMakeIdResponse](#GetVehicleTypesForMakeIdResponse)\r\n * > - Type: [GetVehicleTypesForMakeIdResults](#GetVehicleTypesForMakeIdResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleTypesForMakeId extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make and\r\n * whose ID equals the make ID in the vPIC Dataset.\r\n *\r\n * @async\r\n * @param {number} makeID - Vehicle make ID.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleTypesForMakeId(\r\n makeID: number\r\n ): Promise {\r\n const action = 'GetVehicleTypesForMakeId';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeId = getTypeof(makeID);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeID}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeIdResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMakeId\r\n * @alias GetVehicleTypesForMakeIdResults\r\n */\r\nexport type GetVehicleTypesForMakeIdResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleTypesForMakeId API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMakeId\r\n * @alias GetVehicleTypesForMakeIdResponse\r\n */\r\nexport type GetVehicleTypesForMakeIdResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,wBAAyB,SAAQA,WAAK;IACjD,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;IAUK,wBAAwB,CAC5B,MAAc;;YAEd,MAAM,MAAM,GAAG,0BAA0B,CAAC;;YAG1C,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,YAAY,KAAK,QAAQ,EAAE;gBAC7B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mEAAmE;oBAC1E,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGhE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetVehicleTypesForMakeId.js","sources":["../../src/api/actions/GetVehicleTypesForMakeId.ts"],"sourcesContent":["/**\n * @module api/actions/GetVehicleTypesForMakeId\n * @category Actions\n * @description GetVehicleTypesForMakeId NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleTypesForMakeId](module-api_actions_GetVehicleTypesForMakeId.GetVehicleTypesForMakeId.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleTypesForMakeIdResponse](#GetVehicleTypesForMakeIdResponse)\n * > - Type: [GetVehicleTypesForMakeIdResults](#GetVehicleTypesForMakeIdResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleTypesForMakeId extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make and\n * whose ID equals the make ID in the vPIC Dataset.\n *\n * @async\n * @param {number} makeID - Vehicle make ID.\n * @returns {(Promise)} Api Response object.\n */\n async GetVehicleTypesForMakeId(\n makeID: number\n ): Promise {\n const action = 'GetVehicleTypesForMakeId';\n\n /* Runtime typechecking */\n const typeofMakeId = getTypeof(makeID);\n if (typeofMakeId !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\n `<${typeofMakeId}> ${makeID}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeIdResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleTypesForMakeId\n * @alias GetVehicleTypesForMakeIdResults\n */\nexport type GetVehicleTypesForMakeIdResults = {\n MakeId: number;\n MakeName: string;\n VehicleTypeId: number;\n VehicleTypeName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleTypesForMakeId API Action.\n *\n * @memberof module:api/actions/GetVehicleTypesForMakeId\n * @alias GetVehicleTypesForMakeIdResponse\n */\nexport type GetVehicleTypesForMakeIdResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,wBAAyB,SAAQA,WAAK;IACjD,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;IAUK,wBAAwB,CAC5B,MAAc;;YAEd,MAAM,MAAM,GAAG,0BAA0B,CAAC;;YAG1C,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,YAAY,KAAK,QAAQ,EAAE;gBAC7B,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mEAAmE;oBAC1E,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGhE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetVehicleVariableList.js.map b/dist/cjs/GetVehicleVariableList.js.map index 6cce47968..5d7adc621 100644 --- a/dist/cjs/GetVehicleVariableList.js.map +++ b/dist/cjs/GetVehicleVariableList.js.map @@ -1 +1 @@ -{"version":3,"file":"GetVehicleVariableList.js","sources":["../../src/api/actions/GetVehicleVariableList.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetVehicleVariableList\r\n * @category Actions\r\n * @description GetVehicleVariableList NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleVariableList](module-api_actions_GetVehicleVariableList.GetVehicleVariableList.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleVariableListResponse](#GetVehicleVariableListResponse)\r\n * > - Type: [GetVehicleVariableListResults](#GetVehicleVariableListResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleVariableList extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Vehicle related variables that are in the vPIC dataset.\r\n * - Information on the name, description and the type of the variable is provided.\r\n *\r\n * @async\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetVehicleVariableList(): Promise {\r\n const action = 'GetVehicleVariableList';\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleVariableListResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableList\r\n * @alias GetVehicleVariableListResults\r\n */\r\nexport type GetVehicleVariableListResults = {\r\n DataType: string;\r\n Description: string;\r\n ID: number;\r\n Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleVariableList API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableList\r\n * @alias GetVehicleVariableListResponse\r\n */\r\nexport type GetVehicleVariableListResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAqBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;IASY,sBAAsB;;YACjC,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGtD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetVehicleVariableList.js","sources":["../../src/api/actions/GetVehicleVariableList.ts"],"sourcesContent":["/**\n * @module api/actions/GetVehicleVariableList\n * @category Actions\n * @description GetVehicleVariableList NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleVariableList](module-api_actions_GetVehicleVariableList.GetVehicleVariableList.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleVariableListResponse](#GetVehicleVariableListResponse)\n * > - Type: [GetVehicleVariableListResults](#GetVehicleVariableListResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleVariableList extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the Vehicle related variables that are in the vPIC dataset.\n * - Information on the name, description and the type of the variable is provided.\n *\n * @async\n * @returns {(Promise)} Api Response object.\n */\n public async GetVehicleVariableList(): Promise {\n const action = 'GetVehicleVariableList';\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleVariableListResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleVariableList\n * @alias GetVehicleVariableListResults\n */\nexport type GetVehicleVariableListResults = {\n DataType: string;\n Description: string;\n ID: number;\n Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleVariableList API Action.\n *\n * @memberof module:api/actions/GetVehicleVariableList\n * @alias GetVehicleVariableListResponse\n */\nexport type GetVehicleVariableListResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAqBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;IASY,sBAAsB;;YACjC,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;;YAGtD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetVehicleVariableValuesList.js.map b/dist/cjs/GetVehicleVariableValuesList.js.map index f22438a52..8c987f7c9 100644 --- a/dist/cjs/GetVehicleVariableValuesList.js.map +++ b/dist/cjs/GetVehicleVariableValuesList.js.map @@ -1 +1 @@ -{"version":3,"file":"GetVehicleVariableValuesList.js","sources":["../../src/api/actions/GetVehicleVariableValuesList.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetVehicleVariableValuesList\r\n * @category Actions\r\n * @description GetVehicleVariableValuesList NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleVariableValuesList](module-api_actions_GetVehicleVariableValuesList.GetVehicleVariableValuesList.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleVariableValuesListResponse](#GetVehicleVariableValuesListResponse)\r\n * > - Type: [GetVehicleVariableValuesListResults](#GetVehicleVariableValuesListResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleVariableValuesList extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the accepted values for a given variable that are stored in the vPIC dataset.\r\n *\r\n * This applies to only \"Look up\" type of variables.\r\n * - `variableValue` can either be a:\r\n * - Variable Name (\"battery type\" in first example, please use full name, not just part of it),\r\n * - or Variable ID (number).\r\n *\r\n * @async\r\n * @param {string|number} variableValue - The variable you want to get a values list of.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleVariableValuesList(\r\n variableValue: string | number\r\n ): Promise {\r\n const action = 'GetVehicleVariableValuesList';\r\n\r\n /* Runtime typechecking */\r\n const typeofVariableValue = getTypeof(variableValue);\r\n if (typeofVariableValue !== 'string' && typeofVariableValue !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"variableValue\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofVariableValue}> ${variableValue}`\r\n )\r\n );\r\n }\r\n /* Encode to a valid URI string (space chars, etc.) if variableValue is a string*/\r\n if (typeofVariableValue === 'string') {\r\n variableValue = encodeURI(variableValue as string);\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${variableValue}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleVariableValuesListResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableValuesList\r\n * @alias GetVehicleVariableValuesListResults\r\n */\r\nexport type GetVehicleVariableValuesListResults = {\r\n ElementName: string;\r\n Id: number;\r\n Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleVariableValuesList API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableValuesList\r\n * @alias GetVehicleVariableValuesListResponse\r\n */\r\nexport type GetVehicleVariableValuesListResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,4BAA6B,SAAQA,WAAK;IACrD,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;IAcK,4BAA4B,CAChC,aAA8B;;YAE9B,MAAM,MAAM,GAAG,8BAA8B,CAAC;;YAG9C,MAAM,mBAAmB,GAAGC,eAAS,CAAC,aAAa,CAAC,CAAC;YACrD,IAAI,mBAAmB,KAAK,QAAQ,IAAI,mBAAmB,KAAK,QAAQ,EAAE;gBACxE,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,oFAAoF;oBAC3F,IAAI,mBAAmB,KAAK,aAAa,EAAE,CAC9C,CACF,CAAC;aACH;;YAED,IAAI,mBAAmB,KAAK,QAAQ,EAAE;gBACpC,aAAa,GAAG,SAAS,CAAC,aAAuB,CAAC,CAAC;aACpD;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,aAAa,GAAG,WAAW,EAAE,CAAC;;YAGvE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetVehicleVariableValuesList.js","sources":["../../src/api/actions/GetVehicleVariableValuesList.ts"],"sourcesContent":["/**\n * @module api/actions/GetVehicleVariableValuesList\n * @category Actions\n * @description GetVehicleVariableValuesList NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleVariableValuesList](module-api_actions_GetVehicleVariableValuesList.GetVehicleVariableValuesList.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleVariableValuesListResponse](#GetVehicleVariableValuesListResponse)\n * > - Type: [GetVehicleVariableValuesListResults](#GetVehicleVariableValuesListResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleVariableValuesList extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the accepted values for a given variable that are stored in the vPIC dataset.\n *\n * This applies to only \"Look up\" type of variables.\n * - `variableValue` can either be a:\n * - Variable Name (\"battery type\" in first example, please use full name, not just part of it),\n * - or Variable ID (number).\n *\n * @async\n * @param {string|number} variableValue - The variable you want to get a values list of.\n * @returns {(Promise)} Api Response object.\n */\n async GetVehicleVariableValuesList(\n variableValue: string | number\n ): Promise {\n const action = 'GetVehicleVariableValuesList';\n\n /* Runtime typechecking */\n const typeofVariableValue = getTypeof(variableValue);\n if (typeofVariableValue !== 'string' && typeofVariableValue !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"variableValue\" argument is required and must be of type string or number, got: ` +\n `<${typeofVariableValue}> ${variableValue}`\n )\n );\n }\n /* Encode to a valid URI string (space chars, etc.) if variableValue is a string*/\n if (typeofVariableValue === 'string') {\n variableValue = encodeURI(variableValue as string);\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${variableValue}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleVariableValuesListResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleVariableValuesList\n * @alias GetVehicleVariableValuesListResults\n */\nexport type GetVehicleVariableValuesListResults = {\n ElementName: string;\n Id: number;\n Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleVariableValuesList API Action.\n *\n * @memberof module:api/actions/GetVehicleVariableValuesList\n * @alias GetVehicleVariableValuesListResponse\n */\nexport type GetVehicleVariableValuesListResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,4BAA6B,SAAQA,WAAK;IACrD,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;IAcK,4BAA4B,CAChC,aAA8B;;YAE9B,MAAM,MAAM,GAAG,8BAA8B,CAAC;;YAG9C,MAAM,mBAAmB,GAAGC,eAAS,CAAC,aAAa,CAAC,CAAC;YACrD,IAAI,mBAAmB,KAAK,QAAQ,IAAI,mBAAmB,KAAK,QAAQ,EAAE;gBACxE,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,oFAAoF;oBAC3F,IAAI,mBAAmB,KAAK,aAAa,EAAE,CAC9C,CACF,CAAC;aACH;;YAED,IAAI,mBAAmB,KAAK,QAAQ,EAAE;gBACpC,aAAa,GAAG,SAAS,CAAC,aAAuB,CAAC,CAAC;aACpD;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,aAAa,GAAG,WAAW,EAAE,CAAC;;YAGvE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetWMIsForManufacturer-90384d3e.js b/dist/cjs/GetWMIsForManufacturer-90384d3e.js deleted file mode 100644 index 69b75ba16..000000000 --- a/dist/cjs/GetWMIsForManufacturer-90384d3e.js +++ /dev/null @@ -1,1673 +0,0 @@ -'use strict'; - -var Fetch = require('./Fetch-d7540537.js'); - -/** - * @module api/actions/DecodeVin - * @category Actions - * @description DecodeVin NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [DecodeVin](module-api_actions_DecodeVin.DecodeVin.html) - * > - * > **Types** - * > - Type: [DecodeVinResponse](#DecodeVinResponse) - * > - Type: [DecodeVinResults](#DecodeVinResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class DecodeVin extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * The DecodeVin API Action will decode the VIN and the decoded output will be made available in the format of Key-value pairs. - * - Providing `params.modelYear` allows for the decoding to specifically be done in the current, - * or older (pre-1980), model year ranges. - * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding. - * - This API also supports partial VIN decoding (VINs that are less than 17 characters). - * - In this case, the VIN will be decoded partially with the available characters. - * - In case of partial VINs, a "*" could be used to indicate the unavailable characters. - * - The 9th digit is not necessary. - * - * @async - * @param {string} vin - Vehicle Identification Number (full or partial). - * @param {object} [params={}] - Query Search Parameters to append to the URL. - * @param {number} [params.modelYear] - Optional Model Year search parameter. - * @returns {(Promise)} - Api Response object. - */ - DecodeVin(vin, params) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'DecodeVin'; - /* Runtime typechecking */ - const typeofParams = Fetch.getTypeof(params); - if (params && typeofParams !== 'object') { - return Promise.reject(new Error(`${action}, "params" argument must be of type object, got: ` + - `<${typeofParams}> ${params}`)); - } - const typeofVin = Fetch.getTypeof(vin); - if (typeofVin !== 'string') { - return Promise.reject(new Error(`${action}, "vin" argument is required and must be of type string, got: ` + - `<${typeofVin}> ${vin}`)); - } - const typeofModelYear = Fetch.getTypeof(params === null || params === void 0 ? void 0 : params.modelYear); - if ((params === null || params === void 0 ? void 0 : params.modelYear) && typeofModelYear !== 'number') { - return Promise.reject(new Error(`${action}, "params.modelYear" argument is required and must be of type string or number, got: ` + - `<${typeofModelYear}> ${params.modelYear}`)); - } - /* Build the query string to be appended to the URL*/ - const queryString = yield this.buildQueryString(params).catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${vin}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/DecodeVinExtended - * @category Actions - * @description DecodeVinExtended NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [DecodeVinExtended](module-api_actions_DecodeVinExtended.DecodeVinExtended.html) - * > - * > **Types** - * > - Type: [DecodeVinExtendedResponse](#DecodeVinExtendedResponse) - * > - Type: [DecodeVinExtendedResults](#DecodeVinExtendedResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class DecodeVinExtended extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This is exactly like the DecodeVin method but provides additional information on variables - * related to other NHTSA programs like - * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc. - * - This will decode the VIN and the decoded output will be made available - * in the format of Key-value pairs. - * - In the returned 'Results` object: - * - The IDs (VariableID and ValueID) represent the unique ID associated with the Variable/Value. - * - In case of text variables, the ValueID is not applicable. - * - Providing `params.modelYear` allows for the decoding to specifically be done in the current, - * or older (pre-1980), model year ranges. - * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding. - * - This Action also supports partial VIN decoding (VINs that are less than 17 characters). - * - In this case, the VIN will be decoded partially with the available characters. - * - In case of partial VINs, a "*" could be used to indicate the unavailable characters. - * - The 9th digit is not necessary. - * - * @async - * @param {string} vin - Vehicle Identification Number (full or partial). - * @param {object} [params={}] - Query Search Parameters to append to the URL. - * @param {string|number} [params.modelYear] - Optional Model Year search parameter. - * @returns {(Promise)} - Api Response object. - */ - DecodeVinExtended(vin, params) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'DecodeVinExtended'; - /* Runtime typechecking */ - const typeofParams = Fetch.getTypeof(params); - if (params && typeofParams !== 'object') { - return Promise.reject(new Error(`${action}, "params" argument must be of type object, got: ` + - `<${typeofParams}> ${params}`)); - } - const typeofVin = Fetch.getTypeof(vin); - if (typeofVin !== 'string') { - return Promise.reject(new Error(`${action}, "vin" argument is required and must be of type string, got: ` + - `<${typeofVin}> ${vin}`)); - } - const typeofModelYear = Fetch.getTypeof(params === null || params === void 0 ? void 0 : params.modelYear); - if ((params === null || params === void 0 ? void 0 : params.modelYear) && typeofModelYear !== 'number') { - return Promise.reject(new Error(`${action}, "params.modelYear" argument is required and must be of type string or number, got: ` + - `<${typeofModelYear}> ${params.modelYear}`)); - } - /* Build the query string to be appended to the URL*/ - const queryString = yield this.buildQueryString(params).catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${vin}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/DecodeVinValues - * @category Actions - * @description DecodeVinValues NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [DecodeVinValues](module-api_actions_DecodeVinValues.DecodeVinValues.html) - * > - * > **Types** - * > - Type: [DecodeVinValuesResponse](#DecodeVinValuesResponse) - * > - Type: [DecodeVinValuesResults](#DecodeVinValuesResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class DecodeVinValues extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * The DecodeVinValues API Action will decode the VIN with the Results returned in a _flat file_ format. - * - The Results will be made available in a flat file format of a single object containing - * 'key: value' results. - * - Providing params.modelYear allows for the decoding to specifically be done in the current, - * or older (pre-1980), model year ranges. - * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding. - * - This Action also supports partial VIN decoding (VINs that are less than 17 characters). - * - In this case, the VIN will be decoded partially with the available characters. - * - In case of partial VINs, a "*" could be used to indicate the unavailable characters. - * - * @async - * @param {string} vin - Vehicle Identification Number (full or partial). - * @param {object} [params={}] - Query Search Parameters to append to the URL. - * @param {string|number} [params.modelYear] - Optional Model Year search parameter. - * @returns {(Promise)} Api Response object. - */ - DecodeVinValues(vin, params) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'DecodeVinValues'; - /* Runtime typechecking */ - const typeofParams = Fetch.getTypeof(params); - if (params && typeofParams !== 'object') { - return Promise.reject(new Error(`${action}, "params" argument must be of type object, got: ` + - `<${typeofParams}> ${params}`)); - } - const typeofVin = Fetch.getTypeof(vin); - if (typeofVin !== 'string') { - return Promise.reject(new Error(`${action}, "vin" argument is required and must be of type string, got: ` + - `<${typeofVin}> ${vin}`)); - } - const typeofModelYear = Fetch.getTypeof(params === null || params === void 0 ? void 0 : params.modelYear); - if ((params === null || params === void 0 ? void 0 : params.modelYear) && - typeofModelYear !== 'string' && - typeofModelYear !== 'number') { - return Promise.reject(new Error(`${action}, "params.modelYear" argument is required and must be of type string or number, got: ` + - `<${typeofModelYear}> ${params.modelYear}`)); - } - /* Build the query string to be appended to the URL*/ - const queryString = yield this.buildQueryString(params).catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${vin}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/DecodeVINValuesBatch - * @category Actions - * @description DecodeVINValuesBatch NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [DecodeVINValuesBatch](module-api_actions_DecodeVINValuesBatch.DecodeVINValuesBatch.html) - * > - * > **Types** - * > - Type: [DecodeVINValuesBatchResponse](#DecodeVINValuesBatchResponse) - * > - Type: [DecodeVINValuesBatchResults](#DecodeVINValuesBatchResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class DecodeVINValuesBatch extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This decodes a batch of VINs that are submitted in a standardized format in a string - * and returns multiple decodes in a flat format. - * - * The `inputString` parameter should be in the following format: - * - `vin , modelYear ; vin , modelYear ; vin , modelYear ...` - * - * "modelYear" is optional, the output for each VIN decode is in the same format as produced by the "Decode VIN (flat format)" method. - * - * @async - * @param {string} inputString - A string of Vehicle Identification Numbers (full or partial) following the format listed in the description. - * @returns {(Promise)} - Api Response object. - */ - DecodeVINValuesBatch(inputString) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'DecodeVINValuesBatch'; - /* Runtime typechecking */ - const typeofInputString = Fetch.getTypeof(inputString); - if (typeofInputString !== 'string') { - return Promise.reject(new Error(`${action}, "inputString" argument is required and must be of type string, got: ` + - `<${typeofInputString}> ${inputString}`)); - } - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/`; - const body = encodeURI(`DATA=${inputString}&format=json`); - /* Return the result */ - return yield this.get(url, { - method: 'POST', - headers: { 'content-type': 'application/x-www-form-urlencoded' }, - body, - }) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/DecodeVinValuesExtended - * @category Actions - * @description DecodeVinValuesExtended NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [DecodeVinValuesExtended](module-api_actions_DecodeVinValuesExtended.DecodeVinValuesExtended.html) - * > - * > **Types** - * > - Type: [DecodeVinValuesExtendedResponse](#DecodeVinValuesExtendedResponse) - * > - Type: [DecodeVinValuesExtendedResults](#DecodeVinValuesExtendedResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class DecodeVinValuesExtended extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This is exactly like the DecodeVinValues (flat format Results) method but provides additional information - * on variables related to other NHTSA programs like - * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc. - * - The Results will be made available in a flat file format of a single object containing - * 'key: value' results. - * - Providing `params.modelYear` allows for the decoding to specifically be done in the current, - * or older (pre-1980), model year ranges. - * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding. - * - This Action also supports partial VIN decoding (VINs that are less than 17 characters). - * - In this case, the VIN will be decoded partially with the available characters. - * - In case of partial VINs, a "*" could be used to indicate the unavailable characters. - * - * @async - * @param {string} vin - Vehicle Identification Number (full or partial). - * @param {object} [params={}] - Query Search Parameters to append to the URL. - * @param {string|number} [params.modelYear] - Optional Model Year search parameter. - * @reje - * @returns {(Promise)} Api Response object. - */ - DecodeVinValuesExtended(vin, params) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'DecodeVinValuesExtended'; - /* Runtime typechecking */ - const typeofParams = Fetch.getTypeof(params); - if (params && typeofParams !== 'object') { - return Promise.reject(new Error(`${action}, "params" argument must be of type object, got: ` + - `<${typeofParams}> ${params}`)); - } - const typeofVin = Fetch.getTypeof(vin); - if (typeofVin !== 'string') { - return Promise.reject(new Error(`${action}, "vin" argument is required and must be of type string, got: ` + - `<${typeofVin}> ${vin}`)); - } - const typeofModelYear = Fetch.getTypeof(params === null || params === void 0 ? void 0 : params.modelYear); - if ((params === null || params === void 0 ? void 0 : params.modelYear) && typeofModelYear !== 'number') { - return Promise.reject(new Error(`${action}, "params.modelYear" argument is required and must be of type string or number, got: ` + - `<${typeofModelYear}> ${params.modelYear}`)); - } - /* Build the query string to be appended to the URL*/ - const queryString = yield this.buildQueryString(params).catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${vin}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/DecodeWMI - * @category Actions - * @description DecodeWMI NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [DecodeWMI](module-api_actions_DecodeWMI.DecodeWMI.html) - * > - * > **Types** - * > - Type: [DecodeWMIResponse](#DecodeWMIResponse) - * > - Type: [DecodeWMIResults](#DecodeWMIResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class DecodeWMI extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This provides information on the World Manufacturer Identifier for a specific WMI code. - * - `WMI` may be put in as either 3 characters representing VIN position 1-3 or 6 characters - * representing VIN positions 1-3 & 12-14. Example "JTD", "1T9131". - * - * @async - * @param {string} WMI - World Manufacturer Identifier. - * @returns {(Promise)} Api Response object. - */ - DecodeWMI(WMI) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'DecodeWMI'; - /* Runtime typechecking */ - const typeofWMI = Fetch.getTypeof(WMI); - if (typeofWMI !== 'string') { - return Promise.reject(new Error(`${action}, "WMI" argument is required and must be of type string, got: ` + - `<${typeofWMI}> ${WMI}`)); - } - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${WMI}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetAllMakes - * @category Actions - * @description GetAllMakes NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetAllMakes](module-api_actions_GetAllMakes.GetAllMakes.html) - * > - * > **Types** - * > - Type: [GetAllMakesResponse](#GetAllMakesResponse) - * > - Type: [GetAllMakesResults](#GetAllMakesResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetAllMakes extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This provides a list of all the Makes available in the vPIC Dataset. - * - * @async - * @returns {(Promise)} Api Response object. - */ - GetAllMakes() { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetAllMakes'; - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetAllManufacturers - * @category Actions - * @description GetAllManufacturers NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetAllManufacturers](module-api_actions_GetAllManufacturers.GetAllManufacturers.html) - * > - * > **Types** - * > - Type: [GetAllManufacturersResponse](#GetAllManufacturersResponse) - * > - Type: [GetAllManufacturersResults](#GetAllManufacturersResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetAllManufacturers extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This provides a list of all the Manufacturers available in vPIC Dataset. - * - `params.manufacturerType` allows the user to filter the list based on manufacturer type, - * ('Incomplete Vehicles', 'Completed Vehicle Manufacturer', 'Incomplete Vehicle Manufacturer', - * 'Intermediate Manufacturer', 'Final-Stage Manufacturer', 'Alterer', or any partial match of those strings). - * - You can get a list of all manufacturer types with the following API Action: - * `GetVehicleVariableValuesList('manufacturer type')` - * - Results are provided in pages of 100 items. - * - Provide a number value for `params.page` to specify 1st (default), 2nd, 3rd, Nth, etc page. - * - * @async - * @param {object} [params={}] - Query Search Parameters to append to the URL. - * @param {string} [params.manufacturerType] - See method description. - * @param {number} [params.page] - Specify the page number (results returned 100 at a time). - * @returns {(Promise)} Api Response object. - */ - GetAllManufacturers(params = {}) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetAllManufacturers'; - /* Runtime typechecking */ - const typeofParams = Fetch.getTypeof(params); - if (typeofParams !== 'object') { - return Promise.reject(new Error(`${action}, "params" argument must be of type object, got: ` + - `<${typeofParams}> ${params}`)); - } - const typeofManufacturerType = Fetch.getTypeof(params.manufacturerType); - if (params.manufacturerType && typeofManufacturerType !== 'string') { - return Promise.reject(new Error(`${action}, "params.manufacturerType" argument must be of type string, got: ` + - `<${typeofManufacturerType}> ${params.manufacturerType}`)); - } - const typeofPage = Fetch.getTypeof(params.page); - if (params.page && typeofPage !== 'number') { - return Promise.reject(new Error(`${action}, "params.page" argument must be of type number, got: ` + - `<${typeofPage}> ${params.page}`)); - } - /* Build the query string to be appended to the URL*/ - const queryString = yield this.buildQueryString(params).catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetCanadianVehicleSpecifications - * @category Actions - * @description GetCanadianVehicleSpecifications NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetCanadianVehicleSpecifications](module-api_actions_GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications.html) - * > - * > **Types** - * > - Type: [GetCanadianVehicleSpecificationsResponse](#GetCanadianVehicleSpecificationsResponse) - * > - Type: [GetCanadianVehicleSpecificationsResults](#GetCanadianVehicleSpecificationsResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetCanadianVehicleSpecifications extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * The Canadian Vehicle Specifications (CVS) consists of a database of original vehicle dimensions, - * used primarily in collision investigation and reconstruction, combined with a search engine. - * - * The database is compiled annually by the Collision Investigation and Research Division of Transport Canada. - * Visit official [Canadian Vehicle Specifications](http://www.carsp.ca/research/resources/safety-sources/canadian-vehicle-specifications/) - * page for more details. - * - * This API action will return a 404 html error if any of the query parameters in params - * are missing from the query string. This is the only API action with this behaviour. Therefore, - * parameters are inserted into the query string as empty strings if not provided by the user. - * - * @async - * @param {object} params - Query Search Parameters to append to the URL. - * @param {number} params.year - Model year of the vehicle (required) - Number, >= 1971. - * @param {string} [params.make] - Vehicle's make, like "Honda", "Toyota", etc... - * @param {string} [params.model] - Vehicle's model, like "Pilot", "Focus". Can also include some other elements like Body Type, Engine Model/size, etc... - * @param {string} [params.units] - "Metric" (default), or "US" for United States customary units. - * @returns {(Promise)} Api Response object. - */ - GetCanadianVehicleSpecifications(params) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetCanadianVehicleSpecifications'; - /* Runtime typechecking */ - const typeofParams = Fetch.getTypeof(params); - if (typeofParams !== 'object') { - return Promise.reject(new Error(`${action}, "params" argument must be of type object, got: ` + - `<${typeofParams}> ${params}`)); - } - const typeofYear = Fetch.getTypeof(params.year); - if (typeofYear !== 'number') { - return Promise.reject(new Error(`${action}, "params.year" argument is required and must be of type number, got: ` + - `<${typeofYear}> ${params.year}`)); - } - const typeofMake = Fetch.getTypeof(params.make); - if (params.make && typeofMake !== 'string') { - return Promise.reject(new Error(`${action}, "params.make" argument must be of type string, got: ` + - `<${typeofMake}> ${params.make}`)); - } - const typeofModel = Fetch.getTypeof(params.model); - if (params.model && typeofModel !== 'string') { - return Promise.reject(new Error(`${action}, "params.model" argument must be of type string, got: ` + - `<${typeofModel}> ${params.model}`)); - } - const typeofUnits = Fetch.getTypeof(params.units); - if (params.units && typeofUnits !== 'string') { - return Promise.reject(new Error(`${action}, "params.units" argument must be of type string, got: ` + - `<${typeofUnits}> ${params.units}`)); - } - /* Set default query parameters to empty strings if not provided by the user */ - const make = params.make || ''; - const model = params.model || ''; - const units = params.units || ''; - const params_ = { - year: params.year, - make, - model, - units, - }; - /* - * Build the 'default' query string to be appended to the URL. - * - * Additionally, sets the allowEmptyStringValues option (2nd argument) to true because - * this API action will return a 404 error if any of the query parameters are missing from the query string. - * This is the only API action with this behaviour ("year" is the only param the user must provide). - */ - const queryString = yield this.buildQueryString(params_, true).catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetEquipmentPlantCodes - * @category Actions - * @description GetEquipmentPlantCodes NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetEquipmentPlantCodes](module-api_actions_GetEquipmentPlantCodes.GetEquipmentPlantCodes.html) - * > - * > **Types** - * > - Type: [GetEquipmentPlantCodesResponse](#GetEquipmentPlantCodesResponse) - * > - Type: [GetEquipmentPlantCodesResults](#GetEquipmentPlantCodesResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetEquipmentPlantCodes extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * Returns assigned Equipment Plant Codes. Can be filtered by Year, Equipment Type and Report Type. - * - * `params.year`: - * - Only years >= 2016 are supported - * - * `params.equipmentType`: - * - 1 (Tires) - * - 3 (Brake Hoses) - * - 13 (Glazing) - * - 16 (Retread) - * - * `params.reportType`: - * - 'New' (The Equipment Plant Code was assigned during the selected year). - * - 'Updated' (The Equipment Plant data was modified during the selected year). - * - 'Closed' (The Equipment Plant is no longer Active). - * - 'All' (All Equipment Plant Codes regardless of year, including their status (active or closed)). - * - * @async - * @param {object} params - Query Search Parameters to append to the URL. - * @param {number} params.year - Model year of the vehicle - Number, >= 2016. - * @param {number} params.equipmentType - Number equal to 1, 3, 13, or 16. - * @param {string} params.reportType - 'New', 'Updated', 'Closed', or 'All'. - * @returns {(Promise)} Api Response object. - */ - GetEquipmentPlantCodes(params) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetEquipmentPlantCodes'; - /* Runtime typechecking */ - const typeofParams = Fetch.getTypeof(params); - if (typeofParams !== 'object') { - return Promise.reject(new Error(`${action}, "params" argument must be of type object, got: ` + - `<${typeofParams}> ${params}`)); - } - const typeofYear = Fetch.getTypeof(params.year); - if (typeofYear !== 'number') { - return Promise.reject(new Error(`${action}, "params.year" argument is required and must be of type number, got: ` + - `<${typeofYear}> ${params.year}`)); - } - const typeofEquipmentType = Fetch.getTypeof(params.equipmentType); - if (typeofEquipmentType !== 'number') { - return Promise.reject(new Error(`${action}, "params.equipmentType" argument is required and must be of type number, got: ` + - `<${typeofEquipmentType}> ${params.equipmentType}`)); - } - const typeofReportType = Fetch.getTypeof(params.reportType); - if (typeofReportType !== 'string') { - return Promise.reject(new Error(`${action}, "params.reportType" argument is required and must be of type string, got: ` + - `<${typeofReportType}> ${params.reportType}`)); - } - /* Build the query string to be appended to the URL*/ - const queryString = yield this.buildQueryString(params).catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetMakeForManufacturer - * @category Actions - * @description GetMakeForManufacturer NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetMakeForManufacturer](module-api_actions_GetMakeForManufacturer.GetMakeForManufacturer.html) - * > - * > **Types** - * > - Type: [GetMakeForManufacturerResponse](#GetMakeForManufacturerResponse) - * > - Type: [GetMakeForManufacturerResults](#GetMakeForManufacturerResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetMakeForManufacturer extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This returns all the Makes in the vPIC dataset for a specified manufacturer that is requested. - * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id. - * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name - * (it accepts a partial manufacturer name as an input). - * - `manufacturer` name can be a partial name, or a full name for more specificity - * (e.g., "988", "HONDA", "HONDA OF CANADA MFG., INC.", etc.). - * - Multiple results are returned in case of multiple matches. - * - * @async - * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number). - * @returns {(Promise)} Api Response object. - */ - GetMakeForManufacturer(manufacturer) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetMakeForManufacturer'; - /* Runtime typechecking */ - const typeofManufacturer = Fetch.getTypeof(manufacturer); - if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') { - return Promise.reject(new Error(`${action}, "manufacturer" argument is required and must be of type string or number, got: ` + - `<${typeofManufacturer}> ${manufacturer}`)); - } - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetMakesForManufacturerAndYear - * @category Actions - * @description GetMakesForManufacturerAndYear NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetMakesForManufacturerAndYear](module-api_actions_GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear.html) - * > - * > **Types** - * > - Type: [GetMakesForManufacturerAndYearResponse](#GetMakesForManufacturerAndYearResponse) - * > - Type: [GetMakesForManufacturerAndYearResults](#GetMakesForManufacturerAndYearResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetMakesForManufacturerAndYear extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This returns all the Makes in the vPIC dataset for a specified manufacturer, - * and whose Year From and Year To range cover the specified year. - * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id. - * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name - * (it accepts a partial manufacturer name as an input). - * - Multiple results are returned in case of multiple matches. - * - Manufacturer can be idenfitied by Id, a partial name, or a full name - * (e.g., "988", "HONDA", "HONDA OF CANADA MFG., INC.", etc.). - * - * @async - * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number). - * @param {object} params - Query Search Parameters to append to the URL. - * @param {number} params.year - Model year of the vehicle - Number, >= 2016. - * - * @returns {(Promise)} Api Response object. - */ - GetMakesForManufacturerAndYear(manufacturer, params) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetMakesForManufacturerAndYear'; - /* Runtime typechecking */ - const typeofManufacturer = Fetch.getTypeof(manufacturer); - if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') { - return Promise.reject(new Error(`${action}, "manufacturer" argument is required and must be of type string or number, got: ` + - `<${typeofManufacturer}> ${manufacturer}`)); - } - const typeofParams = Fetch.getTypeof(params); - if (typeofParams !== 'object') { - return Promise.reject(new Error(`${action}, "params" argument is required and must be of type object, got: ` + - `<${typeofParams}> ${params}`)); - } - const typeofYear = Fetch.getTypeof(params.year); - if (typeofYear !== 'number') { - return Promise.reject(new Error(`${action}, "params.year" argument is required and must be of type number, got: ` + - `<${typeofYear}> ${params.year}`)); - } - /* Build the query string to be appended to the URL*/ - const queryString = yield this.buildQueryString(params).catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetMakesForVehicleType - * @category Actions - * @description GetMakesForVehicleType NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetMakesForVehicleType](module-api_actions_GetMakesForVehicleType.GetMakesForVehicleType.html) - * > - * > **Types** - * > - Type: [GetMakesForVehicleTypeResponse](#GetMakesForVehicleTypeResponse) - * > - Type: [GetMakesForVehicleTypeResults](#GetMakesForVehicleTypeResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetMakesForVehicleType extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This returns all the Makes in the vPIC dataset for a specified vehicle type (`typeName`), - * whose name is LIKE the vehicle type name in vPIC Dataset. - * - Vehicle `typeName` can be a partial name, or a full name for more specificity - * (e.g., "Vehicle", "Moto", "Low Speed Vehicle", etc.). - * - * @async - * @param {string} typeName - A partial or full vehicle type name. - * @returns {(Promise)} Api Response object. - */ - GetMakesForVehicleType(typeName) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetMakesForVehicleType'; - /* Runtime typechecking */ - const typeofTypeName = Fetch.getTypeof(typeName); - if (typeofTypeName !== 'string') { - return Promise.reject(new Error(`${action}, "typeName" argument is required and must be of type string, got: ` + - `<${typeofTypeName}> ${typeName}`)); - } - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${typeName}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetManufacturerDetails - * @category Actions - * @description GetManufacturerDetails NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetManufacturerDetails](module-api_actions_GetManufacturerDetails.GetManufacturerDetails.html) - * > - * > **Types** - * > - Type: [GetManufacturerDetailsResponse](#GetManufacturerDetailsResponse) - * > - Type: [GetManufacturerDetailsResults](#GetManufacturerDetailsResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetManufacturerDetails extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This provides the details for a specific manufacturer that is requested. - * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id. - * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name, - * (it accepts a partial manufacturer name as an input). - * - Multiple results are returned in case of multiple matches. - * - * @async - * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number). - * @returns {(Promise)} Api Response object. - */ - GetManufacturerDetails(manufacturer) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetManufacturerDetails'; - /* Runtime typechecking */ - const typeofManufacturer = Fetch.getTypeof(manufacturer); - if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') { - return Promise.reject(new Error(`${action}, "manufacturer" argument is required and must be of type string or number, got: ` + - `<${typeofManufacturer}> ${manufacturer}`)); - } - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetModelsForMake - * @category Actions - * @description GetModelsForMake NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetModelsForMake](module-api_actions_GetModelsForMake.GetModelsForMake.html) - * > - * > **Types** - * > - Type: [GetModelsForMakeResponse](#GetModelsForMakeResponse) - * > - Type: [GetModelsForMakeResults](#GetModelsForMakeResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetModelsForMake extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This returns the Models in the vPIC dataset for a specified `makeName` - * whose Name is LIKE the Make in vPIC Dataset. - * - `makeName` can be a partial, or a full for more specificity - * (e.g., "Harley", "Harley Davidson", etc.). - * - * @async - * @param {string} makeName - Vehicle make name. - * @returns {(Promise)} Api Response object. - */ - GetModelsForMake(makeName) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetModelsForMake'; - /* Runtime typechecking */ - const typeofMakeName = Fetch.getTypeof(makeName); - if (typeofMakeName !== 'string') { - return Promise.reject(new Error(`${action}, "makeName" argument is required and must be of type string, got: ` + - `<${typeofMakeName}> ${makeName}`)); - } - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${makeName}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetModelsForMakeId - * @category Actions - * @description GetModelsForMakeId NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetModelsForMakeId](module-api_actions_GetModelsForMakeId.GetModelsForMakeId.html) - * > - * > **Types** - * > - Type: [GetModelsForMakeIdResponse](#GetModelsForMakeIdResponse) - * > - Type: [GetModelsForMakeIdResults](#GetModelsForMakeIdResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetModelsForMakeId extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This returns the Models in the vPIC dataset for a specified Make - * whose Id is equal to the `makeId` in the vPIC Dataset. - * - * @async - * @param {number} makeID - Vehicle make ID (number). - * @returns {(Promise)} Api Response object. - */ - GetModelsForMakeId(makeID) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetModelsForMakeId'; - /* Runtime typechecking */ - const typeofMakeId = Fetch.getTypeof(makeID); - if (typeofMakeId !== 'number') { - return Promise.reject(new Error(`${action}, "makeId" argument is required and must be of type number, got: ` + - `<${typeofMakeId}> ${makeID}`)); - } - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString({}).catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${makeID}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetModelsForMakeIdYear - * @category Actions - * @description GetModelsForMakeIdYear NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetModelsForMakeIdYear](module-api_actions_GetModelsForMakeIdYear.GetModelsForMakeIdYear.html) - * > - * > **Types** - * > - Type: [GetModelsForMakeIdYearResponse](#GetModelsForMakeIdYearResponse) - * > - Type: [GetModelsForMakeIdYearResults](#GetModelsForMakeIdYearResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetModelsForMakeIdYear extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This returns the Models in the vPIC dataset for a specified Model Year - * and Make whose name is LIKE the Make in the vPIC Dataset. - * - `params.makeId` is a number and is a required query parameter. - * - * A minimum of one of the following are required (or a combination of both): - * - `params.modelYear` is a number (greater than 1995) - * - `params.vehicleType` can be a partial name, or a full name for more specificity - * (e.g., "Vehicle", "Moto", "Low Speed Vehicle", etc.). - * - * @async - * @param {object} params - Query Search Parameters to append to the URL. - * @param {number} params.makeId - Make ID to search. - * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995). - * @param {string} [params.vehicleType] - String representing the vehicle type to search. - * @returns {(Promise)} Api Response object. - */ - GetModelsForMakeIdYear(params) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetModelsForMakeIdYear'; - const makeId = params === null || params === void 0 ? void 0 : params.makeId; - const modelYear = params === null || params === void 0 ? void 0 : params.modelYear; - const vehicleType = params === null || params === void 0 ? void 0 : params.vehicleType; - /* Valid params object */ - const typeofParams = Fetch.getTypeof(params); - if (typeofParams !== 'object') { - return Promise.reject(new Error(`${action}, "params" argument must be of type object, got: ` + - `<${typeofParams}> ${params}`)); - } - /* Required makeId param of type number */ - const typeofMakeId = Fetch.getTypeof(makeId); - if (typeofMakeId !== 'number') { - return Promise.reject(new Error(`${action}, "params.makeId" argument is required and must be of type number, got: ` + - `<${typeofMakeId}> ${makeId}`)); - } - /* At least one of modelYear or vehicleType params is required */ - if (!modelYear && !vehicleType) { - return Promise.reject(new Error(`${action}, either one of "params.modelYear" or "params.vehicleType" is required, got: ` + - `${modelYear} | ${vehicleType}`)); - } - /* valid modelYear param of type number */ - const typeofModelYear = Fetch.getTypeof(modelYear); - if (modelYear && typeofModelYear !== 'number') { - return Promise.reject(new Error(`${action}, "params.modelYear" must be of type number, got: ` + - `<${typeofModelYear}> ${modelYear}`)); - } - /* valid vehicleType param of type string */ - const typeofVehicleType = Fetch.getTypeof(vehicleType); - if (vehicleType && typeofVehicleType !== 'string') { - return Promise.reject(new Error(`${action}, "params.vehicleType" must be of type string, got: ` + - `<${typeofVehicleType}> ${vehicleType}`)); - } - /* Beginning of the the actionUrl */ - let actionUrl = `${action}/makeId/${makeId}/`; - /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */ - if (modelYear && vehicleType) { - actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`; - } - else if (modelYear) { - actionUrl += `modelYear/${modelYear}`; - } - else { - actionUrl += `vehicleType/${vehicleType}`; - } - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${actionUrl}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetModelsForMakeYear - * @category Actions - * @description GetModelsForMakeYear NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetModelsForMakeYear](module-api_actions_GetModelsForMakeYear.GetModelsForMakeYear.html) - * > - * > **Types** - * > - Type: [GetModelsForMakeYearResponse](#GetModelsForMakeYearResponse) - * > - Type: [GetModelsForMakeYearResults](#GetModelsForMakeYearResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetModelsForMakeYear extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This returns the Models in the vPIC dataset for a specified Model Year - * and Make whose name is LIKE the Make in the vPIC Dataset. - * - `params.make` is required. It can be a partial, or a full name for more specificity - * (e.g., "Harley", "Harley Davidson", etc.). - * - * A minimum of one of the following are required (or a combination of both): - * - `params.modelYear` is a number (greater than 1995) - * - `params.vehicleType` can be a partial name, or a full name for more specificity - * (e.g., "Vehicle", "Moto", "Low Speed Vehicle", etc.). - * - * @async - * - * @param {object} params - Query Search Parameters to append to the URL. - * @param {string} params.make - Make name to search. - * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995). - * @param {string} [params.vehicleType] - String representing the vehicle type to search. - * - * @returns {(Promise)} Api Response object. - */ - GetModelsForMakeYear(params) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetModelsForMakeYear'; - const make = params === null || params === void 0 ? void 0 : params.make; - const modelYear = params === null || params === void 0 ? void 0 : params.modelYear; - const vehicleType = params === null || params === void 0 ? void 0 : params.vehicleType; - /* Valid params object */ - const typeofParams = Fetch.getTypeof(params); - if (typeofParams !== 'object') { - return Promise.reject(new Error(`${action}, "params" argument must be of type object, got: ` + - `<${typeofParams}> ${params}`)); - } - /* Required make param of type string */ - const typeofMake = Fetch.getTypeof(make); - if (typeofMake !== 'string') { - return Promise.reject(new Error(`${action}, "params.make" argument is required and must be of type string, got: ` + - `<${typeofMake}> ${make}`)); - } - /* At least one of modelYear or vehicleType params is required */ - if (!modelYear && !vehicleType) { - return Promise.reject(new Error(`${action}, either one of "params.modelYear" or "params.vehicleType" is required, got: ` + - `${modelYear} | ${vehicleType}`)); - } - /* valid modelYear param of type number */ - const typeofModelYear = Fetch.getTypeof(modelYear); - if (modelYear && typeofModelYear !== 'number') { - return Promise.reject(new Error(`${action}, "params.modelYear" must be of type number, got: ` + - `<${typeofModelYear}> ${modelYear}`)); - } - /* valid vehicleType param of type string */ - const typeofVehicleType = Fetch.getTypeof(vehicleType); - if (vehicleType && typeofVehicleType !== 'string') { - return Promise.reject(new Error(`${action}, "params.vehicleType" must be of type string, got: ` + - `<${typeofVehicleType}> ${vehicleType}`)); - } - /* Beginning of the the actionUrl */ - let actionUrl = `${action}/make/${params.make}/`; - /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */ - if (modelYear && vehicleType) { - actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`; - } - else if (modelYear) { - actionUrl += `modelYear/${modelYear}`; - } - else { - actionUrl += `vehicleType/${vehicleType}`; - } - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${actionUrl}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetParts - * @category Actions - * @description GetParts NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetParts](module-api_actions_GetParts.GetParts.html) - * > - * > **Types** - * > - Type: [GetPartsResponse](#GetPartsResponse) - * > - Type: [GetPartsResults](#GetPartsResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetParts extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This provides a list of ORGs with letter date in the given range of the dates - * and with specified Type (`params.type`) of ORG. - * - Up to 1000 results will be returned at a time. - * - Get the next page by incrementing the `params.page` query parameter. - * - All query `params` are optional. - * - * @async - * @param {object} [params] - Query Search Parameters to append to the URL. - * @param {number} [params.type] - Specified type of ORG to search. - * @param {string} [params.fromDate] - Start date of search query. - * @param {string} [params.toDate] - End date of search query. - * @param {number} [params.page] - Which page number of results to request (100 results per page). - * @returns {(Promise)} Api Response object. - */ - GetParts(params) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetParts'; - const type = params === null || params === void 0 ? void 0 : params.type; - const fromDate = params === null || params === void 0 ? void 0 : params.fromDate; - const toDate = params === null || params === void 0 ? void 0 : params.toDate; - const page = params === null || params === void 0 ? void 0 : params.page; - /* Valid params object */ - const typeofParams = Fetch.getTypeof(params); - if (params && typeofParams !== 'object') { - return Promise.reject(new Error(`${action}, "params" argument must be of type object, got: <${typeofParams}> ${params}`)); - } - /* valid params.type of type number */ - const typeofType = Fetch.getTypeof(type); - if (type && typeofType !== 'number') { - return Promise.reject(new Error(`${action}, "params.type" argument must be of type number, got: <${typeofType}> ${type}`)); - } - /* valid params.fromDate of type string */ - const typeofFromDate = Fetch.getTypeof(fromDate); - if (fromDate && typeofFromDate !== 'string') { - return Promise.reject(new Error(`${action}, "params.fromDate" argument must be of type string, got: <${typeofFromDate}> ${fromDate}`)); - } - /* valid params.toDate of type number */ - const typeofToDate = Fetch.getTypeof(toDate); - if (toDate && typeofToDate !== 'string') { - return Promise.reject(new Error(`${action}, "params.toDate" argument must be of type string, got: <${typeofToDate}> ${toDate}`)); - } - /* valid params.page of type number */ - const typeofPage = Fetch.getTypeof(page); - if (page && typeofPage !== 'number') { - return Promise.reject(new Error(`${action}, "params.page" argument must be of type number, got: <${typeofPage}> ${page}`)); - } - /* Build the query string to be appended to the URL*/ - const queryString = yield this.buildQueryString(params).catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetVehicleTypesForMake - * @category Actions - * @description GetVehicleTypesForMake NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetVehicleTypesForMake](module-api_actions_GetVehicleTypesForMake.GetVehicleTypesForMake.html) - * > - * > **Types** - * > - Type: [GetVehicleTypesForMakeResponse](#GetVehicleTypesForMakeResponse) - * > - Type: [GetVehicleTypesForMakeResults](#GetVehicleTypesForMakeResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetVehicleTypesForMake extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This returns all the Vehicle Types in the vPIC dataset for a specified Make, - * whose name is LIKE the make name in the vPIC Dataset. - * - `makeName` can be a partial name, or a full name for more specificity - * (e.g., "Merc", "Mercedes Benz", etc.). - * - * @async - * @param {string} makeName - Name of the vehicle make to search. - * @returns {(Promise)} Api Response object. - */ - GetVehicleTypesForMake(makeName) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetVehicleTypesForMake'; - /* Runtime typechecking */ - const typeofMakeName = Fetch.getTypeof(makeName); - if (typeofMakeName !== 'string') { - return Promise.reject(new Error(`${action}, "makeName" argument is required and must be of type string, got: ` + - `<${typeofMakeName}> ${makeName}`)); - } - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${makeName}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetVehicleTypesForMakeId - * @category Actions - * @description GetVehicleTypesForMakeId NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetVehicleTypesForMakeId](module-api_actions_GetVehicleTypesForMakeId.GetVehicleTypesForMakeId.html) - * > - * > **Types** - * > - Type: [GetVehicleTypesForMakeIdResponse](#GetVehicleTypesForMakeIdResponse) - * > - Type: [GetVehicleTypesForMakeIdResults](#GetVehicleTypesForMakeIdResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetVehicleTypesForMakeId extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This returns all the Vehicle Types in the vPIC dataset for a specified Make and - * whose ID equals the make ID in the vPIC Dataset. - * - * @async - * @param {number} makeID - Vehicle make ID. - * @returns {(Promise)} Api Response object. - */ - GetVehicleTypesForMakeId(makeID) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetVehicleTypesForMakeId'; - /* Runtime typechecking */ - const typeofMakeId = Fetch.getTypeof(makeID); - if (typeofMakeId !== 'number') { - return Promise.reject(new Error(`${action}, "makeId" argument is required and must be of type number, got: ` + - `<${typeofMakeId}> ${makeID}`)); - } - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${makeID}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetVehicleVariableList - * @category Actions - * @description GetVehicleVariableList NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetVehicleVariableList](module-api_actions_GetVehicleVariableList.GetVehicleVariableList.html) - * > - * > **Types** - * > - Type: [GetVehicleVariableListResponse](#GetVehicleVariableListResponse) - * > - Type: [GetVehicleVariableListResults](#GetVehicleVariableListResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetVehicleVariableList extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This provides a list of all the Vehicle related variables that are in the vPIC dataset. - * - Information on the name, description and the type of the variable is provided. - * - * @async - * @returns {(Promise)} Api Response object. - */ - GetVehicleVariableList() { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetVehicleVariableList'; - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetVehicleVariableValuesList - * @category Actions - * @description GetVehicleVariableValuesList NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetVehicleVariableValuesList](module-api_actions_GetVehicleVariableValuesList.GetVehicleVariableValuesList.html) - * > - * > **Types** - * > - Type: [GetVehicleVariableValuesListResponse](#GetVehicleVariableValuesListResponse) - * > - Type: [GetVehicleVariableValuesListResults](#GetVehicleVariableValuesListResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetVehicleVariableValuesList extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * This provides a list of all the accepted values for a given variable that are stored in the vPIC dataset. - * - * This applies to only "Look up" type of variables. - * - `variableValue` can either be a: - * - Variable Name ("battery type" in first example, please use full name, not just part of it), - * - or Variable ID (number). - * - * @async - * @param {string|number} variableValue - The variable you want to get a values list of. - * @returns {(Promise)} Api Response object. - */ - GetVehicleVariableValuesList(variableValue) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetVehicleVariableValuesList'; - /* Runtime typechecking */ - const typeofVariableValue = Fetch.getTypeof(variableValue); - if (typeofVariableValue !== 'string' && typeofVariableValue !== 'number') { - return Promise.reject(new Error(`${action}, "variableValue" argument is required and must be of type string or number, got: ` + - `<${typeofVariableValue}> ${variableValue}`)); - } - /* Encode to a valid URI string (space chars, etc.) if variableValue is a string*/ - if (typeofVariableValue === 'string') { - variableValue = encodeURI(variableValue); - } - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${variableValue}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -/** - * @module api/actions/GetWMIsForManufacturer - * @category Actions - * @description GetWMIsForManufacturer NHSTA Api Action. - * - * > **Module Exports**: - * > - Class: [GetWMIsForManufacturer](module-api_actions_GetWMIsForManufacturer.GetWMIsForManufacturer.html) - * > - * > **Types** - * > - Type: [GetWMIsForManufacturerResponse](#GetWMIsForManufacturerResponse) - * > - Type: [GetWMIsForManufacturerResults](#GetWMIsForManufacturerResults) - * - */ -/** - * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html). - * - * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html). - * - * @category Actions - * @param {FetchConfig} [userConfig] - User configuration options to construct the class with. - */ -class GetWMIsForManufacturer extends Fetch.Fetch { - constructor(userConfig) { - super(userConfig); - } - /** - * Provides information on the World Manufacturer Identifier (WMI) for a specified `manufacturer`. - * - Only WMIs registered in vPICList are displayed. - * - `manufacturer` can be a partial name, or a full name for more specificity - * (e.g., "Merc", "Mercedes Benz", etc.). - * - * @async - * @param {string|number} manufacturer - Manufacturer Name. - * @returns {(Promise)} Api Response object. - */ - GetWMIsForManufacturer(manufacturer) { - return Fetch.__awaiter(this, void 0, void 0, function* () { - const action = 'GetWMIsForManufacturer'; - /* Runtime typechecking */ - const typeofManufacturer = Fetch.getTypeof(manufacturer); - if (typeofManufacturer !== 'string') { - return Promise.reject(new Error(`${action}, "manufacturer" argument is required and must be of type string, got: ` + - `<${typeofManufacturer}> ${manufacturer}`)); - } - /* Build the 'default' query string to be appended to the URL*/ - const queryString = yield this.buildQueryString().catch((err) => Promise.reject(new Error(`${action}, Error building query string: ${err}`))); - /* Build the final request URL*/ - const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`; - /* Return the result */ - return yield this.get(url) - .then((response) => response) - .catch((err) => Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))); - }); - } -} - -exports.DecodeVINValuesBatch = DecodeVINValuesBatch; -exports.DecodeVin = DecodeVin; -exports.DecodeVinExtended = DecodeVinExtended; -exports.DecodeVinValues = DecodeVinValues; -exports.DecodeVinValuesExtended = DecodeVinValuesExtended; -exports.DecodeWMI = DecodeWMI; -exports.GetAllMakes = GetAllMakes; -exports.GetAllManufacturers = GetAllManufacturers; -exports.GetCanadianVehicleSpecifications = GetCanadianVehicleSpecifications; -exports.GetEquipmentPlantCodes = GetEquipmentPlantCodes; -exports.GetMakeForManufacturer = GetMakeForManufacturer; -exports.GetMakesForManufacturerAndYear = GetMakesForManufacturerAndYear; -exports.GetMakesForVehicleType = GetMakesForVehicleType; -exports.GetManufacturerDetails = GetManufacturerDetails; -exports.GetModelsForMake = GetModelsForMake; -exports.GetModelsForMakeId = GetModelsForMakeId; -exports.GetModelsForMakeIdYear = GetModelsForMakeIdYear; -exports.GetModelsForMakeYear = GetModelsForMakeYear; -exports.GetParts = GetParts; -exports.GetVehicleTypesForMake = GetVehicleTypesForMake; -exports.GetVehicleTypesForMakeId = GetVehicleTypesForMakeId; -exports.GetVehicleVariableList = GetVehicleVariableList; -exports.GetVehicleVariableValuesList = GetVehicleVariableValuesList; -exports.GetWMIsForManufacturer = GetWMIsForManufacturer; -//# sourceMappingURL=GetWMIsForManufacturer-90384d3e.js.map diff --git a/dist/cjs/GetWMIsForManufacturer-90384d3e.js.map b/dist/cjs/GetWMIsForManufacturer-90384d3e.js.map deleted file mode 100644 index a353327ac..000000000 --- a/dist/cjs/GetWMIsForManufacturer-90384d3e.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GetWMIsForManufacturer-90384d3e.js","sources":["../../src/api/actions/DecodeVin.ts","../../src/api/actions/DecodeVinExtended.ts","../../src/api/actions/DecodeVinValues.ts","../../src/api/actions/DecodeVINValuesBatch.ts","../../src/api/actions/DecodeVinValuesExtended.ts","../../src/api/actions/DecodeWMI.ts","../../src/api/actions/GetAllMakes.ts","../../src/api/actions/GetAllManufacturers.ts","../../src/api/actions/GetCanadianVehicleSpecifications.ts","../../src/api/actions/GetEquipmentPlantCodes.ts","../../src/api/actions/GetMakeForManufacturer.ts","../../src/api/actions/GetMakesForManufacturerAndYear.ts","../../src/api/actions/GetMakesForVehicleType.ts","../../src/api/actions/GetManufacturerDetails.ts","../../src/api/actions/GetModelsForMake.ts","../../src/api/actions/GetModelsForMakeId.ts","../../src/api/actions/GetModelsForMakeIdYear.ts","../../src/api/actions/GetModelsForMakeYear.ts","../../src/api/actions/GetParts.ts","../../src/api/actions/GetVehicleTypesForMake.ts","../../src/api/actions/GetVehicleTypesForMakeId.ts","../../src/api/actions/GetVehicleVariableList.ts","../../src/api/actions/GetVehicleVariableValuesList.ts","../../src/api/actions/GetWMIsForManufacturer.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeVin\r\n * @category Actions\r\n * @description DecodeVin NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVin](module-api_actions_DecodeVin.DecodeVin.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinResponse](#DecodeVinResponse)\r\n * > - Type: [DecodeVinResults](#DecodeVinResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVin extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The DecodeVin API Action will decode the VIN and the decoded output will be made available in the format of Key-value pairs.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This API also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n * - The 9th digit is not necessary.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVin(\r\n vin: string,\r\n params?: {\r\n modelYear?: number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVin';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVin\r\n * @alias DecodeVinResults\r\n */\r\nexport type DecodeVinResults = {\r\n Value: string | null;\r\n ValueId: string | null;\r\n Variable: string;\r\n VariableId: number;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVin API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVin\r\n * @alias DecodeVinResponse\r\n */\r\nexport type DecodeVinResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVinExtended\r\n * @category Actions\r\n * @description DecodeVinExtended NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinExtended](module-api_actions_DecodeVinExtended.DecodeVinExtended.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinExtendedResponse](#DecodeVinExtendedResponse)\r\n * > - Type: [DecodeVinExtendedResults](#DecodeVinExtendedResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinExtended extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This is exactly like the DecodeVin method but provides additional information on variables\r\n * related to other NHTSA programs like\r\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\r\n * - This will decode the VIN and the decoded output will be made available\r\n * in the format of Key-value pairs.\r\n * - In the returned 'Results` object:\r\n * - The IDs (VariableID and ValueID) represent the unique ID associated with the Variable/Value.\r\n * - In case of text variables, the ValueID is not applicable.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n * - The 9th digit is not necessary.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVinExtended(\r\n vin: string,\r\n params?: {\r\n modelYear?: string | number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinExtended';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinExtendedResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinExtended\r\n * @alias DecodeVinExtendedResults\r\n */\r\nexport type DecodeVinExtendedResults = {\r\n Value: string | null;\r\n ValueId: string | null;\r\n Variable: string;\r\n VariableId: number;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinExtended API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinExtended\r\n * @alias DecodeVinExtendedResponse\r\n */\r\nexport type DecodeVinExtendedResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVinValues\r\n * @category Actions\r\n * @description DecodeVinValues NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinValues](module-api_actions_DecodeVinValues.DecodeVinValues.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinValuesResponse](#DecodeVinValuesResponse)\r\n * > - Type: [DecodeVinValuesResults](#DecodeVinValuesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinValues extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The DecodeVinValues API Action will decode the VIN with the Results returned in a _flat file_ format.\r\n * - The Results will be made available in a flat file format of a single object containing\r\n * 'key: value' results.\r\n * - Providing params.modelYear allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeVinValues(\r\n vin: string,\r\n params?: {\r\n modelYear?: number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinValues';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (\r\n params?.modelYear &&\r\n typeofModelYear !== 'string' &&\r\n typeofModelYear !== 'number'\r\n ) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinValuesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinValues\r\n * @alias DecodeVinValuesResults\r\n */\r\nexport type DecodeVinValuesResults = {\r\n /** Flat file format, single object containing keys and values of type string */\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinValues API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinValues\r\n * @alias DecodeVinValuesResponse\r\n */\r\nexport type DecodeVinValuesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /**\r\n * The search results returned by the NHSTA API request.\r\n * Flat file format, single object containing keys and values of type string\r\n * */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVINValuesBatch\r\n * @category Actions\r\n * @description DecodeVINValuesBatch NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVINValuesBatch](module-api_actions_DecodeVINValuesBatch.DecodeVINValuesBatch.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVINValuesBatchResponse](#DecodeVINValuesBatchResponse)\r\n * > - Type: [DecodeVINValuesBatchResults](#DecodeVINValuesBatchResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVINValuesBatch extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This decodes a batch of VINs that are submitted in a standardized format in a string\r\n * and returns multiple decodes in a flat format.\r\n *\r\n * The `inputString` parameter should be in the following format:\r\n * - `vin , modelYear ; vin , modelYear ; vin , modelYear ...`\r\n *\r\n * \"modelYear\" is optional, the output for each VIN decode is in the same format as produced by the \"Decode VIN (flat format)\" method.\r\n *\r\n * @async\r\n * @param {string} inputString - A string of Vehicle Identification Numbers (full or partial) following the format listed in the description.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVINValuesBatch(\r\n inputString: string\r\n ): Promise {\r\n const action = 'DecodeVINValuesBatch';\r\n\r\n /* Runtime typechecking */\r\n const typeofInputString = getTypeof(inputString);\r\n if (typeofInputString !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"inputString\" argument is required and must be of type string, got: ` +\r\n `<${typeofInputString}> ${inputString}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/`;\r\n\r\n const body = encodeURI(`DATA=${inputString}&format=json`);\r\n\r\n /* Return the result */\r\n return await this.get(url, {\r\n method: 'POST',\r\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\r\n body,\r\n })\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVINValuesBatchResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVINValuesBatch\r\n * @alias DecodeVINValuesBatchResults\r\n */\r\nexport type DecodeVINValuesBatchResults = {\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVINValuesBatch API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVINValuesBatch\r\n * @alias DecodeVINValuesBatchResponse\r\n */\r\nexport type DecodeVINValuesBatchResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVinValuesExtended\r\n * @category Actions\r\n * @description DecodeVinValuesExtended NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinValuesExtended](module-api_actions_DecodeVinValuesExtended.DecodeVinValuesExtended.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinValuesExtendedResponse](#DecodeVinValuesExtendedResponse)\r\n * > - Type: [DecodeVinValuesExtendedResults](#DecodeVinValuesExtendedResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinValuesExtended extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This is exactly like the DecodeVinValues (flat format Results) method but provides additional information\r\n * on variables related to other NHTSA programs like\r\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\r\n * - The Results will be made available in a flat file format of a single object containing\r\n * 'key: value' results.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @reje\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeVinValuesExtended(\r\n vin: string,\r\n params?: {\r\n modelYear?: string | number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinValuesExtended';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinValuesExtendedResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinValuesExtended\r\n * @alias DecodeVinValuesExtendedResults\r\n */\r\nexport type DecodeVinValuesExtendedResults = {\r\n /** Flat file format, single object containing keys and values of type string */\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinValuesExtended API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinValuesExtended\r\n * @alias DecodeVinValuesExtendedResponse\r\n */\r\nexport type DecodeVinValuesExtendedResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /**\r\n * The search results returned by the NHSTA API request.\r\n * Flat file format, single object containing keys and values of type string\r\n * */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeWMI\r\n * @category Actions\r\n * @description DecodeWMI NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeWMI](module-api_actions_DecodeWMI.DecodeWMI.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeWMIResponse](#DecodeWMIResponse)\r\n * > - Type: [DecodeWMIResults](#DecodeWMIResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeWMI extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides information on the World Manufacturer Identifier for a specific WMI code.\r\n * - `WMI` may be put in as either 3 characters representing VIN position 1-3 or 6 characters\r\n * representing VIN positions 1-3 & 12-14. Example \"JTD\", \"1T9131\".\r\n *\r\n * @async\r\n * @param {string} WMI - World Manufacturer Identifier.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeWMI(WMI: string): Promise {\r\n const action = 'DecodeWMI';\r\n\r\n /* Runtime typechecking */\r\n const typeofWMI = getTypeof(WMI);\r\n if (typeofWMI !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"WMI\" argument is required and must be of type string, got: ` +\r\n `<${typeofWMI}> ${WMI}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${WMI}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeWMIResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeWMI\r\n * @alias DecodeWMIResults\r\n */\r\nexport type DecodeWMIResults = {\r\n CommonName: string;\r\n CreatedOn: string;\r\n DateAvailableToPublic: string;\r\n Make: string;\r\n ManufacturerName: string;\r\n ParentCompanyName: string;\r\n URL: string;\r\n UpdatedOn: string;\r\n VehicleType: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeWMI API Action.\r\n *\r\n * @memberof module:api/actions/DecodeWMI\r\n * @alias DecodeWMIResponse\r\n */\r\nexport type DecodeWMIResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetAllMakes\r\n * @category Actions\r\n * @description GetAllMakes NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetAllMakes](module-api_actions_GetAllMakes.GetAllMakes.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetAllMakesResponse](#GetAllMakesResponse)\r\n * > - Type: [GetAllMakesResults](#GetAllMakesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetAllMakes extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Makes available in the vPIC Dataset.\r\n *\r\n * @async\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetAllMakes(): Promise {\r\n const action = 'GetAllMakes';\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetAllMakesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetAllMakes\r\n * @alias GetAllMakesResults\r\n */\r\nexport type GetAllMakesResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetAllMakes API Action.\r\n *\r\n * @memberof module:api/actions/GetAllMakes\r\n * @alias GetAllMakesResponse\r\n */\r\nexport type GetAllMakesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetAllManufacturers\r\n * @category Actions\r\n * @description GetAllManufacturers NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetAllManufacturers](module-api_actions_GetAllManufacturers.GetAllManufacturers.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetAllManufacturersResponse](#GetAllManufacturersResponse)\r\n * > - Type: [GetAllManufacturersResults](#GetAllManufacturersResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetAllManufacturers extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Manufacturers available in vPIC Dataset.\r\n * - `params.manufacturerType` allows the user to filter the list based on manufacturer type,\r\n * ('Incomplete Vehicles', 'Completed Vehicle Manufacturer', 'Incomplete Vehicle Manufacturer',\r\n * 'Intermediate Manufacturer', 'Final-Stage Manufacturer', 'Alterer', or any partial match of those strings).\r\n * - You can get a list of all manufacturer types with the following API Action:\r\n * `GetVehicleVariableValuesList('manufacturer type')`\r\n * - Results are provided in pages of 100 items.\r\n * - Provide a number value for `params.page` to specify 1st (default), 2nd, 3rd, Nth, etc page.\r\n *\r\n * @async\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string} [params.manufacturerType] - See method description.\r\n * @param {number} [params.page] - Specify the page number (results returned 100 at a time).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetAllManufacturers(\r\n params: {\r\n manufacturerType?: string;\r\n page?: number;\r\n } = {}\r\n ): Promise {\r\n const action = 'GetAllManufacturers';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofManufacturerType = getTypeof(params.manufacturerType);\r\n if (params.manufacturerType && typeofManufacturerType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.manufacturerType\" argument must be of type string, got: ` +\r\n `<${typeofManufacturerType}> ${params.manufacturerType}`\r\n )\r\n );\r\n }\r\n\r\n const typeofPage = getTypeof(params.page);\r\n if (params.page && typeofPage !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.page\" argument must be of type number, got: ` +\r\n `<${typeofPage}> ${params.page}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetAllManufacturersResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetAllManufacturers\r\n * @alias GetAllManufacturersResults\r\n */\r\nexport type GetAllManufacturersResults = {\r\n Country: string;\r\n Mfr_CommonName: string;\r\n Mfr_ID: number;\r\n Mfr_Name: string;\r\n VehicleTypes: Array<{ isPrimary?: boolean; name?: string }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetAllManufacturers API Action.\r\n *\r\n * @memberof module:api/actions/GetAllManufacturers\r\n * @alias GetAllManufacturersResponse\r\n */\r\nexport type GetAllManufacturersResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetCanadianVehicleSpecifications\r\n * @category Actions\r\n * @description GetCanadianVehicleSpecifications NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetCanadianVehicleSpecifications](module-api_actions_GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetCanadianVehicleSpecificationsResponse](#GetCanadianVehicleSpecificationsResponse)\r\n * > - Type: [GetCanadianVehicleSpecificationsResults](#GetCanadianVehicleSpecificationsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetCanadianVehicleSpecifications extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The Canadian Vehicle Specifications (CVS) consists of a database of original vehicle dimensions,\r\n * used primarily in collision investigation and reconstruction, combined with a search engine.\r\n *\r\n * The database is compiled annually by the Collision Investigation and Research Division of Transport Canada.\r\n * Visit official [Canadian Vehicle Specifications](http://www.carsp.ca/research/resources/safety-sources/canadian-vehicle-specifications/)\r\n * page for more details.\r\n *\r\n * This API action will return a 404 html error if any of the query parameters in params\r\n * are missing from the query string. This is the only API action with this behaviour. Therefore,\r\n * parameters are inserted into the query string as empty strings if not provided by the user.\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle (required) - Number, >= 1971.\r\n * @param {string} [params.make] - Vehicle's make, like \"Honda\", \"Toyota\", etc...\r\n * @param {string} [params.model] - Vehicle's model, like \"Pilot\", \"Focus\". Can also include some other elements like Body Type, Engine Model/size, etc...\r\n * @param {string} [params.units] - \"Metric\" (default), or \"US\" for United States customary units.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetCanadianVehicleSpecifications(params: {\r\n year: number;\r\n make?: string;\r\n model?: string;\r\n units?: string;\r\n }): Promise {\r\n const action = 'GetCanadianVehicleSpecifications';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n const typeofMake = getTypeof(params.make);\r\n if (params.make && typeofMake !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.make\" argument must be of type string, got: ` +\r\n `<${typeofMake}> ${params.make}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModel = getTypeof(params.model);\r\n if (params.model && typeofModel !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.model\" argument must be of type string, got: ` +\r\n `<${typeofModel}> ${params.model}`\r\n )\r\n );\r\n }\r\n\r\n const typeofUnits = getTypeof(params.units);\r\n if (params.units && typeofUnits !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.units\" argument must be of type string, got: ` +\r\n `<${typeofUnits}> ${params.units}`\r\n )\r\n );\r\n }\r\n\r\n /* Set default query parameters to empty strings if not provided by the user */\r\n const make = params.make || '';\r\n const model = params.model || '';\r\n const units = params.units || '';\r\n\r\n const params_ = {\r\n year: params.year,\r\n make,\r\n model,\r\n units,\r\n };\r\n\r\n /*\r\n * Build the 'default' query string to be appended to the URL.\r\n *\r\n * Additionally, sets the allowEmptyStringValues option (2nd argument) to true because\r\n * this API action will return a 404 error if any of the query parameters are missing from the query string.\r\n * This is the only API action with this behaviour (\"year\" is the only param the user must provide).\r\n */\r\n const queryString = await this.buildQueryString(\r\n params_,\r\n true\r\n ).catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetCanadianVehicleSpecificationsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\r\n * @alias GetCanadianVehicleSpecificationsResults\r\n */\r\nexport type GetCanadianVehicleSpecificationsResults = {\r\n Specs: Array<{\r\n Name: string;\r\n Value: string;\r\n }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetCanadianVehicleSpecifications API Action.\r\n *\r\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\r\n * @alias GetCanadianVehicleSpecificationsResponse\r\n */\r\nexport type GetCanadianVehicleSpecificationsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetEquipmentPlantCodes\r\n * @category Actions\r\n * @description GetEquipmentPlantCodes NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetEquipmentPlantCodes](module-api_actions_GetEquipmentPlantCodes.GetEquipmentPlantCodes.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetEquipmentPlantCodesResponse](#GetEquipmentPlantCodesResponse)\r\n * > - Type: [GetEquipmentPlantCodesResults](#GetEquipmentPlantCodesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetEquipmentPlantCodes extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * Returns assigned Equipment Plant Codes. Can be filtered by Year, Equipment Type and Report Type.\r\n *\r\n * `params.year`:\r\n * - Only years >= 2016 are supported\r\n *\r\n * `params.equipmentType`:\r\n * - 1 (Tires)\r\n * - 3 (Brake Hoses)\r\n * - 13 (Glazing)\r\n * - 16 (Retread)\r\n *\r\n * `params.reportType`:\r\n * - 'New' (The Equipment Plant Code was assigned during the selected year).\r\n * - 'Updated' (The Equipment Plant data was modified during the selected year).\r\n * - 'Closed' (The Equipment Plant is no longer Active).\r\n * - 'All' (All Equipment Plant Codes regardless of year, including their status (active or closed)).\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\r\n * @param {number} params.equipmentType - Number equal to 1, 3, 13, or 16.\r\n * @param {string} params.reportType - 'New', 'Updated', 'Closed', or 'All'.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetEquipmentPlantCodes(params: {\r\n year: number;\r\n equipmentType: 1 | 3 | 13 | 16;\r\n reportType: 'New' | 'Updated' | 'Closed' | 'All';\r\n }): Promise {\r\n const action = 'GetEquipmentPlantCodes';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n const typeofEquipmentType = getTypeof(params.equipmentType);\r\n if (typeofEquipmentType !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.equipmentType\" argument is required and must be of type number, got: ` +\r\n `<${typeofEquipmentType}> ${params.equipmentType}`\r\n )\r\n );\r\n }\r\n\r\n const typeofReportType = getTypeof(params.reportType);\r\n if (typeofReportType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.reportType\" argument is required and must be of type string, got: ` +\r\n `<${typeofReportType}> ${params.reportType}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetEquipmentPlantCodesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetEquipmentPlantCodes\r\n * @alias GetEquipmentPlantCodesResults\r\n */\r\nexport type GetEquipmentPlantCodesResults = {\r\n Address: string;\r\n City: string;\r\n Country: string;\r\n DOTCode: string;\r\n Name: string;\r\n OldDotCode: string;\r\n PostalCode: string;\r\n StateProvince: string;\r\n Status: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetEquipmentPlantCodes API Action.\r\n *\r\n * @memberof module:api/actions/GetEquipmentPlantCodes\r\n * @alias GetEquipmentPlantCodesResponse\r\n */\r\nexport type GetEquipmentPlantCodesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetMakeForManufacturer\r\n * @category Actions\r\n * @description GetMakeForManufacturer NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakeForManufacturer](module-api_actions_GetMakeForManufacturer.GetMakeForManufacturer.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakeForManufacturerResponse](#GetMakeForManufacturerResponse)\r\n * > - Type: [GetMakeForManufacturerResults](#GetMakeForManufacturerResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakeForManufacturer extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified manufacturer that is requested.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\r\n * (it accepts a partial manufacturer name as an input).\r\n * - `manufacturer` name can be a partial name, or a full name for more specificity\r\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\r\n * - Multiple results are returned in case of multiple matches.\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetMakeForManufacturer(\r\n manufacturer: string | number\r\n ): Promise {\r\n const action = 'GetMakeForManufacturer';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakeForManufacturerResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakeForManufacturer\r\n * @alias GetMakeForManufacturerResults\r\n */\r\nexport type GetMakeForManufacturerResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Mfr_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakeForManufacturer API Action.\r\n *\r\n * @memberof module:api/actions/GetMakeForManufacturer\r\n * @alias GetMakeForManufacturerResponse\r\n */\r\nexport type GetMakeForManufacturerResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetMakesForManufacturerAndYear\r\n * @category Actions\r\n * @description GetMakesForManufacturerAndYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakesForManufacturerAndYear](module-api_actions_GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakesForManufacturerAndYearResponse](#GetMakesForManufacturerAndYearResponse)\r\n * > - Type: [GetMakesForManufacturerAndYearResults](#GetMakesForManufacturerAndYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakesForManufacturerAndYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified manufacturer,\r\n * and whose Year From and Year To range cover the specified year.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\r\n * (it accepts a partial manufacturer name as an input).\r\n * - Multiple results are returned in case of multiple matches.\r\n * - Manufacturer can be idenfitied by Id, a partial name, or a full name\r\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\r\n *\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetMakesForManufacturerAndYear(\r\n manufacturer: string | number,\r\n params: {\r\n year: number;\r\n }\r\n ): Promise {\r\n const action = 'GetMakesForManufacturerAndYear';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument is required and must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakesForManufacturerAndYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\r\n * @alias GetMakesForManufacturerAndYearResults\r\n */\r\nexport type GetMakesForManufacturerAndYearResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n MfrId: number;\r\n MfrName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakesForManufacturerAndYear API Action.\r\n *\r\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\r\n * @alias GetMakesForManufacturerAndYearResponse\r\n */\r\nexport type GetMakesForManufacturerAndYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetMakesForVehicleType\r\n * @category Actions\r\n * @description GetMakesForVehicleType NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakesForVehicleType](module-api_actions_GetMakesForVehicleType.GetMakesForVehicleType.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakesForVehicleTypeResponse](#GetMakesForVehicleTypeResponse)\r\n * > - Type: [GetMakesForVehicleTypeResults](#GetMakesForVehicleTypeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakesForVehicleType extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified vehicle type (`typeName`),\r\n * whose name is LIKE the vehicle type name in vPIC Dataset.\r\n * - Vehicle `typeName` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n * @param {string} typeName - A partial or full vehicle type name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetMakesForVehicleType(\r\n typeName: string\r\n ): Promise {\r\n const action = 'GetMakesForVehicleType';\r\n\r\n /* Runtime typechecking */\r\n const typeofTypeName = getTypeof(typeName);\r\n if (typeofTypeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"typeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofTypeName}> ${typeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${typeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakesForVehicleTypeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakesForVehicleType\r\n * @alias GetMakesForVehicleTypeResults\r\n */\r\nexport type GetMakesForVehicleTypeResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakesForVehicleType API Action.\r\n *\r\n * @memberof module:api/actions/GetMakesForVehicleType\r\n * @alias GetMakesForVehicleTypeResponse\r\n */\r\nexport type GetMakesForVehicleTypeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetManufacturerDetails\r\n * @category Actions\r\n * @description GetManufacturerDetails NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetManufacturerDetails](module-api_actions_GetManufacturerDetails.GetManufacturerDetails.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetManufacturerDetailsResponse](#GetManufacturerDetailsResponse)\r\n * > - Type: [GetManufacturerDetailsResults](#GetManufacturerDetailsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetManufacturerDetails extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides the details for a specific manufacturer that is requested.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name,\r\n * (it accepts a partial manufacturer name as an input).\r\n * - Multiple results are returned in case of multiple matches.\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetManufacturerDetails(\r\n manufacturer: string | number\r\n ): Promise {\r\n const action = 'GetManufacturerDetails';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetManufacturerDetailsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetManufacturerDetails\r\n * @alias GetManufacturerDetailsResults\r\n */\r\nexport type GetManufacturerDetailsResults = {\r\n Address: string;\r\n Address2: string;\r\n City: string;\r\n ContactEmail: string;\r\n ContactFax: string;\r\n ContactPhone: string;\r\n Country: string;\r\n DBAs: string;\r\n EquipmentItems: Array>;\r\n LastUpdated: string;\r\n ManufacturerTypes: Array<{\r\n Name: string;\r\n }>;\r\n Mfr_CommonName: string;\r\n Mfr_ID: number;\r\n Mfr_Name: string;\r\n OtherManufacturerDetails: string;\r\n PostalCode: string;\r\n PrimaryProduct: string;\r\n PrincipalFirstName: string;\r\n PrincipalLastName: string;\r\n PrincipalPosition: string;\r\n StateProvince: string;\r\n SubmittedName: string;\r\n SubmittedOn: string;\r\n SubmittedPosition: string;\r\n VehicleTypes: Array<{\r\n GVWRFrom: string;\r\n GVWRTo: string;\r\n IsPrimary: boolean;\r\n Name: string;\r\n }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetManufacturerDetails API Action.\r\n *\r\n * @memberof module:api/actions/GetManufacturerDetails\r\n * @alias GetManufacturerDetailsResponse\r\n */\r\nexport type GetManufacturerDetailsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMake\r\n * @category Actions\r\n * @description GetModelsForMake NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMake](module-api_actions_GetModelsForMake.GetModelsForMake.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeResponse](#GetModelsForMakeResponse)\r\n * > - Type: [GetModelsForMakeResults](#GetModelsForMakeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMake extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified `makeName`\r\n * whose Name is LIKE the Make in vPIC Dataset.\r\n * - `makeName` can be a partial, or a full for more specificity\r\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\r\n *\r\n * @async\r\n * @param {string} makeName - Vehicle make name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMake(makeName: string): Promise {\r\n const action = 'GetModelsForMake';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeName = getTypeof(makeName);\r\n if (typeofMakeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofMakeName}> ${makeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMake\r\n * @alias GetModelsForMakeResults\r\n */\r\nexport type GetModelsForMakeResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMake API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMake\r\n * @alias GetModelsForMakeResponse\r\n */\r\nexport type GetModelsForMakeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMakeId\r\n * @category Actions\r\n * @description GetModelsForMakeId NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeId](module-api_actions_GetModelsForMakeId.GetModelsForMakeId.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeIdResponse](#GetModelsForMakeIdResponse)\r\n * > - Type: [GetModelsForMakeIdResults](#GetModelsForMakeIdResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeId extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Make\r\n * whose Id is equal to the `makeId` in the vPIC Dataset.\r\n *\r\n * @async\r\n * @param {number} makeID - Vehicle make ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeId(\r\n makeID: number\r\n ): Promise {\r\n const action = 'GetModelsForMakeId';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeId = getTypeof(makeID);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeID}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString({}).catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeId\r\n * @alias GetModelsForMakeIdResults\r\n */\r\nexport type GetModelsForMakeIdResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeId API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeId\r\n * @alias GetModelsForMakeIdResponse\r\n */\r\nexport type GetModelsForMakeIdResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMakeIdYear\r\n * @category Actions\r\n * @description GetModelsForMakeIdYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeIdYear](module-api_actions_GetModelsForMakeIdYear.GetModelsForMakeIdYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeIdYearResponse](#GetModelsForMakeIdYearResponse)\r\n * > - Type: [GetModelsForMakeIdYearResults](#GetModelsForMakeIdYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeIdYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Model Year\r\n * and Make whose name is LIKE the Make in the vPIC Dataset.\r\n * - `params.makeId` is a number and is a required query parameter.\r\n *\r\n * A minimum of one of the following are required (or a combination of both):\r\n * - `params.modelYear` is a number (greater than 1995)\r\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.makeId - Make ID to search.\r\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\r\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeIdYear(params: {\r\n makeId: number;\r\n modelYear?: number;\r\n vehicleType?: string;\r\n }): Promise {\r\n const action = 'GetModelsForMakeIdYear';\r\n\r\n const makeId: number = params?.makeId;\r\n const modelYear: number | undefined = params?.modelYear;\r\n const vehicleType: string | undefined = params?.vehicleType;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n /* Required makeId param of type number */\r\n const typeofMakeId = getTypeof(makeId);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeId}`\r\n )\r\n );\r\n }\r\n /* At least one of modelYear or vehicleType params is required */\r\n if (!modelYear && !vehicleType) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\r\n `${modelYear} | ${vehicleType}`\r\n )\r\n );\r\n }\r\n /* valid modelYear param of type number */\r\n const typeofModelYear = getTypeof(modelYear);\r\n if (modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" must be of type number, got: ` +\r\n `<${typeofModelYear}> ${modelYear}`\r\n )\r\n );\r\n }\r\n /* valid vehicleType param of type string */\r\n const typeofVehicleType = getTypeof(vehicleType);\r\n if (vehicleType && typeofVehicleType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\r\n `<${typeofVehicleType}> ${vehicleType}`\r\n )\r\n );\r\n }\r\n\r\n /* Beginning of the the actionUrl */\r\n let actionUrl = `${action}/makeId/${makeId}/`;\r\n\r\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\r\n if (modelYear && vehicleType) {\r\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\r\n } else if (modelYear) {\r\n actionUrl += `modelYear/${modelYear}`;\r\n } else {\r\n actionUrl += `vehicleType/${vehicleType}`;\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeIdYear\r\n * @alias GetModelsForMakeIdYearResults\r\n */\r\nexport type GetModelsForMakeIdYearResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeIdYear API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeIdYear\r\n * @alias GetModelsForMakeIdYearResponse\r\n */\r\nexport type GetModelsForMakeIdYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMakeYear\r\n * @category Actions\r\n * @description GetModelsForMakeYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeYear](module-api_actions_GetModelsForMakeYear.GetModelsForMakeYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeYearResponse](#GetModelsForMakeYearResponse)\r\n * > - Type: [GetModelsForMakeYearResults](#GetModelsForMakeYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Model Year\r\n * and Make whose name is LIKE the Make in the vPIC Dataset.\r\n * - `params.make` is required. It can be a partial, or a full name for more specificity\r\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\r\n *\r\n * A minimum of one of the following are required (or a combination of both):\r\n * - `params.modelYear` is a number (greater than 1995)\r\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n *\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {string} params.make - Make name to search.\r\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\r\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\r\n *\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeYear(params: {\r\n make: string;\r\n modelYear?: number;\r\n vehicleType?: string;\r\n }): Promise {\r\n const action = 'GetModelsForMakeYear';\r\n\r\n const make: string = params?.make;\r\n const modelYear: number | undefined = params?.modelYear;\r\n const vehicleType: string | undefined = params?.vehicleType;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n /* Required make param of type string */\r\n const typeofMake = getTypeof(make);\r\n if (typeofMake !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.make\" argument is required and must be of type string, got: ` +\r\n `<${typeofMake}> ${make}`\r\n )\r\n );\r\n }\r\n /* At least one of modelYear or vehicleType params is required */\r\n if (!modelYear && !vehicleType) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\r\n `${modelYear} | ${vehicleType}`\r\n )\r\n );\r\n }\r\n /* valid modelYear param of type number */\r\n const typeofModelYear = getTypeof(modelYear);\r\n if (modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" must be of type number, got: ` +\r\n `<${typeofModelYear}> ${modelYear}`\r\n )\r\n );\r\n }\r\n /* valid vehicleType param of type string */\r\n const typeofVehicleType = getTypeof(vehicleType);\r\n if (vehicleType && typeofVehicleType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\r\n `<${typeofVehicleType}> ${vehicleType}`\r\n )\r\n );\r\n }\r\n\r\n /* Beginning of the the actionUrl */\r\n let actionUrl = `${action}/make/${params.make}/`;\r\n\r\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\r\n if (modelYear && vehicleType) {\r\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\r\n } else if (modelYear) {\r\n actionUrl += `modelYear/${modelYear}`;\r\n } else {\r\n actionUrl += `vehicleType/${vehicleType}`;\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeYear\r\n * @alias GetModelsForMakeYearResults\r\n */\r\nexport type GetModelsForMakeYearResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeYear API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeYear\r\n * @alias GetModelsForMakeYearResponse\r\n */\r\nexport type GetModelsForMakeYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetParts\r\n * @category Actions\r\n * @description GetParts NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetParts](module-api_actions_GetParts.GetParts.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetPartsResponse](#GetPartsResponse)\r\n * > - Type: [GetPartsResults](#GetPartsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetParts extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of ORGs with letter date in the given range of the dates\r\n * and with specified Type (`params.type`) of ORG.\r\n * - Up to 1000 results will be returned at a time.\r\n * - Get the next page by incrementing the `params.page` query parameter.\r\n * - All query `params` are optional.\r\n *\r\n * @async\r\n * @param {object} [params] - Query Search Parameters to append to the URL.\r\n * @param {number} [params.type] - Specified type of ORG to search.\r\n * @param {string} [params.fromDate] - Start date of search query.\r\n * @param {string} [params.toDate] - End date of search query.\r\n * @param {number} [params.page] - Which page number of results to request (100 results per page).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetParts(params?: {\r\n type?: number;\r\n fromDate?: string;\r\n toDate?: string;\r\n page?: number;\r\n }): Promise {\r\n const action = 'GetParts';\r\n\r\n const type: number | undefined = params?.type;\r\n const fromDate: string | undefined = params?.fromDate;\r\n const toDate: string | undefined = params?.toDate;\r\n const page: number | undefined = params?.page;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: <${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.type of type number */\r\n const typeofType = getTypeof(type);\r\n if (type && typeofType !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.type\" argument must be of type number, got: <${typeofType}> ${type}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.fromDate of type string */\r\n const typeofFromDate = getTypeof(fromDate);\r\n if (fromDate && typeofFromDate !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.fromDate\" argument must be of type string, got: <${typeofFromDate}> ${fromDate}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.toDate of type number */\r\n const typeofToDate = getTypeof(toDate);\r\n if (toDate && typeofToDate !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.toDate\" argument must be of type string, got: <${typeofToDate}> ${toDate}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.page of type number */\r\n const typeofPage = getTypeof(page);\r\n if (page && typeofPage !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.page\" argument must be of type number, got: <${typeofPage}> ${page}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetPartsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetParts\r\n * @alias GetPartsResults\r\n */\r\nexport type GetPartsResults = {\r\n CoverLetterURL: string;\r\n LetterDate: string;\r\n ManufacturerId: number;\r\n ManufacturerName: string;\r\n ModelYearFrom: string;\r\n ModelYearTo: string;\r\n Name: string;\r\n Type: string;\r\n URL: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetParts API Action.\r\n *\r\n * @memberof module:api/actions/GetParts\r\n * @alias GetPartsResponse\r\n */\r\nexport type GetPartsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleTypesForMake\r\n * @category Actions\r\n * @description GetVehicleTypesForMake NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleTypesForMake](module-api_actions_GetVehicleTypesForMake.GetVehicleTypesForMake.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleTypesForMakeResponse](#GetVehicleTypesForMakeResponse)\r\n * > - Type: [GetVehicleTypesForMakeResults](#GetVehicleTypesForMakeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleTypesForMake extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make,\r\n * whose name is LIKE the make name in the vPIC Dataset.\r\n * - `makeName` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\r\n *\r\n * @async\r\n * @param {string} makeName - Name of the vehicle make to search.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleTypesForMake(\r\n makeName: string\r\n ): Promise {\r\n const action = 'GetVehicleTypesForMake';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeName = getTypeof(makeName);\r\n if (typeofMakeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofMakeName}> ${makeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMake\r\n * @alias GetVehicleTypesForMakeResults\r\n */\r\nexport type GetVehicleTypesForMakeResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleTypesForMake API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMake\r\n * @alias GetVehicleTypesForMakeResponse\r\n */\r\nexport type GetVehicleTypesForMakeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleTypesForMakeId\r\n * @category Actions\r\n * @description GetVehicleTypesForMakeId NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleTypesForMakeId](module-api_actions_GetVehicleTypesForMakeId.GetVehicleTypesForMakeId.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleTypesForMakeIdResponse](#GetVehicleTypesForMakeIdResponse)\r\n * > - Type: [GetVehicleTypesForMakeIdResults](#GetVehicleTypesForMakeIdResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleTypesForMakeId extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make and\r\n * whose ID equals the make ID in the vPIC Dataset.\r\n *\r\n * @async\r\n * @param {number} makeID - Vehicle make ID.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleTypesForMakeId(\r\n makeID: number\r\n ): Promise {\r\n const action = 'GetVehicleTypesForMakeId';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeId = getTypeof(makeID);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeID}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeIdResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMakeId\r\n * @alias GetVehicleTypesForMakeIdResults\r\n */\r\nexport type GetVehicleTypesForMakeIdResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleTypesForMakeId API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMakeId\r\n * @alias GetVehicleTypesForMakeIdResponse\r\n */\r\nexport type GetVehicleTypesForMakeIdResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleVariableList\r\n * @category Actions\r\n * @description GetVehicleVariableList NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleVariableList](module-api_actions_GetVehicleVariableList.GetVehicleVariableList.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleVariableListResponse](#GetVehicleVariableListResponse)\r\n * > - Type: [GetVehicleVariableListResults](#GetVehicleVariableListResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleVariableList extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Vehicle related variables that are in the vPIC dataset.\r\n * - Information on the name, description and the type of the variable is provided.\r\n *\r\n * @async\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetVehicleVariableList(): Promise {\r\n const action = 'GetVehicleVariableList';\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleVariableListResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableList\r\n * @alias GetVehicleVariableListResults\r\n */\r\nexport type GetVehicleVariableListResults = {\r\n DataType: string;\r\n Description: string;\r\n ID: number;\r\n Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleVariableList API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableList\r\n * @alias GetVehicleVariableListResponse\r\n */\r\nexport type GetVehicleVariableListResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleVariableValuesList\r\n * @category Actions\r\n * @description GetVehicleVariableValuesList NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleVariableValuesList](module-api_actions_GetVehicleVariableValuesList.GetVehicleVariableValuesList.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleVariableValuesListResponse](#GetVehicleVariableValuesListResponse)\r\n * > - Type: [GetVehicleVariableValuesListResults](#GetVehicleVariableValuesListResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleVariableValuesList extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the accepted values for a given variable that are stored in the vPIC dataset.\r\n *\r\n * This applies to only \"Look up\" type of variables.\r\n * - `variableValue` can either be a:\r\n * - Variable Name (\"battery type\" in first example, please use full name, not just part of it),\r\n * - or Variable ID (number).\r\n *\r\n * @async\r\n * @param {string|number} variableValue - The variable you want to get a values list of.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleVariableValuesList(\r\n variableValue: string | number\r\n ): Promise {\r\n const action = 'GetVehicleVariableValuesList';\r\n\r\n /* Runtime typechecking */\r\n const typeofVariableValue = getTypeof(variableValue);\r\n if (typeofVariableValue !== 'string' && typeofVariableValue !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"variableValue\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofVariableValue}> ${variableValue}`\r\n )\r\n );\r\n }\r\n /* Encode to a valid URI string (space chars, etc.) if variableValue is a string*/\r\n if (typeofVariableValue === 'string') {\r\n variableValue = encodeURI(variableValue as string);\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${variableValue}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleVariableValuesListResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableValuesList\r\n * @alias GetVehicleVariableValuesListResults\r\n */\r\nexport type GetVehicleVariableValuesListResults = {\r\n ElementName: string;\r\n Id: number;\r\n Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleVariableValuesList API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableValuesList\r\n * @alias GetVehicleVariableValuesListResponse\r\n */\r\nexport type GetVehicleVariableValuesListResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetWMIsForManufacturer\r\n * @category Actions\r\n * @description GetWMIsForManufacturer NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetWMIsForManufacturer](module-api_actions_GetWMIsForManufacturer.GetWMIsForManufacturer.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetWMIsForManufacturerResponse](#GetWMIsForManufacturerResponse)\r\n * > - Type: [GetWMIsForManufacturerResults](#GetWMIsForManufacturerResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetWMIsForManufacturer extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * Provides information on the World Manufacturer Identifier (WMI) for a specified `manufacturer`.\r\n * - Only WMIs registered in vPICList are displayed.\r\n * - `manufacturer` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetWMIsForManufacturer(\r\n manufacturer: string\r\n ): Promise {\r\n const action = 'GetWMIsForManufacturer';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetWMIsForManufacturerResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetWMIsForManufacturer\r\n * @alias GetWMIsForManufacturerResults\r\n */\r\nexport type GetWMIsForManufacturerResults = {\r\n Country: string;\r\n CreatedOn: string;\r\n DateAvailableToPublic: string;\r\n Id: number;\r\n Name: string;\r\n UpdatedOn: string;\r\n VehicleType: string;\r\n WMI: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetWMIsForManufacturer API Action.\r\n *\r\n * @memberof module:api/actions/GetWMIsForManufacturer\r\n * @alias GetWMIsForManufacturerResponse\r\n */\r\nexport type GetWMIsForManufacturerResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,SAAU,SAAQA,WAAK;IAClC,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;;;;;;;IAkBK,SAAS,CACb,GAAW,EACX,MAEC;;YAED,MAAM,MAAM,GAAG,WAAW,CAAC;;YAG3B,MAAM,YAAY,GAAGC,eAAS,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,MAAM,IAAI,YAAY,KAAK,QAAQ,EAAE;gBACvC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,mDAAmD;oBAC1D,IAAI,YAAY,KAAK,MAAM,EAAE,CAChC,CACF,CAAC;aACH;YAED,MAAM,SAAS,GAAGA,eAAS,CAAC,GAAG,CAAC,CAAC;Y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AY,EAAE,CAC5C,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,YAAY,GAAG,WAAW,EAAE,CAAC;;YAGtE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/cjs/GetWMIsForManufacturer.js.map b/dist/cjs/GetWMIsForManufacturer.js.map index ae2378d8b..7f7ff029c 100644 --- a/dist/cjs/GetWMIsForManufacturer.js.map +++ b/dist/cjs/GetWMIsForManufacturer.js.map @@ -1 +1 @@ -{"version":3,"file":"GetWMIsForManufacturer.js","sources":["../../src/api/actions/GetWMIsForManufacturer.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetWMIsForManufacturer\r\n * @category Actions\r\n * @description GetWMIsForManufacturer NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetWMIsForManufacturer](module-api_actions_GetWMIsForManufacturer.GetWMIsForManufacturer.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetWMIsForManufacturerResponse](#GetWMIsForManufacturerResponse)\r\n * > - Type: [GetWMIsForManufacturerResults](#GetWMIsForManufacturerResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetWMIsForManufacturer extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * Provides information on the World Manufacturer Identifier (WMI) for a specified `manufacturer`.\r\n * - Only WMIs registered in vPICList are displayed.\r\n * - `manufacturer` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetWMIsForManufacturer(\r\n manufacturer: string\r\n ): Promise {\r\n const action = 'GetWMIsForManufacturer';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetWMIsForManufacturerResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetWMIsForManufacturer\r\n * @alias GetWMIsForManufacturerResults\r\n */\r\nexport type GetWMIsForManufacturerResults = {\r\n Country: string;\r\n CreatedOn: string;\r\n DateAvailableToPublic: string;\r\n Id: number;\r\n Name: string;\r\n UpdatedOn: string;\r\n VehicleType: string;\r\n WMI: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetWMIsForManufacturer API Action.\r\n *\r\n * @memberof module:api/actions/GetWMIsForManufacturer\r\n * @alias GetWMIsForManufacturerResponse\r\n */\r\nexport type GetWMIsForManufacturerResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;IAYK,sBAAsB,CAC1B,YAAoB;;YAEpB,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,kBAAkB,GAAGC,eAAS,CAAC,YAAY,CAAC,CAAC;YACnD,IAAI,kBAAkB,KAAK,QAAQ,EAAE;gBACnC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,yEAAyE;oBAChF,IAAI,kBAAkB,KAAK,YAAY,EAAE,CAC5C,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,YAAY,GAAG,WAAW,EAAE,CAAC;;YAGtE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file +{"version":3,"file":"GetWMIsForManufacturer.js","sources":["../../src/api/actions/GetWMIsForManufacturer.ts"],"sourcesContent":["/**\n * @module api/actions/GetWMIsForManufacturer\n * @category Actions\n * @description GetWMIsForManufacturer NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetWMIsForManufacturer](module-api_actions_GetWMIsForManufacturer.GetWMIsForManufacturer.html)\n * >\n * > **Types**\n * > - Type: [GetWMIsForManufacturerResponse](#GetWMIsForManufacturerResponse)\n * > - Type: [GetWMIsForManufacturerResults](#GetWMIsForManufacturerResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetWMIsForManufacturer extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * Provides information on the World Manufacturer Identifier (WMI) for a specified `manufacturer`.\n * - Only WMIs registered in vPICList are displayed.\n * - `manufacturer` can be a partial name, or a full name for more specificity\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name.\n * @returns {(Promise)} Api Response object.\n */\n async GetWMIsForManufacturer(\n manufacturer: string\n ): Promise {\n const action = 'GetWMIsForManufacturer';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetWMIsForManufacturerResponse}.Results' array.\n *\n * @memberof module:api/actions/GetWMIsForManufacturer\n * @alias GetWMIsForManufacturerResults\n */\nexport type GetWMIsForManufacturerResults = {\n Country: string;\n CreatedOn: string;\n DateAvailableToPublic: string;\n Id: number;\n Name: string;\n UpdatedOn: string;\n VehicleType: string;\n WMI: string;\n};\n\n/**\n * Type representing the complete response returned by the GetWMIsForManufacturer API Action.\n *\n * @memberof module:api/actions/GetWMIsForManufacturer\n * @alias GetWMIsForManufacturerResponse\n */\nexport type GetWMIsForManufacturerResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["Fetch","getTypeof"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAwBA;;;;;;;;MAQa,sBAAuB,SAAQA,WAAK;IAC/C,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;KACnB;;;;;;;;;;;IAYK,sBAAsB,CAC1B,YAAoB;;YAEpB,MAAM,MAAM,GAAG,wBAAwB,CAAC;;YAGxC,MAAM,kBAAkB,GAAGC,eAAS,CAAC,YAAY,CAAC,CAAC;YACnD,IAAI,kBAAkB,KAAK,QAAQ,EAAE;gBACnC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,GAAG,MAAM,yEAAyE;oBAChF,IAAI,kBAAkB,KAAK,YAAY,EAAE,CAC5C,CACF,CAAC;aACH;;YAGD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAC1D,OAAO,CAAC,MAAM,CACZ,IAAI,KAAK,CAAC,GAAG,MAAM,kCAAkC,GAAG,EAAE,CAAC,CAC5D,CACF,CAAC;;YAGF,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,YAAY,GAAG,WAAW,EAAE,CAAC;;YAGtE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;iBACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,KACT,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,wBAAwB,GAAG,EAAE,CAAC,CAAC,CAClE,CAAC;SACL;KAAA;;;;;"} \ No newline at end of file diff --git a/dist/cjs/NHTSA.js b/dist/cjs/NHTSA.js index 441ee626b..7fb1b6711 100644 --- a/dist/cjs/NHTSA.js +++ b/dist/cjs/NHTSA.js @@ -3,8 +3,31 @@ Object.defineProperty(exports, '__esModule', { value: true }); var Fetch = require('./Fetch-d7540537.js'); +var DecodeVin = require('./DecodeVin.js'); +var DecodeVinExtended = require('./DecodeVinExtended.js'); +var DecodeVinValues = require('./DecodeVinValues.js'); +var DecodeVINValuesBatch = require('./DecodeVINValuesBatch.js'); +var DecodeVinValuesExtended = require('./DecodeVinValuesExtended.js'); +var DecodeWMI = require('./DecodeWMI.js'); +var GetAllMakes = require('./GetAllMakes.js'); +var GetAllManufacturers = require('./GetAllManufacturers.js'); +var GetCanadianVehicleSpecifications = require('./GetCanadianVehicleSpecifications.js'); +var GetEquipmentPlantCodes = require('./GetEquipmentPlantCodes.js'); +var GetMakeForManufacturer = require('./GetMakeForManufacturer.js'); +var GetMakesForManufacturerAndYear = require('./GetMakesForManufacturerAndYear.js'); +var GetMakesForVehicleType = require('./GetMakesForVehicleType.js'); +var GetManufacturerDetails = require('./GetManufacturerDetails.js'); +var GetModelsForMake = require('./GetModelsForMake.js'); +var GetModelsForMakeId = require('./GetModelsForMakeId.js'); +var GetModelsForMakeIdYear = require('./GetModelsForMakeIdYear.js'); +var GetModelsForMakeYear = require('./GetModelsForMakeYear.js'); +var GetParts = require('./GetParts.js'); +var GetVehicleTypesForMake = require('./GetVehicleTypesForMake.js'); +var GetVehicleTypesForMakeId = require('./GetVehicleTypesForMakeId.js'); +var GetVehicleVariableList = require('./GetVehicleVariableList.js'); +var GetVehicleVariableValuesList = require('./GetVehicleVariableValuesList.js'); +var GetWMIsForManufacturer = require('./GetWMIsForManufacturer.js'); require('cross-fetch'); -var GetWMIsForManufacturer = require('./GetWMIsForManufacturer-90384d3e.js'); /** * @module api/NHTSA @@ -97,29 +120,29 @@ var GetWMIsForManufacturer = require('./GetWMIsForManufacturer-90384d3e.js'); class NHTSA extends Fetch.Fetch { constructor(userConfig) { super(userConfig); - this.DecodeVin = GetWMIsForManufacturer.DecodeVin.prototype.DecodeVin; - this.DecodeVinExtended = GetWMIsForManufacturer.DecodeVinExtended.prototype.DecodeVinExtended; - this.DecodeVinValues = GetWMIsForManufacturer.DecodeVinValues.prototype.DecodeVinValues; - this.DecodeVINValuesBatch = GetWMIsForManufacturer.DecodeVINValuesBatch.prototype.DecodeVINValuesBatch; - this.DecodeVinValuesExtended = GetWMIsForManufacturer.DecodeVinValuesExtended.prototype.DecodeVinValuesExtended; - this.DecodeWMI = GetWMIsForManufacturer.DecodeWMI.prototype.DecodeWMI; - this.GetAllMakes = GetWMIsForManufacturer.GetAllMakes.prototype.GetAllMakes; - this.GetAllManufacturers = GetWMIsForManufacturer.GetAllManufacturers.prototype.GetAllManufacturers; - this.GetCanadianVehicleSpecifications = GetWMIsForManufacturer.GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications; - this.GetEquipmentPlantCodes = GetWMIsForManufacturer.GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes; - this.GetMakeForManufacturer = GetWMIsForManufacturer.GetMakeForManufacturer.prototype.GetMakeForManufacturer; - this.GetMakesForManufacturerAndYear = GetWMIsForManufacturer.GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear; - this.GetMakesForVehicleType = GetWMIsForManufacturer.GetMakesForVehicleType.prototype.GetMakesForVehicleType; - this.GetManufacturerDetails = GetWMIsForManufacturer.GetManufacturerDetails.prototype.GetManufacturerDetails; - this.GetModelsForMake = GetWMIsForManufacturer.GetModelsForMake.prototype.GetModelsForMake; - this.GetModelsForMakeId = GetWMIsForManufacturer.GetModelsForMakeId.prototype.GetModelsForMakeId; - this.GetModelsForMakeIdYear = GetWMIsForManufacturer.GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear; - this.GetModelsForMakeYear = GetWMIsForManufacturer.GetModelsForMakeYear.prototype.GetModelsForMakeYear; - this.GetParts = GetWMIsForManufacturer.GetParts.prototype.GetParts; - this.GetVehicleTypesForMake = GetWMIsForManufacturer.GetVehicleTypesForMake.prototype.GetVehicleTypesForMake; - this.GetVehicleTypesForMakeId = GetWMIsForManufacturer.GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId; - this.GetVehicleVariableList = GetWMIsForManufacturer.GetVehicleVariableList.prototype.GetVehicleVariableList; - this.GetVehicleVariableValuesList = GetWMIsForManufacturer.GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList; + this.DecodeVin = DecodeVin.DecodeVin.prototype.DecodeVin; + this.DecodeVinExtended = DecodeVinExtended.DecodeVinExtended.prototype.DecodeVinExtended; + this.DecodeVinValues = DecodeVinValues.DecodeVinValues.prototype.DecodeVinValues; + this.DecodeVINValuesBatch = DecodeVINValuesBatch.DecodeVINValuesBatch.prototype.DecodeVINValuesBatch; + this.DecodeVinValuesExtended = DecodeVinValuesExtended.DecodeVinValuesExtended.prototype.DecodeVinValuesExtended; + this.DecodeWMI = DecodeWMI.DecodeWMI.prototype.DecodeWMI; + this.GetAllMakes = GetAllMakes.GetAllMakes.prototype.GetAllMakes; + this.GetAllManufacturers = GetAllManufacturers.GetAllManufacturers.prototype.GetAllManufacturers; + this.GetCanadianVehicleSpecifications = GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications; + this.GetEquipmentPlantCodes = GetEquipmentPlantCodes.GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes; + this.GetMakeForManufacturer = GetMakeForManufacturer.GetMakeForManufacturer.prototype.GetMakeForManufacturer; + this.GetMakesForManufacturerAndYear = GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear; + this.GetMakesForVehicleType = GetMakesForVehicleType.GetMakesForVehicleType.prototype.GetMakesForVehicleType; + this.GetManufacturerDetails = GetManufacturerDetails.GetManufacturerDetails.prototype.GetManufacturerDetails; + this.GetModelsForMake = GetModelsForMake.GetModelsForMake.prototype.GetModelsForMake; + this.GetModelsForMakeId = GetModelsForMakeId.GetModelsForMakeId.prototype.GetModelsForMakeId; + this.GetModelsForMakeIdYear = GetModelsForMakeIdYear.GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear; + this.GetModelsForMakeYear = GetModelsForMakeYear.GetModelsForMakeYear.prototype.GetModelsForMakeYear; + this.GetParts = GetParts.GetParts.prototype.GetParts; + this.GetVehicleTypesForMake = GetVehicleTypesForMake.GetVehicleTypesForMake.prototype.GetVehicleTypesForMake; + this.GetVehicleTypesForMakeId = GetVehicleTypesForMakeId.GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId; + this.GetVehicleVariableList = GetVehicleVariableList.GetVehicleVariableList.prototype.GetVehicleVariableList; + this.GetVehicleVariableValuesList = GetVehicleVariableValuesList.GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList; this.GetWMIsForManufacturer = GetWMIsForManufacturer.GetWMIsForManufacturer.prototype.GetWMIsForManufacturer; } } diff --git a/dist/cjs/NHTSA.js.map b/dist/cjs/NHTSA.js.map index 82c31fd93..bc7bd5546 100644 --- a/dist/cjs/NHTSA.js.map +++ b/dist/cjs/NHTSA.js.map @@ -1 +1 @@ -{"version":3,"file":"NHTSA.js","sources":["../../src/api/NHTSA.ts"],"sourcesContent":["/**\r\n * @module api/NHTSA\r\n * @category API\r\n * @description Module exporting the main (NHSTA) class for API Actions.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [NHTSA](NHTSA.html#NHTSA) - Class that implements all NHTSA API Actions\r\n */\r\n\r\nimport { Fetch /* Class */, FetchConfig /* Type */ } from './Fetch';\r\n\r\n/* Import implemented API Action classes */\r\nimport {\r\n DecodeVin,\r\n DecodeVinExtended,\r\n DecodeVinValues,\r\n DecodeVINValuesBatch,\r\n DecodeVinValuesExtended,\r\n DecodeWMI,\r\n GetAllMakes,\r\n GetAllManufacturers,\r\n GetCanadianVehicleSpecifications,\r\n GetEquipmentPlantCodes,\r\n GetMakeForManufacturer,\r\n GetMakesForManufacturerAndYear,\r\n GetMakesForVehicleType,\r\n GetManufacturerDetails,\r\n GetModelsForMake,\r\n GetModelsForMakeId,\r\n GetModelsForMakeIdYear,\r\n GetModelsForMakeYear,\r\n GetParts,\r\n GetVehicleTypesForMake,\r\n GetVehicleTypesForMakeId,\r\n GetVehicleVariableList,\r\n GetVehicleVariableValuesList,\r\n GetWMIsForManufacturer,\r\n} from './actions';\r\n\r\n/**\r\n * @class NHTSA\r\n * @augments module:api/Fetch.Fetch\r\n * @category API\r\n *\r\n * @param {FetchConfig} [userConfig] - Configuration options to construct the class with.\r\n *\r\n * @implements {module:api/actions/DecodeVin.DecodeVin}\r\n * @implements {module:api/actions/DecodeVinExtended.DecodeVinExtended}\r\n * @implements {module:api/actions/DecodeVinValues.DecodeVinValues}\r\n * @implements {module:api/actions/DecodeVinValuesExtended.DecodeVinValuesExtended}\r\n * @implements {module:api/actions/DecodeWMI.DecodeWMI}\r\n * @implements {module:api/actions/GetAllMakes.GetAllMakes}\r\n * @implements {module:api/actions/GetAllManufacturers.GetAllManufacturers}\r\n * @implements {module:api/actions/GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications}\r\n * @implements {module:api/actions/GetEquipmentPlantCodes.GetEquipmentPlantCodes}\r\n * @implements {module:api/actions/GetMakeForManufacturer.GetMakeForManufacturer}\r\n * @implements {module:api/actions/GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear}\r\n * @implements {module:api/actions/GetMakesForVehicleType.GetMakesForVehicleType}\r\n * @implements {module:api/actions/GetManufacturerDetails.GetManufacturerDetails}\r\n * @implements {module:api/actions/GetModelsForMake.GetModelsForMake}\r\n * @implements {module:api/actions/GetModelsForMakeId.GetModelsForMakeId}\r\n * @implements {module:api/actions/GetModelsForMakeIdYear.GetModelsForMakeIdYear}\r\n * @implements {module:api/actions/GetModelsForMakeYear.GetModelsForMakeYear}\r\n * @implements {module:api/actions/GetParts.GetParts}\r\n * @implements {module:api/actions/GetVehicleTypesForMake.GetVehicleTypesForMake}\r\n * @implements {module:api/actions/GetVehicleTypesForMakeId.GetVehicleTypesForMakeId}\r\n * @implements {module:api/actions/GetVehicleVariableList.GetVehicleVariableList}\r\n * @implements {module:api/actions/GetVehicleVariableValuesList.GetVehicleVariableValuesList}\r\n * @implements {module:api/actions/GetWMIsForManufacturer.GetWMIsForManufacturer}\r\n *\r\n * @example Node bundle\r\n * const { NHTSA } = require('@shaggytools/nhtsa-api-wrapper');\r\n *\r\n * const Wrapper = new NHTSA();\r\n *\r\n * // Decode a VIN and return a response of type ApiResponse\r\n * const response = Wrapper.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\r\n *\r\n * // or get details about a specific manufacturer, plus 23 other available Actions.\r\n * const hondaDetails = Wrapper.GetManufacturerDetails('Honda').catch(error => error)\r\n *\r\n * @example Browser bundle\r\n * // Change to specific version number \"x.x.xx\",\r\n * // or remove completely for the most recently published version\r\n * /dist/bundle.min.js\"\r\n * >\r\n *\r\n * \r\n *\r\n * @example Module - Node lazy loading\r\n * const { NHTSA } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\r\n * .catch(err => err);\r\n *\r\n * const ApiClient = new NHTSA();\r\n *\r\n * const results = await ApiClient.DecodeVin('3VWD07AJ5EM388202')\r\n * .catch(err => err)\r\n *\r\n * @example Module - Browser lazy loading\r\n * \r\n */\r\nclass NHTSA\r\n extends Fetch\r\n implements\r\n DecodeVin,\r\n DecodeVinExtended,\r\n DecodeVinValues,\r\n DecodeVINValuesBatch,\r\n DecodeVinValuesExtended,\r\n DecodeWMI,\r\n GetAllMakes,\r\n GetAllManufacturers,\r\n GetCanadianVehicleSpecifications,\r\n GetEquipmentPlantCodes,\r\n GetMakeForManufacturer,\r\n GetMakesForManufacturerAndYear,\r\n GetMakesForVehicleType,\r\n GetManufacturerDetails,\r\n GetModelsForMake,\r\n GetModelsForMakeId,\r\n GetModelsForMakeIdYear,\r\n GetModelsForMakeYear,\r\n GetParts,\r\n GetVehicleTypesForMake,\r\n GetVehicleTypesForMakeId,\r\n GetVehicleVariableList,\r\n GetVehicleVariableValuesList,\r\n GetWMIsForManufacturer {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n DecodeVin = DecodeVin.prototype.DecodeVin;\r\n\r\n DecodeVinExtended = DecodeVinExtended.prototype.DecodeVinExtended;\r\n\r\n DecodeVinValues = DecodeVinValues.prototype.DecodeVinValues;\r\n\r\n DecodeVINValuesBatch = DecodeVINValuesBatch.prototype.DecodeVINValuesBatch;\r\n\r\n DecodeVinValuesExtended =\r\n DecodeVinValuesExtended.prototype.DecodeVinValuesExtended;\r\n\r\n DecodeWMI = DecodeWMI.prototype.DecodeWMI;\r\n\r\n GetAllMakes = GetAllMakes.prototype.GetAllMakes;\r\n\r\n GetAllManufacturers = GetAllManufacturers.prototype.GetAllManufacturers;\r\n\r\n GetCanadianVehicleSpecifications =\r\n GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications;\r\n\r\n GetEquipmentPlantCodes =\r\n GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes;\r\n\r\n GetMakeForManufacturer =\r\n GetMakeForManufacturer.prototype.GetMakeForManufacturer;\r\n\r\n GetMakesForManufacturerAndYear =\r\n GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear;\r\n\r\n GetMakesForVehicleType =\r\n GetMakesForVehicleType.prototype.GetMakesForVehicleType;\r\n\r\n GetManufacturerDetails =\r\n GetManufacturerDetails.prototype.GetManufacturerDetails;\r\n\r\n GetModelsForMake = GetModelsForMake.prototype.GetModelsForMake;\r\n\r\n GetModelsForMakeId = GetModelsForMakeId.prototype.GetModelsForMakeId;\r\n\r\n GetModelsForMakeIdYear =\r\n GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear;\r\n\r\n GetModelsForMakeYear = GetModelsForMakeYear.prototype.GetModelsForMakeYear;\r\n\r\n GetParts = GetParts.prototype.GetParts;\r\n\r\n GetVehicleTypesForMake =\r\n GetVehicleTypesForMake.prototype.GetVehicleTypesForMake;\r\n\r\n GetVehicleTypesForMakeId =\r\n GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId;\r\n\r\n GetVehicleVariableList =\r\n GetVehicleVariableList.prototype.GetVehicleVariableList;\r\n\r\n GetVehicleVariableValuesList =\r\n GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList;\r\n\r\n GetWMIsForManufacturer =\r\n GetWMIsForManufacturer.prototype.GetWMIsForManufacturer;\r\n}\r\n\r\nexport { NHTSA };\r\n"],"names":["Fetch","DecodeVin","DecodeVinExtended","DecodeVinValues","DecodeVINValuesBatch","DecodeVinValuesExtended","DecodeWMI","GetAllMakes","GetAllManufacturers","GetCanadianVehicleSpecifications","GetEquipmentPlantCodes","GetMakeForManufacturer","GetMakesForManufacturerAndYear","GetMakesForVehicleType","GetManufacturerDetails","GetModelsForMake","GetModelsForMakeId","GetModelsForMakeIdYear","GetModelsForMakeYear","GetParts","GetVehicleTypesForMake","GetVehicleTypesForMakeId","GetVehicleVariableList","GetVehicleVariableValuesList","GetWMIsForManufacturer"],"mappings":";;;;;;;;AAAA;;;;;;;;AAuCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,MAAM,KACJ,SAAQA,WAAK;IA0Bb,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;QAEpB,cAAS,GAAGC,gCAAS,CAAC,SAAS,CAAC,SAAS,CAAC;QAE1C,sBAAiB,GAAGC,wCAAiB,CAAC,SAAS,CAAC,iBAAiB,CAAC;QAElE,oBAAe,GAAGC,sCAAe,CAAC,SAAS,CAAC,eAAe,CAAC;QAE5D,yBAAoB,GAAGC,2CAAoB,CAAC,SAAS,CAAC,oBAAoB,CAAC;QAE3E,4BAAuB,GACrBC,8CAAuB,CAAC,SAAS,CAAC,uBAAuB,CAAC;QAE5D,cAAS,GAAGC,gCAAS,CAAC,SAAS,CAAC,SAAS,CAAC;QAE1C,gBAAW,GAAGC,kCAAW,CAAC,SAAS,CAAC,WAAW,CAAC;QAEhD,wBAAmB,GAAGC,0CAAmB,CAAC,SAAS,CAAC,mBAAmB,CAAC;QAExE,qCAAgC,GAC9BC,uDAAgC,CAAC,SAAS,CAAC,gCAAgC,CAAC;QAE9E,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,mCAA8B,GAC5BC,qDAA8B,CAAC,SAAS,CAAC,8BAA8B,CAAC;QAE1E,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,qBAAgB,GAAGC,uCAAgB,CAAC,SAAS,CAAC,gBAAgB,CAAC;QAE/D,uBAAkB,GAAGC,yCAAkB,CAAC,SAAS,CAAC,kBAAkB,CAAC;QAErE,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,yBAAoB,GAAGC,2CAAoB,CAAC,SAAS,CAAC,oBAAoB,CAAC;QAE3E,aAAQ,GAAGC,+BAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC;QAEvC,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,6BAAwB,GACtBC,+CAAwB,CAAC,SAAS,CAAC,wBAAwB,CAAC;QAE9D,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,iCAA4B,GAC1BC,mDAA4B,CAAC,SAAS,CAAC,4BAA4B,CAAC;QAEtE,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;KA5DzD;;;;;"} \ No newline at end of file +{"version":3,"file":"NHTSA.js","sources":["../../src/api/NHTSA.ts"],"sourcesContent":["/**\n * @module api/NHTSA\n * @category API\n * @description Module exporting the main (NHSTA) class for API Actions.\n *\n * > **Module Exports**:\n * > - Class: [NHTSA](NHTSA.html#NHTSA) - Class that implements all NHTSA API Actions\n */\n\nimport { Fetch /* Class */, FetchConfig /* Type */ } from './Fetch';\n\n/* Import implemented API Action classes */\nimport {\n DecodeVin,\n DecodeVinExtended,\n DecodeVinValues,\n DecodeVINValuesBatch,\n DecodeVinValuesExtended,\n DecodeWMI,\n GetAllMakes,\n GetAllManufacturers,\n GetCanadianVehicleSpecifications,\n GetEquipmentPlantCodes,\n GetMakeForManufacturer,\n GetMakesForManufacturerAndYear,\n GetMakesForVehicleType,\n GetManufacturerDetails,\n GetModelsForMake,\n GetModelsForMakeId,\n GetModelsForMakeIdYear,\n GetModelsForMakeYear,\n GetParts,\n GetVehicleTypesForMake,\n GetVehicleTypesForMakeId,\n GetVehicleVariableList,\n GetVehicleVariableValuesList,\n GetWMIsForManufacturer,\n} from './actions';\n\n/**\n * @class NHTSA\n * @augments module:api/Fetch.Fetch\n * @category API\n *\n * @param {FetchConfig} [userConfig] - Configuration options to construct the class with.\n *\n * @implements {module:api/actions/DecodeVin.DecodeVin}\n * @implements {module:api/actions/DecodeVinExtended.DecodeVinExtended}\n * @implements {module:api/actions/DecodeVinValues.DecodeVinValues}\n * @implements {module:api/actions/DecodeVinValuesExtended.DecodeVinValuesExtended}\n * @implements {module:api/actions/DecodeWMI.DecodeWMI}\n * @implements {module:api/actions/GetAllMakes.GetAllMakes}\n * @implements {module:api/actions/GetAllManufacturers.GetAllManufacturers}\n * @implements {module:api/actions/GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications}\n * @implements {module:api/actions/GetEquipmentPlantCodes.GetEquipmentPlantCodes}\n * @implements {module:api/actions/GetMakeForManufacturer.GetMakeForManufacturer}\n * @implements {module:api/actions/GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear}\n * @implements {module:api/actions/GetMakesForVehicleType.GetMakesForVehicleType}\n * @implements {module:api/actions/GetManufacturerDetails.GetManufacturerDetails}\n * @implements {module:api/actions/GetModelsForMake.GetModelsForMake}\n * @implements {module:api/actions/GetModelsForMakeId.GetModelsForMakeId}\n * @implements {module:api/actions/GetModelsForMakeIdYear.GetModelsForMakeIdYear}\n * @implements {module:api/actions/GetModelsForMakeYear.GetModelsForMakeYear}\n * @implements {module:api/actions/GetParts.GetParts}\n * @implements {module:api/actions/GetVehicleTypesForMake.GetVehicleTypesForMake}\n * @implements {module:api/actions/GetVehicleTypesForMakeId.GetVehicleTypesForMakeId}\n * @implements {module:api/actions/GetVehicleVariableList.GetVehicleVariableList}\n * @implements {module:api/actions/GetVehicleVariableValuesList.GetVehicleVariableValuesList}\n * @implements {module:api/actions/GetWMIsForManufacturer.GetWMIsForManufacturer}\n *\n * @example Node bundle\n * const { NHTSA } = require('@shaggytools/nhtsa-api-wrapper');\n *\n * const Wrapper = new NHTSA();\n *\n * // Decode a VIN and return a response of type ApiResponse\n * const response = Wrapper.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\n *\n * // or get details about a specific manufacturer, plus 23 other available Actions.\n * const hondaDetails = Wrapper.GetManufacturerDetails('Honda').catch(error => error)\n *\n * @example Browser bundle\n * // Change to specific version number \"x.x.xx\",\n * // or remove completely for the most recently published version\n * /dist/bundle.min.js\"\n * >\n *\n * \n *\n * @example Module - Node lazy loading\n * const { NHTSA } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\n * .catch(err => err);\n *\n * const ApiClient = new NHTSA();\n *\n * const results = await ApiClient.DecodeVin('3VWD07AJ5EM388202')\n * .catch(err => err)\n *\n * @example Module - Browser lazy loading\n * \n */\nclass NHTSA\n extends Fetch\n implements\n DecodeVin,\n DecodeVinExtended,\n DecodeVinValues,\n DecodeVINValuesBatch,\n DecodeVinValuesExtended,\n DecodeWMI,\n GetAllMakes,\n GetAllManufacturers,\n GetCanadianVehicleSpecifications,\n GetEquipmentPlantCodes,\n GetMakeForManufacturer,\n GetMakesForManufacturerAndYear,\n GetMakesForVehicleType,\n GetManufacturerDetails,\n GetModelsForMake,\n GetModelsForMakeId,\n GetModelsForMakeIdYear,\n GetModelsForMakeYear,\n GetParts,\n GetVehicleTypesForMake,\n GetVehicleTypesForMakeId,\n GetVehicleVariableList,\n GetVehicleVariableValuesList,\n GetWMIsForManufacturer {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n DecodeVin = DecodeVin.prototype.DecodeVin;\n\n DecodeVinExtended = DecodeVinExtended.prototype.DecodeVinExtended;\n\n DecodeVinValues = DecodeVinValues.prototype.DecodeVinValues;\n\n DecodeVINValuesBatch = DecodeVINValuesBatch.prototype.DecodeVINValuesBatch;\n\n DecodeVinValuesExtended =\n DecodeVinValuesExtended.prototype.DecodeVinValuesExtended;\n\n DecodeWMI = DecodeWMI.prototype.DecodeWMI;\n\n GetAllMakes = GetAllMakes.prototype.GetAllMakes;\n\n GetAllManufacturers = GetAllManufacturers.prototype.GetAllManufacturers;\n\n GetCanadianVehicleSpecifications =\n GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications;\n\n GetEquipmentPlantCodes =\n GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes;\n\n GetMakeForManufacturer =\n GetMakeForManufacturer.prototype.GetMakeForManufacturer;\n\n GetMakesForManufacturerAndYear =\n GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear;\n\n GetMakesForVehicleType =\n GetMakesForVehicleType.prototype.GetMakesForVehicleType;\n\n GetManufacturerDetails =\n GetManufacturerDetails.prototype.GetManufacturerDetails;\n\n GetModelsForMake = GetModelsForMake.prototype.GetModelsForMake;\n\n GetModelsForMakeId = GetModelsForMakeId.prototype.GetModelsForMakeId;\n\n GetModelsForMakeIdYear =\n GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear;\n\n GetModelsForMakeYear = GetModelsForMakeYear.prototype.GetModelsForMakeYear;\n\n GetParts = GetParts.prototype.GetParts;\n\n GetVehicleTypesForMake =\n GetVehicleTypesForMake.prototype.GetVehicleTypesForMake;\n\n GetVehicleTypesForMakeId =\n GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId;\n\n GetVehicleVariableList =\n GetVehicleVariableList.prototype.GetVehicleVariableList;\n\n GetVehicleVariableValuesList =\n GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList;\n\n GetWMIsForManufacturer =\n GetWMIsForManufacturer.prototype.GetWMIsForManufacturer;\n}\n\nexport { NHTSA };\n"],"names":["Fetch","DecodeVin","DecodeVinExtended","DecodeVinValues","DecodeVINValuesBatch","DecodeVinValuesExtended","DecodeWMI","GetAllMakes","GetAllManufacturers","GetCanadianVehicleSpecifications","GetEquipmentPlantCodes","GetMakeForManufacturer","GetMakesForManufacturerAndYear","GetMakesForVehicleType","GetManufacturerDetails","GetModelsForMake","GetModelsForMakeId","GetModelsForMakeIdYear","GetModelsForMakeYear","GetParts","GetVehicleTypesForMake","GetVehicleTypesForMakeId","GetVehicleVariableList","GetVehicleVariableValuesList","GetWMIsForManufacturer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;AAuCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,MAAM,KACJ,SAAQA,WAAK;IA0Bb,YAAY,UAAwB;QAClC,KAAK,CAAC,UAAU,CAAC,CAAC;QAEpB,cAAS,GAAGC,mBAAS,CAAC,SAAS,CAAC,SAAS,CAAC;QAE1C,sBAAiB,GAAGC,mCAAiB,CAAC,SAAS,CAAC,iBAAiB,CAAC;QAElE,oBAAe,GAAGC,+BAAe,CAAC,SAAS,CAAC,eAAe,CAAC;QAE5D,yBAAoB,GAAGC,yCAAoB,CAAC,SAAS,CAAC,oBAAoB,CAAC;QAE3E,4BAAuB,GACrBC,+CAAuB,CAAC,SAAS,CAAC,uBAAuB,CAAC;QAE5D,cAAS,GAAGC,mBAAS,CAAC,SAAS,CAAC,SAAS,CAAC;QAE1C,gBAAW,GAAGC,uBAAW,CAAC,SAAS,CAAC,WAAW,CAAC;QAEhD,wBAAmB,GAAGC,uCAAmB,CAAC,SAAS,CAAC,mBAAmB,CAAC;QAExE,qCAAgC,GAC9BC,iEAAgC,CAAC,SAAS,CAAC,gCAAgC,CAAC;QAE9E,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,mCAA8B,GAC5BC,6DAA8B,CAAC,SAAS,CAAC,8BAA8B,CAAC;QAE1E,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,qBAAgB,GAAGC,iCAAgB,CAAC,SAAS,CAAC,gBAAgB,CAAC;QAE/D,uBAAkB,GAAGC,qCAAkB,CAAC,SAAS,CAAC,kBAAkB,CAAC;QAErE,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,yBAAoB,GAAGC,yCAAoB,CAAC,SAAS,CAAC,oBAAoB,CAAC;QAE3E,aAAQ,GAAGC,iBAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC;QAEvC,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,6BAAwB,GACtBC,iDAAwB,CAAC,SAAS,CAAC,wBAAwB,CAAC;QAE9D,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAE1D,iCAA4B,GAC1BC,yDAA4B,CAAC,SAAS,CAAC,4BAA4B,CAAC;QAEtE,2BAAsB,GACpBC,6CAAsB,CAAC,SAAS,CAAC,sBAAsB,CAAC;KA5DzD;;;;;"} \ No newline at end of file diff --git a/dist/cjs/isValidVin.js.map b/dist/cjs/isValidVin.js.map index 84e3c36a0..9228d7273 100644 --- a/dist/cjs/isValidVin.js.map +++ b/dist/cjs/isValidVin.js.map @@ -1 +1 @@ -{"version":3,"file":"isValidVin.js","sources":["../../src/utils/isValidVin.ts"],"sourcesContent":["/**\r\n * @module utils/isValidVin\r\n * @category Utils\r\n */\r\n\r\n/*\r\n * There will need to be some way to translate vin digits that are alphabetic\r\n * into their number value in the VIN algorithm transliteration table.\r\n * Later, during the creation of the checksum variable, those digits will be\r\n * multiplied against their corresponding weight (by index) in the WEIGHTS_ARRAY.\r\n * This transliteration table is a key part of the VIN validation algorithm.\r\n */\r\nconst TRANSLITERATION_TABLE: Record = {\r\n A: 1,\r\n B: 2,\r\n C: 3,\r\n D: 4,\r\n E: 5,\r\n F: 6,\r\n G: 7,\r\n H: 8,\r\n J: 1,\r\n K: 2,\r\n L: 3,\r\n M: 4,\r\n N: 5,\r\n P: 7,\r\n R: 9,\r\n S: 2,\r\n T: 3,\r\n U: 4,\r\n V: 5,\r\n W: 6,\r\n X: 7,\r\n Y: 8,\r\n Z: 9,\r\n};\r\n\r\n/*\r\n * Later, during the creation of the 'checksum' variable, these weights will be\r\n * multiplied by the value of their mirrored index vin digits.\r\n * The array index of each weight corresponds to the same index of each\r\n * digit in the 'vin'.\r\n */\r\nconst WEIGHTS_ARRAY: number[] = [\r\n 8,\r\n 7,\r\n 6,\r\n 5,\r\n 4,\r\n 3,\r\n 2,\r\n 10,\r\n 0,\r\n 9,\r\n 8,\r\n 7,\r\n 6,\r\n 5,\r\n 4,\r\n 3,\r\n 2,\r\n];\r\n\r\n/**\r\n * Provides **offline** validation of Vehicle Identification Numbers (VINs) using the\r\n * [VIN Check Algorithm](https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit).\r\n *\r\n * @param {string} vin - Vehicle Identification Number.\r\n * @returns {boolean} True for a valid VIN, false for an invalid VIN.\r\n *\r\n * @example When loaded from the browser via html script tags\r\n * // \r\n * const isValid = NHTSA.isValidVin('3VWD07AJ5EM388202')\r\n * console.log(isValid) // true\r\n *\r\n * @example When loaded as a module\r\n * import { isValidVin } from '@shaggytools/nhtsa-api-wrapper'\r\n * const isValid = isValidVin('3VWD07AJ5EM388202')\r\n * console.log(isValid) // true\r\n *\r\n */\r\nexport function isValidVin(vin: string): boolean {\r\n /* A valid VIN must be a string and is always exactly 17 digits */\r\n if (typeof vin !== 'string' || vin.length != 17) {\r\n return false;\r\n }\r\n\r\n /* Normalize the vin to all uppercase letters */\r\n vin = vin.toUpperCase();\r\n\r\n /* split the vin digits into an array */\r\n const vinArray: string[] = vin.split('');\r\n\r\n /* checkDigit will be tested against the checkSum later */\r\n const checkDigit: string = vinArray[8];\r\n\r\n /*\r\n * In a valid VIN, the checkDigit can either be:\r\n * a number, 0-9 inclusive OR the character 'X'\r\n */\r\n if (isNaN(parseInt(checkDigit)) && checkDigit !== 'X') {\r\n return false;\r\n }\r\n\r\n /*\r\n * The checkValue must be a digit and 'X' is the only valid alphabetic check value.\r\n * As per the algorithm, a checkDigit of 'X' is equal to a checkValue of `10` and needs\r\n * to be converted as such.\r\n */\r\n const checkValue: number = checkDigit === 'X' ? 10 : parseInt(checkDigit);\r\n\r\n /*\r\n * Maps the vinArray and converts any values (digits) that are alphabetic,\r\n * into numbers, using the TRANSLITERATION_TABLE.\r\n * Then these numbers are multiplied against their corresponding weight\r\n * in the WEIGHTS_ARRAY, matched by index position.\r\n * All 17 of those digitValues are then added together and divided by 11.\r\n * The remainder, or % modulo, of that division will be the final 'checksum'.\r\n */\r\n const checksum: number =\r\n vinArray\r\n .map((digit: string, index: number) => {\r\n let digitValue: number;\r\n /* Use the transliteration table to convert any Not a Number(NaN) values to numbers */\r\n isNaN(parseInt(digit))\r\n ? (digitValue = TRANSLITERATION_TABLE[digit])\r\n : (digitValue = parseInt(digit));\r\n\r\n /* Convert the digitValue to a weighted number corresponding to it's position, by index, in the weightsArray. */\r\n const weight: number = WEIGHTS_ARRAY[index];\r\n\r\n /* The final step for each digit is to multiply the digit by it's corresponding weight */\r\n return digitValue * weight;\r\n })\r\n /* Finally, get the sum of all digits and divide by 11, the remainder of that operation is the checksum */\r\n .reduce((acc, currValue) => acc + currValue, 0) % 11;\r\n\r\n /*\r\n * The checksum is compared against the checkValue we set earlier (the 9th digit of the VIN)\r\n * As per the algorithm, if they are equal to each other, then the VIN must be valid and\r\n * we return true, otherwise the VIN is invalid and we return false.\r\n */\r\n return checksum === checkValue;\r\n}\r\n"],"names":[],"mappings":";;;;AAAA;;;;AAKA;;;;;;;AAOA,MAAM,qBAAqB,GAA2B;IACpD,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;CACL,CAAC;AAEF;;;;;;AAMA,MAAM,aAAa,GAAa;IAC9B,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,EAAE;IACF,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;SAkBgB,UAAU,CAAC,GAAW;;IAEpC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,IAAI,EAAE,EAAE;QAC/C,OAAO,KAAK,CAAC;KACd;;IAGD,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;;IAGxB,MAAM,QAAQ,GAAa,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;;IAGzC,MAAM,UAAU,GAAW,QAAQ,CAAC,CAAC,CAAC,CAAC;;;;;IAMvC,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,UAAU,KAAK,GAAG,EAAE;QACrD,OAAO,KAAK,CAAC;KACd;;;;;;IAOD,MAAM,UAAU,GAAW,UAAU,KAAK,GAAG,GAAG,EAAE,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;;;;;;;;;IAU1E,MAAM,QAAQ,GACZ,QAAQ;SACL,GAAG,CAAC,CAAC,KAAa,EAAE,KAAa;QAChC,IAAI,UAAkB,CAAC;;QAEvB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;eACjB,UAAU,GAAG,qBAAqB,CAAC,KAAK,CAAC;eACzC,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;;QAGnC,MAAM,MAAM,GAAW,aAAa,CAAC,KAAK,CAAC,CAAC;;QAG5C,OAAO,UAAU,GAAG,MAAM,CAAC;KAC5B,CAAC;;SAED,MAAM,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,GAAG,GAAG,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;;;;;;IAOzD,OAAO,QAAQ,KAAK,UAAU,CAAC;AACjC;;;;"} \ No newline at end of file +{"version":3,"file":"isValidVin.js","sources":["../../src/utils/isValidVin.ts"],"sourcesContent":["/**\n * @module utils/isValidVin\n * @category Utils\n */\n\n/*\n * There will need to be some way to translate vin digits that are alphabetic\n * into their number value in the VIN algorithm transliteration table.\n * Later, during the creation of the checksum variable, those digits will be\n * multiplied against their corresponding weight (by index) in the WEIGHTS_ARRAY.\n * This transliteration table is a key part of the VIN validation algorithm.\n */\nconst TRANSLITERATION_TABLE: Record = {\n A: 1,\n B: 2,\n C: 3,\n D: 4,\n E: 5,\n F: 6,\n G: 7,\n H: 8,\n J: 1,\n K: 2,\n L: 3,\n M: 4,\n N: 5,\n P: 7,\n R: 9,\n S: 2,\n T: 3,\n U: 4,\n V: 5,\n W: 6,\n X: 7,\n Y: 8,\n Z: 9,\n};\n\n/*\n * Later, during the creation of the 'checksum' variable, these weights will be\n * multiplied by the value of their mirrored index vin digits.\n * The array index of each weight corresponds to the same index of each\n * digit in the 'vin'.\n */\nconst WEIGHTS_ARRAY: number[] = [\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n 10,\n 0,\n 9,\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n];\n\n/**\n * Provides **offline** validation of Vehicle Identification Numbers (VINs) using the\n * [VIN Check Algorithm](https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit).\n *\n * @param {string} vin - Vehicle Identification Number.\n * @returns {boolean} True for a valid VIN, false for an invalid VIN.\n *\n * @example When loaded from the browser via html script tags\n * // \n * const isValid = NHTSA.isValidVin('3VWD07AJ5EM388202')\n * console.log(isValid) // true\n *\n * @example When loaded as a module\n * import { isValidVin } from '@shaggytools/nhtsa-api-wrapper'\n * const isValid = isValidVin('3VWD07AJ5EM388202')\n * console.log(isValid) // true\n *\n */\nexport function isValidVin(vin: string): boolean {\n /* A valid VIN must be a string and is always exactly 17 digits */\n if (typeof vin !== 'string' || vin.length != 17) {\n return false;\n }\n\n /* Normalize the vin to all uppercase letters */\n vin = vin.toUpperCase();\n\n /* split the vin digits into an array */\n const vinArray: string[] = vin.split('');\n\n /* checkDigit will be tested against the checkSum later */\n const checkDigit: string = vinArray[8];\n\n /*\n * In a valid VIN, the checkDigit can either be:\n * a number, 0-9 inclusive OR the character 'X'\n */\n if (isNaN(parseInt(checkDigit)) && checkDigit !== 'X') {\n return false;\n }\n\n /*\n * The checkValue must be a digit and 'X' is the only valid alphabetic check value.\n * As per the algorithm, a checkDigit of 'X' is equal to a checkValue of `10` and needs\n * to be converted as such.\n */\n const checkValue: number = checkDigit === 'X' ? 10 : parseInt(checkDigit);\n\n /*\n * Maps the vinArray and converts any values (digits) that are alphabetic,\n * into numbers, using the TRANSLITERATION_TABLE.\n * Then these numbers are multiplied against their corresponding weight\n * in the WEIGHTS_ARRAY, matched by index position.\n * All 17 of those digitValues are then added together and divided by 11.\n * The remainder, or % modulo, of that division will be the final 'checksum'.\n */\n const checksum: number =\n vinArray\n .map((digit: string, index: number) => {\n let digitValue: number;\n /* Use the transliteration table to convert any Not a Number(NaN) values to numbers */\n isNaN(parseInt(digit))\n ? (digitValue = TRANSLITERATION_TABLE[digit])\n : (digitValue = parseInt(digit));\n\n /* Convert the digitValue to a weighted number corresponding to it's position, by index, in the weightsArray. */\n const weight: number = WEIGHTS_ARRAY[index];\n\n /* The final step for each digit is to multiply the digit by it's corresponding weight */\n return digitValue * weight;\n })\n /* Finally, get the sum of all digits and divide by 11, the remainder of that operation is the checksum */\n .reduce((acc, currValue) => acc + currValue, 0) % 11;\n\n /*\n * The checksum is compared against the checkValue we set earlier (the 9th digit of the VIN)\n * As per the algorithm, if they are equal to each other, then the VIN must be valid and\n * we return true, otherwise the VIN is invalid and we return false.\n */\n return checksum === checkValue;\n}\n"],"names":[],"mappings":";;;;AAAA;;;;AAKA;;;;;;;AAOA,MAAM,qBAAqB,GAA2B;IACpD,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,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,GAAG,EAAE,SAAS,KAAK,GAAG,GAAG,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;;;;;;IAOzD,OAAO,QAAQ,KAAK,UAAU,CAAC;AACjC;;;;"} \ No newline at end of file diff --git a/dist/module/Client.js b/dist/module/Client.js index dd8db1cc1..c62b86850 100644 --- a/dist/module/Client.js +++ b/dist/module/Client.js @@ -1,2 +1,2 @@ -import{F as e}from"./Fetch-b3914c0a.js";import{D as t,a,b as o,c as s,d as r,e as i,G as p,f as c,g as l,h as M,i as d,j as h,k as n,l as G,m as u,n as V,o as y,p as F,q as k,r as f,s as D,t as I,u as m,v as b}from"./GetWMIsForManufacturer-a7ef6c3c.js";const x=new class extends e{constructor(e){super(e),this.DecodeVin=t.prototype.DecodeVin,this.DecodeVinExtended=a.prototype.DecodeVinExtended,this.DecodeVinValues=o.prototype.DecodeVinValues,this.DecodeVINValuesBatch=s.prototype.DecodeVINValuesBatch,this.DecodeVinValuesExtended=r.prototype.DecodeVinValuesExtended,this.DecodeWMI=i.prototype.DecodeWMI,this.GetAllMakes=p.prototype.GetAllMakes,this.GetAllManufacturers=c.prototype.GetAllManufacturers,this.GetCanadianVehicleSpecifications=l.prototype.GetCanadianVehicleSpecifications,this.GetEquipmentPlantCodes=M.prototype.GetEquipmentPlantCodes,this.GetMakeForManufacturer=d.prototype.GetMakeForManufacturer,this.GetMakesForManufacturerAndYear=h.prototype.GetMakesForManufacturerAndYear,this.GetMakesForVehicleType=n.prototype.GetMakesForVehicleType,this.GetManufacturerDetails=G.prototype.GetManufacturerDetails,this.GetModelsForMake=u.prototype.GetModelsForMake,this.GetModelsForMakeId=V.prototype.GetModelsForMakeId,this.GetModelsForMakeIdYear=y.prototype.GetModelsForMakeIdYear,this.GetModelsForMakeYear=F.prototype.GetModelsForMakeYear,this.GetParts=k.prototype.GetParts,this.GetVehicleTypesForMake=f.prototype.GetVehicleTypesForMake,this.GetVehicleTypesForMakeId=D.prototype.GetVehicleTypesForMakeId,this.GetVehicleVariableList=I.prototype.GetVehicleVariableList,this.GetVehicleVariableValuesList=m.prototype.GetVehicleVariableValuesList,this.GetWMIsForManufacturer=b.prototype.GetWMIsForManufacturer}};export{x as Client}; +import{NHTSA as e}from"./NHTSA.js";import"./Fetch-44aa28fd.js";import"./DecodeVin.js";import"./DecodeVinExtended.js";import"./DecodeVinValues.js";import"./DecodeVINValuesBatch.js";import"./DecodeVinValuesExtended.js";import"./DecodeWMI.js";import"./GetAllMakes.js";import"./GetAllManufacturers.js";import"./GetCanadianVehicleSpecifications.js";import"./GetEquipmentPlantCodes.js";import"./GetMakeForManufacturer.js";import"./GetMakesForManufacturerAndYear.js";import"./GetMakesForVehicleType.js";import"./GetManufacturerDetails.js";import"./GetModelsForMake.js";import"./GetModelsForMakeId.js";import"./GetModelsForMakeIdYear.js";import"./GetModelsForMakeYear.js";import"./GetParts.js";import"./GetVehicleTypesForMake.js";import"./GetVehicleTypesForMakeId.js";import"./GetVehicleVariableList.js";import"./GetVehicleVariableValuesList.js";import"./GetWMIsForManufacturer.js";const t=new e;export{t as Client}; //# sourceMappingURL=Client.js.map diff --git a/dist/module/Client.js.map b/dist/module/Client.js.map index 44153d89f..2650cf9e2 100644 --- a/dist/module/Client.js.map +++ b/dist/module/Client.js.map @@ -1 +1 @@ -{"version":3,"file":"Client.js","sources":["../../src/api/Client.ts","../../src/api/NHTSA.ts"],"sourcesContent":["/**\n * @module api/Client\n * @category API\n * @description Module exporting an instance of the NHSTA class.\n *\n * > - For more information, see the documentation for the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n */\n\nimport { NHTSA } from './NHTSA';\n\n/**\n * A new instance of the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n *\n * @type {NHTSA}\n *\n * @example Node bundle\n * const { Client } = require('@shaggytools/nhtsa-api-wrapper');\n *\n * // Decode a VIN and return get a response of type ApiResponse\n * const response = Client.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\n *\n * // or get details about a specific manufacturer, plus 23 other available Actions.\n * const audiDetails = Client.GetManufacturerDetails('Audi').catch(error => error)\n *\n * @example Browser bundle\n * // Change to specific version number \"x.x.xx\",\n * // or remove completely for the most recently published version\n * /dist/bundle.min.js\"\n * >\n *\n * \n *\n * @example Module - Node lazy loading\n * const { Client } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\n * .catch(err => err);\n *\n * const results = await Client.DecodeVin('3VWD07AJ5EM388202')\n * .catch(err => err)\n *\n * @example Module - Browser lazy loading\n * \n *\n */\nconst Client: NHTSA = new NHTSA();\n\nexport { Client };\n","/**\r\n * @module api/NHTSA\r\n * @category API\r\n * @description Module exporting the main (NHSTA) class for API Actions.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [NHTSA](NHTSA.html#NHTSA) - Class that implements all NHTSA API Actions\r\n */\r\n\r\nimport { Fetch /* Class */, FetchConfig /* Type */ } from './Fetch';\r\n\r\n/* Import implemented API Action classes */\r\nimport {\r\n DecodeVin,\r\n DecodeVinExtended,\r\n DecodeVinValues,\r\n DecodeVINValuesBatch,\r\n DecodeVinValuesExtended,\r\n DecodeWMI,\r\n GetAllMakes,\r\n GetAllManufacturers,\r\n GetCanadianVehicleSpecifications,\r\n GetEquipmentPlantCodes,\r\n GetMakeForManufacturer,\r\n GetMakesForManufacturerAndYear,\r\n GetMakesForVehicleType,\r\n GetManufacturerDetails,\r\n GetModelsForMake,\r\n GetModelsForMakeId,\r\n GetModelsForMakeIdYear,\r\n GetModelsForMakeYear,\r\n GetParts,\r\n GetVehicleTypesForMake,\r\n GetVehicleTypesForMakeId,\r\n GetVehicleVariableList,\r\n GetVehicleVariableValuesList,\r\n GetWMIsForManufacturer,\r\n} from './actions';\r\n\r\n/**\r\n * @class NHTSA\r\n * @augments module:api/Fetch.Fetch\r\n * @category API\r\n *\r\n * @param {FetchConfig} [userConfig] - Configuration options to construct the class with.\r\n *\r\n * @implements {module:api/actions/DecodeVin.DecodeVin}\r\n * @implements {module:api/actions/DecodeVinExtended.DecodeVinExtended}\r\n * @implements {module:api/actions/DecodeVinValues.DecodeVinValues}\r\n * @implements {module:api/actions/DecodeVinValuesExtended.DecodeVinValuesExtended}\r\n * @implements {module:api/actions/DecodeWMI.DecodeWMI}\r\n * @implements {module:api/actions/GetAllMakes.GetAllMakes}\r\n * @implements {module:api/actions/GetAllManufacturers.GetAllManufacturers}\r\n * @implements {module:api/actions/GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications}\r\n * @implements {module:api/actions/GetEquipmentPlantCodes.GetEquipmentPlantCodes}\r\n * @implements {module:api/actions/GetMakeForManufacturer.GetMakeForManufacturer}\r\n * @implements {module:api/actions/GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear}\r\n * @implements {module:api/actions/GetMakesForVehicleType.GetMakesForVehicleType}\r\n * @implements {module:api/actions/GetManufacturerDetails.GetManufacturerDetails}\r\n * @implements {module:api/actions/GetModelsForMake.GetModelsForMake}\r\n * @implements {module:api/actions/GetModelsForMakeId.GetModelsForMakeId}\r\n * @implements {module:api/actions/GetModelsForMakeIdYear.GetModelsForMakeIdYear}\r\n * @implements {module:api/actions/GetModelsForMakeYear.GetModelsForMakeYear}\r\n * @implements {module:api/actions/GetParts.GetParts}\r\n * @implements {module:api/actions/GetVehicleTypesForMake.GetVehicleTypesForMake}\r\n * @implements {module:api/actions/GetVehicleTypesForMakeId.GetVehicleTypesForMakeId}\r\n * @implements {module:api/actions/GetVehicleVariableList.GetVehicleVariableList}\r\n * @implements {module:api/actions/GetVehicleVariableValuesList.GetVehicleVariableValuesList}\r\n * @implements {module:api/actions/GetWMIsForManufacturer.GetWMIsForManufacturer}\r\n *\r\n * @example Node bundle\r\n * const { NHTSA } = require('@shaggytools/nhtsa-api-wrapper');\r\n *\r\n * const Wrapper = new NHTSA();\r\n *\r\n * // Decode a VIN and return a response of type ApiResponse\r\n * const response = Wrapper.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\r\n *\r\n * // or get details about a specific manufacturer, plus 23 other available Actions.\r\n * const hondaDetails = Wrapper.GetManufacturerDetails('Honda').catch(error => error)\r\n *\r\n * @example Browser bundle\r\n * // Change to specific version number \"x.x.xx\",\r\n * // or remove completely for the most recently published version\r\n * /dist/bundle.min.js\"\r\n * >\r\n *\r\n * \r\n *\r\n * @example Module - Node lazy loading\r\n * const { NHTSA } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\r\n * .catch(err => err);\r\n *\r\n * const ApiClient = new NHTSA();\r\n *\r\n * const results = await ApiClient.DecodeVin('3VWD07AJ5EM388202')\r\n * .catch(err => err)\r\n *\r\n * @example Module - Browser lazy loading\r\n * \r\n */\r\nclass NHTSA\r\n extends Fetch\r\n implements\r\n DecodeVin,\r\n DecodeVinExtended,\r\n DecodeVinValues,\r\n DecodeVINValuesBatch,\r\n DecodeVinValuesExtended,\r\n DecodeWMI,\r\n GetAllMakes,\r\n GetAllManufacturers,\r\n GetCanadianVehicleSpecifications,\r\n GetEquipmentPlantCodes,\r\n GetMakeForManufacturer,\r\n GetMakesForManufacturerAndYear,\r\n GetMakesForVehicleType,\r\n GetManufacturerDetails,\r\n GetModelsForMake,\r\n GetModelsForMakeId,\r\n GetModelsForMakeIdYear,\r\n GetModelsForMakeYear,\r\n GetParts,\r\n GetVehicleTypesForMake,\r\n GetVehicleTypesForMakeId,\r\n GetVehicleVariableList,\r\n GetVehicleVariableValuesList,\r\n GetWMIsForManufacturer {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n DecodeVin = DecodeVin.prototype.DecodeVin;\r\n\r\n DecodeVinExtended = DecodeVinExtended.prototype.DecodeVinExtended;\r\n\r\n DecodeVinValues = DecodeVinValues.prototype.DecodeVinValues;\r\n\r\n DecodeVINValuesBatch = DecodeVINValuesBatch.prototype.DecodeVINValuesBatch;\r\n\r\n DecodeVinValuesExtended =\r\n DecodeVinValuesExtended.prototype.DecodeVinValuesExtended;\r\n\r\n DecodeWMI = DecodeWMI.prototype.DecodeWMI;\r\n\r\n GetAllMakes = GetAllMakes.prototype.GetAllMakes;\r\n\r\n GetAllManufacturers = GetAllManufacturers.prototype.GetAllManufacturers;\r\n\r\n GetCanadianVehicleSpecifications =\r\n GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications;\r\n\r\n GetEquipmentPlantCodes =\r\n GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes;\r\n\r\n GetMakeForManufacturer =\r\n GetMakeForManufacturer.prototype.GetMakeForManufacturer;\r\n\r\n GetMakesForManufacturerAndYear =\r\n GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear;\r\n\r\n GetMakesForVehicleType =\r\n GetMakesForVehicleType.prototype.GetMakesForVehicleType;\r\n\r\n GetManufacturerDetails =\r\n GetManufacturerDetails.prototype.GetManufacturerDetails;\r\n\r\n GetModelsForMake = GetModelsForMake.prototype.GetModelsForMake;\r\n\r\n GetModelsForMakeId = GetModelsForMakeId.prototype.GetModelsForMakeId;\r\n\r\n GetModelsForMakeIdYear =\r\n GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear;\r\n\r\n GetModelsForMakeYear = GetModelsForMakeYear.prototype.GetModelsForMakeYear;\r\n\r\n GetParts = GetParts.prototype.GetParts;\r\n\r\n GetVehicleTypesForMake =\r\n GetVehicleTypesForMake.prototype.GetVehicleTypesForMake;\r\n\r\n GetVehicleTypesForMakeId =\r\n GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId;\r\n\r\n GetVehicleVariableList =\r\n GetVehicleVariableList.prototype.GetVehicleVariableList;\r\n\r\n GetVehicleVariableValuesList =\r\n GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList;\r\n\r\n GetWMIsForManufacturer =\r\n GetWMIsForManufacturer.prototype.GetWMIsForManufacturer;\r\n}\r\n\r\nexport { NHTSA };\r\n"],"names":["Client","Fetch","[object Object]","userConfig","super","this","DecodeVin","prototype","DecodeVinExtended","DecodeVinValues","DecodeVINValuesBatch","DecodeVinValuesExtended","DecodeWMI","GetAllMakes","GetAllManufacturers","GetCanadianVehicleSpecifications","GetEquipmentPlantCodes","GetMakeForManufacturer","GetMakesForManufacturerAndYear","GetMakesForVehicleType","GetManufacturerDetails","GetModelsForMake","GetModelsForMakeId","GetModelsForMakeIdYear","GetModelsForMakeYear","GetParts","GetVehicleTypesForMake","GetVehicleTypesForMakeId","GetVehicleVariableList","GetVehicleVariableValuesList","GetWMIsForManufacturer"],"mappings":"mQAyDMA,EAAgB,IC8DtB,cACUC,EA0BRC,YAAYC,GACVC,MAAMD,GAERE,eAAYC,EAAUC,UAAUD,UAEhCD,uBAAoBG,EAAkBD,UAAUC,kBAEhDH,qBAAkBI,EAAgBF,UAAUE,gBAE5CJ,0BAAuBK,EAAqBH,UAAUG,qBAEtDL,6BACEM,EAAwBJ,UAAUI,wBAEpCN,eAAYO,EAAUL,UAAUK,UAEhCP,iBAAcQ,EAAYN,UAAUM,YAEpCR,yBAAsBS,EAAoBP,UAAUO,oBAEpDT,sCACEU,EAAiCR,UAAUQ,iCAE7CV,4BACEW,EAAuBT,UAAUS,uBAEnCX,4BACEY,EAAuBV,UAAUU,uBAEnCZ,oCACEa,EAA+BX,UAAUW,+BAE3Cb,4BACEc,EAAuBZ,UAAUY,uBAEnCd,4BACEe,EAAuBb,UAAUa,uBAEnCf,sBAAmBgB,EAAiBd,UAAUc,iBAE9ChB,wBAAqBiB,EAAmBf,UAAUe,mBAElDjB,4BACEkB,EAAuBhB,UAAUgB,uBAEnClB,0BAAuBmB,EAAqBjB,UAAUiB,qBAEtDnB,cAAWoB,EAASlB,UAAUkB,SAE9BpB,4BACEqB,EAAuBnB,UAAUmB,uBAEnCrB,8BACEsB,EAAyBpB,UAAUoB,yBAErCtB,4BACEuB,EAAuBrB,UAAUqB,uBAEnCvB,kCACEwB,EAA6BtB,UAAUsB,6BAEzCxB,4BACEyB,EAAuBvB,UAAUuB"} \ No newline at end of file +{"version":3,"file":"Client.js","sources":["../../src/api/Client.ts"],"sourcesContent":["/**\n * @module api/Client\n * @category API\n * @description Module exporting an instance of the NHSTA class.\n *\n * > - For more information, see the documentation for the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n */\n\nimport { NHTSA } from './NHTSA';\n\n/**\n * A new instance of the [NHTSA](module-api_NHTSA-NHTSA.html) class.\n *\n * @type {NHTSA}\n *\n * @example Node bundle\n * const { Client } = require('@shaggytools/nhtsa-api-wrapper');\n *\n * // Decode a VIN and return get a response of type ApiResponse\n * const response = Client.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\n *\n * // or get details about a specific manufacturer, plus 23 other available Actions.\n * const audiDetails = Client.GetManufacturerDetails('Audi').catch(error => error)\n *\n * @example Browser bundle\n * // Change to specific version number \"x.x.xx\",\n * // or remove completely for the most recently published version\n * /dist/bundle.min.js\"\n * >\n *\n * \n *\n * @example Module - Node lazy loading\n * const { Client } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\n * .catch(err => err);\n *\n * const results = await Client.DecodeVin('3VWD07AJ5EM388202')\n * .catch(err => err)\n *\n * @example Module - Browser lazy loading\n * \n *\n */\nconst Client: NHTSA = new NHTSA();\n\nexport { Client };\n"],"names":["Client","NHTSA"],"mappings":"g3BAyDMA,EAAgB,IAAIC"} \ No newline at end of file diff --git a/dist/module/DecodeVINValuesBatch.js b/dist/module/DecodeVINValuesBatch.js index 519c8776d..613848b2b 100644 --- a/dist/module/DecodeVINValuesBatch.js +++ b/dist/module/DecodeVINValuesBatch.js @@ -1,2 +1,2 @@ -import{F as e,_ as t,g as r}from"./Fetch-b3914c0a.js";class o extends e{constructor(e){super(e)}DecodeVINValuesBatch(e){return t(this,void 0,void 0,(function*(){const t="DecodeVINValuesBatch",o=r(e);if("string"!==o)return Promise.reject(new Error(`DecodeVINValuesBatch, "inputString" argument is required and must be of type string, got: <${o}> ${e}`));const s=`${this.baseUrl}/${t}/`,n=encodeURI(`DATA=${e}&format=json`);return yield this.get(s,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:n}).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}export{o as DecodeVINValuesBatch}; +import{F as e,_ as t,g as r}from"./Fetch-44aa28fd.js";class o extends e{constructor(e){super(e)}DecodeVINValuesBatch(e){return t(this,void 0,void 0,(function*(){const t="DecodeVINValuesBatch",o=r(e);if("string"!==o)return Promise.reject(new Error(`DecodeVINValuesBatch, "inputString" argument is required and must be of type string, got: <${o}> ${e}`));const s=`${this.baseUrl}/${t}/`,n=encodeURI(`DATA=${e}&format=json`);return yield this.get(s,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:n}).then(e=>e).catch(e=>Promise.reject(new Error(`${t}, Fetch.get() error: ${e}`)))}))}}export{o as DecodeVINValuesBatch}; //# sourceMappingURL=DecodeVINValuesBatch.js.map diff --git a/dist/module/DecodeVINValuesBatch.js.map b/dist/module/DecodeVINValuesBatch.js.map index d31e4404e..1b40cc39c 100644 --- a/dist/module/DecodeVINValuesBatch.js.map +++ b/dist/module/DecodeVINValuesBatch.js.map @@ -1 +1 @@ -{"version":3,"file":"DecodeVINValuesBatch.js","sources":["../../src/api/actions/DecodeVINValuesBatch.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeVINValuesBatch\r\n * @category Actions\r\n * @description DecodeVINValuesBatch NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVINValuesBatch](module-api_actions_DecodeVINValuesBatch.DecodeVINValuesBatch.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVINValuesBatchResponse](#DecodeVINValuesBatchResponse)\r\n * > - Type: [DecodeVINValuesBatchResults](#DecodeVINValuesBatchResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVINValuesBatch extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This decodes a batch of VINs that are submitted in a standardized format in a string\r\n * and returns multiple decodes in a flat format.\r\n *\r\n * The `inputString` parameter should be in the following format:\r\n * - `vin , modelYear ; vin , modelYear ; vin , modelYear ...`\r\n *\r\n * \"modelYear\" is optional, the output for each VIN decode is in the same format as produced by the \"Decode VIN (flat format)\" method.\r\n *\r\n * @async\r\n * @param {string} inputString - A string of Vehicle Identification Numbers (full or partial) following the format listed in the description.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVINValuesBatch(\r\n inputString: string\r\n ): Promise {\r\n const action = 'DecodeVINValuesBatch';\r\n\r\n /* Runtime typechecking */\r\n const typeofInputString = getTypeof(inputString);\r\n if (typeofInputString !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"inputString\" argument is required and must be of type string, got: ` +\r\n `<${typeofInputString}> ${inputString}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/`;\r\n\r\n const body = encodeURI(`DATA=${inputString}&format=json`);\r\n\r\n /* Return the result */\r\n return await this.get(url, {\r\n method: 'POST',\r\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\r\n body,\r\n })\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVINValuesBatchResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVINValuesBatch\r\n * @alias DecodeVINValuesBatchResults\r\n */\r\nexport type DecodeVINValuesBatchResults = {\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVINValuesBatch API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVINValuesBatch\r\n * @alias DecodeVINValuesBatchResponse\r\n */\r\nexport type DecodeVINValuesBatchResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["DecodeVINValuesBatch","Fetch","[object Object]","userConfig","super","inputString","action","typeofInputString","getTypeof","Promise","reject","Error","url","this","baseUrl","body","encodeURI","get","method","headers","content-type","then","response","catch","err"],"mappings":"4DAgCaA,UAA6BC,EACxCC,YAAYC,GACVC,MAAMD,GAgBFD,qBACJG,4CAEA,MAAMC,EAAS,uBAGTC,EAAoBC,EAAUH,GACpC,GAA0B,WAAtBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,8FAAIJ,MAAsBF,MAMlC,MAAMO,EAAM,GAAGC,KAAKC,WAAWR,KAEzBS,EAAOC,UAAU,QAAQX,iBAG/B,aAAaQ,KAAKI,IAAIL,EAAK,CACzBM,OAAQ,OACRC,QAAS,CAAEC,eAAgB,qCAC3BL,KAAAA,IAECM,KAAMC,GAAaA,GACnBC,MAAOC,GACNf,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BkB"} \ No newline at end of file +{"version":3,"file":"DecodeVINValuesBatch.js","sources":["../../src/api/actions/DecodeVINValuesBatch.ts"],"sourcesContent":["/**\n * @module api/actions/DecodeVINValuesBatch\n * @category Actions\n * @description DecodeVINValuesBatch NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVINValuesBatch](module-api_actions_DecodeVINValuesBatch.DecodeVINValuesBatch.html)\n * >\n * > **Types**\n * > - Type: [DecodeVINValuesBatchResponse](#DecodeVINValuesBatchResponse)\n * > - Type: [DecodeVINValuesBatchResults](#DecodeVINValuesBatchResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVINValuesBatch extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This decodes a batch of VINs that are submitted in a standardized format in a string\n * and returns multiple decodes in a flat format.\n *\n * The `inputString` parameter should be in the following format:\n * - `vin , modelYear ; vin , modelYear ; vin , modelYear ...`\n *\n * \"modelYear\" is optional, the output for each VIN decode is in the same format as produced by the \"Decode VIN (flat format)\" method.\n *\n * @async\n * @param {string} inputString - A string of Vehicle Identification Numbers (full or partial) following the format listed in the description.\n * @returns {(Promise)} - Api Response object.\n */\n async DecodeVINValuesBatch(\n inputString: string\n ): Promise {\n const action = 'DecodeVINValuesBatch';\n\n /* Runtime typechecking */\n const typeofInputString = getTypeof(inputString);\n if (typeofInputString !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"inputString\" argument is required and must be of type string, got: ` +\n `<${typeofInputString}> ${inputString}`\n )\n );\n }\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/`;\n\n const body = encodeURI(`DATA=${inputString}&format=json`);\n\n /* Return the result */\n return await this.get(url, {\n method: 'POST',\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\n body,\n })\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVINValuesBatchResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVINValuesBatch\n * @alias DecodeVINValuesBatchResults\n */\nexport type DecodeVINValuesBatchResults = {\n ABS: string;\n ActiveSafetySysNote: string;\n AdaptiveCruiseControl: string;\n AdaptiveDrivingBeam: string;\n AdaptiveHeadlights: string;\n AdditionalErrorText: string;\n AirBagLocCurtain: string;\n AirBagLocFront: string;\n AirBagLocKnee: string;\n AirBagLocSeatCushion: string;\n AirBagLocSide: string;\n AutoReverseSystem: string;\n AutomaticPedestrianAlertingSound: string;\n AxleConfiguration: string;\n Axles: string;\n BasePrice: string;\n BatteryA: string;\n BatteryA_to: string;\n BatteryCells: string;\n BatteryInfo: string;\n BatteryKWh: string;\n BatteryKWh_to: string;\n BatteryModules: string;\n BatteryPacks: string;\n BatteryType: string;\n BatteryV: string;\n BatteryV_to: string;\n BedLengthIN: string;\n BedType: string;\n BlindSpotMon: string;\n BodyCabType: string;\n BodyClass: string;\n BrakeSystemDesc: string;\n BrakeSystemType: string;\n BusFloorConfigType: string;\n BusLength: string;\n BusType: string;\n CAN_AACN: string;\n CIB: string;\n CashForClunkers: string;\n ChargerLevel: string;\n ChargerPowerKW: string;\n CoolingType: string;\n CurbWeightLB: string;\n CustomMotorcycleType: string;\n DaytimeRunningLight: string;\n DestinationMarket: string;\n DisplacementCC: string;\n DisplacementCI: string;\n DisplacementL: string;\n Doors: string;\n DriveType: string;\n DriverAssist: string;\n DynamicBrakeSupport: string;\n EDR: string;\n ESC: string;\n EVDriveUnit: string;\n ElectrificationLevel: string;\n EngineConfiguration: string;\n EngineCycles: string;\n EngineCylinders: string;\n EngineHP: string;\n EngineHP_to: string;\n EngineKW: string;\n EngineManufacturer: string;\n EngineModel: string;\n EntertainmentSystem: string;\n ErrorCode: string;\n ErrorText: string;\n ForwardCollisionWarning: string;\n FuelInjectionType: string;\n FuelTypePrimary: string;\n FuelTypeSecondary: string;\n GCWR: string;\n GCWR_to: string;\n GVWR: string;\n GVWR_to: string;\n KeylessIgnition: string;\n LaneDepartureWarning: string;\n LaneKeepSystem: string;\n LowerBeamHeadlampLightSource: string;\n Make: string;\n Manufacturer: string;\n ManufacturerId: string;\n Model: string;\n ModelYear: string;\n MotorcycleChassisType: string;\n MotorcycleSuspensionType: string;\n NCSABodyType: string;\n NCSAMake: string;\n NCSAMapExcApprovedBy: string;\n NCSAMapExcApprovedOn: string;\n NCSAMappingException: string;\n NCSAModel: string;\n NCSANote: string;\n Note: string;\n OtherBusInfo: string;\n OtherEngineInfo: string;\n OtherMotorcycleInfo: string;\n OtherRestraintSystemInfo: string;\n OtherTrailerInfo: string;\n ParkAssist: string;\n PedestrianAutomaticEmergencyBraking: string;\n PlantCity: string;\n PlantCompanyName: string;\n PlantCountry: string;\n PlantState: string;\n PossibleValues: string;\n Pretensioner: string;\n RearCrossTrafficAlert: string;\n RearVisibilitySystem: string;\n SAEAutomationLevel: string;\n SAEAutomationLevel_to: string;\n SeatBeltsAll: string;\n SeatRows: string;\n Seats: string;\n SemiautomaticHeadlampBeamSwitching: string;\n Series: string;\n Series2: string;\n SteeringLocation: string;\n SuggestedVIN: string;\n TPMS: string;\n TopSpeedMPH: string;\n TrackWidth: string;\n TractionControl: string;\n TrailerBodyType: string;\n TrailerLength: string;\n TrailerType: string;\n TransmissionSpeeds: string;\n TransmissionStyle: string;\n Trim: string;\n Trim2: string;\n Turbo: string;\n VIN: string;\n ValveTrainDesign: string;\n VehicleType: string;\n WheelBaseLong: string;\n WheelBaseShort: string;\n WheelBaseType: string;\n WheelSizeFront: string;\n WheelSizeRear: string;\n Wheels: string;\n Windows: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVINValuesBatch API Action.\n *\n * @memberof module:api/actions/DecodeVINValuesBatch\n * @alias DecodeVINValuesBatchResponse\n */\nexport type DecodeVINValuesBatchResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["DecodeVINValuesBatch","Fetch","[object Object]","userConfig","super","inputString","action","typeofInputString","getTypeof","Promise","reject","Error","url","this","baseUrl","body","encodeURI","get","method","headers","content-type","then","response","catch","err"],"mappings":"4DAgCaA,UAA6BC,EACxCC,YAAYC,GACVC,MAAMD,GAgBFD,qBACJG,4CAEA,MAAMC,EAAS,uBAGTC,EAAoBC,EAAUH,GACpC,GAA0B,WAAtBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,8FAAIJ,MAAsBF,MAMlC,MAAMO,EAAM,GAAGC,KAAKC,WAAWR,KAEzBS,EAAOC,UAAU,QAAQX,iBAG/B,aAAaQ,KAAKI,IAAIL,EAAK,CACzBM,OAAQ,OACRC,QAAS,CAAEC,eAAgB,qCAC3BL,KAAAA,IAECM,KAAMC,GAAaA,GACnBC,MAAOC,GACNf,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BkB"} \ No newline at end of file diff --git a/dist/module/DecodeVin.js b/dist/module/DecodeVin.js index 5f0d73468..79cca0f3a 100644 --- a/dist/module/DecodeVin.js +++ b/dist/module/DecodeVin.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class o extends e{constructor(e){super(e)}DecodeVin(e,o){return r(this,void 0,void 0,(function*(){const r="DecodeVin",n=t(o);if(o&&"object"!==n)return Promise.reject(new Error(`DecodeVin, "params" argument must be of type object, got: <${n}> ${o}`));const i=t(e);if("string"!==i)return Promise.reject(new Error(`DecodeVin, "vin" argument is required and must be of type string, got: <${i}> ${e}`));const s=t(null==o?void 0:o.modelYear);if((null==o?void 0:o.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVin, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${o.modelYear}`));const c=yield this.buildQueryString(o).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),u=`${this.baseUrl}/${r}/${e}${c}`;return yield this.get(u).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{o as DecodeVin}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class o extends e{constructor(e){super(e)}DecodeVin(e,o){return r(this,void 0,void 0,(function*(){const r="DecodeVin",n=t(o);if(o&&"object"!==n)return Promise.reject(new Error(`DecodeVin, "params" argument must be of type object, got: <${n}> ${o}`));const i=t(e);if("string"!==i)return Promise.reject(new Error(`DecodeVin, "vin" argument is required and must be of type string, got: <${i}> ${e}`));const s=t(null==o?void 0:o.modelYear);if((null==o?void 0:o.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVin, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${o.modelYear}`));const c=yield this.buildQueryString(o).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),u=`${this.baseUrl}/${r}/${e}${c}`;return yield this.get(u).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{o as DecodeVin}; //# sourceMappingURL=DecodeVin.js.map diff --git a/dist/module/DecodeVin.js.map b/dist/module/DecodeVin.js.map index a8c39c344..e5bd7e121 100644 --- a/dist/module/DecodeVin.js.map +++ b/dist/module/DecodeVin.js.map @@ -1 +1 @@ -{"version":3,"file":"DecodeVin.js","sources":["../../src/api/actions/DecodeVin.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeVin\r\n * @category Actions\r\n * @description DecodeVin NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVin](module-api_actions_DecodeVin.DecodeVin.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinResponse](#DecodeVinResponse)\r\n * > - Type: [DecodeVinResults](#DecodeVinResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVin extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The DecodeVin API Action will decode the VIN and the decoded output will be made available in the format of Key-value pairs.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This API also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n * - The 9th digit is not necessary.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVin(\r\n vin: string,\r\n params?: {\r\n modelYear?: number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVin';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVin\r\n * @alias DecodeVinResults\r\n */\r\nexport type DecodeVinResults = {\r\n Value: string | null;\r\n ValueId: string | null;\r\n Variable: string;\r\n VariableId: number;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVin API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVin\r\n * @alias DecodeVinResponse\r\n */\r\nexport type DecodeVinResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["DecodeVin","Fetch","[object Object]","userConfig","super","vin","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofVin","typeofModelYear","modelYear","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAkBC,EAC7BC,YAAYC,GACVC,MAAMD,GAmBFD,UACJG,EACAC,4CAIA,MAAMC,EAAS,YAGTC,EAAeC,EAAUH,GAC/B,GAAIA,GAA2B,WAAjBE,EACZ,OAAOE,QAAQC,OACb,IAAIC,MAEA,8DAAIJ,MAAiBF,MAK7B,MAAMO,EAAYJ,EAAUJ,GAC5B,GAAkB,WAAdQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,2EAAIC,MAAcR,MAK1B,MAAMS,EAAkBL,EAAUH,MAAAA,SAAAA,EAAQS,WAC1C,IAAIT,MAAAA,SAAAA,EAAQS,YAAiC,WAApBD,EACvB,OAAOJ,QAAQC,OACb,IAAIC,MAEA,kGAAIE,MAAoBR,EAAOS,cAMvC,MAAMC,QAAoBC,KAAKC,iBAAiBZ,GAAQa,MAAOC,GAC7DV,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCa,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWf,KAAUF,IAAMW,IAG/C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNV,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Ba"} \ No newline at end of file +{"version":3,"file":"DecodeVin.js","sources":["../../src/api/actions/DecodeVin.ts"],"sourcesContent":["/**\n * @module api/actions/DecodeVin\n * @category Actions\n * @description DecodeVin NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVin](module-api_actions_DecodeVin.DecodeVin.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinResponse](#DecodeVinResponse)\n * > - Type: [DecodeVinResults](#DecodeVinResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVin extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * The DecodeVin API Action will decode the VIN and the decoded output will be made available in the format of Key-value pairs.\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This API also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n * - The 9th digit is not necessary.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {number} [params.modelYear] - Optional Model Year search parameter.\n * @returns {(Promise)} - Api Response object.\n */\n async DecodeVin(\n vin: string,\n params?: {\n modelYear?: number;\n }\n ): Promise {\n const action = 'DecodeVin';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (params?.modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVin\n * @alias DecodeVinResults\n */\nexport type DecodeVinResults = {\n Value: string | null;\n ValueId: string | null;\n Variable: string;\n VariableId: number;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVin API Action.\n *\n * @memberof module:api/actions/DecodeVin\n * @alias DecodeVinResponse\n */\nexport type DecodeVinResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["DecodeVin","Fetch","[object Object]","userConfig","super","vin","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofVin","typeofModelYear","modelYear","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAkBC,EAC7BC,YAAYC,GACVC,MAAMD,GAmBFD,UACJG,EACAC,4CAIA,MAAMC,EAAS,YAGTC,EAAeC,EAAUH,GAC/B,GAAIA,GAA2B,WAAjBE,EACZ,OAAOE,QAAQC,OACb,IAAIC,MAEA,8DAAIJ,MAAiBF,MAK7B,MAAMO,EAAYJ,EAAUJ,GAC5B,GAAkB,WAAdQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,2EAAIC,MAAcR,MAK1B,MAAMS,EAAkBL,EAAUH,MAAAA,SAAAA,EAAQS,WAC1C,IAAIT,MAAAA,SAAAA,EAAQS,YAAiC,WAApBD,EACvB,OAAOJ,QAAQC,OACb,IAAIC,MAEA,kGAAIE,MAAoBR,EAAOS,cAMvC,MAAMC,QAAoBC,KAAKC,iBAAiBZ,GAAQa,MAAOC,GAC7DV,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCa,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWf,KAAUF,IAAMW,IAG/C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNV,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Ba"} \ No newline at end of file diff --git a/dist/module/DecodeVinExtended.js b/dist/module/DecodeVinExtended.js index ec88a47ed..bf21add16 100644 --- a/dist/module/DecodeVinExtended.js +++ b/dist/module/DecodeVinExtended.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class n extends e{constructor(e){super(e)}DecodeVinExtended(e,n){return r(this,void 0,void 0,(function*(){const r="DecodeVinExtended",o=t(n);if(n&&"object"!==o)return Promise.reject(new Error(`DecodeVinExtended, "params" argument must be of type object, got: <${o}> ${n}`));const i=t(e);if("string"!==i)return Promise.reject(new Error(`DecodeVinExtended, "vin" argument is required and must be of type string, got: <${i}> ${e}`));const s=t(null==n?void 0:n.modelYear);if((null==n?void 0:n.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVinExtended, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${n.modelYear}`));const d=yield this.buildQueryString(n).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),c=`${this.baseUrl}/${r}/${e}${d}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{n as DecodeVinExtended}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class n extends e{constructor(e){super(e)}DecodeVinExtended(e,n){return r(this,void 0,void 0,(function*(){const r="DecodeVinExtended",o=t(n);if(n&&"object"!==o)return Promise.reject(new Error(`DecodeVinExtended, "params" argument must be of type object, got: <${o}> ${n}`));const i=t(e);if("string"!==i)return Promise.reject(new Error(`DecodeVinExtended, "vin" argument is required and must be of type string, got: <${i}> ${e}`));const s=t(null==n?void 0:n.modelYear);if((null==n?void 0:n.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVinExtended, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${n.modelYear}`));const d=yield this.buildQueryString(n).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),c=`${this.baseUrl}/${r}/${e}${d}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{n as DecodeVinExtended}; //# sourceMappingURL=DecodeVinExtended.js.map diff --git a/dist/module/DecodeVinExtended.js.map b/dist/module/DecodeVinExtended.js.map index 1a243b383..ebf4b2334 100644 --- a/dist/module/DecodeVinExtended.js.map +++ b/dist/module/DecodeVinExtended.js.map @@ -1 +1 @@ -{"version":3,"file":"DecodeVinExtended.js","sources":["../../src/api/actions/DecodeVinExtended.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeVinExtended\r\n * @category Actions\r\n * @description DecodeVinExtended NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinExtended](module-api_actions_DecodeVinExtended.DecodeVinExtended.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinExtendedResponse](#DecodeVinExtendedResponse)\r\n * > - Type: [DecodeVinExtendedResults](#DecodeVinExtendedResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinExtended extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This is exactly like the DecodeVin method but provides additional information on variables\r\n * related to other NHTSA programs like\r\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\r\n * - This will decode the VIN and the decoded output will be made available\r\n * in the format of Key-value pairs.\r\n * - In the returned 'Results` object:\r\n * - The IDs (VariableID and ValueID) represent the unique ID associated with the Variable/Value.\r\n * - In case of text variables, the ValueID is not applicable.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n * - The 9th digit is not necessary.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVinExtended(\r\n vin: string,\r\n params?: {\r\n modelYear?: string | number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinExtended';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinExtendedResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinExtended\r\n * @alias DecodeVinExtendedResults\r\n */\r\nexport type DecodeVinExtendedResults = {\r\n Value: string | null;\r\n ValueId: string | null;\r\n Variable: string;\r\n VariableId: number;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinExtended API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinExtended\r\n * @alias DecodeVinExtendedResponse\r\n */\r\nexport type DecodeVinExtendedResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["DecodeVinExtended","Fetch","[object Object]","userConfig","super","vin","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofVin","typeofModelYear","modelYear","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA0BC,EACrCC,YAAYC,GACVC,MAAMD,GA0BFD,kBACJG,EACAC,4CAIA,MAAMC,EAAS,oBAGTC,EAAeC,EAAUH,GAC/B,GAAIA,GAA2B,WAAjBE,EACZ,OAAOE,QAAQC,OACb,IAAIC,MAEA,sEAAIJ,MAAiBF,MAK7B,MAAMO,EAAYJ,EAAUJ,GAC5B,GAAkB,WAAdQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,mFAAIC,MAAcR,MAK1B,MAAMS,EAAkBL,EAAUH,MAAAA,SAAAA,EAAQS,WAC1C,IAAIT,MAAAA,SAAAA,EAAQS,YAAiC,WAApBD,EACvB,OAAOJ,QAAQC,OACb,IAAIC,MAEA,0GAAIE,MAAoBR,EAAOS,cAMvC,MAAMC,QAAoBC,KAAKC,iBAAiBZ,GAAQa,MAAOC,GAC7DV,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCa,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWf,KAAUF,IAAMW,IAG/C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNV,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Ba"} \ No newline at end of file +{"version":3,"file":"DecodeVinExtended.js","sources":["../../src/api/actions/DecodeVinExtended.ts"],"sourcesContent":["/**\n * @module api/actions/DecodeVinExtended\n * @category Actions\n * @description DecodeVinExtended NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVinExtended](module-api_actions_DecodeVinExtended.DecodeVinExtended.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinExtendedResponse](#DecodeVinExtendedResponse)\n * > - Type: [DecodeVinExtendedResults](#DecodeVinExtendedResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVinExtended extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This is exactly like the DecodeVin method but provides additional information on variables\n * related to other NHTSA programs like\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\n * - This will decode the VIN and the decoded output will be made available\n * in the format of Key-value pairs.\n * - In the returned 'Results` object:\n * - The IDs (VariableID and ValueID) represent the unique ID associated with the Variable/Value.\n * - In case of text variables, the ValueID is not applicable.\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n * - The 9th digit is not necessary.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\n * @returns {(Promise)} - Api Response object.\n */\n async DecodeVinExtended(\n vin: string,\n params?: {\n modelYear?: string | number;\n }\n ): Promise {\n const action = 'DecodeVinExtended';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (params?.modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinExtendedResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVinExtended\n * @alias DecodeVinExtendedResults\n */\nexport type DecodeVinExtendedResults = {\n Value: string | null;\n ValueId: string | null;\n Variable: string;\n VariableId: number;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVinExtended API Action.\n *\n * @memberof module:api/actions/DecodeVinExtended\n * @alias DecodeVinExtendedResponse\n */\nexport type DecodeVinExtendedResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["DecodeVinExtended","Fetch","[object Object]","userConfig","super","vin","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofVin","typeofModelYear","modelYear","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA0BC,EACrCC,YAAYC,GACVC,MAAMD,GA0BFD,kBACJG,EACAC,4CAIA,MAAMC,EAAS,oBAGTC,EAAeC,EAAUH,GAC/B,GAAIA,GAA2B,WAAjBE,EACZ,OAAOE,QAAQC,OACb,IAAIC,MAEA,sEAAIJ,MAAiBF,MAK7B,MAAMO,EAAYJ,EAAUJ,GAC5B,GAAkB,WAAdQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,mFAAIC,MAAcR,MAK1B,MAAMS,EAAkBL,EAAUH,MAAAA,SAAAA,EAAQS,WAC1C,IAAIT,MAAAA,SAAAA,EAAQS,YAAiC,WAApBD,EACvB,OAAOJ,QAAQC,OACb,IAAIC,MAEA,0GAAIE,MAAoBR,EAAOS,cAMvC,MAAMC,QAAoBC,KAAKC,iBAAiBZ,GAAQa,MAAOC,GAC7DV,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCa,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWf,KAAUF,IAAMW,IAG/C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNV,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Ba"} \ No newline at end of file diff --git a/dist/module/DecodeVinValues.js b/dist/module/DecodeVinValues.js index 402243efd..915121d3e 100644 --- a/dist/module/DecodeVinValues.js +++ b/dist/module/DecodeVinValues.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class o extends e{constructor(e){super(e)}DecodeVinValues(e,o){return r(this,void 0,void 0,(function*(){const r="DecodeVinValues",n=t(o);if(o&&"object"!==n)return Promise.reject(new Error(`DecodeVinValues, "params" argument must be of type object, got: <${n}> ${o}`));const s=t(e);if("string"!==s)return Promise.reject(new Error(`DecodeVinValues, "vin" argument is required and must be of type string, got: <${s}> ${e}`));const i=t(null==o?void 0:o.modelYear);if((null==o?void 0:o.modelYear)&&"string"!==i&&"number"!==i)return Promise.reject(new Error(`DecodeVinValues, "params.modelYear" argument is required and must be of type string or number, got: <${i}> ${o.modelYear}`));const u=yield this.buildQueryString(o).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),c=`${this.baseUrl}/${r}/${e}${u}`;return yield this.get(c).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{o as DecodeVinValues}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class o extends e{constructor(e){super(e)}DecodeVinValues(e,o){return r(this,void 0,void 0,(function*(){const r="DecodeVinValues",n=t(o);if(o&&"object"!==n)return Promise.reject(new Error(`DecodeVinValues, "params" argument must be of type object, got: <${n}> ${o}`));const s=t(e);if("string"!==s)return Promise.reject(new Error(`DecodeVinValues, "vin" argument is required and must be of type string, got: <${s}> ${e}`));const i=t(null==o?void 0:o.modelYear);if((null==o?void 0:o.modelYear)&&"string"!==i&&"number"!==i)return Promise.reject(new Error(`DecodeVinValues, "params.modelYear" argument is required and must be of type string or number, got: <${i}> ${o.modelYear}`));const u=yield this.buildQueryString(o).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),a=`${this.baseUrl}/${r}/${e}${u}`;return yield this.get(a).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{o as DecodeVinValues}; //# sourceMappingURL=DecodeVinValues.js.map diff --git a/dist/module/DecodeVinValues.js.map b/dist/module/DecodeVinValues.js.map index db2d153ef..cdd62eda9 100644 --- a/dist/module/DecodeVinValues.js.map +++ b/dist/module/DecodeVinValues.js.map @@ -1 +1 @@ -{"version":3,"file":"DecodeVinValues.js","sources":["../../src/api/actions/DecodeVinValues.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeVinValues\r\n * @category Actions\r\n * @description DecodeVinValues NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinValues](module-api_actions_DecodeVinValues.DecodeVinValues.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinValuesResponse](#DecodeVinValuesResponse)\r\n * > - Type: [DecodeVinValuesResults](#DecodeVinValuesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinValues extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The DecodeVinValues API Action will decode the VIN with the Results returned in a _flat file_ format.\r\n * - The Results will be made available in a flat file format of a single object containing\r\n * 'key: value' results.\r\n * - Providing params.modelYear allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeVinValues(\r\n vin: string,\r\n params?: {\r\n modelYear?: number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinValues';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (\r\n params?.modelYear &&\r\n typeofModelYear !== 'string' &&\r\n typeofModelYear !== 'number'\r\n ) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinValuesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinValues\r\n * @alias DecodeVinValuesResults\r\n */\r\nexport type DecodeVinValuesResults = {\r\n /** Flat file format, single object containing keys and values of type string */\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinValues API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinValues\r\n * @alias DecodeVinValuesResponse\r\n */\r\nexport type DecodeVinValuesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /**\r\n * The search results returned by the NHSTA API request.\r\n * Flat file format, single object containing keys and values of type string\r\n * */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["DecodeVinValues","Fetch","[object Object]","userConfig","super","vin","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofVin","typeofModelYear","modelYear","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAwBC,EACnCC,YAAYC,GACVC,MAAMD,GAoBFD,gBACJG,EACAC,4CAIA,MAAMC,EAAS,kBAGTC,EAAeC,EAAUH,GAC/B,GAAIA,GAA2B,WAAjBE,EACZ,OAAOE,QAAQC,OACb,IAAIC,MAEA,oEAAIJ,MAAiBF,MAK7B,MAAMO,EAAYJ,EAAUJ,GAC5B,GAAkB,WAAdQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,iFAAIC,MAAcR,MAK1B,MAAMS,EAAkBL,EAAUH,MAAAA,SAAAA,EAAQS,WAC1C,IACET,MAAAA,SAAAA,EAAQS,YACY,WAApBD,GACoB,WAApBA,EAEA,OAAOJ,QAAQC,OACb,IAAIC,MAEA,wGAAIE,MAAoBR,EAAOS,cAMvC,MAAMC,QAAoBC,KAAKC,iBAAiBZ,GAAQa,MAAOC,GAC7DV,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCa,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWf,KAAUF,IAAMW,IAG/C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNV,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Ba"} \ No newline at end of file +{"version":3,"file":"DecodeVinValues.js","sources":["../../src/api/actions/DecodeVinValues.ts"],"sourcesContent":["/**\n * @module api/actions/DecodeVinValues\n * @category Actions\n * @description DecodeVinValues NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVinValues](module-api_actions_DecodeVinValues.DecodeVinValues.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinValuesResponse](#DecodeVinValuesResponse)\n * > - Type: [DecodeVinValuesResults](#DecodeVinValuesResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVinValues extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * The DecodeVinValues API Action will decode the VIN with the Results returned in a _flat file_ format.\n * - The Results will be made available in a flat file format of a single object containing\n * 'key: value' results.\n * - Providing params.modelYear allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\n * @returns {(Promise)} Api Response object.\n */\n async DecodeVinValues(\n vin: string,\n params?: {\n modelYear?: number;\n }\n ): Promise {\n const action = 'DecodeVinValues';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (\n params?.modelYear &&\n typeofModelYear !== 'string' &&\n typeofModelYear !== 'number'\n ) {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinValuesResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVinValues\n * @alias DecodeVinValuesResults\n */\nexport type DecodeVinValuesResults = {\n /** Flat file format, single object containing keys and values of type string */\n ABS: string;\n ActiveSafetySysNote: string;\n AdaptiveCruiseControl: string;\n AdaptiveDrivingBeam: string;\n AdaptiveHeadlights: string;\n AdditionalErrorText: string;\n AirBagLocCurtain: string;\n AirBagLocFront: string;\n AirBagLocKnee: string;\n AirBagLocSeatCushion: string;\n AirBagLocSide: string;\n AutoReverseSystem: string;\n AutomaticPedestrianAlertingSound: string;\n AxleConfiguration: string;\n Axles: string;\n BasePrice: string;\n BatteryA: string;\n BatteryA_to: string;\n BatteryCells: string;\n BatteryInfo: string;\n BatteryKWh: string;\n BatteryKWh_to: string;\n BatteryModules: string;\n BatteryPacks: string;\n BatteryType: string;\n BatteryV: string;\n BatteryV_to: string;\n BedLengthIN: string;\n BedType: string;\n BlindSpotMon: string;\n BodyCabType: string;\n BodyClass: string;\n BrakeSystemDesc: string;\n BrakeSystemType: string;\n BusFloorConfigType: string;\n BusLength: string;\n BusType: string;\n CAN_AACN: string;\n CIB: string;\n CashForClunkers: string;\n ChargerLevel: string;\n ChargerPowerKW: string;\n CoolingType: string;\n CurbWeightLB: string;\n CustomMotorcycleType: string;\n DaytimeRunningLight: string;\n DestinationMarket: string;\n DisplacementCC: string;\n DisplacementCI: string;\n DisplacementL: string;\n Doors: string;\n DriveType: string;\n DriverAssist: string;\n DynamicBrakeSupport: string;\n EDR: string;\n ESC: string;\n EVDriveUnit: string;\n ElectrificationLevel: string;\n EngineConfiguration: string;\n EngineCycles: string;\n EngineCylinders: string;\n EngineHP: string;\n EngineHP_to: string;\n EngineKW: string;\n EngineManufacturer: string;\n EngineModel: string;\n EntertainmentSystem: string;\n ErrorCode: string;\n ErrorText: string;\n ForwardCollisionWarning: string;\n FuelInjectionType: string;\n FuelTypePrimary: string;\n FuelTypeSecondary: string;\n GCWR: string;\n GCWR_to: string;\n GVWR: string;\n GVWR_to: string;\n KeylessIgnition: string;\n LaneDepartureWarning: string;\n LaneKeepSystem: string;\n LowerBeamHeadlampLightSource: string;\n Make: string;\n Manufacturer: string;\n ManufacturerId: string;\n Model: string;\n ModelYear: string;\n MotorcycleChassisType: string;\n MotorcycleSuspensionType: string;\n NCSABodyType: string;\n NCSAMake: string;\n NCSAMapExcApprovedBy: string;\n NCSAMapExcApprovedOn: string;\n NCSAMappingException: string;\n NCSAModel: string;\n NCSANote: string;\n Note: string;\n OtherBusInfo: string;\n OtherEngineInfo: string;\n OtherMotorcycleInfo: string;\n OtherRestraintSystemInfo: string;\n OtherTrailerInfo: string;\n ParkAssist: string;\n PedestrianAutomaticEmergencyBraking: string;\n PlantCity: string;\n PlantCompanyName: string;\n PlantCountry: string;\n PlantState: string;\n PossibleValues: string;\n Pretensioner: string;\n RearCrossTrafficAlert: string;\n RearVisibilitySystem: string;\n SAEAutomationLevel: string;\n SAEAutomationLevel_to: string;\n SeatBeltsAll: string;\n SeatRows: string;\n Seats: string;\n SemiautomaticHeadlampBeamSwitching: string;\n Series: string;\n Series2: string;\n SteeringLocation: string;\n SuggestedVIN: string;\n TPMS: string;\n TopSpeedMPH: string;\n TrackWidth: string;\n TractionControl: string;\n TrailerBodyType: string;\n TrailerLength: string;\n TrailerType: string;\n TransmissionSpeeds: string;\n TransmissionStyle: string;\n Trim: string;\n Trim2: string;\n Turbo: string;\n VIN: string;\n ValveTrainDesign: string;\n VehicleType: string;\n WheelBaseLong: string;\n WheelBaseShort: string;\n WheelBaseType: string;\n WheelSizeFront: string;\n WheelSizeRear: string;\n Wheels: string;\n Windows: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVinValues API Action.\n *\n * @memberof module:api/actions/DecodeVinValues\n * @alias DecodeVinValuesResponse\n */\nexport type DecodeVinValuesResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /**\n * The search results returned by the NHSTA API request.\n * Flat file format, single object containing keys and values of type string\n * */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["DecodeVinValues","Fetch","[object Object]","userConfig","super","vin","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofVin","typeofModelYear","modelYear","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAwBC,EACnCC,YAAYC,GACVC,MAAMD,GAoBFD,gBACJG,EACAC,4CAIA,MAAMC,EAAS,kBAGTC,EAAeC,EAAUH,GAC/B,GAAIA,GAA2B,WAAjBE,EACZ,OAAOE,QAAQC,OACb,IAAIC,MAEA,oEAAIJ,MAAiBF,MAK7B,MAAMO,EAAYJ,EAAUJ,GAC5B,GAAkB,WAAdQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,iFAAIC,MAAcR,MAK1B,MAAMS,EAAkBL,EAAUH,MAAAA,SAAAA,EAAQS,WAC1C,IACET,MAAAA,SAAAA,EAAQS,YACY,WAApBD,GACoB,WAApBA,EAEA,OAAOJ,QAAQC,OACb,IAAIC,MAEA,wGAAIE,MAAoBR,EAAOS,cAMvC,MAAMC,QAAoBC,KAAKC,iBAAiBZ,GAAQa,MAAOC,GAC7DV,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCa,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWf,KAAUF,IAAMW,IAG/C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNV,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Ba"} \ No newline at end of file diff --git a/dist/module/DecodeVinValuesExtended.js b/dist/module/DecodeVinValuesExtended.js index a335e2955..fc79dd939 100644 --- a/dist/module/DecodeVinValuesExtended.js +++ b/dist/module/DecodeVinValuesExtended.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class n extends e{constructor(e){super(e)}DecodeVinValuesExtended(e,n){return r(this,void 0,void 0,(function*(){const r="DecodeVinValuesExtended",o=t(n);if(n&&"object"!==o)return Promise.reject(new Error(`DecodeVinValuesExtended, "params" argument must be of type object, got: <${o}> ${n}`));const s=t(e);if("string"!==s)return Promise.reject(new Error(`DecodeVinValuesExtended, "vin" argument is required and must be of type string, got: <${s}> ${e}`));const i=t(null==n?void 0:n.modelYear);if((null==n?void 0:n.modelYear)&&"number"!==i)return Promise.reject(new Error(`DecodeVinValuesExtended, "params.modelYear" argument is required and must be of type string or number, got: <${i}> ${n.modelYear}`));const d=yield this.buildQueryString(n).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),u=`${this.baseUrl}/${r}/${e}${d}`;return yield this.get(u).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{n as DecodeVinValuesExtended}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class n extends e{constructor(e){super(e)}DecodeVinValuesExtended(e,n){return r(this,void 0,void 0,(function*(){const r="DecodeVinValuesExtended",o=t(n);if(n&&"object"!==o)return Promise.reject(new Error(`DecodeVinValuesExtended, "params" argument must be of type object, got: <${o}> ${n}`));const s=t(e);if("string"!==s)return Promise.reject(new Error(`DecodeVinValuesExtended, "vin" argument is required and must be of type string, got: <${s}> ${e}`));const i=t(null==n?void 0:n.modelYear);if((null==n?void 0:n.modelYear)&&"number"!==i)return Promise.reject(new Error(`DecodeVinValuesExtended, "params.modelYear" argument is required and must be of type string or number, got: <${i}> ${n.modelYear}`));const d=yield this.buildQueryString(n).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),u=`${this.baseUrl}/${r}/${e}${d}`;return yield this.get(u).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{n as DecodeVinValuesExtended}; //# sourceMappingURL=DecodeVinValuesExtended.js.map diff --git a/dist/module/DecodeVinValuesExtended.js.map b/dist/module/DecodeVinValuesExtended.js.map index 4c0f79a0c..1c1095de7 100644 --- a/dist/module/DecodeVinValuesExtended.js.map +++ b/dist/module/DecodeVinValuesExtended.js.map @@ -1 +1 @@ -{"version":3,"file":"DecodeVinValuesExtended.js","sources":["../../src/api/actions/DecodeVinValuesExtended.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeVinValuesExtended\r\n * @category Actions\r\n * @description DecodeVinValuesExtended NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinValuesExtended](module-api_actions_DecodeVinValuesExtended.DecodeVinValuesExtended.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinValuesExtendedResponse](#DecodeVinValuesExtendedResponse)\r\n * > - Type: [DecodeVinValuesExtendedResults](#DecodeVinValuesExtendedResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinValuesExtended extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This is exactly like the DecodeVinValues (flat format Results) method but provides additional information\r\n * on variables related to other NHTSA programs like\r\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\r\n * - The Results will be made available in a flat file format of a single object containing\r\n * 'key: value' results.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @reje\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeVinValuesExtended(\r\n vin: string,\r\n params?: {\r\n modelYear?: string | number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinValuesExtended';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinValuesExtendedResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinValuesExtended\r\n * @alias DecodeVinValuesExtendedResults\r\n */\r\nexport type DecodeVinValuesExtendedResults = {\r\n /** Flat file format, single object containing keys and values of type string */\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinValuesExtended API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinValuesExtended\r\n * @alias DecodeVinValuesExtendedResponse\r\n */\r\nexport type DecodeVinValuesExtendedResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /**\r\n * The search results returned by the NHSTA API request.\r\n * Flat file format, single object containing keys and values of type string\r\n * */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["DecodeVinValuesExtended","Fetch","[object Object]","userConfig","super","vin","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofVin","typeofModelYear","modelYear","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAgCC,EAC3CC,YAAYC,GACVC,MAAMD,GAuBFD,wBACJG,EACAC,4CAIA,MAAMC,EAAS,0BAGTC,EAAeC,EAAUH,GAC/B,GAAIA,GAA2B,WAAjBE,EACZ,OAAOE,QAAQC,OACb,IAAIC,MAEA,4EAAIJ,MAAiBF,MAK7B,MAAMO,EAAYJ,EAAUJ,GAC5B,GAAkB,WAAdQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,yFAAIC,MAAcR,MAK1B,MAAMS,EAAkBL,EAAUH,MAAAA,SAAAA,EAAQS,WAC1C,IAAIT,MAAAA,SAAAA,EAAQS,YAAiC,WAApBD,EACvB,OAAOJ,QAAQC,OACb,IAAIC,MAEA,gHAAIE,MAAoBR,EAAOS,cAMvC,MAAMC,QAAoBC,KAAKC,iBAAiBZ,GAAQa,MAAOC,GAC7DV,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCa,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWf,KAAUF,IAAMW,IAG/C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNV,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Ba"} \ No newline at end of file +{"version":3,"file":"DecodeVinValuesExtended.js","sources":["../../src/api/actions/DecodeVinValuesExtended.ts"],"sourcesContent":["/**\n * @module api/actions/DecodeVinValuesExtended\n * @category Actions\n * @description DecodeVinValuesExtended NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeVinValuesExtended](module-api_actions_DecodeVinValuesExtended.DecodeVinValuesExtended.html)\n * >\n * > **Types**\n * > - Type: [DecodeVinValuesExtendedResponse](#DecodeVinValuesExtendedResponse)\n * > - Type: [DecodeVinValuesExtendedResults](#DecodeVinValuesExtendedResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeVinValuesExtended extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This is exactly like the DecodeVinValues (flat format Results) method but provides additional information\n * on variables related to other NHTSA programs like\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\n * - The Results will be made available in a flat file format of a single object containing\n * 'key: value' results.\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\n * or older (pre-1980), model year ranges.\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\n * - In this case, the VIN will be decoded partially with the available characters.\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\n *\n * @async\n * @param {string} vin - Vehicle Identification Number (full or partial).\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\n * @reje\n * @returns {(Promise)} Api Response object.\n */\n async DecodeVinValuesExtended(\n vin: string,\n params?: {\n modelYear?: string | number;\n }\n ): Promise {\n const action = 'DecodeVinValuesExtended';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofVin = getTypeof(vin);\n if (typeofVin !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\n `<${typeofVin}> ${vin}`\n )\n );\n }\n\n const typeofModelYear = getTypeof(params?.modelYear);\n if (params?.modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\n `<${typeofModelYear}> ${params.modelYear}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeVinValuesExtendedResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeVinValuesExtended\n * @alias DecodeVinValuesExtendedResults\n */\nexport type DecodeVinValuesExtendedResults = {\n /** Flat file format, single object containing keys and values of type string */\n ABS: string;\n ActiveSafetySysNote: string;\n AdaptiveCruiseControl: string;\n AdaptiveDrivingBeam: string;\n AdaptiveHeadlights: string;\n AdditionalErrorText: string;\n AirBagLocCurtain: string;\n AirBagLocFront: string;\n AirBagLocKnee: string;\n AirBagLocSeatCushion: string;\n AirBagLocSide: string;\n AutoReverseSystem: string;\n AutomaticPedestrianAlertingSound: string;\n AxleConfiguration: string;\n Axles: string;\n BasePrice: string;\n BatteryA: string;\n BatteryA_to: string;\n BatteryCells: string;\n BatteryInfo: string;\n BatteryKWh: string;\n BatteryKWh_to: string;\n BatteryModules: string;\n BatteryPacks: string;\n BatteryType: string;\n BatteryV: string;\n BatteryV_to: string;\n BedLengthIN: string;\n BedType: string;\n BlindSpotMon: string;\n BodyCabType: string;\n BodyClass: string;\n BrakeSystemDesc: string;\n BrakeSystemType: string;\n BusFloorConfigType: string;\n BusLength: string;\n BusType: string;\n CAN_AACN: string;\n CIB: string;\n CashForClunkers: string;\n ChargerLevel: string;\n ChargerPowerKW: string;\n CoolingType: string;\n CurbWeightLB: string;\n CustomMotorcycleType: string;\n DaytimeRunningLight: string;\n DestinationMarket: string;\n DisplacementCC: string;\n DisplacementCI: string;\n DisplacementL: string;\n Doors: string;\n DriveType: string;\n DriverAssist: string;\n DynamicBrakeSupport: string;\n EDR: string;\n ESC: string;\n EVDriveUnit: string;\n ElectrificationLevel: string;\n EngineConfiguration: string;\n EngineCycles: string;\n EngineCylinders: string;\n EngineHP: string;\n EngineHP_to: string;\n EngineKW: string;\n EngineManufacturer: string;\n EngineModel: string;\n EntertainmentSystem: string;\n ErrorCode: string;\n ErrorText: string;\n ForwardCollisionWarning: string;\n FuelInjectionType: string;\n FuelTypePrimary: string;\n FuelTypeSecondary: string;\n GCWR: string;\n GCWR_to: string;\n GVWR: string;\n GVWR_to: string;\n KeylessIgnition: string;\n LaneDepartureWarning: string;\n LaneKeepSystem: string;\n LowerBeamHeadlampLightSource: string;\n Make: string;\n Manufacturer: string;\n ManufacturerId: string;\n Model: string;\n ModelYear: string;\n MotorcycleChassisType: string;\n MotorcycleSuspensionType: string;\n NCSABodyType: string;\n NCSAMake: string;\n NCSAMapExcApprovedBy: string;\n NCSAMapExcApprovedOn: string;\n NCSAMappingException: string;\n NCSAModel: string;\n NCSANote: string;\n Note: string;\n OtherBusInfo: string;\n OtherEngineInfo: string;\n OtherMotorcycleInfo: string;\n OtherRestraintSystemInfo: string;\n OtherTrailerInfo: string;\n ParkAssist: string;\n PedestrianAutomaticEmergencyBraking: string;\n PlantCity: string;\n PlantCompanyName: string;\n PlantCountry: string;\n PlantState: string;\n PossibleValues: string;\n Pretensioner: string;\n RearCrossTrafficAlert: string;\n RearVisibilitySystem: string;\n SAEAutomationLevel: string;\n SAEAutomationLevel_to: string;\n SeatBeltsAll: string;\n SeatRows: string;\n Seats: string;\n SemiautomaticHeadlampBeamSwitching: string;\n Series: string;\n Series2: string;\n SteeringLocation: string;\n SuggestedVIN: string;\n TPMS: string;\n TopSpeedMPH: string;\n TrackWidth: string;\n TractionControl: string;\n TrailerBodyType: string;\n TrailerLength: string;\n TrailerType: string;\n TransmissionSpeeds: string;\n TransmissionStyle: string;\n Trim: string;\n Trim2: string;\n Turbo: string;\n VIN: string;\n ValveTrainDesign: string;\n VehicleType: string;\n WheelBaseLong: string;\n WheelBaseShort: string;\n WheelBaseType: string;\n WheelSizeFront: string;\n WheelSizeRear: string;\n Wheels: string;\n Windows: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeVinValuesExtended API Action.\n *\n * @memberof module:api/actions/DecodeVinValuesExtended\n * @alias DecodeVinValuesExtendedResponse\n */\nexport type DecodeVinValuesExtendedResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /**\n * The search results returned by the NHSTA API request.\n * Flat file format, single object containing keys and values of type string\n * */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["DecodeVinValuesExtended","Fetch","[object Object]","userConfig","super","vin","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofVin","typeofModelYear","modelYear","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAgCC,EAC3CC,YAAYC,GACVC,MAAMD,GAuBFD,wBACJG,EACAC,4CAIA,MAAMC,EAAS,0BAGTC,EAAeC,EAAUH,GAC/B,GAAIA,GAA2B,WAAjBE,EACZ,OAAOE,QAAQC,OACb,IAAIC,MAEA,4EAAIJ,MAAiBF,MAK7B,MAAMO,EAAYJ,EAAUJ,GAC5B,GAAkB,WAAdQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,yFAAIC,MAAcR,MAK1B,MAAMS,EAAkBL,EAAUH,MAAAA,SAAAA,EAAQS,WAC1C,IAAIT,MAAAA,SAAAA,EAAQS,YAAiC,WAApBD,EACvB,OAAOJ,QAAQC,OACb,IAAIC,MAEA,gHAAIE,MAAoBR,EAAOS,cAMvC,MAAMC,QAAoBC,KAAKC,iBAAiBZ,GAAQa,MAAOC,GAC7DV,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCa,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWf,KAAUF,IAAMW,IAG/C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNV,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Ba"} \ No newline at end of file diff --git a/dist/module/DecodeWMI.js b/dist/module/DecodeWMI.js index 3d9b05d3f..f82a722f5 100644 --- a/dist/module/DecodeWMI.js +++ b/dist/module/DecodeWMI.js @@ -1,2 +1,2 @@ -import{F as r,_ as e,g as t}from"./Fetch-b3914c0a.js";class s extends r{constructor(r){super(r)}DecodeWMI(r){return e(this,void 0,void 0,(function*(){const e="DecodeWMI",s=t(r);if("string"!==s)return Promise.reject(new Error(`DecodeWMI, "WMI" argument is required and must be of type string, got: <${s}> ${r}`));const i=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),o=`${this.baseUrl}/${e}/${r}${i}`;return yield this.get(o).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{s as DecodeWMI}; +import{F as r,_ as e,g as t}from"./Fetch-44aa28fd.js";class s extends r{constructor(r){super(r)}DecodeWMI(r){return e(this,void 0,void 0,(function*(){const e="DecodeWMI",s=t(r);if("string"!==s)return Promise.reject(new Error(`DecodeWMI, "WMI" argument is required and must be of type string, got: <${s}> ${r}`));const i=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),o=`${this.baseUrl}/${e}/${r}${i}`;return yield this.get(o).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{s as DecodeWMI}; //# sourceMappingURL=DecodeWMI.js.map diff --git a/dist/module/DecodeWMI.js.map b/dist/module/DecodeWMI.js.map index 58fe9bffb..d356b4459 100644 --- a/dist/module/DecodeWMI.js.map +++ b/dist/module/DecodeWMI.js.map @@ -1 +1 @@ -{"version":3,"file":"DecodeWMI.js","sources":["../../src/api/actions/DecodeWMI.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeWMI\r\n * @category Actions\r\n * @description DecodeWMI NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeWMI](module-api_actions_DecodeWMI.DecodeWMI.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeWMIResponse](#DecodeWMIResponse)\r\n * > - Type: [DecodeWMIResults](#DecodeWMIResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeWMI extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides information on the World Manufacturer Identifier for a specific WMI code.\r\n * - `WMI` may be put in as either 3 characters representing VIN position 1-3 or 6 characters\r\n * representing VIN positions 1-3 & 12-14. Example \"JTD\", \"1T9131\".\r\n *\r\n * @async\r\n * @param {string} WMI - World Manufacturer Identifier.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeWMI(WMI: string): Promise {\r\n const action = 'DecodeWMI';\r\n\r\n /* Runtime typechecking */\r\n const typeofWMI = getTypeof(WMI);\r\n if (typeofWMI !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"WMI\" argument is required and must be of type string, got: ` +\r\n `<${typeofWMI}> ${WMI}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${WMI}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeWMIResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeWMI\r\n * @alias DecodeWMIResults\r\n */\r\nexport type DecodeWMIResults = {\r\n CommonName: string;\r\n CreatedOn: string;\r\n DateAvailableToPublic: string;\r\n Make: string;\r\n ManufacturerName: string;\r\n ParentCompanyName: string;\r\n URL: string;\r\n UpdatedOn: string;\r\n VehicleType: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeWMI API Action.\r\n *\r\n * @memberof module:api/actions/DecodeWMI\r\n * @alias DecodeWMIResponse\r\n */\r\nexport type DecodeWMIResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["DecodeWMI","Fetch","[object Object]","userConfig","super","WMI","action","typeofWMI","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAkBC,EAC7BC,YAAYC,GACVC,MAAMD,GAYFD,UAAUG,4CACd,MAAMC,EAAS,YAGTC,EAAYC,EAAUH,GAC5B,GAAkB,WAAdE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,2EAAIJ,MAAcF,MAM1B,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAMO,IAG/C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file +{"version":3,"file":"DecodeWMI.js","sources":["../../src/api/actions/DecodeWMI.ts"],"sourcesContent":["/**\n * @module api/actions/DecodeWMI\n * @category Actions\n * @description DecodeWMI NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [DecodeWMI](module-api_actions_DecodeWMI.DecodeWMI.html)\n * >\n * > **Types**\n * > - Type: [DecodeWMIResponse](#DecodeWMIResponse)\n * > - Type: [DecodeWMIResults](#DecodeWMIResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class DecodeWMI extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides information on the World Manufacturer Identifier for a specific WMI code.\n * - `WMI` may be put in as either 3 characters representing VIN position 1-3 or 6 characters\n * representing VIN positions 1-3 & 12-14. Example \"JTD\", \"1T9131\".\n *\n * @async\n * @param {string} WMI - World Manufacturer Identifier.\n * @returns {(Promise)} Api Response object.\n */\n async DecodeWMI(WMI: string): Promise {\n const action = 'DecodeWMI';\n\n /* Runtime typechecking */\n const typeofWMI = getTypeof(WMI);\n if (typeofWMI !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"WMI\" argument is required and must be of type string, got: ` +\n `<${typeofWMI}> ${WMI}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${WMI}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link DecodeWMIResponse}.Results' array.\n *\n * @memberof module:api/actions/DecodeWMI\n * @alias DecodeWMIResults\n */\nexport type DecodeWMIResults = {\n CommonName: string;\n CreatedOn: string;\n DateAvailableToPublic: string;\n Make: string;\n ManufacturerName: string;\n ParentCompanyName: string;\n URL: string;\n UpdatedOn: string;\n VehicleType: string;\n};\n\n/**\n * Type representing the complete response returned by the DecodeWMI API Action.\n *\n * @memberof module:api/actions/DecodeWMI\n * @alias DecodeWMIResponse\n */\nexport type DecodeWMIResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["DecodeWMI","Fetch","[object Object]","userConfig","super","WMI","action","typeofWMI","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAkBC,EAC7BC,YAAYC,GACVC,MAAMD,GAYFD,UAAUG,4CACd,MAAMC,EAAS,YAGTC,EAAYC,EAAUH,GAC5B,GAAkB,WAAdE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,2EAAIJ,MAAcF,MAM1B,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAMO,IAG/C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file diff --git a/dist/module/Fetch-44aa28fd.js b/dist/module/Fetch-44aa28fd.js new file mode 100644 index 000000000..97c92e78e --- /dev/null +++ b/dist/module/Fetch-44aa28fd.js @@ -0,0 +1,16 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +function t(t,e,r,o){return new(r||(r=Promise))((function(n,s){function i(t){try{u(o.next(t))}catch(t){s(t)}}function a(t){try{u(o.throw(t))}catch(t){s(t)}}function u(t){t.done?n(t.value):new r((function(e){e(t.value)})).then(i,a)}u((o=o.apply(t,e||[])).next())}))}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var o={exports:{}};!function(t,r){var o="undefined"!=typeof self?self:e,n=function(){function t(){this.fetch=!1,this.DOMException=o.DOMException}return t.prototype=o,new t}();!function(t){!function(e){var r="URLSearchParams"in t,o="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),s="FormData"in t,i="ArrayBuffer"in t;if(i)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function l(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function y(t){var e=new FileReader,r=l(e);return e.readAsArrayBuffer(t),r}function b(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:s&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():i&&n&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=b(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=b(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=p(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var t,e,r,o=p(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=l(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o-1?o:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function v(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}})),e}function E(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},m.call(g.prototype),m.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},E.error=function(){var t=new E(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];E.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new E(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function O(t,r){return new Promise((function(o,s){var i=new g(t,r);if(i.signal&&i.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),o=r.shift().trim();if(o){var n=r.join(":").trim();e.append(o,n)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;o(new E(n,r))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},a.open(i.method,i.url,!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),i.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),i.signal&&(i.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",u)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}O.polyfill=!0,t.fetch||(t.fetch=O,t.Headers=d,t.Request=g,t.Response=E),e.Headers=d,e.Request=g,e.Response=E,e.fetch=O,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var s=n;(r=s.fetch).default=s.fetch,r.fetch=s.fetch,r.Headers=s.Headers,r.Request=s.Request,r.Response=s.Response,t.exports=r}(o,o.exports);var n=r(o.exports);function s(t){const e=Object.prototype.toString.call(t).toLowerCase();return e.slice(8,e.length-1)}const i={apiResponseFormat:"json",baseUrl:"https://vpic.nhtsa.dot.gov/api/vehicles",options:{}};class a{constructor(t){let e;e=t&&"object"===s(t)?Object.assign(Object.assign(Object.assign({},i),t),{options:Object.assign(Object.assign({},i.options),t.options)}):Object.assign({},i),this.apiResponseFormat="json",this.baseUrl=e.baseUrl,this.options=e.options}buildQueryString(e,r=!1){return t(this,void 0,void 0,(function*(){return e=e&&"object"===s(e)?Object.assign(Object.assign({},e),{format:this.apiResponseFormat}):{format:this.apiResponseFormat},yield function(t={},e=!1){if("object"!==s(t))return Promise.reject(new Error("queryString(params) - expected params in the form of an object, got: "+t));const r=Object.entries(t),o=r.length;if(o<1)return Promise.resolve("");let n=!1;const i=r.map(([t,r],i)=>{let a="",u="";const c=s(r);if(r&&"number"===c&&(r=r.toString()),(r||e)&&("string"===c||"number"===c))return n||(a="?",n=!0),i{if(!(null==t?void 0:t.status)||t.status>=400)throw new Error(`Bad response from server, code: ${null==t?void 0:t.status}, text: ${null==t?void 0:t.statusText}, headers: ${null==t?void 0:t.headers}`);return t}).catch(t=>Promise.reject(new Error("Fetch.get() http error: "+t))),u=yield a.json().then(t=>t),c=Object.assign(Object.assign({},u),{FetchResponse:{headers:a.headers,ok:a.ok,redirected:a.redirected,status:a.status,statusText:a.statusText,url:a.url}});return Promise.resolve(c)}))}}export{a as F,t as _,s as g}; +//# sourceMappingURL=Fetch-44aa28fd.js.map diff --git a/dist/module/Fetch-44aa28fd.js.map b/dist/module/Fetch-44aa28fd.js.map new file mode 100644 index 000000000..a4d0b3134 --- /dev/null +++ b/dist/module/Fetch-44aa28fd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Fetch-44aa28fd.js","sources":["../../node_modules/tslib/tslib.es6.js","../../node_modules/cross-fetch/dist/browser-ponyfill.js","../../src/utils/getTypeof.ts","../../src/api/Fetch.ts","../../src/utils/makeQueryString.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","var global = typeof self !== 'undefined' ? self : this;\nvar __self__ = (function () {\nfunction F() {\nthis.fetch = false;\nthis.DOMException = global.DOMException\n}\nF.prototype = global;\nreturn new F();\n})();\n(function(self) {\n\nvar irrelevant = (function (exports) {\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = self.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.onabort = function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!self.fetch) {\n self.fetch = fetch;\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n return exports;\n\n}({}));\n})(__self__);\n__self__.fetch.ponyfill = true;\n// Remove \"polyfill\" property added by whatwg-fetch\ndelete __self__.fetch.polyfill;\n// Choose between native implementation (global) or custom implementation (__self__)\n// var ctx = global.fetch ? global : __self__;\nvar ctx = __self__; // this line disable service worker support temporarily\nexports = ctx.fetch // To enable: import fetch from 'cross-fetch'\nexports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.\nexports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'\nexports.Headers = ctx.Headers\nexports.Request = ctx.Request\nexports.Response = ctx.Response\nmodule.exports = exports\n","/**\n * @module utils/getTypeof\n * @category Utils\n */\n\n/**\n * Gets type of `value` using `Object.prototype.toString.call(value)`.\n *\n * @param {any} value - Any kind of value (string, object, array, function, etc).\n *\n * @returns {string} - Type of value, normalized to a lowercase string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTypeof(value: any): string {\n const toString: string = Object.prototype.toString\n .call(value)\n .toLowerCase(); /* ex: => '[object string]' or '[object array], etc. */\n return toString.slice(8, toString.length - 1);\n}\n","/**\n * @module api/Fetch\n * @category API\n * @description API Fetch Logic.\n *\n * > **Module Exports**:\n * > - Class: [Fetch](module-api_Fetch.Fetch.html)\n * > - Constant: [BASE_URL](#~BASE_URL)\n * > - Constant: [DEFAULT_CONFIG](#~DEFAULT_CONFIG)\n * >\n * > **Types**\n * > - Type: [ApiResponse](#ApiResponse)\n * > - Type: [FetchConfig](#FetchConfig)\n * > - Type: [FetchRequestOptions](#FetchRequestOptions)\n * > - Type: [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body)\n * > - Type: [FetchResponse](#FetchResponse)\n * > - Type: [NhtsaResponse](#NhtsaResponse)\n */\n\n/* Module Dependencies */\nimport fetch from 'cross-fetch';\n/* Utilities */\nimport { getTypeof, makeQueryString } from '../utils';\n/* Types */\nimport { QueryStringParameters } from '../utils/types';\n\n/*****************\n * CONSTANTS\n ****************/\n\n/**\n * @constant {string} BASE_URL Default Fetch base URL string\n * @default 'https://vpic.nhtsa.dot.gov/api/vehicles'\n */\nexport const BASE_URL = 'https://vpic.nhtsa.dot.gov/api/vehicles';\n\n/**\n * @constant {module:api/Fetch.FetchConfig} DEFAULT_CONFIG Default Fetch configuration options\n * @property {string} apiResponseFormat=json\n * @property {string} baseUrl=BASE_URL Default: [BASE_URL](module-api_Fetch.html#~BASE_URL)\n * @property {FetchRequestOptions} options={method:\"GET\"}\n */\nexport const DEFAULT_CONFIG: FetchConfig = {\n apiResponseFormat: 'json',\n baseUrl: BASE_URL,\n options: {},\n};\n\n/*****************\n * Fetch Class\n ****************/\n\n/**\n * Class wrapper containing API wrapper HTTP Fetch logic.\n *\n * > **Static Methods**:\n * > - [buildQueryString](#buildQueryString)\n * > - [get](#get)\n *\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n * @category API\n */\nexport class Fetch {\n apiResponseFormat: string;\n baseUrl?: string;\n options?: FetchRequestOptions;\n\n constructor(userConfig?: FetchConfig) {\n let finalConfig: FetchConfig;\n\n /* userConfig takes precedence over DEFAULT_CONFIG */\n if (userConfig && getTypeof(userConfig) === 'object') {\n finalConfig = {\n ...DEFAULT_CONFIG,\n ...userConfig,\n options: { ...DEFAULT_CONFIG.options, ...userConfig.options },\n };\n } else {\n finalConfig = { ...DEFAULT_CONFIG };\n }\n\n /** @private */\n this.apiResponseFormat = 'json';\n /** @private */\n this.baseUrl = finalConfig.baseUrl;\n /** @private */\n this.options = finalConfig.options;\n }\n\n /**\n * Builds a query string from QueryStringParameters.\n *\n * @param {QueryStringParameters} params - Object containing Key:Value pairs to build the URL query string with.\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\n * - Given params of `{paramName: \"\"}` , setting this to true will use 'paramName=' in the final query string.\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\n * @returns {(Promise)} A formatted NHSTA.dot.gov Vehicles API query string.\n */\n async buildQueryString(\n params?: QueryStringParameters,\n allowEmptyStringValues = false\n ): Promise {\n /*\n * Make sure we're always using 'format=json' in the url Query parameters\n * If the user provides a 'format' key in the params, during class instantiation we want to override it to 'json'\n * This package may provide support for the other formats (CSV and XML) if requested.\n */\n if (!params || getTypeof(params) !== 'object') {\n params = {\n format: this.apiResponseFormat,\n };\n } else {\n params = { ...params, format: this.apiResponseFormat };\n }\n\n /* Return the completed query string */\n return await makeQueryString(params, allowEmptyStringValues);\n }\n\n /**\n * Uses the `cross-fetch` npm package to send HTTP requests and retrieve data from an API.\n * - In browser environments, [whatwg-fetch](https://github.com/github/fetch/) window.fetch is used.\n * - In node environments, [node-fetch](https://github.com/bitinn/node-fetch/) NPM package is used.\n *\n * @param {string} url - URL to fetch data from.\n * @param {FetchRequestOptions} [options] - [Fetch options](https://github.github.io/fetch/#options).\n * @returns {(Promise)} Response from the API.\n */\n async get(\n url: string,\n options: FetchRequestOptions = {}\n ): Promise {\n /* Runtime typechecking */\n const typeofUrl = getTypeof(url);\n if (typeofUrl !== 'string') {\n return Promise.reject(\n new Error(\n `Fetch.get(url) - url argument must be of type string, got: ${typeofUrl}`\n )\n );\n }\n const typeofOptions = getTypeof(options);\n if (typeofOptions !== 'object') {\n return Promise.reject(\n new Error(\n `Fetch.get(url, options) - options argument must be of type object, got: ${typeofOptions}`\n )\n );\n }\n\n /* Combine user provided 'options' and class property 'this.options', user options overwrite class options */\n const combinedOptions = { ...this.options, ...options };\n\n /* Use the cross-fetch package to perform an HTTP request */\n const response: Response = await fetch(url, combinedOptions)\n .then((result) => {\n if (!result?.status || result.status >= 400) {\n throw new Error(\n `Bad response from server, code: ${result?.status}, text: ${result?.statusText}, headers: ${result?.headers}`\n );\n } else return result;\n })\n .catch((err) =>\n Promise.reject(new Error(`Fetch.get() http error: ${err}`))\n );\n\n /* Convert the NHTSA API data to JSON */\n const NhtsaResponse: NhtsaResponse = await response\n .json()\n .then((json: NhtsaResponse): NhtsaResponse => json);\n\n /* Add the fetch response information to the returned NHSTA API data */\n const finalResult: ApiResponse = {\n ...NhtsaResponse,\n FetchResponse: {\n headers: response.headers,\n ok: response.ok,\n redirected: response.redirected,\n status: response.status,\n statusText: response.statusText,\n url: response.url,\n },\n };\n\n /* Return the completed ApiResponse */\n return Promise.resolve(finalResult);\n }\n}\n\n/*****************\n * Types\n ****************/\n\n/**\n * Various fetch request body types.\n *\n * @typedef FetchRequestBodyTypes\n * @type {URLSearchParams | FormData | Blob | ArrayBuffer | DataView}\n *\n * @memberof module:api/Fetch\n */\nexport type FetchRequestBodyTypes =\n | URLSearchParams\n | FormData\n | Blob\n | ArrayBuffer\n | DataView;\n\n/**\n * Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}.\n *\n * @memberof module:api/Fetch\n * @alias FetchRequestOptions\n */\nexport type FetchRequestOptions = {\n /**HTTP request method - Default: \"GET\". */\n method?: string;\n /** HTTP request body - [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body). */\n body?: string | FetchRequestBodyTypes;\n /** [Object, Headers](https://github.github.io/fetch/#Headers) - Default: {}. */\n headers?: Record | Headers;\n /**\n * Default: \"omit\" - Authentication credentials mode.\n * - \"omit\" - don't include authentication credentials (e.g. Cookies) in the request.\n * - \"same-origin\" - include credentials in requests to the same site\n * - \"include\" - include credentials in requests to all sites.\n */\n credentials?: 'omit' | 'same-origin' | 'include';\n};\n\n/**\n * Used when instantiating a Fetch class or related subclass.\n *\n * @memberof module:api/Fetch\n * @alias FetchConfig\n */\nexport type FetchConfig = {\n /** Requested response format from the NHSTA API (hardcoded to 'json' for now). */\n apiResponseFormat?: string;\n /** Base of the URL to build fetch URLs from. */\n baseUrl?: string;\n /** Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}. */\n options?: FetchRequestOptions;\n};\n\n/**\n * [Fetch API Response](https://github.github.io/fetch/#Response) properties.\n *\n * @memberof module:api/Fetch\n * @alias FetchResponse\n */\nexport type FetchResponse = {\n /** The [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object associated with the response. */\n headers: Headers;\n /** A boolean indicating whether the response was successful (status in the range 200–299) or not. */\n ok: boolean;\n /** Indicates whether or not the response is the result of a redirect (that is, its URL list has more than one entry). */\n redirected: boolean;\n /** The status code of the response. (This will be 200 for a success). */\n status: number;\n /** The status message corresponding to the status code. (e.g., OK for 200). */\n statusText: string;\n /** The URL of the response. */\n url: string;\n};\n\n/**\n * Response data returned from the NHSTA API.\n *\n * @memberof module:api/Fetch\n * @alias NhtsaResponse\n */\nexport type NhtsaResponse = {\n /** The number of items returned in the Results object. */\n Count: number;\n /** A message describing the Results. */\n Message: string;\n /** Search terms (VIN, WMI, etc) used in the request URL. */\n SearchCriteria: string;\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\n Results: Array;\n};\n\n/**\n * Complete response returned by {@link module:api/Fetch.Fetch#get}.\n *\n * @see {@link module:api/Fetch.NhtsaResponse}\n * @see {@link module:api/Fetch.FetchResponse}\n * @memberof module:api/Fetch\n * @alias ApiResponse\n */\nexport type ApiResponse = {\n /** The number of items returned in the Results object. */\n Count: number;\n /** A message describing the Results. */\n Message: string;\n /** Search terms (VIN, WMI, etc) used in the request URL. */\n SearchCriteria: string;\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) Properties. */\n FetchResponse: FetchResponse;\n};\n","import { getTypeof } from './getTypeof';\n\n/**\n * @module utils/makeQueryString\n * @category Utils\n */\n\n/**\n * Utility method to generate a query string compatible with the NHSTA API, for use in an API URL string.\n *\n * @async\n *\n * @param {object} params - Object of Type [QueryStringParameters](module-utils_makeQueryString.html#.QueryStringParameters).\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\n * - Given params of `{ paramName: \"\" }` , setting this to true will use 'paramName=' in the final query string.\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\n *\n * @returns {Promise} A query string of search parameters for use in a final Fetch.get URL.\n *\n * @example When loaded from the browser via html script tags\n * // \n * const qs = await NHTSA.makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example When loaded as a module\n * import { makeQueryString } from '@shaggytools/nhtsa-api-wrapper'\n * const qs = await makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example Single Param:\n * const qs = await makeQueryString({\n * modelYear: 2019\n * }).catch(error => error)\n * console.log(qs) // \"?modelYear=2019\"\n *\n * @example Multiple Params:\n * const qs = await makeQueryString({\n * whatever: 'some value',\n * modelYear: 2006,\n * page: \"2\"\n * }).catch(error => error)\n *\n * console.log(qs) // \"?whatever=some%20value&modelYear=2006&page=2\"\n *\n * @example Empty Params Object:\n * const qs = await makeQueryString({}).catch(error => error)\n *\n * console.log(qs) // \"\"\n *\n * @example Using allowEmptyStringValues option:\n * const qs = await makeQueryString({\n * year: 2016,\n * vehicleType: '',\n * make: 'Audi'\n * }, true).catch(error => error)\n *\n * console.log(qs) // \"?year=2016&vehicleType=&make=Audi\"\n *\n */\nexport function makeQueryString(\n params: QueryStringParameters = {},\n allowEmptyStringValues = false\n): Promise {\n /* Beginning of error message string */\n const errorBase =\n 'queryString(params) - expected params in the form of an object, got:';\n\n /* Runtime type guard params argument, must be of type object */\n if (getTypeof(params) !== 'object') {\n return Promise.reject(new Error(`${errorBase} ${params}`));\n }\n\n /* Setup QueryString for Array mapping */\n const entries = Object.entries(params);\n const paramsLength = entries.length;\n\n /* Return an empty string if params are an empty object */\n if (paramsLength < 1) return Promise.resolve('');\n\n /* Used to check if we've already prepended a valid query param */\n let isPrepended = false;\n\n /* Map [key]:value entries to \"key=value\" strings in an array */\n const queryStringArray = entries.map(([key, value], index) => {\n let prepend = '';\n let append = '';\n\n const typeofValue = getTypeof(value);\n\n /* Convert any number values to a string */\n if (value && typeofValue === 'number') {\n value = value.toString();\n }\n\n /* Skip any invalid values, only string and number value types are valid */\n if (\n (value || allowEmptyStringValues) &&\n (typeofValue === 'string' || typeofValue === 'number')\n ) {\n /* if this is the first param we need to prepend the '?' char */\n if (!isPrepended) {\n prepend = '?';\n isPrepended = true;\n }\n /* if there is another param coming after this one we need to append the '&' char */\n if (index < paramsLength - 1) {\n append = '&';\n }\n\n /* Add the completed partial query string to queryStringArray */\n return `${prepend}${key}=${value}${append}`;\n }\n return;\n });\n\n /* Join and return the completed query string after URI encoding */\n return Promise.resolve(encodeURI(queryStringArray.join('')));\n}\n\n/**\n * Object containing Key:Value pairs to build the URL query string with.\n * - Parameter values may be either strings or numbers.\n *\n * @memberof module:utils/makeQueryString\n * @alias QueryStringParameters\n * @example\n * {\n * modelYear: 2009,\n * whatever: 'something'\n * }\n *\n */\nexport type QueryStringParameters = {\n [propName: string]: string | number | undefined;\n};\n"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","global","self","this","__self__","F","fetch","DOMException","prototype","exports","support","Symbol","Blob","viewClasses","isArrayBufferView","ArrayBuffer","isView","obj","indexOf","Object","toString","call","normalizeName","name","String","test","TypeError","toLowerCase","normalizeValue","iteratorFor","items","iterator","shift","undefined","Headers","headers","map","forEach","append","Array","isArray","header","getOwnPropertyNames","consumed","body","bodyUsed","fileReaderReady","reader","onload","onerror","error","readBlobAsArrayBuffer","blob","FileReader","promise","readAsArrayBuffer","bufferClone","buf","slice","view","Uint8Array","byteLength","set","buffer","Body","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","FormData","_bodyFormData","URLSearchParams","DataView","_bodyArrayBuffer","get","type","Error","arrayBuffer","text","readAsText","chars","length","i","fromCharCode","join","readArrayBufferAsText","formData","decode","json","JSON","parse","oldValue","has","hasOwnProperty","callback","keys","push","values","entries","methods","Request","input","options","method","upcased","url","credentials","mode","signal","toUpperCase","referrer","form","trim","split","bytes","replace","decodeURIComponent","Response","bodyInit","status","ok","statusText","clone","response","redirectStatuses","redirect","RangeError","location","err","message","stack","create","constructor","init","request","aborted","xhr","XMLHttpRequest","abortXhr","abort","rawHeaders","getAllResponseHeaders","line","parts","key","responseURL","responseText","ontimeout","onabort","open","withCredentials","responseType","setRequestHeader","addEventListener","onreadystatechange","readyState","removeEventListener","send","polyfill","defineProperty","ponyfill","ctx","module","getTypeof","DEFAULT_CONFIG","apiResponseFormat","baseUrl","Fetch","[object Object]","userConfig","finalConfig","params","allowEmptyStringValues","format","paramsLength","isPrepended","queryStringArray","index","prepend","typeofValue","encodeURI","makeQueryString","typeofUrl","typeofOptions","combinedOptions","catch","NhtsaResponse","finalResult","FetchResponse","redirected"],"mappings":";;;;;;;;;;;;;;AAmEO,SAASA,EAAUC,EAASC,EAAYC,EAAGC,GAC9C,OAAO,IAAKD,IAA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,SAAAA,EAAQ6H,wBAAwB7H,MAAAA,SAAAA,EAAQsC,WAEjG,OAAOtC,IAEf6L,MAAOzD,GACN7I,QAAQE,OAAO,IAAIuF,MAAM,2BAA2BoD,KAIlD0D,QAAqC/D,EACxCnC,OACA1F,KAAM0F,GAAuCA,GAG1CmG,iCACDD,IACHE,cAAe,CACb1J,QAASyF,EAASzF,QAClBsF,GAAIG,EAASH,GACbqE,WAAYlE,EAASkE,WACrBtE,OAAQI,EAASJ,OACjBE,WAAYE,EAASF,WACrBhB,IAAKkB,EAASlB,OAKlB,OAAOtH,QAAQC,QAAQuM"} \ No newline at end of file diff --git a/dist/module/Fetch-b3914c0a.js b/dist/module/Fetch-b3914c0a.js deleted file mode 100644 index 675bd3710..000000000 --- a/dist/module/Fetch-b3914c0a.js +++ /dev/null @@ -1,16 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -function t(t,e,r,o){return new(r||(r=Promise))((function(n,s){function i(t){try{u(o.next(t))}catch(t){s(t)}}function a(t){try{u(o.throw(t))}catch(t){s(t)}}function u(t){t.done?n(t.value):new r((function(e){e(t.value)})).then(i,a)}u((o=o.apply(t,e||[])).next())}))}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var r,o=(function(t,r){var o=function(t){function e(){this.fetch=!1,this.DOMException=t.DOMException}return e.prototype=t,new e}("undefined"!=typeof self?self:e);!function(t){!function(e){var r="URLSearchParams"in t,o="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),s="FormData"in t,i="ArrayBuffer"in t;if(i)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function h(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function c(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function l(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function y(t){var e=new FileReader,r=l(e);return e.readAsArrayBuffer(t),r}function b(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:s&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():i&&n&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=b(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=b(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=p(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var t,e,r,o=p(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=l(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o-1?o:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function v(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}})),e}function E(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},m.call(w.prototype),m.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},E.error=function(){var t=new E(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];E.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new E(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function j(t,r){return new Promise((function(o,s){var i=new w(t,r);if(i.signal&&i.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),o=r.shift().trim();if(o){var n=r.join(":").trim();e.append(o,n)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;o(new E(n,r))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},a.open(i.method,i.url,!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),i.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),i.signal&&(i.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",u)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}j.polyfill=!0,t.fetch||(t.fetch=j,t.Headers=d,t.Request=w,t.Response=E),e.Headers=d,e.Request=w,e.Response=E,e.fetch=j}({})}(o),delete o.fetch.polyfill,(r=o.fetch).default=o.fetch,r.fetch=o.fetch,r.Headers=o.Headers,r.Request=o.Request,r.Response=o.Response,t.exports=r}(r={exports:{}},r.exports),r.exports);function n(t){const e=Object.prototype.toString.call(t).toLowerCase();return e.slice(8,e.length-1)}const s={apiResponseFormat:"json",baseUrl:"https://vpic.nhtsa.dot.gov/api/vehicles",options:{}};class i{constructor(t){let e;e=t&&"object"===n(t)?Object.assign(Object.assign(Object.assign({},s),t),{options:Object.assign(Object.assign({},s.options),t.options)}):Object.assign({},s),this.apiResponseFormat="json",this.baseUrl=e.baseUrl,this.options=e.options}buildQueryString(e,r=!1){return t(this,void 0,void 0,(function*(){return e=e&&"object"===n(e)?Object.assign(Object.assign({},e),{format:this.apiResponseFormat}):{format:this.apiResponseFormat},yield function(t={},e=!1){if("object"!==n(t))return Promise.reject(new Error("queryString(params) - expected params in the form of an object, got: "+t));const r=Object.entries(t),o=r.length;if(o<1)return Promise.resolve("");let s=!1;const i=r.map(([t,r],i)=>{let a="",u="";const h=n(r);if(r&&"number"===h&&(r=r.toString()),(r||e)&&("string"===h||"number"===h))return s||(a="?",s=!0),i{if(!(null==t?void 0:t.status)||t.status>=400)throw new Error(`Bad response from server, code: ${null==t?void 0:t.status}, text: ${null==t?void 0:t.statusText}, headers: ${null==t?void 0:t.headers}`);return t}).catch(t=>Promise.reject(new Error("Fetch.get() http error: "+t))),u=yield a.json().then(t=>t),h=Object.assign(Object.assign({},u),{FetchResponse:{headers:a.headers,ok:a.ok,redirected:a.redirected,status:a.status,statusText:a.statusText,url:a.url}});return Promise.resolve(h)}))}}export{i as F,t as _,n as g}; -//# sourceMappingURL=Fetch-b3914c0a.js.map diff --git a/dist/module/Fetch-b3914c0a.js.map b/dist/module/Fetch-b3914c0a.js.map deleted file mode 100644 index 36eea10b9..000000000 --- a/dist/module/Fetch-b3914c0a.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Fetch-b3914c0a.js","sources":["../../node_modules/tslib/tslib.es6.js","../../node_modules/cross-fetch/dist/browser-ponyfill.js","../../src/utils/getTypeof.ts","../../src/api/Fetch.ts","../../src/utils/makeQueryString.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","var __self__ = (function (root) {\nfunction F() {\nthis.fetch = false;\nthis.DOMException = root.DOMException\n}\nF.prototype = root;\nreturn new F();\n})(typeof self !== 'undefined' ? self : this);\n(function(self) {\n\nvar irrelevant = (function (exports) {\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = self.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.onabort = function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!self.fetch) {\n self.fetch = fetch;\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n return exports;\n\n}({}));\n})(__self__);\ndelete __self__.fetch.polyfill\nexports = __self__.fetch // To enable: import fetch from 'cross-fetch'\nexports.default = __self__.fetch // For TypeScript consumers without esModuleInterop.\nexports.fetch = __self__.fetch // To enable: import {fetch} from 'cross-fetch'\nexports.Headers = __self__.Headers\nexports.Request = __self__.Request\nexports.Response = __self__.Response\nmodule.exports = exports\n","/**\r\n * @module utils/getTypeof\r\n * @category Utils\r\n */\r\n\r\n/**\r\n * Gets type of `value` using `Object.prototype.toString.call(value)`.\r\n *\r\n * @param {any} value - Any kind of value (string, object, array, function, etc).\r\n *\r\n * @returns {string} - Type of value, normalized to a lowercase string.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\r\nexport function getTypeof(value: any): string {\r\n const toString: string = Object.prototype.toString\r\n .call(value)\r\n .toLowerCase(); /* ex: => '[object string]' or '[object array], etc. */\r\n return toString.slice(8, toString.length - 1);\r\n}\r\n","/**\r\n * @module api/Fetch\r\n * @category API\r\n * @description API Fetch Logic.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [Fetch](module-api_Fetch.Fetch.html)\r\n * > - Constant: [BASE_URL](#~BASE_URL)\r\n * > - Constant: [DEFAULT_CONFIG](#~DEFAULT_CONFIG)\r\n * >\r\n * > **Types**\r\n * > - Type: [ApiResponse](#ApiResponse)\r\n * > - Type: [FetchConfig](#FetchConfig)\r\n * > - Type: [FetchRequestOptions](#FetchRequestOptions)\r\n * > - Type: [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body)\r\n * > - Type: [FetchResponse](#FetchResponse)\r\n * > - Type: [NhtsaResponse](#NhtsaResponse)\r\n */\r\n\r\n/* Module Dependencies */\r\nimport fetch from 'cross-fetch';\r\n/* Utilities */\r\nimport { getTypeof, makeQueryString } from '../utils';\r\n/* Types */\r\nimport { QueryStringParameters } from '../utils/types';\r\n\r\n/*****************\r\n * CONSTANTS\r\n ****************/\r\n\r\n/**\r\n * @constant {string} BASE_URL Default Fetch base URL string\r\n * @default 'https://vpic.nhtsa.dot.gov/api/vehicles'\r\n */\r\nexport const BASE_URL = 'https://vpic.nhtsa.dot.gov/api/vehicles';\r\n\r\n/**\r\n * @constant {module:api/Fetch.FetchConfig} DEFAULT_CONFIG Default Fetch configuration options\r\n * @property {string} apiResponseFormat=json\r\n * @property {string} baseUrl=BASE_URL Default: [BASE_URL](module-api_Fetch.html#~BASE_URL)\r\n * @property {FetchRequestOptions} options={method:\"GET\"}\r\n */\r\nexport const DEFAULT_CONFIG: FetchConfig = {\r\n apiResponseFormat: 'json',\r\n baseUrl: BASE_URL,\r\n options: {},\r\n};\r\n\r\n/*****************\r\n * Fetch Class\r\n ****************/\r\n\r\n/**\r\n * Class wrapper containing API wrapper HTTP Fetch logic.\r\n *\r\n * > **Static Methods**:\r\n * > - [buildQueryString](#buildQueryString)\r\n * > - [get](#get)\r\n *\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n * @category API\r\n */\r\nexport class Fetch {\r\n apiResponseFormat: string;\r\n baseUrl?: string;\r\n options?: FetchRequestOptions;\r\n\r\n constructor(userConfig?: FetchConfig) {\r\n let finalConfig: FetchConfig;\r\n\r\n /* userConfig takes precedence over DEFAULT_CONFIG */\r\n if (userConfig && getTypeof(userConfig) === 'object') {\r\n finalConfig = {\r\n ...DEFAULT_CONFIG,\r\n ...userConfig,\r\n options: { ...DEFAULT_CONFIG.options, ...userConfig.options },\r\n };\r\n } else {\r\n finalConfig = { ...DEFAULT_CONFIG };\r\n }\r\n\r\n /** @private */\r\n this.apiResponseFormat = 'json';\r\n /** @private */\r\n this.baseUrl = finalConfig.baseUrl;\r\n /** @private */\r\n this.options = finalConfig.options;\r\n }\r\n\r\n /**\r\n * Builds a query string from QueryStringParameters.\r\n *\r\n * @param {QueryStringParameters} params - Object containing Key:Value pairs to build the URL query string with.\r\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\r\n * - Given params of `{paramName: \"\"}` , setting this to true will use 'paramName=' in the final query string.\r\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\r\n * @returns {(Promise)} A formatted NHSTA.dot.gov Vehicles API query string.\r\n */\r\n async buildQueryString(\r\n params?: QueryStringParameters,\r\n allowEmptyStringValues = false\r\n ): Promise {\r\n /*\r\n * Make sure we're always using 'format=json' in the url Query parameters\r\n * If the user provides a 'format' key in the params, during class instantiation we want to override it to 'json'\r\n * This package may provide support for the other formats (CSV and XML) if requested.\r\n */\r\n if (!params || getTypeof(params) !== 'object') {\r\n params = {\r\n format: this.apiResponseFormat,\r\n };\r\n } else {\r\n params = { ...params, format: this.apiResponseFormat };\r\n }\r\n\r\n /* Return the completed query string */\r\n return await makeQueryString(params, allowEmptyStringValues);\r\n }\r\n\r\n /**\r\n * Uses the `cross-fetch` npm package to send HTTP requests and retrieve data from an API.\r\n * - In browser environments, [whatwg-fetch](https://github.com/github/fetch/) window.fetch is used.\r\n * - In node environments, [node-fetch](https://github.com/bitinn/node-fetch/) NPM package is used.\r\n *\r\n * @param {string} url - URL to fetch data from.\r\n * @param {FetchRequestOptions} [options] - [Fetch options](https://github.github.io/fetch/#options).\r\n * @returns {(Promise)} Response from the API.\r\n */\r\n async get(\r\n url: string,\r\n options: FetchRequestOptions = {}\r\n ): Promise {\r\n /* Runtime typechecking */\r\n const typeofUrl = getTypeof(url);\r\n if (typeofUrl !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `Fetch.get(url) - url argument must be of type string, got: ${typeofUrl}`\r\n )\r\n );\r\n }\r\n const typeofOptions = getTypeof(options);\r\n if (typeofOptions !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `Fetch.get(url, options) - options argument must be of type object, got: ${typeofOptions}`\r\n )\r\n );\r\n }\r\n\r\n /* Combine user provided 'options' and class property 'this.options', user options overwrite class options */\r\n const combinedOptions = { ...this.options, ...options };\r\n\r\n /* Use the cross-fetch package to perform an HTTP request */\r\n const response: Response = await fetch(url, combinedOptions)\r\n .then((result) => {\r\n if (!result?.status || result.status >= 400) {\r\n throw new Error(\r\n `Bad response from server, code: ${result?.status}, text: ${result?.statusText}, headers: ${result?.headers}`\r\n );\r\n } else return result;\r\n })\r\n .catch((err) =>\r\n Promise.reject(new Error(`Fetch.get() http error: ${err}`))\r\n );\r\n\r\n /* Convert the NHTSA API data to JSON */\r\n const NhtsaResponse: NhtsaResponse = await response\r\n .json()\r\n .then((json: NhtsaResponse): NhtsaResponse => json);\r\n\r\n /* Add the fetch response information to the returned NHSTA API data */\r\n const finalResult: ApiResponse = {\r\n ...NhtsaResponse,\r\n FetchResponse: {\r\n headers: response.headers,\r\n ok: response.ok,\r\n redirected: response.redirected,\r\n status: response.status,\r\n statusText: response.statusText,\r\n url: response.url,\r\n },\r\n };\r\n\r\n /* Return the completed ApiResponse */\r\n return Promise.resolve(finalResult);\r\n }\r\n}\r\n\r\n/*****************\r\n * Types\r\n ****************/\r\n\r\n/**\r\n * Various fetch request body types.\r\n *\r\n * @typedef FetchRequestBodyTypes\r\n * @type {URLSearchParams | FormData | Blob | ArrayBuffer | DataView}\r\n *\r\n * @memberof module:api/Fetch\r\n */\r\nexport type FetchRequestBodyTypes =\r\n | URLSearchParams\r\n | FormData\r\n | Blob\r\n | ArrayBuffer\r\n | DataView;\r\n\r\n/**\r\n * Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias FetchRequestOptions\r\n */\r\nexport type FetchRequestOptions = {\r\n /**HTTP request method - Default: \"GET\". */\r\n method?: string;\r\n /** HTTP request body - [FetchRequestBodyTypes](https://github.github.io/fetch/#request-body). */\r\n body?: string | FetchRequestBodyTypes;\r\n /** [Object, Headers](https://github.github.io/fetch/#Headers) - Default: {}. */\r\n headers?: Record | Headers;\r\n /**\r\n * Default: \"omit\" - Authentication credentials mode.\r\n * - \"omit\" - don't include authentication credentials (e.g. Cookies) in the request.\r\n * - \"same-origin\" - include credentials in requests to the same site\r\n * - \"include\" - include credentials in requests to all sites.\r\n */\r\n credentials?: 'omit' | 'same-origin' | 'include';\r\n};\r\n\r\n/**\r\n * Used when instantiating a Fetch class or related subclass.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias FetchConfig\r\n */\r\nexport type FetchConfig = {\r\n /** Requested response format from the NHSTA API (hardcoded to 'json' for now). */\r\n apiResponseFormat?: string;\r\n /** Base of the URL to build fetch URLs from. */\r\n baseUrl?: string;\r\n /** Options object provided as the 2nd argument to {@link module:api/Fetch.Fetch#get}. */\r\n options?: FetchRequestOptions;\r\n};\r\n\r\n/**\r\n * [Fetch API Response](https://github.github.io/fetch/#Response) properties.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias FetchResponse\r\n */\r\nexport type FetchResponse = {\r\n /** The [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object associated with the response. */\r\n headers: Headers;\r\n /** A boolean indicating whether the response was successful (status in the range 200–299) or not. */\r\n ok: boolean;\r\n /** Indicates whether or not the response is the result of a redirect (that is, its URL list has more than one entry). */\r\n redirected: boolean;\r\n /** The status code of the response. (This will be 200 for a success). */\r\n status: number;\r\n /** The status message corresponding to the status code. (e.g., OK for 200). */\r\n statusText: string;\r\n /** The URL of the response. */\r\n url: string;\r\n};\r\n\r\n/**\r\n * Response data returned from the NHSTA API.\r\n *\r\n * @memberof module:api/Fetch\r\n * @alias NhtsaResponse\r\n */\r\nexport type NhtsaResponse = {\r\n /** The number of items returned in the Results object. */\r\n Count: number;\r\n /** A message describing the Results. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, etc) used in the request URL. */\r\n SearchCriteria: string;\r\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\r\n Results: Array;\r\n};\r\n\r\n/**\r\n * Complete response returned by {@link module:api/Fetch.Fetch#get}.\r\n *\r\n * @see {@link module:api/Fetch.NhtsaResponse}\r\n * @see {@link module:api/Fetch.FetchResponse}\r\n * @memberof module:api/Fetch\r\n * @alias ApiResponse\r\n */\r\nexport type ApiResponse = {\r\n /** The number of items returned in the Results object. */\r\n Count: number;\r\n /** A message describing the Results. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, etc) used in the request URL. */\r\n SearchCriteria: string;\r\n /** An array of Results returned by NHSTA, specific to each individual API Action. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) Properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","import { getTypeof } from './getTypeof';\n\n/**\n * @module utils/makeQueryString\n * @category Utils\n */\n\n/**\n * Utility method to generate a query string compatible with the NHSTA API, for use in an API URL string.\n *\n * @async\n *\n * @param {object} params - Object of Type [QueryStringParameters](module-utils_makeQueryString.html#.QueryStringParameters).\n * @param {boolean} [allowEmptyStringValues=false] - Set to `true` to add empty parameter values to the returned query string.\n * - Given params of `{ paramName: \"\" }` , setting this to true will use 'paramName=' in the final query string.\n * - GetCanadianVehicleSpecifications is the only API Action that requires this functionality.\n *\n * @returns {Promise} A query string of search parameters for use in a final Fetch.get URL.\n *\n * @example When loaded from the browser via html script tags\n * // \n * const qs = await NHTSA.makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example When loaded as a module\n * import { makeQueryString } from '@shaggytools/nhtsa-api-wrapper'\n * const qs = await makeQueryString({ modelYear: 2010 }).catch(error => error)\n * console.log(qs) // \"?modelYear=2010\"\n *\n * @example Single Param:\n * const qs = await makeQueryString({\n * modelYear: 2019\n * }).catch(error => error)\n * console.log(qs) // \"?modelYear=2019\"\n *\n * @example Multiple Params:\n * const qs = await makeQueryString({\n * whatever: 'some value',\n * modelYear: 2006,\n * page: \"2\"\n * }).catch(error => error)\n *\n * console.log(qs) // \"?whatever=some%20value&modelYear=2006&page=2\"\n *\n * @example Empty Params Object:\n * const qs = await makeQueryString({}).catch(error => error)\n *\n * console.log(qs) // \"\"\n *\n * @example Using allowEmptyStringValues option:\n * const qs = await makeQueryString({\n * year: 2016,\n * vehicleType: '',\n * make: 'Audi'\n * }, true).catch(error => error)\n *\n * console.log(qs) // \"?year=2016&vehicleType=&make=Audi\"\n *\n */\nexport function makeQueryString(\n params: QueryStringParameters = {},\n allowEmptyStringValues = false\n): Promise {\n /* Beginning of error message string */\n const errorBase =\n 'queryString(params) - expected params in the form of an object, got:';\n\n /* Runtime type guard params argument, must be of type object */\n if (getTypeof(params) !== 'object') {\n return Promise.reject(new Error(`${errorBase} ${params}`));\n }\n\n /* Setup QueryString for Array mapping */\n const entries = Object.entries(params);\n const paramsLength = entries.length;\n\n /* Return an empty string if params are an empty object */\n if (paramsLength < 1) return Promise.resolve('');\n\n /* Used to check if we've already prepended a valid query param */\n let isPrepended = false;\n\n /* Map [key]:value entries to \"key=value\" strings in an array */\n const queryStringArray = entries.map(([key, value], index) => {\n let prepend = '';\n let append = '';\n\n const typeofValue = getTypeof(value);\n\n /* Convert any number values to a string */\n if (value && typeofValue === 'number') {\n value = value.toString();\n }\n\n /* Skip any invalid values, only string and number value types are valid */\n if (\n (value || allowEmptyStringValues) &&\n (typeofValue === 'string' || typeofValue === 'number')\n ) {\n /* if this is the first param we need to prepend the '?' char */\n if (!isPrepended) {\n prepend = '?';\n isPrepended = true;\n }\n /* if there is another param coming after this one we need to append the '&' char */\n if (index < paramsLength - 1) {\n append = '&';\n }\n\n /* Add the completed partial query string to queryStringArray */\n return `${prepend}${key}=${value}${append}`;\n }\n return;\n });\n\n /* Join and return the completed query string after URI encoding */\n return Promise.resolve(encodeURI(queryStringArray.join('')));\n}\n\n/**\n * Object containing Key:Value pairs to build the URL query string with.\n * - Parameter values may be either strings or numbers.\n *\n * @memberof module:utils/makeQueryString\n * @alias QueryStringParameters\n * @example\n * {\n * modelYear: 2009,\n * whatever: 'something'\n * }\n *\n */\nexport type QueryStringParameters = {\n [propName: string]: string | number | undefined;\n};\n"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","__self__","root","F","this","fetch","DOMException","prototype","self","exports","support","Symbol","Blob","viewClasses","isArrayBufferView","ArrayBuffer","isView","obj","indexOf","Object","toString","call","normalizeName","name","String","test","TypeError","toLowerCase","normalizeValue","iteratorFor","items","iterator","shift","undefined","Headers","headers","map","forEach","append","Array","isArray","header","getOwnPropertyNames","consumed","body","bodyUsed","fileReaderReady","reader","onload","onerror","error","readBlobAsArrayBuffer","blob","FileReader","promise","readAsArrayBuffer","bufferClone","buf","slice","view","Uint8Array","byteLength","set","buffer","Body","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","FormData","_bodyFormData","URLSearchParams","DataView","_bodyArrayBuffer","get","type","Error","arrayBuffer","text","readAsText","chars","length","i","fromCharCode","join","readArrayBufferAsText","formData","decode","json","JSON","parse","oldValue","has","hasOwnProperty","callback","keys","push","values","entries","methods","Request","input","options","method","upcased","url","credentials","mode","signal","toUpperCase","referrer","form","trim","split","bytes","replace","decodeURIComponent","Response","bodyInit","status","ok","statusText","clone","response","redirectStatuses","redirect","RangeError","location","err","message","stack","create","constructor","init","request","aborted","xhr","XMLHttpRequest","abortXhr","abort","rawHeaders","getAllResponseHeaders","line","parts","key","responseURL","responseText","ontimeout","onabort","open","withCredentials","responseType","setRequestHeader","addEventListener","onreadystatechange","readyState","removeEventListener","send","polyfill","module","getTypeof","DEFAULT_CONFIG","apiResponseFormat","baseUrl","Fetch","[object Object]","userConfig","finalConfig","params","allowEmptyStringValues","format","paramsLength","isPrepended","queryStringArray","index","prepend","typeofValue","encodeURI","makeQueryString","typeofUrl","typeofOptions","combinedOptions","catch","NhtsaResponse","finalResult","FetchResponse","redirected"],"mappings":";;;;;;;;;;;;;;AAmEO,SAASA,EA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AOtC,IAEf0L,MAAOtD,GACN7I,QAAQE,OAAO,IAAIuF,MAAM,2BAA2BoD,KAIlDuD,QAAqC5D,EACxCnC,OACA1F,KAAM0F,GAAuCA,GAG1CgG,iCACDD,IACHE,cAAe,CACbvJ,QAASyF,EAASzF,QAClBsF,GAAIG,EAASH,GACbkE,WAAY/D,EAAS+D,WACrBnE,OAAQI,EAASJ,OACjBE,WAAYE,EAASF,WACrBhB,IAAKkB,EAASlB,OAKlB,OAAOtH,QAAQC,QAAQoM"} \ No newline at end of file diff --git a/dist/module/GetAllMakes.js b/dist/module/GetAllMakes.js index 5ef170767..b903786c3 100644 --- a/dist/module/GetAllMakes.js +++ b/dist/module/GetAllMakes.js @@ -1,2 +1,2 @@ -import{F as e,_ as r}from"./Fetch-b3914c0a.js";class t extends e{constructor(e){super(e)}GetAllMakes(){return r(this,void 0,void 0,(function*(){const e=yield this.buildQueryString().catch(e=>Promise.reject(new Error("GetAllMakes, Error building query string: "+e))),r=`${this.baseUrl}/GetAllMakes${e}`;return yield this.get(r).then(e=>e).catch(e=>Promise.reject(new Error("GetAllMakes, Fetch.get() error: "+e)))}))}}export{t as GetAllMakes}; +import{F as e,_ as r}from"./Fetch-44aa28fd.js";class t extends e{constructor(e){super(e)}GetAllMakes(){return r(this,void 0,void 0,(function*(){const e=yield this.buildQueryString().catch(e=>Promise.reject(new Error("GetAllMakes, Error building query string: "+e))),r=`${this.baseUrl}/GetAllMakes${e}`;return yield this.get(r).then(e=>e).catch(e=>Promise.reject(new Error("GetAllMakes, Fetch.get() error: "+e)))}))}}export{t as GetAllMakes}; //# sourceMappingURL=GetAllMakes.js.map diff --git a/dist/module/GetAllMakes.js.map b/dist/module/GetAllMakes.js.map index 3124b90a8..8008a111c 100644 --- a/dist/module/GetAllMakes.js.map +++ b/dist/module/GetAllMakes.js.map @@ -1 +1 @@ -{"version":3,"file":"GetAllMakes.js","sources":["../../src/api/actions/GetAllMakes.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetAllMakes\r\n * @category Actions\r\n * @description GetAllMakes NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetAllMakes](module-api_actions_GetAllMakes.GetAllMakes.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetAllMakesResponse](#GetAllMakesResponse)\r\n * > - Type: [GetAllMakesResults](#GetAllMakesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetAllMakes extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Makes available in the vPIC Dataset.\r\n *\r\n * @async\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetAllMakes(): Promise {\r\n const action = 'GetAllMakes';\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetAllMakesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetAllMakes\r\n * @alias GetAllMakesResults\r\n */\r\nexport type GetAllMakesResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetAllMakes API Action.\r\n *\r\n * @memberof module:api/actions/GetAllMakes\r\n * @alias GetAllMakesResponse\r\n */\r\nexport type GetAllMakesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetAllMakes","Fetch","[object Object]","userConfig","super","queryString","this","buildQueryString","catch","err","Promise","reject","Error","url","baseUrl","get","then","response"],"mappings":"qDA6BaA,UAAoBC,EAC/BC,YAAYC,GACVC,MAAMD,GASKD,uDACX,MAGMG,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDC,QAAQC,OACN,IAAIC,MAAM,6CAA2CH,KAKnDI,EAAM,GAAGP,KAAKQ,sBAAoBT,IAGxC,aAAaC,KAAKS,IAAIF,GACnBG,KAAMC,GAAaA,GACnBT,MAAOC,GACNC,QAAQC,OAAO,IAAIC,MAAM,mCAAiCH"} \ No newline at end of file +{"version":3,"file":"GetAllMakes.js","sources":["../../src/api/actions/GetAllMakes.ts"],"sourcesContent":["/**\n * @module api/actions/GetAllMakes\n * @category Actions\n * @description GetAllMakes NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetAllMakes](module-api_actions_GetAllMakes.GetAllMakes.html)\n * >\n * > **Types**\n * > - Type: [GetAllMakesResponse](#GetAllMakesResponse)\n * > - Type: [GetAllMakesResults](#GetAllMakesResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetAllMakes extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the Makes available in the vPIC Dataset.\n *\n * @async\n * @returns {(Promise)} Api Response object.\n */\n public async GetAllMakes(): Promise {\n const action = 'GetAllMakes';\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetAllMakesResponse}.Results' array.\n *\n * @memberof module:api/actions/GetAllMakes\n * @alias GetAllMakesResults\n */\nexport type GetAllMakesResults = {\n Make_ID: number;\n Make_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetAllMakes API Action.\n *\n * @memberof module:api/actions/GetAllMakes\n * @alias GetAllMakesResponse\n */\nexport type GetAllMakesResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetAllMakes","Fetch","[object Object]","userConfig","super","queryString","this","buildQueryString","catch","err","Promise","reject","Error","url","baseUrl","get","then","response"],"mappings":"qDA6BaA,UAAoBC,EAC/BC,YAAYC,GACVC,MAAMD,GASKD,uDACX,MAGMG,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDC,QAAQC,OACN,IAAIC,MAAM,6CAA2CH,KAKnDI,EAAM,GAAGP,KAAKQ,sBAAoBT,IAGxC,aAAaC,KAAKS,IAAIF,GACnBG,KAAMC,GAAaA,GACnBT,MAAOC,GACNC,QAAQC,OAAO,IAAIC,MAAM,mCAAiCH"} \ No newline at end of file diff --git a/dist/module/GetAllManufacturers.js b/dist/module/GetAllManufacturers.js index 89d83ca1f..17c56ce77 100644 --- a/dist/module/GetAllManufacturers.js +++ b/dist/module/GetAllManufacturers.js @@ -1,2 +1,2 @@ -import{F as r,_ as e,g as t}from"./Fetch-b3914c0a.js";class a extends r{constructor(r){super(r)}GetAllManufacturers(r={}){return e(this,void 0,void 0,(function*(){const e="GetAllManufacturers",a=t(r);if("object"!==a)return Promise.reject(new Error(`GetAllManufacturers, "params" argument must be of type object, got: <${a}> ${r}`));const n=t(r.manufacturerType);if(r.manufacturerType&&"string"!==n)return Promise.reject(new Error(`GetAllManufacturers, "params.manufacturerType" argument must be of type string, got: <${n}> ${r.manufacturerType}`));const u=t(r.page);if(r.page&&"number"!==u)return Promise.reject(new Error(`GetAllManufacturers, "params.page" argument must be of type number, got: <${u}> ${r.page}`));const s=yield this.buildQueryString(r).catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),o=`${this.baseUrl}/${e}${s}`;return yield this.get(o).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{a as GetAllManufacturers}; +import{F as r,_ as e,g as t}from"./Fetch-44aa28fd.js";class a extends r{constructor(r){super(r)}GetAllManufacturers(r={}){return e(this,void 0,void 0,(function*(){const e="GetAllManufacturers",a=t(r);if("object"!==a)return Promise.reject(new Error(`GetAllManufacturers, "params" argument must be of type object, got: <${a}> ${r}`));const n=t(r.manufacturerType);if(r.manufacturerType&&"string"!==n)return Promise.reject(new Error(`GetAllManufacturers, "params.manufacturerType" argument must be of type string, got: <${n}> ${r.manufacturerType}`));const u=t(r.page);if(r.page&&"number"!==u)return Promise.reject(new Error(`GetAllManufacturers, "params.page" argument must be of type number, got: <${u}> ${r.page}`));const s=yield this.buildQueryString(r).catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),o=`${this.baseUrl}/${e}${s}`;return yield this.get(o).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{a as GetAllManufacturers}; //# sourceMappingURL=GetAllManufacturers.js.map diff --git a/dist/module/GetAllManufacturers.js.map b/dist/module/GetAllManufacturers.js.map index 566cd768f..5c345ce5d 100644 --- a/dist/module/GetAllManufacturers.js.map +++ b/dist/module/GetAllManufacturers.js.map @@ -1 +1 @@ -{"version":3,"file":"GetAllManufacturers.js","sources":["../../src/api/actions/GetAllManufacturers.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetAllManufacturers\r\n * @category Actions\r\n * @description GetAllManufacturers NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetAllManufacturers](module-api_actions_GetAllManufacturers.GetAllManufacturers.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetAllManufacturersResponse](#GetAllManufacturersResponse)\r\n * > - Type: [GetAllManufacturersResults](#GetAllManufacturersResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetAllManufacturers extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Manufacturers available in vPIC Dataset.\r\n * - `params.manufacturerType` allows the user to filter the list based on manufacturer type,\r\n * ('Incomplete Vehicles', 'Completed Vehicle Manufacturer', 'Incomplete Vehicle Manufacturer',\r\n * 'Intermediate Manufacturer', 'Final-Stage Manufacturer', 'Alterer', or any partial match of those strings).\r\n * - You can get a list of all manufacturer types with the following API Action:\r\n * `GetVehicleVariableValuesList('manufacturer type')`\r\n * - Results are provided in pages of 100 items.\r\n * - Provide a number value for `params.page` to specify 1st (default), 2nd, 3rd, Nth, etc page.\r\n *\r\n * @async\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string} [params.manufacturerType] - See method description.\r\n * @param {number} [params.page] - Specify the page number (results returned 100 at a time).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetAllManufacturers(\r\n params: {\r\n manufacturerType?: string;\r\n page?: number;\r\n } = {}\r\n ): Promise {\r\n const action = 'GetAllManufacturers';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofManufacturerType = getTypeof(params.manufacturerType);\r\n if (params.manufacturerType && typeofManufacturerType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.manufacturerType\" argument must be of type string, got: ` +\r\n `<${typeofManufacturerType}> ${params.manufacturerType}`\r\n )\r\n );\r\n }\r\n\r\n const typeofPage = getTypeof(params.page);\r\n if (params.page && typeofPage !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.page\" argument must be of type number, got: ` +\r\n `<${typeofPage}> ${params.page}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetAllManufacturersResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetAllManufacturers\r\n * @alias GetAllManufacturersResults\r\n */\r\nexport type GetAllManufacturersResults = {\r\n Country: string;\r\n Mfr_CommonName: string;\r\n Mfr_ID: number;\r\n Mfr_Name: string;\r\n VehicleTypes: Array<{ isPrimary?: boolean; name?: string }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetAllManufacturers API Action.\r\n *\r\n * @memberof module:api/actions/GetAllManufacturers\r\n * @alias GetAllManufacturersResponse\r\n */\r\nexport type GetAllManufacturersResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetAllManufacturers","Fetch","[object Object]","userConfig","super","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofManufacturerType","manufacturerType","typeofPage","page","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA4BC,EACvCC,YAAYC,GACVC,MAAMD,GAmBFD,oBACJG,EAGI,6CAEJ,MAAMC,EAAS,sBAGTC,EAAeC,EAAUH,GAC/B,GAAqB,WAAjBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,wEAAIJ,MAAiBF,MAK7B,MAAMO,EAAyBJ,EAAUH,EAAOQ,kBAChD,GAAIR,EAAOQ,kBAA+C,WAA3BD,EAC7B,OAAOH,QAAQC,OACb,IAAIC,MAEA,yFAAIC,MAA2BP,EAAOQ,qBAK9C,MAAMC,EAAaN,EAAUH,EAAOU,MACpC,GAAIV,EAAOU,MAAuB,WAAfD,EACjB,OAAOL,QAAQC,OACb,IAAIC,MAEA,6EAAIG,MAAeT,EAAOU,SAMlC,MAAMC,QAAoBC,KAAKC,iBAAiBb,GAAQc,MAAOC,GAC7DX,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCc,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWhB,IAASU,IAGxC,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNX,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Bc"} \ No newline at end of file +{"version":3,"file":"GetAllManufacturers.js","sources":["../../src/api/actions/GetAllManufacturers.ts"],"sourcesContent":["/**\n * @module api/actions/GetAllManufacturers\n * @category Actions\n * @description GetAllManufacturers NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetAllManufacturers](module-api_actions_GetAllManufacturers.GetAllManufacturers.html)\n * >\n * > **Types**\n * > - Type: [GetAllManufacturersResponse](#GetAllManufacturersResponse)\n * > - Type: [GetAllManufacturersResults](#GetAllManufacturersResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetAllManufacturers extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the Manufacturers available in vPIC Dataset.\n * - `params.manufacturerType` allows the user to filter the list based on manufacturer type,\n * ('Incomplete Vehicles', 'Completed Vehicle Manufacturer', 'Incomplete Vehicle Manufacturer',\n * 'Intermediate Manufacturer', 'Final-Stage Manufacturer', 'Alterer', or any partial match of those strings).\n * - You can get a list of all manufacturer types with the following API Action:\n * `GetVehicleVariableValuesList('manufacturer type')`\n * - Results are provided in pages of 100 items.\n * - Provide a number value for `params.page` to specify 1st (default), 2nd, 3rd, Nth, etc page.\n *\n * @async\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\n * @param {string} [params.manufacturerType] - See method description.\n * @param {number} [params.page] - Specify the page number (results returned 100 at a time).\n * @returns {(Promise)} Api Response object.\n */\n async GetAllManufacturers(\n params: {\n manufacturerType?: string;\n page?: number;\n } = {}\n ): Promise {\n const action = 'GetAllManufacturers';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofManufacturerType = getTypeof(params.manufacturerType);\n if (params.manufacturerType && typeofManufacturerType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.manufacturerType\" argument must be of type string, got: ` +\n `<${typeofManufacturerType}> ${params.manufacturerType}`\n )\n );\n }\n\n const typeofPage = getTypeof(params.page);\n if (params.page && typeofPage !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.page\" argument must be of type number, got: ` +\n `<${typeofPage}> ${params.page}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetAllManufacturersResponse}.Results' array.\n *\n * @memberof module:api/actions/GetAllManufacturers\n * @alias GetAllManufacturersResults\n */\nexport type GetAllManufacturersResults = {\n Country: string;\n Mfr_CommonName: string;\n Mfr_ID: number;\n Mfr_Name: string;\n VehicleTypes: Array<{ isPrimary?: boolean; name?: string }>;\n};\n\n/**\n * Type representing the complete response returned by the GetAllManufacturers API Action.\n *\n * @memberof module:api/actions/GetAllManufacturers\n * @alias GetAllManufacturersResponse\n */\nexport type GetAllManufacturersResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetAllManufacturers","Fetch","[object Object]","userConfig","super","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofManufacturerType","manufacturerType","typeofPage","page","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA4BC,EACvCC,YAAYC,GACVC,MAAMD,GAmBFD,oBACJG,EAGI,6CAEJ,MAAMC,EAAS,sBAGTC,EAAeC,EAAUH,GAC/B,GAAqB,WAAjBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,wEAAIJ,MAAiBF,MAK7B,MAAMO,EAAyBJ,EAAUH,EAAOQ,kBAChD,GAAIR,EAAOQ,kBAA+C,WAA3BD,EAC7B,OAAOH,QAAQC,OACb,IAAIC,MAEA,yFAAIC,MAA2BP,EAAOQ,qBAK9C,MAAMC,EAAaN,EAAUH,EAAOU,MACpC,GAAIV,EAAOU,MAAuB,WAAfD,EACjB,OAAOL,QAAQC,OACb,IAAIC,MAEA,6EAAIG,MAAeT,EAAOU,SAMlC,MAAMC,QAAoBC,KAAKC,iBAAiBb,GAAQc,MAAOC,GAC7DX,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCc,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWhB,IAASU,IAGxC,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNX,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Bc"} \ No newline at end of file diff --git a/dist/module/GetCanadianVehicleSpecifications.js b/dist/module/GetCanadianVehicleSpecifications.js index 45199b447..8cf2171fd 100644 --- a/dist/module/GetCanadianVehicleSpecifications.js +++ b/dist/module/GetCanadianVehicleSpecifications.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class i extends e{constructor(e){super(e)}GetCanadianVehicleSpecifications(e){return r(this,void 0,void 0,(function*(){const r="GetCanadianVehicleSpecifications",i=t(e);if("object"!==i)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params" argument must be of type object, got: <${i}> ${e}`));const n=t(e.year);if("number"!==n)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.year" argument is required and must be of type number, got: <${n}> ${e.year}`));const a=t(e.make);if(e.make&&"string"!==a)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.make" argument must be of type string, got: <${a}> ${e.make}`));const s=t(e.model);if(e.model&&"string"!==s)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.model" argument must be of type string, got: <${s}> ${e.model}`));const o=t(e.units);if(e.units&&"string"!==o)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.units" argument must be of type string, got: <${o}> ${e.units}`));const c=e.make||"",m=e.model||"",u=e.units||"",d={year:e.year,make:c,model:m,units:u},g=yield this.buildQueryString(d,!0).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),p=`${this.baseUrl}/${r}${g}`;return yield this.get(p).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{i as GetCanadianVehicleSpecifications}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class i extends e{constructor(e){super(e)}GetCanadianVehicleSpecifications(e){return r(this,void 0,void 0,(function*(){const r="GetCanadianVehicleSpecifications",i=t(e);if("object"!==i)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params" argument must be of type object, got: <${i}> ${e}`));const n=t(e.year);if("number"!==n)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.year" argument is required and must be of type number, got: <${n}> ${e.year}`));const a=t(e.make);if(e.make&&"string"!==a)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.make" argument must be of type string, got: <${a}> ${e.make}`));const s=t(e.model);if(e.model&&"string"!==s)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.model" argument must be of type string, got: <${s}> ${e.model}`));const o=t(e.units);if(e.units&&"string"!==o)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.units" argument must be of type string, got: <${o}> ${e.units}`));const c=e.make||"",m=e.model||"",u=e.units||"",d={year:e.year,make:c,model:m,units:u},g=yield this.buildQueryString(d,!0).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),f=`${this.baseUrl}/${r}${g}`;return yield this.get(f).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{i as GetCanadianVehicleSpecifications}; //# sourceMappingURL=GetCanadianVehicleSpecifications.js.map diff --git a/dist/module/GetCanadianVehicleSpecifications.js.map b/dist/module/GetCanadianVehicleSpecifications.js.map index 7fe0e38ad..f65cc1a1c 100644 --- a/dist/module/GetCanadianVehicleSpecifications.js.map +++ b/dist/module/GetCanadianVehicleSpecifications.js.map @@ -1 +1 @@ -{"version":3,"file":"GetCanadianVehicleSpecifications.js","sources":["../../src/api/actions/GetCanadianVehicleSpecifications.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetCanadianVehicleSpecifications\r\n * @category Actions\r\n * @description GetCanadianVehicleSpecifications NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetCanadianVehicleSpecifications](module-api_actions_GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetCanadianVehicleSpecificationsResponse](#GetCanadianVehicleSpecificationsResponse)\r\n * > - Type: [GetCanadianVehicleSpecificationsResults](#GetCanadianVehicleSpecificationsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetCanadianVehicleSpecifications extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The Canadian Vehicle Specifications (CVS) consists of a database of original vehicle dimensions,\r\n * used primarily in collision investigation and reconstruction, combined with a search engine.\r\n *\r\n * The database is compiled annually by the Collision Investigation and Research Division of Transport Canada.\r\n * Visit official [Canadian Vehicle Specifications](http://www.carsp.ca/research/resources/safety-sources/canadian-vehicle-specifications/)\r\n * page for more details.\r\n *\r\n * This API action will return a 404 html error if any of the query parameters in params\r\n * are missing from the query string. This is the only API action with this behaviour. Therefore,\r\n * parameters are inserted into the query string as empty strings if not provided by the user.\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle (required) - Number, >= 1971.\r\n * @param {string} [params.make] - Vehicle's make, like \"Honda\", \"Toyota\", etc...\r\n * @param {string} [params.model] - Vehicle's model, like \"Pilot\", \"Focus\". Can also include some other elements like Body Type, Engine Model/size, etc...\r\n * @param {string} [params.units] - \"Metric\" (default), or \"US\" for United States customary units.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetCanadianVehicleSpecifications(params: {\r\n year: number;\r\n make?: string;\r\n model?: string;\r\n units?: string;\r\n }): Promise {\r\n const action = 'GetCanadianVehicleSpecifications';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n const typeofMake = getTypeof(params.make);\r\n if (params.make && typeofMake !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.make\" argument must be of type string, got: ` +\r\n `<${typeofMake}> ${params.make}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModel = getTypeof(params.model);\r\n if (params.model && typeofModel !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.model\" argument must be of type string, got: ` +\r\n `<${typeofModel}> ${params.model}`\r\n )\r\n );\r\n }\r\n\r\n const typeofUnits = getTypeof(params.units);\r\n if (params.units && typeofUnits !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.units\" argument must be of type string, got: ` +\r\n `<${typeofUnits}> ${params.units}`\r\n )\r\n );\r\n }\r\n\r\n /* Set default query parameters to empty strings if not provided by the user */\r\n const make = params.make || '';\r\n const model = params.model || '';\r\n const units = params.units || '';\r\n\r\n const params_ = {\r\n year: params.year,\r\n make,\r\n model,\r\n units,\r\n };\r\n\r\n /*\r\n * Build the 'default' query string to be appended to the URL.\r\n *\r\n * Additionally, sets the allowEmptyStringValues option (2nd argument) to true because\r\n * this API action will return a 404 error if any of the query parameters are missing from the query string.\r\n * This is the only API action with this behaviour (\"year\" is the only param the user must provide).\r\n */\r\n const queryString = await this.buildQueryString(\r\n params_,\r\n true\r\n ).catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetCanadianVehicleSpecificationsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\r\n * @alias GetCanadianVehicleSpecificationsResults\r\n */\r\nexport type GetCanadianVehicleSpecificationsResults = {\r\n Specs: Array<{\r\n Name: string;\r\n Value: string;\r\n }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetCanadianVehicleSpecifications API Action.\r\n *\r\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\r\n * @alias GetCanadianVehicleSpecificationsResponse\r\n */\r\nexport type GetCanadianVehicleSpecificationsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetCanadianVehicleSpecifications","Fetch","[object Object]","userConfig","super","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofYear","year","typeofMake","make","typeofModel","model","typeofUnits","units","params_","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAyCC,EACpDC,YAAYC,GACVC,MAAMD,GAuBFD,iCAAiCG,4CAMrC,MAAMC,EAAS,mCAGTC,EAAeC,EAAUH,GAC/B,GAAqB,WAAjBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,qFAAIJ,MAAiBF,MAK7B,MAAMO,EAAaJ,EAAUH,EAAOQ,MACpC,GAAmB,WAAfD,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,0GAAIC,MAAeP,EAAOQ,SAKlC,MAAMC,EAAaN,EAAUH,EAAOU,MACpC,GAAIV,EAAOU,MAAuB,WAAfD,EACjB,OAAOL,QAAQC,OACb,IAAIC,MAEA,0FAAIG,MAAeT,EAAOU,SAKlC,MAAMC,EAAcR,EAAUH,EAAOY,OACrC,GAAIZ,EAAOY,OAAyB,WAAhBD,EAClB,OAAOP,QAAQC,OACb,IAAIC,MAEA,2FAAIK,MAAgBX,EAAOY,UAKnC,MAAMC,EAAcV,EAAUH,EAAOc,OACrC,GAAId,EAAOc,OAAyB,WAAhBD,EAClB,OAAOT,QAAQC,OACb,IAAIC,MAEA,2FAAIO,MAAgBb,EAAOc,UAMnC,MAAMJ,EAAOV,EAAOU,MAAQ,GACtBE,EAAQZ,EAAOY,OAAS,GACxBE,EAAQd,EAAOc,OAAS,GAExBC,EAAU,CACdP,KAAMR,EAAOQ,KACbE,KAAAA,EACAE,MAAAA,EACAE,MAAAA,GAUIE,QAAoBC,KAAKC,iBAC7BH,GACA,GACAI,MAAOC,GACPhB,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCmB,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWrB,IAASe,IAGxC,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNhB,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BmB"} \ No newline at end of file +{"version":3,"file":"GetCanadianVehicleSpecifications.js","sources":["../../src/api/actions/GetCanadianVehicleSpecifications.ts"],"sourcesContent":["/**\n * @module api/actions/GetCanadianVehicleSpecifications\n * @category Actions\n * @description GetCanadianVehicleSpecifications NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetCanadianVehicleSpecifications](module-api_actions_GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications.html)\n * >\n * > **Types**\n * > - Type: [GetCanadianVehicleSpecificationsResponse](#GetCanadianVehicleSpecificationsResponse)\n * > - Type: [GetCanadianVehicleSpecificationsResults](#GetCanadianVehicleSpecificationsResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetCanadianVehicleSpecifications extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * The Canadian Vehicle Specifications (CVS) consists of a database of original vehicle dimensions,\n * used primarily in collision investigation and reconstruction, combined with a search engine.\n *\n * The database is compiled annually by the Collision Investigation and Research Division of Transport Canada.\n * Visit official [Canadian Vehicle Specifications](http://www.carsp.ca/research/resources/safety-sources/canadian-vehicle-specifications/)\n * page for more details.\n *\n * This API action will return a 404 html error if any of the query parameters in params\n * are missing from the query string. This is the only API action with this behaviour. Therefore,\n * parameters are inserted into the query string as empty strings if not provided by the user.\n *\n * @async\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.year - Model year of the vehicle (required) - Number, >= 1971.\n * @param {string} [params.make] - Vehicle's make, like \"Honda\", \"Toyota\", etc...\n * @param {string} [params.model] - Vehicle's model, like \"Pilot\", \"Focus\". Can also include some other elements like Body Type, Engine Model/size, etc...\n * @param {string} [params.units] - \"Metric\" (default), or \"US\" for United States customary units.\n * @returns {(Promise)} Api Response object.\n */\n async GetCanadianVehicleSpecifications(params: {\n year: number;\n make?: string;\n model?: string;\n units?: string;\n }): Promise {\n const action = 'GetCanadianVehicleSpecifications';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofYear = getTypeof(params.year);\n if (typeofYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\n `<${typeofYear}> ${params.year}`\n )\n );\n }\n\n const typeofMake = getTypeof(params.make);\n if (params.make && typeofMake !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.make\" argument must be of type string, got: ` +\n `<${typeofMake}> ${params.make}`\n )\n );\n }\n\n const typeofModel = getTypeof(params.model);\n if (params.model && typeofModel !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.model\" argument must be of type string, got: ` +\n `<${typeofModel}> ${params.model}`\n )\n );\n }\n\n const typeofUnits = getTypeof(params.units);\n if (params.units && typeofUnits !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.units\" argument must be of type string, got: ` +\n `<${typeofUnits}> ${params.units}`\n )\n );\n }\n\n /* Set default query parameters to empty strings if not provided by the user */\n const make = params.make || '';\n const model = params.model || '';\n const units = params.units || '';\n\n const params_ = {\n year: params.year,\n make,\n model,\n units,\n };\n\n /*\n * Build the 'default' query string to be appended to the URL.\n *\n * Additionally, sets the allowEmptyStringValues option (2nd argument) to true because\n * this API action will return a 404 error if any of the query parameters are missing from the query string.\n * This is the only API action with this behaviour (\"year\" is the only param the user must provide).\n */\n const queryString = await this.buildQueryString(\n params_,\n true\n ).catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetCanadianVehicleSpecificationsResponse}.Results' array.\n *\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\n * @alias GetCanadianVehicleSpecificationsResults\n */\nexport type GetCanadianVehicleSpecificationsResults = {\n Specs: Array<{\n Name: string;\n Value: string;\n }>;\n};\n\n/**\n * Type representing the complete response returned by the GetCanadianVehicleSpecifications API Action.\n *\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\n * @alias GetCanadianVehicleSpecificationsResponse\n */\nexport type GetCanadianVehicleSpecificationsResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetCanadianVehicleSpecifications","Fetch","[object Object]","userConfig","super","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofYear","year","typeofMake","make","typeofModel","model","typeofUnits","units","params_","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAyCC,EACpDC,YAAYC,GACVC,MAAMD,GAuBFD,iCAAiCG,4CAMrC,MAAMC,EAAS,mCAGTC,EAAeC,EAAUH,GAC/B,GAAqB,WAAjBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,qFAAIJ,MAAiBF,MAK7B,MAAMO,EAAaJ,EAAUH,EAAOQ,MACpC,GAAmB,WAAfD,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,0GAAIC,MAAeP,EAAOQ,SAKlC,MAAMC,EAAaN,EAAUH,EAAOU,MACpC,GAAIV,EAAOU,MAAuB,WAAfD,EACjB,OAAOL,QAAQC,OACb,IAAIC,MAEA,0FAAIG,MAAeT,EAAOU,SAKlC,MAAMC,EAAcR,EAAUH,EAAOY,OACrC,GAAIZ,EAAOY,OAAyB,WAAhBD,EAClB,OAAOP,QAAQC,OACb,IAAIC,MAEA,2FAAIK,MAAgBX,EAAOY,UAKnC,MAAMC,EAAcV,EAAUH,EAAOc,OACrC,GAAId,EAAOc,OAAyB,WAAhBD,EAClB,OAAOT,QAAQC,OACb,IAAIC,MAEA,2FAAIO,MAAgBb,EAAOc,UAMnC,MAAMJ,EAAOV,EAAOU,MAAQ,GACtBE,EAAQZ,EAAOY,OAAS,GACxBE,EAAQd,EAAOc,OAAS,GAExBC,EAAU,CACdP,KAAMR,EAAOQ,KACbE,KAAAA,EACAE,MAAAA,EACAE,MAAAA,GAUIE,QAAoBC,KAAKC,iBAC7BH,GACA,GACAI,MAAOC,GACPhB,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCmB,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWrB,IAASe,IAGxC,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNhB,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BmB"} \ No newline at end of file diff --git a/dist/module/GetEquipmentPlantCodes.js b/dist/module/GetEquipmentPlantCodes.js index 6d9c1f907..2ef8f637c 100644 --- a/dist/module/GetEquipmentPlantCodes.js +++ b/dist/module/GetEquipmentPlantCodes.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class n extends e{constructor(e){super(e)}GetEquipmentPlantCodes(e){return r(this,void 0,void 0,(function*(){const r="GetEquipmentPlantCodes",n=t(e);if("object"!==n)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params" argument must be of type object, got: <${n}> ${e}`));const o=t(e.year);if("number"!==o)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.year" argument is required and must be of type number, got: <${o}> ${e.year}`));const s=t(e.equipmentType);if("number"!==s)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.equipmentType" argument is required and must be of type number, got: <${s}> ${e.equipmentType}`));const i=t(e.reportType);if("string"!==i)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.reportType" argument is required and must be of type string, got: <${i}> ${e.reportType}`));const u=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),m=`${this.baseUrl}/${r}${u}`;return yield this.get(m).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{n as GetEquipmentPlantCodes}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class n extends e{constructor(e){super(e)}GetEquipmentPlantCodes(e){return r(this,void 0,void 0,(function*(){const r="GetEquipmentPlantCodes",n=t(e);if("object"!==n)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params" argument must be of type object, got: <${n}> ${e}`));const o=t(e.year);if("number"!==o)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.year" argument is required and must be of type number, got: <${o}> ${e.year}`));const s=t(e.equipmentType);if("number"!==s)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.equipmentType" argument is required and must be of type number, got: <${s}> ${e.equipmentType}`));const i=t(e.reportType);if("string"!==i)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.reportType" argument is required and must be of type string, got: <${i}> ${e.reportType}`));const u=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),a=`${this.baseUrl}/${r}${u}`;return yield this.get(a).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{n as GetEquipmentPlantCodes}; //# sourceMappingURL=GetEquipmentPlantCodes.js.map diff --git a/dist/module/GetEquipmentPlantCodes.js.map b/dist/module/GetEquipmentPlantCodes.js.map index 7e1754a5e..242ac6a19 100644 --- a/dist/module/GetEquipmentPlantCodes.js.map +++ b/dist/module/GetEquipmentPlantCodes.js.map @@ -1 +1 @@ -{"version":3,"file":"GetEquipmentPlantCodes.js","sources":["../../src/api/actions/GetEquipmentPlantCodes.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetEquipmentPlantCodes\r\n * @category Actions\r\n * @description GetEquipmentPlantCodes NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetEquipmentPlantCodes](module-api_actions_GetEquipmentPlantCodes.GetEquipmentPlantCodes.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetEquipmentPlantCodesResponse](#GetEquipmentPlantCodesResponse)\r\n * > - Type: [GetEquipmentPlantCodesResults](#GetEquipmentPlantCodesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetEquipmentPlantCodes extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * Returns assigned Equipment Plant Codes. Can be filtered by Year, Equipment Type and Report Type.\r\n *\r\n * `params.year`:\r\n * - Only years >= 2016 are supported\r\n *\r\n * `params.equipmentType`:\r\n * - 1 (Tires)\r\n * - 3 (Brake Hoses)\r\n * - 13 (Glazing)\r\n * - 16 (Retread)\r\n *\r\n * `params.reportType`:\r\n * - 'New' (The Equipment Plant Code was assigned during the selected year).\r\n * - 'Updated' (The Equipment Plant data was modified during the selected year).\r\n * - 'Closed' (The Equipment Plant is no longer Active).\r\n * - 'All' (All Equipment Plant Codes regardless of year, including their status (active or closed)).\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\r\n * @param {number} params.equipmentType - Number equal to 1, 3, 13, or 16.\r\n * @param {string} params.reportType - 'New', 'Updated', 'Closed', or 'All'.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetEquipmentPlantCodes(params: {\r\n year: number;\r\n equipmentType: 1 | 3 | 13 | 16;\r\n reportType: 'New' | 'Updated' | 'Closed' | 'All';\r\n }): Promise {\r\n const action = 'GetEquipmentPlantCodes';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n const typeofEquipmentType = getTypeof(params.equipmentType);\r\n if (typeofEquipmentType !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.equipmentType\" argument is required and must be of type number, got: ` +\r\n `<${typeofEquipmentType}> ${params.equipmentType}`\r\n )\r\n );\r\n }\r\n\r\n const typeofReportType = getTypeof(params.reportType);\r\n if (typeofReportType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.reportType\" argument is required and must be of type string, got: ` +\r\n `<${typeofReportType}> ${params.reportType}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetEquipmentPlantCodesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetEquipmentPlantCodes\r\n * @alias GetEquipmentPlantCodesResults\r\n */\r\nexport type GetEquipmentPlantCodesResults = {\r\n Address: string;\r\n City: string;\r\n Country: string;\r\n DOTCode: string;\r\n Name: string;\r\n OldDotCode: string;\r\n PostalCode: string;\r\n StateProvince: string;\r\n Status: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetEquipmentPlantCodes API Action.\r\n *\r\n * @memberof module:api/actions/GetEquipmentPlantCodes\r\n * @alias GetEquipmentPlantCodesResponse\r\n */\r\nexport type GetEquipmentPlantCodesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetEquipmentPlantCodes","Fetch","[object Object]","userConfig","super","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofYear","year","typeofEquipmentType","equipmentType","typeofReportType","reportType","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GA4BKD,uBAAuBG,4CAKlC,MAAMC,EAAS,yBAGTC,EAAeC,EAAUH,GAC/B,GAAqB,WAAjBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,2EAAIJ,MAAiBF,MAK7B,MAAMO,EAAaJ,EAAUH,EAAOQ,MACpC,GAAmB,WAAfD,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,gGAAIC,MAAeP,EAAOQ,SAKlC,MAAMC,EAAsBN,EAAUH,EAAOU,eAC7C,GAA4B,WAAxBD,EACF,OAAOL,QAAQC,OACb,IAAIC,MAEA,yGAAIG,MAAwBT,EAAOU,kBAK3C,MAAMC,EAAmBR,EAAUH,EAAOY,YAC1C,GAAyB,WAArBD,EACF,OAAOP,QAAQC,OACb,IAAIC,MAEA,sGAAIK,MAAqBX,EAAOY,eAMxC,MAAMC,QAAoBC,KAAKC,iBAAiBf,GAAQgB,MAAOC,GAC7Db,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCgB,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWlB,IAASY,IAGxC,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNb,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BgB"} \ No newline at end of file +{"version":3,"file":"GetEquipmentPlantCodes.js","sources":["../../src/api/actions/GetEquipmentPlantCodes.ts"],"sourcesContent":["/**\n * @module api/actions/GetEquipmentPlantCodes\n * @category Actions\n * @description GetEquipmentPlantCodes NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetEquipmentPlantCodes](module-api_actions_GetEquipmentPlantCodes.GetEquipmentPlantCodes.html)\n * >\n * > **Types**\n * > - Type: [GetEquipmentPlantCodesResponse](#GetEquipmentPlantCodesResponse)\n * > - Type: [GetEquipmentPlantCodesResults](#GetEquipmentPlantCodesResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetEquipmentPlantCodes extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * Returns assigned Equipment Plant Codes. Can be filtered by Year, Equipment Type and Report Type.\n *\n * `params.year`:\n * - Only years >= 2016 are supported\n *\n * `params.equipmentType`:\n * - 1 (Tires)\n * - 3 (Brake Hoses)\n * - 13 (Glazing)\n * - 16 (Retread)\n *\n * `params.reportType`:\n * - 'New' (The Equipment Plant Code was assigned during the selected year).\n * - 'Updated' (The Equipment Plant data was modified during the selected year).\n * - 'Closed' (The Equipment Plant is no longer Active).\n * - 'All' (All Equipment Plant Codes regardless of year, including their status (active or closed)).\n *\n * @async\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\n * @param {number} params.equipmentType - Number equal to 1, 3, 13, or 16.\n * @param {string} params.reportType - 'New', 'Updated', 'Closed', or 'All'.\n * @returns {(Promise)} Api Response object.\n */\n public async GetEquipmentPlantCodes(params: {\n year: number;\n equipmentType: 1 | 3 | 13 | 16;\n reportType: 'New' | 'Updated' | 'Closed' | 'All';\n }): Promise {\n const action = 'GetEquipmentPlantCodes';\n\n /* Runtime typechecking */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofYear = getTypeof(params.year);\n if (typeofYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\n `<${typeofYear}> ${params.year}`\n )\n );\n }\n\n const typeofEquipmentType = getTypeof(params.equipmentType);\n if (typeofEquipmentType !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.equipmentType\" argument is required and must be of type number, got: ` +\n `<${typeofEquipmentType}> ${params.equipmentType}`\n )\n );\n }\n\n const typeofReportType = getTypeof(params.reportType);\n if (typeofReportType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.reportType\" argument is required and must be of type string, got: ` +\n `<${typeofReportType}> ${params.reportType}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetEquipmentPlantCodesResponse}.Results' array.\n *\n * @memberof module:api/actions/GetEquipmentPlantCodes\n * @alias GetEquipmentPlantCodesResults\n */\nexport type GetEquipmentPlantCodesResults = {\n Address: string;\n City: string;\n Country: string;\n DOTCode: string;\n Name: string;\n OldDotCode: string;\n PostalCode: string;\n StateProvince: string;\n Status: string;\n};\n\n/**\n * Type representing the complete response returned by the GetEquipmentPlantCodes API Action.\n *\n * @memberof module:api/actions/GetEquipmentPlantCodes\n * @alias GetEquipmentPlantCodesResponse\n */\nexport type GetEquipmentPlantCodesResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetEquipmentPlantCodes","Fetch","[object Object]","userConfig","super","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofYear","year","typeofEquipmentType","equipmentType","typeofReportType","reportType","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GA4BKD,uBAAuBG,4CAKlC,MAAMC,EAAS,yBAGTC,EAAeC,EAAUH,GAC/B,GAAqB,WAAjBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,2EAAIJ,MAAiBF,MAK7B,MAAMO,EAAaJ,EAAUH,EAAOQ,MACpC,GAAmB,WAAfD,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,gGAAIC,MAAeP,EAAOQ,SAKlC,MAAMC,EAAsBN,EAAUH,EAAOU,eAC7C,GAA4B,WAAxBD,EACF,OAAOL,QAAQC,OACb,IAAIC,MAEA,yGAAIG,MAAwBT,EAAOU,kBAK3C,MAAMC,EAAmBR,EAAUH,EAAOY,YAC1C,GAAyB,WAArBD,EACF,OAAOP,QAAQC,OACb,IAAIC,MAEA,sGAAIK,MAAqBX,EAAOY,eAMxC,MAAMC,QAAoBC,KAAKC,iBAAiBf,GAAQgB,MAAOC,GAC7Db,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCgB,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWlB,IAASY,IAGxC,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNb,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BgB"} \ No newline at end of file diff --git a/dist/module/GetMakeForManufacturer.js b/dist/module/GetMakeForManufacturer.js index d32339524..74f18d1a1 100644 --- a/dist/module/GetMakeForManufacturer.js +++ b/dist/module/GetMakeForManufacturer.js @@ -1,2 +1,2 @@ -import{F as r,_ as e,g as t}from"./Fetch-b3914c0a.js";class n extends r{constructor(r){super(r)}GetMakeForManufacturer(r){return e(this,void 0,void 0,(function*(){const e="GetMakeForManufacturer",n=t(r);if("string"!==n&&"number"!==n)return Promise.reject(new Error(`GetMakeForManufacturer, "manufacturer" argument is required and must be of type string or number, got: <${n}> ${r}`));const o=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),s=`${this.baseUrl}/${e}/${r}${o}`;return yield this.get(s).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{n as GetMakeForManufacturer}; +import{F as r,_ as e,g as t}from"./Fetch-44aa28fd.js";class n extends r{constructor(r){super(r)}GetMakeForManufacturer(r){return e(this,void 0,void 0,(function*(){const e="GetMakeForManufacturer",n=t(r);if("string"!==n&&"number"!==n)return Promise.reject(new Error(`GetMakeForManufacturer, "manufacturer" argument is required and must be of type string or number, got: <${n}> ${r}`));const o=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),s=`${this.baseUrl}/${e}/${r}${o}`;return yield this.get(s).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{n as GetMakeForManufacturer}; //# sourceMappingURL=GetMakeForManufacturer.js.map diff --git a/dist/module/GetMakeForManufacturer.js.map b/dist/module/GetMakeForManufacturer.js.map index 13c5f9409..b9a960893 100644 --- a/dist/module/GetMakeForManufacturer.js.map +++ b/dist/module/GetMakeForManufacturer.js.map @@ -1 +1 @@ -{"version":3,"file":"GetMakeForManufacturer.js","sources":["../../src/api/actions/GetMakeForManufacturer.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetMakeForManufacturer\r\n * @category Actions\r\n * @description GetMakeForManufacturer NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakeForManufacturer](module-api_actions_GetMakeForManufacturer.GetMakeForManufacturer.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakeForManufacturerResponse](#GetMakeForManufacturerResponse)\r\n * > - Type: [GetMakeForManufacturerResults](#GetMakeForManufacturerResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakeForManufacturer extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified manufacturer that is requested.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\r\n * (it accepts a partial manufacturer name as an input).\r\n * - `manufacturer` name can be a partial name, or a full name for more specificity\r\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\r\n * - Multiple results are returned in case of multiple matches.\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetMakeForManufacturer(\r\n manufacturer: string | number\r\n ): Promise {\r\n const action = 'GetMakeForManufacturer';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakeForManufacturerResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakeForManufacturer\r\n * @alias GetMakeForManufacturerResults\r\n */\r\nexport type GetMakeForManufacturerResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Mfr_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakeForManufacturer API Action.\r\n *\r\n * @memberof module:api/actions/GetMakeForManufacturer\r\n * @alias GetMakeForManufacturerResponse\r\n */\r\nexport type GetMakeForManufacturerResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetMakeForManufacturer","Fetch","[object Object]","userConfig","super","manufacturer","action","typeofManufacturer","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAgBFD,uBACJG,4CAEA,MAAMC,EAAS,yBAGTC,EAAqBC,EAAUH,GACrC,GAA2B,WAAvBE,GAA0D,WAAvBA,EACrC,OAAOE,QAAQC,OACb,IAAIC,MAEA,2GAAIJ,MAAuBF,MAMnC,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAeO,IAGxD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file +{"version":3,"file":"GetMakeForManufacturer.js","sources":["../../src/api/actions/GetMakeForManufacturer.ts"],"sourcesContent":["/**\n * @module api/actions/GetMakeForManufacturer\n * @category Actions\n * @description GetMakeForManufacturer NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetMakeForManufacturer](module-api_actions_GetMakeForManufacturer.GetMakeForManufacturer.html)\n * >\n * > **Types**\n * > - Type: [GetMakeForManufacturerResponse](#GetMakeForManufacturerResponse)\n * > - Type: [GetMakeForManufacturerResults](#GetMakeForManufacturerResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetMakeForManufacturer extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Makes in the vPIC dataset for a specified manufacturer that is requested.\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\n * (it accepts a partial manufacturer name as an input).\n * - `manufacturer` name can be a partial name, or a full name for more specificity\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\n * - Multiple results are returned in case of multiple matches.\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\n * @returns {(Promise)} Api Response object.\n */\n async GetMakeForManufacturer(\n manufacturer: string | number\n ): Promise {\n const action = 'GetMakeForManufacturer';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetMakeForManufacturerResponse}.Results' array.\n *\n * @memberof module:api/actions/GetMakeForManufacturer\n * @alias GetMakeForManufacturerResults\n */\nexport type GetMakeForManufacturerResults = {\n Make_ID: number;\n Make_Name: string;\n Mfr_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetMakeForManufacturer API Action.\n *\n * @memberof module:api/actions/GetMakeForManufacturer\n * @alias GetMakeForManufacturerResponse\n */\nexport type GetMakeForManufacturerResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetMakeForManufacturer","Fetch","[object Object]","userConfig","super","manufacturer","action","typeofManufacturer","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAgBFD,uBACJG,4CAEA,MAAMC,EAAS,yBAGTC,EAAqBC,EAAUH,GACrC,GAA2B,WAAvBE,GAA0D,WAAvBA,EACrC,OAAOE,QAAQC,OACb,IAAIC,MAEA,2GAAIJ,MAAuBF,MAMnC,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAeO,IAGxD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file diff --git a/dist/module/GetMakesForManufacturerAndYear.js b/dist/module/GetMakesForManufacturerAndYear.js index ce48598b6..45e6e325f 100644 --- a/dist/module/GetMakesForManufacturerAndYear.js +++ b/dist/module/GetMakesForManufacturerAndYear.js @@ -1,2 +1,2 @@ -import{F as r,_ as e,g as t}from"./Fetch-b3914c0a.js";class n extends r{constructor(r){super(r)}GetMakesForManufacturerAndYear(r,n){return e(this,void 0,void 0,(function*(){const e="GetMakesForManufacturerAndYear",a=t(r);if("string"!==a&&"number"!==a)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "manufacturer" argument is required and must be of type string or number, got: <${a}> ${r}`));const s=t(n);if("object"!==s)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params" argument is required and must be of type object, got: <${s}> ${n}`));const o=t(n.year);if("number"!==o)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params.year" argument is required and must be of type number, got: <${o}> ${n.year}`));const u=yield this.buildQueryString(n).catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),i=`${this.baseUrl}/${e}/${r}${u}`;return yield this.get(i).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{n as GetMakesForManufacturerAndYear}; +import{F as r,_ as e,g as t}from"./Fetch-44aa28fd.js";class n extends r{constructor(r){super(r)}GetMakesForManufacturerAndYear(r,n){return e(this,void 0,void 0,(function*(){const e="GetMakesForManufacturerAndYear",a=t(r);if("string"!==a&&"number"!==a)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "manufacturer" argument is required and must be of type string or number, got: <${a}> ${r}`));const s=t(n);if("object"!==s)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params" argument is required and must be of type object, got: <${s}> ${n}`));const o=t(n.year);if("number"!==o)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params.year" argument is required and must be of type number, got: <${o}> ${n.year}`));const u=yield this.buildQueryString(n).catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),i=`${this.baseUrl}/${e}/${r}${u}`;return yield this.get(i).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{n as GetMakesForManufacturerAndYear}; //# sourceMappingURL=GetMakesForManufacturerAndYear.js.map diff --git a/dist/module/GetMakesForManufacturerAndYear.js.map b/dist/module/GetMakesForManufacturerAndYear.js.map index 3ee2e12e4..27feae5c3 100644 --- a/dist/module/GetMakesForManufacturerAndYear.js.map +++ b/dist/module/GetMakesForManufacturerAndYear.js.map @@ -1 +1 @@ -{"version":3,"file":"GetMakesForManufacturerAndYear.js","sources":["../../src/api/actions/GetMakesForManufacturerAndYear.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetMakesForManufacturerAndYear\r\n * @category Actions\r\n * @description GetMakesForManufacturerAndYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakesForManufacturerAndYear](module-api_actions_GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakesForManufacturerAndYearResponse](#GetMakesForManufacturerAndYearResponse)\r\n * > - Type: [GetMakesForManufacturerAndYearResults](#GetMakesForManufacturerAndYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakesForManufacturerAndYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified manufacturer,\r\n * and whose Year From and Year To range cover the specified year.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\r\n * (it accepts a partial manufacturer name as an input).\r\n * - Multiple results are returned in case of multiple matches.\r\n * - Manufacturer can be idenfitied by Id, a partial name, or a full name\r\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\r\n *\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetMakesForManufacturerAndYear(\r\n manufacturer: string | number,\r\n params: {\r\n year: number;\r\n }\r\n ): Promise {\r\n const action = 'GetMakesForManufacturerAndYear';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument is required and must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakesForManufacturerAndYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\r\n * @alias GetMakesForManufacturerAndYearResults\r\n */\r\nexport type GetMakesForManufacturerAndYearResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n MfrId: number;\r\n MfrName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakesForManufacturerAndYear API Action.\r\n *\r\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\r\n * @alias GetMakesForManufacturerAndYearResponse\r\n */\r\nexport type GetMakesForManufacturerAndYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetMakesForManufacturerAndYear","Fetch","[object Object]","userConfig","super","manufacturer","params","action","typeofManufacturer","getTypeof","Promise","reject","Error","typeofParams","typeofYear","year","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAuCC,EAClDC,YAAYC,GACVC,MAAMD,GAoBKD,+BACXG,EACAC,4CAIA,MAAMC,EAAS,iCAGTC,EAAqBC,EAAUJ,GACrC,GAA2B,WAAvBG,GAA0D,WAAvBA,EACrC,OAAOE,QAAQC,OACb,IAAIC,MAEA,mHAAIJ,MAAuBH,MAKnC,MAAMQ,EAAeJ,EAAUH,GAC/B,GAAqB,WAAjBO,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,mGAAIC,MAAiBP,MAK7B,MAAMQ,EAAaL,EAAUH,EAAOS,MACpC,GAAmB,WAAfD,EACF,OAAOJ,QAAQC,OACb,IAAIC,MAEA,wGAAIE,MAAeR,EAAOS,SAMlC,MAAMC,QAAoBC,KAAKC,iBAAiBZ,GAAQa,MAAOC,GAC7DV,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCa,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWf,KAAUF,IAAeW,IAGxD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNV,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Ba"} \ No newline at end of file +{"version":3,"file":"GetMakesForManufacturerAndYear.js","sources":["../../src/api/actions/GetMakesForManufacturerAndYear.ts"],"sourcesContent":["/**\n * @module api/actions/GetMakesForManufacturerAndYear\n * @category Actions\n * @description GetMakesForManufacturerAndYear NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetMakesForManufacturerAndYear](module-api_actions_GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear.html)\n * >\n * > **Types**\n * > - Type: [GetMakesForManufacturerAndYearResponse](#GetMakesForManufacturerAndYearResponse)\n * > - Type: [GetMakesForManufacturerAndYearResults](#GetMakesForManufacturerAndYearResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetMakesForManufacturerAndYear extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Makes in the vPIC dataset for a specified manufacturer,\n * and whose Year From and Year To range cover the specified year.\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\n * (it accepts a partial manufacturer name as an input).\n * - Multiple results are returned in case of multiple matches.\n * - Manufacturer can be idenfitied by Id, a partial name, or a full name\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\n *\n * @returns {(Promise)} Api Response object.\n */\n public async GetMakesForManufacturerAndYear(\n manufacturer: string | number,\n params: {\n year: number;\n }\n ): Promise {\n const action = 'GetMakesForManufacturerAndYear';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument is required and must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n\n const typeofYear = getTypeof(params.year);\n if (typeofYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\n `<${typeofYear}> ${params.year}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetMakesForManufacturerAndYearResponse}.Results' array.\n *\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\n * @alias GetMakesForManufacturerAndYearResults\n */\nexport type GetMakesForManufacturerAndYearResults = {\n MakeId: number;\n MakeName: string;\n MfrId: number;\n MfrName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetMakesForManufacturerAndYear API Action.\n *\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\n * @alias GetMakesForManufacturerAndYearResponse\n */\nexport type GetMakesForManufacturerAndYearResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetMakesForManufacturerAndYear","Fetch","[object Object]","userConfig","super","manufacturer","params","action","typeofManufacturer","getTypeof","Promise","reject","Error","typeofParams","typeofYear","year","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAuCC,EAClDC,YAAYC,GACVC,MAAMD,GAoBKD,+BACXG,EACAC,4CAIA,MAAMC,EAAS,iCAGTC,EAAqBC,EAAUJ,GACrC,GAA2B,WAAvBG,GAA0D,WAAvBA,EACrC,OAAOE,QAAQC,OACb,IAAIC,MAEA,mHAAIJ,MAAuBH,MAKnC,MAAMQ,EAAeJ,EAAUH,GAC/B,GAAqB,WAAjBO,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,mGAAIC,MAAiBP,MAK7B,MAAMQ,EAAaL,EAAUH,EAAOS,MACpC,GAAmB,WAAfD,EACF,OAAOJ,QAAQC,OACb,IAAIC,MAEA,wGAAIE,MAAeR,EAAOS,SAMlC,MAAMC,QAAoBC,KAAKC,iBAAiBZ,GAAQa,MAAOC,GAC7DV,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCa,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWf,KAAUF,IAAeW,IAGxD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNV,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Ba"} \ No newline at end of file diff --git a/dist/module/GetMakesForVehicleType.js b/dist/module/GetMakesForVehicleType.js index 38e155597..3e637467d 100644 --- a/dist/module/GetMakesForVehicleType.js +++ b/dist/module/GetMakesForVehicleType.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class s extends e{constructor(e){super(e)}GetMakesForVehicleType(e){return r(this,void 0,void 0,(function*(){const r="GetMakesForVehicleType",s=t(e);if("string"!==s)return Promise.reject(new Error(`GetMakesForVehicleType, "typeName" argument is required and must be of type string, got: <${s}> ${e}`));const i=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),o=`${this.baseUrl}/${r}/${e}${i}`;return yield this.get(o).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{s as GetMakesForVehicleType}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class s extends e{constructor(e){super(e)}GetMakesForVehicleType(e){return r(this,void 0,void 0,(function*(){const r="GetMakesForVehicleType",s=t(e);if("string"!==s)return Promise.reject(new Error(`GetMakesForVehicleType, "typeName" argument is required and must be of type string, got: <${s}> ${e}`));const i=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),o=`${this.baseUrl}/${r}/${e}${i}`;return yield this.get(o).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{s as GetMakesForVehicleType}; //# sourceMappingURL=GetMakesForVehicleType.js.map diff --git a/dist/module/GetMakesForVehicleType.js.map b/dist/module/GetMakesForVehicleType.js.map index 61f5e2a96..fc0c3cf34 100644 --- a/dist/module/GetMakesForVehicleType.js.map +++ b/dist/module/GetMakesForVehicleType.js.map @@ -1 +1 @@ -{"version":3,"file":"GetMakesForVehicleType.js","sources":["../../src/api/actions/GetMakesForVehicleType.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetMakesForVehicleType\r\n * @category Actions\r\n * @description GetMakesForVehicleType NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakesForVehicleType](module-api_actions_GetMakesForVehicleType.GetMakesForVehicleType.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakesForVehicleTypeResponse](#GetMakesForVehicleTypeResponse)\r\n * > - Type: [GetMakesForVehicleTypeResults](#GetMakesForVehicleTypeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakesForVehicleType extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified vehicle type (`typeName`),\r\n * whose name is LIKE the vehicle type name in vPIC Dataset.\r\n * - Vehicle `typeName` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n * @param {string} typeName - A partial or full vehicle type name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetMakesForVehicleType(\r\n typeName: string\r\n ): Promise {\r\n const action = 'GetMakesForVehicleType';\r\n\r\n /* Runtime typechecking */\r\n const typeofTypeName = getTypeof(typeName);\r\n if (typeofTypeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"typeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofTypeName}> ${typeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${typeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakesForVehicleTypeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakesForVehicleType\r\n * @alias GetMakesForVehicleTypeResults\r\n */\r\nexport type GetMakesForVehicleTypeResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakesForVehicleType API Action.\r\n *\r\n * @memberof module:api/actions/GetMakesForVehicleType\r\n * @alias GetMakesForVehicleTypeResponse\r\n */\r\nexport type GetMakesForVehicleTypeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetMakesForVehicleType","Fetch","[object Object]","userConfig","super","typeName","action","typeofTypeName","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAaFD,uBACJG,4CAEA,MAAMC,EAAS,yBAGTC,EAAiBC,EAAUH,GACjC,GAAuB,WAAnBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,6FAAIJ,MAAmBF,MAM/B,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAWO,IAGpD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file +{"version":3,"file":"GetMakesForVehicleType.js","sources":["../../src/api/actions/GetMakesForVehicleType.ts"],"sourcesContent":["/**\n * @module api/actions/GetMakesForVehicleType\n * @category Actions\n * @description GetMakesForVehicleType NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetMakesForVehicleType](module-api_actions_GetMakesForVehicleType.GetMakesForVehicleType.html)\n * >\n * > **Types**\n * > - Type: [GetMakesForVehicleTypeResponse](#GetMakesForVehicleTypeResponse)\n * > - Type: [GetMakesForVehicleTypeResults](#GetMakesForVehicleTypeResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetMakesForVehicleType extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Makes in the vPIC dataset for a specified vehicle type (`typeName`),\n * whose name is LIKE the vehicle type name in vPIC Dataset.\n * - Vehicle `typeName` can be a partial name, or a full name for more specificity\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\n *\n * @async\n * @param {string} typeName - A partial or full vehicle type name.\n * @returns {(Promise)} Api Response object.\n */\n async GetMakesForVehicleType(\n typeName: string\n ): Promise {\n const action = 'GetMakesForVehicleType';\n\n /* Runtime typechecking */\n const typeofTypeName = getTypeof(typeName);\n if (typeofTypeName !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"typeName\" argument is required and must be of type string, got: ` +\n `<${typeofTypeName}> ${typeName}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${typeName}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetMakesForVehicleTypeResponse}.Results' array.\n *\n * @memberof module:api/actions/GetMakesForVehicleType\n * @alias GetMakesForVehicleTypeResults\n */\nexport type GetMakesForVehicleTypeResults = {\n MakeId: number;\n MakeName: string;\n VehicleTypeId: number;\n VehicleTypeName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetMakesForVehicleType API Action.\n *\n * @memberof module:api/actions/GetMakesForVehicleType\n * @alias GetMakesForVehicleTypeResponse\n */\nexport type GetMakesForVehicleTypeResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetMakesForVehicleType","Fetch","[object Object]","userConfig","super","typeName","action","typeofTypeName","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAaFD,uBACJG,4CAEA,MAAMC,EAAS,yBAGTC,EAAiBC,EAAUH,GACjC,GAAuB,WAAnBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,6FAAIJ,MAAmBF,MAM/B,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAWO,IAGpD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file diff --git a/dist/module/GetManufacturerDetails.js b/dist/module/GetManufacturerDetails.js index db2e135d9..c88cb2af7 100644 --- a/dist/module/GetManufacturerDetails.js +++ b/dist/module/GetManufacturerDetails.js @@ -1,2 +1,2 @@ -import{F as r,_ as e,g as t}from"./Fetch-b3914c0a.js";class s extends r{constructor(r){super(r)}GetManufacturerDetails(r){return e(this,void 0,void 0,(function*(){const e="GetManufacturerDetails",s=t(r);if("string"!==s&&"number"!==s)return Promise.reject(new Error(`GetManufacturerDetails, "manufacturer" argument is required and must be of type string or number, got: <${s}> ${r}`));const i=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),n=`${this.baseUrl}/${e}/${r}${i}`;return yield this.get(n).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{s as GetManufacturerDetails}; +import{F as r,_ as e,g as t}from"./Fetch-44aa28fd.js";class s extends r{constructor(r){super(r)}GetManufacturerDetails(r){return e(this,void 0,void 0,(function*(){const e="GetManufacturerDetails",s=t(r);if("string"!==s&&"number"!==s)return Promise.reject(new Error(`GetManufacturerDetails, "manufacturer" argument is required and must be of type string or number, got: <${s}> ${r}`));const i=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),n=`${this.baseUrl}/${e}/${r}${i}`;return yield this.get(n).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{s as GetManufacturerDetails}; //# sourceMappingURL=GetManufacturerDetails.js.map diff --git a/dist/module/GetManufacturerDetails.js.map b/dist/module/GetManufacturerDetails.js.map index 613664366..8822b24b0 100644 --- a/dist/module/GetManufacturerDetails.js.map +++ b/dist/module/GetManufacturerDetails.js.map @@ -1 +1 @@ -{"version":3,"file":"GetManufacturerDetails.js","sources":["../../src/api/actions/GetManufacturerDetails.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetManufacturerDetails\r\n * @category Actions\r\n * @description GetManufacturerDetails NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetManufacturerDetails](module-api_actions_GetManufacturerDetails.GetManufacturerDetails.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetManufacturerDetailsResponse](#GetManufacturerDetailsResponse)\r\n * > - Type: [GetManufacturerDetailsResults](#GetManufacturerDetailsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetManufacturerDetails extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides the details for a specific manufacturer that is requested.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name,\r\n * (it accepts a partial manufacturer name as an input).\r\n * - Multiple results are returned in case of multiple matches.\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetManufacturerDetails(\r\n manufacturer: string | number\r\n ): Promise {\r\n const action = 'GetManufacturerDetails';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetManufacturerDetailsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetManufacturerDetails\r\n * @alias GetManufacturerDetailsResults\r\n */\r\nexport type GetManufacturerDetailsResults = {\r\n Address: string;\r\n Address2: string;\r\n City: string;\r\n ContactEmail: string;\r\n ContactFax: string;\r\n ContactPhone: string;\r\n Country: string;\r\n DBAs: string;\r\n EquipmentItems: Array>;\r\n LastUpdated: string;\r\n ManufacturerTypes: Array<{\r\n Name: string;\r\n }>;\r\n Mfr_CommonName: string;\r\n Mfr_ID: number;\r\n Mfr_Name: string;\r\n OtherManufacturerDetails: string;\r\n PostalCode: string;\r\n PrimaryProduct: string;\r\n PrincipalFirstName: string;\r\n PrincipalLastName: string;\r\n PrincipalPosition: string;\r\n StateProvince: string;\r\n SubmittedName: string;\r\n SubmittedOn: string;\r\n SubmittedPosition: string;\r\n VehicleTypes: Array<{\r\n GVWRFrom: string;\r\n GVWRTo: string;\r\n IsPrimary: boolean;\r\n Name: string;\r\n }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetManufacturerDetails API Action.\r\n *\r\n * @memberof module:api/actions/GetManufacturerDetails\r\n * @alias GetManufacturerDetailsResponse\r\n */\r\nexport type GetManufacturerDetailsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetManufacturerDetails","Fetch","[object Object]","userConfig","super","manufacturer","action","typeofManufacturer","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAcKD,uBACXG,4CAEA,MAAMC,EAAS,yBAGTC,EAAqBC,EAAUH,GACrC,GAA2B,WAAvBE,GAA0D,WAAvBA,EACrC,OAAOE,QAAQC,OACb,IAAIC,MAEA,2GAAIJ,MAAuBF,MAMnC,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAeO,IAGxD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file +{"version":3,"file":"GetManufacturerDetails.js","sources":["../../src/api/actions/GetManufacturerDetails.ts"],"sourcesContent":["/**\n * @module api/actions/GetManufacturerDetails\n * @category Actions\n * @description GetManufacturerDetails NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetManufacturerDetails](module-api_actions_GetManufacturerDetails.GetManufacturerDetails.html)\n * >\n * > **Types**\n * > - Type: [GetManufacturerDetailsResponse](#GetManufacturerDetailsResponse)\n * > - Type: [GetManufacturerDetailsResults](#GetManufacturerDetailsResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetManufacturerDetails extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides the details for a specific manufacturer that is requested.\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name,\n * (it accepts a partial manufacturer name as an input).\n * - Multiple results are returned in case of multiple matches.\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\n * @returns {(Promise)} Api Response object.\n */\n public async GetManufacturerDetails(\n manufacturer: string | number\n ): Promise {\n const action = 'GetManufacturerDetails';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetManufacturerDetailsResponse}.Results' array.\n *\n * @memberof module:api/actions/GetManufacturerDetails\n * @alias GetManufacturerDetailsResults\n */\nexport type GetManufacturerDetailsResults = {\n Address: string;\n Address2: string;\n City: string;\n ContactEmail: string;\n ContactFax: string;\n ContactPhone: string;\n Country: string;\n DBAs: string;\n EquipmentItems: Array>;\n LastUpdated: string;\n ManufacturerTypes: Array<{\n Name: string;\n }>;\n Mfr_CommonName: string;\n Mfr_ID: number;\n Mfr_Name: string;\n OtherManufacturerDetails: string;\n PostalCode: string;\n PrimaryProduct: string;\n PrincipalFirstName: string;\n PrincipalLastName: string;\n PrincipalPosition: string;\n StateProvince: string;\n SubmittedName: string;\n SubmittedOn: string;\n SubmittedPosition: string;\n VehicleTypes: Array<{\n GVWRFrom: string;\n GVWRTo: string;\n IsPrimary: boolean;\n Name: string;\n }>;\n};\n\n/**\n * Type representing the complete response returned by the GetManufacturerDetails API Action.\n *\n * @memberof module:api/actions/GetManufacturerDetails\n * @alias GetManufacturerDetailsResponse\n */\nexport type GetManufacturerDetailsResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetManufacturerDetails","Fetch","[object Object]","userConfig","super","manufacturer","action","typeofManufacturer","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAcKD,uBACXG,4CAEA,MAAMC,EAAS,yBAGTC,EAAqBC,EAAUH,GACrC,GAA2B,WAAvBE,GAA0D,WAAvBA,EACrC,OAAOE,QAAQC,OACb,IAAIC,MAEA,2GAAIJ,MAAuBF,MAMnC,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAeO,IAGxD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file diff --git a/dist/module/GetModelsForMake.js b/dist/module/GetModelsForMake.js index ae919a465..2cbe92b40 100644 --- a/dist/module/GetModelsForMake.js +++ b/dist/module/GetModelsForMake.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class s extends e{constructor(e){super(e)}GetModelsForMake(e){return r(this,void 0,void 0,(function*(){const r="GetModelsForMake",s=t(e);if("string"!==s)return Promise.reject(new Error(`GetModelsForMake, "makeName" argument is required and must be of type string, got: <${s}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{s as GetModelsForMake}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class s extends e{constructor(e){super(e)}GetModelsForMake(e){return r(this,void 0,void 0,(function*(){const r="GetModelsForMake",s=t(e);if("string"!==s)return Promise.reject(new Error(`GetModelsForMake, "makeName" argument is required and must be of type string, got: <${s}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{s as GetModelsForMake}; //# sourceMappingURL=GetModelsForMake.js.map diff --git a/dist/module/GetModelsForMake.js.map b/dist/module/GetModelsForMake.js.map index 35a63b91b..3084ff81c 100644 --- a/dist/module/GetModelsForMake.js.map +++ b/dist/module/GetModelsForMake.js.map @@ -1 +1 @@ -{"version":3,"file":"GetModelsForMake.js","sources":["../../src/api/actions/GetModelsForMake.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetModelsForMake\r\n * @category Actions\r\n * @description GetModelsForMake NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMake](module-api_actions_GetModelsForMake.GetModelsForMake.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeResponse](#GetModelsForMakeResponse)\r\n * > - Type: [GetModelsForMakeResults](#GetModelsForMakeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMake extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified `makeName`\r\n * whose Name is LIKE the Make in vPIC Dataset.\r\n * - `makeName` can be a partial, or a full for more specificity\r\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\r\n *\r\n * @async\r\n * @param {string} makeName - Vehicle make name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMake(makeName: string): Promise {\r\n const action = 'GetModelsForMake';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeName = getTypeof(makeName);\r\n if (typeofMakeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofMakeName}> ${makeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMake\r\n * @alias GetModelsForMakeResults\r\n */\r\nexport type GetModelsForMakeResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMake API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMake\r\n * @alias GetModelsForMakeResponse\r\n */\r\nexport type GetModelsForMakeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetModelsForMake","Fetch","[object Object]","userConfig","super","makeName","action","typeofMakeName","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAyBC,EACpCC,YAAYC,GACVC,MAAMD,GAaFD,iBAAiBG,4CACrB,MAAMC,EAAS,mBAGTC,EAAiBC,EAAUH,GACjC,GAAuB,WAAnBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,uFAAIJ,MAAmBF,MAM/B,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAWO,IAGpD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file +{"version":3,"file":"GetModelsForMake.js","sources":["../../src/api/actions/GetModelsForMake.ts"],"sourcesContent":["/**\n * @module api/actions/GetModelsForMake\n * @category Actions\n * @description GetModelsForMake NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMake](module-api_actions_GetModelsForMake.GetModelsForMake.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeResponse](#GetModelsForMakeResponse)\n * > - Type: [GetModelsForMakeResults](#GetModelsForMakeResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMake extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified `makeName`\n * whose Name is LIKE the Make in vPIC Dataset.\n * - `makeName` can be a partial, or a full for more specificity\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\n *\n * @async\n * @param {string} makeName - Vehicle make name.\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMake(makeName: string): Promise {\n const action = 'GetModelsForMake';\n\n /* Runtime typechecking */\n const typeofMakeName = getTypeof(makeName);\n if (typeofMakeName !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\n `<${typeofMakeName}> ${makeName}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMake\n * @alias GetModelsForMakeResults\n */\nexport type GetModelsForMakeResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMake API Action.\n *\n * @memberof module:api/actions/GetModelsForMake\n * @alias GetModelsForMakeResponse\n */\nexport type GetModelsForMakeResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetModelsForMake","Fetch","[object Object]","userConfig","super","makeName","action","typeofMakeName","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAyBC,EACpCC,YAAYC,GACVC,MAAMD,GAaFD,iBAAiBG,4CACrB,MAAMC,EAAS,mBAGTC,EAAiBC,EAAUH,GACjC,GAAuB,WAAnBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,uFAAIJ,MAAmBF,MAM/B,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAWO,IAGpD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file diff --git a/dist/module/GetModelsForMakeId.js b/dist/module/GetModelsForMakeId.js index db0a9d33f..97de2e1ce 100644 --- a/dist/module/GetModelsForMakeId.js +++ b/dist/module/GetModelsForMakeId.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class o extends e{constructor(e){super(e)}GetModelsForMakeId(e){return r(this,void 0,void 0,(function*(){const r="GetModelsForMakeId",o=t(e);if("number"!==o)return Promise.reject(new Error(`GetModelsForMakeId, "makeId" argument is required and must be of type number, got: <${o}> ${e}`));const s=yield this.buildQueryString({}).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${s}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{o as GetModelsForMakeId}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class o extends e{constructor(e){super(e)}GetModelsForMakeId(e){return r(this,void 0,void 0,(function*(){const r="GetModelsForMakeId",o=t(e);if("number"!==o)return Promise.reject(new Error(`GetModelsForMakeId, "makeId" argument is required and must be of type number, got: <${o}> ${e}`));const s=yield this.buildQueryString({}).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${s}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{o as GetModelsForMakeId}; //# sourceMappingURL=GetModelsForMakeId.js.map diff --git a/dist/module/GetModelsForMakeId.js.map b/dist/module/GetModelsForMakeId.js.map index 9c5157f87..360c601a0 100644 --- a/dist/module/GetModelsForMakeId.js.map +++ b/dist/module/GetModelsForMakeId.js.map @@ -1 +1 @@ -{"version":3,"file":"GetModelsForMakeId.js","sources":["../../src/api/actions/GetModelsForMakeId.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetModelsForMakeId\r\n * @category Actions\r\n * @description GetModelsForMakeId NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeId](module-api_actions_GetModelsForMakeId.GetModelsForMakeId.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeIdResponse](#GetModelsForMakeIdResponse)\r\n * > - Type: [GetModelsForMakeIdResults](#GetModelsForMakeIdResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeId extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Make\r\n * whose Id is equal to the `makeId` in the vPIC Dataset.\r\n *\r\n * @async\r\n * @param {number} makeID - Vehicle make ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeId(\r\n makeID: number\r\n ): Promise {\r\n const action = 'GetModelsForMakeId';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeId = getTypeof(makeID);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeID}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString({}).catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeId\r\n * @alias GetModelsForMakeIdResults\r\n */\r\nexport type GetModelsForMakeIdResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeId API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeId\r\n * @alias GetModelsForMakeIdResponse\r\n */\r\nexport type GetModelsForMakeIdResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetModelsForMakeId","Fetch","[object Object]","userConfig","super","makeID","action","typeofMakeId","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA2BC,EACtCC,YAAYC,GACVC,MAAMD,GAWFD,mBACJG,4CAEA,MAAMC,EAAS,qBAGTC,EAAeC,EAAUH,GAC/B,GAAqB,WAAjBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,uFAAIJ,MAAiBF,MAM7B,MAAMO,QAAoBC,KAAKC,iBAAiB,IAAIC,MAAOC,GACzDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAASO,IAGlD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file +{"version":3,"file":"GetModelsForMakeId.js","sources":["../../src/api/actions/GetModelsForMakeId.ts"],"sourcesContent":["/**\n * @module api/actions/GetModelsForMakeId\n * @category Actions\n * @description GetModelsForMakeId NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMakeId](module-api_actions_GetModelsForMakeId.GetModelsForMakeId.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeIdResponse](#GetModelsForMakeIdResponse)\n * > - Type: [GetModelsForMakeIdResults](#GetModelsForMakeIdResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMakeId extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified Make\n * whose Id is equal to the `makeId` in the vPIC Dataset.\n *\n * @async\n * @param {number} makeID - Vehicle make ID (number).\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMakeId(\n makeID: number\n ): Promise {\n const action = 'GetModelsForMakeId';\n\n /* Runtime typechecking */\n const typeofMakeId = getTypeof(makeID);\n if (typeofMakeId !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\n `<${typeofMakeId}> ${makeID}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString({}).catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMakeId\n * @alias GetModelsForMakeIdResults\n */\nexport type GetModelsForMakeIdResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMakeId API Action.\n *\n * @memberof module:api/actions/GetModelsForMakeId\n * @alias GetModelsForMakeIdResponse\n */\nexport type GetModelsForMakeIdResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetModelsForMakeId","Fetch","[object Object]","userConfig","super","makeID","action","typeofMakeId","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA2BC,EACtCC,YAAYC,GACVC,MAAMD,GAWFD,mBACJG,4CAEA,MAAMC,EAAS,qBAGTC,EAAeC,EAAUH,GAC/B,GAAqB,WAAjBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,uFAAIJ,MAAiBF,MAM7B,MAAMO,QAAoBC,KAAKC,iBAAiB,IAAIC,MAAOC,GACzDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAASO,IAGlD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file diff --git a/dist/module/GetModelsForMakeIdYear.js b/dist/module/GetModelsForMakeIdYear.js index e35098428..e06d8e694 100644 --- a/dist/module/GetModelsForMakeIdYear.js +++ b/dist/module/GetModelsForMakeIdYear.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class o extends e{constructor(e){super(e)}GetModelsForMakeIdYear(e){return r(this,void 0,void 0,(function*(){const r="GetModelsForMakeIdYear",o=null==e?void 0:e.makeId,s=null==e?void 0:e.modelYear,a=null==e?void 0:e.vehicleType,i=t(e);if("object"!==i)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params" argument must be of type object, got: <${i}> ${e}`));const n=t(o);if("number"!==n)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.makeId" argument is required and must be of type number, got: <${n}> ${o}`));if(!s&&!a)return Promise.reject(new Error(`GetModelsForMakeIdYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${s} | ${a}`));const d=t(s);if(s&&"number"!==d)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.modelYear" must be of type number, got: <${d}> ${s}`));const m=t(a);if(a&&"string"!==m)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.vehicleType" must be of type string, got: <${m}> ${a}`));let c=`${r}/makeId/${o}/`;c+=s&&a?`modelYear/${s}/vehicleType/${a}`:s?"modelYear/"+s:"vehicleType/"+a;const l=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),u=`${this.baseUrl}/${c}${l}`;return yield this.get(u).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{o as GetModelsForMakeIdYear}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class o extends e{constructor(e){super(e)}GetModelsForMakeIdYear(e){return r(this,void 0,void 0,(function*(){const r="GetModelsForMakeIdYear",o=null==e?void 0:e.makeId,s=null==e?void 0:e.modelYear,a=null==e?void 0:e.vehicleType,i=t(e);if("object"!==i)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params" argument must be of type object, got: <${i}> ${e}`));const n=t(o);if("number"!==n)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.makeId" argument is required and must be of type number, got: <${n}> ${o}`));if(!s&&!a)return Promise.reject(new Error(`GetModelsForMakeIdYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${s} | ${a}`));const d=t(s);if(s&&"number"!==d)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.modelYear" must be of type number, got: <${d}> ${s}`));const m=t(a);if(a&&"string"!==m)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.vehicleType" must be of type string, got: <${m}> ${a}`));let l=`${r}/makeId/${o}/`;l+=s&&a?`modelYear/${s}/vehicleType/${a}`:s?"modelYear/"+s:"vehicleType/"+a;const c=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),u=`${this.baseUrl}/${l}${c}`;return yield this.get(u).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{o as GetModelsForMakeIdYear}; //# sourceMappingURL=GetModelsForMakeIdYear.js.map diff --git a/dist/module/GetModelsForMakeIdYear.js.map b/dist/module/GetModelsForMakeIdYear.js.map index de6098566..1625f47f8 100644 --- a/dist/module/GetModelsForMakeIdYear.js.map +++ b/dist/module/GetModelsForMakeIdYear.js.map @@ -1 +1 @@ -{"version":3,"file":"GetModelsForMakeIdYear.js","sources":["../../src/api/actions/GetModelsForMakeIdYear.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetModelsForMakeIdYear\r\n * @category Actions\r\n * @description GetModelsForMakeIdYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeIdYear](module-api_actions_GetModelsForMakeIdYear.GetModelsForMakeIdYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeIdYearResponse](#GetModelsForMakeIdYearResponse)\r\n * > - Type: [GetModelsForMakeIdYearResults](#GetModelsForMakeIdYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeIdYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Model Year\r\n * and Make whose name is LIKE the Make in the vPIC Dataset.\r\n * - `params.makeId` is a number and is a required query parameter.\r\n *\r\n * A minimum of one of the following are required (or a combination of both):\r\n * - `params.modelYear` is a number (greater than 1995)\r\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.makeId - Make ID to search.\r\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\r\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeIdYear(params: {\r\n makeId: number;\r\n modelYear?: number;\r\n vehicleType?: string;\r\n }): Promise {\r\n const action = 'GetModelsForMakeIdYear';\r\n\r\n const makeId: number = params?.makeId;\r\n const modelYear: number | undefined = params?.modelYear;\r\n const vehicleType: string | undefined = params?.vehicleType;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n /* Required makeId param of type number */\r\n const typeofMakeId = getTypeof(makeId);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeId}`\r\n )\r\n );\r\n }\r\n /* At least one of modelYear or vehicleType params is required */\r\n if (!modelYear && !vehicleType) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\r\n `${modelYear} | ${vehicleType}`\r\n )\r\n );\r\n }\r\n /* valid modelYear param of type number */\r\n const typeofModelYear = getTypeof(modelYear);\r\n if (modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" must be of type number, got: ` +\r\n `<${typeofModelYear}> ${modelYear}`\r\n )\r\n );\r\n }\r\n /* valid vehicleType param of type string */\r\n const typeofVehicleType = getTypeof(vehicleType);\r\n if (vehicleType && typeofVehicleType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\r\n `<${typeofVehicleType}> ${vehicleType}`\r\n )\r\n );\r\n }\r\n\r\n /* Beginning of the the actionUrl */\r\n let actionUrl = `${action}/makeId/${makeId}/`;\r\n\r\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\r\n if (modelYear && vehicleType) {\r\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\r\n } else if (modelYear) {\r\n actionUrl += `modelYear/${modelYear}`;\r\n } else {\r\n actionUrl += `vehicleType/${vehicleType}`;\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeIdYear\r\n * @alias GetModelsForMakeIdYearResults\r\n */\r\nexport type GetModelsForMakeIdYearResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeIdYear API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeIdYear\r\n * @alias GetModelsForMakeIdYearResponse\r\n */\r\nexport type GetModelsForMakeIdYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetModelsForMakeIdYear","Fetch","[object Object]","userConfig","super","params","action","makeId","modelYear","vehicleType","typeofParams","getTypeof","Promise","reject","Error","typeofMakeId","typeofModelYear","typeofVehicleType","actionUrl","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAoBFD,uBAAuBG,4CAK3B,MAAMC,EAAS,yBAETC,EAAiBF,MAAAA,SAAAA,EAAQE,OACzBC,EAAgCH,MAAAA,SAAAA,EAAQG,UACxCC,EAAkCJ,MAAAA,SAAAA,EAAQI,YAG1CC,EAAeC,EAAUN,GAC/B,GAAqB,WAAjBK,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,2EAAIJ,MAAiBL,MAK7B,MAAMU,EAAeJ,EAAUJ,GAC/B,GAAqB,WAAjBQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,kGAAIC,MAAiBR,MAK7B,IAAKC,IAAcC,EACjB,OAAOG,QAAQC,OACb,IAAIC,MAEA,sGAAGN,OAAeC,MAK1B,MAAMO,EAAkBL,EAAUH,GAClC,GAAIA,GAAiC,WAApBQ,EACf,OAAOJ,QAAQC,OACb,IAAIC,MAEA,4EAAIE,MAAoBR,MAKhC,MAAMS,EAAoBN,EAAUF,GACpC,GAAIA,GAAqC,WAAtBQ,EACjB,OAAOL,QAAQC,OACb,IAAIC,MAEA,8EAAIG,MAAsBR,MAMlC,IAAIS,EAAY,GAAGZ,YAAiBC,KAIlCW,GADEV,GAAaC,EACF,aAAaD,iBAAyBC,IAC1CD,EACI,aAAaA,EAEb,eAAeC,EAI9B,MAAMU,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDX,QAAQC,OACN,IAAIC,MAAM,GAAGR,mCAAwCiB,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWP,IAAYC,IAG3C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNX,QAAQC,OAAO,IAAIC,MAAM,GAAGR,yBAA8BiB"} \ No newline at end of file +{"version":3,"file":"GetModelsForMakeIdYear.js","sources":["../../src/api/actions/GetModelsForMakeIdYear.ts"],"sourcesContent":["/**\n * @module api/actions/GetModelsForMakeIdYear\n * @category Actions\n * @description GetModelsForMakeIdYear NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMakeIdYear](module-api_actions_GetModelsForMakeIdYear.GetModelsForMakeIdYear.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeIdYearResponse](#GetModelsForMakeIdYearResponse)\n * > - Type: [GetModelsForMakeIdYearResults](#GetModelsForMakeIdYearResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMakeIdYear extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified Model Year\n * and Make whose name is LIKE the Make in the vPIC Dataset.\n * - `params.makeId` is a number and is a required query parameter.\n *\n * A minimum of one of the following are required (or a combination of both):\n * - `params.modelYear` is a number (greater than 1995)\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\n *\n * @async\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {number} params.makeId - Make ID to search.\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMakeIdYear(params: {\n makeId: number;\n modelYear?: number;\n vehicleType?: string;\n }): Promise {\n const action = 'GetModelsForMakeIdYear';\n\n const makeId: number = params?.makeId;\n const modelYear: number | undefined = params?.modelYear;\n const vehicleType: string | undefined = params?.vehicleType;\n\n /* Valid params object */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n /* Required makeId param of type number */\n const typeofMakeId = getTypeof(makeId);\n if (typeofMakeId !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.makeId\" argument is required and must be of type number, got: ` +\n `<${typeofMakeId}> ${makeId}`\n )\n );\n }\n /* At least one of modelYear or vehicleType params is required */\n if (!modelYear && !vehicleType) {\n return Promise.reject(\n new Error(\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\n `${modelYear} | ${vehicleType}`\n )\n );\n }\n /* valid modelYear param of type number */\n const typeofModelYear = getTypeof(modelYear);\n if (modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" must be of type number, got: ` +\n `<${typeofModelYear}> ${modelYear}`\n )\n );\n }\n /* valid vehicleType param of type string */\n const typeofVehicleType = getTypeof(vehicleType);\n if (vehicleType && typeofVehicleType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\n `<${typeofVehicleType}> ${vehicleType}`\n )\n );\n }\n\n /* Beginning of the the actionUrl */\n let actionUrl = `${action}/makeId/${makeId}/`;\n\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\n if (modelYear && vehicleType) {\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\n } else if (modelYear) {\n actionUrl += `modelYear/${modelYear}`;\n } else {\n actionUrl += `vehicleType/${vehicleType}`;\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdYearResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMakeIdYear\n * @alias GetModelsForMakeIdYearResults\n */\nexport type GetModelsForMakeIdYearResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMakeIdYear API Action.\n *\n * @memberof module:api/actions/GetModelsForMakeIdYear\n * @alias GetModelsForMakeIdYearResponse\n */\nexport type GetModelsForMakeIdYearResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetModelsForMakeIdYear","Fetch","[object Object]","userConfig","super","params","action","makeId","modelYear","vehicleType","typeofParams","getTypeof","Promise","reject","Error","typeofMakeId","typeofModelYear","typeofVehicleType","actionUrl","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAoBFD,uBAAuBG,4CAK3B,MAAMC,EAAS,yBAETC,EAAiBF,MAAAA,SAAAA,EAAQE,OACzBC,EAAgCH,MAAAA,SAAAA,EAAQG,UACxCC,EAAkCJ,MAAAA,SAAAA,EAAQI,YAG1CC,EAAeC,EAAUN,GAC/B,GAAqB,WAAjBK,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,2EAAIJ,MAAiBL,MAK7B,MAAMU,EAAeJ,EAAUJ,GAC/B,GAAqB,WAAjBQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,kGAAIC,MAAiBR,MAK7B,IAAKC,IAAcC,EACjB,OAAOG,QAAQC,OACb,IAAIC,MAEA,sGAAGN,OAAeC,MAK1B,MAAMO,EAAkBL,EAAUH,GAClC,GAAIA,GAAiC,WAApBQ,EACf,OAAOJ,QAAQC,OACb,IAAIC,MAEA,4EAAIE,MAAoBR,MAKhC,MAAMS,EAAoBN,EAAUF,GACpC,GAAIA,GAAqC,WAAtBQ,EACjB,OAAOL,QAAQC,OACb,IAAIC,MAEA,8EAAIG,MAAsBR,MAMlC,IAAIS,EAAY,GAAGZ,YAAiBC,KAIlCW,GADEV,GAAaC,EACF,aAAaD,iBAAyBC,IAC1CD,EACI,aAAaA,EAEb,eAAeC,EAI9B,MAAMU,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDX,QAAQC,OACN,IAAIC,MAAM,GAAGR,mCAAwCiB,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWP,IAAYC,IAG3C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNX,QAAQC,OAAO,IAAIC,MAAM,GAAGR,yBAA8BiB"} \ No newline at end of file diff --git a/dist/module/GetModelsForMakeYear.js b/dist/module/GetModelsForMakeYear.js index 991791ea0..d09a74e68 100644 --- a/dist/module/GetModelsForMakeYear.js +++ b/dist/module/GetModelsForMakeYear.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class o extends e{constructor(e){super(e)}GetModelsForMakeYear(e){return r(this,void 0,void 0,(function*(){const r="GetModelsForMakeYear",o=null==e?void 0:e.make,s=null==e?void 0:e.modelYear,a=null==e?void 0:e.vehicleType,i=t(e);if("object"!==i)return Promise.reject(new Error(`GetModelsForMakeYear, "params" argument must be of type object, got: <${i}> ${e}`));const n=t(o);if("string"!==n)return Promise.reject(new Error(`GetModelsForMakeYear, "params.make" argument is required and must be of type string, got: <${n}> ${o}`));if(!s&&!a)return Promise.reject(new Error(`GetModelsForMakeYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${s} | ${a}`));const m=t(s);if(s&&"number"!==m)return Promise.reject(new Error(`GetModelsForMakeYear, "params.modelYear" must be of type number, got: <${m}> ${s}`));const c=t(a);if(a&&"string"!==c)return Promise.reject(new Error(`GetModelsForMakeYear, "params.vehicleType" must be of type string, got: <${c}> ${a}`));let l=`${r}/make/${e.make}/`;l+=s&&a?`modelYear/${s}/vehicleType/${a}`:s?"modelYear/"+s:"vehicleType/"+a;const u=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),d=`${this.baseUrl}/${l}${u}`;return yield this.get(d).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{o as GetModelsForMakeYear}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class o extends e{constructor(e){super(e)}GetModelsForMakeYear(e){return r(this,void 0,void 0,(function*(){const r="GetModelsForMakeYear",o=null==e?void 0:e.make,s=null==e?void 0:e.modelYear,a=null==e?void 0:e.vehicleType,i=t(e);if("object"!==i)return Promise.reject(new Error(`GetModelsForMakeYear, "params" argument must be of type object, got: <${i}> ${e}`));const n=t(o);if("string"!==n)return Promise.reject(new Error(`GetModelsForMakeYear, "params.make" argument is required and must be of type string, got: <${n}> ${o}`));if(!s&&!a)return Promise.reject(new Error(`GetModelsForMakeYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${s} | ${a}`));const m=t(s);if(s&&"number"!==m)return Promise.reject(new Error(`GetModelsForMakeYear, "params.modelYear" must be of type number, got: <${m}> ${s}`));const l=t(a);if(a&&"string"!==l)return Promise.reject(new Error(`GetModelsForMakeYear, "params.vehicleType" must be of type string, got: <${l}> ${a}`));let c=`${r}/make/${e.make}/`;c+=s&&a?`modelYear/${s}/vehicleType/${a}`:s?"modelYear/"+s:"vehicleType/"+a;const u=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),d=`${this.baseUrl}/${c}${u}`;return yield this.get(d).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{o as GetModelsForMakeYear}; //# sourceMappingURL=GetModelsForMakeYear.js.map diff --git a/dist/module/GetModelsForMakeYear.js.map b/dist/module/GetModelsForMakeYear.js.map index 706f76935..a01c8099f 100644 --- a/dist/module/GetModelsForMakeYear.js.map +++ b/dist/module/GetModelsForMakeYear.js.map @@ -1 +1 @@ -{"version":3,"file":"GetModelsForMakeYear.js","sources":["../../src/api/actions/GetModelsForMakeYear.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetModelsForMakeYear\r\n * @category Actions\r\n * @description GetModelsForMakeYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeYear](module-api_actions_GetModelsForMakeYear.GetModelsForMakeYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeYearResponse](#GetModelsForMakeYearResponse)\r\n * > - Type: [GetModelsForMakeYearResults](#GetModelsForMakeYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Model Year\r\n * and Make whose name is LIKE the Make in the vPIC Dataset.\r\n * - `params.make` is required. It can be a partial, or a full name for more specificity\r\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\r\n *\r\n * A minimum of one of the following are required (or a combination of both):\r\n * - `params.modelYear` is a number (greater than 1995)\r\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n *\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {string} params.make - Make name to search.\r\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\r\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\r\n *\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeYear(params: {\r\n make: string;\r\n modelYear?: number;\r\n vehicleType?: string;\r\n }): Promise {\r\n const action = 'GetModelsForMakeYear';\r\n\r\n const make: string = params?.make;\r\n const modelYear: number | undefined = params?.modelYear;\r\n const vehicleType: string | undefined = params?.vehicleType;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n /* Required make param of type string */\r\n const typeofMake = getTypeof(make);\r\n if (typeofMake !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.make\" argument is required and must be of type string, got: ` +\r\n `<${typeofMake}> ${make}`\r\n )\r\n );\r\n }\r\n /* At least one of modelYear or vehicleType params is required */\r\n if (!modelYear && !vehicleType) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\r\n `${modelYear} | ${vehicleType}`\r\n )\r\n );\r\n }\r\n /* valid modelYear param of type number */\r\n const typeofModelYear = getTypeof(modelYear);\r\n if (modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" must be of type number, got: ` +\r\n `<${typeofModelYear}> ${modelYear}`\r\n )\r\n );\r\n }\r\n /* valid vehicleType param of type string */\r\n const typeofVehicleType = getTypeof(vehicleType);\r\n if (vehicleType && typeofVehicleType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\r\n `<${typeofVehicleType}> ${vehicleType}`\r\n )\r\n );\r\n }\r\n\r\n /* Beginning of the the actionUrl */\r\n let actionUrl = `${action}/make/${params.make}/`;\r\n\r\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\r\n if (modelYear && vehicleType) {\r\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\r\n } else if (modelYear) {\r\n actionUrl += `modelYear/${modelYear}`;\r\n } else {\r\n actionUrl += `vehicleType/${vehicleType}`;\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeYear\r\n * @alias GetModelsForMakeYearResults\r\n */\r\nexport type GetModelsForMakeYearResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeYear API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeYear\r\n * @alias GetModelsForMakeYearResponse\r\n */\r\nexport type GetModelsForMakeYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetModelsForMakeYear","Fetch","[object Object]","userConfig","super","params","action","make","modelYear","vehicleType","typeofParams","getTypeof","Promise","reject","Error","typeofMake","typeofModelYear","typeofVehicleType","actionUrl","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA6BC,EACxCC,YAAYC,GACVC,MAAMD,GAuBFD,qBAAqBG,4CAKzB,MAAMC,EAAS,uBAETC,EAAeF,MAAAA,SAAAA,EAAQE,KACvBC,EAAgCH,MAAAA,SAAAA,EAAQG,UACxCC,EAAkCJ,MAAAA,SAAAA,EAAQI,YAG1CC,EAAeC,EAAUN,GAC/B,GAAqB,WAAjBK,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,yEAAIJ,MAAiBL,MAK7B,MAAMU,EAAaJ,EAAUJ,GAC7B,GAAmB,WAAfQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,8FAAIC,MAAeR,MAK3B,IAAKC,IAAcC,EACjB,OAAOG,QAAQC,OACb,IAAIC,MAEA,oGAAGN,OAAeC,MAK1B,MAAMO,EAAkBL,EAAUH,GAClC,GAAIA,GAAiC,WAApBQ,EACf,OAAOJ,QAAQC,OACb,IAAIC,MAEA,0EAAIE,MAAoBR,MAKhC,MAAMS,EAAoBN,EAAUF,GACpC,GAAIA,GAAqC,WAAtBQ,EACjB,OAAOL,QAAQC,OACb,IAAIC,MAEA,4EAAIG,MAAsBR,MAMlC,IAAIS,EAAY,GAAGZ,UAAeD,EAAOE,QAIvCW,GADEV,GAAaC,EACF,aAAaD,iBAAyBC,IAC1CD,EACI,aAAaA,EAEb,eAAeC,EAI9B,MAAMU,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDX,QAAQC,OACN,IAAIC,MAAM,GAAGR,mCAAwCiB,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWP,IAAYC,IAG3C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNX,QAAQC,OAAO,IAAIC,MAAM,GAAGR,yBAA8BiB"} \ No newline at end of file +{"version":3,"file":"GetModelsForMakeYear.js","sources":["../../src/api/actions/GetModelsForMakeYear.ts"],"sourcesContent":["/**\n * @module api/actions/GetModelsForMakeYear\n * @category Actions\n * @description GetModelsForMakeYear NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetModelsForMakeYear](module-api_actions_GetModelsForMakeYear.GetModelsForMakeYear.html)\n * >\n * > **Types**\n * > - Type: [GetModelsForMakeYearResponse](#GetModelsForMakeYearResponse)\n * > - Type: [GetModelsForMakeYearResults](#GetModelsForMakeYearResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetModelsForMakeYear extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns the Models in the vPIC dataset for a specified Model Year\n * and Make whose name is LIKE the Make in the vPIC Dataset.\n * - `params.make` is required. It can be a partial, or a full name for more specificity\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\n *\n * A minimum of one of the following are required (or a combination of both):\n * - `params.modelYear` is a number (greater than 1995)\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\n *\n * @async\n *\n * @param {object} params - Query Search Parameters to append to the URL.\n * @param {string} params.make - Make name to search.\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\n *\n * @returns {(Promise)} Api Response object.\n */\n async GetModelsForMakeYear(params: {\n make: string;\n modelYear?: number;\n vehicleType?: string;\n }): Promise {\n const action = 'GetModelsForMakeYear';\n\n const make: string = params?.make;\n const modelYear: number | undefined = params?.modelYear;\n const vehicleType: string | undefined = params?.vehicleType;\n\n /* Valid params object */\n const typeofParams = getTypeof(params);\n if (typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: ` +\n `<${typeofParams}> ${params}`\n )\n );\n }\n /* Required make param of type string */\n const typeofMake = getTypeof(make);\n if (typeofMake !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.make\" argument is required and must be of type string, got: ` +\n `<${typeofMake}> ${make}`\n )\n );\n }\n /* At least one of modelYear or vehicleType params is required */\n if (!modelYear && !vehicleType) {\n return Promise.reject(\n new Error(\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\n `${modelYear} | ${vehicleType}`\n )\n );\n }\n /* valid modelYear param of type number */\n const typeofModelYear = getTypeof(modelYear);\n if (modelYear && typeofModelYear !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.modelYear\" must be of type number, got: ` +\n `<${typeofModelYear}> ${modelYear}`\n )\n );\n }\n /* valid vehicleType param of type string */\n const typeofVehicleType = getTypeof(vehicleType);\n if (vehicleType && typeofVehicleType !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\n `<${typeofVehicleType}> ${vehicleType}`\n )\n );\n }\n\n /* Beginning of the the actionUrl */\n let actionUrl = `${action}/make/${params.make}/`;\n\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\n if (modelYear && vehicleType) {\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\n } else if (modelYear) {\n actionUrl += `modelYear/${modelYear}`;\n } else {\n actionUrl += `vehicleType/${vehicleType}`;\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err: Error) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err: Error) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetModelsForMakeYearResponse}.Results' array.\n *\n * @memberof module:api/actions/GetModelsForMakeYear\n * @alias GetModelsForMakeYearResults\n */\nexport type GetModelsForMakeYearResults = {\n Make_ID: number;\n Make_Name: string;\n Model_ID: number;\n Model_Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetModelsForMakeYear API Action.\n *\n * @memberof module:api/actions/GetModelsForMakeYear\n * @alias GetModelsForMakeYearResponse\n */\nexport type GetModelsForMakeYearResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetModelsForMakeYear","Fetch","[object Object]","userConfig","super","params","action","make","modelYear","vehicleType","typeofParams","getTypeof","Promise","reject","Error","typeofMake","typeofModelYear","typeofVehicleType","actionUrl","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA6BC,EACxCC,YAAYC,GACVC,MAAMD,GAuBFD,qBAAqBG,4CAKzB,MAAMC,EAAS,uBAETC,EAAeF,MAAAA,SAAAA,EAAQE,KACvBC,EAAgCH,MAAAA,SAAAA,EAAQG,UACxCC,EAAkCJ,MAAAA,SAAAA,EAAQI,YAG1CC,EAAeC,EAAUN,GAC/B,GAAqB,WAAjBK,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,yEAAIJ,MAAiBL,MAK7B,MAAMU,EAAaJ,EAAUJ,GAC7B,GAAmB,WAAfQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,8FAAIC,MAAeR,MAK3B,IAAKC,IAAcC,EACjB,OAAOG,QAAQC,OACb,IAAIC,MAEA,oGAAGN,OAAeC,MAK1B,MAAMO,EAAkBL,EAAUH,GAClC,GAAIA,GAAiC,WAApBQ,EACf,OAAOJ,QAAQC,OACb,IAAIC,MAEA,0EAAIE,MAAoBR,MAKhC,MAAMS,EAAoBN,EAAUF,GACpC,GAAIA,GAAqC,WAAtBQ,EACjB,OAAOL,QAAQC,OACb,IAAIC,MAEA,4EAAIG,MAAsBR,MAMlC,IAAIS,EAAY,GAAGZ,UAAeD,EAAOE,QAIvCW,GADEV,GAAaC,EACF,aAAaD,iBAAyBC,IAC1CD,EACI,aAAaA,EAEb,eAAeC,EAI9B,MAAMU,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDX,QAAQC,OACN,IAAIC,MAAM,GAAGR,mCAAwCiB,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWP,IAAYC,IAG3C,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNX,QAAQC,OAAO,IAAIC,MAAM,GAAGR,yBAA8BiB"} \ No newline at end of file diff --git a/dist/module/GetParts.js b/dist/module/GetParts.js index 83fdb247b..3f4645934 100644 --- a/dist/module/GetParts.js +++ b/dist/module/GetParts.js @@ -1,2 +1,2 @@ -import{F as r,_ as e,g as t}from"./Fetch-b3914c0a.js";class o extends r{constructor(r){super(r)}GetParts(r){return e(this,void 0,void 0,(function*(){const e="GetParts",o=null==r?void 0:r.type,n=null==r?void 0:r.fromDate,s=null==r?void 0:r.toDate,i=null==r?void 0:r.page,u=t(r);if(r&&"object"!==u)return Promise.reject(new Error(`${e}, "params" argument must be of type object, got: <${u}> ${r}`));const a=t(o);if(o&&"number"!==a)return Promise.reject(new Error(`${e}, "params.type" argument must be of type number, got: <${a}> ${o}`));const m=t(n);if(n&&"string"!==m)return Promise.reject(new Error(`${e}, "params.fromDate" argument must be of type string, got: <${m}> ${n}`));const c=t(s);if(s&&"string"!==c)return Promise.reject(new Error(`${e}, "params.toDate" argument must be of type string, got: <${c}> ${s}`));const g=t(i);if(i&&"number"!==g)return Promise.reject(new Error(`${e}, "params.page" argument must be of type number, got: <${g}> ${i}`));const $=yield this.buildQueryString(r).catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),p=`${this.baseUrl}/${e}${$}`;return yield this.get(p).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{o as GetParts}; +import{F as r,_ as e,g as t}from"./Fetch-44aa28fd.js";class o extends r{constructor(r){super(r)}GetParts(r){return e(this,void 0,void 0,(function*(){const e="GetParts",o=null==r?void 0:r.type,n=null==r?void 0:r.fromDate,s=null==r?void 0:r.toDate,i=null==r?void 0:r.page,a=t(r);if(r&&"object"!==a)return Promise.reject(new Error(`${e}, "params" argument must be of type object, got: <${a}> ${r}`));const u=t(o);if(o&&"number"!==u)return Promise.reject(new Error(`${e}, "params.type" argument must be of type number, got: <${u}> ${o}`));const m=t(n);if(n&&"string"!==m)return Promise.reject(new Error(`${e}, "params.fromDate" argument must be of type string, got: <${m}> ${n}`));const c=t(s);if(s&&"string"!==c)return Promise.reject(new Error(`${e}, "params.toDate" argument must be of type string, got: <${c}> ${s}`));const g=t(i);if(i&&"number"!==g)return Promise.reject(new Error(`${e}, "params.page" argument must be of type number, got: <${g}> ${i}`));const $=yield this.buildQueryString(r).catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),p=`${this.baseUrl}/${e}${$}`;return yield this.get(p).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{o as GetParts}; //# sourceMappingURL=GetParts.js.map diff --git a/dist/module/GetParts.js.map b/dist/module/GetParts.js.map index 9645ca34b..f2a3d86e2 100644 --- a/dist/module/GetParts.js.map +++ b/dist/module/GetParts.js.map @@ -1 +1 @@ -{"version":3,"file":"GetParts.js","sources":["../../src/api/actions/GetParts.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetParts\r\n * @category Actions\r\n * @description GetParts NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetParts](module-api_actions_GetParts.GetParts.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetPartsResponse](#GetPartsResponse)\r\n * > - Type: [GetPartsResults](#GetPartsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetParts extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of ORGs with letter date in the given range of the dates\r\n * and with specified Type (`params.type`) of ORG.\r\n * - Up to 1000 results will be returned at a time.\r\n * - Get the next page by incrementing the `params.page` query parameter.\r\n * - All query `params` are optional.\r\n *\r\n * @async\r\n * @param {object} [params] - Query Search Parameters to append to the URL.\r\n * @param {number} [params.type] - Specified type of ORG to search.\r\n * @param {string} [params.fromDate] - Start date of search query.\r\n * @param {string} [params.toDate] - End date of search query.\r\n * @param {number} [params.page] - Which page number of results to request (100 results per page).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetParts(params?: {\r\n type?: number;\r\n fromDate?: string;\r\n toDate?: string;\r\n page?: number;\r\n }): Promise {\r\n const action = 'GetParts';\r\n\r\n const type: number | undefined = params?.type;\r\n const fromDate: string | undefined = params?.fromDate;\r\n const toDate: string | undefined = params?.toDate;\r\n const page: number | undefined = params?.page;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: <${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.type of type number */\r\n const typeofType = getTypeof(type);\r\n if (type && typeofType !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.type\" argument must be of type number, got: <${typeofType}> ${type}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.fromDate of type string */\r\n const typeofFromDate = getTypeof(fromDate);\r\n if (fromDate && typeofFromDate !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.fromDate\" argument must be of type string, got: <${typeofFromDate}> ${fromDate}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.toDate of type number */\r\n const typeofToDate = getTypeof(toDate);\r\n if (toDate && typeofToDate !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.toDate\" argument must be of type string, got: <${typeofToDate}> ${toDate}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.page of type number */\r\n const typeofPage = getTypeof(page);\r\n if (page && typeofPage !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.page\" argument must be of type number, got: <${typeofPage}> ${page}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetPartsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetParts\r\n * @alias GetPartsResults\r\n */\r\nexport type GetPartsResults = {\r\n CoverLetterURL: string;\r\n LetterDate: string;\r\n ManufacturerId: number;\r\n ManufacturerName: string;\r\n ModelYearFrom: string;\r\n ModelYearTo: string;\r\n Name: string;\r\n Type: string;\r\n URL: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetParts API Action.\r\n *\r\n * @memberof module:api/actions/GetParts\r\n * @alias GetPartsResponse\r\n */\r\nexport type GetPartsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetParts","Fetch","[object Object]","userConfig","super","params","action","type","fromDate","toDate","page","typeofParams","getTypeof","Promise","reject","Error","typeofType","typeofFromDate","typeofToDate","typeofPage","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAiBC,EAC5BC,YAAYC,GACVC,MAAMD,GAkBFD,SAASG,4CAMb,MAAMC,EAAS,WAETC,EAA2BF,MAAAA,SAAAA,EAAQE,KACnCC,EAA+BH,MAAAA,SAAAA,EAAQG,SACvCC,EAA6BJ,MAAAA,SAAAA,EAAQI,OACrCC,EAA2BL,MAAAA,SAAAA,EAAQK,KAGnCC,EAAeC,EAAUP,GAC/B,GAAIA,GAA2B,WAAjBM,EACZ,OAAOE,QAAQC,OACb,IAAIC,MACF,GAAGT,sDAA2DK,MAAiBN,MAMrF,MAAMW,EAAaJ,EAAUL,GAC7B,GAAIA,GAAuB,WAAfS,EACV,OAAOH,QAAQC,OACb,IAAIC,MACF,GAAGT,2DAAgEU,MAAeT,MAMxF,MAAMU,EAAiBL,EAAUJ,GACjC,GAAIA,GAA+B,WAAnBS,EACd,OAAOJ,QAAQC,OACb,IAAIC,MACF,GAAGT,+DAAoEW,MAAmBT,MAMhG,MAAMU,EAAeN,EAAUH,GAC/B,GAAIA,GAA2B,WAAjBS,EACZ,OAAOL,QAAQC,OACb,IAAIC,MACF,GAAGT,6DAAkEY,MAAiBT,MAM5F,MAAMU,EAAaP,EAAUF,GAC7B,GAAIA,GAAuB,WAAfS,EACV,OAAON,QAAQC,OACb,IAAIC,MACF,GAAGT,2DAAgEa,MAAeT,MAMxF,MAAMU,QAAoBC,KAAKC,iBAAiBjB,GAAQkB,MAAOC,GAC7DX,QAAQC,OACN,IAAIC,MAAM,GAAGT,mCAAwCkB,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWpB,IAASc,IAGxC,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNX,QAAQC,OAAO,IAAIC,MAAM,GAAGT,yBAA8BkB"} \ No newline at end of file +{"version":3,"file":"GetParts.js","sources":["../../src/api/actions/GetParts.ts"],"sourcesContent":["/**\n * @module api/actions/GetParts\n * @category Actions\n * @description GetParts NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetParts](module-api_actions_GetParts.GetParts.html)\n * >\n * > **Types**\n * > - Type: [GetPartsResponse](#GetPartsResponse)\n * > - Type: [GetPartsResults](#GetPartsResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetParts extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of ORGs with letter date in the given range of the dates\n * and with specified Type (`params.type`) of ORG.\n * - Up to 1000 results will be returned at a time.\n * - Get the next page by incrementing the `params.page` query parameter.\n * - All query `params` are optional.\n *\n * @async\n * @param {object} [params] - Query Search Parameters to append to the URL.\n * @param {number} [params.type] - Specified type of ORG to search.\n * @param {string} [params.fromDate] - Start date of search query.\n * @param {string} [params.toDate] - End date of search query.\n * @param {number} [params.page] - Which page number of results to request (100 results per page).\n * @returns {(Promise)} Api Response object.\n */\n async GetParts(params?: {\n type?: number;\n fromDate?: string;\n toDate?: string;\n page?: number;\n }): Promise {\n const action = 'GetParts';\n\n const type: number | undefined = params?.type;\n const fromDate: string | undefined = params?.fromDate;\n const toDate: string | undefined = params?.toDate;\n const page: number | undefined = params?.page;\n\n /* Valid params object */\n const typeofParams = getTypeof(params);\n if (params && typeofParams !== 'object') {\n return Promise.reject(\n new Error(\n `${action}, \"params\" argument must be of type object, got: <${typeofParams}> ${params}`\n )\n );\n }\n\n /* valid params.type of type number */\n const typeofType = getTypeof(type);\n if (type && typeofType !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.type\" argument must be of type number, got: <${typeofType}> ${type}`\n )\n );\n }\n\n /* valid params.fromDate of type string */\n const typeofFromDate = getTypeof(fromDate);\n if (fromDate && typeofFromDate !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.fromDate\" argument must be of type string, got: <${typeofFromDate}> ${fromDate}`\n )\n );\n }\n\n /* valid params.toDate of type number */\n const typeofToDate = getTypeof(toDate);\n if (toDate && typeofToDate !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"params.toDate\" argument must be of type string, got: <${typeofToDate}> ${toDate}`\n )\n );\n }\n\n /* valid params.page of type number */\n const typeofPage = getTypeof(page);\n if (page && typeofPage !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"params.page\" argument must be of type number, got: <${typeofPage}> ${page}`\n )\n );\n }\n\n /* Build the query string to be appended to the URL*/\n const queryString = await this.buildQueryString(params).catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetPartsResponse}.Results' array.\n *\n * @memberof module:api/actions/GetParts\n * @alias GetPartsResults\n */\nexport type GetPartsResults = {\n CoverLetterURL: string;\n LetterDate: string;\n ManufacturerId: number;\n ManufacturerName: string;\n ModelYearFrom: string;\n ModelYearTo: string;\n Name: string;\n Type: string;\n URL: string;\n};\n\n/**\n * Type representing the complete response returned by the GetParts API Action.\n *\n * @memberof module:api/actions/GetParts\n * @alias GetPartsResponse\n */\nexport type GetPartsResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetParts","Fetch","[object Object]","userConfig","super","params","action","type","fromDate","toDate","page","typeofParams","getTypeof","Promise","reject","Error","typeofType","typeofFromDate","typeofToDate","typeofPage","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAiBC,EAC5BC,YAAYC,GACVC,MAAMD,GAkBFD,SAASG,4CAMb,MAAMC,EAAS,WAETC,EAA2BF,MAAAA,SAAAA,EAAQE,KACnCC,EAA+BH,MAAAA,SAAAA,EAAQG,SACvCC,EAA6BJ,MAAAA,SAAAA,EAAQI,OACrCC,EAA2BL,MAAAA,SAAAA,EAAQK,KAGnCC,EAAeC,EAAUP,GAC/B,GAAIA,GAA2B,WAAjBM,EACZ,OAAOE,QAAQC,OACb,IAAIC,MACF,GAAGT,sDAA2DK,MAAiBN,MAMrF,MAAMW,EAAaJ,EAAUL,GAC7B,GAAIA,GAAuB,WAAfS,EACV,OAAOH,QAAQC,OACb,IAAIC,MACF,GAAGT,2DAAgEU,MAAeT,MAMxF,MAAMU,EAAiBL,EAAUJ,GACjC,GAAIA,GAA+B,WAAnBS,EACd,OAAOJ,QAAQC,OACb,IAAIC,MACF,GAAGT,+DAAoEW,MAAmBT,MAMhG,MAAMU,EAAeN,EAAUH,GAC/B,GAAIA,GAA2B,WAAjBS,EACZ,OAAOL,QAAQC,OACb,IAAIC,MACF,GAAGT,6DAAkEY,MAAiBT,MAM5F,MAAMU,EAAaP,EAAUF,GAC7B,GAAIA,GAAuB,WAAfS,EACV,OAAON,QAAQC,OACb,IAAIC,MACF,GAAGT,2DAAgEa,MAAeT,MAMxF,MAAMU,QAAoBC,KAAKC,iBAAiBjB,GAAQkB,MAAOC,GAC7DX,QAAQC,OACN,IAAIC,MAAM,GAAGT,mCAAwCkB,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWpB,IAASc,IAGxC,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNX,QAAQC,OAAO,IAAIC,MAAM,GAAGT,yBAA8BkB"} \ No newline at end of file diff --git a/dist/module/GetVehicleTypesForMake.js b/dist/module/GetVehicleTypesForMake.js index 2bf19cdca..ada7ba700 100644 --- a/dist/module/GetVehicleTypesForMake.js +++ b/dist/module/GetVehicleTypesForMake.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class s extends e{constructor(e){super(e)}GetVehicleTypesForMake(e){return r(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMake",s=t(e);if("string"!==s)return Promise.reject(new Error(`GetVehicleTypesForMake, "makeName" argument is required and must be of type string, got: <${s}> ${e}`));const i=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),o=`${this.baseUrl}/${r}/${e}${i}`;return yield this.get(o).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{s as GetVehicleTypesForMake}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class s extends e{constructor(e){super(e)}GetVehicleTypesForMake(e){return r(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMake",s=t(e);if("string"!==s)return Promise.reject(new Error(`GetVehicleTypesForMake, "makeName" argument is required and must be of type string, got: <${s}> ${e}`));const i=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),o=`${this.baseUrl}/${r}/${e}${i}`;return yield this.get(o).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{s as GetVehicleTypesForMake}; //# sourceMappingURL=GetVehicleTypesForMake.js.map diff --git a/dist/module/GetVehicleTypesForMake.js.map b/dist/module/GetVehicleTypesForMake.js.map index 64ade4295..faebc909f 100644 --- a/dist/module/GetVehicleTypesForMake.js.map +++ b/dist/module/GetVehicleTypesForMake.js.map @@ -1 +1 @@ -{"version":3,"file":"GetVehicleTypesForMake.js","sources":["../../src/api/actions/GetVehicleTypesForMake.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetVehicleTypesForMake\r\n * @category Actions\r\n * @description GetVehicleTypesForMake NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleTypesForMake](module-api_actions_GetVehicleTypesForMake.GetVehicleTypesForMake.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleTypesForMakeResponse](#GetVehicleTypesForMakeResponse)\r\n * > - Type: [GetVehicleTypesForMakeResults](#GetVehicleTypesForMakeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleTypesForMake extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make,\r\n * whose name is LIKE the make name in the vPIC Dataset.\r\n * - `makeName` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\r\n *\r\n * @async\r\n * @param {string} makeName - Name of the vehicle make to search.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleTypesForMake(\r\n makeName: string\r\n ): Promise {\r\n const action = 'GetVehicleTypesForMake';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeName = getTypeof(makeName);\r\n if (typeofMakeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofMakeName}> ${makeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMake\r\n * @alias GetVehicleTypesForMakeResults\r\n */\r\nexport type GetVehicleTypesForMakeResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleTypesForMake API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMake\r\n * @alias GetVehicleTypesForMakeResponse\r\n */\r\nexport type GetVehicleTypesForMakeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetVehicleTypesForMake","Fetch","[object Object]","userConfig","super","makeName","action","typeofMakeName","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAaFD,uBACJG,4CAEA,MAAMC,EAAS,yBAGTC,EAAiBC,EAAUH,GACjC,GAAuB,WAAnBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,6FAAIJ,MAAmBF,MAM/B,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAWO,IAGpD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file +{"version":3,"file":"GetVehicleTypesForMake.js","sources":["../../src/api/actions/GetVehicleTypesForMake.ts"],"sourcesContent":["/**\n * @module api/actions/GetVehicleTypesForMake\n * @category Actions\n * @description GetVehicleTypesForMake NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleTypesForMake](module-api_actions_GetVehicleTypesForMake.GetVehicleTypesForMake.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleTypesForMakeResponse](#GetVehicleTypesForMakeResponse)\n * > - Type: [GetVehicleTypesForMakeResults](#GetVehicleTypesForMakeResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleTypesForMake extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make,\n * whose name is LIKE the make name in the vPIC Dataset.\n * - `makeName` can be a partial name, or a full name for more specificity\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\n *\n * @async\n * @param {string} makeName - Name of the vehicle make to search.\n * @returns {(Promise)} Api Response object.\n */\n async GetVehicleTypesForMake(\n makeName: string\n ): Promise {\n const action = 'GetVehicleTypesForMake';\n\n /* Runtime typechecking */\n const typeofMakeName = getTypeof(makeName);\n if (typeofMakeName !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\n `<${typeofMakeName}> ${makeName}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleTypesForMake\n * @alias GetVehicleTypesForMakeResults\n */\nexport type GetVehicleTypesForMakeResults = {\n MakeId: number;\n MakeName: string;\n VehicleTypeId: number;\n VehicleTypeName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleTypesForMake API Action.\n *\n * @memberof module:api/actions/GetVehicleTypesForMake\n * @alias GetVehicleTypesForMakeResponse\n */\nexport type GetVehicleTypesForMakeResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetVehicleTypesForMake","Fetch","[object Object]","userConfig","super","makeName","action","typeofMakeName","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAaFD,uBACJG,4CAEA,MAAMC,EAAS,yBAGTC,EAAiBC,EAAUH,GACjC,GAAuB,WAAnBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,6FAAIJ,MAAmBF,MAM/B,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAWO,IAGpD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file diff --git a/dist/module/GetVehicleTypesForMakeId.js b/dist/module/GetVehicleTypesForMakeId.js index 0be87b42a..9d54a4c20 100644 --- a/dist/module/GetVehicleTypesForMakeId.js +++ b/dist/module/GetVehicleTypesForMakeId.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class s extends e{constructor(e){super(e)}GetVehicleTypesForMakeId(e){return r(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMakeId",s=t(e);if("number"!==s)return Promise.reject(new Error(`GetVehicleTypesForMakeId, "makeId" argument is required and must be of type number, got: <${s}> ${e}`));const i=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),o=`${this.baseUrl}/${r}/${e}${i}`;return yield this.get(o).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{s as GetVehicleTypesForMakeId}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class s extends e{constructor(e){super(e)}GetVehicleTypesForMakeId(e){return r(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMakeId",s=t(e);if("number"!==s)return Promise.reject(new Error(`GetVehicleTypesForMakeId, "makeId" argument is required and must be of type number, got: <${s}> ${e}`));const i=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),o=`${this.baseUrl}/${r}/${e}${i}`;return yield this.get(o).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{s as GetVehicleTypesForMakeId}; //# sourceMappingURL=GetVehicleTypesForMakeId.js.map diff --git a/dist/module/GetVehicleTypesForMakeId.js.map b/dist/module/GetVehicleTypesForMakeId.js.map index 06042b466..62a1c709c 100644 --- a/dist/module/GetVehicleTypesForMakeId.js.map +++ b/dist/module/GetVehicleTypesForMakeId.js.map @@ -1 +1 @@ -{"version":3,"file":"GetVehicleTypesForMakeId.js","sources":["../../src/api/actions/GetVehicleTypesForMakeId.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetVehicleTypesForMakeId\r\n * @category Actions\r\n * @description GetVehicleTypesForMakeId NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleTypesForMakeId](module-api_actions_GetVehicleTypesForMakeId.GetVehicleTypesForMakeId.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleTypesForMakeIdResponse](#GetVehicleTypesForMakeIdResponse)\r\n * > - Type: [GetVehicleTypesForMakeIdResults](#GetVehicleTypesForMakeIdResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleTypesForMakeId extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make and\r\n * whose ID equals the make ID in the vPIC Dataset.\r\n *\r\n * @async\r\n * @param {number} makeID - Vehicle make ID.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleTypesForMakeId(\r\n makeID: number\r\n ): Promise {\r\n const action = 'GetVehicleTypesForMakeId';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeId = getTypeof(makeID);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeID}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeIdResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMakeId\r\n * @alias GetVehicleTypesForMakeIdResults\r\n */\r\nexport type GetVehicleTypesForMakeIdResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleTypesForMakeId API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMakeId\r\n * @alias GetVehicleTypesForMakeIdResponse\r\n */\r\nexport type GetVehicleTypesForMakeIdResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetVehicleTypesForMakeId","Fetch","[object Object]","userConfig","super","makeID","action","typeofMakeId","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAiCC,EAC5CC,YAAYC,GACVC,MAAMD,GAWFD,yBACJG,4CAEA,MAAMC,EAAS,2BAGTC,EAAeC,EAAUH,GAC/B,GAAqB,WAAjBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,6FAAIJ,MAAiBF,MAM7B,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAASO,IAGlD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file +{"version":3,"file":"GetVehicleTypesForMakeId.js","sources":["../../src/api/actions/GetVehicleTypesForMakeId.ts"],"sourcesContent":["/**\n * @module api/actions/GetVehicleTypesForMakeId\n * @category Actions\n * @description GetVehicleTypesForMakeId NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleTypesForMakeId](module-api_actions_GetVehicleTypesForMakeId.GetVehicleTypesForMakeId.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleTypesForMakeIdResponse](#GetVehicleTypesForMakeIdResponse)\n * > - Type: [GetVehicleTypesForMakeIdResults](#GetVehicleTypesForMakeIdResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleTypesForMakeId extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make and\n * whose ID equals the make ID in the vPIC Dataset.\n *\n * @async\n * @param {number} makeID - Vehicle make ID.\n * @returns {(Promise)} Api Response object.\n */\n async GetVehicleTypesForMakeId(\n makeID: number\n ): Promise {\n const action = 'GetVehicleTypesForMakeId';\n\n /* Runtime typechecking */\n const typeofMakeId = getTypeof(makeID);\n if (typeofMakeId !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\n `<${typeofMakeId}> ${makeID}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeIdResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleTypesForMakeId\n * @alias GetVehicleTypesForMakeIdResults\n */\nexport type GetVehicleTypesForMakeIdResults = {\n MakeId: number;\n MakeName: string;\n VehicleTypeId: number;\n VehicleTypeName: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleTypesForMakeId API Action.\n *\n * @memberof module:api/actions/GetVehicleTypesForMakeId\n * @alias GetVehicleTypesForMakeIdResponse\n */\nexport type GetVehicleTypesForMakeIdResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetVehicleTypesForMakeId","Fetch","[object Object]","userConfig","super","makeID","action","typeofMakeId","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAiCC,EAC5CC,YAAYC,GACVC,MAAMD,GAWFD,yBACJG,4CAEA,MAAMC,EAAS,2BAGTC,EAAeC,EAAUH,GAC/B,GAAqB,WAAjBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,6FAAIJ,MAAiBF,MAM7B,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAASO,IAGlD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file diff --git a/dist/module/GetVehicleVariableList.js b/dist/module/GetVehicleVariableList.js index 60fe7d34a..c32fbf4a6 100644 --- a/dist/module/GetVehicleVariableList.js +++ b/dist/module/GetVehicleVariableList.js @@ -1,2 +1,2 @@ -import{F as e,_ as r}from"./Fetch-b3914c0a.js";class t extends e{constructor(e){super(e)}GetVehicleVariableList(){return r(this,void 0,void 0,(function*(){const e="GetVehicleVariableList",r=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),t=`${this.baseUrl}/${e}${r}`;return yield this.get(t).then(e=>e).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{t as GetVehicleVariableList}; +import{F as e,_ as r}from"./Fetch-44aa28fd.js";class t extends e{constructor(e){super(e)}GetVehicleVariableList(){return r(this,void 0,void 0,(function*(){const e="GetVehicleVariableList",r=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),t=`${this.baseUrl}/${e}${r}`;return yield this.get(t).then(e=>e).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{t as GetVehicleVariableList}; //# sourceMappingURL=GetVehicleVariableList.js.map diff --git a/dist/module/GetVehicleVariableList.js.map b/dist/module/GetVehicleVariableList.js.map index e88ce8280..0ef194151 100644 --- a/dist/module/GetVehicleVariableList.js.map +++ b/dist/module/GetVehicleVariableList.js.map @@ -1 +1 @@ -{"version":3,"file":"GetVehicleVariableList.js","sources":["../../src/api/actions/GetVehicleVariableList.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetVehicleVariableList\r\n * @category Actions\r\n * @description GetVehicleVariableList NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleVariableList](module-api_actions_GetVehicleVariableList.GetVehicleVariableList.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleVariableListResponse](#GetVehicleVariableListResponse)\r\n * > - Type: [GetVehicleVariableListResults](#GetVehicleVariableListResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleVariableList extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Vehicle related variables that are in the vPIC dataset.\r\n * - Information on the name, description and the type of the variable is provided.\r\n *\r\n * @async\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetVehicleVariableList(): Promise {\r\n const action = 'GetVehicleVariableList';\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleVariableListResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableList\r\n * @alias GetVehicleVariableListResults\r\n */\r\nexport type GetVehicleVariableListResults = {\r\n DataType: string;\r\n Description: string;\r\n ID: number;\r\n Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleVariableList API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableList\r\n * @alias GetVehicleVariableListResponse\r\n */\r\nexport type GetVehicleVariableListResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetVehicleVariableList","Fetch","[object Object]","userConfig","super","action","queryString","this","buildQueryString","catch","err","Promise","reject","Error","url","baseUrl","get","then","response"],"mappings":"qDA6BaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAUKD,kEACX,MAAMG,EAAS,yBAGTC,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDC,QAAQC,OACN,IAAIC,MAAM,GAAGR,mCAAwCK,OAKnDI,EAAM,GAAGP,KAAKQ,WAAWV,IAASC,IAGxC,aAAaC,KAAKS,IAAIF,GACnBG,KAAMC,GAAaA,GACnBT,MAAOC,GACNC,QAAQC,OAAO,IAAIC,MAAM,GAAGR,yBAA8BK"} \ No newline at end of file +{"version":3,"file":"GetVehicleVariableList.js","sources":["../../src/api/actions/GetVehicleVariableList.ts"],"sourcesContent":["/**\n * @module api/actions/GetVehicleVariableList\n * @category Actions\n * @description GetVehicleVariableList NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleVariableList](module-api_actions_GetVehicleVariableList.GetVehicleVariableList.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleVariableListResponse](#GetVehicleVariableListResponse)\n * > - Type: [GetVehicleVariableListResults](#GetVehicleVariableListResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleVariableList extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the Vehicle related variables that are in the vPIC dataset.\n * - Information on the name, description and the type of the variable is provided.\n *\n * @async\n * @returns {(Promise)} Api Response object.\n */\n public async GetVehicleVariableList(): Promise {\n const action = 'GetVehicleVariableList';\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleVariableListResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleVariableList\n * @alias GetVehicleVariableListResults\n */\nexport type GetVehicleVariableListResults = {\n DataType: string;\n Description: string;\n ID: number;\n Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleVariableList API Action.\n *\n * @memberof module:api/actions/GetVehicleVariableList\n * @alias GetVehicleVariableListResponse\n */\nexport type GetVehicleVariableListResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetVehicleVariableList","Fetch","[object Object]","userConfig","super","action","queryString","this","buildQueryString","catch","err","Promise","reject","Error","url","baseUrl","get","then","response"],"mappings":"qDA6BaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAUKD,kEACX,MAAMG,EAAS,yBAGTC,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDC,QAAQC,OACN,IAAIC,MAAM,GAAGR,mCAAwCK,OAKnDI,EAAM,GAAGP,KAAKQ,WAAWV,IAASC,IAGxC,aAAaC,KAAKS,IAAIF,GACnBG,KAAMC,GAAaA,GACnBT,MAAOC,GACNC,QAAQC,OAAO,IAAIC,MAAM,GAAGR,yBAA8BK"} \ No newline at end of file diff --git a/dist/module/GetVehicleVariableValuesList.js b/dist/module/GetVehicleVariableValuesList.js index 780e11ca0..6eac273cc 100644 --- a/dist/module/GetVehicleVariableValuesList.js +++ b/dist/module/GetVehicleVariableValuesList.js @@ -1,2 +1,2 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class i extends e{constructor(e){super(e)}GetVehicleVariableValuesList(e){return r(this,void 0,void 0,(function*(){const r="GetVehicleVariableValuesList",i=t(e);if("string"!==i&&"number"!==i)return Promise.reject(new Error(`GetVehicleVariableValuesList, "variableValue" argument is required and must be of type string or number, got: <${i}> ${e}`));"string"===i&&(e=encodeURI(e));const s=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${s}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{i as GetVehicleVariableValuesList}; +import{F as e,_ as r,g as t}from"./Fetch-44aa28fd.js";class i extends e{constructor(e){super(e)}GetVehicleVariableValuesList(e){return r(this,void 0,void 0,(function*(){const r="GetVehicleVariableValuesList",i=t(e);if("string"!==i&&"number"!==i)return Promise.reject(new Error(`GetVehicleVariableValuesList, "variableValue" argument is required and must be of type string or number, got: <${i}> ${e}`));"string"===i&&(e=encodeURI(e));const s=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),n=`${this.baseUrl}/${r}/${e}${s}`;return yield this.get(n).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{i as GetVehicleVariableValuesList}; //# sourceMappingURL=GetVehicleVariableValuesList.js.map diff --git a/dist/module/GetVehicleVariableValuesList.js.map b/dist/module/GetVehicleVariableValuesList.js.map index 430e9e446..3eb407b3f 100644 --- a/dist/module/GetVehicleVariableValuesList.js.map +++ b/dist/module/GetVehicleVariableValuesList.js.map @@ -1 +1 @@ -{"version":3,"file":"GetVehicleVariableValuesList.js","sources":["../../src/api/actions/GetVehicleVariableValuesList.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetVehicleVariableValuesList\r\n * @category Actions\r\n * @description GetVehicleVariableValuesList NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleVariableValuesList](module-api_actions_GetVehicleVariableValuesList.GetVehicleVariableValuesList.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleVariableValuesListResponse](#GetVehicleVariableValuesListResponse)\r\n * > - Type: [GetVehicleVariableValuesListResults](#GetVehicleVariableValuesListResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleVariableValuesList extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the accepted values for a given variable that are stored in the vPIC dataset.\r\n *\r\n * This applies to only \"Look up\" type of variables.\r\n * - `variableValue` can either be a:\r\n * - Variable Name (\"battery type\" in first example, please use full name, not just part of it),\r\n * - or Variable ID (number).\r\n *\r\n * @async\r\n * @param {string|number} variableValue - The variable you want to get a values list of.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleVariableValuesList(\r\n variableValue: string | number\r\n ): Promise {\r\n const action = 'GetVehicleVariableValuesList';\r\n\r\n /* Runtime typechecking */\r\n const typeofVariableValue = getTypeof(variableValue);\r\n if (typeofVariableValue !== 'string' && typeofVariableValue !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"variableValue\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofVariableValue}> ${variableValue}`\r\n )\r\n );\r\n }\r\n /* Encode to a valid URI string (space chars, etc.) if variableValue is a string*/\r\n if (typeofVariableValue === 'string') {\r\n variableValue = encodeURI(variableValue as string);\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${variableValue}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleVariableValuesListResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableValuesList\r\n * @alias GetVehicleVariableValuesListResults\r\n */\r\nexport type GetVehicleVariableValuesListResults = {\r\n ElementName: string;\r\n Id: number;\r\n Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleVariableValuesList API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableValuesList\r\n * @alias GetVehicleVariableValuesListResponse\r\n */\r\nexport type GetVehicleVariableValuesListResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetVehicleVariableValuesList","Fetch","[object Object]","userConfig","super","variableValue","action","typeofVariableValue","getTypeof","Promise","reject","Error","encodeURI","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAqCC,EAChDC,YAAYC,GACVC,MAAMD,GAeFD,6BACJG,4CAEA,MAAMC,EAAS,+BAGTC,EAAsBC,EAAUH,GACtC,GAA4B,WAAxBE,GAA4D,WAAxBA,EACtC,OAAOE,QAAQC,OACb,IAAIC,MAEA,kHAAIJ,MAAwBF,MAKR,WAAxBE,IACFF,EAAgBO,UAAUP,IAI5B,MAAMQ,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDR,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCW,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWb,KAAUD,IAAgBQ,IAGzD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNR,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BW"} \ No newline at end of file +{"version":3,"file":"GetVehicleVariableValuesList.js","sources":["../../src/api/actions/GetVehicleVariableValuesList.ts"],"sourcesContent":["/**\n * @module api/actions/GetVehicleVariableValuesList\n * @category Actions\n * @description GetVehicleVariableValuesList NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetVehicleVariableValuesList](module-api_actions_GetVehicleVariableValuesList.GetVehicleVariableValuesList.html)\n * >\n * > **Types**\n * > - Type: [GetVehicleVariableValuesListResponse](#GetVehicleVariableValuesListResponse)\n * > - Type: [GetVehicleVariableValuesListResults](#GetVehicleVariableValuesListResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetVehicleVariableValuesList extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * This provides a list of all the accepted values for a given variable that are stored in the vPIC dataset.\n *\n * This applies to only \"Look up\" type of variables.\n * - `variableValue` can either be a:\n * - Variable Name (\"battery type\" in first example, please use full name, not just part of it),\n * - or Variable ID (number).\n *\n * @async\n * @param {string|number} variableValue - The variable you want to get a values list of.\n * @returns {(Promise)} Api Response object.\n */\n async GetVehicleVariableValuesList(\n variableValue: string | number\n ): Promise {\n const action = 'GetVehicleVariableValuesList';\n\n /* Runtime typechecking */\n const typeofVariableValue = getTypeof(variableValue);\n if (typeofVariableValue !== 'string' && typeofVariableValue !== 'number') {\n return Promise.reject(\n new Error(\n `${action}, \"variableValue\" argument is required and must be of type string or number, got: ` +\n `<${typeofVariableValue}> ${variableValue}`\n )\n );\n }\n /* Encode to a valid URI string (space chars, etc.) if variableValue is a string*/\n if (typeofVariableValue === 'string') {\n variableValue = encodeURI(variableValue as string);\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${variableValue}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetVehicleVariableValuesListResponse}.Results' array.\n *\n * @memberof module:api/actions/GetVehicleVariableValuesList\n * @alias GetVehicleVariableValuesListResults\n */\nexport type GetVehicleVariableValuesListResults = {\n ElementName: string;\n Id: number;\n Name: string;\n};\n\n/**\n * Type representing the complete response returned by the GetVehicleVariableValuesList API Action.\n *\n * @memberof module:api/actions/GetVehicleVariableValuesList\n * @alias GetVehicleVariableValuesListResponse\n */\nexport type GetVehicleVariableValuesListResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetVehicleVariableValuesList","Fetch","[object Object]","userConfig","super","variableValue","action","typeofVariableValue","getTypeof","Promise","reject","Error","encodeURI","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAAqCC,EAChDC,YAAYC,GACVC,MAAMD,GAeFD,6BACJG,4CAEA,MAAMC,EAAS,+BAGTC,EAAsBC,EAAUH,GACtC,GAA4B,WAAxBE,GAA4D,WAAxBA,EACtC,OAAOE,QAAQC,OACb,IAAIC,MAEA,kHAAIJ,MAAwBF,MAKR,WAAxBE,IACFF,EAAgBO,UAAUP,IAI5B,MAAMQ,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDR,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCW,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWb,KAAUD,IAAgBQ,IAGzD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNR,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BW"} \ No newline at end of file diff --git a/dist/module/GetWMIsForManufacturer-a7ef6c3c.js b/dist/module/GetWMIsForManufacturer-a7ef6c3c.js deleted file mode 100644 index 4aec5047d..000000000 --- a/dist/module/GetWMIsForManufacturer-a7ef6c3c.js +++ /dev/null @@ -1,2 +0,0 @@ -import{F as e,_ as r,g as t}from"./Fetch-b3914c0a.js";class n extends e{constructor(e){super(e)}DecodeVin(e,n){return r(this,void 0,void 0,(function*(){const r="DecodeVin",o=t(n);if(n&&"object"!==o)return Promise.reject(new Error(`DecodeVin, "params" argument must be of type object, got: <${o}> ${n}`));const i=t(e);if("string"!==i)return Promise.reject(new Error(`DecodeVin, "vin" argument is required and must be of type string, got: <${i}> ${e}`));const s=t(null==n?void 0:n.modelYear);if((null==n?void 0:n.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVin, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${n.modelYear}`));const u=yield this.buildQueryString(n).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),a=`${this.baseUrl}/${r}/${e}${u}`;return yield this.get(a).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class o extends e{constructor(e){super(e)}DecodeVinExtended(e,n){return r(this,void 0,void 0,(function*(){const r="DecodeVinExtended",o=t(n);if(n&&"object"!==o)return Promise.reject(new Error(`DecodeVinExtended, "params" argument must be of type object, got: <${o}> ${n}`));const i=t(e);if("string"!==i)return Promise.reject(new Error(`DecodeVinExtended, "vin" argument is required and must be of type string, got: <${i}> ${e}`));const s=t(null==n?void 0:n.modelYear);if((null==n?void 0:n.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVinExtended, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${n.modelYear}`));const u=yield this.buildQueryString(n).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),a=`${this.baseUrl}/${r}/${e}${u}`;return yield this.get(a).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class i extends e{constructor(e){super(e)}DecodeVinValues(e,n){return r(this,void 0,void 0,(function*(){const r="DecodeVinValues",o=t(n);if(n&&"object"!==o)return Promise.reject(new Error(`DecodeVinValues, "params" argument must be of type object, got: <${o}> ${n}`));const i=t(e);if("string"!==i)return Promise.reject(new Error(`DecodeVinValues, "vin" argument is required and must be of type string, got: <${i}> ${e}`));const s=t(null==n?void 0:n.modelYear);if((null==n?void 0:n.modelYear)&&"string"!==s&&"number"!==s)return Promise.reject(new Error(`DecodeVinValues, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${n.modelYear}`));const u=yield this.buildQueryString(n).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),a=`${this.baseUrl}/${r}/${e}${u}`;return yield this.get(a).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class s extends e{constructor(e){super(e)}DecodeVINValuesBatch(e){return r(this,void 0,void 0,(function*(){const r="DecodeVINValuesBatch",n=t(e);if("string"!==n)return Promise.reject(new Error(`DecodeVINValuesBatch, "inputString" argument is required and must be of type string, got: <${n}> ${e}`));const o=`${this.baseUrl}/${r}/`,i=encodeURI(`DATA=${e}&format=json`);return yield this.get(o,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i}).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class u extends e{constructor(e){super(e)}DecodeVinValuesExtended(e,n){return r(this,void 0,void 0,(function*(){const r="DecodeVinValuesExtended",o=t(n);if(n&&"object"!==o)return Promise.reject(new Error(`DecodeVinValuesExtended, "params" argument must be of type object, got: <${o}> ${n}`));const i=t(e);if("string"!==i)return Promise.reject(new Error(`DecodeVinValuesExtended, "vin" argument is required and must be of type string, got: <${i}> ${e}`));const s=t(null==n?void 0:n.modelYear);if((null==n?void 0:n.modelYear)&&"number"!==s)return Promise.reject(new Error(`DecodeVinValuesExtended, "params.modelYear" argument is required and must be of type string or number, got: <${s}> ${n.modelYear}`));const u=yield this.buildQueryString(n).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),a=`${this.baseUrl}/${r}/${e}${u}`;return yield this.get(a).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class a extends e{constructor(e){super(e)}DecodeWMI(e){return r(this,void 0,void 0,(function*(){const r="DecodeWMI",n=t(e);if("string"!==n)return Promise.reject(new Error(`DecodeWMI, "WMI" argument is required and must be of type string, got: <${n}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class c extends e{constructor(e){super(e)}GetAllMakes(){return r(this,void 0,void 0,(function*(){const e=yield this.buildQueryString().catch(e=>Promise.reject(new Error("GetAllMakes, Error building query string: "+e))),r=`${this.baseUrl}/GetAllMakes${e}`;return yield this.get(r).then(e=>e).catch(e=>Promise.reject(new Error("GetAllMakes, Fetch.get() error: "+e)))}))}}class d extends e{constructor(e){super(e)}GetAllManufacturers(e={}){return r(this,void 0,void 0,(function*(){const r="GetAllManufacturers",n=t(e);if("object"!==n)return Promise.reject(new Error(`GetAllManufacturers, "params" argument must be of type object, got: <${n}> ${e}`));const o=t(e.manufacturerType);if(e.manufacturerType&&"string"!==o)return Promise.reject(new Error(`GetAllManufacturers, "params.manufacturerType" argument must be of type string, got: <${o}> ${e.manufacturerType}`));const i=t(e.page);if(e.page&&"number"!==i)return Promise.reject(new Error(`GetAllManufacturers, "params.page" argument must be of type number, got: <${i}> ${e.page}`));const s=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),u=`${this.baseUrl}/${r}${s}`;return yield this.get(u).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class m extends e{constructor(e){super(e)}GetCanadianVehicleSpecifications(e){return r(this,void 0,void 0,(function*(){const r="GetCanadianVehicleSpecifications",n=t(e);if("object"!==n)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params" argument must be of type object, got: <${n}> ${e}`));const o=t(e.year);if("number"!==o)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.year" argument is required and must be of type number, got: <${o}> ${e.year}`));const i=t(e.make);if(e.make&&"string"!==i)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.make" argument must be of type string, got: <${i}> ${e.make}`));const s=t(e.model);if(e.model&&"string"!==s)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.model" argument must be of type string, got: <${s}> ${e.model}`));const u=t(e.units);if(e.units&&"string"!==u)return Promise.reject(new Error(`GetCanadianVehicleSpecifications, "params.units" argument must be of type string, got: <${u}> ${e.units}`));const a=e.make||"",c=e.model||"",d=e.units||"",m={year:e.year,make:a,model:c,units:d},l=yield this.buildQueryString(m,!0).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),$=`${this.baseUrl}/${r}${l}`;return yield this.get($).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class l extends e{constructor(e){super(e)}GetEquipmentPlantCodes(e){return r(this,void 0,void 0,(function*(){const r="GetEquipmentPlantCodes",n=t(e);if("object"!==n)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params" argument must be of type object, got: <${n}> ${e}`));const o=t(e.year);if("number"!==o)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.year" argument is required and must be of type number, got: <${o}> ${e.year}`));const i=t(e.equipmentType);if("number"!==i)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.equipmentType" argument is required and must be of type number, got: <${i}> ${e.equipmentType}`));const s=t(e.reportType);if("string"!==s)return Promise.reject(new Error(`GetEquipmentPlantCodes, "params.reportType" argument is required and must be of type string, got: <${s}> ${e.reportType}`));const u=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),a=`${this.baseUrl}/${r}${u}`;return yield this.get(a).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class $ extends e{constructor(e){super(e)}GetMakeForManufacturer(e){return r(this,void 0,void 0,(function*(){const r="GetMakeForManufacturer",n=t(e);if("string"!==n&&"number"!==n)return Promise.reject(new Error(`GetMakeForManufacturer, "manufacturer" argument is required and must be of type string or number, got: <${n}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class g extends e{constructor(e){super(e)}GetMakesForManufacturerAndYear(e,n){return r(this,void 0,void 0,(function*(){const r="GetMakesForManufacturerAndYear",o=t(e);if("string"!==o&&"number"!==o)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "manufacturer" argument is required and must be of type string or number, got: <${o}> ${e}`));const i=t(n);if("object"!==i)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params" argument is required and must be of type object, got: <${i}> ${n}`));const s=t(n.year);if("number"!==s)return Promise.reject(new Error(`GetMakesForManufacturerAndYear, "params.year" argument is required and must be of type number, got: <${s}> ${n.year}`));const u=yield this.buildQueryString(n).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),a=`${this.baseUrl}/${r}/${e}${u}`;return yield this.get(a).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class h extends e{constructor(e){super(e)}GetMakesForVehicleType(e){return r(this,void 0,void 0,(function*(){const r="GetMakesForVehicleType",n=t(e);if("string"!==n)return Promise.reject(new Error(`GetMakesForVehicleType, "typeName" argument is required and must be of type string, got: <${n}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class b extends e{constructor(e){super(e)}GetManufacturerDetails(e){return r(this,void 0,void 0,(function*(){const r="GetManufacturerDetails",n=t(e);if("string"!==n&&"number"!==n)return Promise.reject(new Error(`GetManufacturerDetails, "manufacturer" argument is required and must be of type string or number, got: <${n}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class y extends e{constructor(e){super(e)}GetModelsForMake(e){return r(this,void 0,void 0,(function*(){const r="GetModelsForMake",n=t(e);if("string"!==n)return Promise.reject(new Error(`GetModelsForMake, "makeName" argument is required and must be of type string, got: <${n}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class p extends e{constructor(e){super(e)}GetModelsForMakeId(e){return r(this,void 0,void 0,(function*(){const r="GetModelsForMakeId",n=t(e);if("number"!==n)return Promise.reject(new Error(`GetModelsForMakeId, "makeId" argument is required and must be of type number, got: <${n}> ${e}`));const o=yield this.buildQueryString({}).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class f extends e{constructor(e){super(e)}GetModelsForMakeIdYear(e){return r(this,void 0,void 0,(function*(){const r="GetModelsForMakeIdYear",n=null==e?void 0:e.makeId,o=null==e?void 0:e.modelYear,i=null==e?void 0:e.vehicleType,s=t(e);if("object"!==s)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params" argument must be of type object, got: <${s}> ${e}`));const u=t(n);if("number"!==u)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.makeId" argument is required and must be of type number, got: <${u}> ${n}`));if(!o&&!i)return Promise.reject(new Error(`GetModelsForMakeIdYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${o} | ${i}`));const a=t(o);if(o&&"number"!==a)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.modelYear" must be of type number, got: <${a}> ${o}`));const c=t(i);if(i&&"string"!==c)return Promise.reject(new Error(`GetModelsForMakeIdYear, "params.vehicleType" must be of type string, got: <${c}> ${i}`));let d=`${r}/makeId/${n}/`;d+=o&&i?`modelYear/${o}/vehicleType/${i}`:o?"modelYear/"+o:"vehicleType/"+i;const m=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),l=`${this.baseUrl}/${d}${m}`;return yield this.get(l).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class E extends e{constructor(e){super(e)}GetModelsForMakeYear(e){return r(this,void 0,void 0,(function*(){const r="GetModelsForMakeYear",n=null==e?void 0:e.make,o=null==e?void 0:e.modelYear,i=null==e?void 0:e.vehicleType,s=t(e);if("object"!==s)return Promise.reject(new Error(`GetModelsForMakeYear, "params" argument must be of type object, got: <${s}> ${e}`));const u=t(n);if("string"!==u)return Promise.reject(new Error(`GetModelsForMakeYear, "params.make" argument is required and must be of type string, got: <${u}> ${n}`));if(!o&&!i)return Promise.reject(new Error(`GetModelsForMakeYear, either one of "params.modelYear" or "params.vehicleType" is required, got: ${o} | ${i}`));const a=t(o);if(o&&"number"!==a)return Promise.reject(new Error(`GetModelsForMakeYear, "params.modelYear" must be of type number, got: <${a}> ${o}`));const c=t(i);if(i&&"string"!==c)return Promise.reject(new Error(`GetModelsForMakeYear, "params.vehicleType" must be of type string, got: <${c}> ${i}`));let d=`${r}/make/${e.make}/`;d+=o&&i?`modelYear/${o}/vehicleType/${i}`:o?"modelYear/"+o:"vehicleType/"+i;const m=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),l=`${this.baseUrl}/${d}${m}`;return yield this.get(l).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class j extends e{constructor(e){super(e)}GetParts(e){return r(this,void 0,void 0,(function*(){const r="GetParts",n=null==e?void 0:e.type,o=null==e?void 0:e.fromDate,i=null==e?void 0:e.toDate,s=null==e?void 0:e.page,u=t(e);if(e&&"object"!==u)return Promise.reject(new Error(`${r}, "params" argument must be of type object, got: <${u}> ${e}`));const a=t(n);if(n&&"number"!==a)return Promise.reject(new Error(`${r}, "params.type" argument must be of type number, got: <${a}> ${n}`));const c=t(o);if(o&&"string"!==c)return Promise.reject(new Error(`${r}, "params.fromDate" argument must be of type string, got: <${c}> ${o}`));const d=t(i);if(i&&"string"!==d)return Promise.reject(new Error(`${r}, "params.toDate" argument must be of type string, got: <${d}> ${i}`));const m=t(s);if(s&&"number"!==m)return Promise.reject(new Error(`${r}, "params.page" argument must be of type number, got: <${m}> ${s}`));const l=yield this.buildQueryString(e).catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),$=`${this.baseUrl}/${r}${l}`;return yield this.get($).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class P extends e{constructor(e){super(e)}GetVehicleTypesForMake(e){return r(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMake",n=t(e);if("string"!==n)return Promise.reject(new Error(`GetVehicleTypesForMake, "makeName" argument is required and must be of type string, got: <${n}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class w extends e{constructor(e){super(e)}GetVehicleTypesForMakeId(e){return r(this,void 0,void 0,(function*(){const r="GetVehicleTypesForMakeId",n=t(e);if("number"!==n)return Promise.reject(new Error(`GetVehicleTypesForMakeId, "makeId" argument is required and must be of type number, got: <${n}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class M extends e{constructor(e){super(e)}GetVehicleVariableList(){return r(this,void 0,void 0,(function*(){const e="GetVehicleVariableList",r=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),t=`${this.baseUrl}/${e}${r}`;return yield this.get(t).then(e=>e).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}class v extends e{constructor(e){super(e)}GetVehicleVariableValuesList(e){return r(this,void 0,void 0,(function*(){const r="GetVehicleVariableValuesList",n=t(e);if("string"!==n&&"number"!==n)return Promise.reject(new Error(`GetVehicleVariableValuesList, "variableValue" argument is required and must be of type string or number, got: <${n}> ${e}`));"string"===n&&(e=encodeURI(e));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}class G extends e{constructor(e){super(e)}GetWMIsForManufacturer(e){return r(this,void 0,void 0,(function*(){const r="GetWMIsForManufacturer",n=t(e);if("string"!==n)return Promise.reject(new Error(`GetWMIsForManufacturer, "manufacturer" argument is required and must be of type string, got: <${n}> ${e}`));const o=yield this.buildQueryString().catch(e=>Promise.reject(new Error(`${r}, Error building query string: ${e}`))),i=`${this.baseUrl}/${r}/${e}${o}`;return yield this.get(i).then(e=>e).catch(e=>Promise.reject(new Error(`${r}, Fetch.get() error: ${e}`)))}))}}export{n as D,c as G,o as a,i as b,s as c,u as d,a as e,d as f,m as g,l as h,$ as i,g as j,h as k,b as l,y as m,p as n,f as o,E as p,j as q,P as r,w as s,M as t,v as u,G as v}; -//# sourceMappingURL=GetWMIsForManufacturer-a7ef6c3c.js.map diff --git a/dist/module/GetWMIsForManufacturer-a7ef6c3c.js.map b/dist/module/GetWMIsForManufacturer-a7ef6c3c.js.map deleted file mode 100644 index 99598d69b..000000000 --- a/dist/module/GetWMIsForManufacturer-a7ef6c3c.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GetWMIsForManufacturer-a7ef6c3c.js","sources":["../../src/api/actions/DecodeVin.ts","../../src/api/actions/DecodeVinExtended.ts","../../src/api/actions/DecodeVinValues.ts","../../src/api/actions/DecodeVINValuesBatch.ts","../../src/api/actions/DecodeVinValuesExtended.ts","../../src/api/actions/DecodeWMI.ts","../../src/api/actions/GetAllMakes.ts","../../src/api/actions/GetAllManufacturers.ts","../../src/api/actions/GetCanadianVehicleSpecifications.ts","../../src/api/actions/GetEquipmentPlantCodes.ts","../../src/api/actions/GetMakeForManufacturer.ts","../../src/api/actions/GetMakesForManufacturerAndYear.ts","../../src/api/actions/GetMakesForVehicleType.ts","../../src/api/actions/GetManufacturerDetails.ts","../../src/api/actions/GetModelsForMake.ts","../../src/api/actions/GetModelsForMakeId.ts","../../src/api/actions/GetModelsForMakeIdYear.ts","../../src/api/actions/GetModelsForMakeYear.ts","../../src/api/actions/GetParts.ts","../../src/api/actions/GetVehicleTypesForMake.ts","../../src/api/actions/GetVehicleTypesForMakeId.ts","../../src/api/actions/GetVehicleVariableList.ts","../../src/api/actions/GetVehicleVariableValuesList.ts","../../src/api/actions/GetWMIsForManufacturer.ts"],"sourcesContent":["/**\r\n * @module api/actions/DecodeVin\r\n * @category Actions\r\n * @description DecodeVin NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVin](module-api_actions_DecodeVin.DecodeVin.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinResponse](#DecodeVinResponse)\r\n * > - Type: [DecodeVinResults](#DecodeVinResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVin extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The DecodeVin API Action will decode the VIN and the decoded output will be made available in the format of Key-value pairs.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This API also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n * - The 9th digit is not necessary.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVin(\r\n vin: string,\r\n params?: {\r\n modelYear?: number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVin';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVin\r\n * @alias DecodeVinResults\r\n */\r\nexport type DecodeVinResults = {\r\n Value: string | null;\r\n ValueId: string | null;\r\n Variable: string;\r\n VariableId: number;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVin API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVin\r\n * @alias DecodeVinResponse\r\n */\r\nexport type DecodeVinResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVinExtended\r\n * @category Actions\r\n * @description DecodeVinExtended NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinExtended](module-api_actions_DecodeVinExtended.DecodeVinExtended.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinExtendedResponse](#DecodeVinExtendedResponse)\r\n * > - Type: [DecodeVinExtendedResults](#DecodeVinExtendedResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinExtended extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This is exactly like the DecodeVin method but provides additional information on variables\r\n * related to other NHTSA programs like\r\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\r\n * - This will decode the VIN and the decoded output will be made available\r\n * in the format of Key-value pairs.\r\n * - In the returned 'Results` object:\r\n * - The IDs (VariableID and ValueID) represent the unique ID associated with the Variable/Value.\r\n * - In case of text variables, the ValueID is not applicable.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n * - The 9th digit is not necessary.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVinExtended(\r\n vin: string,\r\n params?: {\r\n modelYear?: string | number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinExtended';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinExtendedResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinExtended\r\n * @alias DecodeVinExtendedResults\r\n */\r\nexport type DecodeVinExtendedResults = {\r\n Value: string | null;\r\n ValueId: string | null;\r\n Variable: string;\r\n VariableId: number;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinExtended API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinExtended\r\n * @alias DecodeVinExtendedResponse\r\n */\r\nexport type DecodeVinExtendedResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVinValues\r\n * @category Actions\r\n * @description DecodeVinValues NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinValues](module-api_actions_DecodeVinValues.DecodeVinValues.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinValuesResponse](#DecodeVinValuesResponse)\r\n * > - Type: [DecodeVinValuesResults](#DecodeVinValuesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinValues extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The DecodeVinValues API Action will decode the VIN with the Results returned in a _flat file_ format.\r\n * - The Results will be made available in a flat file format of a single object containing\r\n * 'key: value' results.\r\n * - Providing params.modelYear allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeVinValues(\r\n vin: string,\r\n params?: {\r\n modelYear?: number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinValues';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (\r\n params?.modelYear &&\r\n typeofModelYear !== 'string' &&\r\n typeofModelYear !== 'number'\r\n ) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinValuesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinValues\r\n * @alias DecodeVinValuesResults\r\n */\r\nexport type DecodeVinValuesResults = {\r\n /** Flat file format, single object containing keys and values of type string */\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinValues API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinValues\r\n * @alias DecodeVinValuesResponse\r\n */\r\nexport type DecodeVinValuesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /**\r\n * The search results returned by the NHSTA API request.\r\n * Flat file format, single object containing keys and values of type string\r\n * */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVINValuesBatch\r\n * @category Actions\r\n * @description DecodeVINValuesBatch NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVINValuesBatch](module-api_actions_DecodeVINValuesBatch.DecodeVINValuesBatch.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVINValuesBatchResponse](#DecodeVINValuesBatchResponse)\r\n * > - Type: [DecodeVINValuesBatchResults](#DecodeVINValuesBatchResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVINValuesBatch extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This decodes a batch of VINs that are submitted in a standardized format in a string\r\n * and returns multiple decodes in a flat format.\r\n *\r\n * The `inputString` parameter should be in the following format:\r\n * - `vin , modelYear ; vin , modelYear ; vin , modelYear ...`\r\n *\r\n * \"modelYear\" is optional, the output for each VIN decode is in the same format as produced by the \"Decode VIN (flat format)\" method.\r\n *\r\n * @async\r\n * @param {string} inputString - A string of Vehicle Identification Numbers (full or partial) following the format listed in the description.\r\n * @returns {(Promise)} - Api Response object.\r\n */\r\n async DecodeVINValuesBatch(\r\n inputString: string\r\n ): Promise {\r\n const action = 'DecodeVINValuesBatch';\r\n\r\n /* Runtime typechecking */\r\n const typeofInputString = getTypeof(inputString);\r\n if (typeofInputString !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"inputString\" argument is required and must be of type string, got: ` +\r\n `<${typeofInputString}> ${inputString}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/`;\r\n\r\n const body = encodeURI(`DATA=${inputString}&format=json`);\r\n\r\n /* Return the result */\r\n return await this.get(url, {\r\n method: 'POST',\r\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\r\n body,\r\n })\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVINValuesBatchResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVINValuesBatch\r\n * @alias DecodeVINValuesBatchResults\r\n */\r\nexport type DecodeVINValuesBatchResults = {\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVINValuesBatch API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVINValuesBatch\r\n * @alias DecodeVINValuesBatchResponse\r\n */\r\nexport type DecodeVINValuesBatchResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeVinValuesExtended\r\n * @category Actions\r\n * @description DecodeVinValuesExtended NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeVinValuesExtended](module-api_actions_DecodeVinValuesExtended.DecodeVinValuesExtended.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeVinValuesExtendedResponse](#DecodeVinValuesExtendedResponse)\r\n * > - Type: [DecodeVinValuesExtendedResults](#DecodeVinValuesExtendedResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeVinValuesExtended extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This is exactly like the DecodeVinValues (flat format Results) method but provides additional information\r\n * on variables related to other NHTSA programs like\r\n * [NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc.\r\n * - The Results will be made available in a flat file format of a single object containing\r\n * 'key: value' results.\r\n * - Providing `params.modelYear` allows for the decoding to specifically be done in the current,\r\n * or older (pre-1980), model year ranges.\r\n * - It is recommended to always provide `params.modelYear` if the model year is known at the time of decoding.\r\n * - This Action also supports partial VIN decoding (VINs that are less than 17 characters).\r\n * - In this case, the VIN will be decoded partially with the available characters.\r\n * - In case of partial VINs, a \"*\" could be used to indicate the unavailable characters.\r\n *\r\n * @async\r\n * @param {string} vin - Vehicle Identification Number (full or partial).\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string|number} [params.modelYear] - Optional Model Year search parameter.\r\n * @reje\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeVinValuesExtended(\r\n vin: string,\r\n params?: {\r\n modelYear?: string | number;\r\n }\r\n ): Promise {\r\n const action = 'DecodeVinValuesExtended';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofVin = getTypeof(vin);\r\n if (typeofVin !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"vin\" argument is required and must be of type string, got: ` +\r\n `<${typeofVin}> ${vin}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModelYear = getTypeof(params?.modelYear);\r\n if (params?.modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofModelYear}> ${params.modelYear}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${vin}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeVinValuesExtendedResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeVinValuesExtended\r\n * @alias DecodeVinValuesExtendedResults\r\n */\r\nexport type DecodeVinValuesExtendedResults = {\r\n /** Flat file format, single object containing keys and values of type string */\r\n ABS: string;\r\n ActiveSafetySysNote: string;\r\n AdaptiveCruiseControl: string;\r\n AdaptiveDrivingBeam: string;\r\n AdaptiveHeadlights: string;\r\n AdditionalErrorText: string;\r\n AirBagLocCurtain: string;\r\n AirBagLocFront: string;\r\n AirBagLocKnee: string;\r\n AirBagLocSeatCushion: string;\r\n AirBagLocSide: string;\r\n AutoReverseSystem: string;\r\n AutomaticPedestrianAlertingSound: string;\r\n AxleConfiguration: string;\r\n Axles: string;\r\n BasePrice: string;\r\n BatteryA: string;\r\n BatteryA_to: string;\r\n BatteryCells: string;\r\n BatteryInfo: string;\r\n BatteryKWh: string;\r\n BatteryKWh_to: string;\r\n BatteryModules: string;\r\n BatteryPacks: string;\r\n BatteryType: string;\r\n BatteryV: string;\r\n BatteryV_to: string;\r\n BedLengthIN: string;\r\n BedType: string;\r\n BlindSpotMon: string;\r\n BodyCabType: string;\r\n BodyClass: string;\r\n BrakeSystemDesc: string;\r\n BrakeSystemType: string;\r\n BusFloorConfigType: string;\r\n BusLength: string;\r\n BusType: string;\r\n CAN_AACN: string;\r\n CIB: string;\r\n CashForClunkers: string;\r\n ChargerLevel: string;\r\n ChargerPowerKW: string;\r\n CoolingType: string;\r\n CurbWeightLB: string;\r\n CustomMotorcycleType: string;\r\n DaytimeRunningLight: string;\r\n DestinationMarket: string;\r\n DisplacementCC: string;\r\n DisplacementCI: string;\r\n DisplacementL: string;\r\n Doors: string;\r\n DriveType: string;\r\n DriverAssist: string;\r\n DynamicBrakeSupport: string;\r\n EDR: string;\r\n ESC: string;\r\n EVDriveUnit: string;\r\n ElectrificationLevel: string;\r\n EngineConfiguration: string;\r\n EngineCycles: string;\r\n EngineCylinders: string;\r\n EngineHP: string;\r\n EngineHP_to: string;\r\n EngineKW: string;\r\n EngineManufacturer: string;\r\n EngineModel: string;\r\n EntertainmentSystem: string;\r\n ErrorCode: string;\r\n ErrorText: string;\r\n ForwardCollisionWarning: string;\r\n FuelInjectionType: string;\r\n FuelTypePrimary: string;\r\n FuelTypeSecondary: string;\r\n GCWR: string;\r\n GCWR_to: string;\r\n GVWR: string;\r\n GVWR_to: string;\r\n KeylessIgnition: string;\r\n LaneDepartureWarning: string;\r\n LaneKeepSystem: string;\r\n LowerBeamHeadlampLightSource: string;\r\n Make: string;\r\n Manufacturer: string;\r\n ManufacturerId: string;\r\n Model: string;\r\n ModelYear: string;\r\n MotorcycleChassisType: string;\r\n MotorcycleSuspensionType: string;\r\n NCSABodyType: string;\r\n NCSAMake: string;\r\n NCSAMapExcApprovedBy: string;\r\n NCSAMapExcApprovedOn: string;\r\n NCSAMappingException: string;\r\n NCSAModel: string;\r\n NCSANote: string;\r\n Note: string;\r\n OtherBusInfo: string;\r\n OtherEngineInfo: string;\r\n OtherMotorcycleInfo: string;\r\n OtherRestraintSystemInfo: string;\r\n OtherTrailerInfo: string;\r\n ParkAssist: string;\r\n PedestrianAutomaticEmergencyBraking: string;\r\n PlantCity: string;\r\n PlantCompanyName: string;\r\n PlantCountry: string;\r\n PlantState: string;\r\n PossibleValues: string;\r\n Pretensioner: string;\r\n RearCrossTrafficAlert: string;\r\n RearVisibilitySystem: string;\r\n SAEAutomationLevel: string;\r\n SAEAutomationLevel_to: string;\r\n SeatBeltsAll: string;\r\n SeatRows: string;\r\n Seats: string;\r\n SemiautomaticHeadlampBeamSwitching: string;\r\n Series: string;\r\n Series2: string;\r\n SteeringLocation: string;\r\n SuggestedVIN: string;\r\n TPMS: string;\r\n TopSpeedMPH: string;\r\n TrackWidth: string;\r\n TractionControl: string;\r\n TrailerBodyType: string;\r\n TrailerLength: string;\r\n TrailerType: string;\r\n TransmissionSpeeds: string;\r\n TransmissionStyle: string;\r\n Trim: string;\r\n Trim2: string;\r\n Turbo: string;\r\n VIN: string;\r\n ValveTrainDesign: string;\r\n VehicleType: string;\r\n WheelBaseLong: string;\r\n WheelBaseShort: string;\r\n WheelBaseType: string;\r\n WheelSizeFront: string;\r\n WheelSizeRear: string;\r\n Wheels: string;\r\n Windows: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeVinValuesExtended API Action.\r\n *\r\n * @memberof module:api/actions/DecodeVinValuesExtended\r\n * @alias DecodeVinValuesExtendedResponse\r\n */\r\nexport type DecodeVinValuesExtendedResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /**\r\n * The search results returned by the NHSTA API request.\r\n * Flat file format, single object containing keys and values of type string\r\n * */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/DecodeWMI\r\n * @category Actions\r\n * @description DecodeWMI NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [DecodeWMI](module-api_actions_DecodeWMI.DecodeWMI.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [DecodeWMIResponse](#DecodeWMIResponse)\r\n * > - Type: [DecodeWMIResults](#DecodeWMIResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class DecodeWMI extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides information on the World Manufacturer Identifier for a specific WMI code.\r\n * - `WMI` may be put in as either 3 characters representing VIN position 1-3 or 6 characters\r\n * representing VIN positions 1-3 & 12-14. Example \"JTD\", \"1T9131\".\r\n *\r\n * @async\r\n * @param {string} WMI - World Manufacturer Identifier.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async DecodeWMI(WMI: string): Promise {\r\n const action = 'DecodeWMI';\r\n\r\n /* Runtime typechecking */\r\n const typeofWMI = getTypeof(WMI);\r\n if (typeofWMI !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"WMI\" argument is required and must be of type string, got: ` +\r\n `<${typeofWMI}> ${WMI}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${WMI}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link DecodeWMIResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/DecodeWMI\r\n * @alias DecodeWMIResults\r\n */\r\nexport type DecodeWMIResults = {\r\n CommonName: string;\r\n CreatedOn: string;\r\n DateAvailableToPublic: string;\r\n Make: string;\r\n ManufacturerName: string;\r\n ParentCompanyName: string;\r\n URL: string;\r\n UpdatedOn: string;\r\n VehicleType: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the DecodeWMI API Action.\r\n *\r\n * @memberof module:api/actions/DecodeWMI\r\n * @alias DecodeWMIResponse\r\n */\r\nexport type DecodeWMIResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetAllMakes\r\n * @category Actions\r\n * @description GetAllMakes NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetAllMakes](module-api_actions_GetAllMakes.GetAllMakes.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetAllMakesResponse](#GetAllMakesResponse)\r\n * > - Type: [GetAllMakesResults](#GetAllMakesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetAllMakes extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Makes available in the vPIC Dataset.\r\n *\r\n * @async\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetAllMakes(): Promise {\r\n const action = 'GetAllMakes';\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetAllMakesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetAllMakes\r\n * @alias GetAllMakesResults\r\n */\r\nexport type GetAllMakesResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetAllMakes API Action.\r\n *\r\n * @memberof module:api/actions/GetAllMakes\r\n * @alias GetAllMakesResponse\r\n */\r\nexport type GetAllMakesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetAllManufacturers\r\n * @category Actions\r\n * @description GetAllManufacturers NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetAllManufacturers](module-api_actions_GetAllManufacturers.GetAllManufacturers.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetAllManufacturersResponse](#GetAllManufacturersResponse)\r\n * > - Type: [GetAllManufacturersResults](#GetAllManufacturersResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetAllManufacturers extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Manufacturers available in vPIC Dataset.\r\n * - `params.manufacturerType` allows the user to filter the list based on manufacturer type,\r\n * ('Incomplete Vehicles', 'Completed Vehicle Manufacturer', 'Incomplete Vehicle Manufacturer',\r\n * 'Intermediate Manufacturer', 'Final-Stage Manufacturer', 'Alterer', or any partial match of those strings).\r\n * - You can get a list of all manufacturer types with the following API Action:\r\n * `GetVehicleVariableValuesList('manufacturer type')`\r\n * - Results are provided in pages of 100 items.\r\n * - Provide a number value for `params.page` to specify 1st (default), 2nd, 3rd, Nth, etc page.\r\n *\r\n * @async\r\n * @param {object} [params={}] - Query Search Parameters to append to the URL.\r\n * @param {string} [params.manufacturerType] - See method description.\r\n * @param {number} [params.page] - Specify the page number (results returned 100 at a time).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetAllManufacturers(\r\n params: {\r\n manufacturerType?: string;\r\n page?: number;\r\n } = {}\r\n ): Promise {\r\n const action = 'GetAllManufacturers';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofManufacturerType = getTypeof(params.manufacturerType);\r\n if (params.manufacturerType && typeofManufacturerType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.manufacturerType\" argument must be of type string, got: ` +\r\n `<${typeofManufacturerType}> ${params.manufacturerType}`\r\n )\r\n );\r\n }\r\n\r\n const typeofPage = getTypeof(params.page);\r\n if (params.page && typeofPage !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.page\" argument must be of type number, got: ` +\r\n `<${typeofPage}> ${params.page}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetAllManufacturersResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetAllManufacturers\r\n * @alias GetAllManufacturersResults\r\n */\r\nexport type GetAllManufacturersResults = {\r\n Country: string;\r\n Mfr_CommonName: string;\r\n Mfr_ID: number;\r\n Mfr_Name: string;\r\n VehicleTypes: Array<{ isPrimary?: boolean; name?: string }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetAllManufacturers API Action.\r\n *\r\n * @memberof module:api/actions/GetAllManufacturers\r\n * @alias GetAllManufacturersResponse\r\n */\r\nexport type GetAllManufacturersResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetCanadianVehicleSpecifications\r\n * @category Actions\r\n * @description GetCanadianVehicleSpecifications NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetCanadianVehicleSpecifications](module-api_actions_GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetCanadianVehicleSpecificationsResponse](#GetCanadianVehicleSpecificationsResponse)\r\n * > - Type: [GetCanadianVehicleSpecificationsResults](#GetCanadianVehicleSpecificationsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetCanadianVehicleSpecifications extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * The Canadian Vehicle Specifications (CVS) consists of a database of original vehicle dimensions,\r\n * used primarily in collision investigation and reconstruction, combined with a search engine.\r\n *\r\n * The database is compiled annually by the Collision Investigation and Research Division of Transport Canada.\r\n * Visit official [Canadian Vehicle Specifications](http://www.carsp.ca/research/resources/safety-sources/canadian-vehicle-specifications/)\r\n * page for more details.\r\n *\r\n * This API action will return a 404 html error if any of the query parameters in params\r\n * are missing from the query string. This is the only API action with this behaviour. Therefore,\r\n * parameters are inserted into the query string as empty strings if not provided by the user.\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle (required) - Number, >= 1971.\r\n * @param {string} [params.make] - Vehicle's make, like \"Honda\", \"Toyota\", etc...\r\n * @param {string} [params.model] - Vehicle's model, like \"Pilot\", \"Focus\". Can also include some other elements like Body Type, Engine Model/size, etc...\r\n * @param {string} [params.units] - \"Metric\" (default), or \"US\" for United States customary units.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetCanadianVehicleSpecifications(params: {\r\n year: number;\r\n make?: string;\r\n model?: string;\r\n units?: string;\r\n }): Promise {\r\n const action = 'GetCanadianVehicleSpecifications';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n const typeofMake = getTypeof(params.make);\r\n if (params.make && typeofMake !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.make\" argument must be of type string, got: ` +\r\n `<${typeofMake}> ${params.make}`\r\n )\r\n );\r\n }\r\n\r\n const typeofModel = getTypeof(params.model);\r\n if (params.model && typeofModel !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.model\" argument must be of type string, got: ` +\r\n `<${typeofModel}> ${params.model}`\r\n )\r\n );\r\n }\r\n\r\n const typeofUnits = getTypeof(params.units);\r\n if (params.units && typeofUnits !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.units\" argument must be of type string, got: ` +\r\n `<${typeofUnits}> ${params.units}`\r\n )\r\n );\r\n }\r\n\r\n /* Set default query parameters to empty strings if not provided by the user */\r\n const make = params.make || '';\r\n const model = params.model || '';\r\n const units = params.units || '';\r\n\r\n const params_ = {\r\n year: params.year,\r\n make,\r\n model,\r\n units,\r\n };\r\n\r\n /*\r\n * Build the 'default' query string to be appended to the URL.\r\n *\r\n * Additionally, sets the allowEmptyStringValues option (2nd argument) to true because\r\n * this API action will return a 404 error if any of the query parameters are missing from the query string.\r\n * This is the only API action with this behaviour (\"year\" is the only param the user must provide).\r\n */\r\n const queryString = await this.buildQueryString(\r\n params_,\r\n true\r\n ).catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetCanadianVehicleSpecificationsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\r\n * @alias GetCanadianVehicleSpecificationsResults\r\n */\r\nexport type GetCanadianVehicleSpecificationsResults = {\r\n Specs: Array<{\r\n Name: string;\r\n Value: string;\r\n }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetCanadianVehicleSpecifications API Action.\r\n *\r\n * @memberof module:api/actions/GetCanadianVehicleSpecifications\r\n * @alias GetCanadianVehicleSpecificationsResponse\r\n */\r\nexport type GetCanadianVehicleSpecificationsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetEquipmentPlantCodes\r\n * @category Actions\r\n * @description GetEquipmentPlantCodes NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetEquipmentPlantCodes](module-api_actions_GetEquipmentPlantCodes.GetEquipmentPlantCodes.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetEquipmentPlantCodesResponse](#GetEquipmentPlantCodesResponse)\r\n * > - Type: [GetEquipmentPlantCodesResults](#GetEquipmentPlantCodesResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetEquipmentPlantCodes extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * Returns assigned Equipment Plant Codes. Can be filtered by Year, Equipment Type and Report Type.\r\n *\r\n * `params.year`:\r\n * - Only years >= 2016 are supported\r\n *\r\n * `params.equipmentType`:\r\n * - 1 (Tires)\r\n * - 3 (Brake Hoses)\r\n * - 13 (Glazing)\r\n * - 16 (Retread)\r\n *\r\n * `params.reportType`:\r\n * - 'New' (The Equipment Plant Code was assigned during the selected year).\r\n * - 'Updated' (The Equipment Plant data was modified during the selected year).\r\n * - 'Closed' (The Equipment Plant is no longer Active).\r\n * - 'All' (All Equipment Plant Codes regardless of year, including their status (active or closed)).\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\r\n * @param {number} params.equipmentType - Number equal to 1, 3, 13, or 16.\r\n * @param {string} params.reportType - 'New', 'Updated', 'Closed', or 'All'.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetEquipmentPlantCodes(params: {\r\n year: number;\r\n equipmentType: 1 | 3 | 13 | 16;\r\n reportType: 'New' | 'Updated' | 'Closed' | 'All';\r\n }): Promise {\r\n const action = 'GetEquipmentPlantCodes';\r\n\r\n /* Runtime typechecking */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n const typeofEquipmentType = getTypeof(params.equipmentType);\r\n if (typeofEquipmentType !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.equipmentType\" argument is required and must be of type number, got: ` +\r\n `<${typeofEquipmentType}> ${params.equipmentType}`\r\n )\r\n );\r\n }\r\n\r\n const typeofReportType = getTypeof(params.reportType);\r\n if (typeofReportType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.reportType\" argument is required and must be of type string, got: ` +\r\n `<${typeofReportType}> ${params.reportType}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetEquipmentPlantCodesResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetEquipmentPlantCodes\r\n * @alias GetEquipmentPlantCodesResults\r\n */\r\nexport type GetEquipmentPlantCodesResults = {\r\n Address: string;\r\n City: string;\r\n Country: string;\r\n DOTCode: string;\r\n Name: string;\r\n OldDotCode: string;\r\n PostalCode: string;\r\n StateProvince: string;\r\n Status: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetEquipmentPlantCodes API Action.\r\n *\r\n * @memberof module:api/actions/GetEquipmentPlantCodes\r\n * @alias GetEquipmentPlantCodesResponse\r\n */\r\nexport type GetEquipmentPlantCodesResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetMakeForManufacturer\r\n * @category Actions\r\n * @description GetMakeForManufacturer NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakeForManufacturer](module-api_actions_GetMakeForManufacturer.GetMakeForManufacturer.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakeForManufacturerResponse](#GetMakeForManufacturerResponse)\r\n * > - Type: [GetMakeForManufacturerResults](#GetMakeForManufacturerResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakeForManufacturer extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified manufacturer that is requested.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\r\n * (it accepts a partial manufacturer name as an input).\r\n * - `manufacturer` name can be a partial name, or a full name for more specificity\r\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\r\n * - Multiple results are returned in case of multiple matches.\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetMakeForManufacturer(\r\n manufacturer: string | number\r\n ): Promise {\r\n const action = 'GetMakeForManufacturer';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakeForManufacturerResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakeForManufacturer\r\n * @alias GetMakeForManufacturerResults\r\n */\r\nexport type GetMakeForManufacturerResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Mfr_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakeForManufacturer API Action.\r\n *\r\n * @memberof module:api/actions/GetMakeForManufacturer\r\n * @alias GetMakeForManufacturerResponse\r\n */\r\nexport type GetMakeForManufacturerResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetMakesForManufacturerAndYear\r\n * @category Actions\r\n * @description GetMakesForManufacturerAndYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakesForManufacturerAndYear](module-api_actions_GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakesForManufacturerAndYearResponse](#GetMakesForManufacturerAndYearResponse)\r\n * > - Type: [GetMakesForManufacturerAndYearResults](#GetMakesForManufacturerAndYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakesForManufacturerAndYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified manufacturer,\r\n * and whose Year From and Year To range cover the specified year.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name\r\n * (it accepts a partial manufacturer name as an input).\r\n * - Multiple results are returned in case of multiple matches.\r\n * - Manufacturer can be idenfitied by Id, a partial name, or a full name\r\n * (e.g., \"988\", \"HONDA\", \"HONDA OF CANADA MFG., INC.\", etc.).\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.year - Model year of the vehicle - Number, >= 2016.\r\n *\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetMakesForManufacturerAndYear(\r\n manufacturer: string | number,\r\n params: {\r\n year: number;\r\n }\r\n ): Promise {\r\n const action = 'GetMakesForManufacturerAndYear';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument is required and must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n const typeofYear = getTypeof(params.year);\r\n if (typeofYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.year\" argument is required and must be of type number, got: ` +\r\n `<${typeofYear}> ${params.year}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakesForManufacturerAndYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\r\n * @alias GetMakesForManufacturerAndYearResults\r\n */\r\nexport type GetMakesForManufacturerAndYearResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n MfrId: number;\r\n MfrName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakesForManufacturerAndYear API Action.\r\n *\r\n * @memberof module:api/actions/GetMakesForManufacturerAndYear\r\n * @alias GetMakesForManufacturerAndYearResponse\r\n */\r\nexport type GetMakesForManufacturerAndYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetMakesForVehicleType\r\n * @category Actions\r\n * @description GetMakesForVehicleType NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetMakesForVehicleType](module-api_actions_GetMakesForVehicleType.GetMakesForVehicleType.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetMakesForVehicleTypeResponse](#GetMakesForVehicleTypeResponse)\r\n * > - Type: [GetMakesForVehicleTypeResults](#GetMakesForVehicleTypeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetMakesForVehicleType extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Makes in the vPIC dataset for a specified vehicle type (`typeName`),\r\n * whose name is LIKE the vehicle type name in vPIC Dataset.\r\n * - Vehicle `typeName` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n * @param {string} typeName - A partial or full vehicle type name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetMakesForVehicleType(\r\n typeName: string\r\n ): Promise {\r\n const action = 'GetMakesForVehicleType';\r\n\r\n /* Runtime typechecking */\r\n const typeofTypeName = getTypeof(typeName);\r\n if (typeofTypeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"typeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofTypeName}> ${typeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${typeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetMakesForVehicleTypeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetMakesForVehicleType\r\n * @alias GetMakesForVehicleTypeResults\r\n */\r\nexport type GetMakesForVehicleTypeResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetMakesForVehicleType API Action.\r\n *\r\n * @memberof module:api/actions/GetMakesForVehicleType\r\n * @alias GetMakesForVehicleTypeResponse\r\n */\r\nexport type GetMakesForVehicleTypeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetManufacturerDetails\r\n * @category Actions\r\n * @description GetManufacturerDetails NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetManufacturerDetails](module-api_actions_GetManufacturerDetails.GetManufacturerDetails.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetManufacturerDetailsResponse](#GetManufacturerDetailsResponse)\r\n * > - Type: [GetManufacturerDetailsResults](#GetManufacturerDetailsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetManufacturerDetails extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides the details for a specific manufacturer that is requested.\r\n * - If supplied `manufacturer` is a number - method will do exact match on Manufacturer's Id.\r\n * - If supplied `manufacturer` is a string - it will look for manufacturers whose name is LIKE the provided name,\r\n * (it accepts a partial manufacturer name as an input).\r\n * - Multiple results are returned in case of multiple matches.\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name (string) or Manufacturer ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetManufacturerDetails(\r\n manufacturer: string | number\r\n ): Promise {\r\n const action = 'GetManufacturerDetails';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string' && typeofManufacturer !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetManufacturerDetailsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetManufacturerDetails\r\n * @alias GetManufacturerDetailsResults\r\n */\r\nexport type GetManufacturerDetailsResults = {\r\n Address: string;\r\n Address2: string;\r\n City: string;\r\n ContactEmail: string;\r\n ContactFax: string;\r\n ContactPhone: string;\r\n Country: string;\r\n DBAs: string;\r\n EquipmentItems: Array>;\r\n LastUpdated: string;\r\n ManufacturerTypes: Array<{\r\n Name: string;\r\n }>;\r\n Mfr_CommonName: string;\r\n Mfr_ID: number;\r\n Mfr_Name: string;\r\n OtherManufacturerDetails: string;\r\n PostalCode: string;\r\n PrimaryProduct: string;\r\n PrincipalFirstName: string;\r\n PrincipalLastName: string;\r\n PrincipalPosition: string;\r\n StateProvince: string;\r\n SubmittedName: string;\r\n SubmittedOn: string;\r\n SubmittedPosition: string;\r\n VehicleTypes: Array<{\r\n GVWRFrom: string;\r\n GVWRTo: string;\r\n IsPrimary: boolean;\r\n Name: string;\r\n }>;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetManufacturerDetails API Action.\r\n *\r\n * @memberof module:api/actions/GetManufacturerDetails\r\n * @alias GetManufacturerDetailsResponse\r\n */\r\nexport type GetManufacturerDetailsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMake\r\n * @category Actions\r\n * @description GetModelsForMake NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMake](module-api_actions_GetModelsForMake.GetModelsForMake.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeResponse](#GetModelsForMakeResponse)\r\n * > - Type: [GetModelsForMakeResults](#GetModelsForMakeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMake extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified `makeName`\r\n * whose Name is LIKE the Make in vPIC Dataset.\r\n * - `makeName` can be a partial, or a full for more specificity\r\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\r\n *\r\n * @async\r\n * @param {string} makeName - Vehicle make name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMake(makeName: string): Promise {\r\n const action = 'GetModelsForMake';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeName = getTypeof(makeName);\r\n if (typeofMakeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofMakeName}> ${makeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMake\r\n * @alias GetModelsForMakeResults\r\n */\r\nexport type GetModelsForMakeResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMake API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMake\r\n * @alias GetModelsForMakeResponse\r\n */\r\nexport type GetModelsForMakeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMakeId\r\n * @category Actions\r\n * @description GetModelsForMakeId NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeId](module-api_actions_GetModelsForMakeId.GetModelsForMakeId.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeIdResponse](#GetModelsForMakeIdResponse)\r\n * > - Type: [GetModelsForMakeIdResults](#GetModelsForMakeIdResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeId extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Make\r\n * whose Id is equal to the `makeId` in the vPIC Dataset.\r\n *\r\n * @async\r\n * @param {number} makeID - Vehicle make ID (number).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeId(\r\n makeID: number\r\n ): Promise {\r\n const action = 'GetModelsForMakeId';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeId = getTypeof(makeID);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeID}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString({}).catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeId\r\n * @alias GetModelsForMakeIdResults\r\n */\r\nexport type GetModelsForMakeIdResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeId API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeId\r\n * @alias GetModelsForMakeIdResponse\r\n */\r\nexport type GetModelsForMakeIdResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMakeIdYear\r\n * @category Actions\r\n * @description GetModelsForMakeIdYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeIdYear](module-api_actions_GetModelsForMakeIdYear.GetModelsForMakeIdYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeIdYearResponse](#GetModelsForMakeIdYearResponse)\r\n * > - Type: [GetModelsForMakeIdYearResults](#GetModelsForMakeIdYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeIdYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Model Year\r\n * and Make whose name is LIKE the Make in the vPIC Dataset.\r\n * - `params.makeId` is a number and is a required query parameter.\r\n *\r\n * A minimum of one of the following are required (or a combination of both):\r\n * - `params.modelYear` is a number (greater than 1995)\r\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {number} params.makeId - Make ID to search.\r\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\r\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeIdYear(params: {\r\n makeId: number;\r\n modelYear?: number;\r\n vehicleType?: string;\r\n }): Promise {\r\n const action = 'GetModelsForMakeIdYear';\r\n\r\n const makeId: number = params?.makeId;\r\n const modelYear: number | undefined = params?.modelYear;\r\n const vehicleType: string | undefined = params?.vehicleType;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n /* Required makeId param of type number */\r\n const typeofMakeId = getTypeof(makeId);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeId}`\r\n )\r\n );\r\n }\r\n /* At least one of modelYear or vehicleType params is required */\r\n if (!modelYear && !vehicleType) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\r\n `${modelYear} | ${vehicleType}`\r\n )\r\n );\r\n }\r\n /* valid modelYear param of type number */\r\n const typeofModelYear = getTypeof(modelYear);\r\n if (modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" must be of type number, got: ` +\r\n `<${typeofModelYear}> ${modelYear}`\r\n )\r\n );\r\n }\r\n /* valid vehicleType param of type string */\r\n const typeofVehicleType = getTypeof(vehicleType);\r\n if (vehicleType && typeofVehicleType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\r\n `<${typeofVehicleType}> ${vehicleType}`\r\n )\r\n );\r\n }\r\n\r\n /* Beginning of the the actionUrl */\r\n let actionUrl = `${action}/makeId/${makeId}/`;\r\n\r\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\r\n if (modelYear && vehicleType) {\r\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\r\n } else if (modelYear) {\r\n actionUrl += `modelYear/${modelYear}`;\r\n } else {\r\n actionUrl += `vehicleType/${vehicleType}`;\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeIdYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeIdYear\r\n * @alias GetModelsForMakeIdYearResults\r\n */\r\nexport type GetModelsForMakeIdYearResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeIdYear API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeIdYear\r\n * @alias GetModelsForMakeIdYearResponse\r\n */\r\nexport type GetModelsForMakeIdYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetModelsForMakeYear\r\n * @category Actions\r\n * @description GetModelsForMakeYear NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetModelsForMakeYear](module-api_actions_GetModelsForMakeYear.GetModelsForMakeYear.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetModelsForMakeYearResponse](#GetModelsForMakeYearResponse)\r\n * > - Type: [GetModelsForMakeYearResults](#GetModelsForMakeYearResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetModelsForMakeYear extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns the Models in the vPIC dataset for a specified Model Year\r\n * and Make whose name is LIKE the Make in the vPIC Dataset.\r\n * - `params.make` is required. It can be a partial, or a full name for more specificity\r\n * (e.g., \"Harley\", \"Harley Davidson\", etc.).\r\n *\r\n * A minimum of one of the following are required (or a combination of both):\r\n * - `params.modelYear` is a number (greater than 1995)\r\n * - `params.vehicleType` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Vehicle\", \"Moto\", \"Low Speed Vehicle\", etc.).\r\n *\r\n * @async\r\n *\r\n * @param {object} params - Query Search Parameters to append to the URL.\r\n * @param {string} params.make - Make name to search.\r\n * @param {number} [params.modelYear] - A number representing the model year to search (greater than 1995).\r\n * @param {string} [params.vehicleType] - String representing the vehicle type to search.\r\n *\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetModelsForMakeYear(params: {\r\n make: string;\r\n modelYear?: number;\r\n vehicleType?: string;\r\n }): Promise {\r\n const action = 'GetModelsForMakeYear';\r\n\r\n const make: string = params?.make;\r\n const modelYear: number | undefined = params?.modelYear;\r\n const vehicleType: string | undefined = params?.vehicleType;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: ` +\r\n `<${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n /* Required make param of type string */\r\n const typeofMake = getTypeof(make);\r\n if (typeofMake !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.make\" argument is required and must be of type string, got: ` +\r\n `<${typeofMake}> ${make}`\r\n )\r\n );\r\n }\r\n /* At least one of modelYear or vehicleType params is required */\r\n if (!modelYear && !vehicleType) {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, either one of \"params.modelYear\" or \"params.vehicleType\" is required, got: ` +\r\n `${modelYear} | ${vehicleType}`\r\n )\r\n );\r\n }\r\n /* valid modelYear param of type number */\r\n const typeofModelYear = getTypeof(modelYear);\r\n if (modelYear && typeofModelYear !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.modelYear\" must be of type number, got: ` +\r\n `<${typeofModelYear}> ${modelYear}`\r\n )\r\n );\r\n }\r\n /* valid vehicleType param of type string */\r\n const typeofVehicleType = getTypeof(vehicleType);\r\n if (vehicleType && typeofVehicleType !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.vehicleType\" must be of type string, got: ` +\r\n `<${typeofVehicleType}> ${vehicleType}`\r\n )\r\n );\r\n }\r\n\r\n /* Beginning of the the actionUrl */\r\n let actionUrl = `${action}/make/${params.make}/`;\r\n\r\n /* Append params.modelYear and params.vehicleType to the actionUrl, at least one is required by the API */\r\n if (modelYear && vehicleType) {\r\n actionUrl += `modelYear/${modelYear}/vehicleType/${vehicleType}`;\r\n } else if (modelYear) {\r\n actionUrl += `modelYear/${modelYear}`;\r\n } else {\r\n actionUrl += `vehicleType/${vehicleType}`;\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err: Error) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${actionUrl}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err: Error) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetModelsForMakeYearResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeYear\r\n * @alias GetModelsForMakeYearResults\r\n */\r\nexport type GetModelsForMakeYearResults = {\r\n Make_ID: number;\r\n Make_Name: string;\r\n Model_ID: number;\r\n Model_Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetModelsForMakeYear API Action.\r\n *\r\n * @memberof module:api/actions/GetModelsForMakeYear\r\n * @alias GetModelsForMakeYearResponse\r\n */\r\nexport type GetModelsForMakeYearResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetParts\r\n * @category Actions\r\n * @description GetParts NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetParts](module-api_actions_GetParts.GetParts.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetPartsResponse](#GetPartsResponse)\r\n * > - Type: [GetPartsResults](#GetPartsResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetParts extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of ORGs with letter date in the given range of the dates\r\n * and with specified Type (`params.type`) of ORG.\r\n * - Up to 1000 results will be returned at a time.\r\n * - Get the next page by incrementing the `params.page` query parameter.\r\n * - All query `params` are optional.\r\n *\r\n * @async\r\n * @param {object} [params] - Query Search Parameters to append to the URL.\r\n * @param {number} [params.type] - Specified type of ORG to search.\r\n * @param {string} [params.fromDate] - Start date of search query.\r\n * @param {string} [params.toDate] - End date of search query.\r\n * @param {number} [params.page] - Which page number of results to request (100 results per page).\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetParts(params?: {\r\n type?: number;\r\n fromDate?: string;\r\n toDate?: string;\r\n page?: number;\r\n }): Promise {\r\n const action = 'GetParts';\r\n\r\n const type: number | undefined = params?.type;\r\n const fromDate: string | undefined = params?.fromDate;\r\n const toDate: string | undefined = params?.toDate;\r\n const page: number | undefined = params?.page;\r\n\r\n /* Valid params object */\r\n const typeofParams = getTypeof(params);\r\n if (params && typeofParams !== 'object') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params\" argument must be of type object, got: <${typeofParams}> ${params}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.type of type number */\r\n const typeofType = getTypeof(type);\r\n if (type && typeofType !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.type\" argument must be of type number, got: <${typeofType}> ${type}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.fromDate of type string */\r\n const typeofFromDate = getTypeof(fromDate);\r\n if (fromDate && typeofFromDate !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.fromDate\" argument must be of type string, got: <${typeofFromDate}> ${fromDate}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.toDate of type number */\r\n const typeofToDate = getTypeof(toDate);\r\n if (toDate && typeofToDate !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.toDate\" argument must be of type string, got: <${typeofToDate}> ${toDate}`\r\n )\r\n );\r\n }\r\n\r\n /* valid params.page of type number */\r\n const typeofPage = getTypeof(page);\r\n if (page && typeofPage !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"params.page\" argument must be of type number, got: <${typeofPage}> ${page}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString(params).catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetPartsResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetParts\r\n * @alias GetPartsResults\r\n */\r\nexport type GetPartsResults = {\r\n CoverLetterURL: string;\r\n LetterDate: string;\r\n ManufacturerId: number;\r\n ManufacturerName: string;\r\n ModelYearFrom: string;\r\n ModelYearTo: string;\r\n Name: string;\r\n Type: string;\r\n URL: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetParts API Action.\r\n *\r\n * @memberof module:api/actions/GetParts\r\n * @alias GetPartsResponse\r\n */\r\nexport type GetPartsResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleTypesForMake\r\n * @category Actions\r\n * @description GetVehicleTypesForMake NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleTypesForMake](module-api_actions_GetVehicleTypesForMake.GetVehicleTypesForMake.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleTypesForMakeResponse](#GetVehicleTypesForMakeResponse)\r\n * > - Type: [GetVehicleTypesForMakeResults](#GetVehicleTypesForMakeResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleTypesForMake extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make,\r\n * whose name is LIKE the make name in the vPIC Dataset.\r\n * - `makeName` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\r\n *\r\n * @async\r\n * @param {string} makeName - Name of the vehicle make to search.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleTypesForMake(\r\n makeName: string\r\n ): Promise {\r\n const action = 'GetVehicleTypesForMake';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeName = getTypeof(makeName);\r\n if (typeofMakeName !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeName\" argument is required and must be of type string, got: ` +\r\n `<${typeofMakeName}> ${makeName}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeName}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMake\r\n * @alias GetVehicleTypesForMakeResults\r\n */\r\nexport type GetVehicleTypesForMakeResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleTypesForMake API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMake\r\n * @alias GetVehicleTypesForMakeResponse\r\n */\r\nexport type GetVehicleTypesForMakeResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleTypesForMakeId\r\n * @category Actions\r\n * @description GetVehicleTypesForMakeId NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleTypesForMakeId](module-api_actions_GetVehicleTypesForMakeId.GetVehicleTypesForMakeId.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleTypesForMakeIdResponse](#GetVehicleTypesForMakeIdResponse)\r\n * > - Type: [GetVehicleTypesForMakeIdResults](#GetVehicleTypesForMakeIdResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleTypesForMakeId extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This returns all the Vehicle Types in the vPIC dataset for a specified Make and\r\n * whose ID equals the make ID in the vPIC Dataset.\r\n *\r\n * @async\r\n * @param {number} makeID - Vehicle make ID.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleTypesForMakeId(\r\n makeID: number\r\n ): Promise {\r\n const action = 'GetVehicleTypesForMakeId';\r\n\r\n /* Runtime typechecking */\r\n const typeofMakeId = getTypeof(makeID);\r\n if (typeofMakeId !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"makeId\" argument is required and must be of type number, got: ` +\r\n `<${typeofMakeId}> ${makeID}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${makeID}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleTypesForMakeIdResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMakeId\r\n * @alias GetVehicleTypesForMakeIdResults\r\n */\r\nexport type GetVehicleTypesForMakeIdResults = {\r\n MakeId: number;\r\n MakeName: string;\r\n VehicleTypeId: number;\r\n VehicleTypeName: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleTypesForMakeId API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleTypesForMakeId\r\n * @alias GetVehicleTypesForMakeIdResponse\r\n */\r\nexport type GetVehicleTypesForMakeIdResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleVariableList\r\n * @category Actions\r\n * @description GetVehicleVariableList NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleVariableList](module-api_actions_GetVehicleVariableList.GetVehicleVariableList.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleVariableListResponse](#GetVehicleVariableListResponse)\r\n * > - Type: [GetVehicleVariableListResults](#GetVehicleVariableListResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleVariableList extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the Vehicle related variables that are in the vPIC dataset.\r\n * - Information on the name, description and the type of the variable is provided.\r\n *\r\n * @async\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n public async GetVehicleVariableList(): Promise {\r\n const action = 'GetVehicleVariableList';\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleVariableListResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableList\r\n * @alias GetVehicleVariableListResults\r\n */\r\nexport type GetVehicleVariableListResults = {\r\n DataType: string;\r\n Description: string;\r\n ID: number;\r\n Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleVariableList API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableList\r\n * @alias GetVehicleVariableListResponse\r\n */\r\nexport type GetVehicleVariableListResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetVehicleVariableValuesList\r\n * @category Actions\r\n * @description GetVehicleVariableValuesList NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetVehicleVariableValuesList](module-api_actions_GetVehicleVariableValuesList.GetVehicleVariableValuesList.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetVehicleVariableValuesListResponse](#GetVehicleVariableValuesListResponse)\r\n * > - Type: [GetVehicleVariableValuesListResults](#GetVehicleVariableValuesListResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetVehicleVariableValuesList extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * This provides a list of all the accepted values for a given variable that are stored in the vPIC dataset.\r\n *\r\n * This applies to only \"Look up\" type of variables.\r\n * - `variableValue` can either be a:\r\n * - Variable Name (\"battery type\" in first example, please use full name, not just part of it),\r\n * - or Variable ID (number).\r\n *\r\n * @async\r\n * @param {string|number} variableValue - The variable you want to get a values list of.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetVehicleVariableValuesList(\r\n variableValue: string | number\r\n ): Promise {\r\n const action = 'GetVehicleVariableValuesList';\r\n\r\n /* Runtime typechecking */\r\n const typeofVariableValue = getTypeof(variableValue);\r\n if (typeofVariableValue !== 'string' && typeofVariableValue !== 'number') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"variableValue\" argument is required and must be of type string or number, got: ` +\r\n `<${typeofVariableValue}> ${variableValue}`\r\n )\r\n );\r\n }\r\n /* Encode to a valid URI string (space chars, etc.) if variableValue is a string*/\r\n if (typeofVariableValue === 'string') {\r\n variableValue = encodeURI(variableValue as string);\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${variableValue}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetVehicleVariableValuesListResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableValuesList\r\n * @alias GetVehicleVariableValuesListResults\r\n */\r\nexport type GetVehicleVariableValuesListResults = {\r\n ElementName: string;\r\n Id: number;\r\n Name: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetVehicleVariableValuesList API Action.\r\n *\r\n * @memberof module:api/actions/GetVehicleVariableValuesList\r\n * @alias GetVehicleVariableValuesListResponse\r\n */\r\nexport type GetVehicleVariableValuesListResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n","/**\r\n * @module api/actions/GetWMIsForManufacturer\r\n * @category Actions\r\n * @description GetWMIsForManufacturer NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetWMIsForManufacturer](module-api_actions_GetWMIsForManufacturer.GetWMIsForManufacturer.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetWMIsForManufacturerResponse](#GetWMIsForManufacturerResponse)\r\n * > - Type: [GetWMIsForManufacturerResults](#GetWMIsForManufacturerResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetWMIsForManufacturer extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * Provides information on the World Manufacturer Identifier (WMI) for a specified `manufacturer`.\r\n * - Only WMIs registered in vPICList are displayed.\r\n * - `manufacturer` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetWMIsForManufacturer(\r\n manufacturer: string\r\n ): Promise {\r\n const action = 'GetWMIsForManufacturer';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetWMIsForManufacturerResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetWMIsForManufacturer\r\n * @alias GetWMIsForManufacturerResults\r\n */\r\nexport type GetWMIsForManufacturerResults = {\r\n Country: string;\r\n CreatedOn: string;\r\n DateAvailableToPublic: string;\r\n Id: number;\r\n Name: string;\r\n UpdatedOn: string;\r\n VehicleType: string;\r\n WMI: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetWMIsForManufacturer API Action.\r\n *\r\n * @memberof module:api/actions/GetWMIsForManufacturer\r\n * @alias GetWMIsForManufacturerResponse\r\n */\r\nexport type GetWMIsForManufacturerResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["DecodeVin","Fetch","[object Object]","userConfig","super","vin","params","action","typeofParams","getTypeof","Promise","reject","Error","typeofVin","typeofModelYear","modelYear","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response","DecodeVinExtended","DecodeVinValues","DecodeVINValuesBatch","inputString","typeofInputString","body","encodeURI","method","headers","content-type","DecodeVinValuesExtended","DecodeWMI","WMI","typeofWMI","GetAllMakes","GetAllManufacturers","typeofManufacturerType","manufacturerType","typeofPage","page","GetCanadianVehicleSpecifications","typeofYear","year","typeofMake","make","typeofModel","model","typeofUnits","units","params_","GetEquipmentPlantCodes","typeofEquipmentType","equipmentType","typeofReportType","reportType","GetMakeForManufacturer","manufacturer","typeofManufacturer","GetMakesForManufacturerAndYear","GetMakesForVehicleType","typeName","typeofTypeName","GetManufacturerDetails","GetModelsForMake","makeName","typeofMakeName","GetModelsForMakeId","makeID","typeofMakeId","GetModelsForMakeIdYear","makeId","vehicleType","typeofVehicleType","actionUrl","GetModelsForMakeYear","GetParts","type","fromDate","toDate","typeofType","typeofFromDate","typeofToDate","GetVehicleTypesForMake","GetVehicleTypesForMakeId","GetVehicleVariableList","GetVehicleVariableValuesList","variableValue","typeofVariableValue","GetWMIsForManufacturer"],"mappings":"4DAgCaA,UAAkBC,EAC7BC,YAAYC,GACVC,MAAMD,GAmBFD,UACJG,EACAC,4CAIA,MAAMC,EAAS,YAGTC,EAAeC,EAAUH,GAC/B,GAAIA,GAA2B,WAAjBE,EACZ,OAAOE,QAAQC,OACb,IAAIC,MAEA,8DAAIJ,MAAiBF,MAK7B,MAAMO,EAAYJ,EAAUJ,GAC5B,GAAkB,WAAdQ,EACF,OAAOH,QAAQC,OACb,IAAIC,MAEA,2EAAIC,MAAcR,MAK1B,MAAMS,EAA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ACNV,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Ba,iBCnDrD0E,UAA+B7F,EAC1CC,YAAYC,GACVC,MAAMD,GAaFD,uBACJ4D,4CAEA,MAAMvD,EAAS,yBAGTwD,EAAqBtD,EAAUqD,GACrC,GAA2B,WAAvBC,EACF,OAAOrD,QAAQC,OACb,IAAIC,MAEA,iGAAImD,MAAuBD,MAMnC,MAAM9C,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDV,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCa,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWf,KAAUuD,IAAe9C,IAGxD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNV,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8Ba"} \ No newline at end of file diff --git a/dist/module/GetWMIsForManufacturer.js b/dist/module/GetWMIsForManufacturer.js index 765a461e2..cf3c92885 100644 --- a/dist/module/GetWMIsForManufacturer.js +++ b/dist/module/GetWMIsForManufacturer.js @@ -1,2 +1,2 @@ -import{F as r,_ as e,g as t}from"./Fetch-b3914c0a.js";class s extends r{constructor(r){super(r)}GetWMIsForManufacturer(r){return e(this,void 0,void 0,(function*(){const e="GetWMIsForManufacturer",s=t(r);if("string"!==s)return Promise.reject(new Error(`GetWMIsForManufacturer, "manufacturer" argument is required and must be of type string, got: <${s}> ${r}`));const n=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),i=`${this.baseUrl}/${e}/${r}${n}`;return yield this.get(i).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{s as GetWMIsForManufacturer}; +import{F as r,_ as e,g as t}from"./Fetch-44aa28fd.js";class s extends r{constructor(r){super(r)}GetWMIsForManufacturer(r){return e(this,void 0,void 0,(function*(){const e="GetWMIsForManufacturer",s=t(r);if("string"!==s)return Promise.reject(new Error(`GetWMIsForManufacturer, "manufacturer" argument is required and must be of type string, got: <${s}> ${r}`));const n=yield this.buildQueryString().catch(r=>Promise.reject(new Error(`${e}, Error building query string: ${r}`))),i=`${this.baseUrl}/${e}/${r}${n}`;return yield this.get(i).then(r=>r).catch(r=>Promise.reject(new Error(`${e}, Fetch.get() error: ${r}`)))}))}}export{s as GetWMIsForManufacturer}; //# sourceMappingURL=GetWMIsForManufacturer.js.map diff --git a/dist/module/GetWMIsForManufacturer.js.map b/dist/module/GetWMIsForManufacturer.js.map index 8669a099d..a18c873d5 100644 --- a/dist/module/GetWMIsForManufacturer.js.map +++ b/dist/module/GetWMIsForManufacturer.js.map @@ -1 +1 @@ -{"version":3,"file":"GetWMIsForManufacturer.js","sources":["../../src/api/actions/GetWMIsForManufacturer.ts"],"sourcesContent":["/**\r\n * @module api/actions/GetWMIsForManufacturer\r\n * @category Actions\r\n * @description GetWMIsForManufacturer NHSTA Api Action.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [GetWMIsForManufacturer](module-api_actions_GetWMIsForManufacturer.GetWMIsForManufacturer.html)\r\n * >\r\n * > **Types**\r\n * > - Type: [GetWMIsForManufacturerResponse](#GetWMIsForManufacturerResponse)\r\n * > - Type: [GetWMIsForManufacturerResults](#GetWMIsForManufacturerResults)\r\n *\r\n */\r\n\r\n/* Parent Class and Fetch Types */\r\nimport {\r\n Fetch /* Class */,\r\n FetchConfig /* Type */,\r\n FetchResponse /* Type */,\r\n} from '../Fetch';\r\n\r\n/* Utility Functions */\r\nimport { getTypeof } from '../../utils';\r\n\r\n/**\r\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\r\n *\r\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\r\n *\r\n * @category Actions\r\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\r\n */\r\nexport class GetWMIsForManufacturer extends Fetch {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n\r\n /**\r\n * Provides information on the World Manufacturer Identifier (WMI) for a specified `manufacturer`.\r\n * - Only WMIs registered in vPICList are displayed.\r\n * - `manufacturer` can be a partial name, or a full name for more specificity\r\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\r\n *\r\n * @async\r\n * @param {string|number} manufacturer - Manufacturer Name.\r\n * @returns {(Promise)} Api Response object.\r\n */\r\n async GetWMIsForManufacturer(\r\n manufacturer: string\r\n ): Promise {\r\n const action = 'GetWMIsForManufacturer';\r\n\r\n /* Runtime typechecking */\r\n const typeofManufacturer = getTypeof(manufacturer);\r\n if (typeofManufacturer !== 'string') {\r\n return Promise.reject(\r\n new Error(\r\n `${action}, \"manufacturer\" argument is required and must be of type string, got: ` +\r\n `<${typeofManufacturer}> ${manufacturer}`\r\n )\r\n );\r\n }\r\n\r\n /* Build the 'default' query string to be appended to the URL*/\r\n const queryString = await this.buildQueryString().catch((err) =>\r\n Promise.reject(\r\n new Error(`${action}, Error building query string: ${err}`)\r\n )\r\n );\r\n\r\n /* Build the final request URL*/\r\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\r\n\r\n /* Return the result */\r\n return await this.get(url)\r\n .then((response) => response)\r\n .catch((err) =>\r\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Type representing the structure of objects found in the '{@link GetWMIsForManufacturerResponse}.Results' array.\r\n *\r\n * @memberof module:api/actions/GetWMIsForManufacturer\r\n * @alias GetWMIsForManufacturerResults\r\n */\r\nexport type GetWMIsForManufacturerResults = {\r\n Country: string;\r\n CreatedOn: string;\r\n DateAvailableToPublic: string;\r\n Id: number;\r\n Name: string;\r\n UpdatedOn: string;\r\n VehicleType: string;\r\n WMI: string;\r\n};\r\n\r\n/**\r\n * Type representing the complete response returned by the GetWMIsForManufacturer API Action.\r\n *\r\n * @memberof module:api/actions/GetWMIsForManufacturer\r\n * @alias GetWMIsForManufacturerResponse\r\n */\r\nexport type GetWMIsForManufacturerResponse = {\r\n /** A count of the items returned in the Results array. */\r\n Count: number;\r\n /** A message describing the Results array. */\r\n Message: string;\r\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\r\n SearchCriteria: string;\r\n /** The search results returned by the NHSTA API request. */\r\n Results: Array;\r\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\r\n FetchResponse: FetchResponse;\r\n};\r\n"],"names":["GetWMIsForManufacturer","Fetch","[object Object]","userConfig","super","manufacturer","action","typeofManufacturer","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAaFD,uBACJG,4CAEA,MAAMC,EAAS,yBAGTC,EAAqBC,EAAUH,GACrC,GAA2B,WAAvBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,iGAAIJ,MAAuBF,MAMnC,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAeO,IAGxD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file +{"version":3,"file":"GetWMIsForManufacturer.js","sources":["../../src/api/actions/GetWMIsForManufacturer.ts"],"sourcesContent":["/**\n * @module api/actions/GetWMIsForManufacturer\n * @category Actions\n * @description GetWMIsForManufacturer NHSTA Api Action.\n *\n * > **Module Exports**:\n * > - Class: [GetWMIsForManufacturer](module-api_actions_GetWMIsForManufacturer.GetWMIsForManufacturer.html)\n * >\n * > **Types**\n * > - Type: [GetWMIsForManufacturerResponse](#GetWMIsForManufacturerResponse)\n * > - Type: [GetWMIsForManufacturerResults](#GetWMIsForManufacturerResults)\n *\n */\n\n/* Parent Class and Fetch Types */\nimport {\n Fetch /* Class */,\n FetchConfig /* Type */,\n FetchResponse /* Type */,\n} from '../Fetch';\n\n/* Utility Functions */\nimport { getTypeof } from '../../utils';\n\n/**\n * Implemented by [NHTSA](module-api_NHTSA-NHTSA.html).\n *\n * Extends [api/Fetch.Fetch](module-api_Fetch.Fetch.html).\n *\n * @category Actions\n * @param {FetchConfig} [userConfig] - User configuration options to construct the class with.\n */\nexport class GetWMIsForManufacturer extends Fetch {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n\n /**\n * Provides information on the World Manufacturer Identifier (WMI) for a specified `manufacturer`.\n * - Only WMIs registered in vPICList are displayed.\n * - `manufacturer` can be a partial name, or a full name for more specificity\n * (e.g., \"Merc\", \"Mercedes Benz\", etc.).\n *\n * @async\n * @param {string|number} manufacturer - Manufacturer Name.\n * @returns {(Promise)} Api Response object.\n */\n async GetWMIsForManufacturer(\n manufacturer: string\n ): Promise {\n const action = 'GetWMIsForManufacturer';\n\n /* Runtime typechecking */\n const typeofManufacturer = getTypeof(manufacturer);\n if (typeofManufacturer !== 'string') {\n return Promise.reject(\n new Error(\n `${action}, \"manufacturer\" argument is required and must be of type string, got: ` +\n `<${typeofManufacturer}> ${manufacturer}`\n )\n );\n }\n\n /* Build the 'default' query string to be appended to the URL*/\n const queryString = await this.buildQueryString().catch((err) =>\n Promise.reject(\n new Error(`${action}, Error building query string: ${err}`)\n )\n );\n\n /* Build the final request URL*/\n const url = `${this.baseUrl}/${action}/${manufacturer}${queryString}`;\n\n /* Return the result */\n return await this.get(url)\n .then((response) => response)\n .catch((err) =>\n Promise.reject(new Error(`${action}, Fetch.get() error: ${err}`))\n );\n }\n}\n\n/**\n * Type representing the structure of objects found in the '{@link GetWMIsForManufacturerResponse}.Results' array.\n *\n * @memberof module:api/actions/GetWMIsForManufacturer\n * @alias GetWMIsForManufacturerResults\n */\nexport type GetWMIsForManufacturerResults = {\n Country: string;\n CreatedOn: string;\n DateAvailableToPublic: string;\n Id: number;\n Name: string;\n UpdatedOn: string;\n VehicleType: string;\n WMI: string;\n};\n\n/**\n * Type representing the complete response returned by the GetWMIsForManufacturer API Action.\n *\n * @memberof module:api/actions/GetWMIsForManufacturer\n * @alias GetWMIsForManufacturerResponse\n */\nexport type GetWMIsForManufacturerResponse = {\n /** A count of the items returned in the Results array. */\n Count: number;\n /** A message describing the Results array. */\n Message: string;\n /** Search terms (VIN, WMI, manufacturer, etc.) used in the request URL. */\n SearchCriteria: string;\n /** The search results returned by the NHSTA API request. */\n Results: Array;\n /** [Fetch API Response](https://github.github.io/fetch/#Response) properties. */\n FetchResponse: FetchResponse;\n};\n"],"names":["GetWMIsForManufacturer","Fetch","[object Object]","userConfig","super","manufacturer","action","typeofManufacturer","getTypeof","Promise","reject","Error","queryString","this","buildQueryString","catch","err","url","baseUrl","get","then","response"],"mappings":"4DAgCaA,UAA+BC,EAC1CC,YAAYC,GACVC,MAAMD,GAaFD,uBACJG,4CAEA,MAAMC,EAAS,yBAGTC,EAAqBC,EAAUH,GACrC,GAA2B,WAAvBE,EACF,OAAOE,QAAQC,OACb,IAAIC,MAEA,iGAAIJ,MAAuBF,MAMnC,MAAMO,QAAoBC,KAAKC,mBAAmBC,MAAOC,GACvDP,QAAQC,OACN,IAAIC,MAAM,GAAGL,mCAAwCU,OAKnDC,EAAM,GAAGJ,KAAKK,WAAWZ,KAAUD,IAAeO,IAGxD,aAAaC,KAAKM,IAAIF,GACnBG,KAAMC,GAAaA,GACnBN,MAAOC,GACNP,QAAQC,OAAO,IAAIC,MAAM,GAAGL,yBAA8BU"} \ No newline at end of file diff --git a/dist/module/NHTSA.js b/dist/module/NHTSA.js index 5f2239953..812762452 100644 --- a/dist/module/NHTSA.js +++ b/dist/module/NHTSA.js @@ -1,2 +1,2 @@ -import{F as e}from"./Fetch-b3914c0a.js";import{D as t,a,b as o,c as s,d as r,e as i,G as p,f as c,g as l,h as M,i as d,j as h,k as n,l as G,m as u,n as V,o as y,p as F,q as k,r as f,s as D,t as I,u as m,v as b}from"./GetWMIsForManufacturer-a7ef6c3c.js";class x extends e{constructor(e){super(e),this.DecodeVin=t.prototype.DecodeVin,this.DecodeVinExtended=a.prototype.DecodeVinExtended,this.DecodeVinValues=o.prototype.DecodeVinValues,this.DecodeVINValuesBatch=s.prototype.DecodeVINValuesBatch,this.DecodeVinValuesExtended=r.prototype.DecodeVinValuesExtended,this.DecodeWMI=i.prototype.DecodeWMI,this.GetAllMakes=p.prototype.GetAllMakes,this.GetAllManufacturers=c.prototype.GetAllManufacturers,this.GetCanadianVehicleSpecifications=l.prototype.GetCanadianVehicleSpecifications,this.GetEquipmentPlantCodes=M.prototype.GetEquipmentPlantCodes,this.GetMakeForManufacturer=d.prototype.GetMakeForManufacturer,this.GetMakesForManufacturerAndYear=h.prototype.GetMakesForManufacturerAndYear,this.GetMakesForVehicleType=n.prototype.GetMakesForVehicleType,this.GetManufacturerDetails=G.prototype.GetManufacturerDetails,this.GetModelsForMake=u.prototype.GetModelsForMake,this.GetModelsForMakeId=V.prototype.GetModelsForMakeId,this.GetModelsForMakeIdYear=y.prototype.GetModelsForMakeIdYear,this.GetModelsForMakeYear=F.prototype.GetModelsForMakeYear,this.GetParts=k.prototype.GetParts,this.GetVehicleTypesForMake=f.prototype.GetVehicleTypesForMake,this.GetVehicleTypesForMakeId=D.prototype.GetVehicleTypesForMakeId,this.GetVehicleVariableList=I.prototype.GetVehicleVariableList,this.GetVehicleVariableValuesList=m.prototype.GetVehicleVariableValuesList,this.GetWMIsForManufacturer=b.prototype.GetWMIsForManufacturer}}export{x as NHTSA}; +import{F as e}from"./Fetch-44aa28fd.js";import{DecodeVin as t}from"./DecodeVin.js";import{DecodeVinExtended as o}from"./DecodeVinExtended.js";import{DecodeVinValues as r}from"./DecodeVinValues.js";import{DecodeVINValuesBatch as a}from"./DecodeVINValuesBatch.js";import{DecodeVinValuesExtended as s}from"./DecodeVinValuesExtended.js";import{DecodeWMI as i}from"./DecodeWMI.js";import{GetAllMakes as p}from"./GetAllMakes.js";import{GetAllManufacturers as l}from"./GetAllManufacturers.js";import{GetCanadianVehicleSpecifications as c}from"./GetCanadianVehicleSpecifications.js";import{GetEquipmentPlantCodes as M}from"./GetEquipmentPlantCodes.js";import{GetMakeForManufacturer as d}from"./GetMakeForManufacturer.js";import{GetMakesForManufacturerAndYear as G}from"./GetMakesForManufacturerAndYear.js";import{GetMakesForVehicleType as m}from"./GetMakesForVehicleType.js";import{GetManufacturerDetails as n}from"./GetManufacturerDetails.js";import{GetModelsForMake as V}from"./GetModelsForMake.js";import{GetModelsForMakeId as u}from"./GetModelsForMakeId.js";import{GetModelsForMakeIdYear as h}from"./GetModelsForMakeIdYear.js";import{GetModelsForMakeYear as f}from"./GetModelsForMakeYear.js";import{GetParts as y}from"./GetParts.js";import{GetVehicleTypesForMake as F}from"./GetVehicleTypesForMake.js";import{GetVehicleTypesForMakeId as k}from"./GetVehicleTypesForMakeId.js";import{GetVehicleVariableList as j}from"./GetVehicleVariableList.js";import{GetVehicleVariableValuesList as D}from"./GetVehicleVariableValuesList.js";import{GetWMIsForManufacturer as I}from"./GetWMIsForManufacturer.js";class A extends e{constructor(e){super(e),this.DecodeVin=t.prototype.DecodeVin,this.DecodeVinExtended=o.prototype.DecodeVinExtended,this.DecodeVinValues=r.prototype.DecodeVinValues,this.DecodeVINValuesBatch=a.prototype.DecodeVINValuesBatch,this.DecodeVinValuesExtended=s.prototype.DecodeVinValuesExtended,this.DecodeWMI=i.prototype.DecodeWMI,this.GetAllMakes=p.prototype.GetAllMakes,this.GetAllManufacturers=l.prototype.GetAllManufacturers,this.GetCanadianVehicleSpecifications=c.prototype.GetCanadianVehicleSpecifications,this.GetEquipmentPlantCodes=M.prototype.GetEquipmentPlantCodes,this.GetMakeForManufacturer=d.prototype.GetMakeForManufacturer,this.GetMakesForManufacturerAndYear=G.prototype.GetMakesForManufacturerAndYear,this.GetMakesForVehicleType=m.prototype.GetMakesForVehicleType,this.GetManufacturerDetails=n.prototype.GetManufacturerDetails,this.GetModelsForMake=V.prototype.GetModelsForMake,this.GetModelsForMakeId=u.prototype.GetModelsForMakeId,this.GetModelsForMakeIdYear=h.prototype.GetModelsForMakeIdYear,this.GetModelsForMakeYear=f.prototype.GetModelsForMakeYear,this.GetParts=y.prototype.GetParts,this.GetVehicleTypesForMake=F.prototype.GetVehicleTypesForMake,this.GetVehicleTypesForMakeId=k.prototype.GetVehicleTypesForMakeId,this.GetVehicleVariableList=j.prototype.GetVehicleVariableList,this.GetVehicleVariableValuesList=D.prototype.GetVehicleVariableValuesList,this.GetWMIsForManufacturer=I.prototype.GetWMIsForManufacturer}}export{A as NHTSA}; //# sourceMappingURL=NHTSA.js.map diff --git a/dist/module/NHTSA.js.map b/dist/module/NHTSA.js.map index 2892de127..789a7ddde 100644 --- a/dist/module/NHTSA.js.map +++ b/dist/module/NHTSA.js.map @@ -1 +1 @@ -{"version":3,"file":"NHTSA.js","sources":["../../src/api/NHTSA.ts"],"sourcesContent":["/**\r\n * @module api/NHTSA\r\n * @category API\r\n * @description Module exporting the main (NHSTA) class for API Actions.\r\n *\r\n * > **Module Exports**:\r\n * > - Class: [NHTSA](NHTSA.html#NHTSA) - Class that implements all NHTSA API Actions\r\n */\r\n\r\nimport { Fetch /* Class */, FetchConfig /* Type */ } from './Fetch';\r\n\r\n/* Import implemented API Action classes */\r\nimport {\r\n DecodeVin,\r\n DecodeVinExtended,\r\n DecodeVinValues,\r\n DecodeVINValuesBatch,\r\n DecodeVinValuesExtended,\r\n DecodeWMI,\r\n GetAllMakes,\r\n GetAllManufacturers,\r\n GetCanadianVehicleSpecifications,\r\n GetEquipmentPlantCodes,\r\n GetMakeForManufacturer,\r\n GetMakesForManufacturerAndYear,\r\n GetMakesForVehicleType,\r\n GetManufacturerDetails,\r\n GetModelsForMake,\r\n GetModelsForMakeId,\r\n GetModelsForMakeIdYear,\r\n GetModelsForMakeYear,\r\n GetParts,\r\n GetVehicleTypesForMake,\r\n GetVehicleTypesForMakeId,\r\n GetVehicleVariableList,\r\n GetVehicleVariableValuesList,\r\n GetWMIsForManufacturer,\r\n} from './actions';\r\n\r\n/**\r\n * @class NHTSA\r\n * @augments module:api/Fetch.Fetch\r\n * @category API\r\n *\r\n * @param {FetchConfig} [userConfig] - Configuration options to construct the class with.\r\n *\r\n * @implements {module:api/actions/DecodeVin.DecodeVin}\r\n * @implements {module:api/actions/DecodeVinExtended.DecodeVinExtended}\r\n * @implements {module:api/actions/DecodeVinValues.DecodeVinValues}\r\n * @implements {module:api/actions/DecodeVinValuesExtended.DecodeVinValuesExtended}\r\n * @implements {module:api/actions/DecodeWMI.DecodeWMI}\r\n * @implements {module:api/actions/GetAllMakes.GetAllMakes}\r\n * @implements {module:api/actions/GetAllManufacturers.GetAllManufacturers}\r\n * @implements {module:api/actions/GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications}\r\n * @implements {module:api/actions/GetEquipmentPlantCodes.GetEquipmentPlantCodes}\r\n * @implements {module:api/actions/GetMakeForManufacturer.GetMakeForManufacturer}\r\n * @implements {module:api/actions/GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear}\r\n * @implements {module:api/actions/GetMakesForVehicleType.GetMakesForVehicleType}\r\n * @implements {module:api/actions/GetManufacturerDetails.GetManufacturerDetails}\r\n * @implements {module:api/actions/GetModelsForMake.GetModelsForMake}\r\n * @implements {module:api/actions/GetModelsForMakeId.GetModelsForMakeId}\r\n * @implements {module:api/actions/GetModelsForMakeIdYear.GetModelsForMakeIdYear}\r\n * @implements {module:api/actions/GetModelsForMakeYear.GetModelsForMakeYear}\r\n * @implements {module:api/actions/GetParts.GetParts}\r\n * @implements {module:api/actions/GetVehicleTypesForMake.GetVehicleTypesForMake}\r\n * @implements {module:api/actions/GetVehicleTypesForMakeId.GetVehicleTypesForMakeId}\r\n * @implements {module:api/actions/GetVehicleVariableList.GetVehicleVariableList}\r\n * @implements {module:api/actions/GetVehicleVariableValuesList.GetVehicleVariableValuesList}\r\n * @implements {module:api/actions/GetWMIsForManufacturer.GetWMIsForManufacturer}\r\n *\r\n * @example Node bundle\r\n * const { NHTSA } = require('@shaggytools/nhtsa-api-wrapper');\r\n *\r\n * const Wrapper = new NHTSA();\r\n *\r\n * // Decode a VIN and return a response of type ApiResponse\r\n * const response = Wrapper.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\r\n *\r\n * // or get details about a specific manufacturer, plus 23 other available Actions.\r\n * const hondaDetails = Wrapper.GetManufacturerDetails('Honda').catch(error => error)\r\n *\r\n * @example Browser bundle\r\n * // Change to specific version number \"x.x.xx\",\r\n * // or remove completely for the most recently published version\r\n * /dist/bundle.min.js\"\r\n * >\r\n *\r\n * \r\n *\r\n * @example Module - Node lazy loading\r\n * const { NHTSA } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\r\n * .catch(err => err);\r\n *\r\n * const ApiClient = new NHTSA();\r\n *\r\n * const results = await ApiClient.DecodeVin('3VWD07AJ5EM388202')\r\n * .catch(err => err)\r\n *\r\n * @example Module - Browser lazy loading\r\n * \r\n */\r\nclass NHTSA\r\n extends Fetch\r\n implements\r\n DecodeVin,\r\n DecodeVinExtended,\r\n DecodeVinValues,\r\n DecodeVINValuesBatch,\r\n DecodeVinValuesExtended,\r\n DecodeWMI,\r\n GetAllMakes,\r\n GetAllManufacturers,\r\n GetCanadianVehicleSpecifications,\r\n GetEquipmentPlantCodes,\r\n GetMakeForManufacturer,\r\n GetMakesForManufacturerAndYear,\r\n GetMakesForVehicleType,\r\n GetManufacturerDetails,\r\n GetModelsForMake,\r\n GetModelsForMakeId,\r\n GetModelsForMakeIdYear,\r\n GetModelsForMakeYear,\r\n GetParts,\r\n GetVehicleTypesForMake,\r\n GetVehicleTypesForMakeId,\r\n GetVehicleVariableList,\r\n GetVehicleVariableValuesList,\r\n GetWMIsForManufacturer {\r\n constructor(userConfig?: FetchConfig) {\r\n super(userConfig);\r\n }\r\n DecodeVin = DecodeVin.prototype.DecodeVin;\r\n\r\n DecodeVinExtended = DecodeVinExtended.prototype.DecodeVinExtended;\r\n\r\n DecodeVinValues = DecodeVinValues.prototype.DecodeVinValues;\r\n\r\n DecodeVINValuesBatch = DecodeVINValuesBatch.prototype.DecodeVINValuesBatch;\r\n\r\n DecodeVinValuesExtended =\r\n DecodeVinValuesExtended.prototype.DecodeVinValuesExtended;\r\n\r\n DecodeWMI = DecodeWMI.prototype.DecodeWMI;\r\n\r\n GetAllMakes = GetAllMakes.prototype.GetAllMakes;\r\n\r\n GetAllManufacturers = GetAllManufacturers.prototype.GetAllManufacturers;\r\n\r\n GetCanadianVehicleSpecifications =\r\n GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications;\r\n\r\n GetEquipmentPlantCodes =\r\n GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes;\r\n\r\n GetMakeForManufacturer =\r\n GetMakeForManufacturer.prototype.GetMakeForManufacturer;\r\n\r\n GetMakesForManufacturerAndYear =\r\n GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear;\r\n\r\n GetMakesForVehicleType =\r\n GetMakesForVehicleType.prototype.GetMakesForVehicleType;\r\n\r\n GetManufacturerDetails =\r\n GetManufacturerDetails.prototype.GetManufacturerDetails;\r\n\r\n GetModelsForMake = GetModelsForMake.prototype.GetModelsForMake;\r\n\r\n GetModelsForMakeId = GetModelsForMakeId.prototype.GetModelsForMakeId;\r\n\r\n GetModelsForMakeIdYear =\r\n GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear;\r\n\r\n GetModelsForMakeYear = GetModelsForMakeYear.prototype.GetModelsForMakeYear;\r\n\r\n GetParts = GetParts.prototype.GetParts;\r\n\r\n GetVehicleTypesForMake =\r\n GetVehicleTypesForMake.prototype.GetVehicleTypesForMake;\r\n\r\n GetVehicleTypesForMakeId =\r\n GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId;\r\n\r\n GetVehicleVariableList =\r\n GetVehicleVariableList.prototype.GetVehicleVariableList;\r\n\r\n GetVehicleVariableValuesList =\r\n GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList;\r\n\r\n GetWMIsForManufacturer =\r\n GetWMIsForManufacturer.prototype.GetWMIsForManufacturer;\r\n}\r\n\r\nexport { NHTSA };\r\n"],"names":["NHTSA","Fetch","[object Object]","userConfig","super","this","DecodeVin","prototype","DecodeVinExtended","DecodeVinValues","DecodeVINValuesBatch","DecodeVinValuesExtended","DecodeWMI","GetAllMakes","GetAllManufacturers","GetCanadianVehicleSpecifications","GetEquipmentPlantCodes","GetMakeForManufacturer","GetMakesForManufacturerAndYear","GetMakesForVehicleType","GetManufacturerDetails","GetModelsForMake","GetModelsForMakeId","GetModelsForMakeIdYear","GetModelsForMakeYear","GetParts","GetVehicleTypesForMake","GetVehicleTypesForMakeId","GetVehicleVariableList","GetVehicleVariableValuesList","GetWMIsForManufacturer"],"mappings":"6PAuHA,MAAMA,UACIC,EA0BRC,YAAYC,GACVC,MAAMD,GAERE,eAAYC,EAAUC,UAAUD,UAEhCD,uBAAoBG,EAAkBD,UAAUC,kBAEhDH,qBAAkBI,EAAgBF,UAAUE,gBAE5CJ,0BAAuBK,EAAqBH,UAAUG,qBAEtDL,6BACEM,EAAwBJ,UAAUI,wBAEpCN,eAAYO,EAAUL,UAAUK,UAEhCP,iBAAcQ,EAAYN,UAAUM,YAEpCR,yBAAsBS,EAAoBP,UAAUO,oBAEpDT,sCACEU,EAAiCR,UAAUQ,iCAE7CV,4BACEW,EAAuBT,UAAUS,uBAEnCX,4BACEY,EAAuBV,UAAUU,uBAEnCZ,oCACEa,EAA+BX,UAAUW,+BAE3Cb,4BACEc,EAAuBZ,UAAUY,uBAEnCd,4BACEe,EAAuBb,UAAUa,uBAEnCf,sBAAmBgB,EAAiBd,UAAUc,iBAE9ChB,wBAAqBiB,EAAmBf,UAAUe,mBAElDjB,4BACEkB,EAAuBhB,UAAUgB,uBAEnClB,0BAAuBmB,EAAqBjB,UAAUiB,qBAEtDnB,cAAWoB,EAASlB,UAAUkB,SAE9BpB,4BACEqB,EAAuBnB,UAAUmB,uBAEnCrB,8BACEsB,EAAyBpB,UAAUoB,yBAErCtB,4BACEuB,EAAuBrB,UAAUqB,uBAEnCvB,kCACEwB,EAA6BtB,UAAUsB,6BAEzCxB,4BACEyB,EAAuBvB,UAAUuB"} \ No newline at end of file +{"version":3,"file":"NHTSA.js","sources":["../../src/api/NHTSA.ts"],"sourcesContent":["/**\n * @module api/NHTSA\n * @category API\n * @description Module exporting the main (NHSTA) class for API Actions.\n *\n * > **Module Exports**:\n * > - Class: [NHTSA](NHTSA.html#NHTSA) - Class that implements all NHTSA API Actions\n */\n\nimport { Fetch /* Class */, FetchConfig /* Type */ } from './Fetch';\n\n/* Import implemented API Action classes */\nimport {\n DecodeVin,\n DecodeVinExtended,\n DecodeVinValues,\n DecodeVINValuesBatch,\n DecodeVinValuesExtended,\n DecodeWMI,\n GetAllMakes,\n GetAllManufacturers,\n GetCanadianVehicleSpecifications,\n GetEquipmentPlantCodes,\n GetMakeForManufacturer,\n GetMakesForManufacturerAndYear,\n GetMakesForVehicleType,\n GetManufacturerDetails,\n GetModelsForMake,\n GetModelsForMakeId,\n GetModelsForMakeIdYear,\n GetModelsForMakeYear,\n GetParts,\n GetVehicleTypesForMake,\n GetVehicleTypesForMakeId,\n GetVehicleVariableList,\n GetVehicleVariableValuesList,\n GetWMIsForManufacturer,\n} from './actions';\n\n/**\n * @class NHTSA\n * @augments module:api/Fetch.Fetch\n * @category API\n *\n * @param {FetchConfig} [userConfig] - Configuration options to construct the class with.\n *\n * @implements {module:api/actions/DecodeVin.DecodeVin}\n * @implements {module:api/actions/DecodeVinExtended.DecodeVinExtended}\n * @implements {module:api/actions/DecodeVinValues.DecodeVinValues}\n * @implements {module:api/actions/DecodeVinValuesExtended.DecodeVinValuesExtended}\n * @implements {module:api/actions/DecodeWMI.DecodeWMI}\n * @implements {module:api/actions/GetAllMakes.GetAllMakes}\n * @implements {module:api/actions/GetAllManufacturers.GetAllManufacturers}\n * @implements {module:api/actions/GetCanadianVehicleSpecifications.GetCanadianVehicleSpecifications}\n * @implements {module:api/actions/GetEquipmentPlantCodes.GetEquipmentPlantCodes}\n * @implements {module:api/actions/GetMakeForManufacturer.GetMakeForManufacturer}\n * @implements {module:api/actions/GetMakesForManufacturerAndYear.GetMakesForManufacturerAndYear}\n * @implements {module:api/actions/GetMakesForVehicleType.GetMakesForVehicleType}\n * @implements {module:api/actions/GetManufacturerDetails.GetManufacturerDetails}\n * @implements {module:api/actions/GetModelsForMake.GetModelsForMake}\n * @implements {module:api/actions/GetModelsForMakeId.GetModelsForMakeId}\n * @implements {module:api/actions/GetModelsForMakeIdYear.GetModelsForMakeIdYear}\n * @implements {module:api/actions/GetModelsForMakeYear.GetModelsForMakeYear}\n * @implements {module:api/actions/GetParts.GetParts}\n * @implements {module:api/actions/GetVehicleTypesForMake.GetVehicleTypesForMake}\n * @implements {module:api/actions/GetVehicleTypesForMakeId.GetVehicleTypesForMakeId}\n * @implements {module:api/actions/GetVehicleVariableList.GetVehicleVariableList}\n * @implements {module:api/actions/GetVehicleVariableValuesList.GetVehicleVariableValuesList}\n * @implements {module:api/actions/GetWMIsForManufacturer.GetWMIsForManufacturer}\n *\n * @example Node bundle\n * const { NHTSA } = require('@shaggytools/nhtsa-api-wrapper');\n *\n * const Wrapper = new NHTSA();\n *\n * // Decode a VIN and return a response of type ApiResponse\n * const response = Wrapper.DecodeVinValues('3VWD07AJ5EM388202').catch(error => error)\n *\n * // or get details about a specific manufacturer, plus 23 other available Actions.\n * const hondaDetails = Wrapper.GetManufacturerDetails('Honda').catch(error => error)\n *\n * @example Browser bundle\n * // Change to specific version number \"x.x.xx\",\n * // or remove completely for the most recently published version\n * /dist/bundle.min.js\"\n * >\n *\n * \n *\n * @example Module - Node lazy loading\n * const { NHTSA } = await import('@shaggytools/nhtsa-api-wrapper/dist/module/index.js')\n * .catch(err => err);\n *\n * const ApiClient = new NHTSA();\n *\n * const results = await ApiClient.DecodeVin('3VWD07AJ5EM388202')\n * .catch(err => err)\n *\n * @example Module - Browser lazy loading\n * \n */\nclass NHTSA\n extends Fetch\n implements\n DecodeVin,\n DecodeVinExtended,\n DecodeVinValues,\n DecodeVINValuesBatch,\n DecodeVinValuesExtended,\n DecodeWMI,\n GetAllMakes,\n GetAllManufacturers,\n GetCanadianVehicleSpecifications,\n GetEquipmentPlantCodes,\n GetMakeForManufacturer,\n GetMakesForManufacturerAndYear,\n GetMakesForVehicleType,\n GetManufacturerDetails,\n GetModelsForMake,\n GetModelsForMakeId,\n GetModelsForMakeIdYear,\n GetModelsForMakeYear,\n GetParts,\n GetVehicleTypesForMake,\n GetVehicleTypesForMakeId,\n GetVehicleVariableList,\n GetVehicleVariableValuesList,\n GetWMIsForManufacturer {\n constructor(userConfig?: FetchConfig) {\n super(userConfig);\n }\n DecodeVin = DecodeVin.prototype.DecodeVin;\n\n DecodeVinExtended = DecodeVinExtended.prototype.DecodeVinExtended;\n\n DecodeVinValues = DecodeVinValues.prototype.DecodeVinValues;\n\n DecodeVINValuesBatch = DecodeVINValuesBatch.prototype.DecodeVINValuesBatch;\n\n DecodeVinValuesExtended =\n DecodeVinValuesExtended.prototype.DecodeVinValuesExtended;\n\n DecodeWMI = DecodeWMI.prototype.DecodeWMI;\n\n GetAllMakes = GetAllMakes.prototype.GetAllMakes;\n\n GetAllManufacturers = GetAllManufacturers.prototype.GetAllManufacturers;\n\n GetCanadianVehicleSpecifications =\n GetCanadianVehicleSpecifications.prototype.GetCanadianVehicleSpecifications;\n\n GetEquipmentPlantCodes =\n GetEquipmentPlantCodes.prototype.GetEquipmentPlantCodes;\n\n GetMakeForManufacturer =\n GetMakeForManufacturer.prototype.GetMakeForManufacturer;\n\n GetMakesForManufacturerAndYear =\n GetMakesForManufacturerAndYear.prototype.GetMakesForManufacturerAndYear;\n\n GetMakesForVehicleType =\n GetMakesForVehicleType.prototype.GetMakesForVehicleType;\n\n GetManufacturerDetails =\n GetManufacturerDetails.prototype.GetManufacturerDetails;\n\n GetModelsForMake = GetModelsForMake.prototype.GetModelsForMake;\n\n GetModelsForMakeId = GetModelsForMakeId.prototype.GetModelsForMakeId;\n\n GetModelsForMakeIdYear =\n GetModelsForMakeIdYear.prototype.GetModelsForMakeIdYear;\n\n GetModelsForMakeYear = GetModelsForMakeYear.prototype.GetModelsForMakeYear;\n\n GetParts = GetParts.prototype.GetParts;\n\n GetVehicleTypesForMake =\n GetVehicleTypesForMake.prototype.GetVehicleTypesForMake;\n\n GetVehicleTypesForMakeId =\n GetVehicleTypesForMakeId.prototype.GetVehicleTypesForMakeId;\n\n GetVehicleVariableList =\n GetVehicleVariableList.prototype.GetVehicleVariableList;\n\n GetVehicleVariableValuesList =\n GetVehicleVariableValuesList.prototype.GetVehicleVariableValuesList;\n\n GetWMIsForManufacturer =\n GetWMIsForManufacturer.prototype.GetWMIsForManufacturer;\n}\n\nexport { NHTSA };\n"],"names":["NHTSA","Fetch","[object Object]","userConfig","super","this","DecodeVin","prototype","DecodeVinExtended","DecodeVinValues","DecodeVINValuesBatch","DecodeVinValuesExtended","DecodeWMI","GetAllMakes","GetAllManufacturers","GetCanadianVehicleSpecifications","GetEquipmentPlantCodes","GetMakeForManufacturer","GetMakesForManufacturerAndYear","GetMakesForVehicleType","GetManufacturerDetails","GetModelsForMake","GetModelsForMakeId","GetModelsForMakeIdYear","GetModelsForMakeYear","GetParts","GetVehicleTypesForMake","GetVehicleTypesForMakeId","GetVehicleVariableList","GetVehicleVariableValuesList","GetWMIsForManufacturer"],"mappings":"sjDAuHA,MAAMA,UACIC,EA0BRC,YAAYC,GACVC,MAAMD,GAERE,eAAYC,EAAUC,UAAUD,UAEhCD,uBAAoBG,EAAkBD,UAAUC,kBAEhDH,qBAAkBI,EAAgBF,UAAUE,gBAE5CJ,0BAAuBK,EAAqBH,UAAUG,qBAEtDL,6BACEM,EAAwBJ,UAAUI,wBAEpCN,eAAYO,EAAUL,UAAUK,UAEhCP,iBAAcQ,EAAYN,UAAUM,YAEpCR,yBAAsBS,EAAoBP,UAAUO,oBAEpDT,sCACEU,EAAiCR,UAAUQ,iCAE7CV,4BACEW,EAAuBT,UAAUS,uBAEnCX,4BACEY,EAAuBV,UAAUU,uBAEnCZ,oCACEa,EAA+BX,UAAUW,+BAE3Cb,4BACEc,EAAuBZ,UAAUY,uBAEnCd,4BACEe,EAAuBb,UAAUa,uBAEnCf,sBAAmBgB,EAAiBd,UAAUc,iBAE9ChB,wBAAqBiB,EAAmBf,UAAUe,mBAElDjB,4BACEkB,EAAuBhB,UAAUgB,uBAEnClB,0BAAuBmB,EAAqBjB,UAAUiB,qBAEtDnB,cAAWoB,EAASlB,UAAUkB,SAE9BpB,4BACEqB,EAAuBnB,UAAUmB,uBAEnCrB,8BACEsB,EAAyBpB,UAAUoB,yBAErCtB,4BACEuB,EAAuBrB,UAAUqB,uBAEnCvB,kCACEwB,EAA6BtB,UAAUsB,6BAEzCxB,4BACEyB,EAAuBvB,UAAUuB"} \ No newline at end of file diff --git a/dist/module/isValidVin.js.map b/dist/module/isValidVin.js.map index 5a1c89b01..1ed5a8b70 100644 --- a/dist/module/isValidVin.js.map +++ b/dist/module/isValidVin.js.map @@ -1 +1 @@ -{"version":3,"file":"isValidVin.js","sources":["../../src/utils/isValidVin.ts"],"sourcesContent":["/**\r\n * @module utils/isValidVin\r\n * @category Utils\r\n */\r\n\r\n/*\r\n * There will need to be some way to translate vin digits that are alphabetic\r\n * into their number value in the VIN algorithm transliteration table.\r\n * Later, during the creation of the checksum variable, those digits will be\r\n * multiplied against their corresponding weight (by index) in the WEIGHTS_ARRAY.\r\n * This transliteration table is a key part of the VIN validation algorithm.\r\n */\r\nconst TRANSLITERATION_TABLE: Record = {\r\n A: 1,\r\n B: 2,\r\n C: 3,\r\n D: 4,\r\n E: 5,\r\n F: 6,\r\n G: 7,\r\n H: 8,\r\n J: 1,\r\n K: 2,\r\n L: 3,\r\n M: 4,\r\n N: 5,\r\n P: 7,\r\n R: 9,\r\n S: 2,\r\n T: 3,\r\n U: 4,\r\n V: 5,\r\n W: 6,\r\n X: 7,\r\n Y: 8,\r\n Z: 9,\r\n};\r\n\r\n/*\r\n * Later, during the creation of the 'checksum' variable, these weights will be\r\n * multiplied by the value of their mirrored index vin digits.\r\n * The array index of each weight corresponds to the same index of each\r\n * digit in the 'vin'.\r\n */\r\nconst WEIGHTS_ARRAY: number[] = [\r\n 8,\r\n 7,\r\n 6,\r\n 5,\r\n 4,\r\n 3,\r\n 2,\r\n 10,\r\n 0,\r\n 9,\r\n 8,\r\n 7,\r\n 6,\r\n 5,\r\n 4,\r\n 3,\r\n 2,\r\n];\r\n\r\n/**\r\n * Provides **offline** validation of Vehicle Identification Numbers (VINs) using the\r\n * [VIN Check Algorithm](https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit).\r\n *\r\n * @param {string} vin - Vehicle Identification Number.\r\n * @returns {boolean} True for a valid VIN, false for an invalid VIN.\r\n *\r\n * @example When loaded from the browser via html script tags\r\n * // \r\n * const isValid = NHTSA.isValidVin('3VWD07AJ5EM388202')\r\n * console.log(isValid) // true\r\n *\r\n * @example When loaded as a module\r\n * import { isValidVin } from '@shaggytools/nhtsa-api-wrapper'\r\n * const isValid = isValidVin('3VWD07AJ5EM388202')\r\n * console.log(isValid) // true\r\n *\r\n */\r\nexport function isValidVin(vin: string): boolean {\r\n /* A valid VIN must be a string and is always exactly 17 digits */\r\n if (typeof vin !== 'string' || vin.length != 17) {\r\n return false;\r\n }\r\n\r\n /* Normalize the vin to all uppercase letters */\r\n vin = vin.toUpperCase();\r\n\r\n /* split the vin digits into an array */\r\n const vinArray: string[] = vin.split('');\r\n\r\n /* checkDigit will be tested against the checkSum later */\r\n const checkDigit: string = vinArray[8];\r\n\r\n /*\r\n * In a valid VIN, the checkDigit can either be:\r\n * a number, 0-9 inclusive OR the character 'X'\r\n */\r\n if (isNaN(parseInt(checkDigit)) && checkDigit !== 'X') {\r\n return false;\r\n }\r\n\r\n /*\r\n * The checkValue must be a digit and 'X' is the only valid alphabetic check value.\r\n * As per the algorithm, a checkDigit of 'X' is equal to a checkValue of `10` and needs\r\n * to be converted as such.\r\n */\r\n const checkValue: number = checkDigit === 'X' ? 10 : parseInt(checkDigit);\r\n\r\n /*\r\n * Maps the vinArray and converts any values (digits) that are alphabetic,\r\n * into numbers, using the TRANSLITERATION_TABLE.\r\n * Then these numbers are multiplied against their corresponding weight\r\n * in the WEIGHTS_ARRAY, matched by index position.\r\n * All 17 of those digitValues are then added together and divided by 11.\r\n * The remainder, or % modulo, of that division will be the final 'checksum'.\r\n */\r\n const checksum: number =\r\n vinArray\r\n .map((digit: string, index: number) => {\r\n let digitValue: number;\r\n /* Use the transliteration table to convert any Not a Number(NaN) values to numbers */\r\n isNaN(parseInt(digit))\r\n ? (digitValue = TRANSLITERATION_TABLE[digit])\r\n : (digitValue = parseInt(digit));\r\n\r\n /* Convert the digitValue to a weighted number corresponding to it's position, by index, in the weightsArray. */\r\n const weight: number = WEIGHTS_ARRAY[index];\r\n\r\n /* The final step for each digit is to multiply the digit by it's corresponding weight */\r\n return digitValue * weight;\r\n })\r\n /* Finally, get the sum of all digits and divide by 11, the remainder of that operation is the checksum */\r\n .reduce((acc, currValue) => acc + currValue, 0) % 11;\r\n\r\n /*\r\n * The checksum is compared against the checkValue we set earlier (the 9th digit of the VIN)\r\n * As per the algorithm, if they are equal to each other, then the VIN must be valid and\r\n * we return true, otherwise the VIN is invalid and we return false.\r\n */\r\n return checksum === checkValue;\r\n}\r\n"],"names":["TRANSLITERATION_TABLE","A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z","WEIGHTS_ARRAY","isValidVin","vin","length","vinArray","toUpperCase","split","checkDigit","isNaN","parseInt","checkValue","map","digit","index","digitValue","reduce","acc","currValue"],"mappings":"AAYA,MAAMA,EAAgD,CACpDC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,GASCC,EAA0B,CAC9B,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,YAqBcC,EAAWC,GAEzB,GAAmB,iBAARA,GAAkC,IAAdA,EAAIC,OACjC,OAAO,EAOT,MAAMC,GAHNF,EAAMA,EAAIG,eAGqBC,MAAM,IAG/BC,EAAqBH,EAAS,GAMpC,GAAII,MAAMC,SAASF,KAA+B,MAAfA,EACjC,OAAO,EAQT,MAAMG,EAAoC,MAAfH,EAAqB,GAAKE,SAASF,GAiC9D,OAtBEH,EACGO,IAAI,CAACC,EAAeC,KACnB,IAAIC,EAGCA,EADLN,MAAMC,SAASG,IACGpC,EAAsBoC,GACtBH,SAASG,GAM3B,OAAOE,EAHgBd,EAAca,KAMtCE,OAAO,CAACC,EAAKC,IAAcD,EAAMC,EAAW,GAAK,KAOlCP"} \ No newline at end of file +{"version":3,"file":"isValidVin.js","sources":["../../src/utils/isValidVin.ts"],"sourcesContent":["/**\n * @module utils/isValidVin\n * @category Utils\n */\n\n/*\n * There will need to be some way to translate vin digits that are alphabetic\n * into their number value in the VIN algorithm transliteration table.\n * Later, during the creation of the checksum variable, those digits will be\n * multiplied against their corresponding weight (by index) in the WEIGHTS_ARRAY.\n * This transliteration table is a key part of the VIN validation algorithm.\n */\nconst TRANSLITERATION_TABLE: Record = {\n A: 1,\n B: 2,\n C: 3,\n D: 4,\n E: 5,\n F: 6,\n G: 7,\n H: 8,\n J: 1,\n K: 2,\n L: 3,\n M: 4,\n N: 5,\n P: 7,\n R: 9,\n S: 2,\n T: 3,\n U: 4,\n V: 5,\n W: 6,\n X: 7,\n Y: 8,\n Z: 9,\n};\n\n/*\n * Later, during the creation of the 'checksum' variable, these weights will be\n * multiplied by the value of their mirrored index vin digits.\n * The array index of each weight corresponds to the same index of each\n * digit in the 'vin'.\n */\nconst WEIGHTS_ARRAY: number[] = [\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n 10,\n 0,\n 9,\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n];\n\n/**\n * Provides **offline** validation of Vehicle Identification Numbers (VINs) using the\n * [VIN Check Algorithm](https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit).\n *\n * @param {string} vin - Vehicle Identification Number.\n * @returns {boolean} True for a valid VIN, false for an invalid VIN.\n *\n * @example When loaded from the browser via html script tags\n * // \n * const isValid = NHTSA.isValidVin('3VWD07AJ5EM388202')\n * console.log(isValid) // true\n *\n * @example When loaded as a module\n * import { isValidVin } from '@shaggytools/nhtsa-api-wrapper'\n * const isValid = isValidVin('3VWD07AJ5EM388202')\n * console.log(isValid) // true\n *\n */\nexport function isValidVin(vin: string): boolean {\n /* A valid VIN must be a string and is always exactly 17 digits */\n if (typeof vin !== 'string' || vin.length != 17) {\n return false;\n }\n\n /* Normalize the vin to all uppercase letters */\n vin = vin.toUpperCase();\n\n /* split the vin digits into an array */\n const vinArray: string[] = vin.split('');\n\n /* checkDigit will be tested against the checkSum later */\n const checkDigit: string = vinArray[8];\n\n /*\n * In a valid VIN, the checkDigit can either be:\n * a number, 0-9 inclusive OR the character 'X'\n */\n if (isNaN(parseInt(checkDigit)) && checkDigit !== 'X') {\n return false;\n }\n\n /*\n * The checkValue must be a digit and 'X' is the only valid alphabetic check value.\n * As per the algorithm, a checkDigit of 'X' is equal to a checkValue of `10` and needs\n * to be converted as such.\n */\n const checkValue: number = checkDigit === 'X' ? 10 : parseInt(checkDigit);\n\n /*\n * Maps the vinArray and converts any values (digits) that are alphabetic,\n * into numbers, using the TRANSLITERATION_TABLE.\n * Then these numbers are multiplied against their corresponding weight\n * in the WEIGHTS_ARRAY, matched by index position.\n * All 17 of those digitValues are then added together and divided by 11.\n * The remainder, or % modulo, of that division will be the final 'checksum'.\n */\n const checksum: number =\n vinArray\n .map((digit: string, index: number) => {\n let digitValue: number;\n /* Use the transliteration table to convert any Not a Number(NaN) values to numbers */\n isNaN(parseInt(digit))\n ? (digitValue = TRANSLITERATION_TABLE[digit])\n : (digitValue = parseInt(digit));\n\n /* Convert the digitValue to a weighted number corresponding to it's position, by index, in the weightsArray. */\n const weight: number = WEIGHTS_ARRAY[index];\n\n /* The final step for each digit is to multiply the digit by it's corresponding weight */\n return digitValue * weight;\n })\n /* Finally, get the sum of all digits and divide by 11, the remainder of that operation is the checksum */\n .reduce((acc, currValue) => acc + currValue, 0) % 11;\n\n /*\n * The checksum is compared against the checkValue we set earlier (the 9th digit of the VIN)\n * As per the algorithm, if they are equal to each other, then the VIN must be valid and\n * we return true, otherwise the VIN is invalid and we return false.\n */\n return checksum === checkValue;\n}\n"],"names":["TRANSLITERATION_TABLE","A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z","WEIGHTS_ARRAY","isValidVin","vin","length","vinArray","toUpperCase","split","checkDigit","isNaN","parseInt","checkValue","map","digit","index","digitValue","reduce","acc","currValue"],"mappings":"AAYA,MAAMA,EAAgD,CACpDC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,EACHC,EAAG,GASCC,EAA0B,CAC9B,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,YAqBcC,EAAWC,GAEzB,GAAmB,iBAARA,GAAkC,IAAdA,EAAIC,OACjC,OAAO,EAOT,MAAMC,GAHNF,EAAMA,EAAIG,eAGqBC,MAAM,IAG/BC,EAAqBH,EAAS,GAMpC,GAAII,MAAMC,SAASF,KAA+B,MAAfA,EACjC,OAAO,EAQT,MAAMG,EAAoC,MAAfH,EAAqB,GAAKE,SAASF,GAiC9D,OAtBEH,EACGO,IAAI,CAACC,EAAeC,KACnB,IAAIC,EAGCA,EADLN,MAAMC,SAASG,IACGpC,EAAsBoC,GACtBH,SAASG,GAM3B,OAAOE,EAHgBd,EAAca,KAMtCE,OAAO,CAACC,EAAKC,IAAcD,EAAMC,EAAW,GAAK,KAOlCP"} \ No newline at end of file diff --git a/package.json b/package.json index 25f834a83..f5cbc42b3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@shaggytools/nhtsa-api-wrapper", "libraryName": "NHTSA", - "version": "1.1.11", + "version": "1.1.12", "description": "A wrapper around the NHTSA.dot.gov 'vehicles' API, written completely in Typescript.", "engines": { "node": ">=10.19.0",