diff --git a/.changeset/hungry-stingrays-promise.md b/.changeset/hungry-stingrays-promise.md new file mode 100644 index 00000000..fd58bed1 --- /dev/null +++ b/.changeset/hungry-stingrays-promise.md @@ -0,0 +1,53 @@ +--- +"docs": patch +"@shaggytools/nhtsa-api-wrapper": patch +--- + +๐Ÿ› ๏ธ Fixes + +- fix(output): fix export file paths in published packages, add trailing `./` to all export paths in package.json; use correct export for `unpkg` +- fix(docs): vitepress broken after update, add type:module to docs package.json + +๐Ÿงช Tests + +- coverage: switch from coverage-c8 to coverage-v8, c8 is deprecated in vitest + +๐Ÿก Chores + +- Add dependency `@vitest/coverage-v8` - `v1.0.1` +- Remove dependency `@vitest/coverage-c8` + +- Update dependency `pnpm` to `v8.9.2` +- Update dependency `turbo` to `v1.10.16` +- Update dependency `typescript` to `v5.2.2` +- Update dependency `vue` to `v3.3.7` +- Update dependency `sass` to `v1.69.4` +- Update dependency `dotenv` to `v16.3.1` +- Update dependency `rimraf` to `v5.0.5` +- Update dependency `typedoc` to `v0.25.2` +- Update dependency `typedoc-plugin-markdown` to `v3.16.0` +- Update dependency `vite` to `v5.0.5` +- Update dependency `@vite-pwa/vitepress` to `v0.3.1` +- Update dependency `vitepress` to `v1.0.0-rc.31` +- Update dependency `vite-plugin-dts` to `v3.6.4` +- Update dependency `vite-plugin-pwa` to `v0.17.3` +- Update dependency `vite-tsconfig-paths` to `v4.2.1` +- Update dependency `vitest` to `v1.0.1` +- Update dependency `@vitest/ui` to `v1.0.1` +- Update dependency `prettier` to `v3.0.0` +- Update dependency `eslint` to `v8.52.0` +- Update dependency `eslint-config-prettier` to `v9.0.0` +- Update dependency `eslint-plugin-prettier` to `v5.0.0` +- Update dependency `eslint-plugin-markdown` to `v3.0.1` +- Update dependency `@typescript-eslint/eslint-plugin` to `v6.9.0` +- Update dependency `@typescript-eslint/parser` to `v6.9.0` +- Update dependency `@commitlint/cli` to `v18.1.0` +- Update dependency `@commitlint/config-conventional` to `v18.1.0` +- Update dependency `@changesets/cli` to `v2.26.2` +- Update dependency `@types/node` to `v18.18.7` +- Update dependency `workbox-window` to `v7.0.0` + +Actions: +- Update github action `pnpm/action-setup` to `v2.4.0` +- Update github action `actions/checkout` to `v4.0.0` +- Update github action `actions/setup-node` to `v4.0.0` diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eec95b26..2112e1d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 2 @@ -45,7 +45,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/workflows/setup @@ -60,7 +60,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/workflows/setup diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 26dd1a1e..c194447c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/workflows/setup @@ -22,6 +22,6 @@ jobs: uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} # don't add this token to PUBLIC repos or action will fail - files: ./packages/lib/coverage/coverage-final.json + files: ./packages/lib/.vitest/dist/coverage/coverage-final.json name: "Upload Test Coverage" # optional fail_ci_if_error: true # optional (default = false) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 316664c4..3b8f5160 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/workflows/setup diff --git a/.github/workflows/setup/action.yaml b/.github/workflows/setup/action.yaml index 4469f330..6b76d36a 100644 --- a/.github/workflows/setup/action.yaml +++ b/.github/workflows/setup/action.yaml @@ -5,10 +5,10 @@ runs: using: "composite" steps: - name: Install pnpm - uses: pnpm/action-setup@v2.2.4 + uses: pnpm/action-setup@v2.4.0 - name: Setup Node.js environment - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 cache: "pnpm" diff --git a/.gitignore b/.gitignore index 715a6d7d..a4e63db8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,10 +8,17 @@ distDev/ docsDev/ dev-dist/ +### Vite +**/vite.config.ts.timestamp* + ### Vitepress **/.vitepress/dist/** **/.vitepress/cache/** +### Vitest +**/.vitest/dist/** +**/*/tsconfig.vitest-temp.json + ### Turbo .turbo @@ -48,6 +55,7 @@ lib-cov # Coverage directory used by tools like istanbul coverage +!**/public/coverage # nyc test coverage .nyc_output diff --git a/.vscode/settings.json b/.vscode/settings.json index 94b39bd9..c068fdd5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,8 @@ { "editor.defaultFormatter": "rvest.vs-code-prettier-eslint", "editor.codeActionsOnSave": { - "source.fixAll": true, - "source.fixAll.eslint": true + "source.fixAll": "explicit", + "source.fixAll.eslint": "explicit" }, "editor.formatOnPaste": false, // required "editor.formatOnType": false, // required diff --git a/README.md b/README.md index df20ac3b..8e4b4d65 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ WMIs, get all makes for a certain year, and more. - [Install](https://vpic.shaggytech.com/guide/install) - [Node Quick Start](https://vpic.shaggytech.com//guide/getting-started#node-quick-start) - [Browser Quick Start](https://vpic.shaggytech.com/guide/getting-started#browser-quick-start) -- [API Reference](https://vpic.shaggytech.com/api/) +- [API Reference](https://vpic.shaggytech.com/guide/vpic/) ## Mono Repo Structure @@ -129,9 +129,9 @@ const { Results } = await DecodeVinValues("WA1A4AFY2J2008189"); 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) +For a full example response see: [DecodeVinValues](https://vpic.shaggytech.com/guide/vpic/endpoints/decode-vin-values#returns) -All available endpoints can be found here: [VPIC API Endpoints](https://vpic.shaggytech.com/api/#vpic-api-endpoints) +All available endpoints can be found here: [VPIC API Endpoints](https://vpic.shaggytech.com/guide/vpic/#vpic-api-endpoints) ## Browser Install diff --git a/apps/docs/.prettierignore b/apps/docs/.prettierignore new file mode 100644 index 00000000..aa2c5cd5 --- /dev/null +++ b/apps/docs/.prettierignore @@ -0,0 +1 @@ +**/typedoc/** \ No newline at end of file diff --git a/apps/docs/.vitepress/config.ts b/apps/docs/.vitepress/config.ts index 9da9cf46..e206dc21 100644 --- a/apps/docs/.vitepress/config.ts +++ b/apps/docs/.vitepress/config.ts @@ -42,10 +42,6 @@ export default withPwa( outline: 'deep', nav: nav(), sidebar: sidebar(), - - // search: { - // provider: 'local', - // }, algolia: getAlgoliaConfig(process.env), editLink: { diff --git a/apps/docs/.vitepress/menu-links.ts b/apps/docs/.vitepress/menu-links.ts index f6e5b442..70250a2c 100644 --- a/apps/docs/.vitepress/menu-links.ts +++ b/apps/docs/.vitepress/menu-links.ts @@ -3,244 +3,238 @@ import { type DefaultTheme } from 'vitepress' type SidebarItem = DefaultTheme.SidebarItem const vpicEndpointLinks = [ - { text: 'DecodeVin', link: '/api/endpoints/decode-vin' }, - { text: 'DecodeVinExtended', link: '/api/endpoints/decode-vin-extended' }, - { text: 'DecodeVinValues', link: '/api/endpoints/decode-vin-values' }, + { text: 'DecodeVin', link: '/guide/vpic/endpoints/decode-vin' }, + { + text: 'DecodeVinExtended', + link: '/guide/vpic/endpoints/decode-vin-extended', + }, + { text: 'DecodeVinValues', link: '/guide/vpic/endpoints/decode-vin-values' }, { text: 'DecodeVinValuesBatch', - link: '/api/endpoints/decode-vin-values-batch', + link: '/guide/vpic/endpoints/decode-vin-values-batch', }, { text: 'DecodeVinValuesExtended', - link: '/api/endpoints/decode-vin-values-extended', + link: '/guide/vpic/endpoints/decode-vin-values-extended', + }, + { text: 'DecodeWMI', link: '/guide/vpic/endpoints/decode-wmi' }, + { text: 'GetAllMakes', link: '/guide/vpic/endpoints/get-all-makes' }, + { + text: 'GetAllManufacturers', + link: '/guide/vpic/endpoints/get-all-manufacturers', }, - { text: 'DecodeWMI', link: '/api/endpoints/decode-wmi' }, - { text: 'GetAllMakes', link: '/api/endpoints/get-all-makes' }, - { text: 'GetAllManufacturers', link: '/api/endpoints/get-all-manufacturers' }, { text: 'GetCanadianVehicleSpecifications', - link: '/api/endpoints/get-canadian-vehicle-specifications', + link: '/guide/vpic/endpoints/get-canadian-vehicle-specifications', }, { text: 'GetEquipmentPlantCodes', - link: '/api/endpoints/get-equipment-plant-codes', + link: '/guide/vpic/endpoints/get-equipment-plant-codes', }, { text: 'GetMakeForManufacturer', - link: '/api/endpoints/get-make-for-manufacturer', + link: '/guide/vpic/endpoints/get-make-for-manufacturer', }, { text: 'GetMakesForManufacturerAndYear', - link: '/api/endpoints/get-makes-for-manufacturer-and-year', + link: '/guide/vpic/endpoints/get-makes-for-manufacturer-and-year', }, { text: 'GetMakesForVehicleType', - link: '/api/endpoints/get-makes-for-vehicle-type', + link: '/guide/vpic/endpoints/get-makes-for-vehicle-type', }, { text: 'GetManufacturerDetails', - link: '/api/endpoints/get-manufacturer-details', + link: '/guide/vpic/endpoints/get-manufacturer-details', + }, + { + text: 'GetModelsForMake', + link: '/guide/vpic/endpoints/get-models-for-make', + }, + { + text: 'GetModelsForMakeId', + link: '/guide/vpic/endpoints/get-models-for-make-id', }, - { text: 'GetModelsForMake', link: '/api/endpoints/get-models-for-make' }, - { text: 'GetModelsForMakeId', link: '/api/endpoints/get-models-for-make-id' }, { text: 'GetModelsForMakeIdYear', - link: '/api/endpoints/get-models-for-make-id-year', + link: '/guide/vpic/endpoints/get-models-for-make-id-year', }, { text: 'GetModelsForMakeYear', - link: '/api/endpoints/get-models-for-make-year', + link: '/guide/vpic/endpoints/get-models-for-make-year', }, - { text: 'GetParts', link: '/api/endpoints/get-parts' }, + { text: 'GetParts', link: '/guide/vpic/endpoints/get-parts' }, { text: 'GetVehicleTypesForMake', - link: '/api/endpoints/get-vehicle-types-for-make', + link: '/guide/vpic/endpoints/get-vehicle-types-for-make', }, { text: 'GetVehicleTypesForMakeId', - link: '/api/endpoints/get-vehicle-types-for-make-id', + link: '/guide/vpic/endpoints/get-vehicle-types-for-make-id', }, { text: 'GetVehicleVariableList', - link: '/api/endpoints/get-vehicle-variable-list', + link: '/guide/vpic/endpoints/get-vehicle-variable-list', }, { text: 'GetVehicleVariableValuesList', - link: '/api/endpoints/get-vehicle-variable-values-list', + link: '/guide/vpic/endpoints/get-vehicle-variable-values-list', }, { text: 'GetWMIsForManufacturer', - link: '/api/endpoints/get-wmis-for-manufacturer', + link: '/guide/vpic/endpoints/get-wmis-for-manufacturer', }, ] const typedocLinks = [ { - text: 'Modules', + text: '/api', collapsed: true, items: [ + { text: 'Index', link: '/typedoc/api' }, + { + text: 'useNHTSA', + link: '/typedoc/api/useNHTSA', + }, { - text: '/api', + text: '/endpoints/', collapsed: true, items: [ - { text: 'Index', link: '/typedoc/modules/api' }, + { text: 'Index', link: '/typedoc/api/endpoints' }, { - text: 'useNHTSA', - link: '/typedoc/modules/api_useNHTSA', + text: 'DecodeVin', + link: '/typedoc/api/vpic/endpoints/DecodeVin', }, { - text: '/endpoints/', - collapsed: true, - items: [ - { text: 'Index', link: '/typedoc/modules/api_endpoints' }, - { - text: 'DecodeVin', - link: '/typedoc/modules/api_endpoints_DecodeVin', - }, - { - text: 'DecodeVinExtended', - link: '/typedoc/modules/api_endpoints_DecodeVinExtended', - }, - { - text: 'DecodeVinValues', - link: '/typedoc/modules/api_endpoints_DecodeVinValues', - }, - { - text: 'DecodeVinValuesBatch', - link: '/typedoc/modules/api_endpoints_DecodeVinValuesBatch', - }, - { - text: 'DecodeVinValuesExtended', - link: '/typedoc/modules/api_endpoints_DecodeVinValuesExtended', - }, - { - text: 'DecodeWMI', - link: '/typedoc/modules/api_endpoints_DecodeWMI', - }, - { - text: 'GetAllMakes', - link: '/typedoc/modules/api_endpoints_GetAllMakes', - }, - { - text: 'GetAllManufacturers', - link: '/typedoc/modules/api_endpoints_GetAllManufacturers', - }, - { - text: 'GetCanadianVehicleSpecifications', - link: '/typedoc/modules/api_endpoints_GetCanadianVehicleSpecifications', - }, - { - text: 'GetEquipmentPlantCodes', - link: '/typedoc/modules/api_endpoints_GetEquipmentPlantCodes', - }, - { - text: 'GetMakeForManufacturer', - link: '/typedoc/modules/api_endpoints_GetMakeForManufacturer', - }, - { - text: 'GetMakesForManufacturerAndYear', - link: '/typedoc/modules/api_endpoints_GetMakesForManufacturerAndYear', - }, - { - text: 'GetMakesForVehicleType', - link: '/typedoc/modules/api_endpoints_GetMakesForVehicleType', - }, - { - text: 'GetManufacturerDetails', - link: '/typedoc/modules/api_endpoints_GetManufacturerDetails', - }, - { - text: 'GetModelsForMake', - link: '/typedoc/modules/api_endpoints_GetModelsForMake', - }, - { - text: 'GetModelsForMakeId', - link: '/typedoc/modules/api_endpoints_GetModelsForMakeId', - }, - { - text: 'GetModelsForMakeIdYear', - link: '/typedoc/modules/api_endpoints_GetModelsForMakeIdYear', - }, - { - text: 'GetModelsForMakeYear', - link: '/typedoc/modules/api_endpoints_GetModelsForMakeYear', - }, - { - text: 'GetParts', - link: '/typedoc/modules/api_endpoints_GetParts', - }, - { - text: 'GetVehicleTypesForMake', - link: '/typedoc/modules/api_endpoints_GetVehicleTypesForMake', - }, - { - text: 'GetVehicleTypesForMakeId', - link: '/typedoc/modules/api_endpoints_GetVehicleTypesForMakeId', - }, - { - text: 'GetVehicleVariableList', - link: '/typedoc/modules/api_endpoints_GetVehicleVariableList', - }, - { - text: 'GetVehicleVariableValuesList', - link: '/typedoc/modules/api_endpoints_GetVehicleVariableValuesList', - }, - { - text: 'GetWMIsForManufacturer', - link: '/typedoc/modules/api_endpoints_GetWMIsForManufacturer', - }, - ], + text: 'DecodeVinExtended', + link: '/typedoc/api/vpic/endpoints/DecodeVinExtended', + }, + { + text: 'DecodeVinValues', + link: '/typedoc/api/vpic/endpoints/DecodeVinValues', + }, + { + text: 'DecodeVinValuesBatch', + link: '/typedoc/api/vpic/endpoints/DecodeVinValuesBatch', + }, + { + text: 'DecodeVinValuesExtended', + link: '/typedoc/api/vpic/endpoints/DecodeVinValuesExtended', + }, + { + text: 'DecodeWMI', + link: '/typedoc/api/vpic/endpoints/DecodeWMI', + }, + { + text: 'GetAllMakes', + link: '/typedoc/api/vpic/endpoints/GetAllMakes', + }, + { + text: 'GetAllManufacturers', + link: '/typedoc/api/vpic/endpoints/GetAllManufacturers', + }, + { + text: 'GetCanadianVehicleSpecifications', + link: '/typedoc/api/vpic/endpoints/GetCanadianVehicleSpecifications', + }, + { + text: 'GetEquipmentPlantCodes', + link: '/typedoc/api/vpic/endpoints/GetEquipmentPlantCodes', + }, + { + text: 'GetMakeForManufacturer', + link: '/typedoc/api/vpic/endpoints/GetMakeForManufacturer', + }, + { + text: 'GetMakesForManufacturerAndYear', + link: '/typedoc/api/vpic/endpoints/GetMakesForManufacturerAndYear', + }, + { + text: 'GetMakesForVehicleType', + link: '/typedoc/api/vpic/endpoints/GetMakesForVehicleType', + }, + { + text: 'GetManufacturerDetails', + link: '/typedoc/api/vpic/endpoints/GetManufacturerDetails', }, - ], - }, - { - text: '/utils', - collapsed: true, - items: [ - { text: 'Index', link: '/typedoc/modules/utils' }, { - text: 'argHandler', - link: '/typedoc/modules/utils_argHandler', + text: 'GetModelsForMake', + link: '/typedoc/api/vpic/endpoints/GetModelsForMake', }, { - text: 'errorHandler', - link: '/typedoc/modules/utils_errorHandler', + text: 'GetModelsForMakeId', + link: '/typedoc/api/vpic/endpoints/GetModelsForMakeId', }, { - text: 'getTypeof', - link: '/typedoc/modules/utils_getTypeof', + text: 'GetModelsForMakeIdYear', + link: '/typedoc/api/vpic/endpoints/GetModelsForMakeIdYear', }, { - text: 'isValidVin', - link: '/typedoc/modules/utils_isValidVin', + text: 'GetModelsForMakeYear', + link: '/typedoc/api/vpic/endpoints/GetModelsForMakeYear', }, { - text: 'queryString', - link: '/typedoc/modules/utils_queryString', + text: 'GetParts', + link: '/typedoc/api/vpic/endpoints/GetParts', + }, + { + text: 'GetVehicleTypesForMake', + link: '/typedoc/api/vpic/endpoints/GetVehicleTypesForMake', + }, + { + text: 'GetVehicleTypesForMakeId', + link: '/typedoc/api/vpic/endpoints/GetVehicleTypesForMakeId', + }, + { + text: 'GetVehicleVariableList', + link: '/typedoc/api/vpic/endpoints/GetVehicleVariableList', + }, + { + text: 'GetVehicleVariableValuesList', + link: '/typedoc/api/vpic/endpoints/GetVehicleVariableValuesList', + }, + { + text: 'GetWMIsForManufacturer', + link: '/typedoc/api/vpic/endpoints/GetWMIsForManufacturer', }, ], }, ], }, { - text: 'Types', + text: '/utils', collapsed: true, items: [ - { text: 'Index', link: '/typedoc/modules/types' }, - { text: '/api/types', link: '/typedoc/modules/api_types' }, + { text: 'Index', link: '/typedoc/utils' }, + { + text: 'argHandler', + link: '/typedoc/utils/argHandler', + }, + { + text: 'errorHandler', + link: '/typedoc/utils/errorHandler', + }, { - text: '/api/endpoints/types', - link: '/typedoc/modules/api_endpoints_types', + text: 'getTypeof', + link: '/typedoc/utils/getTypeof', }, { - text: '/utils/types', - link: '/typedoc/modules/utils_types', + text: 'isValidVin', + link: '/typedoc/utils/isValidVin', + }, + { + text: 'queryString', + link: '/typedoc/utils/queryString', }, ], }, + { + text: 'Types', + link: '/typedoc/types', + }, ] -export type LinkGroup = 'guide' | 'api' | 'typedocs' +export type LinkGroup = 'guide' | 'typedocs' const groupLinks: Record = { guide: [ @@ -249,12 +243,19 @@ const groupLinks: Record = { { text: 'Getting Started', link: '/guide/getting-started' }, { text: 'Typescript', link: '/guide/typescript' }, { - text: 'Bring Your Own Fetch (BYOF)', - link: '/guide/bring-your-own-fetch', - }, - { - text: 'Support for Node Versions < 18', - link: '/guide/native-fetch', + text: 'VPIC', + items: [ + { text: 'Overview', link: '/guide/vpic/' }, + { + text: 'VPIC Response', + link: '/guide/vpic/vpic-api-response', + }, + { + text: 'VPIC Functions', + items: vpicEndpointLinks, + collapsed: true, + }, + ], }, { text: 'Examples', @@ -274,17 +275,18 @@ const groupLinks: Record = { { text: 'useNHTSA', link: '/utils/use-nhtsa' }, ], }, - ], - api: [ - { text: 'Overview', link: '/api/' }, { - text: 'VPIC Response', - link: '/api/vpic-api-response', - }, - { - text: 'VPIC Functions', - items: vpicEndpointLinks, - collapsed: false, + text: 'Misc', + items: [ + { + text: 'Bring Your Own Fetch (BYOF)', + link: '/guide/bring-your-own-fetch', + }, + { + text: 'Support for Node Versions < 18', + link: '/guide/native-fetch', + }, + ], }, ], typedocs: [{ text: 'Index', link: '/typedoc/' }, ...typedocLinks], @@ -295,10 +297,6 @@ const linkGroups: Record = { text: 'Guide', items: groupLinks.guide, }, - api: { - text: 'API', - items: groupLinks.api, - }, typedocs: { text: 'Typedocs', items: groupLinks.typedocs, diff --git a/apps/docs/.vitepress/menu.ts b/apps/docs/.vitepress/menu.ts index d3ac6cff..e78a712f 100644 --- a/apps/docs/.vitepress/menu.ts +++ b/apps/docs/.vitepress/menu.ts @@ -7,7 +7,6 @@ const pkg = require('@shaggytools/nhtsa-api-wrapper/package.json') function nav() { return [ { text: 'Guide', link: '/guide/', activeMatch: '/guide|utils/' }, - { text: 'API', link: '/api/', activeMatch: '/api/' }, { text: 'Typedocs', link: '/typedoc/', activeMatch: '/typedoc/' }, { text: pkg.version, @@ -25,7 +24,6 @@ function sidebar() { return { '/guide/': sidebarLinks(['guide']), '/utils/': sidebarLinks(['guide']), - '/api/': sidebarLinks(['api']), '/typedoc/': sidebarLinks(['typedocs']), } } diff --git a/apps/docs/.vitepress/theme/components/VinDecoder.vue b/apps/docs/.vitepress/theme/components/VinDecoder.vue new file mode 100644 index 00000000..3181a13b --- /dev/null +++ b/apps/docs/.vitepress/theme/components/VinDecoder.vue @@ -0,0 +1,26 @@ + + + diff --git a/apps/docs/package.json b/apps/docs/package.json index ed859a2f..895dd38c 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -4,38 +4,39 @@ "version": "3.0.4", "description": "Documentation for @shaggytools/nhtsa-api-wrapper", "main": "index.js", + "type": "module", "scripts": { "preinstall": "npx only-allow pnpm", "dev": "vitepress dev --host", "build": "vitepress build", "preview": "vitepress preview", "lint": "eslint .", - "lint:fix": "eslint --fix", - "format": "prettier --write \"src/**/*.{ts,tsx,md}\"", + "lint:fix": "eslint . --fix", + "format": "prettier --write \"src/**/*.{js,ts,md}\"", "format:typedoc": "prettier --write \"src/typedoc/**/*.md\"", "clean": "rimraf .vitepress/dist .vitepress/cache .turbo", "clean:all": "pnpm run clean && rimraf node_modules" }, "dependencies": { "@shaggytools/nhtsa-api-wrapper": "workspace:*", - "vue": "3.3.4" + "vue": "3.3.7" }, "devDependencies": { - "@types/node": "18.13.0", - "@vite-pwa/vitepress": "0.0.5", - "dotenv": "16.0.3", - "eslint": "8.41.0", + "@types/node": "18.18.7", + "@vite-pwa/vitepress": "0.3.1", + "dotenv": "16.3.1", + "eslint": "8.52.0", "eslint-config-custom": "workspace:*", - "prettier": "2.8.8", + "prettier": "3.0.3", "prettier-config": "workspace:*", - "rimraf": "5.0.1", - "sass": "1.62.1", + "rimraf": "5.0.5", + "sass": "1.69.4", "sitemap": "7.1.1", "tsconfig": "workspace:*", - "typescript": "5.0.4", - "vite-plugin-pwa": "0.15.1", - "vitepress": "1.0.0-beta.1", - "workbox-window": "6.6.0" + "typescript": "5.2.2", + "vite-plugin-pwa": "0.17.3", + "vitepress": "1.0.0-rc.31", + "workbox-window": "7.0.0" }, "eslintConfig": { "extends": [ @@ -44,4 +45,4 @@ "root": true }, "prettier": "prettier-config" -} +} \ No newline at end of file diff --git a/apps/docs/src/api/index.md b/apps/docs/src/api/index.md deleted file mode 100644 index 672ff1b9..00000000 --- a/apps/docs/src/api/index.md +++ /dev/null @@ -1,39 +0,0 @@ -# API Reference - ---- - -This section of the documentation describes the main functions exported by this package, as well as -the response format returned by the NHTSA API. - -You can also find details of the VPIC API endpoints and what they return. - -## VPIC API Response - -- [VPIC API Response](../api/vpic-api-response) - -## VPIC API Endpoints - -- [DecodeVin](../api/endpoints/decode-vin) -- [DecodeVinExtended](../api/endpoints/decode-vin-extended) -- [DecodeVinValues](../api/endpoints/decode-vin-values) -- [DecodeVinValuesBatch](../api/endpoints/decode-vin-values-batch) -- [DecodeVinValuesExtended](../api/endpoints/decode-vin-values-extended) -- [DecodeWMI](../api/endpoints/decode-wmi) -- [GetAllMakes](../api/endpoints/get-all-makes) -- [GetAllManufacturers](../api/endpoints/get-all-manufacturers) -- [GetCanadianVehicleSpecifications](../api/endpoints/get-canadian-vehicle-specifications) -- [GetEquipmentPlantCodes](../api/endpoints/get-equipment-plant-codes) -- [GetMakeForManufacturer](../api/endpoints/get-make-for-manufacturer) -- [GetMakesForManufacturerAndYear](../api/endpoints/get-makes-for-manufacturer-and-year) -- [GetMakesForVehicleType](../api/endpoints/get-makes-for-vehicle-type) -- [GetManufacturerDetails](../api/endpoints/get-manufacturer-details) -- [GetModelsForMake](../api/endpoints/get-models-for-make) -- [GetModelsForMakeId](../api/endpoints/get-models-for-make-id) -- [GetModelsForMakeIdYear](../api/endpoints/get-models-for-make-id-year) -- [GetModelsForMakeYear](../api/endpoints/get-models-for-make-year) -- [GetParts](../api/endpoints/get-parts) -- [GetVehicleTypesForMake](../api/endpoints/get-vehicle-types-for-make) -- [GetVehicleTypesForMakeId](../api/endpoints/get-vehicle-types-for-make-id) -- [GetVehicleVariableList](../api/endpoints/get-vehicle-variable-list) -- [GetVehicleVariableValuesList](../api/endpoints/get-vehicle-variable-values-list) -- [GetWMIsForManufacturer](../api/endpoints/get-wmis-for-manufacturer) diff --git a/apps/docs/src/guide/getting-started.md b/apps/docs/src/guide/getting-started.md index ab05e101..710cebec 100644 --- a/apps/docs/src/guide/getting-started.md +++ b/apps/docs/src/guide/getting-started.md @@ -54,11 +54,11 @@ Further Reading: - A more in depth explanation of how to decode a VIN and parse the data can be found on the [Decoding a VIN](../guide/vin-decoding) page. -- For a full example response see [DecodeVinValues](../api/endpoints/decode-vin-values#returns) +- For a full example response see [DecodeVinValues](../guide/vpic/endpoints/decode-vin-values#returns) documentation. - The structure of `Results[0]` in the above example can be seen on the - [Typedocs - DecodeVinValuesResults](../typedoc/modules/api_endpoints_DecodeVinValues#decodevinvaluesresults) + [Typedocs - DecodeVinValuesResults](../typedoc/api/vpic/endpoints/DecodeVinValues#decodevinvaluesresults) page. --- @@ -72,7 +72,7 @@ The following are simple examples that use the jsDelivr CDN: _~ 4kB (auto minified)_ ```html - + @@ -200,5 +200,5 @@ import { - [VIN Decoding](../guide/vin-decoding) - [Offline VIN Validation](../guide/offline-vin-validation) -- [VPIC API Response](../api/vpic-api-response) -- [VPIC API Endpoints](../api/endpoints/#vpic-api-endpoints) +- [VPIC API Response](../guide/vpic/vpic-api-response) +- [VPIC API Endpoints](../guide/vpic/endpoints/#vpic-api-endpoints) diff --git a/apps/docs/src/guide/index.md b/apps/docs/src/guide/index.md index dc280523..22609b7f 100644 --- a/apps/docs/src/guide/index.md +++ b/apps/docs/src/guide/index.md @@ -4,7 +4,7 @@ โœ”๏ธ A thin Javascript client for the [NHTSA VPIC API](https://vpic.nhtsa.dot.gov/api/) -โœ”๏ธ 24 helper functions to retrieve data from each of the [VPIC API endpoints](../api/index#vpic-api-endpoints) +โœ”๏ธ 24 helper functions to retrieve data from each of the [VPIC API endpoints](../guide/vpic/index#vpic-api-endpoints) โœ”๏ธ Works in Node.js via package managers and in browser scripts via CDN. @@ -29,7 +29,7 @@ make interacting with the API and retrieving data less of a chore. - Provides a set of 24 helper functions to interact with each of the 24 endpoints, so you don't have to worry about the url structure, query parameters, formatting, or fetching the data. - See the [VPIC API](/api/) section for more info. + See the [VPIC API](/guide/vpic/) section for more info. - Use the built in `fetch` functionionality or provide your own. The endpoint functions can be used to build full VPIC URLs for you to use your own fetch implentation such as Axios or a polyfill. @@ -56,7 +56,7 @@ It can also be used to get all models of a make, to decode WMIs, get all makes f and more. A list of all 24 VPIC endpoints can be found in the -[NHTSA API Endpoints](../api/index#vpic-api-endpoints) section. +[NHTSA API Endpoints](../guide/vpic/index#vpic-api-endpoints) section. ::: tip :bulb: TIP diff --git a/apps/docs/src/guide/install.md b/apps/docs/src/guide/install.md index 56705656..89e0371e 100644 --- a/apps/docs/src/guide/install.md +++ b/apps/docs/src/guide/install.md @@ -120,7 +120,7 @@ want to use the Node.js method instead and install from a package manager. ::: code-group ```html [jsDelivr (ESM)] - + @@ -138,7 +138,7 @@ want to use the Node.js method instead and install from a package manager. ``` ```html [jsDelivr (IIFE)] - + @@ -155,7 +155,7 @@ want to use the Node.js method instead and install from a package manager. ``` ```html [UNPKG (IIFE)] - + diff --git a/apps/docs/src/guide/typescript.md b/apps/docs/src/guide/typescript.md index 5010d36c..7a039ff1 100644 --- a/apps/docs/src/guide/typescript.md +++ b/apps/docs/src/guide/typescript.md @@ -5,81 +5,29 @@ in the `@shaggytools/nhtsa-api-wrapper/dist/types`. In most cases you shouldn't directly. We've tried to be as accurate as possible typing the API responses based on testing real responses -from the NHTSA API. Please report any discrepancies you may find and they will be fixed. - -::: tip :mag: See Also: - -Check out the [API](/api/) section for more details on each endpoint helper function and their -return types. - -::: +from the NHTSA API. Please report any discrepancies you find via the +[Github Repo](https://github.com/ShaggyTech/nhtsa-api-wrapper/issues/new/choose) and they will be +fixed. --- -## Using Typescript - -This package was designed with typescript support in mind and therefore should work out of the box -with most modern code editors. - -If for some reason you're not getting any type hints or code completion, or receive errors about not -finding types for this package, you may need to add the following to your `tsconfig.json` file: - -::: code-group - -```json [tsconfig.json] -{ - "compilerOptions": { - "types": ["@shaggytools/nhtsa-api-wrapper"] - } -} -``` - -::: - -There is the potential for some confusion when using the package with Typescript. This is due to -the fact that the NHTSA API uses `PascalCase` for it's endpoint names, and Javascript -conventions are to use `camelCase` for function names and `PascalCase` for classes/types. - -In this package the endpoint wrapper functions aren't `camelCased` like most javascript functions, -they are `PascalCased`. For example `DecodeVin` and `GetAllMakes` instead of `decodeVin` and -`getAllMakes`. - -The decision was made to name package endpoint functions with the same name and casing as the -endpoints themselves, mostly for the sake of consistency between this package and the -[official VPIC documentation](https://vpic.nhtsa.dot.gov/api/). - -The package types are also `PascalCased` just like the endpoint functions. This can be confusing when -importing from this package while using intellesense/code completion in your code editor as it will -show the function names and types all grouped together in `PascalCase`. It may be hard to tell the -difference between the function names and the types if you don't know what to look for. - -Every endpoint function has a corresponding `Results` type with the same name and casing as the -function. For example `DecodeVin` has a `DecodeVinResults` type, `GetAllMakes` has a -`GetAllMakesResults` type, etc. - -A few endpoints also have other associated types, such as -[`DecodeVinExtendedVariable`](../typedoc/modules/api_endpoints_DecodeVinExtended#decodevinextendedvariable) -that describe possible `Variable` values found in the `Results` array of the `DecodeVinExtended` -endpoint. - ## Exported Types ::: tip :mag: See Also: -The [Typedocs - Types](../typedoc/modules/types) page lists all of the types this -package exports and their structure. - -
+The [Typedocs - Types](../typedoc/types) page lists all of the types this package exports and their +structure. -You can find a full list of bundled types in the `/dist/types` directory on the -[UNPKG Homepage](https://unpkg.com/browse/@shaggytools/nhtsa-api-wrapper/dist/types/) for this -package. ::: All bundled types can be found in the `@shaggytools/nhtsa-api-wrapper/dist/types` directory. You shouldn't need to import them directly from `/dist/types`. Instead, you can import them directly from the package itself. +You can find a full list of bundled types in the `/dist/types` directory on the +[UNPKG Homepage](https://unpkg.com/browse/@shaggytools/nhtsa-api-wrapper/dist/types/) for this +package. + Here's an example of how to import specific types from this package: ```ts @@ -98,6 +46,23 @@ import { } from '@shaggytools/nhtsa-api-wrapper' ``` +::: warning :mag: Note: + +If for some reason you're not getting any type hints or code completion, or receive errors about not +finding types for this package, you may need to add the following to your `tsconfig.json` file: + +::: code-group + +```json [tsconfig.json] +{ + "compilerOptions": { + "types": ["@shaggytools/nhtsa-api-wrapper"] + } +} +``` + +::: + ## NHTSA API Response Types The NHTSA VPIC API response is an object with the following structure: @@ -138,12 +103,44 @@ type NhtsaResponse = { ::: tip :mag: See Also: -The [VPIC Response](/api/vpic-api-response) page has more details +The [VPIC Response](./vpic/vpic-api-response) page has more details on the response returned by the VPIC API. ::: -## Note for Beginners +## Using Typescript With This Package + +This package was designed with typescript support in mind and therefore will work out of the box +with most modern code editors. You should get type hints, code completion, and TS errors for all of +the package functions and types. + +There is the potential for some confusion when using the package with Typescript. This is due to +the fact that the NHTSA API uses `PascalCase` for it's endpoint names, and Javascript +conventions are to use `camelCase` for function names and `PascalCase` for classes/types. + +In this package the endpoint wrapper functions aren't `camelCased` like most javascript functions, +they are `PascalCased`. For example `DecodeVin` and `GetAllMakes` instead of `decodeVin` and +`getAllMakes`. + +The decision was made to name package endpoint functions with the same name and casing as the +endpoints themselves, mostly for the sake of consistency between this package and the +[official VPIC documentation](https://vpic.nhtsa.dot.gov/api/). + +The package types are also `PascalCased` just like the endpoint functions. This can be confusing when +importing from this package while using intellesense/code completion in your code editor as it will +show the function names and types all grouped together in `PascalCase`. It may be hard to tell the +difference between the function names and the types if you don't know what to look for. + +Every endpoint function has a corresponding `Results` type with the same name and casing as the +function. For example `DecodeVin` has a `DecodeVinResults` type, `GetAllMakes` has a +`GetAllMakesResults` type, etc. + +A few endpoints also have other associated types, such as +[`DecodeVinExtendedVariable`](../typedoc/api/vpic/endpoints/DecodeVinExtended#DecodeVinExtendedVariable) +that describe possible `Variable` values found in the `Results` array of the `DecodeVinExtended` +endpoint. + +## Notes for Beginners If you're new to Typescript, you may be wondering what 'full typescript support' means. @@ -215,15 +212,15 @@ appear. This is what is known as "intellisense" or "code completion". If you were to attempt accessing `Results[0].Other` you would see that it does not exist in type `DecodeVinResults`. Your code editor would let you know that you're trying to access a property -that doesn't exist. In this way you can avoid common mistakes like typos and accessing properties -that don't exist. +that doesn't exist. In this way you can avoid common mistakes like typos and accessing non-existing +properties. Similarly, if you saved the `Results[0].ValueId` value to a variable, your code editor will know that it's of type `number` and warn you if you try to use in ways that numbers can't be used, such as `Results[0].ValueId.toUpperCase()` or similar. You would be warned that `toUpperCase` does not exist on type `number`. -
+### Conclusion These are just some of the benefits of having Typescript support. The key takeaway is that it will help you avoid common mistakes and make you a more efficient developer. It can be adopted into an diff --git a/apps/docs/src/guide/vin-decoding.md b/apps/docs/src/guide/vin-decoding.md index 0b85f6f7..92de67f1 100644 --- a/apps/docs/src/guide/vin-decoding.md +++ b/apps/docs/src/guide/vin-decoding.md @@ -30,7 +30,7 @@ response = { */ ``` -::: tip :mag: See: [VPIC Response](../api/vpic-api-response) for more info on the response object +::: tip :mag: See: [VPIC Response](../guide/vpic/vpic-api-response) for more info on the response object ::: --- @@ -50,9 +50,9 @@ object. This object is the decoded data for the VIN. ::: tip See also: -- [DecodeVinValues](../api/endpoints/decode-vin-values) -- [DecodeVinValues Example Response](../api/endpoints/decode-vin-values#returns) -- [Type - DecodeVinValuesResults](../typedoc/modules/api_endpoints_DecodeVinValues#decodevinvaluesresults) +- [DecodeVinValues](../guide/vpic/endpoints/decode-vin-values) +- [DecodeVinValues Example Response](../guide/vpic/endpoints/decode-vin-values#returns) +- [Type - DecodeVinValuesResults](../typedoc/api/vpic/endpoints/DecodeVinValues#decodevinvaluesresults) ::: @@ -89,9 +89,8 @@ console.log( ```typescript import { DecodeVinValues } from '@shaggytools/nhtsa-api-wrapper' -const { Count, Message, Results, SearchCriteria } = await DecodeVinValues( - 'WA1A4AFY2J2008189' -) +const { Count, Message, Results, SearchCriteria } = + await DecodeVinValues('WA1A4AFY2J2008189') // Destructure to get the specific data you want to use const { ModelYear, Make, Model, EngineHP } = Results[0] @@ -101,5 +100,5 @@ console.log( ) ``` -::: tip :mag: See Also: [VPIC API Endpoints](../api/#vpic-api-endpoints) +::: tip :mag: See Also: [VPIC API Endpoints](../guide/vpic/#vpic-api-endpoints) ::: diff --git a/apps/docs/src/api/endpoints/decode-vin-extended.md b/apps/docs/src/guide/vpic/endpoints/decode-vin-extended.md similarity index 93% rename from apps/docs/src/api/endpoints/decode-vin-extended.md rename to apps/docs/src/guide/vpic/endpoints/decode-vin-extended.md index b6a05d32..f3cb3a41 100644 --- a/apps/docs/src/api/endpoints/decode-vin-extended.md +++ b/apps/docs/src/guide/vpic/endpoints/decode-vin-extended.md @@ -15,7 +15,7 @@ async function DecodeVinExtended ( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_DecodeVinExtended) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/DecodeVinExtended) ::: ## Description @@ -54,7 +54,7 @@ Any `params` that are not listed in the table above will be ignored. As `params` is optional, it also has type `| boolean`, so you can set `doFetch` without having to pass `undefined` in place of intentionally undefined `params`. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -91,7 +91,7 @@ Returns the URL string that can be used to fetch the data, does _not_ fetch the // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVinExtended/WA1A4AFY2J2008189?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type DecodeVinExtendedResults @@ -157,7 +157,7 @@ const response = await DecodeVinExtended('5UXWX7C5*BA') - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/decode-vin-values-batch.md b/apps/docs/src/guide/vpic/endpoints/decode-vin-values-batch.md similarity index 91% rename from apps/docs/src/api/endpoints/decode-vin-values-batch.md rename to apps/docs/src/guide/vpic/endpoints/decode-vin-values-batch.md index 40cb3fb3..e0fab586 100644 --- a/apps/docs/src/api/endpoints/decode-vin-values-batch.md +++ b/apps/docs/src/guide/vpic/endpoints/decode-vin-values-batch.md @@ -10,7 +10,7 @@ async function DecodeVinValuesBatch( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_DecodeVinValuesBatch) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/DecodeVinValuesBatch) ::: ## Description @@ -53,7 +53,7 @@ the model year if it is known at the time of decoding, but it is not required. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -91,7 +91,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da ``` ::: tip :bulb: See: -[Using doFetch](../../guide/bring-your-own-fetch#using-dofetch) for info on how to +[Using doFetch](../../bring-your-own-fetch#using-dofetch) for info on how to use the URL string to fetch the data in a POST request such as this endpoint. ::: @@ -157,9 +157,9 @@ const response = await DecodeVinValuesBatch('5UXWX7C5*BA; 5YJSA3DS*EF, 2015') - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) -- See: [Using with POST Endpoints](../../guide/bring-your-own-fetch#using-with-post-endpoints) +- See: [Using with POST Endpoints](../../bring-your-own-fetch#using-with-post-endpoints) - Returns: diff --git a/apps/docs/src/api/endpoints/decode-vin-values-extended.md b/apps/docs/src/guide/vpic/endpoints/decode-vin-values-extended.md similarity index 93% rename from apps/docs/src/api/endpoints/decode-vin-values-extended.md rename to apps/docs/src/guide/vpic/endpoints/decode-vin-values-extended.md index b59941da..65e4f4b2 100644 --- a/apps/docs/src/api/endpoints/decode-vin-values-extended.md +++ b/apps/docs/src/guide/vpic/endpoints/decode-vin-values-extended.md @@ -15,7 +15,7 @@ async function DecodeVinValuesExtended( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_DecodeVinValuesExtended) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/DecodeVinValuesExtended) ::: ## Description @@ -64,7 +64,7 @@ Any `params` that are not listed in the table above will be ignored. As `params` is optional, it also has type `| boolean`, so you can set `doFetch` without having to pass `undefined` in place of intentionally undefined `params`. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -101,7 +101,7 @@ Returns the URL string that can be used to fetch the data, does _not_ fetch the // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVinValuesExtended/WA1A4AFY2J2008189?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - DecodeVinValuesExtendedResults @@ -161,7 +161,7 @@ const response = await DecodeVinValuesExtended('5UXWX7C5*BA') - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/decode-vin-values.md b/apps/docs/src/guide/vpic/endpoints/decode-vin-values.md similarity index 93% rename from apps/docs/src/api/endpoints/decode-vin-values.md rename to apps/docs/src/guide/vpic/endpoints/decode-vin-values.md index 5f4551ba..b8c2d944 100644 --- a/apps/docs/src/api/endpoints/decode-vin-values.md +++ b/apps/docs/src/guide/vpic/endpoints/decode-vin-values.md @@ -15,7 +15,7 @@ async function DecodeVinValues( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_DecodeVinValues) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/DecodeVinValues) ::: ## Description @@ -60,7 +60,7 @@ Any `params` that are not listed in the table above will be ignored. As `params` is optional, it also has type `| boolean`, so you can set `doFetch` without having to pass `undefined` in place of intentionally undefined `params`. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -97,7 +97,7 @@ Returns the URL string that can be used to fetch the data, does _not_ fetch the // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVinValues/WA1A4AFY2J2008189?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - DecodeVinValuesResults @@ -155,7 +155,7 @@ const response = await DecodeVinValues('5UXWX7C5*BA') - Does _NOT_ fetch data from VPIC API internally -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/decode-vin.md b/apps/docs/src/guide/vpic/endpoints/decode-vin.md similarity index 92% rename from apps/docs/src/api/endpoints/decode-vin.md rename to apps/docs/src/guide/vpic/endpoints/decode-vin.md index 93f611ea..60661413 100644 --- a/apps/docs/src/api/endpoints/decode-vin.md +++ b/apps/docs/src/guide/vpic/endpoints/decode-vin.md @@ -15,7 +15,7 @@ async function DecodeVin( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_DecodeVin) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/DecodeVin) ::: ## Description @@ -50,7 +50,7 @@ Any `params` that are not listed in the table above will be ignored. As `params` is optional, it also has type `| boolean`, so you can set `doFetch` without having to pass `undefined` in place of intentionally undefined `params`. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -87,7 +87,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/WA1A4AFY2J2008189?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - DecodeVinResults @@ -151,7 +151,7 @@ const response = await DecodeVin('5UXWX7C5*BA') - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/decode-wmi.md b/apps/docs/src/guide/vpic/endpoints/decode-wmi.md similarity index 89% rename from apps/docs/src/api/endpoints/decode-wmi.md rename to apps/docs/src/guide/vpic/endpoints/decode-wmi.md index 1a950221..5e7ed793 100644 --- a/apps/docs/src/api/endpoints/decode-wmi.md +++ b/apps/docs/src/guide/vpic/endpoints/decode-wmi.md @@ -10,7 +10,7 @@ async function DecodeWMI( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_DecodeWMI) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/DecodeWMI) ::: ## Description @@ -38,7 +38,7 @@ be available in VPIC data sets. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -75,7 +75,7 @@ Returns the URL string that can be used to fetch the data, does _not_ fetch the // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/DecodeWMI/WVW?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - DecodeWMIResults @@ -123,7 +123,7 @@ const response = await DecodeWMI('1CG', true) - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-all-makes.md b/apps/docs/src/guide/vpic/endpoints/get-all-makes.md similarity index 87% rename from apps/docs/src/api/endpoints/get-all-makes.md rename to apps/docs/src/guide/vpic/endpoints/get-all-makes.md index b8157141..de2fe507 100644 --- a/apps/docs/src/api/endpoints/get-all-makes.md +++ b/apps/docs/src/guide/vpic/endpoints/get-all-makes.md @@ -9,7 +9,7 @@ async function GetAllMakes( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetAllMakes) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetAllMakes) ::: ## Description @@ -30,7 +30,7 @@ an individual vehicle Make. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -67,7 +67,7 @@ Returns the URL string that can be used to fetch the data, does _not_ fetch the // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetAllMakes/?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetAllMakesResults @@ -115,7 +115,7 @@ const response = await GetAllMakes(true) - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-all-manufacturers.md b/apps/docs/src/guide/vpic/endpoints/get-all-manufacturers.md similarity index 92% rename from apps/docs/src/api/endpoints/get-all-manufacturers.md rename to apps/docs/src/guide/vpic/endpoints/get-all-manufacturers.md index e63048b1..5d2fcb7c 100644 --- a/apps/docs/src/api/endpoints/get-all-manufacturers.md +++ b/apps/docs/src/guide/vpic/endpoints/get-all-manufacturers.md @@ -15,7 +15,7 @@ async function GetAllManufacturers( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetAllManufacturers) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetAllManufacturers) ::: ## Description @@ -46,7 +46,7 @@ Any `params` that are not listed in the table above will be ignored. As `params` is optional, it also has type `| boolean`, so you can set `doFetch` without having to pass `undefined` in place of intentionally undefined `params`. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -83,7 +83,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetParts?type=565&fromDate=1/1/2015&toDate=5/5/2015&manufacturer=hon&format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetAllManufacturersResults @@ -148,7 +148,7 @@ const response = await GetAllManufacturers({ - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-canadian-vehicle-specifications.md b/apps/docs/src/guide/vpic/endpoints/get-canadian-vehicle-specifications.md similarity index 93% rename from apps/docs/src/api/endpoints/get-canadian-vehicle-specifications.md rename to apps/docs/src/guide/vpic/endpoints/get-canadian-vehicle-specifications.md index d82eb80b..551e3351 100644 --- a/apps/docs/src/api/endpoints/get-canadian-vehicle-specifications.md +++ b/apps/docs/src/guide/vpic/endpoints/get-canadian-vehicle-specifications.md @@ -15,7 +15,7 @@ async function GetCanadianVehicleSpecifications( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetCanadianVehicleSpecifications) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetCanadianVehicleSpecifications) ::: ## Description @@ -56,7 +56,7 @@ Any `params` that are not listed in the table above will be ignored. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -94,7 +94,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetCanadianVehicleSpecifications/?Year=2011&Make=Acura&Model=&units=&format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetCanadianVehicleSpecificationsResults @@ -145,7 +145,7 @@ const response = await GetCanadianVehicleSpecifications({ - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-equipment-plant-codes.md b/apps/docs/src/guide/vpic/endpoints/get-equipment-plant-codes.md similarity index 93% rename from apps/docs/src/api/endpoints/get-equipment-plant-codes.md rename to apps/docs/src/guide/vpic/endpoints/get-equipment-plant-codes.md index 14d1ecca..d217de72 100644 --- a/apps/docs/src/api/endpoints/get-equipment-plant-codes.md +++ b/apps/docs/src/guide/vpic/endpoints/get-equipment-plant-codes.md @@ -31,7 +31,7 @@ async function GetEquipmentPlantCodes( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetEquipmentPlantCodes) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetEquipmentPlantCodes) ::: ## Description @@ -78,7 +78,7 @@ Any `params` that are not listed in the table above will be ignored. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -116,7 +116,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetEquipmentPlantCodes?year=2015&equipmentType=1&reportType=new&format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetEquipmentPlantCodesParams @@ -166,7 +166,7 @@ const response = await GetEquipmentPlantCodes({ - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-make-for-manufacturer.md b/apps/docs/src/guide/vpic/endpoints/get-make-for-manufacturer.md similarity index 90% rename from apps/docs/src/api/endpoints/get-make-for-manufacturer.md rename to apps/docs/src/guide/vpic/endpoints/get-make-for-manufacturer.md index 510034c3..0ab11490 100644 --- a/apps/docs/src/api/endpoints/get-make-for-manufacturer.md +++ b/apps/docs/src/guide/vpic/endpoints/get-make-for-manufacturer.md @@ -10,7 +10,7 @@ async function GetMakeForManufacturer( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetMakeForManufacturer) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetMakeForManufacturer) ::: ## Description @@ -36,7 +36,7 @@ that is requested. Multiple results are returned in case of multiple matches. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -73,7 +73,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetMakeForManufacturer/?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetMakeForManufacturerResults @@ -118,7 +118,7 @@ const response = await GetMakeForManufacturer(988) - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-makes-for-manufacturer-and-year.md b/apps/docs/src/guide/vpic/endpoints/get-makes-for-manufacturer-and-year.md similarity index 92% rename from apps/docs/src/api/endpoints/get-makes-for-manufacturer-and-year.md rename to apps/docs/src/guide/vpic/endpoints/get-makes-for-manufacturer-and-year.md index da1bd756..45b87001 100644 --- a/apps/docs/src/api/endpoints/get-makes-for-manufacturer-and-year.md +++ b/apps/docs/src/guide/vpic/endpoints/get-makes-for-manufacturer-and-year.md @@ -13,7 +13,7 @@ async function GetMakesForManufacturerAndYear( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetMakesForManufacturerAndYear) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetMakesForManufacturerAndYear) ::: ## Description @@ -51,7 +51,7 @@ Any `params` that are not listed in the table above will be ignored. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -89,7 +89,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetMakesForManufacturerAndYear/volks?year=2020&format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetMakesForManufacturerAndYearResults @@ -134,7 +134,7 @@ const response = await GetMakesForManufacturerAndYear(1148, { year: 2020 }) - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-makes-for-vehicle-type.md b/apps/docs/src/guide/vpic/endpoints/get-makes-for-vehicle-type.md similarity index 88% rename from apps/docs/src/api/endpoints/get-makes-for-vehicle-type.md rename to apps/docs/src/guide/vpic/endpoints/get-makes-for-vehicle-type.md index b8922096..817fec25 100644 --- a/apps/docs/src/api/endpoints/get-makes-for-vehicle-type.md +++ b/apps/docs/src/guide/vpic/endpoints/get-makes-for-vehicle-type.md @@ -10,7 +10,7 @@ async function GetMakesForVehicleType( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetMakesForVehicleType) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetMakesForVehicleType) ::: ## Description @@ -32,7 +32,7 @@ See: [Package Reference](../../typedoc/modules/api_endpoints_GetMakesForVehicleT Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -70,7 +70,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetMakesForVehicleType/truck?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetMakesForVehicleTypeResults @@ -107,7 +107,7 @@ const response = await GetMakesForVehicleType('truck') - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-manufacturer-details.md b/apps/docs/src/guide/vpic/endpoints/get-manufacturer-details.md similarity index 90% rename from apps/docs/src/api/endpoints/get-manufacturer-details.md rename to apps/docs/src/guide/vpic/endpoints/get-manufacturer-details.md index 7ee32cd6..1bcbbadc 100644 --- a/apps/docs/src/api/endpoints/get-manufacturer-details.md +++ b/apps/docs/src/guide/vpic/endpoints/get-manufacturer-details.md @@ -10,7 +10,7 @@ async function GetManufacturerDetails( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetManufacturerDetails) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetManufacturerDetails) ::: ## Description @@ -36,7 +36,7 @@ Multiple results are returned in case of multiple matches. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -74,7 +74,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetManufacturerDetails/tesla?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetManufacturerDetailsResults @@ -119,7 +119,7 @@ const response = await GetManufacturerDetails(955) - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-models-for-make-id-year.md b/apps/docs/src/guide/vpic/endpoints/get-models-for-make-id-year.md similarity index 94% rename from apps/docs/src/api/endpoints/get-models-for-make-id-year.md rename to apps/docs/src/guide/vpic/endpoints/get-models-for-make-id-year.md index d92bd214..a06d51ea 100644 --- a/apps/docs/src/api/endpoints/get-models-for-make-id-year.md +++ b/apps/docs/src/guide/vpic/endpoints/get-models-for-make-id-year.md @@ -15,7 +15,7 @@ async function GetModelsForMakeIdYear( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetModelsForMakeIdYear) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetModelsForMakeIdYear) ::: ## Description @@ -75,7 +75,7 @@ Any `params` that are not listed in the table above will be ignored. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -113,7 +113,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetModelsForMakeIdYear/makeId/474/modelyear/2015/vehicleType/car?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetModelsForMakeIdYearResults @@ -175,7 +175,7 @@ const response = await GetModelsForMakeIdYear({ - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-models-for-make-id.md b/apps/docs/src/guide/vpic/endpoints/get-models-for-make-id.md similarity index 89% rename from apps/docs/src/api/endpoints/get-models-for-make-id.md rename to apps/docs/src/guide/vpic/endpoints/get-models-for-make-id.md index 84a26573..8ba40ad0 100644 --- a/apps/docs/src/api/endpoints/get-models-for-make-id.md +++ b/apps/docs/src/guide/vpic/endpoints/get-models-for-make-id.md @@ -10,7 +10,7 @@ async function GetModelsForMakeId( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetModelsForMakeId) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetModelsForMakeId) ::: ## Description @@ -49,7 +49,7 @@ endpoint. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -87,7 +87,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetModelsForMakeId/582?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetModelsForMakeIdResults @@ -124,7 +124,7 @@ const response = await GetModelsForMakeId(582) - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-models-for-make-year.md b/apps/docs/src/guide/vpic/endpoints/get-models-for-make-year.md similarity index 93% rename from apps/docs/src/api/endpoints/get-models-for-make-year.md rename to apps/docs/src/guide/vpic/endpoints/get-models-for-make-year.md index 004bdd7f..d6571a43 100644 --- a/apps/docs/src/api/endpoints/get-models-for-make-year.md +++ b/apps/docs/src/guide/vpic/endpoints/get-models-for-make-year.md @@ -15,7 +15,7 @@ async function GetModelsForMakeYear( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetModelsForMakeYear) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetModelsForMakeYear) ::: ## Description @@ -56,7 +56,7 @@ Any `params` that are not listed in the table above will be ignored. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -94,7 +94,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetModelsForMakeYear/make/audi/modelyear/2018/vehicleType/car?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetModelsForMakeYearResults @@ -157,7 +157,7 @@ const response = await GetModelsForMakeYear({ - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-models-for-make.md b/apps/docs/src/guide/vpic/endpoints/get-models-for-make.md similarity index 87% rename from apps/docs/src/api/endpoints/get-models-for-make.md rename to apps/docs/src/guide/vpic/endpoints/get-models-for-make.md index c9eff80f..cf3a8009 100644 --- a/apps/docs/src/api/endpoints/get-models-for-make.md +++ b/apps/docs/src/guide/vpic/endpoints/get-models-for-make.md @@ -10,7 +10,7 @@ async function GetModelsForMake( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetModelsForMake) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetModelsForMake) ::: ## Description @@ -32,7 +32,7 @@ whose Name is LIKE the Make in vPIC Dataset. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -70,7 +70,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetModelsForMake/audi?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetModelsForMakeResults @@ -107,7 +107,7 @@ const response = await GetModelsForMake('audi') - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-parts.md b/apps/docs/src/guide/vpic/endpoints/get-parts.md similarity index 93% rename from apps/docs/src/api/endpoints/get-parts.md rename to apps/docs/src/guide/vpic/endpoints/get-parts.md index e7a5c9c5..26062b9c 100644 --- a/apps/docs/src/api/endpoints/get-parts.md +++ b/apps/docs/src/guide/vpic/endpoints/get-parts.md @@ -18,7 +18,7 @@ async function GetParts( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetParts) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetParts) ::: ## Description @@ -77,7 +77,7 @@ Any `params` that are not listed in the table above will be ignored. As `params` is optional, it also has type `| boolean`, so you can set `doFetch` without having to pass `undefined` in place of intentionally undefined `params`. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -114,7 +114,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetParts?type=565&fromDate=1/1/2015&toDate=5/5/2015&manufacturer=honda&page=1format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetPartsResults @@ -165,7 +165,7 @@ const response = await GetParts({ - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-vehicle-types-for-make-id.md b/apps/docs/src/guide/vpic/endpoints/get-vehicle-types-for-make-id.md similarity index 90% rename from apps/docs/src/api/endpoints/get-vehicle-types-for-make-id.md rename to apps/docs/src/guide/vpic/endpoints/get-vehicle-types-for-make-id.md index 416ab58b..b14ffac1 100644 --- a/apps/docs/src/api/endpoints/get-vehicle-types-for-make-id.md +++ b/apps/docs/src/guide/vpic/endpoints/get-vehicle-types-for-make-id.md @@ -10,7 +10,7 @@ async function GetVehicleTypesForMakeId( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetVehicleTypesForMakeId) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetVehicleTypesForMakeId) ::: ## Description @@ -49,7 +49,7 @@ endpoint. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -87,7 +87,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetVehicleTypesForMakeId/449?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetVehicleTypesForMakeIdResults @@ -122,7 +122,7 @@ const response = await GetVehicleTypesForMakeId(449) - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-vehicle-types-for-make.md b/apps/docs/src/guide/vpic/endpoints/get-vehicle-types-for-make.md similarity index 88% rename from apps/docs/src/api/endpoints/get-vehicle-types-for-make.md rename to apps/docs/src/guide/vpic/endpoints/get-vehicle-types-for-make.md index fa7a2719..e60268bf 100644 --- a/apps/docs/src/api/endpoints/get-vehicle-types-for-make.md +++ b/apps/docs/src/guide/vpic/endpoints/get-vehicle-types-for-make.md @@ -10,7 +10,7 @@ async function GetVehicleTypesForMake( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetVehicleTypesForMake) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetVehicleTypesForMake) ::: ## Description @@ -32,7 +32,7 @@ whose name is LIKE the make name in the vPIC Dataset. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -70,7 +70,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetVehicleTypesForMake/merc?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetVehicleTypesForMakeResults @@ -107,7 +107,7 @@ const response = await GetVehicleTypesForMake('merc') - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-vehicle-variable-list.md b/apps/docs/src/guide/vpic/endpoints/get-vehicle-variable-list.md similarity index 87% rename from apps/docs/src/api/endpoints/get-vehicle-variable-list.md rename to apps/docs/src/guide/vpic/endpoints/get-vehicle-variable-list.md index b59d7376..a80927b8 100644 --- a/apps/docs/src/api/endpoints/get-vehicle-variable-list.md +++ b/apps/docs/src/guide/vpic/endpoints/get-vehicle-variable-list.md @@ -9,7 +9,7 @@ async function GetVehicleVariableList( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetVehicleVariableList) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetVehicleVariableList) ::: ## Description @@ -27,7 +27,7 @@ vPIC dataset. Information on the name, description and the type of the variable Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -65,7 +65,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/getvehiclevariablelist?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetVehicleVariableListResults @@ -102,7 +102,7 @@ const response = await GetVehicleVariableList() - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-vehicle-variable-values-list.md b/apps/docs/src/guide/vpic/endpoints/get-vehicle-variable-values-list.md similarity index 90% rename from apps/docs/src/api/endpoints/get-vehicle-variable-values-list.md rename to apps/docs/src/guide/vpic/endpoints/get-vehicle-variable-values-list.md index 978f2f01..b786e8e8 100644 --- a/apps/docs/src/api/endpoints/get-vehicle-variable-values-list.md +++ b/apps/docs/src/guide/vpic/endpoints/get-vehicle-variable-values-list.md @@ -10,7 +10,7 @@ async function GetVehicleVariableValuesList( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetVehicleVariableValuesList) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetVehicleVariableValuesList) ::: ## Description @@ -34,7 +34,7 @@ If `variableValue` is a string, it must use full name, not just part of it, e.g. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -72,7 +72,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetVehicleVariableValuesList/battery%20type?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetVehicleVariableValuesListResults @@ -117,7 +117,7 @@ const response = await GetVehicleVariableValuesList(1) - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/get-wmis-for-manufacturer.md b/apps/docs/src/guide/vpic/endpoints/get-wmis-for-manufacturer.md similarity index 93% rename from apps/docs/src/api/endpoints/get-wmis-for-manufacturer.md rename to apps/docs/src/guide/vpic/endpoints/get-wmis-for-manufacturer.md index 4a1bed18..66ccf0b4 100644 --- a/apps/docs/src/api/endpoints/get-wmis-for-manufacturer.md +++ b/apps/docs/src/guide/vpic/endpoints/get-wmis-for-manufacturer.md @@ -13,7 +13,7 @@ async function GetWMIsForManufacturer( ``` ::: tip :bulb: More In Depth -See: [Package Reference](../../typedoc/modules/api_endpoints_GetWMIsForManufacturer) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetWMIsForManufacturer) ::: ## Description @@ -58,7 +58,7 @@ Any `params` that are not listed in the table above will be ignored. Set `doFetch` to `false` if you want to fetch the data yourself. -- See [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) for more info. ::: @@ -96,7 +96,7 @@ Returns a URL string that can be used to fetch the data, does _not_ fetch the da // ex: => 'https://vpic.nhtsa.dot.gov/api/vehicles/GetVehicleVariableValuesList/battery%20type?format=json' ``` -::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +::: tip :bulb: See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) ::: ## Type - GetWMIsForManufacturerResults @@ -152,7 +152,7 @@ const response = await GetWMIsForManufacturer({ - Does _NOT_ fetch data from VPIC API -- See: [BYOF - Bring Your Own Fetch](../../guide/bring-your-own-fetch.md#option-1-set-dofetch-to-false) +- See: [BYOF - Bring Your Own Fetch](../../bring-your-own-fetch.md#option-1-set-dofetch-to-false) - Returns: diff --git a/apps/docs/src/api/endpoints/index.md b/apps/docs/src/guide/vpic/endpoints/index.md similarity index 100% rename from apps/docs/src/api/endpoints/index.md rename to apps/docs/src/guide/vpic/endpoints/index.md diff --git a/apps/docs/src/guide/vpic/index.md b/apps/docs/src/guide/vpic/index.md new file mode 100644 index 00000000..89eda811 --- /dev/null +++ b/apps/docs/src/guide/vpic/index.md @@ -0,0 +1,39 @@ +# API Reference + +--- + +This section of the documentation describes the main functions exported by this package, as well as +the response format returned by the NHTSA API. + +You can also find details of the VPIC API endpoints and what they return. + +## VPIC API Response + +- [VPIC API Response](./vpic-api-response) + +## VPIC API Endpoints + +- [DecodeVin](./endpoints/decode-vin) +- [DecodeVinExtended](./endpoints/decode-vin-extended) +- [DecodeVinValues](./endpoints/decode-vin-values) +- [DecodeVinValuesBatch](./endpoints/decode-vin-values-batch) +- [DecodeVinValuesExtended](./endpoints/decode-vin-values-extended) +- [DecodeWMI](./endpoints/decode-wmi) +- [GetAllMakes](./endpoints/get-all-makes) +- [GetAllManufacturers](./endpoints/get-all-manufacturers) +- [GetCanadianVehicleSpecifications](./endpoints/get-canadian-vehicle-specifications) +- [GetEquipmentPlantCodes](./endpoints/get-equipment-plant-codes) +- [GetMakeForManufacturer](./endpoints/get-make-for-manufacturer) +- [GetMakesForManufacturerAndYear](./endpoints/get-makes-for-manufacturer-and-year) +- [GetMakesForVehicleType](./endpoints/get-makes-for-vehicle-type) +- [GetManufacturerDetails](./endpoints/get-manufacturer-details) +- [GetModelsForMake](./endpoints/get-models-for-make) +- [GetModelsForMakeId](./endpoints/get-models-for-make-id) +- [GetModelsForMakeIdYear](./endpoints/get-models-for-make-id-year) +- [GetModelsForMakeYear](./endpoints/get-models-for-make-year) +- [GetParts](./endpoints/get-parts) +- [GetVehicleTypesForMake](./endpoints/get-vehicle-types-for-make) +- [GetVehicleTypesForMakeId](./endpoints/get-vehicle-types-for-make-id) +- [GetVehicleVariableList](./endpoints/get-vehicle-variable-list) +- [GetVehicleVariableValuesList](./endpoints/get-vehicle-variable-values-list) +- [GetWMIsForManufacturer](./endpoints/get-wmis-for-manufacturer) diff --git a/apps/docs/src/api/vpic-api-response.md b/apps/docs/src/guide/vpic/vpic-api-response.md similarity index 94% rename from apps/docs/src/api/vpic-api-response.md rename to apps/docs/src/guide/vpic/vpic-api-response.md index a7571b5a..54f6ba70 100644 --- a/apps/docs/src/api/vpic-api-response.md +++ b/apps/docs/src/guide/vpic/vpic-api-response.md @@ -134,11 +134,11 @@ type NhtsaResponse = { ``` ::: tip :bulb: TIP -Check out the [Api Reference](/api/) section for specific details on each -endpoint's `Results` array types. +Check out the [VPIC](/guide/vpic/) section for specific details on each endpoint's `Results` array +types. -Here's [DecodeVinResults](../api/endpoints/decode-vin#type-decodevinresults) that was mentioned in the above -example. +Here's [DecodeVinResults](./endpoints/decode-vin#type-decodevinresults) that was mentioned in +the above example. ::: ### SearchCriteria diff --git a/apps/docs/src/index.md b/apps/docs/src/index.md index 7bbb4aaf..0bdfdf58 100644 --- a/apps/docs/src/index.md +++ b/apps/docs/src/index.md @@ -19,7 +19,7 @@ hero: link: /guide/ - theme: alt text: VPIC Helper Functions - link: /api/ + link: /guide/vpic/ features: - title: Simplify the VPIC API diff --git a/apps/docs/src/parts/package-exports-types.md b/apps/docs/src/parts/package-exports-types.md index b368395d..0b5bb828 100644 --- a/apps/docs/src/parts/package-exports-types.md +++ b/apps/docs/src/parts/package-exports-types.md @@ -1,7 +1,7 @@ ## Types This Package Exports ::: tip :bulb: INFO -All types used by this package can be found in the [Typedoc Section](../typedoc/modules/types). +All types used by this package can be found in the [Typedoc Section](../typedoc/types). ::: Each endpoint function returns a `NhtsaResponse` object where `T` is one of the `Results` types @@ -58,5 +58,5 @@ import type { ::: tip :bulb: TIP You can find specific details on each endpoint's `Results` types on their respective pages. -See [DecodeVinResults](../api/endpoints/decode-vin#type-decodevinresults) for example. +See [DecodeVinResults](../guide/vpic/endpoints/decode-vin#type-decodevinresults) for example. ::: diff --git a/apps/docs/src/typedoc/api.md b/apps/docs/src/typedoc/api.md new file mode 100644 index 00000000..2e2961fa --- /dev/null +++ b/apps/docs/src/typedoc/api.md @@ -0,0 +1,218 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](modules.md) / api + +# api + +## Contents + +- [References](api.md#references) + - [DecodeVin](api.md#decodevin) + - [DecodeVinExtended](api.md#decodevinextended) + - [DecodeVinValues](api.md#decodevinvalues) + - [DecodeVinValuesBatch](api.md#decodevinvaluesbatch) + - [DecodeVinValuesExtended](api.md#decodevinvaluesextended) + - [DecodeWMI](api.md#decodewmi) + - [GetAllMakes](api.md#getallmakes) + - [GetAllManufacturers](api.md#getallmanufacturers) + - [GetCanadianVehicleSpecifications](api.md#getcanadianvehiclespecifications) + - [GetEquipmentPlantCodes](api.md#getequipmentplantcodes) + - [GetMakeForManufacturer](api.md#getmakeformanufacturer) + - [GetMakesForManufacturerAndYear](api.md#getmakesformanufacturerandyear) + - [GetMakesForVehicleType](api.md#getmakesforvehicletype) + - [GetManufacturerDetails](api.md#getmanufacturerdetails) + - [GetModelsForMake](api.md#getmodelsformake) + - [GetModelsForMakeId](api.md#getmodelsformakeid) + - [GetModelsForMakeIdYear](api.md#getmodelsformakeidyear) + - [GetModelsForMakeYear](api.md#getmodelsformakeyear) + - [GetParts](api.md#getparts) + - [GetVehicleTypesForMake](api.md#getvehicletypesformake) + - [GetVehicleTypesForMakeId](api.md#getvehicletypesformakeid) + - [GetVehicleVariableList](api.md#getvehiclevariablelist) + - [GetVehicleVariableValuesList](api.md#getvehiclevariablevalueslist) + - [GetWMIsForManufacturer](api.md#getwmisformanufacturer) + - [NoInvalidOptions](api.md#noinvalidoptions) + - [SafetyRatingsOptions](api.md#safetyratingsoptions) + - [SafetyRatingsOptionsBase](api.md#safetyratingsoptionsbase) + - [SafetyRatingsOptionsEmpty](api.md#safetyratingsoptionsempty) + - [SafetyRatingsOptionsMake](api.md#safetyratingsoptionsmake) + - [SafetyRatingsOptionsModel](api.md#safetyratingsoptionsmodel) + - [SafetyRatingsOptionsModelYear](api.md#safetyratingsoptionsmodelyear) + - [SafetyRatingsOptionsVehicleId](api.md#safetyratingsoptionsvehicleid) + - [SafetyRatingsResponse](api.md#safetyratingsresponse) + - [SafetyRatingsResponseByOptions](api.md#safetyratingsresponsebyoptions) + - [SafetyRatingsResponseByVariant](api.md#safetyratingsresponsebyvariant) + - [SafetyRatingsResultsByOptions](api.md#safetyratingsresultsbyoptions) + - [SafetyRatingsResultsByVariant](api.md#safetyratingsresultsbyvariant) + - [SafetyRatingsResultsData](api.md#safetyratingsresultsdata) + - [SafetyRatingsResultsVariants](api.md#safetyratingsresultsvariants) + - [safetyRatings](api.md#safetyratings) + - [useNHTSA](api.md#usenhtsa) + +## References + +### DecodeVin + +Re-exports [DecodeVin](api/vpic/endpoints/DecodeVin.md#decodevin) + +### DecodeVinExtended + +Re-exports [DecodeVinExtended](api/vpic/endpoints/DecodeVinExtended.md#decodevinextended) + +### DecodeVinValues + +Re-exports [DecodeVinValues](api/vpic/endpoints/DecodeVinValues.md#decodevinvalues) + +### DecodeVinValuesBatch + +Re-exports [DecodeVinValuesBatch](api/vpic/endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatch) + +### DecodeVinValuesExtended + +Re-exports [DecodeVinValuesExtended](api/vpic/endpoints/DecodeVinValuesExtended.md#decodevinvaluesextended) + +### DecodeWMI + +Re-exports [DecodeWMI](api/vpic/endpoints/DecodeWMI.md#decodewmi) + +### GetAllMakes + +Re-exports [GetAllMakes](api/vpic/endpoints/GetAllMakes.md#getallmakes) + +### GetAllManufacturers + +Re-exports [GetAllManufacturers](api/vpic/endpoints/GetAllManufacturers.md#getallmanufacturers) + +### GetCanadianVehicleSpecifications + +Re-exports [GetCanadianVehicleSpecifications](api/vpic/endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecifications) + +### GetEquipmentPlantCodes + +Re-exports [GetEquipmentPlantCodes](api/vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodes) + +### GetMakeForManufacturer + +Re-exports [GetMakeForManufacturer](api/vpic/endpoints/GetMakeForManufacturer.md#getmakeformanufacturer) + +### GetMakesForManufacturerAndYear + +Re-exports [GetMakesForManufacturerAndYear](api/vpic/endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyear) + +### GetMakesForVehicleType + +Re-exports [GetMakesForVehicleType](api/vpic/endpoints/GetMakesForVehicleType.md#getmakesforvehicletype) + +### GetManufacturerDetails + +Re-exports [GetManufacturerDetails](api/vpic/endpoints/GetManufacturerDetails.md#getmanufacturerdetails) + +### GetModelsForMake + +Re-exports [GetModelsForMake](api/vpic/endpoints/GetModelsForMake.md#getmodelsformake) + +### GetModelsForMakeId + +Re-exports [GetModelsForMakeId](api/vpic/endpoints/GetModelsForMakeId.md#getmodelsformakeid) + +### GetModelsForMakeIdYear + +Re-exports [GetModelsForMakeIdYear](api/vpic/endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyear) + +### GetModelsForMakeYear + +Re-exports [GetModelsForMakeYear](api/vpic/endpoints/GetModelsForMakeYear.md#getmodelsformakeyear) + +### GetParts + +Re-exports [GetParts](api/vpic/endpoints/GetParts.md#getparts) + +### GetVehicleTypesForMake + +Re-exports [GetVehicleTypesForMake](api/vpic/endpoints/GetVehicleTypesForMake.md#getvehicletypesformake) + +### GetVehicleTypesForMakeId + +Re-exports [GetVehicleTypesForMakeId](api/vpic/endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeid) + +### GetVehicleVariableList + +Re-exports [GetVehicleVariableList](api/vpic/endpoints/GetVehicleVariableList.md#getvehiclevariablelist) + +### GetVehicleVariableValuesList + +Re-exports [GetVehicleVariableValuesList](api/vpic/endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslist) + +### GetWMIsForManufacturer + +Re-exports [GetWMIsForManufacturer](api/vpic/endpoints/GetWMIsForManufacturer.md#getwmisformanufacturer) + +### NoInvalidOptions + +Re-exports [NoInvalidOptions](api/safetyRatings.md#noinvalidoptionst) + +### SafetyRatingsOptions + +Re-exports [SafetyRatingsOptions](api/safetyRatings.md#safetyratingsoptions) + +### SafetyRatingsOptionsBase + +Re-exports [SafetyRatingsOptionsBase](api/safetyRatings.md#safetyratingsoptionsbase) + +### SafetyRatingsOptionsEmpty + +Re-exports [SafetyRatingsOptionsEmpty](api/safetyRatings.md#safetyratingsoptionsempty) + +### SafetyRatingsOptionsMake + +Re-exports [SafetyRatingsOptionsMake](api/safetyRatings.md#safetyratingsoptionsmake) + +### SafetyRatingsOptionsModel + +Re-exports [SafetyRatingsOptionsModel](api/safetyRatings.md#safetyratingsoptionsmodel) + +### SafetyRatingsOptionsModelYear + +Re-exports [SafetyRatingsOptionsModelYear](api/safetyRatings.md#safetyratingsoptionsmodelyear) + +### SafetyRatingsOptionsVehicleId + +Re-exports [SafetyRatingsOptionsVehicleId](api/safetyRatings.md#safetyratingsoptionsvehicleid) + +### SafetyRatingsResponse + +Re-exports [SafetyRatingsResponse](api/safetyRatings.md#safetyratingsresponse) + +### SafetyRatingsResponseByOptions + +Re-exports [SafetyRatingsResponseByOptions](api/safetyRatings.md#safetyratingsresponsebyoptionsoptions) + +### SafetyRatingsResponseByVariant + +Re-exports [SafetyRatingsResponseByVariant](api/safetyRatings.md#safetyratingsresponsebyvariantvariant) + +### SafetyRatingsResultsByOptions + +Re-exports [SafetyRatingsResultsByOptions](api/safetyRatings.md#safetyratingsresultsbyoptionsoptions) + +### SafetyRatingsResultsByVariant + +Re-exports [SafetyRatingsResultsByVariant](api/safetyRatings.md#safetyratingsresultsbyvariantvariant) + +### SafetyRatingsResultsData + +Re-exports [SafetyRatingsResultsData](api/safetyRatings.md#safetyratingsresultsdata) + +### SafetyRatingsResultsVariants + +Re-exports [SafetyRatingsResultsVariants](api/safetyRatings.md#safetyratingsresultsvariants) + +### safetyRatings + +Re-exports [safetyRatings](api/safetyRatings.md#safetyratings) + +### useNHTSA + +Re-exports [useNHTSA](api/useNHTSA.md#usenhtsa) diff --git a/apps/docs/src/typedoc/api/safetyRatings.md b/apps/docs/src/typedoc/api/safetyRatings.md new file mode 100644 index 00000000..ecbcaecc --- /dev/null +++ b/apps/docs/src/typedoc/api/safetyRatings.md @@ -0,0 +1,730 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../modules.md) / api/safetyRatings + +# api/safetyRatings + +## Contents + +- [Type Aliases](safetyRatings.md#type-aliases) + - [NoInvalidOptions``](safetyRatings.md#noinvalidoptionst) + - [SafetyRatingsOptions](safetyRatings.md#safetyratingsoptions) + - [SafetyRatingsOptionsBase](safetyRatings.md#safetyratingsoptionsbase) + - [SafetyRatingsOptionsEmpty](safetyRatings.md#safetyratingsoptionsempty) + - [SafetyRatingsOptionsMake](safetyRatings.md#safetyratingsoptionsmake) + - [SafetyRatingsOptionsModel](safetyRatings.md#safetyratingsoptionsmodel) + - [SafetyRatingsOptionsModelYear](safetyRatings.md#safetyratingsoptionsmodelyear) + - [SafetyRatingsOptionsVehicleId](safetyRatings.md#safetyratingsoptionsvehicleid) + - [SafetyRatingsResponse](safetyRatings.md#safetyratingsresponse) + - [SafetyRatingsResponseByOptions``](safetyRatings.md#safetyratingsresponsebyoptionsoptions) + - [SafetyRatingsResponseByVariant``](safetyRatings.md#safetyratingsresponsebyvariantvariant) + - [SafetyRatingsResultsByOptions``](safetyRatings.md#safetyratingsresultsbyoptionsoptions) + - [SafetyRatingsResultsByVariant``](safetyRatings.md#safetyratingsresultsbyvariantvariant) + - [SafetyRatingsResultsData](safetyRatings.md#safetyratingsresultsdata) + - [SafetyRatingsResultsVariants](safetyRatings.md#safetyratingsresultsvariants) +- [Functions](safetyRatings.md#functions) + - [safetyRatings()](safetyRatings.md#safetyratings) + - [Options](safetyRatings.md#options) + - [API Response](safetyRatings.md#api-response) + +## Type Aliases + +### NoInvalidOptions`` + +> **NoInvalidOptions**\<`T`\>: [`NoExtraProperties`](../utils/types.md#noextrapropertiest-u)\<[`SafetyRatingsOptionsBase`](safetyRatings.md#safetyratingsoptionsbase), `T`\> + +Ensures only valid options are used in the `safetyRatings()` function + +#### Type parameters + +| Parameter | +| :------ | +| `T` extends [`SafetyRatingsOptions`](safetyRatings.md#safetyratingsoptions) | + +#### Source + +api/safetyRatings/index.ts:497 + +*** + +### SafetyRatingsOptions + +> **SafetyRatingsOptions**: [`SafetyRatingsOptionsEmpty`](safetyRatings.md#safetyratingsoptionsempty) \| [`SafetyRatingsOptionsVehicleId`](safetyRatings.md#safetyratingsoptionsvehicleid) \| [`SafetyRatingsOptionsModelYear`](safetyRatings.md#safetyratingsoptionsmodelyear) \| [`SafetyRatingsOptionsMake`](safetyRatings.md#safetyratingsoptionsmake) \| [`SafetyRatingsOptionsModel`](safetyRatings.md#safetyratingsoptionsmodel) + +All valid options combinations for the `safetyRatings()` function + +#### Source + +api/safetyRatings/index.ts:489 + +*** + +### SafetyRatingsOptionsBase + +> **SafetyRatingsOptionsBase**: `object` + +All valid options for the `safetyRatings()` function + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `make` | `string` | - | +| `model` | `string` | - | +| `modelYear` | `string` \| `number` | - | +| `vehicleId` | `string` \| `number` | - | + +#### Source + +api/safetyRatings/index.ts:429 + +*** + +### SafetyRatingsOptionsEmpty + +> **SafetyRatingsOptionsEmpty**: `object` + +Options to build path: `/SafetyRatings` + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `make` | `undefined` | - | +| `model` | `undefined` | - | +| `modelYear` | `undefined` | - | +| `vehicleId` | `undefined` | - | + +#### Source + +api/safetyRatings/index.ts:439 + +*** + +### SafetyRatingsOptionsMake + +> **SafetyRatingsOptionsMake**: `object` + +Options to build path: `/SafetyRatings/modelYear/:modelYear/make/:make` + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `make` | `string` | - | +| `model` | `undefined` | - | +| `modelYear` | `string` \| `number` | - | +| `vehicleId` | `undefined` | - | + +#### Source + +api/safetyRatings/index.ts:459 + +*** + +### SafetyRatingsOptionsModel + +> **SafetyRatingsOptionsModel**: `object` + +Options to build path: `/SafetyRatings/modelYear/:modelYear/make/:make/model/:model` + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `make` | `string` | - | +| `model` | `string` | - | +| `modelYear` | `string` \| `number` | - | +| `vehicleId` | `undefined` | - | + +#### Source + +api/safetyRatings/index.ts:469 + +*** + +### SafetyRatingsOptionsModelYear + +> **SafetyRatingsOptionsModelYear**: `object` + +Options to build path: `/SafetyRatings/modelYear/:modelYear` + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `make` | `undefined` | - | +| `model` | `undefined` | - | +| `modelYear` | `string` \| `number` | - | +| `vehicleId` | `undefined` | - | + +#### Source + +api/safetyRatings/index.ts:449 + +*** + +### SafetyRatingsOptionsVehicleId + +> **SafetyRatingsOptionsVehicleId**: `object` + +Options to build path: `/SafetyRatings/vehicleId/:vehicleId` + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `make` | `undefined` | - | +| `model` | `undefined` | - | +| `modelYear` | `undefined` | - | +| `vehicleId` | `string` \| `number` | - | + +#### Source + +api/safetyRatings/index.ts:479 + +*** + +### SafetyRatingsResponse + +> **SafetyRatingsResponse**: [`NhtsaResponse`](types.md#nhtsaresponseresultstype-apitype)\<[`SafetyRatingsResultsData`](safetyRatings.md#safetyratingsresultsdata), `"safetyRatings"`\> + +Types the `safetyRatings()` function with `SafetyRatingsResultsData` as the `Results` array. + +This is the generic type of the parsed API response and is only meant to be a fallback type. + +The `Results` array will be typed as `SafetyRatingsResultsData`, which is all possible properties +found in the `Results` array objects of `Safety Ratings API` paths, with all marked as optional +properties that could be undefined. + +#### Source + +api/safetyRatings/index.ts:657 + +*** + +### SafetyRatingsResponseByOptions`` + +> **SafetyRatingsResponseByOptions**\<`Options`\>: [`NhtsaResponse`](types.md#nhtsaresponseresultstype-apitype)\<[`SafetyRatingsResultsByOptions`](safetyRatings.md#safetyratingsresultsbyoptionsoptions)\<`Options`\>, `"safetyRatings"`\> + +Types the `safetyRatings()` function return based on the type of `SafetyRatingsOptions` passed to +this type, inferred from the `options` passed to the function. + +This type represents the complete parsed API response. + +The `Results` array will be typed based on the `options` passed to the function. + +#### Type parameters + +| Parameter | +| :------ | +| `Options` extends [`SafetyRatingsOptions`](safetyRatings.md#safetyratingsoptions) | + +#### Source + +api/safetyRatings/index.ts:633 + +*** + +### SafetyRatingsResponseByVariant`` + +> **SafetyRatingsResponseByVariant**\<`Variant`\>: [`NhtsaResponse`](types.md#nhtsaresponseresultstype-apitype)\<[`SafetyRatingsResultsByVariant`](safetyRatings.md#safetyratingsresultsbyvariantvariant)\<`Variant`\>, `"safetyRatings"`\> + +Types the `safetyRatings()` function return based on the `variant` passed to this type. + +This type represents the complete parsed API response. + +The `Results` array will be typed based on the `variant` passed to this type. + +#### Type parameters + +| Parameter | Default | +| :------ | :------ | +| `Variant` extends [`SafetyRatingsResultsVariants`](safetyRatings.md#safetyratingsresultsvariants) | `"default"` | + +#### Source + +api/safetyRatings/index.ts:644 + +*** + +### SafetyRatingsResultsByOptions`` + +> **SafetyRatingsResultsByOptions**\<`Options`\>: `Options` extends [`SafetyRatingsOptionsModelYear`](safetyRatings.md#safetyratingsoptionsmodelyear) ? [`SafetyRatingsResultsByVariant`](safetyRatings.md#safetyratingsresultsbyvariantvariant)\<`"modelYear"`\> : `Options` extends [`SafetyRatingsOptionsMake`](safetyRatings.md#safetyratingsoptionsmake) ? [`SafetyRatingsResultsByVariant`](safetyRatings.md#safetyratingsresultsbyvariantvariant)\<`"make"`\> : `Options` extends [`SafetyRatingsOptionsModel`](safetyRatings.md#safetyratingsoptionsmodel) ? [`SafetyRatingsResultsByVariant`](safetyRatings.md#safetyratingsresultsbyvariantvariant)\<`"model"`\> : `Options` extends [`SafetyRatingsOptionsVehicleId`](safetyRatings.md#safetyratingsoptionsvehicleid) ? [`SafetyRatingsResultsByVariant`](safetyRatings.md#safetyratingsresultsbyvariantvariant)\<`"vehicleId"`\> : `Options` extends [`SafetyRatingsOptionsEmpty`](safetyRatings.md#safetyratingsoptionsempty) ? [`SafetyRatingsResultsByVariant`](safetyRatings.md#safetyratingsresultsbyvariantvariant)\<`"getModelYears"`\> : [`SafetyRatingsResultsByVariant`](safetyRatings.md#safetyratingsresultsbyvariantvariant) + +Types the `Results` array of the `Safety Ratings API` response based on the `options` passed +to the function. + +#### Type parameters + +| Parameter | +| :------ | +| `Options` extends [`SafetyRatingsOptions`](safetyRatings.md#safetyratingsoptions) | + +#### Source + +api/safetyRatings/index.ts:611 + +*** + +### SafetyRatingsResultsByVariant`` + +> **SafetyRatingsResultsByVariant**\<`Variant`\>: `Variant` extends `"getModelYears"` ? `{ [K in keyof Pick]-?: SafetyRatingsResultsData[K] }` : `Variant` extends `"modelYear"` ? `{ [K in keyof Pick]-?: SafetyRatingsResultsData[K] }` : `Variant` extends `"make"` ? `{ [K in keyof Pick]-?: SafetyRatingsResultsData[K] }` : `Variant` extends `"model"` ? `{ [K in keyof Pick]-?: SafetyRatingsResultsData[K] }` : `Variant` extends `"vehicleId"` ? `{ [K in keyof SafetyRatingsResultsData]-?: SafetyRatingsResultsData[K] }` : [`SafetyRatingsResultsData`](safetyRatings.md#safetyratingsresultsdata) + +Types the `Results[]` of the `Safety Ratings API` response based on the `ResultsVariant` that is +passed to this type. + +Used to type no args `()` or `undefined` as the first arg passed to `safetyRatings()` as Variant +'getModelYears' in the function overloads. Also used in .test-d.ts files to easily match the +expected return type of the function. + +#### Type parameters + +| Parameter | Default | +| :------ | :------ | +| `Variant` extends [`SafetyRatingsResultsVariants`](safetyRatings.md#safetyratingsresultsvariants) | `"default"` | + +#### Source + +api/safetyRatings/index.ts:565 + +*** + +### SafetyRatingsResultsData + +> **SafetyRatingsResultsData**: `object` + +All possible properties and values found in the `Results` array objects of `Safety Ratings API` + +`SafetyRatingsResultsVariants` variant `'vehicleId'` will have all properties defined, all other +variants will only have some properties defined. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `ComplaintsCount` | `number` | - | +| `FrontCrashDriversideRating` | `string` | - | +| `FrontCrashPassengersideRating` | `string` | - | +| `InvestigationCount` | `number` | - | +| `Make` | `string` | - | +| `Model` | `string` | - | +| `ModelYear` | `number` | - | +| `NHTSAElectronicStabilityControl` | `string` | - | +| `NHTSAForwardCollisionWarning` | `string` | - | +| `NHTSALaneDepartureWarning` | `string` | - | +| `OverallFrontCrashRating` | `string` | - | +| `OverallRating` | `string` | - | +| `OverallSideCrashRating` | `string` | - | +| `RecallsCount` | `number` | - | +| `RolloverPossibility` | `number` | - | +| `RolloverPossibility2` | `number` | - | +| `RolloverRating` | `string` | - | +| `RolloverRating2` | `string` | - | +| `SideCrashDriversideRating` | `string` | - | +| `SideCrashPassengersideRating` | `string` | - | +| `SidePoleCrashRating` | `string` | - | +| `VehicleDescription` | `string` | - | +| `VehicleId` | `number` | - | +| `VehiclePicture` | `string` | - | +| `combinedSideBarrierAndPoleRating-Front` | `string` | - | +| `combinedSideBarrierAndPoleRating-Rear` | `string` | - | +| `dynamicTipResult` | `string` | - | +| `sideBarrierRating-Overall` | `string` | - | + +#### Source + +api/safetyRatings/index.ts:519 + +*** + +### SafetyRatingsResultsVariants + +> **SafetyRatingsResultsVariants**: `"getModelYears"` \| `"modelYear"` \| `"make"` \| `"model"` \| `"vehicleId"` \| `"default"` + +Variant names to use to type the `Results` array of the `Safety Ratings API` response based on +the `options` passed to the function. `SafetyRatingsResultsData` will be Pick<>ed based on the +the variant name. + +#### Source + +api/safetyRatings/index.ts:505 + +## Functions + +### safetyRatings() + +#### safetyRatings(options) + +> **safetyRatings**(`options`?): `Promise`\<[`SafetyRatingsResponseByVariant`](safetyRatings.md#safetyratingsresponsebyvariantvariant)\<`"getModelYears"`\>\> + +::: tip :bulb: More Information +See: [safetyRatings API Documentation] /guide/safetyRatings +::: + +You can use `safetyRatings()` as a thin wrapper for the `Safety Ratings API` to get safety +ratings for a vehicle. + +This function is designed to handle all of the different possible workflows and return the +correct data/url for each one, all depending on which options you pass to the function. In this +sense it is a single universal function that can handle the entirety of the Safety Ratings API. + +Check out the official +[Safety Ratings API Docs](https://www.nhtsa.gov/nhtsa-datasets-and-apis#ratings) for more +information on the different workflows and paths you can use to get safety ratings if you don't +already know the `VehicleId` of the vehicle you want to get safety ratings for. + +From the official documentation: + +> NHTSA's New Car Assessment Program (NCAP) rates vehicles to determine crashworthiness and +rollover safety. The safety ratings are gathered during controlled crash and rollover tests +conducted at NHTSA research facilities. Vehicles with a rating of five stars indicate the highest +safety rating, whereas a one star indicates the lowest rating. + +### Options + +The Safety Ratings API uses the path to represent the query. This function uses the options +passed to build the correct url path query. + +Valid `options` are: +- `modelYear` - Model Year of the vehicle to search +- `make` - Make of the vehicle to search +- `model` - Model of the vehicle to search +- `vehicleId` - VehicleId of the vehicle to search + +All are optional and these are the only valid options you can pass to this function. + +There are several rules to follow when using this API or you will get a 404/403 error response: + +1. If you provide a `vehicleId` then you cannot provide any other options. +2. If you provide a `make` then you must also provide a `modelYear`. +3. If you provide a `model` then you must also provide a `make` and `modelYear`. +4. You must use PascalCase `SafetyRatings` in the path, it is case sensitive and will return a + 403 forbidden error otherwise. + +FYI: Rules #1-3 will return a 404 error from the NHTSA API if you break them. + +- If you break rule #1, by passing `vehicleId` and any other valid combination of remaining +options, this function will silently ignore the other options and only use the `vehicleId`. It +will not throw an Error but you will get typescript errors. + +- If you break rules #2 or #3, this function will throw an Error as a fail safe to prevent +you from getting a 404 error from the NHTSA API and you'll get typescript errors. + +- Rule #4 is enforced by this function internally when fetching the data or returning the URL +string. + +Some other important things to note: + +- If you pass an object that includes options not listed above, the function will throw an Error. + +- If you pass an object with an invalid options combination, the function will throw an Error. + +- If you pass an object with any valid combination of options but include options not listed +above, the function will throw an Error. + +- If you pass options with `vehicleId` and any other options listed above, you will get +typescript errors but the function will not throw an Error. It will silently ignore the other +options and only use the `vehicleId`. + +Full (valid) endpoint URL examples, trailing slash ok: + +- https://api.nhtsa.gov/SafetyRatings +- https://api.nhtsa.gov/SafetyRatings/modelyear/2013 +- https://api.nhtsa.gov/SafetyRatings/modelyear/2013/make/honda +- https://api.nhtsa.gov/SafetyRatings/modelyear/2013/make/honda/model/accord +- https://api.nhtsa.gov/SafetyRatings/vehicleId/7523 + +#### Some Notes on `VehicleId` + +All paths other than `vehicleId/:vehicleId` are only used to retrieve enough missing +information to obtain the `VehicleId` for a particular year, make, and model, and then get the +safety ratings for that `VehicleId`. + +- If you already know the `VehicleId` number you can pass `{ vehicleId: VehicleId }` as the only +option and directly get the safety ratings for that vehicle. + +- If you don't know the `VehicleId` number, you can pass the `modelYear`, `make`, and `model` +options to get the `VehicleId` for that particular vehicle. + +- The other paths are used if you don't know the `modelYear`, `make`, or `model` and need to +retrieve that information first. + +The following describes the use of the different paths and options in more detail. + +#### Get All Model Years - `/SafetyRatings` + +If you pass no arguments, an empty object `{}`, `undefined`, or `true` as the first argument, the +base path `/SafetyRatings` will be used. + +This path returns a list of available model years in the database. + +```js +// Get a list of available model years +await safetyRatings().then((response) => { + response.Results.forEach((result) => { + console.log(result.ModelYear) // 2024, 2023, 2022, etc + console.log(results.VehicleId) // 0 + }) +}) +``` + +#### Get Makes For Model Year - `/SafetyRatings/modelYear/:modelYear` + +If you pass a `modelYear` as the only option, the `/modelYear/:modelYear` path will be used. + +This path returns a list of available makes for that model year. + +```js +// Get a list of available makes for the 2013 model year +await safetyRatings({ + modelYear: 2013, +}) +.then((response) => { + response.Results.forEach((result) => { + console.log(result.Make) // ACURA, AUDI, BENTLEY, etc. + console.log(results.VehicleId) // 0 + }) +}) +``` + +If you need to get all available model years, first call the function with no arguments. + +#### Get Models For Make - `/SafetyRatings/modelYear/:modelYear/make/:make` + +If you pass a `modelYear` and `make` as the only options, the `/modelYear/:modelYear/make/:make` +path will be used. + +This path returns all of the models for that model year and make combination. + +```js +// Get the models for a 2013 Honda +await safetyRatings({ + modelYear: 2013, + make: 'Honda', +}) +.then((response) => { + response.Results.forEach((model) => { + console.log(model.Model) // Accord, Civic, etc + console.log(model.VehicleId) // 0 + }) +}) +``` + +If you need to get makes for a particular model year, first call the function with `modelYear` as +the only option to get all of the available makes. + +#### Get Model VehicleId(s) - `/SafetyRatings/modelYear/:modelYear/make/:make/model/:model` + +If you pass a `modelYear`, `make`, and `model` as the only options, the +`/modelYear/:modelYear/make/:make/model/:model` path will be used. + +This path returns a list of vehicle variants for year, make and model, with the `VehicleId` and +`VehicleDescription` of each variant. + +```js +// Get as list of VehicleId(s) for a 2013 Honda Accord +await safetyRatings({ + modelYear: 2013, + make: 'Honda', + model: 'Accord', +}) +.then((response) => { + console.log(response.Results[0].VehicleId) // 7523 + console.log(response.Results[0].VehicleDescription) // 2013 Honda Accord 4 DR FWD + console.log(response.Results[1].VehicleId) // 7522 + console.log(response.Results[1].VehicleDescription) // 2013 Honda Accord 2 DR FWD +}) +``` + +Note that there may be multiple objects in the `Results` array, each with a different +`VehicleId`. One reason for this could be that there are multiple body styles for that particular +model year, make, and model combination. + +You can use the `VehicleDescription` to narrow further but there is no known way to narrow it +further than this. You will have to choose the correct `VehicleId` from the `Results` or already +know the `VehicleId` for the specific vehicle you want to get safety ratings for. You can also +check that there is only one object in the `Results` array and if so, use that `VehicleId` or +pick the first one and use that `VehicleId`. + +The next step is to call the function again with `{ vehicleId: VehicleId }` included in +the passed options to get the safety ratings for that vehicle. + +#### Get Safety Ratings For VehicleId - `/SafetyRatings/vehicleId/:vehicleId` + +If you pass `options.vehicleId`, the `/vehicleId/:vehicleId` path will be used. + +This path returns a list of Safety Ratings for the given `vehicleId`. + +All other options will be ignored if you provide a `vehicleId` option. + +There will only be one object in the `Results` array for this path that contains all of the +safety ratings. + +```js +// Get the Safety Ratings for a 2013 Honda Accord 4 DR FWD +await safetyRatings({ + vehicleId: 7523, +}) +.then((response) => { + console.log(response.Results[0].ComplaintsCount) + console.log(response.Results[0].InvestigationCount) + console.log(response.Results[0].RecallsCount) + console.log(response.Results[0].VehiclePicture) +// ...etc +}) +``` + +### API Response + +The return from this function will be the parsed JSON response, typed to reflect the different +types of objects you can expect to get back from the API in the `Results` array, depending on +options passed. + +The response will be an object with the following properties: + +- `Count` - The number of results returned +- `Message` - A message from the NHTSA API +- `Results` - An array of objects containing the response data + +The `Results` array will contain objects with properties depending on which path you used to get +the data. See the `SafetyRatingsResultsData` type for a list of all possible properties. + +The `Results` array will be typed based on the `options` passed to the function. See the +`SafetyRatingsResultsByVariant` type to see which properties will be included based on the +`options` passed. + +The `VehicleId` is found in `response.Results[x].VehicleId` for any path combination. You can +expect it will be a value of `0` for all paths except for the `/vehicleId/:vehicleId` or +`/modelYear/:modelYear/make/:make/model/:model` paths, which will return the actual `VehicleId` +for that vehicle. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `options`? | `true` | Object names and values to append to the URL as a path | + +##### Returns + +`Promise`\<[`SafetyRatingsResponseByVariant`](safetyRatings.md#safetyratingsresponsebyvariantvariant)\<`"getModelYears"`\>\> + +- Parsed API response `object` -or- url `string` if `doFetch = false` + +##### Source + +api/safetyRatings/index.ts:265 + +#### safetyRatings(options) + +> **safetyRatings**(`options`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `options` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +api/safetyRatings/index.ts:268 + +#### safetyRatings(options, doFetch) + +> **safetyRatings**\<`T`\>(`options`, `doFetch`): `Promise`\<`string`\> + +##### Type parameters + +| Parameter | +| :------ | +| `T` extends [`SafetyRatingsOptions`](safetyRatings.md#safetyratingsoptions) | + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `options` | `undefined` \| [`NoInvalidOptions`](safetyRatings.md#noinvalidoptionst)\<`T`\> | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +api/safetyRatings/index.ts:269 + +#### safetyRatings(options, doFetch) + +> **safetyRatings**\<`T`\>(`options`, `doFetch`?): `Promise`\<[`SafetyRatingsResponseByOptions`](safetyRatings.md#safetyratingsresponsebyoptionsoptions)\<`T`\>\> + +##### Type parameters + +| Parameter | +| :------ | +| `T` extends [`SafetyRatingsOptions`](safetyRatings.md#safetyratingsoptions) | + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `options` | [`NoInvalidOptions`](safetyRatings.md#noinvalidoptionst)\<`T`\> | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`SafetyRatingsResponseByOptions`](safetyRatings.md#safetyratingsresponsebyoptionsoptions)\<`T`\>\> + +##### Source + +api/safetyRatings/index.ts:273 + +#### safetyRatings(options, doFetch) + +> **safetyRatings**(`options`?, `doFetch`?): `Promise`\<[`SafetyRatingsResponseByVariant`](safetyRatings.md#safetyratingsresponsebyvariantvariant)\<`"getModelYears"`\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `options`? | `undefined` | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`SafetyRatingsResponseByVariant`](safetyRatings.md#safetyratingsresponsebyvariantvariant)\<`"getModelYears"`\>\> + +##### Source + +api/safetyRatings/index.ts:277 + +#### safetyRatings(options, doFetch) + +> **safetyRatings**\<`T`\>(`options`?, `doFetch`?): `Promise`\<[`SafetyRatingsResponse`](safetyRatings.md#safetyratingsresponse)\> + +##### Type parameters + +| Parameter | +| :------ | +| `T` extends [`SafetyRatingsOptions`](safetyRatings.md#safetyratingsoptions) | + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `options`? | `boolean` \| [`NoInvalidOptions`](safetyRatings.md#noinvalidoptionst)\<`T`\> | +| `doFetch`? | `boolean` | + +##### Returns + +`Promise`\<[`SafetyRatingsResponse`](safetyRatings.md#safetyratingsresponse)\> + +##### Source + +api/safetyRatings/index.ts:281 diff --git a/apps/docs/src/typedoc/api/safetyRatings/types.md b/apps/docs/src/typedoc/api/safetyRatings/types.md new file mode 100644 index 00000000..5bfeab34 --- /dev/null +++ b/apps/docs/src/typedoc/api/safetyRatings/types.md @@ -0,0 +1,78 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/safetyRatings/types + +# api/safetyRatings/types + +## Contents + +- [References](types.md#references) + - [SafetyRatingsOptions](types.md#safetyratingsoptions) + - [SafetyRatingsOptionsBase](types.md#safetyratingsoptionsbase) + - [SafetyRatingsOptionsEmpty](types.md#safetyratingsoptionsempty) + - [SafetyRatingsOptionsMake](types.md#safetyratingsoptionsmake) + - [SafetyRatingsOptionsModel](types.md#safetyratingsoptionsmodel) + - [SafetyRatingsOptionsModelYear](types.md#safetyratingsoptionsmodelyear) + - [SafetyRatingsOptionsVehicleId](types.md#safetyratingsoptionsvehicleid) + - [SafetyRatingsResponseByOptions](types.md#safetyratingsresponsebyoptions) + - [SafetyRatingsResponseByVariant](types.md#safetyratingsresponsebyvariant) + - [SafetyRatingsResultsByOptions](types.md#safetyratingsresultsbyoptions) + - [SafetyRatingsResultsByVariant](types.md#safetyratingsresultsbyvariant) + - [SafetyRatingsResultsData](types.md#safetyratingsresultsdata) + - [SafetyRatingsResultsVariants](types.md#safetyratingsresultsvariants) + +## References + +### SafetyRatingsOptions + +Re-exports [SafetyRatingsOptions](../safetyRatings.md#safetyratingsoptions) + +### SafetyRatingsOptionsBase + +Re-exports [SafetyRatingsOptionsBase](../safetyRatings.md#safetyratingsoptionsbase) + +### SafetyRatingsOptionsEmpty + +Re-exports [SafetyRatingsOptionsEmpty](../safetyRatings.md#safetyratingsoptionsempty) + +### SafetyRatingsOptionsMake + +Re-exports [SafetyRatingsOptionsMake](../safetyRatings.md#safetyratingsoptionsmake) + +### SafetyRatingsOptionsModel + +Re-exports [SafetyRatingsOptionsModel](../safetyRatings.md#safetyratingsoptionsmodel) + +### SafetyRatingsOptionsModelYear + +Re-exports [SafetyRatingsOptionsModelYear](../safetyRatings.md#safetyratingsoptionsmodelyear) + +### SafetyRatingsOptionsVehicleId + +Re-exports [SafetyRatingsOptionsVehicleId](../safetyRatings.md#safetyratingsoptionsvehicleid) + +### SafetyRatingsResponseByOptions + +Re-exports [SafetyRatingsResponseByOptions](../safetyRatings.md#safetyratingsresponsebyoptionsoptions) + +### SafetyRatingsResponseByVariant + +Re-exports [SafetyRatingsResponseByVariant](../safetyRatings.md#safetyratingsresponsebyvariantvariant) + +### SafetyRatingsResultsByOptions + +Re-exports [SafetyRatingsResultsByOptions](../safetyRatings.md#safetyratingsresultsbyoptionsoptions) + +### SafetyRatingsResultsByVariant + +Re-exports [SafetyRatingsResultsByVariant](../safetyRatings.md#safetyratingsresultsbyvariantvariant) + +### SafetyRatingsResultsData + +Re-exports [SafetyRatingsResultsData](../safetyRatings.md#safetyratingsresultsdata) + +### SafetyRatingsResultsVariants + +Re-exports [SafetyRatingsResultsVariants](../safetyRatings.md#safetyratingsresultsvariants) diff --git a/apps/docs/src/typedoc/api/types.md b/apps/docs/src/typedoc/api/types.md new file mode 100644 index 00000000..33347d56 --- /dev/null +++ b/apps/docs/src/typedoc/api/types.md @@ -0,0 +1,276 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../modules.md) / api/types + +# api/types + +## Contents + +- [References](types.md#references) + - [CreateUrlOptions](types.md#createurloptions) + - [DecodeVinExtendedResults](types.md#decodevinextendedresults) + - [DecodeVinExtendedVariable](types.md#decodevinextendedvariable) + - [DecodeVinResults](types.md#decodevinresults) + - [DecodeVinValuesBatchResults](types.md#decodevinvaluesbatchresults) + - [DecodeVinValuesExtendedResults](types.md#decodevinvaluesextendedresults) + - [DecodeVinValuesResults](types.md#decodevinvaluesresults) + - [DecodeVinVariable](types.md#decodevinvariable) + - [DecodeWMIResults](types.md#decodewmiresults) + - [GetAllMakesResults](types.md#getallmakesresults) + - [GetAllManufacturersResults](types.md#getallmanufacturersresults) + - [GetCanadianVehicleSpecificationsResults](types.md#getcanadianvehiclespecificationsresults) + - [GetEquipmentPlantCodesParams](types.md#getequipmentplantcodesparams) + - [GetEquipmentPlantCodesResults](types.md#getequipmentplantcodesresults) + - [GetMakeForManufacturerResults](types.md#getmakeformanufacturerresults) + - [GetMakesForManufacturerAndYearResults](types.md#getmakesformanufacturerandyearresults) + - [GetMakesForVehicleTypeResults](types.md#getmakesforvehicletyperesults) + - [GetManufacturerDetailsResults](types.md#getmanufacturerdetailsresults) + - [GetModelsForMakeIdResults](types.md#getmodelsformakeidresults) + - [GetModelsForMakeIdYearResults](types.md#getmodelsformakeidyearresults) + - [GetModelsForMakeResults](types.md#getmodelsformakeresults) + - [GetModelsForMakeYearResults](types.md#getmodelsformakeyearresults) + - [GetPartsResults](types.md#getpartsresults) + - [GetVehicleTypesForMakeIdResults](types.md#getvehicletypesformakeidresults) + - [GetVehicleTypesForMakeResults](types.md#getvehicletypesformakeresults) + - [GetVehicleVariableListResults](types.md#getvehiclevariablelistresults) + - [GetVehicleVariableValuesListResults](types.md#getvehiclevariablevalueslistresults) + - [GetWMIsForManufacturerResults](types.md#getwmisformanufacturerresults) + - [SafetyRatingsOptions](types.md#safetyratingsoptions) + - [SafetyRatingsOptionsBase](types.md#safetyratingsoptionsbase) + - [SafetyRatingsOptionsEmpty](types.md#safetyratingsoptionsempty) + - [SafetyRatingsOptionsMake](types.md#safetyratingsoptionsmake) + - [SafetyRatingsOptionsModel](types.md#safetyratingsoptionsmodel) + - [SafetyRatingsOptionsModelYear](types.md#safetyratingsoptionsmodelyear) + - [SafetyRatingsOptionsVehicleId](types.md#safetyratingsoptionsvehicleid) + - [SafetyRatingsResponseByOptions](types.md#safetyratingsresponsebyoptions) + - [SafetyRatingsResponseByVariant](types.md#safetyratingsresponsebyvariant) + - [SafetyRatingsResultsByOptions](types.md#safetyratingsresultsbyoptions) + - [SafetyRatingsResultsByVariant](types.md#safetyratingsresultsbyvariant) + - [SafetyRatingsResultsData](types.md#safetyratingsresultsdata) + - [SafetyRatingsResultsVariants](types.md#safetyratingsresultsvariants) +- [Type Aliases](types.md#type-aliases) + - [ApiTypes](types.md#apitypes) + - [NhtsaResponse``](types.md#nhtsaresponseresultstype-apitype) + +## References + +### CreateUrlOptions + +Re-exports [CreateUrlOptions](useNHTSA.md#createurloptions) + +### DecodeVinExtendedResults + +Re-exports [DecodeVinExtendedResults](vpic/endpoints/DecodeVinExtended.md#decodevinextendedresults) + +### DecodeVinExtendedVariable + +Re-exports [DecodeVinExtendedVariable](vpic/endpoints/DecodeVinExtended.md#decodevinextendedvariable) + +### DecodeVinResults + +Re-exports [DecodeVinResults](vpic/endpoints/DecodeVin.md#decodevinresults) + +### DecodeVinValuesBatchResults + +Re-exports [DecodeVinValuesBatchResults](vpic/endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatchresults) + +### DecodeVinValuesExtendedResults + +Re-exports [DecodeVinValuesExtendedResults](vpic/endpoints/DecodeVinValuesExtended.md#decodevinvaluesextendedresults) + +### DecodeVinValuesResults + +Re-exports [DecodeVinValuesResults](vpic/endpoints/DecodeVinValues.md#decodevinvaluesresults) + +### DecodeVinVariable + +Re-exports [DecodeVinVariable](vpic/endpoints/DecodeVin.md#decodevinvariable) + +### DecodeWMIResults + +Re-exports [DecodeWMIResults](vpic/endpoints/DecodeWMI.md#decodewmiresults) + +### GetAllMakesResults + +Re-exports [GetAllMakesResults](vpic/endpoints/GetAllMakes.md#getallmakesresults) + +### GetAllManufacturersResults + +Re-exports [GetAllManufacturersResults](vpic/endpoints/GetAllManufacturers.md#getallmanufacturersresults) + +### GetCanadianVehicleSpecificationsResults + +Re-exports [GetCanadianVehicleSpecificationsResults](vpic/endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) + +### GetEquipmentPlantCodesParams + +Re-exports [GetEquipmentPlantCodesParams](vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesparams) + +### GetEquipmentPlantCodesResults + +Re-exports [GetEquipmentPlantCodesResults](vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesresults) + +### GetMakeForManufacturerResults + +Re-exports [GetMakeForManufacturerResults](vpic/endpoints/GetMakeForManufacturer.md#getmakeformanufacturerresults) + +### GetMakesForManufacturerAndYearResults + +Re-exports [GetMakesForManufacturerAndYearResults](vpic/endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) + +### GetMakesForVehicleTypeResults + +Re-exports [GetMakesForVehicleTypeResults](vpic/endpoints/GetMakesForVehicleType.md#getmakesforvehicletyperesults) + +### GetManufacturerDetailsResults + +Re-exports [GetManufacturerDetailsResults](vpic/endpoints/GetManufacturerDetails.md#getmanufacturerdetailsresults) + +### GetModelsForMakeIdResults + +Re-exports [GetModelsForMakeIdResults](vpic/endpoints/GetModelsForMakeId.md#getmodelsformakeidresults) + +### GetModelsForMakeIdYearResults + +Re-exports [GetModelsForMakeIdYearResults](vpic/endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) + +### GetModelsForMakeResults + +Re-exports [GetModelsForMakeResults](vpic/endpoints/GetModelsForMake.md#getmodelsformakeresults) + +### GetModelsForMakeYearResults + +Re-exports [GetModelsForMakeYearResults](vpic/endpoints/GetModelsForMakeYear.md#getmodelsformakeyearresults) + +### GetPartsResults + +Re-exports [GetPartsResults](vpic/endpoints/GetParts.md#getpartsresults) + +### GetVehicleTypesForMakeIdResults + +Re-exports [GetVehicleTypesForMakeIdResults](vpic/endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) + +### GetVehicleTypesForMakeResults + +Re-exports [GetVehicleTypesForMakeResults](vpic/endpoints/GetVehicleTypesForMake.md#getvehicletypesformakeresults) + +### GetVehicleVariableListResults + +Re-exports [GetVehicleVariableListResults](vpic/endpoints/GetVehicleVariableList.md#getvehiclevariablelistresults) + +### GetVehicleVariableValuesListResults + +Re-exports [GetVehicleVariableValuesListResults](vpic/endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) + +### GetWMIsForManufacturerResults + +Re-exports [GetWMIsForManufacturerResults](vpic/endpoints/GetWMIsForManufacturer.md#getwmisformanufacturerresults) + +### SafetyRatingsOptions + +Re-exports [SafetyRatingsOptions](safetyRatings.md#safetyratingsoptions) + +### SafetyRatingsOptionsBase + +Re-exports [SafetyRatingsOptionsBase](safetyRatings.md#safetyratingsoptionsbase) + +### SafetyRatingsOptionsEmpty + +Re-exports [SafetyRatingsOptionsEmpty](safetyRatings.md#safetyratingsoptionsempty) + +### SafetyRatingsOptionsMake + +Re-exports [SafetyRatingsOptionsMake](safetyRatings.md#safetyratingsoptionsmake) + +### SafetyRatingsOptionsModel + +Re-exports [SafetyRatingsOptionsModel](safetyRatings.md#safetyratingsoptionsmodel) + +### SafetyRatingsOptionsModelYear + +Re-exports [SafetyRatingsOptionsModelYear](safetyRatings.md#safetyratingsoptionsmodelyear) + +### SafetyRatingsOptionsVehicleId + +Re-exports [SafetyRatingsOptionsVehicleId](safetyRatings.md#safetyratingsoptionsvehicleid) + +### SafetyRatingsResponseByOptions + +Re-exports [SafetyRatingsResponseByOptions](safetyRatings.md#safetyratingsresponsebyoptionsoptions) + +### SafetyRatingsResponseByVariant + +Re-exports [SafetyRatingsResponseByVariant](safetyRatings.md#safetyratingsresponsebyvariantvariant) + +### SafetyRatingsResultsByOptions + +Re-exports [SafetyRatingsResultsByOptions](safetyRatings.md#safetyratingsresultsbyoptionsoptions) + +### SafetyRatingsResultsByVariant + +Re-exports [SafetyRatingsResultsByVariant](safetyRatings.md#safetyratingsresultsbyvariantvariant) + +### SafetyRatingsResultsData + +Re-exports [SafetyRatingsResultsData](safetyRatings.md#safetyratingsresultsdata) + +### SafetyRatingsResultsVariants + +Re-exports [SafetyRatingsResultsVariants](safetyRatings.md#safetyratingsresultsvariants) + +## Type Aliases + +### ApiTypes + +> **ApiTypes**: `"vpic"` \| `"safetyRatings"` \| `"recalls"` \| `"complaints"` \| `"products"` \| `"cssiStation"` + +#### Source + +[api/types.ts:11](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/types.ts#L11) + +*** + +### NhtsaResponse`` + +> **NhtsaResponse**\<`ResultsType`, `ApiType`\>: `ApiType` extends `"vpic"` ? `object` : `ApiType` extends `"safetyRatings"` ? `object` : `ApiType` extends `"recalls"` ? `object` : `ApiType` extends `"complaints"` \| `"products"` ? `object` : `ApiType` extends `"cssiStation"` ? `object` : `never` + +Response data returned from the NHTSA APIs. + +The end user should not have to worry about this type. It is used internally for all of the api +functions in this package. + +There is a slight difference between all of the NHTSA API responses. As an example: +- The `vpic` response data has a `Results` key +- The `recalls` response data has a `results` key and no `SearchCriteria` key. + +In any case, either `Results` or `results` key will be an array of objects of type "ResultsType" + +There are several keys points to note: +- This type will default to `vpic` if no `ApiType` is provided as this was the orginal intended + usage of this package. +- If using the other APIs (recalls, safety ratings, complaints, etc.), you must provide the + relevant `ApiType` to get the correct intelisense typing for the response. +- If using the `products` API, you must provide the `ApiType` of `products`, etc. + +#### Example + +```ts +// This will default to the `vpic` response type +NhtsaResponse + +// This will correctly type the `recalls` api response +NhtsaResponse +``` + +#### Type parameters + +| Parameter | Default | +| :------ | :------ | +| `ResultsType` | - | +| `ApiType` extends [`ApiTypes`](types.md#apitypes) | `"vpic"` | + +#### Source + +[api/types.ts:47](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/types.ts#L47) diff --git a/apps/docs/src/typedoc/api/useNHTSA.md b/apps/docs/src/typedoc/api/useNHTSA.md new file mode 100644 index 00000000..8937cef1 --- /dev/null +++ b/apps/docs/src/typedoc/api/useNHTSA.md @@ -0,0 +1,86 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../modules.md) / api/useNHTSA + +# api/useNHTSA + +## Contents + +- [Type Aliases](useNHTSA.md#type-aliases) + - [CreateUrlOptions](useNHTSA.md#createurloptions) +- [Functions](useNHTSA.md#functions) + - [useNHTSA()](useNHTSA.md#usenhtsa) + +## Type Aliases + +### CreateUrlOptions + +> **CreateUrlOptions**: `object` + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `allowEmptyParams` | `boolean` | - | +| `apiType` | [`ApiTypes`](types.md#apitypes) | - | +| `endpointName` | `string` | - | +| `includeQueryString` | `boolean` | - | +| `params` | [`QueryStringParams`](../utils/queryString.md#querystringparams) | - | +| `path` | `string` | - | +| `saveUrl` | `boolean` | - | + +#### Source + +[api/useNHTSA.ts:20](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/useNHTSA.ts#L20) + +## Functions + +### useNHTSA() + +> **useNHTSA**(): `object` + +`useNHTSA` returns a composable object containing helper functions for working with the VPIC +API. It is used internally by the package and by users to make direct requests to the VPIC API. + +It returns an object containing methods for making HTTP requests to the VPIC API. All +request methods return a Promise that resolves to an object containing the full response data. + +The functions returned by the composable are: + +- `createCachedUrl` - Builds the URL string and stores it in internal state + +- `getCachedUrl` - Gets the URL stored in internal state + +- `setCachedUrl` - Directly sets the URL internal state, does not check if URL is valid + +- `clearCachedUrl` - Clears the URL stored in internal state + +- `createUrl` - Returns a built URL string but does not store it in internal state + +- `createPostBody` - Creates a POST body string from an object of key/value pairs + +- `get` - Makes a GET request, uses the internal url variable if no URL is provided + +- `post` - Makes a POST request, uses the internal url variable if no URL is provided + +#### Returns + +`object` + +> | Member | Type | Description | +> | :------ | :------ | :------ | +> | `clearCachedUrl` | () => `string` | - | +> | `createCachedUrl` | (`options`) => `string` | - | +> | `createPostBody` | (`data`) => `string` | - | +> | `createUrl` | (`options`) => `string` | - | +> | `get` | \<`ResultsType`, `ApiType`\>(`url`?, `options`?) => `Promise`\<[`NhtsaResponse`](types.md#nhtsaresponseresultstype-apitype)\<`ResultsType`, `ApiType`\>\> | - | +> | `getCachedUrl` | () => `string` | - | +> | `post` | \<`ResultsType`, `ApiType`\>(`url`?, `options`?) => `Promise`\<[`NhtsaResponse`](types.md#nhtsaresponseresultstype-apitype)\<`ResultsType`, `ApiType`\>\> | - | +> | `setCachedUrl` | (`url`) => `string` | - | +> + +#### Source + +[api/useNHTSA.ts:56](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/useNHTSA.ts#L56) diff --git a/apps/docs/src/typedoc/api/vpic.md b/apps/docs/src/typedoc/api/vpic.md new file mode 100644 index 00000000..38b7a0a4 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic.md @@ -0,0 +1,133 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../modules.md) / api/vpic + +# api/vpic + +## Contents + +- [References](vpic.md#references) + - [DecodeVin](vpic.md#decodevin) + - [DecodeVinExtended](vpic.md#decodevinextended) + - [DecodeVinValues](vpic.md#decodevinvalues) + - [DecodeVinValuesBatch](vpic.md#decodevinvaluesbatch) + - [DecodeVinValuesExtended](vpic.md#decodevinvaluesextended) + - [DecodeWMI](vpic.md#decodewmi) + - [GetAllMakes](vpic.md#getallmakes) + - [GetAllManufacturers](vpic.md#getallmanufacturers) + - [GetCanadianVehicleSpecifications](vpic.md#getcanadianvehiclespecifications) + - [GetEquipmentPlantCodes](vpic.md#getequipmentplantcodes) + - [GetMakeForManufacturer](vpic.md#getmakeformanufacturer) + - [GetMakesForManufacturerAndYear](vpic.md#getmakesformanufacturerandyear) + - [GetMakesForVehicleType](vpic.md#getmakesforvehicletype) + - [GetManufacturerDetails](vpic.md#getmanufacturerdetails) + - [GetModelsForMake](vpic.md#getmodelsformake) + - [GetModelsForMakeId](vpic.md#getmodelsformakeid) + - [GetModelsForMakeIdYear](vpic.md#getmodelsformakeidyear) + - [GetModelsForMakeYear](vpic.md#getmodelsformakeyear) + - [GetParts](vpic.md#getparts) + - [GetVehicleTypesForMake](vpic.md#getvehicletypesformake) + - [GetVehicleTypesForMakeId](vpic.md#getvehicletypesformakeid) + - [GetVehicleVariableList](vpic.md#getvehiclevariablelist) + - [GetVehicleVariableValuesList](vpic.md#getvehiclevariablevalueslist) + - [GetWMIsForManufacturer](vpic.md#getwmisformanufacturer) + +## References + +### DecodeVin + +Re-exports [DecodeVin](vpic/endpoints/DecodeVin.md#decodevin) + +### DecodeVinExtended + +Re-exports [DecodeVinExtended](vpic/endpoints/DecodeVinExtended.md#decodevinextended) + +### DecodeVinValues + +Re-exports [DecodeVinValues](vpic/endpoints/DecodeVinValues.md#decodevinvalues) + +### DecodeVinValuesBatch + +Re-exports [DecodeVinValuesBatch](vpic/endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatch) + +### DecodeVinValuesExtended + +Re-exports [DecodeVinValuesExtended](vpic/endpoints/DecodeVinValuesExtended.md#decodevinvaluesextended) + +### DecodeWMI + +Re-exports [DecodeWMI](vpic/endpoints/DecodeWMI.md#decodewmi) + +### GetAllMakes + +Re-exports [GetAllMakes](vpic/endpoints/GetAllMakes.md#getallmakes) + +### GetAllManufacturers + +Re-exports [GetAllManufacturers](vpic/endpoints/GetAllManufacturers.md#getallmanufacturers) + +### GetCanadianVehicleSpecifications + +Re-exports [GetCanadianVehicleSpecifications](vpic/endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecifications) + +### GetEquipmentPlantCodes + +Re-exports [GetEquipmentPlantCodes](vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodes) + +### GetMakeForManufacturer + +Re-exports [GetMakeForManufacturer](vpic/endpoints/GetMakeForManufacturer.md#getmakeformanufacturer) + +### GetMakesForManufacturerAndYear + +Re-exports [GetMakesForManufacturerAndYear](vpic/endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyear) + +### GetMakesForVehicleType + +Re-exports [GetMakesForVehicleType](vpic/endpoints/GetMakesForVehicleType.md#getmakesforvehicletype) + +### GetManufacturerDetails + +Re-exports [GetManufacturerDetails](vpic/endpoints/GetManufacturerDetails.md#getmanufacturerdetails) + +### GetModelsForMake + +Re-exports [GetModelsForMake](vpic/endpoints/GetModelsForMake.md#getmodelsformake) + +### GetModelsForMakeId + +Re-exports [GetModelsForMakeId](vpic/endpoints/GetModelsForMakeId.md#getmodelsformakeid) + +### GetModelsForMakeIdYear + +Re-exports [GetModelsForMakeIdYear](vpic/endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyear) + +### GetModelsForMakeYear + +Re-exports [GetModelsForMakeYear](vpic/endpoints/GetModelsForMakeYear.md#getmodelsformakeyear) + +### GetParts + +Re-exports [GetParts](vpic/endpoints/GetParts.md#getparts) + +### GetVehicleTypesForMake + +Re-exports [GetVehicleTypesForMake](vpic/endpoints/GetVehicleTypesForMake.md#getvehicletypesformake) + +### GetVehicleTypesForMakeId + +Re-exports [GetVehicleTypesForMakeId](vpic/endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeid) + +### GetVehicleVariableList + +Re-exports [GetVehicleVariableList](vpic/endpoints/GetVehicleVariableList.md#getvehiclevariablelist) + +### GetVehicleVariableValuesList + +Re-exports [GetVehicleVariableValuesList](vpic/endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslist) + +### GetWMIsForManufacturer + +Re-exports [GetWMIsForManufacturer](vpic/endpoints/GetWMIsForManufacturer.md#getwmisformanufacturer) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints.md b/apps/docs/src/typedoc/api/vpic/endpoints.md new file mode 100644 index 00000000..ac9954ec --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints.md @@ -0,0 +1,133 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/vpic/endpoints + +# api/vpic/endpoints + +## Contents + +- [References](endpoints.md#references) + - [DecodeVin](endpoints.md#decodevin) + - [DecodeVinExtended](endpoints.md#decodevinextended) + - [DecodeVinValues](endpoints.md#decodevinvalues) + - [DecodeVinValuesBatch](endpoints.md#decodevinvaluesbatch) + - [DecodeVinValuesExtended](endpoints.md#decodevinvaluesextended) + - [DecodeWMI](endpoints.md#decodewmi) + - [GetAllMakes](endpoints.md#getallmakes) + - [GetAllManufacturers](endpoints.md#getallmanufacturers) + - [GetCanadianVehicleSpecifications](endpoints.md#getcanadianvehiclespecifications) + - [GetEquipmentPlantCodes](endpoints.md#getequipmentplantcodes) + - [GetMakeForManufacturer](endpoints.md#getmakeformanufacturer) + - [GetMakesForManufacturerAndYear](endpoints.md#getmakesformanufacturerandyear) + - [GetMakesForVehicleType](endpoints.md#getmakesforvehicletype) + - [GetManufacturerDetails](endpoints.md#getmanufacturerdetails) + - [GetModelsForMake](endpoints.md#getmodelsformake) + - [GetModelsForMakeId](endpoints.md#getmodelsformakeid) + - [GetModelsForMakeIdYear](endpoints.md#getmodelsformakeidyear) + - [GetModelsForMakeYear](endpoints.md#getmodelsformakeyear) + - [GetParts](endpoints.md#getparts) + - [GetVehicleTypesForMake](endpoints.md#getvehicletypesformake) + - [GetVehicleTypesForMakeId](endpoints.md#getvehicletypesformakeid) + - [GetVehicleVariableList](endpoints.md#getvehiclevariablelist) + - [GetVehicleVariableValuesList](endpoints.md#getvehiclevariablevalueslist) + - [GetWMIsForManufacturer](endpoints.md#getwmisformanufacturer) + +## References + +### DecodeVin + +Re-exports [DecodeVin](endpoints/DecodeVin.md#decodevin) + +### DecodeVinExtended + +Re-exports [DecodeVinExtended](endpoints/DecodeVinExtended.md#decodevinextended) + +### DecodeVinValues + +Re-exports [DecodeVinValues](endpoints/DecodeVinValues.md#decodevinvalues) + +### DecodeVinValuesBatch + +Re-exports [DecodeVinValuesBatch](endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatch) + +### DecodeVinValuesExtended + +Re-exports [DecodeVinValuesExtended](endpoints/DecodeVinValuesExtended.md#decodevinvaluesextended) + +### DecodeWMI + +Re-exports [DecodeWMI](endpoints/DecodeWMI.md#decodewmi) + +### GetAllMakes + +Re-exports [GetAllMakes](endpoints/GetAllMakes.md#getallmakes) + +### GetAllManufacturers + +Re-exports [GetAllManufacturers](endpoints/GetAllManufacturers.md#getallmanufacturers) + +### GetCanadianVehicleSpecifications + +Re-exports [GetCanadianVehicleSpecifications](endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecifications) + +### GetEquipmentPlantCodes + +Re-exports [GetEquipmentPlantCodes](endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodes) + +### GetMakeForManufacturer + +Re-exports [GetMakeForManufacturer](endpoints/GetMakeForManufacturer.md#getmakeformanufacturer) + +### GetMakesForManufacturerAndYear + +Re-exports [GetMakesForManufacturerAndYear](endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyear) + +### GetMakesForVehicleType + +Re-exports [GetMakesForVehicleType](endpoints/GetMakesForVehicleType.md#getmakesforvehicletype) + +### GetManufacturerDetails + +Re-exports [GetManufacturerDetails](endpoints/GetManufacturerDetails.md#getmanufacturerdetails) + +### GetModelsForMake + +Re-exports [GetModelsForMake](endpoints/GetModelsForMake.md#getmodelsformake) + +### GetModelsForMakeId + +Re-exports [GetModelsForMakeId](endpoints/GetModelsForMakeId.md#getmodelsformakeid) + +### GetModelsForMakeIdYear + +Re-exports [GetModelsForMakeIdYear](endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyear) + +### GetModelsForMakeYear + +Re-exports [GetModelsForMakeYear](endpoints/GetModelsForMakeYear.md#getmodelsformakeyear) + +### GetParts + +Re-exports [GetParts](endpoints/GetParts.md#getparts) + +### GetVehicleTypesForMake + +Re-exports [GetVehicleTypesForMake](endpoints/GetVehicleTypesForMake.md#getvehicletypesformake) + +### GetVehicleTypesForMakeId + +Re-exports [GetVehicleTypesForMakeId](endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeid) + +### GetVehicleVariableList + +Re-exports [GetVehicleVariableList](endpoints/GetVehicleVariableList.md#getvehiclevariablelist) + +### GetVehicleVariableValuesList + +Re-exports [GetVehicleVariableValuesList](endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslist) + +### GetWMIsForManufacturer + +Re-exports [GetWMIsForManufacturer](endpoints/GetWMIsForManufacturer.md#getwmisformanufacturer) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVin.md b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVin.md new file mode 100644 index 00000000..4bccbe00 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVin.md @@ -0,0 +1,181 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/DecodeVin + +# api/vpic/endpoints/DecodeVin + +## Contents + +- [Type Aliases](DecodeVin.md#type-aliases) + - [DecodeVinResults](DecodeVin.md#decodevinresults) + - [DecodeVinVariable](DecodeVin.md#decodevinvariable) +- [Functions](DecodeVin.md#functions) + - [DecodeVin()](DecodeVin.md#decodevin) + +## Type Aliases + +### DecodeVinResults + +> **DecodeVinResults**: `object` + +Objects in the `Results` array of `DecodeVin` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Value` | `string` \| `null` | - | +| `ValueId` | `string` \| `null` | - | +| `Variable` | [`DecodeVinVariable`](DecodeVin.md#decodevinvariable) | - | +| `VariableId` | `number` | - | + +#### Source + +[api/vpic/endpoints/DecodeVin.ts:110](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVin.ts#L110) + +*** + +### DecodeVinVariable + +> **DecodeVinVariable**: `"Suggested VIN"` \| `"Error Code"` \| `"Possible Values"` \| `"Additional Error Text"` \| `"Error Text"` \| `"Vehicle Descriptor"` \| `"Destination Market"` \| `"Make"` \| `"Manufacturer Name"` \| `"Model"` \| `"Model Year"` \| `"Plant City"` \| `"Series"` \| `"Trim"` \| `"Vehicle Type"` \| `"Plant Country"` \| `"Plant Company Name"` \| `"Plant State"` \| `"Trim2"` \| `"Series2"` \| `"Note"` \| `"Base Price ($)"` \| `"Non-Land Use"` \| `"Body Class"` \| `"Doors"` \| `"Windows"` \| `"Wheel Base Type"` \| `"Track Width (inches)"` \| `"Gross Vehicle Weight Rating From"` \| `"Bed Length (inches)"` \| `"Curb Weight (pounds)"` \| `"Wheel Base (inches) From"` \| `"Wheel Base (inches) To"` \| `"Gross Combination Weight Rating From"` \| `"Gross Combination Weight Rating To"` \| `"Gross Vehicle Weight Rating To"` \| `"Bed Type"` \| `"Cab Type"` \| `"Trailer Type Connection"` \| `"Trailer Body Type"` \| `"Trailer Length (feet)"` \| `"Other Trailer Info"` \| `"Number of Wheels"` \| `"Wheel Size Front (inches)"` \| `"Wheel Size Rear (inches)"` \| `"Entertainment System"` \| `"Steering Location"` \| `"Number of Seats"` \| `"Number of Seat Rows"` \| `"Transmission Style"` \| `"Transmission Speeds"` \| `"Drive Type"` \| `"Axles"` \| `"Axle Configuration"` \| `"Brake System Type"` \| `"Brake System Description"` \| `"Other Battery Info"` \| `"Battery Type"` \| `"Number of Battery Cells per Module"` \| `"Battery Current (Amps) From"` \| `"Battery Voltage (Volts) From"` \| `"Battery Energy (kWh) From"` \| `"EV Drive Unit"` \| `"Battery Current (Amps) To"` \| `"Battery Voltage (Volts) To"` \| `"Battery Energy (kWh) To"` \| `"Number of Battery Modules per Pack"` \| `"Number of Battery Packs per Vehicle"` \| `"Charger Level"` \| `"Charger Power (kW)"` \| `"Engine Number of Cylinders"` \| `"Displacement (CC)"` \| `"Displacement (CI)"` \| `"Displacement (L)"` \| `"Engine Stroke Cycles"` \| `"Engine Model"` \| `"Engine Power (kW)"` \| `"Fuel Type - Primary"` \| `"Valve Train Design"` \| `"Engine Configuration"` \| `"Fuel Type - Secondary"` \| `"Fuel Delivery / Fuel Injection Type"` \| `"Engine Brake (hp) From"` \| `"Cooling Type"` \| `"Engine Brake (hp) To"` \| `"Electrification Level"` \| `"Other Engine Info"` \| `"Turbo"` \| `"Top Speed (MPH)"` \| `"Engine Manufacturer"` \| `"Pretensioner"` \| `"Seat Belt Type"` \| `"Other Restraint System Info"` \| `"Curtain Air Bag Locations"` \| `"Seat Cushion Air Bag Locations"` \| `"Front Air Bag Locations"` \| `"Knee Air Bag Locations"` \| `"Side Air Bag Locations"` \| `"Anti-lock Braking System (ABS)"` \| `"Electronic Stability Control (ESC)"` \| `"Traction Control"` \| `"Tire Pressure Monitoring System (TPMS) Type"` \| `"Active Safety System Note"` \| `"Auto-Reverse System for Windows and Sunroofs"` \| `"Automatic Pedestrian Alerting Sound (for Hybrid and EV only)"` \| `"Event Data Recorder (EDR)"` \| `"Keyless Ignition"` \| `"SAE Automation Level From"` \| `"SAE Automation Level To"` \| `"Adaptive Cruise Control (ACC)"` \| `"Crash Imminent Braking (CIB)"` \| `"Blind Spot Warning (BSW)"` \| `"Forward Collision Warning (FCW)"` \| `"Lane Departure Warning (LDW)"` \| `"Lane Keeping Assistance (LKA)"` \| `"Backup Camera"` \| `"Parking Assist"` \| `"Bus Length (feet)"` \| `"Bus Floor Configuration Type"` \| `"Bus Type"` \| `"Other Bus Info"` \| `"Custom Motorcycle Type"` \| `"Motorcycle Suspension Type"` \| `"Motorcycle Chassis Type"` \| `"Other Motorcycle Info"` \| `"Dynamic Brake Support (DBS)"` \| `"Pedestrian Automatic Emergency Braking (PAEB)"` \| `"Automatic Crash Notification (ACN) / Advanced Automatic Crash Notification (AACN)"` \| `"Daytime Running Light (DRL)"` \| `"Headlamp Light Source"` \| `"Semiautomatic Headlamp Beam Switching"` \| `"Adaptive Driving Beam (ADB)"` \| `"Rear Cross Traffic Alert"` \| `"Rear Automatic Emergency Braking"` \| `"Blind Spot Intervention (BSI)"` \| `"Lane Centering Assistance"` \| `string` & `Record`\<`string`, `never`\> + +Possible `DecodeVinResults.Variable` values for DecodeVin endpoint. + +This type is here to provide a list of possible values manually extracted from an actual API +response. There are some things to note: +- Names are ordered to mirror actual API response order. +- Names have been known to change slightly or be added/removed. +- Some listed here could be missing from the API response. +- There may be more actual values than listed here. + +Last Updated: 02/14/2023 + +#### Source + +[api/vpic/endpoints/DecodeVin.ts:129](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVin.ts#L129) + +## Functions + +### DecodeVin() + +#### DecodeVin(vin) + +> **DecodeVin**(`vin`): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> + +::: tip :bulb: More Information +See: [DecodeVin Documentation](/guide/vpic/endpoints/decode-vin) +::: + +`DecodeVin` decodes a Vehicle Identification Number (VIN) and returns useful information about +the vehicle. + +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, but it is not required. + +This endpoint also supports partial VIN decoding (VINs that are less than 17 characters). + - Ex: 5UXWX7C5*BA + - 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 + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `vin` | `string` | Vehicle Identification Number (full or partial) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/DecodeVin.ts:36](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVin.ts#L36) + +#### DecodeVin(vin, doFetch, _dummy) + +> **DecodeVin**(`vin`, `doFetch`, `_dummy`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `true` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> + +##### Source + +[api/vpic/endpoints/DecodeVin.ts:38](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVin.ts#L38) + +#### DecodeVin(vin, doFetch, _dummy) + +> **DecodeVin**(`vin`, `doFetch`, `_dummy`?): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `false` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/DecodeVin.ts:44](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVin.ts#L44) + +#### DecodeVin(vin, params, doFetch) + +> **DecodeVin**(`vin`, `params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params` | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/DecodeVin.ts:50](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVin.ts#L50) + +#### DecodeVin(vin, params, doFetch) + +> **DecodeVin**(`vin`, `params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params`? | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> + +##### Source + +[api/vpic/endpoints/DecodeVin.ts:56](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVin.ts#L56) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinExtended.md b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinExtended.md new file mode 100644 index 00000000..e373179e --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinExtended.md @@ -0,0 +1,185 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/DecodeVinExtended + +# api/vpic/endpoints/DecodeVinExtended + +## Contents + +- [Type Aliases](DecodeVinExtended.md#type-aliases) + - [DecodeVinExtendedResults](DecodeVinExtended.md#decodevinextendedresults) + - [DecodeVinExtendedVariable](DecodeVinExtended.md#decodevinextendedvariable) +- [Functions](DecodeVinExtended.md#functions) + - [DecodeVinExtended()](DecodeVinExtended.md#decodevinextended) + +## Type Aliases + +### DecodeVinExtendedResults + +> **DecodeVinExtendedResults**: `object` + +Objects in the `Results` array of `DecodeVinExtended` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Value` | `string` \| `null` | - | +| `ValueId` | `string` \| `null` | - | +| `Variable` | [`DecodeVinExtendedVariable`](DecodeVinExtended.md#decodevinextendedvariable) | - | +| `VariableId` | `number` | - | + +#### Source + +[api/vpic/endpoints/DecodeVinExtended.ts:116](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts#L116) + +*** + +### DecodeVinExtendedVariable + +> **DecodeVinExtendedVariable**: `"Suggested VIN"` \| `"Error Code"` \| `"Possible Values"` \| `"Additional Error Text"` \| `"Error Text"` \| `"Vehicle Descriptor"` \| `"Destination Market"` \| `"Make"` \| `"Manufacturer Name"` \| `"Model"` \| `"Model Year"` \| `"Plant City"` \| `"Series"` \| `"Trim"` \| `"Vehicle Type"` \| `"Plant Country"` \| `"Plant Company Name"` \| `"Plant State"` \| `"Trim2"` \| `"Series2"` \| `"Note"` \| `"Base Price ($)"` \| `"Non-Land Use"` \| `"Body Class"` \| `"Doors"` \| `"Windows"` \| `"Wheel Base Type"` \| `"Track Width (inches)"` \| `"Gross Vehicle Weight Rating From"` \| `"Bed Length (inches)"` \| `"Curb Weight (pounds)"` \| `"Wheel Base (inches) From"` \| `"Wheel Base (inches) To"` \| `"Gross Combination Weight Rating From"` \| `"Gross Combination Weight Rating To"` \| `"Gross Vehicle Weight Rating To"` \| `"Bed Type"` \| `"Cab Type"` \| `"Trailer Type Connection"` \| `"Trailer Body Type"` \| `"Trailer Length (feet)"` \| `"Other Trailer Info"` \| `"Number of Wheels"` \| `"Wheel Size Front (inches)"` \| `"Wheel Size Rear (inches)"` \| `"Entertainment System"` \| `"Steering Location"` \| `"Number of Seats"` \| `"Number of Seat Rows"` \| `"Transmission Style"` \| `"Transmission Speeds"` \| `"Drive Type"` \| `"Axles"` \| `"Axle Configuration"` \| `"Brake System Type"` \| `"Brake System Description"` \| `"Other Battery Info"` \| `"Battery Type"` \| `"Number of Battery Cells per Module"` \| `"Battery Current (Amps) From"` \| `"Battery Voltage (Volts) From"` \| `"Battery Energy (kWh) From"` \| `"EV Drive Unit"` \| `"Battery Current (Amps) To"` \| `"Battery Voltage (Volts) To"` \| `"Battery Energy (kWh) To"` \| `"Number of Battery Modules per Pack"` \| `"Number of Battery Packs per Vehicle"` \| `"Charger Level"` \| `"Charger Power (kW)"` \| `"Engine Number of Cylinders"` \| `"Displacement (CC)"` \| `"Displacement (CI)"` \| `"Displacement (L)"` \| `"Engine Stroke Cycles"` \| `"Engine Model"` \| `"Engine Power (kW)"` \| `"Fuel Type - Primary"` \| `"Valve Train Design"` \| `"Engine Configuration"` \| `"Fuel Type - Secondary"` \| `"Fuel Delivery / Fuel Injection Type"` \| `"Engine Brake (hp) From"` \| `"Cooling Type"` \| `"Engine Brake (hp) To"` \| `"Electrification Level"` \| `"Other Engine Info"` \| `"Turbo"` \| `"Top Speed (MPH)"` \| `"Engine Manufacturer"` \| `"Pretensioner"` \| `"Seat Belt Type"` \| `"Other Restraint System Info"` \| `"Curtain Air Bag Locations"` \| `"Seat Cushion Air Bag Locations"` \| `"Front Air Bag Locations"` \| `"Knee Air Bag Locations"` \| `"Side Air Bag Locations"` \| `"Anti-lock Braking System (ABS)"` \| `"Electronic Stability Control (ESC)"` \| `"Traction Control"` \| `"Tire Pressure Monitoring System (TPMS) Type"` \| `"Active Safety System Note"` \| `"Auto-Reverse System for Windows and Sunroofs"` \| `"Automatic Pedestrian Alerting Sound (for Hybrid and EV only)"` \| `"Event Data Recorder (EDR)"` \| `"Keyless Ignition"` \| `"SAE Automation Level From"` \| `"SAE Automation Level To"` \| `"NCSA Body Type"` \| `"NCSA Make"` \| `"NCSA Model"` \| `"NCSA Note"` \| `"Adaptive Cruise Control (ACC)"` \| `"Crash Imminent Braking (CIB)"` \| `"Blind Spot Warning (BSW)"` \| `"Forward Collision Warning (FCW)"` \| `"Lane Departure Warning (LDW)"` \| `"Lane Keeping Assistance (LKA)"` \| `"Backup Camera"` \| `"Parking Assist"` \| `"Bus Length (feet)"` \| `"Bus Floor Configuration Type"` \| `"Bus Type"` \| `"Other Bus Info"` \| `"Custom Motorcycle Type"` \| `"Motorcycle Suspension Type"` \| `"Motorcycle Chassis Type"` \| `"Other Motorcycle Info"` \| `"Dynamic Brake Support (DBS)"` \| `"Pedestrian Automatic Emergency Braking (PAEB)"` \| `"Automatic Crash Notification (ACN) / Advanced Automatic Crash Notification (AACN)"` \| `"Daytime Running Light (DRL)"` \| `"Headlamp Light Source"` \| `"Semiautomatic Headlamp Beam Switching"` \| `"Adaptive Driving Beam (ADB)"` \| `"Rear Cross Traffic Alert"` \| `"Rear Automatic Emergency Braking"` \| `"Blind Spot Intervention (BSI)"` \| `"Lane Centering Assistance"` \| `string` & `Record`\<`string`, `never`\> + +Possible `DecodeVinExtendedResults.Variable` values for DecodeVinExtended endpoint. + +This type is here to provide a list of possible values manually extracted from an actual API +response. There are some things to note: +- Names are ordered to mirror actual API response order. +- Names have been known to change slightly or be added/removed. +- Some listed here could be missing from the API response. +- There may be more actual values than listed here. + +Last Updated: 02/14/2023 + +#### Source + +[api/vpic/endpoints/DecodeVinExtended.ts:135](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts#L135) + +## Functions + +### DecodeVinExtended() + +#### DecodeVinExtended(vin) + +> **DecodeVinExtended**(`vin`): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> + +::: tip :bulb: More Information +See: [DecodeVinExtended Documentation](/guide/vpic/endpoints/decode-vin-extended) +::: + +`DecodeVinExtended` decodes a Vehicle Identification Number (VIN) and returns useful information +about the vehicle. + +This endpoint is similar to `DecodeVin` but returns additional information on variables related +to other NHTSA programs like the +[NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa). + +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, but it is not required. + +This endpoint also supports partial VIN decoding (VINs that are less than 17 characters). + - Ex: 5UXWX7C5*BA + - 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 + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `vin` | `string` | Vehicle Identification Number (full or partial) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` (default: `true`) + +##### Source + +[api/vpic/endpoints/DecodeVinExtended.ts:40](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts#L40) + +#### DecodeVinExtended(vin, doFetch, _dummy) + +> **DecodeVinExtended**(`vin`, `doFetch`, `_dummy`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `true` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> + +##### Source + +[api/vpic/endpoints/DecodeVinExtended.ts:44](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts#L44) + +#### DecodeVinExtended(vin, doFetch, _dummy) + +> **DecodeVinExtended**(`vin`, `doFetch`, `_dummy`?): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `false` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/DecodeVinExtended.ts:50](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts#L50) + +#### DecodeVinExtended(vin, params, doFetch) + +> **DecodeVinExtended**(`vin`, `params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params` | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/DecodeVinExtended.ts:56](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts#L56) + +#### DecodeVinExtended(vin, params, doFetch) + +> **DecodeVinExtended**(`vin`, `params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params`? | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> + +##### Source + +[api/vpic/endpoints/DecodeVinExtended.ts:62](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts#L62) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValues.md b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValues.md new file mode 100644 index 00000000..f2e4edb2 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValues.md @@ -0,0 +1,325 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/DecodeVinValues + +# api/vpic/endpoints/DecodeVinValues + +## Contents + +- [Type Aliases](DecodeVinValues.md#type-aliases) + - [DecodeVinValuesParams](DecodeVinValues.md#decodevinvaluesparams) + - [DecodeVinValuesResults](DecodeVinValues.md#decodevinvaluesresults) +- [Functions](DecodeVinValues.md#functions) + - [DecodeVinValues()](DecodeVinValues.md#decodevinvalues) + +## Type Aliases + +### DecodeVinValuesParams + +> **DecodeVinValuesParams**: `object` + +Query String Parameters for this endpoint + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `modelYear` | `string` \| `number` | - | + +#### Source + +[api/vpic/endpoints/DecodeVinValues.ts:111](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts#L111) + +*** + +### DecodeVinValuesResults + +> **DecodeVinValuesResults**: `object` + +Single object found in the `Results` array of `DecodeVinValues` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `ABS` | `string` | - | +| `ActiveSafetySysNote` | `string` | - | +| `AdaptiveCruiseControl` | `string` | - | +| `AdaptiveDrivingBeam` | `string` | - | +| `AdaptiveHeadlights` | `string` | - | +| `AdditionalErrorText` | `string` | - | +| `AirBagLocCurtain` | `string` | - | +| `AirBagLocFront` | `string` | - | +| `AirBagLocKnee` | `string` | - | +| `AirBagLocSeatCushion` | `string` | - | +| `AirBagLocSide` | `string` | - | +| `AutoReverseSystem` | `string` | - | +| `AutomaticPedestrianAlertingSound` | `string` | - | +| `AxleConfiguration` | `string` | - | +| `Axles` | `string` | - | +| `BasePrice` | `string` | - | +| `BatteryA` | `string` | - | +| `BatteryA_to` | `string` | - | +| `BatteryCells` | `string` | - | +| `BatteryInfo` | `string` | - | +| `BatteryKWh` | `string` | - | +| `BatteryKWh_to` | `string` | - | +| `BatteryModules` | `string` | - | +| `BatteryPacks` | `string` | - | +| `BatteryType` | `string` | - | +| `BatteryV` | `string` | - | +| `BatteryV_to` | `string` | - | +| `BedLengthIN` | `string` | - | +| `BedType` | `string` | - | +| `BlindSpotIntervention` | `string` | - | +| `BlindSpotMon` | `string` | - | +| `BodyCabType` | `string` | - | +| `BodyClass` | `string` | - | +| `BrakeSystemDesc` | `string` | - | +| `BrakeSystemType` | `string` | - | +| `BusFloorConfigType` | `string` | - | +| `BusLength` | `string` | - | +| `BusType` | `string` | - | +| `CAN_AACN` | `string` | - | +| `CIB` | `string` | - | +| `CashForClunkers` | `string` | - | +| `ChargerLevel` | `string` | - | +| `ChargerPowerKW` | `string` | - | +| `CoolingType` | `string` | - | +| `CurbWeightLB` | `string` | - | +| `CustomMotorcycleType` | `string` | - | +| `DaytimeRunningLight` | `string` | - | +| `DestinationMarket` | `string` | - | +| `DisplacementCC` | `string` | - | +| `DisplacementCI` | `string` | - | +| `DisplacementL` | `string` | - | +| `Doors` | `string` | - | +| `DriveType` | `string` | - | +| `DriverAssist` | `string` | - | +| `DynamicBrakeSupport` | `string` | - | +| `EDR` | `string` | - | +| `ESC` | `string` | - | +| `EVDriveUnit` | `string` | - | +| `ElectrificationLevel` | `string` | - | +| `EngineConfiguration` | `string` | - | +| `EngineCycles` | `string` | - | +| `EngineCylinders` | `string` | - | +| `EngineHP` | `string` | - | +| `EngineHP_to` | `string` | - | +| `EngineKW` | `string` | - | +| `EngineManufacturer` | `string` | - | +| `EngineModel` | `string` | - | +| `EntertainmentSystem` | `string` | - | +| `ErrorCode` | `string` | - | +| `ErrorText` | `string` | - | +| `ForwardCollisionWarning` | `string` | - | +| `FuelInjectionType` | `string` | - | +| `FuelTypePrimary` | `string` | - | +| `FuelTypeSecondary` | `string` | - | +| `GCWR` | `string` | - | +| `GCWR_to` | `string` | - | +| `GVWR` | `string` | - | +| `GVWR_to` | `string` | - | +| `KeylessIgnition` | `string` | - | +| `LaneCenteringAssistance` | `string` | - | +| `LaneDepartureWarning` | `string` | - | +| `LaneKeepSystem` | `string` | - | +| `LowerBeamHeadlampLightSource` | `string` | - | +| `Make` | `string` | - | +| `MakeID` | `string` | - | +| `Manufacturer` | `string` | - | +| `ManufacturerId` | `string` | - | +| `Model` | `string` | - | +| `ModelID` | `string` | - | +| `ModelYear` | `string` | - | +| `MotorcycleChassisType` | `string` | - | +| `MotorcycleSuspensionType` | `string` | - | +| `NCSABodyType` | `string` | - | +| `NCSAMake` | `string` | - | +| `NCSAMapExcApprovedBy` | `string` | - | +| `NCSAMapExcApprovedOn` | `string` | - | +| `NCSAMappingException` | `string` | - | +| `NCSAModel` | `string` | - | +| `NCSANote` | `string` | - | +| `NonLandUse` | `string` | - | +| `Note` | `string` | - | +| `OtherBusInfo` | `string` | - | +| `OtherEngineInfo` | `string` | - | +| `OtherMotorcycleInfo` | `string` | - | +| `OtherRestraintSystemInfo` | `string` | - | +| `OtherTrailerInfo` | `string` | - | +| `ParkAssist` | `string` | - | +| `PedestrianAutomaticEmergencyBraking` | `string` | - | +| `PlantCity` | `string` | - | +| `PlantCompanyName` | `string` | - | +| `PlantCountry` | `string` | - | +| `PlantState` | `string` | - | +| `PossibleValues` | `string` | - | +| `Pretensioner` | `string` | - | +| `RearAutomaticEmergencyBraking` | `string` | - | +| `RearCrossTrafficAlert` | `string` | - | +| `RearVisibilitySystem` | `string` | - | +| `SAEAutomationLevel` | `string` | - | +| `SAEAutomationLevel_to` | `string` | - | +| `SeatBeltsAll` | `string` | - | +| `SeatRows` | `string` | - | +| `Seats` | `string` | - | +| `SemiautomaticHeadlampBeamSwitching` | `string` | - | +| `Series` | `string` | - | +| `Series2` | `string` | - | +| `SteeringLocation` | `string` | - | +| `SuggestedVIN` | `string` | - | +| `TPMS` | `string` | - | +| `TopSpeedMPH` | `string` | - | +| `TrackWidth` | `string` | - | +| `TractionControl` | `string` | - | +| `TrailerBodyType` | `string` | - | +| `TrailerLength` | `string` | - | +| `TrailerType` | `string` | - | +| `TransmissionSpeeds` | `string` | - | +| `TransmissionStyle` | `string` | - | +| `Trim` | `string` | - | +| `Trim2` | `string` | - | +| `Turbo` | `string` | - | +| `VIN` | `string` | - | +| `ValveTrainDesign` | `string` | - | +| `VehicleDescriptor` | `string` | - | +| `VehicleType` | `string` | - | +| `WheelBaseLong` | `string` | - | +| `WheelBaseShort` | `string` | - | +| `WheelBaseType` | `string` | - | +| `WheelSizeFront` | `string` | - | +| `WheelSizeRear` | `string` | - | +| `Wheels` | `string` | - | +| `Windows` | `string` | - | + +#### Source + +[api/vpic/endpoints/DecodeVinValues.ts:118](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts#L118) + +## Functions + +### DecodeVinValues() + +#### DecodeVinValues(vin) + +> **DecodeVinValues**(`vin`): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> + +::: tip :bulb: More Information +See: [DecodeVinValues Documentation](/guide/vpic/endpoints/decode-vin-values) +::: + +`DecodeVinValues` decodes a Vehicle Identification Number (VIN) and returns useful information +about the vehicle in in a _flat format_. This means the endpoint will return an array with a +single object of results. Each key in the object is the name of a variable. + +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, but it is not required. + +This endpoint also supports partial VIN decoding (VINs that are less than 17 characters). + - Ex: "5UXWX7C5*BA" + - 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 + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `vin` | `string` | Vehicle Identification Number (full or partial) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/DecodeVinValues.ts:37](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts#L37) + +#### DecodeVinValues(vin, doFetch, _dummy) + +> **DecodeVinValues**(`vin`, `doFetch`, `_dummy`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `true` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> + +##### Source + +[api/vpic/endpoints/DecodeVinValues.ts:41](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts#L41) + +#### DecodeVinValues(vin, doFetch, _dummy) + +> **DecodeVinValues**(`vin`, `doFetch`, `_dummy`?): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `false` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/DecodeVinValues.ts:47](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts#L47) + +#### DecodeVinValues(vin, params, doFetch) + +> **DecodeVinValues**(`vin`, `params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params` | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/DecodeVinValues.ts:53](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts#L53) + +#### DecodeVinValues(vin, params, doFetch) + +> **DecodeVinValues**(`vin`, `params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params`? | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> + +##### Source + +[api/vpic/endpoints/DecodeVinValues.ts:59](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts#L59) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValuesBatch.md b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValuesBatch.md new file mode 100644 index 00000000..c371f7e3 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValuesBatch.md @@ -0,0 +1,251 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/DecodeVinValuesBatch + +# api/vpic/endpoints/DecodeVinValuesBatch + +## Contents + +- [Type Aliases](DecodeVinValuesBatch.md#type-aliases) + - [DecodeVinValuesBatchResults](DecodeVinValuesBatch.md#decodevinvaluesbatchresults) +- [Functions](DecodeVinValuesBatch.md#functions) + - [DecodeVinValuesBatch()](DecodeVinValuesBatch.md#decodevinvaluesbatch) + +## Type Aliases + +### DecodeVinValuesBatchResults + +> **DecodeVinValuesBatchResults**: `object` + +Objects found in the `Results` array of `DecodeVinValuesBatch` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `ABS` | `string` | - | +| `ActiveSafetySysNote` | `string` | - | +| `AdaptiveCruiseControl` | `string` | - | +| `AdaptiveDrivingBeam` | `string` | - | +| `AdaptiveHeadlights` | `string` | - | +| `AdditionalErrorText` | `string` | - | +| `AirBagLocCurtain` | `string` | - | +| `AirBagLocFront` | `string` | - | +| `AirBagLocKnee` | `string` | - | +| `AirBagLocSeatCushion` | `string` | - | +| `AirBagLocSide` | `string` | - | +| `AutoReverseSystem` | `string` | - | +| `AutomaticPedestrianAlertingSound` | `string` | - | +| `AxleConfiguration` | `string` | - | +| `Axles` | `string` | - | +| `BasePrice` | `string` | - | +| `BatteryA` | `string` | - | +| `BatteryA_to` | `string` | - | +| `BatteryCells` | `string` | - | +| `BatteryInfo` | `string` | - | +| `BatteryKWh` | `string` | - | +| `BatteryKWh_to` | `string` | - | +| `BatteryModules` | `string` | - | +| `BatteryPacks` | `string` | - | +| `BatteryType` | `string` | - | +| `BatteryV` | `string` | - | +| `BatteryV_to` | `string` | - | +| `BedLengthIN` | `string` | - | +| `BedType` | `string` | - | +| `BlindSpotIntervention` | `string` | - | +| `BlindSpotMon` | `string` | - | +| `BodyCabType` | `string` | - | +| `BodyClass` | `string` | - | +| `BrakeSystemDesc` | `string` | - | +| `BrakeSystemType` | `string` | - | +| `BusFloorConfigType` | `string` | - | +| `BusLength` | `string` | - | +| `BusType` | `string` | - | +| `CAN_AACN` | `string` | - | +| `CIB` | `string` | - | +| `CashForClunkers` | `string` | - | +| `ChargerLevel` | `string` | - | +| `ChargerPowerKW` | `string` | - | +| `CoolingType` | `string` | - | +| `CurbWeightLB` | `string` | - | +| `CustomMotorcycleType` | `string` | - | +| `DaytimeRunningLight` | `string` | - | +| `DestinationMarket` | `string` | - | +| `DisplacementCC` | `string` | - | +| `DisplacementCI` | `string` | - | +| `DisplacementL` | `string` | - | +| `Doors` | `string` | - | +| `DriveType` | `string` | - | +| `DriverAssist` | `string` | - | +| `DynamicBrakeSupport` | `string` | - | +| `EDR` | `string` | - | +| `ESC` | `string` | - | +| `EVDriveUnit` | `string` | - | +| `ElectrificationLevel` | `string` | - | +| `EngineConfiguration` | `string` | - | +| `EngineCycles` | `string` | - | +| `EngineCylinders` | `string` | - | +| `EngineHP` | `string` | - | +| `EngineHP_to` | `string` | - | +| `EngineKW` | `string` | - | +| `EngineManufacturer` | `string` | - | +| `EngineModel` | `string` | - | +| `EntertainmentSystem` | `string` | - | +| `ErrorCode` | `string` | - | +| `ErrorText` | `string` | - | +| `ForwardCollisionWarning` | `string` | - | +| `FuelInjectionType` | `string` | - | +| `FuelTypePrimary` | `string` | - | +| `FuelTypeSecondary` | `string` | - | +| `GCWR` | `string` | - | +| `GCWR_to` | `string` | - | +| `GVWR` | `string` | - | +| `GVWR_to` | `string` | - | +| `KeylessIgnition` | `string` | - | +| `LaneCenteringAssistance` | `string` | - | +| `LaneDepartureWarning` | `string` | - | +| `LaneKeepSystem` | `string` | - | +| `LowerBeamHeadlampLightSource` | `string` | - | +| `Make` | `string` | - | +| `MakeID` | `string` | - | +| `Manufacturer` | `string` | - | +| `ManufacturerId` | `string` | - | +| `Model` | `string` | - | +| `ModelID` | `string` | - | +| `ModelYear` | `string` | - | +| `MotorcycleChassisType` | `string` | - | +| `MotorcycleSuspensionType` | `string` | - | +| `NCSABodyType` | `string` | - | +| `NCSAMake` | `string` | - | +| `NCSAMapExcApprovedBy` | `string` | - | +| `NCSAMapExcApprovedOn` | `string` | - | +| `NCSAMappingException` | `string` | - | +| `NCSAModel` | `string` | - | +| `NCSANote` | `string` | - | +| `NonLandUse` | `string` | - | +| `Note` | `string` | - | +| `OtherBusInfo` | `string` | - | +| `OtherEngineInfo` | `string` | - | +| `OtherMotorcycleInfo` | `string` | - | +| `OtherRestraintSystemInfo` | `string` | - | +| `OtherTrailerInfo` | `string` | - | +| `ParkAssist` | `string` | - | +| `PedestrianAutomaticEmergencyBraking` | `string` | - | +| `PlantCity` | `string` | - | +| `PlantCompanyName` | `string` | - | +| `PlantCountry` | `string` | - | +| `PlantState` | `string` | - | +| `PossibleValues` | `string` | - | +| `Pretensioner` | `string` | - | +| `RearAutomaticEmergencyBraking` | `string` | - | +| `RearCrossTrafficAlert` | `string` | - | +| `RearVisibilitySystem` | `string` | - | +| `SAEAutomationLevel` | `string` | - | +| `SAEAutomationLevel_to` | `string` | - | +| `SeatBeltsAll` | `string` | - | +| `SeatRows` | `string` | - | +| `Seats` | `string` | - | +| `SemiautomaticHeadlampBeamSwitching` | `string` | - | +| `Series` | `string` | - | +| `Series2` | `string` | - | +| `SteeringLocation` | `string` | - | +| `SuggestedVIN` | `string` | - | +| `TPMS` | `string` | - | +| `TopSpeedMPH` | `string` | - | +| `TrackWidth` | `string` | - | +| `TractionControl` | `string` | - | +| `TrailerBodyType` | `string` | - | +| `TrailerLength` | `string` | - | +| `TrailerType` | `string` | - | +| `TransmissionSpeeds` | `string` | - | +| `TransmissionStyle` | `string` | - | +| `Trim` | `string` | - | +| `Trim2` | `string` | - | +| `Turbo` | `string` | - | +| `VIN` | `string` | - | +| `ValveTrainDesign` | `string` | - | +| `VehicleDescriptor` | `string` | - | +| `VehicleType` | `string` | - | +| `WheelBaseLong` | `string` | - | +| `WheelBaseShort` | `string` | - | +| `WheelBaseType` | `string` | - | +| `WheelSizeFront` | `string` | - | +| `WheelSizeRear` | `string` | - | +| `Wheels` | `string` | - | +| `Windows` | `string` | - | + +#### Source + +[api/vpic/endpoints/DecodeVinValuesBatch.ts:90](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValuesBatch.ts#L90) + +## Functions + +### DecodeVinValuesBatch() + +#### DecodeVinValuesBatch(inputString, doFetch) + +> **DecodeVinValuesBatch**(`inputString`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesBatchResults`](DecodeVinValuesBatch.md#decodevinvaluesbatchresults)\>\> + +::: tip :bulb: More Information +See: [DecodeVinValuesBatch Documentation](/guide/vpic/endpoints/decode-vin-values-batch) +::: + +`DecodeVinValuesBatch` decodes a batch of Vehicle Identification Numbers (VINs) and returns +useful information about the vehicles in in a _flat format_. This means the endpoint will return +an array with multiple objects of results. Each object represents a VIN from the `inputString` +and the key:value pairs in the objects are variables and their values for each particular VIN. + +For this particular API you just have to provide a string of VINs, `inputString`, that are +separated by a `;`. You can also indicate the model year after the vin, preceded by a `,`. + +The `inputString` parameter should be in the following format: +- ex: `5UXWX7C5*BA, 2011; 5YJSA3DS*EF` +- no modelYear: `vin; vin; vin` +- with modelYear: `vin, modelYear; vin, modelYear; vin, modelYear` +- mix of with/without modelYear: `vin; vin, modelYear` +- _vin_ and _modelYear_ are placeholders for real values in these examples +- all spaces between `;` and `,` are used in these examples for readability and are optional +- _Max 50 VINs per batch_ + +Providing the modelYear in the input string allows for the decoding to specifically be done in +the current, or older (pre-1980), model year ranges. It is recommended to always provide +the model year if it is known at the time of decoding, but it is not required. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `inputString` | `string` | A string of Vehicle Identification Numbers (full or partial)
following the format listed in the description | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesBatchResults`](DecodeVinValuesBatch.md#decodevinvaluesbatchresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/DecodeVinValuesBatch.ts:43](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValuesBatch.ts#L43) + +#### DecodeVinValuesBatch(inputString, doFetch) + +> **DecodeVinValuesBatch**(`inputString`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `inputString` | `string` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/DecodeVinValuesBatch.ts:48](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValuesBatch.ts#L48) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValuesExtended.md b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValuesExtended.md new file mode 100644 index 00000000..13477182 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValuesExtended.md @@ -0,0 +1,310 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/DecodeVinValuesExtended + +# api/vpic/endpoints/DecodeVinValuesExtended + +## Contents + +- [Type Aliases](DecodeVinValuesExtended.md#type-aliases) + - [DecodeVinValuesExtendedResults](DecodeVinValuesExtended.md#decodevinvaluesextendedresults) +- [Functions](DecodeVinValuesExtended.md#functions) + - [DecodeVinValuesExtended()](DecodeVinValuesExtended.md#decodevinvaluesextended) + +## Type Aliases + +### DecodeVinValuesExtendedResults + +> **DecodeVinValuesExtendedResults**: `object` + +Single object found in the `Results` array of `DecodeVinValuesExtended` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `ABS` | `string` | - | +| `ActiveSafetySysNote` | `string` | - | +| `AdaptiveCruiseControl` | `string` | - | +| `AdaptiveDrivingBeam` | `string` | - | +| `AdaptiveHeadlights` | `string` | - | +| `AdditionalErrorText` | `string` | - | +| `AirBagLocCurtain` | `string` | - | +| `AirBagLocFront` | `string` | - | +| `AirBagLocKnee` | `string` | - | +| `AirBagLocSeatCushion` | `string` | - | +| `AirBagLocSide` | `string` | - | +| `AutoReverseSystem` | `string` | - | +| `AutomaticPedestrianAlertingSound` | `string` | - | +| `AxleConfiguration` | `string` | - | +| `Axles` | `string` | - | +| `BasePrice` | `string` | - | +| `BatteryA` | `string` | - | +| `BatteryA_to` | `string` | - | +| `BatteryCells` | `string` | - | +| `BatteryInfo` | `string` | - | +| `BatteryKWh` | `string` | - | +| `BatteryKWh_to` | `string` | - | +| `BatteryModules` | `string` | - | +| `BatteryPacks` | `string` | - | +| `BatteryType` | `string` | - | +| `BatteryV` | `string` | - | +| `BatteryV_to` | `string` | - | +| `BedLengthIN` | `string` | - | +| `BedType` | `string` | - | +| `BlindSpotIntervention` | `string` | - | +| `BlindSpotMon` | `string` | - | +| `BodyCabType` | `string` | - | +| `BodyClass` | `string` | - | +| `BrakeSystemDesc` | `string` | - | +| `BrakeSystemType` | `string` | - | +| `BusFloorConfigType` | `string` | - | +| `BusLength` | `string` | - | +| `BusType` | `string` | - | +| `CAN_AACN` | `string` | - | +| `CIB` | `string` | - | +| `CashForClunkers` | `string` | - | +| `ChargerLevel` | `string` | - | +| `ChargerPowerKW` | `string` | - | +| `CoolingType` | `string` | - | +| `CurbWeightLB` | `string` | - | +| `CustomMotorcycleType` | `string` | - | +| `DaytimeRunningLight` | `string` | - | +| `DestinationMarket` | `string` | - | +| `DisplacementCC` | `string` | - | +| `DisplacementCI` | `string` | - | +| `DisplacementL` | `string` | - | +| `Doors` | `string` | - | +| `DriveType` | `string` | - | +| `DriverAssist` | `string` | - | +| `DynamicBrakeSupport` | `string` | - | +| `EDR` | `string` | - | +| `ESC` | `string` | - | +| `EVDriveUnit` | `string` | - | +| `ElectrificationLevel` | `string` | - | +| `EngineConfiguration` | `string` | - | +| `EngineCycles` | `string` | - | +| `EngineCylinders` | `string` | - | +| `EngineHP` | `string` | - | +| `EngineHP_to` | `string` | - | +| `EngineKW` | `string` | - | +| `EngineManufacturer` | `string` | - | +| `EngineModel` | `string` | - | +| `EntertainmentSystem` | `string` | - | +| `ErrorCode` | `string` | - | +| `ErrorText` | `string` | - | +| `ForwardCollisionWarning` | `string` | - | +| `FuelInjectionType` | `string` | - | +| `FuelTypePrimary` | `string` | - | +| `FuelTypeSecondary` | `string` | - | +| `GCWR` | `string` | - | +| `GCWR_to` | `string` | - | +| `GVWR` | `string` | - | +| `GVWR_to` | `string` | - | +| `KeylessIgnition` | `string` | - | +| `LaneCenteringAssistance` | `string` | - | +| `LaneDepartureWarning` | `string` | - | +| `LaneKeepSystem` | `string` | - | +| `LowerBeamHeadlampLightSource` | `string` | - | +| `Make` | `string` | - | +| `MakeID` | `string` | - | +| `Manufacturer` | `string` | - | +| `ManufacturerId` | `string` | - | +| `Model` | `string` | - | +| `ModelID` | `string` | - | +| `ModelYear` | `string` | - | +| `MotorcycleChassisType` | `string` | - | +| `MotorcycleSuspensionType` | `string` | - | +| `NCSABodyType` | `string` | - | +| `NCSAMake` | `string` | - | +| `NCSAMapExcApprovedBy` | `string` | - | +| `NCSAMapExcApprovedOn` | `string` | - | +| `NCSAMappingException` | `string` | - | +| `NCSAModel` | `string` | - | +| `NCSANote` | `string` | - | +| `NonLandUse` | `string` | - | +| `Note` | `string` | - | +| `OtherBusInfo` | `string` | - | +| `OtherEngineInfo` | `string` | - | +| `OtherMotorcycleInfo` | `string` | - | +| `OtherRestraintSystemInfo` | `string` | - | +| `OtherTrailerInfo` | `string` | - | +| `ParkAssist` | `string` | - | +| `PedestrianAutomaticEmergencyBraking` | `string` | - | +| `PlantCity` | `string` | - | +| `PlantCompanyName` | `string` | - | +| `PlantCountry` | `string` | - | +| `PlantState` | `string` | - | +| `PossibleValues` | `string` | - | +| `Pretensioner` | `string` | - | +| `RearAutomaticEmergencyBraking` | `string` | - | +| `RearCrossTrafficAlert` | `string` | - | +| `RearVisibilitySystem` | `string` | - | +| `SAEAutomationLevel` | `string` | - | +| `SAEAutomationLevel_to` | `string` | - | +| `SeatBeltsAll` | `string` | - | +| `SeatRows` | `string` | - | +| `Seats` | `string` | - | +| `SemiautomaticHeadlampBeamSwitching` | `string` | - | +| `Series` | `string` | - | +| `Series2` | `string` | - | +| `SteeringLocation` | `string` | - | +| `SuggestedVIN` | `string` | - | +| `TPMS` | `string` | - | +| `TopSpeedMPH` | `string` | - | +| `TrackWidth` | `string` | - | +| `TractionControl` | `string` | - | +| `TrailerBodyType` | `string` | - | +| `TrailerLength` | `string` | - | +| `TrailerType` | `string` | - | +| `TransmissionSpeeds` | `string` | - | +| `TransmissionStyle` | `string` | - | +| `Trim` | `string` | - | +| `Trim2` | `string` | - | +| `Turbo` | `string` | - | +| `VIN` | `string` | - | +| `ValveTrainDesign` | `string` | - | +| `VehicleDescriptor` | `string` | - | +| `VehicleType` | `string` | - | +| `WheelBaseLong` | `string` | - | +| `WheelBaseShort` | `string` | - | +| `WheelBaseType` | `string` | - | +| `WheelSizeFront` | `string` | - | +| `WheelSizeRear` | `string` | - | +| `Wheels` | `string` | - | +| `Windows` | `string` | - | + +#### Source + +[api/vpic/endpoints/DecodeVinValuesExtended.ts:117](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts#L117) + +## Functions + +### DecodeVinValuesExtended() + +#### DecodeVinValuesExtended(vin) + +> **DecodeVinValuesExtended**(`vin`): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> + +::: tip :bulb: More Information +See: [DecodeVinValuesExtended Documentation](/guide/vpic/endpoints/decode-vin-values-extended) +::: + +`DecodeVinValuesExtended` decodes a Vehicle Identification Number (VIN) and returns useful +information about the vehicle in in a _flat format_. This means the endpoint will return an +array with a single object of results. Each key in the object is the name of a variable. + +This endpoint is similar to `DecodeVinValues` but returns additional information on variables +related to other NHTSA programs like +[NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc. + +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, but it is not required. + +This endpoint also supports partial VIN decoding (VINs that are less than 17 characters). + - Ex: "5UXWX7C5*BA" + - 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 + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `vin` | `string` | Vehicle Identification Number (full or partial) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/DecodeVinValuesExtended.ts:41](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts#L41) + +#### DecodeVinValuesExtended(vin, doFetch, _dummy) + +> **DecodeVinValuesExtended**(`vin`, `doFetch`, `_dummy`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `true` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> + +##### Source + +[api/vpic/endpoints/DecodeVinValuesExtended.ts:45](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts#L45) + +#### DecodeVinValuesExtended(vin, doFetch, _dummy) + +> **DecodeVinValuesExtended**(`vin`, `doFetch`, `_dummy`?): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `false` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/DecodeVinValuesExtended.ts:51](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts#L51) + +#### DecodeVinValuesExtended(vin, params, doFetch) + +> **DecodeVinValuesExtended**(`vin`, `params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params` | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/DecodeVinValuesExtended.ts:57](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts#L57) + +#### DecodeVinValuesExtended(vin, params, doFetch) + +> **DecodeVinValuesExtended**(`vin`, `params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params`? | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> + +##### Source + +[api/vpic/endpoints/DecodeVinValuesExtended.ts:63](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts#L63) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/DecodeWMI.md b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeWMI.md new file mode 100644 index 00000000..a028da1e --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeWMI.md @@ -0,0 +1,100 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/DecodeWMI + +# api/vpic/endpoints/DecodeWMI + +## Contents + +- [Type Aliases](DecodeWMI.md#type-aliases) + - [DecodeWMIResults](DecodeWMI.md#decodewmiresults) +- [Functions](DecodeWMI.md#functions) + - [DecodeWMI()](DecodeWMI.md#decodewmi) + +## Type Aliases + +### DecodeWMIResults + +> **DecodeWMIResults**: `object` + +Objects found in the `Results` array of `DecodeWMI` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `CommonName` | `string` | - | +| `CreatedOn` | `string` | - | +| `DateAvailableToPublic` | `string` | - | +| `Make` | `string` | - | +| `ManufacturerName` | `string` | - | +| `ParentCompanyName` | `string` | - | +| `URL` | `string` | - | +| `UpdatedOn` | `string` \| `null` | - | +| `VehicleType` | `string` | - | + +#### Source + +[api/vpic/endpoints/DecodeWMI.ts:76](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeWMI.ts#L76) + +## Functions + +### DecodeWMI() + +#### DecodeWMI(WMI, doFetch) + +> **DecodeWMI**(`WMI`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeWMIResults`](DecodeWMI.md#decodewmiresults)\>\> + +::: tip :bulb: More Information +See: [DecodeWMI Documentation](/guide/vpic/endpoints/decode-wmi) +::: + +`DecodeWMI` provides information on the World Manufacturer Identifier for a specific `WMI` code. + +`WMI` may be provided as either 3 characters representing VIN position 1-3 _or_ 6 characters +representing VIN positions 1-3 & 12-14. +- Examples: "JTD" "1T9131" + +A list of WMI codes can be found +[here](https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/World_Manufacturer_Identifier_(WMI)), +but keep in mind that not all of the listed WMIs are registered with NHTSA and therefore may not +be available in VPIC data sets. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `WMI` | `string` | World Manufacturer Identifier | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeWMIResults`](DecodeWMI.md#decodewmiresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` (default: `true`) + +##### Source + +[api/vpic/endpoints/DecodeWMI.ts:32](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeWMI.ts#L32) + +#### DecodeWMI(WMI, doFetch) + +> **DecodeWMI**(`WMI`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `WMI` | `string` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/DecodeWMI.ts:37](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeWMI.ts#L37) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetAllMakes.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetAllMakes.md new file mode 100644 index 00000000..72616f64 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetAllMakes.md @@ -0,0 +1,86 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetAllMakes + +# api/vpic/endpoints/GetAllMakes + +## Contents + +- [Type Aliases](GetAllMakes.md#type-aliases) + - [GetAllMakesResults](GetAllMakes.md#getallmakesresults) +- [Functions](GetAllMakes.md#functions) + - [GetAllMakes()](GetAllMakes.md#getallmakes) + +## Type Aliases + +### GetAllMakesResults + +> **GetAllMakesResults**: `object` + +Objects found in the `Results` array of `GetAllMakes` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Make_ID` | `number` | - | +| `Make_Name` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetAllMakes.ts:62](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts#L62) + +## Functions + +### GetAllMakes() + +#### GetAllMakes(doFetch) + +> **GetAllMakes**(`doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetAllMakesResults`](GetAllMakes.md#getallmakesresults)\>\> + +::: tip :bulb: More Information +See: [GetAllMakes Documentation](/guide/vpic/endpoints/get-all-makes) +::: + +`GetAllMakes` provides a list of all the Makes available in the vPIC Dataset. +Each object in the `Results` array represents the `Make_ID` and the `Make_Name` of +an individual vehicle Make. + +- FYI there are over 10,000 registered makes in the database! + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetAllMakesResults`](GetAllMakes.md#getallmakesresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` (default: `true`) + +##### Source + +[api/vpic/endpoints/GetAllMakes.ts:26](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts#L26) + +#### GetAllMakes(doFetch) + +> **GetAllMakes**(`doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetAllMakes.ts:28](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts#L28) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetAllManufacturers.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetAllManufacturers.md new file mode 100644 index 00000000..83bcb401 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetAllManufacturers.md @@ -0,0 +1,137 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetAllManufacturers + +# api/vpic/endpoints/GetAllManufacturers + +## Contents + +- [Type Aliases](GetAllManufacturers.md#type-aliases) + - [GetAllManufacturersResults](GetAllManufacturers.md#getallmanufacturersresults) +- [Functions](GetAllManufacturers.md#functions) + - [GetAllManufacturers()](GetAllManufacturers.md#getallmanufacturers) + +## Type Aliases + +### GetAllManufacturersResults + +> **GetAllManufacturersResults**: `object` + +Objects found in the `Results` array of `GetAllManufacturers` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Country` | `string` | - | +| `Mfr_CommonName` | `string` \| `null` | - | +| `Mfr_ID` | `number` | - | +| `Mfr_Name` | `string` | - | +| `VehicleTypes` | `object`[] | - | + +#### Source + +[api/vpic/endpoints/GetAllManufacturers.ts:111](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts#L111) + +## Functions + +### GetAllManufacturers() + +#### GetAllManufacturers(doFetch, _dummy) + +> **GetAllManufacturers**(`doFetch`?, `_dummy`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> + +::: tip :bulb: More Information +See: [GetAllManufacturers Documentation](/guide/vpic/endpoints/get-all-manufacturers) +::: + +`GetAllManufacturers` provides a list of all the Manufacturers available in the vPIC Dataset. + +`params.manufacturerType` is optional but allows the user to filter the list based on +manufacturer type. Types include 'Incomplete Vehicles', 'Completed Vehicle Manufacturer', +'Incomplete Vehicle Manufacturer', 'Intermediate Manufacturer', 'Final-Stage Manufacturer', +'Alterer', or any partial match of those strings. + +`params.page` is optional and used to specify (n)th page of results. Results are provided in +pages of 100 items. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | +| `_dummy`? | `undefined` | - | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetAllManufacturers.ts:33](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts#L33) + +#### GetAllManufacturers(doFetch, _dummy) + +> **GetAllManufacturers**(`doFetch`?, `_dummy`?): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `doFetch`? | `false` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetAllManufacturers.ts:38](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts#L38) + +#### GetAllManufacturers(params, doFetch) + +> **GetAllManufacturers**(`params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params` | `object` | +| `params.manufacturerType`? | `string` | +| `params.page`? | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetAllManufacturers.ts:43](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts#L43) + +#### GetAllManufacturers(params, doFetch) + +> **GetAllManufacturers**(`params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params`? | `object` | +| `params.manufacturerType`? | `string` | +| `params.page`? | `string` \| `number` | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> + +##### Source + +[api/vpic/endpoints/GetAllManufacturers.ts:51](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts#L51) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetCanadianVehicleSpecifications.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetCanadianVehicleSpecifications.md new file mode 100644 index 00000000..5d5c896e --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetCanadianVehicleSpecifications.md @@ -0,0 +1,108 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetCanadianVehicleSpecifications + +# api/vpic/endpoints/GetCanadianVehicleSpecifications + +## Contents + +- [Type Aliases](GetCanadianVehicleSpecifications.md#type-aliases) + - [GetCanadianVehicleSpecificationsResults](GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) +- [Functions](GetCanadianVehicleSpecifications.md#functions) + - [GetCanadianVehicleSpecifications()](GetCanadianVehicleSpecifications.md#getcanadianvehiclespecifications) + +## Type Aliases + +### GetCanadianVehicleSpecificationsResults + +> **GetCanadianVehicleSpecificationsResults**: `object` + +Objects found in the `Results` array of `GetCanadianVehicleSpecifications` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Specs` | `object`[] | - | + +#### Source + +[api/vpic/endpoints/GetCanadianVehicleSpecifications.ts:120](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetCanadianVehicleSpecifications.ts#L120) + +## Functions + +### GetCanadianVehicleSpecifications() + +#### GetCanadianVehicleSpecifications(params, doFetch) + +> **GetCanadianVehicleSpecifications**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetCanadianVehicleSpecificationsResults`](GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults)\>\> + +::: tip :bulb: More Information +See: [GetCanadianVehicleSpecifications Documentation](/guide/vpic/endpoints/get-canadian-vehicle-specifications) +::: + +`GetCanadianVehicleSpecifications` returns data from the Canadian Vehicle Specifications (CVS). +The CVS consists of a database of original vehicle dimensions, used primarily in +collision investigation and reconstruction, combined with a search engine. + +The CVS 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. + +`params.year` is the only required query parameter, all others are optional but will still be +included in the query string as blank values even if not provided by the user. +See below Note for more details. + +_NOTE:_ This endpoint does not like missing query keys and will return a 404 error if any of +them are omitted from the query string. Therefore, we must set default values to empty strings +for any query keys that are not provided by the user. This means keys not provided by user will +always show up as "something=" in the query string. `year` is the only key user must provide, +no default value is set for it so that an error will be thrown if not provided by user. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `params` | `object` | Object of Query Search names and values to append to the URL as a query string | +| `params.make`? | `string` | Vehicle's make, like "Honda", "Toyota", etc... | +| `params.model`? | `string` | Vehicle's model, like "Pilot", "Focus". Can also include
some other elements like Body Type, Engine Model/size, etc... | +| `params.units`? | `string` | "Metric" (default), or "US" for standard units | +| `params.year`? | `string` \| `number` | Model year of the vehicle - year >= 1971 | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetCanadianVehicleSpecificationsResults`](GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults)\>\> + +- Api +Response `object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetCanadianVehicleSpecifications.ts:45](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetCanadianVehicleSpecifications.ts#L45) + +#### GetCanadianVehicleSpecifications(params, doFetch) + +> **GetCanadianVehicleSpecifications**(`params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params` | `object` | +| `params.make`? | `string` | +| `params.model`? | `string` | +| `params.units`? | `string` | +| `params.year` | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetCanadianVehicleSpecifications.ts:55](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetCanadianVehicleSpecifications.ts#L55) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetEquipmentPlantCodes.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetEquipmentPlantCodes.md new file mode 100644 index 00000000..1cf1a211 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetEquipmentPlantCodes.md @@ -0,0 +1,133 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetEquipmentPlantCodes + +# api/vpic/endpoints/GetEquipmentPlantCodes + +## Contents + +- [Type Aliases](GetEquipmentPlantCodes.md#type-aliases) + - [GetEquipmentPlantCodesParams](GetEquipmentPlantCodes.md#getequipmentplantcodesparams) + - [GetEquipmentPlantCodesResults](GetEquipmentPlantCodes.md#getequipmentplantcodesresults) +- [Functions](GetEquipmentPlantCodes.md#functions) + - [GetEquipmentPlantCodes()](GetEquipmentPlantCodes.md#getequipmentplantcodes) + +## Type Aliases + +### GetEquipmentPlantCodesParams + +> **GetEquipmentPlantCodesParams**: `object` + +Query String Parameters for this endpoint + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `equipmentType` | `"1"` \| `"3"` \| `"13"` \| `"16"` \| `1` \| `3` \| `13` \| `16` | - | +| `reportType` | `"New"` \| `"Updated"` \| `"Closed"` \| `"All"` \| `"new"` \| `"updated"` \| `"closed"` \| `"all"` | - | +| `year` | `string` \| `number` | - | + +#### Source + +[api/vpic/endpoints/GetEquipmentPlantCodes.ts:105](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts#L105) + +*** + +### GetEquipmentPlantCodesResults + +> **GetEquipmentPlantCodesResults**: `object` + +Objects found in the `Results` array of `GetEquipmentPlantCodes` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Address` | `string` \| `null` | - | +| `City` | `string` \| `null` | - | +| `Country` | `string` | - | +| `DOTCode` | `string` | - | +| `Name` | `string` | - | +| `OldDotCode` | `string` | - | +| `PostalCode` | `string` \| `null` | - | +| `StateProvince` | `string` \| `null` | - | +| `Status` | `string` \| `null` | - | + +#### Source + +[api/vpic/endpoints/GetEquipmentPlantCodes.ts:122](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts#L122) + +## Functions + +### GetEquipmentPlantCodes() + +#### GetEquipmentPlantCodes(params, doFetch) + +> **GetEquipmentPlantCodes**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetEquipmentPlantCodesResults`](GetEquipmentPlantCodes.md#getequipmentplantcodesresults)\>\> + +::: tip :bulb: More Information +See: [GetEquipmentPlantCodes Documentation](/guide/vpic/endpoints/get-equipment-plant-codes) +::: + +`GetEquipmentPlantCodes` returns assigned Equipment Plant Codes. Can be filtered by Year, +Equipment Type and Report Type. + +ALL parameters are required and endpoint will return 404 if there are any undefined keys and/or +values in the query string. + +`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)) + +`params.year`: +- year >= 2016 +- NOTE: It seems API will still respond with years `< 2016 but api docs state only years >` = 2016 + are supported + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `params` | [`GetEquipmentPlantCodesParams`](GetEquipmentPlantCodes.md#getequipmentplantcodesparams) | Object of Query Search names and values to append to the URL as a query string | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetEquipmentPlantCodesResults`](GetEquipmentPlantCodes.md#getequipmentplantcodesresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetEquipmentPlantCodes.ts:47](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts#L47) + +#### GetEquipmentPlantCodes(params, doFetch) + +> **GetEquipmentPlantCodes**(`params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params` | [`GetEquipmentPlantCodesParams`](GetEquipmentPlantCodes.md#getequipmentplantcodesparams) | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetEquipmentPlantCodes.ts:52](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts#L52) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetMakeForManufacturer.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetMakeForManufacturer.md new file mode 100644 index 00000000..493f655a --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetMakeForManufacturer.md @@ -0,0 +1,93 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetMakeForManufacturer + +# api/vpic/endpoints/GetMakeForManufacturer + +## Contents + +- [Type Aliases](GetMakeForManufacturer.md#type-aliases) + - [GetMakeForManufacturerResults](GetMakeForManufacturer.md#getmakeformanufacturerresults) +- [Functions](GetMakeForManufacturer.md#functions) + - [GetMakeForManufacturer()](GetMakeForManufacturer.md#getmakeformanufacturer) + +## Type Aliases + +### GetMakeForManufacturerResults + +> **GetMakeForManufacturerResults**: `object` + +Objects found in the `Results` array of `GetMakeForManufacturer` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Make_ID` | `number` | - | +| `Make_Name` | `string` | - | +| `Mfr_Name` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetMakeForManufacturer.ts:77](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetMakeForManufacturer.ts#L77) + +## Functions + +### GetMakeForManufacturer() + +#### GetMakeForManufacturer(manufacturer, doFetch) + +> **GetMakeForManufacturer**(`manufacturer`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetMakeForManufacturerResults`](GetMakeForManufacturer.md#getmakeformanufacturerresults)\>\> + +::: tip :bulb: More Information +See: [GetMakeForManufacturer Documentation](/guide/vpic/endpoints/get-make-for-manufacturer) +::: + +`GetMakeForManufacturer` returns all the Makes in the vPIC dataset for a specified manufacturer +that is requested. Multiple results are returned in case of multiple matches. + +`manufacturer` name can be a partial name, or a full name for more specificity, e.g. "988", +"honda", "HONDA OF CANADA MFG., INC.", etc. + +- 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. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `manufacturer` | `string` \| `number` | Manufacturer Name or ID | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetMakeForManufacturerResults`](GetMakeForManufacturer.md#getmakeformanufacturerresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetMakeForManufacturer.ts:31](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetMakeForManufacturer.ts#L31) + +#### GetMakeForManufacturer(manufacturer, doFetch) + +> **GetMakeForManufacturer**(`manufacturer`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `manufacturer` | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetMakeForManufacturer.ts:36](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetMakeForManufacturer.ts#L36) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetMakesForManufacturerAndYear.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetMakesForManufacturerAndYear.md new file mode 100644 index 00000000..dc475e40 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetMakesForManufacturerAndYear.md @@ -0,0 +1,108 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetMakesForManufacturerAndYear + +# api/vpic/endpoints/GetMakesForManufacturerAndYear + +## Contents + +- [Type Aliases](GetMakesForManufacturerAndYear.md#type-aliases) + - [GetMakesForManufacturerAndYearResults](GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) +- [Functions](GetMakesForManufacturerAndYear.md#functions) + - [GetMakesForManufacturerAndYear()](GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyear) + +## Type Aliases + +### GetMakesForManufacturerAndYearResults + +> **GetMakesForManufacturerAndYearResults**: `object` + +Objects found in the `Results` array of `GetMakesForManufacturerAndYear` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `MakeId` | `number` | - | +| `MakeName` | `string` | - | +| `MfrId` | `number` | - | +| `MfrName` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetMakesForManufacturerAndYear.ts:105](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetMakesForManufacturerAndYear.ts#L105) + +## Functions + +### GetMakesForManufacturerAndYear() + +#### GetMakesForManufacturerAndYear(manufacturer, params, doFetch) + +> **GetMakesForManufacturerAndYear**(`manufacturer`, `params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetMakesForManufacturerAndYearResults`](GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults)\>\> + +::: tip :bulb: More Information +See: [GetMakesForManufacturerAndYear Documentation](/guide/vpic/endpoints/get-makes-for-manufacturer-and-year) +::: + +`GetMakesForManufacturerAndYear` returns all the Makes in the vPIC dataset for a specified +`manufacturer`, and whose "Year From" and "Year To" range cover the specified `year`. Multiple +results are returned in case of multiple matches. + +Both `manufacturer` and `params.year` are required. + +`manufacturer` name can be a partial name, or a full name for more specificity, e.g. "988", +"honda", "HONDA OF CANADA MFG., INC.", etc. + +- 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. + +`params.year` must be a number > 2016, years prior to 2016 are not supported according to the +NHTSA API. During testing it was found that the API still returns data for years prior to 2016. + +::: warning :exclamation: Required Parameters +Both `manufacturer` and `params.year` are required. + ::: + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `manufacturer` | `string` \| `number` | Manufacturer Name (string) or Manufacturer ID (number) | +| `params` | `object` | Object of Query Search names and values to append to the URL as a query string | +| `params.year` | `string` \| `number` | Model year of the vehicle - Number, >= 2016 | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetMakesForManufacturerAndYearResults`](GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults)\>\> + +- Api +Response `object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetMakesForManufacturerAndYear.ts:43](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetMakesForManufacturerAndYear.ts#L43) + +#### GetMakesForManufacturerAndYear(manufacturer, params, doFetch) + +> **GetMakesForManufacturerAndYear**(`manufacturer`, `params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `manufacturer` | `string` \| `number` | +| `params` | `object` | +| `params.year` | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetMakesForManufacturerAndYear.ts:49](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetMakesForManufacturerAndYear.ts#L49) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetMakesForVehicleType.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetMakesForVehicleType.md new file mode 100644 index 00000000..72558e58 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetMakesForVehicleType.md @@ -0,0 +1,90 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetMakesForVehicleType + +# api/vpic/endpoints/GetMakesForVehicleType + +## Contents + +- [Type Aliases](GetMakesForVehicleType.md#type-aliases) + - [GetMakesForVehicleTypeResults](GetMakesForVehicleType.md#getmakesforvehicletyperesults) +- [Functions](GetMakesForVehicleType.md#functions) + - [GetMakesForVehicleType()](GetMakesForVehicleType.md#getmakesforvehicletype) + +## Type Aliases + +### GetMakesForVehicleTypeResults + +> **GetMakesForVehicleTypeResults**: `object` + +Objects found in the `Results` array of `GetMakesForVehicleType` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `MakeId` | `number` | - | +| `MakeName` | `string` | - | +| `VehicleTypeId` | `number` | - | +| `VehicleTypeName` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetMakesForVehicleType.ts:73](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetMakesForVehicleType.ts#L73) + +## Functions + +### GetMakesForVehicleType() + +#### GetMakesForVehicleType(typeName, doFetch) + +> **GetMakesForVehicleType**(`typeName`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetMakesForVehicleTypeResults`](GetMakesForVehicleType.md#getmakesforvehicletyperesults)\>\> + +::: tip :bulb: More Information +See: [GetMakesForVehicleType Documentation](/guide/vpic/endpoints/get-makes-for-vehicle-type) +::: + +`GetMakesForVehicleType` 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. + +`typeName` can be a partial name, or a full name for more specificity, e.g., "Vehicle", "Moto", +"Low Speed Vehicle", etc. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `typeName` | `string` | A partial or full vehicle type name | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetMakesForVehicleTypeResults`](GetMakesForVehicleType.md#getmakesforvehicletyperesults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetMakesForVehicleType.ts:27](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetMakesForVehicleType.ts#L27) + +#### GetMakesForVehicleType(typeName, doFetch) + +> **GetMakesForVehicleType**(`typeName`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `typeName` | `string` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetMakesForVehicleType.ts:32](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetMakesForVehicleType.ts#L32) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetManufacturerDetails.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetManufacturerDetails.md new file mode 100644 index 00000000..a73d1962 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetManufacturerDetails.md @@ -0,0 +1,115 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetManufacturerDetails + +# api/vpic/endpoints/GetManufacturerDetails + +## Contents + +- [Type Aliases](GetManufacturerDetails.md#type-aliases) + - [GetManufacturerDetailsResults](GetManufacturerDetails.md#getmanufacturerdetailsresults) +- [Functions](GetManufacturerDetails.md#functions) + - [GetManufacturerDetails()](GetManufacturerDetails.md#getmanufacturerdetails) + +## Type Aliases + +### GetManufacturerDetailsResults + +> **GetManufacturerDetailsResults**: `object` + +Objects found in the `Results` array of `GetManufacturerDetails` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Address` | `string` \| `null` | - | +| `Address2` | `string` \| `null` | - | +| `City` | `string` \| `null` | - | +| `ContactEmail` | `string` \| `null` | - | +| `ContactFax` | `string` \| `null` | - | +| `ContactPhone` | `string` \| `null` | - | +| `Country` | `string` \| `null` | - | +| `DBAs` | `string` \| `null` | - | +| `EquipmentItems` | `unknown`[] | - | +| `LastUpdated` | `string` | - | +| `ManufacturerTypes` | `object`[] | - | +| `Mfr_CommonName` | `string` \| `null` | - | +| `Mfr_ID` | `number` \| `null` | - | +| `Mfr_Name` | `string` \| `null` | - | +| `OtherManufacturerDetails` | `string` \| `null` | - | +| `PostalCode` | `string` \| `null` | - | +| `PrimaryProduct` | `string` \| `null` | - | +| `PrincipalFirstName` | `string` \| `null` | - | +| `PrincipalLastName` | `string` \| `null` | - | +| `PrincipalPosition` | `string` \| `null` | - | +| `StateProvince` | `string` \| `null` | - | +| `SubmittedName` | `string` \| `null` | - | +| `SubmittedOn` | `string` | - | +| `SubmittedPosition` | `string` \| `null` | - | +| `VehicleTypes` | `object`[] | - | + +#### Source + +[api/vpic/endpoints/GetManufacturerDetails.ts:77](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetManufacturerDetails.ts#L77) + +## Functions + +### GetManufacturerDetails() + +#### GetManufacturerDetails(manufacturer, doFetch) + +> **GetManufacturerDetails**(`manufacturer`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetManufacturerDetailsResults`](GetManufacturerDetails.md#getmanufacturerdetailsresults)\>\> + +::: tip :bulb: More Information +See: [GetMakesForVehicleType Documentation](/guide/vpic/endpoints/get-makes-for-vehicle-type) +::: + +`GetManufacturerDetails` provides the details for a specific manufacturer that is requested. +Multiple results are returned in case of multiple matches. + +`manufacturer` name can be a partial name, or a full name for more specificity, e.g. "988", +"honda", "HONDA OF CANADA MFG., INC.", etc. + +- 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. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `manufacturer` | `string` \| `number` | Manufacturer Name or ID | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetManufacturerDetailsResults`](GetManufacturerDetails.md#getmanufacturerdetailsresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetManufacturerDetails.ts:31](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetManufacturerDetails.ts#L31) + +#### GetManufacturerDetails(manufacturer, doFetch) + +> **GetManufacturerDetails**(`manufacturer`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `manufacturer` | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetManufacturerDetails.ts:36](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetManufacturerDetails.ts#L36) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMake.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMake.md new file mode 100644 index 00000000..670dfc6c --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMake.md @@ -0,0 +1,92 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetModelsForMake + +# api/vpic/endpoints/GetModelsForMake + +## Contents + +- [Type Aliases](GetModelsForMake.md#type-aliases) + - [GetModelsForMakeResults](GetModelsForMake.md#getmodelsformakeresults) +- [Functions](GetModelsForMake.md#functions) + - [GetModelsForMake()](GetModelsForMake.md#getmodelsformake) + +## Type Aliases + +### GetModelsForMakeResults + +> **GetModelsForMakeResults**: `object` + +Objects found in the `Results` array of `GetModelsForMake` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Make_ID` | `number` | - | +| `Make_Name` | `string` | - | +| `Model_ID` | `number` | - | +| `Model_Name` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetModelsForMake.ts:71](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetModelsForMake.ts#L71) + +## Functions + +### GetModelsForMake() + +#### GetModelsForMake(makeName, doFetch) + +> **GetModelsForMake**(`makeName`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetModelsForMakeResults`](GetModelsForMake.md#getmodelsformakeresults)\>\> + +::: tip :bulb: More Information +See: [GetModelsForMake Documentation](/guide/vpic/endpoints/get-models-for-make) +::: + +`GetModelsForMake` 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. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `makeName` | `string` | Vehicle make name | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetModelsForMakeResults`](GetModelsForMake.md#getmodelsformakeresults)\>\> + +- Api Response object + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetModelsForMake.ts:28](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetModelsForMake.ts#L28) + +#### GetModelsForMake(makeName, doFetch) + +> **GetModelsForMake**(`makeName`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `makeName` | `string` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetModelsForMake.ts:33](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetModelsForMake.ts#L33) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeId.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeId.md new file mode 100644 index 00000000..599f536f --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeId.md @@ -0,0 +1,104 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetModelsForMakeId + +# api/vpic/endpoints/GetModelsForMakeId + +## Contents + +- [Type Aliases](GetModelsForMakeId.md#type-aliases) + - [GetModelsForMakeIdResults](GetModelsForMakeId.md#getmodelsformakeidresults) +- [Functions](GetModelsForMakeId.md#functions) + - [GetModelsForMakeId()](GetModelsForMakeId.md#getmodelsformakeid) + +## Type Aliases + +### GetModelsForMakeIdResults + +> **GetModelsForMakeIdResults**: `object` + +Objects found in the `Results` array of `GetModelsForMakeId` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Make_ID` | `number` | - | +| `Make_Name` | `string` | - | +| `Model_ID` | `number` | - | +| `Model_Name` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetModelsForMakeId.ts:87](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetModelsForMakeId.ts#L87) + +## Functions + +### GetModelsForMakeId() + +#### GetModelsForMakeId(makeId, doFetch) + +> **GetModelsForMakeId**(`makeId`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetModelsForMakeIdResults`](GetModelsForMakeId.md#getmodelsformakeidresults)\>\> + +::: tip :bulb: More Information +See: [GetModelsForMakeId Documentation](/guide/vpic/endpoints/get-models-for-make-id) +::: + +`GetModelsForMakeId` returns the Models in the vPIC dataset for a specified Make whose ID is +equal to the `makeID` in the vPIC Dataset. + +You can get `makeID`s via `MAKE_ID` key in Results objects of the following endpoints: +- `GetAllMakes` endpoint +- `GetMakeForManufacturer` endpoint +- `GetModelsForMake` endpoint +- `GetModelsForMakeYear` endpoint + +You can get `makeID`s via `MakeID` key in Results objects of the following endpoints: +- `DecodeVinValues` +- `DecodeVinValuesBatch` + +You can get `makeID`s via `ValueId` key in Results objects of the following endpoints. +One of the objects in the `Results` array will contain both `Variable: "Make"` and +`VariableId: 26`. The `ValueId` key in that same object is the `makeID` for use in this +endpoint. +- `DecodeVin` +- `DecodeVinExtended` + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `makeId` | `string` \| `number` | Make ID to search | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetModelsForMakeIdResults`](GetModelsForMakeId.md#getmodelsformakeidresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetModelsForMakeId.ts:41](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetModelsForMakeId.ts#L41) + +#### GetModelsForMakeId(makeId, doFetch) + +> **GetModelsForMakeId**(`makeId`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `makeId` | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetModelsForMakeId.ts:46](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetModelsForMakeId.ts#L46) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeIdYear.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeIdYear.md new file mode 100644 index 00000000..af45f707 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeIdYear.md @@ -0,0 +1,117 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetModelsForMakeIdYear + +# api/vpic/endpoints/GetModelsForMakeIdYear + +## Contents + +- [Type Aliases](GetModelsForMakeIdYear.md#type-aliases) + - [GetModelsForMakeIdYearResults](GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) +- [Functions](GetModelsForMakeIdYear.md#functions) + - [GetModelsForMakeIdYear()](GetModelsForMakeIdYear.md#getmodelsformakeidyear) + +## Type Aliases + +### GetModelsForMakeIdYearResults + +> **GetModelsForMakeIdYearResults**: `object` + +Objects found in the `Results` array of `GetModelsForMakeIdYear` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Make_ID` | `number` | - | +| `Make_Name` | `string` | - | +| `Model_ID` | `number` | - | +| `Model_Name` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetModelsForMakeIdYear.ts:152](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetModelsForMakeIdYear.ts#L152) + +## Functions + +### GetModelsForMakeIdYear() + +#### GetModelsForMakeIdYear(params, doFetch) + +> **GetModelsForMakeIdYear**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetModelsForMakeIdYearResults`](GetModelsForMakeIdYear.md#getmodelsformakeidyearresults)\>\> + +::: tip :bulb: More Information +See: [GetModelsForMakeIdYear Documentation](/guide/vpic/endpoints/get-models-for-make-id-year) +::: + +`GetModelsForMakeIdYear` 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 an integer and is **required**. + +A minimum of one of the following are also **required** (or a combination of both): +- `params.modelYear` year you want to search for (years >= 1995 are supported according to NHTSA + docs) +- `params.vehicleType` can be a partial name, or a full name for more specificity, e.g., + "Vehicle", "Moto", "Low Speed Vehicle", etc. + +You can get `makeID`s via `MAKE_ID` key in Results objects of the following endpoints: +- `GetAllMakes` endpoint +- `GetMakeForManufacturer` endpoint +- `GetModelsForMake` endpoint +- `GetModelsForMakeYear` endpoint + +You can get `makeID`s via `MakeID` key in Results objects of the following endpoints: +- `DecodeVinValues` +- `DecodeVinValuesBatch` + +You can get `makeID`s via `ValueId` key in Results objects of the following endpoints. +One of the objects in the `Results` array will contain both `Variable: "Make"` and +`VariableId: 26`. The `ValueId` key in that same object is the `makeID` for use in this +endpoint. +- `DecodeVin` +- `DecodeVinExtended` + +_NOTE:_ This endpoint requires special handling of the params object, such that none of the +params are used in the query string and are instead used as part of the URL path for the +endpoint. To account for this, we pass the params object to the `createUrl` function as the +`path`, after encoding the params object key:values into a url path string. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `params` | `Object` | Object of Query Search names and values to append to the URL as a query string | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetModelsForMakeIdYearResults`](GetModelsForMakeIdYear.md#getmodelsformakeidyearresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetModelsForMakeIdYear.ts:61](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetModelsForMakeIdYear.ts#L61) + +#### GetModelsForMakeIdYear(params, doFetch) + +> **GetModelsForMakeIdYear**(`params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params` | `Object` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetModelsForMakeIdYear.ts:71](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetModelsForMakeIdYear.ts#L71) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeYear.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeYear.md new file mode 100644 index 00000000..2f48cecf --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeYear.md @@ -0,0 +1,101 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetModelsForMakeYear + +# api/vpic/endpoints/GetModelsForMakeYear + +## Contents + +- [Type Aliases](GetModelsForMakeYear.md#type-aliases) + - [GetModelsForMakeYearResults](GetModelsForMakeYear.md#getmodelsformakeyearresults) +- [Functions](GetModelsForMakeYear.md#functions) + - [GetModelsForMakeYear()](GetModelsForMakeYear.md#getmodelsformakeyear) + +## Type Aliases + +### GetModelsForMakeYearResults + +> **GetModelsForMakeYearResults**: `object` + +Objects found in the `Results` array of `GetModelsForMakeYear` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Make_ID` | `number` | - | +| `Make_Name` | `string` | - | +| `Model_ID` | `number` | - | +| `Model_Name` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetModelsForMakeYear.ts:133](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetModelsForMakeYear.ts#L133) + +## Functions + +### GetModelsForMakeYear() + +#### GetModelsForMakeYear(params, doFetch) + +> **GetModelsForMakeYear**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetModelsForMakeYearResults`](GetModelsForMakeYear.md#getmodelsformakeyearresults)\>\> + +::: tip :bulb: More Information +See: [GetModelsForMakeYear Documentation](/guide/vpic/endpoints/get-models-for-make-year) +::: + +`GetModelsForMakeYear` 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 also **required** (or a combination of both): +- `params.modelYear` year you want to search for (years >= 1995 are supported according to NHTSA + docs) +- `params.vehicleType` can be a partial name, or a full name for more specificity, e.g., + "Vehicle", "Moto", "Low Speed Vehicle", etc. + +_NOTE:_ This endpoint requires special handling of the params object, such that none of the +params are used in the query string and are instead used as part of the URL path for the +endpoint. To account for this, we pass the params object to the `createUrl` function as the +`path`, after encoding the params object key:values into a url path string. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `params` | `Object` | Object of Query Search names and values to append to the URL as a query string | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetModelsForMakeYearResults`](GetModelsForMakeYear.md#getmodelsformakeyearresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetModelsForMakeYear.ts:47](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetModelsForMakeYear.ts#L47) + +#### GetModelsForMakeYear(params, doFetch) + +> **GetModelsForMakeYear**(`params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params` | `Object` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetModelsForMakeYear.ts:57](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetModelsForMakeYear.ts#L57) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetParts.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetParts.md new file mode 100644 index 00000000..0375beae --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetParts.md @@ -0,0 +1,167 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetParts + +# api/vpic/endpoints/GetParts + +## Contents + +- [Type Aliases](GetParts.md#type-aliases) + - [GetPartsResults](GetParts.md#getpartsresults) +- [Functions](GetParts.md#functions) + - [GetParts()](GetParts.md#getparts) + +## Type Aliases + +### GetPartsResults + +> **GetPartsResults**: `object` + +Objects found in the `Results` array of `GetParts` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `CoverLetterURL` | `string` | - | +| `LetterDate` | `string` | - | +| `ManufacturerId` | `number` | - | +| `ManufacturerName` | `string` | - | +| `ModelYearFrom` | `number` \| `null` | - | +| `ModelYearTo` | `number` \| `null` | - | +| `Name` | `string` | - | +| `Type` | `string` | - | +| `URL` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetParts.ts:143](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetParts.ts#L143) + +## Functions + +### GetParts() + +#### GetParts(doFetch, _dummy) + +> **GetParts**(`doFetch`?, `_dummy`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> + +::: tip :bulb: More Information +See: [GetParts Documentation](/guide/vpic/endpoints/get-parts) +::: + +`GetParts` 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. + +`params.manufacturer`: +- (optional) if supplied value is a number - method will do exact match on Manufacturer's Id +- if supplied value 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 name can be a partial name, or a full name for more specificity, e.g., "988", + "HONDA", "HONDA OF CANADA MFG., INC.", etc. + +`params.type`: +- (optional) number, 565 (Vehicle Identification Number Guidance, based on 49 CFR Part 565) + or 566 (Manufacturer Identification โ€“ Reporting Requirements based on 49 CFR Part 566) + +`params.fromDate`: +- (optional) ORG's Letter Date should be on or after this date + +`params.toDate`: +- (optional) ORG's Letter Date should be on or before this date + +`params.page`: + - (optional) number, 1 (default) first 1000 records, 2 - next 1000 records, etc + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | +| `_dummy`? | `undefined` | - | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetParts.ts:60](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetParts.ts#L60) + +#### GetParts(doFetch, _dummy) + +> **GetParts**(`doFetch`?, `_dummy`?): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `doFetch`? | `false` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetParts.ts:65](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetParts.ts#L65) + +#### GetParts(params, doFetch) + +> **GetParts**(`params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params` | `object` | +| `params.fromDate`? | `string` | +| `params.manufacturer`? | `string` \| `number` | +| `params.page`? | `string` \| `number` | +| `params.toDate`? | `string` | +| `params.type`? | `565` \| `566` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetParts.ts:67](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetParts.ts#L67) + +#### GetParts(params, doFetch) + +> **GetParts**(`params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params`? | `object` | +| `params.fromDate`? | `string` | +| `params.manufacturer`? | `string` \| `number` | +| `params.page`? | `string` \| `number` | +| `params.toDate`? | `string` | +| `params.type`? | `565` \| `566` | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> + +##### Source + +[api/vpic/endpoints/GetParts.ts:78](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetParts.ts#L78) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleTypesForMake.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleTypesForMake.md new file mode 100644 index 00000000..5a9fd713 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleTypesForMake.md @@ -0,0 +1,90 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetVehicleTypesForMake + +# api/vpic/endpoints/GetVehicleTypesForMake + +## Contents + +- [Type Aliases](GetVehicleTypesForMake.md#type-aliases) + - [GetVehicleTypesForMakeResults](GetVehicleTypesForMake.md#getvehicletypesformakeresults) +- [Functions](GetVehicleTypesForMake.md#functions) + - [GetVehicleTypesForMake()](GetVehicleTypesForMake.md#getvehicletypesformake) + +## Type Aliases + +### GetVehicleTypesForMakeResults + +> **GetVehicleTypesForMakeResults**: `object` + +Objects found in the `Results` array of `GetVehicleTypesForMake` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `MakeId` | `number` | - | +| `MakeName` | `string` | - | +| `VehicleTypeId` | `number` | - | +| `VehicleTypeName` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetVehicleTypesForMake.ts:73](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMake.ts#L73) + +## Functions + +### GetVehicleTypesForMake() + +#### GetVehicleTypesForMake(makeName, doFetch) + +> **GetVehicleTypesForMake**(`makeName`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetVehicleTypesForMakeResults`](GetVehicleTypesForMake.md#getvehicletypesformakeresults)\>\> + +::: tip :bulb: More Information +See: [GetVehicleTypesForMake Documentation](/guide/vpic/endpoints/get-vehicle-types-for-make) +::: + +`GetVehicleTypesForMake` 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. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `makeName` | `string` | Name of the vehicle make to search | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetVehicleTypesForMakeResults`](GetVehicleTypesForMake.md#getvehicletypesformakeresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetVehicleTypesForMake.ts:27](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMake.ts#L27) + +#### GetVehicleTypesForMake(makeName, doFetch) + +> **GetVehicleTypesForMake**(`makeName`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `makeName` | `string` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetVehicleTypesForMake.ts:32](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMake.ts#L32) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleTypesForMakeId.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleTypesForMakeId.md new file mode 100644 index 00000000..e1a7d975 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleTypesForMakeId.md @@ -0,0 +1,102 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetVehicleTypesForMakeId + +# api/vpic/endpoints/GetVehicleTypesForMakeId + +## Contents + +- [Type Aliases](GetVehicleTypesForMakeId.md#type-aliases) + - [GetVehicleTypesForMakeIdResults](GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) +- [Functions](GetVehicleTypesForMakeId.md#functions) + - [GetVehicleTypesForMakeId()](GetVehicleTypesForMakeId.md#getvehicletypesformakeid) + +## Type Aliases + +### GetVehicleTypesForMakeIdResults + +> **GetVehicleTypesForMakeIdResults**: `object` + +Objects found in the `Results` array of `GetVehicleTypesForMakeId` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `VehicleTypeId` | `number` | - | +| `VehicleTypeName` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetVehicleTypesForMakeId.ts:87](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMakeId.ts#L87) + +## Functions + +### GetVehicleTypesForMakeId() + +#### GetVehicleTypesForMakeId(makeId, doFetch) + +> **GetVehicleTypesForMakeId**(`makeId`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetVehicleTypesForMakeIdResults`](GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults)\>\> + +::: tip :bulb: More Information +See: [GetVehicleTypesForMakeId Documentation](/guide/vpic/endpoints/get-vehicle-types-for-make-id) +::: + +`GetVehicleTypesForMakeId` returns the Models in the vPIC dataset for a specified Make +whose ID is equal to the `makeID` in the vPIC Dataset. + +You can get `makeID`s via `MAKE_ID` key in Results objects of the following endpoints: +- `GetAllMakes` endpoint +- `GetMakeForManufacturer` endpoint +- `GetModelsForMake` endpoint +- `GetModelsForMakeYear` endpoint + +You can get `makeID`s via `MakeID` key in Results objects of the following endpoints: +- `DecodeVinValues` +- `DecodeVinValuesBatch` + +You can get `makeID`s via `ValueId` key in Results objects of the following endpoints. +One of the objects in the `Results` array will contain both `Variable: "Make"` and +`VariableId: 26`. The `ValueId` key in that same object is the `makeID` for use in this +endpoint. +- `DecodeVin` +- `DecodeVinExtended` + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `makeId` | `string` \| `number` | Make ID to search | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetVehicleTypesForMakeIdResults`](GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetVehicleTypesForMakeId.ts:41](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMakeId.ts#L41) + +#### GetVehicleTypesForMakeId(makeId, doFetch) + +> **GetVehicleTypesForMakeId**(`makeId`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `makeId` | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetVehicleTypesForMakeId.ts:46](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMakeId.ts#L46) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleVariableList.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleVariableList.md new file mode 100644 index 00000000..1c3e30da --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleVariableList.md @@ -0,0 +1,86 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetVehicleVariableList + +# api/vpic/endpoints/GetVehicleVariableList + +## Contents + +- [Type Aliases](GetVehicleVariableList.md#type-aliases) + - [GetVehicleVariableListResults](GetVehicleVariableList.md#getvehiclevariablelistresults) +- [Functions](GetVehicleVariableList.md#functions) + - [GetVehicleVariableList()](GetVehicleVariableList.md#getvehiclevariablelist) + +## Type Aliases + +### GetVehicleVariableListResults + +> **GetVehicleVariableListResults**: `object` + +Objects found in the `Results` array of `GetVehicleVariableList` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `DataType` | `"string"` \| `"int"` \| `"decimal"` \| `"lookup"` | - | +| `Description` | `string` | - | +| `GroupName` | `string` \| `null` | - | +| `ID` | `number` | - | +| `Name` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetVehicleVariableList.ts:60](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts#L60) + +## Functions + +### GetVehicleVariableList() + +#### GetVehicleVariableList(doFetch) + +> **GetVehicleVariableList**(`doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetVehicleVariableListResults`](GetVehicleVariableList.md#getvehiclevariablelistresults)\>\> + +::: tip :bulb: More Information +See: [GetVehicleVariableList Documentation](/guide/vpic/endpoints/get-vehicle-variable-list) +::: + +`GetVehicleVariableList` 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. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetVehicleVariableListResults`](GetVehicleVariableList.md#getvehiclevariablelistresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetVehicleVariableList.ts:23](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts#L23) + +#### GetVehicleVariableList(doFetch) + +> **GetVehicleVariableList**(`doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetVehicleVariableList.ts:27](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts#L27) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleVariableValuesList.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleVariableValuesList.md new file mode 100644 index 00000000..5f5aaf0a --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleVariableValuesList.md @@ -0,0 +1,91 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetVehicleVariableValuesList + +# api/vpic/endpoints/GetVehicleVariableValuesList + +## Contents + +- [Type Aliases](GetVehicleVariableValuesList.md#type-aliases) + - [GetVehicleVariableValuesListResults](GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) +- [Functions](GetVehicleVariableValuesList.md#functions) + - [GetVehicleVariableValuesList()](GetVehicleVariableValuesList.md#getvehiclevariablevalueslist) + +## Type Aliases + +### GetVehicleVariableValuesListResults + +> **GetVehicleVariableValuesListResults**: `object` + +Objects found in the `Results` array of `GetVehicleVariableValuesList` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `ElementName` | `string` | - | +| `Id` | `number` | - | +| `Name` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetVehicleVariableValuesList.ts:75](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetVehicleVariableValuesList.ts#L75) + +## Functions + +### GetVehicleVariableValuesList() + +#### GetVehicleVariableValuesList(variableValue, doFetch) + +> **GetVehicleVariableValuesList**(`variableValue`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetVehicleVariableValuesListResults`](GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults)\>\> + +::: tip :bulb: More Information +See: [GetVehicleVariableValuesList Documentation](/guide/vpic/endpoints/get-vehicle-variable-values-list) +::: + +`GetVehicleVariableValuesList` provides a list of all the accepted values for a given variable +that are stored in the vPIC dataset. + +If `variableValue` is a string, it must use full name, not just part of it, e.g., +"Battery Type", not "Battery" + +`variableValue` can be also be a number, which is the ID of the variable, e.g., 1, 2, 3, etc. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `variableValue` | `string` \| `number` | The variable you want to get a values list of | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetVehicleVariableValuesListResults`](GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetVehicleVariableValuesList.ts:29](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetVehicleVariableValuesList.ts#L29) + +#### GetVehicleVariableValuesList(variableValue, doFetch) + +> **GetVehicleVariableValuesList**(`variableValue`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `variableValue` | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetVehicleVariableValuesList.ts:34](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetVehicleVariableValuesList.ts#L34) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/GetWMIsForManufacturer.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetWMIsForManufacturer.md new file mode 100644 index 00000000..33f8b4ae --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetWMIsForManufacturer.md @@ -0,0 +1,111 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetWMIsForManufacturer + +# api/vpic/endpoints/GetWMIsForManufacturer + +## Contents + +- [Type Aliases](GetWMIsForManufacturer.md#type-aliases) + - [GetWMIsForManufacturerResults](GetWMIsForManufacturer.md#getwmisformanufacturerresults) +- [Functions](GetWMIsForManufacturer.md#functions) + - [GetWMIsForManufacturer()](GetWMIsForManufacturer.md#getwmisformanufacturer) + +## Type Aliases + +### GetWMIsForManufacturerResults + +> **GetWMIsForManufacturerResults**: `object` + +Objects found in the `Results` array of `GetWMIsForManufacturer` endpoint response. + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `Country` | `string` \| `null` | - | +| `CreatedOn` | `string` | - | +| `DateAvailableToPublic` | `string` | - | +| `Id` | `number` | - | +| `Name` | `string` | - | +| `UpdatedOn` | `string` | - | +| `VehicleType` | `string` | - | +| `WMI` | `string` | - | + +#### Source + +[api/vpic/endpoints/GetWMIsForManufacturer.ts:123](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetWMIsForManufacturer.ts#L123) + +## Functions + +### GetWMIsForManufacturer() + +#### GetWMIsForManufacturer(params, doFetch) + +> **GetWMIsForManufacturer**(`params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetWMIsForManufacturerResults`](GetWMIsForManufacturer.md#getwmisformanufacturerresults)\>\> + +::: tip :bulb: More Information +See: [GetWMIsForManufacturer Documentation](/guide/vpic/endpoints/get-wmis-for-manufacturer) +::: + +`GetWMIsForManufacturer` provides information on the World Manufacturer Identifier (WMI) for a +specified `manufacturer`. Only WMIs registered in vPICList are displayed. Multiple results are +returned in case of multiple matches. + +Both `manufacturer` and `vehicleType` are optional but at least one must be provided. + +`manufacturer` can be a partial name, or a full name for more specificity, or WMI ID number, + e.g., "Merc", "Mercedes Benz", 987, etc. +- If `manufacturer` is a number - method will do exact match on Manufacturer's Id +- If `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) + +`vehicleType` can be a string or number, e.g., "car", 1, etc. +- If `vehicleType` is a number - method will do exact match on VehicleType's Id +- If `vehicleType` is a string - it will look for VehicleType whose name is LIKE the provided + name (it accepts a partial VehicleType name as an input). + +_NOTE_: For this endpoint, `manufacturer` is actually part of the path string, not a query param. +We include `manufacturer` in params as it's easier to type the function args using the +'AtLeastOne' type if they are placed in the same object (params). This can cause confusion as +it's not consistent with other endpoint methods where path string is the first arg, and the query +params are the second arg. + +##### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `params`? | [`AtLeastOne`](../../../utils/types.md#atleastonet-r)\<`object`\> | Object of Query Search names and values to append to the URL as a query string | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetWMIsForManufacturerResults`](GetWMIsForManufacturer.md#getwmisformanufacturerresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[api/vpic/endpoints/GetWMIsForManufacturer.ts:48](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetWMIsForManufacturer.ts#L48) + +#### GetWMIsForManufacturer(params, doFetch) + +> **GetWMIsForManufacturer**(`params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params` | [`AtLeastOne`](../../../utils/types.md#atleastonet-r)\<`object`\> | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[api/vpic/endpoints/GetWMIsForManufacturer.ts:56](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetWMIsForManufacturer.ts#L56) diff --git a/apps/docs/src/typedoc/api/vpic/endpoints/types.md b/apps/docs/src/typedoc/api/vpic/endpoints/types.md new file mode 100644 index 00000000..1f416dde --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/endpoints/types.md @@ -0,0 +1,148 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/types + +# api/vpic/endpoints/types + +## Contents + +- [References](types.md#references) + - [DecodeVinExtendedResults](types.md#decodevinextendedresults) + - [DecodeVinExtendedVariable](types.md#decodevinextendedvariable) + - [DecodeVinResults](types.md#decodevinresults) + - [DecodeVinValuesBatchResults](types.md#decodevinvaluesbatchresults) + - [DecodeVinValuesExtendedResults](types.md#decodevinvaluesextendedresults) + - [DecodeVinValuesResults](types.md#decodevinvaluesresults) + - [DecodeVinVariable](types.md#decodevinvariable) + - [DecodeWMIResults](types.md#decodewmiresults) + - [GetAllMakesResults](types.md#getallmakesresults) + - [GetAllManufacturersResults](types.md#getallmanufacturersresults) + - [GetCanadianVehicleSpecificationsResults](types.md#getcanadianvehiclespecificationsresults) + - [GetEquipmentPlantCodesParams](types.md#getequipmentplantcodesparams) + - [GetEquipmentPlantCodesResults](types.md#getequipmentplantcodesresults) + - [GetMakeForManufacturerResults](types.md#getmakeformanufacturerresults) + - [GetMakesForManufacturerAndYearResults](types.md#getmakesformanufacturerandyearresults) + - [GetMakesForVehicleTypeResults](types.md#getmakesforvehicletyperesults) + - [GetManufacturerDetailsResults](types.md#getmanufacturerdetailsresults) + - [GetModelsForMakeIdResults](types.md#getmodelsformakeidresults) + - [GetModelsForMakeIdYearResults](types.md#getmodelsformakeidyearresults) + - [GetModelsForMakeResults](types.md#getmodelsformakeresults) + - [GetModelsForMakeYearResults](types.md#getmodelsformakeyearresults) + - [GetPartsResults](types.md#getpartsresults) + - [GetVehicleTypesForMakeIdResults](types.md#getvehicletypesformakeidresults) + - [GetVehicleTypesForMakeResults](types.md#getvehicletypesformakeresults) + - [GetVehicleVariableListResults](types.md#getvehiclevariablelistresults) + - [GetVehicleVariableValuesListResults](types.md#getvehiclevariablevalueslistresults) + - [GetWMIsForManufacturerResults](types.md#getwmisformanufacturerresults) + +## References + +### DecodeVinExtendedResults + +Re-exports [DecodeVinExtendedResults](DecodeVinExtended.md#decodevinextendedresults) + +### DecodeVinExtendedVariable + +Re-exports [DecodeVinExtendedVariable](DecodeVinExtended.md#decodevinextendedvariable) + +### DecodeVinResults + +Re-exports [DecodeVinResults](DecodeVin.md#decodevinresults) + +### DecodeVinValuesBatchResults + +Re-exports [DecodeVinValuesBatchResults](DecodeVinValuesBatch.md#decodevinvaluesbatchresults) + +### DecodeVinValuesExtendedResults + +Re-exports [DecodeVinValuesExtendedResults](DecodeVinValuesExtended.md#decodevinvaluesextendedresults) + +### DecodeVinValuesResults + +Re-exports [DecodeVinValuesResults](DecodeVinValues.md#decodevinvaluesresults) + +### DecodeVinVariable + +Re-exports [DecodeVinVariable](DecodeVin.md#decodevinvariable) + +### DecodeWMIResults + +Re-exports [DecodeWMIResults](DecodeWMI.md#decodewmiresults) + +### GetAllMakesResults + +Re-exports [GetAllMakesResults](GetAllMakes.md#getallmakesresults) + +### GetAllManufacturersResults + +Re-exports [GetAllManufacturersResults](GetAllManufacturers.md#getallmanufacturersresults) + +### GetCanadianVehicleSpecificationsResults + +Re-exports [GetCanadianVehicleSpecificationsResults](GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) + +### GetEquipmentPlantCodesParams + +Re-exports [GetEquipmentPlantCodesParams](GetEquipmentPlantCodes.md#getequipmentplantcodesparams) + +### GetEquipmentPlantCodesResults + +Re-exports [GetEquipmentPlantCodesResults](GetEquipmentPlantCodes.md#getequipmentplantcodesresults) + +### GetMakeForManufacturerResults + +Re-exports [GetMakeForManufacturerResults](GetMakeForManufacturer.md#getmakeformanufacturerresults) + +### GetMakesForManufacturerAndYearResults + +Re-exports [GetMakesForManufacturerAndYearResults](GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) + +### GetMakesForVehicleTypeResults + +Re-exports [GetMakesForVehicleTypeResults](GetMakesForVehicleType.md#getmakesforvehicletyperesults) + +### GetManufacturerDetailsResults + +Re-exports [GetManufacturerDetailsResults](GetManufacturerDetails.md#getmanufacturerdetailsresults) + +### GetModelsForMakeIdResults + +Re-exports [GetModelsForMakeIdResults](GetModelsForMakeId.md#getmodelsformakeidresults) + +### GetModelsForMakeIdYearResults + +Re-exports [GetModelsForMakeIdYearResults](GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) + +### GetModelsForMakeResults + +Re-exports [GetModelsForMakeResults](GetModelsForMake.md#getmodelsformakeresults) + +### GetModelsForMakeYearResults + +Re-exports [GetModelsForMakeYearResults](GetModelsForMakeYear.md#getmodelsformakeyearresults) + +### GetPartsResults + +Re-exports [GetPartsResults](GetParts.md#getpartsresults) + +### GetVehicleTypesForMakeIdResults + +Re-exports [GetVehicleTypesForMakeIdResults](GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) + +### GetVehicleTypesForMakeResults + +Re-exports [GetVehicleTypesForMakeResults](GetVehicleTypesForMake.md#getvehicletypesformakeresults) + +### GetVehicleVariableListResults + +Re-exports [GetVehicleVariableListResults](GetVehicleVariableList.md#getvehiclevariablelistresults) + +### GetVehicleVariableValuesListResults + +Re-exports [GetVehicleVariableValuesListResults](GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) + +### GetWMIsForManufacturerResults + +Re-exports [GetWMIsForManufacturerResults](GetWMIsForManufacturer.md#getwmisformanufacturerresults) diff --git a/apps/docs/src/typedoc/api/vpic/types.md b/apps/docs/src/typedoc/api/vpic/types.md new file mode 100644 index 00000000..cd5878d0 --- /dev/null +++ b/apps/docs/src/typedoc/api/vpic/types.md @@ -0,0 +1,148 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/vpic/types + +# api/vpic/types + +## Contents + +- [References](types.md#references) + - [DecodeVinExtendedResults](types.md#decodevinextendedresults) + - [DecodeVinExtendedVariable](types.md#decodevinextendedvariable) + - [DecodeVinResults](types.md#decodevinresults) + - [DecodeVinValuesBatchResults](types.md#decodevinvaluesbatchresults) + - [DecodeVinValuesExtendedResults](types.md#decodevinvaluesextendedresults) + - [DecodeVinValuesResults](types.md#decodevinvaluesresults) + - [DecodeVinVariable](types.md#decodevinvariable) + - [DecodeWMIResults](types.md#decodewmiresults) + - [GetAllMakesResults](types.md#getallmakesresults) + - [GetAllManufacturersResults](types.md#getallmanufacturersresults) + - [GetCanadianVehicleSpecificationsResults](types.md#getcanadianvehiclespecificationsresults) + - [GetEquipmentPlantCodesParams](types.md#getequipmentplantcodesparams) + - [GetEquipmentPlantCodesResults](types.md#getequipmentplantcodesresults) + - [GetMakeForManufacturerResults](types.md#getmakeformanufacturerresults) + - [GetMakesForManufacturerAndYearResults](types.md#getmakesformanufacturerandyearresults) + - [GetMakesForVehicleTypeResults](types.md#getmakesforvehicletyperesults) + - [GetManufacturerDetailsResults](types.md#getmanufacturerdetailsresults) + - [GetModelsForMakeIdResults](types.md#getmodelsformakeidresults) + - [GetModelsForMakeIdYearResults](types.md#getmodelsformakeidyearresults) + - [GetModelsForMakeResults](types.md#getmodelsformakeresults) + - [GetModelsForMakeYearResults](types.md#getmodelsformakeyearresults) + - [GetPartsResults](types.md#getpartsresults) + - [GetVehicleTypesForMakeIdResults](types.md#getvehicletypesformakeidresults) + - [GetVehicleTypesForMakeResults](types.md#getvehicletypesformakeresults) + - [GetVehicleVariableListResults](types.md#getvehiclevariablelistresults) + - [GetVehicleVariableValuesListResults](types.md#getvehiclevariablevalueslistresults) + - [GetWMIsForManufacturerResults](types.md#getwmisformanufacturerresults) + +## References + +### DecodeVinExtendedResults + +Re-exports [DecodeVinExtendedResults](endpoints/DecodeVinExtended.md#decodevinextendedresults) + +### DecodeVinExtendedVariable + +Re-exports [DecodeVinExtendedVariable](endpoints/DecodeVinExtended.md#decodevinextendedvariable) + +### DecodeVinResults + +Re-exports [DecodeVinResults](endpoints/DecodeVin.md#decodevinresults) + +### DecodeVinValuesBatchResults + +Re-exports [DecodeVinValuesBatchResults](endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatchresults) + +### DecodeVinValuesExtendedResults + +Re-exports [DecodeVinValuesExtendedResults](endpoints/DecodeVinValuesExtended.md#decodevinvaluesextendedresults) + +### DecodeVinValuesResults + +Re-exports [DecodeVinValuesResults](endpoints/DecodeVinValues.md#decodevinvaluesresults) + +### DecodeVinVariable + +Re-exports [DecodeVinVariable](endpoints/DecodeVin.md#decodevinvariable) + +### DecodeWMIResults + +Re-exports [DecodeWMIResults](endpoints/DecodeWMI.md#decodewmiresults) + +### GetAllMakesResults + +Re-exports [GetAllMakesResults](endpoints/GetAllMakes.md#getallmakesresults) + +### GetAllManufacturersResults + +Re-exports [GetAllManufacturersResults](endpoints/GetAllManufacturers.md#getallmanufacturersresults) + +### GetCanadianVehicleSpecificationsResults + +Re-exports [GetCanadianVehicleSpecificationsResults](endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) + +### GetEquipmentPlantCodesParams + +Re-exports [GetEquipmentPlantCodesParams](endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesparams) + +### GetEquipmentPlantCodesResults + +Re-exports [GetEquipmentPlantCodesResults](endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesresults) + +### GetMakeForManufacturerResults + +Re-exports [GetMakeForManufacturerResults](endpoints/GetMakeForManufacturer.md#getmakeformanufacturerresults) + +### GetMakesForManufacturerAndYearResults + +Re-exports [GetMakesForManufacturerAndYearResults](endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) + +### GetMakesForVehicleTypeResults + +Re-exports [GetMakesForVehicleTypeResults](endpoints/GetMakesForVehicleType.md#getmakesforvehicletyperesults) + +### GetManufacturerDetailsResults + +Re-exports [GetManufacturerDetailsResults](endpoints/GetManufacturerDetails.md#getmanufacturerdetailsresults) + +### GetModelsForMakeIdResults + +Re-exports [GetModelsForMakeIdResults](endpoints/GetModelsForMakeId.md#getmodelsformakeidresults) + +### GetModelsForMakeIdYearResults + +Re-exports [GetModelsForMakeIdYearResults](endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) + +### GetModelsForMakeResults + +Re-exports [GetModelsForMakeResults](endpoints/GetModelsForMake.md#getmodelsformakeresults) + +### GetModelsForMakeYearResults + +Re-exports [GetModelsForMakeYearResults](endpoints/GetModelsForMakeYear.md#getmodelsformakeyearresults) + +### GetPartsResults + +Re-exports [GetPartsResults](endpoints/GetParts.md#getpartsresults) + +### GetVehicleTypesForMakeIdResults + +Re-exports [GetVehicleTypesForMakeIdResults](endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) + +### GetVehicleTypesForMakeResults + +Re-exports [GetVehicleTypesForMakeResults](endpoints/GetVehicleTypesForMake.md#getvehicletypesformakeresults) + +### GetVehicleVariableListResults + +Re-exports [GetVehicleVariableListResults](endpoints/GetVehicleVariableList.md#getvehiclevariablelistresults) + +### GetVehicleVariableValuesListResults + +Re-exports [GetVehicleVariableValuesListResults](endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) + +### GetWMIsForManufacturerResults + +Re-exports [GetWMIsForManufacturerResults](endpoints/GetWMIsForManufacturer.md#getwmisformanufacturerresults) diff --git a/apps/docs/src/typedoc/constants.md b/apps/docs/src/typedoc/constants.md new file mode 100644 index 00000000..f76216bb --- /dev/null +++ b/apps/docs/src/typedoc/constants.md @@ -0,0 +1,72 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](modules.md) / constants + +# constants + +## Contents + +- [Variables](constants.md#variables) + - [NHTSA\_API\_URL](constants.md#nhtsa-api-url) + - [NHTSA\_BASE\_URL](constants.md#nhtsa-base-url) + - [NHTSA\_DEFAULT\_API\_TYPE](constants.md#nhtsa-default-api-type) + - [NHTSA\_RESPONSE\_FORMAT](constants.md#nhtsa-response-format) + - [NHTSA\_VPIC\_URL](constants.md#nhtsa-vpic-url) + +## Variables + +### NHTSA\_API\_URL + +> **`const`** **NHTSA\_API\_URL**: `"https://api.nhtsa.gov"` = `'https://api.nhtsa.gov'` + +NHTSA API (recalls, complaints, etc.) + +#### Source + +[constants.ts:12](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/constants.ts#L12) + +*** + +### NHTSA\_BASE\_URL + +> **`const`** **NHTSA\_BASE\_URL**: `"https://vpic.nhtsa.dot.gov/api/vehicles"` = `'https://vpic.nhtsa.dot.gov/api/vehicles'` + +Deprecated since v4.0.0 - has been renamed to NHTSA_VPIC_URL + +#### Source + +[constants.ts:15](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/constants.ts#L15) + +*** + +### NHTSA\_DEFAULT\_API\_TYPE + +> **`const`** **NHTSA\_DEFAULT\_API\_TYPE**: `"vpic"` = `'vpic'` + +#### Source + +[constants.ts:6](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/constants.ts#L6) + +*** + +### NHTSA\_RESPONSE\_FORMAT + +> **`const`** **NHTSA\_RESPONSE\_FORMAT**: `"json"` = `'json'` + +#### Source + +[constants.ts:7](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/constants.ts#L7) + +*** + +### NHTSA\_VPIC\_URL + +> **`const`** **NHTSA\_VPIC\_URL**: `"https://vpic.nhtsa.dot.gov/api/vehicles"` = `'https://vpic.nhtsa.dot.gov/api/vehicles'` + +VPIC Vehicles API (vin decoding) + +#### Source + +[constants.ts:10](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/constants.ts#L10) diff --git a/apps/docs/src/typedoc/exports.md b/apps/docs/src/typedoc/exports.md new file mode 100644 index 00000000..e248a645 --- /dev/null +++ b/apps/docs/src/typedoc/exports.md @@ -0,0 +1,369 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](modules.md) / exports + +# exports + +## Contents + +- [Exported NHTSA API Functions](exports.md#exported-nhtsa-api-functions) + - [DecodeVin](exports.md#decodevin) + - [DecodeVinExtended](exports.md#decodevinextended) + - [DecodeVinValues](exports.md#decodevinvalues) + - [DecodeVinValuesBatch](exports.md#decodevinvaluesbatch) + - [DecodeVinValuesExtended](exports.md#decodevinvaluesextended) + - [DecodeWMI](exports.md#decodewmi) + - [GetAllMakes](exports.md#getallmakes) + - [GetAllManufacturers](exports.md#getallmanufacturers) + - [GetCanadianVehicleSpecifications](exports.md#getcanadianvehiclespecifications) + - [GetEquipmentPlantCodes](exports.md#getequipmentplantcodes) + - [GetMakeForManufacturer](exports.md#getmakeformanufacturer) + - [GetMakesForManufacturerAndYear](exports.md#getmakesformanufacturerandyear) + - [GetMakesForVehicleType](exports.md#getmakesforvehicletype) + - [GetManufacturerDetails](exports.md#getmanufacturerdetails) + - [GetModelsForMake](exports.md#getmodelsformake) + - [GetModelsForMakeId](exports.md#getmodelsformakeid) + - [GetModelsForMakeIdYear](exports.md#getmodelsformakeidyear) + - [GetModelsForMakeYear](exports.md#getmodelsformakeyear) + - [GetParts](exports.md#getparts) + - [GetVehicleTypesForMake](exports.md#getvehicletypesformake) + - [GetVehicleTypesForMakeId](exports.md#getvehicletypesformakeid) + - [GetVehicleVariableList](exports.md#getvehiclevariablelist) + - [GetVehicleVariableValuesList](exports.md#getvehiclevariablevalueslist) + - [GetWMIsForManufacturer](exports.md#getwmisformanufacturer) + - [safetyRatings](exports.md#safetyratings) + - [useNHTSA](exports.md#usenhtsa) +- [Exported Types](exports.md#exported-types) + - [DecodeVinExtendedResults](exports.md#decodevinextendedresults) + - [DecodeVinExtendedVariable](exports.md#decodevinextendedvariable) + - [DecodeVinResults](exports.md#decodevinresults) + - [DecodeVinValuesBatchResults](exports.md#decodevinvaluesbatchresults) + - [DecodeVinValuesExtendedResults](exports.md#decodevinvaluesextendedresults) + - [DecodeVinValuesResults](exports.md#decodevinvaluesresults) + - [DecodeVinVariable](exports.md#decodevinvariable) + - [DecodeWMIResults](exports.md#decodewmiresults) + - [GetAllMakesResults](exports.md#getallmakesresults) + - [GetAllManufacturersResults](exports.md#getallmanufacturersresults) + - [GetCanadianVehicleSpecificationsResults](exports.md#getcanadianvehiclespecificationsresults) + - [GetEquipmentPlantCodesParams](exports.md#getequipmentplantcodesparams) + - [GetEquipmentPlantCodesResults](exports.md#getequipmentplantcodesresults) + - [GetMakeForManufacturerResults](exports.md#getmakeformanufacturerresults) + - [GetMakesForManufacturerAndYearResults](exports.md#getmakesformanufacturerandyearresults) + - [GetMakesForVehicleTypeResults](exports.md#getmakesforvehicletyperesults) + - [GetManufacturerDetailsResults](exports.md#getmanufacturerdetailsresults) + - [GetModelsForMakeIdResults](exports.md#getmodelsformakeidresults) + - [GetModelsForMakeIdYearResults](exports.md#getmodelsformakeidyearresults) + - [GetModelsForMakeResults](exports.md#getmodelsformakeresults) + - [GetModelsForMakeYearResults](exports.md#getmodelsformakeyearresults) + - [GetPartsResults](exports.md#getpartsresults) + - [GetVehicleTypesForMakeIdResults](exports.md#getvehicletypesformakeidresults) + - [GetVehicleTypesForMakeResults](exports.md#getvehicletypesformakeresults) + - [GetVehicleVariableListResults](exports.md#getvehiclevariablelistresults) + - [GetVehicleVariableValuesListResults](exports.md#getvehiclevariablevalueslistresults) + - [GetWMIsForManufacturerResults](exports.md#getwmisformanufacturerresults) + - [NhtsaResponse](exports.md#nhtsaresponse) + - [SafetyRatingsOptions](exports.md#safetyratingsoptions) + - [SafetyRatingsOptionsBase](exports.md#safetyratingsoptionsbase) + - [SafetyRatingsOptionsEmpty](exports.md#safetyratingsoptionsempty) + - [SafetyRatingsOptionsMake](exports.md#safetyratingsoptionsmake) + - [SafetyRatingsOptionsModel](exports.md#safetyratingsoptionsmodel) + - [SafetyRatingsOptionsModelYear](exports.md#safetyratingsoptionsmodelyear) + - [SafetyRatingsOptionsVehicleId](exports.md#safetyratingsoptionsvehicleid) + - [SafetyRatingsResponseByOptions](exports.md#safetyratingsresponsebyoptions) + - [SafetyRatingsResponseByVariant](exports.md#safetyratingsresponsebyvariant) + - [SafetyRatingsResultsByOptions](exports.md#safetyratingsresultsbyoptions) + - [SafetyRatingsResultsByVariant](exports.md#safetyratingsresultsbyvariant) + - [SafetyRatingsResultsData](exports.md#safetyratingsresultsdata) + - [SafetyRatingsResultsVariants](exports.md#safetyratingsresultsvariants) +- [Exported Utility Functions](exports.md#exported-utility-functions) + - [createQueryString](exports.md#createquerystring) + - [encodeQueryStringParams](exports.md#encodequerystringparams) + - [isValidVin](exports.md#isvalidvin) + +## Exported NHTSA API Functions + +### DecodeVin + +Re-exports [DecodeVin](api/vpic/endpoints/DecodeVin.md#decodevin) + +### DecodeVinExtended + +Re-exports [DecodeVinExtended](api/vpic/endpoints/DecodeVinExtended.md#decodevinextended) + +### DecodeVinValues + +Re-exports [DecodeVinValues](api/vpic/endpoints/DecodeVinValues.md#decodevinvalues) + +### DecodeVinValuesBatch + +Re-exports [DecodeVinValuesBatch](api/vpic/endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatch) + +### DecodeVinValuesExtended + +Re-exports [DecodeVinValuesExtended](api/vpic/endpoints/DecodeVinValuesExtended.md#decodevinvaluesextended) + +### DecodeWMI + +Re-exports [DecodeWMI](api/vpic/endpoints/DecodeWMI.md#decodewmi) + +### GetAllMakes + +Re-exports [GetAllMakes](api/vpic/endpoints/GetAllMakes.md#getallmakes) + +### GetAllManufacturers + +Re-exports [GetAllManufacturers](api/vpic/endpoints/GetAllManufacturers.md#getallmanufacturers) + +### GetCanadianVehicleSpecifications + +Re-exports [GetCanadianVehicleSpecifications](api/vpic/endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecifications) + +### GetEquipmentPlantCodes + +Re-exports [GetEquipmentPlantCodes](api/vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodes) + +### GetMakeForManufacturer + +Re-exports [GetMakeForManufacturer](api/vpic/endpoints/GetMakeForManufacturer.md#getmakeformanufacturer) + +### GetMakesForManufacturerAndYear + +Re-exports [GetMakesForManufacturerAndYear](api/vpic/endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyear) + +### GetMakesForVehicleType + +Re-exports [GetMakesForVehicleType](api/vpic/endpoints/GetMakesForVehicleType.md#getmakesforvehicletype) + +### GetManufacturerDetails + +Re-exports [GetManufacturerDetails](api/vpic/endpoints/GetManufacturerDetails.md#getmanufacturerdetails) + +### GetModelsForMake + +Re-exports [GetModelsForMake](api/vpic/endpoints/GetModelsForMake.md#getmodelsformake) + +### GetModelsForMakeId + +Re-exports [GetModelsForMakeId](api/vpic/endpoints/GetModelsForMakeId.md#getmodelsformakeid) + +### GetModelsForMakeIdYear + +Re-exports [GetModelsForMakeIdYear](api/vpic/endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyear) + +### GetModelsForMakeYear + +Re-exports [GetModelsForMakeYear](api/vpic/endpoints/GetModelsForMakeYear.md#getmodelsformakeyear) + +### GetParts + +Re-exports [GetParts](api/vpic/endpoints/GetParts.md#getparts) + +### GetVehicleTypesForMake + +Re-exports [GetVehicleTypesForMake](api/vpic/endpoints/GetVehicleTypesForMake.md#getvehicletypesformake) + +### GetVehicleTypesForMakeId + +Re-exports [GetVehicleTypesForMakeId](api/vpic/endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeid) + +### GetVehicleVariableList + +Re-exports [GetVehicleVariableList](api/vpic/endpoints/GetVehicleVariableList.md#getvehiclevariablelist) + +### GetVehicleVariableValuesList + +Re-exports [GetVehicleVariableValuesList](api/vpic/endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslist) + +### GetWMIsForManufacturer + +Re-exports [GetWMIsForManufacturer](api/vpic/endpoints/GetWMIsForManufacturer.md#getwmisformanufacturer) + +### safetyRatings + +Re-exports [safetyRatings](api/safetyRatings.md#safetyratings) + +### useNHTSA + +Re-exports [useNHTSA](api/useNHTSA.md#usenhtsa) + +## Exported Types + +### DecodeVinExtendedResults + +Re-exports [DecodeVinExtendedResults](api/vpic/endpoints/DecodeVinExtended.md#decodevinextendedresults) + +### DecodeVinExtendedVariable + +Re-exports [DecodeVinExtendedVariable](api/vpic/endpoints/DecodeVinExtended.md#decodevinextendedvariable) + +### DecodeVinResults + +Re-exports [DecodeVinResults](api/vpic/endpoints/DecodeVin.md#decodevinresults) + +### DecodeVinValuesBatchResults + +Re-exports [DecodeVinValuesBatchResults](api/vpic/endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatchresults) + +### DecodeVinValuesExtendedResults + +Re-exports [DecodeVinValuesExtendedResults](api/vpic/endpoints/DecodeVinValuesExtended.md#decodevinvaluesextendedresults) + +### DecodeVinValuesResults + +Re-exports [DecodeVinValuesResults](api/vpic/endpoints/DecodeVinValues.md#decodevinvaluesresults) + +### DecodeVinVariable + +Re-exports [DecodeVinVariable](api/vpic/endpoints/DecodeVin.md#decodevinvariable) + +### DecodeWMIResults + +Re-exports [DecodeWMIResults](api/vpic/endpoints/DecodeWMI.md#decodewmiresults) + +### GetAllMakesResults + +Re-exports [GetAllMakesResults](api/vpic/endpoints/GetAllMakes.md#getallmakesresults) + +### GetAllManufacturersResults + +Re-exports [GetAllManufacturersResults](api/vpic/endpoints/GetAllManufacturers.md#getallmanufacturersresults) + +### GetCanadianVehicleSpecificationsResults + +Re-exports [GetCanadianVehicleSpecificationsResults](api/vpic/endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) + +### GetEquipmentPlantCodesParams + +Re-exports [GetEquipmentPlantCodesParams](api/vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesparams) + +### GetEquipmentPlantCodesResults + +Re-exports [GetEquipmentPlantCodesResults](api/vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesresults) + +### GetMakeForManufacturerResults + +Re-exports [GetMakeForManufacturerResults](api/vpic/endpoints/GetMakeForManufacturer.md#getmakeformanufacturerresults) + +### GetMakesForManufacturerAndYearResults + +Re-exports [GetMakesForManufacturerAndYearResults](api/vpic/endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) + +### GetMakesForVehicleTypeResults + +Re-exports [GetMakesForVehicleTypeResults](api/vpic/endpoints/GetMakesForVehicleType.md#getmakesforvehicletyperesults) + +### GetManufacturerDetailsResults + +Re-exports [GetManufacturerDetailsResults](api/vpic/endpoints/GetManufacturerDetails.md#getmanufacturerdetailsresults) + +### GetModelsForMakeIdResults + +Re-exports [GetModelsForMakeIdResults](api/vpic/endpoints/GetModelsForMakeId.md#getmodelsformakeidresults) + +### GetModelsForMakeIdYearResults + +Re-exports [GetModelsForMakeIdYearResults](api/vpic/endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) + +### GetModelsForMakeResults + +Re-exports [GetModelsForMakeResults](api/vpic/endpoints/GetModelsForMake.md#getmodelsformakeresults) + +### GetModelsForMakeYearResults + +Re-exports [GetModelsForMakeYearResults](api/vpic/endpoints/GetModelsForMakeYear.md#getmodelsformakeyearresults) + +### GetPartsResults + +Re-exports [GetPartsResults](api/vpic/endpoints/GetParts.md#getpartsresults) + +### GetVehicleTypesForMakeIdResults + +Re-exports [GetVehicleTypesForMakeIdResults](api/vpic/endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) + +### GetVehicleTypesForMakeResults + +Re-exports [GetVehicleTypesForMakeResults](api/vpic/endpoints/GetVehicleTypesForMake.md#getvehicletypesformakeresults) + +### GetVehicleVariableListResults + +Re-exports [GetVehicleVariableListResults](api/vpic/endpoints/GetVehicleVariableList.md#getvehiclevariablelistresults) + +### GetVehicleVariableValuesListResults + +Re-exports [GetVehicleVariableValuesListResults](api/vpic/endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) + +### GetWMIsForManufacturerResults + +Re-exports [GetWMIsForManufacturerResults](api/vpic/endpoints/GetWMIsForManufacturer.md#getwmisformanufacturerresults) + +### NhtsaResponse + +Re-exports [NhtsaResponse](api/types.md#nhtsaresponseresultstype-apitype) + +### SafetyRatingsOptions + +Re-exports [SafetyRatingsOptions](api/safetyRatings.md#safetyratingsoptions) + +### SafetyRatingsOptionsBase + +Re-exports [SafetyRatingsOptionsBase](api/safetyRatings.md#safetyratingsoptionsbase) + +### SafetyRatingsOptionsEmpty + +Re-exports [SafetyRatingsOptionsEmpty](api/safetyRatings.md#safetyratingsoptionsempty) + +### SafetyRatingsOptionsMake + +Re-exports [SafetyRatingsOptionsMake](api/safetyRatings.md#safetyratingsoptionsmake) + +### SafetyRatingsOptionsModel + +Re-exports [SafetyRatingsOptionsModel](api/safetyRatings.md#safetyratingsoptionsmodel) + +### SafetyRatingsOptionsModelYear + +Re-exports [SafetyRatingsOptionsModelYear](api/safetyRatings.md#safetyratingsoptionsmodelyear) + +### SafetyRatingsOptionsVehicleId + +Re-exports [SafetyRatingsOptionsVehicleId](api/safetyRatings.md#safetyratingsoptionsvehicleid) + +### SafetyRatingsResponseByOptions + +Re-exports [SafetyRatingsResponseByOptions](api/safetyRatings.md#safetyratingsresponsebyoptionsoptions) + +### SafetyRatingsResponseByVariant + +Re-exports [SafetyRatingsResponseByVariant](api/safetyRatings.md#safetyratingsresponsebyvariantvariant) + +### SafetyRatingsResultsByOptions + +Re-exports [SafetyRatingsResultsByOptions](api/safetyRatings.md#safetyratingsresultsbyoptionsoptions) + +### SafetyRatingsResultsByVariant + +Re-exports [SafetyRatingsResultsByVariant](api/safetyRatings.md#safetyratingsresultsbyvariantvariant) + +### SafetyRatingsResultsData + +Re-exports [SafetyRatingsResultsData](api/safetyRatings.md#safetyratingsresultsdata) + +### SafetyRatingsResultsVariants + +Re-exports [SafetyRatingsResultsVariants](api/safetyRatings.md#safetyratingsresultsvariants) + +## Exported Utility Functions + +### createQueryString + +Re-exports [createQueryString](utils/queryString.md#createquerystring) + +### encodeQueryStringParams + +Re-exports [encodeQueryStringParams](utils/queryString.md#encodequerystringparams) + +### isValidVin + +Re-exports [isValidVin](utils/isValidVin.md#isvalidvin) diff --git a/apps/docs/src/typedoc/index.md b/apps/docs/src/typedoc/index.md index f76a1147..98ea92fd 100644 --- a/apps/docs/src/typedoc/index.md +++ b/apps/docs/src/typedoc/index.md @@ -1,4 +1,6 @@ -@shaggytools/nhtsa-api-wrapper / [Exports](modules.md) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( Readme \| [API](modules.md) ) + +*** ::: tip :bulb: Auto-generated By TypeDoc from package source code ::: diff --git a/apps/docs/src/typedoc/modules.md b/apps/docs/src/typedoc/modules.md index a80f47e9..530bc29c 100644 --- a/apps/docs/src/typedoc/modules.md +++ b/apps/docs/src/typedoc/modules.md @@ -1,61 +1,83 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](index.md) / Exports +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) + +*** # @shaggytools/nhtsa-api-wrapper - v3.0.4 -## Table of contents - -### API Modules - -- [api](modules/api.md) -- [api/useNHTSA](modules/api_useNHTSA.md) - -### API Endpoints Modules - -- [api/endpoints](modules/api_endpoints.md) -- [api/endpoints/DecodeVin](modules/api_endpoints_DecodeVin.md) -- [api/endpoints/DecodeVinExtended](modules/api_endpoints_DecodeVinExtended.md) -- [api/endpoints/DecodeVinValues](modules/api_endpoints_DecodeVinValues.md) -- [api/endpoints/DecodeVinValuesBatch](modules/api_endpoints_DecodeVinValuesBatch.md) -- [api/endpoints/DecodeVinValuesExtended](modules/api_endpoints_DecodeVinValuesExtended.md) -- [api/endpoints/DecodeWMI](modules/api_endpoints_DecodeWMI.md) -- [api/endpoints/GetAllMakes](modules/api_endpoints_GetAllMakes.md) -- [api/endpoints/GetAllManufacturers](modules/api_endpoints_GetAllManufacturers.md) -- [api/endpoints/GetCanadianVehicleSpecifications](modules/api_endpoints_GetCanadianVehicleSpecifications.md) -- [api/endpoints/GetEquipmentPlantCodes](modules/api_endpoints_GetEquipmentPlantCodes.md) -- [api/endpoints/GetMakeForManufacturer](modules/api_endpoints_GetMakeForManufacturer.md) -- [api/endpoints/GetMakesForManufacturerAndYear](modules/api_endpoints_GetMakesForManufacturerAndYear.md) -- [api/endpoints/GetMakesForVehicleType](modules/api_endpoints_GetMakesForVehicleType.md) -- [api/endpoints/GetManufacturerDetails](modules/api_endpoints_GetManufacturerDetails.md) -- [api/endpoints/GetModelsForMake](modules/api_endpoints_GetModelsForMake.md) -- [api/endpoints/GetModelsForMakeId](modules/api_endpoints_GetModelsForMakeId.md) -- [api/endpoints/GetModelsForMakeIdYear](modules/api_endpoints_GetModelsForMakeIdYear.md) -- [api/endpoints/GetModelsForMakeYear](modules/api_endpoints_GetModelsForMakeYear.md) -- [api/endpoints/GetParts](modules/api_endpoints_GetParts.md) -- [api/endpoints/GetVehicleTypesForMake](modules/api_endpoints_GetVehicleTypesForMake.md) -- [api/endpoints/GetVehicleTypesForMakeId](modules/api_endpoints_GetVehicleTypesForMakeId.md) -- [api/endpoints/GetVehicleVariableList](modules/api_endpoints_GetVehicleVariableList.md) -- [api/endpoints/GetVehicleVariableValuesList](modules/api_endpoints_GetVehicleVariableValuesList.md) -- [api/endpoints/GetWMIsForManufacturer](modules/api_endpoints_GetWMIsForManufacturer.md) - -### Other Modules - -- [constants](modules/constants.md) -- [global](modules/global.md) -- [index](modules/index.md) -- [vite-env](modules/vite_env.md) - -### Types Modules - -- [api/endpoints/types](modules/api_endpoints_types.md) -- [api/types](modules/api_types.md) -- [types](modules/types.md) -- [utils/types](modules/utils_types.md) - -### Utility Functions Modules - -- [utils](modules/utils.md) -- [utils/argHandler](modules/utils_argHandler.md) -- [utils/errorHandler](modules/utils_errorHandler.md) -- [utils/getTypeof](modules/utils_getTypeof.md) -- [utils/isValidVin](modules/utils_isValidVin.md) -- [utils/queryString](modules/utils_queryString.md) +## API + +| Module | Description | +| :------ | :------ | +| [api](api.md) | - | +| [api/useNHTSA](api/useNHTSA.md) | - | + +## API - Safety Ratings + +| Module | Description | +| :------ | :------ | +| [api/safetyRatings](api/safetyRatings.md) | - | + +## API - VPIC (VIN Decoding) + +| Module | Description | +| :------ | :------ | +| [api/vpic](api/vpic.md) | - | +| [api/vpic/endpoints](api/vpic/endpoints.md) | - | +| [api/vpic/endpoints/DecodeVin](api/vpic/endpoints/DecodeVin.md) | - | +| [api/vpic/endpoints/DecodeVinExtended](api/vpic/endpoints/DecodeVinExtended.md) | - | +| [api/vpic/endpoints/DecodeVinValues](api/vpic/endpoints/DecodeVinValues.md) | - | +| [api/vpic/endpoints/DecodeVinValuesBatch](api/vpic/endpoints/DecodeVinValuesBatch.md) | - | +| [api/vpic/endpoints/DecodeVinValuesExtended](api/vpic/endpoints/DecodeVinValuesExtended.md) | - | +| [api/vpic/endpoints/DecodeWMI](api/vpic/endpoints/DecodeWMI.md) | - | +| [api/vpic/endpoints/GetAllMakes](api/vpic/endpoints/GetAllMakes.md) | - | +| [api/vpic/endpoints/GetAllManufacturers](api/vpic/endpoints/GetAllManufacturers.md) | - | +| [api/vpic/endpoints/GetCanadianVehicleSpecifications](api/vpic/endpoints/GetCanadianVehicleSpecifications.md) | - | +| [api/vpic/endpoints/GetEquipmentPlantCodes](api/vpic/endpoints/GetEquipmentPlantCodes.md) | - | +| [api/vpic/endpoints/GetMakeForManufacturer](api/vpic/endpoints/GetMakeForManufacturer.md) | - | +| [api/vpic/endpoints/GetMakesForManufacturerAndYear](api/vpic/endpoints/GetMakesForManufacturerAndYear.md) | - | +| [api/vpic/endpoints/GetMakesForVehicleType](api/vpic/endpoints/GetMakesForVehicleType.md) | - | +| [api/vpic/endpoints/GetManufacturerDetails](api/vpic/endpoints/GetManufacturerDetails.md) | - | +| [api/vpic/endpoints/GetModelsForMake](api/vpic/endpoints/GetModelsForMake.md) | - | +| [api/vpic/endpoints/GetModelsForMakeId](api/vpic/endpoints/GetModelsForMakeId.md) | - | +| [api/vpic/endpoints/GetModelsForMakeIdYear](api/vpic/endpoints/GetModelsForMakeIdYear.md) | - | +| [api/vpic/endpoints/GetModelsForMakeYear](api/vpic/endpoints/GetModelsForMakeYear.md) | - | +| [api/vpic/endpoints/GetParts](api/vpic/endpoints/GetParts.md) | - | +| [api/vpic/endpoints/GetVehicleTypesForMake](api/vpic/endpoints/GetVehicleTypesForMake.md) | - | +| [api/vpic/endpoints/GetVehicleTypesForMakeId](api/vpic/endpoints/GetVehicleTypesForMakeId.md) | - | +| [api/vpic/endpoints/GetVehicleVariableList](api/vpic/endpoints/GetVehicleVariableList.md) | - | +| [api/vpic/endpoints/GetVehicleVariableValuesList](api/vpic/endpoints/GetVehicleVariableValuesList.md) | - | +| [api/vpic/endpoints/GetWMIsForManufacturer](api/vpic/endpoints/GetWMIsForManufacturer.md) | - | + +## Constants + +| Module | Description | +| :------ | :------ | +| [constants](constants.md) | - | + +## Package Exports + +| Module | Description | +| :------ | :------ | +| [exports](exports.md) | - | + +## Types + +| Module | Description | +| :------ | :------ | +| [api/safetyRatings/types](api/safetyRatings/types.md) | - | +| [api/types](api/types.md) | - | +| [api/vpic/endpoints/types](api/vpic/endpoints/types.md) | - | +| [api/vpic/types](api/vpic/types.md) | - | +| [types](types.md) | - | +| [utils/types](utils/types.md) | - | + +## Utility Functions + +| Module | Description | +| :------ | :------ | +| [utils](utils.md) | - | +| [utils/argHandler](utils/argHandler.md) | - | +| [utils/errorHandler](utils/errorHandler.md) | - | +| [utils/getTypeof](utils/getTypeof.md) | - | +| [utils/isValidVin](utils/isValidVin.md) | - | +| [utils/queryString](utils/queryString.md) | - | diff --git a/apps/docs/src/typedoc/modules/api.md b/apps/docs/src/typedoc/modules/api.md deleted file mode 100644 index 1ab39513..00000000 --- a/apps/docs/src/typedoc/modules/api.md +++ /dev/null @@ -1,183 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api - -# Module: api - -## Table of contents - -### References - -- [DecodeVin](api.md#decodevin) -- [DecodeVinExtended](api.md#decodevinextended) -- [DecodeVinValues](api.md#decodevinvalues) -- [DecodeVinValuesBatch](api.md#decodevinvaluesbatch) -- [DecodeVinValuesExtended](api.md#decodevinvaluesextended) -- [DecodeWMI](api.md#decodewmi) -- [GetAllMakes](api.md#getallmakes) -- [GetAllManufacturers](api.md#getallmanufacturers) -- [GetCanadianVehicleSpecifications](api.md#getcanadianvehiclespecifications) -- [GetEquipmentPlantCodes](api.md#getequipmentplantcodes) -- [GetMakeForManufacturer](api.md#getmakeformanufacturer) -- [GetMakesForManufacturerAndYear](api.md#getmakesformanufacturerandyear) -- [GetMakesForVehicleType](api.md#getmakesforvehicletype) -- [GetManufacturerDetails](api.md#getmanufacturerdetails) -- [GetModelsForMake](api.md#getmodelsformake) -- [GetModelsForMakeId](api.md#getmodelsformakeid) -- [GetModelsForMakeIdYear](api.md#getmodelsformakeidyear) -- [GetModelsForMakeYear](api.md#getmodelsformakeyear) -- [GetParts](api.md#getparts) -- [GetVehicleTypesForMake](api.md#getvehicletypesformake) -- [GetVehicleTypesForMakeId](api.md#getvehicletypesformakeid) -- [GetVehicleVariableList](api.md#getvehiclevariablelist) -- [GetVehicleVariableValuesList](api.md#getvehiclevariablevalueslist) -- [GetWMIsForManufacturer](api.md#getwmisformanufacturer) -- [useNHTSA](api.md#usenhtsa) - -## References - -### DecodeVin - -Re-exports [DecodeVin](api_endpoints_DecodeVin.md#decodevin) - ---- - -### DecodeVinExtended - -Re-exports [DecodeVinExtended](api_endpoints_DecodeVinExtended.md#decodevinextended) - ---- - -### DecodeVinValues - -Re-exports [DecodeVinValues](api_endpoints_DecodeVinValues.md#decodevinvalues) - ---- - -### DecodeVinValuesBatch - -Re-exports [DecodeVinValuesBatch](api_endpoints_DecodeVinValuesBatch.md#decodevinvaluesbatch) - ---- - -### DecodeVinValuesExtended - -Re-exports [DecodeVinValuesExtended](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextended) - ---- - -### DecodeWMI - -Re-exports [DecodeWMI](api_endpoints_DecodeWMI.md#decodewmi) - ---- - -### GetAllMakes - -Re-exports [GetAllMakes](api_endpoints_GetAllMakes.md#getallmakes) - ---- - -### GetAllManufacturers - -Re-exports [GetAllManufacturers](api_endpoints_GetAllManufacturers.md#getallmanufacturers) - ---- - -### GetCanadianVehicleSpecifications - -Re-exports [GetCanadianVehicleSpecifications](api_endpoints_GetCanadianVehicleSpecifications.md#getcanadianvehiclespecifications) - ---- - -### GetEquipmentPlantCodes - -Re-exports [GetEquipmentPlantCodes](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodes) - ---- - -### GetMakeForManufacturer - -Re-exports [GetMakeForManufacturer](api_endpoints_GetMakeForManufacturer.md#getmakeformanufacturer) - ---- - -### GetMakesForManufacturerAndYear - -Re-exports [GetMakesForManufacturerAndYear](api_endpoints_GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyear) - ---- - -### GetMakesForVehicleType - -Re-exports [GetMakesForVehicleType](api_endpoints_GetMakesForVehicleType.md#getmakesforvehicletype) - ---- - -### GetManufacturerDetails - -Re-exports [GetManufacturerDetails](api_endpoints_GetManufacturerDetails.md#getmanufacturerdetails) - ---- - -### GetModelsForMake - -Re-exports [GetModelsForMake](api_endpoints_GetModelsForMake.md#getmodelsformake) - ---- - -### GetModelsForMakeId - -Re-exports [GetModelsForMakeId](api_endpoints_GetModelsForMakeId.md#getmodelsformakeid) - ---- - -### GetModelsForMakeIdYear - -Re-exports [GetModelsForMakeIdYear](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyear) - ---- - -### GetModelsForMakeYear - -Re-exports [GetModelsForMakeYear](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyear) - ---- - -### GetParts - -Re-exports [GetParts](api_endpoints_GetParts.md#getparts) - ---- - -### GetVehicleTypesForMake - -Re-exports [GetVehicleTypesForMake](api_endpoints_GetVehicleTypesForMake.md#getvehicletypesformake) - ---- - -### GetVehicleTypesForMakeId - -Re-exports [GetVehicleTypesForMakeId](api_endpoints_GetVehicleTypesForMakeId.md#getvehicletypesformakeid) - ---- - -### GetVehicleVariableList - -Re-exports [GetVehicleVariableList](api_endpoints_GetVehicleVariableList.md#getvehiclevariablelist) - ---- - -### GetVehicleVariableValuesList - -Re-exports [GetVehicleVariableValuesList](api_endpoints_GetVehicleVariableValuesList.md#getvehiclevariablevalueslist) - ---- - -### GetWMIsForManufacturer - -Re-exports [GetWMIsForManufacturer](api_endpoints_GetWMIsForManufacturer.md#getwmisformanufacturer) - ---- - -### useNHTSA - -Re-exports [useNHTSA](api_useNHTSA.md#usenhtsa) diff --git a/apps/docs/src/typedoc/modules/api_endpoints.md b/apps/docs/src/typedoc/modules/api_endpoints.md deleted file mode 100644 index 8fbbfa93..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints.md +++ /dev/null @@ -1,176 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints - -# Module: api/endpoints - -## Table of contents - -### References - -- [DecodeVin](api_endpoints.md#decodevin) -- [DecodeVinExtended](api_endpoints.md#decodevinextended) -- [DecodeVinValues](api_endpoints.md#decodevinvalues) -- [DecodeVinValuesBatch](api_endpoints.md#decodevinvaluesbatch) -- [DecodeVinValuesExtended](api_endpoints.md#decodevinvaluesextended) -- [DecodeWMI](api_endpoints.md#decodewmi) -- [GetAllMakes](api_endpoints.md#getallmakes) -- [GetAllManufacturers](api_endpoints.md#getallmanufacturers) -- [GetCanadianVehicleSpecifications](api_endpoints.md#getcanadianvehiclespecifications) -- [GetEquipmentPlantCodes](api_endpoints.md#getequipmentplantcodes) -- [GetMakeForManufacturer](api_endpoints.md#getmakeformanufacturer) -- [GetMakesForManufacturerAndYear](api_endpoints.md#getmakesformanufacturerandyear) -- [GetMakesForVehicleType](api_endpoints.md#getmakesforvehicletype) -- [GetManufacturerDetails](api_endpoints.md#getmanufacturerdetails) -- [GetModelsForMake](api_endpoints.md#getmodelsformake) -- [GetModelsForMakeId](api_endpoints.md#getmodelsformakeid) -- [GetModelsForMakeIdYear](api_endpoints.md#getmodelsformakeidyear) -- [GetModelsForMakeYear](api_endpoints.md#getmodelsformakeyear) -- [GetParts](api_endpoints.md#getparts) -- [GetVehicleTypesForMake](api_endpoints.md#getvehicletypesformake) -- [GetVehicleTypesForMakeId](api_endpoints.md#getvehicletypesformakeid) -- [GetVehicleVariableList](api_endpoints.md#getvehiclevariablelist) -- [GetVehicleVariableValuesList](api_endpoints.md#getvehiclevariablevalueslist) -- [GetWMIsForManufacturer](api_endpoints.md#getwmisformanufacturer) - -## References - -### DecodeVin - -Re-exports [DecodeVin](api_endpoints_DecodeVin.md#decodevin) - ---- - -### DecodeVinExtended - -Re-exports [DecodeVinExtended](api_endpoints_DecodeVinExtended.md#decodevinextended) - ---- - -### DecodeVinValues - -Re-exports [DecodeVinValues](api_endpoints_DecodeVinValues.md#decodevinvalues) - ---- - -### DecodeVinValuesBatch - -Re-exports [DecodeVinValuesBatch](api_endpoints_DecodeVinValuesBatch.md#decodevinvaluesbatch) - ---- - -### DecodeVinValuesExtended - -Re-exports [DecodeVinValuesExtended](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextended) - ---- - -### DecodeWMI - -Re-exports [DecodeWMI](api_endpoints_DecodeWMI.md#decodewmi) - ---- - -### GetAllMakes - -Re-exports [GetAllMakes](api_endpoints_GetAllMakes.md#getallmakes) - ---- - -### GetAllManufacturers - -Re-exports [GetAllManufacturers](api_endpoints_GetAllManufacturers.md#getallmanufacturers) - ---- - -### GetCanadianVehicleSpecifications - -Re-exports [GetCanadianVehicleSpecifications](api_endpoints_GetCanadianVehicleSpecifications.md#getcanadianvehiclespecifications) - ---- - -### GetEquipmentPlantCodes - -Re-exports [GetEquipmentPlantCodes](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodes) - ---- - -### GetMakeForManufacturer - -Re-exports [GetMakeForManufacturer](api_endpoints_GetMakeForManufacturer.md#getmakeformanufacturer) - ---- - -### GetMakesForManufacturerAndYear - -Re-exports [GetMakesForManufacturerAndYear](api_endpoints_GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyear) - ---- - -### GetMakesForVehicleType - -Re-exports [GetMakesForVehicleType](api_endpoints_GetMakesForVehicleType.md#getmakesforvehicletype) - ---- - -### GetManufacturerDetails - -Re-exports [GetManufacturerDetails](api_endpoints_GetManufacturerDetails.md#getmanufacturerdetails) - ---- - -### GetModelsForMake - -Re-exports [GetModelsForMake](api_endpoints_GetModelsForMake.md#getmodelsformake) - ---- - -### GetModelsForMakeId - -Re-exports [GetModelsForMakeId](api_endpoints_GetModelsForMakeId.md#getmodelsformakeid) - ---- - -### GetModelsForMakeIdYear - -Re-exports [GetModelsForMakeIdYear](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyear) - ---- - -### GetModelsForMakeYear - -Re-exports [GetModelsForMakeYear](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyear) - ---- - -### GetParts - -Re-exports [GetParts](api_endpoints_GetParts.md#getparts) - ---- - -### GetVehicleTypesForMake - -Re-exports [GetVehicleTypesForMake](api_endpoints_GetVehicleTypesForMake.md#getvehicletypesformake) - ---- - -### GetVehicleTypesForMakeId - -Re-exports [GetVehicleTypesForMakeId](api_endpoints_GetVehicleTypesForMakeId.md#getvehicletypesformakeid) - ---- - -### GetVehicleVariableList - -Re-exports [GetVehicleVariableList](api_endpoints_GetVehicleVariableList.md#getvehiclevariablelist) - ---- - -### GetVehicleVariableValuesList - -Re-exports [GetVehicleVariableValuesList](api_endpoints_GetVehicleVariableValuesList.md#getvehiclevariablevalueslist) - ---- - -### GetWMIsForManufacturer - -Re-exports [GetWMIsForManufacturer](api_endpoints_GetWMIsForManufacturer.md#getwmisformanufacturer) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_DecodeVin.md b/apps/docs/src/typedoc/modules/api_endpoints_DecodeVin.md deleted file mode 100644 index 7fa516ee..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_DecodeVin.md +++ /dev/null @@ -1,172 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/DecodeVin - -# Module: api/endpoints/DecodeVin - -## Table of contents - -### Type Aliases - -- [DecodeVinResults](api_endpoints_DecodeVin.md#decodevinresults) -- [DecodeVinVariable](api_endpoints_DecodeVin.md#decodevinvariable) - -### Functions - -- [DecodeVin](api_endpoints_DecodeVin.md#decodevin) - -## Type Aliases - -### DecodeVinResults - -ฦฌ **DecodeVinResults**: `Object` - -Objects in the `Results` array of `DecodeVin` endpoint response. - -#### Type declaration - -| Name | Type | -| :----------- | :------------------------------------------------------------------ | -| `Value` | `string` \| `null` | -| `ValueId` | `string` \| `null` | -| `Variable` | [`DecodeVinVariable`](api_endpoints_DecodeVin.md#decodevinvariable) | -| `VariableId` | `number` | - -#### Defined in - -[api/endpoints/DecodeVin.ts:110](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L110) - ---- - -### DecodeVinVariable - -ฦฌ **DecodeVinVariable**: `"Suggested VIN"` \| `"Error Code"` \| `"Possible Values"` \| `"Additional Error Text"` \| `"Error Text"` \| `"Vehicle Descriptor"` \| `"Destination Market"` \| `"Make"` \| `"Manufacturer Name"` \| `"Model"` \| `"Model Year"` \| `"Plant City"` \| `"Series"` \| `"Trim"` \| `"Vehicle Type"` \| `"Plant Country"` \| `"Plant Company Name"` \| `"Plant State"` \| `"Trim2"` \| `"Series2"` \| `"Note"` \| `"Base Price ($)"` \| `"Non-Land Use"` \| `"Body Class"` \| `"Doors"` \| `"Windows"` \| `"Wheel Base Type"` \| `"Track Width (inches)"` \| `"Gross Vehicle Weight Rating From"` \| `"Bed Length (inches)"` \| `"Curb Weight (pounds)"` \| `"Wheel Base (inches) From"` \| `"Wheel Base (inches) To"` \| `"Gross Combination Weight Rating From"` \| `"Gross Combination Weight Rating To"` \| `"Gross Vehicle Weight Rating To"` \| `"Bed Type"` \| `"Cab Type"` \| `"Trailer Type Connection"` \| `"Trailer Body Type"` \| `"Trailer Length (feet)"` \| `"Other Trailer Info"` \| `"Number of Wheels"` \| `"Wheel Size Front (inches)"` \| `"Wheel Size Rear (inches)"` \| `"Entertainment System"` \| `"Steering Location"` \| `"Number of Seats"` \| `"Number of Seat Rows"` \| `"Transmission Style"` \| `"Transmission Speeds"` \| `"Drive Type"` \| `"Axles"` \| `"Axle Configuration"` \| `"Brake System Type"` \| `"Brake System Description"` \| `"Other Battery Info"` \| `"Battery Type"` \| `"Number of Battery Cells per Module"` \| `"Battery Current (Amps) From"` \| `"Battery Voltage (Volts) From"` \| `"Battery Energy (kWh) From"` \| `"EV Drive Unit"` \| `"Battery Current (Amps) To"` \| `"Battery Voltage (Volts) To"` \| `"Battery Energy (kWh) To"` \| `"Number of Battery Modules per Pack"` \| `"Number of Battery Packs per Vehicle"` \| `"Charger Level"` \| `"Charger Power (kW)"` \| `"Engine Number of Cylinders"` \| `"Displacement (CC)"` \| `"Displacement (CI)"` \| `"Displacement (L)"` \| `"Engine Stroke Cycles"` \| `"Engine Model"` \| `"Engine Power (kW)"` \| `"Fuel Type - Primary"` \| `"Valve Train Design"` \| `"Engine Configuration"` \| `"Fuel Type - Secondary"` \| `"Fuel Delivery / Fuel Injection Type"` \| `"Engine Brake (hp) From"` \| `"Cooling Type"` \| `"Engine Brake (hp) To"` \| `"Electrification Level"` \| `"Other Engine Info"` \| `"Turbo"` \| `"Top Speed (MPH)"` \| `"Engine Manufacturer"` \| `"Pretensioner"` \| `"Seat Belt Type"` \| `"Other Restraint System Info"` \| `"Curtain Air Bag Locations"` \| `"Seat Cushion Air Bag Locations"` \| `"Front Air Bag Locations"` \| `"Knee Air Bag Locations"` \| `"Side Air Bag Locations"` \| `"Anti-lock Braking System (ABS)"` \| `"Electronic Stability Control (ESC)"` \| `"Traction Control"` \| `"Tire Pressure Monitoring System (TPMS) Type"` \| `"Active Safety System Note"` \| `"Auto-Reverse System for Windows and Sunroofs"` \| `"Automatic Pedestrian Alerting Sound (for Hybrid and EV only)"` \| `"Event Data Recorder (EDR)"` \| `"Keyless Ignition"` \| `"SAE Automation Level From"` \| `"SAE Automation Level To"` \| `"Adaptive Cruise Control (ACC)"` \| `"Crash Imminent Braking (CIB)"` \| `"Blind Spot Warning (BSW)"` \| `"Forward Collision Warning (FCW)"` \| `"Lane Departure Warning (LDW)"` \| `"Lane Keeping Assistance (LKA)"` \| `"Backup Camera"` \| `"Parking Assist"` \| `"Bus Length (feet)"` \| `"Bus Floor Configuration Type"` \| `"Bus Type"` \| `"Other Bus Info"` \| `"Custom Motorcycle Type"` \| `"Motorcycle Suspension Type"` \| `"Motorcycle Chassis Type"` \| `"Other Motorcycle Info"` \| `"Dynamic Brake Support (DBS)"` \| `"Pedestrian Automatic Emergency Braking (PAEB)"` \| `"Automatic Crash Notification (ACN) / Advanced Automatic Crash Notification (AACN)"` \| `"Daytime Running Light (DRL)"` \| `"Headlamp Light Source"` \| `"Semiautomatic Headlamp Beam Switching"` \| `"Adaptive Driving Beam (ADB)"` \| `"Rear Cross Traffic Alert"` \| `"Rear Automatic Emergency Braking"` \| `"Blind Spot Intervention (BSI)"` \| `"Lane Centering Assistance"` \| `string` & `Record`<`string`, `never`\> - -Possible `DecodeVinResults.Variable` values for DecodeVin endpoint. - -This type is here to provide a list of possible values manually extracted from an actual API -response. There are some things to note: - -- Names are ordered to mirror actual API response order. -- Names have been known to change slightly or be added/removed. -- Some listed here could be missing from the API response. -- There may be more actual values than listed here. - -Last Updated: 02/14/2023 - -#### Defined in - -[api/endpoints/DecodeVin.ts:129](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L129) - -## Functions - -### DecodeVin - -โ–ธ **DecodeVin**(`vin`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinResults`](api_endpoints_DecodeVin.md#decodevinresults)\>\> - -::: tip :bulb: More Information -See: [DecodeVin Documentation](/api/endpoints/decode-vin) -::: - -`DecodeVin` decodes a Vehicle Identification Number (VIN) and returns useful information about -the vehicle. - -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, but it is not required. - -This endpoint also supports partial VIN decoding (VINs that are less than 17 characters). - -- Ex: 5UXWX7C5\*BA -- 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 - -#### Parameters - -| Name | Type | Description | -| :---- | :------- | :---------------------------------------------- | -| `vin` | `string` | Vehicle Identification Number (full or partial) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinResults`](api_endpoints_DecodeVin.md#decodevinresults)\>\> - -- Api Response `object` - -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/DecodeVin.ts:36](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L36) - -โ–ธ **DecodeVin**(`vin`, `doFetch`, `_dummy?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinResults`](api_endpoints_DecodeVin.md#decodevinresults)\>\> - -#### Parameters - -| Name | Type | -| :-------- | :---------- | -| `vin` | `string` | -| `doFetch` | `true` | -| `_dummy?` | `undefined` | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinResults`](api_endpoints_DecodeVin.md#decodevinresults)\>\> - -#### Defined in - -[api/endpoints/DecodeVin.ts:38](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L38) - -โ–ธ **DecodeVin**(`vin`, `doFetch`, `_dummy?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :---------- | -| `vin` | `string` | -| `doFetch` | `false` | -| `_dummy?` | `undefined` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/DecodeVin.ts:44](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L44) - -โ–ธ **DecodeVin**(`vin`, `params`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------------ | :------------------- | -| `vin` | `string` | -| `params` | `Object` | -| `params.modelYear?` | `string` \| `number` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/DecodeVin.ts:50](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L50) - -โ–ธ **DecodeVin**(`vin`, `params?`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinResults`](api_endpoints_DecodeVin.md#decodevinresults)\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :------------------- | -| `vin` | `string` | -| `params?` | `Object` | -| `params.modelYear?` | `string` \| `number` | -| `doFetch?` | `true` | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinResults`](api_endpoints_DecodeVin.md#decodevinresults)\>\> - -#### Defined in - -[api/endpoints/DecodeVin.ts:56](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L56) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_DecodeVinExtended.md b/apps/docs/src/typedoc/modules/api_endpoints_DecodeVinExtended.md deleted file mode 100644 index 54c97cd0..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_DecodeVinExtended.md +++ /dev/null @@ -1,176 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/DecodeVinExtended - -# Module: api/endpoints/DecodeVinExtended - -## Table of contents - -### Type Aliases - -- [DecodeVinExtendedResults](api_endpoints_DecodeVinExtended.md#decodevinextendedresults) -- [DecodeVinExtendedVariable](api_endpoints_DecodeVinExtended.md#decodevinextendedvariable) - -### Functions - -- [DecodeVinExtended](api_endpoints_DecodeVinExtended.md#decodevinextended) - -## Type Aliases - -### DecodeVinExtendedResults - -ฦฌ **DecodeVinExtendedResults**: `Object` - -Objects in the `Results` array of `DecodeVinExtended` endpoint response. - -#### Type declaration - -| Name | Type | -| :----------- | :------------------------------------------------------------------------------------------ | -| `Value` | `string` \| `null` | -| `ValueId` | `string` \| `null` | -| `Variable` | [`DecodeVinExtendedVariable`](api_endpoints_DecodeVinExtended.md#decodevinextendedvariable) | -| `VariableId` | `number` | - -#### Defined in - -[api/endpoints/DecodeVinExtended.ts:116](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L116) - ---- - -### DecodeVinExtendedVariable - -ฦฌ **DecodeVinExtendedVariable**: `"Suggested VIN"` \| `"Error Code"` \| `"Possible Values"` \| `"Additional Error Text"` \| `"Error Text"` \| `"Vehicle Descriptor"` \| `"Destination Market"` \| `"Make"` \| `"Manufacturer Name"` \| `"Model"` \| `"Model Year"` \| `"Plant City"` \| `"Series"` \| `"Trim"` \| `"Vehicle Type"` \| `"Plant Country"` \| `"Plant Company Name"` \| `"Plant State"` \| `"Trim2"` \| `"Series2"` \| `"Note"` \| `"Base Price ($)"` \| `"Non-Land Use"` \| `"Body Class"` \| `"Doors"` \| `"Windows"` \| `"Wheel Base Type"` \| `"Track Width (inches)"` \| `"Gross Vehicle Weight Rating From"` \| `"Bed Length (inches)"` \| `"Curb Weight (pounds)"` \| `"Wheel Base (inches) From"` \| `"Wheel Base (inches) To"` \| `"Gross Combination Weight Rating From"` \| `"Gross Combination Weight Rating To"` \| `"Gross Vehicle Weight Rating To"` \| `"Bed Type"` \| `"Cab Type"` \| `"Trailer Type Connection"` \| `"Trailer Body Type"` \| `"Trailer Length (feet)"` \| `"Other Trailer Info"` \| `"Number of Wheels"` \| `"Wheel Size Front (inches)"` \| `"Wheel Size Rear (inches)"` \| `"Entertainment System"` \| `"Steering Location"` \| `"Number of Seats"` \| `"Number of Seat Rows"` \| `"Transmission Style"` \| `"Transmission Speeds"` \| `"Drive Type"` \| `"Axles"` \| `"Axle Configuration"` \| `"Brake System Type"` \| `"Brake System Description"` \| `"Other Battery Info"` \| `"Battery Type"` \| `"Number of Battery Cells per Module"` \| `"Battery Current (Amps) From"` \| `"Battery Voltage (Volts) From"` \| `"Battery Energy (kWh) From"` \| `"EV Drive Unit"` \| `"Battery Current (Amps) To"` \| `"Battery Voltage (Volts) To"` \| `"Battery Energy (kWh) To"` \| `"Number of Battery Modules per Pack"` \| `"Number of Battery Packs per Vehicle"` \| `"Charger Level"` \| `"Charger Power (kW)"` \| `"Engine Number of Cylinders"` \| `"Displacement (CC)"` \| `"Displacement (CI)"` \| `"Displacement (L)"` \| `"Engine Stroke Cycles"` \| `"Engine Model"` \| `"Engine Power (kW)"` \| `"Fuel Type - Primary"` \| `"Valve Train Design"` \| `"Engine Configuration"` \| `"Fuel Type - Secondary"` \| `"Fuel Delivery / Fuel Injection Type"` \| `"Engine Brake (hp) From"` \| `"Cooling Type"` \| `"Engine Brake (hp) To"` \| `"Electrification Level"` \| `"Other Engine Info"` \| `"Turbo"` \| `"Top Speed (MPH)"` \| `"Engine Manufacturer"` \| `"Pretensioner"` \| `"Seat Belt Type"` \| `"Other Restraint System Info"` \| `"Curtain Air Bag Locations"` \| `"Seat Cushion Air Bag Locations"` \| `"Front Air Bag Locations"` \| `"Knee Air Bag Locations"` \| `"Side Air Bag Locations"` \| `"Anti-lock Braking System (ABS)"` \| `"Electronic Stability Control (ESC)"` \| `"Traction Control"` \| `"Tire Pressure Monitoring System (TPMS) Type"` \| `"Active Safety System Note"` \| `"Auto-Reverse System for Windows and Sunroofs"` \| `"Automatic Pedestrian Alerting Sound (for Hybrid and EV only)"` \| `"Event Data Recorder (EDR)"` \| `"Keyless Ignition"` \| `"SAE Automation Level From"` \| `"SAE Automation Level To"` \| `"NCSA Body Type"` \| `"NCSA Make"` \| `"NCSA Model"` \| `"NCSA Note"` \| `"Adaptive Cruise Control (ACC)"` \| `"Crash Imminent Braking (CIB)"` \| `"Blind Spot Warning (BSW)"` \| `"Forward Collision Warning (FCW)"` \| `"Lane Departure Warning (LDW)"` \| `"Lane Keeping Assistance (LKA)"` \| `"Backup Camera"` \| `"Parking Assist"` \| `"Bus Length (feet)"` \| `"Bus Floor Configuration Type"` \| `"Bus Type"` \| `"Other Bus Info"` \| `"Custom Motorcycle Type"` \| `"Motorcycle Suspension Type"` \| `"Motorcycle Chassis Type"` \| `"Other Motorcycle Info"` \| `"Dynamic Brake Support (DBS)"` \| `"Pedestrian Automatic Emergency Braking (PAEB)"` \| `"Automatic Crash Notification (ACN) / Advanced Automatic Crash Notification (AACN)"` \| `"Daytime Running Light (DRL)"` \| `"Headlamp Light Source"` \| `"Semiautomatic Headlamp Beam Switching"` \| `"Adaptive Driving Beam (ADB)"` \| `"Rear Cross Traffic Alert"` \| `"Rear Automatic Emergency Braking"` \| `"Blind Spot Intervention (BSI)"` \| `"Lane Centering Assistance"` \| `string` & `Record`<`string`, `never`\> - -Possible `DecodeVinExtendedResults.Variable` values for DecodeVinExtended endpoint. - -This type is here to provide a list of possible values manually extracted from an actual API -response. There are some things to note: - -- Names are ordered to mirror actual API response order. -- Names have been known to change slightly or be added/removed. -- Some listed here could be missing from the API response. -- There may be more actual values than listed here. - -Last Updated: 02/14/2023 - -#### Defined in - -[api/endpoints/DecodeVinExtended.ts:135](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L135) - -## Functions - -### DecodeVinExtended - -โ–ธ **DecodeVinExtended**(`vin`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinExtendedResults`](api_endpoints_DecodeVinExtended.md#decodevinextendedresults)\>\> - -::: tip :bulb: More Information -See: [DecodeVinExtended Documentation](/api/endpoints/decode-vin-extended) -::: - -`DecodeVinExtended` decodes a Vehicle Identification Number (VIN) and returns useful information -about the vehicle. - -This endpoint is similar to `DecodeVin` but returns additional information on variables related -to other NHTSA programs like the -[NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa). - -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, but it is not required. - -This endpoint also supports partial VIN decoding (VINs that are less than 17 characters). - -- Ex: 5UXWX7C5\*BA -- 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 - -#### Parameters - -| Name | Type | Description | -| :---- | :------- | :---------------------------------------------- | -| `vin` | `string` | Vehicle Identification Number (full or partial) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinExtendedResults`](api_endpoints_DecodeVinExtended.md#decodevinextendedresults)\>\> - -- Api Response `object` - -or- url `string` if `doFetch = false` (default: `true`) - -#### Defined in - -[api/endpoints/DecodeVinExtended.ts:40](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L40) - -โ–ธ **DecodeVinExtended**(`vin`, `doFetch`, `_dummy?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinExtendedResults`](api_endpoints_DecodeVinExtended.md#decodevinextendedresults)\>\> - -#### Parameters - -| Name | Type | -| :-------- | :---------- | -| `vin` | `string` | -| `doFetch` | `true` | -| `_dummy?` | `undefined` | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinExtendedResults`](api_endpoints_DecodeVinExtended.md#decodevinextendedresults)\>\> - -#### Defined in - -[api/endpoints/DecodeVinExtended.ts:44](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L44) - -โ–ธ **DecodeVinExtended**(`vin`, `doFetch`, `_dummy?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :---------- | -| `vin` | `string` | -| `doFetch` | `false` | -| `_dummy?` | `undefined` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/DecodeVinExtended.ts:50](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L50) - -โ–ธ **DecodeVinExtended**(`vin`, `params`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------------ | :------------------- | -| `vin` | `string` | -| `params` | `Object` | -| `params.modelYear?` | `string` \| `number` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/DecodeVinExtended.ts:56](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L56) - -โ–ธ **DecodeVinExtended**(`vin`, `params?`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinExtendedResults`](api_endpoints_DecodeVinExtended.md#decodevinextendedresults)\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :------------------- | -| `vin` | `string` | -| `params?` | `Object` | -| `params.modelYear?` | `string` \| `number` | -| `doFetch?` | `true` | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinExtendedResults`](api_endpoints_DecodeVinExtended.md#decodevinextendedresults)\>\> - -#### Defined in - -[api/endpoints/DecodeVinExtended.ts:62](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L62) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_DecodeVinValues.md b/apps/docs/src/typedoc/modules/api_endpoints_DecodeVinValues.md deleted file mode 100644 index 42ea3c60..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_DecodeVinValues.md +++ /dev/null @@ -1,315 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/DecodeVinValues - -# Module: api/endpoints/DecodeVinValues - -## Table of contents - -### Type Aliases - -- [DecodeVinValuesParams](api_endpoints_DecodeVinValues.md#decodevinvaluesparams) -- [DecodeVinValuesResults](api_endpoints_DecodeVinValues.md#decodevinvaluesresults) - -### Functions - -- [DecodeVinValues](api_endpoints_DecodeVinValues.md#decodevinvalues) - -## Type Aliases - -### DecodeVinValuesParams - -ฦฌ **DecodeVinValuesParams**: `Object` - -Query String Parameters for this endpoint - -#### Type declaration - -| Name | Type | -| :----------- | :------------------- | -| `modelYear?` | `string` \| `number` | - -#### Defined in - -[api/endpoints/DecodeVinValues.ts:111](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L111) - ---- - -### DecodeVinValuesResults - -ฦฌ **DecodeVinValuesResults**: `Object` - -Single object found in the `Results` array of `DecodeVinValues` endpoint response. - -#### Type declaration - -| Name | Type | -| :------------------------------------ | :------- | -| `ABS` | `string` | -| `ActiveSafetySysNote` | `string` | -| `AdaptiveCruiseControl` | `string` | -| `AdaptiveDrivingBeam` | `string` | -| `AdaptiveHeadlights` | `string` | -| `AdditionalErrorText` | `string` | -| `AirBagLocCurtain` | `string` | -| `AirBagLocFront` | `string` | -| `AirBagLocKnee` | `string` | -| `AirBagLocSeatCushion` | `string` | -| `AirBagLocSide` | `string` | -| `AutoReverseSystem` | `string` | -| `AutomaticPedestrianAlertingSound` | `string` | -| `AxleConfiguration` | `string` | -| `Axles` | `string` | -| `BasePrice` | `string` | -| `BatteryA` | `string` | -| `BatteryA_to` | `string` | -| `BatteryCells` | `string` | -| `BatteryInfo` | `string` | -| `BatteryKWh` | `string` | -| `BatteryKWh_to` | `string` | -| `BatteryModules` | `string` | -| `BatteryPacks` | `string` | -| `BatteryType` | `string` | -| `BatteryV` | `string` | -| `BatteryV_to` | `string` | -| `BedLengthIN` | `string` | -| `BedType` | `string` | -| `BlindSpotIntervention` | `string` | -| `BlindSpotMon` | `string` | -| `BodyCabType` | `string` | -| `BodyClass` | `string` | -| `BrakeSystemDesc` | `string` | -| `BrakeSystemType` | `string` | -| `BusFloorConfigType` | `string` | -| `BusLength` | `string` | -| `BusType` | `string` | -| `CAN_AACN` | `string` | -| `CIB` | `string` | -| `CashForClunkers` | `string` | -| `ChargerLevel` | `string` | -| `ChargerPowerKW` | `string` | -| `CoolingType` | `string` | -| `CurbWeightLB` | `string` | -| `CustomMotorcycleType` | `string` | -| `DaytimeRunningLight` | `string` | -| `DestinationMarket` | `string` | -| `DisplacementCC` | `string` | -| `DisplacementCI` | `string` | -| `DisplacementL` | `string` | -| `Doors` | `string` | -| `DriveType` | `string` | -| `DriverAssist` | `string` | -| `DynamicBrakeSupport` | `string` | -| `EDR` | `string` | -| `ESC` | `string` | -| `EVDriveUnit` | `string` | -| `ElectrificationLevel` | `string` | -| `EngineConfiguration` | `string` | -| `EngineCycles` | `string` | -| `EngineCylinders` | `string` | -| `EngineHP` | `string` | -| `EngineHP_to` | `string` | -| `EngineKW` | `string` | -| `EngineManufacturer` | `string` | -| `EngineModel` | `string` | -| `EntertainmentSystem` | `string` | -| `ErrorCode` | `string` | -| `ErrorText` | `string` | -| `ForwardCollisionWarning` | `string` | -| `FuelInjectionType` | `string` | -| `FuelTypePrimary` | `string` | -| `FuelTypeSecondary` | `string` | -| `GCWR` | `string` | -| `GCWR_to` | `string` | -| `GVWR` | `string` | -| `GVWR_to` | `string` | -| `KeylessIgnition` | `string` | -| `LaneCenteringAssistance` | `string` | -| `LaneDepartureWarning` | `string` | -| `LaneKeepSystem` | `string` | -| `LowerBeamHeadlampLightSource` | `string` | -| `Make` | `string` | -| `MakeID` | `string` | -| `Manufacturer` | `string` | -| `ManufacturerId` | `string` | -| `Model` | `string` | -| `ModelID` | `string` | -| `ModelYear` | `string` | -| `MotorcycleChassisType` | `string` | -| `MotorcycleSuspensionType` | `string` | -| `NCSABodyType` | `string` | -| `NCSAMake` | `string` | -| `NCSAMapExcApprovedBy` | `string` | -| `NCSAMapExcApprovedOn` | `string` | -| `NCSAMappingException` | `string` | -| `NCSAModel` | `string` | -| `NCSANote` | `string` | -| `NonLandUse` | `string` | -| `Note` | `string` | -| `OtherBusInfo` | `string` | -| `OtherEngineInfo` | `string` | -| `OtherMotorcycleInfo` | `string` | -| `OtherRestraintSystemInfo` | `string` | -| `OtherTrailerInfo` | `string` | -| `ParkAssist` | `string` | -| `PedestrianAutomaticEmergencyBraking` | `string` | -| `PlantCity` | `string` | -| `PlantCompanyName` | `string` | -| `PlantCountry` | `string` | -| `PlantState` | `string` | -| `PossibleValues` | `string` | -| `Pretensioner` | `string` | -| `RearAutomaticEmergencyBraking` | `string` | -| `RearCrossTrafficAlert` | `string` | -| `RearVisibilitySystem` | `string` | -| `SAEAutomationLevel` | `string` | -| `SAEAutomationLevel_to` | `string` | -| `SeatBeltsAll` | `string` | -| `SeatRows` | `string` | -| `Seats` | `string` | -| `SemiautomaticHeadlampBeamSwitching` | `string` | -| `Series` | `string` | -| `Series2` | `string` | -| `SteeringLocation` | `string` | -| `SuggestedVIN` | `string` | -| `TPMS` | `string` | -| `TopSpeedMPH` | `string` | -| `TrackWidth` | `string` | -| `TractionControl` | `string` | -| `TrailerBodyType` | `string` | -| `TrailerLength` | `string` | -| `TrailerType` | `string` | -| `TransmissionSpeeds` | `string` | -| `TransmissionStyle` | `string` | -| `Trim` | `string` | -| `Trim2` | `string` | -| `Turbo` | `string` | -| `VIN` | `string` | -| `ValveTrainDesign` | `string` | -| `VehicleDescriptor` | `string` | -| `VehicleType` | `string` | -| `WheelBaseLong` | `string` | -| `WheelBaseShort` | `string` | -| `WheelBaseType` | `string` | -| `WheelSizeFront` | `string` | -| `WheelSizeRear` | `string` | -| `Wheels` | `string` | -| `Windows` | `string` | - -#### Defined in - -[api/endpoints/DecodeVinValues.ts:118](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L118) - -## Functions - -### DecodeVinValues - -โ–ธ **DecodeVinValues**(`vin`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesResults`](api_endpoints_DecodeVinValues.md#decodevinvaluesresults)\>\> - -::: tip :bulb: More Information -See: [DecodeVinValues Documentation](/api/endpoints/decode-vin-values) -::: - -`DecodeVinValues` decodes a Vehicle Identification Number (VIN) and returns useful information -about the vehicle in in a _flat format_. This means the endpoint will return an array with a -single object of results. Each key in the object is the name of a variable. - -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, but it is not required. - -This endpoint also supports partial VIN decoding (VINs that are less than 17 characters). - -- Ex: "5UXWX7C5\*BA" -- 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 - -#### Parameters - -| Name | Type | Description | -| :---- | :------- | :---------------------------------------------- | -| `vin` | `string` | Vehicle Identification Number (full or partial) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesResults`](api_endpoints_DecodeVinValues.md#decodevinvaluesresults)\>\> - -- Api Response `object` - -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/DecodeVinValues.ts:37](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L37) - -โ–ธ **DecodeVinValues**(`vin`, `doFetch`, `_dummy?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesResults`](api_endpoints_DecodeVinValues.md#decodevinvaluesresults)\>\> - -#### Parameters - -| Name | Type | -| :-------- | :---------- | -| `vin` | `string` | -| `doFetch` | `true` | -| `_dummy?` | `undefined` | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesResults`](api_endpoints_DecodeVinValues.md#decodevinvaluesresults)\>\> - -#### Defined in - -[api/endpoints/DecodeVinValues.ts:41](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L41) - -โ–ธ **DecodeVinValues**(`vin`, `doFetch`, `_dummy?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :---------- | -| `vin` | `string` | -| `doFetch` | `false` | -| `_dummy?` | `undefined` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/DecodeVinValues.ts:47](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L47) - -โ–ธ **DecodeVinValues**(`vin`, `params`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------------ | :------------------- | -| `vin` | `string` | -| `params` | `Object` | -| `params.modelYear?` | `string` \| `number` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/DecodeVinValues.ts:53](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L53) - -โ–ธ **DecodeVinValues**(`vin`, `params?`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesResults`](api_endpoints_DecodeVinValues.md#decodevinvaluesresults)\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :------------------- | -| `vin` | `string` | -| `params?` | `Object` | -| `params.modelYear?` | `string` \| `number` | -| `doFetch?` | `true` | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesResults`](api_endpoints_DecodeVinValues.md#decodevinvaluesresults)\>\> - -#### Defined in - -[api/endpoints/DecodeVinValues.ts:59](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L59) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_DecodeVinValuesBatch.md b/apps/docs/src/typedoc/modules/api_endpoints_DecodeVinValuesBatch.md deleted file mode 100644 index 38ec1728..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_DecodeVinValuesBatch.md +++ /dev/null @@ -1,247 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/DecodeVinValuesBatch - -# Module: api/endpoints/DecodeVinValuesBatch - -## Table of contents - -### Type Aliases - -- [DecodeVinValuesBatchResults](api_endpoints_DecodeVinValuesBatch.md#decodevinvaluesbatchresults) - -### Functions - -- [DecodeVinValuesBatch](api_endpoints_DecodeVinValuesBatch.md#decodevinvaluesbatch) - -## Type Aliases - -### DecodeVinValuesBatchResults - -ฦฌ **DecodeVinValuesBatchResults**: `Object` - -Objects found in the `Results` array of `DecodeVinValuesBatch` endpoint response. - -#### Type declaration - -| Name | Type | -| :------------------------------------ | :------- | -| `ABS` | `string` | -| `ActiveSafetySysNote` | `string` | -| `AdaptiveCruiseControl` | `string` | -| `AdaptiveDrivingBeam` | `string` | -| `AdaptiveHeadlights` | `string` | -| `AdditionalErrorText` | `string` | -| `AirBagLocCurtain` | `string` | -| `AirBagLocFront` | `string` | -| `AirBagLocKnee` | `string` | -| `AirBagLocSeatCushion` | `string` | -| `AirBagLocSide` | `string` | -| `AutoReverseSystem` | `string` | -| `AutomaticPedestrianAlertingSound` | `string` | -| `AxleConfiguration` | `string` | -| `Axles` | `string` | -| `BasePrice` | `string` | -| `BatteryA` | `string` | -| `BatteryA_to` | `string` | -| `BatteryCells` | `string` | -| `BatteryInfo` | `string` | -| `BatteryKWh` | `string` | -| `BatteryKWh_to` | `string` | -| `BatteryModules` | `string` | -| `BatteryPacks` | `string` | -| `BatteryType` | `string` | -| `BatteryV` | `string` | -| `BatteryV_to` | `string` | -| `BedLengthIN` | `string` | -| `BedType` | `string` | -| `BlindSpotIntervention` | `string` | -| `BlindSpotMon` | `string` | -| `BodyCabType` | `string` | -| `BodyClass` | `string` | -| `BrakeSystemDesc` | `string` | -| `BrakeSystemType` | `string` | -| `BusFloorConfigType` | `string` | -| `BusLength` | `string` | -| `BusType` | `string` | -| `CAN_AACN` | `string` | -| `CIB` | `string` | -| `CashForClunkers` | `string` | -| `ChargerLevel` | `string` | -| `ChargerPowerKW` | `string` | -| `CoolingType` | `string` | -| `CurbWeightLB` | `string` | -| `CustomMotorcycleType` | `string` | -| `DaytimeRunningLight` | `string` | -| `DestinationMarket` | `string` | -| `DisplacementCC` | `string` | -| `DisplacementCI` | `string` | -| `DisplacementL` | `string` | -| `Doors` | `string` | -| `DriveType` | `string` | -| `DriverAssist` | `string` | -| `DynamicBrakeSupport` | `string` | -| `EDR` | `string` | -| `ESC` | `string` | -| `EVDriveUnit` | `string` | -| `ElectrificationLevel` | `string` | -| `EngineConfiguration` | `string` | -| `EngineCycles` | `string` | -| `EngineCylinders` | `string` | -| `EngineHP` | `string` | -| `EngineHP_to` | `string` | -| `EngineKW` | `string` | -| `EngineManufacturer` | `string` | -| `EngineModel` | `string` | -| `EntertainmentSystem` | `string` | -| `ErrorCode` | `string` | -| `ErrorText` | `string` | -| `ForwardCollisionWarning` | `string` | -| `FuelInjectionType` | `string` | -| `FuelTypePrimary` | `string` | -| `FuelTypeSecondary` | `string` | -| `GCWR` | `string` | -| `GCWR_to` | `string` | -| `GVWR` | `string` | -| `GVWR_to` | `string` | -| `KeylessIgnition` | `string` | -| `LaneCenteringAssistance` | `string` | -| `LaneDepartureWarning` | `string` | -| `LaneKeepSystem` | `string` | -| `LowerBeamHeadlampLightSource` | `string` | -| `Make` | `string` | -| `MakeID` | `string` | -| `Manufacturer` | `string` | -| `ManufacturerId` | `string` | -| `Model` | `string` | -| `ModelID` | `string` | -| `ModelYear` | `string` | -| `MotorcycleChassisType` | `string` | -| `MotorcycleSuspensionType` | `string` | -| `NCSABodyType` | `string` | -| `NCSAMake` | `string` | -| `NCSAMapExcApprovedBy` | `string` | -| `NCSAMapExcApprovedOn` | `string` | -| `NCSAMappingException` | `string` | -| `NCSAModel` | `string` | -| `NCSANote` | `string` | -| `NonLandUse` | `string` | -| `Note` | `string` | -| `OtherBusInfo` | `string` | -| `OtherEngineInfo` | `string` | -| `OtherMotorcycleInfo` | `string` | -| `OtherRestraintSystemInfo` | `string` | -| `OtherTrailerInfo` | `string` | -| `ParkAssist` | `string` | -| `PedestrianAutomaticEmergencyBraking` | `string` | -| `PlantCity` | `string` | -| `PlantCompanyName` | `string` | -| `PlantCountry` | `string` | -| `PlantState` | `string` | -| `PossibleValues` | `string` | -| `Pretensioner` | `string` | -| `RearAutomaticEmergencyBraking` | `string` | -| `RearCrossTrafficAlert` | `string` | -| `RearVisibilitySystem` | `string` | -| `SAEAutomationLevel` | `string` | -| `SAEAutomationLevel_to` | `string` | -| `SeatBeltsAll` | `string` | -| `SeatRows` | `string` | -| `Seats` | `string` | -| `SemiautomaticHeadlampBeamSwitching` | `string` | -| `Series` | `string` | -| `Series2` | `string` | -| `SteeringLocation` | `string` | -| `SuggestedVIN` | `string` | -| `TPMS` | `string` | -| `TopSpeedMPH` | `string` | -| `TrackWidth` | `string` | -| `TractionControl` | `string` | -| `TrailerBodyType` | `string` | -| `TrailerLength` | `string` | -| `TrailerType` | `string` | -| `TransmissionSpeeds` | `string` | -| `TransmissionStyle` | `string` | -| `Trim` | `string` | -| `Trim2` | `string` | -| `Turbo` | `string` | -| `VIN` | `string` | -| `ValveTrainDesign` | `string` | -| `VehicleDescriptor` | `string` | -| `VehicleType` | `string` | -| `WheelBaseLong` | `string` | -| `WheelBaseShort` | `string` | -| `WheelBaseType` | `string` | -| `WheelSizeFront` | `string` | -| `WheelSizeRear` | `string` | -| `Wheels` | `string` | -| `Windows` | `string` | - -#### Defined in - -[api/endpoints/DecodeVinValuesBatch.ts:90](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts#L90) - -## Functions - -### DecodeVinValuesBatch - -โ–ธ **DecodeVinValuesBatch**(`inputString`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesBatchResults`](api_endpoints_DecodeVinValuesBatch.md#decodevinvaluesbatchresults)\>\> - -::: tip :bulb: More Information -See: [DecodeVinValuesBatch Documentation](/api/endpoints/decode-vin-values-batch) -::: - -`DecodeVinValuesBatch` decodes a batch of Vehicle Identification Numbers (VINs) and returns -useful information about the vehicles in in a _flat format_. This means the endpoint will return -an array with multiple objects of results. Each object represents a VIN from the `inputString` -and the key:value pairs in the objects are variables and their values for each particular VIN. - -For this particular API you just have to provide a string of VINs, `inputString`, that are -separated by a `;`. You can also indicate the model year after the vin, preceded by a `,`. - -The `inputString` parameter should be in the following format: - -- ex: `5UXWX7C5*BA, 2011; 5YJSA3DS*EF` -- no modelYear: `vin; vin; vin` -- with modelYear: `vin, modelYear; vin, modelYear; vin, modelYear` -- mix of with/without modelYear: `vin; vin, modelYear` -- _vin_ and _modelYear_ are placeholders for real values in these examples -- all spaces between `;` and `,` are used in these examples for readability and are optional -- _Max 50 VINs per batch_ - -Providing the modelYear in the input string allows for the decoding to specifically be done in -the current, or older (pre-1980), model year ranges. It is recommended to always provide -the model year if it is known at the time of decoding, but it is not required. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------- | :---------------------------------------------------------------------------------------------------------- | -| `inputString` | `string` | A string of Vehicle Identification Numbers (full or partial) following the format listed in the description | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesBatchResults`](api_endpoints_DecodeVinValuesBatch.md#decodevinvaluesbatchresults)\>\> - -- Api Response `object` - -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/DecodeVinValuesBatch.ts:43](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts#L43) - -โ–ธ **DecodeVinValuesBatch**(`inputString`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `inputString` | `string` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/DecodeVinValuesBatch.ts:48](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts#L48) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_DecodeVinValuesExtended.md b/apps/docs/src/typedoc/modules/api_endpoints_DecodeVinValuesExtended.md deleted file mode 100644 index 0a15def2..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_DecodeVinValuesExtended.md +++ /dev/null @@ -1,300 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/DecodeVinValuesExtended - -# Module: api/endpoints/DecodeVinValuesExtended - -## Table of contents - -### Type Aliases - -- [DecodeVinValuesExtendedResults](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextendedresults) - -### Functions - -- [DecodeVinValuesExtended](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextended) - -## Type Aliases - -### DecodeVinValuesExtendedResults - -ฦฌ **DecodeVinValuesExtendedResults**: `Object` - -Single object found in the `Results` array of `DecodeVinValuesExtended` endpoint response. - -#### Type declaration - -| Name | Type | -| :------------------------------------ | :------- | -| `ABS` | `string` | -| `ActiveSafetySysNote` | `string` | -| `AdaptiveCruiseControl` | `string` | -| `AdaptiveDrivingBeam` | `string` | -| `AdaptiveHeadlights` | `string` | -| `AdditionalErrorText` | `string` | -| `AirBagLocCurtain` | `string` | -| `AirBagLocFront` | `string` | -| `AirBagLocKnee` | `string` | -| `AirBagLocSeatCushion` | `string` | -| `AirBagLocSide` | `string` | -| `AutoReverseSystem` | `string` | -| `AutomaticPedestrianAlertingSound` | `string` | -| `AxleConfiguration` | `string` | -| `Axles` | `string` | -| `BasePrice` | `string` | -| `BatteryA` | `string` | -| `BatteryA_to` | `string` | -| `BatteryCells` | `string` | -| `BatteryInfo` | `string` | -| `BatteryKWh` | `string` | -| `BatteryKWh_to` | `string` | -| `BatteryModules` | `string` | -| `BatteryPacks` | `string` | -| `BatteryType` | `string` | -| `BatteryV` | `string` | -| `BatteryV_to` | `string` | -| `BedLengthIN` | `string` | -| `BedType` | `string` | -| `BlindSpotIntervention` | `string` | -| `BlindSpotMon` | `string` | -| `BodyCabType` | `string` | -| `BodyClass` | `string` | -| `BrakeSystemDesc` | `string` | -| `BrakeSystemType` | `string` | -| `BusFloorConfigType` | `string` | -| `BusLength` | `string` | -| `BusType` | `string` | -| `CAN_AACN` | `string` | -| `CIB` | `string` | -| `CashForClunkers` | `string` | -| `ChargerLevel` | `string` | -| `ChargerPowerKW` | `string` | -| `CoolingType` | `string` | -| `CurbWeightLB` | `string` | -| `CustomMotorcycleType` | `string` | -| `DaytimeRunningLight` | `string` | -| `DestinationMarket` | `string` | -| `DisplacementCC` | `string` | -| `DisplacementCI` | `string` | -| `DisplacementL` | `string` | -| `Doors` | `string` | -| `DriveType` | `string` | -| `DriverAssist` | `string` | -| `DynamicBrakeSupport` | `string` | -| `EDR` | `string` | -| `ESC` | `string` | -| `EVDriveUnit` | `string` | -| `ElectrificationLevel` | `string` | -| `EngineConfiguration` | `string` | -| `EngineCycles` | `string` | -| `EngineCylinders` | `string` | -| `EngineHP` | `string` | -| `EngineHP_to` | `string` | -| `EngineKW` | `string` | -| `EngineManufacturer` | `string` | -| `EngineModel` | `string` | -| `EntertainmentSystem` | `string` | -| `ErrorCode` | `string` | -| `ErrorText` | `string` | -| `ForwardCollisionWarning` | `string` | -| `FuelInjectionType` | `string` | -| `FuelTypePrimary` | `string` | -| `FuelTypeSecondary` | `string` | -| `GCWR` | `string` | -| `GCWR_to` | `string` | -| `GVWR` | `string` | -| `GVWR_to` | `string` | -| `KeylessIgnition` | `string` | -| `LaneCenteringAssistance` | `string` | -| `LaneDepartureWarning` | `string` | -| `LaneKeepSystem` | `string` | -| `LowerBeamHeadlampLightSource` | `string` | -| `Make` | `string` | -| `MakeID` | `string` | -| `Manufacturer` | `string` | -| `ManufacturerId` | `string` | -| `Model` | `string` | -| `ModelID` | `string` | -| `ModelYear` | `string` | -| `MotorcycleChassisType` | `string` | -| `MotorcycleSuspensionType` | `string` | -| `NCSABodyType` | `string` | -| `NCSAMake` | `string` | -| `NCSAMapExcApprovedBy` | `string` | -| `NCSAMapExcApprovedOn` | `string` | -| `NCSAMappingException` | `string` | -| `NCSAModel` | `string` | -| `NCSANote` | `string` | -| `NonLandUse` | `string` | -| `Note` | `string` | -| `OtherBusInfo` | `string` | -| `OtherEngineInfo` | `string` | -| `OtherMotorcycleInfo` | `string` | -| `OtherRestraintSystemInfo` | `string` | -| `OtherTrailerInfo` | `string` | -| `ParkAssist` | `string` | -| `PedestrianAutomaticEmergencyBraking` | `string` | -| `PlantCity` | `string` | -| `PlantCompanyName` | `string` | -| `PlantCountry` | `string` | -| `PlantState` | `string` | -| `PossibleValues` | `string` | -| `Pretensioner` | `string` | -| `RearAutomaticEmergencyBraking` | `string` | -| `RearCrossTrafficAlert` | `string` | -| `RearVisibilitySystem` | `string` | -| `SAEAutomationLevel` | `string` | -| `SAEAutomationLevel_to` | `string` | -| `SeatBeltsAll` | `string` | -| `SeatRows` | `string` | -| `Seats` | `string` | -| `SemiautomaticHeadlampBeamSwitching` | `string` | -| `Series` | `string` | -| `Series2` | `string` | -| `SteeringLocation` | `string` | -| `SuggestedVIN` | `string` | -| `TPMS` | `string` | -| `TopSpeedMPH` | `string` | -| `TrackWidth` | `string` | -| `TractionControl` | `string` | -| `TrailerBodyType` | `string` | -| `TrailerLength` | `string` | -| `TrailerType` | `string` | -| `TransmissionSpeeds` | `string` | -| `TransmissionStyle` | `string` | -| `Trim` | `string` | -| `Trim2` | `string` | -| `Turbo` | `string` | -| `VIN` | `string` | -| `ValveTrainDesign` | `string` | -| `VehicleDescriptor` | `string` | -| `VehicleType` | `string` | -| `WheelBaseLong` | `string` | -| `WheelBaseShort` | `string` | -| `WheelBaseType` | `string` | -| `WheelSizeFront` | `string` | -| `WheelSizeRear` | `string` | -| `Wheels` | `string` | -| `Windows` | `string` | - -#### Defined in - -[api/endpoints/DecodeVinValuesExtended.ts:117](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts#L117) - -## Functions - -### DecodeVinValuesExtended - -โ–ธ **DecodeVinValuesExtended**(`vin`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesExtendedResults`](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> - -::: tip :bulb: More Information -See: [DecodeVinValuesExtended Documentation](/api/endpoints/decode-vin-values-extended) -::: - -`DecodeVinValuesExtended` decodes a Vehicle Identification Number (VIN) and returns useful -information about the vehicle in in a _flat format_. This means the endpoint will return an -array with a single object of results. Each key in the object is the name of a variable. - -This endpoint is similar to `DecodeVinValues` but returns additional information on variables -related to other NHTSA programs like -[NCSA](https://www.nhtsa.gov/research-data/national-center-statistics-and-analysis-ncsa), etc. - -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, but it is not required. - -This endpoint also supports partial VIN decoding (VINs that are less than 17 characters). - -- Ex: "5UXWX7C5\*BA" -- 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 - -#### Parameters - -| Name | Type | Description | -| :---- | :------- | :---------------------------------------------- | -| `vin` | `string` | Vehicle Identification Number (full or partial) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesExtendedResults`](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> - -- Api Response - `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/DecodeVinValuesExtended.ts:41](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts#L41) - -โ–ธ **DecodeVinValuesExtended**(`vin`, `doFetch`, `_dummy?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesExtendedResults`](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> - -#### Parameters - -| Name | Type | -| :-------- | :---------- | -| `vin` | `string` | -| `doFetch` | `true` | -| `_dummy?` | `undefined` | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesExtendedResults`](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> - -#### Defined in - -[api/endpoints/DecodeVinValuesExtended.ts:45](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts#L45) - -โ–ธ **DecodeVinValuesExtended**(`vin`, `doFetch`, `_dummy?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :---------- | -| `vin` | `string` | -| `doFetch` | `false` | -| `_dummy?` | `undefined` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/DecodeVinValuesExtended.ts:51](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts#L51) - -โ–ธ **DecodeVinValuesExtended**(`vin`, `params`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------------ | :------------------- | -| `vin` | `string` | -| `params` | `Object` | -| `params.modelYear?` | `string` \| `number` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/DecodeVinValuesExtended.ts:57](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts#L57) - -โ–ธ **DecodeVinValuesExtended**(`vin`, `params?`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesExtendedResults`](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> - -#### Parameters - -| Name | Type | -| :------------------ | :------------------- | -| `vin` | `string` | -| `params?` | `Object` | -| `params.modelYear?` | `string` \| `number` | -| `doFetch?` | `true` | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeVinValuesExtendedResults`](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> - -#### Defined in - -[api/endpoints/DecodeVinValuesExtended.ts:63](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts#L63) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_DecodeWMI.md b/apps/docs/src/typedoc/modules/api_endpoints_DecodeWMI.md deleted file mode 100644 index 494a0ad9..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_DecodeWMI.md +++ /dev/null @@ -1,96 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/DecodeWMI - -# Module: api/endpoints/DecodeWMI - -## Table of contents - -### Type Aliases - -- [DecodeWMIResults](api_endpoints_DecodeWMI.md#decodewmiresults) - -### Functions - -- [DecodeWMI](api_endpoints_DecodeWMI.md#decodewmi) - -## Type Aliases - -### DecodeWMIResults - -ฦฌ **DecodeWMIResults**: `Object` - -Objects found in the `Results` array of `DecodeWMI` endpoint response. - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `CommonName` | `string` | -| `CreatedOn` | `string` | -| `DateAvailableToPublic` | `string` | -| `Make` | `string` | -| `ManufacturerName` | `string` | -| `ParentCompanyName` | `string` | -| `URL` | `string` | -| `UpdatedOn` | `string` \| `null` | -| `VehicleType` | `string` | - -#### Defined in - -[api/endpoints/DecodeWMI.ts:76](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeWMI.ts#L76) - -## Functions - -### DecodeWMI - -โ–ธ **DecodeWMI**(`WMI`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeWMIResults`](api_endpoints_DecodeWMI.md#decodewmiresults)\>\> - -::: tip :bulb: More Information -See: [DecodeWMI Documentation](/api/endpoints/decode-wmi) -::: - -`DecodeWMI` provides information on the World Manufacturer Identifier for a specific `WMI` code. - -`WMI` may be provided as either 3 characters representing VIN position 1-3 _or_ 6 characters -representing VIN positions 1-3 & 12-14. - -- Examples: "JTD" "1T9131" - -A list of WMI codes can be found -[here](), -but keep in mind that not all of the listed WMIs are registered with NHTSA and therefore may not -be available in VPIC data sets. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :----------------------------------------------------------------- | -| `WMI` | `string` | World Manufacturer Identifier | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`DecodeWMIResults`](api_endpoints_DecodeWMI.md#decodewmiresults)\>\> - -- Api Response `object` - -or- url `string` if `doFetch = false` (default: `true`) - -#### Defined in - -[api/endpoints/DecodeWMI.ts:32](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeWMI.ts#L32) - -โ–ธ **DecodeWMI**(`WMI`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `WMI` | `string` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/DecodeWMI.ts:37](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeWMI.ts#L37) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetAllMakes.md b/apps/docs/src/typedoc/modules/api_endpoints_GetAllMakes.md deleted file mode 100644 index 8ca21729..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetAllMakes.md +++ /dev/null @@ -1,81 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetAllMakes - -# Module: api/endpoints/GetAllMakes - -## Table of contents - -### Type Aliases - -- [GetAllMakesResults](api_endpoints_GetAllMakes.md#getallmakesresults) - -### Functions - -- [GetAllMakes](api_endpoints_GetAllMakes.md#getallmakes) - -## Type Aliases - -### GetAllMakesResults - -ฦฌ **GetAllMakesResults**: `Object` - -Objects found in the `Results` array of `GetAllMakes` endpoint response. - -#### Type declaration - -| Name | Type | -| :---------- | :------- | -| `Make_ID` | `number` | -| `Make_Name` | `string` | - -#### Defined in - -[api/endpoints/GetAllMakes.ts:56](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllMakes.ts#L56) - -## Functions - -### GetAllMakes - -โ–ธ **GetAllMakes**(`doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetAllMakesResults`](api_endpoints_GetAllMakes.md#getallmakesresults)\>\> - -::: tip :bulb: More Information -See: [GetAllMakes Documentation](/api/endpoints/get-all-makes) -::: - -`GetAllMakes` provides a list of all the Makes available in the vPIC Dataset. -Each object in the `Results` array represents the `Make_ID` and the `Make_Name` of -an individual vehicle Make. - -- FYI there are over 10,000 registered makes in the database! - -#### Parameters - -| Name | Type | Description | -| :--------- | :----- | :----------------------------------------------------------------- | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetAllMakesResults`](api_endpoints_GetAllMakes.md#getallmakesresults)\>\> - -- Api Response `object` - -or- url `string` if `doFetch = false` (default: `true`) - -#### Defined in - -[api/endpoints/GetAllMakes.ts:26](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllMakes.ts#L26) - -โ–ธ **GetAllMakes**(`doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetAllMakes.ts:28](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllMakes.ts#L28) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetAllManufacturers.md b/apps/docs/src/typedoc/modules/api_endpoints_GetAllManufacturers.md deleted file mode 100644 index 2b68736e..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetAllManufacturers.md +++ /dev/null @@ -1,128 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetAllManufacturers - -# Module: api/endpoints/GetAllManufacturers - -## Table of contents - -### Type Aliases - -- [GetAllManufacturersResults](api_endpoints_GetAllManufacturers.md#getallmanufacturersresults) - -### Functions - -- [GetAllManufacturers](api_endpoints_GetAllManufacturers.md#getallmanufacturers) - -## Type Aliases - -### GetAllManufacturersResults - -ฦฌ **GetAllManufacturersResults**: `Object` - -Objects found in the `Results` array of `GetAllManufacturers` endpoint response. - -#### Type declaration - -| Name | Type | -| :--------------- | :------------------------------------------------ | -| `Country` | `string` | -| `Mfr_CommonName` | `string` \| `null` | -| `Mfr_ID` | `number` | -| `Mfr_Name` | `string` | -| `VehicleTypes` | { `IsPrimary?`: `boolean` ; `Name?`: `string` }[] | - -#### Defined in - -[api/endpoints/GetAllManufacturers.ts:111](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllManufacturers.ts#L111) - -## Functions - -### GetAllManufacturers - -โ–ธ **GetAllManufacturers**(`doFetch?`, `_dummy?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetAllManufacturersResults`](api_endpoints_GetAllManufacturers.md#getallmanufacturersresults)\>\> - -::: tip :bulb: More Information -See: [GetAllManufacturers Documentation](/api/endpoints/get-all-manufacturers) -::: - -`GetAllManufacturers` provides a list of all the Manufacturers available in the vPIC Dataset. - -`params.manufacturerType` is optional but allows the user to filter the list based on -manufacturer type. Types include 'Incomplete Vehicles', 'Completed Vehicle Manufacturer', -'Incomplete Vehicle Manufacturer', 'Intermediate Manufacturer', 'Final-Stage Manufacturer', -'Alterer', or any partial match of those strings. - -`params.page` is optional and used to specify (n)th page of results. Results are provided in -pages of 100 items. - -#### Parameters - -| Name | Type | Description | -| :--------- | :---------- | :----------------------------------------------------------------- | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | -| `_dummy?` | `undefined` | - | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetAllManufacturersResults`](api_endpoints_GetAllManufacturers.md#getallmanufacturersresults)\>\> - -- Api Response `object` - -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetAllManufacturers.ts:33](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllManufacturers.ts#L33) - -โ–ธ **GetAllManufacturers**(`doFetch?`, `_dummy?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :--------- | :---------- | -| `doFetch?` | `false` | -| `_dummy?` | `undefined` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetAllManufacturers.ts:38](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllManufacturers.ts#L38) - -โ–ธ **GetAllManufacturers**(`params`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------------------- | :------------------- | -| `params` | `Object` | -| `params.manufacturerType?` | `string` | -| `params.page?` | `string` \| `number` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetAllManufacturers.ts:43](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllManufacturers.ts#L43) - -โ–ธ **GetAllManufacturers**(`params?`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetAllManufacturersResults`](api_endpoints_GetAllManufacturers.md#getallmanufacturersresults)\>\> - -#### Parameters - -| Name | Type | -| :------------------------- | :------------------- | -| `params?` | `Object` | -| `params.manufacturerType?` | `string` | -| `params.page?` | `string` \| `number` | -| `doFetch?` | `true` | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetAllManufacturersResults`](api_endpoints_GetAllManufacturers.md#getallmanufacturersresults)\>\> - -#### Defined in - -[api/endpoints/GetAllManufacturers.ts:51](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllManufacturers.ts#L51) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetCanadianVehicleSpecifications.md b/apps/docs/src/typedoc/modules/api_endpoints_GetCanadianVehicleSpecifications.md deleted file mode 100644 index c739d159..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetCanadianVehicleSpecifications.md +++ /dev/null @@ -1,103 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetCanadianVehicleSpecifications - -# Module: api/endpoints/GetCanadianVehicleSpecifications - -## Table of contents - -### Type Aliases - -- [GetCanadianVehicleSpecificationsResults](api_endpoints_GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) - -### Functions - -- [GetCanadianVehicleSpecifications](api_endpoints_GetCanadianVehicleSpecifications.md#getcanadianvehiclespecifications) - -## Type Aliases - -### GetCanadianVehicleSpecificationsResults - -ฦฌ **GetCanadianVehicleSpecificationsResults**: `Object` - -Objects found in the `Results` array of `GetCanadianVehicleSpecifications` endpoint response. - -#### Type declaration - -| Name | Type | -| :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `Specs` | { `Name`: `"Make"` \| `"Model"` \| `"MYR"` \| `"OL"` \| `"OW"` \| `"OH"` \| `"WB"` \| `"CW"` \| `"A"` \| `"B"` \| `"C"` \| `"D"` \| `"E"` \| `"F"` \| `"G"` \| `"TWF"` \| `"TWR"` \| `"WD"` ; `Value`: `string` }[] | - -#### Defined in - -[api/endpoints/GetCanadianVehicleSpecifications.ts:120](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts#L120) - -## Functions - -### GetCanadianVehicleSpecifications - -โ–ธ **GetCanadianVehicleSpecifications**(`params`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetCanadianVehicleSpecificationsResults`](api_endpoints_GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults)\>\> - -::: tip :bulb: More Information -See: [GetCanadianVehicleSpecifications Documentation](/api/endpoints/get-canadian-vehicle-specifications) -::: - -`GetCanadianVehicleSpecifications` returns data from the Canadian Vehicle Specifications (CVS). -The CVS consists of a database of original vehicle dimensions, used primarily in -collision investigation and reconstruction, combined with a search engine. - -The CVS 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. - -`params.year` is the only required query parameter, all others are optional but will still be -included in the query string as blank values even if not provided by the user. -See below Note for more details. - -_NOTE:_ This endpoint does not like missing query keys and will return a 404 error if any of -them are omitted from the query string. Therefore, we must set default values to empty strings -for any query keys that are not provided by the user. This means keys not provided by user will -always show up as "something=" in the query string. `year` is the only key user must provide, -no default value is set for it so that an error will be thrown if not provided by user. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :------------------- | :--------------------------------------------------------------------------------------------------------------------- | -| `params` | `Object` | Object of Query Search names and values to append to the URL as a query string | -| `params.make?` | `string` | Vehicle's make, like "Honda", "Toyota", etc... | -| `params.model?` | `string` | Vehicle's model, like "Pilot", "Focus". Can also include some other elements like Body Type, Engine Model/size, etc... | -| `params.units?` | `string` | "Metric" (default), or "US" for standard units | -| `params.year` | `string` \| `number` | Model year of the vehicle - year >= 1971 | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetCanadianVehicleSpecificationsResults`](api_endpoints_GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults)\>\> - -- Api - Response `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetCanadianVehicleSpecifications.ts:45](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts#L45) - -โ–ธ **GetCanadianVehicleSpecifications**(`params`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------------- | :------------------- | -| `params` | `Object` | -| `params.make?` | `string` | -| `params.model?` | `string` | -| `params.units?` | `string` | -| `params.year` | `string` \| `number` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetCanadianVehicleSpecifications.ts:55](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts#L55) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetEquipmentPlantCodes.md b/apps/docs/src/typedoc/modules/api_endpoints_GetEquipmentPlantCodes.md deleted file mode 100644 index a103a35f..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetEquipmentPlantCodes.md +++ /dev/null @@ -1,131 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetEquipmentPlantCodes - -# Module: api/endpoints/GetEquipmentPlantCodes - -## Table of contents - -### Type Aliases - -- [GetEquipmentPlantCodesParams](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesparams) -- [GetEquipmentPlantCodesResults](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesresults) - -### Functions - -- [GetEquipmentPlantCodes](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodes) - -## Type Aliases - -### GetEquipmentPlantCodesParams - -ฦฌ **GetEquipmentPlantCodesParams**: `Object` - -Query String Parameters for this endpoint - -#### Type declaration - -| Name | Type | -| :-------------- | :------------------------------------------------------------------------------------------------- | -| `equipmentType` | `"1"` \| `"3"` \| `"13"` \| `"16"` \| `1` \| `3` \| `13` \| `16` | -| `reportType` | `"New"` \| `"Updated"` \| `"Closed"` \| `"All"` \| `"new"` \| `"updated"` \| `"closed"` \| `"all"` | -| `year` | `string` \| `number` | - -#### Defined in - -[api/endpoints/GetEquipmentPlantCodes.ts:105](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts#L105) - ---- - -### GetEquipmentPlantCodesResults - -ฦฌ **GetEquipmentPlantCodesResults**: `Object` - -Objects found in the `Results` array of `GetEquipmentPlantCodes` endpoint response. - -#### Type declaration - -| Name | Type | -| :-------------- | :----------------- | -| `Address` | `string` \| `null` | -| `City` | `string` \| `null` | -| `Country` | `string` | -| `DOTCode` | `string` | -| `Name` | `string` | -| `OldDotCode` | `string` | -| `PostalCode` | `string` \| `null` | -| `StateProvince` | `string` \| `null` | -| `Status` | `string` \| `null` | - -#### Defined in - -[api/endpoints/GetEquipmentPlantCodes.ts:122](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts#L122) - -## Functions - -### GetEquipmentPlantCodes - -โ–ธ **GetEquipmentPlantCodes**(`params`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetEquipmentPlantCodesResults`](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesresults)\>\> - -::: tip :bulb: More Information -See: [GetEquipmentPlantCodes Documentation](/api/endpoints/get-equipment-plant-codes) -::: - -`GetEquipmentPlantCodes` returns assigned Equipment Plant Codes. Can be filtered by Year, -Equipment Type and Report Type. - -ALL parameters are required and endpoint will return 404 if there are any undefined keys and/or -values in the query string. - -`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)) - -`params.year`: - -- year >= 2016 -- NOTE: It seems API will still respond with years < 2016 but api docs state only years >= 2016 - are supported - -#### Parameters - -| Name | Type | Description | -| :--------- | :----------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------- | -| `params` | [`GetEquipmentPlantCodesParams`](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesparams) | Object of Query Search names and values to append to the URL as a query string | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetEquipmentPlantCodesResults`](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesresults)\>\> - -- Api Response - `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetEquipmentPlantCodes.ts:47](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts#L47) - -โ–ธ **GetEquipmentPlantCodes**(`params`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------------------------------------------------------- | -| `params` | [`GetEquipmentPlantCodesParams`](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesparams) | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetEquipmentPlantCodes.ts:52](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts#L52) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetMakeForManufacturer.md b/apps/docs/src/typedoc/modules/api_endpoints_GetMakeForManufacturer.md deleted file mode 100644 index 6a5daeda..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetMakeForManufacturer.md +++ /dev/null @@ -1,88 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetMakeForManufacturer - -# Module: api/endpoints/GetMakeForManufacturer - -## Table of contents - -### Type Aliases - -- [GetMakeForManufacturerResults](api_endpoints_GetMakeForManufacturer.md#getmakeformanufacturerresults) - -### Functions - -- [GetMakeForManufacturer](api_endpoints_GetMakeForManufacturer.md#getmakeformanufacturer) - -## Type Aliases - -### GetMakeForManufacturerResults - -ฦฌ **GetMakeForManufacturerResults**: `Object` - -Objects found in the `Results` array of `GetMakeForManufacturer` endpoint response. - -#### Type declaration - -| Name | Type | -| :---------- | :------- | -| `Make_ID` | `number` | -| `Make_Name` | `string` | -| `Mfr_Name` | `string` | - -#### Defined in - -[api/endpoints/GetMakeForManufacturer.ts:77](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakeForManufacturer.ts#L77) - -## Functions - -### GetMakeForManufacturer - -โ–ธ **GetMakeForManufacturer**(`manufacturer`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetMakeForManufacturerResults`](api_endpoints_GetMakeForManufacturer.md#getmakeformanufacturerresults)\>\> - -::: tip :bulb: More Information -See: [GetMakeForManufacturer Documentation](/api/endpoints/get-make-for-manufacturer) -::: - -`GetMakeForManufacturer` returns all the Makes in the vPIC dataset for a specified manufacturer -that is requested. Multiple results are returned in case of multiple matches. - -`manufacturer` name can be a partial name, or a full name for more specificity, e.g. "988", -"honda", "HONDA OF CANADA MFG., INC.", etc. - -- 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. - -#### Parameters - -| Name | Type | Description | -| :------------- | :------------------- | :----------------------------------------------------------------- | -| `manufacturer` | `string` \| `number` | Manufacturer Name or ID | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetMakeForManufacturerResults`](api_endpoints_GetMakeForManufacturer.md#getmakeformanufacturerresults)\>\> - -- Api Response - `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetMakeForManufacturer.ts:31](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakeForManufacturer.ts#L31) - -โ–ธ **GetMakeForManufacturer**(`manufacturer`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------- | :------------------- | -| `manufacturer` | `string` \| `number` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetMakeForManufacturer.ts:36](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakeForManufacturer.ts#L36) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetMakesForManufacturerAndYear.md b/apps/docs/src/typedoc/modules/api_endpoints_GetMakesForManufacturerAndYear.md deleted file mode 100644 index 994df9e1..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetMakesForManufacturerAndYear.md +++ /dev/null @@ -1,103 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetMakesForManufacturerAndYear - -# Module: api/endpoints/GetMakesForManufacturerAndYear - -## Table of contents - -### Type Aliases - -- [GetMakesForManufacturerAndYearResults](api_endpoints_GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) - -### Functions - -- [GetMakesForManufacturerAndYear](api_endpoints_GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyear) - -## Type Aliases - -### GetMakesForManufacturerAndYearResults - -ฦฌ **GetMakesForManufacturerAndYearResults**: `Object` - -Objects found in the `Results` array of `GetMakesForManufacturerAndYear` endpoint response. - -#### Type declaration - -| Name | Type | -| :--------- | :------- | -| `MakeId` | `number` | -| `MakeName` | `string` | -| `MfrId` | `number` | -| `MfrName` | `string` | - -#### Defined in - -[api/endpoints/GetMakesForManufacturerAndYear.ts:105](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts#L105) - -## Functions - -### GetMakesForManufacturerAndYear - -โ–ธ **GetMakesForManufacturerAndYear**(`manufacturer`, `params`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetMakesForManufacturerAndYearResults`](api_endpoints_GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults)\>\> - -::: tip :bulb: More Information -See: [GetMakesForManufacturerAndYear Documentation](/api/endpoints/get-makes-for-manufacturer-and-year) -::: - -`GetMakesForManufacturerAndYear` returns all the Makes in the vPIC dataset for a specified -`manufacturer`, and whose "Year From" and "Year To" range cover the specified `year`. Multiple -results are returned in case of multiple matches. - -Both `manufacturer` and `params.year` are required. - -`manufacturer` name can be a partial name, or a full name for more specificity, e.g. "988", -"honda", "HONDA OF CANADA MFG., INC.", etc. - -- 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. - -`params.year` must be a number > 2016, years prior to 2016 are not supported according to the -NHTSA API. During testing it was found that the API still returns data for years prior to 2016. - -::: warning :exclamation: Required Parameters -Both `manufacturer` and `params.year` are required. -::: - -#### Parameters - -| Name | Type | Description | -| :------------- | :------------------- | :----------------------------------------------------------------------------- | -| `manufacturer` | `string` \| `number` | Manufacturer Name (string) or Manufacturer ID (number) | -| `params` | `Object` | Object of Query Search names and values to append to the URL as a query string | -| `params.year` | `string` \| `number` | Model year of the vehicle - Number, >= 2016 | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetMakesForManufacturerAndYearResults`](api_endpoints_GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults)\>\> - -- Api - Response `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetMakesForManufacturerAndYear.ts:43](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts#L43) - -โ–ธ **GetMakesForManufacturerAndYear**(`manufacturer`, `params`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------- | :------------------- | -| `manufacturer` | `string` \| `number` | -| `params` | `Object` | -| `params.year` | `string` \| `number` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetMakesForManufacturerAndYear.ts:49](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts#L49) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetMakesForVehicleType.md b/apps/docs/src/typedoc/modules/api_endpoints_GetMakesForVehicleType.md deleted file mode 100644 index 824df589..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetMakesForVehicleType.md +++ /dev/null @@ -1,85 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetMakesForVehicleType - -# Module: api/endpoints/GetMakesForVehicleType - -## Table of contents - -### Type Aliases - -- [GetMakesForVehicleTypeResults](api_endpoints_GetMakesForVehicleType.md#getmakesforvehicletyperesults) - -### Functions - -- [GetMakesForVehicleType](api_endpoints_GetMakesForVehicleType.md#getmakesforvehicletype) - -## Type Aliases - -### GetMakesForVehicleTypeResults - -ฦฌ **GetMakesForVehicleTypeResults**: `Object` - -Objects found in the `Results` array of `GetMakesForVehicleType` endpoint response. - -#### Type declaration - -| Name | Type | -| :---------------- | :------- | -| `MakeId` | `number` | -| `MakeName` | `string` | -| `VehicleTypeId` | `number` | -| `VehicleTypeName` | `string` | - -#### Defined in - -[api/endpoints/GetMakesForVehicleType.ts:73](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakesForVehicleType.ts#L73) - -## Functions - -### GetMakesForVehicleType - -โ–ธ **GetMakesForVehicleType**(`typeName`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetMakesForVehicleTypeResults`](api_endpoints_GetMakesForVehicleType.md#getmakesforvehicletyperesults)\>\> - -::: tip :bulb: More Information -See: [GetMakesForVehicleType Documentation](/api/endpoints/get-makes-for-vehicle-type) -::: - -`GetMakesForVehicleType` 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. - -`typeName` can be a partial name, or a full name for more specificity, e.g., "Vehicle", "Moto", -"Low Speed Vehicle", etc. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :----------------------------------------------------------------- | -| `typeName` | `string` | A partial or full vehicle type name | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetMakesForVehicleTypeResults`](api_endpoints_GetMakesForVehicleType.md#getmakesforvehicletyperesults)\>\> - -- Api Response - `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetMakesForVehicleType.ts:27](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakesForVehicleType.ts#L27) - -โ–ธ **GetMakesForVehicleType**(`typeName`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :--------- | :------- | -| `typeName` | `string` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetMakesForVehicleType.ts:32](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakesForVehicleType.ts#L32) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetManufacturerDetails.md b/apps/docs/src/typedoc/modules/api_endpoints_GetManufacturerDetails.md deleted file mode 100644 index 15577187..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetManufacturerDetails.md +++ /dev/null @@ -1,110 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetManufacturerDetails - -# Module: api/endpoints/GetManufacturerDetails - -## Table of contents - -### Type Aliases - -- [GetManufacturerDetailsResults](api_endpoints_GetManufacturerDetails.md#getmanufacturerdetailsresults) - -### Functions - -- [GetManufacturerDetails](api_endpoints_GetManufacturerDetails.md#getmanufacturerdetails) - -## Type Aliases - -### GetManufacturerDetailsResults - -ฦฌ **GetManufacturerDetailsResults**: `Object` - -Objects found in the `Results` array of `GetManufacturerDetails` endpoint response. - -#### Type declaration - -| Name | Type | -| :------------------------- | :------------------------------------------------------------------------------------------ | -| `Address` | `string` \| `null` | -| `Address2` | `string` \| `null` | -| `City` | `string` \| `null` | -| `ContactEmail` | `string` \| `null` | -| `ContactFax` | `string` \| `null` | -| `ContactPhone` | `string` \| `null` | -| `Country` | `string` \| `null` | -| `DBAs` | `string` \| `null` | -| `EquipmentItems` | `unknown`[] | -| `LastUpdated` | `string` | -| `ManufacturerTypes` | { `Name`: `string` }[] | -| `Mfr_CommonName` | `string` \| `null` | -| `Mfr_ID` | `number` \| `null` | -| `Mfr_Name` | `string` \| `null` | -| `OtherManufacturerDetails` | `string` \| `null` | -| `PostalCode` | `string` \| `null` | -| `PrimaryProduct` | `string` \| `null` | -| `PrincipalFirstName` | `string` \| `null` | -| `PrincipalLastName` | `string` \| `null` | -| `PrincipalPosition` | `string` \| `null` | -| `StateProvince` | `string` \| `null` | -| `SubmittedName` | `string` \| `null` | -| `SubmittedOn` | `string` | -| `SubmittedPosition` | `string` \| `null` | -| `VehicleTypes` | { `GVWRFrom`: `string` ; `GVWRTo`: `string` ; `IsPrimary`: `boolean` ; `Name`: `string` }[] | - -#### Defined in - -[api/endpoints/GetManufacturerDetails.ts:77](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetManufacturerDetails.ts#L77) - -## Functions - -### GetManufacturerDetails - -โ–ธ **GetManufacturerDetails**(`manufacturer`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetManufacturerDetailsResults`](api_endpoints_GetManufacturerDetails.md#getmanufacturerdetailsresults)\>\> - -::: tip :bulb: More Information -See: [GetMakesForVehicleType Documentation](/api/endpoints/get-makes-for-vehicle-type) -::: - -`GetManufacturerDetails` provides the details for a specific manufacturer that is requested. -Multiple results are returned in case of multiple matches. - -`manufacturer` name can be a partial name, or a full name for more specificity, e.g. "988", -"honda", "HONDA OF CANADA MFG., INC.", etc. - -- 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. - -#### Parameters - -| Name | Type | Description | -| :------------- | :------------------- | :----------------------------------------------------------------- | -| `manufacturer` | `string` \| `number` | Manufacturer Name or ID | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetManufacturerDetailsResults`](api_endpoints_GetManufacturerDetails.md#getmanufacturerdetailsresults)\>\> - -- Api Response - `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetManufacturerDetails.ts:31](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetManufacturerDetails.ts#L31) - -โ–ธ **GetManufacturerDetails**(`manufacturer`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :------------- | :------------------- | -| `manufacturer` | `string` \| `number` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetManufacturerDetails.ts:36](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetManufacturerDetails.ts#L36) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMake.md b/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMake.md deleted file mode 100644 index 97012c4d..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMake.md +++ /dev/null @@ -1,87 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetModelsForMake - -# Module: api/endpoints/GetModelsForMake - -## Table of contents - -### Type Aliases - -- [GetModelsForMakeResults](api_endpoints_GetModelsForMake.md#getmodelsformakeresults) - -### Functions - -- [GetModelsForMake](api_endpoints_GetModelsForMake.md#getmodelsformake) - -## Type Aliases - -### GetModelsForMakeResults - -ฦฌ **GetModelsForMakeResults**: `Object` - -Objects found in the `Results` array of `GetModelsForMake` endpoint response. - -#### Type declaration - -| Name | Type | -| :----------- | :------- | -| `Make_ID` | `number` | -| `Make_Name` | `string` | -| `Model_ID` | `number` | -| `Model_Name` | `string` | - -#### Defined in - -[api/endpoints/GetModelsForMake.ts:71](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMake.ts#L71) - -## Functions - -### GetModelsForMake - -โ–ธ **GetModelsForMake**(`makeName`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetModelsForMakeResults`](api_endpoints_GetModelsForMake.md#getmodelsformakeresults)\>\> - -::: tip :bulb: More Information -See: [GetModelsForMake Documentation](/api/endpoints/get-models-for-make) -::: - -`GetModelsForMake` 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. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :----------------------------------------------------------------- | -| `makeName` | `string` | Vehicle make name | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetModelsForMakeResults`](api_endpoints_GetModelsForMake.md#getmodelsformakeresults)\>\> - -- Api Response object - -- Api Response `object` - -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetModelsForMake.ts:28](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMake.ts#L28) - -โ–ธ **GetModelsForMake**(`makeName`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :--------- | :------- | -| `makeName` | `string` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetModelsForMake.ts:33](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMake.ts#L33) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeId.md b/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeId.md deleted file mode 100644 index b7e3239c..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeId.md +++ /dev/null @@ -1,102 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetModelsForMakeId - -# Module: api/endpoints/GetModelsForMakeId - -## Table of contents - -### Type Aliases - -- [GetModelsForMakeIdResults](api_endpoints_GetModelsForMakeId.md#getmodelsformakeidresults) - -### Functions - -- [GetModelsForMakeId](api_endpoints_GetModelsForMakeId.md#getmodelsformakeid) - -## Type Aliases - -### GetModelsForMakeIdResults - -ฦฌ **GetModelsForMakeIdResults**: `Object` - -Objects found in the `Results` array of `GetModelsForMakeId` endpoint response. - -#### Type declaration - -| Name | Type | -| :----------- | :------- | -| `Make_ID` | `number` | -| `Make_Name` | `string` | -| `Model_ID` | `number` | -| `Model_Name` | `string` | - -#### Defined in - -[api/endpoints/GetModelsForMakeId.ts:87](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeId.ts#L87) - -## Functions - -### GetModelsForMakeId - -โ–ธ **GetModelsForMakeId**(`makeId`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetModelsForMakeIdResults`](api_endpoints_GetModelsForMakeId.md#getmodelsformakeidresults)\>\> - -::: tip :bulb: More Information -See: [GetModelsForMakeId Documentation](/api/endpoints/get-models-for-make-id) -::: - -`GetModelsForMakeId` returns the Models in the vPIC dataset for a specified Make whose ID is -equal to the `makeID` in the vPIC Dataset. - -You can get `makeID`s via `MAKE_ID` key in Results objects of the following endpoints: - -- `GetAllMakes` endpoint -- `GetMakeForManufacturer` endpoint -- `GetModelsForMake` endpoint -- `GetModelsForMakeYear` endpoint - -You can get `makeID`s via `MakeID` key in Results objects of the following endpoints: - -- `DecodeVinValues` -- `DecodeVinValuesBatch` - -You can get `makeID`s via `ValueId` key in Results objects of the following endpoints. -One of the objects in the `Results` array will contain both `Variable: "Make"` and -`VariableId: 26`. The `ValueId` key in that same object is the `makeID` for use in this -endpoint. - -- `DecodeVin` -- `DecodeVinExtended` - -#### Parameters - -| Name | Type | Description | -| :--------- | :------------------- | :----------------------------------------------------------------- | -| `makeId` | `string` \| `number` | Make ID to search | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetModelsForMakeIdResults`](api_endpoints_GetModelsForMakeId.md#getmodelsformakeidresults)\>\> - -- Api Response `object` - -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetModelsForMakeId.ts:41](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeId.ts#L41) - -โ–ธ **GetModelsForMakeId**(`makeId`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------------------- | -| `makeId` | `string` \| `number` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetModelsForMakeId.ts:46](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeId.ts#L46) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeIdYear.md b/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeIdYear.md deleted file mode 100644 index 4e799287..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeIdYear.md +++ /dev/null @@ -1,116 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetModelsForMakeIdYear - -# Module: api/endpoints/GetModelsForMakeIdYear - -## Table of contents - -### Type Aliases - -- [GetModelsForMakeIdYearResults](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) - -### Functions - -- [GetModelsForMakeIdYear](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyear) - -## Type Aliases - -### GetModelsForMakeIdYearResults - -ฦฌ **GetModelsForMakeIdYearResults**: `Object` - -Objects found in the `Results` array of `GetModelsForMakeIdYear` endpoint response. - -#### Type declaration - -| Name | Type | -| :----------- | :------- | -| `Make_ID` | `number` | -| `Make_Name` | `string` | -| `Model_ID` | `number` | -| `Model_Name` | `string` | - -#### Defined in - -[api/endpoints/GetModelsForMakeIdYear.ts:152](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts#L152) - -## Functions - -### GetModelsForMakeIdYear - -โ–ธ **GetModelsForMakeIdYear**(`params`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetModelsForMakeIdYearResults`](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyearresults)\>\> - -::: tip :bulb: More Information -See: [GetModelsForMakeIdYear Documentation](/api/endpoints/get-models-for-make-id-year) -::: - -`GetModelsForMakeIdYear` 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 an integer and is **required**. - -A minimum of one of the following are also **required** (or a combination of both): - -- `params.modelYear` year you want to search for (years >= 1995 are supported according to NHTSA - docs) -- `params.vehicleType` can be a partial name, or a full name for more specificity, e.g., - "Vehicle", "Moto", "Low Speed Vehicle", etc. - -You can get `makeID`s via `MAKE_ID` key in Results objects of the following endpoints: - -- `GetAllMakes` endpoint -- `GetMakeForManufacturer` endpoint -- `GetModelsForMake` endpoint -- `GetModelsForMakeYear` endpoint - -You can get `makeID`s via `MakeID` key in Results objects of the following endpoints: - -- `DecodeVinValues` -- `DecodeVinValuesBatch` - -You can get `makeID`s via `ValueId` key in Results objects of the following endpoints. -One of the objects in the `Results` array will contain both `Variable: "Make"` and -`VariableId: 26`. The `ValueId` key in that same object is the `makeID` for use in this -endpoint. - -- `DecodeVin` -- `DecodeVinExtended` - -_NOTE:_ This endpoint requires special handling of the params object, such that none of the -params are used in the query string and are instead used as part of the URL path for the -endpoint. To account for this, we pass the params object to the `createUrl` function as the -`path`, after encoding the params object key:values into a url path string. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :----------------------------------------------------------------------------- | -| `params` | `Object` | Object of Query Search names and values to append to the URL as a query string | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetModelsForMakeIdYearResults`](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyearresults)\>\> - -- Api Response - `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetModelsForMakeIdYear.ts:61](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts#L61) - -โ–ธ **GetModelsForMakeIdYear**(`params`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `params` | `Object` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetModelsForMakeIdYear.ts:71](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts#L71) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeYear.md b/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeYear.md deleted file mode 100644 index e0c01795..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeYear.md +++ /dev/null @@ -1,97 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetModelsForMakeYear - -# Module: api/endpoints/GetModelsForMakeYear - -## Table of contents - -### Type Aliases - -- [GetModelsForMakeYearResults](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyearresults) - -### Functions - -- [GetModelsForMakeYear](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyear) - -## Type Aliases - -### GetModelsForMakeYearResults - -ฦฌ **GetModelsForMakeYearResults**: `Object` - -Objects found in the `Results` array of `GetModelsForMakeYear` endpoint response. - -#### Type declaration - -| Name | Type | -| :----------- | :------- | -| `Make_ID` | `number` | -| `Make_Name` | `string` | -| `Model_ID` | `number` | -| `Model_Name` | `string` | - -#### Defined in - -[api/endpoints/GetModelsForMakeYear.ts:133](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeYear.ts#L133) - -## Functions - -### GetModelsForMakeYear - -โ–ธ **GetModelsForMakeYear**(`params`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetModelsForMakeYearResults`](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyearresults)\>\> - -::: tip :bulb: More Information -See: [GetModelsForMakeYear Documentation](/api/endpoints/get-models-for-make-year) -::: - -`GetModelsForMakeYear` 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 also **required** (or a combination of both): - -- `params.modelYear` year you want to search for (years >= 1995 are supported according to NHTSA - docs) -- `params.vehicleType` can be a partial name, or a full name for more specificity, e.g., - "Vehicle", "Moto", "Low Speed Vehicle", etc. - -_NOTE:_ This endpoint requires special handling of the params object, such that none of the -params are used in the query string and are instead used as part of the URL path for the -endpoint. To account for this, we pass the params object to the `createUrl` function as the -`path`, after encoding the params object key:values into a url path string. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :----------------------------------------------------------------------------- | -| `params` | `Object` | Object of Query Search names and values to append to the URL as a query string | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetModelsForMakeYearResults`](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyearresults)\>\> - -- Api Response `object` - -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetModelsForMakeYear.ts:47](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeYear.ts#L47) - -โ–ธ **GetModelsForMakeYear**(`params`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------- | -| `params` | `Object` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetModelsForMakeYear.ts:57](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeYear.ts#L57) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetParts.md b/apps/docs/src/typedoc/modules/api_endpoints_GetParts.md deleted file mode 100644 index 3ec3779d..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetParts.md +++ /dev/null @@ -1,163 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetParts - -# Module: api/endpoints/GetParts - -## Table of contents - -### Type Aliases - -- [GetPartsResults](api_endpoints_GetParts.md#getpartsresults) - -### Functions - -- [GetParts](api_endpoints_GetParts.md#getparts) - -## Type Aliases - -### GetPartsResults - -ฦฌ **GetPartsResults**: `Object` - -Objects found in the `Results` array of `GetParts` endpoint response. - -#### Type declaration - -| Name | Type | -| :----------------- | :----------------- | -| `CoverLetterURL` | `string` | -| `LetterDate` | `string` | -| `ManufacturerId` | `number` | -| `ManufacturerName` | `string` | -| `ModelYearFrom` | `number` \| `null` | -| `ModelYearTo` | `number` \| `null` | -| `Name` | `string` | -| `Type` | `string` | -| `URL` | `string` | - -#### Defined in - -[api/endpoints/GetParts.ts:143](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetParts.ts#L143) - -## Functions - -### GetParts - -โ–ธ **GetParts**(`doFetch?`, `_dummy?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetPartsResults`](api_endpoints_GetParts.md#getpartsresults)\>\> - -::: tip :bulb: More Information -See: [GetParts Documentation](/api/endpoints/get-parts) -::: - -`GetParts` 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. - -`params.manufacturer`: - -- (optional) if supplied value is a number - method will do exact match on Manufacturer's Id -- if supplied value 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 name can be a partial name, or a full name for more specificity, e.g., "988", - "HONDA", "HONDA OF CANADA MFG., INC.", etc. - -`params.type`: - -- (optional) number, 565 (Vehicle Identification Number Guidance, based on 49 CFR Part 565) - or 566 (Manufacturer Identification โ€“ Reporting Requirements based on 49 CFR Part 566) - -`params.fromDate`: - -- (optional) ORG's Letter Date should be on or after this date - -`params.toDate`: - -- (optional) ORG's Letter Date should be on or before this date - -`params.page`: - -- (optional) number, 1 (default) first 1000 records, 2 - next 1000 records, etc - -#### Parameters - -| Name | Type | Description | -| :--------- | :---------- | :----------------------------------------------------------------- | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | -| `_dummy?` | `undefined` | - | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetPartsResults`](api_endpoints_GetParts.md#getpartsresults)\>\> - -- Api Response `object` - -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetParts.ts:60](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetParts.ts#L60) - -โ–ธ **GetParts**(`doFetch?`, `_dummy?`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :--------- | :---------- | -| `doFetch?` | `false` | -| `_dummy?` | `undefined` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetParts.ts:65](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetParts.ts#L65) - -โ–ธ **GetParts**(`params`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :--------------------- | :------------------- | -| `params` | `Object` | -| `params.fromDate?` | `string` | -| `params.manufacturer?` | `string` \| `number` | -| `params.page?` | `string` \| `number` | -| `params.toDate?` | `string` | -| `params.type?` | `565` \| `566` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetParts.ts:67](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetParts.ts#L67) - -โ–ธ **GetParts**(`params?`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetPartsResults`](api_endpoints_GetParts.md#getpartsresults)\>\> - -#### Parameters - -| Name | Type | -| :--------------------- | :------------------- | -| `params?` | `Object` | -| `params.fromDate?` | `string` | -| `params.manufacturer?` | `string` \| `number` | -| `params.page?` | `string` \| `number` | -| `params.toDate?` | `string` | -| `params.type?` | `565` \| `566` | -| `doFetch?` | `true` | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetPartsResults`](api_endpoints_GetParts.md#getpartsresults)\>\> - -#### Defined in - -[api/endpoints/GetParts.ts:78](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetParts.ts#L78) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetVehicleTypesForMake.md b/apps/docs/src/typedoc/modules/api_endpoints_GetVehicleTypesForMake.md deleted file mode 100644 index f3ba4cba..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetVehicleTypesForMake.md +++ /dev/null @@ -1,85 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetVehicleTypesForMake - -# Module: api/endpoints/GetVehicleTypesForMake - -## Table of contents - -### Type Aliases - -- [GetVehicleTypesForMakeResults](api_endpoints_GetVehicleTypesForMake.md#getvehicletypesformakeresults) - -### Functions - -- [GetVehicleTypesForMake](api_endpoints_GetVehicleTypesForMake.md#getvehicletypesformake) - -## Type Aliases - -### GetVehicleTypesForMakeResults - -ฦฌ **GetVehicleTypesForMakeResults**: `Object` - -Objects found in the `Results` array of `GetVehicleTypesForMake` endpoint response. - -#### Type declaration - -| Name | Type | -| :---------------- | :------- | -| `MakeId` | `number` | -| `MakeName` | `string` | -| `VehicleTypeId` | `number` | -| `VehicleTypeName` | `string` | - -#### Defined in - -[api/endpoints/GetVehicleTypesForMake.ts:73](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts#L73) - -## Functions - -### GetVehicleTypesForMake - -โ–ธ **GetVehicleTypesForMake**(`makeName`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetVehicleTypesForMakeResults`](api_endpoints_GetVehicleTypesForMake.md#getvehicletypesformakeresults)\>\> - -::: tip :bulb: More Information -See: [GetVehicleTypesForMake Documentation](/api/endpoints/get-vehicle-types-for-make) -::: - -`GetVehicleTypesForMake` 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. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :----------------------------------------------------------------- | -| `makeName` | `string` | Name of the vehicle make to search | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetVehicleTypesForMakeResults`](api_endpoints_GetVehicleTypesForMake.md#getvehicletypesformakeresults)\>\> - -- Api Response - `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetVehicleTypesForMake.ts:27](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts#L27) - -โ–ธ **GetVehicleTypesForMake**(`makeName`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :--------- | :------- | -| `makeName` | `string` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetVehicleTypesForMake.ts:32](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts#L32) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetVehicleTypesForMakeId.md b/apps/docs/src/typedoc/modules/api_endpoints_GetVehicleTypesForMakeId.md deleted file mode 100644 index b1fde33f..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetVehicleTypesForMakeId.md +++ /dev/null @@ -1,100 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetVehicleTypesForMakeId - -# Module: api/endpoints/GetVehicleTypesForMakeId - -## Table of contents - -### Type Aliases - -- [GetVehicleTypesForMakeIdResults](api_endpoints_GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) - -### Functions - -- [GetVehicleTypesForMakeId](api_endpoints_GetVehicleTypesForMakeId.md#getvehicletypesformakeid) - -## Type Aliases - -### GetVehicleTypesForMakeIdResults - -ฦฌ **GetVehicleTypesForMakeIdResults**: `Object` - -Objects found in the `Results` array of `GetVehicleTypesForMakeId` endpoint response. - -#### Type declaration - -| Name | Type | -| :---------------- | :------- | -| `VehicleTypeId` | `number` | -| `VehicleTypeName` | `string` | - -#### Defined in - -[api/endpoints/GetVehicleTypesForMakeId.ts:87](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts#L87) - -## Functions - -### GetVehicleTypesForMakeId - -โ–ธ **GetVehicleTypesForMakeId**(`makeId`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetVehicleTypesForMakeIdResults`](api_endpoints_GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults)\>\> - -::: tip :bulb: More Information -See: [GetVehicleTypesForMakeId Documentation](/api/endpoints/get-vehicle-types-for-make-id) -::: - -`GetVehicleTypesForMakeId` returns the Models in the vPIC dataset for a specified Make -whose ID is equal to the `makeID` in the vPIC Dataset. - -You can get `makeID`s via `MAKE_ID` key in Results objects of the following endpoints: - -- `GetAllMakes` endpoint -- `GetMakeForManufacturer` endpoint -- `GetModelsForMake` endpoint -- `GetModelsForMakeYear` endpoint - -You can get `makeID`s via `MakeID` key in Results objects of the following endpoints: - -- `DecodeVinValues` -- `DecodeVinValuesBatch` - -You can get `makeID`s via `ValueId` key in Results objects of the following endpoints. -One of the objects in the `Results` array will contain both `Variable: "Make"` and -`VariableId: 26`. The `ValueId` key in that same object is the `makeID` for use in this -endpoint. - -- `DecodeVin` -- `DecodeVinExtended` - -#### Parameters - -| Name | Type | Description | -| :--------- | :------------------- | :----------------------------------------------------------------- | -| `makeId` | `string` \| `number` | Make ID to search | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetVehicleTypesForMakeIdResults`](api_endpoints_GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults)\>\> - -- Api Response - `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetVehicleTypesForMakeId.ts:41](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts#L41) - -โ–ธ **GetVehicleTypesForMakeId**(`makeId`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------------------- | -| `makeId` | `string` \| `number` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetVehicleTypesForMakeId.ts:46](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts#L46) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetVehicleVariableList.md b/apps/docs/src/typedoc/modules/api_endpoints_GetVehicleVariableList.md deleted file mode 100644 index fb89f554..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetVehicleVariableList.md +++ /dev/null @@ -1,81 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetVehicleVariableList - -# Module: api/endpoints/GetVehicleVariableList - -## Table of contents - -### Type Aliases - -- [GetVehicleVariableListResults](api_endpoints_GetVehicleVariableList.md#getvehiclevariablelistresults) - -### Functions - -- [GetVehicleVariableList](api_endpoints_GetVehicleVariableList.md#getvehiclevariablelist) - -## Type Aliases - -### GetVehicleVariableListResults - -ฦฌ **GetVehicleVariableListResults**: `Object` - -Objects found in the `Results` array of `GetVehicleVariableList` endpoint response. - -#### Type declaration - -| Name | Type | -| :------------ | :------------------------------------------------- | -| `DataType` | `"string"` \| `"int"` \| `"decimal"` \| `"lookup"` | -| `Description` | `string` | -| `GroupName` | `string` \| `null` | -| `ID` | `number` | -| `Name` | `string` | - -#### Defined in - -[api/endpoints/GetVehicleVariableList.ts:54](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableList.ts#L54) - -## Functions - -### GetVehicleVariableList - -โ–ธ **GetVehicleVariableList**(`doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetVehicleVariableListResults`](api_endpoints_GetVehicleVariableList.md#getvehiclevariablelistresults)\>\> - -::: tip :bulb: More Information -See: [GetVehicleVariableList Documentation](/api/endpoints/get-vehicle-variable-list) -::: - -`GetVehicleVariableList` 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. - -#### Parameters - -| Name | Type | Description | -| :--------- | :----- | :----------------------------------------------------------------- | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetVehicleVariableListResults`](api_endpoints_GetVehicleVariableList.md#getvehiclevariablelistresults)\>\> - -- Api Response - `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetVehicleVariableList.ts:23](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableList.ts#L23) - -โ–ธ **GetVehicleVariableList**(`doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :------ | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetVehicleVariableList.ts:27](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableList.ts#L27) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetVehicleVariableValuesList.md b/apps/docs/src/typedoc/modules/api_endpoints_GetVehicleVariableValuesList.md deleted file mode 100644 index 4e16476c..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetVehicleVariableValuesList.md +++ /dev/null @@ -1,86 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetVehicleVariableValuesList - -# Module: api/endpoints/GetVehicleVariableValuesList - -## Table of contents - -### Type Aliases - -- [GetVehicleVariableValuesListResults](api_endpoints_GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) - -### Functions - -- [GetVehicleVariableValuesList](api_endpoints_GetVehicleVariableValuesList.md#getvehiclevariablevalueslist) - -## Type Aliases - -### GetVehicleVariableValuesListResults - -ฦฌ **GetVehicleVariableValuesListResults**: `Object` - -Objects found in the `Results` array of `GetVehicleVariableValuesList` endpoint response. - -#### Type declaration - -| Name | Type | -| :------------ | :------- | -| `ElementName` | `string` | -| `Id` | `number` | -| `Name` | `string` | - -#### Defined in - -[api/endpoints/GetVehicleVariableValuesList.ts:75](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts#L75) - -## Functions - -### GetVehicleVariableValuesList - -โ–ธ **GetVehicleVariableValuesList**(`variableValue`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetVehicleVariableValuesListResults`](api_endpoints_GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults)\>\> - -::: tip :bulb: More Information -See: [GetVehicleVariableValuesList Documentation](/api/endpoints/get-vehicle-variable-values-list) -::: - -`GetVehicleVariableValuesList` provides a list of all the accepted values for a given variable -that are stored in the vPIC dataset. - -If `variableValue` is a string, it must use full name, not just part of it, e.g., -"Battery Type", not "Battery" - -`variableValue` can be also be a number, which is the ID of the variable, e.g., 1, 2, 3, etc. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :------------------- | :----------------------------------------------------------------- | -| `variableValue` | `string` \| `number` | The variable you want to get a values list of | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetVehicleVariableValuesListResults`](api_endpoints_GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults)\>\> - -- Api Response - `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetVehicleVariableValuesList.ts:29](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts#L29) - -โ–ธ **GetVehicleVariableValuesList**(`variableValue`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------------- | :------------------- | -| `variableValue` | `string` \| `number` | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetVehicleVariableValuesList.ts:34](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts#L34) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_GetWMIsForManufacturer.md b/apps/docs/src/typedoc/modules/api_endpoints_GetWMIsForManufacturer.md deleted file mode 100644 index fd32b665..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetWMIsForManufacturer.md +++ /dev/null @@ -1,108 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetWMIsForManufacturer - -# Module: api/endpoints/GetWMIsForManufacturer - -## Table of contents - -### Type Aliases - -- [GetWMIsForManufacturerResults](api_endpoints_GetWMIsForManufacturer.md#getwmisformanufacturerresults) - -### Functions - -- [GetWMIsForManufacturer](api_endpoints_GetWMIsForManufacturer.md#getwmisformanufacturer) - -## Type Aliases - -### GetWMIsForManufacturerResults - -ฦฌ **GetWMIsForManufacturerResults**: `Object` - -Objects found in the `Results` array of `GetWMIsForManufacturer` endpoint response. - -#### Type declaration - -| Name | Type | -| :---------------------- | :----------------- | -| `Country` | `string` \| `null` | -| `CreatedOn` | `string` | -| `DateAvailableToPublic` | `string` | -| `Id` | `number` | -| `Name` | `string` | -| `UpdatedOn` | `string` | -| `VehicleType` | `string` | -| `WMI` | `string` | - -#### Defined in - -[api/endpoints/GetWMIsForManufacturer.ts:123](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts#L123) - -## Functions - -### GetWMIsForManufacturer - -โ–ธ **GetWMIsForManufacturer**(`params?`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetWMIsForManufacturerResults`](api_endpoints_GetWMIsForManufacturer.md#getwmisformanufacturerresults)\>\> - -::: tip :bulb: More Information -See: [GetWMIsForManufacturer Documentation](/api/endpoints/get-wmis-for-manufacturer) -::: - -`GetWMIsForManufacturer` provides information on the World Manufacturer Identifier (WMI) for a -specified `manufacturer`. Only WMIs registered in vPICList are displayed. Multiple results are -returned in case of multiple matches. - -Both `manufacturer` and `vehicleType` are optional but at least one must be provided. - -`manufacturer` can be a partial name, or a full name for more specificity, or WMI ID number, -e.g., "Merc", "Mercedes Benz", 987, etc. - -- If `manufacturer` is a number - method will do exact match on Manufacturer's Id -- If `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) - -`vehicleType` can be a string or number, e.g., "car", 1, etc. - -- If `vehicleType` is a number - method will do exact match on VehicleType's Id -- If `vehicleType` is a string - it will look for VehicleType whose name is LIKE the provided - name (it accepts a partial VehicleType name as an input). - -_NOTE_: For this endpoint, `manufacturer` is actually part of the path string, not a query param. -We include `manufacturer` in params as it's easier to type the function args using the -'AtLeastOne' type if they are placed in the same object (params). This can cause confusion as -it's not consistent with other endpoint methods where path string is the first arg, and the query -params are the second arg. - -#### Parameters - -| Name | Type | Description | -| :--------- | :--------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------- | -| `params?` | [`AtLeastOne`](utils_types.md#atleastone)<{ `manufacturer?`: `string` \| `number` ; `vehicleType?`: `string` \| `number` }\> | Object of Query Search names and values to append to the URL as a query string | -| `doFetch?` | `true` | Whether to fetch the data or just return the URL (default: `true`) | - -#### Returns - -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetWMIsForManufacturerResults`](api_endpoints_GetWMIsForManufacturer.md#getwmisformanufacturerresults)\>\> - -- Api Response - `object` -or- url `string` if `doFetch = false` - -#### Defined in - -[api/endpoints/GetWMIsForManufacturer.ts:48](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts#L48) - -โ–ธ **GetWMIsForManufacturer**(`params`, `doFetch`): `Promise`<`string`\> - -#### Parameters - -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------------------------------- | -| `params` | [`AtLeastOne`](utils_types.md#atleastone)<{ `manufacturer?`: `string` \| `number` ; `vehicleType?`: `string` \| `number` }\> | -| `doFetch` | `false` | - -#### Returns - -`Promise`<`string`\> - -#### Defined in - -[api/endpoints/GetWMIsForManufacturer.ts:56](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts#L56) diff --git a/apps/docs/src/typedoc/modules/api_endpoints_types.md b/apps/docs/src/typedoc/modules/api_endpoints_types.md deleted file mode 100644 index 6d9de49c..00000000 --- a/apps/docs/src/typedoc/modules/api_endpoints_types.md +++ /dev/null @@ -1,197 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/types - -# Module: api/endpoints/types - -## Table of contents - -### References - -- [DecodeVinExtendedResults](api_endpoints_types.md#decodevinextendedresults) -- [DecodeVinExtendedVariable](api_endpoints_types.md#decodevinextendedvariable) -- [DecodeVinResults](api_endpoints_types.md#decodevinresults) -- [DecodeVinValuesBatchResults](api_endpoints_types.md#decodevinvaluesbatchresults) -- [DecodeVinValuesExtendedResults](api_endpoints_types.md#decodevinvaluesextendedresults) -- [DecodeVinValuesResults](api_endpoints_types.md#decodevinvaluesresults) -- [DecodeVinVariable](api_endpoints_types.md#decodevinvariable) -- [DecodeWMIResults](api_endpoints_types.md#decodewmiresults) -- [GetAllMakesResults](api_endpoints_types.md#getallmakesresults) -- [GetAllManufacturersResults](api_endpoints_types.md#getallmanufacturersresults) -- [GetCanadianVehicleSpecificationsResults](api_endpoints_types.md#getcanadianvehiclespecificationsresults) -- [GetEquipmentPlantCodesParams](api_endpoints_types.md#getequipmentplantcodesparams) -- [GetEquipmentPlantCodesResults](api_endpoints_types.md#getequipmentplantcodesresults) -- [GetMakeForManufacturerResults](api_endpoints_types.md#getmakeformanufacturerresults) -- [GetMakesForManufacturerAndYearResults](api_endpoints_types.md#getmakesformanufacturerandyearresults) -- [GetMakesForVehicleTypeResults](api_endpoints_types.md#getmakesforvehicletyperesults) -- [GetManufacturerDetailsResults](api_endpoints_types.md#getmanufacturerdetailsresults) -- [GetModelsForMakeIdResults](api_endpoints_types.md#getmodelsformakeidresults) -- [GetModelsForMakeIdYearResults](api_endpoints_types.md#getmodelsformakeidyearresults) -- [GetModelsForMakeResults](api_endpoints_types.md#getmodelsformakeresults) -- [GetModelsForMakeYearResults](api_endpoints_types.md#getmodelsformakeyearresults) -- [GetPartsResults](api_endpoints_types.md#getpartsresults) -- [GetVehicleTypesForMakeIdResults](api_endpoints_types.md#getvehicletypesformakeidresults) -- [GetVehicleTypesForMakeResults](api_endpoints_types.md#getvehicletypesformakeresults) -- [GetVehicleVariableListResults](api_endpoints_types.md#getvehiclevariablelistresults) -- [GetVehicleVariableValuesListResults](api_endpoints_types.md#getvehiclevariablevalueslistresults) -- [GetWMIsForManufacturerResults](api_endpoints_types.md#getwmisformanufacturerresults) - -## References - -### DecodeVinExtendedResults - -Re-exports [DecodeVinExtendedResults](api_endpoints_DecodeVinExtended.md#decodevinextendedresults) - ---- - -### DecodeVinExtendedVariable - -Re-exports [DecodeVinExtendedVariable](api_endpoints_DecodeVinExtended.md#decodevinextendedvariable) - ---- - -### DecodeVinResults - -Re-exports [DecodeVinResults](api_endpoints_DecodeVin.md#decodevinresults) - ---- - -### DecodeVinValuesBatchResults - -Re-exports [DecodeVinValuesBatchResults](api_endpoints_DecodeVinValuesBatch.md#decodevinvaluesbatchresults) - ---- - -### DecodeVinValuesExtendedResults - -Re-exports [DecodeVinValuesExtendedResults](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextendedresults) - ---- - -### DecodeVinValuesResults - -Re-exports [DecodeVinValuesResults](api_endpoints_DecodeVinValues.md#decodevinvaluesresults) - ---- - -### DecodeVinVariable - -Re-exports [DecodeVinVariable](api_endpoints_DecodeVin.md#decodevinvariable) - ---- - -### DecodeWMIResults - -Re-exports [DecodeWMIResults](api_endpoints_DecodeWMI.md#decodewmiresults) - ---- - -### GetAllMakesResults - -Re-exports [GetAllMakesResults](api_endpoints_GetAllMakes.md#getallmakesresults) - ---- - -### GetAllManufacturersResults - -Re-exports [GetAllManufacturersResults](api_endpoints_GetAllManufacturers.md#getallmanufacturersresults) - ---- - -### GetCanadianVehicleSpecificationsResults - -Re-exports [GetCanadianVehicleSpecificationsResults](api_endpoints_GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) - ---- - -### GetEquipmentPlantCodesParams - -Re-exports [GetEquipmentPlantCodesParams](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesparams) - ---- - -### GetEquipmentPlantCodesResults - -Re-exports [GetEquipmentPlantCodesResults](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesresults) - ---- - -### GetMakeForManufacturerResults - -Re-exports [GetMakeForManufacturerResults](api_endpoints_GetMakeForManufacturer.md#getmakeformanufacturerresults) - ---- - -### GetMakesForManufacturerAndYearResults - -Re-exports [GetMakesForManufacturerAndYearResults](api_endpoints_GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) - ---- - -### GetMakesForVehicleTypeResults - -Re-exports [GetMakesForVehicleTypeResults](api_endpoints_GetMakesForVehicleType.md#getmakesforvehicletyperesults) - ---- - -### GetManufacturerDetailsResults - -Re-exports [GetManufacturerDetailsResults](api_endpoints_GetManufacturerDetails.md#getmanufacturerdetailsresults) - ---- - -### GetModelsForMakeIdResults - -Re-exports [GetModelsForMakeIdResults](api_endpoints_GetModelsForMakeId.md#getmodelsformakeidresults) - ---- - -### GetModelsForMakeIdYearResults - -Re-exports [GetModelsForMakeIdYearResults](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) - ---- - -### GetModelsForMakeResults - -Re-exports [GetModelsForMakeResults](api_endpoints_GetModelsForMake.md#getmodelsformakeresults) - ---- - -### GetModelsForMakeYearResults - -Re-exports [GetModelsForMakeYearResults](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyearresults) - ---- - -### GetPartsResults - -Re-exports [GetPartsResults](api_endpoints_GetParts.md#getpartsresults) - ---- - -### GetVehicleTypesForMakeIdResults - -Re-exports [GetVehicleTypesForMakeIdResults](api_endpoints_GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) - ---- - -### GetVehicleTypesForMakeResults - -Re-exports [GetVehicleTypesForMakeResults](api_endpoints_GetVehicleTypesForMake.md#getvehicletypesformakeresults) - ---- - -### GetVehicleVariableListResults - -Re-exports [GetVehicleVariableListResults](api_endpoints_GetVehicleVariableList.md#getvehiclevariablelistresults) - ---- - -### GetVehicleVariableValuesListResults - -Re-exports [GetVehicleVariableValuesListResults](api_endpoints_GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) - ---- - -### GetWMIsForManufacturerResults - -Re-exports [GetWMIsForManufacturerResults](api_endpoints_GetWMIsForManufacturer.md#getwmisformanufacturerresults) diff --git a/apps/docs/src/typedoc/modules/api_types.md b/apps/docs/src/typedoc/modules/api_types.md deleted file mode 100644 index e7a2a201..00000000 --- a/apps/docs/src/typedoc/modules/api_types.md +++ /dev/null @@ -1,235 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/types - -# Module: api/types - -## Table of contents - -### References - -- [CreateUrlOptions](api_types.md#createurloptions) -- [DecodeVinExtendedResults](api_types.md#decodevinextendedresults) -- [DecodeVinExtendedVariable](api_types.md#decodevinextendedvariable) -- [DecodeVinResults](api_types.md#decodevinresults) -- [DecodeVinValuesBatchResults](api_types.md#decodevinvaluesbatchresults) -- [DecodeVinValuesExtendedResults](api_types.md#decodevinvaluesextendedresults) -- [DecodeVinValuesResults](api_types.md#decodevinvaluesresults) -- [DecodeVinVariable](api_types.md#decodevinvariable) -- [DecodeWMIResults](api_types.md#decodewmiresults) -- [GetAllMakesResults](api_types.md#getallmakesresults) -- [GetAllManufacturersResults](api_types.md#getallmanufacturersresults) -- [GetCanadianVehicleSpecificationsResults](api_types.md#getcanadianvehiclespecificationsresults) -- [GetEquipmentPlantCodesParams](api_types.md#getequipmentplantcodesparams) -- [GetEquipmentPlantCodesResults](api_types.md#getequipmentplantcodesresults) -- [GetMakeForManufacturerResults](api_types.md#getmakeformanufacturerresults) -- [GetMakesForManufacturerAndYearResults](api_types.md#getmakesformanufacturerandyearresults) -- [GetMakesForVehicleTypeResults](api_types.md#getmakesforvehicletyperesults) -- [GetManufacturerDetailsResults](api_types.md#getmanufacturerdetailsresults) -- [GetModelsForMakeIdResults](api_types.md#getmodelsformakeidresults) -- [GetModelsForMakeIdYearResults](api_types.md#getmodelsformakeidyearresults) -- [GetModelsForMakeResults](api_types.md#getmodelsformakeresults) -- [GetModelsForMakeYearResults](api_types.md#getmodelsformakeyearresults) -- [GetPartsResults](api_types.md#getpartsresults) -- [GetVehicleTypesForMakeIdResults](api_types.md#getvehicletypesformakeidresults) -- [GetVehicleTypesForMakeResults](api_types.md#getvehicletypesformakeresults) -- [GetVehicleVariableListResults](api_types.md#getvehiclevariablelistresults) -- [GetVehicleVariableValuesListResults](api_types.md#getvehiclevariablevalueslistresults) -- [GetWMIsForManufacturerResults](api_types.md#getwmisformanufacturerresults) - -### Type Aliases - -- [NhtsaResponse](api_types.md#nhtsaresponse) - -## References - -### CreateUrlOptions - -Re-exports [CreateUrlOptions](api_useNHTSA.md#createurloptions) - ---- - -### DecodeVinExtendedResults - -Re-exports [DecodeVinExtendedResults](api_endpoints_DecodeVinExtended.md#decodevinextendedresults) - ---- - -### DecodeVinExtendedVariable - -Re-exports [DecodeVinExtendedVariable](api_endpoints_DecodeVinExtended.md#decodevinextendedvariable) - ---- - -### DecodeVinResults - -Re-exports [DecodeVinResults](api_endpoints_DecodeVin.md#decodevinresults) - ---- - -### DecodeVinValuesBatchResults - -Re-exports [DecodeVinValuesBatchResults](api_endpoints_DecodeVinValuesBatch.md#decodevinvaluesbatchresults) - ---- - -### DecodeVinValuesExtendedResults - -Re-exports [DecodeVinValuesExtendedResults](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextendedresults) - ---- - -### DecodeVinValuesResults - -Re-exports [DecodeVinValuesResults](api_endpoints_DecodeVinValues.md#decodevinvaluesresults) - ---- - -### DecodeVinVariable - -Re-exports [DecodeVinVariable](api_endpoints_DecodeVin.md#decodevinvariable) - ---- - -### DecodeWMIResults - -Re-exports [DecodeWMIResults](api_endpoints_DecodeWMI.md#decodewmiresults) - ---- - -### GetAllMakesResults - -Re-exports [GetAllMakesResults](api_endpoints_GetAllMakes.md#getallmakesresults) - ---- - -### GetAllManufacturersResults - -Re-exports [GetAllManufacturersResults](api_endpoints_GetAllManufacturers.md#getallmanufacturersresults) - ---- - -### GetCanadianVehicleSpecificationsResults - -Re-exports [GetCanadianVehicleSpecificationsResults](api_endpoints_GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) - ---- - -### GetEquipmentPlantCodesParams - -Re-exports [GetEquipmentPlantCodesParams](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesparams) - ---- - -### GetEquipmentPlantCodesResults - -Re-exports [GetEquipmentPlantCodesResults](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesresults) - ---- - -### GetMakeForManufacturerResults - -Re-exports [GetMakeForManufacturerResults](api_endpoints_GetMakeForManufacturer.md#getmakeformanufacturerresults) - ---- - -### GetMakesForManufacturerAndYearResults - -Re-exports [GetMakesForManufacturerAndYearResults](api_endpoints_GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) - ---- - -### GetMakesForVehicleTypeResults - -Re-exports [GetMakesForVehicleTypeResults](api_endpoints_GetMakesForVehicleType.md#getmakesforvehicletyperesults) - ---- - -### GetManufacturerDetailsResults - -Re-exports [GetManufacturerDetailsResults](api_endpoints_GetManufacturerDetails.md#getmanufacturerdetailsresults) - ---- - -### GetModelsForMakeIdResults - -Re-exports [GetModelsForMakeIdResults](api_endpoints_GetModelsForMakeId.md#getmodelsformakeidresults) - ---- - -### GetModelsForMakeIdYearResults - -Re-exports [GetModelsForMakeIdYearResults](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) - ---- - -### GetModelsForMakeResults - -Re-exports [GetModelsForMakeResults](api_endpoints_GetModelsForMake.md#getmodelsformakeresults) - ---- - -### GetModelsForMakeYearResults - -Re-exports [GetModelsForMakeYearResults](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyearresults) - ---- - -### GetPartsResults - -Re-exports [GetPartsResults](api_endpoints_GetParts.md#getpartsresults) - ---- - -### GetVehicleTypesForMakeIdResults - -Re-exports [GetVehicleTypesForMakeIdResults](api_endpoints_GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) - ---- - -### GetVehicleTypesForMakeResults - -Re-exports [GetVehicleTypesForMakeResults](api_endpoints_GetVehicleTypesForMake.md#getvehicletypesformakeresults) - ---- - -### GetVehicleVariableListResults - -Re-exports [GetVehicleVariableListResults](api_endpoints_GetVehicleVariableList.md#getvehiclevariablelistresults) - ---- - -### GetVehicleVariableValuesListResults - -Re-exports [GetVehicleVariableValuesListResults](api_endpoints_GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) - ---- - -### GetWMIsForManufacturerResults - -Re-exports [GetWMIsForManufacturerResults](api_endpoints_GetWMIsForManufacturer.md#getwmisformanufacturerresults) - -## Type Aliases - -### NhtsaResponse - -ฦฌ **NhtsaResponse**<`T`\>: `Object` - -Response data returned from the NHTSA VPIC API. `Results` key will be an array of objects of type "T" - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Type declaration - -| Name | Type | Description | -| :--------------- | :----------------- | :-------------------------------------------------------------------------------------- | -| `Count` | `number` | The number of items returned in the Results object. Will = 0 if no Results | -| `Message` | `string` | A message describing the Results. If Count is 0 check the Message for helpful info | -| `Results` | `T`[] | An array of objects returned by NHTSA VPIC API, specific to each individual API Action. | -| `SearchCriteria` | `string` \| `null` | Search terms (VIN, WMI, etc) used in the request URL. | - -#### Defined in - -[api/types.ts:12](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/types.ts#L12) diff --git a/apps/docs/src/typedoc/modules/api_useNHTSA.md b/apps/docs/src/typedoc/modules/api_useNHTSA.md deleted file mode 100644 index 6795dc3d..00000000 --- a/apps/docs/src/typedoc/modules/api_useNHTSA.md +++ /dev/null @@ -1,83 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/useNHTSA - -# Module: api/useNHTSA - -## Table of contents - -### Type Aliases - -- [CreateUrlOptions](api_useNHTSA.md#createurloptions) - -### Functions - -- [useNHTSA](api_useNHTSA.md#usenhtsa) - -## Type Aliases - -### CreateUrlOptions - -ฦฌ **CreateUrlOptions**: `Object` - -#### Type declaration - -| Name | Type | -| :-------------------- | :------------------------------------------------------------ | -| `allowEmptyParams?` | `boolean` | -| `endpointName` | `string` | -| `includeQueryString?` | `boolean` | -| `params?` | [`QueryStringParams`](utils_queryString.md#querystringparams) | -| `path?` | `string` | -| `saveUrl?` | `boolean` | - -#### Defined in - -[api/useNHTSA.ts:15](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/useNHTSA.ts#L15) - -## Functions - -### useNHTSA - -โ–ธ **useNHTSA**(): `Object` - -`useNHTSA` returns a composable object containing helper functions for working with the VPIC -API. It is used internally by the package and by users to make direct requests to the VPIC API. - -It returns an object containing methods for making HTTP requests to the VPIC API. All -request methods return a Promise that resolves to an object containing the full response data. - -The functions returned by the composable are: - -- `createCachedUrl` - Builds the URL string and stores it in internal state - -- `getCachedUrl` - Gets the URL stored in internal state - -- `setCachedUrl` - Directly sets the URL internal state, does not check if URL is valid - -- `clearCachedUrl` - Clears the URL stored in internal state - -- `createUrl` - Returns a built URL string but does not store it in internal state - -- `createPostBody` - Creates a POST body string from an object of key/value pairs - -- `get` - Makes a GET request, uses the internal url variable if no URL is provided - -- `post` - Makes a POST request, uses the internal url variable if no URL is provided - -#### Returns - -`Object` - -| Name | Type | -| :---------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `clearCachedUrl` | () => `string` | -| `createCachedUrl` | (`input`: `string` \| [`CreateUrlOptions`](api_useNHTSA.md#createurloptions)) => `string` | -| `createPostBody` | (`data`: `string`) => `string` | -| `createUrl` | (`options`: [`CreateUrlOptions`](api_useNHTSA.md#createurloptions)) => `string` | -| `get` | (`url?`: `string` \| [`CreateUrlOptions`](api_useNHTSA.md#createurloptions), `options?`: `RequestInit` & { `saveUrl?`: `boolean` }) => `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<`T`\>\> | -| `getCachedUrl` | () => `string` | -| `post` | (`url?`: `string` \| [`CreateUrlOptions`](api_useNHTSA.md#createurloptions), `options?`: `RequestInit` & { `saveUrl?`: `boolean` }) => `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<`T`\>\> | -| `setCachedUrl` | (`url`: `string`) => `string` | - -#### Defined in - -[api/useNHTSA.ts:50](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/useNHTSA.ts#L50) diff --git a/apps/docs/src/typedoc/modules/constants.md b/apps/docs/src/typedoc/modules/constants.md deleted file mode 100644 index aedfd958..00000000 --- a/apps/docs/src/typedoc/modules/constants.md +++ /dev/null @@ -1,30 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / constants - -# Module: constants - -## Table of contents - -### Variables - -- [NHTSA_BASE_URL](constants.md#nhtsa_base_url) -- [NHTSA_RESPONSE_FORMAT](constants.md#nhtsa_response_format) - -## Variables - -### NHTSA_BASE_URL - -โ€ข `Const` **NHTSA_BASE_URL**: `"https://vpic.nhtsa.dot.gov/api/vehicles"` - -#### Defined in - -[constants.ts:1](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/constants.ts#L1) - ---- - -### NHTSA_RESPONSE_FORMAT - -โ€ข `Const` **NHTSA_RESPONSE_FORMAT**: `"json"` - -#### Defined in - -[constants.ts:2](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/constants.ts#L2) diff --git a/apps/docs/src/typedoc/modules/global.md b/apps/docs/src/typedoc/modules/global.md deleted file mode 100644 index 952598ea..00000000 --- a/apps/docs/src/typedoc/modules/global.md +++ /dev/null @@ -1,3 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / global - -# Module: global diff --git a/apps/docs/src/typedoc/modules/index.md b/apps/docs/src/typedoc/modules/index.md deleted file mode 100644 index d1ed8a11..00000000 --- a/apps/docs/src/typedoc/modules/index.md +++ /dev/null @@ -1,449 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / index - -# Module: index - -## Table of contents - -### References - -- [AtLeastOne](index.md#atleastone) -- [CreateUrlOptions](index.md#createurloptions) -- [DecodeVin](index.md#decodevin) -- [DecodeVinExtended](index.md#decodevinextended) -- [DecodeVinExtendedResults](index.md#decodevinextendedresults) -- [DecodeVinExtendedVariable](index.md#decodevinextendedvariable) -- [DecodeVinResults](index.md#decodevinresults) -- [DecodeVinValues](index.md#decodevinvalues) -- [DecodeVinValuesBatch](index.md#decodevinvaluesbatch) -- [DecodeVinValuesBatchResults](index.md#decodevinvaluesbatchresults) -- [DecodeVinValuesExtended](index.md#decodevinvaluesextended) -- [DecodeVinValuesExtendedResults](index.md#decodevinvaluesextendedresults) -- [DecodeVinValuesResults](index.md#decodevinvaluesresults) -- [DecodeVinVariable](index.md#decodevinvariable) -- [DecodeWMI](index.md#decodewmi) -- [DecodeWMIResults](index.md#decodewmiresults) -- [GetAllMakes](index.md#getallmakes) -- [GetAllMakesResults](index.md#getallmakesresults) -- [GetAllManufacturers](index.md#getallmanufacturers) -- [GetAllManufacturersResults](index.md#getallmanufacturersresults) -- [GetCanadianVehicleSpecifications](index.md#getcanadianvehiclespecifications) -- [GetCanadianVehicleSpecificationsResults](index.md#getcanadianvehiclespecificationsresults) -- [GetEquipmentPlantCodes](index.md#getequipmentplantcodes) -- [GetEquipmentPlantCodesParams](index.md#getequipmentplantcodesparams) -- [GetEquipmentPlantCodesResults](index.md#getequipmentplantcodesresults) -- [GetMakeForManufacturer](index.md#getmakeformanufacturer) -- [GetMakeForManufacturerResults](index.md#getmakeformanufacturerresults) -- [GetMakesForManufacturerAndYear](index.md#getmakesformanufacturerandyear) -- [GetMakesForManufacturerAndYearResults](index.md#getmakesformanufacturerandyearresults) -- [GetMakesForVehicleType](index.md#getmakesforvehicletype) -- [GetMakesForVehicleTypeResults](index.md#getmakesforvehicletyperesults) -- [GetManufacturerDetails](index.md#getmanufacturerdetails) -- [GetManufacturerDetailsResults](index.md#getmanufacturerdetailsresults) -- [GetModelsForMake](index.md#getmodelsformake) -- [GetModelsForMakeId](index.md#getmodelsformakeid) -- [GetModelsForMakeIdResults](index.md#getmodelsformakeidresults) -- [GetModelsForMakeIdYear](index.md#getmodelsformakeidyear) -- [GetModelsForMakeIdYearResults](index.md#getmodelsformakeidyearresults) -- [GetModelsForMakeResults](index.md#getmodelsformakeresults) -- [GetModelsForMakeYear](index.md#getmodelsformakeyear) -- [GetModelsForMakeYearResults](index.md#getmodelsformakeyearresults) -- [GetParts](index.md#getparts) -- [GetPartsResults](index.md#getpartsresults) -- [GetVehicleTypesForMake](index.md#getvehicletypesformake) -- [GetVehicleTypesForMakeId](index.md#getvehicletypesformakeid) -- [GetVehicleTypesForMakeIdResults](index.md#getvehicletypesformakeidresults) -- [GetVehicleTypesForMakeResults](index.md#getvehicletypesformakeresults) -- [GetVehicleVariableList](index.md#getvehiclevariablelist) -- [GetVehicleVariableListResults](index.md#getvehiclevariablelistresults) -- [GetVehicleVariableValuesList](index.md#getvehiclevariablevalueslist) -- [GetVehicleVariableValuesListResults](index.md#getvehiclevariablevalueslistresults) -- [GetWMIsForManufacturer](index.md#getwmisformanufacturer) -- [GetWMIsForManufacturerResults](index.md#getwmisformanufacturerresults) -- [IArgToValidate](index.md#iargtovalidate) -- [NhtsaResponse](index.md#nhtsaresponse) -- [QueryStringParams](index.md#querystringparams) -- [QueryStringParamsEncoded](index.md#querystringparamsencoded) -- [QueryStringTypes](index.md#querystringtypes) -- [RequireOnlyOne](index.md#requireonlyone) -- [createQueryString](index.md#createquerystring) -- [encodeQueryStringParams](index.md#encodequerystringparams) -- [isValidVin](index.md#isvalidvin) -- [useNHTSA](index.md#usenhtsa) - -## References - -### AtLeastOne - -Re-exports [AtLeastOne](utils_types.md#atleastone) - ---- - -### CreateUrlOptions - -Re-exports [CreateUrlOptions](api_useNHTSA.md#createurloptions) - ---- - -### DecodeVin - -Re-exports [DecodeVin](api_endpoints_DecodeVin.md#decodevin) - ---- - -### DecodeVinExtended - -Re-exports [DecodeVinExtended](api_endpoints_DecodeVinExtended.md#decodevinextended) - ---- - -### DecodeVinExtendedResults - -Re-exports [DecodeVinExtendedResults](api_endpoints_DecodeVinExtended.md#decodevinextendedresults) - ---- - -### DecodeVinExtendedVariable - -Re-exports [DecodeVinExtendedVariable](api_endpoints_DecodeVinExtended.md#decodevinextendedvariable) - ---- - -### DecodeVinResults - -Re-exports [DecodeVinResults](api_endpoints_DecodeVin.md#decodevinresults) - ---- - -### DecodeVinValues - -Re-exports [DecodeVinValues](api_endpoints_DecodeVinValues.md#decodevinvalues) - ---- - -### DecodeVinValuesBatch - -Re-exports [DecodeVinValuesBatch](api_endpoints_DecodeVinValuesBatch.md#decodevinvaluesbatch) - ---- - -### DecodeVinValuesBatchResults - -Re-exports [DecodeVinValuesBatchResults](api_endpoints_DecodeVinValuesBatch.md#decodevinvaluesbatchresults) - ---- - -### DecodeVinValuesExtended - -Re-exports [DecodeVinValuesExtended](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextended) - ---- - -### DecodeVinValuesExtendedResults - -Re-exports [DecodeVinValuesExtendedResults](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextendedresults) - ---- - -### DecodeVinValuesResults - -Re-exports [DecodeVinValuesResults](api_endpoints_DecodeVinValues.md#decodevinvaluesresults) - ---- - -### DecodeVinVariable - -Re-exports [DecodeVinVariable](api_endpoints_DecodeVin.md#decodevinvariable) - ---- - -### DecodeWMI - -Re-exports [DecodeWMI](api_endpoints_DecodeWMI.md#decodewmi) - ---- - -### DecodeWMIResults - -Re-exports [DecodeWMIResults](api_endpoints_DecodeWMI.md#decodewmiresults) - ---- - -### GetAllMakes - -Re-exports [GetAllMakes](api_endpoints_GetAllMakes.md#getallmakes) - ---- - -### GetAllMakesResults - -Re-exports [GetAllMakesResults](api_endpoints_GetAllMakes.md#getallmakesresults) - ---- - -### GetAllManufacturers - -Re-exports [GetAllManufacturers](api_endpoints_GetAllManufacturers.md#getallmanufacturers) - ---- - -### GetAllManufacturersResults - -Re-exports [GetAllManufacturersResults](api_endpoints_GetAllManufacturers.md#getallmanufacturersresults) - ---- - -### GetCanadianVehicleSpecifications - -Re-exports [GetCanadianVehicleSpecifications](api_endpoints_GetCanadianVehicleSpecifications.md#getcanadianvehiclespecifications) - ---- - -### GetCanadianVehicleSpecificationsResults - -Re-exports [GetCanadianVehicleSpecificationsResults](api_endpoints_GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) - ---- - -### GetEquipmentPlantCodes - -Re-exports [GetEquipmentPlantCodes](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodes) - ---- - -### GetEquipmentPlantCodesParams - -Re-exports [GetEquipmentPlantCodesParams](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesparams) - ---- - -### GetEquipmentPlantCodesResults - -Re-exports [GetEquipmentPlantCodesResults](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesresults) - ---- - -### GetMakeForManufacturer - -Re-exports [GetMakeForManufacturer](api_endpoints_GetMakeForManufacturer.md#getmakeformanufacturer) - ---- - -### GetMakeForManufacturerResults - -Re-exports [GetMakeForManufacturerResults](api_endpoints_GetMakeForManufacturer.md#getmakeformanufacturerresults) - ---- - -### GetMakesForManufacturerAndYear - -Re-exports [GetMakesForManufacturerAndYear](api_endpoints_GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyear) - ---- - -### GetMakesForManufacturerAndYearResults - -Re-exports [GetMakesForManufacturerAndYearResults](api_endpoints_GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) - ---- - -### GetMakesForVehicleType - -Re-exports [GetMakesForVehicleType](api_endpoints_GetMakesForVehicleType.md#getmakesforvehicletype) - ---- - -### GetMakesForVehicleTypeResults - -Re-exports [GetMakesForVehicleTypeResults](api_endpoints_GetMakesForVehicleType.md#getmakesforvehicletyperesults) - ---- - -### GetManufacturerDetails - -Re-exports [GetManufacturerDetails](api_endpoints_GetManufacturerDetails.md#getmanufacturerdetails) - ---- - -### GetManufacturerDetailsResults - -Re-exports [GetManufacturerDetailsResults](api_endpoints_GetManufacturerDetails.md#getmanufacturerdetailsresults) - ---- - -### GetModelsForMake - -Re-exports [GetModelsForMake](api_endpoints_GetModelsForMake.md#getmodelsformake) - ---- - -### GetModelsForMakeId - -Re-exports [GetModelsForMakeId](api_endpoints_GetModelsForMakeId.md#getmodelsformakeid) - ---- - -### GetModelsForMakeIdResults - -Re-exports [GetModelsForMakeIdResults](api_endpoints_GetModelsForMakeId.md#getmodelsformakeidresults) - ---- - -### GetModelsForMakeIdYear - -Re-exports [GetModelsForMakeIdYear](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyear) - ---- - -### GetModelsForMakeIdYearResults - -Re-exports [GetModelsForMakeIdYearResults](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) - ---- - -### GetModelsForMakeResults - -Re-exports [GetModelsForMakeResults](api_endpoints_GetModelsForMake.md#getmodelsformakeresults) - ---- - -### GetModelsForMakeYear - -Re-exports [GetModelsForMakeYear](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyear) - ---- - -### GetModelsForMakeYearResults - -Re-exports [GetModelsForMakeYearResults](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyearresults) - ---- - -### GetParts - -Re-exports [GetParts](api_endpoints_GetParts.md#getparts) - ---- - -### GetPartsResults - -Re-exports [GetPartsResults](api_endpoints_GetParts.md#getpartsresults) - ---- - -### GetVehicleTypesForMake - -Re-exports [GetVehicleTypesForMake](api_endpoints_GetVehicleTypesForMake.md#getvehicletypesformake) - ---- - -### GetVehicleTypesForMakeId - -Re-exports [GetVehicleTypesForMakeId](api_endpoints_GetVehicleTypesForMakeId.md#getvehicletypesformakeid) - ---- - -### GetVehicleTypesForMakeIdResults - -Re-exports [GetVehicleTypesForMakeIdResults](api_endpoints_GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) - ---- - -### GetVehicleTypesForMakeResults - -Re-exports [GetVehicleTypesForMakeResults](api_endpoints_GetVehicleTypesForMake.md#getvehicletypesformakeresults) - ---- - -### GetVehicleVariableList - -Re-exports [GetVehicleVariableList](api_endpoints_GetVehicleVariableList.md#getvehiclevariablelist) - ---- - -### GetVehicleVariableListResults - -Re-exports [GetVehicleVariableListResults](api_endpoints_GetVehicleVariableList.md#getvehiclevariablelistresults) - ---- - -### GetVehicleVariableValuesList - -Re-exports [GetVehicleVariableValuesList](api_endpoints_GetVehicleVariableValuesList.md#getvehiclevariablevalueslist) - ---- - -### GetVehicleVariableValuesListResults - -Re-exports [GetVehicleVariableValuesListResults](api_endpoints_GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) - ---- - -### GetWMIsForManufacturer - -Re-exports [GetWMIsForManufacturer](api_endpoints_GetWMIsForManufacturer.md#getwmisformanufacturer) - ---- - -### GetWMIsForManufacturerResults - -Re-exports [GetWMIsForManufacturerResults](api_endpoints_GetWMIsForManufacturer.md#getwmisformanufacturerresults) - ---- - -### IArgToValidate - -Re-exports [IArgToValidate](utils_argHandler.md#iargtovalidate) - ---- - -### NhtsaResponse - -Re-exports [NhtsaResponse](api_types.md#nhtsaresponse) - ---- - -### QueryStringParams - -Re-exports [QueryStringParams](utils_queryString.md#querystringparams) - ---- - -### QueryStringParamsEncoded - -Re-exports [QueryStringParamsEncoded](utils_queryString.md#querystringparamsencoded) - ---- - -### QueryStringTypes - -Re-exports [QueryStringTypes](utils_queryString.md#querystringtypes) - ---- - -### RequireOnlyOne - -Re-exports [RequireOnlyOne](utils_types.md#requireonlyone) - ---- - -### createQueryString - -Re-exports [createQueryString](utils_queryString.md#createquerystring) - ---- - -### encodeQueryStringParams - -Re-exports [encodeQueryStringParams](utils_queryString.md#encodequerystringparams) - ---- - -### isValidVin - -Re-exports [isValidVin](utils_isValidVin.md#isvalidvin) - ---- - -### useNHTSA - -Re-exports [useNHTSA](api_useNHTSA.md#usenhtsa) diff --git a/apps/docs/src/typedoc/modules/types.md b/apps/docs/src/typedoc/modules/types.md deleted file mode 100644 index ba55de09..00000000 --- a/apps/docs/src/typedoc/modules/types.md +++ /dev/null @@ -1,253 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / types - -# Module: types - -## Table of contents - -### References - -- [AtLeastOne](types.md#atleastone) -- [CreateUrlOptions](types.md#createurloptions) -- [DecodeVinExtendedResults](types.md#decodevinextendedresults) -- [DecodeVinExtendedVariable](types.md#decodevinextendedvariable) -- [DecodeVinResults](types.md#decodevinresults) -- [DecodeVinValuesBatchResults](types.md#decodevinvaluesbatchresults) -- [DecodeVinValuesExtendedResults](types.md#decodevinvaluesextendedresults) -- [DecodeVinValuesResults](types.md#decodevinvaluesresults) -- [DecodeVinVariable](types.md#decodevinvariable) -- [DecodeWMIResults](types.md#decodewmiresults) -- [GetAllMakesResults](types.md#getallmakesresults) -- [GetAllManufacturersResults](types.md#getallmanufacturersresults) -- [GetCanadianVehicleSpecificationsResults](types.md#getcanadianvehiclespecificationsresults) -- [GetEquipmentPlantCodesParams](types.md#getequipmentplantcodesparams) -- [GetEquipmentPlantCodesResults](types.md#getequipmentplantcodesresults) -- [GetMakeForManufacturerResults](types.md#getmakeformanufacturerresults) -- [GetMakesForManufacturerAndYearResults](types.md#getmakesformanufacturerandyearresults) -- [GetMakesForVehicleTypeResults](types.md#getmakesforvehicletyperesults) -- [GetManufacturerDetailsResults](types.md#getmanufacturerdetailsresults) -- [GetModelsForMakeIdResults](types.md#getmodelsformakeidresults) -- [GetModelsForMakeIdYearResults](types.md#getmodelsformakeidyearresults) -- [GetModelsForMakeResults](types.md#getmodelsformakeresults) -- [GetModelsForMakeYearResults](types.md#getmodelsformakeyearresults) -- [GetPartsResults](types.md#getpartsresults) -- [GetVehicleTypesForMakeIdResults](types.md#getvehicletypesformakeidresults) -- [GetVehicleTypesForMakeResults](types.md#getvehicletypesformakeresults) -- [GetVehicleVariableListResults](types.md#getvehiclevariablelistresults) -- [GetVehicleVariableValuesListResults](types.md#getvehiclevariablevalueslistresults) -- [GetWMIsForManufacturerResults](types.md#getwmisformanufacturerresults) -- [IArgToValidate](types.md#iargtovalidate) -- [NhtsaResponse](types.md#nhtsaresponse) -- [QueryStringParams](types.md#querystringparams) -- [QueryStringParamsEncoded](types.md#querystringparamsencoded) -- [QueryStringTypes](types.md#querystringtypes) -- [RequireOnlyOne](types.md#requireonlyone) - -## References - -### AtLeastOne - -Re-exports [AtLeastOne](utils_types.md#atleastone) - ---- - -### CreateUrlOptions - -Re-exports [CreateUrlOptions](api_useNHTSA.md#createurloptions) - ---- - -### DecodeVinExtendedResults - -Re-exports [DecodeVinExtendedResults](api_endpoints_DecodeVinExtended.md#decodevinextendedresults) - ---- - -### DecodeVinExtendedVariable - -Re-exports [DecodeVinExtendedVariable](api_endpoints_DecodeVinExtended.md#decodevinextendedvariable) - ---- - -### DecodeVinResults - -Re-exports [DecodeVinResults](api_endpoints_DecodeVin.md#decodevinresults) - ---- - -### DecodeVinValuesBatchResults - -Re-exports [DecodeVinValuesBatchResults](api_endpoints_DecodeVinValuesBatch.md#decodevinvaluesbatchresults) - ---- - -### DecodeVinValuesExtendedResults - -Re-exports [DecodeVinValuesExtendedResults](api_endpoints_DecodeVinValuesExtended.md#decodevinvaluesextendedresults) - ---- - -### DecodeVinValuesResults - -Re-exports [DecodeVinValuesResults](api_endpoints_DecodeVinValues.md#decodevinvaluesresults) - ---- - -### DecodeVinVariable - -Re-exports [DecodeVinVariable](api_endpoints_DecodeVin.md#decodevinvariable) - ---- - -### DecodeWMIResults - -Re-exports [DecodeWMIResults](api_endpoints_DecodeWMI.md#decodewmiresults) - ---- - -### GetAllMakesResults - -Re-exports [GetAllMakesResults](api_endpoints_GetAllMakes.md#getallmakesresults) - ---- - -### GetAllManufacturersResults - -Re-exports [GetAllManufacturersResults](api_endpoints_GetAllManufacturers.md#getallmanufacturersresults) - ---- - -### GetCanadianVehicleSpecificationsResults - -Re-exports [GetCanadianVehicleSpecificationsResults](api_endpoints_GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) - ---- - -### GetEquipmentPlantCodesParams - -Re-exports [GetEquipmentPlantCodesParams](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesparams) - ---- - -### GetEquipmentPlantCodesResults - -Re-exports [GetEquipmentPlantCodesResults](api_endpoints_GetEquipmentPlantCodes.md#getequipmentplantcodesresults) - ---- - -### GetMakeForManufacturerResults - -Re-exports [GetMakeForManufacturerResults](api_endpoints_GetMakeForManufacturer.md#getmakeformanufacturerresults) - ---- - -### GetMakesForManufacturerAndYearResults - -Re-exports [GetMakesForManufacturerAndYearResults](api_endpoints_GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) - ---- - -### GetMakesForVehicleTypeResults - -Re-exports [GetMakesForVehicleTypeResults](api_endpoints_GetMakesForVehicleType.md#getmakesforvehicletyperesults) - ---- - -### GetManufacturerDetailsResults - -Re-exports [GetManufacturerDetailsResults](api_endpoints_GetManufacturerDetails.md#getmanufacturerdetailsresults) - ---- - -### GetModelsForMakeIdResults - -Re-exports [GetModelsForMakeIdResults](api_endpoints_GetModelsForMakeId.md#getmodelsformakeidresults) - ---- - -### GetModelsForMakeIdYearResults - -Re-exports [GetModelsForMakeIdYearResults](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) - ---- - -### GetModelsForMakeResults - -Re-exports [GetModelsForMakeResults](api_endpoints_GetModelsForMake.md#getmodelsformakeresults) - ---- - -### GetModelsForMakeYearResults - -Re-exports [GetModelsForMakeYearResults](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyearresults) - ---- - -### GetPartsResults - -Re-exports [GetPartsResults](api_endpoints_GetParts.md#getpartsresults) - ---- - -### GetVehicleTypesForMakeIdResults - -Re-exports [GetVehicleTypesForMakeIdResults](api_endpoints_GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) - ---- - -### GetVehicleTypesForMakeResults - -Re-exports [GetVehicleTypesForMakeResults](api_endpoints_GetVehicleTypesForMake.md#getvehicletypesformakeresults) - ---- - -### GetVehicleVariableListResults - -Re-exports [GetVehicleVariableListResults](api_endpoints_GetVehicleVariableList.md#getvehiclevariablelistresults) - ---- - -### GetVehicleVariableValuesListResults - -Re-exports [GetVehicleVariableValuesListResults](api_endpoints_GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) - ---- - -### GetWMIsForManufacturerResults - -Re-exports [GetWMIsForManufacturerResults](api_endpoints_GetWMIsForManufacturer.md#getwmisformanufacturerresults) - ---- - -### IArgToValidate - -Re-exports [IArgToValidate](utils_argHandler.md#iargtovalidate) - ---- - -### NhtsaResponse - -Re-exports [NhtsaResponse](api_types.md#nhtsaresponse) - ---- - -### QueryStringParams - -Re-exports [QueryStringParams](utils_queryString.md#querystringparams) - ---- - -### QueryStringParamsEncoded - -Re-exports [QueryStringParamsEncoded](utils_queryString.md#querystringparamsencoded) - ---- - -### QueryStringTypes - -Re-exports [QueryStringTypes](utils_queryString.md#querystringtypes) - ---- - -### RequireOnlyOne - -Re-exports [RequireOnlyOne](utils_types.md#requireonlyone) diff --git a/apps/docs/src/typedoc/modules/utils.md b/apps/docs/src/typedoc/modules/utils.md deleted file mode 100644 index ee2cf5d9..00000000 --- a/apps/docs/src/typedoc/modules/utils.md +++ /dev/null @@ -1,71 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / utils - -# Module: utils - -## Table of contents - -### References - -- [catchInvalidArguments](utils.md#catchinvalidarguments) -- [createQueryString](utils.md#createquerystring) -- [encodeQueryStringParams](utils.md#encodequerystringparams) -- [getTypeof](utils.md#gettypeof) -- [handleError](utils.md#handleerror) -- [isError](utils.md#iserror) -- [isValidVin](utils.md#isvalidvin) -- [rejectWithError](utils.md#rejectwitherror) -- [validateArgument](utils.md#validateargument) - -## References - -### catchInvalidArguments - -Re-exports [catchInvalidArguments](utils_argHandler.md#catchinvalidarguments) - ---- - -### createQueryString - -Re-exports [createQueryString](utils_queryString.md#createquerystring) - ---- - -### encodeQueryStringParams - -Re-exports [encodeQueryStringParams](utils_queryString.md#encodequerystringparams) - ---- - -### getTypeof - -Re-exports [getTypeof](utils_getTypeof.md#gettypeof) - ---- - -### handleError - -Re-exports [handleError](utils_errorHandler.md#handleerror) - ---- - -### isError - -Re-exports [isError](utils_errorHandler.md#iserror) - ---- - -### isValidVin - -Re-exports [isValidVin](utils_isValidVin.md#isvalidvin) - ---- - -### rejectWithError - -Re-exports [rejectWithError](utils_errorHandler.md#rejectwitherror) - ---- - -### validateArgument - -Re-exports [validateArgument](utils_argHandler.md#validateargument) diff --git a/apps/docs/src/typedoc/modules/utils_argHandler.md b/apps/docs/src/typedoc/modules/utils_argHandler.md deleted file mode 100644 index 84529275..00000000 --- a/apps/docs/src/typedoc/modules/utils_argHandler.md +++ /dev/null @@ -1,137 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / utils/argHandler - -# Module: utils/argHandler - -## Table of contents - -### Type Aliases - -- [IArgToValidate](utils_argHandler.md#iargtovalidate) - -### Functions - -- [catchInvalidArguments](utils_argHandler.md#catchinvalidarguments) -- [validateArgument](utils_argHandler.md#validateargument) - -## Type Aliases - -### IArgToValidate - -ฦฌ **IArgToValidate**: { `errorMode?`: `"error"` \| `"boolean"` ; `name`: `string` ; `value`: `unknown` } & [`AtLeastOne`](utils_types.md#atleastone)<{ `required?`: `boolean` ; `types?`: `string`[] }\> - -#### Defined in - -[utils/argHandler.ts:9](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/argHandler.ts#L9) - -## Functions - -### catchInvalidArguments - -โ–ธ **catchInvalidArguments**(`options`): `boolean` - -Catches invalid arguments passed to functions and throws an error with a message detailing the -invalid argument(s) and what was expected. - -At least one of `required` or `types` must be provided for each arg to validate against or it -will validate nothing and return true for that arg value as if it was valid. - -Under the hood it loops through the args and calls `validateArgument` to validate each arg. -`validateArgument` will throw an error if any of the arguments are invalid based on the provided -options in each arg. See the description for `validateArgument` for more details on how -validation logic works and how to override the default error throwing behavior. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | -| `options` | `Object` | options object | -| `options.args` | [`IArgToValidate`](utils_argHandler.md#iargtovalidate)[] | array of IArgToValidate objects | -| `options.mode?` | `"default"` \| `"atLeast"` | 'default' or 'atLeast' - 'default' will validate all args, 'atLeast' will validate at least one arg in in the array has a defined value | - -#### Returns - -`boolean` - -- true if validation passes, throws error in the case of validation failure - -#### Defined in - -[utils/argHandler.ts:148](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/argHandler.ts#L148) - ---- - -### validateArgument - -โ–ธ **validateArgument**(`options`): `boolean` - -Will validate a single argument based on the provided options and throws an error with a message -detailing the invalid argument(s) and what was expected. - -There are two modes for this function: - -- 'error' - (default) - Throws an error if the argument fails validation. -- 'boolean' - Returns false if the argument fails validation, does not throw an error. - -Both modes return true if the argument passes validation. - -The logic is the same for both modes, the only difference is the return value. - -`error` mode is useful for validating arguments supplied to a function and throwing an -error if the arguments are invalid. Can also be used to validate existence and type of any -value matches an array of type names you provide. It will throw an error if the argument is -invalid and return true if the argument is valid. - -`boolean` mode is useful for validating arguments in a function that returns a boolean value, -such as in Array.filter() or 'if' statements. It will return false if the argument is invalid -and true if the argument is valid. - -### Options - -The main purpose for this function is to throw a helpful Error message to the user when they -are using the endpoint functions in a way that would cause the NHTSA API to return an error. -In default mode, it uses the `options.name` and `options.types` array (if provided) to build the -error message in the case of validation failure. - -- `options.name` and `options.value` are required in each arg object. It's ok to pass undefined - as the value, i.e. `{ value: someVarThatMightBeUndefined }`, but you must provide a name for the - argument. If you didn't provide a name then the error message would not be as helpful. - -- `options.required` and `options.types` are optional. - -At least one of `options.required` or `options.types` must be provided as part of each arg -object. At least one of these options must be provided for each arg object, otherwise it will -always return true. You probably don't need to validate that arg if you don't provide at least -one of these options. - -### Validation Logic - -If both `required` is true and `types` are provided, it will validate the value is defined and -that the typeof value is one of the provided strings in the `types` array. - -If `required` is true and no `types` are provided, it will only validate value is defined. - -- If `types` is provided but it is not `required`, it will only validate value is one of the - type strings in the `types` array. -- If `types` is provided but it is not `required` and value is 'undefined' it will skip - validation as there is no value to validate against and user would mark it required if they - wanted to validate against a defined value. If the value is not required and you give types of - ['string', 'number'] for example, it will validate that the value is either a string or a number. -- If neither `required` nor `types` are provided, it will not peerform validation and will - simply return true. - -#### Parameters - -| Name | Type | Description | -| :-------- | :----------------------------------------------------- | :------------- | -| `options` | [`IArgToValidate`](utils_argHandler.md#iargtovalidate) | options object | - -#### Returns - -`boolean` - -- true if validation passes, mode 'error' throws Error in the case of - validation failure, mode 'boolean' returns false in the case of validation failure - -#### Defined in - -[utils/argHandler.ts:83](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/argHandler.ts#L83) diff --git a/apps/docs/src/typedoc/modules/utils_getTypeof.md b/apps/docs/src/typedoc/modules/utils_getTypeof.md deleted file mode 100644 index d477a5c2..00000000 --- a/apps/docs/src/typedoc/modules/utils_getTypeof.md +++ /dev/null @@ -1,39 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / utils/getTypeof - -# Module: utils/getTypeof - -## Table of contents - -### Functions - -- [getTypeof](utils_getTypeof.md#gettypeof) - -## Functions - -### getTypeof - -โ–ธ **getTypeof**(`value`): `string` - -Gets type of `value` using `Object.prototype.toString.call(value)`. - -Why? Because `typeof` is not reliable for all types of values. - -Object.prototype.toString gives more accurate results in the case someone has used an object wrapper -for primitive data types such as `new Number()` or `new String()`. -It will also accurately recognize any Error types, Error, TypeError, etc., as 'error'. - -#### Parameters - -| Name | Type | Description | -| :------ | :-------- | :-------------------------------------------------------- | -| `value` | `unknown` | Any kind of value (string, object, array, function, etc). | - -#### Returns - -`string` - -- Type of value, normalized to a lowercase string. - -#### Defined in - -[utils/getTypeof.ts:18](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/getTypeof.ts#L18) diff --git a/apps/docs/src/typedoc/modules/utils_queryString.md b/apps/docs/src/typedoc/modules/utils_queryString.md deleted file mode 100644 index 4c3d7ec6..00000000 --- a/apps/docs/src/typedoc/modules/utils_queryString.md +++ /dev/null @@ -1,157 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / utils/queryString - -# Module: utils/queryString - -## Table of contents - -### Type Aliases - -- [QueryStringParams](utils_queryString.md#querystringparams) -- [QueryStringParamsEncoded](utils_queryString.md#querystringparamsencoded) -- [QueryStringTypes](utils_queryString.md#querystringtypes) - -### Functions - -- [createQueryString](utils_queryString.md#createquerystring) -- [encodeQueryStringParams](utils_queryString.md#encodequerystringparams) - -## Type Aliases - -### QueryStringParams - -ฦฌ **QueryStringParams**: `Record`<`string`, [`QueryStringTypes`](utils_queryString.md#querystringtypes)\> - -Object to build the query string with - -#### Defined in - -[utils/queryString.ts:13](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L13) - ---- - -### QueryStringParamsEncoded - -ฦฌ **QueryStringParamsEncoded**<`T`\>: { [key in keyof T]: string } - -Object returned by encodeQueryStringParams() - -#### Type parameters - -| Name | -| :--- | -| `T` | - -#### Defined in - -[utils/queryString.ts:16](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L16) - ---- - -### QueryStringTypes - -ฦฌ **QueryStringTypes**: `string` \| `number` \| `boolean` - -Valid URI component types - -#### Defined in - -[utils/queryString.ts:10](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L10) - -## Functions - -### createQueryString - -โ–ธ **createQueryString**<`T`\>(`params?`, `allowEmptyParams?`): `string` - -This function is used internally by other package functions. As a consumer of this package, you -should not need to use this function directly in most cases. - -Utility function to generate a query string conforming to URI component standards. Takes an an -optional object of search parameters and returns an encoded query string. - -This function will always override `params.format` with `{ format: 'json' }`. This is hardcoded -into the package and cannot be overridden, this package provides no support for CSV or XML -formats at this time. This means the default query string will be `"?format=json"` even if no -`params` are provided by user. - -- Ignores parameters that are not strings, numbers, or booleans, and also ignores empty strings - by default. - -- If you don't provide an object as the first argument, an error will be thrown. Providing an - empty object will not throw an error. - -- If the second argument, `allowEmptyParams`, is set to `true`, the function will include keys - with empty string values in the final query string, e.g. 'emptyKey='. - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------- | -| `T` | extends [`QueryStringParams`](utils_queryString.md#querystringparams) | - -#### Parameters - -| Name | Type | Default value | Description | -| :------------------ | :-------- | :------------ | :------------------------------------------------------------------------ | -| `params` | `T` | `undefined` | An object of search parameters to be converted to a query string. | -| `allowEmptyParams?` | `boolean` | `false` | Set to `true` to include keys with empty string values, e.g. 'emptyKey='. | - -#### Returns - -`string` - -- A query string of search parameters for use in a final fetch URL. - -#### Defined in - -[utils/queryString.ts:100](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L100) - ---- - -### encodeQueryStringParams - -โ–ธ **encodeQueryStringParams**<`T`\>(`params`): [`QueryStringParamsEncoded`](utils_queryString.md#querystringparamsencoded)<`T`\> - -This function is used internally by other package functions. As a consumer of this package, you -should not need to use this function directly in most cases. - -Utility function to perform URI component encoding on all values in an object, for use in URL -query strings. - -- Returns an object of valid URI encoded parameters with same keys as the original object. -- Will silently filter out parameters with values that are not type `string`, `number`, or - `boolean`. -- It filters invalid key/values so that encodeURIComponent() does not throw an error. - -In it's current implementation, this function assumes that invalid types have already been -filtered out, and that all values are valid. If you need to be sure that all keys are present -in the returned object, you can use the `validateArgument()` function to check the types of all -values are valid before calling this function. - -This function is not exported by the package, but is used internally by other -functions. However, it _is_ exported by the package as part of the composable function -`useQueryString`, and renamed to `encodeParams` for less verbose use. - -#### Type parameters - -| Name | Type | -| :--- | :-------------------------------------------------------------------- | -| `T` | extends [`QueryStringParams`](utils_queryString.md#querystringparams) | - -#### Parameters - -| Name | Type | Description | -| :------- | :--- | :-------------------------------------------- | -| `params` | `T` | An object of search parameters to be encoded. | - -#### Returns - -[`QueryStringParamsEncoded`](utils_queryString.md#querystringparamsencoded)<`T`\> - -- A new object of same keys as the original object with - values converted to URI component strings. Any keys with values not a string, number, or - boolean are filtered out of final object. - -#### Defined in - -[utils/queryString.ts:44](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L44) diff --git a/apps/docs/src/typedoc/modules/utils_types.md b/apps/docs/src/typedoc/modules/utils_types.md deleted file mode 100644 index 8f206988..00000000 --- a/apps/docs/src/typedoc/modules/utils_types.md +++ /dev/null @@ -1,81 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / utils/types - -# Module: utils/types - -## Table of contents - -### References - -- [IArgToValidate](utils_types.md#iargtovalidate) -- [QueryStringParams](utils_types.md#querystringparams) -- [QueryStringParamsEncoded](utils_types.md#querystringparamsencoded) -- [QueryStringTypes](utils_types.md#querystringtypes) - -### Type Aliases - -- [AtLeastOne](utils_types.md#atleastone) -- [RequireOnlyOne](utils_types.md#requireonlyone) - -## References - -### IArgToValidate - -Re-exports [IArgToValidate](utils_argHandler.md#iargtovalidate) - ---- - -### QueryStringParams - -Re-exports [QueryStringParams](utils_queryString.md#querystringparams) - ---- - -### QueryStringParamsEncoded - -Re-exports [QueryStringParamsEncoded](utils_queryString.md#querystringparamsencoded) - ---- - -### QueryStringTypes - -Re-exports [QueryStringTypes](utils_queryString.md#querystringtypes) - -## Type Aliases - -### AtLeastOne - -ฦฌ **AtLeastOne**<`T`, `R`\>: { [P in R]-?: Required\> & Partial\> }[`R`] - -Require at least one of a set of properties in an object -https://stackoverflow.com/a/49725198 - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------- | -| `T` | `T` | -| `R` | extends keyof `T` = keyof `T` | - -#### Defined in - -[utils/types.ts:18](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/types.ts#L18) - ---- - -### RequireOnlyOne - -ฦฌ **RequireOnlyOne**<`T`, `Keys`\>: `Omit`<`T`, `Keys`\> & { [K in keyof Required]: Required\> & Partial, undefined\>\> }[`Keys`] - -Require only one of a set of properties in an object -https://stackoverflow.com/a/49725198 - -#### Type parameters - -| Name | Type | -| :----- | :---------------------------- | -| `T` | `T` | -| `Keys` | extends keyof `T` = keyof `T` | - -#### Defined in - -[utils/types.ts:26](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/types.ts#L26) diff --git a/apps/docs/src/typedoc/modules/vite_env.md b/apps/docs/src/typedoc/modules/vite_env.md deleted file mode 100644 index d9621354..00000000 --- a/apps/docs/src/typedoc/modules/vite_env.md +++ /dev/null @@ -1,3 +0,0 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / vite-env - -# Module: vite-env diff --git a/apps/docs/src/typedoc/types.md b/apps/docs/src/typedoc/types.md new file mode 100644 index 00000000..9dc1f3f5 --- /dev/null +++ b/apps/docs/src/typedoc/types.md @@ -0,0 +1,268 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](modules.md) / types + +# types + +## Contents + +- [References](types.md#references) + - [ApiTypes](types.md#apitypes) + - [AtLeastOne](types.md#atleastone) + - [CreateUrlOptions](types.md#createurloptions) + - [DecodeVinExtendedResults](types.md#decodevinextendedresults) + - [DecodeVinExtendedVariable](types.md#decodevinextendedvariable) + - [DecodeVinResults](types.md#decodevinresults) + - [DecodeVinValuesBatchResults](types.md#decodevinvaluesbatchresults) + - [DecodeVinValuesExtendedResults](types.md#decodevinvaluesextendedresults) + - [DecodeVinValuesResults](types.md#decodevinvaluesresults) + - [DecodeVinVariable](types.md#decodevinvariable) + - [DecodeWMIResults](types.md#decodewmiresults) + - [GetAllMakesResults](types.md#getallmakesresults) + - [GetAllManufacturersResults](types.md#getallmanufacturersresults) + - [GetCanadianVehicleSpecificationsResults](types.md#getcanadianvehiclespecificationsresults) + - [GetEquipmentPlantCodesParams](types.md#getequipmentplantcodesparams) + - [GetEquipmentPlantCodesResults](types.md#getequipmentplantcodesresults) + - [GetMakeForManufacturerResults](types.md#getmakeformanufacturerresults) + - [GetMakesForManufacturerAndYearResults](types.md#getmakesformanufacturerandyearresults) + - [GetMakesForVehicleTypeResults](types.md#getmakesforvehicletyperesults) + - [GetManufacturerDetailsResults](types.md#getmanufacturerdetailsresults) + - [GetModelsForMakeIdResults](types.md#getmodelsformakeidresults) + - [GetModelsForMakeIdYearResults](types.md#getmodelsformakeidyearresults) + - [GetModelsForMakeResults](types.md#getmodelsformakeresults) + - [GetModelsForMakeYearResults](types.md#getmodelsformakeyearresults) + - [GetPartsResults](types.md#getpartsresults) + - [GetVehicleTypesForMakeIdResults](types.md#getvehicletypesformakeidresults) + - [GetVehicleTypesForMakeResults](types.md#getvehicletypesformakeresults) + - [GetVehicleVariableListResults](types.md#getvehiclevariablelistresults) + - [GetVehicleVariableValuesListResults](types.md#getvehiclevariablevalueslistresults) + - [GetWMIsForManufacturerResults](types.md#getwmisformanufacturerresults) + - [IArgToValidate](types.md#iargtovalidate) + - [Impossible](types.md#impossible) + - [NhtsaResponse](types.md#nhtsaresponse) + - [NoExtraProperties](types.md#noextraproperties) + - [QueryStringParams](types.md#querystringparams) + - [QueryStringParamsEncoded](types.md#querystringparamsencoded) + - [QueryStringTypes](types.md#querystringtypes) + - [RequireOnlyOne](types.md#requireonlyone) + - [SafetyRatingsOptions](types.md#safetyratingsoptions) + - [SafetyRatingsOptionsBase](types.md#safetyratingsoptionsbase) + - [SafetyRatingsOptionsEmpty](types.md#safetyratingsoptionsempty) + - [SafetyRatingsOptionsMake](types.md#safetyratingsoptionsmake) + - [SafetyRatingsOptionsModel](types.md#safetyratingsoptionsmodel) + - [SafetyRatingsOptionsModelYear](types.md#safetyratingsoptionsmodelyear) + - [SafetyRatingsOptionsVehicleId](types.md#safetyratingsoptionsvehicleid) + - [SafetyRatingsResponseByOptions](types.md#safetyratingsresponsebyoptions) + - [SafetyRatingsResponseByVariant](types.md#safetyratingsresponsebyvariant) + - [SafetyRatingsResultsByOptions](types.md#safetyratingsresultsbyoptions) + - [SafetyRatingsResultsByVariant](types.md#safetyratingsresultsbyvariant) + - [SafetyRatingsResultsData](types.md#safetyratingsresultsdata) + - [SafetyRatingsResultsVariants](types.md#safetyratingsresultsvariants) + +## References + +### ApiTypes + +Re-exports [ApiTypes](api/types.md#apitypes) + +### AtLeastOne + +Re-exports [AtLeastOne](utils/types.md#atleastonet-r) + +### CreateUrlOptions + +Re-exports [CreateUrlOptions](api/useNHTSA.md#createurloptions) + +### DecodeVinExtendedResults + +Re-exports [DecodeVinExtendedResults](api/vpic/endpoints/DecodeVinExtended.md#decodevinextendedresults) + +### DecodeVinExtendedVariable + +Re-exports [DecodeVinExtendedVariable](api/vpic/endpoints/DecodeVinExtended.md#decodevinextendedvariable) + +### DecodeVinResults + +Re-exports [DecodeVinResults](api/vpic/endpoints/DecodeVin.md#decodevinresults) + +### DecodeVinValuesBatchResults + +Re-exports [DecodeVinValuesBatchResults](api/vpic/endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatchresults) + +### DecodeVinValuesExtendedResults + +Re-exports [DecodeVinValuesExtendedResults](api/vpic/endpoints/DecodeVinValuesExtended.md#decodevinvaluesextendedresults) + +### DecodeVinValuesResults + +Re-exports [DecodeVinValuesResults](api/vpic/endpoints/DecodeVinValues.md#decodevinvaluesresults) + +### DecodeVinVariable + +Re-exports [DecodeVinVariable](api/vpic/endpoints/DecodeVin.md#decodevinvariable) + +### DecodeWMIResults + +Re-exports [DecodeWMIResults](api/vpic/endpoints/DecodeWMI.md#decodewmiresults) + +### GetAllMakesResults + +Re-exports [GetAllMakesResults](api/vpic/endpoints/GetAllMakes.md#getallmakesresults) + +### GetAllManufacturersResults + +Re-exports [GetAllManufacturersResults](api/vpic/endpoints/GetAllManufacturers.md#getallmanufacturersresults) + +### GetCanadianVehicleSpecificationsResults + +Re-exports [GetCanadianVehicleSpecificationsResults](api/vpic/endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) + +### GetEquipmentPlantCodesParams + +Re-exports [GetEquipmentPlantCodesParams](api/vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesparams) + +### GetEquipmentPlantCodesResults + +Re-exports [GetEquipmentPlantCodesResults](api/vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesresults) + +### GetMakeForManufacturerResults + +Re-exports [GetMakeForManufacturerResults](api/vpic/endpoints/GetMakeForManufacturer.md#getmakeformanufacturerresults) + +### GetMakesForManufacturerAndYearResults + +Re-exports [GetMakesForManufacturerAndYearResults](api/vpic/endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) + +### GetMakesForVehicleTypeResults + +Re-exports [GetMakesForVehicleTypeResults](api/vpic/endpoints/GetMakesForVehicleType.md#getmakesforvehicletyperesults) + +### GetManufacturerDetailsResults + +Re-exports [GetManufacturerDetailsResults](api/vpic/endpoints/GetManufacturerDetails.md#getmanufacturerdetailsresults) + +### GetModelsForMakeIdResults + +Re-exports [GetModelsForMakeIdResults](api/vpic/endpoints/GetModelsForMakeId.md#getmodelsformakeidresults) + +### GetModelsForMakeIdYearResults + +Re-exports [GetModelsForMakeIdYearResults](api/vpic/endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) + +### GetModelsForMakeResults + +Re-exports [GetModelsForMakeResults](api/vpic/endpoints/GetModelsForMake.md#getmodelsformakeresults) + +### GetModelsForMakeYearResults + +Re-exports [GetModelsForMakeYearResults](api/vpic/endpoints/GetModelsForMakeYear.md#getmodelsformakeyearresults) + +### GetPartsResults + +Re-exports [GetPartsResults](api/vpic/endpoints/GetParts.md#getpartsresults) + +### GetVehicleTypesForMakeIdResults + +Re-exports [GetVehicleTypesForMakeIdResults](api/vpic/endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) + +### GetVehicleTypesForMakeResults + +Re-exports [GetVehicleTypesForMakeResults](api/vpic/endpoints/GetVehicleTypesForMake.md#getvehicletypesformakeresults) + +### GetVehicleVariableListResults + +Re-exports [GetVehicleVariableListResults](api/vpic/endpoints/GetVehicleVariableList.md#getvehiclevariablelistresults) + +### GetVehicleVariableValuesListResults + +Re-exports [GetVehicleVariableValuesListResults](api/vpic/endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) + +### GetWMIsForManufacturerResults + +Re-exports [GetWMIsForManufacturerResults](api/vpic/endpoints/GetWMIsForManufacturer.md#getwmisformanufacturerresults) + +### IArgToValidate + +Re-exports [IArgToValidate](utils/argHandler.md#iargtovalidate) + +### Impossible + +Re-exports [Impossible](utils/types.md#impossiblek) + +### NhtsaResponse + +Re-exports [NhtsaResponse](api/types.md#nhtsaresponseresultstype-apitype) + +### NoExtraProperties + +Re-exports [NoExtraProperties](utils/types.md#noextrapropertiest-u) + +### QueryStringParams + +Re-exports [QueryStringParams](utils/queryString.md#querystringparams) + +### QueryStringParamsEncoded + +Re-exports [QueryStringParamsEncoded](utils/queryString.md#querystringparamsencodedt) + +### QueryStringTypes + +Re-exports [QueryStringTypes](utils/queryString.md#querystringtypes) + +### RequireOnlyOne + +Re-exports [RequireOnlyOne](utils/types.md#requireonlyonet-keys) + +### SafetyRatingsOptions + +Re-exports [SafetyRatingsOptions](api/safetyRatings.md#safetyratingsoptions) + +### SafetyRatingsOptionsBase + +Re-exports [SafetyRatingsOptionsBase](api/safetyRatings.md#safetyratingsoptionsbase) + +### SafetyRatingsOptionsEmpty + +Re-exports [SafetyRatingsOptionsEmpty](api/safetyRatings.md#safetyratingsoptionsempty) + +### SafetyRatingsOptionsMake + +Re-exports [SafetyRatingsOptionsMake](api/safetyRatings.md#safetyratingsoptionsmake) + +### SafetyRatingsOptionsModel + +Re-exports [SafetyRatingsOptionsModel](api/safetyRatings.md#safetyratingsoptionsmodel) + +### SafetyRatingsOptionsModelYear + +Re-exports [SafetyRatingsOptionsModelYear](api/safetyRatings.md#safetyratingsoptionsmodelyear) + +### SafetyRatingsOptionsVehicleId + +Re-exports [SafetyRatingsOptionsVehicleId](api/safetyRatings.md#safetyratingsoptionsvehicleid) + +### SafetyRatingsResponseByOptions + +Re-exports [SafetyRatingsResponseByOptions](api/safetyRatings.md#safetyratingsresponsebyoptionsoptions) + +### SafetyRatingsResponseByVariant + +Re-exports [SafetyRatingsResponseByVariant](api/safetyRatings.md#safetyratingsresponsebyvariantvariant) + +### SafetyRatingsResultsByOptions + +Re-exports [SafetyRatingsResultsByOptions](api/safetyRatings.md#safetyratingsresultsbyoptionsoptions) + +### SafetyRatingsResultsByVariant + +Re-exports [SafetyRatingsResultsByVariant](api/safetyRatings.md#safetyratingsresultsbyvariantvariant) + +### SafetyRatingsResultsData + +Re-exports [SafetyRatingsResultsData](api/safetyRatings.md#safetyratingsresultsdata) + +### SafetyRatingsResultsVariants + +Re-exports [SafetyRatingsResultsVariants](api/safetyRatings.md#safetyratingsresultsvariants) diff --git a/apps/docs/src/typedoc/utils.md b/apps/docs/src/typedoc/utils.md new file mode 100644 index 00000000..97cdd1c1 --- /dev/null +++ b/apps/docs/src/typedoc/utils.md @@ -0,0 +1,58 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](modules.md) / utils + +# utils + +## Contents + +- [References](utils.md#references) + - [catchInvalidArguments](utils.md#catchinvalidarguments) + - [createQueryString](utils.md#createquerystring) + - [encodeQueryStringParams](utils.md#encodequerystringparams) + - [getTypeof](utils.md#gettypeof) + - [handleError](utils.md#handleerror) + - [isError](utils.md#iserror) + - [isValidVin](utils.md#isvalidvin) + - [rejectWithError](utils.md#rejectwitherror) + - [validateArgument](utils.md#validateargument) + +## References + +### catchInvalidArguments + +Re-exports [catchInvalidArguments](utils/argHandler.md#catchinvalidarguments) + +### createQueryString + +Re-exports [createQueryString](utils/queryString.md#createquerystring) + +### encodeQueryStringParams + +Re-exports [encodeQueryStringParams](utils/queryString.md#encodequerystringparams) + +### getTypeof + +Re-exports [getTypeof](utils/getTypeof.md#gettypeof) + +### handleError + +Re-exports [handleError](utils/errorHandler.md#handleerror) + +### isError + +Re-exports [isError](utils/errorHandler.md#iserror) + +### isValidVin + +Re-exports [isValidVin](utils/isValidVin.md#isvalidvin) + +### rejectWithError + +Re-exports [rejectWithError](utils/errorHandler.md#rejectwitherror) + +### validateArgument + +Re-exports [validateArgument](utils/argHandler.md#validateargument) diff --git a/apps/docs/src/typedoc/utils/argHandler.md b/apps/docs/src/typedoc/utils/argHandler.md new file mode 100644 index 00000000..14e1b028 --- /dev/null +++ b/apps/docs/src/typedoc/utils/argHandler.md @@ -0,0 +1,149 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../modules.md) / utils/argHandler + +# utils/argHandler + +## Contents + +- [Type Aliases](argHandler.md#type-aliases) + - [IArgToValidate](argHandler.md#iargtovalidate) +- [Functions](argHandler.md#functions) + - [catchInvalidArguments()](argHandler.md#catchinvalidarguments) + - [validateArgument()](argHandler.md#validateargument) + - [`argData` Object](argHandler.md#argdata-object) + - [Validation Logic](argHandler.md#validation-logic) + +## Type Aliases + +### IArgToValidate + +> **IArgToValidate**: `object` & [`AtLeastOne`](types.md#atleastonet-r)\<`object`\> \| `object` + +#### Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `errorMode` | `"error"` \| `"boolean"` | - | +| `name` | `string` | - | +| `required` | `boolean` | - | +| `requiredBy` | `object`[] | - | +| `types` | `string`[] | - | +| `value` | `unknown` | - | + +#### Source + +[utils/argHandler.ts:9](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/argHandler.ts#L9) + +## Functions + +### catchInvalidArguments() + +> **catchInvalidArguments**(`options`): `boolean` + +Catches invalid arguments passed to functions and throws an error with a message detailing the +invalid argument(s) and what was expected. + +At least one of `required` or `types` must be provided for each arg to validate against or it +will validate nothing and return true for that arg value as if it was valid. + +Under the hood it loops through the args and calls `validateArgument` to validate each arg. +`validateArgument` will throw an error if any of the arguments are invalid based on the provided +options in each arg. See the description for `validateArgument` for more details on how +validation logic works and how to override the default error throwing behavior. + +#### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `options` | `object` | options object with args array and mode | +| `options.args` | [`IArgToValidate`](argHandler.md#iargtovalidate)[] | array of IArgToValidate objects | +| `options.mode`? | `"default"` \| `"atLeast"` | 'default' or 'atLeast' - 'default' will validate all
args, 'atLeast' will validate at least one arg in in the array has a defined value | + +#### Returns + +`boolean` + +- true if validation passes, throws error in the case of validation failure + +#### Source + +[utils/argHandler.ts:234](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/argHandler.ts#L234) + +*** + +### validateArgument() + +> **validateArgument**(`argData`): `boolean` + +Will validate a single argument based on the provided arg object and throws an error with a +message detailing the invalid argument(s) and what was expected. + +There are two modes for this function: +- 'error' - (default) - Throws an error if the argument fails validation. +- 'boolean' - Returns false if the argument fails validation, does not throw an error. + +Both modes return true if the argument passes validation. + +The logic is the same for both modes, the only difference is the return value. + +`error` mode is useful for validating arguments supplied to a function and throwing an +error if the arguments are invalid. Can also be used to validate existence and type of any +value matches an array of type names you provide. It will throw an error if the argument is +invalid and return true if the argument is valid. + +`boolean` mode is useful for validating arguments in a function that returns a boolean value, +such as in Array.filter() or 'if' statements. It will return false if the argument is invalid +and true if the argument is valid. + +### `argData` Object + +The main purpose for this function is to throw a helpful Error message to the user when they +are using the endpoint functions in a way that would cause the NHTSA API to return an error. +In default mode, it uses the `argData.name` and `argData.types` array (if provided) to build the +error message in the case of validation failure. + +- `argData.name` and `argData.value` are required in the arg object. It's ok to pass undefined +as the value, i.e. `{ value: someVarThatMightBeUndefined }`, but you must provide a name for the +argument. If you didn't provide a name then the error message would not be as helpful. + +- `argData.required` and `argData.types` are optional. + +At least one of `argData.required` or `argData.types` must be provided as part of each arg +object. At least one of these must be provided, otherwise it will always return true. You +probably don't need to validate that arg if you don't provide at least* one of these options. + +### Validation Logic + +If both `required` is true and `types` are provided, it will validate the value is defined and +that the typeof value is one of the provided strings in the `types` array. + +If `required` is true and no `types` are provided, it will only validate value is defined. + +- If `types` is provided but it is not `required`, it will only validate value is one of the +type strings in the `types` array. +- If `types` is provided but it is not `required` and value is 'undefined' it will skip +validation as there is no value to validate against and user would mark it required if they +wanted to validate against a defined value. If the value is not required and you give types of +['string', 'number'] for example, it will validate that the value is either a string or a number. +- If neither `required` nor `types` are provided, it will not peerform validation and will +simply return true. + +#### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `argData` | [`IArgToValidate`](argHandler.md#iargtovalidate) | options object | + +#### Returns + +`boolean` + +- true if validation passes, mode 'error' throws Error in the case of +validation failure, mode 'boolean' returns false in the case of validation failure + +#### Source + +[utils/argHandler.ts:101](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/argHandler.ts#L101) diff --git a/apps/docs/src/typedoc/modules/utils_errorHandler.md b/apps/docs/src/typedoc/utils/errorHandler.md similarity index 53% rename from apps/docs/src/typedoc/modules/utils_errorHandler.md rename to apps/docs/src/typedoc/utils/errorHandler.md index 26ee55c0..8381af47 100644 --- a/apps/docs/src/typedoc/modules/utils_errorHandler.md +++ b/apps/docs/src/typedoc/utils/errorHandler.md @@ -1,20 +1,23 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / utils/errorHandler +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) -# Module: utils/errorHandler +*** -## Table of contents +[@shaggytools/nhtsa-api-wrapper](../modules.md) / utils/errorHandler -### Functions +# utils/errorHandler -- [handleError](utils_errorHandler.md#handleerror) -- [isError](utils_errorHandler.md#iserror) -- [rejectWithError](utils_errorHandler.md#rejectwitherror) +## Contents + +- [Functions](errorHandler.md#functions) + - [handleError()](errorHandler.md#handleerror) + - [isError()](errorHandler.md#iserror) + - [rejectWithError()](errorHandler.md#rejectwitherror) ## Functions -### handleError +### handleError() -โ–ธ **handleError**(`error`): `Error` +> **handleError**(`error`): `Error` Handles errors by returning an Error instance. Accepts any type of value but will return default error message of `an unknown error occurred` if @@ -22,8 +25,8 @@ Accepts any type of value but will return default error message of `an unknown e #### Parameters -| Name | Type | Description | -| :------ | :-------- | :---------------- | +| Parameter | Type | Description | +| :------ | :------ | :------ | | `error` | `unknown` | Any type of value | #### Returns @@ -32,22 +35,22 @@ Accepts any type of value but will return default error message of `an unknown e - instance of Error with message -#### Defined in +#### Source [utils/errorHandler.ts:26](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/errorHandler.ts#L26) ---- +*** -### isError +### isError() -โ–ธ **isError**(`error`): `boolean` +> **isError**(`error`): `boolean` Checks if `error` is an instance of any Error type. #### Parameters -| Name | Type | Description | -| :------ | :-------- | :---------------- | +| Parameter | Type | Description | +| :------ | :------ | :------ | | `error` | `unknown` | Any type of value | #### Returns @@ -56,30 +59,30 @@ Checks if `error` is an instance of any Error type. - True if `error` is an instance of Error, TypeError, etc. -#### Defined in +#### Source [utils/errorHandler.ts:14](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/errorHandler.ts#L14) ---- +*** -### rejectWithError +### rejectWithError() -โ–ธ **rejectWithError**(`error`): `Promise`<`never`\> +> **rejectWithError**(`error`): `Promise`\<`never`\> Returns a Promise rejection containing an Error instance. -Uses [handleError](utils_errorHandler.md#handleerror) to return a default error message if `error` is +Uses [handleError](errorHandler.md#handleerror) to return a default error message if `error` is not an Error type. #### Parameters -| Name | Type | Description | -| :------ | :-------- | :---------------- | +| Parameter | Type | Description | +| :------ | :------ | :------ | | `error` | `unknown` | Any type of value | #### Returns -`Promise`<`never`\> +`Promise`\<`never`\> -#### Defined in +#### Source [utils/errorHandler.ts:47](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/errorHandler.ts#L47) diff --git a/apps/docs/src/typedoc/utils/getTypeof.md b/apps/docs/src/typedoc/utils/getTypeof.md new file mode 100644 index 00000000..fb013551 --- /dev/null +++ b/apps/docs/src/typedoc/utils/getTypeof.md @@ -0,0 +1,45 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../modules.md) / utils/getTypeof + +# utils/getTypeof + +## Contents + +- [Functions](getTypeof.md#functions) + - [getTypeof()](getTypeof.md#gettypeof) + +## Functions + +### getTypeof() + +> **getTypeof**(`value`): `string` + +Gets type of `value` using `Object.prototype.toString.call(value)`. + +Why? Because `typeof` is not reliable for all types of values. + +Values of null, Arrray, Error, new Date(), new String(), and /regex/ are all typeof 'object'. + +Object.prototype.toString.call gives more accurate results in the case someone has used an object +wrapper for primitive data types such as `new Number()` or `new String()`. + +It will also accurately recognize any Error types, Error, TypeError, etc., as 'error'. + +#### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `value` | `unknown` | Any kind of value (string, object, array, function, etc). | + +#### Returns + +`string` + +- Type of value, normalized to a lowercase string. + +#### Source + +[utils/getTypeof.ts:21](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/getTypeof.ts#L21) diff --git a/apps/docs/src/typedoc/modules/utils_isValidVin.md b/apps/docs/src/typedoc/utils/isValidVin.md similarity index 60% rename from apps/docs/src/typedoc/modules/utils_isValidVin.md rename to apps/docs/src/typedoc/utils/isValidVin.md index 755a09c7..8cf846cc 100644 --- a/apps/docs/src/typedoc/modules/utils_isValidVin.md +++ b/apps/docs/src/typedoc/utils/isValidVin.md @@ -1,56 +1,57 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / utils/isValidVin +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) -# Module: utils/isValidVin +*** -## Table of contents +[@shaggytools/nhtsa-api-wrapper](../modules.md) / utils/isValidVin -### Functions +# utils/isValidVin -- [isValidVin](utils_isValidVin.md#isvalidvin) +## Contents + +- [Functions](isValidVin.md#functions) + - [isValidVin()](isValidVin.md#isvalidvin) ## Functions -### isValidVin +### isValidVin() -โ–ธ **isValidVin**(`vin`): `boolean` +> **isValidVin**(`vin`): `boolean` Provides **offline** validation of Vehicle Identification Numbers (VINs) using the -[VIN Check Algorithm](). +[VIN Check Algorithm](https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit). If you need to test that the algorithm is working correctly, you can use 17 ones `1` as the VIN and it should return `true` as the result. -**`Example`** +#### Parameters -Browser via html script tags +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `vin` | `string` | Vehicle Identification Number. | + +#### Returns +`boolean` + +True for a valid VIN, false for an invalid VIN. + +#### Example + +Browser via html script tags ```ts const isValid = NHTSA.isValidVin('3VWD07AJ5EM388202') console.log(isValid) // true ``` -**`Example`** +#### Example Imported as a module - ```ts import { isValidVin } from '@shaggytools/nhtsa-api-wrapper' const isValid = isValidVin('3VWD07AJ5EM388202') console.log(isValid) // true ``` -#### Parameters - -| Name | Type | Description | -| :---- | :------- | :----------------------------- | -| `vin` | `string` | Vehicle Identification Number. | - -#### Returns - -`boolean` - -True for a valid VIN, false for an invalid VIN. - -#### Defined in +#### Source [utils/isValidVin.ts:66](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/isValidVin.ts#L66) diff --git a/apps/docs/src/typedoc/utils/queryString.md b/apps/docs/src/typedoc/utils/queryString.md new file mode 100644 index 00000000..3dbae39f --- /dev/null +++ b/apps/docs/src/typedoc/utils/queryString.md @@ -0,0 +1,154 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../modules.md) / utils/queryString + +# utils/queryString + +## Contents + +- [Type Aliases](queryString.md#type-aliases) + - [QueryStringParams](queryString.md#querystringparams) + - [QueryStringParamsEncoded``](queryString.md#querystringparamsencodedt) + - [QueryStringTypes](queryString.md#querystringtypes) +- [Functions](queryString.md#functions) + - [createQueryString()](queryString.md#createquerystring) + - [encodeQueryStringParams()](queryString.md#encodequerystringparams) + +## Type Aliases + +### QueryStringParams + +> **QueryStringParams**: `Record`\<`string`, [`QueryStringTypes`](queryString.md#querystringtypes)\> + +Object to build the query string with + +#### Source + +[utils/queryString.ts:13](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L13) + +*** + +### QueryStringParamsEncoded`` + +> **QueryStringParamsEncoded**\<`T`\>: `{ [key in keyof T]: string }` + +Object returned by encodeQueryStringParams() + +#### Type parameters + +| Parameter | +| :------ | +| `T` | + +#### Source + +[utils/queryString.ts:16](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L16) + +*** + +### QueryStringTypes + +> **QueryStringTypes**: `string` \| `number` \| `boolean` \| `undefined` + +Valid URI component types + +#### Source + +[utils/queryString.ts:10](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L10) + +## Functions + +### createQueryString() + +> **createQueryString**\<`T`\>(`params`, `allowEmptyParams`?): `string` + +This function is used internally by other package functions. As a consumer of this package, you +should not need to use this function directly in most cases. + +Utility function to generate a query string conforming to URI component standards. Takes an an +optional object of search parameters and returns an encoded query string. + +This function will always override `params.format` with `{ format: 'json' }`. This is hardcoded +into the package and cannot be overridden, this package provides no support for CSV or XML +formats at this time. This means the default query string will be `"?format=json"` even if no +`params` are provided by user. + +- Ignores parameters that are not strings, numbers, or booleans, and also ignores empty strings + by default. + +- If you don't provide an object as the first argument, an error will be thrown. Providing an + empty object will not throw an error. + +- If the second argument, `allowEmptyParams`, is set to `true`, the function will include keys + with empty string values in the final query string, e.g. 'emptyKey='. + +#### Type parameters + +| Parameter | +| :------ | +| `T` extends [`QueryStringParams`](queryString.md#querystringparams) | + +#### Parameters + +| Parameter | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `params` | `T` | `undefined` | An object of search parameters to be converted to a query
string. | +| `allowEmptyParams`? | `boolean` | `false` | Set to `true` to include keys with empty string
values, e.g. 'emptyKey='. | + +#### Returns + +`string` + +- A query string of search parameters for use in a final fetch URL. + +#### Source + +[utils/queryString.ts:96](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L96) + +*** + +### encodeQueryStringParams() + +> **encodeQueryStringParams**\<`T`\>(`params`): [`QueryStringParamsEncoded`](queryString.md#querystringparamsencodedt)\<`T`\> + +This function is used internally by other package functions. As a consumer of this package, you +should not need to use this function directly in most cases. + +Utility function to perform URI component encoding on all values in an object, for use in URL +query strings. + +- Returns an object of valid URI encoded parameters with same keys as the original object. +- Will silently filter out parameters with values that are not type `string`, `number`, or + `boolean`. +- It filters invalid key/values so that encodeURIComponent() does not throw an error. + +In it's current implementation, this function assumes that invalid types have already been +filtered out, and that all values are valid. If you need to be sure that all keys are present +in the returned object, you can use the `validateArgument()` function to check the types of all +values are valid before calling this function. + +#### Type parameters + +| Parameter | +| :------ | +| `T` extends [`QueryStringParams`](queryString.md#querystringparams) | + +#### Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `params` | `T` | An object of search parameters to be encoded. | + +#### Returns + +[`QueryStringParamsEncoded`](queryString.md#querystringparamsencodedt)\<`T`\> + +- A new object of same keys as the original object with +values converted to URI component strings. Any keys with values not a string, number, or +boolean are filtered out of final object. + +#### Source + +[utils/queryString.ts:40](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L40) diff --git a/apps/docs/src/typedoc/utils/types.md b/apps/docs/src/typedoc/utils/types.md new file mode 100644 index 00000000..35ee8955 --- /dev/null +++ b/apps/docs/src/typedoc/utils/types.md @@ -0,0 +1,120 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../modules.md) / utils/types + +# utils/types + +## Contents + +- [References](types.md#references) + - [IArgToValidate](types.md#iargtovalidate) + - [QueryStringParams](types.md#querystringparams) + - [QueryStringParamsEncoded](types.md#querystringparamsencoded) + - [QueryStringTypes](types.md#querystringtypes) +- [Type Aliases](types.md#type-aliases) + - [AtLeastOne``](types.md#atleastonet-r) + - [Impossible``](types.md#impossiblek) + - [NoExtraProperties``](types.md#noextrapropertiest-u) + - [RequireOnlyOne``](types.md#requireonlyonet-keys) + +## References + +### IArgToValidate + +Re-exports [IArgToValidate](argHandler.md#iargtovalidate) + +### QueryStringParams + +Re-exports [QueryStringParams](queryString.md#querystringparams) + +### QueryStringParamsEncoded + +Re-exports [QueryStringParamsEncoded](queryString.md#querystringparamsencodedt) + +### QueryStringTypes + +Re-exports [QueryStringTypes](queryString.md#querystringtypes) + +## Type Aliases + +### AtLeastOne`` + +> **AtLeastOne**\<`T`, `R`\>: `{ [P in R]-?: Required> & Partial> }`\[`R`\] + +Require at least one of a set of properties in an object +https://stackoverflow.com/a/49725198 + +#### Type parameters + +| Parameter | Default | +| :------ | :------ | +| `T` | - | +| `R` extends keyof `T` | keyof `T` | + +#### Source + +[utils/types.ts:18](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/types.ts#L18) + +*** + +### Impossible`` + +> **Impossible**\<`K`\>: `{ [P in K]: never }` + +A type that, when passed a union of keys, creates an object which cannot have those properties. +Used in conjunction with `NoExtraProperties` to create a type that can only have the properties +you want it to have. +https://stackoverflow.com/a/57117594 + +#### Type parameters + +| Parameter | +| :------ | +| `K` extends keyof `never` | + +#### Source + +[utils/types.ts:38](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/types.ts#L38) + +*** + +### NoExtraProperties`` + +> **NoExtraProperties**\<`T`, `U`\>: `U` & [`Impossible`](types.md#impossiblek)\<`Exclude`\\> + +Provide it the type that contains only the properties you want, and then a type that extends that +type, based on what the caller provided using generics. +https://stackoverflow.com/a/57117594 + +#### Type parameters + +| Parameter | Default | +| :------ | :------ | +| `T` | - | +| `U` extends `T` | `T` | + +#### Source + +[utils/types.ts:47](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/types.ts#L47) + +*** + +### RequireOnlyOne`` + +> **RequireOnlyOne**\<`T`, `Keys`\>: `Omit`\<`T`, `Keys`\> & `{ [K in keyof Required]: Required> & Partial, undefined>> }`\[`Keys`\] + +Require only one of a set of properties in an object +https://stackoverflow.com/a/49725198 + +#### Type parameters + +| Parameter | Default | +| :------ | :------ | +| `T` | - | +| `Keys` extends keyof `T` | keyof `T` | + +#### Source + +[utils/types.ts:26](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/types.ts#L26) diff --git a/apps/docs/src/utils/use-nhtsa.md b/apps/docs/src/utils/use-nhtsa.md index 95f9af1e..32568775 100644 --- a/apps/docs/src/utils/use-nhtsa.md +++ b/apps/docs/src/utils/use-nhtsa.md @@ -40,14 +40,14 @@ API. It is used internally by the package and by users to make direct requests t It contains functions for making HTTP requests to the VPIC API. All request methods return a Promise that resolves to an object containing the full response data. See the -[VPIC API Response](../api/vpic-api-response) page for more info on the full response returned by the +[VPIC API Response](../guide/vpic/vpic-api-response) page for more info on the full response returned by the request functions. It also contains functions for building and returning the URL string for the VPIC API endpoints. ::: tip See Also: -- [useNHTSA Reference](../typedoc/modules/api_useNHTSA) +- [useNHTSA Reference](../typedoc/api/useNHTSA) - [Alternate Use of This Package](../guide/bring-your-own-fetch#option-2-using-usenhtsa) @@ -159,9 +159,9 @@ get() ## Options -[`CreateUrlOptions`](../typedoc/modules/api_useNHTSA#createurloptions): +[`CreateUrlOptions`](../typedoc/api/useNHTSA#createurloptions): -- `endpointName` - The name of the endpoint to use, see [VPIC API Endpoints](../api/#vpic-api-endpoints) +- `endpointName` - The name of the endpoint to use, see [VPIC API Endpoints](../guide/vpic/#vpic-api-endpoints) (required) - `path` - The final path to use in the full url path (default: `""`) diff --git a/config/eslint-config-custom/eslint-config.js b/config/eslint-config-custom/eslint-config.js index 02eb0e41..2e1bf4fd 100644 --- a/config/eslint-config-custom/eslint-config.js +++ b/config/eslint-config-custom/eslint-config.js @@ -37,6 +37,7 @@ module.exports = { "coverage/", "dist/", "dev/", + "dev-dist", "typeDoc/", ], // 0 = off, 1 = warn, 2 = error diff --git a/config/eslint-config-custom/package.json b/config/eslint-config-custom/package.json index ee149fec..29b8499b 100644 --- a/config/eslint-config-custom/package.json +++ b/config/eslint-config-custom/package.json @@ -5,15 +5,15 @@ "private": true, "main": "eslint-config.js", "dependencies": { - "@typescript-eslint/eslint-plugin": "5.59.7", - "@typescript-eslint/parser": "5.59.7", - "eslint": "8.41.0", - "eslint-config-prettier": "8.8.0", - "eslint-plugin-markdown": "3.0.0", - "eslint-plugin-prettier": "4.2.1", - "prettier": "2.8.8" + "@typescript-eslint/eslint-plugin": "6.9.0", + "@typescript-eslint/parser": "6.9.0", + "eslint": "8.52.0", + "eslint-config-prettier": "9.0.0", + "eslint-plugin-markdown": "3.0.1", + "eslint-plugin-prettier": "5.0.1", + "prettier": "3.0.3" }, "devDependencies": { - "typescript": "5.0.4" + "typescript": "5.2.2" } } diff --git a/config/prettier-config/package.json b/config/prettier-config/package.json index 24842ad7..65eb44a1 100644 --- a/config/prettier-config/package.json +++ b/config/prettier-config/package.json @@ -5,6 +5,6 @@ "private": true, "main": "prettier-config.json", "devDependencies": { - "prettier": "2.8.8" + "prettier": "3.0.3" } } diff --git a/config/tsconfig/package.json b/config/tsconfig/package.json index e0329d68..32c2ce73 100644 --- a/config/tsconfig/package.json +++ b/config/tsconfig/package.json @@ -12,6 +12,6 @@ "vite-press.json" ], "dependencies": { - "@types/node": "18.15.11" + "@types/node": "18.18.7" } } diff --git a/config/typedoc-config/package.json b/config/typedoc-config/package.json index b1052f23..c54968b8 100644 --- a/config/typedoc-config/package.json +++ b/config/typedoc-config/package.json @@ -5,8 +5,8 @@ "private": true, "main": "typedoc-config.js", "devDependencies": { - "typedoc": "0.24.7", - "typedoc-plugin-markdown": "3.15.3", - "typescript": "5.0.4" + "typedoc": "0.25.2", + "typedoc-plugin-markdown": "4.0.0-next.25", + "typescript": "5.2.2" } } diff --git a/config/typedoc-config/typedoc-config.js b/config/typedoc-config/typedoc-config.js index 9894e976..2d2d66ba 100644 --- a/config/typedoc-config/typedoc-config.js +++ b/config/typedoc-config/typedoc-config.js @@ -12,7 +12,11 @@ const navigationLinks = { module.exports = { entryPoints: [entryPoint], entryPointStrategy: "expand", - exclude: ["**/*+(.spec|.e2e|.test|vite-env.d).ts"], + exclude: [ + "**/*+(.spec|.e2e|.test|.test-d|vite-env|global).ts", + "**/vite-env.d.ts", + "**/global.d.ts" + ], gitRevision: "main", hideGenerator: true, includeVersion: true, diff --git a/examples/simple-examples/nhtsa-test-iife.html b/examples/simple-examples/browser-iife-example.html similarity index 79% rename from examples/simple-examples/nhtsa-test-iife.html rename to examples/simple-examples/browser-iife-example.html index 615007ab..75aa166d 100644 --- a/examples/simple-examples/nhtsa-test-iife.html +++ b/examples/simple-examples/browser-iife-example.html @@ -5,6 +5,15 @@ Testing IIFE bundle imports + - - -

- Click to console.log GetCanadianVehicleSpecifications results -
-

-

- Click to console.log NHTSA.DecodeWMI() results -
-

-

- Click to console.log isValidVin() results -
-

- - diff --git a/examples/simple-examples/nhtsa-test-umd-cjs.js b/examples/simple-examples/nhtsa-test-umd-cjs.js deleted file mode 100755 index e3d43f0c..00000000 --- a/examples/simple-examples/nhtsa-test-umd-cjs.js +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable no-undef */ -/* eslint-disable no-console */ - -import nhtsa from '../../dist/nhtsa-api-wrapper.umd.cjs' - -const decoderTest = async () => { - const { Results } = await nhtsa - .DecodeVin('3VWCK21C92M452103') - .catch((err) => err) - - return Results -} - -const results = await decoderTest() - -console.log(JSON.stringify(results)) diff --git a/examples/simple-examples/nhtsa-test.cjs b/examples/simple-examples/nhtsa-test.cjs deleted file mode 100644 index 2ad4f003..00000000 --- a/examples/simple-examples/nhtsa-test.cjs +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable no-undef */ -/* eslint-disable no-console */ - -async function testApi() { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const nhsta = await require("../../packages/lib/dist/nhtsa-api-wrapper.cjs"); - const result = await nhsta.DecodeVin("3VWCK21C92M452103", false); - console.log(result); - return result; -} - -testApi(); diff --git a/examples/simple-examples/nhtsa-test.js b/examples/simple-examples/nhtsa-test.js deleted file mode 100755 index 38b8dafd..00000000 --- a/examples/simple-examples/nhtsa-test.js +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable no-undef */ -/* eslint-disable no-console */ - -import { DecodeVin } from "../../packages/lib/dist/nhtsa-api-wrapper.mjs"; - -async function testApi() { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const result = await DecodeVin("3VWCK21C92M452103"); - console.log(result); - return result; -} - -testApi(); diff --git a/examples/simple-examples/nhtsa-test.mjs b/examples/simple-examples/nhtsa-test.mjs deleted file mode 100755 index 3424778e..00000000 --- a/examples/simple-examples/nhtsa-test.mjs +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable no-undef */ -/* eslint-disable no-console */ - -import { DecodeVin } from "../../packages/lib/dist/nhtsa-api-wrapper.mjs"; - -const results = await DecodeVin("3VWCK21C92M452103").catch((err) => err); - -console.log(JSON.stringify(results)); diff --git a/examples/simple-examples/node-cjs-example.cjs b/examples/simple-examples/node-cjs-example.cjs new file mode 100644 index 00000000..67d1c030 --- /dev/null +++ b/examples/simple-examples/node-cjs-example.cjs @@ -0,0 +1,15 @@ +#!/usr/bin/env node +/* eslint-disable no-undef */ +/* eslint-disable no-console */ + +async function testApi() { + // eslint-disable-next-line @typescript-eslint/no-var-requires + + // No need to import from /dist/ in this example, the CJS bundle is the default in the case of CommonJS environments. + const NHTSA = await require("@shaggytools/nhtsa-api-wrapper"); + const result = await NHTSA.DecodeVin("3VWCK21C92M452103"); + console.log(result); + return result; +} + +testApi(); diff --git a/examples/simple-examples/node-mjs-example.mjs b/examples/simple-examples/node-mjs-example.mjs new file mode 100755 index 00000000..cd1c8e29 --- /dev/null +++ b/examples/simple-examples/node-mjs-example.mjs @@ -0,0 +1,12 @@ +#!/usr/bin/env node +/* eslint-disable no-undef */ +/* eslint-disable no-console */ + +// No need to import from /dist/ in this example, the ESM (.mjs) bundle is the default when using +// files with the .mjs extension. + +import { DecodeVin } from "@shaggytools/nhtsa-api-wrapper"; + +const results = await DecodeVin("3VWCK21C92M452103"); + +console.log(JSON.stringify(results)); diff --git a/examples/simple-examples/node-umd-example.cjs b/examples/simple-examples/node-umd-example.cjs new file mode 100755 index 00000000..e9f1eca9 --- /dev/null +++ b/examples/simple-examples/node-umd-example.cjs @@ -0,0 +1,21 @@ +#!/usr/bin/env node +/* eslint-disable no-undef */ +/* eslint-disable no-console */ + +/* This file is named with a .cjs extension to allow for the require syntax. + * See the node-umd-example.mjs file for another example of using the UMD bundle + * with the import syntax. + */ + +async function testApi() { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const NHTSA = + await require("@shaggytools/nhtsa-api-wrapper/dist/nhtsa-api-wrapper.umd.cjs"); + + const result = await NHTSA.DecodeVin("3VWCK21C92M452103"); + + console.log(result); + return result; +} + +testApi(); diff --git a/examples/simple-examples/node-umd-example.mjs b/examples/simple-examples/node-umd-example.mjs new file mode 100755 index 00000000..efabbc4a --- /dev/null +++ b/examples/simple-examples/node-umd-example.mjs @@ -0,0 +1,24 @@ +#!/usr/bin/env node +/* eslint-disable no-undef */ +/* eslint-disable no-console */ + +/* This file is named with a .mjs extension to allow for the import syntax and + * indicate that it is a module, even though it is using the UMD bundle with .cjs + * extension. + * See the node-umd-example.cjs file for another example of using the UMD bundle + * with the require syntax. + */ + +import nhtsa from "@shaggytools/nhtsa-api-wrapper/dist/nhtsa-api-wrapper.umd.cjs"; + +const decoderTest = async () => { + const { Results } = await nhtsa + .DecodeVin("3VWCK21C92M452103") + .catch((err) => err); + + return Results; +}; + +const results = await decoderTest(); + +console.log(JSON.stringify(results)); diff --git a/examples/simple-examples/package.json b/examples/simple-examples/package.json new file mode 100644 index 00000000..6abc50d8 --- /dev/null +++ b/examples/simple-examples/package.json @@ -0,0 +1,10 @@ +{ + "name": "simple-examples", + "version": "0.0.1", + "description": "Simple Examples for Node and Browser demonstrating use of @shaggytools/nhtsa-api-wrapper", + "private": true, + "main": "index.js", + "dependencies": { + "@shaggytools/nhtsa-api-wrapper": "workspace:*" + } +} diff --git a/package.json b/package.json index 784597b4..eb9a088e 100644 --- a/package.json +++ b/package.json @@ -13,15 +13,16 @@ "bugs": { "url": "https://github.com/ShaggyTech/nhtsa-api-wrapper/issues" }, - "packageManager": "pnpm@8.1.0", + "packageManager": "pnpm@8.9.2", "workspaces": [ "apps/*", "config/*", + "examples/*", "packages/*" ], "engines": { "node": ">=18.13.0", - "pnpm": ">=7.27.1" + "pnpm": ">=8.6.0" }, "scripts": { "preinstall": "npx only-allow pnpm", @@ -41,13 +42,13 @@ "ci:publish": "pnpm run build && pnpm publish -r" }, "devDependencies": { - "@changesets/cli": "2.26.1", - "@commitlint/cli": "17.6.3", - "@commitlint/config-conventional": "17.6.3", + "@changesets/cli": "2.26.2", + "@commitlint/cli": "18.1.0", + "@commitlint/config-conventional": "18.1.0", "husky": "8.0.3", - "rimraf": "5.0.1", - "turbo": "1.9.9", - "typescript": "5.0.4" + "rimraf": "5.0.5", + "turbo": "1.10.16", + "typescript": "5.2.2" }, "husky": { "hooks": { diff --git a/packages/lib/.typedoc/typedoc.cjs b/packages/lib/.typedoc/typedoc.cjs index 964f0a57..116abfb4 100644 --- a/packages/lib/.typedoc/typedoc.cjs +++ b/packages/lib/.typedoc/typedoc.cjs @@ -12,6 +12,12 @@ module.exports = { extends: 'typedoc-config', out, // typedoc-plugin-markdown options - entryDocument: './index.md', + entryFileName: 'index.md', readme: './README.md', + outputFileStrategy: 'modules', + parametersFormat: 'table', + propertiesFormat: 'table', + enumMembersFormat: 'table', + typeDeclarationFormat: 'table', + indexFormat: 'table', } diff --git a/packages/lib/README.md b/packages/lib/README.md index 21f68e14..e8b523d1 100644 --- a/packages/lib/README.md +++ b/packages/lib/README.md @@ -61,7 +61,7 @@ WMIs, get all makes for a certain year, and more. - [Install](https://vpic.shaggytech.com/guide/install) - [Node Quick Start](https://vpic.shaggytech.com//guide/getting-started#node-quick-start) - [Browser Quick Start](https://vpic.shaggytech.com/guide/getting-started#browser-quick-start) -- [API Reference](https://vpic.shaggytech.com/api/) +- [VPIC Reference](https://vpic.shaggytech.com/guide/vpic/) ## Node Install @@ -112,9 +112,9 @@ const { Results } = await DecodeVinValues('WA1A4AFY2J2008189') 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) +For a full example response see: [DecodeVinValues](https://vpic.shaggytech.com/guide/vpic/endpoints/decode-vin-values#returns) -All available endpoints can be found here: [VPIC API Endpoints](https://vpic.shaggytech.com/api/#vpic-api-endpoints) +All available endpoints can be found here: [VPIC API Endpoints](https://vpic.shaggytech.com/guide/vpic/#vpic-api-endpoints) ## Browser Install diff --git a/packages/lib/package.json b/packages/lib/package.json index d15f7cf8..26ff0515 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -35,12 +35,12 @@ "libraryName": "nhtsa-api-wrapper", "sideEffects": false, "type": "module", - "main": "dist/nhtsa-api-wrapper.cjs", - "module": "dist/nhtsa-api-wrapper.mjs", - "types": "dist/types/index.d.ts", - "source": "src/index.ts", - "unpkg": "dist/nhtsa-api-wrapper.iife.js", - "jsdelivr": "dist/nhtsa-api-wrapper.iife.js", + "main": "./dist/nhtsa-api-wrapper.cjs", + "module": "./dist/nhtsa-api-wrapper.mjs", + "types": "./dist/types/index.d.ts", + "source": "./src/index.ts", + "unpkg": "./dist/nhtsa-api-wrapper.umd.cjs", + "jsdelivr": "./dist/nhtsa-api-wrapper.iife.js", "files": [ "dist" ], @@ -53,45 +53,48 @@ }, "require": "./dist/nhtsa-api-wrapper.cjs" }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./dist/*": "./dist/*" }, "publishConfig": { "access": "public" }, "scripts": { "preinstall": "npx only-allow pnpm", - "build": "pnpm run \"/^build:.*/\" && pnpm run format:typedoc", + "build": "pnpm run \"/^build:.*/\"", "build:lib": "tsc --noEmit && vite build", "build:typedocs": "typedoc --options .typedoc/typedoc.cjs", "dev": "pnpm run \"/^dev:.*/\"", "dev:lib": "vite build --watch", "dev:typedocs": "typedoc --options .typedoc/typedoc.cjs --watch", - "preview": "vite preview", "lint": "eslint .", "lint:fix": "eslint --fix", - "format": "prettier --write \"src/**/*.{ts,tsx,md}\"", + "format": "prettier --write \"src/**/*.{js,ts,md}\"", "format:typedoc": "pnpm --filter docs run format:typedoc", "test": "vitest", + "test:ui": "vitest --ui --reporter=html --coverage.enabled=true", + "test:ui:build": "vitest --ui --reporter=html --coverage.enabled=true --open=false --watch=false", + "test:ui:preview": "vite preview --outDir ./.vitest/dist/ui", "coverage": "vitest --coverage", - "clean": "rimraf ./dist ./coverage .turbo", + "clean": "rimraf ./dist ./.vitest/dist .turbo", "clean:all": "pnpm run clean && rimraf node_modules" }, "devDependencies": { - "@vitest/coverage-c8": "0.31.1", - "@vitest/ui": "0.31.1", - "eslint": "8.41.0", + "@vitest/coverage-v8": "1.0.1", + "@vitest/ui": "1.0.1", + "eslint": "8.52.0", "eslint-config-custom": "workspace:*", - "prettier": "2.8.8", + "prettier": "3.0.3", "prettier-config": "workspace:*", - "rimraf": "5.0.1", + "rimraf": "5.0.5", "tsconfig": "workspace:*", - "typedoc": "0.24.7", + "typedoc": "0.25.2", "typedoc-config": "workspace:*", - "typescript": "5.0.4", - "vite": "4.3.9", - "vite-plugin-dts": "2.3.0", - "vite-tsconfig-paths": "4.2.0", - "vitest": "0.31.1", + "typescript": "5.2.2", + "vite": "5.0.5", + "vite-plugin-dts": "3.6.4", + "vite-tsconfig-paths": "4.2.1", + "vitest": "1.0.1", "vitest-fetch-mock": "0.2.2" }, "eslintConfig": { @@ -101,4 +104,4 @@ "root": true }, "prettier": "prettier-config" -} +} \ No newline at end of file diff --git a/packages/lib/src/__tests__/index.test.ts b/packages/lib/src/__tests__/index.test.ts new file mode 100644 index 00000000..60008577 --- /dev/null +++ b/packages/lib/src/__tests__/index.test.ts @@ -0,0 +1,199 @@ +import { describe, expect, it } from 'vitest' +import { + // VPIC API + DecodeVin, + DecodeVinExtended, + DecodeVinValues, + DecodeVinValuesBatch, + DecodeVinValuesExtended, + DecodeWMI, + GetAllMakes, + GetAllManufacturers, + GetCanadianVehicleSpecifications, + GetEquipmentPlantCodes, + GetMakeForManufacturer, + GetMakesForManufacturerAndYear, + GetMakesForVehicleType, + GetManufacturerDetails, + GetModelsForMake, + GetModelsForMakeId, + GetModelsForMakeIdYear, + GetModelsForMakeYear, + GetParts, + GetVehicleTypesForMake, + GetVehicleTypesForMakeId, + GetVehicleVariableList, + GetVehicleVariableValuesList, + GetWMIsForManufacturer, + complaints, + products, + recalls, + safetyRatings, + useNHTSA, + // Utility functions + createQueryString, + encodeQueryStringParams, + isValidVin, +} from '../' + +describe('api/index.ts', () => { + it('exports DecodeVin function', () => { + expect(DecodeVin).toBeDefined() + expect(DecodeVin).toBeInstanceOf(Function) + }) + + it('exports DecodeVinExtended function', () => { + expect(DecodeVinExtended).toBeDefined() + expect(DecodeVinExtended).toBeInstanceOf(Function) + }) + + it('exports DecodeVinValues function', () => { + expect(DecodeVinValues).toBeDefined() + expect(DecodeVinValues).toBeInstanceOf(Function) + }) + + it('exports DecodeVinValuesBatch function', () => { + expect(DecodeVinValuesBatch).toBeDefined() + expect(DecodeVinValuesBatch).toBeInstanceOf(Function) + }) + + it('exports DecodeVinValuesExtended function', () => { + expect(DecodeVinValuesExtended).toBeDefined() + expect(DecodeVinValuesExtended).toBeInstanceOf(Function) + }) + + it('exports DecodeWMI function', () => { + expect(DecodeWMI).toBeDefined() + expect(DecodeWMI).toBeInstanceOf(Function) + }) + + it('exports GetAllMakes function', () => { + expect(GetAllMakes).toBeDefined() + expect(GetAllMakes).toBeInstanceOf(Function) + }) + + it('exports GetAllManufacturers function', () => { + expect(GetAllManufacturers).toBeDefined() + expect(GetAllManufacturers).toBeInstanceOf(Function) + }) + + it('exports GetCanadianVehicleSpecifications function', () => { + expect(GetCanadianVehicleSpecifications).toBeDefined() + expect(GetCanadianVehicleSpecifications).toBeInstanceOf(Function) + }) + + it('exports GetEquipmentPlantCodes function', () => { + expect(GetEquipmentPlantCodes).toBeDefined() + expect(GetEquipmentPlantCodes).toBeInstanceOf(Function) + }) + + it('exports GetMakeForManufacturer function', () => { + expect(GetMakeForManufacturer).toBeDefined() + expect(GetMakeForManufacturer).toBeInstanceOf(Function) + }) + + it('exports GetMakesForManufacturerAndYear function', () => { + expect(GetMakesForManufacturerAndYear).toBeDefined() + expect(GetMakesForManufacturerAndYear).toBeInstanceOf(Function) + }) + + it('exports GetMakesForVehicleType function', () => { + expect(GetMakesForVehicleType).toBeDefined() + expect(GetMakesForVehicleType).toBeInstanceOf(Function) + }) + + it('exports GetManufacturerDetails function', () => { + expect(GetManufacturerDetails).toBeDefined() + expect(GetManufacturerDetails).toBeInstanceOf(Function) + }) + + it('exports GetModelsForMake function', () => { + expect(GetModelsForMake).toBeDefined() + expect(GetModelsForMake).toBeInstanceOf(Function) + }) + + it('exports GetModelsForMakeId function', () => { + expect(GetModelsForMakeId).toBeDefined() + expect(GetModelsForMakeId).toBeInstanceOf(Function) + }) + + it('exports GetModelsForMakeIdYear function', () => { + expect(GetModelsForMakeIdYear).toBeDefined() + expect(GetModelsForMakeIdYear).toBeInstanceOf(Function) + }) + + it('exports GetModelsForMakeYear function', () => { + expect(GetModelsForMakeYear).toBeDefined() + expect(GetModelsForMakeYear).toBeInstanceOf(Function) + }) + + it('exports GetParts function', () => { + expect(GetParts).toBeDefined() + expect(GetParts).toBeInstanceOf(Function) + }) + + it('exports GetVehicleTypesForMake function', () => { + expect(GetVehicleTypesForMake).toBeDefined() + expect(GetVehicleTypesForMake).toBeInstanceOf(Function) + }) + + it('exports GetVehicleTypesForMakeId function', () => { + expect(GetVehicleTypesForMakeId).toBeDefined() + expect(GetVehicleTypesForMakeId).toBeInstanceOf(Function) + }) + + it('exports GetVehicleVariableList function', () => { + expect(GetVehicleVariableList).toBeDefined() + expect(GetVehicleVariableList).toBeInstanceOf(Function) + }) + + it('exports GetVehicleVariableValuesList function', () => { + expect(GetVehicleVariableValuesList).toBeDefined() + expect(GetVehicleVariableValuesList).toBeInstanceOf(Function) + }) + + it('exports GetWMIsForManufacturer function', () => { + expect(GetWMIsForManufacturer).toBeDefined() + expect(GetWMIsForManufacturer).toBeInstanceOf(Function) + }) + + it('exports complaints function', () => { + expect(complaints).toBeDefined() + expect(complaints).toBeInstanceOf(Function) + }) + + it('exports products function', () => { + expect(products).toBeDefined() + expect(products).toBeInstanceOf(Function) + }) + + it('exports recalls function', () => { + expect(recalls).toBeDefined() + expect(recalls).toBeInstanceOf(Function) + }) + + it('exports safetyRatings function', () => { + expect(safetyRatings).toBeDefined() + expect(safetyRatings).toBeInstanceOf(Function) + }) + + it('exports useNHTSA function', () => { + expect(useNHTSA).toBeDefined() + expect(useNHTSA).toBeInstanceOf(Function) + }) + + it('exports createQueryString function', () => { + expect(createQueryString).toBeDefined() + expect(createQueryString).toBeInstanceOf(Function) + }) + + it('exports encodeQueryStringParams function', () => { + expect(encodeQueryStringParams).toBeDefined() + expect(encodeQueryStringParams).toBeInstanceOf(Function) + }) + + it('exports isValidVin function', () => { + expect(isValidVin).toBeDefined() + expect(isValidVin).toBeInstanceOf(Function) + }) +}) diff --git a/packages/lib/src/api/README.md b/packages/lib/src/api/README.md index c0e07021..145b3200 100644 --- a/packages/lib/src/api/README.md +++ b/packages/lib/src/api/README.md @@ -2,14 +2,6 @@ ## `/api` exports the following: -- [useNHTSA](#useNHTSA) - a composable function that returns an object containing methods for making +- Composable function [useNHTSA](#useNHTSA) which returns an object containing methods for making HTTP requests to the NHTSA API. The returned functions are documented in the - [Package Documentation](https://www.shaggytech.com/nhtsa-api-wrapper) - -- `/api/endpoints` contains all 24 helper functions, one for each endpoint - (DecodeVin, GetAllMakes, etc). - -- `/api/types` contains all the types used by the NHTSA API. - - each endpoint response type is the endpoint name appended by `Results`, - - `Results`, such as `DecodeVinResults` - - see documentation of each endpoint for more details. + [Package Documentation](https://vpic.shaggytech.com) diff --git a/packages/lib/src/api/__tests__/index.test.ts b/packages/lib/src/api/__tests__/index.test.ts index b2ece334..28e23e04 100644 --- a/packages/lib/src/api/__tests__/index.test.ts +++ b/packages/lib/src/api/__tests__/index.test.ts @@ -25,6 +25,10 @@ import { GetVehicleVariableValuesList, GetWMIsForManufacturer, useNHTSA, + complaints, + products, + recalls, + safetyRatings, } from '../' describe('api/index.ts', () => { @@ -152,4 +156,24 @@ describe('api/index.ts', () => { expect(useNHTSA).toBeDefined() expect(useNHTSA).toBeInstanceOf(Function) }) + + it('exports complaints function', () => { + expect(complaints).toBeDefined() + expect(complaints).toBeInstanceOf(Function) + }) + + it('exports products function', () => { + expect(products).toBeDefined() + expect(products).toBeInstanceOf(Function) + }) + + it('exports recalls function', () => { + expect(recalls).toBeDefined() + expect(recalls).toBeInstanceOf(Function) + }) + + it('exports safetyRatings function', () => { + expect(safetyRatings).toBeDefined() + expect(safetyRatings).toBeInstanceOf(Function) + }) }) diff --git a/packages/lib/src/api/__tests__/useNHTSA.test.ts b/packages/lib/src/api/__tests__/useNHTSA.test.ts index 5bbf9fb3..2a2d7fa0 100644 --- a/packages/lib/src/api/__tests__/useNHTSA.test.ts +++ b/packages/lib/src/api/__tests__/useNHTSA.test.ts @@ -1,76 +1,77 @@ -import { beforeEach, describe, expect, it } from 'vitest' +import { beforeEach, describe, expect, test } from 'vitest' import { useNHTSA } from '../' // Mocks import { createMockResponse } from '.vitest/helpers' import { mockResults } from '.vitest/data' +import { ApiTypes } from '../types' describe('api/useNHTSA.ts', () => { - it('exports useNHTSA function', () => { + test('exports useNHTSA function', () => { expect(useNHTSA).toBeDefined() expect(useNHTSA).toBeInstanceOf(Function) }) }) describe('useNHTSA', () => { - describe('return object', () => { - it('returns object', () => { + describe('return object with functions', () => { + test('returns object', () => { const nhtsa = useNHTSA() expect(nhtsa).toBeDefined() expect(nhtsa).toBeInstanceOf(Object) }) - it('returns setCachedUrl function', () => { + test('returns setCachedUrl function', () => { const { setCachedUrl } = useNHTSA() expect(setCachedUrl).toBeDefined() expect(setCachedUrl).toBeInstanceOf(Function) }) - it('returns getCachedUrl function', () => { + test('returns getCachedUrl function', () => { const { getCachedUrl } = useNHTSA() expect(getCachedUrl).toBeDefined() expect(getCachedUrl).toBeInstanceOf(Function) }) - it('returns clearCachedUrl function', () => { + test('returns clearCachedUrl function', () => { const { clearCachedUrl } = useNHTSA() expect(clearCachedUrl).toBeDefined() expect(clearCachedUrl).toBeInstanceOf(Function) }) - it('returns createCachedUrl function', () => { + test('returns createCachedUrl function', () => { const { createCachedUrl } = useNHTSA() expect(createCachedUrl).toBeDefined() expect(createCachedUrl).toBeInstanceOf(Function) }) - it('returns createUrl function', () => { + test('returns createUrl function', () => { const { createUrl } = useNHTSA() expect(createUrl).toBeDefined() expect(createUrl).toBeInstanceOf(Function) }) - it('returns createPostBody function', () => { + test('returns createPostBody function', () => { const { createPostBody } = useNHTSA() expect(createPostBody).toBeDefined() expect(createPostBody).toBeInstanceOf(Function) }) - it('returns get function', () => { + test('returns get function', () => { const { get } = useNHTSA() expect(get).toBeDefined() expect(get).toBeInstanceOf(Function) }) - it('returns post function', () => { + test('returns post function', () => { const { post } = useNHTSA() expect(post).toBeDefined() expect(post).toBeInstanceOf(Function) }) }) - describe('setCachedUrl', () => { - it('sets cached url', () => { + describe('useNHTSA.setCachedUrl()', () => { + test('sets cached url', () => { const { setCachedUrl, getCachedUrl } = useNHTSA() expect(getCachedUrl()).toBe(undefined) @@ -79,8 +80,8 @@ describe('useNHTSA', () => { }) }) - describe('getCachedUrl', () => { - it('gets cached url', () => { + describe('useNHTSA.getCachedUrl()', () => { + test('gets cached url', () => { const { setCachedUrl, getCachedUrl } = useNHTSA() expect(getCachedUrl()).toBe(undefined) @@ -91,19 +92,19 @@ describe('useNHTSA', () => { }) describe('clearCachedUrl', () => { - it('clears url', () => { + test('clears url', () => { const { setCachedUrl, getCachedUrl, clearCachedUrl } = useNHTSA() expect(getCachedUrl()).toBe(undefined) setCachedUrl('mock url 3') expect(getCachedUrl()).toBe('mock url 3') clearCachedUrl() - expect(getCachedUrl()).toBe('') + expect(getCachedUrl()).toBe(undefined) }) }) - describe('createUrl', () => { - it('creates url without caching', () => { + describe('useNHTSA.createUrl()', () => { + test('creates url without caching', () => { const { createUrl, setCachedUrl, getCachedUrl } = useNHTSA() const url = createUrl({ endpointName: 'Test', path: 'path' }) @@ -118,37 +119,40 @@ describe('useNHTSA', () => { }) }) - describe('createPostBody', () => { - it('returns a body string for VPIC POST requests', () => { + describe('useNHTSA.createPostBody()', () => { + test('returns a body string for VPIC POST requests', () => { const { createPostBody } = useNHTSA() const body = createPostBody('5UXWX7C5*BA;5YJSA3DS*EF,2015') expect(body).toBe('DATA=5UXWX7C5*BA;5YJSA3DS*EF,2015&format=json') }) - it('returns a URI encoded body string for VPIC POST requests', () => { + test('returns a URI encoded body string for VPIC POST requests', () => { const { createPostBody } = useNHTSA() const body = createPostBody('5UXWX7C5*BA; 5YJSA3DS*EF, 2015') expect(body).toBe('DATA=5UXWX7C5*BA;%205YJSA3DS*EF,%202015&format=json') }) - it('returns a URI encoded body string for VPIC POST requests if no data is provided', () => { + test('returns a default body string for VPIC POST requests if no data is provided', () => { const { createPostBody } = useNHTSA() let body = createPostBody('') expect(body).toBe('DATA=format=json') - body = createPostBody(undefined as unknown as string) + body = createPostBody( + // @ts-expect-error Argument of type 'undefined' is not assignable to parameter of type 'string'. + undefined + ) expect(body).toBe('DATA=format=json') }) }) - describe('createCachedUrl', () => { + describe('useNHTSA.createCachedUrl()', () => { /*********************** * Returns url string ***********************/ - it('caches url when provided an object', () => { + test('caches url when provided an object', () => { const { createCachedUrl, getCachedUrl } = useNHTSA() expect(getCachedUrl()).toBe(undefined) @@ -166,7 +170,7 @@ describe('useNHTSA', () => { ) }) - it('caches url when provided a string', () => { + test('caches url when provided a string', () => { const { createCachedUrl, getCachedUrl } = useNHTSA() expect(getCachedUrl()).toBe(undefined) @@ -179,7 +183,7 @@ describe('useNHTSA', () => { expect(getCachedUrl()).toBe('mock url 6') }) - it('does not cache url when provided an object with saveUrl = false', () => { + test('does not cache url when provided an object with saveUrl = false', () => { const { createCachedUrl, getCachedUrl } = useNHTSA() expect(getCachedUrl()).toBe(undefined) @@ -215,7 +219,7 @@ describe('useNHTSA', () => { ) }) - it('ignores empty string params by default', () => { + test('ignores empty string params by default', () => { const { createCachedUrl, getCachedUrl } = useNHTSA() expect(getCachedUrl()).toBe(undefined) @@ -230,7 +234,7 @@ describe('useNHTSA', () => { ) }) - it('uses empty string values when provided an object with allowEmptyParams = true', () => { + test('uses empty string values when provided an object with allowEmptyParams = true', () => { const { createCachedUrl, getCachedUrl } = useNHTSA() expect(getCachedUrl()).toBe(undefined) @@ -245,37 +249,100 @@ describe('useNHTSA', () => { ) }) - it('does not include default query string when provided an object with includeQueryString = false', () => { + test('does not include default query string when includeQueryString = false', () => { const { createCachedUrl, getCachedUrl } = useNHTSA() expect(getCachedUrl()).toBe(undefined) const url = createCachedUrl({ - endpointName: 'DecodeVinValuesBatch', + endpointName: 'someEndpoint', includeQueryString: false, }) - expect(url).toBe( - 'https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVinValuesBatch/' + expect(url).toBe('https://vpic.nhtsa.dot.gov/api/vehicles/someEndpoint/') + }) + + describe('sets correct base API url based on options.apiType or uses default "vpic"', () => { + const { createCachedUrl } = useNHTSA() + + test('vpic.nhtsa.dot.gov/api/vehicles/, apiType: undefined', () => { + const url = createCachedUrl({ + endpointName: 'someEndpoint', + }) + expect(url).toBe( + 'https://vpic.nhtsa.dot.gov/api/vehicles/someEndpoint/?format=json' + ) + }) + + test.each(['vpic'])( + 'vpic.nhtsa.dot.gov/api/vehicles/, apiType: "%s"', + (apiType) => { + const url = createCachedUrl({ + endpointName: 'someEndpoint', + apiType, + }) + expect(url).toBe( + 'https://vpic.nhtsa.dot.gov/api/vehicles/someEndpoint/?format=json' + ) + } ) + + test.each([ + 'complaints', + 'cssiStation', + 'products', + 'recalls', + 'safetyRatings', + ])('api.nhtsa.gov/, apiType: "%s"', (apiType) => { + const url = createCachedUrl({ + endpointName: 'someEndpoint', + apiType, + }) + expect(url).toBe(`https://api.nhtsa.gov/someEndpoint/?format=json`) + }) }) /*********************** - * rejects with error + * Throws Error ***********************/ - it('rejects with error if endpointName is not provided in input object', () => { - const { createCachedUrl } = useNHTSA() + describe('Throws Error:', () => { + describe('if arg is an object but endpointName is not a string:', () => { + test.each([ + {}, + { a: 'b' }, + { endpointName: undefined }, + { endpointName: null }, + { endpointName: 123 }, + { endpointName: 1234n }, + { endpointName: 0 }, + { endpointName: -0 }, + { endpointName: 0n }, + { endpointName: [] }, + { endpointName: ['1', '2', '3'] }, + { endpointName: () => 'a function' }, + { endpointName: true }, + { endpointName: false }, + { endpointName: new Date() }, + { endpointName: new Number() }, + { endpointName: new Boolean() }, + { endpointName: new Error() }, + ])('createCachedUrl( %s )', async (arg) => { + const { createCachedUrl } = useNHTSA() + expect(() => + createCachedUrl( + // @ts-expect-error Types of property 'endpointName' are incompatible. Type 'x' is not assignable to type 'string'. + arg + ) + ).toThrowError( + /options.endpointName is required to create a URL string/ + ) - expect(() => - createCachedUrl({ endpointName: undefined as unknown as string }) - ).toThrowError() + expect(fetchMock.requests().length).toEqual(0) + }) + }) }) }) - describe('get', () => { - beforeEach(() => { - fetchMock.resetMocks() - }) - + describe('useNHTSA.get()', () => { const endpointName = 'DecodeVin' const vin = 'WA1A4AFY2J2008189' const params = { modelYear: 2018 } @@ -284,151 +351,228 @@ describe('useNHTSA', () => { /*********************** * Returns data ***********************/ - it('returns data when given a string', async () => { - fetchMock.mockResolvedValue(createMockResponse(mockResults)) - - const { get } = useNHTSA() - const data = await get(mockUrl) + describe('Returns Data:', () => { + beforeEach(() => { + fetchMock.resetMocks() + fetchMock.mockResolvedValue(createMockResponse(mockResults)) + }) - expect(data).toEqual(mockResults) - expect(fetchMock.requests()[0].url).toEqual(mockUrl) - expect(fetchMock.requests()[0].method).toEqual('GET') - }) + test('when passed a string', async () => { + const { get } = useNHTSA() + const data = await get(mockUrl) - it('returns data when given an object of CreateUrlOptions', async () => { - fetchMock.mockResolvedValue(createMockResponse(mockResults)) + expect(data).toEqual(mockResults) + expect(fetchMock.requests()[0].url).toEqual(mockUrl) + expect(fetchMock.requests()[0].method).toEqual('GET') + }) - const { get } = useNHTSA() - const data = await get({ - endpointName: endpointName, - path: vin, - params, + test('when passed an object of CreateUrlOptions', async () => { + const { get } = useNHTSA() + const data = await get({ + endpointName: endpointName, + path: vin, + params, + }) + + expect(data).toEqual(mockResults) + expect(fetchMock.requests()[0].url).toEqual(mockUrl) + expect(fetchMock.requests()[0].method).toEqual('GET') }) - expect(data).toEqual(mockResults) - expect(fetchMock.requests()[0].url).toEqual(mockUrl) - expect(fetchMock.requests()[0].method).toEqual('GET') + test('uses a cached url if not passed one', async () => { + const { createCachedUrl, get } = useNHTSA() + createCachedUrl({ + endpointName: endpointName, + path: vin, + params, + }) + const data = await get() + + expect(data).toEqual(mockResults) + expect(fetchMock.requests()[0].url).toEqual(mockUrl) + expect(fetchMock.requests()[0].method).toEqual('GET') + }) }) - it('uses a cached url if not provided one', async () => { - fetchMock.mockResolvedValue(createMockResponse(mockResults)) + /*********************** + * Rejects with Error + ***********************/ + describe('Rejects with Error:', () => { + beforeEach(() => { + fetchMock.resetMocks() + fetchMock.mockResolvedValue(createMockResponse(mockResults)) + }) - const { createCachedUrl, get } = useNHTSA() - createCachedUrl({ - endpointName: endpointName, - path: vin, - params, + describe('If first arg is defined but is neither a string nor object:', () => { + test.each([ + 123, + 1234n, + 0, + -0, + 0n, + [], + ['1', '2', '3'], + () => 'a function', + true, + false, + null, + undefined, + NaN, + new Date(), + new Number(), + new Boolean(), + new Error(), + ])('get( %s )', async (arg) => { + const { get } = useNHTSA() + await expect(() => + get( + // @ts-expect-error Argument of type 'x' is not assignable to parameter of type 'string | CreateUrlOptions | undefined'. + arg + ) + ).rejects.toThrowError(/error validating argument named "url"/) + + expect(fetchMock.requests().length).toEqual(0) + }) }) - const data = await get() - expect(data).toEqual(mockResults) - expect(fetchMock.requests()[0].url).toEqual(mockUrl) - expect(fetchMock.requests()[0].method).toEqual('GET') + describe('If first arg is an object but endpointName is not provided:', () => { + test.each([ + {}, + { a: 'b' }, + { endpointName: undefined }, + { endpointName: null }, + { endpointName: 123 }, + { endpointName: 1234n }, + { endpointName: 0 }, + { endpointName: -0 }, + { endpointName: 0n }, + { endpointName: [] }, + { endpointName: ['1', '2', '3'] }, + { endpointName: () => 'a function' }, + { endpointName: true }, + { endpointName: false }, + { endpointName: new Date() }, + { endpointName: new Number() }, + { endpointName: new Boolean() }, + { endpointName: new Error() }, + ])('get( %s )', async (arg) => { + const { get } = useNHTSA() + await expect(() => + get( + // @ts-expect-error Types of property 'endpointName' are incompatible. Type 'x' is not assignable to type 'string'. + arg + ) + ).rejects.toThrowError( + /options.endpointName is required to create a URL string/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + }) + + describe('If second arg is defined but is not an object:', () => { + test.each([ + 123, + 1234n, + 0, + -0, + 0n, + [], + ['1', '2', '3'], + () => 'a function', + true, + false, + NaN, + new Date(), + new Number(), + new Boolean(), + new Error(), + ])('get( %s )', async (arg) => { + const { get } = useNHTSA() + await expect(() => + get( + { endpointName }, + // @ts-expect-error Argument of type 'x' is not assignable to parameter of type 'BodyInit | null | undefined'. + arg + ) + ).rejects.toThrowError(/error validating argument named "options"/) + + expect(fetchMock.requests().length).toEqual(0) + }) + }) }) /*********************** - * rejects with error + * Network Errors ***********************/ - it.each([1234, ['a', 'b'], null])( - 'rejects with error if there is no url cached and no valid url is provided, %#', - async (arg) => { + describe('Network Errors - Rejects with Error:', () => { + test('if there is no response', async () => { + // @ts-expect-error Argument of type 'undefined' is not assignable to parameter of type 'Response'. + fetchMock.mockResolvedValue(undefined) + const { get } = useNHTSA() - await expect(() => get(arg as unknown as string)).rejects.toThrowError( - /error validating argument named "url"/ + await expect(() => get(mockUrl)).rejects.toThrowError( + /API responded with an unknown error or sent no response/ ) + }) - expect(fetchMock.requests().length).toEqual(0) - } - ) + test('If response.ok === false', async () => { + fetchMock.mockResolvedValue( + createMockResponse( + { a: 'b' }, + { + ok: false, + } + ) + ) - it.each([{}, { a: 'b' }, { endpointName: undefined }])( - 'rejects with error if endpointName is not provided in CreateUrlOptions object, %#', - async (arg) => { const { get } = useNHTSA() - await expect(() => get(arg as unknown as string)).rejects.toThrowError( - /Endpoint name is required to create a VPIC URL string/ + await expect(() => get(mockUrl)).rejects.toThrowError( + /API response not ok/ ) + }) - expect(fetchMock.requests().length).toEqual(0) - } - ) - - /*********************** - * Network errors - ***********************/ - it('rejects with error if there is no response', async () => { - fetchMock.mockResolvedValue(undefined as unknown as Response) - - const { get } = useNHTSA() - await expect(() => get(mockUrl)).rejects.toThrowError( - /There was an error fetching API data: APi responded with an error, no response object returned/ - ) - }) - - it('rejects with error if !response.ok', async () => { - fetchMock.mockResolvedValue( - createMockResponse( - {}, - { - status: 500, - ok: false, - headers: new Headers({ 'Content-Type': 'application/xml' }), - } + test('if response content-type is not json', async () => { + fetchMock.mockResolvedValue( + createMockResponse( + { a: 'b' }, + { + headers: new Headers({ 'Content-Type': 'application/xml' }), + } + ) ) - ) - const { get } = useNHTSA() - await expect(() => get(mockUrl)).rejects.toThrowError( - /There was an error fetching API data: APi response not ok/ - ) - }) - - it('rejects with error if response is not json', async () => { - fetchMock.mockResolvedValue( - createMockResponse( - {}, - { - status: 200, - ok: true, - headers: new Headers({ 'Content-Type': 'application/xml' }), - } + const { get } = useNHTSA() + await expect(() => get(mockUrl)).rejects.toThrowError( + /API response not in JSON format/ ) - ) - - const { get } = useNHTSA() - await expect(() => get(mockUrl)).rejects.toThrowError( - /There was an error fetching API data: API response not in JSON format/ - ) - }) + }) - it('rejects with error if there is no json() method on the response', async () => { - fetchMock.mockResolvedValue( - createMockResponse({}, { json: null } as unknown as Response) - ) + test('if the response does not have a json() function', async () => { + fetchMock.mockResolvedValue( + // @ts-expect-error Type 'null' is not assignable to type '(() => Promise) | undefined'. + createMockResponse({ a: 'b' }, { json: 'empty' }) + ) - const { get } = useNHTSA() - await expect(() => get(mockUrl)).rejects.toThrowError( - /There was an error fetching API data: API response not in JSON format/ - ) - }) + const { get } = useNHTSA() + await expect(() => get(mockUrl)).rejects.toThrowError( + /API response not in JSON format/ + ) + }) - it('rejects with error if there is no data in response', async () => { - fetchMock.mockResolvedValue( - createMockResponse(undefined as unknown as object) - ) + test('if there is no data in response', async () => { + // @ts-expect-error Argument of type 'undefined' is not assignable to parameter of type 'object'. + fetchMock.mockResolvedValue(createMockResponse(undefined, {})) - const { get } = useNHTSA() - await expect(() => get(mockUrl)).rejects.toThrowError( - /There was an error fetching API data: VPIC API returned no data/ - ) + const { get } = useNHTSA() + await expect(() => get(mockUrl)).rejects.toThrowError( + /API returned no data/ + ) + }) }) }) - describe('post', () => { - beforeEach(() => { - fetchMock.resetMocks() - }) - + describe('useNHTSA.post()', () => { const endpointName = 'DecodeVinValuesBatch' const body = '5UXWX7C5*BA;5YJSA3DS*EF,2015' const mockUrl = `https://vpic.nhtsa.dot.gov/api/vehicles/${endpointName}/` @@ -436,156 +580,259 @@ describe('useNHTSA', () => { /*********************** * Returns data * ***********************/ - it('returns data when given an object of CreateUrlOptions', async () => { - fetchMock.mockResolvedValue(createMockResponse(mockResults)) - - const { post } = useNHTSA() - const data = await post({ endpointName }, { body }) - - expect(data).toEqual(mockResults) - expect(fetchMock.requests()[0].url).toEqual(mockUrl) - expect(fetchMock.requests()[0].method).toEqual('POST') - expect(fetchMock.requests()[0].headers.get('Content-Type')).toEqual( - 'application/x-www-form-urlencoded' - ) - }) - - it('returns data when given a URL string', async () => { - fetchMock.mockResolvedValue(createMockResponse(mockResults)) + describe('Returns Data:', () => { + beforeEach(() => { + fetchMock.resetMocks() + fetchMock.mockResolvedValue(createMockResponse(mockResults)) + }) + test('when passed an object of CreateUrlOptions', async () => { + const { post } = useNHTSA() + const data = await post({ endpointName }, { body }) - const { post } = useNHTSA() - const data = await post(mockUrl, { body }) + expect(data).toEqual(mockResults) + expect(fetchMock.requests()[0].url).toEqual(mockUrl) + expect(fetchMock.requests()[0].method).toEqual('POST') + expect(fetchMock.requests()[0].headers.get('Content-Type')).toEqual( + 'application/x-www-form-urlencoded' + ) + }) - expect(data).toEqual(mockResults) - expect(fetchMock.requests()[0].url).toEqual(mockUrl) - expect(fetchMock.requests()[0].method).toEqual('POST') - expect(fetchMock.requests()[0].headers.get('Content-Type')).toEqual( - 'application/x-www-form-urlencoded' - ) - }) + test('when passed a URL string', async () => { + const { post } = useNHTSA() + const data = await post(mockUrl, { body }) - it('uses a cached url if not provided one', async () => { - fetchMock.mockResolvedValue(createMockResponse(mockResults)) + expect(data).toEqual(mockResults) + expect(fetchMock.requests()[0].url).toEqual(mockUrl) + expect(fetchMock.requests()[0].method).toEqual('POST') + expect(fetchMock.requests()[0].headers.get('Content-Type')).toEqual( + 'application/x-www-form-urlencoded' + ) + }) - const { createCachedUrl, getCachedUrl, post } = useNHTSA() - createCachedUrl({ endpointName, includeQueryString: false }) - const data = await post(getCachedUrl(), { body }) + test('using a cached url if one is not passed', async () => { + const { createCachedUrl, getCachedUrl, post } = useNHTSA() + createCachedUrl({ endpointName, includeQueryString: false }) + const data = await post(getCachedUrl(), { body }) - expect(data).toEqual(mockResults) - expect(fetchMock.requests()[0].url).toEqual(mockUrl) - expect(fetchMock.requests()[0].method).toEqual('POST') + expect(data).toEqual(mockResults) + expect(fetchMock.requests()[0].url).toEqual(mockUrl) + expect(fetchMock.requests()[0].method).toEqual('POST') + }) }) /*********************** * rejects with error ***********************/ - it.each([1234, ['a', 'b'], null])( - 'rejects with error if there is no url cached and no valid url is provided, %#', - async (arg) => { - const { post } = useNHTSA() - - await expect(() => post(arg as unknown as string)).rejects.toThrowError( - /error validating argument named "url"/ - ) + describe('Rejects with Error:', () => { + beforeEach(() => { + fetchMock.resetMocks() + fetchMock.mockResolvedValue(createMockResponse(mockResults)) + }) - expect(fetchMock.requests().length).toEqual(0) - } - ) + describe('If first arg is defined but is neither a string nor object:', () => { + test.each([ + 123, + 1234n, + 0, + -0, + 0n, + [], + ['1', '2', '3'], + () => 'a function', + true, + false, + null, + undefined, + NaN, + new Date(), + new Number(), + new Boolean(), + new Error(), + ])('post( %s )', async (arg) => { + const { post } = useNHTSA() + await expect(() => + post( + // @ts-expect-error Argument of type 'x' is not assignable to parameter of type 'string | CreateUrlOptions | undefined'. + arg + ) + ).rejects.toThrowError(/error validating argument named "url"/) + + expect(fetchMock.requests().length).toEqual(0) + }) + }) - it.each([{}, { a: 'b' }, { endpointName: undefined }])( - 'rejects with error if endpointName is not provided in CreateUrlOptions object, %#', - async (arg) => { - const { post } = useNHTSA() - await expect(() => post(arg as unknown as string)).rejects.toThrowError( - /Endpoint name is required to create a VPIC URL string/ - ) + describe('If first arg is an object but endpointName is not provided:', () => { + test.each([ + {}, + { a: 'b' }, + { endpointName: undefined }, + { endpointName: null }, + { endpointName: 123 }, + { endpointName: 1234n }, + { endpointName: 0 }, + { endpointName: -0 }, + { endpointName: 0n }, + { endpointName: [] }, + { endpointName: ['1', '2', '3'] }, + { endpointName: () => 'a function' }, + { endpointName: true }, + { endpointName: false }, + { endpointName: new Date() }, + { endpointName: new Number() }, + { endpointName: new Boolean() }, + { endpointName: new Error() }, + ])('post( %s )', async (arg) => { + const { post } = useNHTSA() + await expect(() => + post( + // @ts-expect-error Types of property 'endpointName' are incompatible. Type 'x' is not assignable to type 'string'. + arg + ) + ).rejects.toThrowError( + /options.endpointName is required to create a URL string/ + ) - expect(fetchMock.requests().length).toEqual(0) - } - ) + expect(fetchMock.requests().length).toEqual(0) + }) + }) - it.each([{ a: 'b' }, 32, ['a', 'b']])( - 'rejects with error if body is not a string, %#', - async (arg) => { - const { post } = useNHTSA() + describe('If second arg is defined but is not an object:', () => { + test.each([ + 123, + 1234n, + 0, + -0, + 0n, + [], + ['1', '2', '3'], + () => 'a function', + true, + false, + NaN, + new Date(), + new Number(), + new Boolean(), + new Error(), + ])('post( url, %s )', async (arg) => { + const { post } = useNHTSA() + await expect(() => + post( + { endpointName }, + // @ts-expect-error Argument of type 'x' is not assignable to parameter of type 'BodyInit | null | undefined'. + arg + ) + ).rejects.toThrowError(/error validating argument named "options"/) + + expect(fetchMock.requests().length).toEqual(0) + }) + }) - await expect(() => - post( - { endpointName, includeQueryString: false }, - { body: arg as unknown as string } + describe('if second arg is an object but "body" property is not a string:', () => { + test.each([ + 123, + 1234n, + 0, + -0, + 0n, + [], + ['1', '2', '3'], + {}, + { a: '1', b: '2', c: '3' }, + () => 'a function', + true, + false, + null, + undefined, + NaN, + new Date(), + new Object(), + ])('post( url, { body: %s } )', async (arg) => { + const { post } = useNHTSA() + + await expect(() => + post( + { endpointName, includeQueryString: false }, + { + // @ts-expect-error Type 'number' is not assignable to type 'BodyInit | null | undefined' + body: arg, + } + ) + ).rejects.toThrowError( + /error validating argument named "options.body"/ ) - ).rejects.toThrowError(/error validating argument named "options.body"/) - } - ) + }) + }) + }) /*********************** * Network errors ***********************/ - it('rejects with error if there is no response', async () => { - fetchMock.mockResolvedValue(undefined as unknown as Response) + describe('Network Errors - Rejects with Error:', () => { + const body = '5UXWX7C5*BA;5YJSA3DS*EF,2015' - const { post } = useNHTSA() - await expect(() => post(mockUrl)).rejects.toThrowError( - /There was an error fetching API data: APi responded with an error, no response object returned/ - ) - }) + test('If there is no response', async () => { + // @ts-expect-error Argument of type 'undefined' is not assignable to parameter of type 'Response'. + fetchMock.mockResolvedValue(undefined) - it('rejects with error if !response.ok', async () => { - fetchMock.mockResolvedValue( - createMockResponse( - {}, - { - status: 500, - ok: false, - headers: new Headers({ 'Content-Type': 'application/xml' }), - } + const { post } = useNHTSA() + await expect(() => post(mockUrl, { body })).rejects.toThrowError( + /API responded with an unknown error or sent no response/ ) - ) + }) - const { post } = useNHTSA() - await expect(() => post(mockUrl)).rejects.toThrowError( - /There was an error fetching API data: APi response not ok/ - ) - }) + test('If response.ok === false', async () => { + fetchMock.mockResolvedValue( + createMockResponse( + { a: 'b' }, + { + ok: false, + } + ) + ) - it('rejects with error if response is not json', async () => { - fetchMock.mockResolvedValue( - createMockResponse( - {}, - { - status: 200, - ok: true, - headers: new Headers({ 'Content-Type': 'application/xml' }), - } + const { post } = useNHTSA() + await expect(() => post(mockUrl, { body })).rejects.toThrowError( + /API response not ok/ ) - ) + }) - const { post } = useNHTSA() - await expect(() => post(mockUrl)).rejects.toThrowError( - /There was an error fetching API data: API response not in JSON format/ - ) - }) + test('If response content-type is not json', async () => { + fetchMock.mockResolvedValue( + createMockResponse( + { a: 'b' }, + { + headers: new Headers({ 'Content-Type': 'application/xml' }), + } + ) + ) - it('rejects with error if there is no json() method on the response', async () => { - fetchMock.mockResolvedValue( - createMockResponse({}, { json: null } as unknown as Response) - ) + const { post } = useNHTSA() + await expect(() => post(mockUrl, { body })).rejects.toThrowError( + /API response not in JSON format/ + ) + }) - const { post } = useNHTSA() - await expect(() => post(mockUrl)).rejects.toThrowError( - /There was an error fetching API data: API response not in JSON format/ - ) - }) + test('If the response does not have a json() function', async () => { + fetchMock.mockResolvedValue( + // @ts-expect-error Type 'null' is not assignable to type '(() => Promise) | undefined'. + createMockResponse({ a: 'b' }, { json: 'empty' }) + ) - it('rejects with error if there is no data in response', async () => { - fetchMock.mockResolvedValue( - createMockResponse(undefined as unknown as object) - ) + const { post } = useNHTSA() + await expect(() => post(mockUrl, { body })).rejects.toThrowError( + /API response not in JSON format/ + ) + }) - const { post } = useNHTSA() - await expect(() => post(mockUrl)).rejects.toThrowError( - /There was an error fetching API data: VPIC API returned no data/ - ) + test('If there is no data in response', async () => { + // @ts-expect-error Argument of type 'undefined' is not assignable to parameter of type 'object'. + fetchMock.mockResolvedValue(createMockResponse(undefined, {})) + + const { post } = useNHTSA() + await expect(() => post(mockUrl, { body })).rejects.toThrowError( + /API returned no data/ + ) + }) }) }) }) diff --git a/packages/lib/src/api/complaints/__tests__/complaints.test-d.ts b/packages/lib/src/api/complaints/__tests__/complaints.test-d.ts new file mode 100644 index 00000000..d63127e8 --- /dev/null +++ b/packages/lib/src/api/complaints/__tests__/complaints.test-d.ts @@ -0,0 +1,839 @@ +import { describe, expectTypeOf, test } from 'vitest' + +import { + complaints, + type ComplaintsOptions, + type ComplaintsOptionsEmpty, + type ComplaintsOptionsMake, + type ComplaintsOptionsModelYear, + type ComplaintsOptionsOdiNumber, + type ComplaintsOptionsVehicle, + type ComplaintsResponseByOptions, + type ComplaintsResponseByVariant, +} from '../complaints' + +const modelYearString = '2020' +const modelYearNumber = 2020 +const modelYear = modelYearNumber +const make = 'Volkswagen' +const model = 'Atlas' +const odiNumberAsString = 11549247 +const odiNumberAsNumber = '11549247' +const odiNumber = odiNumberAsNumber + +test('Typecheck: complaints() - parameters - ', () => { + expectTypeOf().toBeFunction() + expectTypeOf().parameters.toMatchTypeOf< + [ + options?: boolean | ComplaintsOptions | undefined, + doFetch?: boolean | undefined, + ] + >() +}) + +describe('Typecheck: complaints() - return correct type of response data - ', () => { + /***************************** + * doFetch = true | undefined (default) + ****************************/ + test('with no arguments', async () => { + const result = await complaints() + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with no options and doFetch = true', async () => { + const result = await complaints(true) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with undefined as first argument', async () => { + const result = await complaints(undefined) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with undefined as first argument and doFetch = true', async () => { + const result = await complaints(undefined, true) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with undefined as both arguments', async () => { + const result = await complaints(undefined, undefined) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with empty object as first argument', async () => { + const result = await complaints({}) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with empty object as first argument and doFetch = true', async () => { + const result = await complaints({}, true) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with options.modelYear as string', async () => { + const result = await complaints({ modelYear: modelYearString }) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with options.modelYear as string and doFetch = true', async () => { + const result = await complaints({ modelYear: modelYearString }, true) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with options.modelYear as number', async () => { + const result = await complaints({ modelYear: modelYearNumber }) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with options.modelYear as number and doFetch = true', async () => { + const result = await complaints({ modelYear: modelYearNumber }, true) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with options.make', async () => { + const result = await complaints({ modelYear, make }) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with options.make and doFetch = true', async () => { + const result = await complaints({ modelYear, make }, true) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with options.model', async () => { + const result = await complaints({ modelYear, make, model }) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with options.model and doFetch = true', async () => { + const result = await complaints({ modelYear, make, model }, true) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with options.odiNumber', async () => { + const result = await complaints({ odiNumber }) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with options.odiNumber as string and doFetch = true', async () => { + const result = await complaints({ odiNumber: odiNumberAsString }, true) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) + + test('with options.odiNumber as number and doFetch = true', async () => { + const result = await complaints({ odiNumber: odiNumberAsNumber }, true) + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByVariant<'odiNumber'> + >() + expectTypeOf(result).toEqualTypeOf< + ComplaintsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ComplaintsResponseByOptions + >() + }) +}) + +describe('Typecheck: complaints() - returns type string if doFetch = false - ', () => { + /***************************** + * doFetch = false + ****************************/ + test('with doFetch = false', async () => { + expectTypeOf(await complaints(false)).toEqualTypeOf() + }) + + test('with undefined as first argument and doFetch = false', async () => { + expectTypeOf(await complaints(undefined, false)).toEqualTypeOf() + }) + + test('with empty object as first argument and doFetch = false', async () => { + expectTypeOf(await complaints({}, false)).toEqualTypeOf() + }) + + test('with options.modelYear as string and doFetch = false', async () => { + expectTypeOf( + await complaints({ modelYear: modelYearString }, false) + ).toEqualTypeOf() + }) + + test('with options.modelYear as number and doFetch = false', async () => { + expectTypeOf( + await complaints({ modelYear: modelYearNumber }, false) + ).toEqualTypeOf() + }) + + test('with options.make and doFetch = false', async () => { + expectTypeOf( + await complaints({ modelYear, make }, false) + ).toEqualTypeOf() + }) + + test('with options.model and doFetch = false', async () => { + expectTypeOf( + await complaints({ modelYear, make, model }, false) + ).toEqualTypeOf() + }) + + test('with options.odiNumber and doFetch = false', async () => { + expectTypeOf(await complaints({ odiNumber }, false)).toEqualTypeOf() + }) +}) diff --git a/packages/lib/src/api/complaints/__tests__/complaints.test.ts b/packages/lib/src/api/complaints/__tests__/complaints.test.ts new file mode 100644 index 00000000..30a34901 --- /dev/null +++ b/packages/lib/src/api/complaints/__tests__/complaints.test.ts @@ -0,0 +1,729 @@ +import { beforeEach, describe, expect, test } from 'vitest' +import { complaints } from '../complaints' + +// Mocks +import { createMockResponse } from '.vitest/helpers' +import { mockResults } from '.vitest/data' + +const modelYearString = '2020' +const modelYearNumber = 2020 +const modelYear = modelYearNumber +const make = 'Volkswagen' +const model = 'Atlas' +const odiNumberAsString = 11549247 +const odiNumberAsNumber = '11549247' +const odiNumber = odiNumberAsNumber + +// Use Products API: +// https://api.nhtsa.gov/products/vehicle/modelYears?issueType=c +// https://api.nhtsa.gov/products/vehicle/makes?modelYear={modelYear}&issueType=c +// https://api.nhtsa.gov/products/vehicle/models?modelYear={modelYear}&make={make}&issueType=c + +// Use Complaints API +// https://api.nhtsa.gov/complaints/complaintsByVehicle?modelYear=2020&make=Volkswagen&model=Jetta +// https://api.nhtsa.gov/complaints/odiNumber?odiNumber=11549247 + +const baseUrlProducts = 'https://api.nhtsa.gov/products/vehicle' +const baseUrl = 'https://api.nhtsa.gov/complaints' +const mockUrlBase = `${baseUrlProducts}/modelYears?issueType=c&format=json` +const mockUrlModelYear = `${baseUrlProducts}/makes?modelYear=${modelYear}&issueType=c&format=json` +const mockUrlMake = `${baseUrlProducts}/models?modelYear=${modelYear}&make=${make}&issueType=c&format=json` +const mockUrlVehicle = `${baseUrl}/complaintsByVehicle?modelYear=${modelYear}&make=${make}&model=${model}&format=json` +const mockUrlOdiNumber = `${baseUrl}/odiNumber?odiNumber=${odiNumber}&format=json` + +const expectedFetchOptions = { + saveUrl: true, + method: 'GET', +} + +type TestEach = { + description: string + args: Parameters + expectedUrl: string +} + +describe('complaints()', () => { + beforeEach(() => { + fetchMock.resetMocks() + fetchMock.mockResolvedValue(createMockResponse(mockResults)) + }) + + test('Is a function that returns a Promise', () => { + expect(complaints).toBeDefined() + expect(complaints).toBeInstanceOf(Function) + expect(complaints()).toBeInstanceOf(Promise) + }) + + /***************************** + * doFetch = true (default) + ****************************/ + describe('Fetches API data with: ', () => { + test.each([ + // no arguments, empty object, undefined - returns all available model years + { description: 'no arguments', args: [], expectedUrl: mockUrlBase }, + { + description: 'doFetch = true as first argument', + args: [true], + expectedUrl: mockUrlBase, + }, + { + description: 'undefined as first argument', + args: [undefined], + expectedUrl: mockUrlBase, + }, + { + description: 'undefined as first argument and doFetch = true', + args: [undefined, true], + expectedUrl: mockUrlBase, + }, + { + description: 'empty object as first argument', + args: [{}], + expectedUrl: mockUrlBase, + }, + { + description: 'empty object as first argument and doFetch = true', + args: [{}, true], + expectedUrl: mockUrlBase, + }, + // options.modelYear + { + description: 'options.modelYear as string', + args: [{ modelYear: modelYearString }], + expectedUrl: mockUrlModelYear, + }, + { + description: 'options.modelYear as string and doFetch = true', + args: [{ modelYear: modelYearString }, true], + expectedUrl: mockUrlModelYear, + }, + { + description: 'options.modelYear as number', + args: [{ modelYear: modelYearNumber }], + expectedUrl: mockUrlModelYear, + }, + { + description: 'options.modelYear as number and doFetch = true', + args: [{ modelYear: modelYearNumber }, true], + expectedUrl: mockUrlModelYear, + }, + // options.make + { + description: 'options.make', + args: [{ modelYear, make }], + expectedUrl: mockUrlMake, + }, + { + description: 'options.make and doFetch = true', + args: [{ modelYear, make }, true], + expectedUrl: mockUrlMake, + }, + // options.model + { + description: 'options.model', + args: [{ modelYear, make, model }], + expectedUrl: mockUrlVehicle, + }, + { + description: 'options.model and doFetch = true', + args: [{ modelYear, make, model }, true], + expectedUrl: mockUrlVehicle, + }, + // options.odiNumber + { + description: 'options.odiNumber as string', + args: [{ odiNumber: odiNumberAsString }], + expectedUrl: mockUrlOdiNumber, + }, + { + description: 'options.odiNumber as string and doFetch = true', + args: [{ odiNumber: odiNumberAsString }, true], + expectedUrl: mockUrlOdiNumber, + }, + { + description: 'options.odiNumber as number', + args: [{ odiNumber: odiNumberAsNumber }], + expectedUrl: mockUrlOdiNumber, + }, + { + description: 'options.odiNumber as number and doFetch = true', + args: [{ odiNumber: odiNumberAsNumber }, true], + expectedUrl: mockUrlOdiNumber, + }, + { + description: + 'with options.odiNumber as undefined and other valid options', + args: [ + { + odiNumber: undefined, + modelYear, + make, + model, + }, + ], + expectedUrl: mockUrlVehicle, + }, + { + description: + 'with options.odiNumber as undefined and other valid options and doFetch = true', + args: [ + { + odiNumber: undefined, + modelYear, + make, + model, + }, + true, + ], + expectedUrl: mockUrlVehicle, + }, + ])('$description', async ({ args, expectedUrl }) => { + const results = await complaints(...args) + expect(results).toEqual(mockResults) + expect(fetchMock).toHaveBeenCalledWith(expectedUrl, expectedFetchOptions) + expect(fetchMock.requests().length).toEqual(1) + expect(fetchMock.requests()[0].url).toEqual(expectedUrl) + expect(fetchMock.requests()[0].method).toEqual('GET') + }) + + test('with options.odiNumber and other valid options = TS Errors', async () => { + const results = await complaints({ + odiNumber, + // @ts-expect-error Type 'string' is not assignable to type 'undefined'. + modelYear, + // @ts-expect-error Type 'string' is not assignable to type 'undefined'. + make, + // @ts-expect-error Type 'string' is not assignable to type 'undefined'. + model, + }) + + expect(results).toEqual(mockResults) + expect(fetchMock).toHaveBeenCalledWith( + mockUrlOdiNumber, + expectedFetchOptions + ) + expect(fetchMock.requests().length).toEqual(1) + expect(fetchMock.requests()[0].url).toEqual(mockUrlOdiNumber) + expect(fetchMock.requests()[0].method).toEqual('GET') + }) + }) + + /***************************** + * doFetch = false + ***************************/ + describe('Returns API URL string with: ', () => { + test.each([ + { + description: 'doFetch = false as first argument', + args: [false], + expectedUrl: mockUrlBase, + }, + { + description: 'undefined as first argument and doFetch = false', + args: [undefined, false], + expectedUrl: mockUrlBase, + }, + { + description: 'empty object and doFetch = false', + args: [{}, false], + expectedUrl: mockUrlBase, + }, + // options.modelYear + { + description: 'options.modelYear as string and doFetch = false', + args: [{ modelYear: modelYearString }, false], + expectedUrl: mockUrlModelYear, + }, + { + description: 'options.modelYear as number and doFetch = false', + args: [{ modelYear: modelYearNumber }, false], + expectedUrl: mockUrlModelYear, + }, + // options.make + { + description: 'options.make and doFetch = false', + args: [{ modelYear, make }, false], + expectedUrl: mockUrlMake, + }, + // options.model + { + description: 'options.model and doFetch = true', + args: [{ modelYear, make, model }, false], + expectedUrl: mockUrlVehicle, + }, + // options.odiNumber + { + description: 'options.odiNumber as string and doFetch = false', + args: [{ odiNumber: odiNumberAsString }, false], + expectedUrl: mockUrlOdiNumber, + }, + { + description: 'options.odiNumber as number and doFetch = false', + args: [{ odiNumber: odiNumberAsNumber }, false], + expectedUrl: mockUrlOdiNumber, + }, + { + description: + 'with options.odiNumber as undefined and other valid options and doFetch = false', + args: [ + { + odiNumber: undefined, + modelYear, + make, + model, + }, + false, + ], + expectedUrl: mockUrlVehicle, + }, + ])('$description', async ({ args, expectedUrl }) => { + const results = await complaints(...args) + + expect(results).toEqual(expectedUrl) + expect(fetchMock.requests().length).toEqual(0) + }) + }) + + /***************************** + * rejects with error + ***************************/ + describe('Rejects with Error if: ', () => { + test.each(['string', 123, ['array'], null, () => {}])( + 'options is neither an object nor boolean, <%s>', + async (arg) => { + await expect(() => + // @ts-expect-error Type (x) is not assignable to type ... + complaints(arg) + ).rejects.toThrowError( + /error validating argument named "options", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([{ object: 123 }, ['array'], true, false, null, () => {}])( + 'options.modelYear is neither a string nor number, <%s>', + async (arg) => { + await expect(() => + complaints({ + // @ts-expect-error Type (x) is not assignable to type 'string | number | undefined + modelYear: arg, + }) + ).rejects.toThrowError( + /error validating argument named "modelYear", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([123, { object: 123 }, ['array'], true, false, null, () => {}])( + 'options.make is not a string, <%s>', + async (arg) => { + await expect(() => + complaints({ + modelYear, + // @ts-expect-error Type (x) is not assignable to type 'string | undefined + make: arg, + }) + ).rejects.toThrowError( + /error validating argument named "make", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([123, { object: 123 }, ['array'], true, false, null, () => {}])( + 'options.model is not a string, <%s>', + async (arg) => { + await expect(() => + complaints({ + modelYear, + make, + // @ts-expect-error Type (x) is not assignable to type 'string | undefined + model: arg, + }) + ).rejects.toThrowError( + /error validating argument named "model", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([{ object: 123 }, ['array'], true, false, null, () => {}])( + 'options.odiNumber is neither a string nor number <%s>', + async (arg) => { + await expect(() => + complaints({ + // @ts-expect-error Type (x) is not assignable to type 'string | number | undefined + odiNumber: arg, + }) + ).rejects.toThrowError( + /error validating argument named "odiNumber", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test('options.make is provided but not options.modelYear', async () => { + await expect(() => + // @ts-expect-error Properties 'modelYear' and 'model' are missing but required in type + complaints({ + make, + }) + ).rejects.toThrowError( + /error validating argument named "modelYear", it is required if "make"/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('options.model is provided but not options.modelYear', async () => { + await expect(() => + // @ts-expect-error Property 'modelYear' is missing but required in type + complaints({ + make, + model, + }) + ).rejects.toThrowError( + /error validating argument named "modelYear", it is required if "model"/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('options.model is provided but not options.make', async () => { + await expect(() => + // @ts-expect-error Property 'make' is missing but required in type + complaints({ + modelYear, + model, + }) + ).rejects.toThrowError( + /error validating argument named "make", it is required if "model"/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options', async () => { + await expect(() => + complaints({ + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and doFetch = true', async () => { + await expect(() => + complaints( + { + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + }, + true + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and doFetch = false', async () => { + await expect(() => + complaints( + { + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + }, + false + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and wrong type for valid options', async () => { + await expect(() => + complaints({ + notAnOption: 'no TS error, odiNumber error takes precedence', + // @ts-expect-error Type 'never[]' is not assignable to type 'string | undefined' + odiNumber: [], + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options', async () => { + await expect(() => + complaints({ + // @ts-expect-error Type 'string' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options and doFetch = true', async () => { + await expect(() => + complaints( + { + // @ts-expect-error Type 'string' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + make, + }, + true + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options and doFetch = false', async () => { + await expect(() => + complaints( + { + // @ts-expect-error Type 'string' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + make, + model, + }, + false + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and all valid options', async () => { + await expect(() => + complaints({ + notAnOption: 'no TS error, odiNumber error takes precedence', + modelYear, + make, + model, + // @ts-expect-error Type 'number' is not assignable to type 'undefined' + odiNumber: ['array'], + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + }) +}) + +/******************************* + * These are here to test the IDE intellisense tooltips when hovering the function and results, + * to ensure the correct types are displayed for the end user. These are not meant to be + * run as tests and testing of hovering must be done manually. + * + * The actual types and typed returns are tested in complaints.test-d.ts via Vitest type checking, + * these are simply hovering tooltip tests. + * + * This cannot be achieved in test.each() tests because the way .each() is typed, it will show all + * possible return types at once, which is not helpful for the end user. + * + * We cannot use expectTypeOf() because it will not work with test.each() tests in the same + * file, and expectTypeOf() will not show the IDE tooltips as a user would see them. + * + * Order of `Results` keys does not matter, only that they are all present with no extraneous + * keys. + ******************************/ +describe.skip('IDE Tooltips - manual test of results type on hover', async () => { + test('/products/vehicle/modelYears', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + modelYear: string; + }[]; + } + ******************************/ + const result_1 = await complaints() + const result_2 = await complaints(undefined) + const result_3 = await complaints({}) + const result_4 = await complaints({}, true) + const result_5 = await complaints({}, undefined) + const result_6 = await complaints(true) + const result_7 = await complaints(undefined, true) + const result_8 = await complaints(undefined, undefined) + + for (const result of [ + result_1, + result_2, + result_3, + result_4, + result_5, + result_6, + result_7, + result_8, + ]) { + expect(result) + } + }) + + test('/products/vehicle/makes', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + modelYear: string; + make: string; + }[]; + } + ******************************/ + const result_1 = await complaints({ modelYear: modelYearString }) + const result_2 = await complaints({ modelYear: modelYearNumber }) + const result_3 = await complaints({ modelYear }, true) + const result_4 = await complaints({ modelYear }, undefined) + + for (const result of [result_1, result_2, result_3, result_4]) { + expect(result) + } + }) + + test('/products/vehicle/models', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + modelYear: string; + make: string; + model: string; + }[]; + } + ******************************/ + const result_1 = await complaints({ modelYear, make }) + const result_2 = await complaints({ modelYear, make }, true) + const result_3 = await complaints({ modelYear, make }, undefined) + + for (const result of [result_1, result_2, result_3]) { + expect(result) + } + }) + + test('/complaints/complaintsByVehicle', async () => { + /******Expected Tooltip*******\ + const result_x: { + Manufacturer: string; + NHTSAodiNumber: string; + parkIt: boolean; + parkOutSide: boolean; + ReportReceivedDate: string; + Component: string; + Summary: string; + Consequence: string; + Remedy: string; + Notes: string; + ModelYear: string; + Make: string; + Model: string; + } + ******************************/ + const result_1 = await complaints({ modelYear, make, model }) + const result_2 = await complaints({ modelYear, make, model }, true) + const result_3 = await complaints( + { + modelYear, + make, + model, + }, + undefined + ) + + for (const result of [result_1, result_2, result_3]) { + expect(result) + } + }) + + test('/complaints/odiNumber', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + Manufacturer: string; + NHTSAodiNumber: string; + parkIt: boolean; + parkOutSide: boolean; + ReportReceivedDate: string; + Component: string; + Summary: string; + Consequence: string; + Remedy: string; + Notes: string; + ModelYear: string; + Make: string; + Model: string; + PotentialNumberofUnitsAffected: number; + }[]; + } + ******************************/ + const result_1 = await complaints({ odiNumber }) + const result_2 = await complaints({ odiNumber }, true) + const result_3 = await complaints({ odiNumber }, undefined) + + for (const result of [result_1, result_2, result_3]) { + expect(result) + } + }) + + test('returns a string if doFetch = false', async () => { + /******Expected Tooltip*******\ + const result_x: string + ******************************/ + const result_1 = await complaints(false) + const result_2 = await complaints(undefined, false) + const result_3 = await complaints({}, false) + const result_4 = await complaints({ modelYear: modelYearString }, false) + const result_5 = await complaints({ modelYear: modelYearNumber }, false) + const result_6 = await complaints({ modelYear, make }, false) + const result_7 = await complaints({ modelYear, make, model }, false) + const result_8 = await complaints({ odiNumber }, false) + const result_9 = await complaints({ odiNumber }, false) + + for (const result of [ + result_1, + result_2, + result_3, + result_4, + result_5, + result_6, + result_7, + result_8, + result_9, + ]) { + expect(result) + } + }) +}) diff --git a/packages/lib/src/api/complaints/complaints.ts b/packages/lib/src/api/complaints/complaints.ts new file mode 100644 index 00000000..6a4a17fd --- /dev/null +++ b/packages/lib/src/api/complaints/complaints.ts @@ -0,0 +1,663 @@ +/** + * @module api/complaints + * @category API - Complaints + */ +import { products, useNHTSA } from '@/api' +import { + catchInvalidArguments, + encodeQueryStringParams, + rejectWithError, +} from '@/utils' +import type { + NhtsaResponse, + NoExtraProperties, + ProductsResultsByVariant, + ProductsResultsData, + QueryStringParamsEncoded, +} from '@/types' + +/** + * # Complaints API + * + * ::: tip :bulb: More Information + * See: [Complaints Documentation] /guide/complaints + * ::: + * + * You can use `complaints()` as a thin wrapper for the `NHTSA Complaints API` to get complaints + * based on a vehicle's `modelYear`, `make`, and `model` or a specific `odiNumber`. + * + * This function is designed to handle all of the different possible workflows and return the + * correct data/url for each one, all depending on which options you pass to the function. In this + * sense it is a single universal function that can handle the entirety of the Complaints API. + * + * From the [Official Documentation](https://www.nhtsa.gov/nhtsa-datasets-and-apis#complaints): + * + * > Complaint information entered into NHTSAโ€™s Office of Defects Investigation (ODI) vehicle + * owner's complaint database is used with other data sources to identify safety issues that warrant + * investigation and to determine if a safety-related defect trend exists. Complaint information is + * also analyzed to monitor existing recalls for proper scope and adequacy. + * + * ## Options + * + * The Complaints API uses a path and query string to get different data. This function uses the + * options passed to build the correct url path and query string. + * + * Valid `options` are: + * + * - `modelYear` - Model Year of the vehicle to search for + * - `make` - Make of the vehicle to search for + * - `model` - Model of the vehicle to search for + * - `odiNumber` - ODI Number to search for + * + * All are optional and the only valid options you can pass to this function. + * + * Valid `options` combinations: + * + * These use the `Products API` to get model years, makes, and models available in the + * `Complaints API` dataset: + * - `complaints()` + * - `complaints({})` + * - `complaints({ modelYear })` + * - `complaints({ modelYear, make })` + * + * These use the `Complaints API` to get the complaints data for a specific vehicle or ODI Number: + * - `complaints({ modelYear, make, model })` + * - `complaints({ odiNumber })` + * + * Real Example URLs - for options that use the `Products API`: + * - https://api.nhtsa.gov/products/vehicle/modelYears?issueType=r + * - https://api.nhtsa.gov/products/vehicle/makes?modelYear=2020&issueType=c + * - https://api.nhtsa.gov/products/vehicle/models?modelYear=2020&make=Volkswagen&issueType=c + * + * Real Example URLs - for options that use the `Complaints API`: + * - https://api.nhtsa.gov/complaints/complaintsByVehicle?modelYear=2020&make=Volkswagen&model=Jetta + * - https://api.nhtsa.gov/complaints/odiNumber?odiNumber=11549247 + * + * Note that `format=json` will always be appended to the query string when using this package, even + * though it is not required by the Complaints and Products APIs. + * + * Returned data will be structured as `{ Count, Message, Results }` for any combination of options. + * + * See the `Returns` section below for more details. + * + * ### Some Notes on `odiNumber` + * + * The `odiNumber` is found in `Results[x].odiNumber` with options + * `{ modelYear, make, model }` or `{ odiNumber }`. + * + * - If you already know the `odiNumber` you can pass `{ odiNumber }` and directly get + * complaint information for that specific ODI number. + * - If you don't have an `odiNumber` number, you can pass `{ modelYear, make, model }` options + * to get the `odiNumber`s for that particular vehicle. + * - The other paths are used if you want to get the `modelYear`s, `make`s, or `model`s + * availaible in the Complaints API dataset, so you can then use that information to get the + * `odiNumber`s for that particular vehicle. + * + * ## Rules + * + * There are several rules to follow when using this API or you will get a network error response + * from the NHTSA API. + * + * 1. If you provide a `odiNumber` then you cannot provide any other options. + * 2. If you provide a `make` then you must also provide a `modelYear`. + * 3. If you provide a `model` then you must also provide a `make` and `modelYear`. + * + * FYI: Rules #1-3 will return a 400 Bad Request error from the NHTSA API if you break them. + * + * Consequences of breaking the rules: + * + * - Rule #1 - if passing `odiNumber` and any other valid combination of options, this function + * will silently ignore the other options and only use the `odiNumber`. It will _not_ throw + * an `Error` but you will get Typescript errors. + * - Rules #2 and #3 - this function will throw an `Error` as a fail safe to prevent you from + * getting a network error from the NHTSA API. + * + * There will also be TypeScript errors if you pass invalid options or invalid combinations of + * options. + * + * To clarify, this function will `throw Error`s in the following cases: + * + * - If you pass options not listed above. + * - If you pass an invalid combination of options. + * - If you pass a valid combination of options but include options not listed above. + * + * ## Usage + * + * The following describes in more detail the use of the different options and the paths they use. + * + * ### Get All Model Years + * + * Uses the `Products API` to get all available model years in the complaints dataset. + * + * If you pass no arguments, an empty object `{}`, `undefined`, or `true` as the first argument, the + * path and query string: `/products/vehicle/modelYears?issueType=c` will be used. + * + * Example: Get a list of available model years in the complaints dataset + * ```js + * await complaints().then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "2024", "2023", "2022", etc + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await complaints(false) + * console.log(url) // "https://api.nhtsa.gov/products/vehicle/modelYears?issueType=c&format=json" + * ``` + * + * ### Get Makes for Model Year + * + * Uses the `Products API` to get all available makes in the complaints dataset for a specific + * `modelYear`. + * + * If you pass a `modelYear` as the only option, the path and query string + * `/products/vehicle/makes?modelYear={modelYear}&issueType=c` will be used. + * + * Example: Get a list of available makes for the 2013 model year + * ```js + * await complaints({ modelYear: 2013 }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "ACURA", "AUDI", "BENTLEY", etc. + * console.log(result.make) // "JETTA", "ACCORD", etc. + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await complaints({ modelYear: 2013 }, false) + * console.log(url) + * // "https://api.nhtsa.gov/products/vehicle/makes?modelYear=2013&issueType=c&format=json" + * ``` + * + * If you need to get all available model years, first call the function with no arguments. + * + * ### Get Models for Make + * + * Uses the `Products API` to get all available models in the complaints dataset for a specific + * `modelYear` and `make`. + * + * If you pass a `modelYear` and `make` as the only options, the path and query string + * `/products/vehicle/models?modelYear={modelYear}&make={make}&issueType=c` will be used. + * + * Example: Get a list of available models for a 2013 Honda + * ```js + * await complaints({ modelYear: 2013, make: 'Honda' }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "2013" + * console.log(result.make) // "HONDA" + * console.log(result.model) // "ACCORD", "CIVIC", etc. + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await complaints({ modelYear: 2013, make: 'Honda' }, false) + * console.log(url) + * // "https://api.nhtsa.gov/products/vehicle/models?modelYear=2013&make=Honda&issueType=c&format=json" + * ``` + * + * If you need to get makes for a particular model year, first call the function with `modelYear` as + * the only option to get all of the available makes. + * + * ### Get Complaints for Year, Make, and Model + * + * Uses the `Complaints API` to get all available complaints for a specific `modelYear`, `make`, and + * `model`. + * + * If you pass a `modelYear`, `make`, and `model` as the only options, the path and query string + * `/complaints/complaintsByVehicle?&modelYear={modelYear}&make={make}&model={model}` will be used. + * + * Example: Get as list of complaints for a 2013 Honda Accord + * ```js + * await complaints({ modelYear: 2013, make: 'Honda', model: 'Accord' }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.odiNumber) // 11549247, 11483831, etc. + * console.log(result.crash) // true or false + * console.log(result.fire) // true or false + * console.log(result.numberOfInjuries) // 0, 1, 2, etc. + * console.log(result.numberOfDeaths) // 0, 1, 2, etc. + * console.log(result.dateOfIncident) // "01/18/2023", "11/18/2015", etc. + * console.log(result.vin) // "1V2LR2CA6LC", "1V2TR2CA1LC", etc. + * // ...more properties + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await complaints({ modelYear: 2013, make: 'Honda', model: 'Accord' }, false) + * console.log(url) + * // "https://api.nhtsa.gov/complaints/complaintsByVehicle?modelYear=2013&make=Honda&model=Accord&format=json" + * ``` + * + * Note that there will be multiple objects in the `Results[]`, each with a different + * `odiNumber`, depending on how many complaints there are for that year, make, and model + * combination. + * + * You can use the `odiNumber` as `options.odiNumber` to get a single complaint based on the + * ODI Number. It will return the exact same properties, but only for that specific ODI Number. + * + * ### Get Recall Information for Campaign Number + * + * Uses the `Complaints API` to get recall information for a specific `odiNumber`. + * + * If you pass `options.odiNumber`, the path and query string + * `/complaints/odiNumber?odiNumber={odiNumber}` will be used. + * + * All other options will be ignored if you provide `options.odiNumber`. + * + * There will likely be only one object in the `Results[]`, but you should always check that this is + * the case before dismissing the possibility of multiple objects in the `Results[]`. + * + * Example: Get complaint information for a specific ODI Number + * ```js + * await complaints({ odiNumber: 11549247 }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.odiNumber) // 11549247, 11483831, etc. + * console.log(result.crash) // true or false + * console.log(result.fire) // true or false + * console.log(result.numberOfInjuries) // 0, 1, 2, etc. + * console.log(result.numberOfDeaths) // 0, 1, 2, etc. + * console.log(result.dateOfIncident) // "01/18/2023", "11/18/2015", etc. + * console.log(result.vin) // "1V2LR2CA6LC", "1V2TR2CA1LC", etc. + * // ...more properties + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await complaints({ odiNumber: 11549247 }, false) + * console.log(url) + * // "https://api.nhtsa.gov/complaints/odiNumber?odiNumber=11549247&format=json" + * ``` + * + * ## Returns + * + * The return from this function will be a parsed JSON response, typed to reflect the different + * types of objects you can expect to get back from the API in the `Results[]`. + * + * Returned data will be stuctured as `{ Count, Message, Results }`. + * + * The direct response from the Complaints API is an object with the following properties: + * - `count` - The number of results returned + * - `message` - A message from the NHTSA API + * - `results` - An array of objects containing the response data + * + * In order to keep parity with the other APIs and make it easier to type the responses, this + * function will return the data as an object with all lowercase property names converted to + * uppercase: + * - `Count` - The number of results returned + * - `Message` - A message from the NHTSA API + * - `Results` - An array of objects containing the response data + * + * The `Results[]` will be typed based on the `options` passed to the function. + * + * - `{}`, `{ modelYear }`, and `{ modelYear, make }` will be typed as `ProductsResultsData` + * properties. + * - `{ modelYear, make, model }` and `{ odiNumber }` will be typed as `ComplaintsResultsData` + * properties. + * + * - See types `ProductsResultsData` and `ComplaintsResultsData` for a list of all possible + * properties. + * - See type `ComplaintsResultsByVariant` for clarity on which properties will be included based on + * the `options` passed. + * + * @param [options] - Object of options, fetch data from the API depending on options passed + * @param [options.modelYear] - Model Year of the vehicle to search for + * @param [options.make] - Make of the vehicle to search for + * @param [options.model] - Model of the vehicle to search for + * @param [options.odiNumber] - ODI Number to search for + * @param [doFetch=true] - If false, will return the url string instead of fetching the data + * (default: `true`) + * @returns - Parsed API response `object` -or- url `string` if `doFetch = false` + */ +function complaints>( + options: NoInvalidOptions, + doFetch?: true +): Promise> +function complaints>( + options: NoInvalidOptions | undefined, + doFetch: false +): Promise +function complaints( + options?: undefined, + doFetch?: true +): Promise> +function complaints( + doFetch?: true +): Promise> +function complaints(doFetch: false): Promise +function complaints>( + options?: NoInvalidOptions | boolean, + doFetch?: boolean +): Promise +/* Implementation */ +async function complaints( + options?: NoInvalidOptions | boolean, + doFetch: boolean = true +): Promise { + const endpointName = 'complaints' + + try { + let path = '' + let encodedParams: QueryStringParamsEncoded = {} + + if (typeof options === 'boolean') { + /* If first argument is boolean, it is doFetch */ + doFetch = options + /* Set options undefined so it will pass argument check below, otherwise invalid type */ + options = undefined + } + + /* This will also ensure we have an actual object using our custom getTypeof() function */ + catchInvalidArguments({ + args: [ + { + name: 'options', + value: options, + types: ['object'], + validKeys: ['modelYear', 'make', 'model', 'odiNumber'], + }, + { + name: 'modelYear', + value: options?.modelYear, + types: ['string', 'number'], + requiredBy: [ + // order important for user exerience in error messages + { name: 'model', value: options?.model }, + { name: 'make', value: options?.make }, + ], + }, + { + name: 'make', + value: options?.make, + types: ['string'], + requiredBy: [{ name: 'model', value: options?.model }], + }, + { name: 'model', value: options?.model, types: ['string'] }, + { + name: 'odiNumber', + value: options?.odiNumber, + types: ['string', 'number'], + }, + ], + }) + + /* options are guaranteed to be an object by now because of catchInvalidArguments() */ + if (options) { + encodedParams = encodeQueryStringParams(options) + } + + const { modelYear, make, model, odiNumber } = encodedParams + const hasVehicle = modelYear && make && model + const { get, createCachedUrl, getCachedUrl } = useNHTSA() + + /* + * use the Complaints API if odiNumber or full vehicle is passed, ignores vehicle if + * odiNumber exists + */ + if (odiNumber || hasVehicle) { + if (odiNumber) { + path = `odiNumber` + } else if (hasVehicle) { + path = `complaintsByVehicle` + } + + const params = odiNumber ? { odiNumber } : { modelYear, make, model } + + createCachedUrl({ + apiType: 'complaints', + endpointName, + path, + params, + }) + + if (!doFetch) { + return getCachedUrl() + } else { + return get() + } + } + + /* else use the Products API */ + if (modelYear && make) return products('c', { modelYear, make }, doFetch) + if (modelYear) return products('c', { modelYear }, doFetch) + else return products('c', doFetch) + } catch (error) { + return rejectWithError(error) + } +} + +export { complaints } + +/** + * These types have to be kept together with the function in the same file. + * + * This is so Intellisense will show the full type contents of the return to the end user when they + * save the results to a variable and then hover over that variable. If these types are moved to + * another file, Intellisense will only show the type name, not the full type contents for the + * complaints() NhstaResponse return type. + * + * Any type that is used directly in the function overloads and not in this file will cause this. + * So, theoretically, you could move all of those types here and the others live in their own file, + * but that would spread the types out and they are only used here and in the tests, so it makes + * sense to keep them together. + */ + +/** + * All valid options for the `complaints()` function + */ +export type ComplaintsOptionsBase = { + modelYear?: string | number + make?: string + model?: string + odiNumber?: string | number +} + +/** + * Options to get all available `modelYear`s via the `Products API`. + * + * Builds path: `/products/vehicle/modelYears?issueType=c` + */ +export type ComplaintsOptionsEmpty = { + modelYear?: undefined + make?: undefined + model?: undefined + odiNumber?: undefined +} + +/** + * Options to get all available `make`s for a specific `modelYear` via the `Products API`. + * + * Builds path: `/products/vehicle/makes?modelYear={modelYear}&issueType=c` + */ +export type ComplaintsOptionsModelYear = { + modelYear: string | number + make?: undefined + model?: undefined + odiNumber?: undefined +} + +/** + * Options to get all available `models`s for a specific `modelYear` and `make` via the + * `Products API`. + * + * Builds path: `/products/vehicle/models?modelYear={modelYear}&make={make}&issueType=c` + */ +export type ComplaintsOptionsMake = { + modelYear: string | number + make: string + model?: undefined + odiNumber?: undefined +} + +/** + * Options to get all available complaints for a specific vehicle by `modelYear`, `make`, and + * `model`. + * + * Builds path: `/complaints/complaintsByVehicle?make={make}&model={model}&modelYear={modelYear}` + */ +export type ComplaintsOptionsVehicle = { + modelYear: string | number + make: string + model: string + odiNumber?: undefined +} + +/** + * Options to get complaints for a specific `odiNumber`. + * + * Builds path: `/complaints/odiNumber?odiNumber={odiNumber}` + */ +export type ComplaintsOptionsOdiNumber = { + odiNumber: string | number + modelYear?: undefined + make?: undefined + model?: undefined +} + +/** + * All valid options combinations for the `complaints()` function + */ +export type ComplaintsOptions = + | ComplaintsOptionsEmpty + | ComplaintsOptionsModelYear + | ComplaintsOptionsMake + | ComplaintsOptionsVehicle + | ComplaintsOptionsOdiNumber + +/** + * Ensures only valid options are passed to the `complaints()` function + */ +export type NoInvalidOptions = NoExtraProperties< + ComplaintsOptionsBase, + T +> + +/** + * Variant names used to type the `Results[]` of the `Complaints API` response based on + * the `options` passed to the function. `ComplaintsResultsData` will be Pick<>ed based on the + * the variant name. + */ +export type ComplaintsResultsVariant = + | 'getModelYears' + | 'getMakes' + | 'getModels' + | 'vehicle' + | 'odiNumber' + | 'default' + +/** + * All possible properties and values found in the `Results[]` objects of `Complaints API`. + */ +export type ComplaintsResultsData = { + odiNumber?: number + manufacturer?: string + crash?: boolean + fire?: boolean + numberOfInjuries?: string + numberOfDeaths?: string + dateOfIncident?: string + dateComplaintFiled?: string + vin?: string + components?: string + summary?: string + products: [ + { + type: string + productYear: string + productMake: string + productModel: string + manufacturer: string + }, + ] +} + +/* + * This is typed with Pick<> so the user can see the actual type of the results array objects + * when they hover over the variable they saved the response to. Anything less verbose hides the + * results behind a type name and the user has to go look at the type definition to see what the + * actual keys of the Results array objects are. They could of course just hit ctrl+enter to have + * auto complete show them the keys, but this is more user friendly. + */ +/** + * Types the `Results[]` of the `Complaints API` response based on the `ComplaintsResultsVariant` + * that is passed to this type. + * + * Used to type no args `()` or `undefined` as the first arg passed to `complaints()`. + * + * Also used in .test-d.ts files to easily match the expected return type of the function. + */ +export type ComplaintsResultsByVariant< + Variant extends ComplaintsResultsVariant = 'default', +> = + /* Pick<> ComplaintsData based on Variant string */ + Variant extends 'getModelYears' + ? /* Path /products/vehicle/modelYears?issueType=r / */ + ProductsResultsByVariant<'getModelYears'> + : Variant extends 'getMakes' + ? /* Path /products/vehicle/makes?modelYear={modelYear}&issueType=r */ + ProductsResultsByVariant<'getMakes'> + : Variant extends 'getModels' + ? /* Path /products/vehicle/models?modelYear={modelYear}&make={make}&issueType=r */ + ProductsResultsByVariant<'getModels'> + : Variant extends 'vehicle' + ? /* Path /complaints/complaintsByVehicle?make={make}&model={model}&modelYear={modelYear} */ { + [K in keyof ComplaintsResultsData]-?: ComplaintsResultsData[K] + } + : Variant extends 'odiNumber' + ? /* Path /complaints/odiNumber?odiNumber={odiNumber} - all defined */ { + [K in keyof ComplaintsResultsData]-?: ComplaintsResultsData[K] + } + : /* fallback default value - all optional properties */ + ComplaintsResultsData + +/** + * Types the `Results[]` of the `Complaints API` response based on the `options` passed + * to the function. + */ +export type ComplaintsResultsByOptions = + Options extends ComplaintsOptionsModelYear + ? ComplaintsResultsByVariant<'getMakes'> + : Options extends ComplaintsOptionsMake + ? ComplaintsResultsByVariant<'getModels'> + : Options extends ComplaintsOptionsVehicle + ? ComplaintsResultsByVariant<'vehicle'> + : Options extends ComplaintsOptionsOdiNumber + ? ComplaintsResultsByVariant<'odiNumber'> + : Options extends ComplaintsOptionsEmpty + ? ComplaintsResultsByVariant<'getModelYears'> + : ComplaintsResultsByVariant + +/** + * Types the `complaints()` function return based on the type of `ComplaintsOptions` passed to + * this type, inferred from the `options` passed to the function. + * + * This type represents the complete parsed API response. + * + * The `Results[]` objects will be typed based on the `options` passed to the function. + */ +export type ComplaintsResponseByOptions = + Options extends ComplaintsOptionsVehicle | ComplaintsOptionsOdiNumber + ? NhtsaResponse, 'complaints'> + : NhtsaResponse, 'products'> + +/** + * Types the `complaints()` function return based on the `variant` passed to this type. + * + * This type represents the complete parsed API response. + * + * The `Results[]` objects will be typed based on the `Variant` passed to this type. + */ +export type ComplaintsResponseByVariant< + Variant extends ComplaintsResultsVariant = 'default', +> = NhtsaResponse, 'complaints'> + +/** + * This is the generic type of the parsed API response and is only meant to be a fallback type. + * + * Types the `complaints()` function with `ComplaintsResultsData` and/or `ProductsResultsData` as the + * `Results[]` objects. + */ +export type ComplaintsResponse = + | NhtsaResponse + | NhtsaResponse diff --git a/packages/lib/src/api/complaints/types.ts b/packages/lib/src/api/complaints/types.ts new file mode 100644 index 00000000..7e34e027 --- /dev/null +++ b/packages/lib/src/api/complaints/types.ts @@ -0,0 +1,23 @@ +/** + * @module api/complaints/types + * @category Types + */ + +export type { + ComplaintsOptions, + ComplaintsOptionsBase, + ComplaintsOptionsEmpty, + ComplaintsOptionsMake, + ComplaintsOptionsModelYear, + ComplaintsOptionsOdiNumber, + ComplaintsOptionsVehicle, + ComplaintsResponse, + ComplaintsResponseByOptions, + ComplaintsResponseByVariant, + ComplaintsResultsByOptions, + ComplaintsResultsByVariant, + ComplaintsResultsData, + ComplaintsResultsVariant, +} from './complaints' + +export {} diff --git a/packages/lib/src/api/cssiStation/__tests__/cssiStation.test-d.ts b/packages/lib/src/api/cssiStation/__tests__/cssiStation.test-d.ts new file mode 100644 index 00000000..fede7cc6 --- /dev/null +++ b/packages/lib/src/api/cssiStation/__tests__/cssiStation.test-d.ts @@ -0,0 +1,218 @@ +import { describe, expectTypeOf, test } from 'vitest' + +import { + cssiStation, + type CSSIOptions, + type CSSIResponse, +} from '../cssiStation' + +const state = 'TX' +const zipNumber = 78745 +const zipString = '78745' +const zip = zipNumber +const locationNumbers = { + lat: 32.7813, + long: -96.797, + miles: 25, +} +const locationStrings = { + lat: '32.7813', + long: '-96.7970', + miles: '25', +} +const location = locationNumbers +const filtersLang = { + lang: 'spanish', +} +const filtersCpsWeek = { + cpsweek: true, +} +const filters = { + lang: 'spanish', + cpsweek: true, +} + +test('Typecheck: cssiStation() - parameters - ', () => { + expectTypeOf().toBeFunction() + expectTypeOf().parameters.toMatchTypeOf< + [options?: boolean | CSSIOptions | undefined, doFetch?: boolean | undefined] + >() +}) + +describe('Typecheck: cssiStation() - return correct type of response data - ', () => { + /***************************** + * doFetch = true | undefined (default) + ****************************/ + test('with no arguments', async () => { + const result = await cssiStation() + expectTypeOf(result).toEqualTypeOf() + }) + + test('with no options and doFetch = true', async () => { + const result = await cssiStation(true) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with undefined as first argument', async () => { + const result = await cssiStation(undefined) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with undefined as first argument and doFetch = true', async () => { + const result = await cssiStation(undefined, true) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with undefined as both arguments', async () => { + const result = await cssiStation(undefined, undefined) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with empty object as first argument', async () => { + const result = await cssiStation({}) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with empty object as first argument and doFetch = true', async () => { + const result = await cssiStation({}, true) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with options.state', async () => { + const result = await cssiStation({ state }) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with options.state and doFetch = true', async () => { + const result = await cssiStation({ state }, true) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with options.state and filters.lang', async () => { + const result = await cssiStation({ state, filters: filtersLang }) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with options.state and filters.lang and doFetch = true', async () => { + const result = await cssiStation({ state, filters: filtersLang }, true) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with options.zip as string', async () => { + const result = await cssiStation({ zip: zipString }) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with options.zip as string and doFetch = true', async () => { + const result = await cssiStation({ zip: zipString }, true) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with options.zip as number', async () => { + const result = await cssiStation({ zip: zipNumber }) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with options.zip as number and doFetch = true', async () => { + const result = await cssiStation({ zip: zipNumber }, true) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with options.zip and options.filters.lang', async () => { + const result = await cssiStation({ zip, filters: filtersLang }) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with options.zip and options.filters.cpWeek', async () => { + const result = await cssiStation({ zip, filters: filtersCpsWeek }) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with options.zip, options.filters, and doFetch = true', async () => { + const result = await cssiStation({ zip, filters: filtersLang }, true) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with option.location and values as strings', async () => { + const result = await cssiStation({ location: locationStrings }) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with option.location and values as numbers', async () => { + const result = await cssiStation({ location: locationNumbers }) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with option.location and doFetch = true', async () => { + const result = await cssiStation({ location }, true) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with option.location and options.filters', async () => { + const result = await cssiStation({ location, filters }) + expectTypeOf(result).toEqualTypeOf() + }) +}) + +describe('Typecheck: cssiStation() - returns type string if doFetch = false - ', () => { + /***************************** + * doFetch = false + ****************************/ + test('with doFetch = false', async () => { + expectTypeOf(await cssiStation(false)).toEqualTypeOf() + }) + + test('with undefined as first argument and doFetch = false', async () => { + expectTypeOf(await cssiStation(undefined, false)).toEqualTypeOf() + }) + + test('with empty object as first argument and doFetch = false', async () => { + expectTypeOf(await cssiStation({}, false)).toEqualTypeOf() + }) + + test('with options.state and doFetch = false', async () => { + expectTypeOf(await cssiStation({ state }, false)).toEqualTypeOf() + }) + + test('with options.state, filters.lang, and doFetch = false', async () => { + expectTypeOf( + await cssiStation({ state, filters: filtersLang }, false) + ).toEqualTypeOf() + }) + + test('with options.zip as string and doFetch = false', async () => { + expectTypeOf( + await cssiStation({ zip: zipString }, false) + ).toEqualTypeOf() + }) + + test('with options.zip as number and doFetch = false', async () => { + expectTypeOf( + await cssiStation({ zip: zipNumber }, false) + ).toEqualTypeOf() + }) + + test('with options.zip, options.filters, and doFetch = false', async () => { + expectTypeOf( + await cssiStation({ zip, filters: filtersLang }, false) + ).toEqualTypeOf() + }) + + test('with options.location values as strings and doFetch = false', async () => { + expectTypeOf( + await cssiStation({ location: locationStrings }, false) + ).toEqualTypeOf() + }) + + test('with options.location values as numbers and doFetch = false', async () => { + expectTypeOf( + await cssiStation({ location: locationNumbers }, false) + ).toEqualTypeOf() + }) + + test('with options.location, filters, and doFetch = false', async () => { + expectTypeOf( + await cssiStation({ location, filters }, false) + ).toEqualTypeOf() + }) +}) diff --git a/packages/lib/src/api/cssiStation/__tests__/cssiStation.test.ts b/packages/lib/src/api/cssiStation/__tests__/cssiStation.test.ts new file mode 100644 index 00000000..383a2381 --- /dev/null +++ b/packages/lib/src/api/cssiStation/__tests__/cssiStation.test.ts @@ -0,0 +1,1042 @@ +import { beforeEach, describe, expect, test } from 'vitest' +import { cssiStation } from '../cssiStation' + +// Mocks +import { createMockResponse } from '.vitest/helpers' +import { mockResults } from '.vitest/data' + +const state = 'TX' +const zipNumber = 78745 +const zipString = '78745' +const zip = zipNumber +const lat = 32.7813 +const long = -96.7971 +const miles = 25 +const locationNumbers = { + lat, + long, + miles, +} +const locationStrings = { + lat: '32.7813', + long: '-96.7971', + miles: '25', +} +const location = locationNumbers +const lang = 'spanish' +const cpsweek = true +const filtersLang = { + lang, +} +const filtersCpsWeek = { + cpsweek, +} +const filters = { + lang, + cpsweek, +} + +// https://api.nhtsa.gov/CSSIStation +// https://api.nhtsa.gov/CSSIStation/state/TX +// https://api.nhtsa.gov/CSSIStation/state/tx/lang/spanish +// https://api.nhtsa.gov/CSSIStation/zip/78745 +// https://api.nhtsa.gov/CSSIStation/zip/78745/lang/spanish +// https://api.nhtsa.gov/CSSIStation/zip/12345/cspweek +// https://api.nhtsa.gov/CSSIStation/zip/12345/cspweek?lang=spanish +// https://api.nhtsa.gov/CSSIStation?lat=32.7813&long=-96.7970&miles=25 +// https://api.nhtsa.gov/CSSIStation?lat=32.7813&long=-96.7970&miles=25&lang=spanish +// https://api.nhtsa.gov/CSSIStation?lat=32.7813&long=-96.7970&miles=25&cpsweek +// https://api.nhtsa.gov/CSSIStation?lat=32.7813&long=-96.7970&miles=25&cpsweek&lang=spanish + +const baseUrl = 'https://api.nhtsa.gov/CSSIStation/' +const mockUrlBase = `${baseUrl}?format=json` +const mockUrlState = `${baseUrl}state/${state}?format=json` +const mockUrlStateLang = `${baseUrl}state/${state}/lang/${lang}?format=json` +const mockUrlZip = `${baseUrl}zip/${zip}?format=json` +const mockUrlZipLang = `${baseUrl}zip/${zip}/lang/${lang}?format=json` +const mockUrlZipCpsweek = `${baseUrl}zip/${zip}/cpsweek?format=json` +const mockUrlZipCpsweekLang = `${baseUrl}zip/${zip}/cpsweek?lang=${lang}&format=json` +const mockUrlLocationBase = `${baseUrl}?lat=${lat}&long=${long}&miles=${miles}` +const mockUrlLocation = `${mockUrlLocationBase}&format=json` +const mockUrlLocationLang = `${mockUrlLocationBase}&lang=${lang}&format=json` +const mockUrlLocationCpsweek = `${mockUrlLocationBase}&cpsweek=${cpsweek}&format=json` +const mockUrlLocationCpsweekLang = `${mockUrlLocationBase}&lang=${lang}&cpsweek=${cpsweek}&format=json` + +const expectedFetchOptions = { + saveUrl: true, + method: 'GET', +} + +type TestEach = { + description: string + args: Parameters + expectedUrl: string +} + +describe('cssiStation()', () => { + beforeEach(() => { + fetchMock.resetMocks() + fetchMock.mockResolvedValue(createMockResponse(mockResults)) + }) + + test('Is a function that returns a Promise', () => { + expect(cssiStation).toBeDefined() + expect(cssiStation).toBeInstanceOf(Function) + expect(cssiStation()).toBeInstanceOf(Promise) + }) + + /***************************** + * doFetch = true (default) + ****************************/ + describe('Fetches API data with: ', () => { + test.each([ + // no arguments, empty object, undefined - returns all available model years + { description: 'no arguments', args: [], expectedUrl: mockUrlBase }, + { + description: 'doFetch = true as first argument', + args: [true], + expectedUrl: mockUrlBase, + }, + { + description: 'undefined as first argument', + args: [undefined], + expectedUrl: mockUrlBase, + }, + { + description: 'undefined as first argument and doFetch = true', + args: [undefined, true], + expectedUrl: mockUrlBase, + }, + { + description: 'empty object as first argument', + args: [{}], + expectedUrl: mockUrlBase, + }, + { + description: 'empty object as first argument and doFetch = true', + args: [{}, true], + expectedUrl: mockUrlBase, + }, + // options.state + { + description: 'options.state', + args: [{ state }], + expectedUrl: mockUrlState, + }, + { + description: 'options.state and doFetch = true', + args: [{ state }, true], + expectedUrl: mockUrlState, + }, + // options.state and filters.lang + { + description: 'options.state and filters.lang', + args: [{ state, filters: filtersLang }], + expectedUrl: mockUrlStateLang, + }, + { + description: 'options.state and filters.lang and doFetch = true', + args: [{ state, filters: filtersLang }, true], + expectedUrl: mockUrlStateLang, + }, + // options.zip + { + description: 'options.zip as number', + args: [{ zip: zipNumber }], + expectedUrl: mockUrlZip, + }, + { + description: 'options.zip as number and doFetch = true', + args: [{ zip: zipNumber }, true], + expectedUrl: mockUrlZip, + }, + { + description: 'options.zip as string', + args: [{ zip: zipString }], + expectedUrl: mockUrlZip, + }, + { + description: 'options.zip as string and doFetch = true', + args: [{ zip: zipString }, true], + expectedUrl: mockUrlZip, + }, + // options.zip and filters.lang + { + description: 'options.zip and filters.lang', + args: [{ zip, filters: filtersLang }], + expectedUrl: mockUrlZipLang, + }, + { + description: 'options.zip and filters.lang and doFetch = true', + args: [{ zip, filters: filtersLang }, true], + expectedUrl: mockUrlZipLang, + }, + // options.zip and filters.cpsweek + { + description: 'options.zip and filters.cpsweek', + args: [{ zip, filters: filtersCpsWeek }], + expectedUrl: mockUrlZipCpsweek, + }, + { + description: 'options.zip and filters.cpsweek and doFetch = true', + args: [{ zip, filters: filtersCpsWeek }, true], + expectedUrl: mockUrlZipCpsweek, + }, + // options.zip and filters.cpsweek and filters.lang + { + description: 'options.zip and filters.cpsweek and filters.lang', + args: [{ zip, filters }], + expectedUrl: mockUrlZipCpsweekLang, + }, + { + description: + 'options.zip and filters.cpsweek and filters.lang and doFetch = true', + args: [{ zip, filters }, true], + expectedUrl: mockUrlZipCpsweekLang, + }, + // location + { + description: 'options.location as numbers', + args: [{ location: locationNumbers }], + expectedUrl: mockUrlLocation, + }, + { + description: 'options.location as numbers and doFetch = true', + args: [{ location: locationNumbers }, true], + expectedUrl: mockUrlLocation, + }, + { + description: 'options.location as strings', + args: [{ location: locationStrings }], + expectedUrl: mockUrlLocation, + }, + { + description: 'options.location as strings and doFetch = true', + args: [{ location: locationStrings }, true], + expectedUrl: mockUrlLocation, + }, + // location and filters.lang + { + description: 'options.location and filters.lang', + args: [{ location, filters: filtersLang }], + expectedUrl: mockUrlLocationLang, + }, + { + description: 'options.location and filters.lang and doFetch = true', + args: [{ location, filters: filtersLang }, true], + expectedUrl: mockUrlLocationLang, + }, + // location and filters.cpsweek + { + description: 'options.location and filters.cpsweek', + args: [{ location, filters: filtersCpsWeek }], + expectedUrl: mockUrlLocationCpsweek, + }, + { + description: 'options.location and filters.cpsweek and doFetch = true', + args: [{ location, filters: filtersCpsWeek }, true], + expectedUrl: mockUrlLocationCpsweek, + }, + // location and filters.cpsweek and filters.lang + { + description: 'options.location and filters.cpsweek and filters.lang', + args: [{ location, filters }], + expectedUrl: mockUrlLocationCpsweekLang, + }, + { + description: + 'options.location and filters.cpsweek and filters.lang and doFetch = true', + args: [{ location, filters }, true], + expectedUrl: mockUrlLocationCpsweekLang, + }, + ])('$description', async ({ args, expectedUrl }) => { + const results = await cssiStation(...args) + expect(results).toEqual(mockResults) + expect(fetchMock).toHaveBeenCalledWith(expectedUrl, expectedFetchOptions) + expect(fetchMock.requests().length).toEqual(1) + expect(fetchMock.requests()[0].url).toEqual(expectedUrl) + expect(fetchMock.requests()[0].method).toEqual('GET') + }) + }) + + /***************************** + * doFetch = false + ***************************/ + describe('Returns API URL string with: ', () => { + test.each([ + { + description: 'doFetch = false as first argument', + args: [false], + expectedUrl: mockUrlBase, + }, + { + description: 'undefined as first argument and doFetch = false', + args: [undefined, false], + expectedUrl: mockUrlBase, + }, + { + description: 'empty object and doFetch = false', + args: [{}, false], + expectedUrl: mockUrlBase, + }, + // options.state + { + description: 'options.state and doFetch = false', + args: [{ state }, false], + expectedUrl: mockUrlState, + }, + // options.state and filters.lang + { + description: 'options.state and filters.lang and doFetch = false', + args: [{ state, filters: filtersLang }, false], + expectedUrl: mockUrlStateLang, + }, + // options.zip + { + description: 'options.zip as number and doFetch = false', + args: [{ zip: zipNumber }, false], + expectedUrl: mockUrlZip, + }, + { + description: 'options.zip as string and doFetch = false', + args: [{ zip: zipString }, false], + expectedUrl: mockUrlZip, + }, + // options.zip and filters.lang + { + description: 'options.zip and filters.lang and doFetch = false', + args: [{ zip, filters: filtersLang }, false], + expectedUrl: mockUrlZipLang, + }, + // options.zip and filters.cpsweek + { + description: 'options.zip and filters.cpsweek and doFetch = false', + args: [{ zip, filters: filtersCpsWeek }, false], + expectedUrl: mockUrlZipCpsweek, + }, + // options.zip and filters.cpsweek and filters.lang + { + description: + 'options.zip and filters.cpsweek and filters.lang and doFetch = false', + args: [{ zip, filters }, false], + expectedUrl: mockUrlZipCpsweekLang, + }, + // location + { + description: 'options.location as numbers and doFetch = false', + args: [{ location: locationNumbers }, false], + expectedUrl: mockUrlLocation, + }, + { + description: 'options.location as strings and doFetch = false', + args: [{ location: locationStrings }, false], + expectedUrl: mockUrlLocation, + }, + // location and filters.lang + { + description: 'options.location and filters.lang and doFetch = false', + args: [{ location, filters: filtersLang }, false], + expectedUrl: mockUrlLocationLang, + }, + // location and filters.cpsweek + { + description: 'options.location and filters.cpsweek and doFetch = false', + args: [{ location, filters: filtersCpsWeek }, false], + expectedUrl: mockUrlLocationCpsweek, + }, + // location and filters.cpsweek and filters.lang + { + description: + 'options.location and filters.cpsweek and filters.lang and doFetch = false', + args: [{ location, filters }, false], + expectedUrl: mockUrlLocationCpsweekLang, + }, + ])('$description', async ({ args, expectedUrl }) => { + const results = await cssiStation(...args) + + expect(results).toEqual(expectedUrl) + expect(fetchMock.requests().length).toEqual(0) + }) + }) + + /***************************** + * rejects with error + ***************************/ + describe('Rejects with Error if: ', () => { + test.each(['string', 123, ['array'], null, () => {}])( + 'options is neither an object nor boolean, <%s>', + async (arg) => { + await expect(() => + // @ts-expect-error Type (x) is not assignable to type ... + cssiStation(arg) + ).rejects.toThrowError( + /error validating argument named "options", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([123, { object: 123 }, ['array'], true, false, null, () => {}])( + 'options.state is not a string, <%s>', + async (arg) => { + await expect(() => + cssiStation({ + // @ts-expect-error Type (x) is not assignable to type 'string | undefined + state: arg, + }) + ).rejects.toThrowError( + /error validating argument named "state", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([{ object: 123 }, ['array'], true, false, null, () => {}])( + 'options.zip is neither string nor number, <%s>', + async (arg) => { + await expect(() => + cssiStation({ + // @ts-expect-error Type (x) is not assignable to type string | number | undefined + zip: arg, + }) + ).rejects.toThrowError( + /error validating argument named "zip", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([123, 'string', ['array'], true, false, null, () => {}])( + 'options.location is not an object, <%s>', + async (arg) => { + await expect(() => + cssiStation({ + // @ts-expect-error Type (x) is not assignable to type 'Location' | undefined + location: arg, + }) + ).rejects.toThrowError( + /error validating argument named "location", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([{ object: 123 }, ['array'], true, () => {}])( + 'options.location.lat is neither string nor number, <%s>', + async (arg) => { + await expect(() => + cssiStation({ + location: { + // @ts-expect-error Type (x) is not assignable to type string | number | undefined + lat: arg, + long, + miles, + }, + }) + ).rejects.toThrowError( + /error validating argument named "location.lat", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([{ object: 123 }, ['array'], true, () => {}])( + 'options.location.long is neither string nor number, <%s>', + async (arg) => { + await expect(() => + cssiStation({ + location: { + lat, + // @ts-expect-error Type (x) is not assignable to type string | number | undefined + long: arg, + miles, + }, + }) + ).rejects.toThrowError( + /error validating argument named "location.long", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([{ object: 123 }, ['array'], true, () => {}])( + 'options.location.miles is neither string nor number, <%s>', + async (arg) => { + await expect(() => + cssiStation({ + location: { + lat, + long, + // @ts-expect-error Type (x) is not assignable to type string | number | undefined + miles: arg, + }, + }) + ).rejects.toThrowError( + /error validating argument named "location.miles", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each(['string', 123, ['array'], true, false, null, () => {}])( + 'options.filters is not an object <%s>', + async (arg) => { + await expect(() => + cssiStation({ + state, + // @ts-expect-error Type (x) is not assignable to type 'filters' | undefined + filters: arg, + }) + ).rejects.toThrowError( + /error validating argument named "filters", must be of type/ + ) + + await expect(() => + cssiStation({ + zip, + // @ts-expect-error Type (x) is not assignable to type 'filters' | undefined + filters: arg, + }) + ).rejects.toThrowError( + /error validating argument named "filters", must be of type/ + ) + + await expect(() => + cssiStation({ + location, + // @ts-expect-error Type (x) is not assignable to type 'filters' | undefined + filters: arg, + }) + ).rejects.toThrowError( + /error validating argument named "filters", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([123, ['array'], true, false, null, () => {}])( + 'options.filters.lang is neither string nor number, <%s>', + async (arg) => { + await expect(() => + cssiStation({ + state, + filters: { + // @ts-expect-error Type (x) is not assignable to type string | undefined + lang: arg, + }, + }) + ).rejects.toThrowError( + /error validating argument named "filters.lang", must be of type/ + ) + + await expect(() => + cssiStation({ + zip, + filters: { + cpsweek, + // @ts-expect-error Type (x) is not assignable to type string | undefined + lang: arg, + }, + }) + ).rejects.toThrowError( + /error validating argument named "filters.lang", must be of type/ + ) + + await expect(() => + cssiStation({ + location, + filters: { + cpsweek, + // @ts-expect-error Type (x) is not assignable to type string | undefined + lang: arg, + }, + }) + ).rejects.toThrowError( + /error validating argument named "filters.lang", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each(['string', 123, { object: 123 }, ['array'], null, () => {}])( + 'options.filters.cpsweek is not a boolean, <%s>', + async (arg) => { + await expect(() => + cssiStation({ + zip, + filters: { + lang, + // @ts-expect-error Type (x) is not assignable to type boolean | undefined + cpsweek: arg, + }, + }) + ).rejects.toThrowError( + /error validating argument named "filters.cpsweek", must be of type/ + ) + + await expect(() => + cssiStation({ + location, + filters: { + lang, + // @ts-expect-error Type (x) is not assignable to type boolean | undefined + cpsweek: arg, + }, + }) + ).rejects.toThrowError( + /error validating argument named "filters.cpsweek", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test('options.location is missing lat', async () => { + await expect(() => + cssiStation({ + // @ts-expect-error Property 'lat' is missing in type 'x' but required in type 'x' + location: { + long, + miles, + }, + }) + ).rejects.toThrowError(/error validating argument named "location.lat"/) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('options.location is missing long', async () => { + await expect(() => + cssiStation({ + // @ts-expect-error Property 'long' is missing in type 'x' but required in type 'x' + location: { + lat, + miles, + }, + }) + ).rejects.toThrowError(/error validating argument named "location.long"/) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('options.location is missing miles', async () => { + await expect(() => + cssiStation({ + // @ts-expect-error Property 'miles' is missing in type 'x' but required in type 'x' + location: { + lat, + long, + }, + }) + ).rejects.toThrowError(/error validating argument named "location.miles"/) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('options includes combinations of state, zip, and location', async () => { + await expect(() => + cssiStation({ + state, + // @ts-expect-error Type 'number' is not assignable to type 'undefined'. + zip, + }) + ).rejects.toThrowError( + /Invalid options: state, zip, and location are not compatible./ + ) + + await expect(() => + cssiStation({ + state, + // @ts-expect-error Type 'location' is not assignable to type 'undefined'. + location, + }) + ).rejects.toThrowError( + /Invalid options: state, zip, and location are not compatible./ + ) + + await expect(() => + cssiStation({ + zip, + // @ts-expect-error Type 'location' is not assignable to type 'undefined'. + location, + }) + ).rejects.toThrowError( + /Invalid options: state, zip, and location are not compatible./ + ) + + await expect(() => + cssiStation({ + state, + // @ts-expect-error Type 'number' is not assignable to type 'undefined'. + zip, + // @ts-expect-error Type 'location' is not assignable to type 'undefined'. + location, + }) + ).rejects.toThrowError( + /Invalid options: state, zip, and location are not compatible./ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('options.state and filter.cpsweek passed together', async () => { + await expect(() => + cssiStation({ + state, + filters: { + // @ts-expect-error Type 'boolean' is not assignable to type 'undefined'. + cpsweek, + }, + }) + ).rejects.toThrowError( + /Invalid options: state and filters.cpsweek are not compatible./ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with unknown options', async () => { + await expect(() => + cssiStation({ + // @ts-expect-error 'notAnOption' does not exist in type 'CSSIOptions' + notAnOption: 'unknown option with TS error', + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: state, zip, location, filters/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with unknown options and doFetch = true', async () => { + await expect(() => + cssiStation( + { + // @ts-expect-error 'notAnOption' does not exist in type 'CSSIOptions' + notAnOption: 'unknown option with TS error', + }, + true + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: state, zip, location, filters/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with unknown options and doFetch = false', async () => { + await expect(() => + cssiStation( + { + // @ts-expect-error 'notAnOption' does not exist in type 'CSSIOptions' + notAnOption: 'unknown option with TS error', + }, + false + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: state, zip, location, filters/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with unknown options and wrong type for valid options', async () => { + await expect(() => + cssiStation({ + notAnOption: 'no TS error, vehicleId error takes precedence', + // @ts-expect-error Type 'never[]' is not assignable to type 'string'. + state: [], + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: state, zip, location, filters/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with unknown options and valid options', async () => { + await expect(() => + cssiStation({ + // @ts-expect-error 'notAnOption' does not exist in type 'CSSIOptions' + notAnOption: 'unknown option with TS error', + state, + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: state, zip, location, filters/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with unknown options and valid options and doFetch = true', async () => { + await expect(() => + cssiStation( + { + // @ts-expect-error 'notAnOption' does not exist in type 'CSSIOptions' + notAnOption: 'unknown option with TS error', + zip, + filters, + }, + true + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: state, zip, location, filters/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with unknown options and valid options and doFetch = false', async () => { + await expect(() => + cssiStation( + { + // @ts-expect-error 'notAnOption' does not exist in type 'CSSIOptions' + notAnOption: 'unknown option with TS error', + location, + filters, + }, + false + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: state, zip, location, filters/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with unknown options.location', async () => { + await expect(() => + cssiStation({ + location: { + // @ts-expect-error 'notAnOption' does not exist in type 'Location' + notAnOption: 'unknown option with TS error', + }, + }) + ).rejects.toThrowError( + /Invalid keys for location: notAnOption. Valid keys are: lat, long, miles/ + ) + + await expect(() => + cssiStation({ + location: { + // @ts-expect-error 'notAnOption' does not exist in type 'Location' + notAnOption: 'unknown option with TS error', + lat, + long, + miles, + }, + }) + ).rejects.toThrowError( + /Invalid keys for location: notAnOption. Valid keys are: lat, long, miles/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with unknown options.filters', async () => { + await expect(() => + cssiStation({ + filters: { + // @ts-expect-error 'notAnOption' does not exist in type 'filters' + notAnOption: 'unknown option with TS error', + }, + }) + ).rejects.toThrowError( + /Invalid keys for filters: notAnOption. Valid keys are: lang, cpsweek/ + ) + + await expect(() => + cssiStation({ + filters: { + // @ts-expect-error 'notAnOption' does not exist in type 'filters' + notAnOption: 'unknown option with TS error', + lang, + cpsweek, + }, + }) + ).rejects.toThrowError( + /Invalid keys for filters: notAnOption. Valid keys are: lang, cpsweek/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + }) +}) + +/******************************* + * These are here to test the IDE intellisense tooltips when hovering the function and results, + * to ensure the correct types are displayed for the end user. These are not meant to be + * run as tests and testing of hovering must be done manually. + * + * The actual types and typed returns are tested in cssiStation.test-d.ts via Vitest type checking, + * these are simply hovering tooltip tests. + * + * This cannot be achieved in test.each() tests because the way .each() is typed, it will show all + * possible return types at once, which is not helpful for the end user. + * + * We cannot use expectTypeOf() because it will not work with test.each() tests in the same + * file, and expectTypeOf() will not show the IDE tooltips as a user would see them. + * + * Order of `Results` keys does not matter, only that they are all present with no extraneous + * keys. + ******************************/ +describe.skip('IDE Tooltips - manual test of results type on hover', async () => { + test('/CSSIStation/', async () => { + /******Expected Tooltip*******\ + const result_x: { + StartLatitude: number; + StartLongitude: number; + Count: number; + Message: string; + Results: CSSIResultsData[]; + } + ******************************/ + const result_1 = await cssiStation() + const result_2 = await cssiStation(undefined) + const result_3 = await cssiStation({}) + const result_4 = await cssiStation({}, true) + const result_5 = await cssiStation({}, undefined) + const result_6 = await cssiStation(true) + const result_7 = await cssiStation(undefined, true) + const result_8 = await cssiStation(undefined, undefined) + + for (const result of [ + result_1, + result_2, + result_3, + result_4, + result_5, + result_6, + result_7, + result_8, + ]) { + expect(result) + } + }) + + test('/CSSIStation/state/:state', async () => { + /******Expected Tooltip*******\ + const result_x: { + StartLatitude: number; + StartLongitude: number; + Count: number; + Message: string; + Results: CSSIResultsData[]; + } + ******************************/ + const result_1 = await cssiStation({ state }) + const result_2 = await cssiStation({ state, filters: { lang } }) + const result_3 = await cssiStation({ state }, true) + const result_4 = await cssiStation({ state }, undefined) + const result_5 = await cssiStation({ state, filters: { lang } }, true) + const result_6 = await cssiStation({ state, filters: { lang } }, undefined) + + for (const result of [ + result_1, + result_2, + result_3, + result_4, + result_5, + result_6, + ]) { + expect(result) + } + }) + + test('/CSSIStation/zip/:zip', async () => { + /******Expected Tooltip*******\ + const result_x: { + StartLatitude: number; + StartLongitude: number; + Count: number; + Message: string; + Results: CSSIResultsData[]; + } + ******************************/ + const result_1 = await cssiStation({ zip }) + const result_2 = await cssiStation({ zip }, true) + const result_3 = await cssiStation({ zip }, undefined) + const result_4 = await cssiStation({ zip, filters: { lang } }) + const result_5 = await cssiStation({ zip, filters: { lang } }, true) + const result_6 = await cssiStation({ zip, filters: { lang } }, undefined) + const result_7 = await cssiStation({ zip, filters: { cpsweek } }) + const result_8 = await cssiStation({ zip, filters: { cpsweek } }, true) + const result_9 = await cssiStation({ zip, filters: { cpsweek } }, undefined) + const result_10 = await cssiStation({ zip, filters }) + const result_11 = await cssiStation({ zip, filters }, true) + const result_12 = await cssiStation({ zip, filters }, undefined) + + for (const result of [ + result_1, + result_2, + result_3, + result_4, + result_5, + result_6, + result_7, + result_8, + result_9, + result_10, + result_11, + result_12, + ]) { + expect(result) + } + }) + + test('/CSSIStation?lat={lat}&long={long}&miles={miles}', async () => { + /******Expected Tooltip*******\ + const result_x: { + StartLatitude: number; + StartLongitude: number; + Count: number; + Message: string; + Results: CSSIResultsData[]; + } + ******************************/ + const result_1 = await cssiStation({ location }) + const result_2 = await cssiStation({ location }, true) + const result_3 = await cssiStation({ location }, undefined) + const result_4 = await cssiStation({ location, filters: { lang } }) + const result_5 = await cssiStation({ location, filters: { lang } }, true) + const result_6 = await cssiStation( + { location, filters: { lang } }, + undefined + ) + const result_7 = await cssiStation({ location, filters: { cpsweek } }) + const result_8 = await cssiStation({ location, filters: { cpsweek } }, true) + const result_9 = await cssiStation( + { location, filters: { cpsweek } }, + undefined + ) + const result_10 = await cssiStation({ location, filters }) + const result_11 = await cssiStation({ location, filters }, true) + const result_12 = await cssiStation({ location, filters }, undefined) + + for (const result of [ + result_1, + result_2, + result_3, + result_4, + result_5, + result_6, + result_7, + result_8, + result_9, + result_10, + result_11, + result_12, + ]) { + expect(result) + } + }) +}) diff --git a/packages/lib/src/api/cssiStation/cssiStation.ts b/packages/lib/src/api/cssiStation/cssiStation.ts new file mode 100644 index 00000000..2c598db7 --- /dev/null +++ b/packages/lib/src/api/cssiStation/cssiStation.ts @@ -0,0 +1,739 @@ +/** + * @module api/cssiStation + * @category API - CSSI Station Locator API + */ + +import { useNHTSA } from '@/api' +import { + catchInvalidArguments, + encodeQueryStringParams, + rejectWithError, +} from '@/utils' +import type { + NhtsaResponse, + NoExtraProperties, + QueryStringParamsEncoded, +} from '@/types' + +/** + * # CSSI Station API + * + * ::: tip :bulb: More Information + * See: [CSSI Station Documentation] /guide/cssi-station/ + * ::: + * + * You can use `cssiStation()` as a thin wrapper for the `NHTSA Car Seat Inspection Locator API` to + * get safety ratings for a vehicle. + * + * This function is designed to handle all of the different possible workflows and return the + * correct data/url for each one, all depending on which options you pass to the function. In this + * sense it is a single universal function that can handle the entirety of the Safety Ratings + * API. + * + * From the + * [Official Documentation](https://www.nhtsa.gov/nhtsa-datasets-and-apis#car-seat-inspection-locator): + * + * > Car crashes are a leading cause of death and injuries for children. Data show a high number of + * child car seats are not installed properly. Car seat inspection stations make it easier for + * parents and caregivers to check to see if their car seat is installed correctly. NHTSA provides + * information to help people locate a car seat inspection station. Information for each station + * is reported to NHTSA and we attempt to validate the station locations using a commercial + * geographic database so this data will, in most cases, be able to be used for driving + * directions. + * + * ## Options + * + * The CSSI Station API uses a path and query string to get different data. This function uses the + * options passed to build the correct url path and query string. + * + * Valid `options` are: + * + * - `state` - State to search + * - `zip` - Zip code to search + * - `location` - Object containing `lat`, `long`, and `miles` to search + * - `filters` - Object containing `lang` and `cpsweek` to filter results + * + * All are optional and the only valid options you can pass to this function. + * + * Valid `options` combinations: + * + * No options: + * - `cssiStation()` - Get first 100 stations + * - `cssiStation({})` - Get first 100 stations + * + * With options.state: + * - `cssiStation({ state: 'NV' })` + * - `cssiStation({ state: 'nv' })` + * - `cssiStation({ state: 'Nv' })` + * - `cssiStation({ state: 'Nevada' })` + * - `cssiStation({ state: 'nevada' })` + * - `cssiStation({ state: 'NV', filters: { lang: 'spanish' } })` + * - Note: `filters.cpsweek` not compatible with `state` + * + * With options.zip: + * - `cssiStation({ zip: 63640 })` + * - `cssiStation({ zip: 63640, filters: { lang: 'spanish' } })` + * - `cssiStation({ zip: 63640, filters: { cpsweek: true } })` + * - `cssiStation({ zip: 63640, filters: { lang: 'spanish', cpsweek: true } })` + * + * With options.location: + * - `cssiStation({ location: { lat: 32.71325, long: -97.28864, miles: 50 } })` + * - `cssiStation({ location, filters: { lang: 'spanish' } })` + * - `cssiStation({ location, filters: { cpsweek: true } })` + * - `cssiStation({ location, filters: { lang: 'spanish', cpsweek: true } })` + * + * Real Example URLs, w/trailing slash also ok: + * + * - https://api.nhtsa.gov/CSSIStation + * - https://api.nhtsa.gov/CSSIStation/state/NV + * - https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish + * - https://api.nhtsa.gov/CSSIStation/zip/63640 + * - https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish + * - https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek + * - https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek?lang=spanish + * - https://api.nhtsa.gov/CSSIStation?lat=32.71325&long=-97.28864&miles=50 + * - https://api.nhtsa.gov/CSSIStation?lat=32.71325&long=-97.28864&miles=50&lang=spanish + * - https://api.nhtsa.gov/CSSIStation?lat=32.71325&long=-97.28864&miles=50&cpsweek=true + * - https://api.nhtsa.gov/CSSIStation?lat=32.71325&long=-97.28864&miles=50&lang=spanish&cpsweek=true + * + * Note that `?format=json` will always be appended to the URL when using this package, even + * though it is not required by the CSSI Station API. + * + * Returned data will be structured as `{ Count, Message, Results, StartLatitude, StartLongitude }` + * for any combination of options. + * + * See the `Returns` section below for more details. + * + * ### Some Notes on this API + * + * Based on real world testing, it appears that this API may be broken or partially abandoned by + * NHTSA. For example: + * + * - if you search by state, you cannot use filters.cpsweek, it will return a 404 Unknown error + * if added as a path and will have no effect if added as a query string to the path. + * - location query string has no effect on returned data, it will return the same data as if you + * sent no query string at all to the base url, the first 100 stations in the database. + * - as a consequence of the above, it appears that filters will also have no effect when used with + * the location query string + * + * When using the location query string, the lat and long in the returned data will not match the + * lat and long you sent in the query string. For example, if you send: + * + * https://api.nhtsa.gov/CSSIStation?lat=32.71325&long=-97.28864&miles=50 + * + * You get data returned with: + * - StartLatitude: 42.75565 + * - StartLongitude: -92.79417 + * + * Which does not match the lat and long you sent in the query string. It should be: + * - StartLatitude: 32.71325 + * - StartLongitude: -97.28864 + * + * This will also return the same data as when you send no query string: + * + * https://api.nhtsa.gov/CSSIStation + * + * This appears to be broken on the NHTSA side, possibly because whatever API they were using to + * convert lat and long to a geo location is no longer available or because they are using a + * different internal API behind an auth wall for their offical seat install locator site at + * https://www.nhtsa.gov/equipment/car-seats-and-booster-seats#installation-help-inspection and have + * abandoned this part of the CSSI API. + * + * In practice you can send whatever query string names and values you want, it will ignore the + * query and still return the same data as if you sent no query. + * + * ## Rules + * + * There are several rules to follow when using this API or you will get a network error response + * from the NHTSA API. + * + * 1. You can only pass one of the following options exclusively: `state`, `zip`, or `location`. + * 2. If you pass `state`, you cannot pass `filters.cpsweek`. + * 3. If you pass `location`, you must pass all of the following options: `lat`, `long`, and + * `miles`. + * + * FYI: Rules #1-2 will return a 404 Unknown error from the NHTSA API if you break them. + * + * Consequences of breaking the rules: + * + * - Rule #1 - If you pass more than one of the following options: `state`, `zip`, or `location`, + * this function will throw an error to prevent you from getting a 404 error from the NHTSA API. + * - Rule #2 - If you pass `state` and `filters.cpsweek`, this function will throw an error to + * prevent you from getting a 404 error from the NHTSA API. + * - Rule #3 - If you pass `location` and do not pass all of the following options: `lat`, `long`, + * and `miles`, this function will throw an error. + * + * There will also be TypeScript errors if you pass invalid options or invalid combinations of + * options. + * + * To clarify, this function will `throw Error`s in the following cases: + * + * - If you pass options not listed above. + * - If you pass an invalid combination of options. + * - If you pass a valid combination of options but include options not listed above. + * + * ## Usage + * + * The following describes in more detail the use of the different options and the paths they use. + * + * ### Get First 100 Stations + * + * Get a list of the first 100 stations in the `CSSI Station API` database. + * + * If you pass no arguments, an empty object `{}`, `undefined`, or `true` as the first argument, the + * path `/CSSIStation` will be used. + * + * ```js + * await cssiStation().then((response) => { + * response.Results.forEach((station) => { + * console.log(station.AddressLine1) // "1000 E. 14th St.", etc. + * console.log(station.City) // "Rolla", etc. + * console.log(station.State) // "MO", etc. + * console.log(station.CPSWeekEventFlag) // "Yes" or "No" + * // ...more properties + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await cssiStation(false) + * console.log(url) // "https://api.nhtsa.gov/CSSIStation?format=json" + * ``` + * + * ### Get Stations by State + * + * Get a list of all available stations in the `CSSI Station API` for a specific state. + * + * If you pass a `state` as the only option, the path `/state/:state` will be used. + * + * ```js + * await cssiStation({ state: 'Texas' }) + * .then((response) => { + * response.Results.forEach((station) => { + * console.log(station.AddressLine1) // "1000 E. 14th St.", etc. + * console.log(station.City) // "Rolla", etc. + * console.log(station.State) // "MO", etc. + * console.log(station.CPSWeekEventFlag) // "Yes" or "No" + * // ...more properties + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await cssiStation({ state: 'Texas' }, false) + * console.log(url) // "https://api.nhtsa.gov/CSSIStation/state/Texas?format=json" + * ``` + * + * ### Get Stations by Zip Code + * + * Get a list of all available stations in the `CSSI Station API` for a specific zip code. + * + * If you pass a `zip` as the only option, the path `/zip/:zip` will be used. + * + * ```js + * // Get the models for a 2013 Honda + * await cssiStation({ zip: 63640 }) + * .then((response) => { + * response.Results.forEach((station) => { + * console.log(station.AddressLine1) // "1000 E. 14th St.", etc. + * console.log(station.City) // "Rolla", etc. + * console.log(station.State) // "MO", etc. + * console.log(station.CPSWeekEventFlag) // "Yes" or "No" + * // ...more properties + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await cssiStation({ zip: 63640 }, false) + * console.log(url) // "https://api.nhtsa.gov/CSSIStation/zip/63640?format=json" + * ``` + * + * ### Get Stations by Location + * + * Gets a list of all available stations in the `CSSI Station API` for a specific locatiion + * (`latitude` and `longitude`) and radius (`miles`). + * + * If you pass a `location` as the only option, the path `/` will be used with the following query + * string: `?lat={long}&long={long}&miles={miles}`. + * + * Note that this appears to be broken and returns the same data (first 100 stations) as if you + * sent no query string at all to the base url of `/CSSIStation`. + * + * ```js + * await cssiStation({ location: { lat: 32.71325, long: -97.28864, miles: 50 } }) + * .then((response) => { + * response.Results.forEach((station) => { + * console.log(station.AddressLine1) // "1000 E. 14th St.", etc. + * console.log(station.City) // "Rolla", etc. + * console.log(station.State) // "MO", etc. + * console.log(station.CPSWeekEventFlag) // "Yes" or "No" + * // ...more properties + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await cssiStation({ location: { lat: 32.71325, long: -97.28864, miles: 50 } }, false) + * console.log(url) + * // "https://api.nhtsa.gov/CSSIStation?lat=32.71325&long=-97.28864&miles=50&format=json" + * ``` + * + * ### Get by State Filtered by Language + * + * Get a list of all available stations in the `CSSI Station API` for a specific state and language. + * + * If you pass a `state` and `filters.lang` as options, the path `/state/:state/lang/:lang` will be + * used. + * + * Note: `filter.cpsweek` is not compatible with `state`. + * + * ```js + * await cssiStation({ state: 'Texas', filters: { lang: 'spanish' } }) + * .then((response) => { + * response.Results.forEach((station) => { + * console.log(station.AddressLine1) // "1000 E. 14th St.", etc. + * console.log(station.City) // "Rolla", etc. + * console.log(station.State) // "MO", etc. + * console.log(station.CPSWeekEventFlag) // "Yes" or "No" + * // ...more properties + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await cssiStation({ state: 'Texas', filters: { lang: 'spanish' } }, false) + * console.log(url) // "https://api.nhtsa.gov/CSSIStation/state/Texas/lang/spanish?format=json" + * ``` + * + * ### Get by Zip Code Filtered by Language and/or CPSWeek + * + * Get a list of all available stations in the `CSSI Station API` for a specific zip code and + * language and/or CPSWeek. + * + * If you pass a `zip` and `filters.lang` as options, the path `/zip/:zip/lang/:lang` will be used. + * + * If you pass a `zip` and `filters.cpsweek` as options, the path `/zip/:zip/cpsweek` will be used. + * + * If you pass a `zip` and `filters.lang` and `filters.cpsweek` as options, the path and query + * `/zip/:zip/cpsweek?lang={lang}` will be used. + * + * ```js + * await cssiStation({ zip: 63640, filters: { lang: 'spanish' } }) + * .then((response) => { + * response.Results.forEach((station) => { + * console.log(station.AddressLine1) // "1000 E. 14th St.", etc. + * console.log(station.City) // "Rolla", etc. + * console.log(station.State) // "MO", etc. + * console.log(station.CPSWeekEventFlag) // "Yes" or "No" + * // ...more properties + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * await cssiStation({ zip: 63640, filters: { lang: 'spanish' } }, false) + * // "https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish?format=json" + * await cssiStation({ zip: 63640, filters: { cpsweek: true } }, false) + * // "https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek?format=json" + * await cssiStation({ zip: 63640, filters: { lang: 'spanish', cpsweek: true } }, false) + * // "https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek?lang=spanish&format=json" + * ``` + * + * ## Returns + * + * The return from this function will be a parsed JSON response, typed to reflect the different + * types of objects you can expect to get back from the API in the `Results[]`. + * + * Returned data will be structured as `{ Count, Message, Results, StartLatitude, StartLongitude }` + * + * The return will be an object with the following properties: + * + * - `Count` - The number of results returned + * - `Message` - A message from the NHTSA API + * - `Results` - An array of objects containing the response data + * - `StartLatitude` - The latitude of the starting point used to search for stations + * - `StartLongitude` - The longitude of the starting point used to search for stations + * + * The `Results[]` typings will have the same properties no matter which options you pass to the + * function. + * + * It's very possible you get a repsonse with empty Results and a Count of 0, in which case this + * means it found no stations. This is not an error, it's just a response with no data. + * + * - See type `CSSIResultsData` for a list of all possible properties in the `Results[]` + * + * @param [options] - Object of options, fetch data from the API depending on options passed + * @param [options.state] - State to search + * @param [options.zip] - Zip code to search + * @param [options.location] - Object containing `lat`, `long`, and `miles` to search + * @param [options.location.lat] - Latitude of the location to search + * @param [options.location.long] - Longitude of the location to search + * @param [options.location.miles] - Radius in miles to search + * @param [options.filters] - Object containing `lang` and `cpsweek` to filter results + * @param [options.filters.lang] - Language to filter results by (e.g. 'spanish') + * @param [options.filters.cpsweek] - If true, will filter results by stations participating in + * CPSWeek + * @param [doFetch=true] - If false, will return the url string instead of fetching the data + * (default: `true`) + * @returns - Parsed API response `object` -or- url `string` if `doFetch = false` + */ +function cssiStation( + options: CSSIOptions, + doFetch?: true +): Promise +function cssiStation( + options: CSSIOptions | undefined, + doFetch: false +): Promise +function cssiStation(options?: undefined, doFetch?: true): Promise +function cssiStation(doFetch?: true): Promise +function cssiStation(doFetch: false): Promise +function cssiStation( + options?: CSSIOptions | boolean, + doFetch?: boolean +): Promise +/* Implementation */ +async function cssiStation( + options?: CSSIOptions | boolean, + doFetch: boolean = true +): Promise { + const endpointName = 'CSSIStation' + const apiType = 'cssiStation' + + /** + * Builds the URL path + */ + const buildPath = (parts: CSSIOptionsBase): string => { + const pathParts = [] + if (parts.state) { + pathParts.push(`state/${parts.state}`) + if (parts.filters?.lang) { + pathParts.push(`lang/${parts.filters.lang}`) + } + // filters.cpsweek not compatible with state + } + if (parts.zip) { + pathParts.push(`zip/${parts.zip}`) + if (parts.filters?.cpsweek) { + pathParts.push('cpsweek') + } else if (parts.filters?.lang) { + pathParts.push(`lang/${parts.filters.lang}`) + } + // if (zip && filters.cpsweek && filters.lang) - lang will be added as query string + } + return pathParts.join('/') + } + + try { + let path = '' + let encodedParams: QueryStringParamsEncoded = {} + + if (typeof options === 'boolean') { + /* If first argument is boolean, it is doFetch */ + doFetch = options + /* Set options undefined so it will pass argument check below, otherwise invalid type */ + options = undefined + } + + /* Throw an error if options contains invalid keys or types of values */ + catchInvalidArguments({ + args: [ + { + name: 'options', + value: options, + types: ['object'], + validKeys: ['state', 'zip', 'location', 'filters'], + }, + { + name: 'state', + value: options?.state, + types: ['string'], + }, + { + name: 'zip', + value: options?.zip, + types: ['string', 'number'], + }, + { + name: 'location', + value: options?.location, + types: ['object'], + validKeys: ['lat', 'long', 'miles'], + }, + { + name: 'location.lat', + value: options?.location?.lat, + types: ['string', 'number'], + requiredBy: [ + { name: 'location.long', value: options?.location?.long }, + { name: 'location.miles', value: options?.location?.miles }, + ], + }, + { + name: 'location.long', + value: options?.location?.long, + types: ['string', 'number'], + requiredBy: [ + { name: 'location.lat', value: options?.location?.lat }, + { name: 'location.miles', value: options?.location?.miles }, + ], + }, + { + name: 'location.miles', + value: options?.location?.miles, + types: ['string', 'number'], + requiredBy: [ + { name: 'location.lat', value: options?.location?.lat }, + { name: 'location.long', value: options?.location?.long }, + ], + }, + { + name: 'filters', + value: options?.filters, + types: ['object'], + validKeys: ['lang', 'cpsweek'], + }, + { + name: 'filters.lang', + value: options?.filters?.lang, + types: ['string'], + }, + { + name: 'filters.cpsweek', + value: options?.filters?.cpsweek, + types: ['boolean'], + }, + ], + }) + + /* options are guaranteed to be an object by now because of catchInvalidArguments() */ + if (options) { + const { + state, + zip, + location: { lat, long, miles } = {}, + filters: { lang, cpsweek } = {}, + } = options + const hasLocation = lat && long && miles + const hasBothFilters = cpsweek && lang + + /* Throw an error if state, zip, and location are provided together in any combination */ + if ( + (state && zip && hasLocation) || + (state && zip) || + (state && hasLocation) || + (zip && hasLocation) + ) { + throw new Error( + `Invalid options: state, zip, and location are not compatible.` + ) + } + + /* Throw an error if cpsweek is included with state */ + if (state && cpsweek) { + throw new Error( + `Invalid options: state and filters.cpsweek are not compatible.` + ) + } + + /* Build the API URL path with state or zip, some filters used in path */ + if (state || zip) { + path = buildPath(options) + } + /* lang is a query when used with zip and filters.cpsweek */ + if (zip && hasBothFilters) { + encodedParams = encodeQueryStringParams({ lang }) + } + /* location uses lat, long, miles, and possible filters as query string */ + if (hasLocation) { + encodedParams = encodeQueryStringParams({ + lat, + long, + miles, + lang, + cpsweek, + }) + } + } + + const { get, createCachedUrl, getCachedUrl } = useNHTSA() + + createCachedUrl({ + apiType, + endpointName, + path, + params: encodedParams, + }) + + if (!doFetch) { + return getCachedUrl() + } else { + return get() + } + } catch (error) { + return rejectWithError(error) + } +} + +export { cssiStation } + +/** + * These types have to be kept together with the function in the same file. + * + * This is so Intellisense will show the full type contents of the return to the end user when they + * save the results to a variable and then hover over that variable. If these types are moved to + * another file, Intellisense will only show the type name, not the full type contents for the + * cssiStation() NhstaResponse return type. + * + * Any type that is used directly in the function overloads and not in this file will cause this. + * So, theoretically, you could move all of those types here and the others live in their own file, + * but that would spread the types out and they are only used here and in the tests, so it makes + * sense to keep them together. + */ + +/** + * All valid options for the `cssiStation()` function + */ +export type CSSIOptionsBase = { + state?: string + zip?: string | number + location?: { + lat: string | number + long: string | number + miles: string | number + } + filters?: { + lang?: string + cpsweek?: boolean + } +} + +/** + * Options that can be used as query string params + * - `lang` is a only query when used with `CSSIOptionsZip` + * - `cpsweek` is a only query when used with `CSSIOptionsLocation` + * - `lat`, `long`, and `miles` are only a query when used with `CSSIOptionsLocation` + * - `lang` and `cpsweek` are also a query when used with `CSSIOptionsLocation` + */ +export type CSSIOptionsCanBeQuery = { + lat?: string | number + long?: string | number + miles?: string | number + lang?: string + cpsweek?: boolean +} + +/** + * Options to get the first 100 stations in the database. + * + * Builds path: `/CSSIStation` + */ +export type CSSIOptionsEmpty = { + state?: undefined + zip?: undefined + location?: undefined + filters?: undefined +} + +/** + * Options to get all stations for a `state` passed to the `products()` function with an optional + * `lang` filter. + * + * Builds path: `/CSSIStation/state/${state}` or `/CSSIStation/state/${state}/lang/${lang}` + */ +export type CSSIOptionsState = { + state: string + filters?: { + lang?: string + cpsweek?: undefined + } + zip?: undefined + location?: undefined +} + +/** + * Options to get all stations for a `zip` passed to the `products()` function with optional + * `lang` and `cpsweek` filters. + * + * Builds paths: + * - `/CSSIStation/zip/${zip}` + * - `/CSSIStation/zip/${zip}/lang/${lang}` + * - `/CSSIStation/zip/${zip}/cpsweek` + * - `/CSSIStation/zip/${zip}/cpsweek?lang=${lang}` + */ +export type CSSIOptionsZip = { + zip: string | number + filters?: { + lang?: string + cpsweek?: boolean + } + state?: undefined + location?: undefined +} + +/** + * Options to get all stations for a location `lat`, `long`, and `miles` passed to the + * `products()` function, with optional `lang` and `cpsweek` filters. + * + * Builds paths: + * - `/CSSIStation?lat=${lat}&long=${long}&miles=${miles}` + * - `/CSSIStation?lat=${lat}&long=${long}&miles=${miles}&lang=${lang}` + * - `/CSSIStation?lat=${lat}&long=${long}&miles=${miles}&cpsweek=true` + * - `/CSSIStation?lat=${lat}&long=${long}&miles=${miles}&cpsweek=true&lang=${lang}` + */ +export type CSSIOptionsLocation = { + location: { + lat: string | number + long: string | number + miles: string | number + } + filters?: { + lang?: string + cpsweek?: boolean + } + state?: undefined + zip?: undefined +} + +/** + * All valid options combinations for the `cssiStation()` function + */ +export type CSSIOptions = + | CSSIOptionsEmpty + | CSSIOptionsState + | CSSIOptionsZip + | CSSIOptionsLocation + +/** + * Ensures only valid options are passed to the `cssiStation()` function + */ +export type NoInvalidOptions = NoExtraProperties< + CSSIOptionsBase, + T +> + +/** + * All possible properties and their value types, found in the `Results[]` objects of the + * `CSSI Station API` response. This is typed with all properties optional so it can be used to + * type the `Results[]` based on `options` passed to the `cssiStation()` function. + */ +export type CSSIResultsData = { + ContactFirstName: string | null + ContactLastName: string | null + Organization: string | null + AddressLine1: string | null + City: string | null + State: string | null + Zip: string | null + Email: string | null + Fax: string | null + Phone1: string | null + CPSWeekEventFlag: string | null + LastUpdatedDate: string | null + MobileStationFlag: string | null + CountiesServed: string | null + LocationLatitude: number | null + LocationLongitude: number | null +} + +/** + * Types the return of the `products()` function. + * + * The `Results[]` will be typed as `CSSIResultsData` + */ +export type CSSIResponse = NhtsaResponse diff --git a/packages/lib/src/api/cssiStation/types.ts b/packages/lib/src/api/cssiStation/types.ts new file mode 100644 index 00000000..884ce595 --- /dev/null +++ b/packages/lib/src/api/cssiStation/types.ts @@ -0,0 +1,17 @@ +/** + * @module api/cssiStation/types + * @category Types + */ + +export type { + CSSIOptions, + CSSIOptionsBase, + CSSIOptionsCanBeQuery, + CSSIOptionsEmpty, + CSSIOptionsLocation, + CSSIOptionsState, + CSSIOptionsZip, + CSSIResponse, + CSSIResultsData, + NoInvalidOptions, +} from './cssiStation' diff --git a/packages/lib/src/api/index.ts b/packages/lib/src/api/index.ts index 72d27c04..550e3b12 100644 --- a/packages/lib/src/api/index.ts +++ b/packages/lib/src/api/index.ts @@ -3,5 +3,35 @@ * @category API */ -export * from './endpoints' +export { complaints } from './complaints/complaints' +export { cssiStation } from './cssiStation/cssiStation' +export { products } from './products/products' +export { recalls } from './recalls/recalls' +export { safetyRatings } from './safetyRatings/safetyRatings' +export { + DecodeVin, + DecodeVinExtended, + DecodeVinValues, + DecodeVinValuesBatch, + DecodeVinValuesExtended, + DecodeWMI, + GetAllMakes, + GetAllManufacturers, + GetCanadianVehicleSpecifications, + GetEquipmentPlantCodes, + GetMakeForManufacturer, + GetMakesForVehicleType, + GetManufacturerDetails, + GetMakesForManufacturerAndYear, + GetModelsForMake, + GetModelsForMakeId, + GetModelsForMakeIdYear, + GetModelsForMakeYear, + GetParts, + GetVehicleTypesForMake, + GetVehicleTypesForMakeId, + GetVehicleVariableList, + GetVehicleVariableValuesList, + GetWMIsForManufacturer, +} from './vpic' export { useNHTSA } from './useNHTSA' diff --git a/packages/lib/src/api/products/__tests__/products.test-d.ts b/packages/lib/src/api/products/__tests__/products.test-d.ts new file mode 100644 index 00000000..dcc78b7c --- /dev/null +++ b/packages/lib/src/api/products/__tests__/products.test-d.ts @@ -0,0 +1,404 @@ +import { describe, expectTypeOf, test } from 'vitest' + +import { + products, + type ProductsIssueType, + type ProductsOptions, + type ProductsOptionsEmpty, + type ProductsOptionsMake, + type ProductsOptionsModelYear, + type ProductsResponseByOptions, + type ProductsResponseByVariant, +} from '../products' + +const issueTypeC = 'c' +const issueTypeR = 'r' +const issueTypeComplaints = 'complaints' +const issueTypeRecalls = 'recalls' +const issueType = issueTypeC +const modelYearString = '2018' +const modelYearNumber = 2018 +const modelYear = modelYearNumber +const make = 'Audi' + +test('Typecheck: products() - parameters - ', () => { + expectTypeOf().toBeFunction() + expectTypeOf().parameters.toMatchTypeOf< + [ + issueType: ProductsIssueType, + options?: boolean | ProductsOptions | undefined, + doFetch?: boolean | undefined, + ] + >() +}) + +describe('Typecheck: products() - returns correct type of response data - ', () => { + /***************************** + * doFetch = true | undefined (default) + ****************************/ + test('with issueType = "c"', async () => { + const result = await products(issueTypeC) + + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType = "complaints"', async () => { + const result = await products(issueTypeComplaints) + + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType = "r"', async () => { + const result = await products(issueTypeR) + + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType = "recalls"', async () => { + const result = await products(issueTypeRecalls) + + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType and doFetch = true', async () => { + const result = await products(issueType, true) + + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType and options/doFetch = undefined', async () => { + const result = await products(issueType, undefined) + + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType, options = undefined, and doFetch = true', async () => { + const result = await products(issueType, undefined, true) + + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType and options = {}', async () => { + const result = await products(issueType, {}) + + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType, options = {}, and doFetch = true', async () => { + const result = await products(issueType, {}, true) + + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType and options.modelYear as string', async () => { + const result = await products(issueType, { modelYear: modelYearString }) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType and options.modelYear as number', async () => { + const result = await products(issueType, { modelYear: modelYearNumber }) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType, options.modelYear, and doFetch = true', async () => { + const result = await products(issueType, { modelYear }, true) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + }) +}) + +describe('Typecheck: products() - returns type string if doFetch = false - ', () => { + /***************************** + * doFetch = false + ****************************/ + test('with issueType and doFetch = false', async () => { + expectTypeOf(await products(issueType, false)).toEqualTypeOf() + }) + + test('with issueType, options = undefined, and doFetch = false', async () => { + expectTypeOf( + await products(issueType, undefined, false) + ).toEqualTypeOf() + }) + + test('with issueType, options = {}, and doFetch = false', async () => { + expectTypeOf(await products(issueType, {}, false)).toEqualTypeOf() + }) + + test('with issueType, options.modelYear, and doFetch = false', async () => { + expectTypeOf( + await products(issueType, { modelYear }, false) + ).toEqualTypeOf() + }) + + test('with issueType, options.modelYear, options.make, and doFetch = false', async () => { + expectTypeOf( + await products(issueType, { modelYear, make }, false) + ).toEqualTypeOf() + }) +}) diff --git a/packages/lib/src/api/products/__tests__/products.test.ts b/packages/lib/src/api/products/__tests__/products.test.ts new file mode 100644 index 00000000..13ee4565 --- /dev/null +++ b/packages/lib/src/api/products/__tests__/products.test.ts @@ -0,0 +1,532 @@ +import { beforeEach, describe, expect, test } from 'vitest' +import { products } from '../products' + +// Mocks +import { createMockResponse } from '.vitest/helpers' +import { mockResults } from '.vitest/data' + +const issueTypeC = 'c' +const issueTypeR = 'r' +const issueTypeComplaints = 'complaints' +const issueTypeRecalls = 'recalls' +const issueType = issueTypeC +const modelYearString = '2018' +const modelYearNumber = 2018 +const modelYear = modelYearNumber +const make = 'Audi' + +// https://api.nhtsa.gov/products/vehicle/modelYears?issueType={issueType} +// https://api.nhtsa.gov/products/vehicle/makes?modelYear={modelYear}&issueType={issueType} +// https://api.nhtsa.gov/products/vehicle/models?modelYear={modelYear}&make={make}&issueType={issueType} + +const baseUrl = 'https://api.nhtsa.gov/products/vehicle' +const mockUrlIssueType = `${baseUrl}/modelYears?issueType=${issueType}&format=json` +const mockUrlIssueTypeC = `${baseUrl}/modelYears?issueType=${issueTypeC}&format=json` +const mockUrlIssueTypeR = `${baseUrl}/modelYears?issueType=${issueTypeR}&format=json` +const mockUrlModelYear = `${baseUrl}/makes?modelYear=${modelYear}&issueType=${issueType}&format=json` +const mockUrlMake = `${baseUrl}/models?modelYear=${modelYear}&make=${make}&issueType=${issueType}&format=json` + +const expectedFetchOptions = { + saveUrl: true, + method: 'GET', +} + +type TestEach = { + description: string + args: Parameters + expectedUrl: string +} + +describe('products()', () => { + beforeEach(() => { + fetchMock.resetMocks() + fetchMock.mockResolvedValue(createMockResponse(mockResults)) + }) + + test('Is a function that returns a Promise', () => { + expect(products).toBeDefined() + expect(products).toBeInstanceOf(Function) + expect(products(issueType)).toBeInstanceOf(Promise) + }) + + /***************************** + * doFetch = true (default) + ****************************/ + describe('Fetches API data with: ', () => { + test.each([ + // no, empty, or undefined options - returns all available model years + { + description: 'issueType = "c"', + args: [issueTypeC], + expectedUrl: mockUrlIssueTypeC, + }, + { + description: 'issueType = "complaints"', + args: [issueTypeComplaints], + expectedUrl: mockUrlIssueTypeC, + }, + { + description: 'issueType = "r"', + args: [issueTypeR], + expectedUrl: mockUrlIssueTypeR, + }, + { + description: 'issueType = "recalls"', + args: [issueTypeRecalls], + expectedUrl: mockUrlIssueTypeR, + }, + { + description: 'issueType and doFetch = true', + args: [issueType, true], + expectedUrl: mockUrlIssueType, + }, + { + description: 'issueType and options/doFetch = undefined', + args: [issueType, undefined], + expectedUrl: mockUrlIssueType, + }, + { + description: 'issueType, options = undefined, and doFetch = true', + args: [issueType, undefined, true], + expectedUrl: mockUrlIssueType, + }, + { + description: 'issueType and options = {}', + args: [issueType, {}], + expectedUrl: mockUrlIssueType, + }, + { + description: 'issueType, options = {}, and doFetch = true', + args: [issueType, {}, true], + expectedUrl: mockUrlIssueType, + }, + // options.modelYear + { + description: 'issueType and options.modelYear as string', + args: [issueType, { modelYear: modelYearString }], + expectedUrl: mockUrlModelYear, + }, + { + description: 'issueType and options.modelYear as number', + args: [issueType, { modelYear: modelYearNumber }], + expectedUrl: mockUrlModelYear, + }, + { + description: 'issueType, options.modelYear, and doFetch = true', + args: [issueType, { modelYear: modelYearNumber }, true], + expectedUrl: mockUrlModelYear, + }, + { + description: + 'issueType, options.modelYear, and options.make = undefined', + args: [issueType, { modelYear: modelYearNumber, make: undefined }], + expectedUrl: mockUrlModelYear, + }, + // options.make + { + description: 'issueType, options.modelYear, and options.make', + args: [issueType, { modelYear, make }], + expectedUrl: mockUrlMake, + }, + { + description: + 'issueType, options.modelYear, options.make, and doFetch = true', + args: [issueType, { modelYear, make }, true], + expectedUrl: mockUrlMake, + }, + ])('$description', async ({ args, expectedUrl }) => { + const results = await products(...args) + expect(results).toEqual(mockResults) + expect(fetchMock).toHaveBeenCalledWith(expectedUrl, expectedFetchOptions) + expect(fetchMock.requests().length).toEqual(1) + expect(fetchMock.requests()[0].url).toEqual(expectedUrl) + expect(fetchMock.requests()[0].method).toEqual('GET') + }) + }) + + /***************************** + * doFetch = false + ***************************/ + describe('Returns API URL string with: ', () => { + test.each([ + { + description: 'issueType and doFetch = false', + args: [issueType, false], + expectedUrl: mockUrlIssueType, + }, + { + description: 'issueType, options = undefined, and doFetch = false', + args: [issueType, undefined, false], + expectedUrl: mockUrlIssueType, + }, + { + description: 'issueType, options = {}, and doFetch = false', + args: [issueType, {}, false], + expectedUrl: mockUrlIssueType, + }, + // options.modelYear + { + description: 'issueType, options.modelYear, and doFetch = false', + args: [issueType, { modelYear }, false], + expectedUrl: mockUrlModelYear, + }, + // options.make + { + description: + 'issueType, options.modelYear and options.make and doFetch = false', + args: [issueType, { modelYear, make }, false], + expectedUrl: mockUrlMake, + }, + ])('$description', async ({ args, expectedUrl }) => { + const results = await products(...args) + + expect(results).toEqual(expectedUrl) + expect(fetchMock.requests().length).toEqual(0) + }) + }) + + /***************************** + * rejects with error + ***************************/ + describe('Rejects with Error if: ', () => { + test.each([ + undefined, + 123, + { object: 123 }, + ['array'], + true, + false, + null, + () => {}, + ])('issueType is undefined or is not a string, <%s>', async (arg) => { + await expect(() => + products( + // @ts-expect-error Argument of type 'x' is not assignable to type 'ProductsIssueType'. + arg + ) + ).rejects.toThrowError( + /error validating argument named "issueType", it is required and must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test.each(['a', 'b', 'rrr', 'ccc', 'complaint', 'recall'])( + 'issueType is not a string of "c", "complaints, "r", or "recalls", <%s>', + async (arg) => { + await expect(() => + products( + // @ts-expect-error Argument of type 'x' is not assignable to type 'ProductsIssueType'. + arg + ) + ).rejects.toThrowError( + /Valid issueTypes are: 'r', 'recalls', 'c', 'complaints'/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each(['string', 123, ['array'], null, () => {}])( + 'options is neither an object nor boolean, <%s>', + async (arg) => { + await expect(() => + products( + issueType, + // @ts-expect-error Type (x) is not assignable to type ... + arg + ) + ).rejects.toThrowError( + /error validating argument named "options", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([{ object: 123 }, ['array'], true, false, null, () => {}])( + 'options.modelYear is neither a string nor number, <%s>', + async (arg) => { + await expect(() => + products(issueType, { + // @ts-expect-error Type (x) is not assignable to type 'string | number | undefined + modelYear: arg, + }) + ).rejects.toThrowError( + /error validating argument named "modelYear", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([123, { object: 123 }, ['array'], true, false, null, () => {}])( + 'options.make is not a string, <%s>', + async (arg) => { + await expect(() => + products(issueType, { + modelYear, + // @ts-expect-error Type (x) is not assignable to type 'string | undefined + make: arg, + }) + ).rejects.toThrowError( + /error validating argument named "make", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test('options.make is provided but not options.modelYear', async () => { + await expect(() => + // @ts-expect-error Property 'modelYear' is missing in type '{ make: string; }' ... + products(issueType, { + make, + }) + ).rejects.toThrowError( + /error validating argument named "modelYear", it is required if "make"/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options', async () => { + await expect(() => + products(issueType, { + modelYear, + // @ts-expect-error Object literal may only specify known properties ... + notAnOption: 'invalid option with TS error', + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and doFetch = true', async () => { + await expect(() => + products( + issueType, + { + // @ts-expect-error Object literal may only specify known properties ... + notAnOption: 'invalid option with TS error', + }, + true + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and doFetch = false', async () => { + await expect(() => + products( + issueType, + { + // @ts-expect-error Object literal may only specify known properties ... + notAnOption: 'invalid option with TS error', + }, + false + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and wrong type for valid options', async () => { + await expect(() => + products(issueType, { + notAnOption: 'no TS error, vehicleId error takes precedence', + // @ts-expect-error Type 'x' is not assignable to type 'string | number | undefined'. + modelYear: [1, 2, 3], + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options', async () => { + await expect(() => + products(issueType, { + // @ts-expect-error Type 'x' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options and doFetch = true', async () => { + await expect(() => + products( + issueType, + { + // @ts-expect-error Type 'x' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + make, + }, + true + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options and doFetch = false', async () => { + await expect(() => + products( + issueType, + { + // @ts-expect-error Type 'x' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + make, + }, + false + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + }) +}) + +/******************************* + * These are here to test the IDE intellisense tooltips when hovering the function and results, + * to ensure the correct types are displayed for the end user. These are not meant to be + * run as tests and testing of hovering must be done manually. + * + * The actual types and typed returns are tested in products.test-d.ts via Vitest type checking, + * these are simply hovering tooltip tests. + * + * This cannot be achieved in test.each() tests because the way .each() is typed, it will show all + * possible return types at once, which is not helpful for the end user. + * + * We cannot use expectTypeOf() because it will not work with test.each() tests in the same + * file, and expectTypeOf() will not show the IDE tooltips as a user would see them. + * + * Order of `Results` keys does not matter, only that they are all present with no extraneous + * keys. + ******************************/ +describe.skip('IDE Tooltips - manual test of results type on hover', async () => { + test('/products/vehicle/modelYears', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + modelYear: string; + }[]; + } + ******************************/ + const result_1 = await products(issueType) + const result_2 = await products(issueType, undefined) + const result_3 = await products(issueType, {}) + const result_4 = await products(issueType, {}, true) + const result_5 = await products(issueType, {}, undefined) + const result_6 = await products(issueType, true) + const result_7 = await products(issueType, undefined, true) + const result_8 = await products(issueType, undefined, undefined) + + for (const result of [ + result_1, + result_2, + result_3, + result_4, + result_5, + result_6, + result_7, + result_8, + ]) { + expect(result) + } + }) + + test('/products/vehicle/makes', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + modelYear: string; + make: string; + }[]; + } + ******************************/ + const result_1 = await products(issueType, { modelYear: modelYearString }) + const result_2 = await products(issueType, { modelYear: modelYearNumber }) + const result_3 = await products(issueType, { modelYear }, true) + const result_4 = await products(issueType, { modelYear }, undefined) + + for (const result of [result_1, result_2, result_3, result_4]) { + expect(result) + } + }) + + test('/products/vehicle/models', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + modelYear: string; + make: string; + model: string; + }[]; + } + ******************************/ + const result_1 = await products(issueType, { modelYear, make }) + const result_2 = await products(issueType, { modelYear, make }, true) + const result_3 = await products(issueType, { modelYear, make }, undefined) + + for (const result of [result_1, result_2, result_3]) { + expect(result) + } + }) + + test('returns a string if doFetch = false', async () => { + /******Expected Tooltip*******\ + const result_x: string + ******************************/ + const result_1 = await products(issueType, false) + const result_2 = await products(issueType, undefined, false) + const result_3 = await products(issueType, {}, false) + const result_4 = await products( + issueType, + { modelYear: modelYearString }, + false + ) + const result_5 = await products( + issueType, + { modelYear: modelYearNumber }, + false + ) + const result_6 = await products(issueType, { modelYear, make }, false) + + for (const result of [ + result_1, + result_2, + result_3, + result_4, + result_5, + result_6, + ]) { + expect(result) + } + }) +}) diff --git a/packages/lib/src/api/products/products.ts b/packages/lib/src/api/products/products.ts new file mode 100644 index 00000000..66a01ed7 --- /dev/null +++ b/packages/lib/src/api/products/products.ts @@ -0,0 +1,540 @@ +/** + * @module api/products + * @category API - Products + */ + +import { useNHTSA } from '@/api' +import { + catchInvalidArguments, + encodeQueryStringParams, + rejectWithError, +} from '@/utils' +import type { + NhtsaResponse, + NoExtraProperties, + QueryStringParamsEncoded, +} from '@/types' + +/** + * # Products API + * + * ::: tip :bulb: More Information + * See: [Products Documentation] /guide/products + * ::: + * + * You can use `products()` as a thin wrapper for the `NHTSA Products API` to get model years, + * makes, and models available in the datasets of the `Recalls` and `Complaints` APIs. + * + * The `products()` function is used by the `recalls()` and `complaints()` functions to get + * model years, makes, and models based on query `issueType=r` or `issueType=c` to then query for + * recalls or complaints based on a specific model year, make, and model. + * + * This function is designed to handle all of the different possible workflows and return the + * correct data/url for each one, all depending on which options you pass to the function. In this + * sense it is a single universal function that can handle the entirety of the Products API. + * + * There is no information about the Products API available in the + * [Official NHTSA APIs Documentation](https://www.nhtsa.gov/nhtsa-datasets-and-apis), other than + * the use of the Products API in the context of the Recalls API and Complaints API. + * + * ## Issue Type + * + * The Products API uses the `?issueType={issueType}` query string to get different data. This + * function uses the `issueType` passed as the first argument to build the correct url path and + * query string. + * + * `issueType` is required and must be one of the following strings: + * + * - `'recalls'` or `'r'` - recalls + * - `'complaints'` or `'c'` - complaints + * + * Example with `issueType`: + * ```js + * products('recalls') + * ``` + * + * Example with `issueType` and some `options`: + * ```js + * products('recalls', { modelYear: 2013, make: 'Honda' }) + * ``` + * + * ## Options + * + * The Products API uses a path and query string to get different data. This function uses the + * options passed to build the correct url path and portions of the query string. + * + * Valid `options` are: + * + * - `modelYear` - Model Year of the vehicle to search for + * - `make` - Make of the vehicle to search for + * + * All are optional and the only valid options you can pass to this function. + * + * Valid `options` combinations: + * + * - `products(issueType)` + * - `products(issueType, {})` + * - `products(issueType, { modelYear })` + * - `products(issueType, { modelYear, make })` + * + * Real Example URLs - with issueType `r`: + * - https://api.nhtsa.gov/products/vehicle/modelYears?issueType=r + * - https://api.nhtsa.gov/products/vehicle/makes?modelYear=2020&issueType=r + * - https://api.nhtsa.gov/products/vehicle/models?modelYear=2020&make=Volkswagen&issueType=r + * + * Real Example URLs - with issueType `c`: + * - https://api.nhtsa.gov/products/vehicle/modelYears?issueType=c + * - https://api.nhtsa.gov/products/vehicle/makes?modelYear=2020&issueType=c + * - https://api.nhtsa.gov/products/vehicle/models?modelYear=2020&make=Volkswagen&issueType=c + * + * Note that `format=json` will always be appended to the query string when using this package, even + * though it is not required by the Products APIs. + * + * Response data will be structured as `{ Count, Message, Results }` for any combination of options. + * + * See the `Returns` section below for more details. + * + * ## Rules + * + * There are several rules to follow when using this API or you will errors from the NHTSA API. + * + * 1. You must provide an `issueType`. + * 2. If you provide a `make` then you must also provide a `modelYear`. + * + * Consequences of breaking the rules: + * + * - Rule #1 - if you don't pass a valid `issueType` you will get some data back, but it will be + * invalid and not what you expect. This function also enforces this rule internally and will throw + * an `Error` if you pass an invalid `issueType`. + * - Rule #2 - this function will throw an `Error` as a fail safe to prevent you from getting a + * 404 network error from the NHTSA API. + * + * There will also be TypeScript errors if you pass invalid options or invalid combinations of + * options. + * + * To clarify, this function will `throw Error`s in the following cases: + * + * - If you pass an invalid or no `issueType`. + * - If you pass options not listed above. + * - If you pass an invalid combination of options. + * - If you pass a valid combination of options but include options not listed above. + * + * ## Usage + * + * The following describes in more detail the use of the different options and the paths they use. + * + * ### Get All Model Years + * + * Get all available model years in the recalls or complaints dataset, based on the `issueType`. + * + * If you pass no options, an empty object `{}`, `undefined`, or `true` as options, the + * path and query string: `/products/vehicle/modelYears?issueType={issueType}` will be used. + * + * Example: Get a list of available model years in the recalls dataset + * ```js + * await products('r').then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "2024", "2023", "2022", etc + * }) + * }) + * + * // Or use doFetch = false to get the url string instead of fetching the data + * const url = await products('r', false) + * console.log(url) + * // "https://api.nhtsa.gov/products/vehicle/modelYears?issueType=r&format=json" + * ``` + * + * ### Get Makes for Model Year + * + * Get all available makes in the recalls or complaints dataset, based on the `issueType`, for a + * specific `modelYear`. + * + * If you pass a `modelYear` as the only option, the path and query string + * `/products/vehicle/makes?modelYear={modelYear}&issueType={issueType}` will be used. + * + * Example: Get a list of available makes for the 2013 model year in the recalls dataset + * ```js + * await products('r', { modelYear: 2013 }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "ACURA", "AUDI", "BENTLEY", etc. + * console.log(result.make) // "JETTA", "ACCORD", etc. + * }) + * }) + * + * // Or use doFetch = false to get the url string instead of fetching the data + * const url = await products('r', { modelYear: 2013 }, false) + * console.log(url) + * // "https://api.nhtsa.gov/products/vehicle/makes?modelYear=2013&issueType=r&format=json" + * ``` + * + * If you need to get all available model years, first call the function with no options. + * + * ### Get Models for Make + * + * Get all available models in the recalls or complaints dataset, based on the `issueType` for a + * specific `modelYear` and `make`. + * + * If you pass a `modelYear` and `make` as options, the path and query string + * `/products/vehicle/models?modelYear={modelYear}&make={make}&issueType={issueType}` will be used. + * + * Example: Get a list of available models for a 2013 Honda in the recalls dataset + * ```js + * await products('r', { modelYear: 2013, make: 'Honda' }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "2013" + * console.log(result.make) // "HONDA" + * console.log(result.model) // "ACCORD", "CIVIC", etc. + * }) + * }) + * + * // Or use doFetch = false to get the url string instead of fetching the data + * const url = await products('r', { modelYear: 2013, make: 'Honda' }, false) + * console.log(url) + * // "https://api.nhtsa.gov/products/vehicle/models?modelYear=2013&make=Honda&issueType=r&format=json" + * ``` + * + * If you need to get makes for a particular model year, first call the function with `modelYear` as + * the only option to get all of the available makes. + * + * ## Returns + * + * The return from this function will be a parsed JSON response, typed to reflect the different + * types of objects you can expect to get back from the API in the `Results[]`. + * + * Returned data will be structured as `{ Count, Message, Results }`. + * + * The direct response from the Products API is an object with the following properties: + * - `count` - The number of results returned + * - `message` - A message from the NHTSA API + * - `results` - An array of objects containing the response data + * + * In order to keep parity with the other APIs and make it easier to type the responses, this + * function will return the data as an object with the properties uppercased: + * - `Count` - The number of results returned + * - `Message` - A message from the NHTSA API + * - `Results` - An array of objects containing the response data + * + * The `Results[]` will be typed based on the `options` passed to the function. + * + * - See type `ProductsResultsData` for a list of all possible properties. + * - See type `ProductsResultsByVariant` for clarity on which properties will be included in the + * `Results[]` based on the `options` passed. + * + * + * @param issueType - Issue Type to search ('r' | 'recalls' | 'c' | 'complaints') - Required + * @param [options] - Object of options, fetch data from the API depending on options passed + * @param [options.modelYear] - Model Year of the vehicle to search for + * @param [options.make] - Make of the vehicle to search for + * @param [doFetch=true] - If false, will return the url string instead of fetching the data + * @returns NHTSA Api Response `object` + */ +function products>( + issueType: ProductsIssueType, + options: NoInvalidOptions, + doFetch?: true +): Promise> +function products>( + issueType: ProductsIssueType, + options: NoInvalidOptions | undefined, + doFetch: false +): Promise +function products( + issueType: ProductsIssueType, + doFetch?: true +): Promise> +function products(issueType: ProductsIssueType, doFetch: false): Promise +function products( + issueType: ProductsIssueType +): Promise> +function products( + issueType: ProductsIssueType, + options?: undefined, + doFetch?: true +): Promise> +function products>( + issueType: ProductsIssueType, + options?: NoInvalidOptions | boolean, + doFetch?: boolean +): Promise +/* Implementation */ +async function products( + issueType: ProductsIssueType, + options?: NoInvalidOptions | boolean, + doFetch: boolean = true +): Promise { + const endpointName = 'products' + + try { + let path = '' + let encodedParams: QueryStringParamsEncoded = {} + + if (typeof options === 'boolean') { + /* If first argument is boolean, it is doFetch */ + doFetch = options + /* Set options undefined so it will pass argument check below, otherwise invalid type */ + options = undefined + } + + catchInvalidArguments({ + args: [ + { + name: 'issueType', + value: issueType, + required: true, + types: ['string'], + }, + { + name: 'options', + value: options, + types: ['object'], + validKeys: ['modelYear', 'make'], + }, + { + name: 'modelYear', + value: options?.modelYear, + types: ['string', 'number'], + requiredBy: [{ name: 'make', value: options?.make }], + }, + { + name: 'make', + value: options?.make, + types: ['string'], + }, + ], + }) + + /* Throw an error if issueType is not 'r' 'recalls' 'c' or 'complaints' */ + if (!['r', 'recalls', 'c', 'complaints'].includes(issueType)) { + throw new Error( + `Invalid argument issueType: ${issueType}. + Valid issueTypes are: 'r', 'recalls', 'c', 'complaints'` + ) + } + + /* Convert 'recalls' or 'complaints' to 'c' or 'r' */ + issueType = + issueType === 'recalls' + ? 'r' + : issueType === 'complaints' + ? 'c' + : issueType + + /* options are guaranteed to be an object by now because of catchInvalidArguments() */ + if (options) { + const { modelYear, make } = encodeQueryStringParams(options) + encodedParams = { modelYear, make } + + /* Build the API URL path */ + if (modelYear && make) path = `vehicle/models` + else if (modelYear) path = `vehicle/makes` + } + + /* If there were no options passed, then path should still be vehicle/modelYears */ + if (!path) path = `vehicle/modelYears` + + const { get, createCachedUrl, getCachedUrl } = useNHTSA() + + createCachedUrl({ + apiType: 'products', + endpointName, + path, + params: { ...encodedParams, issueType }, + }) + + if (!doFetch) { + return getCachedUrl() + } else { + return get() + } + } catch (error) { + return rejectWithError(error) + } +} + +export { products } + +/** + * These types have to be kept together with the function in the same file. + * + * This is so Intellisense will show the full type contents of the return to the end user when they + * save the results to a variable and then hover over that variable. If these types are moved to + * another file, Intellisense will only show the type name, not the full type contents for the + * products() NhstaResponse return type. + * + * Any type that is used directly in the function overloads and not in this file will cause this. + * So, theoretically, you could move all of those types here and the others live in their own file, + * but that would spread the types out and they are only used here and in the tests, so it makes + * sense to keep them together. + */ + +/** All possible issue type strings */ +export type ProductsIssueType = 'c' | 'complaints' | 'r' | 'recalls' + +/** + * All valid options for the `products()` function + */ +export type ProductsOptionsBase = { + modelYear?: string | number + make?: string +} + +/** + * Options to get all available `modelYear`s for the `issueType` passed to the `products()` function. + * + * Builds path: `/products/vehicle/modelYears?issueType={issueType}` + */ +export type ProductsOptionsEmpty = { + modelYear?: undefined + make?: undefined +} + +/** + * Options to get all available `make`s for the `options.modelYear` and `issueType` passed to the + * `products()` function. + * + * Builds path: `/products/vehicle/makes?modelYear={modelYear}&issueType={issueType}` + */ +export type ProductsOptionsModelYear = { + modelYear: string | number + make?: undefined +} + +/** + * Options to get all available `model`s for the `options.modelYear`, `options.make`, and + * `issueType` passed to the `products()` function. + * + * Builds path: `/products/vehicle/models?modelYear={modelYear}&make={make}&issueType={issueType}` + */ +export type ProductsOptionsMake = { + modelYear: string | number + make: string +} + +/** + * All valid options combinations for the `products()` function + */ +export type ProductsOptions = + | ProductsOptionsEmpty + | ProductsOptionsModelYear + | ProductsOptionsMake + +/** + * Ensures only valid options are passed to the `products()` function + */ +export type NoInvalidOptions = NoExtraProperties< + ProductsOptionsBase, + T +> + +/** + * Variant names used to type the `Results[]` of the `Products API` response based on the + * `options` passed to the function. `ProductsResultsData` will be Pick<>ed based on the Variant + * name. + */ +export type ProductsResultsVariant = + | 'getModelYears' + | 'getMakes' + | 'getModels' + | 'default' + +/** + * All possible properties and their value types, found in the `Results[]` objects of the + * `Products API` response. This is typed with all properties optional so it can be used to + * type the `Results[]` based on `options` passed to the `products()` function. + * + * For `ProductsResultsVariant` equal to `'getModels'` will have all properties defined, all other + * Variants will only have some properties defined. + */ +export type ProductsResultsData = { + modelYear?: string + make?: string + model?: string +} + +/** + * This is typed with Pick<> so the user can see the actual type of the `Results[]` objects when + * they hover over the variable they saved the response to. Anything less verbose hides the + * `Results[]` behind a type name and the user has to go look at the type definition to see what the + * actual keys of the Results array objects are. They could of course just hit ctrl+enter to have + * auto complete show them the keys, but this is more user friendly. + */ +/** + * Types the `Results[]` of the `Products API` response based on the `ProductResultsVariant` passed + * to this type. + * + * Used to type no options or `undefined` options as the second arg passed to `products()`. + * + * Also used in .test-d.ts files to easily match the expected return type of the function. + */ +export type ProductsResultsByVariant = + /* Pick<> ProductsResultsData based on Variant string */ + Variant extends 'getModelYears' + ? /* Path /vehicle/modelYears */ + { + [K in keyof Pick< + ProductsResultsData, + 'modelYear' + >]-?: ProductsResultsData[K] + } + : Variant extends 'getMakes' + ? /* Path /vehicle/makes */ + { + [K in keyof Pick< + ProductsResultsData, + 'modelYear' | 'make' + >]-?: ProductsResultsData[K] + } + : Variant extends 'getModels' + ? /* Path /vehicle/models - all properties defined */ + { + [K in keyof ProductsResultsData]-?: ProductsResultsData[K] + } + : /* fallback default value - all optional properties */ + ProductsResultsData + +/** + * Types the `Results[]` of the `Products API` response based on the `options` passed to the + * `products()` function. + */ +export type ProductsResultsByOptions = + Options extends ProductsOptionsModelYear + ? ProductsResultsByVariant<'getMakes'> + : Options extends ProductsOptionsMake + ? ProductsResultsByVariant<'getModels'> + : Options extends ProductsOptionsEmpty + ? ProductsResultsByVariant<'getModelYears'> + : ProductsResultsByVariant<'default'> + +/** + * Types the return of the `products()` function based on the type of `ProductsOptions` passed to + * this type, inferred from the `options` passed to the function. + * + * This type represents the complete parsed API response. + * + * The `Results[]` objects will be typed based on the `options` passed to the function. + */ +export type ProductsResponseByOptions = + NhtsaResponse, 'products'> + +/** + * Types the return of the `products()` function based on the `ProducsResultsVariant` passed to this + * type. + * + * This type represents the complete parsed API response. + * + * The `Results[]` objects will be typed based on the `ProductsResultsVariant` passed to this type. + */ +export type ProductsResponseByVariant< + Variant extends ProductsResultsVariant = 'default', +> = NhtsaResponse, 'products'> + +/** + * This is the generic type of the parsed API response and is only meant to be a fallback type. + * + * The `Results[]` will be typed as `ProductsResultsData`, which is all possible properties + * found in the Results objects of `Products API` paths, with all marked as optional + * properties that could be undefined. + */ +export type ProductsResponse = NhtsaResponse diff --git a/packages/lib/src/api/products/types.ts b/packages/lib/src/api/products/types.ts new file mode 100644 index 00000000..020ed797 --- /dev/null +++ b/packages/lib/src/api/products/types.ts @@ -0,0 +1,20 @@ +/** + * @module api/products/types + * @category Types + */ + +export type { + ProductsIssueType, + ProductsOptions, + ProductsOptionsBase, + ProductsOptionsEmpty, + ProductsOptionsMake, + ProductsOptionsModelYear, + ProductsResponse, + ProductsResponseByOptions, + ProductsResponseByVariant, + ProductsResultsByOptions, + ProductsResultsByVariant, + ProductsResultsData, + ProductsResultsVariant, +} from './products' diff --git a/packages/lib/src/api/recalls/__tests__/recalls.test-d.ts b/packages/lib/src/api/recalls/__tests__/recalls.test-d.ts new file mode 100644 index 00000000..409208e4 --- /dev/null +++ b/packages/lib/src/api/recalls/__tests__/recalls.test-d.ts @@ -0,0 +1,780 @@ +import { describe, expectTypeOf, test } from 'vitest' + +import { + recalls, + type RecallsOptions, + type RecallsOptionsCampaignNumber, + type RecallsOptionsEmpty, + type RecallsOptionsMake, + type RecallsOptionsModelYear, + type RecallsOptionsVehicle, + type RecallsResponseByOptions, + type RecallsResponseByVariant, +} from '../recalls' + +const modelYearString = '2020' +const modelYearNumber = 2020 +const modelYear = modelYearNumber +const make = 'Volkswagen' +const model = 'Atlas' +const campaignNumber = '20V505000' + +test('Typecheck: recalls() - parameters - ', () => { + expectTypeOf().toBeFunction() + expectTypeOf().parameters.toMatchTypeOf< + [ + options?: boolean | RecallsOptions | undefined, + doFetch?: boolean | undefined, + ] + >() +}) + +describe('Typecheck: recalls() - return correct type of response data - ', () => { + /***************************** + * doFetch = true | undefined (default) + ****************************/ + test('with no arguments', async () => { + const result = await recalls() + + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with no options and doFetch = true', async () => { + const result = await recalls(true) + + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with undefined as first argument', async () => { + const result = await recalls(undefined) + + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with undefined as first argument and doFetch = true', async () => { + const result = await recalls(undefined, true) + + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with undefined as both arguments', async () => { + const result = await recalls(undefined, undefined) + + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with empty object as first argument', async () => { + const result = await recalls({}) + + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with empty object as first argument and doFetch = true', async () => { + const result = await recalls({}, true) + + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with options.modelYear as string', async () => { + const result = await recalls({ modelYear: modelYearString }) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with options.modelYear as string and doFetch = true', async () => { + const result = await recalls({ modelYear: modelYearString }, true) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with options.modelYear as number', async () => { + const result = await recalls({ modelYear: modelYearNumber }) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with options.modelYear as number and doFetch = true', async () => { + const result = await recalls({ modelYear: modelYearNumber }, true) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with options.make', async () => { + const result = await recalls({ modelYear, make }) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with options.make and doFetch = true', async () => { + const result = await recalls({ modelYear, make }, true) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with options.model', async () => { + const result = await recalls({ modelYear, make, model }) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with options.model and doFetch = true', async () => { + const result = await recalls({ modelYear, make, model }, true) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with options.campaignNumber', async () => { + const result = await recalls({ campaignNumber }) + + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) + + test('with options.campaignNumber and doFetch = true', async () => { + const result = await recalls({ campaignNumber }, true) + + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByVariant<'campaignNumber'> + >() + expectTypeOf(result).toEqualTypeOf< + RecallsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + RecallsResponseByOptions + >() + }) +}) + +describe('Typecheck: recalls() - returns type string if doFetch = false - ', () => { + /***************************** + * doFetch = false + ****************************/ + test('with doFetch = false', async () => { + expectTypeOf(await recalls(false)).toEqualTypeOf() + }) + + test('with undefined as first argument and doFetch = false', async () => { + expectTypeOf(await recalls(undefined, false)).toEqualTypeOf() + }) + + test('with empty object as first argument and doFetch = false', async () => { + expectTypeOf(await recalls({}, false)).toEqualTypeOf() + }) + + test('with options.modelYear as string and doFetch = false', async () => { + expectTypeOf( + await recalls({ modelYear: modelYearString }, false) + ).toEqualTypeOf() + }) + + test('with options.modelYear as number and doFetch = false', async () => { + expectTypeOf( + await recalls({ modelYear: modelYearNumber }, false) + ).toEqualTypeOf() + }) + + test('with options.make and doFetch = false', async () => { + expectTypeOf( + await recalls({ modelYear, make }, false) + ).toEqualTypeOf() + }) + + test('with options.model and doFetch = false', async () => { + expectTypeOf( + await recalls({ modelYear, make, model }, false) + ).toEqualTypeOf() + }) + + test('with options.campaignNumber and doFetch = false', async () => { + expectTypeOf( + await recalls({ campaignNumber }, false) + ).toEqualTypeOf() + }) +}) diff --git a/packages/lib/src/api/recalls/__tests__/recalls.test.ts b/packages/lib/src/api/recalls/__tests__/recalls.test.ts new file mode 100644 index 00000000..e3d2d938 --- /dev/null +++ b/packages/lib/src/api/recalls/__tests__/recalls.test.ts @@ -0,0 +1,712 @@ +import { beforeEach, describe, expect, test } from 'vitest' +import { recalls } from '../recalls' + +// Mocks +import { createMockResponse } from '.vitest/helpers' +import { mockResults } from '.vitest/data' + +const modelYearString = '2020' +const modelYearNumber = 2020 +const modelYear = modelYearNumber +const make = 'Volkswagen' +const model = 'Atlas' +const campaignNumber = '20V505000' + +// Use Products API: +// https://api.nhtsa.gov/products/vehicle/modelYears?issueType=r +// https://api.nhtsa.gov/products/vehicle/makes?modelYear={modelYear}&issueType=r +// https://api.nhtsa.gov/products/vehicle/models?modelYear={modelYear}&make={make}&issueType=r + +// Use Recalls API +// https://api.nhtsa.gov/recalls/recallsByVehicle?modelYear={modelYear}&make={make}&model={model} +// https://api.nhtsa.gov/recalls/campaignNumber?campaignNumber={campaignNumber} + +const baseUrlProducts = 'https://api.nhtsa.gov/products/vehicle' +const baseUrl = 'https://api.nhtsa.gov/recalls' +const mockUrlBase = `${baseUrlProducts}/modelYears?issueType=r&format=json` +const mockUrlModelYear = `${baseUrlProducts}/makes?modelYear=${modelYear}&issueType=r&format=json` +const mockUrlMake = `${baseUrlProducts}/models?modelYear=${modelYear}&make=${make}&issueType=r&format=json` +const mockUrlVehicle = `${baseUrl}/recallsByVehicle?modelYear=${modelYear}&make=${make}&model=${model}&format=json` +const mockUrlCampaignNumber = `${baseUrl}/campaignNumber?campaignNumber=${campaignNumber}&format=json` + +const expectedFetchOptions = { + saveUrl: true, + method: 'GET', +} + +type TestEach = { + description: string + args: Parameters + expectedUrl: string +} + +describe('recalls()', () => { + beforeEach(() => { + fetchMock.resetMocks() + fetchMock.mockResolvedValue(createMockResponse(mockResults)) + }) + + test('Is a function that returns a Promise', () => { + expect(recalls).toBeDefined() + expect(recalls).toBeInstanceOf(Function) + expect(recalls()).toBeInstanceOf(Promise) + }) + + /***************************** + * doFetch = true (default) + ****************************/ + describe('Fetches API data with: ', () => { + test.each([ + // no arguments, empty object, undefined - returns all available model years + { description: 'no arguments', args: [], expectedUrl: mockUrlBase }, + { + description: 'doFetch = true as first argument', + args: [true], + expectedUrl: mockUrlBase, + }, + { + description: 'undefined as first argument', + args: [undefined], + expectedUrl: mockUrlBase, + }, + { + description: 'undefined as first argument and doFetch = true', + args: [undefined, true], + expectedUrl: mockUrlBase, + }, + { + description: 'empty object as first argument', + args: [{}], + expectedUrl: mockUrlBase, + }, + { + description: 'empty object as first argument and doFetch = true', + args: [{}, true], + expectedUrl: mockUrlBase, + }, + // options.modelYear + { + description: 'options.modelYear as string', + args: [{ modelYear: modelYearString }], + expectedUrl: mockUrlModelYear, + }, + { + description: 'options.modelYear as string and doFetch = true', + args: [{ modelYear: modelYearString }, true], + expectedUrl: mockUrlModelYear, + }, + { + description: 'options.modelYear as number', + args: [{ modelYear: modelYearNumber }], + expectedUrl: mockUrlModelYear, + }, + { + description: 'options.modelYear as number and doFetch = true', + args: [{ modelYear: modelYearNumber }, true], + expectedUrl: mockUrlModelYear, + }, + // options.make + { + description: 'options.make', + args: [{ modelYear, make }], + expectedUrl: mockUrlMake, + }, + { + description: 'options.make and doFetch = true', + args: [{ modelYear, make }, true], + expectedUrl: mockUrlMake, + }, + // options.model + { + description: 'options.model', + args: [{ modelYear, make, model }], + expectedUrl: mockUrlVehicle, + }, + { + description: 'options.model and doFetch = true', + args: [{ modelYear, make, model }, true], + expectedUrl: mockUrlVehicle, + }, + // options.campaignNumber + { + description: 'options.campaignNumber', + args: [{ campaignNumber }], + expectedUrl: mockUrlCampaignNumber, + }, + { + description: 'options.campaignNumber and doFetch = true', + args: [{ campaignNumber }, true], + expectedUrl: mockUrlCampaignNumber, + }, + { + description: + 'with options.campaignNumber as undefined and other valid options', + args: [ + { + campaignNumber: undefined, + modelYear, + make, + model, + }, + ], + expectedUrl: mockUrlVehicle, + }, + { + description: + 'with options.campaignNumber as undefined and other valid options and doFetch = true', + args: [ + { + campaignNumber: undefined, + modelYear, + make, + model, + }, + true, + ], + expectedUrl: mockUrlVehicle, + }, + ])('$description', async ({ args, expectedUrl }) => { + const results = await recalls(...args) + expect(results).toEqual(mockResults) + expect(fetchMock).toHaveBeenCalledWith(expectedUrl, expectedFetchOptions) + expect(fetchMock.requests().length).toEqual(1) + expect(fetchMock.requests()[0].url).toEqual(expectedUrl) + expect(fetchMock.requests()[0].method).toEqual('GET') + }) + + test('with options.campaignNumber and other valid options = TS Errors', async () => { + const results = await recalls({ + campaignNumber, + // @ts-expect-error Type 'string' is not assignable to type 'undefined'. + modelYear, + // @ts-expect-error Type 'string' is not assignable to type 'undefined'. + make, + // @ts-expect-error Type 'string' is not assignable to type 'undefined'. + model, + }) + + expect(results).toEqual(mockResults) + expect(fetchMock).toHaveBeenCalledWith( + mockUrlCampaignNumber, + expectedFetchOptions + ) + expect(fetchMock.requests().length).toEqual(1) + expect(fetchMock.requests()[0].url).toEqual(mockUrlCampaignNumber) + expect(fetchMock.requests()[0].method).toEqual('GET') + }) + }) + + /***************************** + * doFetch = false + ***************************/ + describe('Returns API URL string with: ', () => { + test.each([ + { + description: 'doFetch = false as first argument', + args: [false], + expectedUrl: mockUrlBase, + }, + { + description: 'undefined as first argument and doFetch = false', + args: [undefined, false], + expectedUrl: mockUrlBase, + }, + { + description: 'empty object and doFetch = false', + args: [{}, false], + expectedUrl: mockUrlBase, + }, + // options.modelYear + { + description: 'options.modelYear as string and doFetch = false', + args: [{ modelYear: modelYearString }, false], + expectedUrl: mockUrlModelYear, + }, + { + description: 'options.modelYear as number and doFetch = false', + args: [{ modelYear: modelYearNumber }, false], + expectedUrl: mockUrlModelYear, + }, + // options.make + { + description: 'options.make and doFetch = false', + args: [{ modelYear, make }, false], + expectedUrl: mockUrlMake, + }, + // options.model + { + description: 'options.model and doFetch = true', + args: [{ modelYear, make, model }, false], + expectedUrl: mockUrlVehicle, + }, + // options.campaignNumber + { + description: 'options.campaignNumber and doFetch = false', + args: [{ campaignNumber }, false], + expectedUrl: mockUrlCampaignNumber, + }, + { + description: + 'with options.campaignNumber as undefined and other valid options and doFetch = false', + args: [ + { + campaignNumber: undefined, + modelYear, + make, + model, + }, + false, + ], + expectedUrl: mockUrlVehicle, + }, + ])('$description', async ({ args, expectedUrl }) => { + const results = await recalls(...args) + + expect(results).toEqual(expectedUrl) + expect(fetchMock.requests().length).toEqual(0) + }) + }) + + /***************************** + * rejects with error + ***************************/ + describe('Rejects with Error if: ', () => { + test.each(['string', 123, ['array'], null, () => {}])( + 'options is neither an object nor boolean, <%s>', + async (arg) => { + await expect(() => + // @ts-expect-error Type (x) is not assignable to type ... + recalls(arg) + ).rejects.toThrowError( + /error validating argument named "options", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([{ object: 123 }, ['array'], true, false, null, () => {}])( + 'options.modelYear is neither a string nor number, <%s>', + async (arg) => { + await expect(() => + recalls({ + // @ts-expect-error Type (x) is not assignable to type 'string | number | undefined + modelYear: arg, + }) + ).rejects.toThrowError( + /error validating argument named "modelYear", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([123, { object: 123 }, ['array'], true, false, null, () => {}])( + 'options.make is not a string, <%s>', + async (arg) => { + await expect(() => + recalls({ + modelYear, + // @ts-expect-error Type (x) is not assignable to type 'string | undefined + make: arg, + }) + ).rejects.toThrowError( + /error validating argument named "make", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([123, { object: 123 }, ['array'], true, false, null, () => {}])( + 'options.model is not a string, <%s>', + async (arg) => { + await expect(() => + recalls({ + modelYear, + make, + // @ts-expect-error Type (x) is not assignable to type 'string | undefined + model: arg, + }) + ).rejects.toThrowError( + /error validating argument named "model", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([123, { object: 123 }, ['array'], true, false, null, () => {}])( + 'options.campaignNumber is not a string <%s>', + async (arg) => { + await expect(() => + recalls({ + // @ts-expect-error Type (x) is not assignable to type 'string | undefined + campaignNumber: arg, + }) + ).rejects.toThrowError( + /error validating argument named "campaignNumber", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test('options.make is provided but not options.modelYear', async () => { + await expect(() => + // @ts-expect-error Properties 'modelYear' and 'model' are missing but required in type + recalls({ + make, + }) + ).rejects.toThrowError( + /error validating argument named "modelYear", it is required if "make"/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('options.model is provided but not options.modelYear', async () => { + await expect(() => + // @ts-expect-error Property 'modelYear' is missing but required in type + recalls({ + make, + model, + }) + ).rejects.toThrowError( + /error validating argument named "modelYear", it is required if "model"/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('options.model is provided but not options.make', async () => { + await expect(() => + // @ts-expect-error Property 'make' is missing but required in type + recalls({ + modelYear, + model, + }) + ).rejects.toThrowError( + /error validating argument named "make", it is required if "model"/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options', async () => { + await expect(() => + recalls({ + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and doFetch = true', async () => { + await expect(() => + recalls( + { + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + }, + true + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and doFetch = false', async () => { + await expect(() => + recalls( + { + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + }, + false + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and wrong type for valid options', async () => { + await expect(() => + recalls({ + notAnOption: 'no TS error, campaignNumber error takes precedence', + // @ts-expect-error Type 'never[]' is not assignable to type 'string | undefined' + campaignNumber: [], + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options', async () => { + await expect(() => + recalls({ + // @ts-expect-error Type 'string' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options and doFetch = true', async () => { + await expect(() => + recalls( + { + // @ts-expect-error Type 'string' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + make, + }, + true + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options and doFetch = false', async () => { + await expect(() => + recalls( + { + // @ts-expect-error Type 'string' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + make, + model, + }, + false + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and all valid options', async () => { + await expect(() => + recalls({ + notAnOption: 'no TS error, campaignNumber TS error takes precedence', + modelYear, + make, + model, + // @ts-expect-error Type 'number' is not assignable to type 'undefined' + campaignNumber: 123, + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + }) +}) + +/******************************* + * These are here to test the IDE intellisense tooltips when hovering the function and results, + * to ensure the correct types are displayed for the end user. These are not meant to be + * run as tests and testing of hovering must be done manually. + * + * The actual types and typed returns are tested in recalls.test-d.ts via Vitest type checking, + * these are simply hovering tooltip tests. + * + * This cannot be achieved in test.each() tests because the way .each() is typed, it will show all + * possible return types at once, which is not helpful for the end user. + * + * We cannot use expectTypeOf() because it will not work with test.each() tests in the same + * file, and expectTypeOf() will not show the IDE tooltips as a user would see them. + * + * Order of `Results` keys does not matter, only that they are all present with no extraneous + * keys. + ******************************/ +describe.skip('IDE Tooltips - manual test of results type on hover', async () => { + test('/products/vehicle/modelYears', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + modelYear: string; + }[]; + } + ******************************/ + const result_1 = await recalls() + const result_2 = await recalls(undefined) + const result_3 = await recalls({}) + const result_4 = await recalls({}, true) + const result_5 = await recalls({}, undefined) + const result_6 = await recalls(true) + const result_7 = await recalls(undefined, true) + const result_8 = await recalls(undefined, undefined) + + for (const result of [ + result_1, + result_2, + result_3, + result_4, + result_5, + result_6, + result_7, + result_8, + ]) { + expect(result) + } + }) + + test('/products/vehicle/makes', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + modelYear: string; + make: string; + }[]; + } + ******************************/ + const result_1 = await recalls({ modelYear: modelYearString }) + const result_2 = await recalls({ modelYear: modelYearNumber }) + const result_3 = await recalls({ modelYear }, true) + const result_4 = await recalls({ modelYear }, undefined) + + for (const result of [result_1, result_2, result_3, result_4]) { + expect(result) + } + }) + + test('/products/vehicle/models', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + modelYear: string; + make: string; + model: string; + }[]; + } + ******************************/ + const result_1 = await recalls({ modelYear, make }) + const result_2 = await recalls({ modelYear, make }, true) + const result_3 = await recalls({ modelYear, make }, undefined) + + for (const result of [result_1, result_2, result_3]) { + expect(result) + } + }) + + test('/recalls/recallsByVehicle', async () => { + /******Expected Tooltip*******\ + const result_x: { + Manufacturer: string; + NHTSACampaignNumber: string; + parkIt: boolean; + parkOutSide: boolean; + ReportReceivedDate: string; + Component: string; + Summary: string; + Consequence: string; + Remedy: string; + Notes: string; + ModelYear: string; + Make: string; + Model: string; + } + ******************************/ + const result_1 = await recalls({ modelYear, make, model }) + const result_2 = await recalls({ modelYear, make, model }, true) + const result_3 = await recalls( + { + modelYear, + make, + model, + }, + undefined + ) + + for (const result of [result_1, result_2, result_3]) { + expect(result) + } + }) + + test('/recalls/campaignNumber', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + Manufacturer: string; + NHTSACampaignNumber: string; + parkIt: boolean; + parkOutSide: boolean; + ReportReceivedDate: string; + Component: string; + Summary: string; + Consequence: string; + Remedy: string; + Notes: string; + ModelYear: string; + Make: string; + Model: string; + PotentialNumberofUnitsAffected: number; + }[]; + } + ******************************/ + const result_1 = await recalls({ campaignNumber }) + const result_2 = await recalls({ campaignNumber }, true) + const result_3 = await recalls({ campaignNumber }, undefined) + + for (const result of [result_1, result_2, result_3]) { + expect(result) + } + }) + + test('returns a string if doFetch = false', async () => { + /******Expected Tooltip*******\ + const result_x: string + ******************************/ + const result_1 = await recalls(false) + const result_2 = await recalls(undefined, false) + const result_3 = await recalls({}, false) + const result_4 = await recalls({ modelYear: modelYearString }, false) + const result_5 = await recalls({ modelYear: modelYearNumber }, false) + const result_6 = await recalls({ modelYear, make }, false) + const result_7 = await recalls({ modelYear, make, model }, false) + const result_8 = await recalls({ campaignNumber }, false) + const result_9 = await recalls({ campaignNumber }, false) + + for (const result of [ + result_1, + result_2, + result_3, + result_4, + result_5, + result_6, + result_7, + result_8, + result_9, + ]) { + expect(result) + } + }) +}) diff --git a/packages/lib/src/api/recalls/recalls.ts b/packages/lib/src/api/recalls/recalls.ts new file mode 100644 index 00000000..d70861f9 --- /dev/null +++ b/packages/lib/src/api/recalls/recalls.ts @@ -0,0 +1,701 @@ +/** + * @module api/recalls + * @category API - Recalls + */ +import { products, useNHTSA } from '@/api' +import { + catchInvalidArguments, + encodeQueryStringParams, + rejectWithError, +} from '@/utils' +import type { + NhtsaResponse, + NoExtraProperties, + ProductsResultsByVariant, + ProductsResultsData, + QueryStringParamsEncoded, +} from '@/types' + +/** + * # Recalls API + * + * ::: tip :bulb: More Information + * See: [Recalls Documentation] /guide/recalls + * ::: + * + * You can use `recalls()` as a thin wrapper for the `NHTSA Recalls API` to get recall information + * based on a vehicle's `modelYear`, `make`, and `model` or a specific `campaignNumber`. + * + * This function is designed to handle all of the different possible workflows and return the + * correct data/url for each one, all depending on which options you pass to the function. In this + * sense it is a single universal function that can handle the entirety of the Recalls API. + * + * From the [Official Documentation](https://www.nhtsa.gov/nhtsa-datasets-and-apis#recalls): + * + * > Manufacturers who determine that a product or piece of original equipment either has a safety + * defect, or is not in compliance with federal safety standards, are required to notify NHTSA + * within five business days. NHTSA requires that manufacturers file a defect and noncompliance + * report as well as quarterly recall status reports, in compliance with Federal Regulation 49 + * (the National Traffic and Motor Safety Act) Part 573, which identifies the requirements for + * safety recalls. NHTSA stores this information and the data can be used to search for recall + * information related to specific NHTSA campaigns and product types. + * + * ## Options + * + * The Recalls API uses a path and query string to get different data. This function uses the + * options passed to build the correct url path and query string. + * + * Valid `options` are: + * + * - `modelYear` - Model Year of the vehicle to search for + * - `make` - Make of the vehicle to search for + * - `model` - Model of the vehicle to search for + * - `campaignNumber` - Campaign Number of the recall to search for + * + * All are optional and the only valid options you can pass to this function. + * + * Valid `options` combinations: + * + * These use the `Products API` to get model years, makes, and models available in the + * `Recalls API` dataset: + * - `recalls()` + * - `recalls({})` + * - `recalls({ modelYear })` + * - `recalls({ modelYear, make })` + * + * These use the `Recalls API` to get the recall data for a specific vehicle or campaign number: + * - `recalls({ modelYear, make, model })` + * - `recalls({ campaignNumber })` + * + * Real Example URLs - for options that use the `Products API`: + * - https://api.nhtsa.gov/products/vehicle/modelYears?issueType=r + * - https://api.nhtsa.gov/products/vehicle/makes?modelYear=2020&issueType=r + * - https://api.nhtsa.gov/products/vehicle/models?modelYear=2020&make=Volkswagen&issueType=r + * + * Real Example URLs - for options that use the `Recalls API`: + * - https://api.nhtsa.gov/recalls/recallsByVehicle?modelYear=2020&make=Volkswagen&model=Jetta + * - https://api.nhtsa.gov/recalls/campaignNumber?campaignNumber=20V505000 + * + * Note that `format=json` will always be appended to the query string when using this package, even + * though it is not required by the Recalls and Products APIs. + * + * Returned data will be structured as `{ Count, Message, Results }` for any combination of options. + * + * See the `Returns` section below for more details. + * + * ### Some Notes on `campaignNumber` + * + * The `campaignNumber` is found in `Results[x].NHTSACampaignNumber` with options + * `{ modelYear, make, model }` or `{ campaignNumber }`. + * + * - If you already know the `campaignNumber` you can pass `{ campaignNumber }` and directly get + * recall information for that campaign number. + * - If you don't have a `campaignNumber` number, you can pass `{ modelYear, make, model }` options + * to get the `campaignNumber`s for that particular vehicle. + * - The other paths are used if you want to get the `modelYear`s, `make`s, or `model`s + * availaible in the Recalls API dataset, so you can then use that information to get the + * `campaignNumber`s for that particular vehicle. + * + * ## Rules + * + * There are several rules to follow when using this API or you will get a network error response + * from the NHTSA API. + * + * 1. If you provide a `campaignNumber` then you cannot provide any other options. + * 2. If you provide a `make` then you must also provide a `modelYear`. + * 3. If you provide a `model` then you must also provide a `make` and `modelYear`. + * 4. You must use lowercase `recalls` in the path, it is case sensitive and will return a + * 403 forbidden error otherwise. + * + * FYI: Rules #1-3 will return a 400 Bad Request error from the NHTSA API if you break them. + * + * Consequences of breaking the rules: + * + * - Rule #1 - if passing `campaignNumber` and any other valid combination of options, this function + * will silently ignore the other options and only use the `campaignNumber`. It will _not_ throw + * an `Error` but you will get Typescript errors. + * - Rules #2 and #3 - this function will throw an `Error` as a fail safe to prevent you from + * getting a network error from the NHTSA API. + * - Rule #4 - enforced by this function internally when fetching the data or returning the URL + * string. + * + * There will also be TypeScript errors if you pass invalid options or invalid combinations of + * options. + * + * To clarify, this function will `throw Error`s in the following cases: + * + * - If you pass options not listed above. + * - If you pass an invalid combination of options. + * - If you pass a valid combination of options but include options not listed above. + * + * ## Usage + * + * The following describes in more detail the use of the different options and the paths they use. + * + * ### Get All Model Years + * + * Uses the `Products API` to get all available model years in the recalls dataset. + * + * If you pass no arguments, an empty object `{}`, `undefined`, or `true` as the first argument, the + * path and query string: `/products/vehicle/modelYears?issueType=r` will be used. + * + * Example: Get a list of available model years in the recalls dataset + * ```js + * await recalls().then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "2024", "2023", "2022", etc + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await recalls(false) + * console.log(url) // "https://api.nhtsa.gov/products/vehicle/modelYears?issueType=r&format=json" + * ``` + * + * ### Get Makes for Model Year + * + * Uses the `Products API` to get all available makes in the recalls dataset for a specific + * `modelYear`. + * + * If you pass a `modelYear` as the only option, the path and query string + * `/products/vehicle/makes?modelYear={modelYear}&issueType=r` will be used. + * + * Example: Get a list of available makes for the 2013 model year + * ```js + * await recalls({ modelYear: 2013 }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "ACURA", "AUDI", "BENTLEY", etc. + * console.log(result.make) // "JETTA", "ACCORD", etc. + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await recalls({ modelYear: 2013 }, false) + * console.log(url) + * // "https://api.nhtsa.gov/products/vehicle/makes?modelYear=2013&issueType=r&format=json" + * ``` + * + * If you need to get all available model years, first call the function with no arguments. + * + * ### Get Models for Make + * + * Uses the `Products API` to get all available models in the recalls dataset for a specific + * `modelYear` and `make`. + * + * If you pass a `modelYear` and `make` as the only options, the path and query string + * `/products/vehicle/models?modelYear={modelYear}&make={make}&issueType=r` will be used. + * + * Example: Get a list of available models for a 2013 Honda + * ```js + * await recalls({ modelYear: 2013, make: 'Honda' }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "2013" + * console.log(result.make) // "HONDA" + * console.log(result.model) // "ACCORD", "CIVIC", etc. + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await recalls({ modelYear: 2013, make: 'Honda' }, false) + * console.log(url) + * // "https://api.nhtsa.gov/products/vehicle/models?modelYear=2013&make=Honda&issueType=r&format=json" + * ``` + * + * If you need to get makes for a particular model year, first call the function with `modelYear` as + * the only option to get all of the available makes. + * + * ### Get Recalls for Year, Make, and Model + * + * Uses the `Recalls API` to get all available recalls for a specific `modelYear`, `make`, and + * `model`. + * + * If you pass a `modelYear`, `make`, and `model` as the only options, the path and query string + * `/recalls/recallsByVehicle?&modelYear={modelYear}&make={make}&model={model}` will be used. + * + * Example: Get as list of recalls for a 2013 Honda Accord + * ```js + * await recalls({ modelYear: 2013, make: 'Honda', model: 'Accord' }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.NHTSACampaignNumber) // "13V132000", "19V182000", etc. + * console.log(result.Summary) // "Honda (American Honda Motor Co.) is recalling certain..." + * console.log(result.Consequence) // "An explosion of an inflator within the driver frontal..." + * console.log(result.Remedy) // "Honda will notify owners, and dealers will replace the..." + * console.log(result.ModelYear) // "2013" + * console.log(result.Make) // "HONDA" + * console.log(result.Model) // "ACCORD" + * // ...more properties + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await recalls({ modelYear: 2013, make: 'Honda', model: 'Accord' }, false) + * console.log(url) + * // "https://api.nhtsa.gov/recalls/recallsByVehicle?modelYear=2013&make=Honda&model=Accord&format=json" + * ``` + * + * Note that there will be multiple objects in the `Results[]`, each with a different + * `NHTSACampaignNumber`, depending on how many recalls there are for that year, make, and model. + * + * You can use the `NHTSACampaignNumber` as `options.campaignNumber` to get more information about + * the specific recall and how many vehicles were affected by it. + * + * ### Get Recall Information for Campaign Number + * + * Uses the `Recalls API` to get recall information for a specific `campaignNumber`. + * + * If you pass `options.campaignNumber`, the path and query string + * `/recalls/campaignNumber?campaignNumber={campaignNumber}` will be used. + * + * All other options will be ignored if you provide `options.campaignNumber`. + * + * There could be more than one object in the `Results[]`, depending on how many different vehicles + * were affected by the recall. Each model year, make, and model affected will have it's own object + * in the `Results[]`. + * + * // Example: Get recall information for a specific campaign number + * ```js + * await recalls({ campaignNumber: '12V176000' }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.PotentialNumberofUnitsAffected) // 7600, 2230, etc. + * console.log(result.NHTSACampaignNumber) // "13V132000", "19V182000", etc. + * console.log(result.Summary) // "Honda (American Honda Motor Co.) is recalling certain 2013..." + * console.log(result.Consequence) // "An explosion of an inflator within the driver frontal..." + * console.log(result.Remedy) // "Honda will notify owners, and dealers will replace the..." + * console.log(result.ModelYear) // "2013" + * console.log(result.Make) // "HONDA" + * console.log(result.Model) // "ACCORD" + * // ...more properties + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await recalls({ campaignNumber: '12V176000' }, false) + * console.log(url) + * // "https://api.nhtsa.gov/recalls/campaignNumber?campaignNumber=12V176000&format=json" + * ``` + * + * ## Returns + * + * The return from this function will be a parsed JSON response, typed to reflect the different + * types of objects you can expect to get back from the API in the `Results[]`. + * + * Returned data will be stuctured as `{ Count, Message, Results }`. + * + * The direct response from the Recalls API is an object with the following properties: + * - `Count` - The number of results returned + * - `Message` - A message from the NHTSA API + * - `results` - An array of objects containing the response data + * + * In order to keep parity with the other APIs and make it easier to type the responses, this + * function will return the data as an object with lowercase `results` converted to uppercase: + * - `Count` - The number of results returned + * - `Message` - A message from the NHTSA API + * - `Results` - An array of objects containing the response data + * + * The `Results[]` will be typed based on the `options` passed to the function. + * + * - `{}`, `{ modelYear }`, and `{ modelYear, make }` will be typed as `ProductsResultsData` + * properties. + * - `{ modelYear, make, model }` and `{ campaignNumber }` will be typed as `RecallsResultsData` + * properties. + * + * - See types `ProductsResultsData` and `RecallsResultsData` for a list of all possible properties. + * - See type `RecallsResultsByVariant` for clarity on which properties will be included based on + * the `options` passed. + * + * @param [options] - Object of options, fetch data from the API depending on options passed + * @param [options.modelYear] - Model Year of the vehicle to search for + * @param [options.make] - Make of the vehicle to search for + * @param [options.model] - Model of the vehicle to search for + * @param [options.campaignNumber] - Campaign Number of the recall to search + * @param [doFetch=true] - If false, will return the url string instead of fetching the data + * (default: `true`) + * @returns - Parsed API response `object` -or- url `string` if `doFetch = false` + */ +function recalls>( + options: NoInvalidOptions, + doFetch?: true +): Promise> +function recalls>( + options: NoInvalidOptions | undefined, + doFetch: false +): Promise +function recalls( + options?: undefined, + doFetch?: true +): Promise> +function recalls( + doFetch?: true +): Promise> +function recalls(doFetch: false): Promise +function recalls>( + options?: NoInvalidOptions | boolean, + doFetch?: boolean +): Promise +/* Implementation */ +async function recalls( + options?: NoInvalidOptions | boolean, + doFetch: boolean = true +): Promise { + const endpointName = 'recalls' + + try { + let path = '' + let encodedParams: QueryStringParamsEncoded = {} + + if (typeof options === 'boolean') { + /* If first argument is boolean, it is doFetch */ + doFetch = options + /* Set options undefined so it will pass argument check below, otherwise invalid type */ + options = undefined + } + + /* This will also ensure we have an actual object using our custom getTypeof() function */ + catchInvalidArguments({ + args: [ + { + name: 'options', + value: options, + types: ['object'], + validKeys: ['modelYear', 'make', 'model', 'campaignNumber'], + }, + { + name: 'modelYear', + value: options?.modelYear, + types: ['string', 'number'], + requiredBy: [ + // order important for user exerience in error messages + { name: 'model', value: options?.model }, + { name: 'make', value: options?.make }, + ], + }, + { + name: 'make', + value: options?.make, + types: ['string'], + requiredBy: [{ name: 'model', value: options?.model }], + }, + { name: 'model', value: options?.model, types: ['string'] }, + { + name: 'campaignNumber', + value: options?.campaignNumber, + types: ['string'], + }, + ], + }) + + /* options are guaranteed to be an object by now because of catchInvalidArguments() */ + if (options) { + encodedParams = encodeQueryStringParams(options) + } + + const { modelYear, make, model, campaignNumber } = encodedParams + const hasVehicle = modelYear && make && model + const { get, createCachedUrl, getCachedUrl } = useNHTSA() + + /* + * Use the Recalls API if campaignNumber or full vehicle is passed + * ignores vehicle if campaignNumber exists + */ + if (campaignNumber || hasVehicle) { + if (campaignNumber) { + path = `campaignNumber` + } else if (hasVehicle) { + path = `recallsByVehicle` + } + + const params = campaignNumber + ? { campaignNumber } + : { modelYear, make, model } + + createCachedUrl({ + apiType: 'recalls', + endpointName, + path, + params, + }) + + if (!doFetch) { + return getCachedUrl() + } else { + return get() + } + } + + /* Else use the Products API */ + if (modelYear && make) return products('r', { modelYear, make }, doFetch) + if (modelYear) return products('r', { modelYear }, doFetch) + else return products('r', doFetch) + } catch (error) { + return rejectWithError(error) + } +} + +export { recalls } + +/** + * These types have to be kept together with the function in the same file. + * + * This is so Intellisense will show the full type contents of the return to the end user when they + * save the results to a variable and then hover over that variable. If these types are moved to + * another file, Intellisense will only show the type name, not the full type contents for the + * recalls() NhstaResponse return type. + * + * Any type that is used directly in the function overloads and not in this file will cause this. + * So, theoretically, you could move all of those types here and the others live in their own file, + * but that would spread the types out and they are only used here and in the tests, so it makes + * sense to keep them together. + */ + +/** + * All valid options for the `recalls()` function + */ +export type RecallsOptionsBase = { + modelYear?: string | number + make?: string + model?: string + campaignNumber?: string +} + +/** + * Options to get all available `modelYear`s via the `Products API`. + * + * Builds path: `/products/vehicle/modelYears?issueType=r` + */ +export type RecallsOptionsEmpty = { + modelYear?: undefined + make?: undefined + model?: undefined + campaignNumber?: undefined +} + +/** + * Options to get all available `make`s for a specific `modelYear` via the `Products API`. + * + * Builds path: `/products/vehicle/makes?modelYear={modelYear}&issueType=r` + */ +export type RecallsOptionsModelYear = { + modelYear: string | number + make?: undefined + model?: undefined + campaignNumber?: undefined +} + +/** + * Options to get all available `models`s for a specific `modelYear` and `make` via the + * `Products API`. + * + * Builds path: `/products/vehicle/models?modelYear={modelYear}&make={make}&issueType=r` + */ +export type RecallsOptionsMake = { + modelYear: string | number + make: string + model?: undefined + campaignNumber?: undefined +} + +/** + * Options to get all available recalls for a specific vehicle by `modelYear`, `make`, and + * `model`. + * + * Builds path: `/recalls/recallsByVehicle?make={make}&model={model}&modelYear={modelYear}` + */ +export type RecallsOptionsVehicle = { + modelYear: string | number + make: string + model: string + campaignNumber?: undefined +} + +/** + * Options to get recalls for a specific `campaignNumber`. + * + * Builds path: `/recalls/campaignNumber?campaignNumber={campaignNumber}` + */ +export type RecallsOptionsCampaignNumber = { + campaignNumber: string + modelYear?: undefined + make?: undefined + model?: undefined +} + +/** + * All valid options combinations for the `recalls()` function + */ +export type RecallsOptions = + | RecallsOptionsEmpty + | RecallsOptionsModelYear + | RecallsOptionsMake + | RecallsOptionsVehicle + | RecallsOptionsCampaignNumber + +/** + * Ensures only valid options are passed to the `recalls()` function + */ +export type NoInvalidOptions = NoExtraProperties< + RecallsOptionsBase, + T +> + +/** + * Variant names used to type the `Results[]` of the `Recalls API` response based on + * the `options` passed to the function. `RecallsResultsData` will be Pick<>ed based on the + * the variant name. + */ +export type RecallsResultsVariant = + | 'getModelYears' + | 'getMakes' + | 'getModels' + | 'vehicle' + | 'campaignNumber' + | 'default' + +/** + * All possible properties and values found in the `Results[]` objects of `Recalls API`. + * + * Property descriptions derived from + * [data.transportation.gov](https://data.transportation.gov/api/views/6axg-epim/rows.json?accessType=DOWNLOAD) + */ +export type RecallsResultsData = { + /** Displays the name of the product manufacturer. */ + Manufacturer?: string + /* + * Displays the recall number. The recall number is composed of the two-digit year, the + * one-character recall type, the two-character recall sub-type, the three-character recall + * number for the year, and the three-character recall subject. + */ + NHTSACampaignNumber?: string + /** + * Advisory for owners of these vehicles should park them immediately until the recall remedy is + * completed. + */ + parkIt?: boolean + /** + * Advisory for owners to park outside and away from structures because vehicles can catch fire. + */ + parkOutSide?: boolean + /** + * Displays the date that NHTSA received the Defect and Noncompliance report from the + * manufacturer. + */ + ReportReceivedDate?: string + /** Displays the name of the product and the defect that is the subject of the recall. */ + Component?: string + /** Displays a summary of the consequences of the defect or noncompliance. */ + Summary?: string + /** Displays a summary of the consequences of the defect or noncompliance. */ + Consequence?: string + /** Displays a brief description of the proposed solution to the recall. */ + Remedy?: string + /** Provides notes from NHTSA regarding the recall. */ + Notes?: string + /** Affected model year of the recall. */ + ModelYear?: string + /** Affected make of the recall. */ + Make?: string + /** Affected model of the recall. */ + Model?: string + /** + * Displays the number of products that are potentially affected by the recall. + * + * Only defined when searching by `campaignNumber` + */ + PotentialNumberofUnitsAffected?: number +} + +/* + * This is typed with Pick<> so the user can see the actual type of the results array objects + * when they hover over the variable they saved the response to. Anything less verbose hides the + * results behind a type name and the user has to go look at the type definition to see what the + * actual keys of the Results array objects are. They could of course just hit ctrl+enter to have + * auto complete show them the keys, but this is more user friendly. + */ +/** + * Types the `Results[]` of the `Recalls API` response based on the `RecallsResultsVariant` that is + * passed to this type. + * + * Used to type no args `()` or `undefined` as the first arg passed to `recalls()`. + * + * Also used in .test-d.ts files to easily match the expected return type of the function. + */ +export type RecallsResultsByVariant< + Variant extends RecallsResultsVariant = 'default', +> = + /* Pick<> RecallsData based on Variant string */ + Variant extends 'getModelYears' + ? /* Path /products/vehicle/modelYears?issueType=r / */ + ProductsResultsByVariant<'getModelYears'> + : Variant extends 'getMakes' + ? /* Path /products/vehicle/makes?modelYear={modelYear}&issueType=r */ + ProductsResultsByVariant<'getMakes'> + : Variant extends 'getModels' + ? /* Path /products/vehicle/models?modelYear={modelYear}&make={make}&issueType=r */ + ProductsResultsByVariant<'getModels'> + : Variant extends 'vehicle' + ? /* Path /recalls/recallsByVehicle?make={make}&model={model}&modelYear={modelYear} */ { + [K in keyof Pick< + RecallsResultsData, + Exclude + >]-?: RecallsResultsData[K] + } + : Variant extends 'campaignNumber' + ? /* Path /recalls/campaignNumber?campaignNumber={campaignNumber} - all defined */ { + [K in keyof RecallsResultsData]-?: RecallsResultsData[K] + } + : /* fallback default value - all optional properties */ + RecallsResultsData + +/** + * Types the `Results[]` of the `Recalls API` response based on the `options` passed + * to the function. + */ +export type RecallsResultsByOptions = + Options extends RecallsOptionsModelYear + ? RecallsResultsByVariant<'getMakes'> + : Options extends RecallsOptionsMake + ? RecallsResultsByVariant<'getModels'> + : Options extends RecallsOptionsVehicle + ? RecallsResultsByVariant<'vehicle'> + : Options extends RecallsOptionsCampaignNumber + ? RecallsResultsByVariant<'campaignNumber'> + : Options extends RecallsOptionsEmpty + ? RecallsResultsByVariant<'getModelYears'> + : RecallsResultsByVariant + +/** + * Types the `recalls()` function return based on the type of `RecallsOptions` passed to + * this type, inferred from the `options` passed to the function. + * + * This type represents the complete parsed API response. + * + * The `Results[]` objects will be typed based on the `options` passed to the function. + */ +export type RecallsResponseByOptions = + Options extends RecallsOptionsVehicle | RecallsOptionsCampaignNumber + ? NhtsaResponse, 'recalls'> + : NhtsaResponse, 'products'> + +/** + * Types the `recalls()` function return based on the `variant` passed to this type. + * + * This type represents the complete parsed API response. + * + * The `Results[]` objects will be typed based on the `Variant` passed to this type. + */ +export type RecallsResponseByVariant< + Variant extends RecallsResultsVariant = 'default', +> = NhtsaResponse, 'recalls'> + +/** + * This is the generic type of the parsed API response and is only meant to be a fallback type. + * + * Types the `recalls()` function with `RecallsResultsData` and/or `ProductsResultsData` as the + * `Results[]` objects. + */ +export type RecallsResponse = + | NhtsaResponse + | NhtsaResponse diff --git a/packages/lib/src/api/recalls/types.ts b/packages/lib/src/api/recalls/types.ts new file mode 100644 index 00000000..40ff4cd4 --- /dev/null +++ b/packages/lib/src/api/recalls/types.ts @@ -0,0 +1,23 @@ +/** + * @module api/recalls/types + * @category Types + */ + +export type { + RecallsOptions, + RecallsOptionsBase, + RecallsOptionsCampaignNumber, + RecallsOptionsEmpty, + RecallsOptionsMake, + RecallsOptionsModelYear, + RecallsOptionsVehicle, + RecallsResponse, + RecallsResponseByOptions, + RecallsResponseByVariant, + RecallsResultsByOptions, + RecallsResultsByVariant, + RecallsResultsData, + RecallsResultsVariant, +} from './recalls' + +export {} diff --git a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts new file mode 100644 index 00000000..59f2a447 --- /dev/null +++ b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts @@ -0,0 +1,887 @@ +import { describe, expectTypeOf, test } from 'vitest' + +import { + safetyRatings, + type SafetyRatingsOptions, + type SafetyRatingsOptionsEmpty, + type SafetyRatingsOptionsMake, + type SafetyRatingsOptionsVehicle, + type SafetyRatingsOptionsModelYear, + type SafetyRatingsOptionsVehicleId, + type SafetyRatingsResponseByOptions, + type SafetyRatingsResponseByVariant, +} from '../safetyRatings' + +const modelYearString = '2018' +const modelYearNumber = 2018 +const modelYear = modelYearNumber +const make = 'Audi' +const model = 'A5' +const vehicleIdString = '1234' +const vehicleIdNumber = 1234 + +test('Typecheck: safetyRatings() - parameters - ', () => { + expectTypeOf().toBeFunction() + expectTypeOf().parameters.toMatchTypeOf< + [ + options?: boolean | SafetyRatingsOptions | undefined, + doFetch?: boolean | undefined, + ] + >() +}) + +describe('Typecheck: safetyRatings() - return correct type of response data - ', () => { + /***************************** + * doFetch = true | undefined (default) + ****************************/ + test('with no arguments', async () => { + const result = await safetyRatings() + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with no options and doFetch = true', async () => { + const result = await safetyRatings(true) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with undefined as first argument', async () => { + const result = await safetyRatings(undefined) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with undefined as first argument and doFetch = true', async () => { + const result = await safetyRatings(undefined, true) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with undefined as both arguments', async () => { + const result = await safetyRatings(undefined, undefined) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with empty object as first argument', async () => { + const result = await safetyRatings({}) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with empty object as first argument and doFetch = true', async () => { + const result = await safetyRatings({}, true) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with options.modelYear as string', async () => { + const result = await safetyRatings({ modelYear: modelYearString }) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with options.modelYear as string and doFetch = true', async () => { + const result = await safetyRatings({ modelYear: modelYearString }, true) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with options.modelYear as number', async () => { + const result = await safetyRatings({ modelYear: modelYearNumber }) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with options.modelYear as number and doFetch = true', async () => { + const result = await safetyRatings({ modelYear: modelYearNumber }, true) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with options.make', async () => { + const result = await safetyRatings({ modelYear, make }) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with options.make and doFetch = true', async () => { + const result = await safetyRatings({ modelYear, make }, true) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with options.model', async () => { + const result = await safetyRatings({ modelYear, make, model }) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with options.model and doFetch = true', async () => { + const result = await safetyRatings({ modelYear, make, model }, true) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with options.vehicleId as string', async () => { + const result = await safetyRatings({ vehicleId: vehicleIdString }) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with options.vehicleId as string and doFetch = true', async () => { + const result = await safetyRatings({ vehicleId: vehicleIdString }, true) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with options.vehicleId as number', async () => { + const result = await safetyRatings({ vehicleId: vehicleIdNumber }) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) + + test('with options.vehicleId as number and doFetch = true', async () => { + const result = await safetyRatings({ vehicleId: vehicleIdNumber }, true) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'getModels'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicle'> + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + SafetyRatingsResponseByOptions + >() + }) +}) + +describe('Typecheck: safetyRatings() - returns type string if doFetch = false - ', () => { + /***************************** + * doFetch = false + ****************************/ + test('with doFetch = false', async () => { + expectTypeOf(await safetyRatings(false)).toEqualTypeOf() + }) + + test('with undefined as first argument and doFetch = false', async () => { + expectTypeOf(await safetyRatings(undefined, false)).toEqualTypeOf() + }) + + test('with empty object as first argument and doFetch = false', async () => { + expectTypeOf(await safetyRatings({}, false)).toEqualTypeOf() + }) + + test('with options.modelYear as string and doFetch = false', async () => { + expectTypeOf( + await safetyRatings({ modelYear: modelYearString }, false) + ).toEqualTypeOf() + }) + + test('with options.modelYear as number and doFetch = false', async () => { + expectTypeOf( + await safetyRatings({ modelYear: modelYearNumber }, false) + ).toEqualTypeOf() + }) + + test('with options.make and doFetch = false', async () => { + expectTypeOf( + await safetyRatings({ modelYear, make }, false) + ).toEqualTypeOf() + }) + + test('with options.model and doFetch = false', async () => { + expectTypeOf( + await safetyRatings({ modelYear, make, model }, false) + ).toEqualTypeOf() + }) + + test('with options.vehicleId as string and doFetch = false', async () => { + expectTypeOf( + await safetyRatings({ vehicleId: vehicleIdString }, false) + ).toEqualTypeOf() + }) + + test('with options.vehicleId as number and doFetch = false', async () => { + expectTypeOf( + await safetyRatings({ vehicleId: vehicleIdNumber }, false) + ).toEqualTypeOf() + }) +}) diff --git a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts new file mode 100644 index 00000000..5944b89b --- /dev/null +++ b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts @@ -0,0 +1,731 @@ +import { beforeEach, describe, expect, test } from 'vitest' +import { safetyRatings } from '../safetyRatings' + +// Mocks +import { createMockResponse } from '.vitest/helpers' +import { mockResults } from '.vitest/data' + +const modelYearString = '2018' +const modelYearNumber = 2018 +const modelYear = modelYearNumber +const make = 'Audi' +const model = 'A5' +const vehicleIdString = '1234' +const vehicleIdNumber = 1234 +const vehicleId = vehicleIdNumber + +// https://api.nhtsa.gov/SafetyRatings +// https://api.nhtsa.gov/SafetyRatings/modelyear/2013 +// https://api.nhtsa.gov/SafetyRatings/modelyear/2013/make/honda +// https://api.nhtsa.gov/SafetyRatings/modelyear/2013/make/honda/model/accord +// https://api.nhtsa.gov/SafetyRatings/vehicleId/7523 + +const baseUrl = 'https://api.nhtsa.gov/SafetyRatings/' +const mockUrlBase = `${baseUrl}?format=json` +const mockUrlVehicleId = `${baseUrl}vehicleId/${vehicleIdString}?format=json` +const mockUrlModelYear = `${baseUrl}modelYear/${modelYearString}?format=json` +const mockUrlMake = `${baseUrl}modelYear/${modelYearString}/make/${make}?format=json` +const mockUrlModel = `${baseUrl}modelYear/${modelYearString}/make/${make}/model/${model}?format=json` + +const expectedFetchOptions = { + saveUrl: true, + method: 'GET', +} + +type TestEach = { + description: string + args: Parameters + expectedUrl: string +} + +describe('safetyRatings()', () => { + beforeEach(() => { + fetchMock.resetMocks() + fetchMock.mockResolvedValue(createMockResponse(mockResults)) + }) + + test('Is a function that returns a Promise', () => { + expect(safetyRatings).toBeDefined() + expect(safetyRatings).toBeInstanceOf(Function) + expect(safetyRatings()).toBeInstanceOf(Promise) + }) + + /***************************** + * doFetch = true (default) + ****************************/ + describe('Fetches API data with: ', () => { + test.each([ + // no arguments, empty object, undefined - returns all available model years + { description: 'no arguments', args: [], expectedUrl: mockUrlBase }, + { + description: 'doFetch = true as first argument', + args: [true], + expectedUrl: mockUrlBase, + }, + { + description: 'undefined as first argument', + args: [undefined], + expectedUrl: mockUrlBase, + }, + { + description: 'undefined as first argument and doFetch = true', + args: [undefined, true], + expectedUrl: mockUrlBase, + }, + { + description: 'empty object as first argument', + args: [{}], + expectedUrl: mockUrlBase, + }, + { + description: 'empty object as first argument and doFetch = true', + args: [{}, true], + expectedUrl: mockUrlBase, + }, + // options.modelYear + { + description: 'options.modelYear as string', + args: [{ modelYear: modelYearString }], + expectedUrl: mockUrlModelYear, + }, + { + description: 'options.modelYear as string and doFetch = true', + args: [{ modelYear: modelYearString }, true], + expectedUrl: mockUrlModelYear, + }, + { + description: 'options.modelYear as number', + args: [{ modelYear: modelYearNumber }], + expectedUrl: mockUrlModelYear, + }, + { + description: 'options.modelYear as number and doFetch = true', + args: [{ modelYear: modelYearNumber }, true], + expectedUrl: mockUrlModelYear, + }, + // options.make + { + description: 'options.make', + args: [{ modelYear, make }], + expectedUrl: mockUrlMake, + }, + { + description: 'options.make and doFetch = true', + args: [{ modelYear, make }, true], + expectedUrl: mockUrlMake, + }, + // options.model + { + description: 'options.model', + args: [{ modelYear, make, model }], + expectedUrl: mockUrlModel, + }, + { + description: 'options.model and doFetch = true', + args: [{ modelYear, make, model }, true], + expectedUrl: mockUrlModel, + }, + // options.vehicleId + { + description: 'options.vehicleId as string', + args: [{ vehicleId: vehicleIdString }], + expectedUrl: mockUrlVehicleId, + }, + { + description: 'options.vehicleId as string and doFetch = true', + args: [{ vehicleId: vehicleIdString }, true], + expectedUrl: mockUrlVehicleId, + }, + { + description: 'options.vehicleId as number', + args: [{ vehicleId: vehicleIdNumber }], + expectedUrl: mockUrlVehicleId, + }, + { + description: + 'with options.vehicleId as undefined and other valid options', + args: [ + { + vehicleId: undefined, + modelYear, + make, + model, + }, + ], + expectedUrl: mockUrlModel, + }, + { + description: + 'with options.vehicleId as undefined and other valid options and doFetch = true', + args: [ + { + vehicleId: undefined, + modelYear, + make, + model, + }, + true, + ], + expectedUrl: mockUrlModel, + }, + ])('$description', async ({ args, expectedUrl }) => { + const results = await safetyRatings(...args) + expect(results).toEqual(mockResults) + expect(fetchMock).toHaveBeenCalledWith(expectedUrl, expectedFetchOptions) + expect(fetchMock.requests().length).toEqual(1) + expect(fetchMock.requests()[0].url).toEqual(expectedUrl) + expect(fetchMock.requests()[0].method).toEqual('GET') + }) + + test('with options.vehicleId and other valid options = TS Errors', async () => { + const results = await safetyRatings({ + vehicleId: vehicleIdString, + // @ts-expect-error Type 'string' is not assignable to type 'undefined'. + modelYear, + // @ts-expect-error Type 'string' is not assignable to type 'undefined'. + make, + // @ts-expect-error Type 'string' is not assignable to type 'undefined'. + model, + }) + + expect(results).toEqual(mockResults) + expect(fetchMock).toHaveBeenCalledWith( + mockUrlVehicleId, + expectedFetchOptions + ) + expect(fetchMock.requests().length).toEqual(1) + expect(fetchMock.requests()[0].url).toEqual(mockUrlVehicleId) + expect(fetchMock.requests()[0].method).toEqual('GET') + }) + }) + + /***************************** + * doFetch = false + ***************************/ + describe('Returns API URL string with: ', () => { + test.each([ + { + description: 'doFetch = false as first argument', + args: [false], + expectedUrl: mockUrlBase, + }, + { + description: 'undefined as first argument and doFetch = false', + args: [undefined, false], + expectedUrl: mockUrlBase, + }, + { + description: 'empty object and doFetch = false', + args: [{}, false], + expectedUrl: mockUrlBase, + }, + // options.modelYear + { + description: 'options.modelYear as string and doFetch = false', + args: [{ modelYear: modelYearString }, false], + expectedUrl: mockUrlModelYear, + }, + { + description: 'options.modelYear as number and doFetch = false', + args: [{ modelYear: modelYearNumber }, false], + expectedUrl: mockUrlModelYear, + }, + // options.make + { + description: 'options.make and doFetch = false', + args: [{ modelYear, make }, false], + expectedUrl: mockUrlMake, + }, + // options.model + { + description: 'options.model and doFetch = true', + args: [{ modelYear, make, model }, false], + expectedUrl: mockUrlModel, + }, + // options.vehicleId + { + description: 'options.vehicleId as string and doFetch = false', + args: [{ vehicleId: vehicleIdString }, false], + expectedUrl: mockUrlVehicleId, + }, + { + description: 'options.vehicleId as number and doFetch = false', + args: [{ vehicleId: vehicleIdNumber }, false], + expectedUrl: mockUrlVehicleId, + }, + { + description: + 'with options.vehicleId as undefined and other valid options and doFetch = false', + args: [ + { + vehicleId: undefined, + modelYear, + make, + model, + }, + false, + ], + expectedUrl: mockUrlModel, + }, + ])('$description', async ({ args, expectedUrl }) => { + const results = await safetyRatings(...args) + + expect(results).toEqual(expectedUrl) + expect(fetchMock.requests().length).toEqual(0) + }) + }) + + /***************************** + * rejects with error + ***************************/ + describe('Rejects with Error if: ', () => { + test.each(['string', 123, ['array'], null, () => {}])( + 'options is neither an object nor boolean, <%s>', + async (arg) => { + await expect(() => + // @ts-expect-error Type (x) is not assignable to type ... + safetyRatings(arg) + ).rejects.toThrowError( + /error validating argument named "options", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([{ object: 123 }, ['array'], true, false, null, () => {}])( + 'options.modelYear is neither a string nor number, <%s>', + async (arg) => { + await expect(() => + safetyRatings({ + // @ts-expect-error Type (x) is not assignable to type 'string | number | undefined + modelYear: arg, + }) + ).rejects.toThrowError( + /error validating argument named "modelYear", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([123, { object: 123 }, ['array'], true, false, null, () => {}])( + 'options.make is not a string, <%s>', + async (arg) => { + await expect(() => + safetyRatings({ + modelYear, + // @ts-expect-error Type (x) is not assignable to type 'string | undefined + make: arg, + }) + ).rejects.toThrowError( + /error validating argument named "make", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([123, { object: 123 }, ['array'], true, false, null, () => {}])( + 'options.model is not a string, <%s>', + async (arg) => { + await expect(() => + safetyRatings({ + modelYear, + make, + // @ts-expect-error Type (x) is not assignable to type 'string | undefined + model: arg, + }) + ).rejects.toThrowError( + /error validating argument named "model", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([{ object: 123 }, ['array'], true, false, null, () => {}])( + 'options.vehicleId is neither a string nor number <%s>', + async (arg) => { + await expect(() => + safetyRatings({ + // @ts-expect-error Type (x) is not assignable to type 'string | number | undefined + vehicleId: arg, + }) + ).rejects.toThrowError( + /error validating argument named "vehicleId", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test('options.make is provided but not options.modelYear', async () => { + await expect(() => + // @ts-expect-error Properties 'modelYear' and 'model' are missing but required in type + safetyRatings({ + make, + }) + ).rejects.toThrowError( + /error validating argument named "modelYear", it is required if "make"/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('options.model is provided but not options.modelYear', async () => { + await expect(() => + // @ts-expect-error Property 'modelYear' is missing but required in type + safetyRatings({ + make, + model, + }) + ).rejects.toThrowError( + /error validating argument named "modelYear", it is required if "model"/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('options.model is provided but not options.make', async () => { + await expect(() => + // @ts-expect-error Property 'make' is missing but required in type + safetyRatings({ + modelYear, + model, + }) + ).rejects.toThrowError( + /error validating argument named "make", it is required if "model"/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options', async () => { + await expect(() => + safetyRatings({ + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and doFetch = true', async () => { + await expect(() => + safetyRatings( + { + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + }, + true + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and doFetch = false', async () => { + await expect(() => + safetyRatings( + { + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + }, + false + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and wrong type for valid options', async () => { + await expect(() => + safetyRatings({ + notAnOption: 'no TS error, vehicleId error takes precedence', + // @ts-expect-error Type 'never[]' is not assignable to type 'string | number | undefined' + vehicleId: [], + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options', async () => { + await expect(() => + safetyRatings({ + // @ts-expect-error Type 'string' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options and doFetch = true', async () => { + await expect(() => + safetyRatings( + { + // @ts-expect-error Type 'string' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + make, + }, + true + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options and doFetch = false', async () => { + await expect(() => + safetyRatings( + { + // @ts-expect-error Type 'string' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + make, + model, + }, + false + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and all valid options', async () => { + await expect(() => + safetyRatings({ + notAnOption: 'no TS error, vehicleId error takes precedence', + modelYear, + make, + model, + // @ts-expect-error Type 'number' is not assignable to type 'undefined' + vehicleId, + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + }) +}) + +/******************************* + * These are here to test the IDE intellisense tooltips when hovering the function and results, + * to ensure the correct types are displayed for the end user. These are not meant to be + * run as tests and testing of hovering must be done manually. + * + * The actual types and typed returns are tested in safetyRatings.test-d.ts via Vitest type + * checking, these are simply hovering tooltip tests. + * + * This cannot be achieved in test.each() tests because the way .each() is typed, it will show all + * possible return types at once, which is not helpful for the end user. + * + * We cannot use expectTypeOf() because it will not work with test.each() tests in the same + * file, and expectTypeOf() will not show the IDE tooltips as a user would see them. + * + * Order of `Results` keys does not matter, only that they are all present with no extraneous + * keys. + ******************************/ +describe.skip('IDE Tooltips - manual test of results type on hover', async () => { + test('/SafetyRatings/', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + ModelYear: number; + VehicleId: number; + }[]; + } + ******************************/ + const result_1 = await safetyRatings() + const result_2 = await safetyRatings(undefined) + const result_3 = await safetyRatings({}) + const result_4 = await safetyRatings({}, true) + const result_5 = await safetyRatings({}, undefined) + const result_6 = await safetyRatings(true) + const result_7 = await safetyRatings(undefined, true) + const result_8 = await safetyRatings(undefined, undefined) + + for (const result of [ + result_1, + result_2, + result_3, + result_4, + result_5, + result_6, + result_7, + result_8, + ]) { + expect(result) + } + }) + + test('/SafetyRatings/modelyear/:modelYear', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + ModelYear: number; + VehicleId: number; + Make: string; + }[]; + } + ******************************/ + const result_1 = await safetyRatings({ modelYear: modelYearString }) + const result_2 = await safetyRatings({ modelYear: modelYearNumber }) + const result_3 = await safetyRatings({ modelYear }, true) + const result_4 = await safetyRatings({ modelYear }, undefined) + + for (const result of [result_1, result_2, result_3, result_4]) { + expect(result) + } + }) + + test('/SafetyRatings/modelyear/:modelYear/make/:make', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + ModelYear: number; + VehicleId: number; + Make: string; + Model: string; + }[]; + } + ******************************/ + const result_1 = await safetyRatings({ modelYear, make }) + const result_2 = await safetyRatings({ modelYear, make }, true) + const result_3 = await safetyRatings({ modelYear, make }, undefined) + + for (const result of [result_1, result_2, result_3]) { + expect(result) + } + }) + + test('/SafetyRatings/modelyear/:modelYear/make/:make/model/:model', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + VehicleId: number; + VehicleDescription: string; + }[]; + } + ******************************/ + const result_1 = await safetyRatings({ modelYear, make, model }) + const result_2 = await safetyRatings({ modelYear, make, model }, true) + const result_3 = await safetyRatings( + { + modelYear, + make, + model, + }, + undefined + ) + + for (const result of [result_1, result_2, result_3]) { + expect(result) + } + }) + + test('/SafetyRatings/vehicleId/:vehicleId', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: { + 'combinedSideBarrierAndPoleRating-Front': string; + 'combinedSideBarrierAndPoleRating-Rear': string; + ComplaintsCount: number; + dynamicTipResult: string; + FrontCrashDriversideRating: string; + FrontCrashPassengersideRating: string; + InvestigationCount: number; + Make: string; + Model: string; + ModelYear: number; + NHTSAElectronicStabilityControl: string; + NHTSAForwardCollisionWarning: string; + NHTSALaneDepartureWarning: string; + OverallFrontCrashRating: string; + OverallSideCrashRating: string; + OverallRating: string; + RecallsCount: number; + RolloverRating: string; + RolloverRating2: string; + RolloverPossibility: number; + RolloverPossibility2: number; + 'sideBarrierRating-Overall': string; + SideCrashDriversideRating: string; + SideCrashPassengersideRating: string; + SidePoleCrashRating: string; + VehicleDescription: string; + VehicleId: number; + VehiclePicture: string; + }[]; + } + ******************************/ + const result_1 = await safetyRatings({ vehicleId: vehicleIdString }) + const result_2 = await safetyRatings({ vehicleId: vehicleIdNumber }) + const result_3 = await safetyRatings({ vehicleId }, true) + const result_4 = await safetyRatings({ vehicleId }, undefined) + + for (const result of [result_1, result_2, result_3, result_4]) { + expect(result) + } + }) + + test('returns a string if doFetch = false', async () => { + /******Expected Tooltip*******\ + const result_x: string + ******************************/ + const result_1 = await safetyRatings(false) + const result_2 = await safetyRatings(undefined, false) + const result_3 = await safetyRatings({}, false) + const result_4 = await safetyRatings({ modelYear: modelYearString }, false) + const result_5 = await safetyRatings({ modelYear: modelYearNumber }, false) + const result_6 = await safetyRatings({ modelYear, make }, false) + const result_7 = await safetyRatings({ modelYear, make, model }, false) + const result_8 = await safetyRatings({ vehicleId: vehicleIdString }, false) + const result_9 = await safetyRatings({ vehicleId: vehicleIdNumber }, false) + + for (const result of [ + result_1, + result_2, + result_3, + result_4, + result_5, + result_6, + result_7, + result_8, + result_9, + ]) { + expect(result) + } + }) +}) diff --git a/packages/lib/src/api/safetyRatings/safetyRatings.ts b/packages/lib/src/api/safetyRatings/safetyRatings.ts new file mode 100644 index 00000000..48511f02 --- /dev/null +++ b/packages/lib/src/api/safetyRatings/safetyRatings.ts @@ -0,0 +1,671 @@ +/** + * @module api/safetyRatings + * @category API - Safety Ratings + */ + +import { useNHTSA } from '@/api' +import { catchInvalidArguments, rejectWithError } from '@/utils' +import type { NhtsaResponse, NoExtraProperties } from '@/types' + +/** + * # Safety Ratings API + * + * ::: tip :bulb: More Information + * See: [Safety Ratings Documentation] /guide/safetyRatings + * ::: + * + * You can use `safetyRatings()` as a thin wrapper for the `NHTSA Safety Ratings API` to get safety + * ratings for a vehicle. + * + * This function is designed to handle all of the different possible workflows and return the + * correct data/url for each one, all depending on which options you pass to the function. In this + * sense it is a single universal function that can handle the entirety of the Safety Ratings + * API. + * + * From the [Official Documentation](https://www.nhtsa.gov/nhtsa-datasets-and-apis#ratings): + * + * > NHTSA's New Car Assessment Program (NCAP) rates vehicles to determine crashworthiness and + * rollover safety. The safety ratings are gathered during controlled crash and rollover tests + * conducted at NHTSA research facilities. Vehicles with a rating of five stars indicate the highest + * safety rating, whereas a one star indicates the lowest rating. + * + * ## Options + * + * The Safety Ratings API uses the path to represent the query. This function uses the options + * passed to build the correct url path query. + * + * Valid `options` are: + * + * - `modelYear` - Model Year of the vehicle to search + * - `make` - Make of the vehicle to search + * - `model` - Model of the vehicle to search + * - `vehicleId` - VehicleId of the vehicle to search + * + * All are optional and the only valid options you can pass to this function. + * + * Valid `options` combinations: + * + * - `safetyRatings()` + * - `safetyRatings({})` + * - `safetyRatings({ modelYear })` + * - `safetyRatings({ modelYear, make })` + * - `safetyRatings({ modelYear, make, model })` + * - `safetyRatings({ vehicleId })` + * + * Real Example URLs, w/trailing slash also ok: + * + * - https://api.nhtsa.gov/SafetyRatings + * - https://api.nhtsa.gov/SafetyRatings/modelyear/2013 + * - https://api.nhtsa.gov/SafetyRatings/modelyear/2013/make/honda + * - https://api.nhtsa.gov/SafetyRatings/modelyear/2013/make/honda/model/accord + * - https://api.nhtsa.gov/SafetyRatings/vehicleId/7523 + * + * Note that `?format=json` will always be appended to the URL when using this package, even + * though it is not required by the SafetyRatings API. + * + * Returned data will be structured as `{ Count, Message, Results }` for any combination of options. + * + * See the `Returns` section below for more details. + * + * ### Some Notes on `vehicleId` + * + * The `VehicleId` is found in `response.Results[x].VehicleId` for any path combination. + * + * `VehicleId` is included in all cases but will always have a value of `0` except for options + * `{ modelYear, make, model }` and `{ vehicleId }`, which will return the actual `VehicleId`s. + * + * All other options - `{}`, `{ modelYear }` and `{ modelYear, make }` are used to to obtain the + * `VehicleId` for a particular vehicle and then get the safety ratings for that `VehicleId`. + * + * - If you already know the `VehicleId` number you can pass `{ vehicleId: VehicleId }` as the only + * option and directly get the safety ratings for that vehicle. + * - If you don't know the `VehicleId`, you can pass the `modelYear`, `make`, and `model` options to + * get the `VehicleId` for that particular vehicle. + * - The other paths are used if you don't know the `modelYear`, `make`, or `model` and need to + * retrieve that information first. + * + * ## Rules + * + * There are several rules to follow when using this API or you will get a network error response + * from the NHTSA API. + * + * 1. If you provide a `vehicleId` then you cannot provide any other options. + * 2. If you provide a `make` then you must also provide a `modelYear`. + * 3. If you provide a `model` then you must also provide a `make` and `modelYear`. + * 4. You must use PascalCase `SafetyRatings` in the path, it is case sensitive and will return a + * 403 forbidden error otherwise. + * + * FYI: Rules #1-3 will return a 404 Unknown error from the NHTSA API if you break them. + * + * Consequences of breaking the rules: + * + * - Rule #1 - if passing `vehicleId` and any other valid combination of options, this function will + * silently ignore the other options and only use the `vehicleId`. It will not throw an Error but + * you will get typescript errors. + * - Rules #2 and #3 - this function will throw an Error as a fail safe to prevent you from + * getting a network error from the NHTSA API. + * - Rule #4 - enforced by this function internally when fetching the data or returning the URL + * string. + * + * There will also be TypeScript errors if you pass invalid options or invalid combinations of + * options. + * + * To clarify, this function will `throw Error`s in the following cases: + * + * - If you pass options not listed above. + * - If you pass an invalid combination of options. + * - If you pass a valid combination of options but include options not listed above. + * + * ## Usage + * + * The following describes in more detail the use of the different options and the paths they use. + * + * ### Get All Model Years + * + * Get a list of all available model years in the `Safety Ratings API` dataset. + * + * If you pass no arguments, an empty object `{}`, `undefined`, or `true` as the first argument, the + * path `/SafetyRatings` will be used. + * + * Example: Get a list of all available model years + * ```js + * await safetyRatings().then((response) => { + * response.Results.forEach((result) => { + * console.log(result.ModelYear) // "2024", "2023", "2022", etc + * console.log(result.VehicleId) // 0 + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await safetyRatings(false) + * console.log(url) // "https://api.nhtsa.gov/SafetyRatings?format=json" + * ``` + * + * ### Get Makes for Model Year + * + * Get a list of all available makes in the `Safety Ratings API` for a specific model year. + * + * If you pass a `modelYear` as the only option, the path `/modelYear/:modelYear` will be used. + * + * Example: Get a list of available makes for the 2013 model year + * ```js + * await safetyRatings({ modelYear: 2013 }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.Make) // "ACURA", "AUDI", "BENTLEY", etc. + * console.log(result.VehicleId) // 0 + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await safetyRatings({ modelYear: 2013 }, false) + * console.log(url) // "https://api.nhtsa.gov/SafetyRatings/modelYear/2013?format=json" + * ``` + * + * If you need to get all available model years, first call the function with no arguments. + * + * ### Get Models for Make + * + * Get a list of all available models in the `Safety Ratings API` for a specific model year and + * make. + * + * If you pass a `modelYear` and `make` as the only options, the path + * `/modelYear/:modelYear/make/:make` will be used. + * + * Example: Get a list of available models for 2013 Honda vehicles + * ```js + * await safetyRatings({ modelYear: 2013, make: 'Honda' }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.Model) // "Accord", "Civic", etc + * console.log(result.VehicleId) // 0 + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await safetyRatings({ modelYear: 2013, make: 'Honda' }, false) + * console.log(url) // "https://api.nhtsa.gov/SafetyRatings/modelYear/2013/make/Honda?format=json" + * ``` + * + * If you need to get makes for a particular model year, first call the function with `modelYear` as + * the only option to get all of the available makes. + * + * ### Get VehicleId(s) for Year, Make, and Model + * + * Gets a list of vehicle variants for year, make and model, used to get the `VehicleId` and + * `VehicleDescription` for a particular year, make, and model. + * + * If you pass a `modelYear`, `make`, and `model` as the only options, the + * `/modelYear/:modelYear/make/:make/model/:model` path will be used. + * + * Example: Get a list of available vehicle variants for a 2013 Honda Accord + * ```js + * await safetyRatings({ modelYear: 2013, make: 'Honda', model: 'Accord' }) + * .then((response) => { + * // First Object in the Results array + * console.log(response.Results[0].VehicleId) // 7523 + * console.log(response.Results[0].VehicleDescription) // "2013 Honda Accord 4 DR FWD" + * // Second Object in the Results array + * console.log(response.Results[1].VehicleId) // 7522 + * console.log(response.Results[1].VehicleDescription) // "2013 Honda Accord 2 DR FWD" + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await safetyRatings({ modelYear: 2013, make: 'Honda', model: 'Accord' }, false) + * console.log(url) + * // "https://api.nhtsa.gov/SafetyRatings/modelYear/2013/make/Honda/model/Accord?format=json" + * ``` + * + * Note that there may be multiple objects in the `Results[]`, each with a different `VehicleId`. + * One reason for this could be that there are multiple body styles for that particular model year, + * make, and model combination. + * + * You can use the `VehicleDescription` to narrow further but there is no known way to narrow it + * further than this. You will have to choose the correct `VehicleId` from the `Results` or already + * know the `VehicleId` for the specific vehicle you want to get safety ratings for. You can also + * check that there is only one object in the `Results` array and if so, use that `VehicleId` or + * pick the first one and use that `VehicleId`. + * + * The next step is to call the function again with `{ vehicleId: VehicleId }` included in + * the passed options to get the safety ratings for that vehicle. + * + * ### Get Safety Ratings by VehicleId + * + * Gets a list of Safety Ratings for the given `vehicleId`. + * + * If you pass `options.vehicleId`, the `/vehicleId/:vehicleId` path will be used. + * + * All other options will be ignored if you provide `options.vehicleId`. + * + * There will only be one object that contains all of the safety ratings in the `Results[]`. + * + * Example: Get safety ratings for a 2013 Honda Accord 4 DR FWD + * ```js + * await safetyRatings({ vehicleId: 7523 }) + * .then((response) => { + * console.log(response.Results[0].ComplaintsCount) + * console.log(response.Results[0].InvestigationCount) + * console.log(response.Results[0].RecallsCount) + * console.log(response.Results[0].VehiclePicture) + * // ...more properties + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await safetyRatings({ vehicleId: 7523 }, false) + * console.log(url) // "https://api.nhtsa.gov/SafetyRatings/vehicleId/7523?format=json" + * ``` + * + * ## Returns + * + * The return from this function will be a parsed JSON response, typed to reflect the different + * types of objects you can expect to get back from the API in the `Results[]`. + * + * Returned data will be structured as `{ Count, Message, Results }`. + * + * The return will be an object with the following properties: + * + * - `Count` - The number of results returned + * - `Message` - A message from the NHTSA API + * - `Results` - An array of objects containing the response data + * + * The `Results[]` will be typed based on the `options` passed to the function but will contain some + * combination of SafetyRatingsResultsData properties. + * + * - See type `SafetyRatingsResultsData` for a list of all possible properties. + * - See type `SafetyRatingsResultsByVariant` for clarity on which properties will be included based on + * the `options` passed. + * + * @param [options] - Object of options, fetch data from the API depending on options passed + * @param [options.modelYear] - Model Year of the vehicle to search for + * @param [options.make] - Make of the vehicle to search for + * @param [options.model] - Model of the vehicle to search for + * @param [doFetch=true] - If false, will return the url string instead of fetching the data + * (default: `true`) + * @returns - Parsed API response `object` -or- url `string` if `doFetch = false` + */ +function safetyRatings>( + options: NoInvalidOptions, + doFetch?: true +): Promise> +function safetyRatings>( + options: NoInvalidOptions | undefined, + doFetch: false +): Promise +function safetyRatings( + options?: undefined, + doFetch?: true +): Promise> +function safetyRatings( + doFetch?: true +): Promise> +function safetyRatings(doFetch: false): Promise +function safetyRatings>( + options?: NoInvalidOptions | boolean, + doFetch?: boolean +): Promise +/* Implementation */ +async function safetyRatings( + options?: NoInvalidOptions | boolean, + doFetch: boolean = true +): Promise { + const endpointName = 'SafetyRatings' + + /** + * Builds the URL path + */ + const buildPath = (parts: SafetyRatingsOptionsBase): string => { + const pathParts = [] + if (parts.vehicleId) { + pathParts.push(`vehicleId/${parts.vehicleId}`) + } else { + if (parts.modelYear) { + pathParts.push(`modelYear/${parts.modelYear}`) + if (parts.make) { + pathParts.push(`make/${parts.make}`) + if (parts.model) { + pathParts.push(`model/${parts.model}`) + } + } + } + } + return pathParts.join('/') + } + + try { + let path = '' + + if (typeof options === 'boolean') { + /* If first argument is boolean, it is doFetch */ + doFetch = options + /* Set options undefined so it will pass argument check below, otherwise invalid type */ + options = undefined + } + + /* This will also ensure we have an actual object using our custom getTypeof() function */ + catchInvalidArguments({ + args: [ + { + name: 'options', + value: options, + types: ['object'], + validKeys: ['modelYear', 'make', 'model', 'vehicleId'], + }, + { + name: 'vehicleId', + value: options?.vehicleId, + types: ['string', 'number'], + }, + { + name: 'modelYear', + value: options?.modelYear, + types: ['string', 'number'], + requiredBy: [ + // order important for user exerience in error messages + { name: 'model', value: options?.model }, + { name: 'make', value: options?.make }, + ], + }, + { + name: 'make', + value: options?.make, + types: ['string'], + requiredBy: [{ name: 'model', value: options?.model }], + }, + { name: 'model', value: options?.model, types: ['string'] }, + ], + }) + + /* options are guaranteed to be an object by now because of catchInvalidArguments() */ + if (options) { + /* Build the API URL path */ + path = buildPath(options) + } + + const { get, createCachedUrl, getCachedUrl } = useNHTSA() + + createCachedUrl({ + apiType: 'safetyRatings', + endpointName, + path, + }) + + if (!doFetch) { + return getCachedUrl() + } else { + return get() + } + } catch (error) { + return rejectWithError(error) + } +} + +export { safetyRatings } + +/* + * These types have to be kept together with the function in the same file. + * + * This is so Intellisense will show the full type contents of the return to the end user when they + * save the results to a variable and then hover over that variable. If these types are moved to + * another file, Intellisense will only show the type name, not the full type contents for the + * safetyRatings() NhstaResponse return type. + * + * Any type that is used directly in the function overloads and not in this file will cause this. + * So, theoretically, you could move all of those types here and the others live in their own file, + * but that would spread the types out and they are only used here and in the tests, so it makes + * sense to keep them together. + */ + +/** + * All valid options for the `safetyRatings()` function + */ +export type SafetyRatingsOptionsBase = { + modelYear?: string | number + make?: string + model?: string + vehicleId?: string | number +} + +/** + * Options to get all available `modelYear`s in the `Safety Ratings API` + * + * Builds path: `/SafetyRatings` + */ +export type SafetyRatingsOptionsEmpty = { + modelYear?: undefined + make?: undefined + model?: undefined + vehicleId?: undefined +} + +/** + * Options to get all available `make`s in the `Safety Ratings API` for the `options.modelYear` + * passed to the `products()` function. + * + * Builds path: `/SafetyRatings/modelYear/:modelYear` + */ +export type SafetyRatingsOptionsModelYear = { + modelYear: string | number + make?: undefined + model?: undefined + vehicleId?: undefined +} + +/** + * Options to get all available `model`s in the `Safety Ratings API` for the `options.modelYear` and + * `options.make` passed to the `products()` function. + * + * Builds path: `/SafetyRatings/modelYear/:modelYear/make/:make` + */ +export type SafetyRatingsOptionsMake = { + modelYear: string | number + make: string + model?: undefined + vehicleId?: undefined +} + +/** + * Options to get a list of vehicle variants in the `Safety Ratings API` for options `modelYear`, + * `make` and `model` passed to the `products()` function. + * + * Builds path: `/SafetyRatings/modelYear/:modelYear/make/:make/model/:model` + */ +export type SafetyRatingsOptionsVehicle = { + modelYear: string | number + make: string + model: string + vehicleId?: undefined +} + +/** + * Options to get a list of Safety Ratings for the `options.vehicleId` passed to the `products()` + * function. + * + * Builds path: `/SafetyRatings/vehicleId/:vehicleId` + */ +export type SafetyRatingsOptionsVehicleId = { + vehicleId: string | number + modelYear?: undefined + make?: undefined + model?: undefined +} + +/** + * All valid options combinations for the `safetyRatings()` function + */ +export type SafetyRatingsOptions = + | SafetyRatingsOptionsEmpty + | SafetyRatingsOptionsVehicleId + | SafetyRatingsOptionsModelYear + | SafetyRatingsOptionsMake + | SafetyRatingsOptionsVehicle + +/** + * Ensures only valid options are passed to the `safetyRatings()` function + */ +export type NoInvalidOptions = + NoExtraProperties + +/** + * Variant names to used to type the `Results[]` of the `Safety Ratings API` response based on the + * `options` passed to the function. `SafetyRatingsResultsData` will be Pick<>ed based on the the + * Variant name. + */ +export type SafetyRatingsResultsVariant = + | 'getModelYears' + | 'getMakes' + | 'getModels' + | 'vehicle' + | 'vehicleId' + | 'default' + +/** + * All possible properties and their value types, found in the `Results[]` objects of + * `Safety Ratings API` response. This is typed with all properties optional so it can be used to + * type the `Results[]` based on `options` passed to the `saftetyRatings()` function. + * + * `SafetyRatingsResultsVariants` variant `'vehicleId'` will have all properties defined, all other + * variants will only have some properties defined. + */ +export type SafetyRatingsResultsData = { + 'combinedSideBarrierAndPoleRating-Front'?: string + 'combinedSideBarrierAndPoleRating-Rear'?: string + ComplaintsCount?: number + dynamicTipResult?: string + FrontCrashDriversideRating?: string + FrontCrashPassengersideRating?: string + InvestigationCount?: number + Make?: string + Model?: string + ModelYear?: number + NHTSAElectronicStabilityControl?: string + NHTSAForwardCollisionWarning?: string + NHTSALaneDepartureWarning?: string + OverallFrontCrashRating?: string + OverallSideCrashRating?: string + OverallRating?: string + RecallsCount?: number + RolloverRating?: string + RolloverRating2?: string + RolloverPossibility?: number + RolloverPossibility2?: number + 'sideBarrierRating-Overall'?: string + SideCrashDriversideRating?: string + SideCrashPassengersideRating?: string + SidePoleCrashRating?: string + VehicleDescription?: string + VehicleId?: number + VehiclePicture?: string +} + +/* + * This is typed with Pick<> so the user can see the actual type of the Results array objects + * when they hover over the variable they saved the response to. Anything less verbose hides the + * Results behind a type name and the user has to go look at the type definition to see what the + * actual keys of the Results array objects are. They could of course just hit ctrl+enter to have + * auto complete show them the keys, but this is more user friendly. + */ +/** + * Types the `Results[]` of the `Safety Ratings API` response based on the + * `SafetyRatingsResultsVariant` passed to this type. + * + * Used to type no args `()` or `undefined` as the first arg passed to `safetyRatings()`. + * + * Also used in .test-d.ts files to easily match the expected return type of the function. + */ +export type SafetyRatingsResultsByVariant< + Variant extends SafetyRatingsResultsVariant = 'default', +> = + /* Pick<> SafetyRatingsResultsData based on Variant string */ + Variant extends 'getModelYears' + ? /* Base Path / */ + { + [K in keyof Pick< + SafetyRatingsResultsData, + 'ModelYear' | 'VehicleId' + >]-?: SafetyRatingsResultsData[K] + } + : Variant extends 'getMakes' + ? /* Path /modelYear/:modelYear */ + { + [K in keyof Pick< + SafetyRatingsResultsData, + 'Make' | 'ModelYear' | 'VehicleId' + >]-?: SafetyRatingsResultsData[K] + } + : Variant extends 'getModels' + ? /* Path /modelYear/:modelYear/make/:make */ + { + [K in keyof Pick< + SafetyRatingsResultsData, + 'Make' | 'Model' | 'ModelYear' | 'VehicleId' + >]-?: SafetyRatingsResultsData[K] + } + : Variant extends 'vehicle' + ? /* Path /modelYear/:modelYear/make/:make/model/:model */ { + [K in keyof Pick< + SafetyRatingsResultsData, + 'VehicleDescription' | 'VehicleId' + >]-?: SafetyRatingsResultsData[K] + } + : Variant extends 'vehicleId' + ? /* Path /vehicleId/:vehicleId - all properties defined */ { + [K in keyof SafetyRatingsResultsData]-?: SafetyRatingsResultsData[K] + } + : /* fallback default value - all optional properties */ + SafetyRatingsResultsData + +/** + * Types the `Results[]` of the `Safety Ratings API` response based on the `options` passed to the + * function. + */ +export type SafetyRatingsResultsByOptions< + Options extends SafetyRatingsOptions, +> = Options extends SafetyRatingsOptionsModelYear + ? SafetyRatingsResultsByVariant<'getMakes'> + : Options extends SafetyRatingsOptionsMake + ? SafetyRatingsResultsByVariant<'getModels'> + : Options extends SafetyRatingsOptionsVehicle + ? SafetyRatingsResultsByVariant<'vehicle'> + : Options extends SafetyRatingsOptionsVehicleId + ? SafetyRatingsResultsByVariant<'vehicleId'> + : Options extends SafetyRatingsOptionsEmpty + ? SafetyRatingsResultsByVariant<'getModelYears'> + : SafetyRatingsResultsByVariant + +/** + * Types the `safetyRatings()` function return based on the type of `SafetyRatingsOptions` passed to + * this type, inferred from the `options` passed to the function. + * + * This type represents the complete parsed API response. + * + * The `Results[]` will be typed based on the `options` passed to the function. + */ +export type SafetyRatingsResponseByOptions< + Options extends SafetyRatingsOptions, +> = NhtsaResponse, 'safetyRatings'> + +/** + * Types the `safetyRatings()` function return based on the `SafetyRatingsResultsVariant` passed to + * this type. + * + * This type represents the complete parsed API response. + * + * The `Results[]` will be typed based on the `SafetyRatingsResultsVariant`. + */ +export type SafetyRatingsResponseByVariant< + Variant extends SafetyRatingsResultsVariant = 'default', +> = NhtsaResponse, 'safetyRatings'> + +/** + * Types the `safetyRatings()` function with `SafetyRatingsResultsData` as the `Results` array. + * + * This is the generic type of the parsed API response and is only meant to be a fallback type. + * + * The `Results[]` will be typed as `SafetyRatingsResultsData`, which is all possible properties + * found in the Results objects of `Safety Ratings API` paths, with all marked as optional + * properties that could be undefined. + */ +export type SafetyRatingsResponse = NhtsaResponse< + SafetyRatingsResultsData, + 'safetyRatings' +> diff --git a/packages/lib/src/api/safetyRatings/types.ts b/packages/lib/src/api/safetyRatings/types.ts new file mode 100644 index 00000000..ccea2daa --- /dev/null +++ b/packages/lib/src/api/safetyRatings/types.ts @@ -0,0 +1,22 @@ +/** + * @module api/safetyRatings/types + * @category Types + */ + +export type { + SafetyRatingsOptions, + SafetyRatingsOptionsBase, + SafetyRatingsOptionsEmpty, + SafetyRatingsOptionsMake, + SafetyRatingsOptionsModelYear, + SafetyRatingsOptionsVehicle, + SafetyRatingsOptionsVehicleId, + SafetyRatingsResponseByOptions, + SafetyRatingsResponseByVariant, + SafetyRatingsResultsByOptions, + SafetyRatingsResultsByVariant, + SafetyRatingsResultsData, + SafetyRatingsResultsVariant, +} from './safetyRatings' + +export {} diff --git a/packages/lib/src/api/types.ts b/packages/lib/src/api/types.ts index 23c85a69..024e5989 100644 --- a/packages/lib/src/api/types.ts +++ b/packages/lib/src/api/types.ts @@ -3,21 +3,105 @@ * @category Types */ -export * from './endpoints/types' +export * from './complaints/types' +export * from './cssiStation/types' +export * from './products/types' +export * from './recalls/types' +export * from './safetyRatings/types' +export * from './vpic/endpoints/types' + export type { CreateUrlOptions } from './useNHTSA' +export type ApiTypes = + | 'vpic' + | 'safetyRatings' + | 'recalls' + | 'complaints' + | 'products' + | 'cssiStation' + /** - * Response data returned from the NHTSA VPIC API. `Results` key will be an array of objects of type "T" + * Response data returned from the NHTSA APIs. + * + * The end user should not have to worry about this type. It is used internally for all of the api + * functions in this package. + * + * There is a slight difference between all of the NHTSA API responses. As an example: + * - The `vpic` response data has a `Results` key + * - The `recalls` response data has a `results` key and no `SearchCriteria` key. + * + * In any case, either `Results` or `results` key will be an array of objects of type "ResultsType" + * + * There are several keys points to note: + * - This type will default to `vpic` if no `ApiType` is provided as this was the orginal intended + * usage of this package. + * - If using the other APIs (recalls, safety ratings, complaints, etc.), you must provide the + * relevant `ApiType` to get the correct intelisense typing for the response. + * - If using the `products` API, you must provide the `ApiType` of `products`, etc. + * + * @example + * ```ts + * // This will default to the `vpic` response type + * NhtsaResponse + * + * // This will correctly type the `recalls` api response + * NhtsaResponse + * ``` */ -export type NhtsaResponse = { - /** The number of items returned in the Results object. Will = 0 if no Results*/ - Count: number - /** A message describing the Results. If Count is 0 check the Message for helpful info */ - Message: string - /** An array of objects returned by NHTSA VPIC API, specific to each individual API Action. */ - Results: Array - /** Search terms (VIN, WMI, etc) used in the request URL. */ - SearchCriteria: string | null -} +export type NhtsaResponse< + ResultsType, + ApiType extends ApiTypes = 'vpic', +> = ApiType extends 'vpic' + ? { + /** The number of items returned in the Results object. Will = 0 if no Results */ + Count: number + /** A message describing the Results. If Count is 0 check the Message for helpful info */ + Message: string + /** An array of objects of type 'ResultsType', specific to each individual API endpoint. */ + Results: Array + /** Search terms (VIN, WMI, etc) used in the request URL. */ + SearchCriteria: string | null + } + : ApiType extends 'recalls' + ? { + /** The number of items returned in the Results object. Will = 0 if no results */ + Count: number + /** A message describing the results. If Count is 0 check the Message for helpful info */ + Message: string + /** An array of objects of type 'ResultsType', specific to each individual API endpoint. */ + Results: Array + } + : ApiType extends 'safetyRatings' + ? { + /** The number of items returned in the Results object. Will = 0 if no Results */ + Count: number + /** A message describing the Results. If Count is 0 check the Message for helpful info */ + Message: string + /** An array of objects of type 'ResultsType', specific to each individual API endpoint. */ + Results: Array + } + : ApiType extends 'complaints' | 'products' + ? { + /** The number of items returned in the Results object. Will = 0 if no results */ + Count: number + /** A message describing the results. If count is 0 check the message for helpful info */ + Message: string + /** An array of objects of type 'ResultsType', specific to each individual API endpoint. */ + Results: Array + } + : ApiType extends 'cssiStation' + ? { + /** Starting latitude (user's location) */ + StartLatitude: number + /** Starting longitude (user's location) */ + StartLongitude: number + /** The number of items returned in the Results object. Will = 0 if no results */ + Count: number + /** A message describing the Results. If Count is 0 check the Message for helpful info */ + Message: string + /** An array of objects of type 'ResultsType', specific to each individual API endpoint. */ + Results: Array + } + : never export {} diff --git a/packages/lib/src/api/useNHTSA.ts b/packages/lib/src/api/useNHTSA.ts index 9e98218a..5c875f8c 100644 --- a/packages/lib/src/api/useNHTSA.ts +++ b/packages/lib/src/api/useNHTSA.ts @@ -9,11 +9,17 @@ import { getTypeof, rejectWithError, } from '@/utils' -import { NHTSA_BASE_URL, NHTSA_RESPONSE_FORMAT } from '@/constants' -import type { NhtsaResponse, QueryStringParams } from '@/types' +import { + NHTSA_VPIC_URL, + NHTSA_API_URL, + NHTSA_RESPONSE_FORMAT, + NHTSA_DEFAULT_API_TYPE, +} from '@/constants' +import type { ApiTypes, NhtsaResponse, QueryStringParams } from '@/types' export type CreateUrlOptions = { endpointName: string + apiType?: ApiTypes allowEmptyParams?: boolean includeQueryString?: boolean path?: string @@ -57,8 +63,12 @@ export const useNHTSA = () => { /** Gets cached VPIC URL from internal state */ const getCachedUrl = () => _url - /** Clears cached VPIC URL from internal state */ - const clearCachedUrl = () => (_url = '') + /** Clears cached VPIC URL from internal state + * Call this method to release references and facilitate garbage collection + * when the instance is no longer needed. This is particularly important + * in long-lived applications or server-side contexts to prevent memory leaks. + */ + const clearCachedUrl = () => (_url = undefined as unknown as string) /** * This builds the VPIC URL string and sets it as a private variable in the composable instance if @@ -96,32 +106,34 @@ export const useNHTSA = () => { * (default: true) * @returns {string} VPIC API URL string */ - const createCachedUrl = (input: CreateUrlOptions | string): string => { - if (typeof input === 'string') { - setCachedUrl(input) - return input + const createCachedUrl = (options: CreateUrlOptions | string): string => { + if (typeof options === 'string') { + setCachedUrl(options) + return options } const { endpointName, + apiType = NHTSA_DEFAULT_API_TYPE, allowEmptyParams = false, - includeQueryString = true, path = '', params, saveUrl = true, - } = input + } = options + + const { includeQueryString = true } = options - if (!endpointName) { - throw Error('Endpoint name is required to create a VPIC URL string') + if (!endpointName || typeof endpointName !== 'string') { + throw Error('options.endpointName is required to create a URL string') } const queryString = includeQueryString ? createQueryString(params, allowEmptyParams) : '' - const url = encodeURI( - `${NHTSA_BASE_URL}/${endpointName}/${path}${queryString}` - ) + const baseUrl = apiType === 'vpic' ? NHTSA_VPIC_URL : NHTSA_API_URL + + const url = encodeURI(`${baseUrl}/${endpointName}/${path}${queryString}`) if (saveUrl) { setCachedUrl(url) @@ -161,13 +173,19 @@ export const useNHTSA = () => { } /** - * This uses native `fetch()` to make a request to the NHTSA API. Returns a promise that - * resolves to a `NhtsaResponse` object, where `T` is the type of the objects in the - * `Results` array of the `NhtsaResponse` object, e.g. `NhtsaResponse`. + * This uses native `fetch()` to make a request to the NHTSA API. It returns a promise that + * resolves to a `NhtsaResponse` object, where `ResultsType` is the type of the + * objects in the `Results` or `results` array of the `NhtsaResponse` object. * - * _NOTE:_ All POST requests should use the post() method of this composable, which sets specific - * POST fetch options before calling this method. Never call this method directly for POST - * requests. + * For example, `NhtsaResponse` has a `Results` key, which + * contains an array of `DecodeVinResults` objects. Some of the NHTSA API endpoints have a + * `results` key instead of `Results`, so the `ApiType` generic is used to specify the type of + * the `Results` or `results` array. + * + * This function returns the API response contents after parsing the response data as JSON. + * + * It will throw an error if the response is not ok, the response is not in JSON format, or the + * response data is empty. * * --- * @@ -179,20 +197,21 @@ export const useNHTSA = () => { * * `url` - either a full url `string` or an `object` of type `CreateUrlOptions` * - * - `required` if there is no url cached in the composable instance + * - it's `required` if there is no url cached in the composable instance * - if a `CreateUrlOptions` object is provided, `createCachedUrl` will be called with the object - * to build and cache the url before making the request + * to build and cache the url * - if a string is provided, it is assumed the string is a full url and it will be cached in the - * as such in the composable instance before making the request + * as such in the composable instance + * + * --- * * ### Options * * If you need to set custom fetch options for request, set them in the `options` object. * * `options` is optional. If provided, it should be an object containing following properties: - * - `options.saveUrl` - Whether to save the URL string in the composable instance after - * the request is made (default: true). - * - `options.body` - string to send in the NHTSA API POST request. (example: "modelYear=2009") + * - `options.saveUrl` - Whether to save the URL string in the composable instance when creating + * the url (default: true). * - Any other valid `RequestInit` options: * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request * @@ -201,10 +220,10 @@ export const useNHTSA = () => { * new URL string will need to be created for the next request. * * When called from post(), you should set `options.includeQueryString` to false as query strings - * are not allowed in a POST request. In POST requests, "&format=json" is appended to the POST - * body string instead of in the query string. Using the post method directly for POST requests - * will automatically set `options.includeQueryString` to false and append "&format=json" to the - * POST body string. + * are not allowed in a POST request. Also, in POST requests, "&format=json" is appended to the + * POST body string instead of in the query string. Using the post method directly for POST + * requests will automatically set `options.includeQueryString` to false and append "&format=json" + * to the POST body string. * * @param {string} [url] - URL string to use for the request * @param [options] - Object containing RequestInit options + custom options @@ -212,23 +231,55 @@ export const useNHTSA = () => { * instance * @returns {Promise} Promise that resolves to a NhtsaResponse object */ - const get = async ( + const get = async ( url?: string | CreateUrlOptions, options: RequestInit & { saveUrl?: boolean } = { saveUrl: true, method: 'GET', } - ): Promise> => { - /* If url is an object, create and store a url string from it */ - if (url && getTypeof(url) === 'object') { + ): Promise> => { + /* Validate all function arguments */ + catchInvalidArguments({ + args: [ + { + name: 'url', + value: url, + types: ['string', 'object'], + }, + { + name: 'options', + value: options, + types: ['object'], + }, + ], + }) + + /* + * Special note about typeof: + * Values of null, arrray, new Date(), new String(), Error, and /regex/ are all typeof 'object'. + * catchInvalidArguments() will correctly throw an error if url is neither a string nor object + * in these cases as it uses our custom getTypeof() function to check the type. + */ + + /* If url is a string, set it as the cached url if options.saveUrl */ + if (typeof url === 'string' && options.saveUrl) { + _url = url + } + + /* + * If url is an object, create a url string and set it as the cached url if options.saveUrl + */ + if (typeof url === 'object') { url = createCachedUrl({ - ...(url as CreateUrlOptions), + ...url, saveUrl: options.saveUrl, }) } - url = getTypeof(url) === 'string' ? url : getCachedUrl() + /* If url is not a string by now, attempt getting it from the cache */ + url = typeof url === 'string' ? url : getCachedUrl() + /* Ensure url is defined and is a string before fetching */ catchInvalidArguments({ args: [ { @@ -237,102 +288,93 @@ export const useNHTSA = () => { required: true, types: ['string'], }, - { - name: 'options', - value: options, - types: ['object'], - }, ], }) - /* url guaranteed to be a string at this point, so ok to cast it */ - if (options.saveUrl) { - _url = url as string - } - - const nhtsaResponse: NhtsaResponse = await fetch(url as string, options) + /* Fetch and parse the API response */ + const nhtsaResponse: NhtsaResponse = await fetch( + url, + options + ) .then(async (response) => { if (!response) { - throw Error( - `APi responded with an error, no response object returned` - ) + throw Error(`API responded with an unknown error or sent no response`) } + + /* Capture response details for error messages */ const contentType = response.headers.get('content-type') const responseDetails = + `{ ` + `content-type: ${contentType}, ` + - `responseStatus: ${response.status}, ` + - `responseUrl: ${response.url}` + `response.ok: ${response.ok}, ` + + `response.status: ${response.status}, ` + + `response.statusText: ${response.statusText}, ` + + `response.url: ${response.url} ` + + `}` if (!response.ok) { - throw Error(`APi response not ok, got ${responseDetails}`) + throw Error(`API response not ok, response was: ${responseDetails}`) } + /* Ensure response is in JSON format */ const jsonTypes = ['application/json', 'text/json'] const isJson = jsonTypes.some((type) => contentType?.includes(type)) if (!isJson || typeof response.json !== 'function') { - throw Error(`API response not in JSON format, got ${responseDetails}`) + throw Error( + `API response not in JSON format, response was: ${responseDetails}` + ) } - const data: NhtsaResponse = await response.json() + /* Ensure response data exists */ + const data = await response.json() if (!data) { - throw Error(`VPIC API returned no data, got ${responseDetails}`) - } else return data + throw Error(`API returned no data, response was: ${responseDetails}`) + } + /* Convert lowercase 'results' key to uppercase 'Results' key */ + if (data.results) { + data.Results = data.results + delete data.results + } + /* Convert lowercase 'count' key to uppercase 'Count' key */ + if (data.count) { + data.Count = data.count + delete data.count + } + /* Convert lowercase 'message' key to uppercase 'Message' key */ + if (data.message) { + data.Message = data.message + delete data.message + } + /* Return the parsed API response */ + return data }) .catch((error: Error) => { - error.message = `There was an error fetching API data: ${error.message}` + error.message = `There was an error fetching NHTSA API data: ${error.message}` return rejectWithError(error) }) - /* Return the completed ApiResponse */ + /* Return the parsed API response */ return nhtsaResponse } /** - * This uses native `fetch()` to make a _POST_ request to the NHTSA API. Returns a promise that - * resolves to a `NhtsaResponse` object, where `T` is the type of the objects in the - * `Results` array of the `NhtsaResponse` object, e.g. `NhtsaResponse`. + * This uses native `fetch()` to make a _POST_ request to the NHTSA API. * * `DecodeVinValueBatch` is the only NHTSA API endpoint that uses POST requests. * - * This method sets specific POST fetch options before calling get(). All POST requests should use - * post() instead of calling get() directly as get() does not set the correct fetch options for - * POST. - * * --- * - * ### url - * - * `url` is optional. If not provided, the URL string saved in the composable instance will be - * used for the request. If no URL has been saved in the composable instance, an error will be - * thrown stating that a url arg is required. - * - * `url` - either a full url `string` or an `object` of type `CreateUrlOptions` - * - * - `required` if there is no url cached in the composable instance - * - if a `CreateUrlOptions` object is provided, `createCachedUrl` will be called with the object - * to build and cache the url before making the request - * - if a string is provided, it is assumed the string is a full url and it will be cached as such - * in the composable instance before making the request - * * ### Options * - * If you need to set custom fetch options for request, set them in the `options` object. - * - * `options`: Object containing RequestInit options + custom options - * - `options.saveUrl` - Whether to save the URL string in the composable instance after - * the request is made (default: true). - * - `options.body` - string to send in the NHTSA API POST request. (example: "modelYear=2009") - * - Any other valid `RequestInit` options: - * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request - * - * If `options.saveUrl` is true, the URL string will be saved in the composable instance after the - * request is made. If false, the URL string will _not_ be saved in the composable instance and a - * new URL string will be need to be created for the next request. + * If you need to set custom fetch options for the Request, set them in the `options` object. * * `options.body` should be a string consisting of the body request parameters in a format - * described further in the `DecodeVinValueBatch` endpoint documentation. Put simply, by default, - * "DATA" is prepended and "&format=json" appended to `options.body`, even if you - * don't provide `options.body`. This is required format for the NHTSA API POST request. + * described further in the `DecodeVinValueBatch` endpoint documentation. By default, "DATA" is + * prepended and "&format=json" appended to `options.body`, even if you don't provide + * `options.body`. This is required format for the NHTSA API POST request. + * + * This function otherwise mirrors parameters for the useNHTSA.get() function, see that function + * for more details. * * @param {string} [url] - URL string to make the POST request to * @param [options] - Object containing RequestInit options + custom options @@ -343,10 +385,10 @@ export const useNHTSA = () => { * @returns {Promise>} Promise that resolves to a NhtsaResponse object * containing the response data. */ - const post = async ( + const post = async ( url?: string | CreateUrlOptions, options: RequestInit & { saveUrl?: boolean } = { saveUrl: true } - ): Promise> => { + ): Promise> => { /* If url is an object, create and store a url string from it */ if (url && getTypeof(url) === 'object') { /* POST requests should not include query string */ @@ -359,6 +401,7 @@ export const useNHTSA = () => { url = getTypeof(url) === 'string' ? url : getCachedUrl() + /* Validate url, RequestInit options, and options.body is a string */ catchInvalidArguments({ args: [ { @@ -371,16 +414,18 @@ export const useNHTSA = () => { name: 'options', value: options, types: ['object'], + required: true, }, { name: 'options.body', value: options.body, + required: true, types: ['string'], }, ], }) - /* Set specific POST fetch options, url and body guaranteed to be a string after this point */ + /* Set specific POST fetch options */ return await get(url, { ...options, method: 'POST', diff --git a/packages/lib/src/api/vpic/README.md b/packages/lib/src/api/vpic/README.md new file mode 100644 index 00000000..ede36279 --- /dev/null +++ b/packages/lib/src/api/vpic/README.md @@ -0,0 +1,13 @@ +# /vpic + +## `/vpic` exports the following: + +- `/vpic/endpoints` contains all 24 helper functions, one for each endpoint + (DecodeVin, GetAllMakes, etc). + +- `/vpic/types` contains all the types used by the NHTSA API. + - Each endpoint response type is the endpoint name appended by `Results`, + such as: `Results` + - For example, endpoint `DecodeVin` would return a response object containg a Results key + that is an array of objects of type `DecodeVinResults`. + - See the documentation of each endpoint for more details. diff --git a/packages/lib/src/api/vpic/__tests__/_decodeVin.test-d.ts b/packages/lib/src/api/vpic/__tests__/_decodeVin.test-d.ts new file mode 100644 index 00000000..3b9779aa --- /dev/null +++ b/packages/lib/src/api/vpic/__tests__/_decodeVin.test-d.ts @@ -0,0 +1,89 @@ +import { describe, expectTypeOf, test } from 'vitest' + +import { decodeVin, type DecodeVinResponse } from '../_decodeVin' + +const vin = 'WA1A4AFY2J2008189' +const modelYearString = '2018' +const modelYearNumber = 2018 +const modelYear = modelYearNumber + +test('Typecheck: decodeVin() - parameters - ', () => { + expectTypeOf().toBeFunction() + expectTypeOf().parameters.toMatchTypeOf< + [ + vin: string, + options?: boolean | { modelYear?: string | number } | undefined, + doFetch?: boolean | undefined, + ] + >() +}) + +describe('Typecheck: products() - returns correct type of response data - ', () => { + /***************************** + * doFetch = true | undefined (default) + ****************************/ + test('with vin', async () => { + const result = await decodeVin(vin) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with vin and doFetch = true', async () => { + const result = await decodeVin(vin, true) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with vin and options = undefined', async () => { + const result = await decodeVin(vin, undefined) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with vin and options = {}', async () => { + const result = await decodeVin(vin, {}) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with vin, options = {}, and doFetch = true', async () => { + const result = await decodeVin(vin, {}, true) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with vin and options.modelYear as string', async () => { + const result = await decodeVin(vin, { modelYear: modelYearString }) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with vin and options.modelYear as number', async () => { + const result = await decodeVin(vin, { modelYear: modelYearNumber }) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with vin, options.modelYear, and doFetch = true', async () => { + const result = await decodeVin(vin, { modelYear }, true) + expectTypeOf(result).toEqualTypeOf() + }) +}) + +describe('Typecheck: decodeVin() - returns string if doFetch = false - ', () => { + /***************************** + * doFetch = false + ****************************/ + test('with vin and doFetch = false', async () => { + const result = await decodeVin(vin, false) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with vin, options = undefined, and doFetch = false', async () => { + const result = await decodeVin(vin, undefined, false) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with vin, options = {}, and doFetch = false', async () => { + const result = await decodeVin(vin, {}, false) + expectTypeOf(result).toEqualTypeOf() + }) + + test('with vin, options.modelYear, and doFetch = false', async () => { + const result = await decodeVin(vin, { modelYear }, false) + expectTypeOf(result).toEqualTypeOf() + }) +}) diff --git a/packages/lib/src/api/vpic/__tests__/_decodeVin.test.ts b/packages/lib/src/api/vpic/__tests__/_decodeVin.test.ts new file mode 100644 index 00000000..546ee905 --- /dev/null +++ b/packages/lib/src/api/vpic/__tests__/_decodeVin.test.ts @@ -0,0 +1,358 @@ +import { beforeEach, describe, expect, test } from 'vitest' +import { decodeVin } from '../_decodeVin' + +// Mocks +import { createMockResponse } from '.vitest/helpers' +import { mockResults } from '.vitest/data' + +const vin = 'WA1A4AFY2J2008189' +const modelYearString = '2018' +const modelYearNumber = 2018 +const modelYear = modelYearNumber + +// https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/{vin}?format=json +// https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/{vin}?modelYear={modelYear}&format=json + +const baseUrl = 'https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin' +const mockUrl = `${baseUrl}/${vin}?format=json` +const mockUrlModelYear = `${baseUrl}/${vin}?modelYear=${modelYear}&format=json` + +const expectedFetchOptions = { + saveUrl: true, + method: 'GET', +} + +type TestEach = { + description: string + args: Parameters + expectedUrl: string +} + +describe('decodeVin()', () => { + beforeEach(() => { + fetchMock.resetMocks() + fetchMock.mockResolvedValue(createMockResponse(mockResults)) + }) + + test('Is a function that returns a Promise', () => { + expect(decodeVin).toBeDefined() + expect(decodeVin).toBeInstanceOf(Function) + expect(decodeVin(vin)).toBeInstanceOf(Promise) + }) + + /***************************** + * doFetch = true (default) + ****************************/ + describe('Fetches API data with: ', () => { + test.each([ + // vin with no options + { + description: 'vin and no options', + args: [vin], + expectedUrl: mockUrl, + }, + { + description: 'vin, no options, and doFetch = true', + args: [vin, true], + expectedUrl: mockUrl, + }, + // options.modelYear + { + description: 'vin and options.modelYear as string', + args: [vin, { modelYear: modelYearString }], + expectedUrl: mockUrlModelYear, + }, + { + description: 'vin, options.modelYear as string, and doFetch = true', + args: [vin, { modelYear: modelYearString }, true], + expectedUrl: mockUrlModelYear, + }, + { + description: 'vin and options.modelYear as number', + args: [vin, { modelYear: modelYearNumber }], + expectedUrl: mockUrlModelYear, + }, + { + description: 'vin, options.modelYear as number, and doFetch = true', + args: [vin, { modelYear: modelYearNumber }, true], + expectedUrl: mockUrlModelYear, + }, + ])('$description', async ({ args, expectedUrl }) => { + const results = await decodeVin(...args) + expect(results).toEqual(mockResults) + expect(fetchMock).toHaveBeenCalledWith(expectedUrl, expectedFetchOptions) + expect(fetchMock.requests().length).toEqual(1) + expect(fetchMock.requests()[0].url).toEqual(expectedUrl) + expect(fetchMock.requests()[0].method).toEqual('GET') + }) + }) + + /***************************** + * doFetch = false + ***************************/ + describe('Returns API URL string with: ', () => { + test.each([ + { + description: 'vin and doFetch = false', + args: [vin, false], + expectedUrl: mockUrl, + }, + // options.modelYear + { + description: 'vin, options.modelYear as string and doFetch = false', + args: [vin, { modelYear: modelYearString }, false], + expectedUrl: mockUrlModelYear, + }, + { + description: 'vin, options.modelYear as number and doFetch = false', + args: [vin, { modelYear: modelYearNumber }, false], + expectedUrl: mockUrlModelYear, + }, + ])('$description', async ({ args, expectedUrl }) => { + const results = await decodeVin(...args) + + expect(results).toEqual(expectedUrl) + expect(fetchMock.requests().length).toEqual(0) + }) + }) + + /***************************** + * rejects with error + ***************************/ + describe('Rejects with Error if: ', () => { + test.each([123, { object: 123 }, ['array'], true, false, null, () => {}])( + 'vin is undefined or is not a string, <%s>', + async (arg) => { + await expect(() => + decodeVin( + // @ts-expect-error Type (x) is not assignable to type 'string + arg + ) + ).rejects.toThrowError( + /error validating argument named "vin", it is required and must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each(['string', 123, ['array'], null, () => {}])( + 'options is neither an object nor boolean, <%s>', + async (arg) => { + await expect(() => + decodeVin( + vin, + // @ts-expect-error Type (x) is not assignable to type ... + arg + ) + ).rejects.toThrowError( + /error validating argument named "options", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test.each([{ object: 123 }, ['array'], true, false, null, () => {}])( + 'options.modelYear is neither a string nor number, <%s>', + async (arg) => { + await expect(() => + decodeVin(vin, { + // @ts-expect-error Type (x) is not assignable to type 'string | number | undefined + modelYear: arg, + }) + ).rejects.toThrowError( + /error validating argument named "modelYear", must be of type/ + ) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + + test('with invalid options', async () => { + await expect(() => + decodeVin(vin, { + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and doFetch = true', async () => { + await expect(() => + decodeVin( + vin, + { + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + }, + true + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and doFetch = false', async () => { + await expect(() => + decodeVin( + vin, + { + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + }, + false + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and wrong type for valid options', async () => { + await expect(() => + decodeVin(vin, { + notAnOption: 'no TS error, modelYear error takes precedence', + // @ts-expect-error Type 'never[]' is not assignable to type 'string | undefined' + modelYear: [], + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options', async () => { + await expect(() => + decodeVin(vin, { + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + modelYear, + }) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options and doFetch = true', async () => { + await expect(() => + decodeVin( + vin, + { + // @ts-expect-error 'notAnOption' does not exist in type ... + notAnOption: 'invalid option with TS error', + modelYear, + }, + true + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and valid options and doFetch = false', async () => { + await expect(() => + decodeVin( + vin, + { + // @ts-expect-error Type 'string' is not assignable to type 'never'. + notAnOption: 'invalid option with TS error', + modelYear, + }, + false + ) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + }) +}) + +/******************************* + * These are here to test the IDE intellisense tooltips when hovering the function and results, + * to ensure the correct types are displayed for the end user. These are not meant to be + * run as tests and testing of hovering must be done manually. + * + * The actual types and typed returns are tested in decodeVin.test-d.ts via Vitest type checking, + * these are simply hovering tooltip tests. + * + * This cannot be achieved in test.each() tests because the way .each() is typed, it will show all + * possible return types at once, which is not helpful for the end user. + * + * We cannot use expectTypeOf() because it will not work with test.each() tests in the same + * file, and expectTypeOf() will not show the IDE tooltips as a user would see them. + * + * Order of `Results` keys does not matter, only that they are all present with no extraneous + * keys. + ******************************/ +describe.skip('IDE Tooltips - manual test of results type on hover', async () => { + test('/DecodeVin/{vin}', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: DecodeVinResultsData[]; + SearchCriteria: string | null; + } + ******************************/ + const result_1 = await decodeVin(vin) + const result_2 = await decodeVin(vin, true) + const result_3 = await decodeVin(vin, undefined) + + for (const result of [result_1, result_2, result_3]) { + expect(result) + } + }) + + test('/DecodeVin/{vin}?modelYear={modelYear}', async () => { + /******Expected Tooltip*******\ + const result_x: { + Count: number; + Message: string; + Results: DecodeVinResultsData[]; + SearchCriteria: string | null; + } + ******************************/ + const result_1 = await decodeVin(vin, { modelYear: modelYearString }) + const result_2 = await decodeVin(vin, { modelYear: modelYearNumber }) + const result_3 = await decodeVin(vin, { modelYear }, true) + const result_4 = await decodeVin(vin, { modelYear }, undefined) + + for (const result of [result_1, result_2, result_3, result_4]) { + expect(result) + } + }) + + test('returns a string if doFetch = false', async () => { + /******Expected Tooltip*******\ + const result_x: string + ******************************/ + + /* https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/{vin}?format=json */ + const result_1 = await decodeVin(vin, false) + const result_2 = await decodeVin(vin, {}, false) + const result_3 = await decodeVin(vin, undefined, false) + + /* https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/{vin}?modelYear={modelYear}&format=json */ + const result_4 = await decodeVin(vin, { modelYear: modelYearString }, false) + const result_5 = await decodeVin(vin, { modelYear: modelYearNumber }, false) + + for (const result of [result_1, result_2, result_3, result_4, result_5]) { + expect(result) + } + }) +}) diff --git a/packages/lib/src/api/vpic/__tests__/index.test.ts b/packages/lib/src/api/vpic/__tests__/index.test.ts new file mode 100644 index 00000000..1907c69f --- /dev/null +++ b/packages/lib/src/api/vpic/__tests__/index.test.ts @@ -0,0 +1,149 @@ +import { describe, expect, it } from 'vitest' +import { + DecodeVin, + DecodeVinExtended, + DecodeVinValues, + DecodeVinValuesBatch, + DecodeVinValuesExtended, + DecodeWMI, + GetAllMakes, + GetAllManufacturers, + GetCanadianVehicleSpecifications, + GetEquipmentPlantCodes, + GetMakeForManufacturer, + GetMakesForManufacturerAndYear, + GetMakesForVehicleType, + GetManufacturerDetails, + GetModelsForMake, + GetModelsForMakeId, + GetModelsForMakeIdYear, + GetModelsForMakeYear, + GetParts, + GetVehicleTypesForMake, + GetVehicleTypesForMakeId, + GetVehicleVariableList, + GetVehicleVariableValuesList, + GetWMIsForManufacturer, +} from '../' + +describe('api/index.ts', () => { + it('exports DecodeVin function', () => { + expect(DecodeVin).toBeDefined() + expect(DecodeVin).toBeInstanceOf(Function) + }) + + it('exports DecodeVinExtended function', () => { + expect(DecodeVinExtended).toBeDefined() + expect(DecodeVinExtended).toBeInstanceOf(Function) + }) + + it('exports DecodeVinValues function', () => { + expect(DecodeVinValues).toBeDefined() + expect(DecodeVinValues).toBeInstanceOf(Function) + }) + + it('exports DecodeVinValuesBatch function', () => { + expect(DecodeVinValuesBatch).toBeDefined() + expect(DecodeVinValuesBatch).toBeInstanceOf(Function) + }) + + it('exports DecodeVinValuesExtended function', () => { + expect(DecodeVinValuesExtended).toBeDefined() + expect(DecodeVinValuesExtended).toBeInstanceOf(Function) + }) + + it('exports DecodeWMI function', () => { + expect(DecodeWMI).toBeDefined() + expect(DecodeWMI).toBeInstanceOf(Function) + }) + + it('exports GetAllMakes function', () => { + expect(GetAllMakes).toBeDefined() + expect(GetAllMakes).toBeInstanceOf(Function) + }) + + it('exports GetAllManufacturers function', () => { + expect(GetAllManufacturers).toBeDefined() + expect(GetAllManufacturers).toBeInstanceOf(Function) + }) + + it('exports GetCanadianVehicleSpecifications function', () => { + expect(GetCanadianVehicleSpecifications).toBeDefined() + expect(GetCanadianVehicleSpecifications).toBeInstanceOf(Function) + }) + + it('exports GetEquipmentPlantCodes function', () => { + expect(GetEquipmentPlantCodes).toBeDefined() + expect(GetEquipmentPlantCodes).toBeInstanceOf(Function) + }) + + it('exports GetMakeForManufacturer function', () => { + expect(GetMakeForManufacturer).toBeDefined() + expect(GetMakeForManufacturer).toBeInstanceOf(Function) + }) + + it('exports GetMakesForManufacturerAndYear function', () => { + expect(GetMakesForManufacturerAndYear).toBeDefined() + expect(GetMakesForManufacturerAndYear).toBeInstanceOf(Function) + }) + + it('exports GetMakesForVehicleType function', () => { + expect(GetMakesForVehicleType).toBeDefined() + expect(GetMakesForVehicleType).toBeInstanceOf(Function) + }) + + it('exports GetManufacturerDetails function', () => { + expect(GetManufacturerDetails).toBeDefined() + expect(GetManufacturerDetails).toBeInstanceOf(Function) + }) + + it('exports GetModelsForMake function', () => { + expect(GetModelsForMake).toBeDefined() + expect(GetModelsForMake).toBeInstanceOf(Function) + }) + + it('exports GetModelsForMakeId function', () => { + expect(GetModelsForMakeId).toBeDefined() + expect(GetModelsForMakeId).toBeInstanceOf(Function) + }) + + it('exports GetModelsForMakeIdYear function', () => { + expect(GetModelsForMakeIdYear).toBeDefined() + expect(GetModelsForMakeIdYear).toBeInstanceOf(Function) + }) + + it('exports GetModelsForMakeYear function', () => { + expect(GetModelsForMakeYear).toBeDefined() + expect(GetModelsForMakeYear).toBeInstanceOf(Function) + }) + + it('exports GetParts function', () => { + expect(GetParts).toBeDefined() + expect(GetParts).toBeInstanceOf(Function) + }) + + it('exports GetVehicleTypesForMake function', () => { + expect(GetVehicleTypesForMake).toBeDefined() + expect(GetVehicleTypesForMake).toBeInstanceOf(Function) + }) + + it('exports GetVehicleTypesForMakeId function', () => { + expect(GetVehicleTypesForMakeId).toBeDefined() + expect(GetVehicleTypesForMakeId).toBeInstanceOf(Function) + }) + + it('exports GetVehicleVariableList function', () => { + expect(GetVehicleVariableList).toBeDefined() + expect(GetVehicleVariableList).toBeInstanceOf(Function) + }) + + it('exports GetVehicleVariableValuesList function', () => { + expect(GetVehicleVariableValuesList).toBeDefined() + expect(GetVehicleVariableValuesList).toBeInstanceOf(Function) + }) + + it('exports GetWMIsForManufacturer function', () => { + expect(GetWMIsForManufacturer).toBeDefined() + expect(GetWMIsForManufacturer).toBeInstanceOf(Function) + }) +}) diff --git a/packages/lib/src/api/vpic/_decodeVin.ts b/packages/lib/src/api/vpic/_decodeVin.ts new file mode 100644 index 00000000..4f08b5fb --- /dev/null +++ b/packages/lib/src/api/vpic/_decodeVin.ts @@ -0,0 +1,387 @@ +/** + * @module api/vpic/endpoints/decodeVin + * @category API - VPIC (VIN Decoding) + */ + +import { useNHTSA } from '@/api' +import { catchInvalidArguments, rejectWithError } from '@/utils' +import type { NhtsaResponse } from '@/types' + +/** + * # DecodeVin VPIC Endpoint + * + * ::: tip :bulb: More Information + * See: [DecodeVin Documentation](/guide/vpic/endpoints/decode-vin) + * ::: + * + * You can use `decodeVin()` as a thin wrapper for the `DecodeVin` VPIC API endpoint. + * + * From the [Official Documentation](https://vpic.nhtsa.dot.gov/api/): + * + * > The Decode VIN API will decode the VIN and the decoded output will be made available in the + * format of Key-value pairs. The IDs (VariableID and ValueID) represent the unique ID associated + * with the Variable/Value. In case of text variables, the ValueID is not applicable. Model Year + * in the request allows for the decoding to specifically be done in the current, or older + * (pre-1980), model year ranges. It is recommended to always send in the model year. 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. + * + * ## Options + * + * The DecodeVin endpoint uses a path and/or query string to get different data. This function uses + * the options passed to build the correct url path and query string. + * + * Valid `options` are: + * + * - `modelYear` - Model Year of the vehicle to search for (optional) + * + * All are optional and the only valid options you can pass to this function. + * + * Real Example URLs: + * - https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/5UXWX7C5*BA?format=json + * - https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/5UXWX7C5*BA?modelYear=2011&format=json + * + * Note that `format=json` will always be appended to the query string when using this package as it + * is required by the VPIC API. + * + * Returned data will be structured as `{ Count, Message, Results, SearchCriteria }` for any + * combination of options. + * + * See the `Returns` section below for more details. + * + * ## Errors + * + * This function will throw Errors in the following use cases: + * + * - If you pass options not listed above. + * - If you pass a valid options but include options not listed above. + * + * It will also throw Errors if there are problems with the fetch request or response. + * + * ## Usage + * + * The following describes in more detail the use of the different options and the paths they use. + * + * ### Decode a VIN + * + * If you pass only a `vin` and no options, the path and query string `/DecodeVin/{vin}?format=json` + * will be used. + * + * You can provide either a full or partial VIN to decode. + * + * Example: Decode a full VIN + * ```js + * await decodeVin('WVWVA7AU0KW204939') + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.Value) // "Golf R", "2019", "Volkswagen", etc. + * console.log(result.ValueId) // "1234", "567", etc. + * console.log(result.Variable) // "Model", "Model Year", etc. + * console.log(result.VariableId) // 142, 143, etc. + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await decodeVin('5UXWX7C5*BA', false) + * console.log(url) // "https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/WVWVA7AU0KW204939?format=json" + * ``` + * + * Example: Decode a Partial VIN + * ```js + * await decodeVin('5UXWX7C5*BA') + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.Value) // "X5", "BMW", etc. + * console.log(result.ValueId) // "1234", "567", etc. + * console.log(result.Variable) // "Model", "Model Year", etc. + * console.log(result.VariableId) // 142, 143, etc. + * }) + * }) + * ``` + * + * ### Decode a VIN with a Specific Model Year + * + * Uses the `Products API` to get all available models in the recalls dataset for a specific + * `modelYear` and `make`. + * + * If you pass a `options.modelYear`, the path and query string + * `/DecodeVin/{vin}?modelYear={modelYear}&format=json` will be used. + * + * Example: Decode a VIN with a specific model year + * ```js + * await decodeVin('5UXWX7C5*BA', { modelYear: 2011 }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.Value) // "X5", "BMW", etc. + * console.log(result.ValueId) // "1234", "567", etc. + * console.log(result.Variable) // "Model", "Model Year", etc. + * console.log(result.VariableId) // 142, 143, etc. + * }) + * }) + * + * // or use doFetch = false to get the url string instead of fetching the data + * const url = await decodeVin('5UXWX7C5*BA', { modelYear: 2011 }, false) + * console.log(url) + * // "https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/5UXWX7C5*BA?modelYear=2011&format=json" + * ``` + * + * ## Returns + * + * The return from this function will be a parsed JSON response, typed to reflect the different + * types of objects you can expect to get back from the API in the `Results[]`. + * + * Returned data will be stuctured as `{ Count, Message, Results, SearchCriteria }`. + * + * - `Count` - The number of results returned + * - `Message` - A message from the NHTSA API + * - `Results` - An array of objects containing the response data + * - `SearchCriteria` - The search criteria used to get the results + * + * The `Results[]` will be typed as `DecodeVinResultsData`. See that type for a list of all + * possible properties returned in the `Results` array. + * + * @param vin - Vehicle Identification Number (full or partial) + * @param [options] - Object of Query Search names and values to append to the URL as a query string + * @param [options.modelYear] - Optional Model Year search parameter + * @param [doFetch=true] - If false, will return the url string instead of fetching the data + * (default: `true`) + * @returns - Parsed API response `object` -or- url `string` + */ +function decodeVin( + vin: string, + options?: { modelYear?: string | number }, + doFetch?: true +): Promise +function decodeVin( + vin: string, + options: { modelYear?: string | number } | undefined, + doFetch: false +): Promise +function decodeVin(vin: string, doFetch: true): Promise +function decodeVin(vin: string, doFetch: false): Promise +function decodeVin(vin: string): Promise +function decodeVin( + vin: string, + options?: + | { + modelYear?: string | number + } + | boolean, + doFetch?: boolean +): Promise +/* Implementation */ +async function decodeVin( + vin: string, + options?: + | { + modelYear?: string | number + } + | boolean, + doFetch = true +): Promise { + const endpointName = 'DecodeVin' + + try { + if (typeof options === 'boolean') { + /* If first argument is boolean, it is doFetch */ + doFetch = options + /* Set options undefined so it will pass argument check below, otherwise invalid type */ + options = undefined + } + + catchInvalidArguments({ + args: [ + { name: 'vin', value: vin, required: true, types: ['string'] }, + { + name: 'options', + value: options, + types: ['object'], + validKeys: ['modelYear'], + }, + { + name: 'modelYear', + value: options?.modelYear, + types: ['string', 'number'], + }, + ], + }) + + const { get, createCachedUrl, getCachedUrl } = useNHTSA() + + createCachedUrl({ endpointName, path: vin, params: options }) + + if (!doFetch) { + return getCachedUrl() + } else { + return get() + } + } catch (error) { + return rejectWithError(error) + } +} + +export { decodeVin } + +/** + * Objects in the `Results` array of `DecodeVin` endpoint response. + */ +export type DecodeVinResultsData = { + Value: string | null + ValueId: string | null + Variable: DecodeVinVariable + VariableId: number +} + +/** + * Possible `DecodeVinResults.Variable` values for DecodeVin endpoint. + * + * This type is here to provide a list of possible values manually extracted from an actual API + * response. There are some things to note: + * - Names are ordered to mirror actual API response order. + * - Names have been known to change slightly or be added/removed. + * - Some listed here could be missing from the API response. + * - There may be more actual values than listed here. + * + * Last Updated: 02/14/2023 + */ +export type DecodeVinVariable = + | 'Suggested VIN' + | 'Error Code' + | 'Possible Values' + | 'Additional Error Text' + | 'Error Text' + | 'Vehicle Descriptor' + | 'Destination Market' + | 'Make' + | 'Manufacturer Name' + | 'Model' + | 'Model Year' + | 'Plant City' + | 'Series' + | 'Trim' + | 'Vehicle Type' + | 'Plant Country' + | 'Plant Company Name' + | 'Plant State' + | 'Trim2' + | 'Series2' + | 'Note' + | 'Base Price ($)' + | 'Non-Land Use' + | 'Body Class' + | 'Doors' + | 'Windows' + | 'Wheel Base Type' + | 'Track Width (inches)' + | 'Gross Vehicle Weight Rating From' + | 'Bed Length (inches)' + | 'Curb Weight (pounds)' + | 'Wheel Base (inches) From' + | 'Wheel Base (inches) To' + | 'Gross Combination Weight Rating From' + | 'Gross Combination Weight Rating To' + | 'Gross Vehicle Weight Rating To' + | 'Bed Type' + | 'Cab Type' + | 'Trailer Type Connection' + | 'Trailer Body Type' + | 'Trailer Length (feet)' + | 'Other Trailer Info' + | 'Number of Wheels' + | 'Wheel Size Front (inches)' + | 'Wheel Size Rear (inches)' + | 'Entertainment System' + | 'Steering Location' + | 'Number of Seats' + | 'Number of Seat Rows' + | 'Transmission Style' + | 'Transmission Speeds' + | 'Drive Type' + | 'Axles' + | 'Axle Configuration' + | 'Brake System Type' + | 'Brake System Description' + | 'Other Battery Info' + | 'Battery Type' + | 'Number of Battery Cells per Module' + | 'Battery Current (Amps) From' + | 'Battery Voltage (Volts) From' + | 'Battery Energy (kWh) From' + | 'EV Drive Unit' + | 'Battery Current (Amps) To' + | 'Battery Voltage (Volts) To' + | 'Battery Energy (kWh) To' + | 'Number of Battery Modules per Pack' + | 'Number of Battery Packs per Vehicle' + | 'Charger Level' + | 'Charger Power (kW)' + | 'Engine Number of Cylinders' + | 'Displacement (CC)' + | 'Displacement (CI)' + | 'Displacement (L)' + | 'Engine Stroke Cycles' + | 'Engine Model' + | 'Engine Power (kW)' + | 'Fuel Type - Primary' + | 'Valve Train Design' + | 'Engine Configuration' + | 'Fuel Type - Secondary' + | 'Fuel Delivery / Fuel Injection Type' + | 'Engine Brake (hp) From' + | 'Cooling Type' + | 'Engine Brake (hp) To' + | 'Electrification Level' + | 'Other Engine Info' + | 'Turbo' + | 'Top Speed (MPH)' + | 'Engine Manufacturer' + | 'Pretensioner' + | 'Seat Belt Type' + | 'Other Restraint System Info' + | 'Curtain Air Bag Locations' + | 'Seat Cushion Air Bag Locations' + | 'Front Air Bag Locations' + | 'Knee Air Bag Locations' + | 'Side Air Bag Locations' + | 'Anti-lock Braking System (ABS)' + | 'Electronic Stability Control (ESC)' + | 'Traction Control' + | 'Tire Pressure Monitoring System (TPMS) Type' + | 'Active Safety System Note' + | 'Auto-Reverse System for Windows and Sunroofs' + | 'Automatic Pedestrian Alerting Sound (for Hybrid and EV only)' + | 'Event Data Recorder (EDR)' + | 'Keyless Ignition' + | 'SAE Automation Level From' + | 'SAE Automation Level To' + | 'Adaptive Cruise Control (ACC)' + | 'Crash Imminent Braking (CIB)' + | 'Blind Spot Warning (BSW)' + | 'Forward Collision Warning (FCW)' + | 'Lane Departure Warning (LDW)' + | 'Lane Keeping Assistance (LKA)' + | 'Backup Camera' + | 'Parking Assist' + | 'Bus Length (feet)' + | 'Bus Floor Configuration Type' + | 'Bus Type' + | 'Other Bus Info' + | 'Custom Motorcycle Type' + | 'Motorcycle Suspension Type' + | 'Motorcycle Chassis Type' + | 'Other Motorcycle Info' + | 'Dynamic Brake Support (DBS)' + | 'Pedestrian Automatic Emergency Braking (PAEB)' + | 'Automatic Crash Notification (ACN) / Advanced Automatic Crash Notification (AACN)' + | 'Daytime Running Light (DRL)' + | 'Headlamp Light Source' + | 'Semiautomatic Headlamp Beam Switching' + | 'Adaptive Driving Beam (ADB)' + | 'Rear Cross Traffic Alert' + | 'Rear Automatic Emergency Braking' + | 'Blind Spot Intervention (BSI)' + | 'Lane Centering Assistance' + | (string & Record) + +export type DecodeVinResponse = NhtsaResponse diff --git a/packages/lib/src/api/endpoints/DecodeVin.ts b/packages/lib/src/api/vpic/endpoints/DecodeVin.ts similarity index 98% rename from packages/lib/src/api/endpoints/DecodeVin.ts rename to packages/lib/src/api/vpic/endpoints/DecodeVin.ts index 764f6fbc..77e0ea8f 100644 --- a/packages/lib/src/api/endpoints/DecodeVin.ts +++ b/packages/lib/src/api/vpic/endpoints/DecodeVin.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/DecodeVin - * @category API Endpoints + * @module api/vpic/endpoints/DecodeVin + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [DecodeVin Documentation](/api/endpoints/decode-vin) + * See: [DecodeVin Documentation](/guide/vpic/endpoints/decode-vin) * ::: * * `DecodeVin` decodes a Vehicle Identification Number (VIN) and returns useful information about diff --git a/packages/lib/src/api/endpoints/DecodeVinExtended.ts b/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts similarity index 97% rename from packages/lib/src/api/endpoints/DecodeVinExtended.ts rename to packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts index edfe61fb..b4576218 100644 --- a/packages/lib/src/api/endpoints/DecodeVinExtended.ts +++ b/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/DecodeVinExtended - * @category API Endpoints + * @module api/vpic/endpoints/DecodeVinExtended + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [DecodeVinExtended Documentation](/api/endpoints/decode-vin-extended) + * See: [DecodeVinExtended Documentation](/guide/vpic/endpoints/decode-vin-extended) * ::: * * `DecodeVinExtended` decodes a Vehicle Identification Number (VIN) and returns useful information diff --git a/packages/lib/src/api/endpoints/DecodeVinValues.ts b/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts similarity index 97% rename from packages/lib/src/api/endpoints/DecodeVinValues.ts rename to packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts index 3c38def6..cba668b9 100644 --- a/packages/lib/src/api/endpoints/DecodeVinValues.ts +++ b/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/DecodeVinValues - * @category API Endpoints + * @module api/vpic/endpoints/DecodeVinValues + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [DecodeVinValues Documentation](/api/endpoints/decode-vin-values) + * See: [DecodeVinValues Documentation](/guide/vpic/endpoints/decode-vin-values) * ::: * * `DecodeVinValues` decodes a Vehicle Identification Number (VIN) and returns useful information diff --git a/packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts b/packages/lib/src/api/vpic/endpoints/DecodeVinValuesBatch.ts similarity index 97% rename from packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts rename to packages/lib/src/api/vpic/endpoints/DecodeVinValuesBatch.ts index 47f4ad47..11424fa8 100644 --- a/packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts +++ b/packages/lib/src/api/vpic/endpoints/DecodeVinValuesBatch.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/DecodeVinValuesBatch - * @category API Endpoints + * @module api/vpic/endpoints/DecodeVinValuesBatch + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [DecodeVinValuesBatch Documentation](/api/endpoints/decode-vin-values-batch) + * See: [DecodeVinValuesBatch Documentation](/guide/vpic/endpoints/decode-vin-values-batch) * ::: * * `DecodeVinValuesBatch` decodes a batch of Vehicle Identification Numbers (VINs) and returns diff --git a/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts b/packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts similarity index 97% rename from packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts rename to packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts index f91b622a..bfc1eeb0 100644 --- a/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts +++ b/packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/DecodeVinValuesExtended - * @category API Endpoints + * @module api/vpic/endpoints/DecodeVinValuesExtended + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [DecodeVinValuesExtended Documentation](/api/endpoints/decode-vin-values-extended) + * See: [DecodeVinValuesExtended Documentation](/guide/vpic/endpoints/decode-vin-values-extended) * ::: * * `DecodeVinValuesExtended` decodes a Vehicle Identification Number (VIN) and returns useful diff --git a/packages/lib/src/api/endpoints/DecodeWMI.ts b/packages/lib/src/api/vpic/endpoints/DecodeWMI.ts similarity index 93% rename from packages/lib/src/api/endpoints/DecodeWMI.ts rename to packages/lib/src/api/vpic/endpoints/DecodeWMI.ts index 3c988c4d..677533da 100644 --- a/packages/lib/src/api/endpoints/DecodeWMI.ts +++ b/packages/lib/src/api/vpic/endpoints/DecodeWMI.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/DecodeWMI - * @category API Endpoints + * @module api/vpic/endpoints/DecodeWMI + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [DecodeWMI Documentation](/api/endpoints/decode-wmi) + * See: [DecodeWMI Documentation](/guide/vpic/endpoints/decode-wmi) * ::: * * `DecodeWMI` provides information on the World Manufacturer Identifier for a specific `WMI` code. diff --git a/packages/lib/src/api/endpoints/GetAllMakes.ts b/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts similarity index 81% rename from packages/lib/src/api/endpoints/GetAllMakes.ts rename to packages/lib/src/api/vpic/endpoints/GetAllMakes.ts index b1aae13a..a5f54314 100644 --- a/packages/lib/src/api/endpoints/GetAllMakes.ts +++ b/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts @@ -1,15 +1,15 @@ /** - * @module api/endpoints/GetAllMakes - * @category API Endpoints + * @module api/vpic/endpoints/GetAllMakes + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' -import { rejectWithError } from '@/utils' +import { rejectWithError, validateArgument } from '@/utils' import type { NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetAllMakes Documentation](/api/endpoints/get-all-makes) + * See: [GetAllMakes Documentation](/guide/vpic/endpoints/get-all-makes) * ::: * * `GetAllMakes` provides a list of all the Makes available in the vPIC Dataset. @@ -34,6 +34,12 @@ async function GetAllMakes( const endpointName = 'GetAllMakes' try { + validateArgument({ + name: 'doFetch', + value: doFetch, + types: ['boolean'], + }) + const { get, createCachedUrl, getCachedUrl } = useNHTSA() createCachedUrl({ endpointName }) diff --git a/packages/lib/src/api/endpoints/GetAllManufacturers.ts b/packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts similarity index 94% rename from packages/lib/src/api/endpoints/GetAllManufacturers.ts rename to packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts index 1ef6de48..4dd6e9c2 100644 --- a/packages/lib/src/api/endpoints/GetAllManufacturers.ts +++ b/packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetAllManufacturers - * @category API Endpoints + * @module api/vpic/endpoints/GetAllManufacturers + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetAllManufacturers Documentation](/api/endpoints/get-all-manufacturers) + * See: [GetAllManufacturers Documentation](/guide/vpic/endpoints/get-all-manufacturers) * ::: * * `GetAllManufacturers` provides a list of all the Manufacturers available in the vPIC Dataset. diff --git a/packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts b/packages/lib/src/api/vpic/endpoints/GetCanadianVehicleSpecifications.ts similarity index 95% rename from packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts rename to packages/lib/src/api/vpic/endpoints/GetCanadianVehicleSpecifications.ts index 7813e970..35b84896 100644 --- a/packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts +++ b/packages/lib/src/api/vpic/endpoints/GetCanadianVehicleSpecifications.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetCanadianVehicleSpecifications - * @category API Endpoints + * @module api/vpic/endpoints/GetCanadianVehicleSpecifications + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetCanadianVehicleSpecifications Documentation](/api/endpoints/get-canadian-vehicle-specifications) + * See: [GetCanadianVehicleSpecifications Documentation](/guide/vpic/endpoints/get-canadian-vehicle-specifications) * ::: * * `GetCanadianVehicleSpecifications` returns data from the Canadian Vehicle Specifications (CVS). diff --git a/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts b/packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts similarity index 95% rename from packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts rename to packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts index 8542bffd..80d91281 100644 --- a/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts +++ b/packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetEquipmentPlantCodes - * @category API Endpoints + * @module api/vpic/endpoints/GetEquipmentPlantCodes + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetEquipmentPlantCodes Documentation](/api/endpoints/get-equipment-plant-codes) + * See: [GetEquipmentPlantCodes Documentation](/guide/vpic/endpoints/get-equipment-plant-codes) * ::: * * `GetEquipmentPlantCodes` returns assigned Equipment Plant Codes. Can be filtered by Year, diff --git a/packages/lib/src/api/endpoints/GetMakeForManufacturer.ts b/packages/lib/src/api/vpic/endpoints/GetMakeForManufacturer.ts similarity index 92% rename from packages/lib/src/api/endpoints/GetMakeForManufacturer.ts rename to packages/lib/src/api/vpic/endpoints/GetMakeForManufacturer.ts index 3acf0c84..fbdeb6a8 100644 --- a/packages/lib/src/api/endpoints/GetMakeForManufacturer.ts +++ b/packages/lib/src/api/vpic/endpoints/GetMakeForManufacturer.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetMakeForManufacturer - * @category API Endpoints + * @module api/vpic/endpoints/GetMakeForManufacturer + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetMakeForManufacturer Documentation](/api/endpoints/get-make-for-manufacturer) + * See: [GetMakeForManufacturer Documentation](/guide/vpic/endpoints/get-make-for-manufacturer) * ::: * * `GetMakeForManufacturer` returns all the Makes in the vPIC dataset for a specified manufacturer diff --git a/packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts b/packages/lib/src/api/vpic/endpoints/GetMakesForManufacturerAndYear.ts similarity index 94% rename from packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts rename to packages/lib/src/api/vpic/endpoints/GetMakesForManufacturerAndYear.ts index 99f9a3de..ee2245ec 100644 --- a/packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts +++ b/packages/lib/src/api/vpic/endpoints/GetMakesForManufacturerAndYear.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetMakesForManufacturerAndYear - * @category API Endpoints + * @module api/vpic/endpoints/GetMakesForManufacturerAndYear + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetMakesForManufacturerAndYear Documentation](/api/endpoints/get-makes-for-manufacturer-and-year) + * See: [GetMakesForManufacturerAndYear Documentation](/guide/vpic/endpoints/get-makes-for-manufacturer-and-year) * ::: * * `GetMakesForManufacturerAndYear` returns all the Makes in the vPIC dataset for a specified diff --git a/packages/lib/src/api/endpoints/GetMakesForVehicleType.ts b/packages/lib/src/api/vpic/endpoints/GetMakesForVehicleType.ts similarity index 91% rename from packages/lib/src/api/endpoints/GetMakesForVehicleType.ts rename to packages/lib/src/api/vpic/endpoints/GetMakesForVehicleType.ts index af1cd3b4..f9ab6225 100644 --- a/packages/lib/src/api/endpoints/GetMakesForVehicleType.ts +++ b/packages/lib/src/api/vpic/endpoints/GetMakesForVehicleType.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetMakesForVehicleType - * @category API Endpoints + * @module api/vpic/endpoints/GetMakesForVehicleType + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetMakesForVehicleType Documentation](/api/endpoints/get-makes-for-vehicle-type) + * See: [GetMakesForVehicleType Documentation](/guide/vpic/endpoints/get-makes-for-vehicle-type) * ::: * * `GetMakesForVehicleType` returns all the Makes in the vPIC dataset for a specified vehicle type diff --git a/packages/lib/src/api/endpoints/GetManufacturerDetails.ts b/packages/lib/src/api/vpic/endpoints/GetManufacturerDetails.ts similarity index 94% rename from packages/lib/src/api/endpoints/GetManufacturerDetails.ts rename to packages/lib/src/api/vpic/endpoints/GetManufacturerDetails.ts index 3864bd2b..dbd9d1b9 100644 --- a/packages/lib/src/api/endpoints/GetManufacturerDetails.ts +++ b/packages/lib/src/api/vpic/endpoints/GetManufacturerDetails.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetManufacturerDetails - * @category API Endpoints + * @module api/vpic/endpoints/GetManufacturerDetails + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetMakesForVehicleType Documentation](/api/endpoints/get-makes-for-vehicle-type) + * See: [GetMakesForVehicleType Documentation](/guide/vpic/endpoints/get-makes-for-vehicle-type) * ::: * * `GetManufacturerDetails` provides the details for a specific manufacturer that is requested. diff --git a/packages/lib/src/api/endpoints/GetModelsForMake.ts b/packages/lib/src/api/vpic/endpoints/GetModelsForMake.ts similarity index 91% rename from packages/lib/src/api/endpoints/GetModelsForMake.ts rename to packages/lib/src/api/vpic/endpoints/GetModelsForMake.ts index 2c0ca311..ed6f7aa5 100644 --- a/packages/lib/src/api/endpoints/GetModelsForMake.ts +++ b/packages/lib/src/api/vpic/endpoints/GetModelsForMake.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetModelsForMake - * @category API Endpoints + * @module api/vpic/endpoints/GetModelsForMake + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetModelsForMake Documentation](/api/endpoints/get-models-for-make) + * See: [GetModelsForMake Documentation](/guide/vpic/endpoints/get-models-for-make) * ::: * * `GetModelsForMake` returns the Models in the vPIC dataset for a specified `makeName` diff --git a/packages/lib/src/api/endpoints/GetModelsForMakeId.ts b/packages/lib/src/api/vpic/endpoints/GetModelsForMakeId.ts similarity index 93% rename from packages/lib/src/api/endpoints/GetModelsForMakeId.ts rename to packages/lib/src/api/vpic/endpoints/GetModelsForMakeId.ts index a9470d0b..8f3c8e51 100644 --- a/packages/lib/src/api/endpoints/GetModelsForMakeId.ts +++ b/packages/lib/src/api/vpic/endpoints/GetModelsForMakeId.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetModelsForMakeId - * @category API Endpoints + * @module api/vpic/endpoints/GetModelsForMakeId + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetModelsForMakeId Documentation](/api/endpoints/get-models-for-make-id) + * See: [GetModelsForMakeId Documentation](/guide/vpic/endpoints/get-models-for-make-id) * ::: * * `GetModelsForMakeId` returns the Models in the vPIC dataset for a specified Make whose ID is diff --git a/packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts b/packages/lib/src/api/vpic/endpoints/GetModelsForMakeIdYear.ts similarity index 96% rename from packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts rename to packages/lib/src/api/vpic/endpoints/GetModelsForMakeIdYear.ts index 78a174bd..3a66736a 100644 --- a/packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts +++ b/packages/lib/src/api/vpic/endpoints/GetModelsForMakeIdYear.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetModelsForMakeIdYear - * @category API Endpoints + * @module api/vpic/endpoints/GetModelsForMakeIdYear + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -13,7 +13,7 @@ import type { IArgToValidate, NhtsaResponse, AtLeastOne } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetModelsForMakeIdYear Documentation](/api/endpoints/get-models-for-make-id-year) + * See: [GetModelsForMakeIdYear Documentation](/guide/vpic/endpoints/get-models-for-make-id-year) * ::: * * `GetModelsForMakeIdYear` returns the Models in the vPIC dataset for a specified Model Year diff --git a/packages/lib/src/api/endpoints/GetModelsForMakeYear.ts b/packages/lib/src/api/vpic/endpoints/GetModelsForMakeYear.ts similarity index 95% rename from packages/lib/src/api/endpoints/GetModelsForMakeYear.ts rename to packages/lib/src/api/vpic/endpoints/GetModelsForMakeYear.ts index 2ec51f5b..e28f59d4 100644 --- a/packages/lib/src/api/endpoints/GetModelsForMakeYear.ts +++ b/packages/lib/src/api/vpic/endpoints/GetModelsForMakeYear.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetModelsForMakeYear - * @category API Endpoints + * @module api/vpic/endpoints/GetModelsForMakeYear + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -13,7 +13,7 @@ import type { NhtsaResponse, IArgToValidate, AtLeastOne } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetModelsForMakeYear Documentation](/api/endpoints/get-models-for-make-year) + * See: [GetModelsForMakeYear Documentation](/guide/vpic/endpoints/get-models-for-make-year) * ::: * * `GetModelsForMakeYear` returns the Models in the vPIC dataset for a specified Model Year and diff --git a/packages/lib/src/api/endpoints/GetParts.ts b/packages/lib/src/api/vpic/endpoints/GetParts.ts similarity index 97% rename from packages/lib/src/api/endpoints/GetParts.ts rename to packages/lib/src/api/vpic/endpoints/GetParts.ts index 7d857a32..1ffbbfe7 100644 --- a/packages/lib/src/api/endpoints/GetParts.ts +++ b/packages/lib/src/api/vpic/endpoints/GetParts.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetParts - * @category API Endpoints + * @module api/vpic/endpoints/GetParts + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetParts Documentation](/api/endpoints/get-parts) + * See: [GetParts Documentation](/guide/vpic/endpoints/get-parts) * ::: * * `GetParts` provides a list of ORGs with letter date in the given range of the dates and with diff --git a/packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMake.ts similarity index 91% rename from packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts rename to packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMake.ts index 846dae1f..1c5d4d15 100644 --- a/packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts +++ b/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMake.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetVehicleTypesForMake - * @category API Endpoints + * @module api/vpic/endpoints/GetVehicleTypesForMake + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetVehicleTypesForMake Documentation](/api/endpoints/get-vehicle-types-for-make) + * See: [GetVehicleTypesForMake Documentation](/guide/vpic/endpoints/get-vehicle-types-for-make) * ::: * * `GetVehicleTypesForMake` returns all the Vehicle Types in the vPIC dataset for a specified Make, diff --git a/packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMakeId.ts similarity index 92% rename from packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts rename to packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMakeId.ts index bf27a14d..0ca04257 100644 --- a/packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts +++ b/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMakeId.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetVehicleTypesForMakeId - * @category API Endpoints + * @module api/vpic/endpoints/GetVehicleTypesForMakeId + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetVehicleTypesForMakeId Documentation](/api/endpoints/get-vehicle-types-for-make-id) + * See: [GetVehicleTypesForMakeId Documentation](/guide/vpic/endpoints/get-vehicle-types-for-make-id) * ::: * * `GetVehicleTypesForMakeId` returns the Models in the vPIC dataset for a specified Make diff --git a/packages/lib/src/api/endpoints/GetVehicleVariableList.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts similarity index 81% rename from packages/lib/src/api/endpoints/GetVehicleVariableList.ts rename to packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts index a8b57a1a..acc29cb1 100644 --- a/packages/lib/src/api/endpoints/GetVehicleVariableList.ts +++ b/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts @@ -1,15 +1,15 @@ /** - * @module api/endpoints/GetVehicleVariableList - * @category API Endpoints + * @module api/vpic/endpoints/GetVehicleVariableList + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' -import { rejectWithError } from '@/utils' +import { rejectWithError, validateArgument } from '@/utils' import type { NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetVehicleVariableList Documentation](/api/endpoints/get-vehicle-variable-list) + * See: [GetVehicleVariableList Documentation](/guide/vpic/endpoints/get-vehicle-variable-list) * ::: * * `GetVehicleVariableList` provides a list of all the Vehicle related variables that are in the @@ -32,6 +32,12 @@ async function GetVehicleVariableList( const endpointName = 'GetVehicleVariableList' try { + validateArgument({ + name: 'doFetch', + value: doFetch, + types: ['boolean'], + }) + const { get, createCachedUrl, getCachedUrl } = useNHTSA() createCachedUrl({ endpointName }) diff --git a/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleVariableValuesList.ts similarity index 91% rename from packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts rename to packages/lib/src/api/vpic/endpoints/GetVehicleVariableValuesList.ts index 08349d61..ba38a4e0 100644 --- a/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts +++ b/packages/lib/src/api/vpic/endpoints/GetVehicleVariableValuesList.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetVehicleVariableValuesList - * @category API Endpoints + * @module api/vpic/endpoints/GetVehicleVariableValuesList + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetVehicleVariableValuesList Documentation](/api/endpoints/get-vehicle-variable-values-list) + * See: [GetVehicleVariableValuesList Documentation](/guide/vpic/endpoints/get-vehicle-variable-values-list) * ::: * * `GetVehicleVariableValuesList` provides a list of all the accepted values for a given variable diff --git a/packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts b/packages/lib/src/api/vpic/endpoints/GetWMIsForManufacturer.ts similarity index 95% rename from packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts rename to packages/lib/src/api/vpic/endpoints/GetWMIsForManufacturer.ts index e31e4184..feb04141 100644 --- a/packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts +++ b/packages/lib/src/api/vpic/endpoints/GetWMIsForManufacturer.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetWMIsForManufacturer - * @category API Endpoints + * @module api/vpic/endpoints/GetWMIsForManufacturer + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' @@ -9,7 +9,7 @@ import type { AtLeastOne, IArgToValidate, NhtsaResponse } from '@/types' /** * ::: tip :bulb: More Information - * See: [GetWMIsForManufacturer Documentation](/api/endpoints/get-wmis-for-manufacturer) + * See: [GetWMIsForManufacturer Documentation](/guide/vpic/endpoints/get-wmis-for-manufacturer) * ::: * * `GetWMIsForManufacturer` provides information on the World Manufacturer Identifier (WMI) for a diff --git a/packages/lib/src/api/endpoints/__tests__/DecodeVin.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/DecodeVin.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/DecodeVin.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/DecodeVin.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/DecodeVinExtended.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/DecodeVinExtended.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/DecodeVinExtended.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/DecodeVinExtended.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/DecodeVinValues.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/DecodeVinValues.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/DecodeVinValues.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/DecodeVinValues.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/DecodeVinValuesBatch.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/DecodeVinValuesBatch.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/DecodeVinValuesBatch.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/DecodeVinValuesBatch.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/DecodeVinValuesExtended.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/DecodeVinValuesExtended.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/DecodeVinValuesExtended.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/DecodeVinValuesExtended.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/DecodeWMI.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/DecodeWMI.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/DecodeWMI.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/DecodeWMI.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetAllMakes.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetAllMakes.test.ts similarity index 80% rename from packages/lib/src/api/endpoints/__tests__/GetAllMakes.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetAllMakes.test.ts index d25512b6..1d91604c 100644 --- a/packages/lib/src/api/endpoints/__tests__/GetAllMakes.test.ts +++ b/packages/lib/src/api/vpic/endpoints/__tests__/GetAllMakes.test.ts @@ -63,4 +63,20 @@ describe('GetAllMakes', () => { expect(results).toEqual(mockUrl) expect(fetchMock.requests().length).toEqual(0) }) + + /***************************** + * rejects with error + ***************************/ + + it.each([1234, ['a', 'b'], { a: 'b' }, null])( + 'rejects with error if doFetch is neither boolean nor undefined, %#', + async (arg) => { + await expect(() => + // @ts-expect-error - arg is not a boolean + GetAllMakes(arg) + ).rejects.toThrowError(/error validating argument named "doFetch"/) + + expect(fetchMock.requests().length).toEqual(0) + } + ) }) diff --git a/packages/lib/src/api/endpoints/__tests__/GetAllManufacturers.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetAllManufacturers.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetAllManufacturers.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetAllManufacturers.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetCanadianVehicleSpecifications.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetCanadianVehicleSpecifications.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetCanadianVehicleSpecifications.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetCanadianVehicleSpecifications.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetEquipmentPlantCodes.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetEquipmentPlantCodes.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetEquipmentPlantCodes.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetEquipmentPlantCodes.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetMakeForManufacturer.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetMakeForManufacturer.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetMakeForManufacturer.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetMakeForManufacturer.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetMakesForManufacturerAndYear.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetMakesForManufacturerAndYear.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetMakesForManufacturerAndYear.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetMakesForManufacturerAndYear.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetMakesForVehicleType.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetMakesForVehicleType.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetMakesForVehicleType.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetMakesForVehicleType.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetManufacturerDetails.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetManufacturerDetails.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetManufacturerDetails.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetManufacturerDetails.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetModelsForMake.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetModelsForMake.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetModelsForMake.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetModelsForMake.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetModelsForMakeId.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetModelsForMakeId.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetModelsForMakeId.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetModelsForMakeId.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetModelsForMakeIdYear.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetModelsForMakeIdYear.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetModelsForMakeIdYear.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetModelsForMakeIdYear.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetModelsForMakeYear.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetModelsForMakeYear.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetModelsForMakeYear.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetModelsForMakeYear.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetParts.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetParts.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetParts.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetParts.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetVehicleTypesForMake.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetVehicleTypesForMake.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetVehicleTypesForMake.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetVehicleTypesForMake.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetVehicleTypesForMakeId.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetVehicleTypesForMakeId.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetVehicleTypesForMakeId.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetVehicleTypesForMakeId.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetVehicleVariableList.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetVehicleVariableList.test.ts similarity index 81% rename from packages/lib/src/api/endpoints/__tests__/GetVehicleVariableList.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetVehicleVariableList.test.ts index 8c5f52a7..ad3008ac 100644 --- a/packages/lib/src/api/endpoints/__tests__/GetVehicleVariableList.test.ts +++ b/packages/lib/src/api/vpic/endpoints/__tests__/GetVehicleVariableList.test.ts @@ -63,4 +63,20 @@ describe('GetVehicleVariableList', () => { expect(results).toEqual(mockUrl) expect(fetchMock.requests().length).toEqual(0) }) + + /***************************** + * rejects with error + ***************************/ + + it.each([1234, ['a', 'b'], { a: 'b' }, null])( + 'rejects with error if doFetch is neither boolean nor undefined, %#', + async (arg) => { + await expect(() => + // @ts-expect-error - arg is not a boolean + GetVehicleVariableList(arg) + ).rejects.toThrowError(/error validating argument named "doFetch"/) + + expect(fetchMock.requests().length).toEqual(0) + } + ) }) diff --git a/packages/lib/src/api/endpoints/__tests__/GetVehicleVariableValuesList.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetVehicleVariableValuesList.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetVehicleVariableValuesList.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetVehicleVariableValuesList.test.ts diff --git a/packages/lib/src/api/endpoints/__tests__/GetWMIsForManufacturer.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetWMIsForManufacturer.test.ts similarity index 100% rename from packages/lib/src/api/endpoints/__tests__/GetWMIsForManufacturer.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetWMIsForManufacturer.test.ts diff --git a/packages/lib/src/api/endpoints/index.ts b/packages/lib/src/api/vpic/endpoints/index.ts similarity index 95% rename from packages/lib/src/api/endpoints/index.ts rename to packages/lib/src/api/vpic/endpoints/index.ts index 6eef2226..1b9fc4ec 100644 --- a/packages/lib/src/api/endpoints/index.ts +++ b/packages/lib/src/api/vpic/endpoints/index.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints - * @category API Endpoints + * @module api/vpic/endpoints + * @category API - VPIC (VIN Decoding) */ export { DecodeVin } from './DecodeVin' diff --git a/packages/lib/src/api/endpoints/types.ts b/packages/lib/src/api/vpic/endpoints/types.ts similarity index 98% rename from packages/lib/src/api/endpoints/types.ts rename to packages/lib/src/api/vpic/endpoints/types.ts index 4d6bc6b4..175a579a 100644 --- a/packages/lib/src/api/endpoints/types.ts +++ b/packages/lib/src/api/vpic/endpoints/types.ts @@ -1,5 +1,5 @@ /** - * @module api/endpoints/types + * @module api/vpic/endpoints/types * @category Types */ diff --git a/packages/lib/src/api/vpic/index.ts b/packages/lib/src/api/vpic/index.ts new file mode 100644 index 00000000..fcee2f65 --- /dev/null +++ b/packages/lib/src/api/vpic/index.ts @@ -0,0 +1,31 @@ +/** + * @module api/vpic + * @category API - VPIC (VIN Decoding) + */ + +export { + DecodeVin, + DecodeVinExtended, + DecodeVinValues, + DecodeVinValuesBatch, + DecodeVinValuesExtended, + DecodeWMI, + GetAllMakes, + GetAllManufacturers, + GetCanadianVehicleSpecifications, + GetEquipmentPlantCodes, + GetMakeForManufacturer, + GetMakesForVehicleType, + GetManufacturerDetails, + GetMakesForManufacturerAndYear, + GetModelsForMake, + GetModelsForMakeId, + GetModelsForMakeIdYear, + GetModelsForMakeYear, + GetParts, + GetVehicleTypesForMake, + GetVehicleTypesForMakeId, + GetVehicleVariableList, + GetVehicleVariableValuesList, + GetWMIsForManufacturer, +} from './endpoints' diff --git a/packages/lib/src/api/vpic/types.ts b/packages/lib/src/api/vpic/types.ts new file mode 100644 index 00000000..44db9f0a --- /dev/null +++ b/packages/lib/src/api/vpic/types.ts @@ -0,0 +1,12 @@ +/** + * @module api/vpic/types + * @category Types + */ + +export type { + DecodeVinResponse, + DecodeVinResultsData, + DecodeVinVariable, +} from './_decodeVin' + +export {} diff --git a/packages/lib/src/constants.ts b/packages/lib/src/constants.ts index 9246bfca..6f5169e9 100644 --- a/packages/lib/src/constants.ts +++ b/packages/lib/src/constants.ts @@ -1,2 +1,15 @@ -export const NHTSA_BASE_URL = 'https://vpic.nhtsa.dot.gov/api/vehicles' +/** + * @module constants + * @category Constants + */ + +export const NHTSA_DEFAULT_API_TYPE = 'vpic' export const NHTSA_RESPONSE_FORMAT = 'json' + +/** VPIC Vehicles API (vin decoding) */ +export const NHTSA_VPIC_URL = 'https://vpic.nhtsa.dot.gov/api/vehicles' +/** NHTSA API (recalls, complaints, etc.) */ +export const NHTSA_API_URL = 'https://api.nhtsa.gov' + +/** Deprecated since v4.0.0 - has been renamed to NHTSA_VPIC_URL */ +export const NHTSA_BASE_URL = 'https://vpic.nhtsa.dot.gov/api/vehicles' diff --git a/packages/lib/src/index.ts b/packages/lib/src/index.ts index 658a6cb7..30fdfe10 100644 --- a/packages/lib/src/index.ts +++ b/packages/lib/src/index.ts @@ -1,4 +1,13 @@ +/** + * @module exports + * @category Package Exports + */ + +/** + * @category Exported NHTSA API Functions + */ export { + /* vPIC API */ DecodeVin, DecodeVinExtended, DecodeVinValues, @@ -23,9 +32,119 @@ export { GetVehicleVariableList, GetVehicleVariableValuesList, GetWMIsForManufacturer, + /* Other APIs */ + complaints, + cssiStation, + products, + recalls, + safetyRatings, + /* NHTSA Helper Function */ useNHTSA, } from '@/api' -export { createQueryString, encodeQueryStringParams, isValidVin } from '@/utils' +/** + * @category Exported Utility Functions + */ +export { + createQueryString, + encodeQueryStringParams, + generateRandomVIN, + isValidVin, +} from '@/utils' -export * from '@/types' +/** + * @category Exported Types + */ +export type { + NhtsaResponse, + DecodeVinExtendedResults, + DecodeVinResults, + DecodeVinValuesBatchResults, + DecodeVinValuesExtendedResults, + DecodeVinValuesResults, + DecodeVinExtendedVariable, + DecodeVinVariable, + GetCanadianVehicleSpecificationsResults, + GetEquipmentPlantCodesResults, + GetMakeForManufacturerResults, + DecodeWMIResults, + GetAllMakesResults, + GetAllManufacturersResults, + GetEquipmentPlantCodesParams, + GetMakesForManufacturerAndYearResults, + GetMakesForVehicleTypeResults, + GetManufacturerDetailsResults, + GetModelsForMakeIdResults, + GetModelsForMakeIdYearResults, + GetModelsForMakeResults, + GetModelsForMakeYearResults, + GetPartsResults, + GetVehicleTypesForMakeIdResults, + GetVehicleTypesForMakeResults, + GetVehicleVariableListResults, + GetVehicleVariableValuesListResults, + GetWMIsForManufacturerResults, + ComplaintsOptions, + ComplaintsOptionsBase, + ComplaintsOptionsEmpty, + ComplaintsOptionsMake, + ComplaintsOptionsModelYear, + ComplaintsOptionsOdiNumber, + ComplaintsOptionsVehicle, + ComplaintsResponse, + ComplaintsResponseByOptions, + ComplaintsResponseByVariant, + ComplaintsResultsByOptions, + ComplaintsResultsByVariant, + ComplaintsResultsData, + ComplaintsResultsVariant, + CSSIOptions, + CSSIOptionsBase, + CSSIOptionsEmpty, + CSSIOptionsCanBeQuery, + CSSIOptionsLocation, + CSSIOptionsState, + CSSIOptionsZip, + CSSIResponse, + CSSIResultsData, + ProductsIssueType, + ProductsOptions, + ProductsOptionsBase, + ProductsOptionsEmpty, + ProductsOptionsMake, + ProductsOptionsModelYear, + ProductsResponse, + ProductsResponseByOptions, + ProductsResponseByVariant, + ProductsResultsByOptions, + ProductsResultsByVariant, + ProductsResultsData, + ProductsResultsVariant, + RecallsOptions, + RecallsOptionsBase, + RecallsOptionsCampaignNumber, + RecallsOptionsEmpty, + RecallsOptionsMake, + RecallsOptionsModelYear, + RecallsOptionsVehicle, + RecallsResponse, + RecallsResponseByOptions, + RecallsResponseByVariant, + RecallsResultsByOptions, + RecallsResultsByVariant, + RecallsResultsData, + RecallsResultsVariant, + SafetyRatingsOptions, + SafetyRatingsOptionsBase, + SafetyRatingsOptionsEmpty, + SafetyRatingsOptionsMake, + SafetyRatingsOptionsModelYear, + SafetyRatingsOptionsVehicle, + SafetyRatingsOptionsVehicleId, + SafetyRatingsResponseByOptions, + SafetyRatingsResponseByVariant, + SafetyRatingsResultsByOptions, + SafetyRatingsResultsByVariant, + SafetyRatingsResultsData, + SafetyRatingsResultsVariant, +} from '@/types' diff --git a/packages/lib/src/utils/__tests__/argHandler.test.ts b/packages/lib/src/utils/__tests__/argHandler.test.ts index 2d178069..3dd1ae34 100644 --- a/packages/lib/src/utils/__tests__/argHandler.test.ts +++ b/packages/lib/src/utils/__tests__/argHandler.test.ts @@ -1,652 +1,772 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { describe, expect, it } from 'vitest' -import { catchInvalidArguments, validateArgument } from '../argHandler' - -describe('argHandler.ts - exports', () => { - it('catchInvalidArguments function', () => { +import { describe, expect, it, test } from 'vitest' +import { + catchInvalidArguments, + catchInvalidKeys, + validateArgument, +} from '../argHandler' + +describe('utils/argHandler.ts - exports:', () => { + test('catchInvalidArguments function', () => { expect(catchInvalidArguments).toBeDefined() expect(catchInvalidArguments).toBeInstanceOf(Function) }) - it('validateArgument function', () => { + test('validateArgument function', () => { expect(validateArgument).toBeDefined() expect(validateArgument).toBeInstanceOf(Function) }) }) -describe('validateArgument', () => { - describe('all modes', () => { - it('throws error when arg is empty array', () => { - expect(() => validateArgument([] as any)).toThrowError() - }) - - it('throws error when arg is empty object', () => { - expect(() => validateArgument({} as any)).toThrowError() +const truthyValues = [ + true, + 'string', + '0', + 123, + -123, + 3.14, + -3.14, + 1234n, + Infinity, + -Infinity, + [], + ['1', '2', '3'], + {}, + { a: '1', b: '2', c: '3' }, + () => 'a function', + new Date(), + new String(), + new Object(), +] + +const falseyValues = [null, undefined, false, '', NaN, 0, -0, 0n] + +const testNotBoolean = [ + 'string', + 123, + 1234n, + 0, + -0, + 0n, + [], + ['1', '2', '3'], + {}, + { a: '1' }, + () => 'a function', + null, + NaN, + new Date(), + new String(), + new Object(), +] + +const testNotString = [ + 123, + 1234n, + 0, + -0, + 0n, + [], + ['1', '2', '3'], + {}, + { a: '1' }, + () => 'a function', + true, + false, + null, + NaN, + new Date(), + new Object(), +] + +const testNotObject = [ + '', + 'string', + 123, + 1234n, + 0, + -0, + 0n, + [], + ['1', '2', '3'], + () => 'a function', + true, + false, + null, + NaN, + new Date(), + new String(), + new Error(), +] + +const testNotArrayOfLength = [ + 'string', + 123, + 1234n, + [], + {}, + { a: '1' }, + () => 'a function', + true, + new Date(), + new String(), +] + +const testNotArrayOfObjects = [ + ['string'], + [123], + [null, { a: 'b' }], + ['string', { a: 'b' }], + [['nested array']], + ...testNotArrayOfLength, +] + +const testNotArrayOfStrings = [ + [undefined], + [123], + ['string', null], + ['string', 123], + ['string', undefined], + [{ a: 'b' }], + ['string', { a: 'b' }], + [['nested array']], + ...testNotArrayOfLength, +] + +const testTypesMatch: [unknown, string[]][] = [ + /* match single type */ + ['string', ['string']], + [123, ['number']], + [true, ['boolean']], + [false, ['boolean']], + [null, ['null']], + [() => 'a function', ['function']], + [1234n, ['bigint']], + [{ a: '1', b: '2', c: '3' }, ['object']], + [['1', '2', '3'], ['array']], + [[], ['array']], + [{}, ['object']], + [new Date(), ['date']], + [new Error(), ['error']], + [new TypeError(), ['error']], + [new RangeError(), ['error']], + [new ReferenceError(), ['error']], + [new SyntaxError(), ['error']], + [new URIError(), ['error']], + [new EvalError(), ['error']], + /* match multiple types */ + [{}, ['object', 'array']], + [123, ['number', 'string']], + ['string', ['string', 'number']], + [123, ['string', 'number', 'boolean']], + [true, ['string', 'number', 'boolean']], + [null, ['string', 'number', 'boolean', 'undefined', 'null']], + [() => 'a function', ['string', 'number', 'function']], +] + +const testTypesMismatch: [unknown, string[]][] = [ + /* mis-match single type */ + [123, ['string']], + [true, ['string']], + [false, ['string']], + [null, ['string']], + [() => 'a function', ['string']], + [1234n, ['string']], + [{ a: '1', b: '2', c: '3' }, ['string']], + [['1', '2', '3'], ['string']], + [[], ['string']], + [{}, ['string']], + [new Date(), ['string']], + [new String(), ['object']], + [new Error(), ['object']], + [new TypeError(), ['object']], + [new RangeError(), ['object']], + [new ReferenceError(), ['object']], + [new SyntaxError(), ['object']], + [new URIError(), ['object']], + [new EvalError(), ['object']], + /* mis-match multiple types */ + [{}, ['string', 'number']], + [123, ['string', 'boolean']], + [true, ['string', 'number']], + [null, ['string', 'number', 'boolean', 'undefined']], + [() => 'a function', ['string', 'number', 'boolean']], +] + +describe('validateArgument()', () => { + describe('all modes - throws error with invalid argData passed to validateArgument():', () => { + /**************** + * Throws Error + ****************/ + describe('argData is undefined or is not an object:', () => { + test.each([undefined, ...testNotObject])('argData: %s', (argData) => { + expect(() => + validateArgument( + // @ts-expect-error Type 'x' is not assignable to type 'IArgToValidate'. + argData + ) + ).toThrowError( + /'argData' argument is required and must be an object containing valid options/ + ) + }) }) - }) - - describe('errorMode: "error" (default)', () => { - describe('only required', () => { - /**************** - * Returns true - ****************/ - it('returns true with defined value', () => { - expect( - validateArgument({ - name: 'test', - value: '3VWD07AJ5EM388203', - required: true, - }) - ).toEqual(true) - - expect( - validateArgument({ - name: 'test', - value: 1234, - required: true, - }) - ).toEqual(true) - - expect( - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - required: true, - }) - ).toEqual(true) - - expect( - validateArgument({ - name: 'test', - value: { a: '1', b: '2', c: '3' }, - required: true, - }) - ).toEqual(true) - expect( + describe('name is undefined or is not a string:', () => { + test.each([undefined, ...testNotString])('argData.name: %s', (name) => { + expect(() => validateArgument({ - name: 'test', - value: () => 'this is a function', - required: true, + // @ts-expect-error Type 'x' is not assignable to type 'string'. + name, + value: 'some string', }) - ).toEqual(true) + ).toThrowError(/'argData.name', is required and must be of type string/) }) + }) - it('returns true when value is empty array', () => { - expect( + describe('required is defined and is not a boolean:', () => { + test.each(testNotBoolean)('argData.required: %s', (required) => { + expect(() => validateArgument({ name: 'test', - value: [], - required: true, + value: 'some string', + // @ts-expect-error Type 'x' is not assignable to type 'boolean'. + required, }) - ).toEqual(true) + ).toThrowError(/'argData.required' must be of type boolean if provided/) }) + }) - it('returns true when value is empty object', () => { - expect( - validateArgument({ - name: 'test', - value: {}, - required: true, - }) - ).toEqual(true) - }) + describe('requiredBy is defined and is not an array of objects:', () => { + test.each(testNotArrayOfObjects)( + 'argData.requiredBy: %s', + (requiredBy) => { + expect(() => + validateArgument({ + name: 'test', + value: 'some string', + // @ts-expect-error Type 'x' is not assignable to type ... + requiredBy, + }) + ).toThrowError( + /'argData.requiredBy' must be an array of objects if provided/ + ) + } + ) + }) - /**************** - * Throws Error - ****************/ - it('throws error when value is undefined', () => { - expect(() => - validateArgument({ - name: 'test', - value: undefined, - required: true, - }) - ).toThrowError() - }) + describe('requiredBy.value is defined and requiredBy.name is not a string:', () => { + test.each([undefined, ...testNotString])( + 'argData.requiredBy.name: %s', + (requiredByName) => { + expect(() => + validateArgument({ + name: 'test', + value: 'defined value', + requiredBy: [ + { + // @ts-expect-error Type 'x' is not assignable to type 'string'. + name: requiredByName, + value: 1234, + }, + ], + }) + ).toThrowError( + /'argData.requiredBy' requires both a name and value if value is defined/ + ) + } + ) + }) - it('throws error when value is null', () => { + describe('types is defined and is not an array of strings with length > 0:', () => { + test.each(testNotArrayOfStrings)('argData.types: %s', (types) => { expect(() => validateArgument({ name: 'test', - value: null, - required: true, + value: 'some string', + // @ts-expect-error Type 'x' is not assignable to type 'string[]'. + types, }) - ).toThrowError() + ).toThrowError( + /'argData.types' must be an array of strings if provided/ + ) }) + }) - it('throws error when value is empty string', () => { + describe('argData.validKeys is defined and is not an array of strings with length > 0:', () => { + test.each(testNotArrayOfStrings)('argData.validKeys: %s', (validKeys) => { expect(() => validateArgument({ name: 'test', - value: '', - required: true, + value: 'some string', + // @ts-expect-error Type 'x' is not assignable to type 'string[]' | undefined. + validKeys, }) - ).toThrowError() + ).toThrowError( + /'argData.validKeys' must be an array of strings if provided/ + ) }) }) + }) - describe('only types', () => { + describe('argument validation logic', () => { + describe('if argData.required: true', () => { /**************** * Returns true ****************/ - it('returns true with matching type', () => { - expect( - validateArgument({ - name: 'test', - value: '3VWD07AJ5EM388203', - types: ['string'], - }) - ).toEqual(true) - - expect( - validateArgument({ - name: 'test', - value: 132, - types: ['string', 'number'], - }) - ).toEqual(true) - - expect( - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - types: ['array'], - }) - ).toEqual(true) - - expect( - validateArgument({ - name: 'test', - value: { a: '1', b: '2', c: '3' }, - types: ['object', 'boolean'], - }) - ).toEqual(true) - - expect( - validateArgument({ - name: 'test', - value: () => 'this is a function', - types: ['function'], + describe('returns true - if argData.value is defined or "truthy":', () => { + describe('errorMode: "error" (default)', () => { + test.each(truthyValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + required: true, + }) + ).toEqual(true) }) - ).toEqual(true) - }) - - it('returns true with undefined value', () => { - expect( - validateArgument({ - name: 'test', - value: undefined, - types: ['string'], - }) - ).toEqual(true) - }) + }) - it('returns true with empty string when tested against type string', () => { - expect( - validateArgument({ - name: 'test', - value: '', - types: ['string'], + describe('errorMode: "boolean"', () => { + test.each(truthyValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + required: true, + errorMode: 'boolean', + }) + ).toEqual(true) }) - ).toEqual(true) + }) }) - it('returns true with empty array when tested against type array', () => { - expect( - validateArgument({ - name: 'test', - value: [], - types: ['array'], + /******************************** + * Throws Error or Returns False + ********************************/ + describe('throws error or returns false - if argData.value is undefined', () => { + describe('errorMode: "error" (default)', () => { + test.each([undefined])('argData.value: %s', (value) => { + expect(() => + validateArgument({ + name: 'testValue', + value, + required: true, + }) + ).toThrowError( + /error validating argument named "testValue", it is required/ + ) }) - ).toEqual(true) - }) + }) - it('returns true with empty object when tested against type object', () => { - expect( - validateArgument({ - name: 'test', - value: {}, - types: ['object'], + describe('errorMode: "boolean":', () => { + test.each([undefined])('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'testValue', + value, + required: true, + errorMode: 'boolean', + }) + ).toEqual(false) }) - ).toEqual(true) + }) }) + }) + describe('if argData.types is defined', () => { /**************** - * Throws Error + * Returns true ****************/ - it('throws error when types do not match and value is defined', () => { - expect(() => - validateArgument({ - name: 'test', - value: null, - types: ['string'], + describe('returns true - if argData.value is undefined because type match will be skipped', () => { + const testValues = ['', new String(), undefined] + + describe('errorMode: "error" (default)', () => { + test.each(testValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + types: ['string'], + }) + ).toEqual(true) }) - ).toThrowError() + }) - expect(() => - validateArgument({ - name: 'test', - value: 123, - types: ['string'], + describe('errorMode: "boolean"', () => { + test.each(testValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + types: ['string'], + errorMode: 'boolean', + }) + ).toEqual(true) }) - ).toThrowError() + }) + }) - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - types: ['number', 'object'], + describe('returns true - if typeof argData.value matches at least one type:', () => { + describe('errorMode: "error" (default)', () => { + test.each(testTypesMatch)('typeof "%s" = %s', (value, types) => { + expect( + validateArgument({ + name: 'test', + value, + types, + }) + ).toEqual(true) }) - ).toThrowError() - }) + }) - it('throws error when types array is empty', () => { - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - types: [] as any, + describe('errorMode: "boolean"', () => { + test.each(testTypesMatch)('typeof "%s" = %s', (value, types) => { + expect( + validateArgument({ + name: 'test', + value, + types, + errorMode: 'boolean', + }) + ).toEqual(true) }) - ).toThrowError() + }) }) - it('throws error when types is not an array', () => { - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - types: 'string' as any, - }) - ).toThrowError() + /******************************** + * Throws Error or Returns False + ********************************/ + describe('if typeof argData.value does not match at least one type:', () => { + describe('throws error - errorMode: "error" (default)', () => { + test.each(testTypesMismatch)( + 'typeof "%s" != type(s) %s', + (value, types) => { + expect(() => + validateArgument({ + name: 'testValue', + value, + types, + }) + ).toThrowError( + /error validating argument named "testValue", must be of type\(s\)/ + ) + } + ) + }) - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - types: { a: '1' } as any, - }) - ).toThrowError() + describe('returns false - errorMode: "boolean"', () => { + test.each(testTypesMismatch)( + 'typeof "%s" != type(s) %s', + (value, types) => { + expect( + validateArgument({ + name: 'testValue', + value, + types, + errorMode: 'boolean', + }) + ).toEqual(false) + } + ) + }) }) }) - describe('required and types', () => { + describe('if argData.required: true && argData.types is defined', () => { /**************** * Returns True ****************/ - it('returns true if value is defined and types match', () => { - expect( - validateArgument({ - name: 'test', - value: '3VWD07AJ5EM388203', - required: true, - types: ['string'], - }) - ).toEqual(true) - - expect( - validateArgument({ - name: 'test', - value: 132, - required: true, - types: ['string', 'number'], - }) - ).toEqual(true) - - expect( - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - required: true, - types: ['array'], - }) - ).toEqual(true) - - expect( - validateArgument({ - name: 'test', - value: { a: '1', b: '2', c: '3' }, - required: true, - types: ['object', 'boolean'], - }) - ).toEqual(true) - - expect( - validateArgument({ - name: 'test', - value: () => 'this is a function', - required: true, - types: ['function'], + describe('returns true - if argData.value is defined and matches at least one type:', () => { + describe('errorMode: "error" (default)', () => { + test.each(testTypesMatch)('typeof "%s" === %s', (value, types) => { + expect( + validateArgument({ + name: 'test', + value, + required: true, + types, + }) + ).toEqual(true) }) - ).toEqual(true) - }) - - it('returns true with empty array when tested against type array', () => { - expect( - validateArgument({ - name: 'test', - value: [], - required: true, - types: ['array'], - }) - ).toEqual(true) - }) + }) - it('returns true with empty object when tested against type object', () => { - expect( - validateArgument({ - name: 'test', - value: {}, - required: true, - types: ['object'], + describe('errorMode: "boolean"', () => { + test.each(testTypesMatch)('typeof "%s" === %s', (value, types) => { + expect( + validateArgument({ + name: 'test', + value, + required: true, + types, + errorMode: 'boolean', + }) + ).toEqual(true) }) - ).toEqual(true) + }) }) /**************** * Throws Error ****************/ - it('throws error if value is undefined', () => { - expect(() => - validateArgument({ - name: 'test', - value: undefined, - required: true, - types: ['string'], - }) - ).toThrowError() - }) - - it('throws error if value is null', () => { - expect(() => - validateArgument({ - name: 'test', - value: null, - required: true, - types: ['string'], - }) - ).toThrowError() - }) - - it('throws error with empty string when tested against type string', () => { - expect(() => - validateArgument({ - name: 'test', - value: '', - required: true, - types: ['string'], - }) - ).toThrowError() - }) - - it('throws error when type of value does not match', () => { - expect(() => - validateArgument({ - name: 'test', - value: 123, - required: true, - types: ['array'], - }) - ).toThrowError() + describe('if typeof argData.value does not match at least one type:', () => { + describe('throws error - errorMode: "error" (default)', () => { + test.each(testTypesMismatch)( + 'typeof "%s" !== type(s) %s', + (value, types) => { + expect(() => + validateArgument({ + name: 'testValue', + value, + required: true, + types, + }) + ).toThrowError( + /error validating argument named "testValue", it is required and must be of type\(s\)/ + ) + } + ) + }) - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - required: true, - types: ['number', 'string', 'object'], - }) - ).toThrowError() + describe('returns false - errorMode: "boolean"', () => { + test.each(testTypesMismatch)( + 'typeof "%s" !== type(s) %s', + (value, types) => { + expect( + validateArgument({ + name: 'testValue', + value, + required: true, + types, + errorMode: 'boolean', + }) + ).toEqual(false) + } + ) + }) }) }) - }) - describe('errorMode: "boolean"', () => { - describe('only required', () => { + describe('if argData.requiredBy is defined', () => { /**************** * Returns true - * - same as default mode ****************/ - - /**************** - * Returns false - ****************/ - it('returns false when value is undefined', () => { - expect( - validateArgument({ - name: 'test', - value: undefined, - required: true, - errorMode: 'boolean', - }) - ).toEqual(false) - }) - - it('returns false when value is null', () => { - expect( - validateArgument({ - name: 'test', - value: null, - required: true, - errorMode: 'boolean', + describe('returns true - if argData.value is defined when requiredBy another defined value:', () => { + describe('errorMode: "error" (default)', () => { + it.each(truthyValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + requiredBy: [{ name: 'test2', value: 'string' }], + }) + ).toEqual(true) }) - ).toEqual(false) - }) + }) - it('returns false when value is empty string', () => { - expect( - validateArgument({ - name: 'test', - value: '', - required: true, - errorMode: 'boolean', + describe('errorMode: "boolean"', () => { + it.each(truthyValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + requiredBy: [{ name: 'test2', value: 'string' }], + errorMode: 'boolean', + }) + ).toEqual(true) }) - ).toEqual(false) + }) }) - }) - describe('only types', () => { - /**************** - * Returns true - * - same as default mode - ****************/ - - /**************** - * Returns false - ****************/ - it('returns false when types do not match and value is defined', () => { - expect( - validateArgument({ - name: 'test', - value: null, - types: ['string'], - errorMode: 'boolean', + /******************************** + * Throws Error or Returns False + *******************************/ + describe('if argData.value is undefined when requiredBy another defined value', () => { + describe('throws error - errorMode: "error" (default)', () => { + test.each(falseyValues)('argData.value: %s', (value) => { + expect(() => + validateArgument({ + name: 'test', + value, + requiredBy: [{ name: 'test2', value: 132 }], + }) + ).toThrowError( + /error validating argument named "test", it is required if "test2" is passed/ + ) }) - ).toBe(false) - - expect( - validateArgument({ - name: 'test', - value: 123, - types: ['string'], - errorMode: 'boolean', - }) - ).toBe(false) + }) - expect( - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - types: ['number', 'object'], - errorMode: 'boolean', + describe('returns false - errorMode: "boolean"', () => { + test.each(falseyValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + requiredBy: [{ name: 'test2', value: 132 }], + errorMode: 'boolean', + }) + ).toEqual(false) }) - ).toBe(false) + }) }) - /**************** - * Throws Error - ****************/ - it('throws error when types array is empty', () => { - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - types: [] as any, - errorMode: 'boolean', + describe('if argData.value is required but undefined when requiredBy another defined value', () => { + describe('throws error - errorMode: "error" (default)', () => { + test.each(falseyValues)('argData.value: %s', (value) => { + expect(() => + validateArgument({ + name: 'test', + value, + required: true, + requiredBy: [{ name: 'test2', value: 132 }], + }) + ).toThrowError( + /error validating argument named "test", it is required if "test2" is passed/ + ) }) - ).toThrowError() - }) + }) - it('throws error when types is not an array', () => { - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - types: 'string' as any, - errorMode: 'boolean', - }) - ).toThrowError() - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - types: { a: '1' } as any, - errorMode: 'boolean', + describe('returns false - errorMode: "boolean"', () => { + test.each(falseyValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + required: true, + requiredBy: [{ name: 'test2', value: 132 }], + errorMode: 'boolean', + }) + ).toEqual(false) }) - ).toThrowError() + }) }) }) - describe('required and types', () => { + describe('if argData.value is an object and argData.validKeys is an array of strings', () => { /**************** * Returns true - * - same as default mode ****************/ - - /**************** - * Returns false - ****************/ - it('returns false if value is undefined', () => { - expect( - validateArgument({ - name: 'test', - value: undefined, - required: true, - types: ['string'], - errorMode: 'boolean', - }) - ).toBe(false) - }) - - it('returns false if value is null', () => { - expect( - validateArgument({ - name: 'test', - value: null, - required: true, - types: ['string'], - errorMode: 'boolean', - }) - ).toBe(false) - }) - - it('returns false with empty string when tested against type string', () => { - expect( - validateArgument({ - name: 'test', - value: '', - required: true, - types: ['string'], - errorMode: 'boolean', - }) - ).toBe(false) - }) - - it('returns false when type of value does not match', () => { - expect( - validateArgument({ - name: 'test', - value: 123, - required: true, - types: ['array'], - errorMode: 'boolean', + describe('returns true - if argData.value contains all keys in argData.validKeys:', () => { + const testValues = [ + { value: { a: '1' }, validKeys: ['a'] }, + { value: { a: '1' }, validKeys: ['a', 'b'] }, + { value: { a: '1', b: '2' }, validKeys: ['a', 'b'] }, + { value: { a: '1', b: '2', c: '3' }, validKeys: ['a', 'b', 'c'] }, + { + value: { a: '1', b: '2', c: '3' }, + validKeys: ['a', 'b', 'c', 'd'], + }, + ] + + describe('errorMode: "error" (default)', () => { + test.each(testValues)('%s', ({ value, validKeys }) => { + expect( + validateArgument({ + name: 'test', + value, + validKeys, + }) + ).toEqual(true) }) - ).toBe(false) + }) - expect( - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - required: true, - types: ['number', 'string', 'object'], - errorMode: 'boolean', + describe('errorMode: "boolean"', () => { + test.each(testValues)('%s', ({ value, validKeys }) => { + expect( + validateArgument({ + name: 'test', + value, + validKeys, + errorMode: 'boolean', + }) + ).toEqual(true) }) - ).toBe(false) + }) }) - /**************** - * Throws Error - ****************/ - it('throws error when types array is empty', () => { - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - required: true, - types: [] as any, - errorMode: 'boolean', + /******************************** + * Throws Error or Returns False + ********************************/ + describe('if argData.value contains invalid keys:', () => { + const testValues = [ + { value: { a: '1' }, validKeys: ['b'] }, + { value: { a: '1' }, validKeys: ['b', 'c'] }, + { value: { a: '1', b: '2' }, validKeys: ['c'] }, + { value: { a: '1', b: '2', c: '3' }, validKeys: ['d'] }, + { + value: { a: '1', b: '2', c: '3' }, + validKeys: ['d', 'e', 'f'], + }, + ] + + describe('throws error - errorMode: "error" (default)', () => { + test.each(testValues)('%s', ({ value, validKeys }) => { + expect(() => + validateArgument({ + name: 'testObj', + value, + validKeys, + }) + ).toThrowError(/Invalid keys for testObj/) }) - ).toThrowError() - }) + }) - it('throws error when types is not an array', () => { - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - required: true, - types: 'string' as any, - errorMode: 'boolean', - }) - ).toThrowError() - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - required: true, - types: { a: '1' } as any, - errorMode: 'boolean', + describe('returns false - errorMode: "boolean"', () => { + test.each(testValues)('%s', ({ value, validKeys }) => { + expect( + validateArgument({ + name: 'test', + value, + validKeys, + errorMode: 'boolean', + }) + ).toEqual(false) }) - ).toThrowError() + }) }) }) }) }) describe('catchInvalidArguments', () => { - describe('all modes', () => { + describe('all modes - throws error with invalid options passed to catchInvalidArguments():', () => { /**************** * Throws Error ****************/ - it('throws error with empty or invalid args array', () => { - expect(() => catchInvalidArguments(undefined as any)).toThrowError() - expect(() => catchInvalidArguments({} as any)).toThrowError() - - expect(() => - catchInvalidArguments({ args: 'string' } as any) - ).toThrowError() - - expect(() => catchInvalidArguments({ args: [] })).toThrowError() + describe('options are undefined or not an object:', () => { + test.each([undefined, ...testNotObject])('options: %s', (argData) => { + expect(() => + catchInvalidArguments( + // @ts-expect-error Type 'x' is not assignable to type ... + argData + ) + ).toThrowError( + /catchInvalidArguments requires "args" that must be an array of IArgToValidate objects/ + ) + }) + }) - expect(() => catchInvalidArguments({ args: {} } as any)).toThrowError() + describe('options.args is undefined or is not an array of length > 0:', () => { + test.each([undefined, ...testNotArrayOfLength])( + 'options.args: %s', + (args) => { + expect(() => + catchInvalidArguments( + // @ts-expect-error Type 'x' is not assignable to type 'IArgToValidate'. + { args } + ) + ).toThrowError( + /catchInvalidArguments requires "args" that must be an array of IArgToValidate objects/ + ) + } + ) }) }) - describe('mode: "default" (default)', () => { + describe('options.mode: "default"', () => { /**************** * Returns true ****************/ - it('returns true if all args are valid', () => { + test('returns true if all args are valid', () => { const args = [ { name: 'make', value: 'Audi', required: true, types: ['string'] }, { name: 'params', value: { a: '1' }, types: ['object'] }, @@ -659,55 +779,80 @@ describe('catchInvalidArguments', () => { expect(catchInvalidArguments({ args })).toBe(true) }) + // Remainder of the cases are covered in validateArgument() tests + /**************** * Throws Error ****************/ - it('throws error if validation fails', () => { - expect(() => - catchInvalidArguments({ - args: [ - { - name: 'make', - value: '', - required: true, - types: ['string'], - }, - ], - }) - ).toThrowError() + describe('throws error if validation fails', () => { + test('if argData.value is undefined when required', () => { + expect(() => + catchInvalidArguments({ + args: [ + { + name: 'testName', + value: undefined, + required: true, + types: ['string'], + }, + ], + }) + ).toThrowError(/error validating argument named "testName"/) + }) - expect(() => - catchInvalidArguments({ - args: [ - { - name: 'make', - value: undefined, - required: true, - types: ['string'], - }, - ], - }) - ).toThrowError() + test('if argData.value is required and defined but does not match type', () => { + expect(() => + catchInvalidArguments({ + args: [ + // Passes validation + { + name: 'shouldPass', + value: Error('test error'), + required: true, + types: ['error'], + }, + // Fails validation + { + name: 'testName', + value: 123, + required: true, + types: ['string'], + }, + ], + }) + ).toThrowError(/error validating argument named "testName"/) + }) - expect(() => - catchInvalidArguments({ - args: [ - { - name: 'modelYear', - value: '1988', - types: ['number'], - }, - ], - }) - ).toThrowError() + test('if argData.value is defined and does not match type', () => { + expect(() => + catchInvalidArguments({ + args: [ + // Passes validation + { + name: 'shouldPass', + value: Error('test error'), + types: ['error'], + }, + // Fails validation + { + name: 'testName', + value: 123, + types: ['string'], + }, + ], + }) + ).toThrowError(/error validating argument named "testName"/) + }) + + // Remainder of the cases are covered in validateArgument() tests }) }) - describe('atLeast mode', () => { + describe('options.mode: "atLeast"', () => { /**************** * Returns true ****************/ - it('returns true if at least one two args defined', () => { + test('returns true if at least one of two args defined', () => { const args = [ { name: 'make', value: undefined, types: ['string'] }, { name: 'year', value: 1999, types: ['number'] }, @@ -715,7 +860,7 @@ describe('catchInvalidArguments', () => { expect(catchInvalidArguments({ mode: 'atLeast', args })).toEqual(true) }) - it('returns true if both args defined', () => { + test('returns true if both args defined', () => { const args = [ { name: 'make', value: 'Audi', types: ['string'] }, { name: 'year', value: 1999, types: ['number'] }, @@ -723,7 +868,7 @@ describe('catchInvalidArguments', () => { expect(catchInvalidArguments({ mode: 'atLeast', args })).toEqual(true) }) - it('returns true if at least one of three args defined', () => { + test('returns true if at least one of three args defined', () => { const args = [ { name: 'make', value: null, types: ['string'] }, { name: 'year', value: undefined, types: ['number'] }, @@ -735,14 +880,14 @@ describe('catchInvalidArguments', () => { /**************** * Throws Error ****************/ - it('throws error if not at least one', () => { + test('throws error if not at least one', () => { expect(() => catchInvalidArguments({ mode: 'atLeast', args: [ { - name: 'model', - value: '', + name: 'modelYear', + value: null, types: ['string'], }, { @@ -752,12 +897,215 @@ describe('catchInvalidArguments', () => { }, { name: 'model', - value: null, + value: '', types: ['string'], }, ], }) - ).toThrowError() + ).toThrowError( + /must provide at least one of the following arguments: modelYear, make, model/ + ) + }) + }) +}) + +describe('catchInvalidKeys', () => { + describe('all modes- throws error with invalid options passed to catchInvalidKeys():', () => { + /**************** + * Throws Error + ****************/ + describe('options are neither object nor array of length:', () => { + test.each([ + [], + '', + 'string', + 123, + 1234n, + 0, + -0, + 0n, + () => 'a function', + true, + false, + null, + undefined, + NaN, + new Date(), + new String(), + new Error(), + ])('options: %s', (argData) => { + expect(() => + catchInvalidKeys( + // @ts-expect-error Type 'x' is not assignable to type ... + argData + ) + ).toThrowError( + /catchInvalidKeys requires an object or array of objects as the only argument/ + ) + }) + }) + + describe('options.name is undefined or is not a string:', () => { + test.each([undefined, testNotString])('options.name: %s', (name) => { + expect(() => + catchInvalidKeys({ + // @ts-expect-error Type 'x' is not assignable to type 'string'. + name, + obj: { a: 'b' }, + validKeys: ['a', 'b', 'c'], + }) + ).toThrowError(/catchInvalidKeys requires 'options.name' be a string/) + }) + }) + + describe('options.obj is not an object if defined:', () => { + test.each(testNotObject)('options.value: %s', (obj) => { + expect(() => + catchInvalidKeys({ + name: 'test', + // @ts-expect-error Type 'x' is not assignable to type 'object'. + obj, + validKeys: ['a', 'b', 'c'], + }) + ).toThrowError( + /catchInvalidKeys requires 'options.obj' be an object if defined/ + ) + }) + }) + + describe('options.validKeys is undefined or is not an array of strings with length > 0:', () => { + test.each([undefined, testNotArrayOfLength])( + 'options.validKeys: %s', + (validKeys) => { + expect(() => + catchInvalidKeys({ + name: 'test', + obj: { a: 'b' }, + // @ts-expect-error Type 'x' is not assignable to type 'string[]' | undefined. + validKeys, + }) + ).toThrowError( + /catchInvalidKeys requires 'options.validKeys' be an array of strings/ + ) + } + ) + }) + }) + + /** + * Returns true + */ + describe('returns true:', () => { + test('if options.obj is undefined', () => { + expect( + catchInvalidKeys({ + name: 'testObj', + obj: undefined, + validKeys: ['apple', 'bravo', 'charlie'], + }) + ).toEqual(true) + }) + + test('if no invalid keys found in options.obj', () => { + expect( + catchInvalidKeys({ + name: 'testObj', + obj: { apple: 'a', bravo: 'b', charlie: 'c' }, + validKeys: ['apple', 'bravo', 'charlie'], + }) + ).toEqual(true) + }) + + test('if options is an array and no invalid keys found in any obj', () => { + expect( + catchInvalidKeys([ + { + name: 'testObj_1', + obj: { apple: 'a', bravo: 'b', charlie: 'c' }, + validKeys: ['apple', 'bravo', 'charlie'], + }, + { + name: 'testObj_2', + obj: { delta: 'd', echo: 'e' }, + validKeys: ['delta', 'echo'], + }, + ]) + ).toEqual(true) + }) + }) + + /** + * Throws Error + */ + describe('throws Error:', () => { + test('if invalid keys found in options.obj', () => { + expect(() => + catchInvalidKeys({ + name: 'testObj', + obj: { apple: 'a', bravo: 'b', charlie: 'c', delta: 'd' }, + validKeys: ['apple', 'bravo', 'charlie'], + }) + ).toThrowError( + /Invalid keys for testObj: delta. Valid keys are: apple, bravo, charlie/ + ) + + expect(() => + catchInvalidKeys({ + name: 'testObj', + obj: { bravo: 'b', charlie: 'c' }, + validKeys: ['apple'], + }) + ).toThrowError( + /Invalid keys for testObj: bravo, charlie. Valid keys are: apple/ + ) + }) + + test('if options is an array and invalid keys found in any obj', () => { + expect(() => + catchInvalidKeys([ + { + name: 'testObj_1', + obj: { apple: 'a', bravo: 'b', charlie: 'c', delta: 'd' }, + validKeys: ['apple', 'bravo', 'charlie'], + }, + { + name: 'testObj_2', + obj: { echo: 'e', foxtrot: 'f' }, + validKeys: ['echo'], + }, + ]) + ).toThrowError( + /Invalid keys for testObj_1: delta. Valid keys are: apple, bravo, charlie/ + ) + + expect(() => + catchInvalidKeys([ + { + name: 'testObj_2', + obj: { echo: 'e', foxtrot: 'f' }, + validKeys: ['echo'], + }, + { + name: 'testObj_1', + obj: { apple: 'a', bravo: 'b', charlie: 'c', delta: 'd' }, + validKeys: ['apple', 'bravo', 'charlie'], + }, + ]) + ).toThrowError( + /Invalid keys for testObj_2: foxtrot. Valid keys are: echo/ + ) + + expect(() => + catchInvalidKeys([ + { + name: 'testObj', + obj: { apple: 'a', bravo: 'b' }, + validKeys: ['charlie'], + }, + ]) + ).toThrowError( + /Invalid keys for testObj: apple, bravo. Valid keys are: charlie/ + ) }) }) }) diff --git a/packages/lib/src/utils/__tests__/errorHandler.test.ts b/packages/lib/src/utils/__tests__/errorHandler.test.ts index d495c0f5..45590664 100644 --- a/packages/lib/src/utils/__tests__/errorHandler.test.ts +++ b/packages/lib/src/utils/__tests__/errorHandler.test.ts @@ -1,123 +1,208 @@ -import { describe, it, expect } from 'vitest' +import { describe, test, expect } from 'vitest' import { handleError, isError, rejectWithError } from '../errorHandler' const defaultErrorMessage = 'an unknown error occurred.' describe('errorHandler.ts - exports', () => { - it('isError function', () => { + test('isError function', () => { expect(isError).toBeDefined() expect(isError).toBeInstanceOf(Function) }) - it('handleError function', () => { + test('handleError function', () => { expect(handleError).toBeDefined() expect(handleError).toBeInstanceOf(Function) }) - it('rejectWithError function', () => { + test('rejectWithError function', () => { expect(rejectWithError).toBeDefined() expect(rejectWithError).toBeInstanceOf(Function) }) }) -describe('isError', () => { - it('returns true for errors', () => { - expect(isError(Error())).toBe(true) - expect(isError(TypeError())).toBe(true) - expect(isError(SyntaxError())).toBe(true) - expect(isError(EvalError())).toBe(true) - expect(isError(RangeError())).toBe(true) - expect(isError(ReferenceError())).toBe(true) - expect(isError(URIError())).toBe(true) +describe('isError()', () => { + describe('returns true for Error types:', () => { + test.each([ + ['Error', Error()], + ['TypeError', TypeError()], + ['SyntaxError', SyntaxError()], + ['EvalError', EvalError()], + ['RangeError', RangeError()], + ['ReferenceError', ReferenceError()], + ['URIError', URIError()], + ])('%s', (_, error) => { + expect(isError(error)).toBe(true) + }) }) - it('returns false for non-errors', () => { - expect(isError(123)).toBe(false) - expect(isError('string')).toBe(false) - expect(isError({ message: 'test' })).toBe(false) - expect(isError([1, 2, 3])).toBe(false) - expect(isError(null)).toBe(false) - expect(isError(undefined)).toBe(false) - expect(isError(true)).toBe(false) - expect(isError(false)).toBe(false) - expect(isError(() => null)).toBe(false) + describe('returns false for non-Error types:', () => { + test.each([ + ['string', 'string'], + ['number', 123], + ['object', { message: 'test' }], + ['array', [1, 2, 3]], + ['null', null], + ['undefined', undefined], + ['true', true], + ['false', false], + ['function', () => null], + ['Map', new Map()], + ['Date', new Date()], + ['RegExp', new RegExp('test')], + ['Promise', Promise.resolve()], + ])('%s', (_, error) => { + expect(isError(error)).toBe(false) + // @ts-expect-error Expected 1 arguments, but got 0. + expect(isError()).toBe(false) + }) }) }) -describe('handleError', () => { - it('returns same Error when provided an Error', () => { - expect(handleError(Error('test error'))).toBeInstanceOf(Error) - expect(handleError(Error('test error')).message).toBe('test error') - - expect(handleError(TypeError('test error'))).toBeInstanceOf(TypeError) - expect(handleError(SyntaxError('test error'))).toBeInstanceOf(SyntaxError) - expect(handleError(EvalError('test error'))).toBeInstanceOf(EvalError) - expect(handleError(RangeError('test error'))).toBeInstanceOf(RangeError) - expect(handleError(ReferenceError('test error'))).toBeInstanceOf( - ReferenceError - ) - expect(handleError(URIError('test error'))).toBeInstanceOf(URIError) +describe('handleError()', () => { + describe('returns same Error and default message when passed an Error type without a message:', () => { + test.each([ + ['Error', Error()], + ['TypeError', TypeError()], + ['SyntaxError', SyntaxError()], + ['EvalError', EvalError()], + ['RangeError', RangeError()], + ['ReferenceError', ReferenceError()], + ['URIError', URIError()], + ])('%s', (_, error) => { + expect(handleError(error)).toBeInstanceOf(Error) + }) }) - it('returns an Error with message when provided a message string', () => { - expect(handleError('test error')).toBeInstanceOf(Error) - expect(handleError('test error').message).toBe('test error') - - expect(handleError('')).toBeInstanceOf(Error) - expect(handleError('').message).toBe('') + describe('returns same Error and message when passed an Error type containing a message:', () => { + const errorMsg = 'some test error message' + test.each([ + ['Error', Error(errorMsg)], + ['TypeError', TypeError(errorMsg)], + ['SyntaxError', SyntaxError(errorMsg)], + ['EvalError', EvalError(errorMsg)], + ['RangeError', RangeError(errorMsg)], + ['ReferenceError', ReferenceError(errorMsg)], + ['URIError', URIError(errorMsg)], + ])('%s', (_, error) => { + expect(handleError(error)).toBeInstanceOf(Error) + expect(handleError(error).message).toBe(errorMsg) + }) }) - it('returns an Error with default message', () => { - expect(handleError(Error())).toBeInstanceOf(Error) - expect(handleError(Error()).message).toBe(defaultErrorMessage) - - expect(handleError(undefined)).toBeInstanceOf(Error) - expect(handleError(undefined).message).toBe(defaultErrorMessage) + describe('returns a new Error with same message when passed a message string:', () => { + test.each([ + ['string', 'some error message'], + ['empty string', ''], + ])('%s', (_, errorMsg) => { + expect(handleError(errorMsg)).toBeInstanceOf(Error) + expect(handleError(errorMsg).message).toBe(errorMsg) + }) + }) - expect(handleError(null)).toBeInstanceOf(Error) - expect(handleError(null).message).toBe(defaultErrorMessage) + describe('returns an Error with a default message if not passed a string or Error:', () => { + test.each([ + ['number', 123], + ['object', { message: 'test' }], + ['array', [1, 2, 3]], + ['null', null], + ['undefined', undefined], + ['true', true], + ['false', false], + ['function', () => null], + ['Map', new Map()], + ['Date', new Date()], + ['RegExp', new RegExp('test')], + ['Promise', Promise.resolve()], + ])('%s', (_, error) => { + expect(handleError(error)).toBeInstanceOf(Error) + expect(handleError(error).message).toBe(defaultErrorMessage) + + // @ts-expect-error Expected 1 arguments, but got 0. + expect(handleError()).toBeInstanceOf(Error) + // @ts-expect-error Expected 1 arguments, but got 0. + expect(handleError().message).toBe(defaultErrorMessage) + }) + }) +}) - expect(handleError({ message: 'test error', b: 2 })).toBeInstanceOf(Error) - expect(handleError({ message: 'test error', b: 2 }).message).toBe( - defaultErrorMessage - ) +describe('rejectWithError() - returns rejected promise:', () => { + describe('with same Error and default message when passed an Error type without a message', () => { + test.each([ + ['Error', Error()], + ['TypeError', TypeError()], + ['SyntaxError', SyntaxError()], + ['EvalError', EvalError()], + ['RangeError', RangeError()], + ['ReferenceError', ReferenceError()], + ['URIError', URIError()], + ])('%s', async (_, error) => { + await expect(rejectWithError(error)).rejects.toBeInstanceOf(Error) + await expect(rejectWithError(error)).rejects.toHaveProperty( + 'message', + defaultErrorMessage + ) + }) + }) - expect(handleError(['a', 'b', 'c'])).toBeInstanceOf(Error) - expect(handleError(['a', 'b', 'c']).message).toBe(defaultErrorMessage) + describe('with same Error and message when when passed an Error type with a message', () => { + test.each([ + ['Error', Error('test error')], + ['TypeError', TypeError('test error')], + ['SyntaxError', SyntaxError('test error')], + ['EvalError', EvalError('test error')], + ['RangeError', RangeError('test error')], + ['ReferenceError', ReferenceError('test error')], + ['URIError', URIError('test error')], + ])('%s', async (_, error) => { + await expect(rejectWithError(error)).rejects.toBeInstanceOf(Error) + await expect(rejectWithError(error)).rejects.toHaveProperty( + 'message', + 'test error' + ) + }) }) -}) -describe('rejectWithError', () => { - it('rejects with provided Error', async () => { - await expect(rejectWithError(Error('test error'))).rejects.toBeInstanceOf( - Error - ) - await expect(rejectWithError(Error('test error'))).rejects.toHaveProperty( - 'message', - 'test error' - ) + describe('with new Error when a passed a string as the error message', () => { + test.each([ + ['string', 'test error'], + ['empty string', ''], + ])('%s', async (_, errorMsg) => { + await expect(rejectWithError(errorMsg)).rejects.toBeInstanceOf(Error) + await expect(rejectWithError(errorMsg)).rejects.toHaveProperty( + 'message', + errorMsg + ) + }) }) - it('rejects with a new Error if not provided an Error', async () => { - await expect(rejectWithError('test error')).rejects.toBeInstanceOf(Error) - await expect(rejectWithError('test error')).rejects.toHaveProperty( - 'message', - 'test error' - ) - - await expect(rejectWithError('')).rejects.toBeInstanceOf(Error) - await expect(rejectWithError('')).rejects.toHaveProperty('message', '') - - await expect(rejectWithError(Error())).rejects.toBeInstanceOf(Error) - await expect(rejectWithError(Error())).rejects.toHaveProperty( - 'message', - defaultErrorMessage - ) - - await expect(rejectWithError(undefined)).rejects.toBeInstanceOf(Error) - await expect(rejectWithError(undefined)).rejects.toHaveProperty( - 'message', - defaultErrorMessage - ) + describe('with a new Error and default message if not passed an Error or string', () => { + test.each([ + ['number', 123], + ['object', { message: 'test' }], + ['array', [1, 2, 3]], + ['null', null], + ['undefined', undefined], + ['true', true], + ['false', false], + ['function', () => null], + ['Map', new Map()], + ['Date', new Date()], + ['RegExp', new RegExp('test')], + ['Promise', Promise.resolve()], + ])('%s', async (_, error) => { + await expect(rejectWithError(error)).rejects.toBeInstanceOf(Error) + await expect(rejectWithError(error)).rejects.toHaveProperty( + 'message', + defaultErrorMessage + ) + + // @ts-expect-error Expected 1 arguments, but got 0. + await expect(rejectWithError()).rejects.toBeInstanceOf(Error) + // @ts-expect-error Expected 1 arguments, but got 0. + await expect(rejectWithError()).rejects.toHaveProperty( + 'message', + defaultErrorMessage + ) + }) }) }) diff --git a/packages/lib/src/utils/__tests__/getTypeof.test.ts b/packages/lib/src/utils/__tests__/getTypeof.test.ts index 99d14dbf..6b77473b 100644 --- a/packages/lib/src/utils/__tests__/getTypeof.test.ts +++ b/packages/lib/src/utils/__tests__/getTypeof.test.ts @@ -1,37 +1,66 @@ -import { describe, expect, it } from 'vitest' +import { describe, expect, test } from 'vitest' import { getTypeof } from '../getTypeof' describe('getTypeof.ts - exports', () => { - it('getTypeof function', () => { + test('getTypeof function', () => { expect(getTypeof).toBeDefined() expect(getTypeof).toBeInstanceOf(Function) }) }) -describe('getTypeof', () => { - it('it returns correct type', () => { - expect(getTypeof(undefined)).toBe('undefined') - expect(getTypeof(null)).toBe('null') - expect(getTypeof(true)).toBe('boolean') - expect(getTypeof('this is a string')).toBe('string') - expect(getTypeof(() => 'this is a function')).toBe('function') - expect(getTypeof({ an: 'object' })).toBe('object') - expect(getTypeof(['an', 'array'])).toBe('array') +describe('getTypeof()', () => { + describe('returns correct type for primitive values:', () => { + test.each([ + [undefined, 'undefined'], + [null, 'null'], + [true, 'boolean'], + [false, 'boolean'], + ['this is a string', 'string'], + [123, 'number'], + [123.456, 'number'], + [NaN, 'number'], + [Infinity, 'number'], + [0, 'number'], + [-0, 'number'], + [Infinity, 'number'], + [-Infinity, 'number'], + [123n, 'bigint'], + [Symbol('test'), 'symbol'], + ])('value: %s = type: "%s"', (value, type) => { + expect(getTypeof(value)).toBe(type) + }) }) - it('it handles different Error types as type "error"', () => { - const error = new Error('this is an error') - const typeError = new TypeError('this is a type error') - const rangeError = new RangeError('this is a range error') - const referenceError = new ReferenceError('this is a reference error') - const syntaxError = new SyntaxError('this is a syntax error') - const uriError = new URIError('this is a URI error') + describe('returns correct type for non-primitive values:', () => { + test.each([ + [{ message: 'test' }, 'object'], + [{}, 'object'], + [[1, 2, 3], 'array'], + [() => null, 'function'], + [class {}, 'function'], + [new Map(), 'map'], + [new Date(), 'date'], + [new RegExp('test'), 'regexp'], + [Promise.resolve(), 'promise'], + [new Set(), 'set'], + [new WeakMap(), 'weakmap'], + [new WeakSet(), 'weakset'], + ])(`value: %s = type: "%s"`, (value, type) => { + expect(getTypeof(value)).toBe(type) + }) + }) - expect(getTypeof(error)).toBe('error') - expect(getTypeof(typeError)).toBe('error') - expect(getTypeof(rangeError)).toBe('error') - expect(getTypeof(referenceError)).toBe('error') - expect(getTypeof(syntaxError)).toBe('error') - expect(getTypeof(uriError)).toBe('error') + describe('returns type "error" for all Error types:', () => { + test.each([ + [Error(), 'error'], + [TypeError(), 'error'], + [SyntaxError(), 'error'], + [EvalError(), 'error'], + [RangeError(), 'error'], + [ReferenceError(), 'error'], + [URIError(), 'error'], + ])(`value: %s = type: "%s"`, (error) => { + expect(getTypeof(error)).toBe('error') + }) }) }) diff --git a/packages/lib/src/utils/__tests__/index.test.ts b/packages/lib/src/utils/__tests__/index.test.ts index 35560163..aa6b8fa1 100644 --- a/packages/lib/src/utils/__tests__/index.test.ts +++ b/packages/lib/src/utils/__tests__/index.test.ts @@ -1,4 +1,4 @@ -import { describe, expect, it } from 'vitest' +import { describe, expect, test } from 'vitest' import { catchInvalidArguments, createQueryString, @@ -12,47 +12,47 @@ import { } from '../' describe('utils/index.ts', () => { - it('exports catchInvalidArguments function', () => { + test('exports catchInvalidArguments function', () => { expect(catchInvalidArguments).toBeDefined() expect(catchInvalidArguments).toBeInstanceOf(Function) }) - it('exports createQueryString function', () => { + test('exports createQueryString function', () => { expect(createQueryString).toBeDefined() expect(createQueryString).toBeInstanceOf(Function) }) - it('exports encodeQueryStringParams function', () => { + test('exports encodeQueryStringParams function', () => { expect(encodeQueryStringParams).toBeDefined() expect(encodeQueryStringParams).toBeInstanceOf(Function) }) - it('exports getTypeof function', () => { + test('exports getTypeof function', () => { expect(getTypeof).toBeDefined() expect(getTypeof).toBeInstanceOf(Function) }) - it('exports handleError function', () => { + test('exports handleError function', () => { expect(handleError).toBeDefined() expect(handleError).toBeInstanceOf(Function) }) - it('exports isError function', () => { + test('exports isError function', () => { expect(isError).toBeDefined() expect(isError).toBeInstanceOf(Function) }) - it('exports isValidVin function', () => { + test('exports isValidVin function', () => { expect(isValidVin).toBeDefined() expect(isValidVin).toBeInstanceOf(Function) }) - it('exports rejectWithError function', () => { + test('exports rejectWithError function', () => { expect(rejectWithError).toBeDefined() expect(rejectWithError).toBeInstanceOf(Function) }) - it('exports validateArgument function', () => { + test('exports validateArgument function', () => { expect(validateArgument).toBeDefined() expect(validateArgument).toBeInstanceOf(Function) }) diff --git a/packages/lib/src/utils/__tests__/isValidVin.test.ts b/packages/lib/src/utils/__tests__/isValidVin.test.ts index 267635a3..64e34241 100644 --- a/packages/lib/src/utils/__tests__/isValidVin.test.ts +++ b/packages/lib/src/utils/__tests__/isValidVin.test.ts @@ -1,40 +1,82 @@ -import { describe, expect, it } from 'vitest' -import { isValidVin } from '../isValidVin' +import { describe, expect, test } from 'vitest' +import { isValidVin, generateRandomVIN } from '../isValidVin' -describe('isValidVin.ts - exports', () => { - it('isValidVin function', () => { +describe('isValidVin.ts - exports:', () => { + test('isValidVin function', () => { expect(isValidVin).toBeDefined() expect(isValidVin).toBeInstanceOf(Function) }) + + test('generateRandomVIN function', () => { + expect(generateRandomVIN).toBeDefined() + expect(generateRandomVIN).toBeInstanceOf(Function) + }) }) -describe('isValidVin - utility helper function', () => { - it('it should return true with a valid VIN', () => { - // All zeros - expect(isValidVin('00000000000000000')).toBe(true) - // valid uppercase - expect(isValidVin('3VWD07AJ5EM388202')).toBe(true) - expect(isValidVin('1FMJK2AT1KEA36140')).toBe(true) - expect(isValidVin('5XYZU3LA1EG176607')).toBe(true) - // valid lowercase - expect(isValidVin('3vwd07aj5em388202')).toBe(true) - }) - - it('it should fail with invalid arguments', async () => { - // known invalid VIN - expect(isValidVin('3VWD07AJ5EM388203')).toBe(false) - // VIN too short - expect(isValidVin('3VWD07AJ5EM38820')).toBe(false) - expect(isValidVin('1234567890')).toBe(false) - expect(isValidVin('')).toBe(false) - // invalid check digit (vin[8]) - expect(isValidVin('3VWD07AJAEM388203')).toBe(false) - // check digit is equal to 'X' but vin is invalid - expect(isValidVin('3VWD07AJXEM388203')).toBe(false) - // invalid argument type - expect(isValidVin([] as unknown as string)).toBe(false) - expect(isValidVin({} as unknown as string)).toBe(false) - // missing argument - expect(isValidVin(undefined as unknown as string)).toBe(false) +describe('isValidVin())', () => { + describe('returns true when passed a known valid VIN', () => { + test.each([ + '3VWD07AJ5EM388202', + '3VWD07AJ5EM388202 ', + '1FMJK2AT1KEA36140', + '5XYZU3LA1EG176607', + '1M8GDM9AXKP042788', + '3vwd07aj5em388202', + ])('%s', (vin) => { + expect(isValidVin(vin)).toBe(true) + }) + }) + + describe('returns true when passed a structurally valid VIN that does not correspond to an actual vehicle', () => { + test.each([ + '00000000000000000', + '11111111111111111', + generateRandomVIN(), + generateRandomVIN(), + generateRandomVIN(), + generateRandomVIN(), + ])('%s', (vin) => { + expect(isValidVin(vin)).toBe(true) + }) + }) + + describe('returns false when passed an invalid VIN', () => { + test.each([ + '3VWD07AJ5EM3882020', + '3VWD07AJ5EM388203', + '3VWD07AJAEM388203', + '3VWD07AJXEM388203', + '3VWD07AJ5EM38820', + '1234567890', + '', + ])('%s', (vin) => { + expect(isValidVin(vin)).toBe(false) + }) + }) + + describe('returns false when passed arg that is not a string', () => { + test.each([[], {}, undefined, null, true, false, 0, 1, NaN, () => {}])( + '%s', + (vin) => { + // @ts-expect-error Type 'x' is not assignable to type 'string'. + expect(isValidVin(vin)).toBe(false) + } + ) + }) +}) + +describe('generateRandomVIN()', () => { + test('returns a string', () => { + expect(typeof generateRandomVIN()).toBe('string') + }) + + test('returns a string that is 17 characters long', () => { + expect(generateRandomVIN().length).toBe(17) + }) + + test('returns a string that is 17 characters long and is a valid VIN', () => { + const vin = generateRandomVIN() + expect(vin.length).toBe(17) + expect(isValidVin(vin)).toBe(true) }) }) diff --git a/packages/lib/src/utils/__tests__/queryString.test.ts b/packages/lib/src/utils/__tests__/queryString.test.ts index 7c409185..10b6742e 100644 --- a/packages/lib/src/utils/__tests__/queryString.test.ts +++ b/packages/lib/src/utils/__tests__/queryString.test.ts @@ -1,166 +1,133 @@ -import { describe, expect, it } from 'vitest' +import { describe, expect, test } from 'vitest' import { createQueryString, encodeQueryStringParams } from '../queryString' describe('queryString.ts - exports', () => { - it('createQueryString function', () => { + test('createQueryString function', () => { expect(createQueryString).toBeDefined() expect(createQueryString).toBeInstanceOf(Function) }) - it('validateArgument function', () => { + test('validateArgument function', () => { expect(encodeQueryStringParams).toBeDefined() expect(encodeQueryStringParams).toBeInstanceOf(Function) }) }) -describe('createQueryString', () => { +describe('encodeQueryStringParams()', () => { /************** * Successes **************/ - it('returns correct string with: one param', () => { - expect( - createQueryString({ - modelYear: '2019', - }) - ).toBe('?modelYear=2019&format=json') - }) - - it('returns correct string with: two params', () => { - expect( - createQueryString({ - modelYear: '2019', - page: 2, - }) - ).toBe('?modelYear=2019&page=2&format=json') - }) - - it('URI encodes string values', () => { - expect( - createQueryString({ - variable: 'vehicle type', - mixed: 'something./?&=+[]{}-_|!@#$%^&*()<>:;",', - }) - ).toBe( - '?variable=vehicle%20type&mixed=something.%2F%3F%26%3D%2B%5B%5D%7B%7D-_%7C!%40%23%24%25%5E%26*()%3C%3E%3A%3B%22%2C&format=json' - ) - }) - - /************** - * Returns Default String - **************/ - it('returns default string when: no params', () => { - expect(createQueryString()).toBe('?format=json') - }) - - it('returns default string when: params are undefined', () => { - expect(createQueryString(undefined)).toBe('?format=json') - }) - - it('returns default string when: params are an empty object', () => { - expect(createQueryString({})).toBe('?format=json') - }) - - it('ignores empty string values #1', () => { - expect( - createQueryString({ - empty: '', - }) - ).toBe('?format=json') - }) - - it('ignores empty string values #2', () => { - expect( - createQueryString({ - empty: '', - modelYear: 2019, - }) - ).toBe('?modelYear=2019&format=json') - }) - - it('ignores invalid values', () => { - const params = { outer: { inner: true } } - expect(createQueryString(params as unknown as Record)).toBe( - '?format=json' - ) + describe('returns correct object with values URI component encoded', () => { + test.each([ + [{}, {}], + [{ modelYear: '2019' }, { modelYear: '2019' }], + [ + { modelYear: '2019', page: 2 }, + { modelYear: '2019', page: '2' }, + ], + [ + { modelYear: '2019', page: 2, variable: 'vehicle type' }, + { modelYear: '2019', page: '2', variable: 'vehicle%20type' }, + ], + [ + { + modelYear: '2019', + page: 2, + variable: 'vehicle type', + mixed: 'something./?&=+[]{}-_|!@#$%^&*()<>:;",', + }, + { + modelYear: '2019', + page: '2', + variable: 'vehicle%20type', + mixed: + 'something.%2F%3F%26%3D%2B%5B%5D%7B%7D-_%7C!%40%23%24%25%5E%26*()%3C%3E%3A%3B%22%2C', + }, + ], + ])('params: %s', (params, expected) => { + expect(encodeQueryStringParams(params)).toEqual(expected) + }) }) /**************** * Throws Error ****************/ - it('throws error if first argument is an array', () => { - expect(() => - createQueryString(['it', 'invalid'] as unknown as Record) - ).toThrowError() - }) - - it('arg is a string', () => { - expect(() => - createQueryString('it' as unknown as Record) - ).toThrowError() - }) - - describe('allowEmptyStringValues option set to true:', () => { - it('handles only one param containing an empty string value', () => { - expect(createQueryString({ nothingHere: '' }, true)).toBe( - '?nothingHere=&format=json' - ) - }) - - it('handles multiple params containing empty string values', () => { - expect(createQueryString({ nothingHere: '', second: '' }, true)).toBe( - '?nothingHere=&second=&format=json' - ) - }) - - it('handles a mix of non-empty values and empty string values', () => { - expect( - createQueryString({ nothingHere: '', modelYear: 2019 }, true) - ).toBe('?nothingHere=&modelYear=2019&format=json') + describe('throws error when params is not passed or is not an object', () => { + test.each([ + [undefined], + ['string'], + [123], + [true], + [false], + [() => 'function'], + ])('params: %s', (params) => { + expect(() => + // @ts-expect-error Type 'x' is not assignable to type 'QueryStringParams'. + encodeQueryStringParams(params) + ).toThrowError(/error validating argument named "params"/) }) }) }) -describe('encodeQueryStringParams', () => { +describe('createQueryString()', () => { /************** * Successes **************/ - describe('returns correct object', () => { - it('params is an empty object', () => { - expect(encodeQueryStringParams({})).toEqual({}) - }) - - it('one param', () => { - expect( - encodeQueryStringParams({ + describe('returns correct string', () => { + test.each([ + [undefined, '?format=json'], + [{}, '?format=json'], + [{ modelYear: '2019' }, '?modelYear=2019&format=json'], + [{ modelYear: '2019', page: 2 }, '?modelYear=2019&page=2&format=json'], + [ + { modelYear: '2019', page: 2, variable: 'vehicle type' }, + '?modelYear=2019&page=2&variable=vehicle%20type&format=json', + ], + [ + { modelYear: '2019', - }) - ).toEqual({ modelYear: '2019' }) + page: 2, + variable: 'vehicle type', + mixed: 'something./?&=+[]{}-_|!@#$%^&*()<>:;",', + }, + '?modelYear=2019&page=2&variable=vehicle%20type&mixed=something.%2F%3F%26%3D%2B%5B%5D%7B%7D-_%7C!%40%23%24%25%5E%26*()%3C%3E%3A%3B%22%2C&format=json', + ], + ])('params: %s', (params, expected) => { + expect(createQueryString(params)).toBe(expected) }) - it('one param with spaces', () => { - expect( - encodeQueryStringParams({ - variable: 'Some Variable', - }) - ).toEqual({ variable: 'Some%20Variable' }) + describe('and ignores empty string values', () => { + test.each([ + [{ empty: '' }, '?format=json'], + [{ empty: '', modelYear: 2019 }, '?modelYear=2019&format=json'], + ])('params: %s', (params, expected) => { + expect(createQueryString(params)).toBe(expected) + }) }) - it('empty string value', () => { - expect( - encodeQueryStringParams({ - empty: '', - }) - ).toEqual({ empty: '' }) + describe('and allows empty string values with allowEmptyStringValues option set to true', () => { + test.each([ + [{ empty: '' }, '?empty=&format=json'], + [ + { empty: '', empty2: '', empty3: undefined }, + '?empty=&empty2=&format=json', + ], + [{ empty: '', modelYear: 2019 }, '?empty=&modelYear=2019&format=json'], + ])('params: %s', (params, expected) => { + expect(createQueryString(params, true)).toBe(expected) + }) }) - it('params with encodable characters', () => { - expect( - encodeQueryStringParams({ - variable: 'something./?&=+[] {}-_|!@#$%^&*()<>:;"', - }) - ).toEqual({ - variable: - 'something.%2F%3F%26%3D%2B%5B%5D%20%7B%7D-_%7C!%40%23%24%25%5E%26*()%3C%3E%3A%3B%22', + describe('and ignores invalid params', () => { + test.each([ + [{ invalid: ['a', 'b'], invalid2: { a: 'b' } }, '?format=json'], + [ + { modelYear: '2019', invalid: ['a', 'b'], invalid2: { a: 'b' } }, + '?modelYear=2019&format=json', + ], + ])('params: %s', (params, expected) => { + // @ts-expect-error Type 'x' is not assignable to type 'QueryStringTypes'. + expect(createQueryString(params)).toBe(expected) }) }) }) @@ -168,26 +135,15 @@ describe('encodeQueryStringParams', () => { /**************** * Throws Error ****************/ - describe('throws error', () => { - it('params is undefined', () => { - expect(() => - encodeQueryStringParams(undefined as unknown as Record) - ).toThrowError() - }) - - it('params is an array', () => { - expect(() => - encodeQueryStringParams(['it', 'invalid'] as unknown as Record< - string, - string - >) - ).toThrowError() - }) - - it('params is a string', () => { - expect(() => - encodeQueryStringParams('it' as unknown as Record) - ).toThrowError() - }) + describe('throws Error if params is not an object', () => { + test.each(['string', ['array'], 123, true, false, () => 'function'])( + 'params: %s', + (params) => { + expect(() => + // @ts-expect-error Type 'x' is not assignable to type 'QueryStringParams'. + createQueryString(params) + ).toThrowError(/error validating argument named "params"/) + } + ) }) }) diff --git a/packages/lib/src/utils/argHandler.ts b/packages/lib/src/utils/argHandler.ts index 01ad4ec3..dbd7e930 100644 --- a/packages/lib/src/utils/argHandler.ts +++ b/packages/lib/src/utils/argHandler.ts @@ -8,16 +8,35 @@ import type { AtLeastOne } from '@/types' export type IArgToValidate = { name: string - value: unknown - errorMode?: 'error' | 'boolean' -} & AtLeastOne<{ + value?: unknown required?: boolean + requiredBy?: Array<{ + name: string + value: unknown + }> types?: string[] -}> + validKeys?: string[] + errorMode?: 'error' | 'boolean' +} & ( + | AtLeastOne<{ + required?: boolean + types?: string[] + }> + | { + requiredBy: Array<{ + name: string + value: unknown + }> + } + | { + value: Record + validKeys: string[] + } +) /** - * Will validate a single argument based on the provided options and throws an error with a message - * detailing the invalid argument(s) and what was expected. + * Will validate a single argument based on the provided arg object and throws an error with a + * message detailing the invalid argument(s) and what was expected. * * There are two modes for this function: * - 'error' - (default) - Throws an error if the argument fails validation. @@ -36,23 +55,22 @@ export type IArgToValidate = { * such as in Array.filter() or 'if' statements. It will return false if the argument is invalid * and true if the argument is valid. * - * ### Options + * ### `argData` Object * * The main purpose for this function is to throw a helpful Error message to the user when they * are using the endpoint functions in a way that would cause the NHTSA API to return an error. - * In default mode, it uses the `options.name` and `options.types` array (if provided) to build the + * In default mode, it uses the `argData.name` and `argData.types` array (if provided) to build the * error message in the case of validation failure. * - * - `options.name` and `options.value` are required in each arg object. It's ok to pass undefined + * - `argData.name` and `argData.value` are required in the arg object. It's ok to pass undefined * as the value, i.e. `{ value: someVarThatMightBeUndefined }`, but you must provide a name for the * argument. If you didn't provide a name then the error message would not be as helpful. * - * - `options.required` and `options.types` are optional. + * - `argData.required` and `argData.types` are optional. * - * At least one of `options.required` or `options.types` must be provided as part of each arg - * object. At least one of these options must be provided for each arg object, otherwise it will - * always return true. You probably don't need to validate that arg if you don't provide at least - * one of these options. + * At least one of `argData.required` or `argData.types` must be provided as part of each arg + * object. At least one of these must be provided, otherwise it will always return true. You + * probably don't need to validate that arg if you don't provide at least* one of these options. * * ### Validation Logic * @@ -70,60 +88,174 @@ export type IArgToValidate = { * - If neither `required` nor `types` are provided, it will not peerform validation and will * simply return true. * - * @param options - options object - * @param {string} options.name - name of the argument - * @param {unknown} options.value - value of the argument - * @param {boolean} [options.required] - if true, will validate that value is defined - * @param {(string[])} [options.types] - array of strings to validate value against - * @param {("error"|"boolean")} [options.errorMode='error'] - 'error' or 'boolean' - 'error' will + * @param argData - options object + * @param argData.name - name of the argument + * @param argData.value - value of the argument + * @param [argData.required] - if true, will validate that value is defined + * @param [argData.requiredBy] - array of objects with name and value properties. Will validate + * that value is defined if any of the `value`s in requiredBy array are defined. + * @param [argData.requiredBy.name] - name of the argument that requires this argument to be defined + * @param [argData.requiredBy.value] - value of the argument that requires this argument to be + * defined + * @param [argData.types] - array of strings to validate value against + * @param [argData.errorMode='error'] - 'error' or 'boolean' - 'error' will * throw an error if the argument is invalid, 'boolean' will return false if the argument is invalid - * @returns {(Error|boolean)} - true if validation passes, mode 'error' throws Error in the case of + * @returns - true if validation passes, mode 'error' throws Error in the case of * validation failure, mode 'boolean' returns false in the case of validation failure */ -export const validateArgument = ({ - name, - value, - required, - types, - errorMode = 'error', -}: IArgToValidate): boolean => { +export const validateArgument = (argData: IArgToValidate): boolean => { + if (getTypeof(argData) !== 'object') { + throw Error( + `'argData' argument is required and must be an object containing valid options` + ) + } + + const { + name, + value, + required, + requiredBy, + types, + validKeys, + errorMode = 'error', + } = argData + /* later we will use this to store types normalized to lowercase */ + const typesLowercased: string[] = [] + + /* validate and typeguard argData passed to function */ if (getTypeof(name) !== 'string') { - throw Error(`'name', is required and must be of type string`) + throw Error(`'argData.name', is required and must be of type string`) + } + if (required !== undefined && getTypeof(required) !== 'boolean') { + throw Error(`'argData.required' must be of type boolean if provided`) + } + if (requiredBy) { + if (getTypeof(requiredBy) !== 'array' || !requiredBy.length) { + throw Error( + `'argData.requiredBy' must be an array of objects if provided` + ) + } + requiredBy.forEach((arg) => { + if (getTypeof(arg) !== 'object') { + throw Error( + `'argData.requiredBy' must be an array of objects if provided` + ) + } + if (arg.value) { + if (getTypeof(arg.name) !== 'string') { + throw Error( + `'argData.requiredBy' requires both a name and value if value is defined` + ) + } + } + }) } + if (types) { + if (getTypeof(types) !== 'array' || !types.length) { + throw Error(`'argData.types' must be an array of strings if provided`) + } + types.forEach((type) => { + if (getTypeof(type) !== 'string') { + throw Error(`'argData.types' must be an array of strings if provided`) + } + /* normalize all passed types to lowercase */ + typesLowercased.push(type.toLowerCase()) + }) + } + if (validKeys) { + if (getTypeof(validKeys) !== 'array' || !validKeys.length) { + throw Error(`'argData.validKeys' must be an array of strings if provided`) + } + validKeys.forEach((key) => { + if (getTypeof(key) !== 'string') { + throw Error( + `'argData.validKeys' must be an array of strings if provided` + ) + } + }) + } + /* End of argData validation */ + /* for argument validation error messages */ let error = '' const typeofValue = getTypeof(value) const errorPrepend = `error validating argument named "${name}",` const errorAppend = `received value: ${value} - of type: <${typeofValue}>` - if (types && (getTypeof(types) !== 'array' || !types.length)) { - throw Error(`${errorPrepend} 'types' must be an array of strings`) + /* + * If provided an array of requiredBy objects with name and value properties, will validate + * `argData.value` is defined if any of the `value`s in requiredBy array are defined. + */ + if (requiredBy && requiredBy.length) { + try { + requiredBy.forEach(({ name: requiredByName, value: requiredByValue }) => { + if (requiredByValue) { + /* + * If options.value is falsey throw an error because this requiredBy.value requires it + * be defined + */ + if (!value) { + throw Error(`${errorPrepend} it is required if "${requiredByName}" is passed, + ${errorAppend}`) + } + } + }) + } catch (err) { + error = (err as Error).message + } + + /* exit early if requiredBy checks do not pass */ + if (error.length) { + if (errorMode === 'boolean') return false + else throw Error(error) + } } - /* ex: if types = ['string', 'number'] then you'll get '' */ - const joinedTypes = types ? `<${types.join(' | ')}>` : '' + /* + * If provided an array of validKeys and value is an object, will validate that the object + * contains only the valid keys in the array. + */ + if (getTypeof(value) === 'object' && validKeys) { + try { + catchInvalidKeys({ + name, + obj: value as Record, + validKeys, + }) + } catch (err) { + error = (err as Error).message + } + + /* exit early if validKeys checks do not pass */ + if (error.length) { + if (errorMode === 'boolean') return false + else throw Error(error) + } + } /* argument validation logic */ - if (required && !types) { - if (!value) { - error = `${errorPrepend} is required, ${errorAppend}` + if (required && !typesLowercased.length) { + if (value === undefined) { + error = `${errorPrepend} it is required, ${errorAppend}` } - } else if (types && !required) { + } else if (!required && typesLowercased.length) { /* if value is not defined and is not required then we don't need to validate the type */ - if (value !== undefined && !types.includes(typeofValue)) { - error = `${errorPrepend} must be of type(s) ${joinedTypes}, ${errorAppend}` + if (value !== undefined && !typesLowercased.includes(typeofValue)) { + error = `${errorPrepend} must be of type(s) ${typesLowercased}, ${errorAppend}` } - } else if (required && types) { - if (!value || !types.includes(typeofValue)) { - error = `${errorPrepend} is required and must be of type(s) ${joinedTypes}, ${errorAppend}` + } else if (required && typesLowercased.length) { + if (value === undefined || !typesLowercased.includes(typeofValue)) { + error = `${errorPrepend} it is required and must be of type(s) ${typesLowercased}, ${errorAppend}` } } + /* if any argument validation has failed, throw an error or return false depending on mode */ if (error.length) { if (errorMode === 'boolean') return false else throw Error(error) } + /* else all validation has passed, return true */ return true } @@ -139,25 +271,24 @@ export const validateArgument = ({ * options in each arg. See the description for `validateArgument` for more details on how * validation logic works and how to override the default error throwing behavior. * - * @param {Object} options - options object - * @param {IArgToValidate[]} options.args - array of IArgToValidate objects - * @param {boolean} [options.mode=default] - 'default' or 'atLeast' - 'default' will validate all + * @param options - options object with args array and mode + * @param options.args - array of IArgToValidate objects + * @param [options.mode="default"] - 'default' or 'atLeast' - 'default' will validate all * args, 'atLeast' will validate at least one arg in in the array has a defined value - * @returns {boolean} - true if validation passes, throws error in the case of validation failure + * @returns - true if validation passes, throws error in the case of validation failure */ -export const catchInvalidArguments = ({ - args, - mode = 'default', -}: { +export const catchInvalidArguments = (options: { args: IArgToValidate[] mode?: 'default' | 'atLeast' }) => { - if (getTypeof(args) !== 'array' || !args.length) { + if (getTypeof(options?.args) !== 'array' || !options?.args.length) { throw Error( `catchInvalidArguments requires "args" that must be an array of IArgToValidate objects` ) } + const { args, mode = 'default' } = options + if (mode === 'default') { args.forEach((arg) => validateArgument(arg)) } else if (mode === 'atLeast') { @@ -173,3 +304,87 @@ export const catchInvalidArguments = ({ return true } + +/** + * Checks if the provided object contains any invalid keys. + * Throws an error if invalid keys are found. + * + * ILYSS + * + * @param options - Options object passed to function. + * @param options.name - The name of the object being checked. + * @param options.obj - The object to be checked for invalid keys. + * @param options.validKeys - An array of valid keys to check against. + * @returns Returns true if no invalid keys are found. + * @throws Throws an error if invalid keys are found. + */ +export const catchInvalidKeys = ( + options: + | { + name: string + obj: Record | undefined + validKeys: string[] + } + | Array<{ + name: string + obj: Record | undefined + validKeys: string[] + }> +) => { + /* error messages */ + const errorPrepend = `catchInvalidKeys requires` + + /* recursively call itself if options is an array */ + if (Array.isArray(options)) { + if (!options.length) { + throw new Error( + `${errorPrepend} an object or array of objects as the only argument` + ) + } + options.forEach((option) => catchInvalidKeys(option)) + return true + } + + if (!options || getTypeof(options) !== 'object') { + throw new Error( + `${errorPrepend} an object or array of objects as the only argument` + ) + } + + const { name, obj, validKeys } = options + + /* function typeguard */ + if (getTypeof(name) !== 'string' || !name.length) { + throw new Error(`${errorPrepend} 'options.name' be a string`) + } + if (obj !== undefined && getTypeof(obj) !== 'object') { + throw new Error(`${errorPrepend} 'options.obj' be an object if defined`) + } + if (getTypeof(validKeys) !== 'array' || !validKeys.length) { + throw new Error( + `${errorPrepend} 'options.validKeys' be an array of strings` + ) + } + validKeys.forEach((key) => { + if (getTypeof(key) !== 'string') { + throw new Error( + `${errorPrepend} 'options.validKeys' be an array of strings` + ) + } + }) + /* end of function typeguard */ + + if (obj === undefined) return true + + const invalidKeys = Object.keys(obj).filter((key) => !validKeys.includes(key)) + + if (invalidKeys.length) { + throw new Error( + `Invalid keys for ${name}: ${invalidKeys.join( + ', ' + )}. Valid keys are: ${validKeys.join(', ')}` + ) + } + + return true +} diff --git a/packages/lib/src/utils/errorHandler.ts b/packages/lib/src/utils/errorHandler.ts index 02a82293..b38819f7 100644 --- a/packages/lib/src/utils/errorHandler.ts +++ b/packages/lib/src/utils/errorHandler.ts @@ -17,6 +17,7 @@ export const isError = (error: unknown): boolean => { /** * Handles errors by returning an Error instance. + * * Accepts any type of value but will return default error message of `an unknown error occurred` if * `error` is not an Error type or a message string. * diff --git a/packages/lib/src/utils/getTypeof.ts b/packages/lib/src/utils/getTypeof.ts index f0a6ff9c..4754fb8a 100644 --- a/packages/lib/src/utils/getTypeof.ts +++ b/packages/lib/src/utils/getTypeof.ts @@ -8,8 +8,11 @@ * * Why? Because `typeof` is not reliable for all types of values. * - * Object.prototype.toString gives more accurate results in the case someone has used an object wrapper - * for primitive data types such as `new Number()` or `new String()`. + * Values of null, Arrray, Error, new Date(), new String(), and /regex/ are all typeof 'object'. + * + * Object.prototype.toString.call gives more accurate results in the case someone has used an object + * wrapper for primitive data types such as `new Number()` or `new String()`. + * * It will also accurately recognize any Error types, Error, TypeError, etc., as 'error'. * * @param {any} value - Any kind of value (string, object, array, function, etc). diff --git a/packages/lib/src/utils/index.ts b/packages/lib/src/utils/index.ts index 6c2d9354..f9fd82b3 100644 --- a/packages/lib/src/utils/index.ts +++ b/packages/lib/src/utils/index.ts @@ -3,8 +3,12 @@ * @category Utility Functions */ -export { catchInvalidArguments, validateArgument } from './argHandler' +export { + catchInvalidArguments, + catchInvalidKeys, + validateArgument, +} from './argHandler' export { handleError, isError, rejectWithError } from './errorHandler' export { getTypeof } from './getTypeof' -export { isValidVin } from './isValidVin' +export { isValidVin, generateRandomVIN } from './isValidVin' export { createQueryString, encodeQueryStringParams } from './queryString' diff --git a/packages/lib/src/utils/isValidVin.ts b/packages/lib/src/utils/isValidVin.ts index 69c7f8dc..4d97e607 100644 --- a/packages/lib/src/utils/isValidVin.ts +++ b/packages/lib/src/utils/isValidVin.ts @@ -46,80 +46,100 @@ const WEIGHTS_ARRAY: number[] = [ /** * Provides **offline** validation of Vehicle Identification Numbers (VINs) using the - * [VIN Check Algorithm](https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit). + * [VIN Check Digit Algorithm](https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit). * - * If you need to test that the algorithm is working correctly, you can use 17 ones `1` as - * the VIN and it should return `true` as the result. + * This function uses the check digit algorithm to validate the structure of the VIN, but does not + * check the VIN against any database of actual vehicles. * - * @example Browser via html script tags - * const isValid = NHTSA.isValidVin('3VWD07AJ5EM388202') - * console.log(isValid) // true + * Note that it's possible to generate a random VIN that will pass this validation but does not + * correspond to an actual vehicle. See the {@link generateRandomVIN} function for more details. * - * @example Imported as a module - * import { isValidVin } from '@shaggytools/nhtsa-api-wrapper' + * @example * const isValid = isValidVin('3VWD07AJ5EM388202') * console.log(isValid) // true * - * @param {string} vin - Vehicle Identification Number. - * @returns {boolean} True for a valid VIN, false for an invalid VIN. + * @param vin - Vehicle Identification Number. + * @returns True for a valid VIN, false for an invalid VIN. */ export function isValidVin(vin: string): boolean { - /* A valid VIN must be a string and is always exactly 17 digits */ - if (typeof vin !== 'string' || vin.length != 17) { - return false - } - + /* If the vin is not a string, it is not valid */ + if (typeof vin !== 'string') return false /* Normalize the vin to all uppercase letters */ - vin = vin.toUpperCase() - /* split the vin digits into an array */ - const vinArray: string[] = vin.split('') + vin = vin.trimEnd().toUpperCase() + /* Valid VIN must be 17 characters long */ + if (vin.length !== 17) return false /* checkDigit will be tested against the checkSum later */ - const checkDigit: string = vinArray[8] + let checkDigit: string | number = vin[8] - /* - * In a valid VIN, the checkDigit can either be: - * a number, 0-9 inclusive OR the character 'X' - */ + /* In a valid VIN, the checkDigit can either be: a number, 0-9 inclusive, or the char 'X' */ if (isNaN(parseInt(checkDigit)) && checkDigit !== 'X') { return false - } - - /* - * The checkValue must be a digit and 'X' is the only valid alphabetic check value. - * As per the algorithm, a checkDigit of 'X' is equal to a checkValue of `10` and needs to be - * converted as such. - */ - const checkValue: number = checkDigit === 'X' ? 10 : parseInt(checkDigit) + } else checkDigit = checkDigit === 'X' ? 10 : parseInt(checkDigit) /* - * Maps the vinArray and converts any values (digits) that are alphabetic, into numbers, using the + * Maps the vin chars and converts any values (digits) that are alphabetic into numbers, using the * TRANSLITERATION_TABLE. Then these numbers are multiplied against their corresponding weight in * the WEIGHTS_ARRAY, matched by index position. All 17 of those digitValues are then added * together and divided by 11. The remainder, or % modulo, of that division will be the final * 'checksum'. */ const checksum: number = - vinArray - .map((digit: string, index: number) => { - let digitValue: number + vin + .split('') + .map((digit, index) => { + let value: number /* Use the transliteration table to convert any Not a Number(NaN) values to numbers */ isNaN(parseInt(digit)) - ? (digitValue = TRANSLITERATION_TABLE[digit]) - : (digitValue = parseInt(digit)) - - /* Convert the digitValue to a weighted number corresponding to it's position, by index */ - const weight: number = WEIGHTS_ARRAY[index] - - /* The final step for each digit is to multiply the digit by it's corresponding weight */ - return digitValue * weight + ? (value = TRANSLITERATION_TABLE[digit]) + : (value = parseInt(digit)) + /* Multiply the digit by it's corresponding weight */ + return value * WEIGHTS_ARRAY[index] }) /* Finally, get the sum of all digits and divide by 11, the modulo of that is the checksum */ - .reduce((acc, currValue) => acc + currValue, 0) % 11 + .reduce((sum, value) => sum + value, 0) % 11 /* * The checksum is compared against the checkValue we set earlier (the 9th digit of the VIN). As * per the algorithm, if they are equal to each other, then the VIN must be valid and we return * true, otherwise the VIN is invalid and we return false. */ - return checksum === checkValue + return checksum === checkDigit +} + +/** + * Generates a random valid Vehicle Identification Number (VIN) that will pass the VIN validation + * check digit algorithm implemented in the {@link isValidVin} function. + * + * Used internally to generate random VINs for testing purposes. + * + * Note that these VINs are structurally valid but do not correspond to actual vehicles and will not + * return any data from the NHTSA API. + * + * This works by generating a random string of 16 characters composed of the characters from the + * transliteration table and the numbers 0-9. Then it calculates the check digit and replaces the + * 9th character with the correct check digit so that the VIN will pass the validation algorithm. + * + * @param vin - Vehicle Identification Number string. + * @returns A randomly generated, structurally valid 17-character VIN. + */ +export function generateRandomVIN() { + let vin = '' + // Generate the first 16 characters of the VIN + for (let i = 0; i < 17; i++) { + const charSet = 'ABCDEFGHJKLMNPRSTUVWXYZ0123456789' + vin += charSet.charAt(Math.floor(Math.random() * charSet.length)) + } + + // Calculate the check digit + let sum = 0 + for (let i = 0; i < 17; i++) { + const digit = TRANSLITERATION_TABLE[vin[i]] || parseInt(vin[i], 10) + sum += digit * WEIGHTS_ARRAY[i] + } + const checkDigit = sum % 11 + /* v8 ignore next */ + const checkChar = checkDigit === 10 ? 'X' : checkDigit.toString() + + // Replace the 9th character (check digit) in the VIN + return vin.substring(0, 8) + checkChar + vin.substring(9) } diff --git a/packages/lib/src/utils/queryString.ts b/packages/lib/src/utils/queryString.ts index 1aa24f11..56ae75d0 100644 --- a/packages/lib/src/utils/queryString.ts +++ b/packages/lib/src/utils/queryString.ts @@ -7,7 +7,7 @@ import { NHTSA_RESPONSE_FORMAT } from '@/constants' import { validateArgument } from '@/utils' /** Valid URI component types */ -export type QueryStringTypes = string | number | boolean +export type QueryStringTypes = string | number | boolean | undefined /** Object to build the query string with */ export type QueryStringParams = Record @@ -16,30 +16,21 @@ export type QueryStringParams = Record export type QueryStringParamsEncoded = { [key in keyof T]: string } /** - * This function is used internally by other package functions. As a consumer of this package, you - * should not need to use this function directly in most cases. - * * Utility function to perform URI component encoding on all values in an object, for use in URL * query strings. * + * This function is used internally by other package functions. As a consumer of this package, you + * should not need to use this function directly in most cases. + * * - Returns an object of valid URI encoded parameters with same keys as the original object. - * - Will silently filter out parameters with values that are not type `string`, `number`, or - * `boolean`. + * - Will silently filter out parameters with values that are not type `string`, `number`, + * `boolean`, or `undefined`. * - It filters invalid key/values so that encodeURIComponent() does not throw an error. * - * In it's current implementation, this function assumes that invalid types have already been - * filtered out, and that all values are valid. If you need to be sure that all keys are present - * in the returned object, you can use the `validateArgument()` function to check the types of all - * values are valid before calling this function. - * - * This function is not exported by the package, but is used internally by other - * functions. However, it _is_ exported by the package as part of the composable function - * `useQueryString`, and renamed to `encodeParams` for less verbose use. - * - * @param {QueryStringParams} params - An object of search parameters to be encoded. - * @returns {QueryStringParamsEncoded} - A new object of same keys as the original object with - * values converted to URI component strings. Any keys with values not a string, number, or - * boolean are filtered out of final object. + * @param params - An object of search parameters to be encoded. Any keys with values not a string, + * number, or boolean are filtered out of the final object. + * @returns - A new object of same keys as the original object with values converted to URI + * component strings. */ export const encodeQueryStringParams = ( params: T @@ -62,8 +53,8 @@ export const encodeQueryStringParams = ( }) ) .reduce((acc, [key, value]) => { - /* can expect only strings, numbers, and booleans after filtering */ - acc[key as keyof T] = encodeURIComponent(value) + /* can expect only strings, numbers, booleans, and undefined after filtering */ + if (value !== undefined) acc[key as keyof T] = encodeURIComponent(value) return acc }, {} as QueryStringParamsEncoded) @@ -71,31 +62,31 @@ export const encodeQueryStringParams = ( } /** + * Utility function to generate a query string conforming to URI component standards. Takes an an + * optional object of search parameters and returns an encoded query string. + * * This function is used internally by other package functions. As a consumer of this package, you * should not need to use this function directly in most cases. * - * Utility function to generate a query string conforming to URI component standards. Takes an an - * optional object of search parameters and returns an encoded query string. + * Default query string: `"?format=json"` * * This function will always override `params.format` with `{ format: 'json' }`. This is hardcoded * into the package and cannot be overridden, this package provides no support for CSV or XML * formats at this time. This means the default query string will be `"?format=json"` even if no * `params` are provided by user. * - * - Ignores parameters that are not strings, numbers, or booleans, and also ignores empty strings - * by default. - * - * - If you don't provide an object as the first argument, an error will be thrown. Providing an - * empty object will not throw an error. - * + * - Ignores parameters that are not strings, numbers, booleans, or undefined and also ignores empty + * string values by default. + * - If you don't provide anyyhing other than an object as the first argument, an error will be + * thrown. Providing an empty object will not throw an error. * - If the second argument, `allowEmptyParams`, is set to `true`, the function will include keys * with empty string values in the final query string, e.g. 'emptyKey='. * - * @param {QueryStringParams} params - An object of search parameters to be converted to a query + * @param params - An object of search parameters to be converted to a query * string. - * @param {boolean} [allowEmptyParams=false] - Set to `true` to include keys with empty string + * @param [allowEmptyParams=false] - Set to `true` to include keys with empty string * values, e.g. 'emptyKey='. - * @returns {string} - A query string of search parameters for use in a final fetch URL. + * @returns - A query string of search parameters for use in a final fetch URL. */ export const createQueryString = ( params = {} as T, diff --git a/packages/lib/src/utils/types.ts b/packages/lib/src/utils/types.ts index aecfb209..b527ec16 100644 --- a/packages/lib/src/utils/types.ts +++ b/packages/lib/src/utils/types.ts @@ -29,4 +29,22 @@ export type RequireOnlyOne = Omit & Partial, undefined>> }[Keys] +/** + *A type that, when passed a union of keys, creates an object which cannot have those properties. + * Used in conjunction with `NoExtraProperties` to create a type that can only have the properties + * you want it to have. + * https://stackoverflow.com/a/57117594 + */ +export type Impossible = { + [P in K]: never +} + +/** + * Provide it the type that contains only the properties you want, and then a type that extends that + * type, based on what the caller provided using generics. + * https://stackoverflow.com/a/57117594 + */ +export type NoExtraProperties = U & + Impossible> + export {} diff --git a/packages/lib/tsconfig.json b/packages/lib/tsconfig.json index 4ca54021..5b42aa27 100644 --- a/packages/lib/tsconfig.json +++ b/packages/lib/tsconfig.json @@ -9,7 +9,10 @@ ".vitest/*": [ "./.vitest/*" ] - } + }, + "types": [ + "vitest/importMeta" + ] }, "include": [ "src/**/*.ts", diff --git a/packages/lib/vite.config.ts b/packages/lib/vite.config.ts index 0d36e409..764b7939 100644 --- a/packages/lib/vite.config.ts +++ b/packages/lib/vite.config.ts @@ -5,6 +5,7 @@ import { resolve } from 'path' import { defineConfig } from 'vite' import dts from 'vite-plugin-dts' import tsconfigPaths from 'vite-tsconfig-paths' +import { coverageConfigDefaults } from 'vitest/config' const packageName = 'nhtsa-api-wrapper' @@ -23,8 +24,10 @@ export default defineConfig({ tsconfigPaths(), dts({ entryRoot: './src', - outputDir: './dist/types', + outDir: './dist/types', insertTypesEntry: true, + rollupTypes: true, + exclude: ['**/__tests__/**/*', 'node_modules/**'], }), ], resolve: { @@ -40,37 +43,38 @@ export default defineConfig({ ], }, build: { - outDir: 'dist', lib: { entry: resolve(__dirname, 'src/index.ts'), name: 'NHTSA', formats, fileName: (format) => fileName[format], }, - sourcemap: true, + outDir: 'dist', reportCompressedSize: true, - rollupOptions: { - output: { - sourcemap: true, - }, - }, + sourcemap: true, }, test: { + setupFiles: ['./.vitest/setup.ts'], environment: 'node', globals: true, - watch: false, // turned off for CI/CD runs + typecheck: { checker: 'tsc', enabled: true }, + // output of @vitest/ui reporter=html that can be used to view test results via vite preview + outputFile: './.vitest/dist/ui/index.html', coverage: { - provider: 'c8', - all: true, - src: ['./src'], + provider: 'v8', + reportsDirectory: './.vitest/dist/coverage', exclude: [ + ...coverageConfigDefaults.exclude, '**/*/types.ts', '**/__tests__/**/*', '**/.vitest/**/*', - 'vite-env.d.ts', - 'global.d.ts', + '**/*/vite-env.d.ts', + '**/*/global.d.ts', + '**/*/types.d.ts', + '**/*/typedoc.cjs', ], }, - setupFiles: ['./.vitest/setup.ts'], + // uncomment to enable in source file testing + // includeSource: ['src/**/*.{js,ts}'], }, }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bae16c76..f11a2175 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,30 +1,34 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + importers: .: devDependencies: '@changesets/cli': - specifier: 2.26.1 - version: 2.26.1 + specifier: 2.26.2 + version: 2.26.2 '@commitlint/cli': - specifier: 17.6.3 - version: 17.6.3 + specifier: 18.1.0 + version: 18.1.0 '@commitlint/config-conventional': - specifier: 17.6.3 - version: 17.6.3 + specifier: 18.1.0 + version: 18.1.0 husky: specifier: 8.0.3 version: 8.0.3 rimraf: - specifier: 5.0.1 - version: 5.0.1 + specifier: 5.0.5 + version: 5.0.5 turbo: - specifier: 1.9.9 - version: 1.9.9 + specifier: 1.10.16 + version: 1.10.16 typescript: - specifier: 5.0.4 - version: 5.0.4 + specifier: 5.2.2 + version: 5.2.2 apps/docs: dependencies: @@ -32,36 +36,36 @@ importers: specifier: workspace:* version: link:../../packages/lib vue: - specifier: 3.3.4 - version: 3.3.4 + specifier: 3.3.7 + version: 3.3.7(typescript@5.2.2) devDependencies: '@types/node': - specifier: 18.13.0 - version: 18.13.0 + specifier: 18.18.7 + version: 18.18.7 '@vite-pwa/vitepress': - specifier: 0.0.5 - version: 0.0.5(vite-plugin-pwa@0.15.1) + specifier: 0.3.1 + version: 0.3.1(vite-plugin-pwa@0.17.3) dotenv: - specifier: 16.0.3 - version: 16.0.3 + specifier: 16.3.1 + version: 16.3.1 eslint: - specifier: 8.41.0 - version: 8.41.0 + specifier: 8.52.0 + version: 8.52.0 eslint-config-custom: specifier: workspace:* version: link:../../config/eslint-config-custom prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.0.3 + version: 3.0.3 prettier-config: specifier: workspace:* version: link:../../config/prettier-config rimraf: - specifier: 5.0.1 - version: 5.0.1 + specifier: 5.0.5 + version: 5.0.5 sass: - specifier: 1.62.1 - version: 1.62.1 + specifier: 1.69.4 + version: 1.69.4 sitemap: specifier: 7.1.1 version: 7.1.1 @@ -69,231 +73,265 @@ importers: specifier: workspace:* version: link:../../config/tsconfig typescript: - specifier: 5.0.4 - version: 5.0.4 + specifier: 5.2.2 + version: 5.2.2 vite-plugin-pwa: - specifier: 0.15.1 - version: 0.15.1(workbox-window@6.6.0) + specifier: 0.17.3 + version: 0.17.3(vite@5.0.5)(workbox-build@7.0.0)(workbox-window@7.0.0) vitepress: - specifier: 1.0.0-beta.1 - version: 1.0.0-beta.1(@types/node@18.13.0)(sass@1.62.1) + specifier: 1.0.0-rc.31 + version: 1.0.0-rc.31(@algolia/client-search@4.20.0)(@types/node@18.18.7)(sass@1.69.4)(search-insights@2.11.0)(typescript@5.2.2) workbox-window: - specifier: 6.6.0 - version: 6.6.0 + specifier: 7.0.0 + version: 7.0.0 config/eslint-config-custom: dependencies: '@typescript-eslint/eslint-plugin': - specifier: 5.59.7 - version: 5.59.7(@typescript-eslint/parser@5.59.7)(eslint@8.41.0)(typescript@5.0.4) + specifier: 6.9.0 + version: 6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2) '@typescript-eslint/parser': - specifier: 5.59.7 - version: 5.59.7(eslint@8.41.0)(typescript@5.0.4) + specifier: 6.9.0 + version: 6.9.0(eslint@8.52.0)(typescript@5.2.2) eslint: - specifier: 8.41.0 - version: 8.41.0 + specifier: 8.52.0 + version: 8.52.0 eslint-config-prettier: - specifier: 8.8.0 - version: 8.8.0(eslint@8.41.0) + specifier: 9.0.0 + version: 9.0.0(eslint@8.52.0) eslint-plugin-markdown: - specifier: 3.0.0 - version: 3.0.0(eslint@8.41.0) + specifier: 3.0.1 + version: 3.0.1(eslint@8.52.0) eslint-plugin-prettier: - specifier: 4.2.1 - version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.41.0)(prettier@2.8.8) + specifier: 5.0.1 + version: 5.0.1(eslint-config-prettier@9.0.0)(eslint@8.52.0)(prettier@3.0.3) prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.0.3 + version: 3.0.3 devDependencies: typescript: - specifier: 5.0.4 - version: 5.0.4 + specifier: 5.2.2 + version: 5.2.2 config/prettier-config: devDependencies: prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.0.3 + version: 3.0.3 config/tsconfig: dependencies: '@types/node': - specifier: 18.15.11 - version: 18.15.11 + specifier: 18.18.7 + version: 18.18.7 config/typedoc-config: devDependencies: typedoc: - specifier: 0.24.7 - version: 0.24.7(typescript@5.0.4) + specifier: 0.25.2 + version: 0.25.2(typescript@5.2.2) typedoc-plugin-markdown: - specifier: 3.15.3 - version: 3.15.3(typedoc@0.24.7) + specifier: 4.0.0-next.25 + version: 4.0.0-next.25(typedoc@0.25.2) typescript: - specifier: 5.0.4 - version: 5.0.4 + specifier: 5.2.2 + version: 5.2.2 + + examples/simple-examples: + dependencies: + '@shaggytools/nhtsa-api-wrapper': + specifier: workspace:* + version: link:../../packages/lib packages/lib: devDependencies: - '@vitest/coverage-c8': - specifier: 0.31.1 - version: 0.31.1(vitest@0.31.1) + '@vitest/coverage-v8': + specifier: 1.0.1 + version: 1.0.1(vitest@1.0.1) '@vitest/ui': - specifier: 0.31.1 - version: 0.31.1(vitest@0.31.1) + specifier: 1.0.1 + version: 1.0.1(vitest@1.0.1) eslint: - specifier: 8.41.0 - version: 8.41.0 + specifier: 8.52.0 + version: 8.52.0 eslint-config-custom: specifier: workspace:* version: link:../../config/eslint-config-custom prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.0.3 + version: 3.0.3 prettier-config: specifier: workspace:* version: link:../../config/prettier-config rimraf: - specifier: 5.0.1 - version: 5.0.1 + specifier: 5.0.5 + version: 5.0.5 tsconfig: specifier: workspace:* version: link:../../config/tsconfig typedoc: - specifier: 0.24.7 - version: 0.24.7(typescript@5.0.4) + specifier: 0.25.2 + version: 0.25.2(typescript@5.2.2) typedoc-config: specifier: workspace:* version: link:../../config/typedoc-config typescript: - specifier: 5.0.4 - version: 5.0.4 + specifier: 5.2.2 + version: 5.2.2 vite: - specifier: 4.3.9 - version: 4.3.9 + specifier: 5.0.5 + version: 5.0.5(@types/node@18.18.7)(sass@1.69.4) vite-plugin-dts: - specifier: 2.3.0 - version: 2.3.0(vite@4.3.9) + specifier: 3.6.4 + version: 3.6.4(@types/node@18.18.7)(typescript@5.2.2)(vite@5.0.5) vite-tsconfig-paths: - specifier: 4.2.0 - version: 4.2.0(typescript@5.0.4)(vite@4.3.9) + specifier: 4.2.1 + version: 4.2.1(typescript@5.2.2)(vite@5.0.5) vitest: - specifier: 0.31.1 - version: 0.31.1(@vitest/ui@0.31.1) + specifier: 1.0.1 + version: 1.0.1(@types/node@18.18.7)(@vitest/ui@1.0.1) vitest-fetch-mock: specifier: 0.2.2 - version: 0.2.2(vitest@0.31.1) + version: 0.2.2(vitest@1.0.1) packages: - /@algolia/autocomplete-core@1.8.2: - resolution: {integrity: sha512-mTeshsyFhAqw/ebqNsQpMtbnjr+qVOSKXArEj4K0d7sqc8It1XD0gkASwecm9mF/jlOQ4Z9RNg1HbdA8JPdRwQ==} + /@aashutoshrathi/word-wrap@1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + + /@algolia/autocomplete-core@1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0)(search-insights@2.11.0): + resolution: {integrity: sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==} + dependencies: + '@algolia/autocomplete-plugin-algolia-insights': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0)(search-insights@2.11.0) + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0) + transitivePeerDependencies: + - '@algolia/client-search' + - algoliasearch + - search-insights + dev: true + + /@algolia/autocomplete-plugin-algolia-insights@1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0)(search-insights@2.11.0): + resolution: {integrity: sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg==} + peerDependencies: + search-insights: '>= 1 < 3' dependencies: - '@algolia/autocomplete-shared': 1.8.2 + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0) + search-insights: 2.11.0 + transitivePeerDependencies: + - '@algolia/client-search' + - algoliasearch dev: true - /@algolia/autocomplete-preset-algolia@1.8.2(algoliasearch@4.17.1): - resolution: {integrity: sha512-J0oTx4me6ZM9kIKPuL3lyU3aB8DEvpVvR6xWmHVROx5rOYJGQcZsdG4ozxwcOyiiu3qxMkIbzntnV1S1VWD8yA==} + /@algolia/autocomplete-preset-algolia@1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0): + resolution: {integrity: sha512-d4qlt6YmrLMYy95n5TB52wtNDr6EgAIPH81dvvvW8UmuWRgxEtY0NJiPwl/h95JtG2vmRM804M0DSwMCNZlzRA==} peerDependencies: '@algolia/client-search': '>= 4.9.1 < 6' algoliasearch: '>= 4.9.1 < 6' dependencies: - '@algolia/autocomplete-shared': 1.8.2 - algoliasearch: 4.17.1 + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0) + '@algolia/client-search': 4.20.0 + algoliasearch: 4.20.0 dev: true - /@algolia/autocomplete-shared@1.8.2: - resolution: {integrity: sha512-b6Z/X4MczChMcfhk6kfRmBzPgjoPzuS9KGR4AFsiLulLNRAAqhP+xZTKtMnZGhLuc61I20d5WqlId02AZvcO6g==} + /@algolia/autocomplete-shared@1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0): + resolution: {integrity: sha512-Wnm9E4Ye6Rl6sTTqjoymD+l8DjSTHsHboVRYrKgEt8Q7UHm9nYbqhN/i0fhUYA3OAEH7WA8x3jfpnmJm3rKvaQ==} + peerDependencies: + '@algolia/client-search': '>= 4.9.1 < 6' + algoliasearch: '>= 4.9.1 < 6' + dependencies: + '@algolia/client-search': 4.20.0 + algoliasearch: 4.20.0 dev: true - /@algolia/cache-browser-local-storage@4.17.1: - resolution: {integrity: sha512-e91Jpu93X3t3mVdQwF3ZDjSFMFIfzSc+I76G4EX8nl9RYXgqcjframoL05VTjcD2YCsI18RIHAWVCBoCXVZnrw==} + /@algolia/cache-browser-local-storage@4.20.0: + resolution: {integrity: sha512-uujahcBt4DxduBTvYdwO3sBfHuJvJokiC3BP1+O70fglmE1ShkH8lpXqZBac1rrU3FnNYSUs4pL9lBdTKeRPOQ==} dependencies: - '@algolia/cache-common': 4.17.1 + '@algolia/cache-common': 4.20.0 dev: true - /@algolia/cache-common@4.17.1: - resolution: {integrity: sha512-fvi1WT8aSiGAKrcTw8Qg3RYgcwW8GZMHcqEm4AyDBEy72JZlFBSY80cTQ75MslINjCHXLDT+9EN8AGI9WVY7uA==} + /@algolia/cache-common@4.20.0: + resolution: {integrity: sha512-vCfxauaZutL3NImzB2G9LjLt36vKAckc6DhMp05An14kVo8F1Yofb6SIl6U3SaEz8pG2QOB9ptwM5c+zGevwIQ==} dev: true - /@algolia/cache-in-memory@4.17.1: - resolution: {integrity: sha512-NbBt6eBWlsXc5geSpfPRC5dkIB/0Ptthw8r0yM5Z7D3sPlYdnTZSO9y9XWXIptRMwmZe4cM8iBMN8y0tzbcBkA==} + /@algolia/cache-in-memory@4.20.0: + resolution: {integrity: sha512-Wm9ak/IaacAZXS4mB3+qF/KCoVSBV6aLgIGFEtQtJwjv64g4ePMapORGmCyulCFwfePaRAtcaTbMcJF+voc/bg==} dependencies: - '@algolia/cache-common': 4.17.1 + '@algolia/cache-common': 4.20.0 dev: true - /@algolia/client-account@4.17.1: - resolution: {integrity: sha512-3rL/6ofJvyL+q8TiWM3qoM9tig+SY4gB1Vbsj+UeJPnJm8Khm+7OS+r+mFraqR6pTehYqN8yGYoE7x4diEn4aA==} + /@algolia/client-account@4.20.0: + resolution: {integrity: sha512-GGToLQvrwo7am4zVkZTnKa72pheQeez/16sURDWm7Seyz+HUxKi3BM6fthVVPUEBhtJ0reyVtuK9ArmnaKl10Q==} dependencies: - '@algolia/client-common': 4.17.1 - '@algolia/client-search': 4.17.1 - '@algolia/transporter': 4.17.1 + '@algolia/client-common': 4.20.0 + '@algolia/client-search': 4.20.0 + '@algolia/transporter': 4.20.0 dev: true - /@algolia/client-analytics@4.17.1: - resolution: {integrity: sha512-Bepr2w249vODqeBtM7i++tPmUsQ9B81aupUGbDWmjA/FX+jzQqOdhW8w1CFO5kWViNKTbz2WBIJ9U3x8hOa4bA==} + /@algolia/client-analytics@4.20.0: + resolution: {integrity: sha512-EIr+PdFMOallRdBTHHdKI3CstslgLORQG7844Mq84ib5oVFRVASuuPmG4bXBgiDbcsMLUeOC6zRVJhv1KWI0ug==} dependencies: - '@algolia/client-common': 4.17.1 - '@algolia/client-search': 4.17.1 - '@algolia/requester-common': 4.17.1 - '@algolia/transporter': 4.17.1 + '@algolia/client-common': 4.20.0 + '@algolia/client-search': 4.20.0 + '@algolia/requester-common': 4.20.0 + '@algolia/transporter': 4.20.0 dev: true - /@algolia/client-common@4.17.1: - resolution: {integrity: sha512-+r7kg4EgbFnGsDnoGSVNtXZO8xvZ0vzf1WAOV7sqV9PMf1bp6cpJP/3IuPrSk4t5w2KVl+pC8jfTM7HcFlfBEQ==} + /@algolia/client-common@4.20.0: + resolution: {integrity: sha512-P3WgMdEss915p+knMMSd/fwiHRHKvDu4DYRrCRaBrsfFw7EQHon+EbRSm4QisS9NYdxbS04kcvNoavVGthyfqQ==} dependencies: - '@algolia/requester-common': 4.17.1 - '@algolia/transporter': 4.17.1 + '@algolia/requester-common': 4.20.0 + '@algolia/transporter': 4.20.0 dev: true - /@algolia/client-personalization@4.17.1: - resolution: {integrity: sha512-gJku9DG/THJpfsSlG/az0a3QIn+VVff9kKh8PG8+7ZfxOHS+C+Y5YSeZVsC+c2cfoKLPo3CuHIiJ/p86erR3bA==} + /@algolia/client-personalization@4.20.0: + resolution: {integrity: sha512-N9+zx0tWOQsLc3K4PVRDV8GUeOLAY0i445En79Pr3zWB+m67V+n/8w4Kw1C5LlbHDDJcyhMMIlqezh6BEk7xAQ==} dependencies: - '@algolia/client-common': 4.17.1 - '@algolia/requester-common': 4.17.1 - '@algolia/transporter': 4.17.1 + '@algolia/client-common': 4.20.0 + '@algolia/requester-common': 4.20.0 + '@algolia/transporter': 4.20.0 dev: true - /@algolia/client-search@4.17.1: - resolution: {integrity: sha512-Q5YfT5gVkx60PZDQBqp/zH9aUbBdC7HVvxupiHUgnCKqRQsRZjOhLest7AI6FahepuZLBZS62COrO7v+JvKY7w==} + /@algolia/client-search@4.20.0: + resolution: {integrity: sha512-zgwqnMvhWLdpzKTpd3sGmMlr4c+iS7eyyLGiaO51zDZWGMkpgoNVmltkzdBwxOVXz0RsFMznIxB9zuarUv4TZg==} dependencies: - '@algolia/client-common': 4.17.1 - '@algolia/requester-common': 4.17.1 - '@algolia/transporter': 4.17.1 + '@algolia/client-common': 4.20.0 + '@algolia/requester-common': 4.20.0 + '@algolia/transporter': 4.20.0 dev: true - /@algolia/logger-common@4.17.1: - resolution: {integrity: sha512-Us28Ot+fLEmX9M96sa65VZ8EyEEzhYPxfhV9aQyKDjfXbUdJlJxKt6wZpoEg9RAPSdO8IjK9nmuW2P8au3rRsg==} + /@algolia/logger-common@4.20.0: + resolution: {integrity: sha512-xouigCMB5WJYEwvoWW5XDv7Z9f0A8VoXJc3VKwlHJw/je+3p2RcDXfksLI4G4lIVncFUYMZx30tP/rsdlvvzHQ==} dev: true - /@algolia/logger-console@4.17.1: - resolution: {integrity: sha512-iKGQTpOjHiE64W3JIOu6dmDvn+AfYIElI9jf/Nt6umRPmP/JI9rK+OHUoW4pKrBtdG0DPd62ppeNXzSnLxY6/g==} + /@algolia/logger-console@4.20.0: + resolution: {integrity: sha512-THlIGG1g/FS63z0StQqDhT6bprUczBI8wnLT3JWvfAQDZX5P6fCg7dG+pIrUBpDIHGszgkqYEqECaKKsdNKOUA==} dependencies: - '@algolia/logger-common': 4.17.1 + '@algolia/logger-common': 4.20.0 dev: true - /@algolia/requester-browser-xhr@4.17.1: - resolution: {integrity: sha512-W5mGfGDsyfVR+r4pUFrYLGBEM18gs38+GNt5PE5uPULy4uVTSnnVSkJkWeRkmLBk9zEZ/Nld8m4zavK6dtEuYg==} + /@algolia/requester-browser-xhr@4.20.0: + resolution: {integrity: sha512-HbzoSjcjuUmYOkcHECkVTwAelmvTlgs48N6Owt4FnTOQdwn0b8pdht9eMgishvk8+F8bal354nhx/xOoTfwiAw==} dependencies: - '@algolia/requester-common': 4.17.1 + '@algolia/requester-common': 4.20.0 dev: true - /@algolia/requester-common@4.17.1: - resolution: {integrity: sha512-HggXdjvVFQR0I5l7hM5WdHgQ1tqcRWeyXZz8apQ7zPWZhirmY2E9D6LVhDh/UnWQNEm7nBtM+eMFONJ3bZccIQ==} + /@algolia/requester-common@4.20.0: + resolution: {integrity: sha512-9h6ye6RY/BkfmeJp7Z8gyyeMrmmWsMOCRBXQDs4mZKKsyVlfIVICpcSibbeYcuUdurLhIlrOUkH3rQEgZzonng==} dev: true - /@algolia/requester-node-http@4.17.1: - resolution: {integrity: sha512-NzFWecXT6d0PPsQY9L+/qoK2deF74OLcpvqCH+Vh3mh+QzPsFafcBExdguAjZsAWDn1R6JEeFW7/fo/p0SE57w==} + /@algolia/requester-node-http@4.20.0: + resolution: {integrity: sha512-ocJ66L60ABSSTRFnCHIEZpNHv6qTxsBwJEPfYaSBsLQodm0F9ptvalFkHMpvj5DfE22oZrcrLbOYM2bdPJRHng==} dependencies: - '@algolia/requester-common': 4.17.1 + '@algolia/requester-common': 4.20.0 dev: true - /@algolia/transporter@4.17.1: - resolution: {integrity: sha512-ZM+qhX47Vh46mWH8/U9ihvy98HdTYpYQDSlqBD7IbiUbbyoCMke+qmdSX2MGhR2FCcXBSxejsJKKVAfbpaLVgg==} + /@algolia/transporter@4.20.0: + resolution: {integrity: sha512-Lsii1pGWOAISbzeyuf+r/GPhvHMPHSPrTDWNcIzOE1SG1inlJHICaVe2ikuoRjcpgxZNU54Jl+if15SUCsaTUg==} dependencies: - '@algolia/cache-common': 4.17.1 - '@algolia/logger-common': 4.17.1 - '@algolia/requester-common': 4.17.1 + '@algolia/cache-common': 4.20.0 + '@algolia/logger-common': 4.20.0 + '@algolia/requester-common': 4.20.0 dev: true /@ampproject/remapping@2.2.1: @@ -301,7 +339,7 @@ packages: engines: {node: '>=6.0.0'} dependencies: '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.20 dev: true /@apideck/better-ajv-errors@0.3.6(ajv@8.12.0): @@ -323,264 +361,266 @@ packages: '@babel/highlight': 7.18.6 dev: true - /@babel/compat-data@7.22.0: - resolution: {integrity: sha512-OgCMbbNCD/iA8cjMt+Zhp+nIC7XKaEaTG8zjvZPjGbhkppq1NIMWiZn7EaZRxUDHn4Ul265scRqg94N2WiFaGw==} + /@babel/code-frame@7.23.5: + resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.23.4 + chalk: 2.4.2 + dev: true + + /@babel/compat-data@7.23.5: + resolution: {integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==} engines: {node: '>=6.9.0'} dev: true - /@babel/core@7.22.1: - resolution: {integrity: sha512-Hkqu7J4ynysSXxmAahpN1jjRwVJ+NdpraFLIWflgjpVob3KNyK3/tIUc7Q7szed8WMp0JNa7Qtd1E9Oo22F9gA==} + /@babel/core@7.23.5: + resolution: {integrity: sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.21.4 - '@babel/generator': 7.22.0 - '@babel/helper-compilation-targets': 7.22.1(@babel/core@7.22.1) - '@babel/helper-module-transforms': 7.22.1 - '@babel/helpers': 7.22.0 - '@babel/parser': 7.22.0 - '@babel/template': 7.21.9 - '@babel/traverse': 7.22.1 - '@babel/types': 7.22.0 - convert-source-map: 1.9.0 + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) + '@babel/helpers': 7.23.5 + '@babel/parser': 7.23.5 + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.5 + '@babel/types': 7.23.5 + convert-source-map: 2.0.0 debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 - semver: 6.3.0 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true - /@babel/generator@7.22.0: - resolution: {integrity: sha512-tyzR0OsH88AelgukhL2rbEUCLKBGmy2G9Th/5vpyOt0zf44Be61kvIQXjCwTSX8t+qJ/vMwZfhK6mPdrMLZXRg==} + /@babel/generator@7.23.5: + resolution: {integrity: sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.0 + '@babel/types': 7.23.5 '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.20 jsesc: 2.5.2 dev: true - /@babel/helper-annotate-as-pure@7.18.6: - resolution: {integrity: sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==} + /@babel/helper-annotate-as-pure@7.22.5: + resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.0 + '@babel/types': 7.23.5 dev: true - /@babel/helper-builder-binary-assignment-operator-visitor@7.22.0: - resolution: {integrity: sha512-65sHfBfgwY7VAzJscbxFoNSdqWul2+dMfSPihzmTKRd3QEKdcGmWEy7qRaVzMYsH7oJ91UIGFIAzW3xg7ER13w==} + /@babel/helper-builder-binary-assignment-operator-visitor@7.22.15: + resolution: {integrity: sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.0 + '@babel/types': 7.23.5 dev: true - /@babel/helper-compilation-targets@7.22.1(@babel/core@7.22.1): - resolution: {integrity: sha512-Rqx13UM3yVB5q0D/KwQ8+SPfX/+Rnsy1Lw1k/UwOC4KC6qrzIQoY3lYnBu5EHKBlEHHcj0M0W8ltPSkD8rqfsQ==} + /@babel/helper-compilation-targets@7.22.15: + resolution: {integrity: sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==} engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 dependencies: - '@babel/compat-data': 7.22.0 - '@babel/core': 7.22.1 - '@babel/helper-validator-option': 7.21.0 - browserslist: 4.21.5 + '@babel/compat-data': 7.23.5 + '@babel/helper-validator-option': 7.23.5 + browserslist: 4.22.2 lru-cache: 5.1.1 - semver: 6.3.0 + semver: 6.3.1 dev: true - /@babel/helper-create-class-features-plugin@7.22.1(@babel/core@7.22.1): - resolution: {integrity: sha512-SowrZ9BWzYFgzUMwUmowbPSGu6CXL5MSuuCkG3bejahSpSymioPmuLdhPxNOc9MjuNGjy7M/HaXvJ8G82Lywlw==} + /@babel/helper-create-class-features-plugin@7.23.5(@babel/core@7.23.5): + resolution: {integrity: sha512-QELlRWxSpgdwdJzSJn4WAhKC+hvw/AtHbbrIoncKHkhKKR/luAlKkgBDcri1EzWAo8f8VvYVryEHN4tax/V67A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-environment-visitor': 7.22.1 - '@babel/helper-function-name': 7.21.0 - '@babel/helper-member-expression-to-functions': 7.22.0 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/helper-replace-supers': 7.22.1 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - '@babel/helper-split-export-declaration': 7.18.6 - semver: 6.3.0 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.5) + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + semver: 6.3.1 dev: true - /@babel/helper-create-regexp-features-plugin@7.22.1(@babel/core@7.22.1): - resolution: {integrity: sha512-WWjdnfR3LPIe+0EY8td7WmjhytxXtjKAEpnAxun/hkNiyOaPlvGK+NZaBFIdi9ndYV3Gav7BpFvtUwnaJlwi1w==} + /@babel/helper-create-regexp-features-plugin@7.22.15(@babel/core@7.23.5): + resolution: {integrity: sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 regexpu-core: 5.3.2 - semver: 6.3.0 + semver: 6.3.1 dev: true - /@babel/helper-define-polyfill-provider@0.4.0(@babel/core@7.22.1): - resolution: {integrity: sha512-RnanLx5ETe6aybRi1cO/edaRH+bNYWaryCEmjDDYyNr4wnSzyOp8T0dWipmqVHKEY3AbVKUom50AKSlj1zmKbg==} + /@babel/helper-define-polyfill-provider@0.4.3(@babel/core@7.23.5): + resolution: {integrity: sha512-WBrLmuPP47n7PNwsZ57pqam6G/RGo1vw/87b0Blc53tZNGZ4x7YvZ6HgQe2vo1W/FR20OgjeZuGXzudPiXHFug==} peerDependencies: - '@babel/core': ^7.4.0-0 + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-compilation-targets': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 debug: 4.3.4 lodash.debounce: 4.0.8 - resolve: 1.22.2 - semver: 6.3.0 + resolve: 1.22.8 transitivePeerDependencies: - supports-color dev: true - /@babel/helper-environment-visitor@7.22.1: - resolution: {integrity: sha512-Z2tgopurB/kTbidvzeBrc2To3PUP/9i5MUe+fU6QJCQDyPwSH2oRapkLw3KGECDYSjhQZCNxEvNvZlLw8JjGwA==} + /@babel/helper-environment-visitor@7.22.20: + resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-function-name@7.21.0: - resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} + /@babel/helper-function-name@7.23.0: + resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.21.9 - '@babel/types': 7.22.0 + '@babel/template': 7.22.15 + '@babel/types': 7.23.5 dev: true - /@babel/helper-hoist-variables@7.18.6: - resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} + /@babel/helper-hoist-variables@7.22.5: + resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.0 + '@babel/types': 7.23.5 dev: true - /@babel/helper-member-expression-to-functions@7.22.0: - resolution: {integrity: sha512-nf2NhMw5E6vzxvUOPeqHnNxcCyTe7r8MJYIWzLaMosohfQTk6F2jepzprj4ux8ez0yTPjDyrDeboItaylgdaiw==} + /@babel/helper-member-expression-to-functions@7.23.0: + resolution: {integrity: sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.0 + '@babel/types': 7.23.5 dev: true - /@babel/helper-module-imports@7.21.4: - resolution: {integrity: sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==} + /@babel/helper-module-imports@7.22.15: + resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.0 + '@babel/types': 7.23.5 dev: true - /@babel/helper-module-transforms@7.22.1: - resolution: {integrity: sha512-dxAe9E7ySDGbQdCVOY/4+UcD8M9ZFqZcZhSPsPacvCG4M+9lwtDDQfI2EoaSvmf7W/8yCBkGU0m7Pvt1ru3UZw==} + /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 dependencies: - '@babel/helper-environment-visitor': 7.22.1 - '@babel/helper-module-imports': 7.21.4 - '@babel/helper-simple-access': 7.21.5 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/helper-validator-identifier': 7.19.1 - '@babel/template': 7.21.9 - '@babel/traverse': 7.22.1 - '@babel/types': 7.22.0 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.20 dev: true - /@babel/helper-optimise-call-expression@7.18.6: - resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==} + /@babel/helper-optimise-call-expression@7.22.5: + resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.0 + '@babel/types': 7.23.5 dev: true - /@babel/helper-plugin-utils@7.21.5: - resolution: {integrity: sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg==} + /@babel/helper-plugin-utils@7.22.5: + resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-remap-async-to-generator@7.18.9(@babel/core@7.22.1): - resolution: {integrity: sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==} + /@babel/helper-remap-async-to-generator@7.22.20(@babel/core@7.23.5): + resolution: {integrity: sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-environment-visitor': 7.22.1 - '@babel/helper-wrap-function': 7.20.5 - '@babel/types': 7.22.0 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-wrap-function': 7.22.20 dev: true - /@babel/helper-replace-supers@7.22.1: - resolution: {integrity: sha512-ut4qrkE4AuSfrwHSps51ekR1ZY/ygrP1tp0WFm8oVq6nzc/hvfV/22JylndIbsf2U2M9LOMwiSddr6y+78j+OQ==} + /@babel/helper-replace-supers@7.22.20(@babel/core@7.23.5): + resolution: {integrity: sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==} engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 dependencies: - '@babel/helper-environment-visitor': 7.22.1 - '@babel/helper-member-expression-to-functions': 7.22.0 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/template': 7.21.9 - '@babel/traverse': 7.22.1 - '@babel/types': 7.22.0 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 dev: true - /@babel/helper-simple-access@7.21.5: - resolution: {integrity: sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg==} + /@babel/helper-simple-access@7.22.5: + resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.0 + '@babel/types': 7.23.5 dev: true - /@babel/helper-skip-transparent-expression-wrappers@7.20.0: - resolution: {integrity: sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==} + /@babel/helper-skip-transparent-expression-wrappers@7.22.5: + resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.0 + '@babel/types': 7.23.5 dev: true - /@babel/helper-split-export-declaration@7.18.6: - resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} + /@babel/helper-split-export-declaration@7.22.6: + resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.0 + '@babel/types': 7.23.5 dev: true /@babel/helper-string-parser@7.21.5: resolution: {integrity: sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==} engines: {node: '>=6.9.0'} + /@babel/helper-string-parser@7.23.4: + resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/helper-validator-identifier@7.19.1: resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} engines: {node: '>=6.9.0'} - /@babel/helper-validator-option@7.21.0: - resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} + /@babel/helper-validator-identifier@7.22.20: + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-validator-option@7.23.5: + resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-wrap-function@7.20.5: - resolution: {integrity: sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q==} + /@babel/helper-wrap-function@7.22.20: + resolution: {integrity: sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-function-name': 7.21.0 - '@babel/template': 7.21.9 - '@babel/traverse': 7.22.1 - '@babel/types': 7.22.0 - transitivePeerDependencies: - - supports-color + '@babel/helper-function-name': 7.23.0 + '@babel/template': 7.22.15 + '@babel/types': 7.23.5 dev: true - /@babel/helpers@7.22.0: - resolution: {integrity: sha512-I/hZCYErxdjuUnJpJxHmCESB3AdcOAFjj+K6+of9JyWBeAhggR9NQoUHI481pRNH87cx77mbpx0cygzXlvGayA==} + /@babel/helpers@7.23.5: + resolution: {integrity: sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.21.9 - '@babel/traverse': 7.22.1 - '@babel/types': 7.22.0 + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.5 + '@babel/types': 7.23.5 transitivePeerDependencies: - supports-color dev: true @@ -594,887 +634,872 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser@7.22.0: - resolution: {integrity: sha512-DA65VCJRetcFmJnt9/hEmRvXNCwk0V86dxG6p6N13hzDazaLRjGdTGPGgjxZOtLuFgWzOSRX4grybmRXwQ9bSg==} + /@babel/highlight@7.23.4: + resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: true + + /@babel/parser@7.23.0: + resolution: {integrity: sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==} engines: {node: '>=6.0.0'} hasBin: true dependencies: '@babel/types': 7.22.0 - /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==} + /@babel/parser@7.23.5: + resolution: {integrity: sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.23.5 + dev: true + + /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-iRkKcCqb7iGnq9+3G6rZ+Ciz5VywC4XNRHe57lKM+jOeYAoR0lVqdeeDRfh0tQcTfw/+vBhHn926FmQhLtlFLQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-THA2q9FkS/RVTqWt0IXNns3zyHc8kzfiDEK9+vkIYGMlyaV6i6O3IpOg/oODSKqtRqu7gzwONjIJqwPlRQT41A==} + /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-WwlxbfMNdVEpQjZmK5mhm7oSwD3dS6eU+Iwsi4Knl9wAletWem7kaRsGOG+8UEbRyqxY4SS5zvtfXwX+jMxUwQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.13.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - '@babel/plugin-transform-optional-chaining': 7.22.0(@babel/core@7.22.1) + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/plugin-transform-optional-chaining': 7.23.4(@babel/core@7.23.5) dev: true - /@babel/plugin-proposal-private-property-in-object@7.21.0(@babel/core@7.22.1): - resolution: {integrity: sha512-ha4zfehbJjc5MmXBlHec1igel5TJXXLDDRbuJ4+XT2TJcyD9/V1919BA8gMvsdHcNMBy4WBUBiRb3nw/EQUtBw==} + /@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-XaJak1qcityzrX0/IU5nKHb34VaibwP3saKqG6a/tppelgllOH13LUann4ZCIBcVOeE6H18K4Vx9QKkVww3z/w==} engines: {node: '>=6.9.0'} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-create-class-features-plugin': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.22.1) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-proposal-unicode-property-regex@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==} - engines: {node: '>=4'} + /@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.23.5): + resolution: {integrity: sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==} + engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 dev: true - /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.22.1): + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.23.5): resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.22.1): + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.23.5): resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.22.1): + /@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.23.5): resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.22.1): + /@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.23.5): resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.22.1): + /@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.23.5): resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-import-assertions@7.20.0(@babel/core@7.22.1): - resolution: {integrity: sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ==} + /@babel/plugin-syntax-import-assertions@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-import-attributes@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-TFqy+gFAiTh8KlVS8/c6w97uhAVcCVyd2R0srMHVYymBcBK5N5P+bf8VG6tEAiYCZ3TLYvi6fpzU9Rq79t9oxw==} + /@babel/plugin-syntax-import-attributes@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-pawnE0P9g10xgoP7yKr6CK63K2FMsTE+FZidZO/1PwRdzmAPVs+HS1mAURUsgaoxammTJvULUdIkEK0gOcU2tA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.22.1): + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.23.5): resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.22.1): + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.23.5): resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.22.1): + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.23.5): resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.22.1): + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.23.5): resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.22.1): + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.23.5): resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.22.1): + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.23.5): resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.22.1): + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.23.5): resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.22.1): + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.23.5): resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.22.1): + /@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.23.5): resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.22.1): + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.23.5): resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.22.1): + /@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.23.5): resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-arrow-functions@7.21.5(@babel/core@7.22.1): - resolution: {integrity: sha512-wb1mhwGOCaXHDTcsRYMKF9e5bbMgqwxtqa2Y1ifH96dXJPwbuLX9qHy3clhrxVqgMz7nyNXs8VkxdH8UBcjKqA==} + /@babel/plugin-transform-arrow-functions@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-async-generator-functions@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-SLpCXbF08XTYRJ/QM0hn4DdgSQB6aAtCaS+zfrjx374ectu4JbpwyQv3fF0kAtPdfQkeFdz86Dajj8A6oYRM9g==} + /@babel/plugin-transform-async-generator-functions@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-efdkfPhHYTtn0G6n2ddrESE91fgXxjlqLsnUtPWnJs4a4mZIbUaK7ffqKIIUKXSHwcDvaCVX6GXkaJJFqtX7jw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-environment-visitor': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-remap-async-to-generator': 7.18.9(@babel/core@7.22.1) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.1) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.5) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-async-to-generator@7.20.7(@babel/core@7.22.1): - resolution: {integrity: sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q==} + /@babel/plugin-transform-async-to-generator@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-A7LFsKi4U4fomjqXJlZg/u0ft/n8/7n7lpffUP/ZULx/DtV9SGlNKZolHH6PE8Xl1ngCc0M11OaeZptXVkfKSw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-module-imports': 7.21.4 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-remap-async-to-generator': 7.18.9(@babel/core@7.22.1) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-block-scoped-functions@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==} + /@babel/plugin-transform-block-scoped-functions@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-vI+0sIaPIO6CNuM9Kk5VmXcMVRiOpDh7w2zZt9GXzmE/9KD70CUEVhvPR/etAeNK/FAEkhxQtXOzVF3EuRL41A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-block-scoping@7.21.0(@babel/core@7.22.1): - resolution: {integrity: sha512-Mdrbunoh9SxwFZapeHVrwFmri16+oYotcZysSzhNIVDwIAb1UV+kvnxULSYq9J3/q5MDG+4X6w8QVgD1zhBXNQ==} + /@babel/plugin-transform-block-scoping@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-class-properties@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-m04PcP0S4OR+NpRQNIOEPHVdGcXqbOEn+pIYzrqRTXMlOjKy6s7s30MZ1WzglHQhD/X/yhngun4yG0FqPszZzw==} + /@babel/plugin-transform-class-properties@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-create-class-features-plugin': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-create-class-features-plugin': 7.23.5(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-class-static-block@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-b6N2cduLeAmnZMHlLj0XB8108D4EHLtpv1fl7PudLjHf+yxFxnKvhuTn5vuQg61qzS+wxp5DBOcNo1W/GEsFWg==} + /@babel/plugin-transform-class-static-block@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-nsWu/1M+ggti1SOALj3hfx5FXzAY06fwPJsUZD4/A5e1bWi46VUIWtD+kOX6/IdhXGsXBWllLFDSnqSCdUNydQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.12.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-create-class-features-plugin': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.22.1) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-create-class-features-plugin': 7.23.5(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-classes@7.21.0(@babel/core@7.22.1): - resolution: {integrity: sha512-RZhbYTCEUAe6ntPehC4hlslPWosNHDox+vAs4On/mCLRLfoDVHf6hVEd7kuxr1RnHwJmxFfUM3cZiZRmPxJPXQ==} + /@babel/plugin-transform-classes@7.23.5(@babel/core@7.23.5): + resolution: {integrity: sha512-jvOTR4nicqYC9yzOHIhXG5emiFEOpappSJAl73SDSEDcybD+Puuze8Tnpb9p9qEyYup24tq891gkaygIFvWDqg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-compilation-targets': 7.22.1(@babel/core@7.22.1) - '@babel/helper-environment-visitor': 7.22.1 - '@babel/helper-function-name': 7.21.0 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-replace-supers': 7.22.1 - '@babel/helper-split-export-declaration': 7.18.6 + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.5) + '@babel/helper-split-export-declaration': 7.22.6 globals: 11.12.0 - transitivePeerDependencies: - - supports-color dev: true - /@babel/plugin-transform-computed-properties@7.21.5(@babel/core@7.22.1): - resolution: {integrity: sha512-TR653Ki3pAwxBxUe8srfF3e4Pe3FTA46uaNHYyQwIoM4oWKSoOZiDNyHJ0oIoDIUPSRQbQG7jzgVBX3FPVne1Q==} + /@babel/plugin-transform-computed-properties@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/template': 7.21.9 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/template': 7.22.15 dev: true - /@babel/plugin-transform-destructuring@7.21.3(@babel/core@7.22.1): - resolution: {integrity: sha512-bp6hwMFzuiE4HqYEyoGJ/V2LeIWn+hLVKc4pnj++E5XQptwhtcGmSayM029d/j2X1bPKGTlsyPwAubuU22KhMA==} + /@babel/plugin-transform-destructuring@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-dotall-regex@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==} + /@babel/plugin-transform-dotall-regex@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-vgnFYDHAKzFaTVp+mneDsIEbnJ2Np/9ng9iviHw3P/KVcgONxpNULEW/51Z/BaFojG2GI2GwwXck5uV1+1NOYQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-duplicate-keys@7.18.9(@babel/core@7.22.1): - resolution: {integrity: sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==} + /@babel/plugin-transform-duplicate-keys@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-RrqQ+BQmU3Oyav3J+7/myfvRCq7Tbz+kKLLshUmMwNlDHExbGL7ARhajvoBJEvc+fCguPPu887N+3RRXBVKZUA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-dynamic-import@7.22.1(@babel/core@7.22.1): - resolution: {integrity: sha512-rlhWtONnVBPdmt+jeewS0qSnMz/3yLFrqAP8hHC6EDcrYRSyuz9f9yQhHvVn2Ad6+yO9fHXac5piudeYrInxwQ==} + /@babel/plugin-transform-dynamic-import@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-V6jIbLhdJK86MaLh4Jpghi8ho5fGzt3imHOBu/x0jlBaPYqDoWz4RDXjmMOfnh+JWNaQleEAByZLV0QzBT4YQQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.22.1) + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-exponentiation-operator@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==} + /@babel/plugin-transform-exponentiation-operator@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-5fhCsl1odX96u7ILKHBj4/Y8vipoqwsJMh4csSA8qFfxrZDEA4Ssku2DyNvMJSmZNOEBT750LfFPbtrnTP90BQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-builder-binary-assignment-operator-visitor': 7.22.0 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-builder-binary-assignment-operator-visitor': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-export-namespace-from@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-NkqdpxXHZG1CbXuu31weYMjAOeZ785n4ip/yXYg/4oZxdCg1jH10iR7oPJbZeyF99HhnTxqFnis3FTlpnh5Ovw==} + /@babel/plugin-transform-export-namespace-from@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.22.1) + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-for-of@7.21.5(@babel/core@7.22.1): - resolution: {integrity: sha512-nYWpjKW/7j/I/mZkGVgHJXh4bA1sfdFnJoOXwJuj4m3Q2EraO/8ZyrkCau9P5tbHQk01RMSt6KYLCsW7730SXQ==} + /@babel/plugin-transform-for-of@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-X8jSm8X1CMwxmK878qsUGJRmbysKNbdpTv/O1/v0LuY/ZkZrng5WYiekYSdg9m09OTmDDUWeEDsTE+17WYbAZw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-function-name@7.18.9(@babel/core@7.22.1): - resolution: {integrity: sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==} + /@babel/plugin-transform-function-name@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-I1QXp1LxIvt8yLaib49dRW5Okt7Q4oaxao6tFVKS/anCdEOMtYwWVKoiOA1p34GOWIZjUK0E+zCp7+l1pfQyiw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-compilation-targets': 7.22.1(@babel/core@7.22.1) - '@babel/helper-function-name': 7.21.0 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-json-strings@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-6sSCmFYjv4czjub/ESDp46/TQGEM6oH0/t0Zd1gj8qb+j3XY/+s1M8h+2EtJ5JYNQ6ZBxpmazCDwhwQT950Aug==} + /@babel/plugin-transform-json-strings@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-81nTOqM1dMwZ/aRXQ59zVubN9wHGqk6UtqRK+/q+ciXmRy8fSolhGVvG09HHRGo4l6fr/c4ZhXUQH0uFW7PZbg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.1) + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-literals@7.18.9(@babel/core@7.22.1): - resolution: {integrity: sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==} + /@babel/plugin-transform-literals@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-wZ0PIXRxnwZvl9AYpqNUxpZ5BiTGrYt7kueGQ+N5FiQ7RCOD4cm8iShd6S6ggfVIWaJf2EMk8eRzAh52RfP4rQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-logical-assignment-operators@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-tSYLi4c8H5K1iSCLCjA4xaYgw+zQEl7WUP9YI2WpwXkmryDC7+Pu/uD43XQos7Sm326OIC6Yf+6LuWjBs8JJKQ==} + /@babel/plugin-transform-logical-assignment-operators@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-Mc/ALf1rmZTP4JKKEhUwiORU+vcfarFVLfcFiolKUo6sewoxSEgl36ak5t+4WamRsNr6nzjZXQjM35WsU+9vbg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.1) + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-member-expression-literals@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==} + /@babel/plugin-transform-member-expression-literals@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-sC3LdDBDi5x96LA+Ytekz2ZPk8i/Ck+DEuDbRAll5rknJ5XRTSaPKEYwomLcs1AA8wg9b3KjIQRsnApj+q51Ag==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-modules-amd@7.20.11(@babel/core@7.22.1): - resolution: {integrity: sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g==} + /@babel/plugin-transform-modules-amd@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-vJYQGxeKM4t8hYCKVBlZX/gtIY2I7mRGFNcm85sgXGMTBcoV3QdVtdpbcWEbzbfUIUZKwvgFT82mRvaQIebZzw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-module-transforms': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-modules-commonjs@7.21.5(@babel/core@7.22.1): - resolution: {integrity: sha512-OVryBEgKUbtqMoB7eG2rs6UFexJi6Zj6FDXx+esBLPTCxCNxAY9o+8Di7IsUGJ+AVhp5ncK0fxWUBd0/1gPhrQ==} + /@babel/plugin-transform-modules-commonjs@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-module-transforms': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-simple-access': 7.21.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-simple-access': 7.22.5 dev: true - /@babel/plugin-transform-modules-systemjs@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-hSo/4vBjCjwsol3nLDJG3QRDuNzvzofnyhKyCiSXpzqEVmkos9SODFC3xzDvvuE3AUjHUMgTpTRpJq16i62heA==} + /@babel/plugin-transform-modules-systemjs@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-ZxyKGTkF9xT9YJuKQRo19ewf3pXpopuYQd8cDXqNzc3mUNbOME0RKMoZxviQk74hwzfQsEe66dE92MaZbdHKNQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-hoist-variables': 7.18.6 - '@babel/helper-module-transforms': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-validator-identifier': 7.19.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-identifier': 7.22.20 dev: true - /@babel/plugin-transform-modules-umd@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==} + /@babel/plugin-transform-modules-umd@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-zHsy9iXX2nIsCBFPud3jKn1IRPWg3Ing1qOZgeKV39m1ZgIdpJqvlWVeiHBZC6ITRG0MfskhYe9cLgntfSFPIg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-module-transforms': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-named-capturing-groups-regex@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-3bIivRwjbaMFYuP8OypIlTbZK0SxW3j9VpVQX/Yj2q0wG6GqOG30Vgmo5X7QW3TGi3rxrdYpKuwxqfb5aCnJkA==} + /@babel/plugin-transform-named-capturing-groups-regex@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-new-target@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-IZH0e2Fm8XmnZTXRzoRsHBBJ7wFzfeU22iiEZCi6EumrAjKOG6AdHpsxtBezG4SCQhqRS8DojQM8+bqtOBTQqw==} + /@babel/plugin-transform-new-target@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-YJ3xKqtJMAT5/TIZnpAR3I+K+WaDowYbN3xyxI8zxx/Gsypwf9B9h0VB+1Nh6ACAAPRS5NSRje0uVv5i79HYGQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-nullish-coalescing-operator@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-KU2Or7uQqYKcL6rVLh8jThUBAKy1H+mxPx4E1omUqdSL+hVM9NriMjGFnnv+9xSn3jUMV5FQHsLQxgGLr/MWTw==} + /@babel/plugin-transform-nullish-coalescing-operator@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.1) + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-numeric-separator@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-dfbXAKlbPlDKXsY7fa/gRBWgI4n537TR4b5AnVCZ3RwQ1aVPxs52Xs3XHFxQMn3j4LmUhn8IL2nAYmNh6z2/Ew==} + /@babel/plugin-transform-numeric-separator@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-mps6auzgwjRrwKEZA05cOwuDc9FAzoyFS4ZsG/8F43bTLf/TgkJg7QXOrPO1JO599iA3qgK9MXdMGOEC8O1h6Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.1) + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-object-rest-spread@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-PHXQfxbe5EKp2+MuEdBFO4X1gsjvUZPjSDGvYz7PjWl8hZtYDCDxPrwZG+GwT/j6FnAmSz2bTZbQ5Jrh3fhRPg==} + /@babel/plugin-transform-object-rest-spread@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-9x9K1YyeQVw0iOXJlIzwm8ltobIIv7j2iLyP2jIhEbqPRQ7ScNgwQufU2I0Gq11VjyG4gI4yMXt2VFags+1N3g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/compat-data': 7.22.0 - '@babel/core': 7.22.1 - '@babel/helper-compilation-targets': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.1) - '@babel/plugin-transform-parameters': 7.22.0(@babel/core@7.22.1) + '@babel/compat-data': 7.23.5 + '@babel/core': 7.23.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-object-super@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==} + /@babel/plugin-transform-object-super@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-BwQ8q0x2JG+3lxCVFohg+KbQM7plfpBwThdW9A6TMtWwLsbDA01Ek2Zb/AgDN39BiZsExm4qrXxjk+P1/fzGrA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-replace-supers': 7.22.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-optional-catch-binding@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-x8HEst6X74Aut0TxZI4s1UbUCtqR7IW764w/o/tTIDsm9OY9g+y9BeNhfZ+GrN0/TErN1dBoHNxqo1JXHdfxyA==} + /@babel/plugin-transform-optional-catch-binding@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-XIq8t0rJPHf6Wvmbn9nFxU6ao4c7WhghTR5WyV8SrJfUFzyxhCm4nhC+iAp3HFhbAKLfYpgzhJ6t4XCtVwqO5A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.1) + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-optional-chaining@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-p5BZinFj92iSErcstoPK+e+MHJUEZ6Gmlu0EkP3DJ0Y/1XPNvlXxfAzuh8KkN+3wCsYRKLAxAsF6Sn8b/bfWaA==} + /@babel/plugin-transform-optional-chaining@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.1) + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-parameters@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-hlRM1lu7xeqW8EKKg9ByHwnCEIy0dNPd/fwffpwAck2H3C5mQCrWR9PdrjsywivsFuVAbyyAImU58vAR1cXrEw==} + /@babel/plugin-transform-parameters@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-private-methods@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-3ao+Yt2kGQEXC894aBRCPo+zzW6YbM/iba+znKsZgEmDkc8RU/ODBfRpWP11qerQ0/mDzqjLpIG7HhpiKx0/cg==} + /@babel/plugin-transform-private-methods@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-UzqRcRtWsDMTLrRWFvUBDwmw06tCQH9Rl1uAjfh6ijMSmGYQ+fpdB+cnqRC8EMh5tuuxSv0/TejGL+7vyj+50g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-create-class-features-plugin': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-create-class-features-plugin': 7.23.5(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-private-property-in-object@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-P4bP+/4Rq6aQ/IZmAEUX+injSKhuOOMOZkXtB3x++P3k5BtyV8RkTvOtpqIv0mLpHge5ReGk0ijNBFRN0n2xEQ==} + /@babel/plugin-transform-private-property-in-object@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-9G3K1YqTq3F4Vt88Djx1UZ79PDyj+yKRnUy7cZGSMe+a7jkwD259uKKuUzQlPkGam7R+8RJwh5z4xO27fA1o2A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-create-class-features-plugin': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.22.1) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.23.5(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.5) dev: true - /@babel/plugin-transform-property-literals@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==} + /@babel/plugin-transform-property-literals@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-jR3Jn3y7cZp4oEWPFAlRsSWjxKe4PZILGBSd4nis1TsC5qeSpb+nrtihJuDhNI7QHiVbUaiXa0X2RZY3/TI6Nw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-regenerator@7.21.5(@babel/core@7.22.1): - resolution: {integrity: sha512-ZoYBKDb6LyMi5yCsByQ5jmXsHAQDDYeexT1Szvlmui+lADvfSecr5Dxd/PkrTC3pAD182Fcju1VQkB4oCp9M+w==} + /@babel/plugin-transform-regenerator@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-KP+75h0KghBMcVpuKisx3XTu9Ncut8Q8TuvGO4IhY+9D5DFEckQefOuIsB/gQ2tG71lCke4NMrtIPS8pOj18BQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - regenerator-transform: 0.15.1 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + regenerator-transform: 0.15.2 dev: true - /@babel/plugin-transform-reserved-words@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==} + /@babel/plugin-transform-reserved-words@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-QnNTazY54YqgGxwIexMZva9gqbPa15t/x9VS+0fsEFWplwVpXYZivtgl43Z1vMpc1bdPP2PP8siFeVcnFvA3Cg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-shorthand-properties@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==} + /@babel/plugin-transform-shorthand-properties@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-ED2fgqZLmexWiN+YNFX26fx4gh5qHDhn1O2gvEhreLW2iI63Sqm4llRLCXALKrCnbN4Jy0VcMQZl/SAzqug/jg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-spread@7.20.7(@babel/core@7.22.1): - resolution: {integrity: sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw==} + /@babel/plugin-transform-spread@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 dev: true - /@babel/plugin-transform-sticky-regex@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==} + /@babel/plugin-transform-sticky-regex@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-HZOyN9g+rtvnOU3Yh7kSxXrKbzgrm5X4GncPY1QOquu7epga5MxKHVpYu2hvQnry/H+JjckSYRb93iNfsioAGg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-template-literals@7.18.9(@babel/core@7.22.1): - resolution: {integrity: sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==} + /@babel/plugin-transform-template-literals@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-Flok06AYNp7GV2oJPZZcP9vZdszev6vPBkHLwxwSpaIqx75wn6mUd3UFWsSsA0l8nXAKkyCmL/sR02m8RYGeHg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-typeof-symbol@7.18.9(@babel/core@7.22.1): - resolution: {integrity: sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==} + /@babel/plugin-transform-typeof-symbol@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-4t15ViVnaFdrPC74be1gXBSMzXk3B4Us9lP7uLRQHTFpV5Dvt33pn+2MyyNxmN3VTTm3oTrZVMUmuw3oBnQ2oQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-unicode-escapes@7.21.5(@babel/core@7.22.1): - resolution: {integrity: sha512-LYm/gTOwZqsYohlvFUe/8Tujz75LqqVC2w+2qPHLR+WyWHGCZPN1KBpJCJn+4Bk4gOkQy/IXKIge6az5MqwlOg==} + /@babel/plugin-transform-unicode-escapes@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-OMCUx/bU6ChE3r4+ZdylEqAjaQgHAgipgW8nsCfu5pGqDcFytVd91AwRvUJSBZDz0exPGgnjoqhgRYLRjFZc9Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-unicode-property-regex@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-uQacKjQ46K+yDfrbEyhEGkqqf5Zbn9WTKWgHOioHrTnOSVGYZSITlNNe0cP4fTgt4ZtjvMp85s4Hj86XS3v3uQ==} + /@babel/plugin-transform-unicode-property-regex@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-KcLIm+pDZkWZQAFJ9pdfmh89EwVfmNovFBcXko8szpBeF8z68kWIPeKlmSOkT9BXJxs2C0uk+5LxoxIv62MROA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-unicode-regex@7.18.6(@babel/core@7.22.1): - resolution: {integrity: sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==} + /@babel/plugin-transform-unicode-regex@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-wMHpNA4x2cIA32b/ci3AfwNgheiva2W0WUKWTK7vBHBhDKfPsc5cFGNWm69WBqpwd86u1qwZ9PWevKqm1A3yAw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-unicode-sets-regex@7.22.0(@babel/core@7.22.1): - resolution: {integrity: sha512-w9ZRKNaJAk2vOhY6HTF7nmr+c5vJ//RCH7S0l4sWyts1x17W45oa6J3UYeZ/RXb74XHm1eFfLjqzY1Hg2mtyaw==} + /@babel/plugin-transform-unicode-sets-regex@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-W7lliA/v9bNR83Qc3q1ip9CQMZ09CcHDbHfbLRDNuAhn1Mvkr1ZNF7hPmztMQvtTGVLJ9m8IZqWsTkXOml8dbw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.23.5 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/preset-env@7.22.2(@babel/core@7.22.1): - resolution: {integrity: sha512-UPNK9pgphMULvA2EMKIWHU90C47PKyuvQ8pE1MzH7l9PgFcRabdrHhlePpBuWxYZQ+TziP2nycKoI5C1Yhdm9Q==} + /@babel/preset-env@7.23.5(@babel/core@7.23.5): + resolution: {integrity: sha512-0d/uxVD6tFGWXGDSfyMD1p2otoaKmu6+GD+NfAx0tMaH+dxORnp7T9TaVQ6mKyya7iBtCIVxHjWT7MuzzM9z+A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/compat-data': 7.22.0 - '@babel/core': 7.22.1 - '@babel/helper-compilation-targets': 7.22.1(@babel/core@7.22.1) - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-validator-option': 7.21.0 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-proposal-private-property-in-object': 7.21.0(@babel/core@7.22.1) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.1) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.22.1) - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.22.1) - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.22.1) - '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.22.1) - '@babel/plugin-syntax-import-assertions': 7.20.0(@babel/core@7.22.1) - '@babel/plugin-syntax-import-attributes': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.22.1) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.1) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.1) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.1) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.1) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.1) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.1) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.1) - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.22.1) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.22.1) - '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-arrow-functions': 7.21.5(@babel/core@7.22.1) - '@babel/plugin-transform-async-generator-functions': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-async-to-generator': 7.20.7(@babel/core@7.22.1) - '@babel/plugin-transform-block-scoped-functions': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-block-scoping': 7.21.0(@babel/core@7.22.1) - '@babel/plugin-transform-class-properties': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-class-static-block': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-classes': 7.21.0(@babel/core@7.22.1) - '@babel/plugin-transform-computed-properties': 7.21.5(@babel/core@7.22.1) - '@babel/plugin-transform-destructuring': 7.21.3(@babel/core@7.22.1) - '@babel/plugin-transform-dotall-regex': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-duplicate-keys': 7.18.9(@babel/core@7.22.1) - '@babel/plugin-transform-dynamic-import': 7.22.1(@babel/core@7.22.1) - '@babel/plugin-transform-exponentiation-operator': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-export-namespace-from': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-for-of': 7.21.5(@babel/core@7.22.1) - '@babel/plugin-transform-function-name': 7.18.9(@babel/core@7.22.1) - '@babel/plugin-transform-json-strings': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-literals': 7.18.9(@babel/core@7.22.1) - '@babel/plugin-transform-logical-assignment-operators': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-member-expression-literals': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-modules-amd': 7.20.11(@babel/core@7.22.1) - '@babel/plugin-transform-modules-commonjs': 7.21.5(@babel/core@7.22.1) - '@babel/plugin-transform-modules-systemjs': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-modules-umd': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-named-capturing-groups-regex': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-new-target': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-nullish-coalescing-operator': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-numeric-separator': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-object-rest-spread': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-object-super': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-optional-catch-binding': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-optional-chaining': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-parameters': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-private-methods': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-private-property-in-object': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-property-literals': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-regenerator': 7.21.5(@babel/core@7.22.1) - '@babel/plugin-transform-reserved-words': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-shorthand-properties': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-spread': 7.20.7(@babel/core@7.22.1) - '@babel/plugin-transform-sticky-regex': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-template-literals': 7.18.9(@babel/core@7.22.1) - '@babel/plugin-transform-typeof-symbol': 7.18.9(@babel/core@7.22.1) - '@babel/plugin-transform-unicode-escapes': 7.21.5(@babel/core@7.22.1) - '@babel/plugin-transform-unicode-property-regex': 7.22.0(@babel/core@7.22.1) - '@babel/plugin-transform-unicode-regex': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-unicode-sets-regex': 7.22.0(@babel/core@7.22.1) - '@babel/preset-modules': 0.1.5(@babel/core@7.22.1) - '@babel/types': 7.22.0 - babel-plugin-polyfill-corejs2: 0.4.3(@babel/core@7.22.1) - babel-plugin-polyfill-corejs3: 0.8.1(@babel/core@7.22.1) - babel-plugin-polyfill-regenerator: 0.5.0(@babel/core@7.22.1) - core-js-compat: 3.30.2 - semver: 6.3.0 + '@babel/compat-data': 7.23.5 + '@babel/core': 7.23.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.23.5 + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.23.5) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.5) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.23.5) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.5) + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-import-assertions': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-syntax-import-attributes': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.23.5) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.5) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.5) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.5) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.23.5) + '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.23.5) + '@babel/plugin-transform-arrow-functions': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-async-generator-functions': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-async-to-generator': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-block-scoped-functions': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-block-scoping': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-class-properties': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-class-static-block': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-classes': 7.23.5(@babel/core@7.23.5) + '@babel/plugin-transform-computed-properties': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-destructuring': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-dotall-regex': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-duplicate-keys': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-dynamic-import': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-exponentiation-operator': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-export-namespace-from': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-for-of': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-function-name': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-json-strings': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-literals': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-logical-assignment-operators': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-member-expression-literals': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-modules-amd': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-modules-systemjs': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-modules-umd': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-named-capturing-groups-regex': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-new-target': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-nullish-coalescing-operator': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-numeric-separator': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-object-rest-spread': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-object-super': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-optional-catch-binding': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-optional-chaining': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-private-methods': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-private-property-in-object': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-property-literals': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-regenerator': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-reserved-words': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-shorthand-properties': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-spread': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-sticky-regex': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-template-literals': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-typeof-symbol': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-unicode-escapes': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-unicode-property-regex': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-unicode-regex': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-unicode-sets-regex': 7.23.3(@babel/core@7.23.5) + '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.23.5) + babel-plugin-polyfill-corejs2: 0.4.6(@babel/core@7.23.5) + babel-plugin-polyfill-corejs3: 0.8.6(@babel/core@7.23.5) + babel-plugin-polyfill-regenerator: 0.5.3(@babel/core@7.23.5) + core-js-compat: 3.33.3 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true - /@babel/preset-modules@0.1.5(@babel/core@7.22.1): - resolution: {integrity: sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==} + /@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.23.5): + resolution: {integrity: sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-proposal-unicode-property-regex': 7.18.6(@babel/core@7.22.1) - '@babel/plugin-transform-dotall-regex': 7.18.6(@babel/core@7.22.1) - '@babel/types': 7.22.0 + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/types': 7.23.5 esutils: 2.0.3 dev: true @@ -1489,27 +1514,34 @@ packages: regenerator-runtime: 0.13.11 dev: true - /@babel/template@7.21.9: - resolution: {integrity: sha512-MK0X5k8NKOuWRamiEfc3KEJiHMTkGZNUjzMipqCGDDc6ijRl/B7RGSKVGncu4Ro/HdyzzY6cmoXuKI2Gffk7vQ==} + /@babel/runtime@7.23.5: + resolution: {integrity: sha512-NdUTHcPe4C99WxPub+K9l9tK5/lV4UXIoaHSYgzco9BCyjKAAwzdBI+wWtYqHt7LJdbo74ZjRPJgzVweq1sz0w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.21.4 - '@babel/parser': 7.22.0 - '@babel/types': 7.22.0 + regenerator-runtime: 0.14.0 dev: true - /@babel/traverse@7.22.1: - resolution: {integrity: sha512-lAWkdCoUFnmwLBhIRLciFntGYsIIoC6vIbN8zrLPqBnJmPu7Z6nzqnKd7FsxQUNAvZfVZ0x6KdNvNp8zWIOHSQ==} + /@babel/template@7.22.15: + resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.21.4 - '@babel/generator': 7.22.0 - '@babel/helper-environment-visitor': 7.22.1 - '@babel/helper-function-name': 7.21.0 - '@babel/helper-hoist-variables': 7.18.6 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.22.0 - '@babel/types': 7.22.0 + '@babel/code-frame': 7.23.5 + '@babel/parser': 7.23.5 + '@babel/types': 7.23.5 + dev: true + + /@babel/traverse@7.23.5: + resolution: {integrity: sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.23.5 + '@babel/types': 7.23.5 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: @@ -1524,15 +1556,24 @@ packages: '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 + /@babel/types@7.23.5: + resolution: {integrity: sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + dev: true + /@bcoe/v8-coverage@0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true - /@changesets/apply-release-plan@6.1.3: - resolution: {integrity: sha512-ECDNeoc3nfeAe1jqJb5aFQX7CqzQhD2klXRez2JDb/aVpGUbX673HgKrnrgJRuQR/9f2TtLoYIzrGB9qwD77mg==} + /@changesets/apply-release-plan@6.1.4: + resolution: {integrity: sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==} dependencies: '@babel/runtime': 7.22.0 - '@changesets/config': 2.3.0 + '@changesets/config': 2.3.1 '@changesets/get-version-range-type': 0.3.2 '@changesets/git': 2.0.0 '@changesets/types': 5.2.1 @@ -1543,18 +1584,18 @@ packages: outdent: 0.5.0 prettier: 2.8.8 resolve-from: 5.0.0 - semver: 5.7.1 + semver: 7.5.4 dev: true - /@changesets/assemble-release-plan@5.2.3: - resolution: {integrity: sha512-g7EVZCmnWz3zMBAdrcKhid4hkHT+Ft1n0mLussFMcB1dE2zCuwcvGoy9ec3yOgPGF4hoMtgHaMIk3T3TBdvU9g==} + /@changesets/assemble-release-plan@5.2.4: + resolution: {integrity: sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==} dependencies: '@babel/runtime': 7.22.0 '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.5 + '@changesets/get-dependents-graph': 1.3.6 '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 - semver: 5.7.1 + semver: 7.5.4 dev: true /@changesets/changelog-git@0.1.14: @@ -1563,18 +1604,18 @@ packages: '@changesets/types': 5.2.1 dev: true - /@changesets/cli@2.26.1: - resolution: {integrity: sha512-XnTa+b51vt057fyAudvDKGB0Sh72xutQZNAdXkCqPBKO2zvs2yYZx5hFZj1u9cbtpwM6Sxtcr02/FQJfZOzemQ==} + /@changesets/cli@2.26.2: + resolution: {integrity: sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==} hasBin: true dependencies: '@babel/runtime': 7.22.0 - '@changesets/apply-release-plan': 6.1.3 - '@changesets/assemble-release-plan': 5.2.3 + '@changesets/apply-release-plan': 6.1.4 + '@changesets/assemble-release-plan': 5.2.4 '@changesets/changelog-git': 0.1.14 - '@changesets/config': 2.3.0 + '@changesets/config': 2.3.1 '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.5 - '@changesets/get-release-plan': 3.0.16 + '@changesets/get-dependents-graph': 1.3.6 + '@changesets/get-release-plan': 3.0.17 '@changesets/git': 2.0.0 '@changesets/logger': 0.0.5 '@changesets/pre': 1.0.14 @@ -1583,7 +1624,7 @@ packages: '@changesets/write': 0.2.3 '@manypkg/get-packages': 1.1.3 '@types/is-ci': 3.0.0 - '@types/semver': 6.2.3 + '@types/semver': 7.5.0 ansi-colors: 4.1.3 chalk: 2.4.2 enquirer: 2.3.6 @@ -1596,17 +1637,17 @@ packages: p-limit: 2.3.0 preferred-pm: 3.0.3 resolve-from: 5.0.0 - semver: 5.7.1 + semver: 7.5.4 spawndamnit: 2.0.0 term-size: 2.2.1 tty-table: 4.2.1 dev: true - /@changesets/config@2.3.0: - resolution: {integrity: sha512-EgP/px6mhCx8QeaMAvWtRrgyxW08k/Bx2tpGT+M84jEdX37v3VKfh4Cz1BkwrYKuMV2HZKeHOh8sHvja/HcXfQ==} + /@changesets/config@2.3.1: + resolution: {integrity: sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==} dependencies: '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.5 + '@changesets/get-dependents-graph': 1.3.6 '@changesets/logger': 0.0.5 '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 @@ -1620,22 +1661,22 @@ packages: extendable-error: 0.1.7 dev: true - /@changesets/get-dependents-graph@1.3.5: - resolution: {integrity: sha512-w1eEvnWlbVDIY8mWXqWuYE9oKhvIaBhzqzo4ITSJY9hgoqQ3RoBqwlcAzg11qHxv/b8ReDWnMrpjpKrW6m1ZTA==} + /@changesets/get-dependents-graph@1.3.6: + resolution: {integrity: sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==} dependencies: '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 chalk: 2.4.2 fs-extra: 7.0.1 - semver: 5.7.1 + semver: 7.5.4 dev: true - /@changesets/get-release-plan@3.0.16: - resolution: {integrity: sha512-OpP9QILpBp1bY2YNIKFzwigKh7Qe9KizRsZomzLe6pK8IUo8onkAAVUD8+JRKSr8R7d4+JRuQrfSSNlEwKyPYg==} + /@changesets/get-release-plan@3.0.17: + resolution: {integrity: sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==} dependencies: '@babel/runtime': 7.22.0 - '@changesets/assemble-release-plan': 5.2.3 - '@changesets/config': 2.3.0 + '@changesets/assemble-release-plan': 5.2.4 + '@changesets/config': 2.3.1 '@changesets/pre': 1.0.14 '@changesets/read': 0.5.9 '@changesets/types': 5.2.1 @@ -1712,16 +1753,16 @@ packages: prettier: 2.8.8 dev: true - /@commitlint/cli@17.6.3: - resolution: {integrity: sha512-ItSz2fd4F+CujgIbQOfNNerDF1eFlsBGEfp9QcCb1kxTYMuKTYZzA6Nu1YRRrIaaWwe2E7awUGpIMrPoZkOG3A==} - engines: {node: '>=v14'} + /@commitlint/cli@18.1.0: + resolution: {integrity: sha512-ZT95pRNGD9fEEX1ih0yKyJ65U3Y88vLrJjK6hlSpLrJFioQNXTI4sSoOq7hHnOsJAmTsgEg5zxIY8qTzgEQtWg==} + engines: {node: '>=v18'} hasBin: true dependencies: - '@commitlint/format': 17.4.4 - '@commitlint/lint': 17.6.3 - '@commitlint/load': 17.5.0 - '@commitlint/read': 17.5.1 - '@commitlint/types': 17.4.4 + '@commitlint/format': 18.1.0 + '@commitlint/lint': 18.1.0 + '@commitlint/load': 18.1.0 + '@commitlint/read': 18.1.0 + '@commitlint/types': 18.1.0 execa: 5.1.1 lodash.isfunction: 3.0.9 resolve-from: 5.0.0 @@ -1732,26 +1773,26 @@ packages: - '@swc/wasm' dev: true - /@commitlint/config-conventional@17.6.3: - resolution: {integrity: sha512-bLyHEjjRWqlLQWIgYFHmUPbEFMOOLXeF3QbUinDIJev/u9e769tkoTH9YPknEywiuIrAgZaVo+OfzAIsJP0fsw==} - engines: {node: '>=v14'} + /@commitlint/config-conventional@18.1.0: + resolution: {integrity: sha512-8vvvtV3GOLEMHeKc8PjRL1lfP1Y4B6BG0WroFd9PJeRiOc3nFX1J0wlJenLURzl9Qus6YXVGWf+a/ZlbCKT3AA==} + engines: {node: '>=v18'} dependencies: - conventional-changelog-conventionalcommits: 5.0.0 + conventional-changelog-conventionalcommits: 7.0.2 dev: true - /@commitlint/config-validator@17.4.4: - resolution: {integrity: sha512-bi0+TstqMiqoBAQDvdEP4AFh0GaKyLFlPPEObgI29utoKEYoPQTvF0EYqIwYYLEoJYhj5GfMIhPHJkTJhagfeg==} - engines: {node: '>=v14'} + /@commitlint/config-validator@18.1.0: + resolution: {integrity: sha512-kbHkIuItXn93o2NmTdwi5Mk1ujyuSIysRE/XHtrcps/27GuUKEIqBJp6TdJ4Sq+ze59RlzYSHMKuDKZbfg9+uQ==} + engines: {node: '>=v18'} dependencies: - '@commitlint/types': 17.4.4 + '@commitlint/types': 18.1.0 ajv: 8.12.0 dev: true - /@commitlint/ensure@17.4.4: - resolution: {integrity: sha512-AHsFCNh8hbhJiuZ2qHv/m59W/GRE9UeOXbkOqxYMNNg9pJ7qELnFcwj5oYpa6vzTSHtPGKf3C2yUFNy1GGHq6g==} - engines: {node: '>=v14'} + /@commitlint/ensure@18.1.0: + resolution: {integrity: sha512-CkPzJ9UBumIo54VDcpmBlaVX81J++wzEhN3DJH9+6PaLeiIG+gkSx8t7C2gfwG7PaiW4HzQtdQlBN5ab+c4vFQ==} + engines: {node: '>=v18'} dependencies: - '@commitlint/types': 17.4.4 + '@commitlint/types': 18.1.0 lodash.camelcase: 4.3.0 lodash.kebabcase: 4.1.1 lodash.snakecase: 4.1.1 @@ -1759,123 +1800,123 @@ packages: lodash.upperfirst: 4.3.1 dev: true - /@commitlint/execute-rule@17.4.0: - resolution: {integrity: sha512-LIgYXuCSO5Gvtc0t9bebAMSwd68ewzmqLypqI2Kke1rqOqqDbMpYcYfoPfFlv9eyLIh4jocHWwCK5FS7z9icUA==} - engines: {node: '>=v14'} + /@commitlint/execute-rule@18.1.0: + resolution: {integrity: sha512-w3Vt4K+O7+nSr9/gFSEfZ1exKUOPSlJaRpnk7Y+XowEhvwT7AIk1HNANH+gETf0zGZ020+hfiMW/Ome+SNCUsg==} + engines: {node: '>=v18'} dev: true - /@commitlint/format@17.4.4: - resolution: {integrity: sha512-+IS7vpC4Gd/x+uyQPTAt3hXs5NxnkqAZ3aqrHd5Bx/R9skyCAWusNlNbw3InDbAK6j166D9asQM8fnmYIa+CXQ==} - engines: {node: '>=v14'} + /@commitlint/format@18.1.0: + resolution: {integrity: sha512-So/w217tGWMZZb1yXcUFNF2qFLyYtSVqbnGoMbX8a+JKcG4oB11Gc1adS0ssUOMivtiNpaLtkSHFynyiwtJtiQ==} + engines: {node: '>=v18'} dependencies: - '@commitlint/types': 17.4.4 + '@commitlint/types': 18.1.0 chalk: 4.1.2 dev: true - /@commitlint/is-ignored@17.6.3: - resolution: {integrity: sha512-LQbNdnPbxrpbcrVKR5yf51SvquqktpyZJwqXx3lUMF6+nT9PHB8xn3wLy8pi2EQv5Zwba484JnUwDE1ygVYNQA==} - engines: {node: '>=v14'} + /@commitlint/is-ignored@18.1.0: + resolution: {integrity: sha512-fa1fY93J/Nx2GH6r6WOLdBOiL7x9Uc1N7wcpmaJ1C5Qs6P+rPSUTkofe2IOhSJIJoboHfAH6W0ru4xtK689t0Q==} + engines: {node: '>=v18'} dependencies: - '@commitlint/types': 17.4.4 - semver: 7.5.0 + '@commitlint/types': 18.1.0 + semver: 7.5.4 dev: true - /@commitlint/lint@17.6.3: - resolution: {integrity: sha512-fBlXwt6SHJFgm3Tz+luuo3DkydAx9HNC5y4eBqcKuDuMVqHd2ugMNr+bQtx6riv9mXFiPoKp7nE4Xn/ls3iVDA==} - engines: {node: '>=v14'} + /@commitlint/lint@18.1.0: + resolution: {integrity: sha512-LGB3eI5UYu5LLayibNrRM4bSbowr1z9uyqvp0c7+0KaSJi+xHxy/QEhb6fy4bMAtbXEvygY0sUu9HxSWg41rVQ==} + engines: {node: '>=v18'} dependencies: - '@commitlint/is-ignored': 17.6.3 - '@commitlint/parse': 17.4.4 - '@commitlint/rules': 17.6.1 - '@commitlint/types': 17.4.4 + '@commitlint/is-ignored': 18.1.0 + '@commitlint/parse': 18.1.0 + '@commitlint/rules': 18.1.0 + '@commitlint/types': 18.1.0 dev: true - /@commitlint/load@17.5.0: - resolution: {integrity: sha512-l+4W8Sx4CD5rYFsrhHH8HP01/8jEP7kKf33Xlx2Uk2out/UKoKPYMOIRcDH5ppT8UXLMV+x6Wm5osdRKKgaD1Q==} - engines: {node: '>=v14'} + /@commitlint/load@18.1.0: + resolution: {integrity: sha512-oZbAV3wdh4f5EB99y6U1uY1grvU1Oz1EYtWML9Zu4he6sgzVGHuIP81mka8exFp4bGytaUmuIKl+ahck3P4HoQ==} + engines: {node: '>=v18'} dependencies: - '@commitlint/config-validator': 17.4.4 - '@commitlint/execute-rule': 17.4.0 - '@commitlint/resolve-extends': 17.4.4 - '@commitlint/types': 17.4.4 - '@types/node': 20.2.5 + '@commitlint/config-validator': 18.1.0 + '@commitlint/execute-rule': 18.1.0 + '@commitlint/resolve-extends': 18.1.0 + '@commitlint/types': 18.1.0 + '@types/node': 18.18.7 chalk: 4.1.2 cosmiconfig: 8.1.3 - cosmiconfig-typescript-loader: 4.3.0(@types/node@20.2.5)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.0.4) + cosmiconfig-typescript-loader: 4.3.0(@types/node@18.18.7)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.2.2) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 resolve-from: 5.0.0 - ts-node: 10.9.1(@types/node@20.2.5)(typescript@5.0.4) - typescript: 5.0.4 + ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' dev: true - /@commitlint/message@17.4.2: - resolution: {integrity: sha512-3XMNbzB+3bhKA1hSAWPCQA3lNxR4zaeQAQcHj0Hx5sVdO6ryXtgUBGGv+1ZCLMgAPRixuc6en+iNAzZ4NzAa8Q==} - engines: {node: '>=v14'} + /@commitlint/message@18.1.0: + resolution: {integrity: sha512-8dT/jJg73wf3o2Mut/fqEDTpBYSIEVtX5PWyuY/0uviEYeheZAczFo/VMIkeGzhJJn1IrcvAwWsvJ1lVGY2I/w==} + engines: {node: '>=v18'} dev: true - /@commitlint/parse@17.4.4: - resolution: {integrity: sha512-EKzz4f49d3/OU0Fplog7nwz/lAfXMaDxtriidyGF9PtR+SRbgv4FhsfF310tKxs6EPj8Y+aWWuX3beN5s+yqGg==} - engines: {node: '>=v14'} + /@commitlint/parse@18.1.0: + resolution: {integrity: sha512-23yv8uBweXWYn8bXk4PjHIsmVA+RkbqPh2h7irupBo2LthVlzMRc4LM6UStasScJ4OlXYYaWOmuP7jcExUF50Q==} + engines: {node: '>=v18'} dependencies: - '@commitlint/types': 17.4.4 - conventional-changelog-angular: 5.0.13 - conventional-commits-parser: 3.2.4 + '@commitlint/types': 18.1.0 + conventional-changelog-angular: 6.0.0 + conventional-commits-parser: 5.0.0 dev: true - /@commitlint/read@17.5.1: - resolution: {integrity: sha512-7IhfvEvB//p9aYW09YVclHbdf1u7g7QhxeYW9ZHSO8Huzp8Rz7m05aCO1mFG7G8M+7yfFnXB5xOmG18brqQIBg==} - engines: {node: '>=v14'} + /@commitlint/read@18.1.0: + resolution: {integrity: sha512-rzfzoKUwxmvYO81tI5o1371Nwt3vhcQR36oTNfupPdU1jgSL3nzBIS3B93LcZh3IYKbCIMyMPN5WZ10BXdeoUg==} + engines: {node: '>=v18'} dependencies: - '@commitlint/top-level': 17.4.0 - '@commitlint/types': 17.4.4 + '@commitlint/top-level': 18.1.0 + '@commitlint/types': 18.1.0 fs-extra: 11.1.1 git-raw-commits: 2.0.11 minimist: 1.2.8 dev: true - /@commitlint/resolve-extends@17.4.4: - resolution: {integrity: sha512-znXr1S0Rr8adInptHw0JeLgumS11lWbk5xAWFVno+HUFVN45875kUtqjrI6AppmD3JI+4s0uZlqqlkepjJd99A==} - engines: {node: '>=v14'} + /@commitlint/resolve-extends@18.1.0: + resolution: {integrity: sha512-3mZpzOEJkELt7BbaZp6+bofJyxViyObebagFn0A7IHaLARhPkWTivXdjvZHS12nAORftv88Yhbh8eCPKfSvB7g==} + engines: {node: '>=v18'} dependencies: - '@commitlint/config-validator': 17.4.4 - '@commitlint/types': 17.4.4 + '@commitlint/config-validator': 18.1.0 + '@commitlint/types': 18.1.0 import-fresh: 3.3.0 lodash.mergewith: 4.6.2 resolve-from: 5.0.0 resolve-global: 1.0.0 dev: true - /@commitlint/rules@17.6.1: - resolution: {integrity: sha512-lUdHw6lYQ1RywExXDdLOKxhpp6857/4c95Dc/1BikrHgdysVUXz26yV0vp1GL7Gv+avx9WqZWTIVB7pNouxlfw==} - engines: {node: '>=v14'} + /@commitlint/rules@18.1.0: + resolution: {integrity: sha512-VJNQ674CRv4znI0DbsjZLVnn647J+BTxHGcrDIsYv7c99gW7TUGeIe5kL80G7l8+5+N0se8v9yn+Prr8xEy6Yw==} + engines: {node: '>=v18'} dependencies: - '@commitlint/ensure': 17.4.4 - '@commitlint/message': 17.4.2 - '@commitlint/to-lines': 17.4.0 - '@commitlint/types': 17.4.4 + '@commitlint/ensure': 18.1.0 + '@commitlint/message': 18.1.0 + '@commitlint/to-lines': 18.1.0 + '@commitlint/types': 18.1.0 execa: 5.1.1 dev: true - /@commitlint/to-lines@17.4.0: - resolution: {integrity: sha512-LcIy/6ZZolsfwDUWfN1mJ+co09soSuNASfKEU5sCmgFCvX5iHwRYLiIuoqXzOVDYOy7E7IcHilr/KS0e5T+0Hg==} - engines: {node: '>=v14'} + /@commitlint/to-lines@18.1.0: + resolution: {integrity: sha512-aHIoSDjG0ckxPLYDpODUeSLbEKmF6Jrs1B5JIssbbE9eemBtXtjm9yzdiAx9ZXcwoHlhbTp2fbndDb3YjlvJag==} + engines: {node: '>=v18'} dev: true - /@commitlint/top-level@17.4.0: - resolution: {integrity: sha512-/1loE/g+dTTQgHnjoCy0AexKAEFyHsR2zRB4NWrZ6lZSMIxAhBJnmCqwao7b4H8888PsfoTBCLBYIw8vGnej8g==} - engines: {node: '>=v14'} + /@commitlint/top-level@18.1.0: + resolution: {integrity: sha512-1/USHlolIxJlsfLKecSXH+6PDojIvnzaJGPYwF7MtnTuuXCNQ4izkeqDsRuNMe9nU2VIKpK9OT8Q412kGNmgGw==} + engines: {node: '>=v18'} dependencies: find-up: 5.0.0 dev: true - /@commitlint/types@17.4.4: - resolution: {integrity: sha512-amRN8tRLYOsxRr6mTnGGGvB5EmW/4DDjLMgiwK3CCVEmN6Sr/6xePGEpWaspKkckILuUORCwe6VfDBw6uj4axQ==} - engines: {node: '>=v14'} + /@commitlint/types@18.1.0: + resolution: {integrity: sha512-65vGxZmbs+2OVwEItxhp3Ul7X2m2LyLfifYI/NdPwRqblmuES2w2aIRhIjb7cwUIBHHSTT8WXj4ixVHQibmvLQ==} + engines: {node: '>=v18'} dependencies: chalk: 4.1.2 dev: true @@ -1887,28 +1928,30 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true - /@docsearch/css@3.4.0: - resolution: {integrity: sha512-Hg8Xfma+rFwRi6Y/pfei4FJoQ1hdVURmmNs/XPoMTCPAImU+d5yxj+M+qdLtNjWRpfWziU4dQcqY94xgFBn2dg==} + /@docsearch/css@3.5.2: + resolution: {integrity: sha512-SPiDHaWKQZpwR2siD0KQUwlStvIAnEyK6tAE2h2Wuoq8ue9skzhlyVQ1ddzOxX6khULnAALDiR/isSF3bnuciA==} dev: true - /@docsearch/js@3.4.0: - resolution: {integrity: sha512-uOtOHZJv+5PQmL68+srVzlGhLejnEBJgZl1bR87Zh/uK5RUI7p6el1R8hGTl2F8K2tCloNRxTMtXyYUNbMV+qw==} + /@docsearch/js@3.5.2(@algolia/client-search@4.20.0)(search-insights@2.11.0): + resolution: {integrity: sha512-p1YFTCDflk8ieHgFJYfmyHBki1D61+U9idwrLh+GQQMrBSP3DLGKpy0XUJtPjAOPltcVbqsTjiPFfH7JImjUNg==} dependencies: - '@docsearch/react': 3.4.0 + '@docsearch/react': 3.5.2(@algolia/client-search@4.20.0)(search-insights@2.11.0) preact: 10.15.0 transitivePeerDependencies: - '@algolia/client-search' - '@types/react' - react - react-dom + - search-insights dev: true - /@docsearch/react@3.4.0: - resolution: {integrity: sha512-ufrp5879XYGojgS30ZAp8H4qIMbahRHB9M85VDBP36Xgz5QjYM54i1URKj5e219F7gqTtOivfztFTij6itc0MQ==} + /@docsearch/react@3.5.2(@algolia/client-search@4.20.0)(search-insights@2.11.0): + resolution: {integrity: sha512-9Ahcrs5z2jq/DcAvYtvlqEBHImbm4YJI8M9y0x6Tqg598P40HTEkX7hsMcIuThI+hTFxRGZ9hll0Wygm2yEjng==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' react: '>= 16.8.0 < 19.0.0' react-dom: '>= 16.8.0 < 19.0.0' + search-insights: '>= 1 < 3' peerDependenciesMeta: '@types/react': optional: true @@ -1916,17 +1959,20 @@ packages: optional: true react-dom: optional: true + search-insights: + optional: true dependencies: - '@algolia/autocomplete-core': 1.8.2 - '@algolia/autocomplete-preset-algolia': 1.8.2(algoliasearch@4.17.1) - '@docsearch/css': 3.4.0 - algoliasearch: 4.17.1 + '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0)(search-insights@2.11.0) + '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0) + '@docsearch/css': 3.5.2 + algoliasearch: 4.20.0 + search-insights: 2.11.0 transitivePeerDependencies: - '@algolia/client-search' dev: true - /@esbuild/android-arm64@0.17.19: - resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} + /@esbuild/android-arm64@0.19.5: + resolution: {integrity: sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1934,8 +1980,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.17.19: - resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} + /@esbuild/android-arm@0.19.5: + resolution: {integrity: sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -1943,8 +1989,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.17.19: - resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} + /@esbuild/android-x64@0.19.5: + resolution: {integrity: sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -1952,8 +1998,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.17.19: - resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} + /@esbuild/darwin-arm64@0.19.5: + resolution: {integrity: sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -1961,8 +2007,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.17.19: - resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} + /@esbuild/darwin-x64@0.19.5: + resolution: {integrity: sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -1970,8 +2016,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.17.19: - resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} + /@esbuild/freebsd-arm64@0.19.5: + resolution: {integrity: sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -1979,8 +2025,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.17.19: - resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} + /@esbuild/freebsd-x64@0.19.5: + resolution: {integrity: sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -1988,8 +2034,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.17.19: - resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} + /@esbuild/linux-arm64@0.19.5: + resolution: {integrity: sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -1997,8 +2043,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.17.19: - resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} + /@esbuild/linux-arm@0.19.5: + resolution: {integrity: sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -2006,8 +2052,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.17.19: - resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} + /@esbuild/linux-ia32@0.19.5: + resolution: {integrity: sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -2015,8 +2061,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.17.19: - resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==} + /@esbuild/linux-loong64@0.19.5: + resolution: {integrity: sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -2024,8 +2070,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.17.19: - resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} + /@esbuild/linux-mips64el@0.19.5: + resolution: {integrity: sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -2033,8 +2079,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.17.19: - resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} + /@esbuild/linux-ppc64@0.19.5: + resolution: {integrity: sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -2042,8 +2088,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.17.19: - resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} + /@esbuild/linux-riscv64@0.19.5: + resolution: {integrity: sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -2051,8 +2097,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.17.19: - resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} + /@esbuild/linux-s390x@0.19.5: + resolution: {integrity: sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -2060,8 +2106,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.17.19: - resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} + /@esbuild/linux-x64@0.19.5: + resolution: {integrity: sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -2069,8 +2115,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.17.19: - resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} + /@esbuild/netbsd-x64@0.19.5: + resolution: {integrity: sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -2078,8 +2124,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.17.19: - resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} + /@esbuild/openbsd-x64@0.19.5: + resolution: {integrity: sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -2087,8 +2133,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.17.19: - resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} + /@esbuild/sunos-x64@0.19.5: + resolution: {integrity: sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -2096,8 +2142,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.17.19: - resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} + /@esbuild/win32-arm64@0.19.5: + resolution: {integrity: sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -2105,8 +2151,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.17.19: - resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} + /@esbuild/win32-ia32@0.19.5: + resolution: {integrity: sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -2114,8 +2160,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.17.19: - resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} + /@esbuild/win32-x64@0.19.5: + resolution: {integrity: sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -2123,26 +2169,26 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.41.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.52.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.41.0 - eslint-visitor-keys: 3.4.1 + eslint: 8.52.0 + eslint-visitor-keys: 3.4.3 - /@eslint-community/regexpp@4.5.1: - resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==} + /@eslint-community/regexpp@4.9.1: + resolution: {integrity: sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - /@eslint/eslintrc@2.0.3: - resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==} + /@eslint/eslintrc@2.1.2: + resolution: {integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 debug: 4.3.4 - espree: 9.5.2 + espree: 9.6.1 globals: 13.20.0 ignore: 5.2.4 import-fresh: 3.3.0 @@ -2152,15 +2198,15 @@ packages: transitivePeerDependencies: - supports-color - /@eslint/js@8.41.0: - resolution: {integrity: sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA==} + /@eslint/js@8.52.0: + resolution: {integrity: sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - /@humanwhocodes/config-array@0.11.8: - resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} + /@humanwhocodes/config-array@0.11.13: + resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==} engines: {node: '>=10.10.0'} dependencies: - '@humanwhocodes/object-schema': 1.2.1 + '@humanwhocodes/object-schema': 2.0.1 debug: 4.3.4 minimatch: 3.1.2 transitivePeerDependencies: @@ -2170,8 +2216,8 @@ packages: resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - /@humanwhocodes/object-schema@1.2.1: - resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} + /@humanwhocodes/object-schema@2.0.1: + resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} /@isaacs/cliui@8.0.2: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} @@ -2190,18 +2236,20 @@ packages: engines: {node: '>=8'} dev: true + /@jest/schemas@29.6.3: + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.27.8 + dev: true + /@jridgewell/gen-mapping@0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} dependencies: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.18 - dev: true - - /@jridgewell/resolve-uri@3.1.0: - resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} - engines: {node: '>=6.0.0'} + '@jridgewell/trace-mapping': 0.3.20 dev: true /@jridgewell/resolve-uri@3.1.1: @@ -2214,25 +2262,21 @@ packages: engines: {node: '>=6.0.0'} dev: true - /@jridgewell/source-map@0.3.3: - resolution: {integrity: sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==} + /@jridgewell/source-map@0.3.5: + resolution: {integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==} dependencies: '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 - dev: true - - /@jridgewell/sourcemap-codec@1.4.14: - resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + '@jridgewell/trace-mapping': 0.3.20 dev: true /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} - /@jridgewell/trace-mapping@0.3.18: - resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} + /@jridgewell/trace-mapping@0.3.20: + resolution: {integrity: sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==} dependencies: - '@jridgewell/resolve-uri': 3.1.0 - '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 dev: true /@jridgewell/trace-mapping@0.3.9: @@ -2262,30 +2306,30 @@ packages: read-yaml-file: 1.1.0 dev: true - /@microsoft/api-extractor-model@7.27.0: - resolution: {integrity: sha512-wHqIMiwSARmiuVLn/zmVpiRncq6hvBfC5GF+sjrN3w4FqVkqFYk7DetvfRNdy/3URdqqmYGrhJlcU9HpLnHOPg==} + /@microsoft/api-extractor-model@7.28.2(@types/node@18.18.7): + resolution: {integrity: sha512-vkojrM2fo3q4n4oPh4uUZdjJ2DxQ2+RnDQL/xhTWSRUNPF6P4QyrvY357HBxbnltKcYu+nNNolVqc6TIGQ73Ig==} dependencies: '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.1 + '@rushstack/node-core-library': 3.61.0(@types/node@18.18.7) transitivePeerDependencies: - '@types/node' dev: true - /@microsoft/api-extractor@7.35.0: - resolution: {integrity: sha512-yBGfPJeEtzk8sg2hE2/vOPRvnJBvstbWNGeyGV1jIEUSgytzQ0QPgPEkOsP2n7nBfnyRXmZaBa2vJPGOzVWy+g==} + /@microsoft/api-extractor@7.38.0(@types/node@18.18.7): + resolution: {integrity: sha512-e1LhZYnfw+JEebuY2bzhw0imDCl1nwjSThTrQqBXl40hrVo6xm3j/1EpUr89QyzgjqmAwek2ZkIVZbrhaR+cqg==} hasBin: true dependencies: - '@microsoft/api-extractor-model': 7.27.0 + '@microsoft/api-extractor-model': 7.28.2(@types/node@18.18.7) '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.1 - '@rushstack/rig-package': 0.3.19 - '@rushstack/ts-command-line': 4.13.3 + '@rushstack/node-core-library': 3.61.0(@types/node@18.18.7) + '@rushstack/rig-package': 0.5.1 + '@rushstack/ts-command-line': 4.16.1 colors: 1.2.5 lodash: 4.17.21 - resolve: 1.22.2 - semver: 7.3.8 + resolve: 1.22.8 + semver: 7.5.4 source-map: 0.6.1 typescript: 5.0.4 transitivePeerDependencies: @@ -2330,11 +2374,23 @@ packages: dev: true optional: true + /@pkgr/utils@2.4.2: + resolution: {integrity: sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + dependencies: + cross-spawn: 7.0.3 + fast-glob: 3.3.1 + is-glob: 4.0.3 + open: 9.1.0 + picocolors: 1.0.0 + tslib: 2.6.2 + dev: false + /@polka/url@1.0.0-next.21: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} dev: true - /@rollup/plugin-babel@5.3.1(@babel/core@7.22.1)(rollup@2.79.1): + /@rollup/plugin-babel@5.3.1(@babel/core@7.23.5)(rollup@2.79.1): resolution: {integrity: sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==} engines: {node: '>= 10.0.0'} peerDependencies: @@ -2345,8 +2401,8 @@ packages: '@types/babel__core': optional: true dependencies: - '@babel/core': 7.22.1 - '@babel/helper-module-imports': 7.21.4 + '@babel/core': 7.23.5 + '@babel/helper-module-imports': 7.22.15 '@rollup/pluginutils': 3.1.0(rollup@2.79.1) rollup: 2.79.1 dev: true @@ -2362,7 +2418,7 @@ packages: builtin-modules: 3.3.0 deepmerge: 4.3.1 is-module: 1.0.0 - resolve: 1.22.2 + resolve: 1.22.8 rollup: 2.79.1 dev: true @@ -2388,11 +2444,11 @@ packages: rollup: 2.79.1 dev: true - /@rollup/pluginutils@5.0.2: - resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} + /@rollup/pluginutils@5.0.5: + resolution: {integrity: sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==} engines: {node: '>=14.0.0'} peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0 + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 peerDependenciesMeta: rollup: optional: true @@ -2402,32 +2458,129 @@ packages: picomatch: 2.3.1 dev: true - /@rushstack/node-core-library@3.59.1: - resolution: {integrity: sha512-iy/xaEhXGpX+DY1ZzAtNA+QPw+9+TJh773Im+JxG4R1fu00/vWq470UOEj6upxlUxmp0JxhnmNRxzfptHrn/Uw==} + /@rollup/rollup-android-arm-eabi@4.5.0: + resolution: {integrity: sha512-OINaBGY+Wc++U0rdr7BLuFClxcoWaVW3vQYqmQq6B3bqQ/2olkaoz+K8+af/Mmka/C2yN5j+L9scBkv4BtKsDA==} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-android-arm64@4.5.0: + resolution: {integrity: sha512-UdMf1pOQc4ZmUA/NTmKhgJTBimbSKnhPS2zJqucqFyBRFPnPDtwA8MzrGNTjDeQbIAWfpJVAlxejw+/lQyBK/w==} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-arm64@4.5.0: + resolution: {integrity: sha512-L0/CA5p/idVKI+c9PcAPGorH6CwXn6+J0Ys7Gg1axCbTPgI8MeMlhA6fLM9fK+ssFhqogMHFC8HDvZuetOii7w==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-x64@4.5.0: + resolution: {integrity: sha512-QZCbVqU26mNlLn8zi/XDDquNmvcr4ON5FYAHQQsyhrHx8q+sQi/6xduoznYXwk/KmKIXG5dLfR0CvY+NAWpFYQ==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm-gnueabihf@4.5.0: + resolution: {integrity: sha512-VpSQ+xm93AeV33QbYslgf44wc5eJGYfYitlQzAi3OObu9iwrGXEnmu5S3ilkqE3Pr/FkgOiJKV/2p0ewf4Hrtg==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-gnu@4.5.0: + resolution: {integrity: sha512-OrEyIfpxSsMal44JpEVx9AEcGpdBQG1ZuWISAanaQTSMeStBW+oHWwOkoqR54bw3x8heP8gBOyoJiGg+fLY8qQ==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-musl@4.5.0: + resolution: {integrity: sha512-1H7wBbQuE6igQdxMSTjtFfD+DGAudcYWhp106z/9zBA8OQhsJRnemO4XGavdzHpGhRtRxbgmUGdO3YQgrWf2RA==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-gnu@4.5.0: + resolution: {integrity: sha512-FVyFI13tXw5aE65sZdBpNjPVIi4Q5mARnL/39UIkxvSgRAIqCo5sCpCELk0JtXHGee2owZz5aNLbWNfBHzr71Q==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-musl@4.5.0: + resolution: {integrity: sha512-eBPYl2sLpH/o8qbSz6vPwWlDyThnQjJfcDOGFbNjmjb44XKC1F5dQfakOsADRVrXCNzM6ZsSIPDG5dc6HHLNFg==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-arm64-msvc@4.5.0: + resolution: {integrity: sha512-xaOHIfLOZypoQ5U2I6rEaugS4IYtTgP030xzvrBf5js7p9WI9wik07iHmsKaej8Z83ZDxN5GyypfoyKV5O5TJA==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-ia32-msvc@4.5.0: + resolution: {integrity: sha512-Al6quztQUrHwcOoU2TuFblUQ5L+/AmPBXFR6dUvyo4nRj2yQRK0WIUaGMF/uwKulvRcXkpHe3k9A8Vf93VDktA==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-x64-msvc@4.5.0: + resolution: {integrity: sha512-8kdW+brNhI/NzJ4fxDufuJUjepzINqJKLGHuxyAtpPG9bMbn8P5mtaCcbOm0EzLJ+atg+kF9dwg8jpclkVqx5w==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rushstack/node-core-library@3.61.0(@types/node@18.18.7): + resolution: {integrity: sha512-tdOjdErme+/YOu4gPed3sFS72GhtWCgNV9oDsHDnoLY5oDfwjKUc9Z+JOZZ37uAxcm/OCahDHfuu2ugqrfWAVQ==} peerDependencies: '@types/node': '*' peerDependenciesMeta: '@types/node': optional: true dependencies: + '@types/node': 18.18.7 colors: 1.2.5 fs-extra: 7.0.1 import-lazy: 4.0.0 jju: 1.4.0 - resolve: 1.22.2 - semver: 7.3.8 + resolve: 1.22.8 + semver: 7.5.4 z-schema: 5.0.5 dev: true - /@rushstack/rig-package@0.3.19: - resolution: {integrity: sha512-2d0/Gn+qjOYneZbiHjn4SjyDwq9I0WagV37z0F1V71G+yONgH7wlt3K/UoNiDkhA8gTHYPRo2jz3CvttybwSag==} + /@rushstack/rig-package@0.5.1: + resolution: {integrity: sha512-pXRYSe29TjRw7rqxD4WS3HN/sRSbfr+tJs4a9uuaSIBAITbUggygdhuG0VrO0EO+QqH91GhYMN4S6KRtOEmGVA==} dependencies: - resolve: 1.22.2 + resolve: 1.22.8 strip-json-comments: 3.1.1 dev: true - /@rushstack/ts-command-line@4.13.3: - resolution: {integrity: sha512-6aQIv/o1EgsC/+SpgUyRmzg2QIAL6sudEzw3sWzJKwWuQTc5XRsyZpyldfE7WAmIqMXDao9QG35/NYORjHm5Zw==} + /@rushstack/ts-command-line@4.16.1: + resolution: {integrity: sha512-+OCsD553GYVLEmz12yiFjMOzuPeCiZ3f8wTiFHL30ZVXexTyPmgjwXEhg2K2P0a2lVf+8YBy7WtPoflB2Fp8/A==} dependencies: '@types/argparse': 1.0.38 argparse: 1.0.10 @@ -2435,22 +2588,17 @@ packages: string-argv: 0.3.2 dev: true + /@sinclair/typebox@0.27.8: + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + dev: true + /@surma/rollup-plugin-off-main-thread@2.2.3: resolution: {integrity: sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ==} dependencies: ejs: 3.1.9 json5: 2.2.3 magic-string: 0.25.9 - string.prototype.matchall: 4.0.8 - dev: true - - /@ts-morph/common@0.19.0: - resolution: {integrity: sha512-Unz/WHmd4pGax91rdIKWi51wnVUW11QttMEPpBiBgIewnc9UQIX7UDLxr5vRlqeByXCwhkF6VabSsI0raWcyAQ==} - dependencies: - fast-glob: 3.2.12 - minimatch: 7.4.6 - mkdirp: 2.1.6 - path-browserify: 1.0.1 + string.prototype.matchall: 4.0.10 dev: true /@tsconfig/node10@1.0.9: @@ -2473,16 +2621,6 @@ packages: resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} dev: true - /@types/chai-subset@1.3.3: - resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} - dependencies: - '@types/chai': 4.3.5 - dev: true - - /@types/chai@4.3.5: - resolution: {integrity: sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==} - dev: true - /@types/estree@0.0.39: resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} dev: true @@ -2491,26 +2629,53 @@ packages: resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==} dev: true + /@types/hast@3.0.3: + resolution: {integrity: sha512-2fYGlaDy/qyLlhidX42wAH0KBi2TCjKMH8CHmBXgRlJ3Y+OXTiqsPQ6IWarZKwF1JoUcAJdPogv1d4b0COTpmQ==} + dependencies: + '@types/unist': 3.0.2 + dev: true + /@types/is-ci@3.0.0: resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} dependencies: ci-info: 3.8.0 dev: true - /@types/istanbul-lib-coverage@2.0.4: - resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} + /@types/istanbul-lib-coverage@2.0.5: + resolution: {integrity: sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ==} dev: true /@types/json-schema@7.0.12: resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} dev: false + /@types/linkify-it@3.0.4: + resolution: {integrity: sha512-hPpIeeHb/2UuCw06kSNAOVWgehBLXEo0/fUs0mw3W2qhqX89PI2yvok83MnuctYGCPrabGIoi0fFso4DQ+sNUQ==} + dev: true + + /@types/markdown-it@13.0.7: + resolution: {integrity: sha512-U/CBi2YUUcTHBt5tjO2r5QV/x0Po6nsYwQU4Y04fBS6vfoImaiZ6f8bi3CjTCxBPQSO1LMyUqkByzi8AidyxfA==} + dependencies: + '@types/linkify-it': 3.0.4 + '@types/mdurl': 1.0.4 + dev: true + /@types/mdast@3.0.10: resolution: {integrity: sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA==} dependencies: '@types/unist': 2.0.6 dev: false + /@types/mdast@4.0.3: + resolution: {integrity: sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==} + dependencies: + '@types/unist': 3.0.2 + dev: true + + /@types/mdurl@1.0.4: + resolution: {integrity: sha512-ARVxjAEX5TARFRzpDRVC6cEk0hUIXCCwaMhz8y7S1/PxU6zZS1UMjyobz7q4w/D/R552r4++EhwmXK1N2rAy0A==} + dev: true + /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true @@ -2523,16 +2688,10 @@ packages: resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} dev: true - /@types/node@18.13.0: - resolution: {integrity: sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==} - dev: true - - /@types/node@18.15.11: - resolution: {integrity: sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==} - - /@types/node@20.2.5: - resolution: {integrity: sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==} - dev: true + /@types/node@18.18.7: + resolution: {integrity: sha512-bw+lEsxis6eqJYW8Ql6+yTqkE6RuFtsQPSe5JxXbqYRFQEER5aJA9a5UH9igqDWm3X4iLHIKOHlnAXLM4mi7uQ==} + dependencies: + undici-types: 5.26.5 /@types/normalize-package-data@2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} @@ -2541,22 +2700,17 @@ packages: /@types/resolve@1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 18.15.11 + '@types/node': 18.18.7 dev: true /@types/sax@1.2.4: resolution: {integrity: sha512-pSAff4IAxJjfAXUG6tFkO7dsSbTmf8CtUpfhhZ5VhkRpC4628tJhh3+V6H1E+/Gs9piSzYKT5yzHO5M4GG9jkw==} dependencies: - '@types/node': 18.15.11 - dev: true - - /@types/semver@6.2.3: - resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} + '@types/node': 18.18.7 dev: true /@types/semver@7.5.0: resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} - dev: false /@types/trusted-types@2.0.3: resolution: {integrity: sha512-NfQ4gyz38SL8sDNrSixxU2Os1a5xcdFxipAFxYEuLUlvU2uDwS4NUpsImcf1//SlWItCVMMLiylsxbmNMToV/g==} @@ -2566,317 +2720,461 @@ packages: resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==} dev: false - /@types/web-bluetooth@0.0.17: - resolution: {integrity: sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==} + /@types/unist@3.0.2: + resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==} dev: true - /@typescript-eslint/eslint-plugin@5.59.7(@typescript-eslint/parser@5.59.7)(eslint@8.41.0)(typescript@5.0.4): - resolution: {integrity: sha512-BL+jYxUFIbuYwy+4fF86k5vdT9lT0CNJ6HtwrIvGh0PhH8s0yy5rjaKH2fDCrz5ITHy07WCzVGNvAmjJh4IJFA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@types/web-bluetooth@0.0.20: + resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} + dev: true + + /@typescript-eslint/eslint-plugin@6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-lgX7F0azQwRPB7t7WAyeHWVfW1YJ9NIgd9mvGhfQpRY56X6AVf8mwM8Wol+0z4liE7XX3QOt8MN1rUKCfSjRIA==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.59.7(eslint@8.41.0)(typescript@5.0.4) - '@typescript-eslint/scope-manager': 5.59.7 - '@typescript-eslint/type-utils': 5.59.7(eslint@8.41.0)(typescript@5.0.4) - '@typescript-eslint/utils': 5.59.7(eslint@8.41.0)(typescript@5.0.4) + '@eslint-community/regexpp': 4.9.1 + '@typescript-eslint/parser': 6.9.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/scope-manager': 6.9.0 + '@typescript-eslint/type-utils': 6.9.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.9.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.9.0 debug: 4.3.4 - eslint: 8.41.0 - grapheme-splitter: 1.0.4 + eslint: 8.52.0 + graphemer: 1.4.0 ignore: 5.2.4 - natural-compare-lite: 1.4.0 - semver: 7.5.1 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 + natural-compare: 1.4.0 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/parser@5.59.7(eslint@8.41.0)(typescript@5.0.4): - resolution: {integrity: sha512-VhpsIEuq/8i5SF+mPg9jSdIwgMBBp0z9XqjiEay+81PYLJuroN+ET1hM5IhkiYMJd9MkTz8iJLt7aaGAgzWUbQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/parser@6.9.0(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-GZmjMh4AJ/5gaH4XF2eXA8tMnHWP+Pm1mjQR2QN4Iz+j/zO04b9TOvJYOX2sCNIQHtRStKTxRY1FX7LhpJT4Gw==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.59.7 - '@typescript-eslint/types': 5.59.7 - '@typescript-eslint/typescript-estree': 5.59.7(typescript@5.0.4) + '@typescript-eslint/scope-manager': 6.9.0 + '@typescript-eslint/types': 6.9.0 + '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.9.0 debug: 4.3.4 - eslint: 8.41.0 - typescript: 5.0.4 + eslint: 8.52.0 + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/scope-manager@5.59.7: - resolution: {integrity: sha512-FL6hkYWK9zBGdxT2wWEd2W8ocXMu3K94i3gvMrjXpx+koFYdYV7KprKfirpgY34vTGzEPPuKoERpP8kD5h7vZQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/scope-manager@6.9.0: + resolution: {integrity: sha512-1R8A9Mc39n4pCCz9o79qRO31HGNDvC7UhPhv26TovDsWPBDx+Sg3rOZdCELIA3ZmNoWAuxaMOT7aWtGRSYkQxw==} + engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 5.59.7 - '@typescript-eslint/visitor-keys': 5.59.7 + '@typescript-eslint/types': 6.9.0 + '@typescript-eslint/visitor-keys': 6.9.0 dev: false - /@typescript-eslint/type-utils@5.59.7(eslint@8.41.0)(typescript@5.0.4): - resolution: {integrity: sha512-ozuz/GILuYG7osdY5O5yg0QxXUAEoI4Go3Do5xeu+ERH9PorHBPSdvD3Tjp2NN2bNLh1NJQSsQu2TPu/Ly+HaQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/type-utils@6.9.0(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-XXeahmfbpuhVbhSOROIzJ+b13krFmgtc4GlEuu1WBT+RpyGPIA4Y/eGnXzjbDj5gZLzpAXO/sj+IF/x2GtTMjQ==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: '*' + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.59.7(typescript@5.0.4) - '@typescript-eslint/utils': 5.59.7(eslint@8.41.0)(typescript@5.0.4) + '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.2.2) + '@typescript-eslint/utils': 6.9.0(eslint@8.52.0)(typescript@5.2.2) debug: 4.3.4 - eslint: 8.41.0 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 + eslint: 8.52.0 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/types@5.59.7: - resolution: {integrity: sha512-UnVS2MRRg6p7xOSATscWkKjlf/NDKuqo5TdbWck6rIRZbmKpVNTLALzNvcjIfHBE7736kZOFc/4Z3VcZwuOM/A==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/types@6.9.0: + resolution: {integrity: sha512-+KB0lbkpxBkBSiVCuQvduqMJy+I1FyDbdwSpM3IoBS7APl4Bu15lStPjgBIdykdRqQNYqYNMa8Kuidax6phaEw==} + engines: {node: ^16.0.0 || >=18.0.0} dev: false - /@typescript-eslint/typescript-estree@5.59.7(typescript@5.0.4): - resolution: {integrity: sha512-4A1NtZ1I3wMN2UGDkU9HMBL+TIQfbrh4uS0WDMMpf3xMRursDbqEf1ahh6vAAe3mObt8k3ZATnezwG4pdtWuUQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/typescript-estree@6.9.0(typescript@5.2.2): + resolution: {integrity: sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.59.7 - '@typescript-eslint/visitor-keys': 5.59.7 + '@typescript-eslint/types': 6.9.0 + '@typescript-eslint/visitor-keys': 6.9.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.1 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/utils@5.59.7(eslint@8.41.0)(typescript@5.0.4): - resolution: {integrity: sha512-yCX9WpdQKaLufz5luG4aJbOpdXf/fjwGMcLFXZVPUz3QqLirG5QcwwnIHNf8cjLjxK4qtzTO8udUtMQSAToQnQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/utils@6.9.0(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-5Wf+Jsqya7WcCO8me504FBigeQKVLAMPmUzYgDbWchINNh1KJbxCgVya3EQ2MjvJMVeXl3pofRmprqX6mfQkjQ==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.41.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) '@types/json-schema': 7.0.12 '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 5.59.7 - '@typescript-eslint/types': 5.59.7 - '@typescript-eslint/typescript-estree': 5.59.7(typescript@5.0.4) - eslint: 8.41.0 - eslint-scope: 5.1.1 - semver: 7.5.1 + '@typescript-eslint/scope-manager': 6.9.0 + '@typescript-eslint/types': 6.9.0 + '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.2.2) + eslint: 8.52.0 + semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript dev: false - /@typescript-eslint/visitor-keys@5.59.7: - resolution: {integrity: sha512-tyN+X2jvMslUszIiYbF0ZleP+RqQsFVpGrKI6e0Eet1w8WmhsAtmzaqm8oM8WJQ1ysLwhnsK/4hYHJjOgJVfQQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/visitor-keys@6.9.0: + resolution: {integrity: sha512-dGtAfqjV6RFOtIP8I0B4ZTBRrlTT8NHHlZZSchQx3qReaoDeXhYM++M4So2AgFK9ZB0emRPA6JI1HkafzA2Ibg==} + engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 5.59.7 - eslint-visitor-keys: 3.4.1 + '@typescript-eslint/types': 6.9.0 + eslint-visitor-keys: 3.4.3 dev: false - /@vite-pwa/vitepress@0.0.5(vite-plugin-pwa@0.15.1): - resolution: {integrity: sha512-B6xy9wxi9fen+/AnRkY2+XCrbhqh2b/TsVTka6qFQ3zJ8zHSoEUHUucYT3KHMcY5I124G0ZmPKNW+UF9Jx1k4w==} + /@ungap/structured-clone@1.2.0: + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + + /@vite-pwa/vitepress@0.3.1(vite-plugin-pwa@0.17.3): + resolution: {integrity: sha512-krgiYQCWXUkpQCx+IHdsanFFpAzfH5pY86MARDa6as5ZNmG18mb/gC6MEahFV67V0xfMfTaNL4B8dQNzzcikLw==} peerDependencies: - vite-plugin-pwa: ^0.14.0 + vite-plugin-pwa: '>=0.17.2 <1' dependencies: - vite-plugin-pwa: 0.15.1(workbox-window@6.6.0) + vite-plugin-pwa: 0.17.3(vite@5.0.5)(workbox-build@7.0.0)(workbox-window@7.0.0) dev: true - /@vitejs/plugin-vue@4.2.3(vite@4.3.9)(vue@3.3.4): - resolution: {integrity: sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==} + /@vitejs/plugin-vue@4.5.1(vite@5.0.5)(vue@3.3.10): + resolution: {integrity: sha512-DaUzYFr+2UGDG7VSSdShKa9sIWYBa1LL8KC0MNOf2H5LjcTPjob0x8LbkqXWmAtbANJCkpiQTj66UVcQkN2s3g==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - vite: ^4.0.0 + vite: ^4.0.0 || ^5.0.0 vue: ^3.2.25 dependencies: - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) - vue: 3.3.4 + vite: 5.0.5(@types/node@18.18.7)(sass@1.69.4) + vue: 3.3.10(typescript@5.2.2) dev: true - /@vitest/coverage-c8@0.31.1(vitest@0.31.1): - resolution: {integrity: sha512-6TkjQpmgYez7e3dbAUoYdRXxWN81BojCmUILJwgCy39uZFG33DsQ0rSRSZC9beAEdCZTpxR63nOvd9hxDQcJ0g==} + /@vitest/coverage-v8@1.0.1(vitest@1.0.1): + resolution: {integrity: sha512-Z4a7ig4VjUCT/P+LRB3IZrBRXb9xWRUM8rSBH9cKgfrU1Oe01/K2WJKtGshOnQwXZoSfQtwCGpbnHmB/qJwjcw==} peerDependencies: - vitest: '>=0.30.0 <1' + vitest: ^1.0.0 dependencies: '@ampproject/remapping': 2.2.1 - c8: 7.13.0 - magic-string: 0.30.0 + '@bcoe/v8-coverage': 0.2.3 + debug: 4.3.4 + istanbul-lib-coverage: 3.2.2 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.1.6 + magic-string: 0.30.5 + magicast: 0.3.2 picocolors: 1.0.0 - std-env: 3.3.3 - vitest: 0.31.1(@vitest/ui@0.31.1) + std-env: 3.5.0 + test-exclude: 6.0.0 + v8-to-istanbul: 9.2.0 + vitest: 1.0.1(@types/node@18.18.7)(@vitest/ui@1.0.1) + transitivePeerDependencies: + - supports-color dev: true - /@vitest/expect@0.31.1: - resolution: {integrity: sha512-BV1LyNvhnX+eNYzJxlHIGPWZpwJFZaCcOIzp2CNG0P+bbetenTupk6EO0LANm4QFt0TTit+yqx7Rxd1qxi/SQA==} + /@vitest/expect@1.0.1: + resolution: {integrity: sha512-3cdrb/eKD/0tygDX75YscuHEHMUJ70u3UoLSq2eqhWks57AyzvsDQbyn53IhZ0tBN7gA8Jj2VhXiOV2lef7thw==} dependencies: - '@vitest/spy': 0.31.1 - '@vitest/utils': 0.31.1 - chai: 4.3.7 + '@vitest/spy': 1.0.1 + '@vitest/utils': 1.0.1 + chai: 4.3.10 dev: true - /@vitest/runner@0.31.1: - resolution: {integrity: sha512-imWuc82ngOtxdCUpXwtEzZIuc1KMr+VlQ3Ondph45VhWoQWit5yvG/fFcldbnCi8DUuFi+NmNx5ehMUw/cGLUw==} + /@vitest/runner@1.0.1: + resolution: {integrity: sha512-/+z0vhJ0MfRPT3AyTvAK6m57rzlew/ct8B2a4LMv7NhpPaiI2QLGyOBMB3lcioWdJHjRuLi9aYppfOv0B5aRQA==} dependencies: - '@vitest/utils': 0.31.1 - concordance: 5.0.4 - p-limit: 4.0.0 - pathe: 1.1.0 + '@vitest/utils': 1.0.1 + p-limit: 5.0.0 + pathe: 1.1.1 dev: true - /@vitest/snapshot@0.31.1: - resolution: {integrity: sha512-L3w5uU9bMe6asrNzJ8WZzN+jUTX4KSgCinEJPXyny0o90fG4FPQMV0OWsq7vrCWfQlAilMjDnOF9nP8lidsJ+g==} + /@vitest/snapshot@1.0.1: + resolution: {integrity: sha512-wIPtPDGSxEZ+DpNMc94AsybX6LV6uN6sosf5TojyP1m2QbKwiRuLV/5RSsjt1oWViHsTj8mlcwrQQ1zHGO0fMw==} dependencies: - magic-string: 0.30.0 - pathe: 1.1.0 - pretty-format: 27.5.1 + magic-string: 0.30.5 + pathe: 1.1.1 + pretty-format: 29.7.0 dev: true - /@vitest/spy@0.31.1: - resolution: {integrity: sha512-1cTpt2m9mdo3hRLDyCG2hDQvRrePTDgEJBFQQNz1ydHHZy03EiA6EpFxY+7ODaY7vMRCie+WlFZBZ0/dQWyssQ==} + /@vitest/spy@1.0.1: + resolution: {integrity: sha512-yXwm1uKhBVr/5MhVeSmtNqK+0q2RXIchJt8kokEKdrWLtkPeDgdbZ6SjR1VQGZuNdWL6sSBnLayIyVvcS0qLfA==} dependencies: - tinyspy: 2.1.0 + tinyspy: 2.2.0 dev: true - /@vitest/ui@0.31.1(vitest@0.31.1): - resolution: {integrity: sha512-+JJ2+rvRPAVxFLNE+WJOMzOjxqYPn7V2hl00uNwid6kquD+UHTa716Z7szfNeZMLnHOHv+fxq1UgLCymvVpE5w==} + /@vitest/ui@1.0.1(vitest@1.0.1): + resolution: {integrity: sha512-3hFMgy/RExKi7UlYEqqnZ65QALdkgXyW1k7Zn7PykVmVBcKe/aI4ZpZ006WeTWvnUWeR+37lbpUD0JhnmKn72A==} peerDependencies: - vitest: '>=0.30.1 <1' + vitest: ^1.0.0 dependencies: - '@vitest/utils': 0.31.1 - fast-glob: 3.2.12 - fflate: 0.7.4 - flatted: 3.2.7 - pathe: 1.1.0 + '@vitest/utils': 1.0.1 + fast-glob: 3.3.2 + fflate: 0.8.1 + flatted: 3.2.9 + pathe: 1.1.1 picocolors: 1.0.0 sirv: 2.0.3 - vitest: 0.31.1(@vitest/ui@0.31.1) + vitest: 1.0.1(@types/node@18.18.7)(@vitest/ui@1.0.1) dev: true - /@vitest/utils@0.31.1: - resolution: {integrity: sha512-yFyRD5ilwojsZfo3E0BnH72pSVSuLg2356cN1tCEe/0RtDzxTPYwOomIC+eQbot7m6DRy4tPZw+09mB7NkbMmA==} + /@vitest/utils@1.0.1: + resolution: {integrity: sha512-MGPCHkzXbbAyscrhwGzh8uP1HPrTYLWaj1WTDtWSGrpe2yJWLRN9mF9ooKawr6NMOg9vTBtg2JqWLfuLC7Dknw==} dependencies: - concordance: 5.0.4 - loupe: 2.3.6 - pretty-format: 27.5.1 + diff-sequences: 29.6.3 + loupe: 2.3.7 + pretty-format: 29.7.0 dev: true - /@vue/compiler-core@3.3.4: - resolution: {integrity: sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==} + /@volar/language-core@1.10.5: + resolution: {integrity: sha512-xD71j4Ee0Ycq8WsiAE6H/aCThGdTobiZZeD+jFD+bvmbopa1Az296pqJysr3Ck8c7n5+GGF+xlKCS3WxRFYgSQ==} dependencies: - '@babel/parser': 7.22.0 - '@vue/shared': 3.3.4 + '@volar/source-map': 1.10.5 + dev: true + + /@volar/source-map@1.10.5: + resolution: {integrity: sha512-s4kgo66SA1kMzYvF9HFE6Vc1rxtXLUmcLrT2WKnchPDvLne+97Kw+xoR2NxJFmsvHoL18vmu/YGXYcN+Q5re1g==} + dependencies: + muggle-string: 0.3.1 + dev: true + + /@volar/typescript@1.10.5: + resolution: {integrity: sha512-kfDehpeLJku9i1BgsFOYIczPmFFH4herl+GZrLGdvX5urTqeCKsKYlF36iNmFaADzjMb9WlENcUZzPjK8MxNrQ==} + dependencies: + '@volar/language-core': 1.10.5 + dev: true + + /@vue/compiler-core@3.3.10: + resolution: {integrity: sha512-doe0hODR1+i1menPkRzJ5MNR6G+9uiZHIknK3Zn5OcIztu6GGw7u0XUzf3AgB8h/dfsZC9eouzoLo3c3+N/cVA==} + dependencies: + '@babel/parser': 7.23.5 + '@vue/shared': 3.3.10 + estree-walker: 2.0.2 + source-map-js: 1.0.2 + dev: true + + /@vue/compiler-core@3.3.7: + resolution: {integrity: sha512-pACdY6YnTNVLXsB86YD8OF9ihwpolzhhtdLVHhBL6do/ykr6kKXNYABRtNMGrsQXpEXXyAdwvWWkuTbs4MFtPQ==} + dependencies: + '@babel/parser': 7.23.0 + '@vue/shared': 3.3.7 estree-walker: 2.0.2 source-map-js: 1.0.2 - /@vue/compiler-dom@3.3.4: - resolution: {integrity: sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==} + /@vue/compiler-dom@3.3.10: + resolution: {integrity: sha512-NCrqF5fm10GXZIK0GrEAauBqdy+F2LZRt3yNHzrYjpYBuRssQbuPLtSnSNjyR9luHKkWSH8we5LMB3g+4z2HvA==} dependencies: - '@vue/compiler-core': 3.3.4 - '@vue/shared': 3.3.4 + '@vue/compiler-core': 3.3.10 + '@vue/shared': 3.3.10 + dev: true - /@vue/compiler-sfc@3.3.4: - resolution: {integrity: sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==} + /@vue/compiler-dom@3.3.7: + resolution: {integrity: sha512-0LwkyJjnUPssXv/d1vNJ0PKfBlDoQs7n81CbO6Q0zdL7H1EzqYRrTVXDqdBVqro0aJjo/FOa1qBAPVI4PGSHBw==} dependencies: - '@babel/parser': 7.22.0 - '@vue/compiler-core': 3.3.4 - '@vue/compiler-dom': 3.3.4 - '@vue/compiler-ssr': 3.3.4 - '@vue/reactivity-transform': 3.3.4 - '@vue/shared': 3.3.4 + '@vue/compiler-core': 3.3.7 + '@vue/shared': 3.3.7 + + /@vue/compiler-sfc@3.3.10: + resolution: {integrity: sha512-xpcTe7Rw7QefOTRFFTlcfzozccvjM40dT45JtrE3onGm/jBLZ0JhpKu3jkV7rbDFLeeagR/5RlJ2Y9SvyS0lAg==} + dependencies: + '@babel/parser': 7.23.5 + '@vue/compiler-core': 3.3.10 + '@vue/compiler-dom': 3.3.10 + '@vue/compiler-ssr': 3.3.10 + '@vue/reactivity-transform': 3.3.10 + '@vue/shared': 3.3.10 + estree-walker: 2.0.2 + magic-string: 0.30.5 + postcss: 8.4.32 + source-map-js: 1.0.2 + dev: true + + /@vue/compiler-sfc@3.3.7: + resolution: {integrity: sha512-7pfldWy/J75U/ZyYIXRVqvLRw3vmfxDo2YLMwVtWVNew8Sm8d6wodM+OYFq4ll/UxfqVr0XKiVwti32PCrruAw==} + dependencies: + '@babel/parser': 7.23.0 + '@vue/compiler-core': 3.3.7 + '@vue/compiler-dom': 3.3.7 + '@vue/compiler-ssr': 3.3.7 + '@vue/reactivity-transform': 3.3.7 + '@vue/shared': 3.3.7 estree-walker: 2.0.2 - magic-string: 0.30.0 - postcss: 8.4.23 + magic-string: 0.30.5 + postcss: 8.4.31 source-map-js: 1.0.2 + dev: false + + /@vue/compiler-ssr@3.3.10: + resolution: {integrity: sha512-12iM4jA4GEbskwXMmPcskK5wImc2ohKm408+o9iox3tfN9qua8xL0THIZtoe9OJHnXP4eOWZpgCAAThEveNlqQ==} + dependencies: + '@vue/compiler-dom': 3.3.10 + '@vue/shared': 3.3.10 + dev: true + + /@vue/compiler-ssr@3.3.7: + resolution: {integrity: sha512-TxOfNVVeH3zgBc82kcUv+emNHo+vKnlRrkv8YvQU5+Y5LJGJwSNzcmLUoxD/dNzv0bhQ/F0s+InlgV0NrApJZg==} + dependencies: + '@vue/compiler-dom': 3.3.7 + '@vue/shared': 3.3.7 + dev: false + + /@vue/devtools-api@6.5.1: + resolution: {integrity: sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==} + dev: true - /@vue/compiler-ssr@3.3.4: - resolution: {integrity: sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==} + /@vue/language-core@1.8.21(typescript@5.2.2): + resolution: {integrity: sha512-dKQJc1xfWIZfv6BeXyxz3SSNrC7npJpDIN/VOb1rodAm4o247TElrXOHYAJdV9x1KilaEUo3YbnQE+WA3vQwMw==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true dependencies: - '@vue/compiler-dom': 3.3.4 - '@vue/shared': 3.3.4 + '@volar/language-core': 1.10.5 + '@volar/source-map': 1.10.5 + '@vue/compiler-dom': 3.3.7 + '@vue/shared': 3.3.7 + computeds: 0.0.1 + minimatch: 9.0.3 + muggle-string: 0.3.1 + typescript: 5.2.2 + vue-template-compiler: 2.7.15 + dev: true - /@vue/devtools-api@6.5.0: - resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==} + /@vue/reactivity-transform@3.3.10: + resolution: {integrity: sha512-0xBdk+CKHWT+Gev8oZ63Tc0qFfj935YZx+UAynlutnrDZ4diFCVFMWixn65HzjE3S1iJppWOo6Tt1OzASH7VEg==} + dependencies: + '@babel/parser': 7.23.5 + '@vue/compiler-core': 3.3.10 + '@vue/shared': 3.3.10 + estree-walker: 2.0.2 + magic-string: 0.30.5 dev: true - /@vue/reactivity-transform@3.3.4: - resolution: {integrity: sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==} + /@vue/reactivity-transform@3.3.7: + resolution: {integrity: sha512-APhRmLVbgE1VPGtoLQoWBJEaQk4V8JUsqrQihImVqKT+8U6Qi3t5ATcg4Y9wGAPb3kIhetpufyZ1RhwbZCIdDA==} dependencies: - '@babel/parser': 7.22.0 - '@vue/compiler-core': 3.3.4 - '@vue/shared': 3.3.4 + '@babel/parser': 7.23.0 + '@vue/compiler-core': 3.3.7 + '@vue/shared': 3.3.7 estree-walker: 2.0.2 - magic-string: 0.30.0 + magic-string: 0.30.5 + dev: false + + /@vue/reactivity@3.3.10: + resolution: {integrity: sha512-H5Z7rOY/JLO+e5a6/FEXaQ1TMuOvY4LDVgT+/+HKubEAgs9qeeZ+NhADSeEtrNQeiKLDuzeKc8v0CUFpB6Pqgw==} + dependencies: + '@vue/shared': 3.3.10 + dev: true + + /@vue/reactivity@3.3.7: + resolution: {integrity: sha512-cZNVjWiw00708WqT0zRpyAgduG79dScKEPYJXq2xj/aMtk3SKvL3FBt2QKUlh6EHBJ1m8RhBY+ikBUzwc7/khg==} + dependencies: + '@vue/shared': 3.3.7 + dev: false + + /@vue/runtime-core@3.3.10: + resolution: {integrity: sha512-DZ0v31oTN4YHX9JEU5VW1LoIVgFovWgIVb30bWn9DG9a7oA415idcwsRNNajqTx8HQJyOaWfRKoyuP2P2TYIag==} + dependencies: + '@vue/reactivity': 3.3.10 + '@vue/shared': 3.3.10 + dev: true - /@vue/reactivity@3.3.4: - resolution: {integrity: sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==} + /@vue/runtime-core@3.3.7: + resolution: {integrity: sha512-LHq9du3ubLZFdK/BP0Ysy3zhHqRfBn80Uc+T5Hz3maFJBGhci1MafccnL3rpd5/3wVfRHAe6c+PnlO2PAavPTQ==} dependencies: - '@vue/shared': 3.3.4 + '@vue/reactivity': 3.3.7 + '@vue/shared': 3.3.7 + dev: false - /@vue/runtime-core@3.3.4: - resolution: {integrity: sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==} + /@vue/runtime-dom@3.3.10: + resolution: {integrity: sha512-c/jKb3ny05KJcYk0j1m7Wbhrxq7mZYr06GhKykDMNRRR9S+/dGT8KpHuNQjv3/8U4JshfkAk6TpecPD3B21Ijw==} dependencies: - '@vue/reactivity': 3.3.4 - '@vue/shared': 3.3.4 + '@vue/runtime-core': 3.3.10 + '@vue/shared': 3.3.10 + csstype: 3.1.2 + dev: true - /@vue/runtime-dom@3.3.4: - resolution: {integrity: sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==} + /@vue/runtime-dom@3.3.7: + resolution: {integrity: sha512-PFQU1oeJxikdDmrfoNQay5nD4tcPNYixUBruZzVX/l0eyZvFKElZUjW4KctCcs52nnpMGO6UDK+jF5oV4GT5Lw==} dependencies: - '@vue/runtime-core': 3.3.4 - '@vue/shared': 3.3.4 + '@vue/runtime-core': 3.3.7 + '@vue/shared': 3.3.7 csstype: 3.1.2 + dev: false + + /@vue/server-renderer@3.3.10(vue@3.3.10): + resolution: {integrity: sha512-0i6ww3sBV3SKlF3YTjSVqKQ74xialMbjVYGy7cOTi7Imd8ediE7t72SK3qnvhrTAhOvlQhq6Bk6nFPdXxe0sAg==} + peerDependencies: + vue: 3.3.10 + dependencies: + '@vue/compiler-ssr': 3.3.10 + '@vue/shared': 3.3.10 + vue: 3.3.10(typescript@5.2.2) + dev: true - /@vue/server-renderer@3.3.4(vue@3.3.4): - resolution: {integrity: sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==} + /@vue/server-renderer@3.3.7(vue@3.3.7): + resolution: {integrity: sha512-UlpKDInd1hIZiNuVVVvLgxpfnSouxKQOSE2bOfQpBuGwxRV/JqqTCyyjXUWiwtVMyeRaZhOYYqntxElk8FhBhw==} peerDependencies: - vue: 3.3.4 + vue: 3.3.7 dependencies: - '@vue/compiler-ssr': 3.3.4 - '@vue/shared': 3.3.4 - vue: 3.3.4 + '@vue/compiler-ssr': 3.3.7 + '@vue/shared': 3.3.7 + vue: 3.3.7(typescript@5.2.2) + dev: false + + /@vue/shared@3.3.10: + resolution: {integrity: sha512-2y3Y2J1a3RhFa0WisHvACJR2ncvWiVHcP8t0Inxo+NKz+8RKO4ZV8eZgCxRgQoA6ITfV12L4E6POOL9HOU5nqw==} + dev: true - /@vue/shared@3.3.4: - resolution: {integrity: sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==} + /@vue/shared@3.3.7: + resolution: {integrity: sha512-N/tbkINRUDExgcPTBvxNkvHGu504k8lzlNQRITVnm6YjOjwa4r0nnbd4Jb01sNpur5hAllyRJzSK5PvB9PPwRg==} - /@vueuse/core@10.1.2(vue@3.3.4): - resolution: {integrity: sha512-roNn8WuerI56A5uiTyF/TEYX0Y+VKlhZAF94unUfdhbDUI+NfwQMn4FUnUscIRUhv3344qvAghopU4bzLPNFlA==} + /@vueuse/core@10.7.0(vue@3.3.10): + resolution: {integrity: sha512-4EUDESCHtwu44ZWK3Gc/hZUVhVo/ysvdtwocB5vcauSV4B7NiGY5972WnsojB3vRNdxvAt7kzJWE2h9h7C9d5w==} dependencies: - '@types/web-bluetooth': 0.0.17 - '@vueuse/metadata': 10.1.2 - '@vueuse/shared': 10.1.2(vue@3.3.4) - vue-demi: 0.14.5(vue@3.3.4) + '@types/web-bluetooth': 0.0.20 + '@vueuse/metadata': 10.7.0 + '@vueuse/shared': 10.7.0(vue@3.3.10) + vue-demi: 0.14.6(vue@3.3.10) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true - /@vueuse/integrations@10.1.2(focus-trap@7.4.3)(vue@3.3.4): - resolution: {integrity: sha512-wUpG3Wv6LiWerOwCzOAM0iGhNQ4vfFUTkhj/xQy7TLXduh2M3D8N08aS0KqlxsejY6R8NLxydDIM+68QfHZZ8Q==} + /@vueuse/integrations@10.7.0(focus-trap@7.5.4)(vue@3.3.10): + resolution: {integrity: sha512-rxiMYgS+91n93qXpHZF9NbHhppWY6IJyVTDxt4acyChL0zZVx7P8FAAfpF1qVK8e4wfjerhpEiMJ0IZ1GWUZ2A==} peerDependencies: async-validator: '*' axios: '*' @@ -2916,23 +3214,23 @@ packages: universal-cookie: optional: true dependencies: - '@vueuse/core': 10.1.2(vue@3.3.4) - '@vueuse/shared': 10.1.2(vue@3.3.4) - focus-trap: 7.4.3 - vue-demi: 0.14.5(vue@3.3.4) + '@vueuse/core': 10.7.0(vue@3.3.10) + '@vueuse/shared': 10.7.0(vue@3.3.10) + focus-trap: 7.5.4 + vue-demi: 0.14.6(vue@3.3.10) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true - /@vueuse/metadata@10.1.2: - resolution: {integrity: sha512-3mc5BqN9aU2SqBeBuWE7ne4OtXHoHKggNgxZR2K+zIW4YLsy6xoZ4/9vErQs6tvoKDX6QAqm3lvsrv0mczAwIQ==} + /@vueuse/metadata@10.7.0: + resolution: {integrity: sha512-GlaH7tKP2iBCZ3bHNZ6b0cl9g0CJK8lttkBNUX156gWvNYhTKEtbweWLm9rxCPIiwzYcr/5xML6T8ZUEt+DkvA==} dev: true - /@vueuse/shared@10.1.2(vue@3.3.4): - resolution: {integrity: sha512-1uoUTPBlgyscK9v6ScGeVYDDzlPSFXBlxuK7SfrDGyUTBiznb3mNceqhwvZHjtDRELZEN79V5uWPTF1VDV8svA==} + /@vueuse/shared@10.7.0(vue@3.3.10): + resolution: {integrity: sha512-kc00uV6CiaTdc3i1CDC4a3lBxzaBE9AgYNtFN87B5OOscqeWElj/uza8qVDmk7/U8JbqoONLbtqiLJ5LGRuqlw==} dependencies: - vue-demi: 0.14.5(vue@3.3.4) + vue-demi: 0.14.6(vue@3.3.10) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -2946,23 +3244,34 @@ packages: through: 2.3.8 dev: true - /acorn-jsx@5.3.2(acorn@8.8.2): + /acorn-jsx@5.3.2(acorn@8.10.0): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.8.2 + acorn: 8.10.0 /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} dev: true - /acorn@8.8.2: - resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + /acorn-walk@8.3.0: + resolution: {integrity: sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==} + engines: {node: '>=0.4.0'} + dev: true + + /acorn@8.10.0: + resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} engines: {node: '>=0.4.0'} hasBin: true + /acorn@8.11.2: + resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + /ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} dependencies: @@ -2980,23 +3289,23 @@ packages: uri-js: 4.4.1 dev: true - /algoliasearch@4.17.1: - resolution: {integrity: sha512-4GDQ1RhP2qUR3x8PevFRbEdqZqIARNViZYjgTJmA1T7wRNtFA3W4Aqc/RsODqa1J8IO/QDla5x4tWuUS8NV8wA==} + /algoliasearch@4.20.0: + resolution: {integrity: sha512-y+UHEjnOItoNy0bYO+WWmLWBlPwDjKHW6mNHrPi0NkuhpQOOEbrkwQH/wgKFDLh7qlKjzoKeiRtlpewDPDG23g==} dependencies: - '@algolia/cache-browser-local-storage': 4.17.1 - '@algolia/cache-common': 4.17.1 - '@algolia/cache-in-memory': 4.17.1 - '@algolia/client-account': 4.17.1 - '@algolia/client-analytics': 4.17.1 - '@algolia/client-common': 4.17.1 - '@algolia/client-personalization': 4.17.1 - '@algolia/client-search': 4.17.1 - '@algolia/logger-common': 4.17.1 - '@algolia/logger-console': 4.17.1 - '@algolia/requester-browser-xhr': 4.17.1 - '@algolia/requester-common': 4.17.1 - '@algolia/requester-node-http': 4.17.1 - '@algolia/transporter': 4.17.1 + '@algolia/cache-browser-local-storage': 4.20.0 + '@algolia/cache-common': 4.20.0 + '@algolia/cache-in-memory': 4.20.0 + '@algolia/client-account': 4.20.0 + '@algolia/client-analytics': 4.20.0 + '@algolia/client-common': 4.20.0 + '@algolia/client-personalization': 4.20.0 + '@algolia/client-search': 4.20.0 + '@algolia/logger-common': 4.20.0 + '@algolia/logger-console': 4.20.0 + '@algolia/requester-browser-xhr': 4.20.0 + '@algolia/requester-common': 4.20.0 + '@algolia/requester-node-http': 4.20.0 + '@algolia/transporter': 4.20.0 dev: true /ansi-colors@4.1.3: @@ -3090,6 +3399,19 @@ packages: es-shim-unscopables: 1.0.0 dev: true + /arraybuffer.prototype.slice@1.0.2: + resolution: {integrity: sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.0 + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + get-intrinsic: 1.2.2 + is-array-buffer: 3.0.2 + is-shared-array-buffer: 1.0.2 + dev: true + /arrify@1.0.1: resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} engines: {node: '>=0.10.0'} @@ -3099,8 +3421,8 @@ packages: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true - /async@3.2.4: - resolution: {integrity: sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==} + /async@3.2.5: + resolution: {integrity: sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==} dev: true /at-least-node@1.0.0: @@ -3113,38 +3435,38 @@ packages: engines: {node: '>= 0.4'} dev: true - /babel-plugin-polyfill-corejs2@0.4.3(@babel/core@7.22.1): - resolution: {integrity: sha512-bM3gHc337Dta490gg+/AseNB9L4YLHxq1nGKZZSHbhXv4aTYU2MD2cjza1Ru4S6975YLTaL1K8uJf6ukJhhmtw==} + /babel-plugin-polyfill-corejs2@0.4.6(@babel/core@7.23.5): + resolution: {integrity: sha512-jhHiWVZIlnPbEUKSSNb9YoWcQGdlTLq7z1GHL4AjFxaoOUMuuEVJ+Y4pAaQUGOGk93YsVCKPbqbfw3m0SM6H8Q==} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 dependencies: - '@babel/compat-data': 7.22.0 - '@babel/core': 7.22.1 - '@babel/helper-define-polyfill-provider': 0.4.0(@babel/core@7.22.1) - semver: 6.3.0 + '@babel/compat-data': 7.23.5 + '@babel/core': 7.23.5 + '@babel/helper-define-polyfill-provider': 0.4.3(@babel/core@7.23.5) + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true - /babel-plugin-polyfill-corejs3@0.8.1(@babel/core@7.22.1): - resolution: {integrity: sha512-ikFrZITKg1xH6pLND8zT14UPgjKHiGLqex7rGEZCH2EvhsneJaJPemmpQaIZV5AL03II+lXylw3UmddDK8RU5Q==} + /babel-plugin-polyfill-corejs3@0.8.6(@babel/core@7.23.5): + resolution: {integrity: sha512-leDIc4l4tUgU7str5BWLS2h8q2N4Nf6lGZP6UrNDxdtfF2g69eJ5L0H7S8A5Ln/arfFAfHor5InAdZuIOwZdgQ==} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-define-polyfill-provider': 0.4.0(@babel/core@7.22.1) - core-js-compat: 3.30.2 + '@babel/core': 7.23.5 + '@babel/helper-define-polyfill-provider': 0.4.3(@babel/core@7.23.5) + core-js-compat: 3.33.3 transitivePeerDependencies: - supports-color dev: true - /babel-plugin-polyfill-regenerator@0.5.0(@babel/core@7.22.1): - resolution: {integrity: sha512-hDJtKjMLVa7Z+LwnTCxoDLQj6wdc+B8dun7ayF2fYieI6OzfuvcLMB32ihJZ4UhCBwNYGl5bg/x/P9cMdnkc2g==} + /babel-plugin-polyfill-regenerator@0.5.3(@babel/core@7.23.5): + resolution: {integrity: sha512-8sHeDOmXC8csczMrYEOf0UTNa4yE2SxV5JGeT/LP1n0OYVDUUFPxG9vdk2AlDlIit4t+Kf0xCtpgXPBwnn/9pw==} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 dependencies: - '@babel/core': 7.22.1 - '@babel/helper-define-polyfill-provider': 0.4.0(@babel/core@7.22.1) + '@babel/core': 7.23.5 + '@babel/helper-define-polyfill-provider': 0.4.3(@babel/core@7.23.5) transitivePeerDependencies: - supports-color dev: true @@ -3159,18 +3481,22 @@ packages: is-windows: 1.0.2 dev: true + /big-integer@1.6.51: + resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==} + engines: {node: '>=0.6'} + dev: false + /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} dev: true - /blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - dev: true - - /body-scroll-lock@4.0.0-beta.0: - resolution: {integrity: sha512-a7tP5+0Mw3YlUJcGAKUqIBkYYGlYxk2fnCasq/FUph1hadxlTRjF+gAcZksxANnaMnALjxEddmSi/H3OR8ugcQ==} - dev: true + /bplist-parser@0.2.0: + resolution: {integrity: sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==} + engines: {node: '>= 5.10.0'} + dependencies: + big-integer: 1.6.51 + dev: false /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -3196,15 +3522,15 @@ packages: wcwidth: 1.0.1 dev: true - /browserslist@4.21.5: - resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} + /browserslist@4.22.2: + resolution: {integrity: sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001489 - electron-to-chromium: 1.4.409 - node-releases: 2.0.12 - update-browserslist-db: 1.0.11(browserslist@4.21.5) + caniuse-lite: 1.0.30001565 + electron-to-chromium: 1.4.601 + node-releases: 2.0.14 + update-browserslist-db: 1.0.13(browserslist@4.22.2) dev: true /buffer-from@1.1.2: @@ -3216,24 +3542,12 @@ packages: engines: {node: '>=6'} dev: true - /c8@7.13.0: - resolution: {integrity: sha512-/NL4hQTv1gBL6J6ei80zu3IiTrmePDKXKXOTLpHvcIWZTVYQlDhVWjjWvkhICylE8EwwnMVzDZugCvdx0/DIIA==} - engines: {node: '>=10.12.0'} - hasBin: true + /bundle-name@3.0.0: + resolution: {integrity: sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==} + engines: {node: '>=12'} dependencies: - '@bcoe/v8-coverage': 0.2.3 - '@istanbuljs/schema': 0.1.3 - find-up: 5.0.0 - foreground-child: 2.0.0 - istanbul-lib-coverage: 3.2.0 - istanbul-lib-report: 3.0.0 - istanbul-reports: 3.1.5 - rimraf: 3.0.2 - test-exclude: 6.0.0 - v8-to-istanbul: 9.1.0 - yargs: 16.2.0 - yargs-parser: 20.2.9 - dev: true + run-applescript: 5.0.0 + dev: false /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} @@ -3247,6 +3561,14 @@ packages: get-intrinsic: 1.2.1 dev: true + /call-bind@1.0.5: + resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==} + dependencies: + function-bind: 1.1.2 + get-intrinsic: 1.2.2 + set-function-length: 1.1.1 + dev: true + /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -3265,19 +3587,23 @@ packages: engines: {node: '>=6'} dev: true - /caniuse-lite@1.0.30001489: - resolution: {integrity: sha512-x1mgZEXK8jHIfAxm+xgdpHpk50IN3z3q3zP261/WS+uvePxW8izXuCu6AHz0lkuYTlATDehiZ/tNyYBdSQsOUQ==} + /caniuse-lite@1.0.30001565: + resolution: {integrity: sha512-xrE//a3O7TP0vaJ8ikzkD2c2NgcVUvsEe2IvFTntV4Yd1Z9FVzh+gW+enX96L0psrbaFMcVcH2l90xNuGDWc8w==} dev: true - /chai@4.3.7: - resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==} + /ccount@2.0.1: + resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} + dev: true + + /chai@4.3.10: + resolution: {integrity: sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==} engines: {node: '>=4'} dependencies: assertion-error: 1.1.0 - check-error: 1.0.2 + check-error: 1.0.3 deep-eql: 4.1.3 - get-func-name: 2.0.0 - loupe: 2.3.6 + get-func-name: 2.0.2 + loupe: 2.3.7 pathval: 1.1.1 type-detect: 4.0.8 dev: true @@ -3298,10 +3624,18 @@ packages: ansi-styles: 4.3.0 supports-color: 7.2.0 + /character-entities-html4@2.1.0: + resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} + dev: true + /character-entities-legacy@1.1.4: resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} dev: false + /character-entities-legacy@3.0.0: + resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} + dev: true + /character-entities@1.2.4: resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} dev: false @@ -3314,8 +3648,10 @@ packages: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} dev: true - /check-error@1.0.2: - resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} + /check-error@1.0.3: + resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + dependencies: + get-func-name: 2.0.2 dev: true /chokidar@3.5.3: @@ -3330,7 +3666,7 @@ packages: normalize-path: 3.0.0 readdirp: 3.6.0 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /ci-info@3.8.0: @@ -3346,14 +3682,6 @@ packages: wrap-ansi: 6.2.0 dev: true - /cliui@7.0.4: - resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - dev: true - /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -3368,10 +3696,6 @@ packages: engines: {node: '>=0.8'} dev: true - /code-block-writer@12.0.0: - resolution: {integrity: sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==} - dev: true - /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: @@ -3396,6 +3720,10 @@ packages: engines: {node: '>=0.1.90'} dev: true + /comma-separated-tokens@2.0.3: + resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} + dev: true + /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} dev: true @@ -3419,64 +3747,49 @@ packages: dot-prop: 5.3.0 dev: true + /computeds@0.0.1: + resolution: {integrity: sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==} + dev: true + /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - /concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.5.1 - well-known-symbols: 2.0.0 - dev: true - - /conventional-changelog-angular@5.0.13: - resolution: {integrity: sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==} - engines: {node: '>=10'} + /conventional-changelog-angular@6.0.0: + resolution: {integrity: sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==} + engines: {node: '>=14'} dependencies: compare-func: 2.0.0 - q: 1.5.1 dev: true - /conventional-changelog-conventionalcommits@5.0.0: - resolution: {integrity: sha512-lCDbA+ZqVFQGUj7h9QBKoIpLhl8iihkO0nCTyRNzuXtcd7ubODpYB04IFy31JloiJgG0Uovu8ot8oxRzn7Nwtw==} - engines: {node: '>=10'} + /conventional-changelog-conventionalcommits@7.0.2: + resolution: {integrity: sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==} + engines: {node: '>=16'} dependencies: compare-func: 2.0.0 - lodash: 4.17.21 - q: 1.5.1 dev: true - /conventional-commits-parser@3.2.4: - resolution: {integrity: sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==} - engines: {node: '>=10'} + /conventional-commits-parser@5.0.0: + resolution: {integrity: sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==} + engines: {node: '>=16'} hasBin: true dependencies: JSONStream: 1.3.5 - is-text-path: 1.0.1 - lodash: 4.17.21 - meow: 8.1.2 - split2: 3.2.2 - through2: 4.0.2 + is-text-path: 2.0.0 + meow: 12.1.1 + split2: 4.2.0 dev: true - /convert-source-map@1.9.0: - resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + /convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} dev: true - /core-js-compat@3.30.2: - resolution: {integrity: sha512-nriW1nuJjUgvkEjIot1Spwakz52V9YkYHZAQG6A1eCgC8AA1p0zngrQEP9R0+V6hji5XilWKG1Bd0YRppmGimA==} + /core-js-compat@3.33.3: + resolution: {integrity: sha512-cNzGqFsh3Ot+529GIXacjTJ7kegdt5fPXxCBVS1G0iaZpuo/tBz399ymceLJveQhFFZ8qThHiP3fzuoQjKN2ow==} dependencies: - browserslist: 4.21.5 + browserslist: 4.22.2 dev: true - /cosmiconfig-typescript-loader@4.3.0(@types/node@20.2.5)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.0.4): + /cosmiconfig-typescript-loader@4.3.0(@types/node@18.18.7)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.2.2): resolution: {integrity: sha512-NTxV1MFfZDLPiBMjxbHRwSh5LaLcPMwNdCutmnHJCKoVnlvldPWlllonKwrsRJ5pYZBIBGRWWU2tfvzxgeSW5Q==} engines: {node: '>=12', npm: '>=6'} peerDependencies: @@ -3485,10 +3798,10 @@ packages: ts-node: '>=10' typescript: '>=3' dependencies: - '@types/node': 20.2.5 + '@types/node': 18.18.7 cosmiconfig: 8.1.3 - ts-node: 10.9.1(@types/node@20.2.5)(typescript@5.0.4) - typescript: 5.0.4 + ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) + typescript: 5.2.2 dev: true /cosmiconfig@8.1.3: @@ -3564,11 +3877,8 @@ packages: engines: {node: '>=8'} dev: true - /date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - dependencies: - time-zone: 1.0.0 + /de-indent@1.0.2: + resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} dev: true /debug@4.3.4: @@ -3610,12 +3920,44 @@ packages: engines: {node: '>=0.10.0'} dev: true + /default-browser-id@3.0.0: + resolution: {integrity: sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==} + engines: {node: '>=12'} + dependencies: + bplist-parser: 0.2.0 + untildify: 4.0.0 + dev: false + + /default-browser@4.0.0: + resolution: {integrity: sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==} + engines: {node: '>=14.16'} + dependencies: + bundle-name: 3.0.0 + default-browser-id: 3.0.0 + execa: 7.2.0 + titleize: 3.0.0 + dev: false + /defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} dependencies: clone: 1.0.4 dev: true + /define-data-property@1.1.1: + resolution: {integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.2 + gopd: 1.0.1 + has-property-descriptors: 1.0.1 + dev: true + + /define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + dev: false + /define-properties@1.2.0: resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} engines: {node: '>= 0.4'} @@ -3624,11 +3966,36 @@ packages: object-keys: 1.1.1 dev: true + /define-properties@1.2.1: + resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.1 + has-property-descriptors: 1.0.1 + object-keys: 1.1.1 + dev: true + + /dequal@2.0.3: + resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} + engines: {node: '>=6'} + dev: true + /detect-indent@6.1.0: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} dev: true + /devlop@1.1.0: + resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + dependencies: + dequal: 2.0.3 + dev: true + + /diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + /diff@4.0.2: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} @@ -3653,8 +4020,8 @@ packages: is-obj: 2.0.0 dev: true - /dotenv@16.0.3: - resolution: {integrity: sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==} + /dotenv@16.3.1: + resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} engines: {node: '>=12'} dev: true @@ -3667,11 +4034,11 @@ packages: engines: {node: '>=0.10.0'} hasBin: true dependencies: - jake: 10.8.6 + jake: 10.8.7 dev: true - /electron-to-chromium@1.4.409: - resolution: {integrity: sha512-+2mRCBG9dR66sprh2dLuO6vr+O1xqHXvhmMglfut3OmfeUVRUho2nZYxxD9pG6G4PLDkZeqhlA/Gk6LpjVSHag==} + /electron-to-chromium@1.4.601: + resolution: {integrity: sha512-SpwUMDWe9tQu8JX5QCO1+p/hChAi9AE9UpoC3rcHVc+gdCGlbT3SGb5I1klgb952HRIyvt9wZhSz9bNBYz9swA==} dev: true /emoji-regex@8.0.0: @@ -3689,6 +4056,11 @@ packages: ansi-colors: 4.1.3 dev: true + /entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + dev: true + /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: @@ -3735,6 +4107,51 @@ packages: which-typed-array: 1.1.9 dev: true + /es-abstract@1.22.3: + resolution: {integrity: sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.0 + arraybuffer.prototype.slice: 1.0.2 + available-typed-arrays: 1.0.5 + call-bind: 1.0.5 + es-set-tostringtag: 2.0.2 + es-to-primitive: 1.2.1 + function.prototype.name: 1.1.6 + get-intrinsic: 1.2.2 + get-symbol-description: 1.0.0 + globalthis: 1.0.3 + gopd: 1.0.1 + has-property-descriptors: 1.0.1 + has-proto: 1.0.1 + has-symbols: 1.0.3 + hasown: 2.0.0 + internal-slot: 1.0.6 + is-array-buffer: 3.0.2 + is-callable: 1.2.7 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-typed-array: 1.1.12 + is-weakref: 1.0.2 + object-inspect: 1.13.1 + object-keys: 1.1.1 + object.assign: 4.1.5 + regexp.prototype.flags: 1.5.1 + safe-array-concat: 1.0.1 + safe-regex-test: 1.0.0 + string.prototype.trim: 1.2.8 + string.prototype.trimend: 1.0.7 + string.prototype.trimstart: 1.0.7 + typed-array-buffer: 1.0.0 + typed-array-byte-length: 1.0.0 + typed-array-byte-offset: 1.0.0 + typed-array-length: 1.0.4 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.13 + dev: true + /es-set-tostringtag@2.0.1: resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} engines: {node: '>= 0.4'} @@ -3744,6 +4161,15 @@ packages: has-tostringtag: 1.0.0 dev: true + /es-set-tostringtag@2.0.2: + resolution: {integrity: sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.2 + has-tostringtag: 1.0.0 + hasown: 2.0.0 + dev: true + /es-shim-unscopables@1.0.0: resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} dependencies: @@ -3759,34 +4185,34 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild@0.17.19: - resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} + /esbuild@0.19.5: + resolution: {integrity: sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.17.19 - '@esbuild/android-arm64': 0.17.19 - '@esbuild/android-x64': 0.17.19 - '@esbuild/darwin-arm64': 0.17.19 - '@esbuild/darwin-x64': 0.17.19 - '@esbuild/freebsd-arm64': 0.17.19 - '@esbuild/freebsd-x64': 0.17.19 - '@esbuild/linux-arm': 0.17.19 - '@esbuild/linux-arm64': 0.17.19 - '@esbuild/linux-ia32': 0.17.19 - '@esbuild/linux-loong64': 0.17.19 - '@esbuild/linux-mips64el': 0.17.19 - '@esbuild/linux-ppc64': 0.17.19 - '@esbuild/linux-riscv64': 0.17.19 - '@esbuild/linux-s390x': 0.17.19 - '@esbuild/linux-x64': 0.17.19 - '@esbuild/netbsd-x64': 0.17.19 - '@esbuild/openbsd-x64': 0.17.19 - '@esbuild/sunos-x64': 0.17.19 - '@esbuild/win32-arm64': 0.17.19 - '@esbuild/win32-ia32': 0.17.19 - '@esbuild/win32-x64': 0.17.19 + '@esbuild/android-arm': 0.19.5 + '@esbuild/android-arm64': 0.19.5 + '@esbuild/android-x64': 0.19.5 + '@esbuild/darwin-arm64': 0.19.5 + '@esbuild/darwin-x64': 0.19.5 + '@esbuild/freebsd-arm64': 0.19.5 + '@esbuild/freebsd-x64': 0.19.5 + '@esbuild/linux-arm': 0.19.5 + '@esbuild/linux-arm64': 0.19.5 + '@esbuild/linux-ia32': 0.19.5 + '@esbuild/linux-loong64': 0.19.5 + '@esbuild/linux-mips64el': 0.19.5 + '@esbuild/linux-ppc64': 0.19.5 + '@esbuild/linux-riscv64': 0.19.5 + '@esbuild/linux-s390x': 0.19.5 + '@esbuild/linux-x64': 0.19.5 + '@esbuild/netbsd-x64': 0.19.5 + '@esbuild/openbsd-x64': 0.19.5 + '@esbuild/sunos-x64': 0.19.5 + '@esbuild/win32-arm64': 0.19.5 + '@esbuild/win32-ia32': 0.19.5 + '@esbuild/win32-x64': 0.19.5 dev: true /escalade@3.1.1: @@ -3803,84 +4229,81 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - /eslint-config-prettier@8.8.0(eslint@8.41.0): - resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} + /eslint-config-prettier@9.0.0(eslint@8.52.0): + resolution: {integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.41.0 + eslint: 8.52.0 dev: false - /eslint-plugin-markdown@3.0.0(eslint@8.41.0): - resolution: {integrity: sha512-hRs5RUJGbeHDLfS7ELanT0e29Ocyssf/7kBM+p7KluY5AwngGkDf8Oyu4658/NZSGTTq05FZeWbkxXtbVyHPwg==} + /eslint-plugin-markdown@3.0.1(eslint@8.52.0): + resolution: {integrity: sha512-8rqoc148DWdGdmYF6WSQFT3uQ6PO7zXYgeBpHAOAakX/zpq+NvFYbDA/H7PYzHajwtmaOzAwfxyl++x0g1/N9A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - eslint: 8.41.0 + eslint: 8.52.0 mdast-util-from-markdown: 0.8.5 transitivePeerDependencies: - supports-color dev: false - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.41.0)(prettier@2.8.8): - resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} - engines: {node: '>=12.0.0'} + /eslint-plugin-prettier@5.0.1(eslint-config-prettier@9.0.0)(eslint@8.52.0)(prettier@3.0.3): + resolution: {integrity: sha512-m3u5RnR56asrwV/lDC4GHorlW75DsFfmUcjfCYylTUs85dBRnB7VM6xG8eCMJdeDRnppzmxZVf1GEPJvl1JmNg==} + engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - eslint: '>=7.28.0' + '@types/eslint': '>=8.0.0' + eslint: '>=8.0.0' eslint-config-prettier: '*' - prettier: '>=2.0.0' + prettier: '>=3.0.0' peerDependenciesMeta: + '@types/eslint': + optional: true eslint-config-prettier: optional: true dependencies: - eslint: 8.41.0 - eslint-config-prettier: 8.8.0(eslint@8.41.0) - prettier: 2.8.8 + eslint: 8.52.0 + eslint-config-prettier: 9.0.0(eslint@8.52.0) + prettier: 3.0.3 prettier-linter-helpers: 1.0.0 + synckit: 0.8.5 dev: false - /eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 - dev: false - - /eslint-scope@7.2.0: - resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} + /eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 - /eslint-visitor-keys@3.4.1: - resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - /eslint@8.41.0: - resolution: {integrity: sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q==} + /eslint@8.52.0: + resolution: {integrity: sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.41.0) - '@eslint-community/regexpp': 4.5.1 - '@eslint/eslintrc': 2.0.3 - '@eslint/js': 8.41.0 - '@humanwhocodes/config-array': 0.11.8 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) + '@eslint-community/regexpp': 4.9.1 + '@eslint/eslintrc': 2.1.2 + '@eslint/js': 8.52.0 + '@humanwhocodes/config-array': 0.11.13 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 debug: 4.3.4 doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.0 - eslint-visitor-keys: 3.4.1 - espree: 9.5.2 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -3890,7 +4313,6 @@ packages: globals: 13.20.0 graphemer: 1.4.0 ignore: 5.2.4 - import-fresh: 3.3.0 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 @@ -3900,20 +4322,19 @@ packages: lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 - optionator: 0.9.1 + optionator: 0.9.3 strip-ansi: 6.0.1 - strip-json-comments: 3.1.1 text-table: 0.2.0 transitivePeerDependencies: - supports-color - /espree@9.5.2: - resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==} + /espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.8.2 - acorn-jsx: 5.3.2(acorn@8.8.2) - eslint-visitor-keys: 3.4.1 + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) + eslint-visitor-keys: 3.4.3 /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} @@ -3933,11 +4354,6 @@ packages: dependencies: estraverse: 5.3.0 - /estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} - dev: false - /estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} @@ -3966,6 +4382,35 @@ packages: onetime: 5.1.2 signal-exit: 3.0.7 strip-final-newline: 2.0.0 + + /execa@7.2.0: + resolution: {integrity: sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==} + engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 4.3.1 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.1.0 + onetime: 6.0.0 + signal-exit: 3.0.7 + strip-final-newline: 3.0.0 + dev: false + + /execa@8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.1.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 dev: true /extendable-error@0.1.7: @@ -3988,12 +4433,18 @@ packages: resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==} dev: false - /fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - dev: true + /fast-glob@3.3.1: + resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 - /fast-glob@3.2.12: - resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} + /fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} dependencies: '@nodelib/fs.stat': 2.0.5 @@ -4001,6 +4452,7 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 + dev: true /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -4013,8 +4465,8 @@ packages: dependencies: reusify: 1.0.4 - /fflate@0.7.4: - resolution: {integrity: sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==} + /fflate@0.8.1: + resolution: {integrity: sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ==} dev: true /file-entry-cache@6.0.1: @@ -4067,10 +4519,14 @@ packages: /flatted@3.2.7: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} - /focus-trap@7.4.3: - resolution: {integrity: sha512-BgSSbK4GPnS2VbtZ50VtOv1Sti6DIkj3+LkVjiWMNjLeAp1SH1UlLx3ULu/DCu4vq5R4/uvTm+zrvsMsuYmGLg==} + /flatted@3.2.9: + resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} + dev: true + + /focus-trap@7.5.4: + resolution: {integrity: sha512-N7kHdlgsO/v+iD/dMoJKtsSqs5Dz/dXZVebRgJw23LDk+jMi/974zyiOYDziY2JPp8xivq9BmUGwIJMiuSBi7w==} dependencies: - tabbable: 6.1.2 + tabbable: 6.2.0 dev: true /for-each@0.3.3: @@ -4079,14 +4535,6 @@ packages: is-callable: 1.2.7 dev: true - /foreground-child@2.0.0: - resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==} - engines: {node: '>=8.0.0'} - dependencies: - cross-spawn: 7.0.3 - signal-exit: 3.0.7 - dev: true - /foreground-child@3.1.1: resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} engines: {node: '>=14'} @@ -4095,15 +4543,6 @@ packages: signal-exit: 4.0.2 dev: true - /fs-extra@10.1.0: - resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} - engines: {node: '>=12'} - dependencies: - graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.0 - dev: true - /fs-extra@11.1.1: resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} engines: {node: '>=14.14'} @@ -4138,14 +4577,14 @@ packages: at-least-node: 1.0.0 graceful-fs: 4.2.11 jsonfile: 6.1.0 - universalify: 2.0.0 + universalify: 2.0.1 dev: true /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true @@ -4156,6 +4595,10 @@ packages: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} dev: true + /function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + dev: true + /function.prototype.name@1.1.5: resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} engines: {node: '>= 0.4'} @@ -4166,6 +4609,16 @@ packages: functions-have-names: 1.2.3 dev: true + /function.prototype.name@1.1.6: + resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + functions-have-names: 1.2.3 + dev: true + /functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: true @@ -4180,8 +4633,8 @@ packages: engines: {node: 6.* || 8.* || >= 10.*} dev: true - /get-func-name@2.0.0: - resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} + /get-func-name@2.0.2: + resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} dev: true /get-intrinsic@1.2.1: @@ -4193,6 +4646,15 @@ packages: has-symbols: 1.0.3 dev: true + /get-intrinsic@1.2.2: + resolution: {integrity: sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==} + dependencies: + function-bind: 1.1.2 + has-proto: 1.0.1 + has-symbols: 1.0.3 + hasown: 2.0.0 + dev: true + /get-own-enumerable-property-symbols@3.0.2: resolution: {integrity: sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==} dev: true @@ -4200,6 +4662,10 @@ packages: /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + + /get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} dev: true /get-symbol-description@1.0.0: @@ -4234,16 +4700,16 @@ packages: dependencies: is-glob: 4.0.3 - /glob@10.2.6: - resolution: {integrity: sha512-U/rnDpXJGF414QQQZv5uVsabTVxMSwzS5CH0p3DRCIV6ownl4f7PzGnkGmvlum2wB+9RlJWJZ6ACU1INnBqiPA==} + /glob@10.3.10: + resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==} engines: {node: '>=16 || 14 >=14.17'} hasBin: true dependencies: foreground-child: 3.1.1 - jackspeak: 2.2.1 + jackspeak: 2.3.6 minimatch: 9.0.1 minipass: 6.0.2 - path-scurry: 1.9.2 + path-scurry: 1.10.1 dev: true /glob@7.2.3: @@ -4287,7 +4753,7 @@ packages: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 - fast-glob: 3.2.12 + fast-glob: 3.3.1 ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 @@ -4308,23 +4774,11 @@ packages: /grapheme-splitter@1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: true /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - /handlebars@4.7.7: - resolution: {integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==} - engines: {node: '>=0.4.7'} - hasBin: true - dependencies: - minimist: 1.2.8 - neo-async: 2.6.2 - source-map: 0.6.1 - wordwrap: 1.0.0 - optionalDependencies: - uglify-js: 3.17.4 - dev: true - /hard-rejection@2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} @@ -4349,6 +4803,12 @@ packages: get-intrinsic: 1.2.1 dev: true + /has-property-descriptors@1.0.1: + resolution: {integrity: sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==} + dependencies: + get-intrinsic: 1.2.2 + dev: true + /has-proto@1.0.1: resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} engines: {node: '>= 0.4'} @@ -4373,6 +4833,100 @@ packages: function-bind: 1.1.1 dev: true + /hasown@2.0.0: + resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} + engines: {node: '>= 0.4'} + dependencies: + function-bind: 1.1.2 + dev: true + + /hast-util-from-parse5@8.0.1: + resolution: {integrity: sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==} + dependencies: + '@types/hast': 3.0.3 + '@types/unist': 3.0.2 + devlop: 1.1.0 + hastscript: 8.0.0 + property-information: 6.4.0 + vfile: 6.0.1 + vfile-location: 5.0.2 + web-namespaces: 2.0.1 + dev: true + + /hast-util-parse-selector@4.0.0: + resolution: {integrity: sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==} + dependencies: + '@types/hast': 3.0.3 + dev: true + + /hast-util-raw@9.0.1: + resolution: {integrity: sha512-5m1gmba658Q+lO5uqL5YNGQWeh1MYWZbZmWrM5lncdcuiXuo5E2HT/CIOp0rLF8ksfSwiCVJ3twlgVRyTGThGA==} + dependencies: + '@types/hast': 3.0.3 + '@types/unist': 3.0.2 + '@ungap/structured-clone': 1.2.0 + hast-util-from-parse5: 8.0.1 + hast-util-to-parse5: 8.0.0 + html-void-elements: 3.0.0 + mdast-util-to-hast: 13.0.2 + parse5: 7.1.2 + unist-util-position: 5.0.0 + unist-util-visit: 5.0.0 + vfile: 6.0.1 + web-namespaces: 2.0.1 + zwitch: 2.0.4 + dev: true + + /hast-util-to-html@9.0.0: + resolution: {integrity: sha512-IVGhNgg7vANuUA2XKrT6sOIIPgaYZnmLx3l/CCOAK0PtgfoHrZwX7jCSYyFxHTrGmC6S9q8aQQekjp4JPZF+cw==} + dependencies: + '@types/hast': 3.0.3 + '@types/unist': 3.0.2 + ccount: 2.0.1 + comma-separated-tokens: 2.0.3 + hast-util-raw: 9.0.1 + hast-util-whitespace: 3.0.0 + html-void-elements: 3.0.0 + mdast-util-to-hast: 13.0.2 + property-information: 6.4.0 + space-separated-tokens: 2.0.2 + stringify-entities: 4.0.3 + zwitch: 2.0.4 + dev: true + + /hast-util-to-parse5@8.0.0: + resolution: {integrity: sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==} + dependencies: + '@types/hast': 3.0.3 + comma-separated-tokens: 2.0.3 + devlop: 1.1.0 + property-information: 6.4.0 + space-separated-tokens: 2.0.2 + web-namespaces: 2.0.1 + zwitch: 2.0.4 + dev: true + + /hast-util-whitespace@3.0.0: + resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} + dependencies: + '@types/hast': 3.0.3 + dev: true + + /hastscript@8.0.0: + resolution: {integrity: sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==} + dependencies: + '@types/hast': 3.0.3 + comma-separated-tokens: 2.0.3 + hast-util-parse-selector: 4.0.0 + property-information: 6.4.0 + space-separated-tokens: 2.0.2 + dev: true + + /he@1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + dev: true + /hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} dev: true @@ -4388,6 +4942,10 @@ packages: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} dev: true + /html-void-elements@3.0.0: + resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==} + dev: true + /human-id@1.0.2: resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} dev: true @@ -4395,6 +4953,15 @@ packages: /human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} + + /human-signals@4.3.1: + resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} + engines: {node: '>=14.18.0'} + dev: false + + /human-signals@5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} dev: true /husky@8.0.3: @@ -4465,6 +5032,15 @@ packages: side-channel: 1.0.4 dev: true + /internal-slot@1.0.6: + resolution: {integrity: sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.2 + hasown: 2.0.0 + side-channel: 1.0.4 + dev: true + /is-alphabetical@1.0.4: resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} dev: false @@ -4527,6 +5103,12 @@ packages: has: 1.0.3 dev: true + /is-core-module@2.13.1: + resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + dependencies: + hasown: 2.0.0 + dev: true + /is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} @@ -4538,6 +5120,18 @@ packages: resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} dev: false + /is-docker@2.2.1: + resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} + engines: {node: '>=8'} + hasBin: true + dev: false + + /is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + dev: false + /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -4557,6 +5151,14 @@ packages: resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} dev: false + /is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + dependencies: + is-docker: 3.0.0 + dev: false + /is-module@1.0.0: resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} dev: true @@ -4618,7 +5220,10 @@ packages: /is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} - dev: true + + /is-stream@3.0.0: + resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} /is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} @@ -4641,11 +5246,11 @@ packages: has-symbols: 1.0.3 dev: true - /is-text-path@1.0.1: - resolution: {integrity: sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==} - engines: {node: '>=0.10.0'} + /is-text-path@2.0.0: + resolution: {integrity: sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==} + engines: {node: '>=8'} dependencies: - text-extensions: 1.9.0 + text-extensions: 2.4.0 dev: true /is-typed-array@1.1.10: @@ -4659,6 +5264,13 @@ packages: has-tostringtag: 1.0.0 dev: true + /is-typed-array@1.1.12: + resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} + engines: {node: '>= 0.4'} + dependencies: + which-typed-array: 1.1.13 + dev: true + /is-weakref@1.0.2: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} dependencies: @@ -4670,33 +5282,55 @@ packages: engines: {node: '>=0.10.0'} dev: true + /is-wsl@2.2.0: + resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} + engines: {node: '>=8'} + dependencies: + is-docker: 2.2.1 + dev: false + + /isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + dev: true + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - /istanbul-lib-coverage@3.2.0: - resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} + /istanbul-lib-coverage@3.2.2: + resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} engines: {node: '>=8'} dev: true - /istanbul-lib-report@3.0.0: - resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} - engines: {node: '>=8'} + /istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} dependencies: - istanbul-lib-coverage: 3.2.0 - make-dir: 3.1.0 + istanbul-lib-coverage: 3.2.2 + make-dir: 4.0.0 supports-color: 7.2.0 dev: true - /istanbul-reports@3.1.5: - resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} + /istanbul-lib-source-maps@4.0.1: + resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} + engines: {node: '>=10'} + dependencies: + debug: 4.3.4 + istanbul-lib-coverage: 3.2.2 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + dev: true + + /istanbul-reports@3.1.6: + resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} engines: {node: '>=8'} dependencies: html-escaper: 2.0.2 - istanbul-lib-report: 3.0.0 + istanbul-lib-report: 3.0.1 dev: true - /jackspeak@2.2.1: - resolution: {integrity: sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==} + /jackspeak@2.3.6: + resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==} engines: {node: '>=14'} dependencies: '@isaacs/cliui': 8.0.2 @@ -4704,12 +5338,12 @@ packages: '@pkgjs/parseargs': 0.11.0 dev: true - /jake@10.8.6: - resolution: {integrity: sha512-G43Ub9IYEFfu72sua6rzooi8V8Gz2lkfk48rW20vEWCGizeaEPlKB1Kh8JIA84yQbiAEfqlPmSpGgCKKxH3rDA==} + /jake@10.8.7: + resolution: {integrity: sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==} engines: {node: '>=10'} hasBin: true dependencies: - async: 3.2.4 + async: 3.2.5 chalk: 4.1.2 filelist: 1.0.4 minimatch: 3.1.2 @@ -4719,7 +5353,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.15.11 + '@types/node': 18.18.7 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -4728,11 +5362,6 @@ packages: resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} dev: true - /js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - dev: true - /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: true @@ -4854,9 +5483,12 @@ packages: strip-bom: 3.0.0 dev: true - /local-pkg@0.4.3: - resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} + /local-pkg@0.5.0: + resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} engines: {node: '>=14'} + dependencies: + mlly: 1.4.2 + pkg-types: 1.0.3 dev: true /locate-path@5.0.0: @@ -4931,10 +5563,10 @@ packages: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true - /loupe@2.3.6: - resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} + /loupe@2.3.7: + resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} dependencies: - get-func-name: 2.0.0 + get-func-name: 2.0.2 dev: true /lru-cache@4.1.5: @@ -4971,24 +5603,25 @@ packages: sourcemap-codec: 1.4.8 dev: true - /magic-string@0.29.0: - resolution: {integrity: sha512-WcfidHrDjMY+eLjlU+8OvwREqHwpgCeKVBUpQ3OhYYuvfaYCUgcbuBzappNzZvg/v8onU3oQj+BYpkOJe9Iw4Q==} + /magic-string@0.30.5: + resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==} engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - /magic-string@0.30.0: - resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==} - engines: {node: '>=12'} + /magicast@0.3.2: + resolution: {integrity: sha512-Fjwkl6a0syt9TFN0JSYpOybxiMCkYNEeOTnOTNRbjphirLakznZXAqrXgj/7GG3D1dvETONNwrBfinvAbpunDg==} dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 + '@babel/parser': 7.23.5 + '@babel/types': 7.23.5 + source-map-js: 1.0.2 + dev: true - /make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} + /make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + engines: {node: '>=10'} dependencies: - semver: 6.3.0 + semver: 7.5.4 dev: true /make-error@1.3.6: @@ -5015,13 +5648,6 @@ packages: hasBin: true dev: true - /md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - dependencies: - blueimp-md5: 2.19.0 - dev: true - /mdast-util-from-markdown@0.8.5: resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} dependencies: @@ -5034,10 +5660,28 @@ packages: - supports-color dev: false + /mdast-util-to-hast@13.0.2: + resolution: {integrity: sha512-U5I+500EOOw9e3ZrclN3Is3fRpw8c19SMyNZlZ2IS+7vLsNzb2Om11VpIVOR+/0137GhZsFEF6YiKD5+0Hr2Og==} + dependencies: + '@types/hast': 3.0.3 + '@types/mdast': 4.0.3 + '@ungap/structured-clone': 1.2.0 + devlop: 1.1.0 + micromark-util-sanitize-uri: 2.0.0 + trim-lines: 3.0.1 + unist-util-position: 5.0.0 + unist-util-visit: 5.0.0 + dev: true + /mdast-util-to-string@2.0.0: resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} dev: false + /meow@12.1.1: + resolution: {integrity: sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==} + engines: {node: '>=16.10'} + dev: true + /meow@6.1.1: resolution: {integrity: sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==} engines: {node: '>=8'} @@ -5074,12 +5718,38 @@ packages: /merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - dev: true /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + /micromark-util-character@2.0.1: + resolution: {integrity: sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==} + dependencies: + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: true + + /micromark-util-encode@2.0.0: + resolution: {integrity: sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==} + dev: true + + /micromark-util-sanitize-uri@2.0.0: + resolution: {integrity: sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==} + dependencies: + micromark-util-character: 2.0.1 + micromark-util-encode: 2.0.0 + micromark-util-symbol: 2.0.0 + dev: true + + /micromark-util-symbol@2.0.0: + resolution: {integrity: sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==} + dev: true + + /micromark-util-types@2.0.0: + resolution: {integrity: sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==} + dev: true + /micromark@2.11.4: resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} dependencies: @@ -5099,7 +5769,10 @@ packages: /mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} - dev: true + + /mimic-fn@4.0.0: + resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} + engines: {node: '>=12'} /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} @@ -5118,15 +5791,15 @@ packages: brace-expansion: 2.0.1 dev: true - /minimatch@7.4.6: - resolution: {integrity: sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==} - engines: {node: '>=10'} + /minimatch@9.0.1: + resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} + engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 dev: true - /minimatch@9.0.1: - resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 @@ -5150,8 +5823,8 @@ packages: engines: {node: '>=16 || 14 >=14.17'} dev: true - /minisearch@6.1.0: - resolution: {integrity: sha512-PNxA/X8pWk+TiqPbsoIYH0GQ5Di7m6326/lwU/S4mlo4wGQddIcf/V//1f9TB0V4j59b57b+HZxt8h3iMROGvg==} + /minisearch@6.3.0: + resolution: {integrity: sha512-ihFnidEeU8iXzcVHy74dhkxh/dn8Dc08ERl0xwoMMGqp4+LvRSCgicb+zGqWthVokQKvCSxITlh3P08OzdTYCQ==} dev: true /mixme@0.5.9: @@ -5159,19 +5832,13 @@ packages: engines: {node: '>= 8.0.0'} dev: true - /mkdirp@2.1.6: - resolution: {integrity: sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==} - engines: {node: '>=10'} - hasBin: true - dev: true - - /mlly@1.3.0: - resolution: {integrity: sha512-HT5mcgIQKkOrZecOjOX3DJorTikWXwsBfpcr/MGBkhfWcjiqvnaL/9ppxvIUXfjT6xt4DVIAsN9fMUz1ev4bIw==} + /mlly@1.4.2: + resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==} dependencies: - acorn: 8.8.2 - pathe: 1.1.0 + acorn: 8.11.2 + pathe: 1.1.1 pkg-types: 1.0.3 - ufo: 1.1.2 + ufo: 1.3.1 dev: true /mrmime@1.0.1: @@ -5182,22 +5849,25 @@ packages: /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + /muggle-string@0.3.1: + resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==} + dev: true + /nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - - /natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} dev: false + /nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - /neo-async@2.6.2: - resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - dev: true - /node-fetch@2.6.7: resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} engines: {node: 4.x || >=6.0.0} @@ -5210,8 +5880,8 @@ packages: whatwg-url: 5.0.0 dev: true - /node-releases@2.0.12: - resolution: {integrity: sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==} + /node-releases@2.0.14: + resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} dev: true /normalize-package-data@2.5.0: @@ -5229,7 +5899,7 @@ packages: dependencies: hosted-git-info: 4.1.0 is-core-module: 2.12.1 - semver: 7.5.1 + semver: 7.5.4 validate-npm-package-license: 3.0.4 dev: true @@ -5243,12 +5913,21 @@ packages: engines: {node: '>=8'} dependencies: path-key: 3.1.1 - dev: true + + /npm-run-path@5.1.0: + resolution: {integrity: sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + path-key: 4.0.0 /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} dev: true + /object-inspect@1.13.1: + resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + dev: true + /object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} @@ -5264,6 +5943,16 @@ packages: object-keys: 1.1.1 dev: true + /object.assign@4.1.5: + resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: true + /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: @@ -5274,18 +5963,33 @@ packages: engines: {node: '>=6'} dependencies: mimic-fn: 2.1.0 - dev: true - /optionator@0.9.1: - resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} + /onetime@6.0.0: + resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} + engines: {node: '>=12'} + dependencies: + mimic-fn: 4.0.0 + + /open@9.1.0: + resolution: {integrity: sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==} + engines: {node: '>=14.16'} + dependencies: + default-browser: 4.0.0 + define-lazy-prop: 3.0.0 + is-inside-container: 1.0.0 + is-wsl: 2.2.0 + dev: false + + /optionator@0.9.3: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 deep-is: 0.1.4 fast-levenshtein: 2.0.6 levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 - word-wrap: 1.2.3 /os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} @@ -5316,9 +6020,9 @@ packages: dependencies: yocto-queue: 0.1.0 - /p-limit@4.0.0: - resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /p-limit@5.0.0: + resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==} + engines: {node: '>=18'} dependencies: yocto-queue: 1.0.0 dev: true @@ -5373,8 +6077,10 @@ packages: lines-and-columns: 1.2.4 dev: true - /path-browserify@1.0.1: - resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + /parse5@7.1.2: + resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} + dependencies: + entities: 4.5.0 dev: true /path-exists@4.0.0: @@ -5389,12 +6095,16 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + /path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true - /path-scurry@1.9.2: - resolution: {integrity: sha512-qSDLy2aGFPm8i4rsbHd4MNyTcrzHFsLQykrtbuGRknZZCBBVXSv2tSCDN2Cg6Rt/GFRw8GoW9y9Ecw5rIPG1sg==} + /path-scurry@1.10.1: + resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} engines: {node: '>=16 || 14 >=14.17'} dependencies: lru-cache: 9.1.1 @@ -5405,8 +6115,8 @@ packages: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} - /pathe@1.1.0: - resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==} + /pathe@1.1.1: + resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} dev: true /pathval@1.1.1: @@ -5436,17 +6146,27 @@ packages: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} dependencies: jsonc-parser: 3.2.0 - mlly: 1.3.0 - pathe: 1.1.0 + mlly: 1.4.2 + pathe: 1.1.1 dev: true - /postcss@8.4.23: - resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==} + /postcss@8.4.31: + resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.6 picocolors: 1.0.0 source-map-js: 1.0.2 + dev: false + + /postcss@8.4.32: + resolution: {integrity: sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true /preact@10.15.0: resolution: {integrity: sha512-nZSa8M2R2m1n7nJSBlzDpxRJaIsejrTO1vlFbdpFvyC8qM1iU+On2y0otfoUm6SRB5o0lF0CKDFxg6grEFU0iQ==} @@ -5477,24 +6197,34 @@ packages: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} hasBin: true + dev: true + + /prettier@3.0.3: + resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} + engines: {node: '>=14'} + hasBin: true /pretty-bytes@5.6.0: resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==} engines: {node: '>=6'} dev: true - /pretty-bytes@6.1.0: - resolution: {integrity: sha512-Rk753HI8f4uivXi4ZCIYdhmG1V+WKzvRMg/X+M42a6t7D07RcmopXJMDNk6N++7Bl75URRGsb40ruvg7Hcp2wQ==} + /pretty-bytes@6.1.1: + resolution: {integrity: sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==} engines: {node: ^14.13.1 || >=16.0.0} dev: true - /pretty-format@27.5.1: - resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + /pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - ansi-regex: 5.0.1 + '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 - react-is: 17.0.2 + react-is: 18.2.0 + dev: true + + /property-information@6.4.0: + resolution: {integrity: sha512-9t5qARVofg2xQqKtytzt+lZ4d1Qvj8t5B8fEwXK6qOfgRLgH/b13QlgEyDh033NOS31nXeFbYv7CLUDG1CeifQ==} dev: true /pseudomap@1.0.2: @@ -5505,9 +6235,9 @@ packages: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} - /q@1.5.1: - resolution: {integrity: sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==} - engines: {node: '>=0.6.0', teleport: '>=0.2.0'} + /punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} dev: true /queue-microtask@1.2.3: @@ -5524,8 +6254,8 @@ packages: safe-buffer: 5.2.1 dev: true - /react-is@17.0.2: - resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} + /react-is@18.2.0: + resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true /read-pkg-up@7.0.1: @@ -5581,8 +6311,8 @@ packages: strip-indent: 3.0.0 dev: true - /regenerate-unicode-properties@10.1.0: - resolution: {integrity: sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==} + /regenerate-unicode-properties@10.1.1: + resolution: {integrity: sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==} engines: {node: '>=4'} dependencies: regenerate: 1.4.2 @@ -5596,10 +6326,14 @@ packages: resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} dev: true - /regenerator-transform@0.15.1: - resolution: {integrity: sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==} + /regenerator-runtime@0.14.0: + resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==} + dev: true + + /regenerator-transform@0.15.2: + resolution: {integrity: sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==} dependencies: - '@babel/runtime': 7.22.0 + '@babel/runtime': 7.23.5 dev: true /regexp.prototype.flags@1.5.0: @@ -5611,13 +6345,22 @@ packages: functions-have-names: 1.2.3 dev: true + /regexp.prototype.flags@1.5.1: + resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + set-function-name: 2.0.1 + dev: true + /regexpu-core@5.3.2: resolution: {integrity: sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==} engines: {node: '>=4'} dependencies: '@babel/regjsgen': 0.8.0 regenerate: 1.4.2 - regenerate-unicode-properties: 10.1.0 + regenerate-unicode-properties: 10.1.1 regjsparser: 0.9.1 unicode-match-property-ecmascript: 2.0.0 unicode-match-property-value-ecmascript: 2.1.0 @@ -5663,7 +6406,7 @@ packages: /resolve@1.19.0: resolution: {integrity: sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==} dependencies: - is-core-module: 2.12.1 + is-core-module: 2.13.1 path-parse: 1.0.7 dev: true @@ -5676,6 +6419,15 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true + /resolve@1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true + dependencies: + is-core-module: 2.13.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -5686,12 +6438,12 @@ packages: dependencies: glob: 7.2.3 - /rimraf@5.0.1: - resolution: {integrity: sha512-OfFZdwtd3lZ+XZzYP/6gTACubwFcHdLRqS9UX3UwpU2dnGQYkPFISRwvM3w9IiB2w7bW5qGo/uAwE4SmXXSKvg==} + /rimraf@5.0.5: + resolution: {integrity: sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==} engines: {node: '>=14'} hasBin: true dependencies: - glob: 10.2.6 + glob: 10.3.10 dev: true /rollup-plugin-terser@7.0.2(rollup@2.79.1): @@ -5700,11 +6452,11 @@ packages: peerDependencies: rollup: ^2.0.0 dependencies: - '@babel/code-frame': 7.21.4 + '@babel/code-frame': 7.23.5 jest-worker: 26.6.2 rollup: 2.79.1 serialize-javascript: 4.0.0 - terser: 5.17.6 + terser: 5.24.0 dev: true /rollup@2.79.1: @@ -5712,22 +6464,51 @@ packages: engines: {node: '>=10.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true - /rollup@3.23.0: - resolution: {integrity: sha512-h31UlwEi7FHihLe1zbk+3Q7z1k/84rb9BSwmBSr/XjOCEaBJ2YyedQDuM0t/kfOS0IxM+vk1/zI9XxYj9V+NJQ==} - engines: {node: '>=14.18.0', npm: '>=8.0.0'} + /rollup@4.5.0: + resolution: {integrity: sha512-41xsWhzxqjMDASCxH5ibw1mXk+3c4TNI2UjKbLxe6iEzrSQnqOzmmK8/3mufCPbzHNJ2e04Fc1ddI35hHy+8zg==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 - dev: true + '@rollup/rollup-android-arm-eabi': 4.5.0 + '@rollup/rollup-android-arm64': 4.5.0 + '@rollup/rollup-darwin-arm64': 4.5.0 + '@rollup/rollup-darwin-x64': 4.5.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.5.0 + '@rollup/rollup-linux-arm64-gnu': 4.5.0 + '@rollup/rollup-linux-arm64-musl': 4.5.0 + '@rollup/rollup-linux-x64-gnu': 4.5.0 + '@rollup/rollup-linux-x64-musl': 4.5.0 + '@rollup/rollup-win32-arm64-msvc': 4.5.0 + '@rollup/rollup-win32-ia32-msvc': 4.5.0 + '@rollup/rollup-win32-x64-msvc': 4.5.0 + fsevents: 2.3.3 + dev: true + + /run-applescript@5.0.0: + resolution: {integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==} + engines: {node: '>=12'} + dependencies: + execa: 5.1.1 + dev: false /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 + /safe-array-concat@1.0.1: + resolution: {integrity: sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==} + engines: {node: '>=0.4'} + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + has-symbols: 1.0.3 + isarray: 2.0.5 + dev: true + /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: true @@ -5744,8 +6525,8 @@ packages: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true - /sass@1.62.1: - resolution: {integrity: sha512-NHpxIzN29MXvWiuswfc1W3I0N8SXBd8UR26WntmDlRYf0bSADnwnOjsyMZ3lMezSlArD33Vs3YFhp7dWvL770A==} + /sass@1.69.4: + resolution: {integrity: sha512-+qEreVhqAy8o++aQfCJwp0sklr2xyEzkm9Pp/Igu9wNPoe7EZEQ8X/MBvvXggI2ql607cxKg/RKOwDj6pp2XDA==} engines: {node: '>=14.0.0'} hasBin: true dependencies: @@ -5754,38 +6535,26 @@ packages: source-map-js: 1.0.2 dev: true - /sax@1.2.4: - resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==} - dev: true - - /semver@5.7.1: - resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} - hasBin: true - dev: true - - /semver@6.3.0: - resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} - hasBin: true + /sax@1.2.4: + resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==} dev: true - /semver@7.3.8: - resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} - engines: {node: '>=10'} + /search-insights@2.11.0: + resolution: {integrity: sha512-Uin2J8Bpm3xaZi9Y8QibSys6uJOFZ+REMrf42v20AA3FUDUrshKkMEP6liJbMAHCm71wO6ls4mwAf7a3gFVxLw==} + dev: true + + /semver@5.7.1: + resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} hasBin: true - dependencies: - lru-cache: 6.0.0 dev: true - /semver@7.5.0: - resolution: {integrity: sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==} - engines: {node: '>=10'} + /semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - dependencies: - lru-cache: 6.0.0 dev: true - /semver@7.5.1: - resolution: {integrity: sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==} + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} engines: {node: '>=10'} hasBin: true dependencies: @@ -5801,6 +6570,25 @@ packages: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} dev: true + /set-function-length@1.1.1: + resolution: {integrity: sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.1 + get-intrinsic: 1.2.2 + gopd: 1.0.1 + has-property-descriptors: 1.0.1 + dev: true + + /set-function-name@2.0.1: + resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.1 + functions-have-names: 1.2.3 + has-property-descriptors: 1.0.1 + dev: true + /shebang-command@1.2.0: resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} engines: {node: '>=0.10.0'} @@ -5832,6 +6620,18 @@ packages: vscode-textmate: 8.0.0 dev: true + /shikiji-transformers@0.7.6: + resolution: {integrity: sha512-yTp+7JMD/aXbV9ndn14eo9IK/UNt8iDsLNyqlOmCtcldlkqWE9T2YKAlOHOTVaeDfYWUWZa2EgSXb/CBfepBrw==} + dependencies: + shikiji: 0.7.6 + dev: true + + /shikiji@0.7.6: + resolution: {integrity: sha512-KzEtvSGQtBvfwVIB70kOmIfl/5rz1LC8j+tvlHXsJKAIdONNQvG1at7ivUUq3xUctqgO6fsO3AGomUSh0F+wsQ==} + dependencies: + hast-util-to-html: 9.0.0 + dev: true + /side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: @@ -5846,13 +6646,17 @@ packages: /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - dev: true /signal-exit@4.0.2: resolution: {integrity: sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==} engines: {node: '>=14'} dev: true + /signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + dev: true + /sirv@2.0.3: resolution: {integrity: sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA==} engines: {node: '>= 10'} @@ -5918,6 +6722,10 @@ packages: deprecated: Please use @jridgewell/sourcemap-codec instead dev: true + /space-separated-tokens@2.0.2: + resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} + dev: true + /spawndamnit@2.0.0: resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} dependencies: @@ -5953,6 +6761,11 @@ packages: readable-stream: 3.6.2 dev: true + /split2@4.2.0: + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + engines: {node: '>= 10.x'} + dev: true + /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true @@ -5961,8 +6774,8 @@ packages: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} dev: true - /std-env@3.3.3: - resolution: {integrity: sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==} + /std-env@3.5.0: + resolution: {integrity: sha512-JGUEaALvL0Mf6JCfYnJOTcobY+Nc7sG/TemDRBqCA0wEr4DER7zDchaaixTlmOxAjG1uRJmX82EQcxwTQTkqVA==} dev: true /stream-transform@2.1.3: @@ -5994,16 +6807,17 @@ packages: strip-ansi: 7.0.1 dev: true - /string.prototype.matchall@4.0.8: - resolution: {integrity: sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==} + /string.prototype.matchall@4.0.10: + resolution: {integrity: sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==} dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - get-intrinsic: 1.2.1 + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + get-intrinsic: 1.2.2 has-symbols: 1.0.3 - internal-slot: 1.0.5 - regexp.prototype.flags: 1.5.0 + internal-slot: 1.0.6 + regexp.prototype.flags: 1.5.1 + set-function-name: 2.0.1 side-channel: 1.0.4 dev: true @@ -6016,6 +6830,15 @@ packages: es-abstract: 1.21.2 dev: true + /string.prototype.trim@1.2.8: + resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + dev: true + /string.prototype.trimend@1.0.6: resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} dependencies: @@ -6024,6 +6847,14 @@ packages: es-abstract: 1.21.2 dev: true + /string.prototype.trimend@1.0.7: + resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + dev: true + /string.prototype.trimstart@1.0.6: resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} dependencies: @@ -6032,12 +6863,27 @@ packages: es-abstract: 1.21.2 dev: true + /string.prototype.trimstart@1.0.7: + resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + dev: true + /string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} dependencies: safe-buffer: 5.2.1 dev: true + /stringify-entities@4.0.3: + resolution: {integrity: sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==} + dependencies: + character-entities-html4: 2.1.0 + character-entities-legacy: 3.0.0 + dev: true + /stringify-object@3.3.0: resolution: {integrity: sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==} engines: {node: '>=4'} @@ -6073,7 +6919,10 @@ packages: /strip-final-newline@2.0.0: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} - dev: true + + /strip-final-newline@3.0.0: + resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} + engines: {node: '>=12'} /strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} @@ -6086,10 +6935,10 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - /strip-literal@1.0.1: - resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==} + /strip-literal@1.3.0: + resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} dependencies: - acorn: 8.8.2 + acorn: 8.11.2 dev: true /supports-color@5.5.0: @@ -6110,8 +6959,16 @@ packages: engines: {node: '>= 0.4'} dev: true - /tabbable@6.1.2: - resolution: {integrity: sha512-qCN98uP7i9z0fIS4amQ5zbGBOq+OSigYeGvPy7NDk8Y9yncqDZ9pRPgfsc2PJIVM9RrJj7GIfuRgmjoUU9zTHQ==} + /synckit@0.8.5: + resolution: {integrity: sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==} + engines: {node: ^14.18.0 || >=16.0.0} + dependencies: + '@pkgr/utils': 2.4.2 + tslib: 2.6.2 + dev: false + + /tabbable@6.2.0: + resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} dev: true /temp-dir@2.0.0: @@ -6134,13 +6991,13 @@ packages: engines: {node: '>=8'} dev: true - /terser@5.17.6: - resolution: {integrity: sha512-V8QHcs8YuyLkLHsJO5ucyff1ykrLVsR4dNnS//L5Y3NiSXpbK1J+WMVUs67eI0KTxs9JtHhgEQpXQVHlHI92DQ==} + /terser@5.24.0: + resolution: {integrity: sha512-ZpGR4Hy3+wBEzVEnHvstMvqpD/nABNelQn/z2r0fjVWGQsN3bpOLzQlqDxmb4CDZnXq5lpjnQ+mHQLAOpfM5iw==} engines: {node: '>=10'} hasBin: true dependencies: - '@jridgewell/source-map': 0.3.3 - acorn: 8.8.2 + '@jridgewell/source-map': 0.3.5 + acorn: 8.11.2 commander: 2.20.3 source-map-support: 0.5.21 dev: true @@ -6154,9 +7011,9 @@ packages: minimatch: 3.1.2 dev: true - /text-extensions@1.9.0: - resolution: {integrity: sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==} - engines: {node: '>=0.10'} + /text-extensions@2.4.0: + resolution: {integrity: sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==} + engines: {node: '>=8'} dev: true /text-table@0.2.0: @@ -6172,25 +7029,25 @@ packages: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} dev: true - /time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - dev: true - - /tinybench@2.5.0: - resolution: {integrity: sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==} + /tinybench@2.5.1: + resolution: {integrity: sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==} dev: true - /tinypool@0.5.0: - resolution: {integrity: sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==} + /tinypool@0.8.1: + resolution: {integrity: sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg==} engines: {node: '>=14.0.0'} dev: true - /tinyspy@2.1.0: - resolution: {integrity: sha512-7eORpyqImoOvkQJCSkL0d0mB4NHHIFAy4b1u8PHdDa7SjGS2njzl6/lyGoZLm+eyYEtlUmFGE0rFj66SWxZgQQ==} + /tinyspy@2.2.0: + resolution: {integrity: sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==} engines: {node: '>=14.0.0'} dev: true + /titleize@3.0.0: + resolution: {integrity: sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==} + engines: {node: '>=12'} + dev: false + /tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} @@ -6220,7 +7077,11 @@ packages: /tr46@1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} dependencies: - punycode: 2.3.0 + punycode: 2.3.1 + dev: true + + /trim-lines@3.0.1: + resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} dev: true /trim-newlines@3.0.1: @@ -6228,14 +7089,16 @@ packages: engines: {node: '>=8'} dev: true - /ts-morph@18.0.0: - resolution: {integrity: sha512-Kg5u0mk19PIIe4islUI/HWRvm9bC1lHejK4S0oh1zaZ77TMZAEmQC0sHQYiu2RgCQFZKXz1fMVi/7nOOeirznA==} + /ts-api-utils@1.0.3(typescript@5.2.2): + resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} + engines: {node: '>=16.13.0'} + peerDependencies: + typescript: '>=4.2.0' dependencies: - '@ts-morph/common': 0.19.0 - code-block-writer: 12.0.0 - dev: true + typescript: 5.2.2 + dev: false - /ts-node@10.9.1(@types/node@20.2.5)(typescript@5.0.4): + /ts-node@10.9.1(@types/node@18.18.7)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -6254,19 +7117,19 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.2.5 - acorn: 8.8.2 + '@types/node': 18.18.7 + acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.0.4 + typescript: 5.2.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true - /tsconfck@2.1.1(typescript@5.0.4): + /tsconfck@2.1.1(typescript@5.2.2): resolution: {integrity: sha512-ZPCkJBKASZBmBUNqGHmRhdhM8pJYDdOXp4nRgj/O0JwUwsMq50lCDRQP/M5GBNAA0elPrq4gAeu4dkaVCuKWww==} engines: {node: ^14.13.1 || ^16 || >=18} hasBin: true @@ -6276,21 +7139,11 @@ packages: typescript: optional: true dependencies: - typescript: 5.0.4 + typescript: 5.2.2 dev: true - /tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - dev: false - - /tsutils@3.21.0(typescript@5.0.4): - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' - dependencies: - tslib: 1.14.1 - typescript: 5.0.4 + /tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: false /tty-table@4.2.1: @@ -6307,65 +7160,64 @@ packages: yargs: 17.7.2 dev: true - /turbo-darwin-64@1.9.9: - resolution: {integrity: sha512-UDGM9E21eCDzF5t1F4rzrjwWutcup33e7ZjNJcW/mJDPorazZzqXGKEPIy9kXwKhamUUXfC7668r6ZuA1WXF2Q==} + /turbo-darwin-64@1.10.16: + resolution: {integrity: sha512-+Jk91FNcp9e9NCLYlvDDlp2HwEDp14F9N42IoW3dmHI5ZkGSXzalbhVcrx3DOox3QfiNUHxzWg4d7CnVNCuuMg==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64@1.9.9: - resolution: {integrity: sha512-VyfkXzTJpYLTAQ9krq2myyEq7RPObilpS04lgJ4OO1piq76RNmSpX9F/t9JCaY9Pj/4TL7i0d8PM7NGhwEA5Ag==} + /turbo-darwin-arm64@1.10.16: + resolution: {integrity: sha512-jqGpFZipIivkRp/i+jnL8npX0VssE6IAVNKtu573LXtssZdV/S+fRGYA16tI46xJGxSAivrZ/IcgZrV6Jk80bw==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-linux-64@1.9.9: - resolution: {integrity: sha512-Fu1MY29Odg8dHOqXcpIIGC3T63XLOGgnGfbobXMKdrC7JQDvtJv8TUCYciRsyknZYjyyKK1z6zKuYIiDjf3KeQ==} + /turbo-linux-64@1.10.16: + resolution: {integrity: sha512-PpqEZHwLoizQ6sTUvmImcRmACyRk9EWLXGlqceogPZsJ1jTRK3sfcF9fC2W56zkSIzuLEP07k5kl+ZxJd8JMcg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64@1.9.9: - resolution: {integrity: sha512-50LI8NafPuJxdnMCBeDdzgyt1cgjQG7FwkyY336v4e95WJPUVjrHdrKH6jYXhOUyrv9+jCJxwX1Yrg02t5yJ1g==} + /turbo-linux-arm64@1.10.16: + resolution: {integrity: sha512-TMjFYz8to1QE0fKVXCIvG/4giyfnmqcQIwjdNfJvKjBxn22PpbjeuFuQ5kNXshUTRaTJihFbuuCcb5OYFNx4uw==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-64@1.9.9: - resolution: {integrity: sha512-9IsTReoLmQl1IRsy3WExe2j2RKWXQyXujfJ4fXF+jp08KxjVF4/tYP2CIRJx/A7UP/7keBta27bZqzAjsmbSTA==} + /turbo-windows-64@1.10.16: + resolution: {integrity: sha512-+jsf68krs0N66FfC4/zZvioUap/Tq3sPFumnMV+EBo8jFdqs4yehd6+MxIwYTjSQLIcpH8KoNMB0gQYhJRLZzw==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64@1.9.9: - resolution: {integrity: sha512-CUu4hpeQo68JjDr0V0ygTQRLbS+/sNfdqEVV+Xz9136vpKn2WMQLAuUBVZV0Sp0S/7i+zGnplskT0fED+W46wQ==} + /turbo-windows-arm64@1.10.16: + resolution: {integrity: sha512-sKm3hcMM1bl0B3PLG4ifidicOGfoJmOEacM5JtgBkYM48ncMHjkHfFY7HrJHZHUnXM4l05RQTpLFoOl/uIo2HQ==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo@1.9.9: - resolution: {integrity: sha512-+ZS66LOT7ahKHxh6XrIdcmf2Yk9mNpAbPEj4iF2cs0cAeaDU3xLVPZFF0HbSho89Uxwhx7b5HBgPbdcjQTwQkg==} + /turbo@1.10.16: + resolution: {integrity: sha512-2CEaK4FIuSZiP83iFa9GqMTQhroW2QryckVqUydmg4tx78baftTOS0O+oDAhvo9r9Nit4xUEtC1RAHoqs6ZEtg==} hasBin: true - requiresBuild: true optionalDependencies: - turbo-darwin-64: 1.9.9 - turbo-darwin-arm64: 1.9.9 - turbo-linux-64: 1.9.9 - turbo-linux-arm64: 1.9.9 - turbo-windows-64: 1.9.9 - turbo-windows-arm64: 1.9.9 + turbo-darwin-64: 1.10.16 + turbo-darwin-arm64: 1.10.16 + turbo-linux-64: 1.10.16 + turbo-linux-arm64: 1.10.16 + turbo-windows-64: 1.10.16 + turbo-windows-arm64: 1.10.16 dev: true /type-check@0.4.0: @@ -6408,6 +7260,36 @@ packages: engines: {node: '>=8'} dev: true + /typed-array-buffer@1.0.0: + resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + is-typed-array: 1.1.12 + dev: true + + /typed-array-byte-length@1.0.0: + resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.12 + dev: true + + /typed-array-byte-offset@1.0.0: + resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.5 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.12 + dev: true + /typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} dependencies: @@ -6416,45 +7298,42 @@ packages: is-typed-array: 1.1.10 dev: true - /typedoc-plugin-markdown@3.15.3(typedoc@0.24.7): - resolution: {integrity: sha512-idntFYu3vfaY3eaD+w9DeRd0PmNGqGuNLKihPU9poxFGnATJYGn9dPtEhn2QrTdishFMg7jPXAhos+2T6YCWRQ==} + /typedoc-plugin-markdown@4.0.0-next.25(typedoc@0.25.2): + resolution: {integrity: sha512-OAucyztjyTcJhpyH8lK3r6W/9lGYxRnEphmphAi8CLL4pBqzA9A00OaOWt4ybkcFBnB8zNIZ4SGCz1sk9NBA3g==} peerDependencies: - typedoc: '>=0.24.0' + typedoc: '>=0.25.0' dependencies: - handlebars: 4.7.7 - typedoc: 0.24.7(typescript@5.0.4) + typedoc: 0.25.2(typescript@5.2.2) dev: true - /typedoc@0.24.7(typescript@5.0.4): - resolution: {integrity: sha512-zzfKDFIZADA+XRIp2rMzLe9xZ6pt12yQOhCr7cD7/PBTjhPmMyMvGrkZ2lPNJitg3Hj1SeiYFNzCsSDrlpxpKw==} - engines: {node: '>= 14.14'} + /typedoc@0.25.2(typescript@5.2.2): + resolution: {integrity: sha512-286F7BeATBiWe/qC4PCOCKlSTwfnsLbC/4cZ68oGBbvAqb9vV33quEOXx7q176OXotD+JdEerdQ1OZGJ818lnA==} + engines: {node: '>= 16'} hasBin: true peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x dependencies: lunr: 2.3.9 marked: 4.3.0 - minimatch: 9.0.1 + minimatch: 9.0.3 shiki: 0.14.2 - typescript: 5.0.4 + typescript: 5.2.2 dev: true /typescript@5.0.4: resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} engines: {node: '>=12.20'} hasBin: true - - /ufo@1.1.2: - resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} dev: true - /uglify-js@3.17.4: - resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} - engines: {node: '>=0.8.0'} + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + engines: {node: '>=14.17'} hasBin: true - requiresBuild: true + + /ufo@1.3.1: + resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} dev: true - optional: true /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} @@ -6465,6 +7344,9 @@ packages: which-boxed-primitive: 1.0.2 dev: true + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + /unicode-canonical-property-names-ecmascript@2.0.0: resolution: {integrity: sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==} engines: {node: '>=4'} @@ -6495,12 +7377,45 @@ packages: crypto-random-string: 2.0.0 dev: true + /unist-util-is@6.0.0: + resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} + dependencies: + '@types/unist': 3.0.2 + dev: true + + /unist-util-position@5.0.0: + resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==} + dependencies: + '@types/unist': 3.0.2 + dev: true + /unist-util-stringify-position@2.0.3: resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} dependencies: '@types/unist': 2.0.6 dev: false + /unist-util-stringify-position@4.0.0: + resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} + dependencies: + '@types/unist': 3.0.2 + dev: true + + /unist-util-visit-parents@6.0.1: + resolution: {integrity: sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==} + dependencies: + '@types/unist': 3.0.2 + unist-util-is: 6.0.0 + dev: true + + /unist-util-visit@5.0.0: + resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} + dependencies: + '@types/unist': 3.0.2 + unist-util-is: 6.0.0 + unist-util-visit-parents: 6.0.1 + dev: true + /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -6511,18 +7426,28 @@ packages: engines: {node: '>= 10.0.0'} dev: true + /universalify@2.0.1: + resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} + engines: {node: '>= 10.0.0'} + dev: true + + /untildify@4.0.0: + resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} + engines: {node: '>=8'} + dev: false + /upath@1.2.0: resolution: {integrity: sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==} engines: {node: '>=4'} dev: true - /update-browserslist-db@1.0.11(browserslist@4.21.5): - resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} + /update-browserslist-db@1.0.13(browserslist@4.22.2): + resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.21.5 + browserslist: 4.22.2 escalade: 3.1.1 picocolors: 1.0.0 dev: true @@ -6540,13 +7465,13 @@ packages: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true - /v8-to-istanbul@9.1.0: - resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} + /v8-to-istanbul@9.2.0: + resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} engines: {node: '>=10.12.0'} dependencies: - '@jridgewell/trace-mapping': 0.3.18 - '@types/istanbul-lib-coverage': 2.0.4 - convert-source-map: 1.9.0 + '@jridgewell/trace-mapping': 0.3.20 + '@types/istanbul-lib-coverage': 2.0.5 + convert-source-map: 2.0.0 dev: true /validate-npm-package-license@3.0.4: @@ -6561,20 +7486,42 @@ packages: engines: {node: '>= 0.10'} dev: true - /vite-node@0.31.1(@types/node@20.2.5): - resolution: {integrity: sha512-BajE/IsNQ6JyizPzu9zRgHrBwczkAs0erQf/JRpgTIESpKvNj9/Gd0vxX905klLkb0I0SJVCKbdrl5c6FnqYKA==} - engines: {node: '>=v14.18.0'} + /vfile-location@5.0.2: + resolution: {integrity: sha512-NXPYyxyBSH7zB5U6+3uDdd6Nybz6o6/od9rk8bp9H8GR3L+cm/fC0uUTbqBmUTnMCUDslAGBOIKNfvvb+gGlDg==} + dependencies: + '@types/unist': 3.0.2 + vfile: 6.0.1 + dev: true + + /vfile-message@4.0.2: + resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} + dependencies: + '@types/unist': 3.0.2 + unist-util-stringify-position: 4.0.0 + dev: true + + /vfile@6.0.1: + resolution: {integrity: sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==} + dependencies: + '@types/unist': 3.0.2 + unist-util-stringify-position: 4.0.0 + vfile-message: 4.0.2 + dev: true + + /vite-node@1.0.1(@types/node@18.18.7): + resolution: {integrity: sha512-Y2Jnz4cr2azsOMMYuVPrQkp3KMnS/0WV8ezZjCy4hU7O5mUHCAVOnFmoEvs1nvix/4mYm74Len8bYRWZJMNP6g==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true dependencies: cac: 6.7.14 debug: 4.3.4 - mlly: 1.3.0 - pathe: 1.1.0 + pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.3.9(@types/node@20.2.5) + vite: 5.0.5(@types/node@18.18.7)(sass@1.69.4) transitivePeerDependencies: - '@types/node' - less + - lightningcss - sass - stylus - sugarss @@ -6582,47 +7529,50 @@ packages: - terser dev: true - /vite-plugin-dts@2.3.0(vite@4.3.9): - resolution: {integrity: sha512-WbJgGtsStgQhdm3EosYmIdTGbag5YQpZ3HXWUAPCDyoXI5qN6EY0V7NXq0lAmnv9hVQsvh0htbYcg0Or5Db9JQ==} + /vite-plugin-dts@3.6.4(@types/node@18.18.7)(typescript@5.2.2)(vite@5.0.5): + resolution: {integrity: sha512-yOVhUI/kQhtS6lCXRYYLv2UUf9bftcwQK9ROxCX2ul17poLQs02ctWX7+vXB8GPRzH8VCK3jebEFtPqqijXx6w==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - vite: '>=2.9.0' + typescript: '*' + vite: '*' + peerDependenciesMeta: + vite: + optional: true dependencies: - '@babel/parser': 7.22.0 - '@microsoft/api-extractor': 7.35.0 - '@rollup/pluginutils': 5.0.2 - '@rushstack/node-core-library': 3.59.1 + '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) + '@rollup/pluginutils': 5.0.5 + '@vue/language-core': 1.8.21(typescript@5.2.2) debug: 4.3.4 - fast-glob: 3.2.12 - fs-extra: 10.1.0 kolorist: 1.8.0 - magic-string: 0.29.0 - ts-morph: 18.0.0 - vite: 4.3.9 + typescript: 5.2.2 + vite: 5.0.5(@types/node@18.18.7)(sass@1.69.4) + vue-tsc: 1.8.21(typescript@5.2.2) transitivePeerDependencies: - '@types/node' - rollup - supports-color dev: true - /vite-plugin-pwa@0.15.1(workbox-window@6.6.0): - resolution: {integrity: sha512-lJVzEYda/Y9AfwxFzX0rV+QCQ2+WdBoEGtR1RBZKWxvrJ4NWEH1VZaHOMyzvRiYhWQsi7aFhewsp1CDvN/R1Og==} + /vite-plugin-pwa@0.17.3(vite@5.0.5)(workbox-build@7.0.0)(workbox-window@7.0.0): + resolution: {integrity: sha512-ilOs0mGxIxKQN3FZYX8pys5DmY/wI9A6oojlY5rrd7mAxCVcSbtjDVAhm62C+3Ww6KQrNr/jmiRUCplC8AsaBw==} + engines: {node: '>=16.0.0'} peerDependencies: - vite: ^3.1.0 || ^4.0.0 - workbox-window: ^6.5.4 + vite: ^3.1.0 || ^4.0.0 || ^5.0.0 + workbox-build: ^7.0.0 + workbox-window: ^7.0.0 dependencies: debug: 4.3.4 - fast-glob: 3.2.12 - pretty-bytes: 6.1.0 - workbox-build: 6.6.0 - workbox-window: 6.6.0 + fast-glob: 3.3.2 + pretty-bytes: 6.1.1 + vite: 5.0.5(@types/node@18.18.7)(sass@1.69.4) + workbox-build: 7.0.0 + workbox-window: 7.0.0 transitivePeerDependencies: - - '@types/babel__core' - supports-color dev: true - /vite-tsconfig-paths@4.2.0(typescript@5.0.4)(vite@4.3.9): - resolution: {integrity: sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==} + /vite-tsconfig-paths@4.2.1(typescript@5.2.2)(vite@5.0.5): + resolution: {integrity: sha512-GNUI6ZgPqT3oervkvzU+qtys83+75N/OuDaQl7HmOqFTb0pjZsuARrRipsyJhJ3enqV8beI1xhGbToR4o78nSQ==} peerDependencies: vite: '*' peerDependenciesMeta: @@ -6631,20 +7581,21 @@ packages: dependencies: debug: 4.3.4 globrex: 0.1.2 - tsconfck: 2.1.1(typescript@5.0.4) - vite: 4.3.9 + tsconfck: 2.1.1(typescript@5.2.2) + vite: 5.0.5(@types/node@18.18.7)(sass@1.69.4) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.3.9: - resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} - engines: {node: ^14.18.0 || >=16.0.0} + /vite@5.0.5(@types/node@18.18.7)(sass@1.69.4): + resolution: {integrity: sha512-OekeWqR9Ls56f3zd4CaxzbbS11gqYkEiBtnWFFgYR2WV8oPJRRKq0mpskYy/XaoCL3L7VINDhqqOMNDiYdGvGg==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: - '@types/node': '>= 14' + '@types/node': ^18.0.0 || >=20.0.0 less: '*' + lightningcss: ^1.21.0 sass: '*' stylus: '*' sugarss: '*' @@ -6654,37 +7605,7 @@ packages: optional: true less: optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - dependencies: - esbuild: 0.17.19 - postcss: 8.4.23 - rollup: 3.23.0 - optionalDependencies: - fsevents: 2.3.2 - dev: true - - /vite@4.3.9(@types/node@18.13.0)(sass@1.62.1): - resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} - engines: {node: ^14.18.0 || >=16.0.0} - hasBin: true - peerDependencies: - '@types/node': '>= 14' - less: '*' - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: + lightningcss: optional: true sass: optional: true @@ -6695,65 +7616,42 @@ packages: terser: optional: true dependencies: - '@types/node': 18.13.0 - esbuild: 0.17.19 - postcss: 8.4.23 - rollup: 3.23.0 - sass: 1.62.1 + '@types/node': 18.18.7 + esbuild: 0.19.5 + postcss: 8.4.32 + rollup: 4.5.0 + sass: 1.69.4 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true - /vite@4.3.9(@types/node@20.2.5): - resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} - engines: {node: ^14.18.0 || >=16.0.0} + /vitepress@1.0.0-rc.31(@algolia/client-search@4.20.0)(@types/node@18.18.7)(sass@1.69.4)(search-insights@2.11.0)(typescript@5.2.2): + resolution: {integrity: sha512-ikH9pIjOOAbyoYAGBVfTz8TzuXp+UoWaIRMU4bw/oiTg8R65SbAaGKY84xx6TuL+f4VqUJ8lhzW82YyxSLvstA==} hasBin: true peerDependencies: - '@types/node': '>= 14' - less: '*' - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 + markdown-it-mathjax3: ^4.3.2 + postcss: ^8.4.31 peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: + markdown-it-mathjax3: optional: true - terser: + postcss: optional: true dependencies: - '@types/node': 20.2.5 - esbuild: 0.17.19 - postcss: 8.4.23 - rollup: 3.23.0 - optionalDependencies: - fsevents: 2.3.2 - dev: true - - /vitepress@1.0.0-beta.1(@types/node@18.13.0)(sass@1.62.1): - resolution: {integrity: sha512-V2yyCwQ+v9fh7rbnGDLp8M7vHa9sLElexXf/JHtBOsOwv7ed9wt1QI4WUagYgKR3TeoJT9v2s6f0UaQSne0EvQ==} - hasBin: true - dependencies: - '@docsearch/css': 3.4.0 - '@docsearch/js': 3.4.0 - '@vitejs/plugin-vue': 4.2.3(vite@4.3.9)(vue@3.3.4) - '@vue/devtools-api': 6.5.0 - '@vueuse/core': 10.1.2(vue@3.3.4) - '@vueuse/integrations': 10.1.2(focus-trap@7.4.3)(vue@3.3.4) - body-scroll-lock: 4.0.0-beta.0 - focus-trap: 7.4.3 + '@docsearch/css': 3.5.2 + '@docsearch/js': 3.5.2(@algolia/client-search@4.20.0)(search-insights@2.11.0) + '@types/markdown-it': 13.0.7 + '@vitejs/plugin-vue': 4.5.1(vite@5.0.5)(vue@3.3.10) + '@vue/devtools-api': 6.5.1 + '@vueuse/core': 10.7.0(vue@3.3.10) + '@vueuse/integrations': 10.7.0(focus-trap@7.5.4)(vue@3.3.10) + focus-trap: 7.5.4 mark.js: 8.11.1 - minisearch: 6.1.0 - shiki: 0.14.2 - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) - vue: 3.3.4 + minisearch: 6.3.0 + mrmime: 1.0.1 + shikiji: 0.7.6 + shikiji-transformers: 0.7.6 + vite: 5.0.5(@types/node@18.18.7)(sass@1.69.4) + vue: 3.3.10(typescript@5.2.2) transitivePeerDependencies: - '@algolia/client-search' - '@types/node' @@ -6767,46 +7665,49 @@ packages: - idb-keyval - jwt-decode - less + - lightningcss - nprogress - qrcode - react - react-dom - sass + - search-insights - sortablejs - stylus - sugarss - terser + - typescript - universal-cookie dev: true - /vitest-fetch-mock@0.2.2(vitest@0.31.1): + /vitest-fetch-mock@0.2.2(vitest@1.0.1): resolution: {integrity: sha512-XmH6QgTSjCWrqXoPREIdbj40T7i1xnGmAsTAgfckoO75W1IEHKR8hcPCQ7SO16RsdW1t85oUm6pcQRLeBgjVYQ==} engines: {node: '>=14.14.0'} peerDependencies: vitest: '>=0.16.0' dependencies: cross-fetch: 3.1.5 - vitest: 0.31.1(@vitest/ui@0.31.1) + vitest: 1.0.1(@types/node@18.18.7)(@vitest/ui@1.0.1) transitivePeerDependencies: - encoding dev: true - /vitest@0.31.1(@vitest/ui@0.31.1): - resolution: {integrity: sha512-/dOoOgzoFk/5pTvg1E65WVaobknWREN15+HF+0ucudo3dDG/vCZoXTQrjIfEaWvQXmqScwkRodrTbM/ScMpRcQ==} - engines: {node: '>=v14.18.0'} + /vitest@1.0.1(@types/node@18.18.7)(@vitest/ui@1.0.1): + resolution: {integrity: sha512-MHsOj079S28hDsvdDvyD1pRj4dcS51EC5Vbe0xvOYX+WryP8soiK2dm8oULi+oA/8Xa/h6GoJEMTmcmBy5YM+Q==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' - '@vitest/browser': '*' - '@vitest/ui': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': ^1.0.0 + '@vitest/ui': ^1.0.0 happy-dom: '*' jsdom: '*' - playwright: '*' - safaridriver: '*' - webdriverio: '*' peerDependenciesMeta: '@edge-runtime/vm': optional: true + '@types/node': + optional: true '@vitest/browser': optional: true '@vitest/ui': @@ -6815,41 +7716,33 @@ packages: optional: true jsdom: optional: true - playwright: - optional: true - safaridriver: - optional: true - webdriverio: - optional: true dependencies: - '@types/chai': 4.3.5 - '@types/chai-subset': 1.3.3 - '@types/node': 20.2.5 - '@vitest/expect': 0.31.1 - '@vitest/runner': 0.31.1 - '@vitest/snapshot': 0.31.1 - '@vitest/spy': 0.31.1 - '@vitest/ui': 0.31.1(vitest@0.31.1) - '@vitest/utils': 0.31.1 - acorn: 8.8.2 - acorn-walk: 8.2.0 + '@types/node': 18.18.7 + '@vitest/expect': 1.0.1 + '@vitest/runner': 1.0.1 + '@vitest/snapshot': 1.0.1 + '@vitest/spy': 1.0.1 + '@vitest/ui': 1.0.1(vitest@1.0.1) + '@vitest/utils': 1.0.1 + acorn-walk: 8.3.0 cac: 6.7.14 - chai: 4.3.7 - concordance: 5.0.4 + chai: 4.3.10 debug: 4.3.4 - local-pkg: 0.4.3 - magic-string: 0.30.0 - pathe: 1.1.0 + execa: 8.0.1 + local-pkg: 0.5.0 + magic-string: 0.30.5 + pathe: 1.1.1 picocolors: 1.0.0 - std-env: 3.3.3 - strip-literal: 1.0.1 - tinybench: 2.5.0 - tinypool: 0.5.0 - vite: 4.3.9(@types/node@20.2.5) - vite-node: 0.31.1(@types/node@20.2.5) + std-env: 3.5.0 + strip-literal: 1.3.0 + tinybench: 2.5.1 + tinypool: 0.8.1 + vite: 5.0.5(@types/node@18.18.7)(sass@1.69.4) + vite-node: 1.0.1(@types/node@18.18.7) why-is-node-running: 2.2.2 transitivePeerDependencies: - less + - lightningcss - sass - stylus - sugarss @@ -6865,8 +7758,8 @@ packages: resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} dev: true - /vue-demi@0.14.5(vue@3.3.4): - resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==} + /vue-demi@0.14.6(vue@3.3.10): + resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} engines: {node: '>=12'} hasBin: true requiresBuild: true @@ -6877,17 +7770,59 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.3.4 + vue: 3.3.10(typescript@5.2.2) + dev: true + + /vue-template-compiler@2.7.15: + resolution: {integrity: sha512-yQxjxMptBL7UAog00O8sANud99C6wJF+7kgbcwqkvA38vCGF7HWE66w0ZFnS/kX5gSoJr/PQ4/oS3Ne2pW37Og==} + dependencies: + de-indent: 1.0.2 + he: 1.2.0 + dev: true + + /vue-tsc@1.8.21(typescript@5.2.2): + resolution: {integrity: sha512-gc9e+opdeF0zKixaadXT5v2s+x+77oqpuza/vwqDhdDyEeLZUOmZaVeb9noZpkdhFaLq7t7ils/7lFU8E/Hgew==} + hasBin: true + peerDependencies: + typescript: '*' + dependencies: + '@volar/typescript': 1.10.5 + '@vue/language-core': 1.8.21(typescript@5.2.2) + semver: 7.5.4 + typescript: 5.2.2 + dev: true + + /vue@3.3.10(typescript@5.2.2): + resolution: {integrity: sha512-zg6SIXZdTBwiqCw/1p+m04VyHjLfwtjwz8N57sPaBhEex31ND0RYECVOC1YrRwMRmxFf5T1dabl6SGUbMKKuVw==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@vue/compiler-dom': 3.3.10 + '@vue/compiler-sfc': 3.3.10 + '@vue/runtime-dom': 3.3.10 + '@vue/server-renderer': 3.3.10(vue@3.3.10) + '@vue/shared': 3.3.10 + typescript: 5.2.2 dev: true - /vue@3.3.4: - resolution: {integrity: sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==} + /vue@3.3.7(typescript@5.2.2): + resolution: {integrity: sha512-YEMDia1ZTv1TeBbnu6VybatmSteGOS3A3YgfINOfraCbf85wdKHzscD6HSS/vB4GAtI7sa1XPX7HcQaJ1l24zA==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true dependencies: - '@vue/compiler-dom': 3.3.4 - '@vue/compiler-sfc': 3.3.4 - '@vue/runtime-dom': 3.3.4 - '@vue/server-renderer': 3.3.4(vue@3.3.4) - '@vue/shared': 3.3.4 + '@vue/compiler-dom': 3.3.7 + '@vue/compiler-sfc': 3.3.7 + '@vue/runtime-dom': 3.3.7 + '@vue/server-renderer': 3.3.7(vue@3.3.7) + '@vue/shared': 3.3.7 + typescript: 5.2.2 + dev: false /wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} @@ -6895,6 +7830,10 @@ packages: defaults: 1.0.4 dev: true + /web-namespaces@2.0.1: + resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==} + dev: true + /webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: true @@ -6903,11 +7842,6 @@ packages: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} dev: true - /well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - dev: true - /whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} dependencies: @@ -6945,6 +7879,17 @@ packages: path-exists: 4.0.0 dev: true + /which-typed-array@1.1.13: + resolution: {integrity: sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.5 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.0 + dev: true + /which-typed-array@1.1.9: resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} engines: {node: '>= 0.4'} @@ -6980,36 +7925,28 @@ packages: stackback: 0.0.2 dev: true - /word-wrap@1.2.3: - resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} - engines: {node: '>=0.10.0'} - - /wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} - dev: true - - /workbox-background-sync@6.6.0: - resolution: {integrity: sha512-jkf4ZdgOJxC9u2vztxLuPT/UjlH7m/nWRQ/MgGL0v8BJHoZdVGJd18Kck+a0e55wGXdqyHO+4IQTk0685g4MUw==} + /workbox-background-sync@7.0.0: + resolution: {integrity: sha512-S+m1+84gjdueM+jIKZ+I0Lx0BDHkk5Nu6a3kTVxP4fdj3gKouRNmhO8H290ybnJTOPfBDtTMXSQA/QLTvr7PeA==} dependencies: idb: 7.1.1 - workbox-core: 6.6.0 + workbox-core: 7.0.0 dev: true - /workbox-broadcast-update@6.6.0: - resolution: {integrity: sha512-nm+v6QmrIFaB/yokJmQ/93qIJ7n72NICxIwQwe5xsZiV2aI93MGGyEyzOzDPVz5THEr5rC3FJSsO3346cId64Q==} + /workbox-broadcast-update@7.0.0: + resolution: {integrity: sha512-oUuh4jzZrLySOo0tC0WoKiSg90bVAcnE98uW7F8GFiSOXnhogfNDGZelPJa+6KpGBO5+Qelv04Hqx2UD+BJqNQ==} dependencies: - workbox-core: 6.6.0 + workbox-core: 7.0.0 dev: true - /workbox-build@6.6.0: - resolution: {integrity: sha512-Tjf+gBwOTuGyZwMz2Nk/B13Fuyeo0Q84W++bebbVsfr9iLkDSo6j6PST8tET9HYA58mlRXwlMGpyWO8ETJiXdQ==} - engines: {node: '>=10.0.0'} + /workbox-build@7.0.0: + resolution: {integrity: sha512-CttE7WCYW9sZC+nUYhQg3WzzGPr4IHmrPnjKiu3AMXsiNQKx+l4hHl63WTrnicLmKEKHScWDH8xsGBdrYgtBzg==} + engines: {node: '>=16.0.0'} dependencies: '@apideck/better-ajv-errors': 0.3.6(ajv@8.12.0) - '@babel/core': 7.22.1 - '@babel/preset-env': 7.22.2(@babel/core@7.22.1) - '@babel/runtime': 7.22.0 - '@rollup/plugin-babel': 5.3.1(@babel/core@7.22.1)(rollup@2.79.1) + '@babel/core': 7.23.5 + '@babel/preset-env': 7.23.5(@babel/core@7.23.5) + '@babel/runtime': 7.23.5 + '@rollup/plugin-babel': 5.3.1(@babel/core@7.23.5)(rollup@2.79.1) '@rollup/plugin-node-resolve': 11.2.1(rollup@2.79.1) '@rollup/plugin-replace': 2.4.2(rollup@2.79.1) '@surma/rollup-plugin-off-main-thread': 2.2.3 @@ -7027,111 +7964,111 @@ packages: strip-comments: 2.0.1 tempy: 0.6.0 upath: 1.2.0 - workbox-background-sync: 6.6.0 - workbox-broadcast-update: 6.6.0 - workbox-cacheable-response: 6.6.0 - workbox-core: 6.6.0 - workbox-expiration: 6.6.0 - workbox-google-analytics: 6.6.0 - workbox-navigation-preload: 6.6.0 - workbox-precaching: 6.6.0 - workbox-range-requests: 6.6.0 - workbox-recipes: 6.6.0 - workbox-routing: 6.6.0 - workbox-strategies: 6.6.0 - workbox-streams: 6.6.0 - workbox-sw: 6.6.0 - workbox-window: 6.6.0 + workbox-background-sync: 7.0.0 + workbox-broadcast-update: 7.0.0 + workbox-cacheable-response: 7.0.0 + workbox-core: 7.0.0 + workbox-expiration: 7.0.0 + workbox-google-analytics: 7.0.0 + workbox-navigation-preload: 7.0.0 + workbox-precaching: 7.0.0 + workbox-range-requests: 7.0.0 + workbox-recipes: 7.0.0 + workbox-routing: 7.0.0 + workbox-strategies: 7.0.0 + workbox-streams: 7.0.0 + workbox-sw: 7.0.0 + workbox-window: 7.0.0 transitivePeerDependencies: - '@types/babel__core' - supports-color dev: true - /workbox-cacheable-response@6.6.0: - resolution: {integrity: sha512-JfhJUSQDwsF1Xv3EV1vWzSsCOZn4mQ38bWEBR3LdvOxSPgB65gAM6cS2CX8rkkKHRgiLrN7Wxoyu+TuH67kHrw==} + /workbox-cacheable-response@7.0.0: + resolution: {integrity: sha512-0lrtyGHn/LH8kKAJVOQfSu3/80WDc9Ma8ng0p2i/5HuUndGttH+mGMSvOskjOdFImLs2XZIimErp7tSOPmu/6g==} dependencies: - workbox-core: 6.6.0 + workbox-core: 7.0.0 dev: true - /workbox-core@6.6.0: - resolution: {integrity: sha512-GDtFRF7Yg3DD859PMbPAYPeJyg5gJYXuBQAC+wyrWuuXgpfoOrIQIvFRZnQ7+czTIQjIr1DhLEGFzZanAT/3bQ==} + /workbox-core@7.0.0: + resolution: {integrity: sha512-81JkAAZtfVP8darBpfRTovHg8DGAVrKFgHpOArZbdFd78VqHr5Iw65f2guwjE2NlCFbPFDoez3D3/6ZvhI/rwQ==} dev: true - /workbox-expiration@6.6.0: - resolution: {integrity: sha512-baplYXcDHbe8vAo7GYvyAmlS4f6998Jff513L4XvlzAOxcl8F620O91guoJ5EOf5qeXG4cGdNZHkkVAPouFCpw==} + /workbox-expiration@7.0.0: + resolution: {integrity: sha512-MLK+fogW+pC3IWU9SFE+FRStvDVutwJMR5if1g7oBJx3qwmO69BNoJQVaMXq41R0gg3MzxVfwOGKx3i9P6sOLQ==} dependencies: idb: 7.1.1 - workbox-core: 6.6.0 + workbox-core: 7.0.0 dev: true - /workbox-google-analytics@6.6.0: - resolution: {integrity: sha512-p4DJa6OldXWd6M9zRl0H6vB9lkrmqYFkRQ2xEiNdBFp9U0LhsGO7hsBscVEyH9H2/3eZZt8c97NB2FD9U2NJ+Q==} + /workbox-google-analytics@7.0.0: + resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==} dependencies: - workbox-background-sync: 6.6.0 - workbox-core: 6.6.0 - workbox-routing: 6.6.0 - workbox-strategies: 6.6.0 + workbox-background-sync: 7.0.0 + workbox-core: 7.0.0 + workbox-routing: 7.0.0 + workbox-strategies: 7.0.0 dev: true - /workbox-navigation-preload@6.6.0: - resolution: {integrity: sha512-utNEWG+uOfXdaZmvhshrh7KzhDu/1iMHyQOV6Aqup8Mm78D286ugu5k9MFD9SzBT5TcwgwSORVvInaXWbvKz9Q==} + /workbox-navigation-preload@7.0.0: + resolution: {integrity: sha512-juWCSrxo/fiMz3RsvDspeSLGmbgC0U9tKqcUPZBCf35s64wlaLXyn2KdHHXVQrb2cqF7I0Hc9siQalainmnXJA==} dependencies: - workbox-core: 6.6.0 + workbox-core: 7.0.0 dev: true - /workbox-precaching@6.6.0: - resolution: {integrity: sha512-eYu/7MqtRZN1IDttl/UQcSZFkHP7dnvr/X3Vn6Iw6OsPMruQHiVjjomDFCNtd8k2RdjLs0xiz9nq+t3YVBcWPw==} + /workbox-precaching@7.0.0: + resolution: {integrity: sha512-EC0vol623LJqTJo1mkhD9DZmMP604vHqni3EohhQVwhJlTgyKyOkMrZNy5/QHfOby+39xqC01gv4LjOm4HSfnA==} dependencies: - workbox-core: 6.6.0 - workbox-routing: 6.6.0 - workbox-strategies: 6.6.0 + workbox-core: 7.0.0 + workbox-routing: 7.0.0 + workbox-strategies: 7.0.0 dev: true - /workbox-range-requests@6.6.0: - resolution: {integrity: sha512-V3aICz5fLGq5DpSYEU8LxeXvsT//mRWzKrfBOIxzIdQnV/Wj7R+LyJVTczi4CQ4NwKhAaBVaSujI1cEjXW+hTw==} + /workbox-range-requests@7.0.0: + resolution: {integrity: sha512-SxAzoVl9j/zRU9OT5+IQs7pbJBOUOlriB8Gn9YMvi38BNZRbM+RvkujHMo8FOe9IWrqqwYgDFBfv6sk76I1yaQ==} dependencies: - workbox-core: 6.6.0 + workbox-core: 7.0.0 dev: true - /workbox-recipes@6.6.0: - resolution: {integrity: sha512-TFi3kTgYw73t5tg73yPVqQC8QQjxJSeqjXRO4ouE/CeypmP2O/xqmB/ZFBBQazLTPxILUQ0b8aeh0IuxVn9a6A==} + /workbox-recipes@7.0.0: + resolution: {integrity: sha512-DntcK9wuG3rYQOONWC0PejxYYIDHyWWZB/ueTbOUDQgefaeIj1kJ7pdP3LZV2lfrj8XXXBWt+JDRSw1lLLOnww==} dependencies: - workbox-cacheable-response: 6.6.0 - workbox-core: 6.6.0 - workbox-expiration: 6.6.0 - workbox-precaching: 6.6.0 - workbox-routing: 6.6.0 - workbox-strategies: 6.6.0 + workbox-cacheable-response: 7.0.0 + workbox-core: 7.0.0 + workbox-expiration: 7.0.0 + workbox-precaching: 7.0.0 + workbox-routing: 7.0.0 + workbox-strategies: 7.0.0 dev: true - /workbox-routing@6.6.0: - resolution: {integrity: sha512-x8gdN7VDBiLC03izAZRfU+WKUXJnbqt6PG9Uh0XuPRzJPpZGLKce/FkOX95dWHRpOHWLEq8RXzjW0O+POSkKvw==} + /workbox-routing@7.0.0: + resolution: {integrity: sha512-8YxLr3xvqidnbVeGyRGkaV4YdlKkn5qZ1LfEePW3dq+ydE73hUUJJuLmGEykW3fMX8x8mNdL0XrWgotcuZjIvA==} dependencies: - workbox-core: 6.6.0 + workbox-core: 7.0.0 dev: true - /workbox-strategies@6.6.0: - resolution: {integrity: sha512-eC07XGuINAKUWDnZeIPdRdVja4JQtTuc35TZ8SwMb1ztjp7Ddq2CJ4yqLvWzFWGlYI7CG/YGqaETntTxBGdKgQ==} + /workbox-strategies@7.0.0: + resolution: {integrity: sha512-dg3qJU7tR/Gcd/XXOOo7x9QoCI9nk74JopaJaYAQ+ugLi57gPsXycVdBnYbayVj34m6Y8ppPwIuecrzkpBVwbA==} dependencies: - workbox-core: 6.6.0 + workbox-core: 7.0.0 dev: true - /workbox-streams@6.6.0: - resolution: {integrity: sha512-rfMJLVvwuED09CnH1RnIep7L9+mj4ufkTyDPVaXPKlhi9+0czCu+SJggWCIFbPpJaAZmp2iyVGLqS3RUmY3fxg==} + /workbox-streams@7.0.0: + resolution: {integrity: sha512-moVsh+5to//l6IERWceYKGiftc+prNnqOp2sgALJJFbnNVpTXzKISlTIsrWY+ogMqt+x1oMazIdHj25kBSq/HQ==} dependencies: - workbox-core: 6.6.0 - workbox-routing: 6.6.0 + workbox-core: 7.0.0 + workbox-routing: 7.0.0 dev: true - /workbox-sw@6.6.0: - resolution: {integrity: sha512-R2IkwDokbtHUE4Kus8pKO5+VkPHD2oqTgl+XJwh4zbF1HyjAbgNmK/FneZHVU7p03XUt9ICfuGDYISWG9qV/CQ==} + /workbox-sw@7.0.0: + resolution: {integrity: sha512-SWfEouQfjRiZ7GNABzHUKUyj8pCoe+RwjfOIajcx6J5mtgKkN+t8UToHnpaJL5UVVOf5YhJh+OHhbVNIHe+LVA==} dev: true - /workbox-window@6.6.0: - resolution: {integrity: sha512-L4N9+vka17d16geaJXXRjENLFldvkWy7JyGxElRD0JvBxvFEd8LOhr+uXCcar/NzAmIBRv9EZ+M+Qr4mOoBITw==} + /workbox-window@7.0.0: + resolution: {integrity: sha512-j7P/bsAWE/a7sxqTzXo3P2ALb1reTfZdvVp6OJ/uLr/C2kZAMvjeWGm8V4htQhor7DOvYg0sSbFN2+flT5U0qA==} dependencies: '@types/trusted-types': 2.0.3 - workbox-core: 6.6.0 + workbox-core: 7.0.0 dev: true /wrap-ansi@6.2.0: @@ -7219,19 +8156,6 @@ packages: yargs-parser: 18.1.3 dev: true - /yargs@16.2.0: - resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} - engines: {node: '>=10'} - dependencies: - cliui: 7.0.4 - escalade: 3.1.1 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 20.2.9 - dev: true - /yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} @@ -7270,3 +8194,7 @@ packages: optionalDependencies: commander: 9.5.0 dev: true + + /zwitch@2.0.4: + resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} + dev: true diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 3208488d..bb19cde2 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,5 +1,6 @@ packages: - - 'apps/*' - - 'config/*' - - 'packages/*' - - '!**/test/**' + - "apps/*" + - "config/*" + - "examples/*" + - "packages/*" + - "!**/test/**"