From a4d29f34049a4321090af2c26895b3a2008c8a29 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Mon, 1 May 2023 00:33:21 -0500 Subject: [PATCH] deployment: switch documentation url to vpic.shaggytech.com --- README.md | 81 ++++++++++++++++++++++++++++++++++++++---- packages/lib/README.md | 25 ++++++++----- 2 files changed, 91 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index a5b63ee88..a6f2dc351 100644 --- a/README.md +++ b/README.md @@ -55,12 +55,12 @@ WMIs, get all makes for a certain year, and more. ## Full Documentation -### [https://shaggytech.com/nhtsa-api-wrapper](https://shaggytech.com/nhtsa-api-wrapper/) +### [https://vpic.shaggytech.com/](https://vpic.shaggytech.com/) -- [Introduction](https://www.shaggytech.com/nhtsa-api-wrapper/guide) -- [Install](https://www.shaggytech.com/nhtsa-api-wrapper/guide/getting-started#install) -- [Quick Start](https://www.shaggytech.com/nhtsa-api-wrapper/guide/getting-started#quick-start) -- [API Reference](https://www.shaggytech.com/nhtsa-api-wrapper/api/) +- [Introduction](https://vpic.shaggytech.com/guide) +- [Install](https://vpic.shaggytech.com/guide/getting-started#install) +- [Quick Start](https://vpic.shaggytech.com//guide/getting-started#quick-start) +- [API Reference](https://vpic.shaggytech.com/api/) ## Mono Repo Structure @@ -114,5 +114,74 @@ Browser global variable: `NHTSA` #### UNPKG ```html [UNPKG] - + ``` + +## List of Exported Functions + +```javascript +import { + // NHTSA API Endpoints + DecodeVin, + DecodeVinExtended, + DecodeVinValues, + DecodeVinValuesBatch, + DecodeVinValuesExtended, + DecodeWMI, + GetAllMakes, + GetAllManufacturers, + GetCanadianVehicleSpecifications, + GetEquipmentPlantCodes, + GetMakeForManufacturer, + GetMakesForManufacturerAndYear, + GetMakesForVehicleType, + GetManufacturerDetails, + GetModelsForMake, + GetModelsForMakeId, + GetModelsForMakeIdYear, + GetModelsForMakeYear, + GetParts, + GetVehicleTypesForMake, + GetVehicleTypesForMakeId, + GetVehicleVariableList, + GetVehicleVariableValuesList, + GetWMIsForManufacturer, + // composable function returning helper functions for NHTSA API + useNHTSA, + // function for offline VIN validation + isValidVin, +} from "@shaggytools/nhtsa-api-wrapper"; +``` + +## Quick Start + +Decoding a VIN is as easy as importing the `DecodeVinValues` function and calling it +with a VIN. + +Make sure to first install via your favorite package manager or use a CDN. + +```javascript +import { DecodeVinValues } from "@shaggytools/nhtsa-api-wrapper"; + +const results = await DecodeVinValues("WA1A4AFY2J2008189"); + +/* +results = { + Count: 136, - number of Results objects returned + Message: 'Results returned successfully ...', + SearchCriteria: 'VIN:WA1A4AFY2J2008189', + Results: [ {...} ] - an array with single object of type DecodeVinValuesResults +} +*/ + +/* You can also use destructuring to get the Results object */ +const { Results } = await DecodeVinValues("WA1A4AFY2J2008189"); + +/* This endpoint only returns a single object in the Results array + The first object in the array is the decoded vin data */ +const decodedVehicle = Results[0]; // equals an object of type DecodeVinValuesResults +``` + +For a full example response see: [DecodeVinValues](https://vpic.shaggytech.com/api/endpoints/decode-vin-values#returns) + +All available endpoints can be found here: [VPIC API Endpoints](https://vpic.shaggytech.com/api/#vpic-api-endpoints) diff --git a/packages/lib/README.md b/packages/lib/README.md index f6e81bd55..82bd788ff 100644 --- a/packages/lib/README.md +++ b/packages/lib/README.md @@ -55,12 +55,12 @@ WMIs, get all makes for a certain year, and more. ## Full Documentation -### [https://shaggytech.com/nhtsa-api-wrapper](https://shaggytech.com/nhtsa-api-wrapper/) +### [https://vpic.shaggytech.com/](https://vpic.shaggytech.com/) -- [Introduction](https://www.shaggytech.com/nhtsa-api-wrapper/guide) -- [Install](https://www.shaggytech.com/nhtsa-api-wrapper/guide/getting-started#install) -- [Quick Start](https://www.shaggytech.com/nhtsa-api-wrapper/guide/getting-started#quick-start) -- [API Reference](https://www.shaggytech.com/nhtsa-api-wrapper/api/) +- [Introduction](https://vpic.shaggytech.com/guide) +- [Install](https://vpic.shaggytech.com/guide/getting-started#install) +- [Quick Start](https://vpic.shaggytech.com//guide/getting-started#quick-start) +- [API Reference](https://vpic.shaggytech.com/api/) ## Install @@ -97,7 +97,7 @@ Browser global variable: `NHTSA` #### UNPKG ```html [UNPKG] - + ``` ## List of Exported Functions @@ -138,7 +138,7 @@ import { ## Quick Start -Decoding a VIN is as easy as importing the `DecodeVin` or `DecodeVinValues` function and calling it +Decoding a VIN is as easy as importing the `DecodeVinValues` function and calling it with a VIN. Make sure to first install via your favorite package manager or use a CDN. @@ -156,8 +156,15 @@ results = { Results: [ {...} ] - an array with single object of type DecodeVinValuesResults } */ + +/* You can also use destructuring to get the Results object */ +const { Results } = await DecodeVinValues('WA1A4AFY2J2008189') + +/* This endpoint only returns a single object in the Results array + The first object in the array is the decoded vin data */ +const decodedVehicle = Results[0] // equals an object of type DecodeVinValuesResults ``` -For a full example response see: [DecodeVinValues](https://www.shaggytech.com/nhtsa-api-wrapper/api/decode-vin-values#returns) +For a full example response see: [DecodeVinValues](https://vpic.shaggytech.com/api/endpoints/decode-vin-values#returns) -All available endpoints can be found here: [VPIC API Endpoints](../api/#vpic-api-endpoints) +All available endpoints can be found here: [VPIC API Endpoints](https://vpic.shaggytech.com/api/#vpic-api-endpoints)